From owner-dev-commits-src-all@freebsd.org Mon Feb 1 01:53: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 37A1B4EED89; Mon, 1 Feb 2021 01:53: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 4DTWFF0sBNz3CmD; Mon, 1 Feb 2021 01:53: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 1035C13214; Mon, 1 Feb 2021 01:53: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 1111rajt051410; Mon, 1 Feb 2021 01:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1111ra7U051408; Mon, 1 Feb 2021 01:53:36 GMT (envelope-from git) Date: Mon, 1 Feb 2021 01:53:36 GMT Message-Id: <202102010153.1111ra7U051408@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: 3f185aacc58b - stable/13 - Decode NFIT Platform Capabilities. 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: 3f185aacc58bc21fee050c0a5049894ca4967a68 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:53:37 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=3f185aacc58bc21fee050c0a5049894ca4967a68 commit 3f185aacc58bc21fee050c0a5049894ca4967a68 Author: Alexander Motin AuthorDate: 2021-01-25 21:08:06 +0000 Commit: Alexander Motin CommitDate: 2021-02-01 01:53:23 +0000 Decode NFIT Platform Capabilities. (cherry picked from commit 1b109c69ed625ebf292c1d16f7a3efcab96722e5) --- usr.sbin/acpi/acpidump/acpi.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 27fe1de0a219..c573c02b7f92 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1562,7 +1562,8 @@ static const char *nfit_types[] = { [ACPI_NFIT_TYPE_SMBIOS] = "SMBIOS", [ACPI_NFIT_TYPE_CONTROL_REGION] = "Control Region", [ACPI_NFIT_TYPE_DATA_REGION] = "Data Region", - [ACPI_NFIT_TYPE_FLUSH_ADDRESS] = "Flush Address" + [ACPI_NFIT_TYPE_FLUSH_ADDRESS] = "Flush Address", + [ACPI_NFIT_TYPE_CAPABILITIES] = "Platform Capabilities" }; @@ -1579,6 +1580,7 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) ACPI_NFIT_CONTROL_REGION *ctlreg; ACPI_NFIT_DATA_REGION *datareg; ACPI_NFIT_FLUSH_ADDRESS *fladdr; + ACPI_NFIT_CAPABILITIES *caps; if (nfit->Type < nitems(nfit_types)) printf("\tType=%s\n", nfit_types[nfit->Type]); @@ -1709,6 +1711,20 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) printf("\tHintCount=%u\n", (u_int)fladdr->HintCount); /* XXX fladdr->HintAddress[i] output is not supported */ break; + case ACPI_NFIT_TYPE_CAPABILITIES: + caps = (ACPI_NFIT_CAPABILITIES *)nfit; + printf("\tHighestCapability=%u\n", (u_int)caps->HighestCapability); + +#define PRINTFLAG(var, flag) printflag((var), ACPI_NFIT_CAPABILITY_## flag, #flag) + + printf("\tCapabilities="); + PRINTFLAG(caps->Capabilities, CACHE_FLUSH); + PRINTFLAG(caps->Capabilities, MEM_FLUSH); + PRINTFLAG(caps->Capabilities, MEM_MIRRORING); + PRINTFLAG_END(); + +#undef PRINTFLAG + break; } } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 01: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 2BB8C4EF51A; Mon, 1 Feb 2021 01: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 4DTWFp0f1pz3D3p; Mon, 1 Feb 2021 01: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 08F6612BEE; Mon, 1 Feb 2021 01: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 1111s5oZ051539; Mon, 1 Feb 2021 01: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 1111s5Yu051538; Mon, 1 Feb 2021 01:54:05 GMT (envelope-from git) Date: Mon, 1 Feb 2021 01:54:05 GMT Message-Id: <202102010154.1111s5Yu051538@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: 0f763fade1af - stable/12 - Decode NFIT Platform Capabilities. 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: 0f763fade1af150b0c977c3c626fa1c38856956b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:54:06 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=0f763fade1af150b0c977c3c626fa1c38856956b commit 0f763fade1af150b0c977c3c626fa1c38856956b Author: Alexander Motin AuthorDate: 2021-01-25 21:08:06 +0000 Commit: Alexander Motin CommitDate: 2021-02-01 01:53:57 +0000 Decode NFIT Platform Capabilities. (cherry picked from commit 1b109c69ed625ebf292c1d16f7a3efcab96722e5) --- usr.sbin/acpi/acpidump/acpi.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 61bdad11eb17..f0ba4ee73e84 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1556,7 +1556,8 @@ static const char *nfit_types[] = { [ACPI_NFIT_TYPE_SMBIOS] = "SMBIOS", [ACPI_NFIT_TYPE_CONTROL_REGION] = "Control Region", [ACPI_NFIT_TYPE_DATA_REGION] = "Data Region", - [ACPI_NFIT_TYPE_FLUSH_ADDRESS] = "Flush Address" + [ACPI_NFIT_TYPE_FLUSH_ADDRESS] = "Flush Address", + [ACPI_NFIT_TYPE_CAPABILITIES] = "Platform Capabilities" }; @@ -1573,6 +1574,7 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) ACPI_NFIT_CONTROL_REGION *ctlreg; ACPI_NFIT_DATA_REGION *datareg; ACPI_NFIT_FLUSH_ADDRESS *fladdr; + ACPI_NFIT_CAPABILITIES *caps; if (nfit->Type < nitems(nfit_types)) printf("\tType=%s\n", nfit_types[nfit->Type]); @@ -1703,6 +1705,20 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) printf("\tHintCount=%u\n", (u_int)fladdr->HintCount); /* XXX fladdr->HintAddress[i] output is not supported */ break; + case ACPI_NFIT_TYPE_CAPABILITIES: + caps = (ACPI_NFIT_CAPABILITIES *)nfit; + printf("\tHighestCapability=%u\n", (u_int)caps->HighestCapability); + +#define PRINTFLAG(var, flag) printflag((var), ACPI_NFIT_CAPABILITY_## flag, #flag) + + printf("\tCapabilities="); + PRINTFLAG(caps->Capabilities, CACHE_FLUSH); + PRINTFLAG(caps->Capabilities, MEM_FLUSH); + PRINTFLAG(caps->Capabilities, MEM_MIRRORING); + PRINTFLAG_END(); + +#undef PRINTFLAG + break; } } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 05:02: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 419CF4F872F; Mon, 1 Feb 2021 05:02:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (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 4DTbR60r64z3jBv; Mon, 1 Feb 2021 05:02:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x432.google.com with SMTP id 7so15157008wrz.0; Sun, 31 Jan 2021 21:02:25 -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=GDPRJ6jy/PSlUOykqXLo0BG9UpoAFHbEQDe8G+sN4ak=; b=XbBfiqe0GxEck3HY6NusRoKORQ+EpfuzgDwtgAqzAkctkfYXM31THXiT668Cy/F8rv mgKZr+tyefQIZ2uYUMIMiSQt4deJoqfACnFXN9DXdNO+0QhK2IFJjcwt1Eofm840t+eN 9hfY5stUPDayXSzHtt7tTa02DrS8ngMbjEiLMWgITWuGPwe543CDdwdEJqFpS1eQ0RvG FRxDuyfgJp9/r2ePVVzLjAqtqgP9bdySVC5lDVOBM7t3yMsjtxafm7uCaHcf47ynzSJ7 uDcuaXGJwfhK8Oz0gThGa+VsRBkPqIoeE9v9XmyCUVhXBol+2FbflX8rknYjBA+Fi78I TV5Q== 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=GDPRJ6jy/PSlUOykqXLo0BG9UpoAFHbEQDe8G+sN4ak=; b=TE6W/11xqMamdN1lvazUQLlD5LGQWy6yAKSPQz5m1wlMR079nDdqsdAhl1FOYS3rrc TDnqWCzeL4Obi6HP/QNbkA5Ry2TU5Dy2w+zhZhACJmUFIqOBhGc7cnjczimIW40gN4E+ 9lxKuyT+y9kNdsguA/4lmUjsTdLhtvrqcdn4KzxoYCldPllxl3FATS++yCNrgcz39/oR rv7rkXnKs8YhyUArvFNBhtTI3FhLU1Q28d/bc0ilR9U/MdCnsZZcvTAFl2iQkDwgcqQI FXIeeLQNmCZ5dgifrYA5p+f0r2gpqvAqsirNNiy6mViEF+oq4tbtcgFer9ovaUUTmEFN ZI0g== X-Gm-Message-State: AOAM5328lIvifPCqXH09kuGktBlO6ymlGWSIUMg8RlMzGZPxNNggIi+B PIYOQh4yeMJR75UPy0YjBjkEaVxnX/J7kkVewSPcS/ktT+E= X-Google-Smtp-Source: ABdhPJx3d4UGo5EeVl3/N+NuiLPVTKy1XAtxHs8KcIBB1ctFsomamfyA7tLUwbHJEAkR/HJZ8f/gk/A1o4vTQuJ0AMc= X-Received: by 2002:adf:e511:: with SMTP id j17mr16100257wrm.17.1612155743695; Sun, 31 Jan 2021 21:02:23 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Sun, 31 Jan 2021 21:02:22 -0800 (PST) In-Reply-To: <202101312144.10VLiwhn025787@gitrepo.freebsd.org> References: <202101312144.10VLiwhn025787@gitrepo.freebsd.org> From: Mateusz Guzik Date: Mon, 1 Feb 2021 06:02:22 +0100 Message-ID: Subject: Re: git: e0a0a3efcb09 - main - mips: fix early kernel panic when setting up interrupt counters To: Oleksandr Tymoshenko 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: 4DTbR60r64z3jBv 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 Feb 2021 05:02:26 -0000 This breaks building mips XLP64: linking kernel.full ld: error: undefined symbol: intrcnt >>> referenced by kern_clock.c:813 (/usr/src/sys/kern/kern_clock.c:813) >>> kern_clock.o:(hardclock) >>> referenced by kern_clock.c:813 (/usr/src/sys/kern/kern_clock.c:813) >>> kern_clock.o:(hardclock) >>> referenced by kern_clock.c:813 (/usr/src/sys/kern/kern_clock.c:813) >>> kern_clock.o:(hardclock) >>> referenced 21 more times and so on On 1/31/21, Oleksandr Tymoshenko wrote: > The branch main has been updated by gonzo: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=e0a0a3efcb09a10ad1de29aca622ea580b2663d2 > > commit e0a0a3efcb09a10ad1de29aca622ea580b2663d2 > Author: Oleksandr Tymoshenko > AuthorDate: 2021-01-30 06:11:24 +0000 > Commit: Oleksandr Tymoshenko > CommitDate: 2021-01-31 21:44:45 +0000 > > mips: fix early kernel panic when setting up interrupt counters > > Commit 248f0ca converted intrcnt and intrnames from u_long[] > and char[] to u_long* and char* respectively, but for non-INTRNG mips > these symbols were defined in .S file as a pre-allocated static arrays, > so the problem wasn't cought at compile time. Conversion from an array > to a pointer requires pointer initialization and it wasn't done > for MIPS, so whatever happenned to be in the begginning of intcnt[] > array was used as a pointer value. > > Move intrcnt/intrnames to C code and allocate them dynamically > although with a fixed size at the moment. > > Reviewed by: emaste > PR: 253051 > Differential Revision: https://reviews.freebsd.org/D28424 > MFC after: 1 day > --- > sys/mips/mips/exception.S | 36 ------------------------------------ > sys/mips/mips/intr_machdep.c | 22 ++++++++++++++++++++++ > 2 files changed, 22 insertions(+), 36 deletions(-) > > diff --git a/sys/mips/mips/exception.S b/sys/mips/mips/exception.S > index 892bebc8f37f..719904ac83b7 100644 > --- a/sys/mips/mips/exception.S > +++ b/sys/mips/mips/exception.S > @@ -80,12 +80,6 @@ dtrace_invop_calltrap_addr: > .text > #endif > > -/* > - * Reasonable limit > - */ > -#define INTRCNT_COUNT 256 > - > - > /* > > *---------------------------------------------------------------------------- > * > @@ -1206,36 +1200,6 @@ FPReturn: > .set pop > END(MipsFPTrap) > > -#ifndef INTRNG > -/* > - * Interrupt counters for vmstat. > - */ > - .data > - .globl intrcnt > - .globl sintrcnt > - .globl intrnames > - .globl sintrnames > -intrnames: > - .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > -sintrnames: > -#ifdef __mips_n64 > - .quad INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > -#else > - .int INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > -#endif > - > - .align (_MIPS_SZLONG / 8) > -intrcnt: > - .space INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 > -sintrcnt: > -#ifdef __mips_n64 > - .quad INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 > -#else > - .int INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 > -#endif > -#endif /* INTRNG */ > - > - > /* > * Vector to real handler in KSEG1. > */ > diff --git a/sys/mips/mips/intr_machdep.c b/sys/mips/mips/intr_machdep.c > index 3b278276865c..a36944f657ca 100644 > --- a/sys/mips/mips/intr_machdep.c > +++ b/sys/mips/mips/intr_machdep.c > @@ -50,6 +50,19 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#ifndef INTRNG > +#define INTRCNT_COUNT 256 > +#define INTRNAME_LEN (2*MAXCOMLEN + 1) > + > +MALLOC_DECLARE(M_MIPSINTR); > +MALLOC_DEFINE(M_MIPSINTR, "mipsintr", "MIPS interrupt handling"); > + > +u_long *intrcnt; > +char *intrnames; > +size_t sintrcnt; > +size_t sintrnames; > +#endif > + > static struct intr_event *hardintr_events[NHARD_IRQS]; > static struct intr_event *softintr_events[NSOFT_IRQS]; > static mips_intrcnt_t mips_intr_counters[NSOFT_IRQS + NHARD_IRQS]; > @@ -121,6 +134,15 @@ cpu_init_interrupts() > int i; > char name[MAXCOMLEN + 1]; > > +#ifndef INTRNG > + intrcnt = mallocarray(INTRCNT_COUNT, sizeof(u_long), M_MIPSINTR, > + M_WAITOK | M_ZERO); > + intrnames = mallocarray(INTRCNT_COUNT, INTRNAME_LEN, M_MIPSINTR, > + M_WAITOK | M_ZERO); > + sintrcnt = INTRCNT_COUNT * sizeof(u_long); > + sintrnames = INTRCNT_COUNT * INTRNAME_LEN; > +#endif > + > /* > * Initialize all available vectors so spare IRQ > * would show up in systat output > _______________________________________________ > 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.org" > -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Mon Feb 1 05: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 51AA14F87FA; Mon, 1 Feb 2021 05:02: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 4DTbRR0VhJz3jDb; Mon, 1 Feb 2021 05:02: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 EE20315983; Mon, 1 Feb 2021 05:02: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 11152gv5098971; Mon, 1 Feb 2021 05:02:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11152gTJ098970; Mon, 1 Feb 2021 05:02:42 GMT (envelope-from git) Date: Mon, 1 Feb 2021 05:02:42 GMT Message-Id: <202102010502.11152gTJ098970@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: bbfb1edd70e1 - main - cache: move hash computation into the parsing loop 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: bbfb1edd70e15241d852d82eb7e1c1049a01b886 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 05:02:43 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=bbfb1edd70e15241d852d82eb7e1c1049a01b886 commit bbfb1edd70e15241d852d82eb7e1c1049a01b886 Author: Mateusz Guzik AuthorDate: 2021-01-31 18:25:18 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 04:36:45 +0000 cache: move hash computation into the parsing loop --- sys/kern/vfs_cache.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 1780e8235dd3..028e3af38ef9 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -722,6 +722,27 @@ cache_get_hash(char *name, u_char len, struct vnode *dvp) return (fnv_32_buf(name, len, dvp->v_nchash)); } +static uint32_t +cache_get_hash_iter_start(struct vnode *dvp) +{ + + return (dvp->v_nchash); +} + +static uint32_t +cache_get_hash_iter(char c, uint32_t hash) +{ + + return (fnv_32_buf(&c, 1, hash)); +} + +static uint32_t +cache_get_hash_iter_finish(uint32_t hash) +{ + + return (hash); +} + static inline struct nchashhead * NCP2BUCKET(struct namecache *ncp) { @@ -3693,11 +3714,11 @@ struct cache_fpl { struct nameidata *ndp; struct componentname *cnp; char *nulchar; - struct pwd **pwd; struct vnode *dvp; struct vnode *tvp; seqc_t dvp_seqc; seqc_t tvp_seqc; + uint32_t hash; struct nameidata_saved snd; struct nameidata_outer snd_outer; int line; @@ -3705,6 +3726,7 @@ struct cache_fpl { bool in_smr; bool fsearch; bool savename; + struct pwd **pwd; #ifdef INVARIANTS struct cache_fpl_debug debug; #endif @@ -4951,6 +4973,7 @@ cache_fplookup_next(struct cache_fpl *fpl) cnp = fpl->cnp; dvp = fpl->dvp; + hash = fpl->hash; if (__predict_false(cnp->cn_nameptr[0] == '.')) { if (cnp->cn_namelen == 1) { @@ -4963,8 +4986,6 @@ cache_fplookup_next(struct cache_fpl *fpl) MPASS(!cache_fpl_isdotdot(cnp)); - hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); - CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) @@ -5246,10 +5267,13 @@ cache_fplookup_parse(struct cache_fpl *fpl) { struct nameidata *ndp; struct componentname *cnp; + struct vnode *dvp; char *cp; + uint32_t hash; ndp = fpl->ndp; cnp = fpl->cnp; + dvp = fpl->dvp; /* * Find the end of this path component, it is either / or nul. @@ -5257,6 +5281,8 @@ cache_fplookup_parse(struct cache_fpl *fpl) * Store / as a temporary sentinel so that we only have one character * to test for. Pathnames tend to be short so this should not be * resulting in cache misses. + * + * TODO: fix this to be word-sized. */ KASSERT(&cnp->cn_nameptr[fpl->debug.ni_pathlen - 1] == fpl->nulchar, ("%s: mismatch between pathlen (%zu) and nulchar (%p != %p), string [%s]\n", @@ -5265,17 +5291,30 @@ cache_fplookup_parse(struct cache_fpl *fpl) KASSERT(*fpl->nulchar == '\0', ("%s: expected nul at %p; string [%s]\n", __func__, fpl->nulchar, cnp->cn_pnbuf)); + hash = cache_get_hash_iter_start(dvp); *fpl->nulchar = '/'; for (cp = cnp->cn_nameptr; *cp != '/'; cp++) { KASSERT(*cp != '\0', ("%s: encountered unexpected nul; string [%s]\n", __func__, cnp->cn_nameptr)); + hash = cache_get_hash_iter(*cp, hash); continue; } *fpl->nulchar = '\0'; + fpl->hash = cache_get_hash_iter_finish(hash); cnp->cn_namelen = cp - cnp->cn_nameptr; cache_fpl_pathlen_sub(fpl, cnp->cn_namelen); + +#ifdef INVARIANTS + if (cnp->cn_namelen <= NAME_MAX) { + if (fpl->hash != cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp)) { + panic("%s: mismatched hash for [%s] len %ld", __func__, + cnp->cn_nameptr, cnp->cn_namelen); + } + } +#endif + /* * Hack: we have to check if the found path component's length exceeds * NAME_MAX. However, the condition is very rarely true and check can From owner-dev-commits-src-all@freebsd.org Mon Feb 1 05:02: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 42D6B4F88DA; Mon, 1 Feb 2021 05:02: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 4DTbRS1D5xz3jTk; Mon, 1 Feb 2021 05:02: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 1A32D15984; Mon, 1 Feb 2021 05:02: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 11152iH2098994; Mon, 1 Feb 2021 05:02:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11152imw098993; Mon, 1 Feb 2021 05:02:44 GMT (envelope-from git) Date: Mon, 1 Feb 2021 05:02:44 GMT Message-Id: <202102010502.11152imw098993@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: 6f19dc2124a3 - main - cache: add delayed degenerate path handling 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: 6f19dc2124a31aadf419743288d2ec1abd895563 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 05:02:44 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6f19dc2124a31aadf419743288d2ec1abd895563 commit 6f19dc2124a31aadf419743288d2ec1abd895563 Author: Mateusz Guzik AuthorDate: 2021-01-31 20:54:35 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 04:53:23 +0000 cache: add delayed degenerate path handling --- sys/kern/vfs_cache.c | 57 +++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 028e3af38ef9..7f0e59f1a1ee 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3737,7 +3737,6 @@ static int cache_fplookup_cross_mount(struct cache_fpl *fpl); static int cache_fplookup_partial_setup(struct cache_fpl *fpl); static int cache_fplookup_skip_slashes(struct cache_fpl *fpl); static int cache_fplookup_trailingslash(struct cache_fpl *fpl); -static int cache_fplookup_preparse(struct cache_fpl *fpl); static void cache_fpl_pathlen_dec(struct cache_fpl *fpl); static void cache_fpl_pathlen_inc(struct cache_fpl *fpl); static void cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n); @@ -4518,6 +4517,9 @@ cache_fplookup_degenerate(struct cache_fpl *fpl) struct vnode *dvp; enum vgetstate dvs; int error, lkflags; +#ifdef INVARIANTS + char *cp; +#endif fpl->tvp = fpl->dvp; fpl->tvp_seqc = fpl->dvp_seqc; @@ -4525,6 +4527,14 @@ cache_fplookup_degenerate(struct cache_fpl *fpl) cnp = fpl->cnp; dvp = fpl->dvp; +#ifdef INVARIANTS + for (cp = cnp->cn_pnbuf; *cp != '\0'; cp++) { + KASSERT(*cp == '/', + ("%s: encountered non-slash; string [%s]\n", __func__, + cnp->cn_pnbuf)); + } +#endif + if (__predict_false(cnp->cn_nameiop != LOOKUP)) { cache_fpl_smr_exit(fpl); return (cache_fpl_handled_error(fpl, EISDIR)); @@ -4589,6 +4599,9 @@ cache_fplookup_noentry(struct cache_fpl *fpl) } if (cnp->cn_nameptr[0] == '\0') { + if (fpl->tvp == NULL) { + return (cache_fplookup_degenerate(fpl)); + } return (cache_fplookup_trailingslash(fpl)); } @@ -4897,7 +4910,7 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) cache_fpl_pathlen_add(fpl, adjust); cnp->cn_nameptr = cnp->cn_pnbuf; fpl->nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; - + fpl->tvp = NULL; return (0); } @@ -4957,8 +4970,7 @@ cache_fplookup_symlink(struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } } - - return (cache_fplookup_preparse(fpl)); + return (0); } static int @@ -5238,30 +5250,6 @@ cache_fpl_pathlen_dec(struct cache_fpl *fpl) } #endif -static int __always_inline -cache_fplookup_preparse(struct cache_fpl *fpl) -{ - struct componentname *cnp; - - cnp = fpl->cnp; - - if (__predict_false(cnp->cn_nameptr[0] == '\0')) { - return (cache_fplookup_degenerate(fpl)); - } - - /* - * By this point the shortest possible pathname is one character + nul - * terminator, hence 2. - */ - KASSERT(fpl->debug.ni_pathlen >= 2, ("%s: pathlen %zu\n", __func__, - fpl->debug.ni_pathlen)); - KASSERT(&cnp->cn_nameptr[fpl->debug.ni_pathlen - 2] == fpl->nulchar - 1, - ("%s: mismatch on string (%p != %p) [%s]\n", __func__, - &cnp->cn_nameptr[fpl->debug.ni_pathlen - 2], fpl->nulchar - 1, - cnp->cn_pnbuf)); - return (0); -} - static void cache_fplookup_parse(struct cache_fpl *fpl) { @@ -5533,6 +5521,13 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; + /* + * Hack: delayed degenerate path checking. + */ + if (cnp->cn_nameptr[0] == '\0' && fpl->tvp == NULL) { + return (cache_fplookup_degenerate(fpl)); + } + /* * Hack: delayed name len checking. */ @@ -5624,10 +5619,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } - error = cache_fplookup_preparse(fpl); - if (__predict_false(cache_fpl_terminated(fpl))) { - return (error); - } + MPASS(fpl->tvp == NULL); for (;;) { cache_fplookup_parse(fpl); @@ -5787,6 +5779,7 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, fpl.nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; fpl.fsearch = false; fpl.savename = (cnp->cn_flags & SAVENAME) != 0; + fpl.tvp = NULL; /* for degenerate path handling */ fpl.pwd = pwdp; pwd = pwd_get_smr(); *(fpl.pwd) = pwd; From owner-dev-commits-src-all@freebsd.org Mon Feb 1 05:02: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 66D454F8A4D; Mon, 1 Feb 2021 05:02: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 4DTbRT22nZz3jDp; Mon, 1 Feb 2021 05:02: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 361DB1577A; Mon, 1 Feb 2021 05:02: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 11152jnN099014; Mon, 1 Feb 2021 05:02:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11152jb4099013; Mon, 1 Feb 2021 05:02:45 GMT (envelope-from git) Date: Mon, 1 Feb 2021 05:02:45 GMT Message-Id: <202102010502.11152jb4099013@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: aae89f6f0957 - main - amd64: use compiler intrinsics for bsf* and bsr* 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: aae89f6f09576351cc3a9a54959649e60fdd849b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 05:02:45 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=aae89f6f09576351cc3a9a54959649e60fdd849b commit aae89f6f09576351cc3a9a54959649e60fdd849b Author: Mateusz Guzik AuthorDate: 2021-01-31 23:35:30 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 04:53:23 +0000 amd64: use compiler intrinsics for bsf* and bsr* --- sys/amd64/include/cpufunc.h | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 763ed2c64c8a..8ef298e1d7d5 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -65,41 +65,13 @@ breakpoint(void) __asm __volatile("int $3"); } -static __inline __pure2 u_int -bsfl(u_int mask) -{ - u_int result; - - __asm __volatile("bsfl %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} - -static __inline __pure2 u_long -bsfq(u_long mask) -{ - u_long result; - - __asm __volatile("bsfq %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} - -static __inline __pure2 u_int -bsrl(u_int mask) -{ - u_int result; +#define bsfl(mask) __builtin_ctz(mask) - __asm __volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} +#define bsfq(mask) __builtin_ctzl(mask) -static __inline __pure2 u_long -bsrq(u_long mask) -{ - u_long result; +#define bsrl(mask) (__builtin_clz(mask) ^ 0x1f) - __asm __volatile("bsrq %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} +#define bsrq(mask) (__builtin_clzl(mask) ^ 0x3f) static __inline void clflush(u_long addr) From owner-dev-commits-src-all@freebsd.org Mon Feb 1 05:02: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 B9A3A4F8968; Mon, 1 Feb 2021 05:02: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 4DTbRV5Tglz3jH5; Mon, 1 Feb 2021 05:02: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 5BAAE15159; Mon, 1 Feb 2021 05:02: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 11152krd099034; Mon, 1 Feb 2021 05:02:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11152kNF099033; Mon, 1 Feb 2021 05:02:46 GMT (envelope-from git) Date: Mon, 1 Feb 2021 05:02:46 GMT Message-Id: <202102010502.11152kNF099033@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: e6ff6154d203 - main - x86: use compiler intrinsics for bswap* 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: e6ff6154d2034c13f3d0da73c1e00d69fdb36516 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 05:02:50 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e6ff6154d2034c13f3d0da73c1e00d69fdb36516 commit e6ff6154d2034c13f3d0da73c1e00d69fdb36516 Author: Mateusz Guzik AuthorDate: 2021-02-01 03:00:13 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 04:53:23 +0000 x86: use compiler intrinsics for bswap* --- sys/x86/include/endian.h | 62 +++--------------------------------------------- 1 file changed, 3 insertions(+), 59 deletions(-) diff --git a/sys/x86/include/endian.h b/sys/x86/include/endian.h index 9c39f4fddf80..18d52fb8a6fa 100644 --- a/sys/x86/include/endian.h +++ b/sys/x86/include/endian.h @@ -65,65 +65,9 @@ #define BYTE_ORDER _BYTE_ORDER #endif -#define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) -#define __bswap32_gen(x) \ - (((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16)) -#define __bswap64_gen(x) \ - (((__uint64_t)__bswap32((x) & 0xffffffff) << 32) | __bswap32((x) >> 32)) - -#ifdef __GNUCLIKE_BUILTIN_CONSTANT_P -#define __bswap16(x) \ - ((__uint16_t)(__builtin_constant_p(x) ? \ - __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))) -#define __bswap32(x) \ - (__builtin_constant_p(x) ? \ - __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) -#define __bswap64(x) \ - (__builtin_constant_p(x) ? \ - __bswap64_gen((__uint64_t)(x)) : __bswap64_var(x)) -#else -/* XXX these are broken for use in static initializers. */ -#define __bswap16(x) __bswap16_var(x) -#define __bswap32(x) __bswap32_var(x) -#define __bswap64(x) __bswap64_var(x) -#endif - -/* These are defined as functions to avoid multiple evaluation of x. */ - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - - return (__bswap16_gen(_x)); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - -#ifdef __GNUCLIKE_ASM - __asm("bswap %0" : "+r" (_x)); - return (_x); -#else - return (__bswap32_gen(_x)); -#endif -} - -static __inline __uint64_t -__bswap64_var(__uint64_t _x) -{ - -#if defined(__amd64__) && defined(__GNUCLIKE_ASM) - __asm("bswap %0" : "+r" (_x)); - return (_x); -#else - /* - * It is important for the optimizations that the following is not - * really generic, but expands to 2 __bswap32_var()'s. - */ - return (__bswap64_gen(_x)); -#endif -} +#define __bswap16(x) __builtin_bswap16(x) +#define __bswap32(x) __builtin_bswap32(x) +#define __bswap64(x) __builtin_bswap64(x) #define __htonl(x) __bswap32(x) #define __htons(x) __bswap16(x) From owner-dev-commits-src-all@freebsd.org Mon Feb 1 05:43: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 0C7545238D4; Mon, 1 Feb 2021 05:43: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 4DTcKx70sDz4hkR; Mon, 1 Feb 2021 05:43: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 E353B1628A; Mon, 1 Feb 2021 05:43: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 1115h1IV051348; Mon, 1 Feb 2021 05:43:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1115h1xj051347; Mon, 1 Feb 2021 05:43:01 GMT (envelope-from git) Date: Mon, 1 Feb 2021 05:43:01 GMT Message-Id: <202102010543.1115h1xj051347@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: b06fd805cc87 - stable/13 - tmpfs: push VEXEC check into tmpfs_lookup() 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: b06fd805cc871cbde03d3ce8310adf09c9d581b4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 05:43:02 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b06fd805cc871cbde03d3ce8310adf09c9d581b4 commit b06fd805cc871cbde03d3ce8310adf09c9d581b4 Author: Kyle Evans AuthorDate: 2021-01-28 14:27:28 +0000 Commit: Kyle Evans CommitDate: 2021-02-01 05:42:30 +0000 tmpfs: push VEXEC check into tmpfs_lookup() vfs_cache_lookup() has already done the appropriate VEXEC check, therefore we must not re-check in VOP_CACHEDLOOKUP. This fixes O_SEARCH semantics on tmpfs and removes a redundant descent into VOP_ACCESS() in the common case. (cherry picked from commit 0f919ed4ae4df082eefb517afe02752b1790afd3) --- sys/fs/tmpfs/tmpfs_vnops.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 66568e07b4d7..f77692a10690 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -91,14 +91,10 @@ tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) struct tmpfs_mount *tm; int error; + /* Caller assumes responsibility for ensuring access (VEXEC). */ dnode = VP_TO_TMPFS_DIR(dvp); *vpp = NULLVP; - /* Check accessibility of requested node as a first step. */ - error = vn_dir_check_exec(dvp, cnp); - if (error != 0) - goto out; - /* We cannot be requesting the parent directory of the root node. */ MPASS(IMPLIES(dnode->tn_type == VDIR && dnode->tn_dir.tn_parent == dnode, @@ -241,8 +237,17 @@ tmpfs_cached_lookup(struct vop_cachedlookup_args *v) static int tmpfs_lookup(struct vop_lookup_args *v) { + struct vnode *dvp = v->a_dvp; + struct vnode **vpp = v->a_vpp; + struct componentname *cnp = v->a_cnp; + int error; - return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp)); + /* Check accessibility of requested node as a first step. */ + error = vn_dir_check_exec(dvp, cnp); + if (error != 0) + return (error); + + return (tmpfs_lookup1(dvp, vpp, cnp)); } static int From owner-dev-commits-src-all@freebsd.org Mon Feb 1 05:44: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 5CD37524D23; Mon, 1 Feb 2021 05:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTcMg28jFz4j4b; Mon, 1 Feb 2021 05:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AE361601B; Mon, 1 Feb 2021 05:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1115iVsp051685; Mon, 1 Feb 2021 05:44:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1115iVUO051684; Mon, 1 Feb 2021 05:44:31 GMT (envelope-from git) Date: Mon, 1 Feb 2021 05:44:31 GMT Message-Id: <202102010544.1115iVUO051684@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: d2336460daff - stable/12 - tmpfs: push VEXEC check into tmpfs_lookup() 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: d2336460daffae7d2cb2344f52054a7a7a0047ad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 05:44:31 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d2336460daffae7d2cb2344f52054a7a7a0047ad commit d2336460daffae7d2cb2344f52054a7a7a0047ad Author: Kyle Evans AuthorDate: 2021-01-28 14:27:28 +0000 Commit: Kyle Evans CommitDate: 2021-02-01 05:44:09 +0000 tmpfs: push VEXEC check into tmpfs_lookup() vfs_cache_lookup() has already done the appropriate VEXEC check, therefore we must not re-check in VOP_CACHEDLOOKUP. This fixes O_SEARCH semantics on tmpfs and removes a redundant descent into VOP_ACCESS() in the common case. Reported-by: arichardson (via CheriBSD Jenkins CI) (cherry picked from commit 0f919ed4ae4df082eefb517afe02752b1790afd3) --- sys/fs/tmpfs/tmpfs_vnops.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index bfb84c508c78..7df835113397 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -86,14 +86,10 @@ tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) struct tmpfs_mount *tm; int error; + /* Caller assumes responsibility for ensuring access (VEXEC). */ dnode = VP_TO_TMPFS_DIR(dvp); *vpp = NULLVP; - /* Check accessibility of requested node as a first step. */ - error = vn_dir_check_exec(dvp, cnp); - if (error != 0) - goto out; - /* We cannot be requesting the parent directory of the root node. */ MPASS(IMPLIES(dnode->tn_type == VDIR && dnode->tn_dir.tn_parent == dnode, @@ -236,8 +232,17 @@ tmpfs_cached_lookup(struct vop_cachedlookup_args *v) static int tmpfs_lookup(struct vop_lookup_args *v) { + struct vnode *dvp = v->a_dvp; + struct vnode **vpp = v->a_vpp; + struct componentname *cnp = v->a_cnp; + int error; - return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp)); + /* Check accessibility of requested node as a first step. */ + error = vn_dir_check_exec(dvp, cnp); + if (error != 0) + return (error); + + return (tmpfs_lookup1(dvp, vpp, cnp)); } static int From owner-dev-commits-src-all@freebsd.org Mon Feb 1 07:22: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 F0E7F4F1029; Mon, 1 Feb 2021 07:22:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTfYF6NkMz4sJH; Mon, 1 Feb 2021 07:22: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 CE552173FD; Mon, 1 Feb 2021 07:22: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 1117MvoR081702; Mon, 1 Feb 2021 07:22:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1117MvG4081701; Mon, 1 Feb 2021 07:22:57 GMT (envelope-from git) Date: Mon, 1 Feb 2021 07:22:57 GMT Message-Id: <202102010722.1117MvG4081701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b760436e1381 - stable/13 - firmware(9): extend firmware_get() by a "no warn" flag. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b760436e1381bc43368db9252a3da1427c5a4885 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 07:22:58 -0000 The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b760436e1381bc43368db9252a3da1427c5a4885 commit b760436e1381bc43368db9252a3da1427c5a4885 Author: Bjoern A. Zeeb AuthorDate: 2021-01-25 22:41:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-02-01 07:15:29 +0000 firmware(9): extend firmware_get() by a "no warn" flag. With the upcoming usage from LinuxKPI but also from drivers ported natively we are seeing more probing of various firmware (names). Add the ability to firmware(9) to silence the "firmware image loading/registering errors" by adding a new firmware_get_flags() functions extending firmware_get() and taking a flags argument as firmware_put() already does. Requested-by: zeising (for future LinuxKPI/DRM) Sponsored-by: The FreeBSD Foundation Sponsored-by: Rubicon Communications, LLC ("Netgate") MFC after: 3 days Reviewed-by: markj Differential Revision: https://reviews.freebsd.org/D27413 (cherry picked from commit 6f65b505468aa8cedc57235604bd8df540d42735) --- share/man/man9/firmware.9 | 40 +++++++++++++++++++++++++++++++++------- sys/kern/subr_firmware.c | 45 +++++++++++++++++++++++++++++++-------------- sys/sys/firmware.h | 5 +++++ 3 files changed, 69 insertions(+), 21 deletions(-) diff --git a/share/man/man9/firmware.9 b/share/man/man9/firmware.9 index b0d429573cf6..6d91beb3ddd1 100644 --- a/share/man/man9/firmware.9 +++ b/share/man/man9/firmware.9 @@ -23,13 +23,14 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2019 +.Dd January 27, 2021 .Dt FIRMWARE 9 .Os .Sh NAME .Nm firmware_register , .Nm firmware_unregister , .Nm firmware_get , +.Nm firmware_get_flags , .Nm firmware_put .Nd firmware image loading and management .Sh SYNOPSIS @@ -57,6 +58,8 @@ struct firmware { .Fn firmware_unregister "const char *imagename" .Ft "const struct firmware *" .Fn firmware_get "const char *imagename" +.Ft "const struct firmware *" +.Fn firmware_get_flags "const char *imagename" "uint32_t flags" .Ft void .Fn firmware_put "const struct firmware *fp" "int flags" .Sh DESCRIPTION @@ -97,7 +100,13 @@ by calling the function .Fn firmware_get with the .Nm imagename -they want as an argument. +they want as an argument, or by calling +.Fn firmware_get_flags +with the +.Nm imagename +and +.Nm flags +they want as an arguments. If a matching image is not already registered, the firmware subsystem will try to load it using the mechanisms specified below (typically, a kernel module @@ -134,11 +143,22 @@ if there are no pending references to the image, otherwise it does not unregister the image and returns EBUSY. .Pp .Fn firmware_get -returns the requested firmware image. +and +.Fn firmware_get_flags +return the requested firmware image. +The +.Fa flags +argument may be set to +.Dv FIRMWARE_GET_NOWARN +to indicate that errors on firmware load or registration should +only be logged in case of +.Nm booverbose . If the image is not yet registered with the system, -the function tries to load it. +the functions try to load it. This involves the linker subsystem and disk access, so .Fn firmware_get +or +.Fn firmware_get_flags must not be called with any locks (except for .Va Giant ) . Note also that if the firmware image is loaded from a filesystem @@ -149,9 +169,11 @@ already mounted. .Pp On success, .Fn firmware_get -returns a pointer to the image description and increases the reference count +and +.Fn firmware_get_flags +return a pointer to the image description and increase the reference count for this image. -On failure, the function returns NULL. +On failure, the functions return NULL. .Pp .Fn firmware_put drops a reference to a firmware image. @@ -183,10 +205,12 @@ these images in memory before calling .Pp When .Fn firmware_get +or +.Fn firmware_get_flags does not find the requested image, it tries to load it using one of the available loading mechanisms. At the moment, there is only one, namely -.Nm Loadable kernel modules : +.Nm Loadable kernel modules . .Pp A firmware image named .Nm foo @@ -203,6 +227,8 @@ which on most systems defaults to Note that in case a module contains multiple images, the caller should first request a .Fn firmware_get +or +.Fn firmware_get_flags for the first image contained in the module, followed by requests for the other images. .Sh BUILDING FIRMWARE LOADABLE MODULES diff --git a/sys/kern/subr_firmware.c b/sys/kern/subr_firmware.c index db262c121918..0465f2a88483 100644 --- a/sys/kern/subr_firmware.c +++ b/sys/kern/subr_firmware.c @@ -238,36 +238,42 @@ firmware_unregister(const char *imagename) return (err); } +struct fw_loadimage { + const char *imagename; + uint32_t flags; +}; + static void -loadimage(void *arg, int npending) +loadimage(void *arg, int npending __unused) { - char *imagename = arg; + struct fw_loadimage *fwli = arg; struct priv_fw *fp; linker_file_t result; int error; - error = linker_reference_module(imagename, NULL, &result); + error = linker_reference_module(fwli->imagename, NULL, &result); if (error != 0) { - printf("%s: could not load firmware image, error %d\n", - imagename, error); + if (bootverbose || (fwli->flags & FIRMWARE_GET_NOWARN) == 0) + printf("%s: could not load firmware image, error %d\n", + fwli->imagename, error); mtx_lock(&firmware_mtx); goto done; } mtx_lock(&firmware_mtx); - fp = lookup(imagename); + fp = lookup(fwli->imagename); if (fp == NULL || fp->file != NULL) { mtx_unlock(&firmware_mtx); if (fp == NULL) printf("%s: firmware image loaded, " - "but did not register\n", imagename); - (void) linker_release_module(imagename, NULL, NULL); + "but did not register\n", fwli->imagename); + (void) linker_release_module(fwli->imagename, NULL, NULL); mtx_lock(&firmware_mtx); goto done; } fp->file = result; /* record the module identity */ done: - wakeup_one(imagename); + wakeup_one(arg); mtx_unlock(&firmware_mtx); } @@ -279,7 +285,7 @@ done: * release this reference for the image to be eligible for removal/unload. */ const struct firmware * -firmware_get(const char *imagename) +firmware_get_flags(const char *imagename, uint32_t flags) { struct task fwload_task; struct thread *td; @@ -306,11 +312,15 @@ firmware_get(const char *imagename) * Also we must not hold any mtx's over this call which is problematic. */ if (!cold) { - TASK_INIT(&fwload_task, 0, loadimage, __DECONST(void *, - imagename)); + struct fw_loadimage fwli; + + fwli.imagename = imagename; + fwli.flags = flags; + TASK_INIT(&fwload_task, 0, loadimage, (void *)&fwli); taskqueue_enqueue(firmware_tq, &fwload_task); - msleep(__DECONST(void *, imagename), &firmware_mtx, 0, - "fwload", 0); + PHOLD(curproc); + msleep((void *)&fwli, &firmware_mtx, 0, "fwload", 0); + PRELE(curproc); } /* * After attempting to load the module, see if the image is registered. @@ -328,6 +338,13 @@ found: /* common exit point on success */ return &fp->fw; } +const struct firmware * +firmware_get(const char *imagename) +{ + + return (firmware_get_flags(imagename, 0)); +} + /* * Release a reference to a firmware image returned by firmware_get. * The caller may specify, with the FIRMWARE_UNLOAD flag, its desire diff --git a/sys/sys/firmware.h b/sys/sys/firmware.h index 8a9b2cf23bd7..0d74a749f4fc 100644 --- a/sys/sys/firmware.h +++ b/sys/sys/firmware.h @@ -60,7 +60,12 @@ struct firmware { const struct firmware *firmware_register(const char *, const void *, size_t, unsigned int, const struct firmware *); int firmware_unregister(const char *); + +#define FIRMWARE_GET_NOWARN 0x0001 /* Do not warn if firmware not found. */ +const struct firmware *firmware_get_flags(const char *, uint32_t flags); const struct firmware *firmware_get(const char *); + #define FIRMWARE_UNLOAD 0x0001 /* unload if unreferenced */ void firmware_put(const struct firmware *, int); + #endif /* _SYS_FIRMWARE_H_ */ From owner-dev-commits-src-all@freebsd.org Mon Feb 1 07:59: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 45AC34F42B6; Mon, 1 Feb 2021 07:59: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 4DTgMC1MSRz4tJd; Mon, 1 Feb 2021 07:59: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 20D1F17C72; Mon, 1 Feb 2021 07:59: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 1117xJ6A022041; Mon, 1 Feb 2021 07:59:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1117xJS9022040; Mon, 1 Feb 2021 07:59:19 GMT (envelope-from git) Date: Mon, 1 Feb 2021 07:59:19 GMT Message-Id: <202102010759.1117xJS9022040@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: d6f9c5a6d2f8 - main - mips: fix NLM platforms breakage caused by e0a0a3ef 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: d6f9c5a6d2f87865f9714d2b8dfd1a9f3080c71e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 07:59:19 -0000 The branch main has been updated by gonzo: URL: https://cgit.FreeBSD.org/src/commit/?id=d6f9c5a6d2f87865f9714d2b8dfd1a9f3080c71e commit d6f9c5a6d2f87865f9714d2b8dfd1a9f3080c71e Author: Oleksandr Tymoshenko AuthorDate: 2021-02-01 07:56:22 +0000 Commit: Oleksandr Tymoshenko CommitDate: 2021-02-01 07:56:22 +0000 mips: fix NLM platforms breakage caused by e0a0a3ef NetLogic platforms have their own implementation of cpu_init_interrupts. Apply the same logic to it as to intr_machdep.c. PR: 253051 --- sys/mips/nlm/intr_machdep.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/mips/nlm/intr_machdep.c b/sys/mips/nlm/intr_machdep.c index b66118c06ee8..33bfad1fe882 100644 --- a/sys/mips/nlm/intr_machdep.c +++ b/sys/mips/nlm/intr_machdep.c @@ -59,6 +59,17 @@ __FBSDID("$FreeBSD$"); #include #include +#define INTRCNT_COUNT 256 +#define INTRNAME_LEN (2*MAXCOMLEN + 1) + +MALLOC_DECLARE(M_MIPSINTR); +MALLOC_DEFINE(M_MIPSINTR, "mipsintr", "MIPS interrupt handling"); + +u_long *intrcnt; +char *intrnames; +size_t sintrcnt; +size_t sintrnames; + struct xlp_intrsrc { void (*bus_ack)(int, void *); /* Additional ack */ void *bus_ack_arg; /* arg for additional ack */ @@ -295,6 +306,13 @@ cpu_init_interrupts() int i; char name[MAXCOMLEN + 1]; + intrcnt = mallocarray(INTRCNT_COUNT, sizeof(u_long), M_MIPSINTR, + M_WAITOK | M_ZERO); + intrnames = mallocarray(INTRCNT_COUNT, INTRNAME_LEN, M_MIPSINTR, + M_WAITOK | M_ZERO); + sintrcnt = INTRCNT_COUNT * sizeof(u_long); + sintrnames = INTRCNT_COUNT * INTRNAME_LEN; + /* * Initialize all available vectors so spare IRQ * would show up in systat output From owner-dev-commits-src-all@freebsd.org Mon Feb 1 08:00: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 CC6874F4925; Mon, 1 Feb 2021 08:00:30 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (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 4DTgNZ5H4zz4tkl; Mon, 1 Feb 2021 08:00:30 +0000 (UTC) (envelope-from gonzo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bluezbox.com; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+SaUEJbbm+kslGpSjVzvjK5lPInJ8Kh2BIzYZHtUva8=; b=szGT4Zm6I3ym+t0uanQoqJCcXG hJ/0ukU6i9lJ4hqGZr8Fg8xTbaNvGYbcMl+lm3Of2TNRnLHK+64e6ZEnTCzzDIZYYIFpcRj8/xVFu ZSHrzIQL/6KsFFpfW6Uh1lYFRCSiCRQrFramdEFz3Wze4MPpUi8d+t2B+P3Rce4nnOJg=; Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1l6U8E-0007kV-RI; Mon, 01 Feb 2021 00:00:23 -0800 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id 11180M4L029790; Mon, 1 Feb 2021 00:00:22 -0800 (PST) (envelope-from gonzo@freebsd.org) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@freebsd.org using -f Date: Mon, 1 Feb 2021 00:00:22 -0800 From: Oleksandr Tymoshenko To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e0a0a3efcb09 - main - mips: fix early kernel panic when setting up interrupt counters Message-ID: <20210201080022.GA29734@bluezbox.com> References: <202101312144.10VLiwhn025787@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD/11.2-RELEASE-p10 (amd64) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Mateusz Guzik (mjguzik@gmail.com) wrote: > This breaks building mips XLP64: Sorry about that and thanks for reporting. Should be fixed now. -- gonzo Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: 4DTgNZ5H4zz4tkl 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 Feb 2021 08:00:30 -0000 Mateusz Guzik (mjguzik@gmail.com) wrote: > This breaks building mips XLP64: Sorry about that and thanks for reporting. Should be fixed now. -- gonzo From owner-dev-commits-src-all@freebsd.org Mon Feb 1 09:24: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 CFA084F7B8D; Mon, 1 Feb 2021 09:24: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 4DTjFl5S6dz50Bd; Mon, 1 Feb 2021 09:24: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 AD0DD18F0D; Mon, 1 Feb 2021 09:24: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 1119Ohj2038626; Mon, 1 Feb 2021 09:24:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1119Oh78038625; Mon, 1 Feb 2021 09:24:43 GMT (envelope-from git) Date: Mon, 1 Feb 2021 09:24:43 GMT Message-Id: <202102010924.1119Oh78038625@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: 22aca6726891 - stable/13 - MFC b8051298b0a3: Fix missing value in uar_page field for ratelimit in mlx5en(4). This is a regression issue after the new UAR API was introduced by f8f5b459d21e . 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: 22aca672689130e683672e8e9164e24e598fe377 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 09:24:43 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=22aca672689130e683672e8e9164e24e598fe377 commit 22aca672689130e683672e8e9164e24e598fe377 Author: Hans Petter Selasky AuthorDate: 2021-01-26 16:01:34 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-01 09:23:25 +0000 MFC b8051298b0a3: Fix missing value in uar_page field for ratelimit in mlx5en(4). This is a regression issue after the new UAR API was introduced by f8f5b459d21e . Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit b8051298b0a345ae0bdfcd2ddf89bca1b96c6c2a) --- sys/dev/mlx5/mlx5_en/mlx5_en_rl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c index 95fb59726e24..33b93b1b5ced 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c @@ -66,6 +66,7 @@ mlx5e_rl_build_cq_param(struct mlx5e_rl_priv_data *rl, MLX5_SET(cqc, cqc, log_cq_size, log_sq_size); MLX5_SET(cqc, cqc, cq_period, rl->param.tx_coalesce_usecs); MLX5_SET(cqc, cqc, cq_max_count, rl->param.tx_coalesce_pkts); + MLX5_SET(cqc, cqc, uar_page, rl->priv->mdev->priv.uar->index); switch (rl->param.tx_coalesce_mode) { case 0: From owner-dev-commits-src-all@freebsd.org Mon Feb 1 09:26: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 E2DE64F79BA; Mon, 1 Feb 2021 09:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTjHH4w1Dz50dX; Mon, 1 Feb 2021 09:26: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 9B49318F84; Mon, 1 Feb 2021 09:26: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 1119Q3Jh038932; Mon, 1 Feb 2021 09:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1119Q3Hw038931; Mon, 1 Feb 2021 09:26:03 GMT (envelope-from git) Date: Mon, 1 Feb 2021 09:26:03 GMT Message-Id: <202102010926.1119Q3Hw038931@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: 6bc1f8425560 - stable/13 - MFC 064009e79462: Add support for enabling and disabling IFCAP_VLAN_HWTSO via ifconfig(8) in mlx5en(4). 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: 6bc1f8425560fa3e2ebc6ac3367967a083ccf6e0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 09:26:03 -0000 The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=6bc1f8425560fa3e2ebc6ac3367967a083ccf6e0 commit 6bc1f8425560fa3e2ebc6ac3367967a083ccf6e0 Author: Hans Petter Selasky AuthorDate: 2021-01-25 10:22:55 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-01 09:25:16 +0000 MFC 064009e79462: Add support for enabling and disabling IFCAP_VLAN_HWTSO via ifconfig(8) in mlx5en(4). Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 064009e79462dea517aa7f1a857fb4d5393caa69) --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 0d4028e240ca..023f519f7ced 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3413,6 +3413,8 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) ifp->if_capenable ^= IFCAP_TSO6; ifp->if_hwassist ^= CSUM_IP6_TSO; } + if (mask & IFCAP_VLAN_HWTSO) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if (mask & IFCAP_VLAN_HWFILTER) { if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) mlx5e_disable_vlan_filter(priv); From owner-dev-commits-src-all@freebsd.org Mon Feb 1 09:27: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 9D3974F7DBA; Mon, 1 Feb 2021 09:27: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 4DTjK042qrz50l1; Mon, 1 Feb 2021 09:27: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 7D3A318DAA; Mon, 1 Feb 2021 09:27: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 1119RWcl039268; Mon, 1 Feb 2021 09:27:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1119RWEb039267; Mon, 1 Feb 2021 09:27:32 GMT (envelope-from git) Date: Mon, 1 Feb 2021 09:27:32 GMT Message-Id: <202102010927.1119RWEb039267@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: 918b98a06129 - stable/12 - MFC 064009e79462: Add support for enabling and disabling IFCAP_VLAN_HWTSO via ifconfig(8) in mlx5en(4). 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: 918b98a061293dba0efd3ba6524ca6a4a0ef1d2e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 09:27:32 -0000 The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=918b98a061293dba0efd3ba6524ca6a4a0ef1d2e commit 918b98a061293dba0efd3ba6524ca6a4a0ef1d2e Author: Hans Petter Selasky AuthorDate: 2021-01-25 10:22:55 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-01 09:27:01 +0000 MFC 064009e79462: Add support for enabling and disabling IFCAP_VLAN_HWTSO via ifconfig(8) in mlx5en(4). Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 064009e79462dea517aa7f1a857fb4d5393caa69) --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 79cf9d9b631d..1596ca0fb21a 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3378,6 +3378,8 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) ifp->if_capenable ^= IFCAP_TSO6; ifp->if_hwassist ^= CSUM_IP6_TSO; } + if (mask & IFCAP_VLAN_HWTSO) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if (mask & IFCAP_VLAN_HWFILTER) { if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) mlx5e_disable_vlan_filter(priv); From owner-dev-commits-src-all@freebsd.org Mon Feb 1 09:28: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 C7A634F81A2; Mon, 1 Feb 2021 09:28: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 4DTjLR5HvRz50gC; Mon, 1 Feb 2021 09:28: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 A87D418B53; Mon, 1 Feb 2021 09:28: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 1119Sl3X039568; Mon, 1 Feb 2021 09:28:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1119SlTd039567; Mon, 1 Feb 2021 09:28:47 GMT (envelope-from git) Date: Mon, 1 Feb 2021 09:28:47 GMT Message-Id: <202102010928.1119SlTd039567@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: 8340ed8900e4 - stable/11 - MFC 064009e79462: Add support for enabling and disabling IFCAP_VLAN_HWTSO via ifconfig(8) in mlx5en(4). 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: 8340ed8900e4ff48e7a428f30a98c0e91c91da03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 09:28:47 -0000 The branch stable/11 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=8340ed8900e4ff48e7a428f30a98c0e91c91da03 commit 8340ed8900e4ff48e7a428f30a98c0e91c91da03 Author: Hans Petter Selasky AuthorDate: 2021-01-25 10:22:55 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-01 09:28:13 +0000 MFC 064009e79462: Add support for enabling and disabling IFCAP_VLAN_HWTSO via ifconfig(8) in mlx5en(4). Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 064009e79462dea517aa7f1a857fb4d5393caa69) --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index d1288ddd6f23..7f004ed96c70 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3233,6 +3233,8 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data) ifp->if_capenable ^= IFCAP_TSO6; ifp->if_hwassist ^= CSUM_IP6_TSO; } + if (mask & IFCAP_VLAN_HWTSO) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if (mask & IFCAP_VLAN_HWFILTER) { if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) mlx5e_disable_vlan_filter(priv); From owner-dev-commits-src-all@freebsd.org Mon Feb 1 09:32: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 39BBB4F85DD; Mon, 1 Feb 2021 09:32: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 4DTjR01Cx4z50w7; Mon, 1 Feb 2021 09:32: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 1B96718CBE; Mon, 1 Feb 2021 09:32: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 1119Wibj051503; Mon, 1 Feb 2021 09:32:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1119Wiob051502; Mon, 1 Feb 2021 09:32:44 GMT (envelope-from git) Date: Mon, 1 Feb 2021 09:32:44 GMT Message-Id: <202102010932.1119Wiob051502@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: 671c393854a5 - stable/11 - MFC ea0efc370416: Add support for PL2303HXN to uplcom(4). 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: 671c393854a5ae60369beadfb74007e240bb18ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 09:32:44 -0000 The branch stable/11 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=671c393854a5ae60369beadfb74007e240bb18ab commit 671c393854a5ae60369beadfb74007e240bb18ab Author: Hans Petter Selasky AuthorDate: 2021-01-07 14:34:26 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-01 09:31:58 +0000 MFC ea0efc370416: Add support for PL2303HXN to uplcom(4). Code changes in this commit were obtained from straight from OpenBSD's uplcom.c with almost no modification, the list of chip names and USB IDs was obtained from Linux. Differential Revision: https://reviews.freebsd.org/D27952 Submitted by: tomli_tomli.me (Yifeng Li) Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit ea0efc37041640686fbfb226e80ee60e58cb17f1) --- share/man/man4/uplcom.4 | 4 +- sys/dev/usb/serial/uplcom.c | 94 +++++++++++++++++++++++++++++++++++++++------ sys/dev/usb/usbdevs | 6 +++ 3 files changed, 92 insertions(+), 12 deletions(-) diff --git a/share/man/man4/uplcom.4 b/share/man/man4/uplcom.4 index b3f1fbb3ff18..ca29ee8d454d 100644 --- a/share/man/man4/uplcom.4 +++ b/share/man/man4/uplcom.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2017 +.Dd January 7, 2021 .Dt UPLCOM 4 .Os .Sh NAME @@ -132,6 +132,8 @@ PLANEX USB-RS232 URS-03 .It Prolific Generic USB-Serial Adapters .It +Prolific Generic USB-Serial Adapters (HXN) +.It Prolific Pharos USB-Serial Adapter .It RATOC REX-USB60 diff --git a/sys/dev/usb/serial/uplcom.c b/sys/dev/usb/serial/uplcom.c index 27858af68692..0913cc7890d4 100644 --- a/sys/dev/usb/serial/uplcom.c +++ b/sys/dev/usb/serial/uplcom.c @@ -129,8 +129,13 @@ SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RWTUN, #define UPLCOM_BULK_BUF_SIZE 1024 /* bytes */ #define UPLCOM_SET_REQUEST 0x01 +#define UPLCOM_SET_REQUEST_PL2303HXN 0x80 #define UPLCOM_SET_CRTSCTS 0x41 #define UPLCOM_SET_CRTSCTS_PL2303X 0x61 +#define UPLCOM_SET_CRTSCTS_PL2303HXN 0xFA +#define UPLCOM_CLEAR_CRTSCTS_PL2303HXN 0xFF +#define UPLCOM_CRTSCTS_REG_PL2303HXN 0x0A +#define UPLCOM_STATUS_REG_PL2303HX 0x8080 #define RSAQ_STATUS_CTS 0x80 #define RSAQ_STATUS_OVERRUN_ERROR 0x40 #define RSAQ_STATUS_PARITY_ERROR 0x20 @@ -143,6 +148,7 @@ SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RWTUN, #define TYPE_PL2303 0 #define TYPE_PL2303HX 1 #define TYPE_PL2303HXD 2 +#define TYPE_PL2303HXN 3 #define UPLCOM_STATE_INDEX 8 @@ -286,6 +292,12 @@ static const STRUCT_USB_HOST_ID uplcom_devs[] = { UPLCOM_DEV(PROLIFIC, MOTOROLA), /* Motorola cable */ UPLCOM_DEV(PROLIFIC, PHAROS), /* Prolific Pharos */ UPLCOM_DEV(PROLIFIC, PL2303), /* Generic adapter */ + UPLCOM_DEV(PROLIFIC, PL2303GC), /* Generic adapter (PL2303HXN, type GC) */ + UPLCOM_DEV(PROLIFIC, PL2303GB), /* Generic adapter (PL2303HXN, type GB) */ + UPLCOM_DEV(PROLIFIC, PL2303GT), /* Generic adapter (PL2303HXN, type GT) */ + UPLCOM_DEV(PROLIFIC, PL2303GL), /* Generic adapter (PL2303HXN, type GL) */ + UPLCOM_DEV(PROLIFIC, PL2303GE), /* Generic adapter (PL2303HXN, type GE) */ + UPLCOM_DEV(PROLIFIC, PL2303GS), /* Generic adapter (PL2303HXN, type GS) */ UPLCOM_DEV(PROLIFIC, RSAQ2), /* I/O DATA USB-RSAQ2 */ UPLCOM_DEV(PROLIFIC, RSAQ3), /* I/O DATA USB-RSAQ3 */ UPLCOM_DEV(PROLIFIC, UIC_MSR206), /* UIC MSR206 Card Reader */ @@ -365,6 +377,10 @@ uplcom_attach(device_t dev) struct usb_device_descriptor *dd; int error; + struct usb_device_request req; + usb_error_t err; + uint8_t buf[4]; + DPRINTFN(11, "\n"); device_set_usb_desc(dev); @@ -404,6 +420,25 @@ uplcom_attach(device_t dev) break; } + /* + * The new chip revision PL2303HXN is only compatible with the new + * UPLCOM_SET_REQUEST_PL2303HXN command. Issuing the old command + * UPLCOM_SET_REQUEST to the new chip raises an error. Thus, PL2303HX + * and PL2303HXN can be distinguished by issuing an old-style request + * (on a status register) to the new chip and checking the error. + */ + if (sc->sc_chiptype == TYPE_PL2303HX) { + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = UPLCOM_SET_REQUEST; + USETW(req.wValue, UPLCOM_STATUS_REG_PL2303HX); + req.wIndex[0] = sc->sc_data_iface_no; + req.wIndex[1] = 0; + USETW(req.wLength, 1); + err = usbd_do_request(sc->sc_udev, NULL, &req, buf); + if (err) + sc->sc_chiptype = TYPE_PL2303HXN; + } + switch (sc->sc_chiptype) { case TYPE_PL2303: DPRINTF("chiptype: 2303\n"); @@ -411,6 +446,9 @@ uplcom_attach(device_t dev) case TYPE_PL2303HX: DPRINTF("chiptype: 2303HX/TA\n"); break; + case TYPE_PL2303HXN: + DPRINTF("chiptype: 2303HXN\n"); + break; case TYPE_PL2303HXD: DPRINTF("chiptype: 2303HXD/TB/RA/EA\n"); break; @@ -472,7 +510,8 @@ uplcom_attach(device_t dev) usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_WR]); usbd_xfer_set_stall(sc->sc_xfer[UPLCOM_BULK_DT_RD]); mtx_unlock(&sc->sc_mtx); - } else { + } else if (sc->sc_chiptype == TYPE_PL2303HX || + sc->sc_chiptype == TYPE_PL2303HXD) { /* reset upstream data pipes */ if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0) || @@ -480,6 +519,12 @@ uplcom_attach(device_t dev) UPLCOM_SET_REQUEST, 9, 0, 0)) { goto detach; } + } else if (sc->sc_chiptype == TYPE_PL2303HXN) { + /* reset upstream data pipes */ + if (uplcom_pl2303_do(sc->sc_udev, UT_WRITE_VENDOR_DEVICE, + UPLCOM_SET_REQUEST_PL2303HXN, 0x07, 0x03, 0)) { + goto detach; + } } error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -543,6 +588,11 @@ uplcom_reset(struct uplcom_softc *sc, struct usb_device *udev) { struct usb_device_request req; + if (sc->sc_chiptype == TYPE_PL2303HXN) { + /* PL2303HXN doesn't need this reset sequence */ + return (0); + } + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = UPLCOM_SET_REQUEST; USETW(req.wValue, 0); @@ -580,6 +630,11 @@ uplcom_pl2303_init(struct usb_device *udev, uint8_t chiptype) { int err; + if (chiptype == TYPE_PL2303HXN) { + /* PL2303HXN doesn't need this initialization sequence */ + return (0); + } + if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1) || uplcom_pl2303_do(udev, UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x0404, 0, 0) || uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1) @@ -726,7 +781,7 @@ uplcom_pre_param(struct ucom_softc *ucom, struct termios *t) * * The PL2303 can only set specific baud rates, up to 1228800 baud. * The PL2303HX can set any baud rate up to 6Mb. - * The PL2303HX rev. D can set any baud rate up to 12Mb. + * The PL2303HX rev. D and PL2303HXN can set any baud rate up to 12Mb. * */ @@ -734,6 +789,10 @@ uplcom_pre_param(struct ucom_softc *ucom, struct termios *t) if (t->c_ospeed & 0x80000000) return 0; switch (sc->sc_chiptype) { + case TYPE_PL2303HXN: + if (t->c_ospeed <= 12000000) + return (0); + break; case TYPE_PL2303HXD: if (t->c_ospeed <= 12000000) return (0); @@ -871,21 +930,34 @@ uplcom_cfg_param(struct ucom_softc *ucom, struct termios *t) DPRINTF("crtscts = on\n"); req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = UPLCOM_SET_REQUEST; - USETW(req.wValue, 0); - if (sc->sc_chiptype != TYPE_PL2303) - USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); - else - USETW(req.wIndex, UPLCOM_SET_CRTSCTS); + if (sc->sc_chiptype == TYPE_PL2303HXN) { + req.bRequest = UPLCOM_SET_REQUEST_PL2303HXN; + USETW(req.wValue, UPLCOM_CRTSCTS_REG_PL2303HXN); + USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303HXN); + } else { + req.bRequest = UPLCOM_SET_REQUEST; + USETW(req.wValue, 0); + if (sc->sc_chiptype != TYPE_PL2303) + USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); + else + USETW(req.wIndex, UPLCOM_SET_CRTSCTS); + } USETW(req.wLength, 0); ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000); } else { req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = UPLCOM_SET_REQUEST; - USETW(req.wValue, 0); - USETW(req.wIndex, 0); + if (sc->sc_chiptype == TYPE_PL2303HXN) { + req.bRequest = UPLCOM_SET_REQUEST_PL2303HXN; + USETW(req.wValue, UPLCOM_CRTSCTS_REG_PL2303HXN); + USETW(req.wIndex, UPLCOM_CLEAR_CRTSCTS_PL2303HXN); + } + else { + req.bRequest = UPLCOM_SET_REQUEST; + USETW(req.wValue, 0); + USETW(req.wIndex, 0); + } USETW(req.wLength, 0); ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000); diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 5d52ff0f7217..2bb5e05035f6 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -3654,6 +3654,12 @@ product PROLIFIC MICROMAX_610U 0x0612 Micromax 610U product PROLIFIC DCU11 0x1234 DCU-11 Phone Cable product PROLIFIC UIC_MSR206 0x206a UIC MSR206 Card Reader product PROLIFIC PL2303 0x2303 PL2303 Serial (ATEN/IOGEAR UC232A) +product PROLIFIC PL2303GC 0x23a3 PL2303HXN Serial, type GC +product PROLIFIC PL2303GB 0x23b3 PL2303HXN Serial, type GB +product PROLIFIC PL2303GT 0x23c3 PL2303HXN Serial, type GT +product PROLIFIC PL2303GL 0x23d3 PL2303HXN Serial, type GL +product PROLIFIC PL2303GE 0x23e3 PL2303HXN Serial, type GE +product PROLIFIC PL2303GS 0x23f3 PL2303HXN Serial, type GS product PROLIFIC PL2305 0x2305 Parallel printer product PROLIFIC ATAPI4 0x2307 ATAPI-4 Controller product PROLIFIC PL2501 0x2501 PL2501 Host-Host interface From owner-dev-commits-src-all@freebsd.org Mon Feb 1 09:39: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 35E8D4F8926; Mon, 1 Feb 2021 09:39:33 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.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 4DTjZs0tnVz51jl; Mon, 1 Feb 2021 09:39:32 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f48.google.com with SMTP id p20so3936969ejb.6; Mon, 01 Feb 2021 01:39:32 -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:content-transfer-encoding; bh=qDgIXXlXn/ZsMLGnpHxLL5Mf5Ks35K5i0ppD9ym/oTE=; b=ThKALNjVUEBYE+ZuguiPxzTRQLKWsisH1zsbtaGTqtEgi0hk2lwt/tnXBgzcNt93sP tyaSiysySe4k5Wpn+nUw8CkTgVDIOa++5R8ALM1pXLO0c50W02YjvYtIO1BrCSr5Zn6/ r3Gs3NkJiXeKfYevpJ7oQl+OXXZxqlGRZLkmlKSL+uoB8pSZGYpL9u/5gQ7IRP3XdzPw kS1dIMCCyuRENmMp0BHCQteDdFWd7na+PW7Xa+/uBdE2ddavXdUeKRPiZSDER8WGM/uh 0h21beqx/LLaWV2O/5ygzPL1SvYVDSdNFNfVM/FkM9ajv9Vyy3jLkcCMmI8jueOgZtCD aU9w== X-Gm-Message-State: AOAM5320DkQNSEKpezl1XLwX0TvL8yiw8dXrzyvL9waE187DNhRyrohk 4Og2kmQ0k0GwNtbTt6kTgSJfBGmaYxPXlw== X-Google-Smtp-Source: ABdhPJzftq0SHA+c1pVCC2EynF5dr8756F7fQzpA9FeDIKam9r12P0JlNEDcb4cu9hiio14kqSCgSg== X-Received: by 2002:a17:907:20aa:: with SMTP id pw10mr16835664ejb.314.1612172371572; Mon, 01 Feb 2021 01:39:31 -0800 (PST) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com. [209.85.128.54]) by smtp.gmail.com with ESMTPSA id s18sm8599305edw.66.2021.02.01.01.39.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Feb 2021 01:39:31 -0800 (PST) Received: by mail-wm1-f54.google.com with SMTP id j18so12005195wmi.3; Mon, 01 Feb 2021 01:39:30 -0800 (PST) X-Received: by 2002:a05:600c:201:: with SMTP id 1mr14016391wmi.104.1612172370699; Mon, 01 Feb 2021 01:39:30 -0800 (PST) MIME-Version: 1.0 References: <202101071105.107B5tUX011254@gitrepo.freebsd.org> <20210110121242.1d9809ff@coosemans.org> In-Reply-To: From: Alexander Richardson Date: Mon, 1 Feb 2021 09:39:19 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 7fa2f2a62f04 - main - Rename NO_WERROR -> MK_WERROR=no To: Antoine Brodin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, =?UTF-8?Q?T=C4=B3l_Coosemans?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4DTjZs0tnVz51jl 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: Mon, 01 Feb 2021 09:39:33 -0000 On Sun, 31 Jan 2021 at 19:12, Antoine Brodin wrote: > > On Sun, Jan 10, 2021 at 12:12 PM T=C4=B3l Coosemans = wrote: > > > > On Thu, 7 Jan 2021 11:05:55 GMT Alex Richardson > > wrote: > > > The branch main has been updated by arichardson: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D7fa2f2a62f04f095e1e27a= d55aa22a8f59b1df8f > > > > > > commit 7fa2f2a62f04f095e1e27ad55aa22a8f59b1df8f > > > Author: Alex Richardson > > > AuthorDate: 2021-01-06 17:55:06 +0000 > > > Commit: Alex Richardson > > > CommitDate: 2021-01-07 09:31:03 +0000 > > > > > > Rename NO_WERROR -> MK_WERROR=3Dno > > > > > > As suggested in D27598. This also supports MK_WERROR.clang=3Dno a= nd > > > MK_WERROR.gcc=3Dno to support the existing NO_WERROR. u= ses. > > > > > > Reviewed By: brooks > > > Differential Revision: https://reviews.freebsd.org/D27601 > > > --- > > > diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk > > > index d0e7f1cb00ba..88c73cc6bfe4 100644 > > > --- a/share/mk/bsd.opts.mk > > > +++ b/share/mk/bsd.opts.mk > > > @@ -65,7 +65,8 @@ __DEFAULT_YES_OPTIONS =3D \ > > > SSP \ > > > TESTS \ > > > TOOLCHAIN \ > > > - WARNS > > > + WARNS \ > > > + WERROR > > > > > > __DEFAULT_NO_OPTIONS =3D \ > > > BIND_NOW \ > > > @@ -103,7 +104,8 @@ __DEFAULT_DEPENDENT_OPTIONS =3D \ > > > INSTALLLIB \ > > > MAN \ > > > PROFILE \ > > > - WARNS > > > + WARNS \ > > > + WERROR > > > .if defined(NO_${var}) > > > .error "NO_${var} is defined, but deprecated. Please use MK_${var}= =3Dno instead." > > > MK_${var}:=3Dno > > > > NO_WERROR is also used by some ports [1] (which have to build against > > multiple version of FreeBSD) and this turns it into an error. Can you > > remove this change or turn it into a warning maybe? Changes to share/m= k > > should always go through a ports exp-run IMHO. > > Ping Alex Richardson? > > Antoine (with hat: portmgr) Hi Antoine, I submitted https://reviews.freebsd.org/D28084 to change this error to a .i= nfo. However, T=C4=B3l said that there weren't many affected ports so this change should not be needed. I can commit this workaround, but if I do this just postpones the problem to when we want to remove the workaround (and might mean it will never be removed). Maybe those ports should just be built with a lower WARNS? Thanks, Alex From owner-dev-commits-src-all@freebsd.org Mon Feb 1 10:07: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 5E1CA4F904A; Mon, 1 Feb 2021 10:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTkCY2CZRz52yB; Mon, 1 Feb 2021 10:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EBE41961B; Mon, 1 Feb 2021 10:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 111A7rbg091528; Mon, 1 Feb 2021 10:07:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111A7rgD091527; Mon, 1 Feb 2021 10:07:53 GMT (envelope-from git) Date: Mon, 1 Feb 2021 10:07:53 GMT Message-Id: <202102011007.111A7rgD091527@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: 5cf6f1c4bc28 - main - Remove the MK_LIBCPLUSPLUS option 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: 5cf6f1c4bc281ac45ced086bc2e393f732f2fcc2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 10:07:53 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=5cf6f1c4bc281ac45ced086bc2e393f732f2fcc2 commit 5cf6f1c4bc281ac45ced086bc2e393f732f2fcc2 Author: Alex Richardson AuthorDate: 2021-01-30 17:56:35 +0000 Commit: Alex Richardson CommitDate: 2021-02-01 09:32:07 +0000 Remove the MK_LIBCPLUSPLUS option This option has been equivalent to any form of C++ support since libstdc++ was removed. Therefore, replace all MK_LIBCPLUSPLUS uses with MK_CXX. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D27974 --- Makefile.inc1 | 8 ++++---- lib/Makefile | 2 +- lib/libproc/Makefile | 4 +--- share/man/man5/src.conf.5 | 4 +--- share/mk/bsd.libnames.mk | 1 - share/mk/bsd.prog.mk | 4 ---- share/mk/src.libnames.mk | 4 ---- share/mk/src.opts.mk | 1 - tools/build/mk/OptionalObsoleteFiles.inc | 2 +- tools/build/options/WITHOUT_LIBCPLUSPLUS | 2 -- tools/build/options/WITH_LIBCPLUSPLUS | 2 -- 11 files changed, 8 insertions(+), 26 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 6387c68d25a5..005d9d25afb3 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2867,7 +2867,7 @@ _prereq_libs+= lib/libssp_nonshared _startup_libs= lib/csu _startup_libs+= lib/libc _startup_libs+= lib/libc_nonshared -.if ${MK_LIBCPLUSPLUS} != "no" +.if ${MK_CXX} != "no" _startup_libs+= lib/libcxxrt .endif @@ -2876,7 +2876,7 @@ _startup_libs+= lib/libgcc_eh lib/libgcc_s lib/libgcc_s__L: lib/libc__L lib/libgcc_s__L: lib/libc_nonshared__L -.if ${MK_LIBCPLUSPLUS} != "no" +.if ${MK_CXX} != "no" lib/libcxxrt__L: lib/libgcc_s__L .endif @@ -2925,7 +2925,7 @@ gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncurses__L _prebuild_libs+= lib/libregex .endif -.if ${MK_LIBCPLUSPLUS} != "no" +.if ${MK_CXX} != "no" _prebuild_libs+= lib/libc++ .endif @@ -3089,7 +3089,7 @@ lib/libradius__L: lib/libmd__L lib/libproc__L: \ ${_cddl_lib_libctf:D${_cddl_lib_libctf}__L} lib/libelf__L lib/librtld_db__L lib/libutil__L -.if ${MK_CXX} != "no" && ${MK_LIBCPLUSPLUS} != "no" +.if ${MK_CXX} != "no" lib/libproc__L: lib/libcxxrt__L .endif diff --git a/lib/Makefile b/lib/Makefile index ddb627917215..48276fcd361e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -182,7 +182,7 @@ SUBDIR.${MK_STATS}+= libstats _libclang_rt= libclang_rt .endif -.if ${MK_LIBCPLUSPLUS} != "no" +.if ${MK_CXX} != "no" _libcxxrt= libcxxrt _libcplusplus= libc++ _libcplusplus+= libc++experimental diff --git a/lib/libproc/Makefile b/lib/libproc/Makefile index 80423741e4a9..434d78bb6933 100644 --- a/lib/libproc/Makefile +++ b/lib/libproc/Makefile @@ -18,10 +18,8 @@ CFLAGS+= -I${.CURDIR} .if ${MK_CXX} == "no" CFLAGS+= -DNO_CXA_DEMANGLE -.elif ${MK_LIBCPLUSPLUS} != "no" -LIBADD+= cxxrt .else -LIBADD+= supcplusplus +LIBADD+= cxxrt .endif LIBADD+= elf procstat rtld_db util diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 0e853db0d1bc..81656db323ed 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 January 30, 2021 +.Dd February 1, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -859,8 +859,6 @@ runtime linker. .Pp This is a default setting on arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mips, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. -.It Va WITHOUT_LIBCPLUSPLUS -Set to avoid building libcxxrt and libc++. .It Va WITH_LIBSOFT On armv6 only, set to enable soft float ABI compatibility libraries. This option is for transitioning to the new hard float ABI. diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index d030292d3c5e..7f591d3fd3f7 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -141,7 +141,6 @@ LIBSPL?= ${LIBDESTDIR}${LIBDIR_BASE}/libspl.a LIBSSL?= ${LIBDESTDIR}${LIBDIR_BASE}/libssl.a LIBSSP_NONSHARED?= ${LIBDESTDIR}${LIBDIR_BASE}/libssp_nonshared.a LIBSTATS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstats.a -LIBSTDCPLUSPLUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdc++.a LIBSTDTHREADS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdthreads.a LIBSYSDECODE?= ${LIBDESTDIR}${LIBDIR_BASE}/libsysdecode.a LIBTACPLUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libtacplus.a diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 5e7aaaeb37f8..44a774957cfb 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -261,11 +261,7 @@ _EXTRADEPEND: .else echo ${PROG_FULL}: ${LIBC} ${DPADD} >> ${DEPENDFILE} .if defined(PROG_CXX) -.if ${COMPILER_TYPE} == "clang" && empty(CXXFLAGS:M-stdlib=libstdc++) echo ${PROG_FULL}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} -.else - echo ${PROG_FULL}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} -.endif .endif .endif .endif # !defined(NO_EXTRADEPEND) diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 32cd1677bcd4..1d3195f53eb1 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -298,11 +298,7 @@ _DP_radius= crypto _DP_rtld_db= elf procstat _DP_procstat= kvm util elf .if ${MK_CXX} == "yes" -.if ${MK_LIBCPLUSPLUS} != "no" _DP_proc= cxxrt -.else -_DP_proc= supcplusplus -.endif .endif .if ${MK_CDDL} != "no" _DP_proc+= ctf diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index e531916b5976..d3f7e33f276c 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -125,7 +125,6 @@ __DEFAULT_YES_OPTIONS = \ LDNS \ LDNS_UTILS \ LEGACY_CONSOLE \ - LIBCPLUSPLUS \ LLD \ LLD_BOOTSTRAP \ LLD_IS_LD \ diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 4a075a78cf70..87fab14e45e7 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -3793,7 +3793,7 @@ OLD_LIBS+=${DEBUG_LIB32_LIBS} . endif .endif -.if ${MK_LIBCPLUSPLUS} == no +.if ${MK_CXX} == no OLD_LIBS+=lib/libcxxrt.so.1 OLD_FILES+=usr/lib/libc++.a OLD_FILES+=usr/lib/libc++_p.a diff --git a/tools/build/options/WITHOUT_LIBCPLUSPLUS b/tools/build/options/WITHOUT_LIBCPLUSPLUS deleted file mode 100644 index 2449e30d4b10..000000000000 --- a/tools/build/options/WITHOUT_LIBCPLUSPLUS +++ /dev/null @@ -1,2 +0,0 @@ -.\" $FreeBSD$ -Set to avoid building libcxxrt and libc++. diff --git a/tools/build/options/WITH_LIBCPLUSPLUS b/tools/build/options/WITH_LIBCPLUSPLUS deleted file mode 100644 index 0f30dd8c1e4f..000000000000 --- a/tools/build/options/WITH_LIBCPLUSPLUS +++ /dev/null @@ -1,2 +0,0 @@ -.\" $FreeBSD$ -Set to build libcxxrt and libc++. From owner-dev-commits-src-all@freebsd.org Mon Feb 1 11:01: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 6FC044FA5C1; Mon, 1 Feb 2021 11:01: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 4DTlPG2nrTz55Xf; Mon, 1 Feb 2021 11:01: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 52EAC19F5C; Mon, 1 Feb 2021 11:01: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 111B1MUu065147; Mon, 1 Feb 2021 11:01:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111B1M2H065146; Mon, 1 Feb 2021 11:01:22 GMT (envelope-from git) Date: Mon, 1 Feb 2021 11:01:22 GMT Message-Id: <202102011101.111B1M2H065146@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: 3447df8bc5b3 - main - cxgbe(4): Fixes to tx coalescing. 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: 3447df8bc5b342bd88d565641435284ff620ee2a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 11:01:22 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=3447df8bc5b342bd88d565641435284ff620ee2a commit 3447df8bc5b342bd88d565641435284ff620ee2a Author: Navdeep Parhar AuthorDate: 2021-02-01 11:00:09 +0000 Commit: Navdeep Parhar CommitDate: 2021-02-01 11:00:09 +0000 cxgbe(4): Fixes to tx coalescing. - The behavior implemented in r362905 resulted in delayed transmission of packets in some cases, causing performance issues. Use a different heuristic to predict tx requests. - Add a tunable/sysctl (hw.cxgbe.tx_coalesce) to disable tx coalescing entirely. It can be changed at any time. There is no change in default behavior. --- sys/dev/cxgbe/adapter.h | 4 ++- sys/dev/cxgbe/t4_main.c | 1 + sys/dev/cxgbe/t4_sge.c | 69 ++++++++++++++++++++++++++++++++++++++++--------- sys/dev/cxgbe/t4_vf.c | 1 + 4 files changed, 62 insertions(+), 13 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 37afa7cf7780..4b2f86d00052 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -561,7 +561,7 @@ struct txpkts { uint8_t wr_type; /* type 0 or type 1 */ uint8_t npkt; /* # of packets in this work request */ uint8_t len16; /* # of 16B pieces used by this work request */ - uint8_t score; /* 1-10. coalescing attempted if score > 3 */ + uint8_t score; uint8_t max_npkt; /* maximum number of packets allowed */ uint16_t plen; /* total payload (sum of all packets) */ @@ -584,6 +584,7 @@ struct sge_txq { struct sglist *gl; __be32 cpl_ctrl0; /* for convenience */ int tc_idx; /* traffic class */ + uint64_t last_tx; /* cycle count when eth_tx was last called */ struct txpkts txp; struct task tx_reclaim_task; @@ -599,6 +600,7 @@ struct sge_txq { uint64_t txpkts1_wrs; /* # of type1 coalesced tx work requests */ uint64_t txpkts0_pkts; /* # of frames in type0 coalesced tx WRs */ uint64_t txpkts1_pkts; /* # of frames in type1 coalesced tx WRs */ + uint64_t txpkts_flush; /* # of times txp had to be sent by tx_update */ uint64_t raw_wrs; /* # of raw work requests (alloc_wr_mbuf) */ uint64_t vxlan_tso_wrs; /* # of VXLAN TSO work requests */ uint64_t vxlan_txcsum; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 994fe2e78de5..18a83df763ab 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -10718,6 +10718,7 @@ clear_stats(struct adapter *sc, u_int port_id) txq->txpkts1_wrs = 0; txq->txpkts0_pkts = 0; txq->txpkts1_pkts = 0; + txq->txpkts_flush = 0; txq->raw_wrs = 0; txq->vxlan_tso_wrs = 0; txq->vxlan_txcsum = 0; diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index f9553bbbce67..45f07358f0db 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -212,6 +212,22 @@ static counter_u64_t defrags; SYSCTL_COUNTER_U64(_hw_cxgbe, OID_AUTO, defrags, CTLFLAG_RD, &defrags, "Number of mbuf defrags performed"); +static int t4_tx_coalesce = 1; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_coalesce, CTLFLAG_RWTUN, &t4_tx_coalesce, 0, + "tx coalescing allowed"); + +/* + * The driver will make aggressive attempts at tx coalescing if it sees these + * many packets eligible for coalescing in quick succession, with no more than + * the specified gap in between the eth_tx calls that delivered the packets. + */ +static int t4_tx_coalesce_pkts = 32; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_coalesce_pkts, CTLFLAG_RWTUN, + &t4_tx_coalesce_pkts, 0, + "# of consecutive packets (1 - 255) that will trigger tx coalescing"); +static int t4_tx_coalesce_gap = 5; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_coalesce_gap, CTLFLAG_RWTUN, + &t4_tx_coalesce_gap, 0, "tx gap (in microseconds)"); static int service_iq(struct sge_iq *, int); static int service_iq_fl(struct sge_iq *, int); @@ -3120,6 +3136,26 @@ set_txupdate_flags(struct sge_txq *txq, u_int avail, } } +#if defined(__i386__) || defined(__amd64__) +extern uint64_t tsc_freq; +#endif + +static inline bool +record_eth_tx_time(struct sge_txq *txq) +{ + const uint64_t cycles = get_cyclecount(); + const uint64_t last_tx = txq->last_tx; +#if defined(__i386__) || defined(__amd64__) + const uint64_t itg = tsc_freq * t4_tx_coalesce_gap / 1000000; +#else + const uint64_t itg = 0; +#endif + + MPASS(cycles >= last_tx); + txq->last_tx = cycles; + return (cycles - last_tx < itg); +} + /* * r->items[cidx] to r->items[pidx], with a wraparound at r->size, are ready to * be consumed. Return the actual number consumed. 0 indicates a stall. @@ -3137,10 +3173,11 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) u_int n, avail, dbdiff; /* # of hardware descriptors */ int i, rc; struct mbuf *m0; - bool snd; + bool snd, recent_tx; void *wr; /* start of the last WR written to the ring */ TXQ_LOCK_ASSERT_OWNED(txq); + recent_tx = record_eth_tx_time(txq); remaining = IDXDIFF(pidx, cidx, r->size); if (__predict_false(discard_tx(eq))) { @@ -3159,17 +3196,15 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) } /* How many hardware descriptors do we have readily available. */ - if (eq->pidx == eq->cidx) { + if (eq->pidx == eq->cidx) avail = eq->sidx - 1; - if (txp->score++ >= 5) - txp->score = 5; /* tx is completely idle, reset. */ - } else + else avail = IDXDIFF(eq->cidx, eq->pidx, eq->sidx) - 1; total = 0; if (remaining == 0) { - if (txp->score-- == 1) /* egr_update had to drain txpkts */ - txp->score = 1; + txp->score = 0; + txq->txpkts_flush++; goto send_txpkts; } @@ -3183,7 +3218,17 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) if (avail < 2 * SGE_MAX_WR_NDESC) avail += reclaim_tx_descs(txq, 64); - if (txp->npkt > 0 || remaining > 1 || txp->score > 3 || + if (t4_tx_coalesce == 0 && txp->npkt == 0) + goto skip_coalescing; + if (cannot_use_txpkts(m0)) + txp->score = 0; + else if (recent_tx) { + if (++txp->score == 0) + txp->score = UINT8_MAX; + } else + txp->score = 1; + if (txp->npkt > 0 || remaining > 1 || + txp->score >= t4_tx_coalesce_pkts || atomic_load_int(&txq->eq.equiq) != 0) { if (vi->flags & TX_USES_VM_WR) rc = add_to_txpkts_vf(sc, txq, m0, avail, &snd); @@ -3198,8 +3243,6 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) for (i = 0; i < txp->npkt; i++) ETHER_BPF_MTAP(ifp, txp->mb[i]); if (txp->npkt > 1) { - if (txp->score++ >= 10) - txp->score = 10; MPASS(avail >= tx_len16_to_desc(txp->len16)); if (vi->flags & TX_USES_VM_WR) n = write_txpkts_vm_wr(sc, txq); @@ -3239,7 +3282,7 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) MPASS(rc != 0 && rc != EAGAIN); MPASS(txp->npkt == 0); - +skip_coalescing: n = tx_len16_to_desc(mbuf_len16(m0)); if (__predict_false(avail < n)) { avail += reclaim_tx_descs(txq, min(n, 32)); @@ -4304,7 +4347,6 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx, M_ZERO | M_WAITOK); txp = &txq->txp; - txp->score = 5; MPASS(nitems(txp->mb) >= sc->params.max_pkts_per_eth_tx_pkts_wr); txq->txp.max_npkt = min(nitems(txp->mb), sc->params.max_pkts_per_eth_tx_pkts_wr); @@ -4363,6 +4405,9 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx, SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts1_pkts", CTLFLAG_RD, &txq->txpkts1_pkts, "# of frames tx'd using type1 txpkts work requests"); + SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts_flush", + CTLFLAG_RD, &txq->txpkts_flush, + "# of times txpkts had to be flushed out by an egress-update"); SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "raw_wrs", CTLFLAG_RD, &txq->raw_wrs, "# of raw work requests (non-packets)"); SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "vxlan_tso_wrs", diff --git a/sys/dev/cxgbe/t4_vf.c b/sys/dev/cxgbe/t4_vf.c index 223ffe7aeaa0..6c736e37faac 100644 --- a/sys/dev/cxgbe/t4_vf.c +++ b/sys/dev/cxgbe/t4_vf.c @@ -893,6 +893,7 @@ t4vf_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, txq->txpkts1_wrs = 0; txq->txpkts0_pkts = 0; txq->txpkts1_pkts = 0; + txq->txpkts_flush = 0; mp_ring_reset_stats(txq->r); } } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:20: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 1FE364FD959; Mon, 1 Feb 2021 12:20: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 4DTn8c0VWXz3CG5; Mon, 1 Feb 2021 12:20: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 03CBA1B11E; Mon, 1 Feb 2021 12:20: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 111CKVdl068679; Mon, 1 Feb 2021 12:20:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CKVrt068678; Mon, 1 Feb 2021 12:20:31 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:20:31 GMT Message-Id: <202102011220.111CKVrt068678@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: 69c5fa5cd1ec - main - zfs: remove incomplete ifdefs for lockless symlink support 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: 69c5fa5cd1ec9b09ed88a086607a8a0993818db9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:20:32 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=69c5fa5cd1ec9b09ed88a086607a8a0993818db9 commit 69c5fa5cd1ec9b09ed88a086607a8a0993818db9 Author: Mateusz Guzik AuthorDate: 2021-02-01 12:18:27 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:18:27 +0000 zfs: remove incomplete ifdefs for lockless symlink support This wil be handled differently upstream and merged later. --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 35e54a2e1560..42f5786ce5c7 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -4463,7 +4463,6 @@ zfs_freebsd_fplookup_vexec(struct vop_fplookup_vexec_args *v) } #endif -#if __FreeBSD_version >= 1400001 static int zfs_freebsd_fplookup_symlink(struct vop_fplookup_symlink_args *v) { @@ -4483,7 +4482,6 @@ zfs_freebsd_fplookup_symlink(struct vop_fplookup_symlink_args *v) } return (cache_symlink_resolve(v->a_fpl, target, strlen(target))); } -#endif #ifndef _SYS_SYSPROTO_H_ struct vop_access_args { @@ -5797,9 +5795,7 @@ struct vop_vector zfs_vnodeops = { #if __FreeBSD_version >= 1300102 .vop_fplookup_vexec = zfs_freebsd_fplookup_vexec, #endif -#if __FreeBSD_version >= 1400001 .vop_fplookup_symlink = zfs_freebsd_fplookup_symlink, -#endif .vop_access = zfs_freebsd_access, .vop_allocate = VOP_EINVAL, .vop_lookup = zfs_cache_lookup, @@ -5849,9 +5845,7 @@ struct vop_vector zfs_fifoops = { #if __FreeBSD_version >= 1300102 .vop_fplookup_vexec = zfs_freebsd_fplookup_vexec, #endif -#if __FreeBSD_version >= 1400001 .vop_fplookup_symlink = zfs_freebsd_fplookup_symlink, -#endif .vop_access = zfs_freebsd_access, .vop_getattr = zfs_freebsd_getattr, .vop_inactive = zfs_freebsd_inactive, @@ -5875,9 +5869,7 @@ struct vop_vector zfs_shareops = { #if __FreeBSD_version >= 1300121 .vop_fplookup_vexec = VOP_EAGAIN, #endif -#if __FreeBSD_version >= 1400001 .vop_fplookup_symlink = VOP_EAGAIN, -#endif .vop_access = zfs_freebsd_access, .vop_inactive = zfs_freebsd_inactive, .vop_reclaim = zfs_freebsd_reclaim, From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12: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 21F2D4FE93E; Mon, 1 Feb 2021 12:40: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 4DTnbg0W5dz3Dms; Mon, 1 Feb 2021 12:40: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 043051B68F; Mon, 1 Feb 2021 12:40: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 111CeU86094619; Mon, 1 Feb 2021 12:40:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CeURH094618; Mon, 1 Feb 2021 12:40:30 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:30 GMT Message-Id: <202102011240.111CeURH094618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: dcee9964238b - stable/13 - cache: add symlink support to lockless lookup 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/stable/13 X-Git-Reftype: branch X-Git-Commit: dcee9964238b12a8e55917f292139f074b1a80b2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:31 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=dcee9964238b12a8e55917f292139f074b1a80b2 commit dcee9964238b12a8e55917f292139f074b1a80b2 Author: Mateusz Guzik AuthorDate: 2021-01-23 13:40:48 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:37:46 +0000 cache: add symlink support to lockless lookup Reviewed by: kib (previous version) Tested by: pho (previous version) Differential Revision: https://reviews.freebsd.org/D27488 --- sys/fs/deadfs/dead_vnops.c | 1 + sys/kern/vfs_cache.c | 214 ++++++++++++++++++++++++++++++++++++++------- sys/kern/vfs_lookup.c | 11 ++- sys/kern/vfs_subr.c | 13 +++ sys/kern/vnode_if.src | 10 +++ sys/sys/namei.h | 4 +- sys/sys/param.h | 2 +- sys/sys/vnode.h | 9 ++ 8 files changed, 227 insertions(+), 37 deletions(-) diff --git a/sys/fs/deadfs/dead_vnops.c b/sys/fs/deadfs/dead_vnops.c index 49f852791387..09c3c996ee0e 100644 --- a/sys/fs/deadfs/dead_vnops.c +++ b/sys/fs/deadfs/dead_vnops.c @@ -80,6 +80,7 @@ struct vop_vector dead_vnodeops = { .vop_unset_text = dead_unset_text, .vop_write = dead_write, .vop_fplookup_vexec = VOP_EOPNOTSUPP, + .vop_fplookup_symlink = VOP_EAGAIN, }; VFS_VOP_VECTOR_REGISTER(dead_vnodeops); diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index cfa25dc59ee4..770c8ebf061b 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -562,6 +562,36 @@ static uma_zone_t __read_mostly cache_zone_small_ts; static uma_zone_t __read_mostly cache_zone_large; static uma_zone_t __read_mostly cache_zone_large_ts; +char * +cache_symlink_alloc(size_t size, int flags) +{ + + if (size < CACHE_ZONE_SMALL_SIZE) { + return (uma_zalloc_smr(cache_zone_small, flags)); + } + if (size < CACHE_ZONE_LARGE_SIZE) { + return (uma_zalloc_smr(cache_zone_large, flags)); + } + return (NULL); +} + +void +cache_symlink_free(char *string, size_t size) +{ + + MPASS(string != NULL); + + if (size < CACHE_ZONE_SMALL_SIZE) { + uma_zfree_smr(cache_zone_small, string); + return; + } + if (size < CACHE_ZONE_LARGE_SIZE) { + uma_zfree_smr(cache_zone_large, string); + return; + } + __assert_unreachable(); +} + static struct namecache * cache_alloc_uma(int len, bool ts) { @@ -3584,6 +3614,7 @@ cache_fast_lookup_enabled_recalc(void) #ifdef MAC mac_on = mac_vnode_check_lookup_enabled(); + mac_on |= mac_vnode_check_readlink_enabled(); #else mac_on = 0; #endif @@ -3615,6 +3646,7 @@ SYSCTL_PROC(_vfs, OID_AUTO, cache_fast_lookup, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MP * need restoring in case fast path lookup fails. */ struct nameidata_outer { + size_t ni_pathlen; int cn_flags; }; @@ -3656,8 +3688,10 @@ static bool cache_fplookup_is_mp(struct cache_fpl *fpl); static int cache_fplookup_cross_mount(struct cache_fpl *fpl); static int cache_fplookup_partial_setup(struct cache_fpl *fpl); static int cache_fplookup_skip_slashes(struct cache_fpl *fpl); +static int cache_fplookup_preparse(struct cache_fpl *fpl); static void cache_fpl_pathlen_dec(struct cache_fpl *fpl); static void cache_fpl_pathlen_inc(struct cache_fpl *fpl); +static void cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n); static void cache_fpl_pathlen_sub(struct cache_fpl *fpl, size_t n); static void @@ -3698,6 +3732,7 @@ static void cache_fpl_checkpoint_outer(struct cache_fpl *fpl) { + fpl->snd_outer.ni_pathlen = fpl->ndp->ni_pathlen; fpl->snd_outer.cn_flags = fpl->ndp->ni_cnd.cn_flags; } @@ -3731,6 +3766,7 @@ cache_fpl_restore_abort(struct cache_fpl *fpl) */ fpl->ndp->ni_resflags = 0; fpl->ndp->ni_cnd.cn_nameptr = fpl->ndp->ni_cnd.cn_pnbuf; + fpl->ndp->ni_pathlen = fpl->snd_outer.ni_pathlen; } #ifdef INVARIANTS @@ -3752,6 +3788,7 @@ cache_fpl_assert_status(struct cache_fpl *fpl) case CACHE_FPL_STATUS_UNSET: __assert_unreachable(); break; + case CACHE_FPL_STATUS_DESTROYED: case CACHE_FPL_STATUS_ABORTED: case CACHE_FPL_STATUS_PARTIAL: case CACHE_FPL_STATUS_HANDLED: @@ -3804,6 +3841,11 @@ cache_fpl_aborted_early_impl(struct cache_fpl *fpl, int line) static int __noinline cache_fpl_aborted_impl(struct cache_fpl *fpl, int line) { + struct nameidata *ndp; + struct componentname *cnp; + + ndp = fpl->ndp; + cnp = fpl->cnp; if (fpl->status != CACHE_FPL_STATUS_UNSET) { KASSERT(fpl->status == CACHE_FPL_STATUS_PARTIAL, @@ -3815,6 +3857,14 @@ cache_fpl_aborted_impl(struct cache_fpl *fpl, int line) if (fpl->in_smr) cache_fpl_smr_exit(fpl); cache_fpl_restore_abort(fpl); + /* + * Resolving symlinks overwrites data passed by the caller. + * Let namei know. + */ + if (ndp->ni_loopcnt > 0) { + fpl->status = CACHE_FPL_STATUS_DESTROYED; + cache_fpl_cleanup_cnp(cnp); + } return (CACHE_FPL_FAILED); } @@ -3955,13 +4005,6 @@ cache_fplookup_dirfd(struct cache_fpl *fpl, struct vnode **vpp) return (0); } -static bool -cache_fplookup_vnode_supported(struct vnode *vp) -{ - - return (vp->v_type != VLNK); -} - static int __noinline cache_fplookup_negative_promote(struct cache_fpl *fpl, struct namecache *oncp, uint32_t hash) @@ -4242,8 +4285,7 @@ cache_fplookup_final_modifying(struct cache_fpl *fpl) * Since we expect this to be the terminal vnode it should * almost never be true. */ - if (__predict_false(!cache_fplookup_vnode_supported(tvp) || - cache_fplookup_is_mp(fpl))) { + if (__predict_false(tvp->v_type == VLNK || cache_fplookup_is_mp(fpl))) { vput(dvp); vput(tvp); return (cache_fpl_aborted(fpl)); @@ -4546,8 +4588,7 @@ cache_fplookup_noentry(struct cache_fpl *fpl) return (cache_fpl_handled(fpl)); } - if (__predict_false(!cache_fplookup_vnode_supported(tvp) || - cache_fplookup_is_mp(fpl))) { + if (__predict_false(tvp->v_type == VLNK || cache_fplookup_is_mp(fpl))) { vput(dvp); vput(tvp); return (cache_fpl_aborted(fpl)); @@ -4688,6 +4729,102 @@ cache_fplookup_neg(struct cache_fpl *fpl, struct namecache *ncp, uint32_t hash) return (cache_fpl_handled_error(fpl, ENOENT)); } +/* + * Resolve a symlink. Called by filesystem-specific routines. + * + * Code flow is: + * ... -> cache_fplookup_symlink -> VOP_FPLOOKUP_SYMLINK -> cache_symlink_resolve + */ +int +cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) +{ + struct nameidata *ndp; + struct componentname *cnp; + + ndp = fpl->ndp; + cnp = fpl->cnp; + + if (__predict_false(len == 0)) { + return (ENOENT); + } + + ndp->ni_pathlen = fpl->nulchar - cnp->cn_nameptr - cnp->cn_namelen + 1; +#ifdef INVARIANTS + if (ndp->ni_pathlen != fpl->debug.ni_pathlen) { + panic("%s: mismatch (%zu != %zu) nulchar %p nameptr %p [%s] ; full string [%s]\n", + __func__, ndp->ni_pathlen, fpl->debug.ni_pathlen, fpl->nulchar, + cnp->cn_nameptr, cnp->cn_nameptr, cnp->cn_pnbuf); + } +#endif + + if (__predict_false(len + ndp->ni_pathlen > MAXPATHLEN)) { + return (ENAMETOOLONG); + } + + if (__predict_false(ndp->ni_loopcnt++ >= MAXSYMLINKS)) { + return (ELOOP); + } + + if (ndp->ni_pathlen > 1) { + bcopy(ndp->ni_next, cnp->cn_pnbuf + len, ndp->ni_pathlen); + } else { + cnp->cn_pnbuf[len] = '\0'; + } + bcopy(string, cnp->cn_pnbuf, len); + + ndp->ni_pathlen += len; + cache_fpl_pathlen_add(fpl, len); + cnp->cn_nameptr = cnp->cn_pnbuf; + fpl->nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; + + return (0); +} + +static int __noinline +cache_fplookup_symlink(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + struct componentname *cnp; + struct vnode *dvp, *tvp; + int error; + + ndp = fpl->ndp; + cnp = fpl->cnp; + dvp = fpl->dvp; + tvp = fpl->tvp; + + if (cache_fpl_islastcn(ndp)) { + if ((cnp->cn_flags & FOLLOW) == 0) { + return (cache_fplookup_final(fpl)); + } + } + + error = VOP_FPLOOKUP_SYMLINK(tvp, fpl); + if (__predict_false(error != 0)) { + switch (error) { + case EAGAIN: + return (cache_fpl_partial(fpl)); + case ENOENT: + case ENAMETOOLONG: + case ELOOP: + cache_fpl_smr_exit(fpl); + return (cache_fpl_handled_error(fpl, error)); + default: + return (cache_fpl_aborted(fpl)); + } + } + + if (*(cnp->cn_nameptr) == '/') { + fpl->dvp = cache_fpl_handle_root(fpl); + fpl->dvp_seqc = vn_seqc_read_any(fpl->dvp); + if (seqc_in_modify(fpl->dvp_seqc)) { + return (cache_fpl_aborted(fpl)); + } + } + + return (cache_fplookup_preparse(fpl)); +} + static int cache_fplookup_next(struct cache_fpl *fpl) { @@ -4743,10 +4880,6 @@ cache_fplookup_next(struct cache_fpl *fpl) return (cache_fpl_partial(fpl)); } - if (!cache_fplookup_vnode_supported(tvp)) { - return (cache_fpl_partial(fpl)); - } - counter_u64_add(numposhits, 1); SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, tvp); @@ -4931,7 +5064,16 @@ static void cache_fpl_pathlen_inc(struct cache_fpl *fpl) { - fpl->debug.ni_pathlen++; + cache_fpl_pathlen_add(fpl, 1); +} + +static void +cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n) +{ + + fpl->debug.ni_pathlen += n; + KASSERT(fpl->debug.ni_pathlen <= PATH_MAX, + ("%s: pathlen overflow to %zd\n", __func__, fpl->debug.ni_pathlen)); } static void @@ -4953,13 +5095,18 @@ cache_fpl_pathlen_inc(struct cache_fpl *fpl) { } +static void +cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n) +{ +} + static void cache_fpl_pathlen_sub(struct cache_fpl *fpl, size_t n) { } #endif -static int +static int __always_inline cache_fplookup_preparse(struct cache_fpl *fpl) { struct componentname *cnp; @@ -5238,8 +5385,6 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } - VNPASS(cache_fplookup_vnode_supported(fpl->dvp), fpl->dvp); - error = cache_fplookup_preparse(fpl); if (__predict_false(cache_fpl_terminated(fpl))) { return (error); @@ -5251,8 +5396,6 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) break; } - VNPASS(cache_fplookup_vnode_supported(fpl->dvp), fpl->dvp); - error = VOP_FPLOOKUP_VEXEC(fpl->dvp, cnp->cn_cred); if (__predict_false(error != 0)) { error = cache_fplookup_failed_vexec(fpl, error); @@ -5266,20 +5409,27 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); - if (cache_fpl_islastcn(ndp)) { - error = cache_fplookup_final(fpl); - break; - } + if (fpl->tvp->v_type == VLNK) { + error = cache_fplookup_symlink(fpl); + if (cache_fpl_terminated(fpl)) { + break; + } + } else { + if (cache_fpl_islastcn(ndp)) { + error = cache_fplookup_final(fpl); + break; + } - if (!vn_seqc_consistent(fpl->dvp, fpl->dvp_seqc)) { - error = cache_fpl_aborted(fpl); - break; - } + if (!vn_seqc_consistent(fpl->dvp, fpl->dvp_seqc)) { + error = cache_fpl_aborted(fpl); + break; + } - fpl->dvp = fpl->tvp; - fpl->dvp_seqc = fpl->tvp_seqc; + fpl->dvp = fpl->tvp; + fpl->dvp_seqc = fpl->tvp_seqc; + cache_fplookup_parse_advance(fpl); + } - cache_fplookup_parse_advance(fpl); cache_fpl_checkpoint(fpl); } diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index b6529623ecbb..ad65ab11bb1d 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -578,6 +578,7 @@ namei(struct nameidata *ndp) ndp->ni_startdir->v_type == VBAD); ndp->ni_lcf = 0; + ndp->ni_loopcnt = 0; ndp->ni_vp = NULL; error = namei_getpath(ndp); @@ -611,8 +612,16 @@ namei(struct nameidata *ndp) TAILQ_INIT(&ndp->ni_cap_tracker); dp = ndp->ni_startdir; break; + case CACHE_FPL_STATUS_DESTROYED: + ndp->ni_loopcnt = 0; + error = namei_getpath(ndp); + if (__predict_false(error != 0)) { + return (error); + } + /* FALLTHROUGH */ case CACHE_FPL_STATUS_ABORTED: TAILQ_INIT(&ndp->ni_cap_tracker); + MPASS(ndp->ni_lcf == 0); error = namei_setup(ndp, &dp, &pwd); if (error != 0) { namei_cleanup_cnp(cnp); @@ -621,8 +630,6 @@ namei(struct nameidata *ndp) break; } - ndp->ni_loopcnt = 0; - /* * Locked lookup. */ diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 8461fd0d49b5..047e4c54f0c5 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -5452,6 +5452,19 @@ vop_fplookup_vexec_debugpost(void *ap __unused, int rc __unused) VFS_SMR_ASSERT_ENTERED(); } +void +vop_fplookup_symlink_debugpre(void *ap __unused) +{ + + VFS_SMR_ASSERT_ENTERED(); +} + +void +vop_fplookup_symlink_debugpost(void *ap __unused, int rc __unused) +{ + + VFS_SMR_ASSERT_ENTERED(); +} void vop_strategy_debugpre(void *ap) { diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index ed6f3bf9d61b..5d15d4a0c863 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -156,6 +156,16 @@ vop_fplookup_vexec { }; +%% fplookup_symlink vp - - - +%! fplookup_symlink debugpre vop_fplookup_symlink_debugpre +%! fplookup_symlink debugpost vop_fplookup_symlink_debugpost + +vop_fplookup_symlink { + IN struct vnode *vp; + IN struct cache_fpl *fpl; +}; + + %% access vp L L L vop_access { diff --git a/sys/sys/namei.h b/sys/sys/namei.h index c045bc7c6bc5..1f9bae9e2753 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -116,8 +116,8 @@ struct nameidata { #ifdef _KERNEL -enum cache_fpl_status { CACHE_FPL_STATUS_ABORTED, CACHE_FPL_STATUS_PARTIAL, - CACHE_FPL_STATUS_HANDLED, CACHE_FPL_STATUS_UNSET }; +enum cache_fpl_status { CACHE_FPL_STATUS_DESTROYED, CACHE_FPL_STATUS_ABORTED, + CACHE_FPL_STATUS_PARTIAL, CACHE_FPL_STATUS_HANDLED, CACHE_FPL_STATUS_UNSET }; int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, struct pwd **pwdp); diff --git a/sys/sys/param.h b/sys/sys/param.h index 97ec07ed3a4d..afa5d9a2e3a8 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300137 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300138 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 0eadfec02313..ffd0bdad940d 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -66,6 +66,7 @@ enum vgetstate { VGET_NONE, VGET_HOLDCNT, VGET_USECOUNT }; */ struct namecache; +struct cache_fpl; struct vpollinfo { struct mtx vpi_lock; /* lock to protect below */ @@ -646,6 +647,10 @@ void cache_purge(struct vnode *vp); void cache_purge_vgone(struct vnode *vp); void cache_purge_negative(struct vnode *vp); void cache_purgevfs(struct mount *mp); +char *cache_symlink_alloc(size_t size, int flags); +void cache_symlink_free(char *string, size_t size); +int cache_symlink_resolve(struct cache_fpl *fpl, const char *string, + size_t len); void cache_vop_rename(struct vnode *fdvp, struct vnode *fvp, struct vnode *tdvp, struct vnode *tvp, struct componentname *fcnp, struct componentname *tcnp); void cache_vop_rmdir(struct vnode *dvp, struct vnode *vp); @@ -900,6 +905,8 @@ int vop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a); #ifdef DEBUG_VFS_LOCKS void vop_fplookup_vexec_debugpre(void *a); void vop_fplookup_vexec_debugpost(void *a, int rc); +void vop_fplookup_symlink_debugpre(void *a); +void vop_fplookup_symlink_debugpost(void *a, int rc); void vop_strategy_debugpre(void *a); void vop_lock_debugpre(void *a); void vop_lock_debugpost(void *a, int rc); @@ -910,6 +917,8 @@ void vop_mkdir_debugpost(void *a, int rc); #else #define vop_fplookup_vexec_debugpre(x) do { } while (0) #define vop_fplookup_vexec_debugpost(x, y) do { } while (0) +#define vop_fplookup_symlink_debugpre(x) do { } while (0) +#define vop_fplookup_symlink_debugpost(x, y) do { } while (0) #define vop_strategy_debugpre(x) do { } while (0) #define vop_lock_debugpre(x) do { } while (0) #define vop_lock_debugpost(x, y) do { } while (0) From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 549464FE9B6; Mon, 1 Feb 2021 12:40: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 4DTnbh1VNGz3DqJ; Mon, 1 Feb 2021 12:40: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 24F001B2A7; Mon, 1 Feb 2021 12:40: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 111CeWxS094638; Mon, 1 Feb 2021 12:40:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CeWnU094637; Mon, 1 Feb 2021 12:40:32 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:32 GMT Message-Id: <202102011240.111CeWnU094637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: afea6cb020db - stable/13 - ufs: denote lack of support for lockless symlink lookup 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/stable/13 X-Git-Reftype: branch X-Git-Commit: afea6cb020db328a3cd8e6abcc58b1a5f0cb4b31 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:32 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=afea6cb020db328a3cd8e6abcc58b1a5f0cb4b31 commit afea6cb020db328a3cd8e6abcc58b1a5f0cb4b31 Author: Mateusz Guzik AuthorDate: 2021-01-23 13:42:16 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:38:23 +0000 ufs: denote lack of support for lockless symlink lookup It is unclear without investigating if it can be provided without using extra memory, so for the time being just don't. (cherry picked from commit c892d60a1d3e11c7e0651705bc4167b218a7415c) --- sys/ufs/ufs/ufs_vnops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index a3f790e16685..0e7ec7ae5453 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2963,6 +2963,7 @@ struct vop_vector ufs_vnodeops = { .vop_accessx = ufs_accessx, .vop_bmap = ufs_bmap, .vop_fplookup_vexec = ufs_fplookup_vexec, + .vop_fplookup_symlink = VOP_EAGAIN, .vop_cachedlookup = ufs_lookup, .vop_close = ufs_close, .vop_create = ufs_create, From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 DF3684FEB80; Mon, 1 Feb 2021 12:40: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 4DTnbj3lZJz3Dn1; Mon, 1 Feb 2021 12:40: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 53C541B2A8; Mon, 1 Feb 2021 12:40: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 111CeXPU094660; Mon, 1 Feb 2021 12:40:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CeX1m094659; Mon, 1 Feb 2021 12:40:33 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:33 GMT Message-Id: <202102011240.111CeX1m094659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 080f14904607 - stable/13 - tmpfs: add support for lockless symlink lookup 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 080f149046070dfd4c99ea3639634864b02d0f80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:34 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=080f149046070dfd4c99ea3639634864b02d0f80 commit 080f149046070dfd4c99ea3639634864b02d0f80 Author: Mateusz Guzik AuthorDate: 2021-01-23 13:45:01 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:38:23 +0000 tmpfs: add support for lockless symlink lookup Reviewed by: kib (previous version) Tested by: pho (previous version) Differential Revision: https://reviews.freebsd.org/D27488 (cherry picked from commit 618029af508be2c01a84162c1bad02bfd000db27) --- sys/fs/tmpfs/tmpfs.h | 8 ++++++-- sys/fs/tmpfs/tmpfs_subr.c | 50 ++++++++++++++++++++++++++++++++++++++++++---- sys/fs/tmpfs/tmpfs_vnops.c | 30 +++++++++++++++++++++++++++- 3 files changed, 81 insertions(+), 7 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 811df5b2936f..28493a550252 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -277,7 +277,10 @@ struct tmpfs_node { /* Valid when tn_type == VLNK. */ /* The link's target, allocated from a string pool. */ - char * tn_link; /* (c) */ + struct tn_link { + char * tn_link_target; /* (c) */ + char tn_link_smr; /* (c) */ + } tn_link; /* Valid when tn_type == VREG. */ struct tn_reg { @@ -300,7 +303,8 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define tn_rdev tn_spec.tn_rdev #define tn_dir tn_spec.tn_dir -#define tn_link tn_spec.tn_link +#define tn_link_target tn_spec.tn_link.tn_link_target +#define tn_link_smr tn_spec.tn_link.tn_link_smr #define tn_reg tn_spec.tn_reg #define tn_fifo tn_spec.tn_fifo diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index c74981db0f58..07e7ea11ad6e 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -252,6 +252,8 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, { struct tmpfs_node *nnode; vm_object_t obj; + char *symlink; + char symlink_smr; /* If the root directory of the 'tmp' file system is not yet * allocated, this must be the request to do it. */ @@ -327,9 +329,41 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, case VLNK: MPASS(strlen(target) < MAXPATHLEN); nnode->tn_size = strlen(target); - nnode->tn_link = malloc(nnode->tn_size, M_TMPFSNAME, - M_WAITOK); - memcpy(nnode->tn_link, target, nnode->tn_size); + + symlink = NULL; + if (!tmp->tm_nonc) { + symlink = cache_symlink_alloc(nnode->tn_size + 1, M_WAITOK); + symlink_smr = true; + } + if (symlink == NULL) { + symlink = malloc(nnode->tn_size + 1, M_TMPFSNAME, M_WAITOK); + symlink_smr = false; + } + memcpy(symlink, target, nnode->tn_size + 1); + + /* + * Allow safe symlink resolving for lockless lookup. + * tmpfs_fplookup_symlink references this comment. + * + * 1. nnode is not yet visible to the world + * 2. both tn_link_target and tn_link_smr get populated + * 3. release fence publishes their content + * 4. tn_link_target content is immutable until node destruction, + * where the pointer gets set to NULL + * 5. tn_link_smr is never changed once set + * + * As a result it is sufficient to issue load consume on the node + * pointer to also get the above content in a stable manner. + * Worst case tn_link_smr flag may be set to true despite being stale, + * while the target buffer is already cleared out. + * + * TODO: Since there is no load consume primitive provided + * right now, the load is performed with an acquire fence. + */ + atomic_store_ptr((uintptr_t *)&nnode->tn_link_target, + (uintptr_t)symlink); + atomic_store_char((char *)&nnode->tn_link_smr, symlink_smr); + atomic_thread_fence_rel(); break; case VREG: @@ -382,6 +416,7 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node, bool detach) { vm_object_t uobj; + char *symlink; bool last; TMPFS_MP_ASSERT_LOCKED(tmp); @@ -417,7 +452,14 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node, break; case VLNK: - free(node->tn_link, M_TMPFSNAME); + symlink = node->tn_link_target; + atomic_store_ptr((uintptr_t *)&node->tn_link_target, + (uintptr_t)NULL); + if (atomic_load_char(&node->tn_link_smr)) { + cache_symlink_free(symlink, node->tn_size + 1); + } else { + free(symlink, M_TMPFSNAME); + } break; case VREG: diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index f77692a10690..bc4caa4adecb 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1449,13 +1449,40 @@ tmpfs_readlink(struct vop_readlink_args *v) node = VP_TO_TMPFS_NODE(vp); - error = uiomove(node->tn_link, MIN(node->tn_size, uio->uio_resid), + error = uiomove(node->tn_link_target, MIN(node->tn_size, uio->uio_resid), uio); tmpfs_set_accessed(VFS_TO_TMPFS(vp->v_mount), node); return (error); } +/* + * VOP_FPLOOKUP_SYMLINK routines are subject to special circumstances, see + * the comment above cache_fplookup for details. + * + * Check tmpfs_alloc_node for tmpfs-specific synchronisation notes. + */ +static int +tmpfs_fplookup_symlink(struct vop_fplookup_symlink_args *v) +{ + struct vnode *vp; + struct tmpfs_node *node; + char *symlink; + + vp = v->a_vp; + node = VP_TO_TMPFS_NODE_SMR(vp); + atomic_thread_fence_acq(); + if (__predict_false(node == NULL)) + return (EAGAIN); + if (!atomic_load_char(&node->tn_link_smr)) + return (EAGAIN); + symlink = atomic_load_ptr(&node->tn_link_target); + if (symlink == NULL) + return (EAGAIN); + + return (cache_symlink_resolve(v->a_fpl, symlink, node->tn_size)); +} + static int tmpfs_inactive(struct vop_inactive_args *v) { @@ -1812,6 +1839,7 @@ struct vop_vector tmpfs_vnodeop_entries = { .vop_open = tmpfs_open, .vop_close = tmpfs_close, .vop_fplookup_vexec = tmpfs_fplookup_vexec, + .vop_fplookup_symlink = tmpfs_fplookup_symlink, .vop_access = tmpfs_access, .vop_stat = tmpfs_stat, .vop_getattr = tmpfs_getattr, From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 94A9D4FEB82; Mon, 1 Feb 2021 12:40: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 4DTnbk3hLSz3DqY; Mon, 1 Feb 2021 12:40: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 6DB9F1B692; Mon, 1 Feb 2021 12:40: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 111CeYV9094682; Mon, 1 Feb 2021 12:40:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CeYhH094681; Mon, 1 Feb 2021 12:40:34 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:34 GMT Message-Id: <202102011240.111CeYhH094681@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: c5fcd06736f9 - stable/13 - zfs: add support for lockless symlink lookup 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c5fcd06736f93ab6dd7b93d54dbeae68ae06ed7b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:34 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=c5fcd06736f93ab6dd7b93d54dbeae68ae06ed7b commit c5fcd06736f93ab6dd7b93d54dbeae68ae06ed7b Author: Mateusz Guzik AuthorDate: 2021-01-23 13:46:32 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:15 +0000 zfs: add support for lockless symlink lookup Reviewed by: kib (previous version) Tested by: pho (previous version) Differential Revision: https://reviews.freebsd.org/D27488 (cherry picked from commit 3110d4ebd6c0848cf5e25890d01791bb407e2a9b) --- .../include/os/freebsd/zfs/sys/zfs_znode_impl.h | 1 + .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 73 +++++++++++++++++++++- .../openzfs/module/os/freebsd/zfs/zfs_znode.c | 7 +++ 3 files changed, 78 insertions(+), 3 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h b/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h index ac2625d9a8ab..091186f23174 100644 --- a/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h +++ b/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h @@ -53,6 +53,7 @@ extern "C" { #define ZNODE_OS_FIELDS \ struct zfsvfs *z_zfsvfs; \ vnode_t *z_vnode; \ + char *z_cached_symlink; \ uint64_t z_uid; \ uint64_t z_gid; \ uint64_t z_gen; \ diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 2e8eadb5e16e..1ee0895625a6 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -4463,6 +4463,29 @@ zfs_freebsd_fplookup_vexec(struct vop_fplookup_vexec_args *v) } #endif +static int +zfs_freebsd_fplookup_symlink(struct vop_fplookup_symlink_args *v) +{ + vnode_t *vp; + znode_t *zp; + char *target; + + vp = v->a_vp; + zp = VTOZ_SMR(vp); + if (__predict_false(zp == NULL)) { + return (EAGAIN); + } + + /* + * FIXME: Load consume would be sufficient but there is no primitive to do it. + */ + target = (char *)atomic_load_acq_ptr((uintptr_t *)&zp->z_cached_symlink); + if (target == NULL) { + return (EAGAIN); + } + return (cache_symlink_resolve(v->a_fpl, target, strlen(target))); +} + #ifndef _SYS_SYSPROTO_H_ struct vop_access_args { struct vnode *a_vp; @@ -4949,6 +4972,8 @@ zfs_freebsd_symlink(struct vop_symlink_args *ap) struct componentname *cnp = ap->a_cnp; vattr_t *vap = ap->a_vap; znode_t *zp = NULL; + char *symlink; + size_t symlink_len; int rc; ASSERT(cnp->cn_flags & SAVENAME); @@ -4959,8 +4984,19 @@ zfs_freebsd_symlink(struct vop_symlink_args *ap) rc = zfs_symlink(VTOZ(ap->a_dvp), cnp->cn_nameptr, vap, ap->a_target, &zp, cnp->cn_cred, 0 /* flags */); - if (rc == 0) + if (rc == 0) { *ap->a_vpp = ZTOV(zp); + ASSERT_VOP_ELOCKED(ZTOV(zp), __func__); + MPASS(zp->z_cached_symlink == NULL); + symlink_len = strlen(ap->a_target); + symlink = cache_symlink_alloc(symlink_len + 1, M_WAITOK); + if (symlink != NULL) { + memcpy(symlink, ap->a_target, symlink_len); + symlink[symlink_len] = '\0'; + atomic_store_rel_ptr((uintptr_t *)&zp->z_cached_symlink, + (uintptr_t)symlink); + } + } return (rc); } @@ -4975,8 +5011,36 @@ struct vop_readlink_args { static int zfs_freebsd_readlink(struct vop_readlink_args *ap) { - - return (zfs_readlink(ap->a_vp, ap->a_uio, ap->a_cred, NULL)); + znode_t *zp = VTOZ(ap->a_vp); + struct uio *auio; + char *symlink, *base; + size_t symlink_len; + int error; + bool trycache; + + auio = ap->a_uio; + trycache = false; + if (auio->uio_segflg == UIO_SYSSPACE && auio->uio_iovcnt == 1) { + base = auio->uio_iov->iov_base; + symlink_len = auio->uio_iov->iov_len; + trycache = true; + } + error = zfs_readlink(ap->a_vp, auio, ap->a_cred, NULL); + if (atomic_load_ptr(&zp->z_cached_symlink) != NULL || + error != 0 || !trycache) { + return (error); + } + symlink_len -= auio->uio_resid; + symlink = cache_symlink_alloc(symlink_len + 1, M_WAITOK); + if (symlink != NULL) { + memcpy(symlink, base, symlink_len); + symlink[symlink_len] = '\0'; + if (!atomic_cmpset_rel_ptr((uintptr_t *)&zp->z_cached_symlink, + (uintptr_t)NULL, (uintptr_t)symlink)) { + cache_symlink_free(symlink, symlink_len + 1); + } + } + return (error); } #ifndef _SYS_SYSPROTO_H_ @@ -5734,6 +5798,7 @@ struct vop_vector zfs_vnodeops = { #if __FreeBSD_version >= 1300102 .vop_fplookup_vexec = zfs_freebsd_fplookup_vexec, #endif + .vop_fplookup_symlink = zfs_freebsd_fplookup_symlink, .vop_access = zfs_freebsd_access, .vop_allocate = VOP_EINVAL, .vop_lookup = zfs_cache_lookup, @@ -5783,6 +5848,7 @@ struct vop_vector zfs_fifoops = { #if __FreeBSD_version >= 1300102 .vop_fplookup_vexec = zfs_freebsd_fplookup_vexec, #endif + .vop_fplookup_symlink = zfs_freebsd_fplookup_symlink, .vop_access = zfs_freebsd_access, .vop_getattr = zfs_freebsd_getattr, .vop_inactive = zfs_freebsd_inactive, @@ -5806,6 +5872,7 @@ struct vop_vector zfs_shareops = { #if __FreeBSD_version >= 1300121 .vop_fplookup_vexec = VOP_EAGAIN, #endif + .vop_fplookup_symlink = VOP_EAGAIN, .vop_access = zfs_freebsd_access, .vop_inactive = zfs_freebsd_inactive, .vop_reclaim = zfs_freebsd_reclaim, diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c index 6a21623c5f67..f9a0820eda2d 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c @@ -444,6 +444,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, zp->z_blksz = blksz; zp->z_seq = 0x7A4653; zp->z_sync_cnt = 0; + atomic_store_ptr((uintptr_t *)&zp->z_cached_symlink, (uintptr_t)NULL); vp = ZTOV(zp); @@ -1237,6 +1238,7 @@ void zfs_znode_free(znode_t *zp) { zfsvfs_t *zfsvfs = zp->z_zfsvfs; + char *symlink; ASSERT(zp->z_sa_hdl == NULL); zp->z_vnode = NULL; @@ -1245,6 +1247,11 @@ zfs_znode_free(znode_t *zp) list_remove(&zfsvfs->z_all_znodes, zp); zfsvfs->z_nr_znodes--; mutex_exit(&zfsvfs->z_znodes_lock); + symlink = atomic_load_ptr(&zp->z_cached_symlink); + if (symlink != NULL) { + atomic_store_rel_ptr((uintptr_t *)&zp->z_cached_symlink, (uintptr_t)NULL); + cache_symlink_free(symlink, strlen(symlink) + 1); + } if (zp->z_acl_cached) { zfs_acl_free(zp->z_acl_cached); From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 C45C64FE8DE; Mon, 1 Feb 2021 12:40: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 4DTnbl4xfmz3DwB; Mon, 1 Feb 2021 12:40: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 97F651B693; Mon, 1 Feb 2021 12:40: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 111CeZUN094700; Mon, 1 Feb 2021 12:40:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CeZjh094699; Mon, 1 Feb 2021 12:40:35 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:35 GMT Message-Id: <202102011240.111CeZjh094699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: ba0689009b71 - stable/13 - cache: add back target entry on rename 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ba0689009b712c558f4ec2b28202a4e45c5bab91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:36 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ba0689009b712c558f4ec2b28202a4e45c5bab91 commit ba0689009b712c558f4ec2b28202a4e45c5bab91 Author: Mateusz Guzik AuthorDate: 2021-01-23 17:21:42 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:15 +0000 cache: add back target entry on rename (cherry picked from commit 02ec31bdf60fa3a8530544cb3c8c4ec1df6cde0d) --- sys/kern/vfs_cache.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 770c8ebf061b..03bafc75acaa 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -367,6 +367,10 @@ static bool __read_frequently cache_fast_revlookup = true; SYSCTL_BOOL(_vfs, OID_AUTO, cache_fast_revlookup, CTLFLAG_RW, &cache_fast_revlookup, 0, ""); +static bool __read_mostly cache_rename_add = true; +SYSCTL_BOOL(_vfs, OID_AUTO, cache_rename_add, CTLFLAG_RW, + &cache_rename_add, 0, ""); + static u_int __exclusive_cache_line neg_cycle; #define ncneghash 3 @@ -2731,6 +2735,21 @@ cache_vop_rename(struct vnode *fdvp, struct vnode *fvp, struct vnode *tdvp, } else { cache_remove_cnp(tdvp, tcnp); } + + /* + * TODO + * + * Historically renaming was always purging all revelang entries, + * but that's quite wasteful. In particular turns out that in many cases + * the target file is immediately accessed after rename, inducing a cache + * miss. + * + * Recode this to reduce relocking and reuse the existing entry (if any) + * instead of just removing it above and allocating a new one here. + */ + if (cache_rename_add) { + cache_enter(tdvp, fvp, tcnp); + } } void From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 913CB4FE7D8; Mon, 1 Feb 2021 12:40: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 4DTnbn0TQlz3DlN; Mon, 1 Feb 2021 12:40: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 AC5E81B705; Mon, 1 Feb 2021 12:40: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 111CeajD094722; Mon, 1 Feb 2021 12:40:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CeaUS094721; Mon, 1 Feb 2021 12:40:36 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:36 GMT Message-Id: <202102011240.111CeaUS094721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 996912046b4d - stable/13 - libc: skip spurious stat in _gettemp 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 996912046b4d7188636cc4da6a3808010862e93e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:37 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=996912046b4d7188636cc4da6a3808010862e93e commit 996912046b4d7188636cc4da6a3808010862e93e Author: Mateusz Guzik AuthorDate: 2021-01-24 04:15:13 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:15 +0000 libc: skip spurious stat in _gettemp It was only done to catch ENOTDIR, but the kernel already returns the error where appropriate. (cherry picked from commit 97a463120bf99819fcb21a781e410fb43dde2a43) --- lib/libc/stdio/mktemp.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index f08d92cc3ec7..f64eda748d0b 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -121,7 +121,6 @@ _gettemp(int dfd, char *path, int *doopen, int domkdir, int slen, int oflags) char *start, *trv, *suffp, *carryp; char *pad; struct stat sbuf; - int rval; uint32_t rand; char carrybuf[MAXPATHLEN]; @@ -156,26 +155,6 @@ _gettemp(int dfd, char *path, int *doopen, int domkdir, int slen, int oflags) /* save first combination of random characters */ memcpy(carrybuf, start, suffp - start); - /* - * check the target directory. - */ - if (doopen != NULL || domkdir) { - for (; trv > path; --trv) { - if (*trv == '/') { - *trv = '\0'; - rval = fstatat(dfd, path, &sbuf, 0); - *trv = '/'; - if (rval != 0) - return (0); - if (!S_ISDIR(sbuf.st_mode)) { - errno = ENOTDIR; - return (0); - } - break; - } - } - } - oflags |= O_CREAT | O_EXCL | O_RDWR; for (;;) { if (doopen) { From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 958424FEA40; Mon, 1 Feb 2021 12:40: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 4DTnbp18Byz3Dqw; Mon, 1 Feb 2021 12:40: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 CA3DB1B628; Mon, 1 Feb 2021 12:40: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 111Cebtm094744; Mon, 1 Feb 2021 12:40:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CebIU094743; Mon, 1 Feb 2021 12:40:37 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:37 GMT Message-Id: <202102011240.111CebIU094743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 410994f46335 - stable/13 - libc: remove open-coded strlen in _gettemp 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 410994f463351fe2899af77c797dd61c772b02cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:39 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=410994f463351fe2899af77c797dd61c772b02cf commit 410994f463351fe2899af77c797dd61c772b02cf Author: Mateusz Guzik AuthorDate: 2021-01-24 04:32:46 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:15 +0000 libc: remove open-coded strlen in _gettemp (cherry picked from commit 6fe328ace8f418bab0ab7f78c6fa1f2e757dd8a9) --- lib/libc/stdio/mktemp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index f64eda748d0b..c47e0221e5cd 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -131,8 +131,7 @@ _gettemp(int dfd, char *path, int *doopen, int domkdir, int slen, int oflags) return (0); } - for (trv = path; *trv != '\0'; ++trv) - ; + trv = path + strlen(path); if (trv - path >= MAXPATHLEN) { errno = ENAMETOOLONG; return (0); From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 7E3514FEA41; Mon, 1 Feb 2021 12:40: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 4DTnbq6pKDz3DtD; Mon, 1 Feb 2021 12:40: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 EB3641B629; Mon, 1 Feb 2021 12:40: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 111CecXu094762; Mon, 1 Feb 2021 12:40:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CecuM094761; Mon, 1 Feb 2021 12:40:38 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:38 GMT Message-Id: <202102011240.111CecuM094761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 3eae6412b50b - stable/13 - libc: try to skip memcpy in _gettemp 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3eae6412b50bbcfe1a7affc26202dc896aedd1ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:40 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3eae6412b50bbcfe1a7affc26202dc896aedd1ab commit 3eae6412b50bbcfe1a7affc26202dc896aedd1ab Author: Mateusz Guzik AuthorDate: 2021-01-24 04:34:22 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:15 +0000 libc: try to skip memcpy in _gettemp (cherry picked from commit b22fdf45ff8ef1d1f9a6c28f1d7f59ca4b012da6) --- lib/libc/stdio/mktemp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index c47e0221e5cd..0ede3058a3d5 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -123,6 +123,7 @@ _gettemp(int dfd, char *path, int *doopen, int domkdir, int slen, int oflags) struct stat sbuf; uint32_t rand; char carrybuf[MAXPATHLEN]; + int saved; if ((doopen != NULL && domkdir) || slen < 0 || (oflags & ~(O_APPEND | O_DIRECT | O_SHLOCK | O_EXLOCK | O_SYNC | @@ -151,9 +152,7 @@ _gettemp(int dfd, char *path, int *doopen, int domkdir, int slen, int oflags) } start = trv + 1; - /* save first combination of random characters */ - memcpy(carrybuf, start, suffp - start); - + saved = 0; oflags |= O_CREAT | O_EXCL | O_RDWR; for (;;) { if (doopen) { @@ -170,6 +169,12 @@ _gettemp(int dfd, char *path, int *doopen, int domkdir, int slen, int oflags) } else if (lstat(path, &sbuf)) return (errno == ENOENT); + /* save first combination of random characters */ + if (!saved) { + memcpy(carrybuf, start, suffp - start); + saved = 1; + } + /* If we have a collision, cycle through the space of filenames */ for (trv = start, carryp = carrybuf;;) { /* have we tried all possible permutations? */ From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 5D8914FEABF; Mon, 1 Feb 2021 12:40: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 4DTnbs0Qkmz3F02; Mon, 1 Feb 2021 12:40: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 0E9B11B165; Mon, 1 Feb 2021 12:40: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 111CedVV094784; Mon, 1 Feb 2021 12:40:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CedgR094783; Mon, 1 Feb 2021 12:40:39 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:39 GMT Message-Id: <202102011240.111CedgR094783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: c700b1babaa8 - stable/13 - cache: track calls to cache_symlink_alloc with unsupported size 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c700b1babaa874dc6327dd62e80c96b34109c6eb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:41 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=c700b1babaa874dc6327dd62e80c96b34109c6eb commit c700b1babaa874dc6327dd62e80c96b34109c6eb Author: Mateusz Guzik AuthorDate: 2021-01-24 20:00:03 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:15 +0000 cache: track calls to cache_symlink_alloc with unsupported size While here assert on size passed to free. (cherry picked from commit 1c7a65adb002cf96bda1f72d9a26dd4237368263) --- sys/kern/vfs_cache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 03bafc75acaa..9d3b935a3047 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -122,6 +122,7 @@ SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", "char *"); SDT_PROBE_DEFINE2(vfs, namecache, evict_negative, done, "struct vnode *", "char *"); +SDT_PROBE_DEFINE1(vfs, namecache, symlink, alloc__fail, "size_t"); SDT_PROBE_DEFINE3(vfs, fplookup, lookup, done, "struct nameidata", "int", "bool"); SDT_PROBE_DECLARE(vfs, namei, lookup, entry); @@ -477,6 +478,7 @@ STATNODE_COUNTER(fullpathfail2, numfullpathfail2, "Number of fullpath search errors (VOP_VPTOCNP failures)"); STATNODE_COUNTER(fullpathfail4, numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); STATNODE_COUNTER(fullpathfound, numfullpathfound, "Number of successful fullpath calls"); +STATNODE_COUNTER(symlinktoobig, symlinktoobig, "Number of times symlink did not fit the cache"); /* * Debug or developer statistics. @@ -576,6 +578,8 @@ cache_symlink_alloc(size_t size, int flags) if (size < CACHE_ZONE_LARGE_SIZE) { return (uma_zalloc_smr(cache_zone_large, flags)); } + counter_u64_add(symlinktoobig, 1); + SDT_PROBE1(vfs, namecache, symlink, alloc__fail, size); return (NULL); } @@ -584,6 +588,8 @@ cache_symlink_free(char *string, size_t size) { MPASS(string != NULL); + KASSERT(size < CACHE_ZONE_LARGE_SIZE, + ("%s: size %zu too big", __func__, size)); if (size < CACHE_ZONE_SMALL_SIZE) { uma_zfree_smr(cache_zone_small, string); From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12: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 A028B4FEAC3; Mon, 1 Feb 2021 12: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 4DTnbv1qJ5z3Dwq; Mon, 1 Feb 2021 12:40: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 597EA1B707; Mon, 1 Feb 2021 12:40: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 111Cegaj094824; Mon, 1 Feb 2021 12:40:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cegkr094823; Mon, 1 Feb 2021 12:40:42 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:42 GMT Message-Id: <202102011240.111Cegkr094823@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: dde453cf7d3a - stable/13 - zfs: fix panics with invariant kernels from zfs_replay_setattr 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/stable/13 X-Git-Reftype: branch X-Git-Commit: dde453cf7d3a272ee9319ba6d9e27d34e6b6da6f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:46 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=dde453cf7d3a272ee9319ba6d9e27d34e6b6da6f commit dde453cf7d3a272ee9319ba6d9e27d34e6b6da6f Author: Mateusz Guzik AuthorDate: 2021-01-25 21:28:05 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:16 +0000 zfs: fix panics with invariant kernels from zfs_replay_setattr (cherry picked from commit f40d6217f20d69427b58d82ce4e29d88bf4dfbd6) --- sys/contrib/openzfs/module/zfs/zfs_replay.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/contrib/openzfs/module/zfs/zfs_replay.c b/sys/contrib/openzfs/module/zfs/zfs_replay.c index cba5e8c9cd0b..53c7dbd5df43 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_replay.c +++ b/sys/contrib/openzfs/module/zfs/zfs_replay.c @@ -859,7 +859,12 @@ zfs_replay_setattr(void *arg1, void *arg2, boolean_t byteswap) zfsvfs->z_fuid_replay = zfs_replay_fuid_domain(start, &start, lr->lr_uid, lr->lr_gid); + /* + * Satisfy assertions. + */ + vn_seqc_write_begin(ZTOV(zp)); error = zfs_setattr(zp, vap, 0, kcred); + vn_seqc_write_end(ZTOV(zp)); zfs_fuid_info_free(zfsvfs->z_fuid_replay); zfsvfs->z_fuid_replay = NULL; From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12: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 C75EC4FEB48; Mon, 1 Feb 2021 12: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 4DTnbv0j98z3DtP; Mon, 1 Feb 2021 12:40: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 3A1D01B706; Mon, 1 Feb 2021 12:40: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 111CefXX094806; Mon, 1 Feb 2021 12:40:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cefa0094805; Mon, 1 Feb 2021 12:40:41 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:41 GMT Message-Id: <202102011240.111Cefa0094805@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: aa411f6ba17b - stable/13 - cache: assorted cleanups 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/stable/13 X-Git-Reftype: branch X-Git-Commit: aa411f6ba17b91af720129bd7593df4c7093f8a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:46 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=aa411f6ba17b91af720129bd7593df4c7093f8a4 commit aa411f6ba17b91af720129bd7593df4c7093f8a4 Author: Mateusz Guzik AuthorDate: 2021-01-24 20:04:01 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:15 +0000 cache: assorted cleanups (cherry picked from commit 868643e7229b7959024880cda396fef87602b948) --- sys/kern/vfs_cache.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 9d3b935a3047..e3098ac7c5d5 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5079,54 +5079,54 @@ cache_fplookup_is_mp(struct cache_fpl *fpl) */ #ifdef INVARIANTS static void -cache_fpl_pathlen_dec(struct cache_fpl *fpl) +cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n) { - cache_fpl_pathlen_sub(fpl, 1); + fpl->debug.ni_pathlen += n; + KASSERT(fpl->debug.ni_pathlen <= PATH_MAX, + ("%s: pathlen overflow to %zd\n", __func__, fpl->debug.ni_pathlen)); } static void -cache_fpl_pathlen_inc(struct cache_fpl *fpl) +cache_fpl_pathlen_sub(struct cache_fpl *fpl, size_t n) { - cache_fpl_pathlen_add(fpl, 1); + fpl->debug.ni_pathlen -= n; + KASSERT(fpl->debug.ni_pathlen <= PATH_MAX, + ("%s: pathlen underflow to %zd\n", __func__, fpl->debug.ni_pathlen)); } static void -cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n) +cache_fpl_pathlen_inc(struct cache_fpl *fpl) { - fpl->debug.ni_pathlen += n; - KASSERT(fpl->debug.ni_pathlen <= PATH_MAX, - ("%s: pathlen overflow to %zd\n", __func__, fpl->debug.ni_pathlen)); + cache_fpl_pathlen_add(fpl, 1); } static void -cache_fpl_pathlen_sub(struct cache_fpl *fpl, size_t n) +cache_fpl_pathlen_dec(struct cache_fpl *fpl) { - fpl->debug.ni_pathlen -= n; - KASSERT(fpl->debug.ni_pathlen <= PATH_MAX, - ("%s: pathlen underflow to %zd\n", __func__, fpl->debug.ni_pathlen)); + cache_fpl_pathlen_sub(fpl, 1); } #else -static void __always_inline -cache_fpl_pathlen_dec(struct cache_fpl *fpl) +static void +cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n) { } -static void __always_inline -cache_fpl_pathlen_inc(struct cache_fpl *fpl) +static void +cache_fpl_pathlen_sub(struct cache_fpl *fpl, size_t n) { } static void -cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n) +cache_fpl_pathlen_inc(struct cache_fpl *fpl) { } static void -cache_fpl_pathlen_sub(struct cache_fpl *fpl, size_t n) +cache_fpl_pathlen_dec(struct cache_fpl *fpl) { } #endif @@ -5258,7 +5258,7 @@ cache_fplookup_parse_advance(struct cache_fpl *fpl) * * Lockless lookup tries to elide checking for spurious slashes and should they * be present is guaranteed to fail to find an entry. In this case the caller - * must check if the name starts with a slash and this call routine. It is + * must check if the name starts with a slash and call this routine. It is * going to fast forward across the spurious slashes and set the state up for * retry. */ @@ -5342,11 +5342,13 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) * Hack: handle O_SEARCH. * * Open Group Base Specifications Issue 7, 2018 edition states: + * * If the access mode of the open file description associated with the * file descriptor is not O_SEARCH, the function shall check whether * directory searches are permitted using the current permissions of * the directory underlying the file descriptor. If the access mode is * O_SEARCH, the function shall not perform the check. + * * * Regular lookup tests for the NOEXECCHECK flag for every path * component to decide whether to do the permission check. However, From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 652E04FE970; Mon, 1 Feb 2021 12:40: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 4DTnbz1tTNz3F0R; Mon, 1 Feb 2021 12:40: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 797271B696; Mon, 1 Feb 2021 12:40: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 111Cehi2094846; Mon, 1 Feb 2021 12:40:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CehGE094845; Mon, 1 Feb 2021 12:40:43 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:43 GMT Message-Id: <202102011240.111CehGE094845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: e92ab3adf4f9 - stable/13 - atomic: make atomic_store_ptr type-aware 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e92ab3adf4f9848933439c9c2fca36df290c0884 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:47 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e92ab3adf4f9848933439c9c2fca36df290c0884 commit e92ab3adf4f9848933439c9c2fca36df290c0884 Author: Mateusz Guzik AuthorDate: 2021-01-25 19:39:14 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:16 +0000 atomic: make atomic_store_ptr type-aware (cherry picked from commit cc96f92a570e05636a20fdd15d4616b127bb9ecc) --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c | 2 +- sys/fs/tmpfs/tmpfs_subr.c | 6 ++---- sys/sys/_cscan_atomic.h | 5 ++++- sys/sys/atomic_common.h | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c index f9a0820eda2d..d9f2635b0129 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c @@ -444,7 +444,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, zp->z_blksz = blksz; zp->z_seq = 0x7A4653; zp->z_sync_cnt = 0; - atomic_store_ptr((uintptr_t *)&zp->z_cached_symlink, (uintptr_t)NULL); + atomic_store_ptr(&zp->z_cached_symlink, NULL); vp = ZTOV(zp); diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 07e7ea11ad6e..3b3581fc81f6 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -360,8 +360,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, * TODO: Since there is no load consume primitive provided * right now, the load is performed with an acquire fence. */ - atomic_store_ptr((uintptr_t *)&nnode->tn_link_target, - (uintptr_t)symlink); + atomic_store_ptr(&nnode->tn_link_target, symlink); atomic_store_char((char *)&nnode->tn_link_smr, symlink_smr); atomic_thread_fence_rel(); break; @@ -453,8 +452,7 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node, case VLNK: symlink = node->tn_link_target; - atomic_store_ptr((uintptr_t *)&node->tn_link_target, - (uintptr_t)NULL); + atomic_store_ptr(&node->tn_link_target, NULL); if (atomic_load_char(&node->tn_link_smr)) { cache_symlink_free(symlink, node->tn_size + 1); } else { diff --git a/sys/sys/_cscan_atomic.h b/sys/sys/_cscan_atomic.h index 19c05b179940..3bd9455102b1 100644 --- a/sys/sys/_cscan_atomic.h +++ b/sys/sys/_cscan_atomic.h @@ -243,7 +243,10 @@ void kcsan_atomic_thread_fence_seq_cst(void); #define atomic_subtract_ptr kcsan_atomic_subtract_ptr #define atomic_subtract_acq_ptr kcsan_atomic_subtract_acq_ptr #define atomic_subtract_rel_ptr kcsan_atomic_subtract_rel_ptr -#define atomic_store_ptr kcsan_atomic_store_ptr +#define atomic_store_ptr(x, v) ({ \ + __typeof(*x) __value = (v); \ + kcsan_atomic_store_ptr((volatile uintptr_t *)(x), (uintptr_t)(__value));\ +}) #define atomic_store_rel_ptr kcsan_atomic_store_rel_ptr #define atomic_swap_ptr kcsan_atomic_swap_ptr #define atomic_testandclear_ptr kcsan_atomic_testandclear_ptr diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index a3548977b940..4c29d132c369 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -58,7 +58,7 @@ #define atomic_store_long(p, v) \ (*(volatile u_long *)(p) = (u_long)(v)) #define atomic_store_ptr(p, v) \ - (*(volatile uintptr_t *)(p) = (uintptr_t)(v)) + (*(volatile __typeof(*p) *)(p) = (v)) #define atomic_store_8(p, v) \ (*(volatile uint8_t *)(p) = (uint8_t)(v)) #define atomic_store_16(p, v) \ From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 7B0524FEC39; Mon, 1 Feb 2021 12:40: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 4DTnc05kqnz3DrT; Mon, 1 Feb 2021 12:40: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 973541B439; Mon, 1 Feb 2021 12:40: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 111CeiEe094868; Mon, 1 Feb 2021 12:40:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CeiX9094867; Mon, 1 Feb 2021 12:40:44 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:44 GMT Message-Id: <202102011240.111CeiX9094867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: fc301c224b27 - stable/13 - atomic: add stub atomic_load_consume_ptr 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/stable/13 X-Git-Reftype: branch X-Git-Commit: fc301c224b272a522bff817e12fcbf99a7a17330 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:49 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=fc301c224b272a522bff817e12fcbf99a7a17330 commit fc301c224b272a522bff817e12fcbf99a7a17330 Author: Mateusz Guzik AuthorDate: 2021-01-25 20:09:41 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:16 +0000 atomic: add stub atomic_load_consume_ptr (cherry picked from commit 054ce2b0371042c0dbc4b3ab1d7e7795ad75d51e) --- sys/sys/_cscan_atomic.h | 5 +++++ sys/sys/atomic_common.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/sys/sys/_cscan_atomic.h b/sys/sys/_cscan_atomic.h index 3bd9455102b1..aed96580e1e4 100644 --- a/sys/sys/_cscan_atomic.h +++ b/sys/sys/_cscan_atomic.h @@ -236,6 +236,11 @@ void kcsan_atomic_thread_fence_seq_cst(void); __retptr; \ }) #define atomic_load_acq_ptr kcsan_atomic_load_acq_ptr +#define atomic_load_consume_ptr(x) ({ \ + __typeof(*x) __retptr; \ + __retptr = (void *)kcsan_atomic_load_acq_ptr((volatile uintptr_t *)(x));\ + __retptr; \ +}) #define atomic_readandclear_ptr kcsan_atomic_readandclear_ptr #define atomic_set_ptr kcsan_atomic_set_ptr #define atomic_set_acq_ptr kcsan_atomic_set_acq_ptr diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index 4c29d132c369..48f0a8b8939c 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -70,4 +70,12 @@ (*(volatile uint64_t *)(p) = (uint64_t)(v)) #endif +/* + * Currently all architectures provide acquire and release fences on their own, + * but they don't provide consume. Kludge below allows relevant code to stop + * openly resorting to the stronger acquire fence, to be sorted out. + */ +#define atomic_load_consume_ptr(p) \ + ((__typeof(*p)) atomic_load_acq_ptr((uintptr_t *)p)) + #endif From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 F39514FEB54; Mon, 1 Feb 2021 12:40: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 4DTnc252WFz3DxQ; Mon, 1 Feb 2021 12:40: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 A81231B697; Mon, 1 Feb 2021 12: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 111CejES095329; Mon, 1 Feb 2021 12: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 111CejdM095316; Mon, 1 Feb 2021 12:40:45 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:45 GMT Message-Id: <202102011240.111CejdM095316@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: e8d3e3884569 - stable/13 - vfs: use atomic_load_consume_ptr in vn_load_v_data_smr 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e8d3e38845697ae831a472870d0bddd991e9041b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:51 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e8d3e38845697ae831a472870d0bddd991e9041b commit e8d3e38845697ae831a472870d0bddd991e9041b Author: Mateusz Guzik AuthorDate: 2021-01-25 20:19:08 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:16 +0000 vfs: use atomic_load_consume_ptr in vn_load_v_data_smr (cherry picked from commit 8d2a230e996c8aec2ec4883d45f7ac38070bd38f) --- sys/sys/vnode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index ffd0bdad940d..78fbec1bd0ba 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1112,7 +1112,7 @@ int vn_dir_check_exec(struct vnode *vp, struct componentname *cnp); struct vnode *_vp = (vp); \ \ VFS_SMR_ASSERT_ENTERED(); \ - atomic_load_ptr(&(_vp)->v_data); \ + atomic_load_consume_ptr(&(_vp)->v_data);\ }) #endif /* _KERNEL */ From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12: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 AEC734FEC96; Mon, 1 Feb 2021 12:40: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 4DTnc50sn9z3Dry; Mon, 1 Feb 2021 12:40: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 1CDD11B43B; Mon, 1 Feb 2021 12:40: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 111CeniH097298; Mon, 1 Feb 2021 12:40:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cengc097297; Mon, 1 Feb 2021 12:40:49 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:49 GMT Message-Id: <202102011240.111Cengc097297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 8a44ccd05889 - stable/13 - cache: store vnodes in local vars in cache_zap_locked 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a44ccd0588966b5687c30644e83ab1eef9683e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:53 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=8a44ccd0588966b5687c30644e83ab1eef9683e3 commit 8a44ccd0588966b5687c30644e83ab1eef9683e3 Author: Mateusz Guzik AuthorDate: 2021-01-23 19:41:40 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:16 +0000 cache: store vnodes in local vars in cache_zap_locked (cherry picked from commit ffcf8f97f8a8fb92689793003acabc0a2fe97af4) --- sys/kern/vfs_cache.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index e3098ac7c5d5..9d5b18aa4132 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1422,10 +1422,14 @@ static void cache_zap_locked(struct namecache *ncp) { struct nchashhead *ncpp; + struct vnode *dvp, *vp; + + dvp = ncp->nc_dvp; + vp = ncp->nc_vp; if (!(ncp->nc_flag & NCF_NEGATIVE)) - cache_assert_vnode_locked(ncp->nc_vp); - cache_assert_vnode_locked(ncp->nc_dvp); + cache_assert_vnode_locked(vp); + cache_assert_vnode_locked(dvp); cache_assert_bucket_locked(ncp); cache_ncp_invalidate(ncp); @@ -1433,28 +1437,26 @@ cache_zap_locked(struct namecache *ncp) ncpp = NCP2BUCKET(ncp); CK_SLIST_REMOVE(ncpp, ncp, namecache, nc_hash); if (!(ncp->nc_flag & NCF_NEGATIVE)) { - SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_vp); - TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); - if (ncp == ncp->nc_vp->v_cache_dd) { - vn_seqc_write_begin_unheld(ncp->nc_vp); - ncp->nc_vp->v_cache_dd = NULL; - vn_seqc_write_end(ncp->nc_vp); + SDT_PROBE3(vfs, namecache, zap, done, dvp, ncp->nc_name, vp); + TAILQ_REMOVE(&vp->v_cache_dst, ncp, nc_dst); + if (ncp == vp->v_cache_dd) { + vn_seqc_write_begin_unheld(vp); + vp->v_cache_dd = NULL; + vn_seqc_write_end(vp); } } else { - SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, - ncp->nc_name); + SDT_PROBE2(vfs, namecache, zap_negative, done, dvp, ncp->nc_name); cache_neg_remove(ncp); } if (ncp->nc_flag & NCF_ISDOTDOT) { - if (ncp == ncp->nc_dvp->v_cache_dd) { - vn_seqc_write_begin_unheld(ncp->nc_dvp); - ncp->nc_dvp->v_cache_dd = NULL; - vn_seqc_write_end(ncp->nc_dvp); + if (ncp == dvp->v_cache_dd) { + vn_seqc_write_begin_unheld(dvp); + dvp->v_cache_dd = NULL; + vn_seqc_write_end(dvp); } } else { LIST_REMOVE(ncp, nc_src); - if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { + if (LIST_EMPTY(&dvp->v_cache_src)) { ncp->nc_flag |= NCF_DVDROP; } } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 57E5D4FEA4E; Mon, 1 Feb 2021 12:40: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 4DTnc90MtWz3DpW; Mon, 1 Feb 2021 12:40: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 857871B69D; Mon, 1 Feb 2021 12:40: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 111CeqMu097360; Mon, 1 Feb 2021 12:40:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CeqCR097359; Mon, 1 Feb 2021 12:40:52 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:52 GMT Message-Id: <202102011240.111CeqCR097359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 1f28a3afe4d2 - stable/13 - cache: change ->v_cache_dd synchronisation rules 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f28a3afe4d227e1f401ea37c97a134eeff1b376 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:57 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1f28a3afe4d227e1f401ea37c97a134eeff1b376 commit 1f28a3afe4d227e1f401ea37c97a134eeff1b376 Author: Mateusz Guzik AuthorDate: 2021-01-25 20:49:09 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:17 +0000 cache: change ->v_cache_dd synchronisation rules Instead of resorting to seqc modification take advantage of immutability of entries and check if the entry still matches after everything got prepared. (cherry picked from commit e7cf562a40fc093df054bd7fa6f34746069a984a) --- sys/kern/vfs_cache.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index fad7ce91ef44..a73e4843b5f3 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1440,9 +1440,7 @@ cache_zap_locked(struct namecache *ncp) SDT_PROBE3(vfs, namecache, zap, done, dvp, ncp->nc_name, vp); TAILQ_REMOVE(&vp->v_cache_dst, ncp, nc_dst); if (ncp == vp->v_cache_dd) { - vn_seqc_write_begin_unheld(vp); atomic_store_ptr(&vp->v_cache_dd, NULL); - vn_seqc_write_end(vp); } } else { SDT_PROBE2(vfs, namecache, zap_negative, done, dvp, ncp->nc_name); @@ -1450,9 +1448,7 @@ cache_zap_locked(struct namecache *ncp) } if (ncp->nc_flag & NCF_ISDOTDOT) { if (ncp == dvp->v_cache_dd) { - vn_seqc_write_begin_unheld(dvp); atomic_store_ptr(&dvp->v_cache_dd, NULL); - vn_seqc_write_end(dvp); } } else { LIST_REMOVE(ncp, nc_src); @@ -1627,9 +1623,7 @@ retry_dotdot: mtx_unlock(dvlp2); cache_free(ncp); } else { - vn_seqc_write_begin(dvp); atomic_store_ptr(&dvp->v_cache_dd, NULL); - vn_seqc_write_end(dvp); mtx_unlock(dvlp); if (dvlp2 != NULL) mtx_unlock(dvlp2); @@ -2246,7 +2240,6 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp, cache_celockstate_init(&cel); hash = cache_get_hash(cnp->cn_nameptr, len, dvp); cache_enter_lock_dd(&cel, dvp, vp, hash); - vn_seqc_write_begin(dvp); ncp = dvp->v_cache_dd; if (ncp != NULL && (ncp->nc_flag & NCF_ISDOTDOT)) { KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent")); @@ -2255,7 +2248,6 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp, ncp = NULL; } atomic_store_ptr(&dvp->v_cache_dd, NULL); - vn_seqc_write_end(dvp); cache_enter_unlock(&cel); if (ncp != NULL) cache_free(ncp); @@ -2392,9 +2384,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, goto out_unlock_free; KASSERT(vp == NULL || vp->v_type == VDIR, ("wrong vnode type %p", vp)); - vn_seqc_write_begin(dvp); + atomic_thread_fence_rel(); atomic_store_ptr(&dvp->v_cache_dd, ncp); - vn_seqc_write_end(dvp); } if (vp != NULL) { @@ -2404,20 +2395,17 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, * directory name in it and the name ".." for the * directory's parent. */ - vn_seqc_write_begin(vp); if ((ndd = vp->v_cache_dd) != NULL) { if ((ndd->nc_flag & NCF_ISDOTDOT) != 0) cache_zap_locked(ndd); else ndd = NULL; } + atomic_thread_fence_rel(); atomic_store_ptr(&vp->v_cache_dd, ncp); - vn_seqc_write_end(vp); } else if (vp->v_type != VDIR) { if (vp->v_cache_dd != NULL) { - vn_seqc_write_begin(vp); atomic_store_ptr(&vp->v_cache_dd, NULL); - vn_seqc_write_end(vp); } } } @@ -3301,10 +3289,6 @@ vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char *buf, cache_rev_failed(&reason); goto out_abort; } - if (!cache_ncp_canuse(ncp)) { - cache_rev_failed(&reason); - goto out_abort; - } if (ncp->nc_nlen >= *buflen) { cache_rev_failed(&reason); error = ENOMEM; @@ -3324,6 +3308,17 @@ vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char *buf, cache_rev_failed(&reason); goto out_abort; } + /* + * Acquire fence provided by vn_seqc_read_any above. + */ + if (__predict_false(atomic_load_ptr(&vp->v_cache_dd) != ncp)) { + cache_rev_failed(&reason); + goto out_abort; + } + if (!cache_ncp_canuse(ncp)) { + cache_rev_failed(&reason); + goto out_abort; + } vp = tvp; vp_seqc = tvp_seqc; if (vp == rdir || vp == rootvnode) @@ -4719,15 +4714,22 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) fpl->tvp = ncp->nc_dvp; } - if (!cache_ncp_canuse(ncp)) { - return (cache_fpl_aborted(fpl)); - } - fpl->tvp_seqc = vn_seqc_read_any(fpl->tvp); if (seqc_in_modify(fpl->tvp_seqc)) { return (cache_fpl_partial(fpl)); } + /* + * Acquire fence provided by vn_seqc_read_any above. + */ + if (__predict_false(atomic_load_ptr(&dvp->v_cache_dd) != ncp)) { + return (cache_fpl_aborted(fpl)); + } + + if (!cache_ncp_canuse(ncp)) { + return (cache_fpl_aborted(fpl)); + } + counter_u64_add(dotdothits, 1); return (0); } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 253604FE9EF; Mon, 1 Feb 2021 12:40: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 4DTncB1Vp7z3Dy2; Mon, 1 Feb 2021 12:40: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 AB09B1B16B; Mon, 1 Feb 2021 12:40: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 111Cerrf097378; Mon, 1 Feb 2021 12:40:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cer6L097377; Mon, 1 Feb 2021 12:40:53 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:53 GMT Message-Id: <202102011240.111Cer6L097377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 51927c36b8a9 - stable/13 - cache: convert cache_fplookup_parse to void now that it always succeeds 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 51927c36b8a9d789534258bfd94e0018ee96381f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:40:59 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=51927c36b8a9d789534258bfd94e0018ee96381f commit 51927c36b8a9d789534258bfd94e0018ee96381f Author: Mateusz Guzik AuthorDate: 2021-01-26 00:40:47 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:17 +0000 cache: convert cache_fplookup_parse to void now that it always succeeds (cherry picked from commit 6943671b481e571f2f1ffbe407a4d75241d1174e) --- sys/kern/vfs_cache.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index a73e4843b5f3..72669449c26a 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5178,7 +5178,7 @@ cache_fplookup_preparse(struct cache_fpl *fpl) return (0); } -static int +static void cache_fplookup_parse(struct cache_fpl *fpl) { struct nameidata *ndp; @@ -5241,7 +5241,6 @@ cache_fplookup_parse(struct cache_fpl *fpl) panic("%s: ran into degenerate name from [%s]\n", __func__, cnp->cn_pnbuf); } #endif - return (0); } static void @@ -5426,10 +5425,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) } for (;;) { - error = cache_fplookup_parse(fpl); - if (__predict_false(error != 0)) { - break; - } + cache_fplookup_parse(fpl); error = VOP_FPLOOKUP_VEXEC(fpl->dvp, cnp->cn_cred); if (__predict_false(error != 0)) { From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:40: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 D492D4FEBB2; Mon, 1 Feb 2021 12:40: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 4DTncB5flgz3F1X; Mon, 1 Feb 2021 12:40: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 C11A81B43E; Mon, 1 Feb 2021 12:40: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 111CesrK097400; Mon, 1 Feb 2021 12:40:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cesrp097399; Mon, 1 Feb 2021 12:40:54 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:54 GMT Message-Id: <202102011240.111Cesrp097399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 82efef21d051 - stable/13 - cache: stop referring to removing entries as invalidating them 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 82efef21d051796c97796f85ff3fda76104bedb7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:00 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=82efef21d051796c97796f85ff3fda76104bedb7 commit 82efef21d051796c97796f85ff3fda76104bedb7 Author: Mateusz Guzik AuthorDate: 2021-01-26 20:31:16 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:17 +0000 cache: stop referring to removing entries as invalidating them Said use is a remnant from the old code and clashes with the NCF_INVALID flag. (cherry picked from commit a51eca7936db50a57d2324d945c3be715df749cd) --- sys/kern/vfs_cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 72669449c26a..4e2cfa9edf53 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -2597,7 +2597,7 @@ cache_changesize(u_long newmaxvnodes) } /* - * Invalidate all entries from and to a particular vnode. + * Remove all entries from and to a particular vnode. */ static void cache_purge_impl(struct vnode *vp) @@ -2688,7 +2688,7 @@ cache_purge_vgone(struct vnode *vp) } /* - * Invalidate all negative entries for a particular directory vnode. + * Remove all negative entries for a particular directory vnode. */ void cache_purge_negative(struct vnode *vp) From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 53E654FEC7C; Mon, 1 Feb 2021 12:41: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 4DTncG2dCtz3F1q; Mon, 1 Feb 2021 12:41: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 0EC631B440; Mon, 1 Feb 2021 12:40: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 111CeuaR097440; Mon, 1 Feb 2021 12:40:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Ceuew097439; Mon, 1 Feb 2021 12:40:56 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:56 GMT Message-Id: <202102011240.111Ceuew097439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: dcba4f2b4380 - stable/13 - conf/kern.mk: save some work by using realpath instead of cd ; pwd 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/stable/13 X-Git-Reftype: branch X-Git-Commit: dcba4f2b43809023a9ffb25080fb68c21e53e5df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:04 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=dcba4f2b43809023a9ffb25080fb68c21e53e5df commit dcba4f2b43809023a9ffb25080fb68c21e53e5df Author: Mateusz Guzik AuthorDate: 2021-01-27 12:25:21 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:17 +0000 conf/kern.mk: save some work by using realpath instead of cd ; pwd I did not check if the entire ordeal can be avoided in the first place. (cherry picked from commit bcb7f57aa22757dd0206e88894bc003a93d0c351) --- sys/conf/kmod.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index c245f447cefb..c0d4441af029 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -309,7 +309,7 @@ ${_ILINKS}: *) \ path=${SYSDIR}/${.TARGET:T}/include ;; \ esac ; \ - path=`(cd $$path && /bin/pwd)` ; \ + path=`realpath $$path`; \ ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fns $$path ${.TARGET:T} From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 2A1C64FEC7D; Mon, 1 Feb 2021 12:41: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 4DTncJ1jMCz3F9q; Mon, 1 Feb 2021 12:41: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 47C351B635; Mon, 1 Feb 2021 12:40: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 111Cexvh098337; Mon, 1 Feb 2021 12:40:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CextL098336; Mon, 1 Feb 2021 12:40:59 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:59 GMT Message-Id: <202102011240.111CextL098336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 569ac576088b - stable/13 - cache: add missing MNT_NOSYMFOLLOW check to symlink traversal 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 569ac576088bdb44856d5992ecdc647483b0970b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:05 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=569ac576088bdb44856d5992ecdc647483b0970b commit 569ac576088bdb44856d5992ecdc647483b0970b Author: Mateusz Guzik AuthorDate: 2021-01-27 14:59:53 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:18 +0000 cache: add missing MNT_NOSYMFOLLOW check to symlink traversal (cherry picked from commit 5c325977b1138828367f39a3f2034af24c3654f0) --- sys/kern/vfs_cache.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index be06a2edc58b..ff8aad14001b 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4816,6 +4816,7 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) static int __noinline cache_fplookup_symlink(struct cache_fpl *fpl) { + struct mount *mp; struct nameidata *ndp; struct componentname *cnp; struct vnode *dvp, *tvp; @@ -4832,6 +4833,20 @@ cache_fplookup_symlink(struct cache_fpl *fpl) } } + mp = atomic_load_ptr(&dvp->v_mount); + if (__predict_false(mp == NULL)) { + return (cache_fpl_aborted(fpl)); + } + + /* + * Note this check races against setting the flag just like regular + * lookup. + */ + if (__predict_false((mp->mnt_flag & MNT_NOSYMFOLLOW) != 0)) { + cache_fpl_smr_exit(fpl); + return (cache_fpl_handled_error(fpl, EACCES)); + } + error = VOP_FPLOOKUP_SYMLINK(tvp, fpl); if (__predict_false(error != 0)) { switch (error) { From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 391674FEA5B; Mon, 1 Feb 2021 12:41: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 4DTncJ5mKDz3DvW; Mon, 1 Feb 2021 12:41: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 6D1591B170; Mon, 1 Feb 2021 12: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 111Cf0cS098357; Mon, 1 Feb 2021 12: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 111Cf0mm098356; Mon, 1 Feb 2021 12:41:00 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:41:00 GMT Message-Id: <202102011241.111Cf0mm098356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 1077e49657fa - stable/13 - fd: add fget_only_user 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1077e49657faaae1477a31fd534375e113df2bd4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:05 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1077e49657faaae1477a31fd534375e113df2bd4 commit 1077e49657faaae1477a31fd534375e113df2bd4 Author: Mateusz Guzik AuthorDate: 2021-01-28 23:27:44 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:18 +0000 fd: add fget_only_user This can be used by single-threaded processes which don't share a file descriptor table to access their file objects without having to reference them. For example select consumers tend to match the requirement and have several file descriptors to inspect. (cherry picked from commit eaad8d1303da500ed691bd774742a4555a05e729) --- sys/kern/kern_descrip.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++--- sys/sys/filedesc.h | 12 +++++++++ 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 257b1de2a6ac..059e5123c7b5 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1860,10 +1860,14 @@ fdgrowtable(struct filedesc *fdp, int nfd) * which must not be freed. */ if (onfiles > NDFILE) { - if (curproc->p_numthreads == 1 && - refcount_load(&fdp->fd_refcnt) == 1) + /* + * Note we may be called here from fdinit while allocating a + * table for a new process in which case ->p_fd points + * elsewhere. + */ + if (curproc->p_fd != fdp || FILEDESC_IS_ONLY_USER(fdp)) { free(otable, M_FILEDESC); - else { + } else { ft = (struct freetable *)&otable->fdt_ofiles[onfiles]; fdp0 = (struct filedesc0 *)fdp; ft->ft_table = otable; @@ -3176,6 +3180,66 @@ out_fallback: return (fget_unlocked_seq(fdp, fd, needrightsp, fpp, NULL)); } +/* + * Translate fd -> file when the caller guarantees the file descriptor table + * can't be changed by others. + * + * Note this does not mean the file object itself is only visible to the caller, + * merely that it wont disappear without having to be referenced. + * + * Must be paired with fput_only_user. + */ +#ifdef CAPABILITIES +int +fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp) +{ + const struct filedescent *fde; + const struct fdescenttbl *fdt; + const cap_rights_t *haverights; + struct file *fp; + int error; + + MPASS(FILEDESC_IS_ONLY_USER(fdp)); + + if (__predict_false(fd >= fdp->fd_nfiles)) + return (EBADF); + + fdt = fdp->fd_files; + fde = &fdt->fdt_ofiles[fd]; + fp = fde->fde_file; + if (__predict_false(fp == NULL)) + return (EBADF); + MPASS(refcount_load(&fp->f_count) > 0); + haverights = cap_rights_fde_inline(fde); + error = cap_check_inline(haverights, needrightsp); + if (__predict_false(error != 0)) + return (EBADF); + *fpp = fp; + return (0); +} +#else +int +fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp) +{ + struct file *fp; + + MPASS(FILEDESC_IS_ONLY_USER(fdp)); + + if (__predict_false(fd >= fdp->fd_nfiles)) + return (EBADF); + + fp = fdp->fd_ofiles[fd].fde_file; + if (__predict_false(fp == NULL)) + return (EBADF); + + MPASS(refcount_load(&fp->f_count) > 0); + *fpp = fp; + return (0); +} +#endif + /* * Extract the file pointer associated with the specified descriptor for the * current user process. diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 9b65c7a66054..890232b7f160 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -177,6 +177,11 @@ struct filedesc_to_leader { SX_NOTRECURSED) #define FILEDESC_UNLOCK_ASSERT(fdp) sx_assert(&(fdp)->fd_sx, SX_UNLOCKED) +#define FILEDESC_IS_ONLY_USER(fdp) ({ \ + struct filedesc *_fdp = (fdp); \ + MPASS(curproc->p_fd == _fdp); \ + (curproc->p_numthreads == 1 && refcount_load(&_fdp->fd_refcnt) == 1); \ +}) #else /* @@ -272,6 +277,13 @@ int fget_unlocked_seq(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, seqc_t *seqp); int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp); +/* Return a file pointer without a ref. FILEDESC_IS_ONLY_USER must be true. */ +int fget_only_user(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, + struct file **fpp); +#define fput_only_user(fdp, fp) ({ \ + MPASS(FILEDESC_IS_ONLY_USER(fdp)); \ + MPASS(refcount_load(&fp->f_count) > 0); \ +}) /* Requires a FILEDESC_{S,X}LOCK held and returns without a ref. */ static __inline struct file * From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 992174FED90; Mon, 1 Feb 2021 12:41: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 4DTncL1XXWz3Dvk; Mon, 1 Feb 2021 12:41: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 9105D1B5A1; Mon, 1 Feb 2021 12:41: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 111Cf15i098377; Mon, 1 Feb 2021 12:41:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cf1li098376; Mon, 1 Feb 2021 12:41:01 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:41:01 GMT Message-Id: <202102011241.111Cf1li098376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 233225ef7d56 - stable/13 - select: employ fget_only_user 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 233225ef7d5604162b6bda47e35fa7a8075bd559 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:09 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=233225ef7d5604162b6bda47e35fa7a8075bd559 commit 233225ef7d5604162b6bda47e35fa7a8075bd559 Author: Mateusz Guzik AuthorDate: 2021-01-28 23:33:46 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:18 +0000 select: employ fget_only_user Since most select users are single-threaded this avoid a lot of work in the common case. For example select of 16 fds (ops/s): before: 2114536 after: 2991010 (cherry picked from commit 6affe1b71238df7bbbca6e2059e5494d91e68d2d) --- sys/kern/sys_generic.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index a055f4a9b597..dc2cd56f5077 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1304,13 +1304,6 @@ selsetbits(fd_mask **ibits, fd_mask **obits, int idx, fd_mask bit, int events) return (n); } -static __inline int -getselfd_cap(struct filedesc *fdp, int fd, struct file **fpp) -{ - - return (fget_unlocked(fdp, fd, &cap_event_rights, fpp)); -} - /* * Traverse the list of fds attached to this thread's seltd and check for * completion. @@ -1327,10 +1320,12 @@ selrescan(struct thread *td, fd_mask **ibits, fd_mask **obits) fd_mask bit; int fd, ev, n, idx; int error; + bool only_user; fdp = td->td_proc->p_fd; stp = td->td_sel; n = 0; + only_user = FILEDESC_IS_ONLY_USER(fdp); STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn) { fd = (int)(uintptr_t)sfp->sf_cookie; si = sfp->sf_si; @@ -1338,13 +1333,19 @@ selrescan(struct thread *td, fd_mask **ibits, fd_mask **obits) /* If the selinfo wasn't cleared the event didn't fire. */ if (si != NULL) continue; - error = getselfd_cap(fdp, fd, &fp); - if (error) + if (only_user) + error = fget_only_user(fdp, fd, &cap_event_rights, &fp); + else + error = fget_unlocked(fdp, fd, &cap_event_rights, &fp); + if (__predict_false(error != 0)) return (error); idx = fd / NFDBITS; bit = (fd_mask)1 << (fd % NFDBITS); ev = fo_poll(fp, selflags(ibits, idx, bit), td->td_ucred, td); - fdrop(fp, td); + if (only_user) + fput_only_user(fdp, fp); + else + fdrop(fp, td); if (ev != 0) n += selsetbits(ibits, obits, idx, bit, ev); } @@ -1366,9 +1367,11 @@ selscan(struct thread *td, fd_mask **ibits, fd_mask **obits, int nfd) int ev, flags, end, fd; int n, idx; int error; + bool only_user; fdp = td->td_proc->p_fd; n = 0; + only_user = FILEDESC_IS_ONLY_USER(fdp); for (idx = 0, fd = 0; fd < nfd; idx++) { end = imin(fd + NFDBITS, nfd); for (bit = 1; fd < end; bit <<= 1, fd++) { @@ -1376,12 +1379,18 @@ selscan(struct thread *td, fd_mask **ibits, fd_mask **obits, int nfd) flags = selflags(ibits, idx, bit); if (flags == 0) continue; - error = getselfd_cap(fdp, fd, &fp); - if (error) + if (only_user) + error = fget_only_user(fdp, fd, &cap_event_rights, &fp); + else + error = fget_unlocked(fdp, fd, &cap_event_rights, &fp); + if (__predict_false(error != 0)) return (error); selfdalloc(td, (void *)(uintptr_t)fd); ev = fo_poll(fp, flags, td->td_ucred, td); - fdrop(fp, td); + if (only_user) + fput_only_user(fdp, fp); + else + fdrop(fp, td); if (ev != 0) n += selsetbits(ibits, obits, idx, bit, ev); } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 EDC214FEBD6; Mon, 1 Feb 2021 12: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 4DTncM4HBNz3F7k; Mon, 1 Feb 2021 12:41: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 B5BB81B6A3; Mon, 1 Feb 2021 12:41: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 111Cf2Ub098399; Mon, 1 Feb 2021 12:41:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cf25O098398; Mon, 1 Feb 2021 12:41:02 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:41:02 GMT Message-Id: <202102011241.111Cf25O098398@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 2bf72739da6f - stable/13 - poll: use fget_unlocked or fget_only_user when feasible 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2bf72739da6f54572597369a1b5892a124c6c9ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:10 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2bf72739da6f54572597369a1b5892a124c6c9ce commit 2bf72739da6f54572597369a1b5892a124c6c9ce Author: Mateusz Guzik AuthorDate: 2021-01-28 23:52:08 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:18 +0000 poll: use fget_unlocked or fget_only_user when feasible This follows select by eleminating the use of filedesc lock. This is a win for single-threaded processes and a mixed bag for others as at small concurrency it is faster to take the lock instead of refing/unrefing each file descriptor. Nonetheless, removal of shared lock usage is a step towards a mtx-protected fd table. (cherry picked from commit 45e1f8541428c19f63dba65d78a8d138e1bc6915) --- sys/kern/sys_generic.c | 75 ++++++++++++++++---------------------------------- 1 file changed, 24 insertions(+), 51 deletions(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index dc2cd56f5077..6fcdee7a088f 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1547,49 +1547,6 @@ sys_ppoll(struct thread *td, struct ppoll_args *uap) return (kern_poll(td, uap->fds, uap->nfds, tsp, ssp)); } -#ifdef CAPABILITIES -static int -poll_fget(struct filedesc *fdp, int fd, struct file **fpp) -{ - const struct filedescent *fde; - const struct fdescenttbl *fdt; - const cap_rights_t *haverights; - struct file *fp; - int error; - - if (__predict_false(fd >= fdp->fd_nfiles)) - return (EBADF); - - fdt = fdp->fd_files; - fde = &fdt->fdt_ofiles[fd]; - fp = fde->fde_file; - if (__predict_false(fp == NULL)) - return (EBADF); - haverights = cap_rights_fde_inline(fde); - error = cap_check_inline(haverights, &cap_event_rights); - if (__predict_false(error != 0)) - return (EBADF); - *fpp = fp; - return (0); -} -#else -static int -poll_fget(struct filedesc *fdp, int fd, struct file **fpp) -{ - struct file *fp; - - if (__predict_false(fd >= fdp->fd_nfiles)) - return (EBADF); - - fp = fdp->fd_ofiles[fd].fde_file; - if (__predict_false(fp == NULL)) - return (EBADF); - - *fpp = fp; - return (0); -} -#endif - static int pollrescan(struct thread *td) { @@ -1600,12 +1557,13 @@ pollrescan(struct thread *td) struct filedesc *fdp; struct file *fp; struct pollfd *fd; - int n; + int n, error; + bool only_user; n = 0; fdp = td->td_proc->p_fd; stp = td->td_sel; - FILEDESC_SLOCK(fdp); + only_user = FILEDESC_IS_ONLY_USER(fdp); STAILQ_FOREACH_SAFE(sfp, &stp->st_selq, sf_link, sfn) { fd = (struct pollfd *)sfp->sf_cookie; si = sfp->sf_si; @@ -1613,7 +1571,11 @@ pollrescan(struct thread *td) /* If the selinfo wasn't cleared the event didn't fire. */ if (si != NULL) continue; - if (poll_fget(fdp, fd->fd, &fp) != 0) { + if (only_user) + error = fget_only_user(fdp, fd->fd, &cap_event_rights, &fp); + else + error = fget_unlocked(fdp, fd->fd, &cap_event_rights, &fp); + if (__predict_false(error != 0)) { fd->revents = POLLNVAL; n++; continue; @@ -1623,10 +1585,13 @@ pollrescan(struct thread *td) * POLLERR if appropriate. */ fd->revents = fo_poll(fp, fd->events, td->td_ucred, td); + if (only_user) + fput_only_user(fdp, fp); + else + fdrop(fp, td); if (fd->revents != 0) n++; } - FILEDESC_SUNLOCK(fdp); stp->st_flags = 0; td->td_retval[0] = n; return (0); @@ -1658,17 +1623,22 @@ pollscan(struct thread *td, struct pollfd *fds, u_int nfd) { struct filedesc *fdp; struct file *fp; - int i, n; + int i, n, error; + bool only_user; n = 0; fdp = td->td_proc->p_fd; - FILEDESC_SLOCK(fdp); + only_user = FILEDESC_IS_ONLY_USER(fdp); for (i = 0; i < nfd; i++, fds++) { if (fds->fd < 0) { fds->revents = 0; continue; } - if (poll_fget(fdp, fds->fd, &fp) != 0) { + if (only_user) + error = fget_only_user(fdp, fds->fd, &cap_event_rights, &fp); + else + error = fget_unlocked(fdp, fds->fd, &cap_event_rights, &fp); + if (__predict_false(error != 0)) { fds->revents = POLLNVAL; n++; continue; @@ -1680,6 +1650,10 @@ pollscan(struct thread *td, struct pollfd *fds, u_int nfd) selfdalloc(td, fds); fds->revents = fo_poll(fp, fds->events, td->td_ucred, td); + if (only_user) + fput_only_user(fdp, fp); + else + fdrop(fp, td); /* * POSIX requires POLLOUT to be never * set simultaneously with POLLHUP. @@ -1690,7 +1664,6 @@ pollscan(struct thread *td, struct pollfd *fds, u_int nfd) if (fds->revents != 0) n++; } - FILEDESC_SUNLOCK(fdp); td->td_retval[0] = n; return (0); } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 30B2D4FEE97; Mon, 1 Feb 2021 12:41: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 4DTncP410Cz3FDV; Mon, 1 Feb 2021 12: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 CE5081B444; Mon, 1 Feb 2021 12:41: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 111Cf3mW098421; Mon, 1 Feb 2021 12:41:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cf3hj098420; Mon, 1 Feb 2021 12:41:03 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:41:03 GMT Message-Id: <202102011241.111Cf3hj098420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: e5b674594e64 - stable/13 - Reimplement strlen 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e5b674594e64b86a34295a475bb6cdb67469f8da Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:12 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e5b674594e64b86a34295a475bb6cdb67469f8da commit e5b674594e64b86a34295a475bb6cdb67469f8da Author: Mateusz Guzik AuthorDate: 2021-01-29 21:48:11 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:18 +0000 Reimplement strlen The previous code neglected to use primitives which can find the end of the string without having to branch on every character. While here augment the somewhat misleading commentary -- strlen as implemented here leaves performance on the table, especially so for userspace. Every arch should get a dedicated variant instead. In the meantime this commit lessens the problem. Tested with glibc test suite. Naive test just calling strlen in a loop on Haswell (ops/s): $(perl -e "print 'A' x 3"): before: 211198039 after: 338626619 $(perl -e "print 'A' x 100"): before: 83151997 after: 98285919 (cherry picked from commit 710e45c4b8539d028877769f1a4ec088c48fb5f1) --- lib/libc/string/strlen.c | 82 +++++++++++++++++------------------------------- sys/libkern/strlen.c | 79 +++++++++++++++------------------------------- 2 files changed, 53 insertions(+), 108 deletions(-) diff --git a/lib/libc/string/strlen.c b/lib/libc/string/strlen.c index a862ffc245ca..0bdc81d7bb9a 100644 --- a/lib/libc/string/strlen.c +++ b/lib/libc/string/strlen.c @@ -35,10 +35,6 @@ __FBSDID("$FreeBSD$"); /* * Portable strlen() for 32-bit and 64-bit systems. * - * Rationale: it is generally much more efficient to do word length - * operations and avoid branches on modern computer systems, as - * compared to byte-length operations with a lot of branches. - * * The expression: * * ((x - 0x01....01) & ~x & 0x80....80) @@ -46,18 +42,13 @@ __FBSDID("$FreeBSD$"); * would evaluate to a non-zero value iff any of the bytes in the * original word is zero. * - * On multi-issue processors, we can divide the above expression into: - * a) (x - 0x01....01) - * b) (~x & 0x80....80) - * c) a & b - * - * Where, a) and b) can be partially computed in parallel. - * * The algorithm above is found on "Hacker's Delight" by * Henry S. Warren, Jr. + * + * Note: this leaves performance on the table and each architecture + * would be best served with a tailor made routine instead. */ -/* Magic numbers for the algorithm */ #if LONG_BIT == 32 static const unsigned long mask01 = 0x01010101; static const unsigned long mask80 = 0x80808080; @@ -70,62 +61,45 @@ static const unsigned long mask80 = 0x8080808080808080; #define LONGPTR_MASK (sizeof(long) - 1) -/* - * Helper macro to return string length if we caught the zero - * byte. - */ -#define testbyte(x) \ - do { \ - if (p[x] == '\0') \ - return (p - str + x); \ - } while (0) +#if BYTE_ORDER == LITTLE_ENDIAN +#define FINDZERO __builtin_ctzl +#else +#define FINDZERO __builtin_clzl +#endif size_t strlen(const char *str) { - const char *p; const unsigned long *lp; + unsigned long mask; long va, vb; + long val; - /* - * Before trying the hard (unaligned byte-by-byte access) way - * to figure out whether there is a nul character, try to see - * if there is a nul character is within this accessible word - * first. - * - * p and (p & ~LONGPTR_MASK) must be equally accessible since - * they always fall in the same memory page, as long as page - * boundaries is integral multiple of word size. - */ - lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK); - va = (*lp - mask01); - vb = ((~*lp) & mask80); - lp++; - if (va & vb) - /* Check if we have \0 in the first part */ - for (p = str; p < (const char *)lp; p++) - if (*p == '\0') - return (p - str); + lp = (unsigned long *) (uintptr_t) str; + if ((uintptr_t)lp & LONGPTR_MASK) { + lp = (__typeof(lp)) ((uintptr_t)lp & ~LONGPTR_MASK); +#if BYTE_ORDER == LITTLE_ENDIAN + mask = ~(~0UL << (((uintptr_t)str & LONGPTR_MASK) << 3)); +#else + mask = ~(~0UL >> (((uintptr_t)str & LONGPTR_MASK) << 3)); +#endif + val = *lp | mask; + va = (val - mask01); + vb = ((~val) & mask80); + if (va & vb) { + return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); + } + lp++; + } - /* Scan the rest of the string using word sized operation */ for (; ; lp++) { va = (*lp - mask01); vb = ((~*lp) & mask80); if (va & vb) { - p = (const char *)(lp); - testbyte(0); - testbyte(1); - testbyte(2); - testbyte(3); -#if (LONG_BIT >= 64) - testbyte(4); - testbyte(5); - testbyte(6); - testbyte(7); -#endif + return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); } } - /* NOTREACHED */ + __builtin_unreachable(); return (0); } diff --git a/sys/libkern/strlen.c b/sys/libkern/strlen.c index a8c7964f69a3..8fa5f3927ea9 100644 --- a/sys/libkern/strlen.c +++ b/sys/libkern/strlen.c @@ -34,10 +34,6 @@ __FBSDID("$FreeBSD$"); /* * Portable strlen() for 32-bit and 64-bit systems. * - * Rationale: it is generally much more efficient to do word length - * operations and avoid branches on modern computer systems, as - * compared to byte-length operations with a lot of branches. - * * The expression: * * ((x - 0x01....01) & ~x & 0x80....80) @@ -45,18 +41,10 @@ __FBSDID("$FreeBSD$"); * would evaluate to a non-zero value iff any of the bytes in the * original word is zero. * - * On multi-issue processors, we can divide the above expression into: - * a) (x - 0x01....01) - * b) (~x & 0x80....80) - * c) a & b - * - * Where, a) and b) can be partially computed in parallel. - * * The algorithm above is found on "Hacker's Delight" by * Henry S. Warren, Jr. */ -/* Magic numbers for the algorithm */ #if LONG_BIT == 32 static const unsigned long mask01 = 0x01010101; static const unsigned long mask80 = 0x80808080; @@ -69,62 +57,45 @@ static const unsigned long mask80 = 0x8080808080808080; #define LONGPTR_MASK (sizeof(long) - 1) -/* - * Helper macro to return string length if we caught the zero - * byte. - */ -#define testbyte(x) \ - do { \ - if (p[x] == '\0') \ - return (p - str + x); \ - } while (0) +#if BYTE_ORDER == LITTLE_ENDIAN +#define FINDZERO __builtin_ctzl +#else +#define FINDZERO __builtin_clzl +#endif size_t (strlen)(const char *str) { - const char *p; const unsigned long *lp; + unsigned long mask; long va, vb; + long val; - /* - * Before trying the hard (unaligned byte-by-byte access) way - * to figure out whether there is a nul character, try to see - * if there is a nul character is within this accessible word - * first. - * - * p and (p & ~LONGPTR_MASK) must be equally accessible since - * they always fall in the same memory page, as long as page - * boundaries is integral multiple of word size. - */ - lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK); - va = (*lp - mask01); - vb = ((~*lp) & mask80); - lp++; - if (va & vb) - /* Check if we have \0 in the first part */ - for (p = str; p < (const char *)lp; p++) - if (*p == '\0') - return (p - str); + lp = (unsigned long *) (uintptr_t) str; + if ((uintptr_t)lp & LONGPTR_MASK) { + lp = (__typeof(lp)) ((uintptr_t)lp & ~LONGPTR_MASK); +#if BYTE_ORDER == LITTLE_ENDIAN + mask = ~(~0UL << (((uintptr_t)str & LONGPTR_MASK) << 3)); +#else + mask = ~(~0UL >> (((uintptr_t)str & LONGPTR_MASK) << 3)); +#endif + val = *lp | mask; + va = (val - mask01); + vb = ((~val) & mask80); + if (va & vb) { + return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); + } + lp++; + } - /* Scan the rest of the string using word sized operation */ for (; ; lp++) { va = (*lp - mask01); vb = ((~*lp) & mask80); if (va & vb) { - p = (const char *)(lp); - testbyte(0); - testbyte(1); - testbyte(2); - testbyte(3); -#if (LONG_BIT >= 64) - testbyte(4); - testbyte(5); - testbyte(6); - testbyte(7); -#endif + return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); } } - /* NOTREACHED */ + __builtin_unreachable(); return (0); } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 362EB4FEF84; Mon, 1 Feb 2021 12:41: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 4DTncQ2FZyz3FDf; Mon, 1 Feb 2021 12: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 2B8871B445; Mon, 1 Feb 2021 12:41: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 111Cf6U5098461; Mon, 1 Feb 2021 12:41:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cf6kA098460; Mon, 1 Feb 2021 12:41:06 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:41:06 GMT Message-Id: <202102011241.111Cf6kA098460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: be03df57d62f - stable/13 - amd64: retire sse2_pagezero 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/stable/13 X-Git-Reftype: branch X-Git-Commit: be03df57d62f4cc6161349f9127309ea20395c0d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:11 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=be03df57d62f4cc6161349f9127309ea20395c0d commit be03df57d62f4cc6161349f9127309ea20395c0d Author: Mateusz Guzik AuthorDate: 2021-01-30 00:17:15 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:18 +0000 amd64: retire sse2_pagezero All page zeroing is using temporal stores with rep movs*, the routine is unused for several years. Should a need arise for zeroing using non-temporal stores, a more optimized variant can be implemented with a more descriptive name. (cherry picked from commit d1de5698dfe6109308d4e5d6536a2ac93941d23a) --- sys/amd64/amd64/support.S | 24 ------------------------ sys/amd64/include/md_var.h | 1 - 2 files changed, 25 deletions(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 35e73e413e87..49baa50ac294 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -81,30 +81,6 @@ ENTRY(pagecopy) ret END(pagecopy) -/* Address: %rdi */ -ENTRY(sse2_pagezero) - PUSH_FRAME_POINTER - movq $-PAGE_SIZE,%rdx - subq %rdx,%rdi - xorl %eax,%eax - jmp 1f - /* - * The loop takes 29 bytes. Ensure that it doesn't cross a 32-byte - * cache line. - */ - .p2align 5,0x90 -1: - movnti %rax,(%rdi,%rdx) - movnti %rax,8(%rdi,%rdx) - movnti %rax,16(%rdi,%rdx) - movnti %rax,24(%rdi,%rdx) - addq $32,%rdx - jne 1b - sfence - POP_FRAME_POINTER - ret -END(sse2_pagezero) - /* * memcmpy(b1, b2, len) * rdi,rsi,rdx diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index 6b6201e4c0f1..3b2454a4b441 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -85,7 +85,6 @@ void gsbase_load_fault(void) __asm(__STRING(gsbase_load_fault)); void fpstate_drop(struct thread *td); void pagezero(void *addr); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist); -void sse2_pagezero(void *addr); void set_top_of_stack_td(struct thread *td); struct savefpu *get_pcb_user_save_td(struct thread *td); struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb); From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 341D04FED53; Mon, 1 Feb 2021 12:41: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 4DTncP67VSz3F42; Mon, 1 Feb 2021 12: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 EAF1F1B6A5; Mon, 1 Feb 2021 12:41: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 111Cf4Do098439; Mon, 1 Feb 2021 12:41:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cf4pA098438; Mon, 1 Feb 2021 12:41:04 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:41:04 GMT Message-Id: <202102011241.111Cf4pA098438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 3975d4c9e1be - stable/13 - amd64: add missing ALIGN_TEXT to loops in memset and memmove 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3975d4c9e1be53c2a4977acaa314bcdc18c02416 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:12 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3975d4c9e1be53c2a4977acaa314bcdc18c02416 commit 3975d4c9e1be53c2a4977acaa314bcdc18c02416 Author: Mateusz Guzik AuthorDate: 2021-01-29 15:09:14 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:18 +0000 amd64: add missing ALIGN_TEXT to loops in memset and memmove (cherry picked from commit 164c3b81848bc81dc200b12370999474225447a3) --- lib/libc/amd64/string/memmove.S | 2 ++ lib/libc/amd64/string/memset.S | 1 + sys/amd64/amd64/support.S | 3 +++ 3 files changed, 6 insertions(+) diff --git a/lib/libc/amd64/string/memmove.S b/lib/libc/amd64/string/memmove.S index accc86440610..4797140a1c16 100644 --- a/lib/libc/amd64/string/memmove.S +++ b/lib/libc/amd64/string/memmove.S @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq (%rsi),%rdx movq %rdx,(%rdi) @@ -198,6 +199,7 @@ __FBSDID("$FreeBSD$"); cmpq $32,%rcx jb 2016f + ALIGN_TEXT 2032: movq (%rsi),%rdx movq %rdx,(%rdi) diff --git a/lib/libc/amd64/string/memset.S b/lib/libc/amd64/string/memset.S index 67f21714b3d1..0639573a4a3e 100644 --- a/lib/libc/amd64/string/memset.S +++ b/lib/libc/amd64/string/memset.S @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq %r10,(%rdi) movq %r10,8(%rdi) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index b0ef54a27ca1..35e73e413e87 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -322,6 +322,7 @@ END(memcmp) cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq (%rsi),%rdx movq %rdx,(%rdi) @@ -455,6 +456,7 @@ END(memcmp) cmpq $32,%rcx jb 2016f + ALIGN_TEXT 2032: movq (%rsi),%rdx movq %rdx,(%rdi) @@ -595,6 +597,7 @@ END(memcpy_erms) cmpq $256,%rcx ja 1256f + ALIGN_TEXT 103200: movq %r10,(%rdi) movq %r10,8(%rdi) From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 A2BF54FED55; Mon, 1 Feb 2021 12:41: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 4DTncQ6HXNz3FDg; Mon, 1 Feb 2021 12:41: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 4ACF71B5A2; Mon, 1 Feb 2021 12:41: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 111Cf7E2098483; Mon, 1 Feb 2021 12:41:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cf7HS098482; Mon, 1 Feb 2021 12:41:07 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:41:07 GMT Message-Id: <202102011241.111Cf7HS098482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 6a3047840dfb - stable/13 - cache: handle NOFOLLOW requests for symlinks 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a3047840dfbbdb59d96a325f295f42755648545 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:12 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6a3047840dfbbdb59d96a325f295f42755648545 commit 6a3047840dfbbdb59d96a325f295f42755648545 Author: Mateusz Guzik AuthorDate: 2021-01-26 22:14:49 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:18 +0000 cache: handle NOFOLLOW requests for symlinks Tested by: pho (cherry picked from commit 8cbd164a179c182e8fd4a71f366bc48fe840eafb) --- sys/kern/vfs_cache.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index ff8aad14001b..b8b876657211 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4307,11 +4307,22 @@ cache_fplookup_final_modifying(struct cache_fpl *fpl) } /* - * Check if the target is either a symlink or a mount point. - * Since we expect this to be the terminal vnode it should - * almost never be true. + * If they want the symlink itself we are fine, but if they want to + * follow it regular lookup has to be engaged. */ - if (__predict_false(tvp->v_type == VLNK || cache_fplookup_is_mp(fpl))) { + if (tvp->v_type == VLNK) { + if ((cnp->cn_flags & FOLLOW) != 0) { + vput(dvp); + vput(tvp); + return (cache_fpl_aborted(fpl)); + } + } + + /* + * Since we expect this to be the terminal vnode it should almost never + * be a mount point. + */ + if (__predict_false(cache_fplookup_is_mp(fpl))) { vput(dvp); vput(tvp); return (cache_fpl_aborted(fpl)); @@ -4614,7 +4625,15 @@ cache_fplookup_noentry(struct cache_fpl *fpl) return (cache_fpl_handled(fpl)); } - if (__predict_false(tvp->v_type == VLNK || cache_fplookup_is_mp(fpl))) { + if (tvp->v_type == VLNK) { + if ((cnp->cn_flags & FOLLOW) != 0) { + vput(dvp); + vput(tvp); + return (cache_fpl_aborted(fpl)); + } + } + + if (__predict_false(cache_fplookup_is_mp(fpl))) { vput(dvp); vput(tvp); return (cache_fpl_aborted(fpl)); From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 109334FEF5B; Mon, 1 Feb 2021 12:41: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 4DTncT361Nz3FDr; Mon, 1 Feb 2021 12:41: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 94C381B173; Mon, 1 Feb 2021 12: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 111Cf90S098523; Mon, 1 Feb 2021 12: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 111Cf9TX098522; Mon, 1 Feb 2021 12:41:09 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:41:09 GMT Message-Id: <202102011241.111Cf9TX098522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 71b460513827 - stable/13 - Drop temporary compat in setproctitle 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 71b460513827a730c4e5dbf0c9a8eb3a18a95112 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:15 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=71b460513827a730c4e5dbf0c9a8eb3a18a95112 commit 71b460513827a730c4e5dbf0c9a8eb3a18a95112 Author: Mateusz Guzik AuthorDate: 2021-01-31 12:23:42 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:19 +0000 Drop temporary compat in setproctitle (cherry picked from commit 46f168bc665a1aee79d91bd102aef7d4754e7917) --- lib/libc/gen/setproctitle.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c index 991af38565cd..3f858952255c 100644 --- a/lib/libc/gen/setproctitle.c +++ b/lib/libc/gen/setproctitle.c @@ -185,17 +185,7 @@ setproctitle_fast(const char *fmt, ...) oid[1] = KERN_PROC; oid[2] = KERN_PROC_ARGS; oid[3] = -1; - if (sysctl(oid, 4, 0, 0, "", 0) != 0) { - /* - * Temporary compat for kernels which don't support - * passing -1. - */ - oid[0] = CTL_KERN; - oid[1] = KERN_PROC; - oid[2] = KERN_PROC_ARGS; - oid[3] = getpid(); - sysctl(oid, 4, 0, 0, "", 0); - } + sysctl(oid, 4, 0, 0, "", 0); fast_update = 1; } } @@ -217,17 +207,7 @@ setproctitle(const char *fmt, ...) oid[1] = KERN_PROC; oid[2] = KERN_PROC_ARGS; oid[3] = -1; - if (sysctl(oid, 4, 0, 0, buf, strlen(buf) + 1) != 0) { - /* - * Temporary compat for kernels which don't support - * passing -1. - */ - oid[0] = CTL_KERN; - oid[1] = KERN_PROC; - oid[2] = KERN_PROC_ARGS; - oid[3] = getpid(); - sysctl(oid, 4, 0, 0, buf, strlen(buf) + 1); - } + sysctl(oid, 4, 0, 0, buf, strlen(buf) + 1); fast_update = 0; } } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:41: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 204B54FEF5C; Mon, 1 Feb 2021 12:41: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 4DTncS6CCYz3F74; Mon, 1 Feb 2021 12:41: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 6CC881B70E; Mon, 1 Feb 2021 12:41: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 111Cf8Up098502; Mon, 1 Feb 2021 12:41:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cf89L098500; Mon, 1 Feb 2021 12:41:08 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:41:08 GMT Message-Id: <202102011241.111Cf89L098500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 006ec2ed1565 - stable/13 - cache: add trailing slash support 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 006ec2ed15650778c36ef956c5058b5b38717de7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:15 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=006ec2ed15650778c36ef956c5058b5b38717de7 commit 006ec2ed15650778c36ef956c5058b5b38717de7 Author: Mateusz Guzik AuthorDate: 2021-01-26 00:38:21 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:19 +0000 cache: add trailing slash support Tested by: pho (cherry picked from commit e027e24bfac7dd311ddacaec73d6c42102069511) --- sys/kern/vfs_cache.c | 227 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 184 insertions(+), 43 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index b8b876657211..1780e8235dd3 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3714,6 +3714,7 @@ static bool cache_fplookup_is_mp(struct cache_fpl *fpl); static int cache_fplookup_cross_mount(struct cache_fpl *fpl); static int cache_fplookup_partial_setup(struct cache_fpl *fpl); static int cache_fplookup_skip_slashes(struct cache_fpl *fpl); +static int cache_fplookup_trailingslash(struct cache_fpl *fpl); static int cache_fplookup_preparse(struct cache_fpl *fpl); static void cache_fpl_pathlen_dec(struct cache_fpl *fpl); static void cache_fpl_pathlen_inc(struct cache_fpl *fpl); @@ -3971,6 +3972,13 @@ cache_fpl_islastcn(struct nameidata *ndp) return (*ndp->ni_next == 0); } +static bool +cache_fpl_istrailingslash(struct cache_fpl *fpl) +{ + + return (*(fpl->nulchar - 1) == '/'); +} + static bool cache_fpl_isdotdot(struct componentname *cnp) { @@ -4201,6 +4209,15 @@ cache_fplookup_final_modifying(struct cache_fpl *fpl) if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME) docache = false; + /* + * Regular lookup nulifies the slash, which we don't do here. + * Don't take chances with filesystem routines seeing it for + * the last entry. + */ + if (cache_fpl_istrailingslash(fpl)) { + return (cache_fpl_partial(fpl)); + } + mp = atomic_load_ptr(&dvp->v_mount); if (__predict_false(mp == NULL)) { return (cache_fpl_aborted(fpl)); @@ -4533,7 +4550,6 @@ cache_fplookup_noentry(struct cache_fpl *fpl) dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; - MPASS(*(cnp->cn_nameptr) != '/'); MPASS((cnp->cn_flags & MAKEENTRY) == 0); MPASS((cnp->cn_flags & ISDOTDOT) == 0); MPASS(!cache_fpl_isdotdot(cnp)); @@ -4546,6 +4562,14 @@ cache_fplookup_noentry(struct cache_fpl *fpl) return (cache_fpl_handled_error(fpl, ENAMETOOLONG)); } + if (cnp->cn_nameptr[0] == '/') { + return (cache_fplookup_skip_slashes(fpl)); + } + + if (cnp->cn_nameptr[0] == '\0') { + return (cache_fplookup_trailingslash(fpl)); + } + if (cnp->cn_nameiop != LOOKUP) { fpl->tvp = NULL; return (cache_fplookup_modifying(fpl)); @@ -4562,6 +4586,15 @@ cache_fplookup_noentry(struct cache_fpl *fpl) return (cache_fpl_partial(fpl)); } + /* + * Regular lookup nulifies the slash, which we don't do here. + * Don't take chances with filesystem routines seeing it for + * the last entry. + */ + if (cache_fpl_istrailingslash(fpl)) { + return (cache_fpl_partial(fpl)); + } + /* * Secure access to dvp; check cache_fplookup_partial_setup for * reasoning. @@ -4792,6 +4825,7 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) { struct nameidata *ndp; struct componentname *cnp; + size_t adjust; ndp = fpl->ndp; cnp = fpl->cnp; @@ -4800,6 +4834,12 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) return (ENOENT); } + if (__predict_false(len > MAXPATHLEN - 2)) { + if (cache_fpl_istrailingslash(fpl)) { + return (EAGAIN); + } + } + ndp->ni_pathlen = fpl->nulchar - cnp->cn_nameptr - cnp->cn_namelen + 1; #ifdef INVARIANTS if (ndp->ni_pathlen != fpl->debug.ni_pathlen) { @@ -4817,15 +4857,22 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) return (ELOOP); } + adjust = len; if (ndp->ni_pathlen > 1) { bcopy(ndp->ni_next, cnp->cn_pnbuf + len, ndp->ni_pathlen); } else { - cnp->cn_pnbuf[len] = '\0'; + if (cache_fpl_istrailingslash(fpl)) { + adjust = len + 1; + cnp->cn_pnbuf[len] = '/'; + cnp->cn_pnbuf[len + 1] = '\0'; + } else { + cnp->cn_pnbuf[len] = '\0'; + } } bcopy(string, cnp->cn_pnbuf, len); - ndp->ni_pathlen += len; - cache_fpl_pathlen_add(fpl, len); + ndp->ni_pathlen += adjust; + cache_fpl_pathlen_add(fpl, adjust); cnp->cn_nameptr = cnp->cn_pnbuf; fpl->nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; @@ -4925,9 +4972,6 @@ cache_fplookup_next(struct cache_fpl *fpl) } if (__predict_false(ncp == NULL)) { - if (cnp->cn_nameptr[0] == '/') { - return (cache_fplookup_skip_slashes(fpl)); - } return (cache_fplookup_noentry(fpl)); } @@ -5194,21 +5238,6 @@ cache_fplookup_preparse(struct cache_fpl *fpl) ("%s: mismatch on string (%p != %p) [%s]\n", __func__, &cnp->cn_nameptr[fpl->debug.ni_pathlen - 2], fpl->nulchar - 1, cnp->cn_pnbuf)); - if (__predict_false(*(fpl->nulchar - 1) == '/')) { - /* - * TODO - * Regular lookup performs the following: - * *ndp->ni_next = '\0'; - * cnp->cn_flags |= TRAILINGSLASH; - * - * Which is problematic since it modifies data read - * from userspace. Then if fast path lookup was to - * abort we would have to either restore it or convey - * the flag. Since this is a corner case just ignore - * it for simplicity. - */ - return (cache_fpl_aborted(fpl)); - } return (0); } @@ -5254,27 +5283,6 @@ cache_fplookup_parse(struct cache_fpl *fpl) * then it could not have been too long to begin with. */ ndp->ni_next = cp; - -#ifdef INVARIANTS - /* - * Code below is only here to assure compatibility with regular lookup. - * It covers handling of trailing slashes and names like "/", both of - * which of can be taken care of upfront which lockless lookup does - * in cache_fplookup_preparse. Regular lookup performs these for each - * path component. - */ - while (*cp == '/' && (cp[1] == '/' || cp[1] == '\0')) { - cp++; - if (*cp == '\0') { - panic("%s: ran into TRAILINGSLASH handling from [%s]\n", - __func__, cnp->cn_pnbuf); - } - } - - if (cnp->cn_nameptr[0] == '\0') { - panic("%s: ran into degenerate name from [%s]\n", __func__, cnp->cn_pnbuf); - } -#endif } static void @@ -5339,6 +5347,139 @@ cache_fplookup_skip_slashes(struct cache_fpl *fpl) return (0); } +/* + * Handle trailing slashes (e.g., "foo/"). + * + * If a trailing slash is found the terminal vnode must be a directory. + * Regular lookup shortens the path by nulifying the first trailing slash and + * sets the TRAILINGSLASH flag to denote this took place. There are several + * checks on it performed later. + * + * Similarly to spurious slashes, lockless lookup handles this in a speculative + * manner relying on an invariant that a non-directory vnode will get a miss. + * In this case cn_nameptr[0] == '\0' and cn_namelen == 0. + * + * Thus for a path like "foo/bar/" the code unwinds the state back to 'bar/' + * and denotes this is the last path component, which avoids looping back. + * + * Only plain lookups are supported for now to restrict corner cases to handle. + */ +static int __noinline +cache_fplookup_trailingslash(struct cache_fpl *fpl) +{ +#ifdef INVARIANTS + size_t ni_pathlen; +#endif + struct nameidata *ndp; + struct componentname *cnp; + struct namecache *ncp; + struct vnode *tvp; + char *cn_nameptr_orig, *cn_nameptr_slash; + seqc_t tvp_seqc; + u_char nc_flag; + + ndp = fpl->ndp; + cnp = fpl->cnp; + tvp = fpl->tvp; + tvp_seqc = fpl->tvp_seqc; + + MPASS(fpl->dvp == fpl->tvp); + KASSERT(cache_fpl_istrailingslash(fpl), + ("%s: expected trailing slash at %p; string [%s]\n", __func__, fpl->nulchar - 1, + cnp->cn_pnbuf)); + KASSERT(cnp->cn_nameptr[0] == '\0', + ("%s: expected nul char at %p; string [%s]\n", __func__, &cnp->cn_nameptr[0], + cnp->cn_pnbuf)); + KASSERT(cnp->cn_namelen == 0, + ("%s: namelen 0 but got %ld; string [%s]\n", __func__, cnp->cn_namelen, + cnp->cn_pnbuf)); + MPASS(cnp->cn_nameptr > cnp->cn_pnbuf); + + if (cnp->cn_nameiop != LOOKUP) { + return (cache_fpl_aborted(fpl)); + } + + if (__predict_false(tvp->v_type != VDIR)) { + if (!vn_seqc_consistent(tvp, tvp_seqc)) { + return (cache_fpl_aborted(fpl)); + } + cache_fpl_smr_exit(fpl); + return (cache_fpl_handled_error(fpl, ENOTDIR)); + } + + /* + * Denote the last component. + */ + ndp->ni_next = &cnp->cn_nameptr[0]; + MPASS(cache_fpl_islastcn(ndp)); + + /* + * Unwind trailing slashes. + */ + cn_nameptr_orig = cnp->cn_nameptr; + while (cnp->cn_nameptr >= cnp->cn_pnbuf) { + cnp->cn_nameptr--; + if (cnp->cn_nameptr[0] != '/') { + break; + } + } + + /* + * Unwind to the beginning of the path component. + * + * Note the path may or may not have started with a slash. + */ + cn_nameptr_slash = cnp->cn_nameptr; + while (cnp->cn_nameptr > cnp->cn_pnbuf) { + cnp->cn_nameptr--; + if (cnp->cn_nameptr[0] == '/') { + break; + } + } + if (cnp->cn_nameptr[0] == '/') { + cnp->cn_nameptr++; + } + + cnp->cn_namelen = cn_nameptr_slash - cnp->cn_nameptr + 1; + cache_fpl_pathlen_add(fpl, cn_nameptr_orig - cnp->cn_nameptr); + cache_fpl_checkpoint(fpl); + +#ifdef INVARIANTS + ni_pathlen = fpl->nulchar - cnp->cn_nameptr + 1; + if (ni_pathlen != fpl->debug.ni_pathlen) { + panic("%s: mismatch (%zu != %zu) nulchar %p nameptr %p [%s] ; full string [%s]\n", + __func__, ni_pathlen, fpl->debug.ni_pathlen, fpl->nulchar, + cnp->cn_nameptr, cnp->cn_nameptr, cnp->cn_pnbuf); + } +#endif + + /* + * The previous directory is this one. + */ + if (cnp->cn_nameptr[0] == '.' && cnp->cn_namelen == 1) { + return (0); + } + + /* + * The previous directory is something else. + */ + tvp = fpl->tvp; + ncp = atomic_load_consume_ptr(&tvp->v_cache_dd); + if (__predict_false(ncp == NULL)) { + return (cache_fpl_aborted(fpl)); + } + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_ISDOTDOT) != 0) { + return (cache_fpl_aborted(fpl)); + } + fpl->dvp = ncp->nc_dvp; + fpl->dvp_seqc = vn_seqc_read_any(fpl->dvp); + if (seqc_in_modify(fpl->dvp_seqc)) { + return (cache_fpl_aborted(fpl)); + } + return (0); +} + /* * See the API contract for VOP_FPLOOKUP_VEXEC. */ From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:46: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 3E1CF4FF9EF; Mon, 1 Feb 2021 12:46: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 4DTnkl14nWz3JsS; Mon, 1 Feb 2021 12:46: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 438461B169; Mon, 1 Feb 2021 12:40: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 111CeoH5097316; Mon, 1 Feb 2021 12:40:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Ceo2A097315; Mon, 1 Feb 2021 12:40:50 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:50 GMT Message-Id: <202102011240.111Ceo2A097315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 247f652e622d - stable/13 - cache: make ->nc_flag accesses atomic-clean for lockless usage 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 247f652e622d9aebda627ea34ba5af242dbb835e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:46:39 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=247f652e622d9aebda627ea34ba5af242dbb835e commit 247f652e622d9aebda627ea34ba5af242dbb835e Author: Mateusz Guzik AuthorDate: 2021-01-25 20:58:59 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:17 +0000 cache: make ->nc_flag accesses atomic-clean for lockless usage (cherry picked from commit 6ef8fede86f3feed7fb1e15b0e8a32ecfec33c6c) --- sys/kern/vfs_cache.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 9d5b18aa4132..ba3856ffe0b4 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -398,7 +398,7 @@ static inline struct negstate * NCP2NEGSTATE(struct namecache *ncp) { - MPASS(ncp->nc_flag & NCF_NEGATIVE); + MPASS(atomic_load_char(&ncp->nc_flag) & NCF_NEGATIVE); return (&ncp->nc_neg); } @@ -1994,7 +1994,7 @@ negative_success: } cache_out_ts(ncp, tsp, ticksp); - whiteout = (ncp->nc_flag & NCF_WHITE); + whiteout = (atomic_load_char(&ncp->nc_flag) & NCF_WHITE); neg_promote = cache_neg_hit_prep(ncp); if (!cache_ncp_canuse(ncp)) { cache_neg_hit_abort(ncp); @@ -2149,6 +2149,7 @@ cache_enter_lock(struct celockstate *cel, struct vnode *dvp, struct vnode *vp, { struct namecache *ncp; struct mtx *blps[2]; + u_char nc_flag; blps[0] = HASH2BUCKETLOCK(hash); for (;;) { @@ -2159,11 +2160,12 @@ cache_enter_lock(struct celockstate *cel, struct vnode *dvp, struct vnode *vp, ncp = vp->v_cache_dd; if (ncp == NULL) break; - if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_ISDOTDOT) == 0) break; MPASS(ncp->nc_dvp == vp); blps[1] = NCP2BUCKETLOCK(ncp); - if (ncp->nc_flag & NCF_NEGATIVE) + if ((nc_flag & NCF_NEGATIVE) != 0) break; if (cache_lock_vnodes_cel_3(cel, ncp->nc_vp)) break; @@ -2190,6 +2192,7 @@ cache_enter_lock_dd(struct celockstate *cel, struct vnode *dvp, struct vnode *vp { struct namecache *ncp; struct mtx *blps[2]; + u_char nc_flag; blps[0] = HASH2BUCKETLOCK(hash); for (;;) { @@ -2198,11 +2201,12 @@ cache_enter_lock_dd(struct celockstate *cel, struct vnode *dvp, struct vnode *vp ncp = dvp->v_cache_dd; if (ncp == NULL) break; - if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_ISDOTDOT) == 0) break; MPASS(ncp->nc_dvp == dvp); blps[1] = NCP2BUCKETLOCK(ncp); - if (ncp->nc_flag & NCF_NEGATIVE) + if ((nc_flag & NCF_NEGATIVE) != 0) break; if (cache_lock_vnodes_cel_3(cel, ncp->nc_vp)) break; @@ -2436,7 +2440,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, vp); } else { if (cnp->cn_flags & ISWHITEOUT) - ncp->nc_flag |= NCF_WHITE; + atomic_store_char(&ncp->nc_flag, ncp->nc_flag | NCF_WHITE); cache_neg_insert(ncp); SDT_PROBE2(vfs, namecache, enter_negative, done, dvp, ncp->nc_name); From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:46: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 4D5854FF43A; Mon, 1 Feb 2021 12:46: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 4DTnkl1cKmz3JbV; Mon, 1 Feb 2021 12:46: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 EE5961B1DD; Mon, 1 Feb 2021 12:40: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 111Celsv097276; Mon, 1 Feb 2021 12:40:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CelwN097275; Mon, 1 Feb 2021 12:40:47 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:47 GMT Message-Id: <202102011240.111CelwN097275@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 872a0097fd81 - stable/13 - tmpfs: drop acq fence now that vn_load_v_data_smr has consume semantics 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 872a0097fd81235cea5730e642daf725e8bf8afc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:46:39 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=872a0097fd81235cea5730e642daf725e8bf8afc commit 872a0097fd81235cea5730e642daf725e8bf8afc Author: Mateusz Guzik AuthorDate: 2021-01-25 20:17:48 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:16 +0000 tmpfs: drop acq fence now that vn_load_v_data_smr has consume semantics (cherry picked from commit c09f7992714559eaa874f13ea4a1d648f199cd08) --- sys/fs/tmpfs/tmpfs_subr.c | 3 --- sys/fs/tmpfs/tmpfs_vnops.c | 1 - 2 files changed, 4 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 3b3581fc81f6..84473a439c43 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -356,9 +356,6 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, * pointer to also get the above content in a stable manner. * Worst case tn_link_smr flag may be set to true despite being stale, * while the target buffer is already cleared out. - * - * TODO: Since there is no load consume primitive provided - * right now, the load is performed with an acquire fence. */ atomic_store_ptr(&nnode->tn_link_target, symlink); atomic_store_char((char *)&nnode->tn_link_smr, symlink_smr); diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index bc4caa4adecb..7be2655dcf0b 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1471,7 +1471,6 @@ tmpfs_fplookup_symlink(struct vop_fplookup_symlink_args *v) vp = v->a_vp; node = VP_TO_TMPFS_NODE_SMR(vp); - atomic_thread_fence_acq(); if (__predict_false(node == NULL)) return (EAGAIN); if (!atomic_load_char(&node->tn_link_smr)) From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:46: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 4D5ED4FF7F8; Mon, 1 Feb 2021 12:46: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 4DTnkl1cxhz3JbW; Mon, 1 Feb 2021 12:46: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 E41531B43F; Mon, 1 Feb 2021 12:40: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 111CetTS097422; Mon, 1 Feb 2021 12:40:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CetKn097421; Mon, 1 Feb 2021 12:40:55 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:55 GMT Message-Id: <202102011240.111CetKn097421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 742285d28301 - stable/13 - cache: tidy up handling of foo/bar lookups where foo is not a directory 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 742285d283012c0022e9acdbe9ed1c7dd5cbb5e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:46:39 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=742285d283012c0022e9acdbe9ed1c7dd5cbb5e6 commit 742285d283012c0022e9acdbe9ed1c7dd5cbb5e6 Author: Mateusz Guzik AuthorDate: 2021-01-26 16:19:12 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:17 +0000 cache: tidy up handling of foo/bar lookups where foo is not a directory The code was performing an avoidable check for doomed state to account for foo being a VDIR but turning VBAD. Now that dooming puts a vnode in a permanent "modify" state this is no longer necessary as the final status check will catch it. (cherry picked from commit a098a831a162fcd55b0097c95e6840621d8c720a) --- sys/kern/vfs_cache.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 4e2cfa9edf53..b759affcc0ac 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5328,20 +5328,11 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) } /* - * Hack: they may be looking up foo/bar, where foo is a - * regular file. In such a case we need to turn ENOTDIR, - * but we may happen to get here with a different error. + * Hack: they may be looking up foo/bar, where foo is not a directory. + * In such a case we need to return ENOTDIR, but we may happen to get + * here with a different error. */ if (dvp->v_type != VDIR) { - /* - * The check here is predominantly to catch - * EOPNOTSUPP from dead_vnodeops. If the vnode - * gets doomed past this point it is going to - * fail seqc verification. - */ - if (VN_IS_DOOMED(dvp)) { - return (cache_fpl_aborted(fpl)); - } error = ENOTDIR; } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:46: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 1806C4FF8E7; Mon, 1 Feb 2021 12:46: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 4DTnkl022gz3JsR; Mon, 1 Feb 2021 12:46: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 CB1621B709; Mon, 1 Feb 2021 12:40: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 111CekFZ096896; Mon, 1 Feb 2021 12:40:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CekWc096881; Mon, 1 Feb 2021 12:40:46 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:46 GMT Message-Id: <202102011240.111CekWc096881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 7ba12ba0a2df - stable/13 - zfs: use atomic_load_consume_ptr for z_cached_symlink 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ba12ba0a2df573d055c7f088e666d86e4fea898 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:46:39 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7ba12ba0a2df573d055c7f088e666d86e4fea898 commit 7ba12ba0a2df573d055c7f088e666d86e4fea898 Author: Mateusz Guzik AuthorDate: 2021-01-25 20:15:19 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:16 +0000 zfs: use atomic_load_consume_ptr for z_cached_symlink (cherry picked from commit 7af02ef0b222eebad4827a264454e85134692e94) --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 1ee0895625a6..42f5786ce5c7 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -4476,10 +4476,7 @@ zfs_freebsd_fplookup_symlink(struct vop_fplookup_symlink_args *v) return (EAGAIN); } - /* - * FIXME: Load consume would be sufficient but there is no primitive to do it. - */ - target = (char *)atomic_load_acq_ptr((uintptr_t *)&zp->z_cached_symlink); + target = atomic_load_consume_ptr(&zp->z_cached_symlink); if (target == NULL) { return (EAGAIN); } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:46: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 3E26E4FF438; Mon, 1 Feb 2021 12:46: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 4DTnkl15NTz3JkG; Mon, 1 Feb 2021 12:46: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 382E51B634; Mon, 1 Feb 2021 12:40: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 111CewPu097477; Mon, 1 Feb 2021 12:40:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Cew5v097470; Mon, 1 Feb 2021 12:40:58 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:58 GMT Message-Id: <202102011240.111Cew5v097470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: e13587448ab1 - stable/13 - cache: fallback when encountering a mount point during .. lookup 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e13587448ab1da930640563340b5e492325f2e10 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:46:39 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e13587448ab1da930640563340b5e492325f2e10 commit e13587448ab1da930640563340b5e492325f2e10 Author: Mateusz Guzik AuthorDate: 2021-01-27 12:52:23 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:17 +0000 cache: fallback when encountering a mount point during .. lookup The current abort is overzealous. (cherry picked from commit 5fc384d1810a3a0a0acefc67abe1daf6d6cd09e4) --- sys/kern/vfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index b759affcc0ac..be06a2edc58b 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4697,7 +4697,7 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) * TODO * The opposite of climb mount is needed here. */ - return (cache_fpl_aborted(fpl)); + return (cache_fpl_partial(fpl)); } ncp = atomic_load_consume_ptr(&dvp->v_cache_dd); From owner-dev-commits-src-all@freebsd.org Mon Feb 1 12:46: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 4643B4FF439; Mon, 1 Feb 2021 12:46: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 4DTnkl13Wlz3Jxx; Mon, 1 Feb 2021 12:46: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 67E231B62F; Mon, 1 Feb 2021 12:40: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 111CepBj097338; Mon, 1 Feb 2021 12:40:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111CepG1097337; Mon, 1 Feb 2021 12:40:51 GMT (envelope-from git) Date: Mon, 1 Feb 2021 12:40:51 GMT Message-Id: <202102011240.111CepG1097337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 9375a93b6c22 - stable/13 - cache: make ->v_cache_dd accesses atomic-clean for lockless usage 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9375a93b6c225d32b24bd141c0033402feebb185 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:46:39 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=9375a93b6c225d32b24bd141c0033402feebb185 commit 9375a93b6c225d32b24bd141c0033402feebb185 Author: Mateusz Guzik AuthorDate: 2021-01-25 20:29:54 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-01 12:39:17 +0000 cache: make ->v_cache_dd accesses atomic-clean for lockless usage (cherry picked from commit 6f0842764946ed57382293cc3361b86955308084) --- sys/kern/vfs_cache.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index ba3856ffe0b4..fad7ce91ef44 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1441,7 +1441,7 @@ cache_zap_locked(struct namecache *ncp) TAILQ_REMOVE(&vp->v_cache_dst, ncp, nc_dst); if (ncp == vp->v_cache_dd) { vn_seqc_write_begin_unheld(vp); - vp->v_cache_dd = NULL; + atomic_store_ptr(&vp->v_cache_dd, NULL); vn_seqc_write_end(vp); } } else { @@ -1451,7 +1451,7 @@ cache_zap_locked(struct namecache *ncp) if (ncp->nc_flag & NCF_ISDOTDOT) { if (ncp == dvp->v_cache_dd) { vn_seqc_write_begin_unheld(dvp); - dvp->v_cache_dd = NULL; + atomic_store_ptr(&dvp->v_cache_dd, NULL); vn_seqc_write_end(dvp); } } else { @@ -1628,7 +1628,7 @@ retry_dotdot: cache_free(ncp); } else { vn_seqc_write_begin(dvp); - dvp->v_cache_dd = NULL; + atomic_store_ptr(&dvp->v_cache_dd, NULL); vn_seqc_write_end(dvp); mtx_unlock(dvlp); if (dvlp2 != NULL) @@ -2157,7 +2157,7 @@ cache_enter_lock(struct celockstate *cel, struct vnode *dvp, struct vnode *vp, cache_lock_vnodes_cel(cel, dvp, vp); if (vp == NULL || vp->v_type != VDIR) break; - ncp = vp->v_cache_dd; + ncp = atomic_load_consume_ptr(&vp->v_cache_dd); if (ncp == NULL) break; nc_flag = atomic_load_char(&ncp->nc_flag); @@ -2198,7 +2198,7 @@ cache_enter_lock_dd(struct celockstate *cel, struct vnode *dvp, struct vnode *vp for (;;) { blps[1] = NULL; cache_lock_vnodes_cel(cel, dvp, vp); - ncp = dvp->v_cache_dd; + ncp = atomic_load_consume_ptr(&dvp->v_cache_dd); if (ncp == NULL) break; nc_flag = atomic_load_char(&ncp->nc_flag); @@ -2240,7 +2240,7 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp, uint32_t hash; int len; - if (dvp->v_cache_dd == NULL) + if (atomic_load_ptr(&dvp->v_cache_dd) == NULL) return; len = cnp->cn_namelen; cache_celockstate_init(&cel); @@ -2254,7 +2254,7 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp, } else { ncp = NULL; } - dvp->v_cache_dd = NULL; + atomic_store_ptr(&dvp->v_cache_dd, NULL); vn_seqc_write_end(dvp); cache_enter_unlock(&cel); if (ncp != NULL) @@ -2393,7 +2393,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, KASSERT(vp == NULL || vp->v_type == VDIR, ("wrong vnode type %p", vp)); vn_seqc_write_begin(dvp); - dvp->v_cache_dd = ncp; + atomic_store_ptr(&dvp->v_cache_dd, ncp); vn_seqc_write_end(dvp); } @@ -2411,12 +2411,12 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, else ndd = NULL; } - vp->v_cache_dd = ncp; + atomic_store_ptr(&vp->v_cache_dd, ncp); vn_seqc_write_end(vp); } else if (vp->v_type != VDIR) { if (vp->v_cache_dd != NULL) { vn_seqc_write_begin(vp); - vp->v_cache_dd = NULL; + atomic_store_ptr(&vp->v_cache_dd, NULL); vn_seqc_write_end(vp); } } @@ -2658,7 +2658,7 @@ cache_has_entries(struct vnode *vp) { if (LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && - vp->v_cache_dd == NULL) + atomic_load_ptr(&vp->v_cache_dd) == NULL) return (false); return (true); } @@ -3291,7 +3291,7 @@ vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char *buf, vp_seqc = tvp_seqc; continue; } - ncp = atomic_load_ptr(&vp->v_cache_dd); + ncp = atomic_load_consume_ptr(&vp->v_cache_dd); if (ncp == NULL) { cache_rev_failed(&reason); goto out_abort; @@ -4705,7 +4705,7 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } - ncp = atomic_load_ptr(&dvp->v_cache_dd); + ncp = atomic_load_consume_ptr(&dvp->v_cache_dd); if (ncp == NULL) { return (cache_fpl_aborted(fpl)); } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 13: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 D1A945285CB; Mon, 1 Feb 2021 13:05: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 4DTp8J5Y9Wz3LyW; Mon, 1 Feb 2021 13:05: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 B16841BCDD; Mon, 1 Feb 2021 13:05: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 111D5KKH026513; Mon, 1 Feb 2021 13:05:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111D5Kck026512; Mon, 1 Feb 2021 13:05:20 GMT (envelope-from git) Date: Mon, 1 Feb 2021 13:05:20 GMT Message-Id: <202102011305.111D5Kck026512@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: bdd4630c9a9c - main - 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/main X-Git-Reftype: branch X-Git-Commit: bdd4630c9a9cea64830f981fc897ac953c48892c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 13:05:20 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bdd4630c9a9cea64830f981fc897ac953c48892c commit bdd4630c9a9cea64830f981fc897ac953c48892c Author: Michael Tuexen AuthorDate: 2021-02-01 13:03:41 +0000 Commit: Michael Tuexen CommitDate: 2021-02-01 13:04:57 +0000 sctp: small cleanup, no functional change intended. MFC after: 3 days --- 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 Mon Feb 1 13:05: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 BF3BF528699; Mon, 1 Feb 2021 13:05: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 4DTp8X0JYrz3MCD; Mon, 1 Feb 2021 13:05: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 D44B61B765; Mon, 1 Feb 2021 13:05: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 111D5V0C026663; Mon, 1 Feb 2021 13:05:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111D5VpX026662; Mon, 1 Feb 2021 13:05:31 GMT (envelope-from git) Date: Mon, 1 Feb 2021 13:05:31 GMT Message-Id: <202102011305.111D5VpX026662@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: 3728c4d31495 - stable/13 - diff: fix incorrectly displaying files as duplicates 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: 3728c4d3149553967532a97254737bdb2cd92417 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 13:05:32 -0000 The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3728c4d3149553967532a97254737bdb2cd92417 commit 3728c4d3149553967532a97254737bdb2cd92417 Author: Jamie Landeg-Jones AuthorDate: 2021-01-25 17:42:26 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-01 13:05:25 +0000 diff: fix incorrectly displaying files as duplicates When diff hits certain access errors, function diffreg() shows the error message, and then returns to the calling function, which calls print_status() with the return value. However, in these cases, the return value isn't changed from the initial default value of D_SAME. Normally, print_status() with a value of D_SAME does nothing, so this works out ok, however, if the "-s" flag is set, a message is displayed showing identicality: case D_SAME: if (sflag) printf("Files %s%s and %s%s are identical\n", path1, entry, path2, entry); break; This then produces such results as: % diff -s /COPYRIGHT /var/run/rpcbind.sock diff: /var/run/rpcbind.sock: Operation not supported Files /COPYRIGHT and /var/run/rpcbind.sock are identical % diff -s /COPYRIGHT /etc/master.passwd diff: /etc/master.passwd: Permission denied Files /COPYRIGHT and /etc/master.passwd are identical Create a D_ERROR status which is returned in such cases, and print_status() then deals with that status seperately from D_SAME PR: 252614 MFC after: 1 week (cherry picked from commit fefb3c46a80fdde6f307e73a2b5b5aed806df1ce) --- usr.bin/diff/diff.c | 2 ++ usr.bin/diff/diff.h | 1 + usr.bin/diff/diffreg.c | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index 0e46b96f9667..1bad6226f49d 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -511,6 +511,8 @@ print_status(int val, char *path1, char *path2, const char *entry) printf("File %s%s is not a regular file or directory and was skipped\n", path2, entry); break; + case D_ERROR: + break; } } diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index 30387610fc19..1974b5cc08d6 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -83,6 +83,7 @@ #define D_MISMATCH2 4 /* path1 was a file, path2 a dir */ #define D_SKIPPED1 5 /* path1 was a special file */ #define D_SKIPPED2 6 /* path2 was a special file */ +#define D_ERROR 7 /* A file access error occurred */ struct excludes { char *pattern; diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 7d2b20b43def..4e887ab27c7b 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -299,6 +299,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) if ((f1 = opentemp(file1)) == NULL || fstat(fileno(f1), &stb1) == -1) { warn("%s", file1); + rval = D_ERROR; status |= 2; goto closem; } @@ -309,6 +310,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) } if (f1 == NULL) { warn("%s", file1); + rval = D_ERROR; status |= 2; goto closem; } @@ -320,6 +322,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) if ((f2 = opentemp(file2)) == NULL || fstat(fileno(f2), &stb2) == -1) { warn("%s", file2); + rval = D_ERROR; status |= 2; goto closem; } @@ -330,6 +333,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) } if (f2 == NULL) { warn("%s", file2); + rval = D_ERROR; status |= 2; goto closem; } @@ -365,6 +369,7 @@ diffreg(char *file1, char *file2, int flags, int capsicum) break; default: /* error */ + rval = D_ERROR; status |= 2; goto closem; } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 13:05: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 99089528258; Mon, 1 Feb 2021 13:05: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 4DTp8X01xtz3M4M; Mon, 1 Feb 2021 13:05: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 B9BC51B764; Mon, 1 Feb 2021 13:05: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 111D5UGd026645; Mon, 1 Feb 2021 13:05:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111D5Uom026644; Mon, 1 Feb 2021 13:05:30 GMT (envelope-from git) Date: Mon, 1 Feb 2021 13:05:30 GMT Message-Id: <202102011305.111D5Uom026644@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: 0702bf9c495d - stable/13 - diff: add a test case for failed -s option 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: 0702bf9c495d517ef30432de1990f9a301598942 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 13:05:32 -0000 The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0702bf9c495d517ef30432de1990f9a301598942 commit 0702bf9c495d517ef30432de1990f9a301598942 Author: Baptiste Daroussin AuthorDate: 2021-01-25 17:40:12 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-01 13:05:24 +0000 diff: add a test case for failed -s option (cherry picked from commit 13860e71eb501f498a2263f44ea9244f6830b61c) --- usr.bin/diff/tests/diff_test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 7ee88d1fe607..6da2bbaea34d 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -15,6 +15,7 @@ atf_test_case Nflag atf_test_case tabsize atf_test_case conflicting_format atf_test_case label +atf_test_case report_identical simple_body() { @@ -226,6 +227,15 @@ label_body() -s exit:1 diff --label hello --label world `which diff` `which ls` } +report_identical_body() +{ + printf "\tA\n" > A + printf "\tB\n" > B + chmod -r B + atf_check -s exit:2 -e inline:"diff: B: Permission denied\n" \ + -o empty diff -s A B +} + atf_init_test_cases() { atf_add_test_case simple @@ -243,4 +253,5 @@ atf_init_test_cases() atf_add_test_case tabsize atf_add_test_case conflicting_format atf_add_test_case label + atf_add_test_case report_identical } From owner-dev-commits-src-all@freebsd.org Mon Feb 1 13:06: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 CAF345288B0; Mon, 1 Feb 2021 13:06:10 +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 4DTp9G4ZFzz3MmQ; Mon, 1 Feb 2021 13:06:10 +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 8EA40260487; Mon, 1 Feb 2021 14:06:08 +0100 (CET) Subject: Re: git: 1a714ff20419 - main - This pulls over all the changes that are in the netflix tree that fix the ratelimit code. There were several bugs in tcp_ratelimit itself and we needed further work to support the multiple tag format coming for the joint TLS and Ratelimit dances. To: Mateusz Guzik , Michael Tuexen , Konstantin Belousov Cc: Randall Stewart , Randall Stewart , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: <48fe9f24-e96b-1078-ada2-a8691ead6cf1@selasky.org> Date: Mon, 1 Feb 2021 14:05:54 +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: Content-Type: multipart/mixed; boundary="------------4CEF225002A76A7E4D6C5E4E" Content-Language: en-US X-Rspamd-Queue-Id: 4DTp9G4ZFzz3MmQ 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 Feb 2021 13:06:10 -0000 This is a multi-part message in MIME format. --------------4CEF225002A76A7E4D6C5E4E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, The attached patch should fix it. (Waiting for a quick review). But there are more issues: For i386 I now see: > ld: error: undefined symbol: xdr_export_sec_context_res >>>> referenced by gss_impl.c >>>> gss_impl.o:(kgss_transfer_context) > > ld: error: undefined symbol: gssd_import_name_1 >>>> referenced by gss_import_name.c >>>> gss_import_name.o:(gss_import_name) > > ld: error: undefined symbol: gssd_pname_to_uid_1 >>>> referenced by gss_pname_to_uid.c >>>> gss_pname_to_uid.o:(gss_pname_to_uid) >>>> referenced by gss_pname_to_uid.c >>>> gss_pname_to_uid.o:(gss_pname_to_unix_cred) > > ld: error: undefined symbol: xdr_pname_to_uid_res >>>> referenced by gss_pname_to_uid.c >>>> gss_pname_to_uid.o:(gss_pname_to_unix_cred) > > ld: error: undefined symbol: gssd_release_cred_1 >>>> referenced by gss_release_cred.c >>>> gss_release_cred.o:(gss_release_cred) > > ld: error: undefined symbol: gssd_release_name_1 >>>> referenced by gss_release_name.c >>>> gss_release_name.o:(gss_release_name) > Maybe xdr needs to be added to LINT now? Passing the ball onto Konstantin. --HPS --------------4CEF225002A76A7E4D6C5E4E Content-Type: text/x-patch; charset=UTF-8; name="a.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="a.diff" commit 38dc40d5b501932e60eb1fb52933a280d5035488 Author: Hans Petter Selasky Date: Mon Feb 1 13:23:21 2021 +0100 Fix LINT kernel builds after 1a714ff20419 . MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28357 Sponsored by: Mellanox Technologies // NVIDIA Networking diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index aeb1ed6906b..8f2cf3d8d06 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -372,17 +372,6 @@ rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) OID_AUTO, "rate", CTLFLAG_RD, &rs->rs_rlt[i].rate, 0, "Rate in bytes per second"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "using", CTLFLAG_RD, - &rs->rs_rlt[i].using, 0, - "Number of flows using"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "enobufs", CTLFLAG_RD, - &rs->rs_rlt[i].rs_num_enobufs, 0, - "Number of enobufs logged on this rate"); - } } #endif @@ -678,8 +667,6 @@ rt_setup_new_rs(struct ifnet *ifp, int *error) */ rs->rs_rlt[i].ptbl = rs; rs->rs_rlt[i].tag = NULL; - rs->rs_rlt[i].using = 0; - rs->rs_rlt[i].rs_num_enobufs = 0; /* * Calculate the time between. */ @@ -1076,28 +1063,16 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) static void rl_increment_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->using, 1); } static void rl_decrement_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_subtract_long(&decon_rte->using, 1); } void tcp_rl_log_enobuf(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->rs_num_enobufs, 1); } /* @@ -1214,9 +1189,11 @@ rt_setup_rate(struct inpcb *inp, struct ifnet *ifp, uint64_t bytes_per_sec, rte = NULL; } else { KASSERT((inp->inp_snd_tag != NULL) , - ("Setup rate has no snd_tag inp:%p rte:%p rate:%lu rs:%p", - inp, rte, rte->rate, rs)); + ("Setup rate has no snd_tag inp:%p rte:%p rate:%llu rs:%p", + inp, rte, (unsigned long long)rte->rate, rs)); +#ifdef INET counter_u64_add(rate_limit_new, 1); +#endif } } if (rte) { @@ -1462,8 +1439,11 @@ tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, if (error) *error = err; return (NULL); - } else + } else { +#ifdef INET counter_u64_add(rate_limit_chg, 1); +#endif + } if (error) *error = 0; tp->t_pacing_rate = nrte->rate; diff --git a/sys/netinet/tcp_ratelimit.h b/sys/netinet/tcp_ratelimit.h index d3f82fab3ee..b69f0e634b6 100644 --- a/sys/netinet/tcp_ratelimit.h +++ b/sys/netinet/tcp_ratelimit.h @@ -44,8 +44,6 @@ struct tcp_hwrate_limit_table { const struct tcp_rate_set *ptbl; /* Pointer to parent table */ struct m_snd_tag *tag; /* Send tag if needed (chelsio) */ uint64_t rate; /* Rate we get in Bytes per second (Bps) */ - uint64_t using; /* Temporary -- rrs remove */ - uint64_t rs_num_enobufs; uint32_t time_between; /* Time-Gap between packets at this rate */ uint32_t flags; }; --------------4CEF225002A76A7E4D6C5E4E-- From owner-dev-commits-src-all@freebsd.org Mon Feb 1 13:18: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 8093C528E44; Mon, 1 Feb 2021 13:18:50 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (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 4DTpRt2zP5z3NRJ; Mon, 1 Feb 2021 13:18:50 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x335.google.com with SMTP id c127so13133609wmf.5; Mon, 01 Feb 2021 05:18:50 -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=pJ7oBfLV7TuEINkxTvap+YXzKPJqYwo9ROTd55JO/To=; b=HPQSczK4lbvTz0/tAQt61iU78VOP7EeJCClFKo5h/fYBcY5QRWcsYraecGC9rwzFHX /GiMh1DMChxPh2UgJXpO7+VGJF1BoenCFPw5b55BxDcQwT1TtFD+2Npg655v6YEuJkZC SYnJQloOTPdRNgOhKHydyPk0iTe7wFCh152z8ACXfqDdoNWzTjKDtnUQHzAekRe3hsGP /vDx3f6sQiDNPQu10n7hZvemAswrGPCTL2vT4OhL7onlRPn2iX+vMz9WVgZXbecizSe+ Abe7Vxi9sIE5J5LvrdJVcj6ApMtwPnfN1HT9MgvnqAbu/PgyD5cX1gtZHWz2c5/Ayytd uArA== 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=pJ7oBfLV7TuEINkxTvap+YXzKPJqYwo9ROTd55JO/To=; b=a4FR8AyBdpf5+1q9mPQanV/gwwEuQ1zWSRgtdL/tqpFuNk6cB5ffrj6pK4EoiDnvDK ZSIEHXKanlCCTC35k6OWQEnPNY9FlJ8G7ZZrXl2C0Af9eIopTJuxwNY3QPipC7fu0wTD T1cdOY8Lx5ydsRrvuIJFGZmmlqkxnJak1zz0Gh2hLK1IKxpzZTqlT6obuRoH6uAwYYOo EXcMabg5fUFArHp9+Q0iQa81OBQGDvz4QVz5yqL1FTASTEzVq9OiuxmjeqY9AyAW2Gtx XhoMAWt9J6walZ4EGhrWLt3B6sypRA/Ii6A1fSi4iNObvXwzo+CgIrNwYejdoh/Mly2S wlOg== X-Gm-Message-State: AOAM532pli/bNoLwCfTwKc3FP0TbMVYsRjfMi1/17Ck57GY6aL0gc1dU 2jPIEMyk/2/wT5jXpNRS4vFcYKT0DecUlIRHq4A= X-Google-Smtp-Source: ABdhPJwYVloFm2c5P//4Cw2HLH0PWvY4gkuvLxxEiK5MtClnclUxVS0TITvrl3GYmgbUIqm1v0k/ZWHU7EbHFD/Bflw= X-Received: by 2002:a1c:98d4:: with SMTP id a203mr3454461wme.10.1612185528879; Mon, 01 Feb 2021 05:18:48 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Mon, 1 Feb 2021 05:18:47 -0800 (PST) In-Reply-To: <48fe9f24-e96b-1078-ada2-a8691ead6cf1@selasky.org> References: <202101281653.10SGrJWf002301@gitrepo.freebsd.org> <48fe9f24-e96b-1078-ada2-a8691ead6cf1@selasky.org> From: Mateusz Guzik Date: Mon, 1 Feb 2021 14:18:47 +0100 Message-ID: Subject: Re: git: 1a714ff20419 - main - This pulls over all the changes that are in the netflix tree that fix the ratelimit code. There were several bugs in tcp_ratelimit itself and we needed further work to support the multiple tag format coming for the joint TLS and Ratelimit dances. To: Hans Petter Selasky Cc: Michael Tuexen , Konstantin Belousov , Randall Stewart , Randall Stewart , 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: 4DTpRt2zP5z3NRJ 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 Feb 2021 13:18:50 -0000 I cannot test the patch right now, but tinderbox builds for me with the offending commit reverted. On 2/1/21, Hans Petter Selasky wrote: > Hi, > > The attached patch should fix it. (Waiting for a quick review). But > there are more issues: > > For i386 I now see: > >> ld: error: undefined symbol: xdr_export_sec_context_res >>>>> referenced by gss_impl.c >>>>> gss_impl.o:(kgss_transfer_context) >> >> ld: error: undefined symbol: gssd_import_name_1 >>>>> referenced by gss_import_name.c >>>>> gss_import_name.o:(gss_import_name) >> >> ld: error: undefined symbol: gssd_pname_to_uid_1 >>>>> referenced by gss_pname_to_uid.c >>>>> gss_pname_to_uid.o:(gss_pname_to_uid) >>>>> referenced by gss_pname_to_uid.c >>>>> gss_pname_to_uid.o:(gss_pname_to_unix_cred) >> >> ld: error: undefined symbol: xdr_pname_to_uid_res >>>>> referenced by gss_pname_to_uid.c >>>>> gss_pname_to_uid.o:(gss_pname_to_unix_cred) >> >> ld: error: undefined symbol: gssd_release_cred_1 >>>>> referenced by gss_release_cred.c >>>>> gss_release_cred.o:(gss_release_cred) >> >> ld: error: undefined symbol: gssd_release_name_1 >>>>> referenced by gss_release_name.c >>>>> gss_release_name.o:(gss_release_name) >> > > Maybe xdr needs to be added to LINT now? > > Passing the ball onto Konstantin. > > --HPS > -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Mon Feb 1 13:25: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 EC2D052928A; Mon, 1 Feb 2021 13:25:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTpbH6QQSz3P63; Mon, 1 Feb 2021 13:25: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 CF2371C0DA; Mon, 1 Feb 2021 13:25: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 111DPFvM052346; Mon, 1 Feb 2021 13:25:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111DPFt2052345; Mon, 1 Feb 2021 13:25:15 GMT (envelope-from git) Date: Mon, 1 Feb 2021 13:25:15 GMT Message-Id: <202102011325.111DPFt2052345@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: db46c0d0cb3d - main - Fix LINT kernel builds after 1a714ff20419 . 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: db46c0d0cb3da2813727e56df1f2db292065867a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 13:25:16 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=db46c0d0cb3da2813727e56df1f2db292065867a commit db46c0d0cb3da2813727e56df1f2db292065867a Author: Hans Petter Selasky AuthorDate: 2021-02-01 12:23:21 +0000 Commit: Hans Petter Selasky CommitDate: 2021-02-01 13:24:15 +0000 Fix LINT kernel builds after 1a714ff20419 . MFC after: 1 week Discussed with: rrs@ Differential Revision: https://reviews.freebsd.org/D28357 Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/netinet/tcp_ratelimit.c | 36 ++++++++---------------------------- sys/netinet/tcp_ratelimit.h | 2 -- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/sys/netinet/tcp_ratelimit.c b/sys/netinet/tcp_ratelimit.c index aeb1ed6906b5..8f2cf3d8d061 100644 --- a/sys/netinet/tcp_ratelimit.c +++ b/sys/netinet/tcp_ratelimit.c @@ -372,17 +372,6 @@ rl_add_syctl_entries(struct sysctl_oid *rl_sysctl_root, struct tcp_rate_set *rs) OID_AUTO, "rate", CTLFLAG_RD, &rs->rs_rlt[i].rate, 0, "Rate in bytes per second"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "using", CTLFLAG_RD, - &rs->rs_rlt[i].using, 0, - "Number of flows using"); - SYSCTL_ADD_U64(&rs->sysctl_ctx, - SYSCTL_CHILDREN(rl_rate_num), - OID_AUTO, "enobufs", CTLFLAG_RD, - &rs->rs_rlt[i].rs_num_enobufs, 0, - "Number of enobufs logged on this rate"); - } } #endif @@ -678,8 +667,6 @@ bail: */ rs->rs_rlt[i].ptbl = rs; rs->rs_rlt[i].tag = NULL; - rs->rs_rlt[i].using = 0; - rs->rs_rlt[i].rs_num_enobufs = 0; /* * Calculate the time between. */ @@ -1076,28 +1063,16 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb *inp, int *error) static void rl_increment_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->using, 1); } static void rl_decrement_using(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_subtract_long(&decon_rte->using, 1); } void tcp_rl_log_enobuf(const struct tcp_hwrate_limit_table *rte) { - struct tcp_hwrate_limit_table *decon_rte; - - decon_rte = __DECONST(struct tcp_hwrate_limit_table *, rte); - atomic_add_long(&decon_rte->rs_num_enobufs, 1); } /* @@ -1214,9 +1189,11 @@ use_real_interface: rte = NULL; } else { KASSERT((inp->inp_snd_tag != NULL) , - ("Setup rate has no snd_tag inp:%p rte:%p rate:%lu rs:%p", - inp, rte, rte->rate, rs)); + ("Setup rate has no snd_tag inp:%p rte:%p rate:%llu rs:%p", + inp, rte, (unsigned long long)rte->rate, rs)); +#ifdef INET counter_u64_add(rate_limit_new, 1); +#endif } } if (rte) { @@ -1462,8 +1439,11 @@ tcp_chg_pacing_rate(const struct tcp_hwrate_limit_table *crte, if (error) *error = err; return (NULL); - } else + } else { +#ifdef INET counter_u64_add(rate_limit_chg, 1); +#endif + } if (error) *error = 0; tp->t_pacing_rate = nrte->rate; diff --git a/sys/netinet/tcp_ratelimit.h b/sys/netinet/tcp_ratelimit.h index d3f82fab3ee1..b69f0e634b60 100644 --- a/sys/netinet/tcp_ratelimit.h +++ b/sys/netinet/tcp_ratelimit.h @@ -44,8 +44,6 @@ struct tcp_hwrate_limit_table { const struct tcp_rate_set *ptbl; /* Pointer to parent table */ struct m_snd_tag *tag; /* Send tag if needed (chelsio) */ uint64_t rate; /* Rate we get in Bytes per second (Bps) */ - uint64_t using; /* Temporary -- rrs remove */ - uint64_t rs_num_enobufs; uint32_t time_between; /* Time-Gap between packets at this rate */ uint32_t flags; }; From owner-dev-commits-src-all@freebsd.org Mon Feb 1 13:52: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 76D0E52A5E3; Mon, 1 Feb 2021 13:52:45 +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 4DTqC12Mvgz3R25; Mon, 1 Feb 2021 13:52:45 +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 31B5226019D; Mon, 1 Feb 2021 14:52:42 +0100 (CET) Subject: Re: git: e92ab3adf4f9 - stable/13 - atomic: make atomic_store_ptr type-aware To: Mateusz Guzik , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202102011240.111CehGE094845@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: <20583f6b-338b-21d6-5ae9-3e56488340d2@selasky.org> Date: Mon, 1 Feb 2021 14:52:29 +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: <202102011240.111CehGE094845@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DTqC12Mvgz3R25 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 Feb 2021 13:52:45 -0000 On 2/1/21 1:40 PM, Mateusz Guzik wrote: > #define atomic_store_ptr(p, v) \ > - (*(volatile uintptr_t *)(p) = (uintptr_t)(v)) > + (*(volatile __typeof(*p) *)(p) = (v)) Are you missing an assert here? CASSERT(sizeof(*p) == sizeof(void *)); The way I read it atomic_store_ptr() can now store any type? --HPS From owner-dev-commits-src-all@freebsd.org Mon Feb 1 13:53: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 7158F52A5F4; Mon, 1 Feb 2021 13:53:36 +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 4DTqD02DNyz3QlN; Mon, 1 Feb 2021 13:53:35 +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 D438C26019D; Mon, 1 Feb 2021 14:53:34 +0100 (CET) Subject: Re: git: fc301c224b27 - stable/13 - atomic: add stub atomic_load_consume_ptr To: Mateusz Guzik , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202102011240.111CeiX9094867@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: <84f152e1-b1ed-b331-ab45-261dd3996903@selasky.org> Date: Mon, 1 Feb 2021 14:53:22 +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: <202102011240.111CeiX9094867@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DTqD02DNyz3QlN 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 Feb 2021 13:53:36 -0000 On 2/1/21 1:40 PM, Mateusz Guzik wrote: > +/* > + * Currently all architectures provide acquire and release fences on their own, > + * but they don't provide consume. Kludge below allows relevant code to stop > + * openly resorting to the stronger acquire fence, to be sorted out. > + */ > +#define atomic_load_consume_ptr(p) \ > + ((__typeof(*p)) atomic_load_acq_ptr((uintptr_t *)p)) > + Are you missing: CTASSERT(sizeof(*p) == sizeof(void *)) ???? --HPS From owner-dev-commits-src-all@freebsd.org Mon Feb 1 13:55: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 EF2CD52AA84 for ; Mon, 1 Feb 2021 13:55:59 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 4DTqGl6DKhz3RDP for ; Mon, 1 Feb 2021 13:55:59 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f54.google.com with SMTP id i9so13276068wmq.1 for ; Mon, 01 Feb 2021 05:55:59 -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=R8/6DAYD7FaIAfNhFbxziww5jJQWPAUE5ZPZA3Kxl+Y=; b=pa9yY1DRBpZdE2xiys7X0/MMYSNBczpQLj9sS9Jmhab934CkHW1NJ+KCZ0gu+hfBp5 MmmDg0f2qm4WG5BGY0YdBbm2P8FnPt9HmxaEcQ7V9FHk2mEwqFnrFxs4oWc6p1jnerhT rVuRroLk0nf10vY5zz0O8LK9kQMxlK/FRyAnsPscXB2isZ53dbq3pulFL/KdQJ7SYjSU yEWYDMAkaimTU5tTqnh7IxqTq9CDMAgbCnhcMwdZoJCmyNwkkH6Ton9YZJmqTB4tB1qJ OTpqOoE3blf0yaHd4fXTcFBm7/8zBF05w9P2rLfELiav2lj9sa4CEUWPsYtsuoZg4kJV wvgg== X-Gm-Message-State: AOAM532Bg/Vjavt0Cua4gYMnHpe6vamsu1whj2rI7axmZPKkqdd6gXzq vAFMSgSGmV8NrqEuahnmhBBi/A== X-Google-Smtp-Source: ABdhPJxGQ6h1Qng+YU28tNu8Jc35IsYv7ZJEa+RUSbFFf8i14eeC+gshJcRIfbgW9yLhOpn9MxKMJA== X-Received: by 2002:a1c:7d0c:: with SMTP id y12mr15172647wmc.184.1612187758125; Mon, 01 Feb 2021 05:55:58 -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 b132sm21194988wmh.21.2021.02.01.05.55.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Feb 2021 05:55:57 -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: fc301c224b27 - stable/13 - atomic: add stub atomic_load_consume_ptr From: Jessica Clarke In-Reply-To: <84f152e1-b1ed-b331-ab45-261dd3996903@selasky.org> Date: Mon, 1 Feb 2021 13:55:55 +0000 Cc: Mateusz Guzik , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202102011240.111CeiX9094867@gitrepo.freebsd.org> <84f152e1-b1ed-b331-ab45-261dd3996903@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DTqGl6DKhz3RDP 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 Feb 2021 13:56:00 -0000 On 1 Feb 2021, at 13:53, Hans Petter Selasky wrote: > On 2/1/21 1:40 PM, Mateusz Guzik wrote: >> +/* >> + * Currently all architectures provide acquire and release fences on = their own, >> + * but they don't provide consume. Kludge below allows relevant code = to stop >> + * openly resorting to the stronger acquire fence, to be sorted out. >> + */ >> +#define atomic_load_consume_ptr(p) \ >> + ((__typeof(*p)) atomic_load_acq_ptr((uintptr_t *)p)) >> + >=20 > Are you missing: >=20 > CTASSERT(sizeof(*p) =3D=3D sizeof(void *)) ???? I also commented on the head commit that this is a waste of time and will likely never be anything other than an acquire, but never got a reply. Jess From owner-dev-commits-src-all@freebsd.org Mon Feb 1 13:58: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 514A452AA95; Mon, 1 Feb 2021 13:58: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 4DTqKB1qwMz3gyv; Mon, 1 Feb 2021 13:58: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 317DE1C4AD; Mon, 1 Feb 2021 13:58: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 111Dw6kQ091932; Mon, 1 Feb 2021 13:58:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Dw60m091931; Mon, 1 Feb 2021 13:58:06 GMT (envelope-from git) Date: Mon, 1 Feb 2021 13:58:06 GMT Message-Id: <202102011358.111Dw60m091931@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 305b3ca5f40c - stable/12 - netgraph/ng_tag: permit variable length data MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 305b3ca5f40cbfff1e29f7e2e10a636331a8575c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 13:58:06 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=305b3ca5f40cbfff1e29f7e2e10a636331a8575c commit 305b3ca5f40cbfff1e29f7e2e10a636331a8575c Author: Lutz Donnerhacke AuthorDate: 2021-01-02 13:58:17 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-01 13:55:42 +0000 netgraph/ng_tag: permit variable length data ng_tag(4) operate on arbitrary data of mbuf_tags(9). Those structures are padded to the next multiple of the alignment by the compiler. Hence a valid argument has be at most as long as the data received. PR: 241462 Reviewed by: kp Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D22140 (cherry picked from commit 7c7c231c14246a709270bf3f3a4593208e84d01a) --- sys/netgraph/ng_tag.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/netgraph/ng_tag.c b/sys/netgraph/ng_tag.c index 9222d3bd3b20..bc3b39ec7f39 100644 --- a/sys/netgraph/ng_tag.c +++ b/sys/netgraph/ng_tag.c @@ -363,9 +363,8 @@ ng_tag_rcvmsg(node_p node, item_p item, hook_p lasthook) hook_p hook; /* Sanity check. */ - if (msg->header.arglen < sizeof(*hp) - || msg->header.arglen != - NG_TAG_HOOKIN_SIZE(hp->tag_len)) + if (msg->header.arglen < sizeof(*hp) || + msg->header.arglen < NG_TAG_HOOKIN_SIZE(hp->tag_len)) ERROUT(EINVAL); /* Find hook. */ @@ -385,9 +384,8 @@ ng_tag_rcvmsg(node_p node, item_p item, hook_p lasthook) hook_p hook; /* Sanity check. */ - if (msg->header.arglen < sizeof(*hp) - || msg->header.arglen != - NG_TAG_HOOKOUT_SIZE(hp->tag_len)) + if (msg->header.arglen < sizeof(*hp) || + msg->header.arglen < NG_TAG_HOOKOUT_SIZE(hp->tag_len)) ERROUT(EINVAL); /* Find hook. */ From owner-dev-commits-src-all@freebsd.org Mon Feb 1 14:08: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 6F9EF52B607; Mon, 1 Feb 2021 14:08: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 4DTqXl2kG8z3hV5; Mon, 1 Feb 2021 14:08: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 507971C957; Mon, 1 Feb 2021 14:08: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 111E879M004924; Mon, 1 Feb 2021 14:08:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111E87k3004923; Mon, 1 Feb 2021 14:08:07 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:08:07 GMT Message-Id: <202102011408.111E87k3004923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 90d158c0cf25 - stable/11 - netgraph/ng_tag: permit variable length data MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 90d158c0cf2598fde2ea1c7cd58909cf5a21c471 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:08:07 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=90d158c0cf2598fde2ea1c7cd58909cf5a21c471 commit 90d158c0cf2598fde2ea1c7cd58909cf5a21c471 Author: Lutz Donnerhacke AuthorDate: 2021-01-02 13:58:17 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-01 14:07:31 +0000 netgraph/ng_tag: permit variable length data ng_tag(4) operate on arbitrary data of mbuf_tags(9). Those structures are padded to the next multiple of the alignment by the compiler. Hence a valid argument has be at most as long as the data received. PR: 241462 Reviewed by: kp Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D22140 (cherry picked from commit 7c7c231c14246a709270bf3f3a4593208e84d01a) --- sys/netgraph/ng_tag.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/netgraph/ng_tag.c b/sys/netgraph/ng_tag.c index 22d45a3174ad..1a9d44528a24 100644 --- a/sys/netgraph/ng_tag.c +++ b/sys/netgraph/ng_tag.c @@ -361,9 +361,8 @@ ng_tag_rcvmsg(node_p node, item_p item, hook_p lasthook) hook_p hook; /* Sanity check. */ - if (msg->header.arglen < sizeof(*hp) - || msg->header.arglen != - NG_TAG_HOOKIN_SIZE(hp->tag_len)) + if (msg->header.arglen < sizeof(*hp) || + msg->header.arglen < NG_TAG_HOOKIN_SIZE(hp->tag_len)) ERROUT(EINVAL); /* Find hook. */ @@ -383,9 +382,8 @@ ng_tag_rcvmsg(node_p node, item_p item, hook_p lasthook) hook_p hook; /* Sanity check. */ - if (msg->header.arglen < sizeof(*hp) - || msg->header.arglen != - NG_TAG_HOOKOUT_SIZE(hp->tag_len)) + if (msg->header.arglen < sizeof(*hp) || + msg->header.arglen < NG_TAG_HOOKOUT_SIZE(hp->tag_len)) ERROUT(EINVAL); /* Find hook. */ From owner-dev-commits-src-all@freebsd.org Mon Feb 1 14:27: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 6297652BB56; Mon, 1 Feb 2021 14:27: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 4DTqyz2MSWz3jvL; Mon, 1 Feb 2021 14:27: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 43FE81CB3B; Mon, 1 Feb 2021 14:27: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 111ERNqF031255; Mon, 1 Feb 2021 14:27:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111ERNL7031254; Mon, 1 Feb 2021 14:27:23 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:27:23 GMT Message-Id: <202102011427.111ERNL7031254@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: 88be0e11205e - main - bridge: fix STP roles and protos strings 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: 88be0e11205e4a2dc77e29f7b4a2e82b8d7c9a5c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:27:23 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=88be0e11205e4a2dc77e29f7b4a2e82b8d7c9a5c commit 88be0e11205e4a2dc77e29f7b4a2e82b8d7c9a5c Author: Jonah Caplan AuthorDate: 2021-01-30 13:54:09 +0000 Commit: Kristof Provost CommitDate: 2021-02-01 14:27:06 +0000 bridge: fix STP roles and protos strings Add the missing commas that got lost in e5539fb618cc7. PR: 252532 Reviewd by: kp@, donner@, freqlabs@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28425 --- sys/net/if_bridgevar.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h index fef252821be7..c12ee4598548 100644 --- a/sys/net/if_bridgevar.h +++ b/sys/net/if_bridgevar.h @@ -278,15 +278,15 @@ struct ifbpstpconf { "discarding" #define STP_PROTOS \ - "stp" \ - "-" \ + "stp", \ + "-", \ "rstp" #define STP_ROLES \ - "disabled" \ - "root" \ - "designated" \ - "alternate" \ + "disabled", \ + "root", \ + "designated", \ + "alternate", \ "backup" #define PV2ID(pv, epri, eaddr) do { \ From owner-dev-commits-src-all@freebsd.org Mon Feb 1 14:40: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 A0AFF52C311; Mon, 1 Feb 2021 14:40: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 4DTrGS42VFz3kdN; Mon, 1 Feb 2021 14:40: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 7A5FF1D00E; Mon, 1 Feb 2021 14:40: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 111Eem0n054361; Mon, 1 Feb 2021 14:40:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Eemlb054360; Mon, 1 Feb 2021 14:40:48 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:40:48 GMT Message-Id: <202102011440.111Eemlb054360@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: e5cc1c474841 - main - src.opts.mk: set MK_ZFS conditional on MK_OPENSSL 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: e5cc1c47484160969e0a7c13cdbc71081d7dd60e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:40:48 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e5cc1c47484160969e0a7c13cdbc71081d7dd60e commit e5cc1c47484160969e0a7c13cdbc71081d7dd60e Author: Mitchell Horne AuthorDate: 2021-01-30 19:04:08 +0000 Commit: Mitchell Horne CommitDate: 2021-02-01 14:31:17 +0000 src.opts.mk: set MK_ZFS conditional on MK_OPENSSL libzfs has a dependency on libcrypto. This causes a buildworld link failure when WITHOUT_OPENSSL/WITHOUT_CRYPT is set. This dependency was added implicitly by the switch to OpenZFS, and explicitly in 40d0fd287510 and cd568e2b1b67. PR: 252841 Reviewed by: kevans, freqlabs MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28431 --- share/mk/src.opts.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index d3f7e33f276c..6cfab4b50613 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -438,6 +438,7 @@ MK_LDNS:= no MK_PKGBOOTSTRAP:= no MK_SVN:= no MK_SVNLITE:= no +MK_ZFS:= no .endif .if ${MK_LDNS} == "no" From owner-dev-commits-src-all@freebsd.org Mon Feb 1 14:40: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 C12AC52BFF7; Mon, 1 Feb 2021 14:40: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 4DTrGT4wz3z3kkV; Mon, 1 Feb 2021 14:40: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 9C4771CB5F; Mon, 1 Feb 2021 14:40: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 111Eenct054392; Mon, 1 Feb 2021 14:40:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Eenh4054391; Mon, 1 Feb 2021 14:40:49 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:40:49 GMT Message-Id: <202102011440.111Eenh4054391@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: 243125c81af5 - main - src.conf(5): regenerate after MK_ZFS change 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: 243125c81af5a4947a25e5977056c68db0474c42 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:40:49 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=243125c81af5a4947a25e5977056c68db0474c42 commit 243125c81af5a4947a25e5977056c68db0474c42 Author: Mitchell Horne AuthorDate: 2021-02-01 14:34:11 +0000 Commit: Mitchell Horne CommitDate: 2021-02-01 14:39:55 +0000 src.conf(5): regenerate after MK_ZFS change With e5cc1c474841, this option is also disabled by WITHOUT_OPENSSL and WITHOUT_CRYPT. --- share/man/man5/src.conf.5 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 81656db323ed..3b57c443353d 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -400,6 +400,8 @@ When set, it enforces these options: .Va WITHOUT_SVNLITE .It .Va WITHOUT_UNBOUND +.It +.Va WITHOUT_ZFS .El .Pp When set, these options are also in effect: @@ -1290,6 +1292,8 @@ When set, it enforces these options: .Va WITHOUT_SVNLITE .It .Va WITHOUT_UNBOUND +.It +.Va WITHOUT_ZFS .El .Pp When set, these options are also in effect: From owner-dev-commits-src-all@freebsd.org Mon Feb 1 14:41: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 2283F52C248; Mon, 1 Feb 2021 14:41: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 4DTrHR0WyGz3l0g; Mon, 1 Feb 2021 14:41: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 04D311CC79; Mon, 1 Feb 2021 14:41: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 111EfcEd056174; Mon, 1 Feb 2021 14:41:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111Efc7G056173; Mon, 1 Feb 2021 14:41:38 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:41:38 GMT Message-Id: <202102011441.111Efc7G056173@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: 45ecda8ebf80 - main - stand/amd64: remove unused addr parameter from bi_load64 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: 45ecda8ebf80bb341aa3b4955810518ae6fab158 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:41:39 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=45ecda8ebf80bb341aa3b4955810518ae6fab158 commit 45ecda8ebf80bb341aa3b4955810518ae6fab158 Author: Roger Pau Monné AuthorDate: 2021-01-29 11:29:37 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-01 14:41:26 +0000 stand/amd64: remove unused addr parameter from bi_load64 All callers of bi_load64 pass 0 as the addr parameter, so just remove it and always calculate the last load address from the module chain. No functional change. Sponsored by: Citrix Systems R&D Reviewed by: tsoome, imp Differential revision: https://reviews.freebsd.org/D28412 --- stand/i386/libi386/bootinfo64.c | 14 +++++++------- stand/i386/libi386/elf64_freebsd.c | 2 +- stand/i386/libi386/libi386.h | 2 +- stand/i386/libi386/multiboot.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c index 9f038f2a4f2b..1ffa4188d926 100644 --- a/stand/i386/libi386/bootinfo64.c +++ b/stand/i386/libi386/bootinfo64.c @@ -182,7 +182,7 @@ bi_checkcpu(void) * - Module metadata are formatted and placed in kernel space. */ int -bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, +bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, int add_smap) { struct preloaded_file *xp, *kfp; @@ -191,6 +191,7 @@ bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, uint64_t kernend; uint64_t envp; uint64_t module; + uint64_t addr; vm_offset_t size; char *rootdevname; int howto; @@ -217,12 +218,11 @@ bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, /* Try reading the /etc/fstab file to select the root device */ getrootmount(i386_fmtdev((void *)rootdev)); - if (addr == 0) { - /* find the last module in the chain */ - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - if (addr < (xp->f_addr + xp->f_size)) - addr = xp->f_addr + xp->f_size; - } + addr = 0; + /* find the last module in the chain */ + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + if (addr < (xp->f_addr + xp->f_size)) + addr = xp->f_addr + xp->f_size; } /* pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); diff --git a/stand/i386/libi386/elf64_freebsd.c b/stand/i386/libi386/elf64_freebsd.c index 6bf884045eea..1108a9e4d713 100644 --- a/stand/i386/libi386/elf64_freebsd.c +++ b/stand/i386/libi386/elf64_freebsd.c @@ -80,7 +80,7 @@ elf64_exec(struct preloaded_file *fp) return(EFTYPE); ehdr = (Elf_Ehdr *)&(md->md_data); - err = bi_load64(fp->f_args, 0, &modulep, &kernend, 1); + err = bi_load64(fp->f_args, &modulep, &kernend, 1); if (err != 0) return(err); diff --git a/stand/i386/libi386/libi386.h b/stand/i386/libi386/libi386.h index dbd6565f8d1c..a52a1190e7ec 100644 --- a/stand/i386/libi386/libi386.h +++ b/stand/i386/libi386/libi386.h @@ -151,7 +151,7 @@ void bi_setboothowto(int howto); vm_offset_t bi_copyenv(vm_offset_t addr); int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernend); -int bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, +int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend, int add_smap); void pxe_enable(void *pxeinfo); diff --git a/stand/i386/libi386/multiboot.c b/stand/i386/libi386/multiboot.c index 71fd63bb4c88..2d0a4a9b2274 100644 --- a/stand/i386/libi386/multiboot.c +++ b/stand/i386/libi386/multiboot.c @@ -274,7 +274,7 @@ multiboot_exec(struct preloaded_file *fp) bzero(mb_mod, sizeof(struct multiboot_mod_list) * NUM_MODULES); - error = bi_load64(fp->f_args, 0, &modulep, &kernend, 0); + error = bi_load64(fp->f_args, &modulep, &kernend, 0); if (error != 0) { printf("bi_load64 failed: %d\n", error); goto error; From owner-dev-commits-src-all@freebsd.org Mon Feb 1 14:54: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 466D452CAD4; Mon, 1 Feb 2021 14:54:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTrZd1Yzpz3mgf; Mon, 1 Feb 2021 14:54: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 21E031D247; Mon, 1 Feb 2021 14:54: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 111EsnJA070298; Mon, 1 Feb 2021 14:54:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111EsnaN070297; Mon, 1 Feb 2021 14:54:49 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:54:49 GMT Message-Id: <202102011454.111EsnaN070297@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: 14640ac7897b - stable/13 - bsdinstall: create /efi/boot directory in ESP 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: 14640ac7897b79d49e97e5c571f05ae563f4a8e2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:54:49 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=14640ac7897b79d49e97e5c571f05ae563f4a8e2 commit 14640ac7897b79d49e97e5c571f05ae563f4a8e2 Author: Mitchell Horne AuthorDate: 2021-01-15 16:14:27 +0000 Commit: Mitchell Horne CommitDate: 2021-02-01 14:53:21 +0000 bsdinstall: create /efi/boot directory in ESP If the installer is creating a new ESP, then this directory will not exist and the subsequent cp will fail silently. This is usually of no consequence if /efi/freebsd/loader.efi is set up correctly. Reviewed by: imp (cherry picked from commit 676b7d077c2c5f548334cea7fccfbfb5d097c9df) --- usr.sbin/bsdinstall/scripts/bootconfig | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index 93a3bc0a53c2..1593545a1c2e 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -131,7 +131,10 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then # i386) ARCHBOOTNAME=ia32 ;; # no support for this in i386 kernels, rare machines *) die "Unsupported arch $(uname -m) for UEFI install" esac - BOOTNAME="/EFI/BOOT/BOOT${ARCHBOOTNAME}.EFI" + BOOTDIR="/efi/boot" + BOOTNAME="${BOOTDIR}/boot${ARCHBOOTNAME}.efi" + FREEBSD_BOOTDIR="/efi/freebsd" + FREEBSD_BOOTNAME="${FREEBSD_BOOTDIR}/loader.efi" for esp in $ESPS; do f_dprintf "Formatting /dev/${esp} as FAT32" @@ -148,8 +151,8 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then fi f_dprintf "Installing loader.efi onto ESP" - mkdir -p "$mntpt/EFI/freebsd" - cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/EFI/freebsd/loader.efi" + mkdir -p "${mntpt}/${FREEBSD_BOOTDIR}" "${mntpt}/${BOOTDIR}" + cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${FREEBSD_BOOTNAME}" # # The following shouldn't be necessary. UEFI defines a way to @@ -173,7 +176,7 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then fi f_dprintf "Creating UEFI boot entry" - efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null + efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null f_dprintf "Unmounting ESP" umount "${mntpt}" From owner-dev-commits-src-all@freebsd.org Mon Feb 1 14: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 532B352C7FB; Mon, 1 Feb 2021 14: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 4DTrZf1vmVz3mKD; Mon, 1 Feb 2021 14: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 343851D248; Mon, 1 Feb 2021 14: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 111EsojU070321; Mon, 1 Feb 2021 14: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 111EsoqQ070320; Mon, 1 Feb 2021 14:54:50 GMT (envelope-from git) Date: Mon, 1 Feb 2021 14:54:50 GMT Message-Id: <202102011454.111EsoqQ070320@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: c415d0df47fc - stable/13 - bsdinstall: riscv-specific tweaks 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: c415d0df47fc4b144c029263fac47ad4df81a803 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:54:50 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=c415d0df47fc4b144c029263fac47ad4df81a803 commit c415d0df47fc4b144c029263fac47ad4df81a803 Author: Mitchell Horne AuthorDate: 2021-01-15 16:34:54 +0000 Commit: Mitchell Horne CommitDate: 2021-02-01 14:54:09 +0000 bsdinstall: riscv-specific tweaks Make the installer more useful, by allowing it to create a bootable installation. Also, enable the menu option for ZFS-on-root. Like arm64, RISC-V boots by UEFI only, so arm64's partedit implementation is renamed and shared among the two platforms. Reviewed by: gjb (cherry picked from commit 7b08a307e88bb1abe17d13d11288392a8e4739ce) --- usr.sbin/bsdinstall/partedit/Makefile | 2 ++ usr.sbin/bsdinstall/partedit/{partedit_arm64.c => partedit_efi.c} | 7 ++++++- usr.sbin/bsdinstall/scripts/auto | 2 +- usr.sbin/bsdinstall/scripts/bootconfig | 3 ++- usr.sbin/bsdinstall/scripts/zfsboot | 4 ++-- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bsdinstall/partedit/Makefile b/usr.sbin/bsdinstall/partedit/Makefile index 7d8f0659da25..a250302a1962 100644 --- a/usr.sbin/bsdinstall/partedit/Makefile +++ b/usr.sbin/bsdinstall/partedit/Makefile @@ -10,6 +10,8 @@ LIBADD+= geom ncursesw util dialog m PARTEDIT_ARCH= ${MACHINE} .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" PARTEDIT_ARCH= x86 +.elif ${MACHINE} == "arm64" || ${MACHINE} == "riscv" +PARTEDIT_ARCH= efi .endif .if !exists(partedit_${PARTEDIT_ARCH}.c) PARTEDIT_ARCH= generic diff --git a/usr.sbin/bsdinstall/partedit/partedit_arm64.c b/usr.sbin/bsdinstall/partedit/partedit_efi.c similarity index 92% rename from usr.sbin/bsdinstall/partedit/partedit_arm64.c rename to usr.sbin/bsdinstall/partedit/partedit_efi.c index 934cd30c72f9..85b3b15d1853 100644 --- a/usr.sbin/bsdinstall/partedit/partedit_arm64.c +++ b/usr.sbin/bsdinstall/partedit/partedit_efi.c @@ -34,6 +34,11 @@ #include "partedit.h" +/* + * partedit implementation for platforms on which the installer only offers + * UEFI-based boot. Currently, this includes arm64 and RISC-V. + */ + /* EFI partition size in bytes */ #define EFI_BOOTPART_SIZE (260 * 1024 * 1024) @@ -94,7 +99,7 @@ const char * partcode_path(const char *part_type, const char *fs_type) { - /* No boot partition data for ARM64 */ + /* No boot partition data. */ return (NULL); } diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index a58a63f2f70c..58e74acb2d92 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -301,7 +301,7 @@ PMODES=" CURARCH=$( uname -m ) case $CURARCH in - amd64|arm64|i386) # Booting ZFS Supported + amd64|arm64|i386|riscv) # Booting ZFS Supported PMODES=" '$msg_auto_zfs' '$msg_auto_zfs_desc' '$msg_auto_zfs_help' $PMODES diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index 1593545a1c2e..f07fb3065c23 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -51,7 +51,7 @@ if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "i386" ]; then X86_BOOTMETHOD=$(sysctl -n machdep.bootmethod) fi -if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then +if [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "riscv" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then UFSBOOT_ESPS=$(cat $TMPDIR/bsdinstall-esps 2>/dev/null) ZFSBOOT_DISKS=$(cat $TMPDIR/bsdinstall-zfsboot 2>/dev/null) num_esps=0 @@ -127,6 +127,7 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then case $(uname -m) in arm64) ARCHBOOTNAME=aa64 ;; amd64) ARCHBOOTNAME=x64 ;; + riscv) ARCHBOOTNAME=riscv64 ;; # arm) ARCHBOOTNAME=arm ;; # No other support for arm install # i386) ARCHBOOTNAME=ia32 ;; # no support for this in i386 kernels, rare machines *) die "Unsupported arch $(uname -m) for UEFI install" diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index eef482b806c5..33cec0ef9ae9 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -1554,8 +1554,8 @@ f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # Determine default boot type # case $(uname -m) in -arm64) - # We support only UEFI boot for arm64 +arm64|riscv) + # We support only UEFI boot for arm64 and riscv. : ${ZFSBOOT_BOOT_TYPE:=UEFI} : ${ZFSBOOT_PARTITION_SCHEME:=GPT} ;; From owner-dev-commits-src-all@freebsd.org Mon Feb 1 16: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 C1F9D52ED35; Mon, 1 Feb 2021 16: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 4DTtQc5B59z3twn; Mon, 1 Feb 2021 16: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 A4C711E14A; Mon, 1 Feb 2021 16: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 111GI0io074674; Mon, 1 Feb 2021 16: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 111GI0bo074673; Mon, 1 Feb 2021 16:18:00 GMT (envelope-from git) Date: Mon, 1 Feb 2021 16:18:00 GMT Message-Id: <202102011618.111GI0bo074673@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: 38bfc6dee33b - main - iflib: Free resources in a consistent order during detach 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: 38bfc6dee33bedb290e1ea2540f97a86fe3caee0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:18:00 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=38bfc6dee33bedb290e1ea2540f97a86fe3caee0 commit 38bfc6dee33bedb290e1ea2540f97a86fe3caee0 Author: Sai Rajesh Tallamraju AuthorDate: 2021-02-01 16:13:00 +0000 Commit: Mark Johnston CommitDate: 2021-02-01 16:15:54 +0000 iflib: Free resources in a consistent order during detach Memory and PCI resources are freed with no particular order. This could cause use-after-frees when detaching following a failed attach. For instance, iflib_tx_structures_free() frees ctx->ifc_txqs[] but iflib_tqg_detach() attempts to access this array. Similarly, adapter queues gets freed by IFDI_QUEUES_FREE() but IFDI_DETACH() attempts to access adapter queues to free PCI resources. MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D27634 --- sys/dev/e1000/if_em.c | 19 ++++++------------- sys/dev/ixl/if_ixl.c | 2 +- sys/net/iflib.c | 22 +++++++++++++--------- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index fb15a3e1f610..b24280dae412 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1102,10 +1102,11 @@ em_if_attach_post(if_ctx_t ctx) struct adapter *adapter = iflib_get_softc(ctx); struct e1000_hw *hw = &adapter->hw; int error = 0; - + /* Setup OS specific network interface */ error = em_setup_interface(ctx); if (error != 0) { + device_printf(adapter->dev, "Interface setup failed: %d\n", error); goto err_late; } @@ -1123,14 +1124,10 @@ em_if_attach_post(if_ctx_t ctx) INIT_DEBUGOUT("em_if_attach_post: end"); - return (error); + return (0); err_late: - em_release_hw_control(adapter); - em_free_pci_resources(ctx); - em_if_queues_free(ctx); - free(adapter->mta, M_DEVBUF); - + /* upon attach_post() error, iflib calls _if_detach() to free resources. */ return (error); } @@ -1155,6 +1152,8 @@ em_if_detach(if_ctx_t ctx) em_release_manageability(adapter); em_release_hw_control(adapter); em_free_pci_resources(ctx); + free(adapter->mta, M_DEVBUF); + adapter->mta = NULL; return (0); } @@ -2981,12 +2980,6 @@ em_if_queues_free(if_ctx_t ctx) free(adapter->rx_queues, M_DEVBUF); adapter->rx_queues = NULL; } - - em_release_hw_control(adapter); - - if (adapter->mta != NULL) { - free(adapter->mta, M_DEVBUF); - } } /********************************************************************* diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 50eb448a1154..097d4b480891 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -1253,7 +1253,7 @@ ixl_if_queues_free(if_ctx_t ctx) struct ixl_pf *pf = iflib_get_softc(ctx); struct ixl_vsi *vsi = &pf->vsi; - if (!vsi->enable_head_writeback) { + if (vsi->tx_queues != NULL && !vsi->enable_head_writeback) { struct ixl_tx_queue *que; int i = 0; diff --git a/sys/net/iflib.c b/sys/net/iflib.c index cfc6972bf987..cce56d0e7335 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -4900,7 +4900,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct device_printf(dev, "Cannot use iflib with only 1 MSI-X interrupt!\n"); err = ENODEV; - goto fail_intr_free; + goto fail_queues; } ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet); @@ -4936,13 +4936,14 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct fail_detach: ether_ifdetach(ctx->ifc_ifp); -fail_intr_free: - iflib_free_intr_mem(ctx); fail_queues: + iflib_tqg_detach(ctx); iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); - iflib_tqg_detach(ctx); IFDI_DETACH(ctx); + IFDI_QUEUES_FREE(ctx); +fail_intr_free: + iflib_free_intr_mem(ctx); fail_unlock: CTX_UNLOCK(ctx); iflib_deregister(ctx); @@ -5139,11 +5140,12 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sctx, if_ctx_t *ctxp, fail_detach: ether_ifdetach(ctx->ifc_ifp); fail_queues: + iflib_tqg_detach(ctx); iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); - iflib_tqg_detach(ctx); fail_iflib_detach: IFDI_DETACH(ctx); + IFDI_QUEUES_FREE(ctx); fail_unlock: CTX_UNLOCK(ctx); iflib_deregister(ctx); @@ -5173,6 +5175,8 @@ iflib_pseudo_deregister(if_ctx_t ctx) iflib_tqg_detach(ctx); iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); + IFDI_DETACH(ctx); + IFDI_QUEUES_FREE(ctx); iflib_deregister(ctx); @@ -5233,8 +5237,12 @@ iflib_device_deregister(if_ctx_t ctx) led_destroy(ctx->ifc_led_dev); iflib_tqg_detach(ctx); + iflib_tx_structures_free(ctx); + iflib_rx_structures_free(ctx); + CTX_LOCK(ctx); IFDI_DETACH(ctx); + IFDI_QUEUES_FREE(ctx); CTX_UNLOCK(ctx); /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ @@ -5242,9 +5250,6 @@ iflib_device_deregister(if_ctx_t ctx) bus_generic_detach(dev); - iflib_tx_structures_free(ctx); - iflib_rx_structures_free(ctx); - iflib_deregister(ctx); device_set_softc(ctx->ifc_dev, NULL); @@ -5828,7 +5833,6 @@ iflib_tx_structures_free(if_ctx_t ctx) } free(ctx->ifc_txqs, M_IFLIB); ctx->ifc_txqs = NULL; - IFDI_QUEUES_FREE(ctx); } /********************************************************************* From owner-dev-commits-src-all@freebsd.org Mon Feb 1 17:26: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 EA4A95307A1; Mon, 1 Feb 2021 17:26:11 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 4DTvxH64gVz4Sgx; Mon, 1 Feb 2021 17:26:11 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x435.google.com with SMTP id g10so17496666wrx.1; Mon, 01 Feb 2021 09:26:11 -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:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=dX8xAAO4C4f7Cya1TWNvn2ZKMoTfiFZLn8fxDBfrGUA=; b=oKsw26hTroXVGbeHBFKU0VDajjuucAFT/K26rl1xTy2SawVjhIqJBcKdLCpYIl1Z7X OZAJh4VvMGiOrY4aEJip/pb8ZUBi30i+IThEOgdsAejXDmLSaMtjPNkfWEcdzzqlCNeH aOt9SmjbrK3nbkL4R5Y7luXxVEIi/GKjhCHBysPj7kVFV8GnIUqzVJyn8MO25EjQWelo VlF8i6KTHCxnwC+MoitmgGCTKPrN8SZzlie7vBjzHyKAyykhxXd8X4F1As7xzuHV4rgL vKaqpTdWYmqyPvy7khcwg9pROuSk8uH59lSW3sg1rxDZ75UpQ6dk5K1dCWmm9bsHyJ9v UpFA== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=dX8xAAO4C4f7Cya1TWNvn2ZKMoTfiFZLn8fxDBfrGUA=; b=NkX9dG/0nfmlCQ6/pamdXs0nKjlpjLg11m/2hMWB57ZFS2dIzm/aVNGKZ+t1qzvnab WWpWXDNwofwSA3ob1nTOTDD+1GToLteGIQvxoubzbcC9eUpzNsbmLHNU58tYDMUST2+h ainnI+uEIctDGHDSBzMTMueDC+kbwC8W437bOk8y+4scv319jjWBiJXTMLYbfVuSSO4w 1CLRlJLCGUBgkddDfn4UXRl7IaI0dCQ3VjyVpDK8vjS9nXAFgTsK1evQzZMvE9rV27OW xvP9I/pgRNuy4M50YcAOyPlG/xjaBLVx98N1haRiZYr30XSeSSD8jdOXNS/phkZ/5A42 lqJA== X-Gm-Message-State: AOAM533eeyG6Y4EL+xV3RNxKXzaMysVf9Ts7ELs82ukpc4Jw3j4C2CRC nJLL4pM1k149Tt/AhH3FujlbnOJrPdM= X-Google-Smtp-Source: ABdhPJx3UCkT4pMKjnliwJbx8BD0R1w+rOq8SXQlfR/APk/xJmy8LgoEX9Di1lQ088GSONqdOVkpGw== X-Received: by 2002:adf:80c8:: with SMTP id 66mr4546429wrl.344.1612200370152; Mon, 01 Feb 2021 09:26:10 -0800 (PST) Received: from brick (cpc159423-cmbg20-2-0-cust338.5-4.cable.virginm.net. [86.7.147.83]) by smtp.gmail.com with ESMTPSA id o14sm26427984wri.48.2021.02.01.09.26.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 09:26:08 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 1 Feb 2021 17:26:07 +0000 From: Edward Tomasz Napierala To: Shawn Webb Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5299d64b2b9f - main - libc: fix buffer overrun in getrpcport(3) Message-ID: Mail-Followup-To: Shawn Webb , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202101312143.10VLhfV5025431@gitrepo.freebsd.org> <20210131215556.eautrr6esynyic6f@mutt-hbsd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210131215556.eautrr6esynyic6f@mutt-hbsd> X-Rspamd-Queue-Id: 4DTvxH64gVz4Sgx 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 Feb 2021 17:26:12 -0000 On 0131T1655, Shawn Webb wrote: > On Sun, Jan 31, 2021 at 09:43:41PM +0000, Edward Tomasz Napierala wrote: > > The branch main has been updated by trasz: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=5299d64b2b9f7a25e423ef1785d9402a0ef198d3 > > > > commit 5299d64b2b9f7a25e423ef1785d9402a0ef198d3 > > Author: Edward Tomasz Napierala > > AuthorDate: 2021-01-31 21:41:55 +0000 > > Commit: Edward Tomasz Napierala > > CommitDate: 2021-01-31 21:42:02 +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 > > --- > > 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, > > Does a fix like this need to get a security advisory report? Also, any > plans to MFC? Sorry, I should have used a better commit message... I don't think this is exploitable, or even triggerable - from my understanding, the gethostbyname(3) function cannot return non-AF_INET address, unless some internal resolver option has been set, which none of the programs using getrpcport(3) seems to do. From owner-dev-commits-src-all@freebsd.org Mon Feb 1 17:27: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 8C5A6530466; Mon, 1 Feb 2021 17:27:55 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 4DTvzG6HKmz4SrR; Mon, 1 Feb 2021 17:27:54 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x42a.google.com with SMTP id m13so17499614wro.12; Mon, 01 Feb 2021 09:27:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=a/hKBx7VpQ8WKvvQJF6IUVudGnZL0JRH+0qxeH8zRgU=; b=oPbX73pPNmPqcqZJlvyxpZF9ucD3m2x6npGBCDewqw81Tfmf8AxNOdIxqZn1RRh4BO 08tg8iO16KWRYjvNX1XoqKNYfJjZ9aGoEWPc47hbPKFyS1ScZ+2YQ+9E+z7FOaQzv1/E 5QmMAsO1FaoVl86FNY1n28pniKrn7aQEIqeusDOE0g7FncNKHUNE2+wjlTRMDC/uPQSc PltZPxahHGnjOPCuc3cSw8QqRM07c+GyaK7Sw3veaBUWaJLWZZC+3L+ZmA+QbwMENNBl gP3OiFQCtDYpQhT3ECYS9GssZ7j2/invWp9Nv9hfJrg321sQbxGOGh6FG8Dc+rCx2jVf ISFA== 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:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=a/hKBx7VpQ8WKvvQJF6IUVudGnZL0JRH+0qxeH8zRgU=; b=AMzm3PaLt+MsvDX+F8Cd28rb2oIwYRqdC7cKZ10tb6/ZucYkeZ+5hF/9CNQ7D2wjT6 8DDF1ry/PrEEJPC4tj6cA6+vCf+IomJ8Ro2sa1WBcz2bFqlKE7FeiwWFgNZYEjgjeD4Q a275U+JjDNXhIxME49VAEltce3md8mUyXRW35S5mRI8zbLRNTas458Sfp9XutHag8H0v p1UhbOwkrHKKQ3l/y8Vp7w5k2QvWtT0s6eGHBp6Y4mKTrJC1IoNLwwIi+q1+OFCkCMv5 K7mudpBnDfNqh81e4VikBcr4PoAp5rE4ugsEZJ6lpitrSG1PKeLXy9thUi5kAmXgAjTa qEng== X-Gm-Message-State: AOAM532vHWdJ/yeTFdScME3V2vtP7ygQ4fbVFJsl4jUYdMVSVCxvGcHf bCcyQjOauh0DF5ntFmTTEqQFXH5Fbcs= X-Google-Smtp-Source: ABdhPJwku5CqSiO8XekEkN6Epcxc3JAa0MlwaUVldYgLNJpdlgm3hBh8Tr9Y0293IK0Tw+cehninxw== X-Received: by 2002:adf:e9cf:: with SMTP id l15mr19101717wrn.317.1612200473370; Mon, 01 Feb 2021 09:27:53 -0800 (PST) Received: from brick (cpc159423-cmbg20-2-0-cust338.5-4.cable.virginm.net. [86.7.147.83]) by smtp.gmail.com with ESMTPSA id h14sm8966540wmq.39.2021.02.01.09.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 09:27:52 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 1 Feb 2021 17:27:50 +0000 From: Edward Tomasz Napierala To: Shawn Webb , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5299d64b2b9f - main - libc: fix buffer overrun in getrpcport(3) Message-ID: Mail-Followup-To: Shawn Webb , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202101312143.10VLhfV5025431@gitrepo.freebsd.org> <20210131215556.eautrr6esynyic6f@mutt-hbsd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4DTvzG6HKmz4SrR X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=oPbX73pP; dmarc=none; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 2a00:1450:4864:20::42a as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.998]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[86.7.147.83:received]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::42a:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[trasz@freebsd.org,etnapierala@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::42a:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::42a:from]; MID_RHS_NOT_FQDN(0.50)[]; 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 Feb 2021 17:27:55 -0000 On 0201T1726, Edward Tomasz Napierala wrote: > On 0131T1655, Shawn Webb wrote: > > On Sun, Jan 31, 2021 at 09:43:41PM +0000, Edward Tomasz Napierala wrote: [..] > > Does a fix like this need to get a security advisory report? Also, any > > plans to MFC? > > Sorry, I should have used a better commit message... I don't think > this is exploitable, or even triggerable - from my understanding, the > gethostbyname(3) function cannot return non-AF_INET address, unless > some internal resolver option has been set, which none of the programs > using getrpcport(3) seems to do. Oh, and yes, MFC is planned; I'm not sure what's the current way to mark commits to get an MFC reminder. From owner-dev-commits-src-all@freebsd.org Mon Feb 1 19:47: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 51F60534F91; Mon, 1 Feb 2021 19:47:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTz4Y515bz4q4D; Mon, 1 Feb 2021 19:47:40 +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 C76E6215B1; Mon, 1 Feb 2021 19:47:39 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 1323233102; Mon, 1 Feb 2021 20:47:38 +0100 (CET) From: "Kristof Provost" To: "Edward Tomasz Napierala" Cc: "Shawn Webb" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5299d64b2b9f - main - libc: fix buffer overrun in getrpcport(3) Date: Mon, 01 Feb 2021 20:47:37 +0100 X-Mailer: MailMate (1.13.2r5673) Message-ID: <300465C7-7F6C-446E-A35A-63DB0B6D9EA5@FreeBSD.org> In-Reply-To: References: <202101312143.10VLhfV5025431@gitrepo.freebsd.org> <20210131215556.eautrr6esynyic6f@mutt-hbsd> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:47:43 -0000 On 1 Feb 2021, at 18:27, Edward Tomasz Napierala wrote: > I'm not sure what's the current way to mark commits to get an MFC > reminder. > The old ways work just fine. Just set ‘MFC after: xxx’ and theMFC Notification Service will do its thing as usual. Best regards, Kristof From owner-dev-commits-src-all@freebsd.org Mon Feb 1 20:26: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 26BAE535B52; Mon, 1 Feb 2021 20:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTzwq6HfCz4tMr; Mon, 1 Feb 2021 20:26: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 CA26B2185A; Mon, 1 Feb 2021 20:26: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 111KQ3Yq001097; Mon, 1 Feb 2021 20:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111KQ3Ce001096; Mon, 1 Feb 2021 20:26:03 GMT (envelope-from git) Date: Mon, 1 Feb 2021 20:26:03 GMT Message-Id: <202102012026.111KQ3Ce001096@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: 682c31db4ecf - main - ipfw(8) crashes when ext6hdr option is omitted 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: 682c31db4ecfb8fc6cac0e8ad4945c03379ea3d1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 20:26:04 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=682c31db4ecfb8fc6cac0e8ad4945c03379ea3d1 commit 682c31db4ecfb8fc6cac0e8ad4945c03379ea3d1 Author: Evgeniy Khramtsov <2khramtsov@gmail.com> AuthorDate: 2021-02-01 19:03:57 +0000 Commit: Kristof Provost CommitDate: 2021-02-01 20:25:11 +0000 ipfw(8) crashes when ext6hdr option is omitted Verify that the option is passed, error out if it's not. The problem can be trivially triggered with `ipfw add allow ext6hdr`. PR: 253169 Reviewed by: kp@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28447 --- sbin/ipfw/ipfw2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 67303d8bb1e7..19f7f331091d 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -4961,6 +4961,7 @@ read_options: break; case TOK_EXT6HDR: + NEED1("missing extension header"); fill_ext6hdr( cmd, *av ); av++; break; From owner-dev-commits-src-all@freebsd.org Mon Feb 1 21:14: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 78610537286; Mon, 1 Feb 2021 21:14: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 4DV10j2yz7z3Dkl; Mon, 1 Feb 2021 21:14: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 58A6F22600; Mon, 1 Feb 2021 21:14: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 111LET2F065660; Mon, 1 Feb 2021 21:14:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111LETDG065659; Mon, 1 Feb 2021 21:14:29 GMT (envelope-from git) Date: Mon, 1 Feb 2021 21:14:29 GMT Message-Id: <202102012114.111LETDG065659@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: bcaa6aa15383 - main - config: Fix typo in comment. 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: bcaa6aa15383cacf5f20179be919bb8dd45cc5f4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:14:29 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bcaa6aa15383cacf5f20179be919bb8dd45cc5f4 commit bcaa6aa15383cacf5f20179be919bb8dd45cc5f4 Author: John Baldwin AuthorDate: 2021-02-01 21:13:36 +0000 Commit: John Baldwin CommitDate: 2021-02-01 21:13:36 +0000 config: Fix typo in comment. --- usr.sbin/config/mkheaders.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/config/mkheaders.c b/usr.sbin/config/mkheaders.c index 62f81553bb5c..5dfde12c1db8 100644 --- a/usr.sbin/config/mkheaders.c +++ b/usr.sbin/config/mkheaders.c @@ -38,7 +38,7 @@ static const char rcsid[] = #endif /* not lint */ /* - * This used to generate a bunch of hearders files related to devices when + * This used to generate a bunch of headers files related to devices when * device counters were supported. Support for that was removed in 2005. * Since then, all we've done is to report unknown devices in this file. * It's kept its historical name, despite no longer generating headers. From owner-dev-commits-src-all@freebsd.org Mon Feb 1 21:21: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 8D35E53704A; Mon, 1 Feb 2021 21:21: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 4DV19H3fqQz3FDQ; Mon, 1 Feb 2021 21:21: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 7070F2256A; Mon, 1 Feb 2021 21:21: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 111LLths077292; Mon, 1 Feb 2021 21:21:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111LLt8l077291; Mon, 1 Feb 2021 21:21:55 GMT (envelope-from git) Date: Mon, 1 Feb 2021 21:21:55 GMT Message-Id: <202102012121.111LLt8l077291@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: 8fb966790e1c - main - zfs: update zfs_config.h to match OpenZFS gf11b09dec 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: 8fb966790e1c87276cc26932efee1b29c046cb8a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:21:55 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=8fb966790e1c87276cc26932efee1b29c046cb8a commit 8fb966790e1c87276cc26932efee1b29c046cb8a Author: Martin Matuska AuthorDate: 2021-02-01 21:08:19 +0000 Commit: Martin Matuska CommitDate: 2021-02-01 21:21:33 +0000 zfs: update zfs_config.h to match OpenZFS gf11b09dec Update zfs_config.h to match latest merge in FreeBSD The version string is declared as 2.0.0-FreeBSD_gf11b09dec to provide more information about the loaded module: - the OpenZFS version in base is 2.0 - we are using the in tree-module ("FreeBSD") - the last merged OpenZFS git revision ("gf11b09dec") With future merges the git revision tag should be updated. As we are merging from OpenZFS master branch and already include features like dRAID, referencing patchlevel releases (2.0.1, 2.0.2) is pointless. Reviewed by: freqlabs MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28447 --- sys/modules/zfs/zfs_config.h | 131 ++++++++++++++++++++++++++++++++----------- 1 file changed, 97 insertions(+), 34 deletions(-) diff --git a/sys/modules/zfs/zfs_config.h b/sys/modules/zfs/zfs_config.h index 6d73d1b8a341..358ecb609a05 100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@ -21,9 +21,6 @@ /* bdi_setup_and_register() wants 2 args */ /* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ -/* lookup_bdev() wants 2 args */ -/* #undef HAVE_2ARGS_LOOKUP_BDEV */ - /* vfs_getattr wants 2 args */ /* #undef HAVE_2ARGS_VFS_GETATTR */ @@ -85,6 +82,12 @@ #define HAVE_AVX512VL 1 #endif +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + /* bio->bi_opf is defined */ /* #undef HAVE_BIO_BI_OPF */ @@ -94,6 +97,9 @@ /* bio has bi_iter */ /* #undef HAVE_BIO_BVEC_ITER */ +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + /* bio_set_dev() is available */ /* #undef HAVE_BIO_SET_DEV */ @@ -115,6 +121,9 @@ /* blk_alloc_queue() expects request function */ /* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + /* blk queue backing_dev_info is dynamic */ /* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ @@ -154,12 +163,24 @@ the CoreFoundation framework. */ /* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + /* clear_inode() is available */ /* #undef HAVE_CLEAR_INODE */ /* dentry uses const struct dentry_operations */ /* #undef HAVE_CONST_DENTRY_OPERATIONS */ +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + /* current_time() exists */ /* #undef HAVE_CURRENT_TIME */ @@ -170,6 +191,9 @@ /* DECLARE_EVENT_CLASS() is available */ /* #undef HAVE_DECLARE_EVENT_CLASS */ +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + /* sops->dirty_inode() wants flags */ /* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ @@ -212,10 +236,10 @@ /* fops->fsync() without dentry */ /* #undef HAVE_FSYNC_WITHOUT_DENTRY */ -/* generic_start_io_acct()/generic_end_io_acct() available */ +/* generic_*_io_acct() 3 arg available */ /* #undef HAVE_GENERIC_IO_ACCT_3ARG */ -/* generic_start_io_acct()/generic_end_io_acct() 4 arg available */ +/* generic_*_io_acct() 4 arg available */ /* #undef HAVE_GENERIC_IO_ACCT_4ARG */ /* generic_readlink is global */ @@ -230,9 +254,6 @@ /* Define if the GNU gettext() function is already present or preinstalled. */ /* #undef HAVE_GETTEXT */ -/* get_disk_and_module() is available */ -/* #undef HAVE_GET_DISK_AND_MODULE */ - /* iops->get_link() cookie */ /* #undef HAVE_GET_LINK_COOKIE */ @@ -242,6 +263,9 @@ /* group_info->gid exists */ /* #undef HAVE_GROUP_INFO_GID */ +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + /* Define if you have the iconv() function and it works. */ #define HAVE_ICONV 1 @@ -266,6 +290,27 @@ /* in_compat_syscall() is available */ /* #undef HAVE_IN_COMPAT_SYSCALL */ +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT_LEGACY */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + /* yes */ /* #undef HAVE_IO_SCHEDULE_TIMEOUT */ @@ -287,6 +332,9 @@ /* kernel does stack verification */ /* #undef HAVE_KERNEL_OBJTOOL */ +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + /* kernel_read() take loff_t pointer */ /* #undef HAVE_KERNEL_READ_PPOS */ @@ -320,25 +368,22 @@ /* kernel has large stacks */ /* #undef HAVE_LARGE_STACKS */ -/* Define if you have libaio */ +/* Define if you have [aio] */ /* #undef HAVE_LIBAIO */ -/* Define if you have libblkid */ +/* Define if you have [blkid] */ /* #undef HAVE_LIBBLKID */ -/* Define if you have libssl */ -#define HAVE_LIBSSL 1 +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 -/* Define to 1 if you have the `tirpc' library (-ltirpc). */ +/* Define if you have [tirpc] */ /* #undef HAVE_LIBTIRPC */ -/* Define if you have libudev */ +/* Define if you have [udev] */ /* #undef HAVE_LIBUDEV */ -/* Define if udev_device_get_is_initialized is available */ -/* #undef HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED */ - -/* Define if you have libuuid */ +/* Define if you have [uuid] */ /* #undef HAVE_LIBUUID */ /* lseek_execute() is available */ @@ -365,6 +410,9 @@ /* Define to 1 if you have the `mlockall' function. */ #define HAVE_MLOCKALL 1 +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + /* Define if host toolchain supports MOVBE */ #define HAVE_MOVBE 1 @@ -377,6 +425,9 @@ /* Define if host toolchain supports PCLMULQDQ */ #define HAVE_PCLMULQDQ 1 +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + /* posix_acl_chmod() exists */ /* #undef HAVE_POSIX_ACL_CHMOD */ @@ -431,6 +482,12 @@ /* REQ_PREFLUSH is defined */ /* #undef HAVE_REQ_PREFLUSH */ +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + /* struct rw_semaphore has member activity */ /* #undef HAVE_RWSEM_ACTIVITY */ @@ -440,6 +497,9 @@ /* linux/sched/signal.h exists */ /* #undef HAVE_SCHED_SIGNAL_HEADER */ +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + /* setattr_prepare() is available */ /* #undef HAVE_SETATTR_PREPARE */ @@ -499,6 +559,9 @@ /* Define to 1 if you have the `strlcpy' function. */ #define HAVE_STRLCPY 1 +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + /* super_setup_bdi_name() exits */ /* #undef HAVE_SUPER_SETUP_BDI_NAME */ @@ -520,6 +583,9 @@ /* kernel has totalram_pages() */ /* #undef HAVE_TOTALRAM_PAGES_FUNC */ +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + /* kernel has __kernel_fpu_* functions */ /* #undef HAVE_UNDERSCORE_KERNEL_FPU */ @@ -541,6 +607,9 @@ /* aops->direct_IO() uses iov_iter with rw and offset */ /* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + /* fops->iterate() is available */ /* #undef HAVE_VFS_ITERATE */ @@ -595,15 +664,12 @@ /* xattr_handler->set() wants xattr_handler */ /* #undef HAVE_XATTR_SET_HANDLER */ -/* Define if you have zlib */ +/* Define if you have [z] */ #define HAVE_ZLIB 1 /* __posix_acl_chmod() exists */ /* #undef HAVE___POSIX_ACL_CHMOD */ -/* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST - /* kernel exports FPU functions */ /* #undef KERNEL_EXPORTS_X86_FPU */ @@ -635,7 +701,7 @@ /* #undef SYSTEM_LINUX */ /* zfs debugging enabled */ -/* #define ZFS_DEBUG 1 */ +/* #undef ZFS_DEBUG */ /* /dev/zfs minor */ /* #undef ZFS_DEVICE_MINOR */ @@ -649,9 +715,6 @@ /* enum node_stat_item contains NR_INACTIVE_FILE */ /* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */ -/* enum node_stat_item contains NR_SLAB_RECLAIMABLE */ -/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE */ - /* enum zone_stat_item contains NR_FILE_PAGES */ /* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */ @@ -661,9 +724,6 @@ /* enum zone_stat_item contains NR_INACTIVE_FILE */ /* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */ -/* enum zone_stat_item contains NR_SLAB_RECLAIMABLE */ -/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_SLAB_RECLAIMABLE */ - /* global_node_page_state() exists */ /* #undef ZFS_GLOBAL_NODE_PAGE_STATE */ @@ -674,16 +734,16 @@ /* #undef ZFS_IS_GPL_COMPATIBLE */ /* Define the project alias string. */ -#define ZFS_META_ALIAS "zfs-0.8.0-1" +#define ZFS_META_ALIAS "zfs-2.0.0-FreeBSD_gf11b09dec" /* Define the project author. */ -#define ZFS_META_AUTHOR "OpenZFS on Linux" +#define ZFS_META_AUTHOR "OpenZFS" /* Define the project release date. */ /* #undef ZFS_META_DATA */ /* Define the maximum compatible kernel version. */ -#define ZFS_META_KVER_MAX "5.6" +#define ZFS_META_KVER_MAX "5.10" /* Define the minimum compatible kernel version. */ #define ZFS_META_KVER_MIN "3.10" @@ -704,8 +764,11 @@ #define ZFS_META_NAME "zfs" /* Define the project release. */ -#define ZFS_META_RELEASE "1" +#define ZFS_META_RELEASE "FreeBSD_gf11b09dec" /* Define the project version. */ -#define ZFS_META_VERSION "0.8.0" +#define ZFS_META_VERSION "2.0.0" + +/* count is located in percpu_ref.data */ +/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */ From owner-dev-commits-src-all@freebsd.org Mon Feb 1 21:33: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 014CB5379CB for ; Mon, 1 Feb 2021 21:33:33 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (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 4DV1Qh6VM7z3G38 for ; Mon, 1 Feb 2021 21:33:32 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb35.google.com with SMTP id w204so15540997ybg.2 for ; Mon, 01 Feb 2021 13:33:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LNFgxSz5EKYvwmBybfKVqKzZLo7JJDZ13SuqmxGjHmI=; b=MYrVVdrrIqLevP+gEcU2gleqZWT1JrFsyhe1wMOZg2Zrd3cnw0b5DW5Na1nd8QswWy PEid3UGjGAmtay6mkj8qcHt3Oi19wv7u4axEM8EAPStxlN+IHxqNilew+9ANOu1Q8FbD K3QWNqvbwWFOCzSANN/8ssP4gM1kpkHO3QBpU= 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=LNFgxSz5EKYvwmBybfKVqKzZLo7JJDZ13SuqmxGjHmI=; b=FMd0+c8yGKhARcOyUlSd03WDqqHdn2Gkvso7A5r8fNtWGnUYuu7H8bJ0o3kog0Yb+e VvcuKszN9Q1tYNJX+29dDGch9Ap0F6OG5BulDSnu5NtoWL/7st96uMZE3HgcmvjVdtBH JEt/+coknOz9sIEnbN6cRuEw4+HAc9jIMgR9iHyAQcFhJsgUyWWrGU46e/NhYIakyTPc o9rBCJhcoepxvdGryjCa2JifrVI4KNoYJjUZVhiGkcS61sRbi6EahF/TXfCoMHBqhiJt P6CdiYeyRbiwfHIjRYJ4njJ009vb/uSvxLh6WdeDWCbjs0p4wcBLvpVCa11c62LAST55 StHg== X-Gm-Message-State: AOAM532ByO0+1DZVQYCxCtV05vSnm2btnIpQl+fvRebT+WTnW0L9vmnr 8V6TMsDsPQLIOvnqIsM0VhlMV4nUDoVvXfCqp4MhAw== X-Google-Smtp-Source: ABdhPJwFVxxaFFmNfNqRLJK0NdAM17WN2/C9eId2VzgataFp4+ObWAQHDQKpnLX0q16eX9VyDHXTmVdE+nyuefu6S9w= X-Received: by 2002:a25:8083:: with SMTP id n3mr19995392ybk.330.1612215211707; Mon, 01 Feb 2021 13:33:31 -0800 (PST) MIME-Version: 1.0 References: <202102012121.111LLt8l077291@gitrepo.freebsd.org> In-Reply-To: <202102012121.111LLt8l077291@gitrepo.freebsd.org> From: Kevin Bowling Date: Mon, 1 Feb 2021 14:33:21 -0700 Message-ID: Subject: Re: git: 8fb966790e1c - main - zfs: update zfs_config.h to match OpenZFS gf11b09dec To: Martin Matuska 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: 4DV1Qh6VM7z3G38 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 Feb 2021 21:33:33 -0000 On Mon, Feb 1, 2021 at 2:21 PM Martin Matuska wrote: > > The branch main has been updated by mm: > > URL: https://cgit.FreeBSD.org/src/commit/?id=8fb966790e1c87276cc26932efee1b29c046cb8a > > commit 8fb966790e1c87276cc26932efee1b29c046cb8a > Author: Martin Matuska > AuthorDate: 2021-02-01 21:08:19 +0000 > Commit: Martin Matuska > CommitDate: 2021-02-01 21:21:33 +0000 > > zfs: update zfs_config.h to match OpenZFS gf11b09dec > > Update zfs_config.h to match latest merge in FreeBSD > > The version string is declared as 2.0.0-FreeBSD_gf11b09dec to provide > more information about the loaded module: > - the OpenZFS version in base is 2.0 > - we are using the in tree-module ("FreeBSD") > - the last merged OpenZFS git revision ("gf11b09dec") > > With future merges the git revision tag should be updated. > As we are merging from OpenZFS master branch and already include features > like dRAID, referencing patchlevel releases (2.0.1, 2.0.2) is pointless. I'm not sure this statement wrt patchlevel will remain accurate, at least intentionally. The intent is 13.x will follow OpenZFS 2.1, which will begin the release process "Soon". From owner-dev-commits-src-all@freebsd.org Mon Feb 1 22:31: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 193BE4E98A3; Mon, 1 Feb 2021 22:31: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 4DV2k70Jc3z3L7X; Mon, 1 Feb 2021 22:31: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 F17C923337; Mon, 1 Feb 2021 22:31: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 111MVwAx070279; Mon, 1 Feb 2021 22:31:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111MVw2D070278; Mon, 1 Feb 2021 22:31:58 GMT (envelope-from git) Date: Mon, 1 Feb 2021 22:31:58 GMT Message-Id: <202102012231.111MVw2D070278@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: f19a4e97d3b0 - stable/13 - newvers: tweak uname to be more useful 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: f19a4e97d3b0905dfda5aaebba49f68a1e07fa3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:31:59 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f19a4e97d3b0905dfda5aaebba49f68a1e07fa3e commit f19a4e97d3b0905dfda5aaebba49f68a1e07fa3e Author: Warner Losh AuthorDate: 2021-01-25 19:53:31 +0000 Commit: Warner Losh CommitDate: 2021-02-01 22:31:35 +0000 newvers: tweak uname to be more useful The current uname is branch-cXXXX-gHASH Three changes to make uname more useful. 1. Move from using git rev-list --count to git rev-lis --count --first-parent since that gives a better, incrementing number. 2. Report this count as 'nXXXXX' rather than 'cXXXXX' because c is part of a hash and we've changed the sematnics of XXXXX 3. Remove g to make HASH cut and pastable. Durting review, #1 & #3 had the largest consensus. There was a diversity of opinion on #2, but on the whole it was positive so I'll acknowledge the dissent, but move forward with something seems to have support since the dissent was all about what letter to use where I chose 'n'. MFC After: 3 days Reviewed by: rgrimes, emaste (earlier version) Differential Revision: https://reviews.freebsd.org/D28338 (cherry picked from commit 8a51f14a7833fd14e1f125e63a0af9d260dcd287) --- sys/conf/newvers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index a40392d91b9b..12d4daa771be 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -253,9 +253,9 @@ fi if [ -n "$git_cmd" ] ; then git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null) if [ "$($git_cmd rev-parse --is-shallow-repository)" = false ] ; then - git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) + git_cnt=$($git_cmd rev-list --first-parent --count HEAD 2>/dev/null) if [ -n "$git_cnt" ] ; then - git="c${git_cnt}-g${git}" + git="n${git_cnt}-${git}" fi fi git_b=$($git_cmd rev-parse --abbrev-ref HEAD) From owner-dev-commits-src-all@freebsd.org Mon Feb 1 22:34: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 D3D8D4E9E84; Mon, 1 Feb 2021 22:34: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 4DV2n75dwMz3Lt5; Mon, 1 Feb 2021 22:34: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 B0195234DF; Mon, 1 Feb 2021 22:34: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 111MYZg0070811; Mon, 1 Feb 2021 22:34:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 111MYZ2A070810; Mon, 1 Feb 2021 22:34:35 GMT (envelope-from git) Date: Mon, 1 Feb 2021 22:34:35 GMT Message-Id: <202102012234.111MYZ2A070810@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: 1912d2b15e6d - main - vt: parse_font_info_static should set refcount, not parse_font_info 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: 1912d2b15e6d6f4a1d8c3886b03ab30d2f21f3fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:34:35 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=1912d2b15e6d6f4a1d8c3886b03ab30d2f21f3fd commit 1912d2b15e6d6f4a1d8c3886b03ab30d2f21f3fd Author: Toomas Soome AuthorDate: 2021-01-31 21:04:59 +0000 Commit: Toomas Soome CommitDate: 2021-02-01 22:33:58 +0000 vt: parse_font_info_static should set refcount, not parse_font_info As we get started with no memory allocator, we set up static font data for font passed by loader (if there is any). At this time, we also must set refcount 1, and refcount will get incremented in cnprobe() callback. At some point the memory allocator will be available, and we will set up properly allocated font data, but we should not disturb the refcount. PR: 253147 --- sys/dev/vt/vt_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index ac89d8635e78..05c383829f49 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -1487,6 +1487,8 @@ parse_font_info_static(struct font_info *fi) vfp = &vt_font_loader; vfp->vf_height = fi->fi_height; vfp->vf_width = fi->fi_width; + /* This is default font, set refcount 1 to disable removal. */ + vfp->vf_refcount = 1; for (unsigned i = 0; i < VFNT_MAPS; i++) { if (fi->fi_map_count[i] == 0) continue; @@ -1499,6 +1501,12 @@ parse_font_info_static(struct font_info *fi) return (vfp); } +/* + * Set up default font with allocated data structures. + * However, we can not set refcount here, because it is already set and + * incremented in vtterm_cnprobe() to avoid being released by font load from + * userland. + */ static struct vt_font * parse_font_info(struct font_info *fi) { @@ -1528,8 +1536,6 @@ parse_font_info(struct font_info *fi) ptr = roundup2(ptr, 8); vfp = &vt_font_loader; - /* This is default font, set refcount 1 to disable removal. */ - vfp->vf_refcount = 1; vfp->vf_height = fi->fi_height; vfp->vf_width = fi->fi_width; for (unsigned i = 0; i < VFNT_MAPS; i++) { From owner-dev-commits-src-all@freebsd.org Tue Feb 2 00:28: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 D23384ED525; Tue, 2 Feb 2021 00:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV5Jz5NrDz3j8m; Tue, 2 Feb 2021 00:28: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 ABBFA24C10; Tue, 2 Feb 2021 00:28: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 1120SpnB014479; Tue, 2 Feb 2021 00:28:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1120Spr5014478; Tue, 2 Feb 2021 00:28:51 GMT (envelope-from git) Date: Tue, 2 Feb 2021 00:28:51 GMT Message-Id: <202102020028.1120Spr5014478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chuck Silvers Subject: git: 7787e7eed9d2 - main - tail: fix "tail -F" file rotation detection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: chs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7787e7eed9d2a43fb6eb66666040f1b495995a2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:28:51 -0000 The branch main has been updated by chs: URL: https://cgit.FreeBSD.org/src/commit/?id=7787e7eed9d2a43fb6eb66666040f1b495995a2f commit 7787e7eed9d2a43fb6eb66666040f1b495995a2f Author: Chuck Silvers AuthorDate: 2021-02-02 00:21:14 +0000 Commit: Chuck Silvers CommitDate: 2021-02-02 00:21:14 +0000 tail: fix "tail -F" file rotation detection When checking if the newly opened file is the same as the old one, we need to fstat() the new file descriptor, not the old one again. Reviewed by: glebius Sponsored by: Netflix --- usr.bin/tail/forward.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index 2888bd18816e..878cb5a4550b 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -367,7 +367,7 @@ follow(file_info_t *files, enum STYLE style, off_t off) continue; ftmp = fileargs_fopen(fa, file->file_name, "r"); if (ftmp == NULL || - fstat(fileno(file->fp), &sb2) == -1) { + fstat(fileno(ftmp), &sb2) == -1) { if (errno != ENOENT) ierr(file->file_name); show(file); From owner-dev-commits-src-all@freebsd.org Tue Feb 2 00:36: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 E4D844ED9ED; Tue, 2 Feb 2021 00:36:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DV5Tj67gNz3jnY; Tue, 2 Feb 2021 00:36:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:18c1:8fb3:c83d:4682]) (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 49F5E23810; Tue, 2 Feb 2021 00:36:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: aa906e2a4957 - main - OpenSSL: Support for kernel TLS offload (KTLS) To: Guido Falsi , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202101281825.10SIPTGJ021104@gitrepo.freebsd.org> <8257bc17-3a2d-f348-a0d5-fbd0f637629f@FreeBSD.org> From: John Baldwin Message-ID: <07c2a98a-e6cc-5241-c75e-9a635d282e18@FreeBSD.org> Date: Mon, 1 Feb 2021 16:36:24 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <8257bc17-3a2d-f348-a0d5-fbd0f637629f@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: Tue, 02 Feb 2021 00:36:26 -0000 On 1/31/21 10:41 AM, Guido Falsi wrote: > On 28/01/21 19:25, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=aa906e2a4957db700d9e6cc60857e1afe1aecc85 >> >> commit aa906e2a4957db700d9e6cc60857e1afe1aecc85 >> Author: John Baldwin >> AuthorDate: 2021-01-16 00:17:31 +0000 >> Commit: John Baldwin >> CommitDate: 2021-01-28 18:24:13 +0000 >> >> OpenSSL: Support for kernel TLS offload (KTLS) >> >> This merges upstream patches from OpenSSL's master branch to add >> KTLS infrastructure for TLS 1.0-1.3 including both RX and TX >> offload and SSL_sendfile support on both Linux and FreeBSD. >> >> Note that TLS 1.3 only supports TX offload. >> >> A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with >> KTLS support. It defaults to enabled on amd64 and disabled on all >> other architectures. >> >> Reviewed by: jkim (earlier version) >> Approved by: secteam >> Obtained from: OpenSSL (patches from master) >> MFC after: 1 week >> Relnotes: yes >> Sponsored by: Netflix >> Differential Revision: https://reviews.freebsd.org/D28273 >> --- > > This commit causes a strange interaction/regression with subverison > client when using https protocol. > > I filed a bug report about this: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253135 > > Workarounds: > > - Compiling system defining WITHOUT_OPENSSL_KTLS > - using the svn:// scheme Hmm, that is certainly odd. I did reproduce it locally and it wasn't even trying to use KTLS (didn't invoke the socket option in the ktrace I had). I will work on debugging this more tomorrow. -- John Baldwin From owner-dev-commits-src-all@freebsd.org Tue Feb 2 01:15: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 E0A9C4F876F; Tue, 2 Feb 2021 01:15: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 4DV6MG5x4yz3nLK; Tue, 2 Feb 2021 01:15: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 BE8F1254C3; Tue, 2 Feb 2021 01:15: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 1121FsYQ078895; Tue, 2 Feb 2021 01:15:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1121Fs8g078894; Tue, 2 Feb 2021 01:15:54 GMT (envelope-from git) Date: Tue, 2 Feb 2021 01:15:54 GMT Message-Id: <202102020115.1121Fs8g078894@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: 0b7f1af804f0 - main - Bump shared library versions after ncurses bump in 13. 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: 0b7f1af804f06a285717b490bef80e24648adcbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:15:54 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0b7f1af804f06a285717b490bef80e24648adcbe commit 0b7f1af804f06a285717b490bef80e24648adcbe Author: John Baldwin AuthorDate: 2021-02-02 01:09:33 +0000 Commit: John Baldwin CommitDate: 2021-02-02 01:11:49 +0000 Bump shared library versions after ncurses bump in 13. A few shared libraries in the base system link against ncurses. An upgrade from a 12.x host to 13 results in ABI breakage for existing binaries since the newer versions of these libraries link against the newer ncurses while the binary itself links against the older ncurses. For example, dialog4ports built on 12.x sometimes crashes on 13 since it depends on libdialog which links against ncurses internally. MFC after: 3 days Reviewed by: kib, delphij Differential Revision: https://reviews.freebsd.org/D28448 --- ObsoleteFiles.inc | 11 +++++++++++ gnu/lib/libdialog/Makefile | 2 +- lib/libdpv/Makefile | 2 +- lib/libedit/Makefile | 2 +- lib/ncurses/form/Makefile | 1 + lib/ncurses/menu/Makefile | 1 + lib/ncurses/panel/Makefile | 1 + 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 29cf25e152e6..696243470b14 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20210201: bump shared libraries which link against ncurses +OLD_LIBS+=lib/libedit.so.7 +OLD_LIBS+=usr/lib/libdialog.so.8 +OLD_LIBS+=usr/lib/libdpv.so.1 +OLD_LIBS+=usr/lib/libform.so.5 +OLD_LIBS+=usr/lib/libformw.so.5 +OLD_LIBS+=usr/lib/libmenu.so.5 +OLD_LIBS+=usr/lib/libmenuw.so.5 +OLD_LIBS+=usr/lib/libpanel.so.5 +OLD_LIBS+=usr/lib/libpanelw.so.5 + # 20210125: ndis driver support removed OLD_FILES+=usr/sbin/ndiscvt OLD_FILES+=usr/sbin/ndisgen diff --git a/gnu/lib/libdialog/Makefile b/gnu/lib/libdialog/Makefile index 69d8dbd3fdb8..e4f1b62121d9 100644 --- a/gnu/lib/libdialog/Makefile +++ b/gnu/lib/libdialog/Makefile @@ -3,7 +3,7 @@ DIALOG= ${SRCTOP}/contrib/dialog LIB= dialog -SHLIB_MAJOR= 8 +SHLIB_MAJOR= 9 SRCS= argv.c arrows.c buildlist.c buttons.c calendar.c checklist.c \ columns.c dlg_keys.c editbox.c fselect.c formbox.c guage.c \ help.c inputbox.c inputstr.c menubox.c mixedform.c \ diff --git a/lib/libdpv/Makefile b/lib/libdpv/Makefile index d2334ee38186..be28debc70bc 100644 --- a/lib/libdpv/Makefile +++ b/lib/libdpv/Makefile @@ -2,7 +2,7 @@ PACKAGE= dpv LIB= dpv -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 INCS= dpv.h MAN= dpv.3 MLINKS= dpv.3 dpv_free.3 diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index f1dbad42db22..963063ef90fa 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -7,7 +7,7 @@ PACKAGE=clibs EDITDIR= ${SRCTOP}/contrib/libedit .PATH: ${EDITDIR} -SHLIB_MAJOR= 7 +SHLIB_MAJOR= 8 SHLIBDIR?= /lib WARNS?= 3 diff --git a/lib/ncurses/form/Makefile b/lib/ncurses/form/Makefile index a8e636d6ce1b..a6b186936dc5 100644 --- a/lib/ncurses/form/Makefile +++ b/lib/ncurses/form/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/form LIB= formw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ diff --git a/lib/ncurses/menu/Makefile b/lib/ncurses/menu/Makefile index 7844cd4d936c..9bd92723fed9 100644 --- a/lib/ncurses/menu/Makefile +++ b/lib/ncurses/menu/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/menu LIB= menuw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ diff --git a/lib/ncurses/panel/Makefile b/lib/ncurses/panel/Makefile index a22df4d89570..9dd950496b1b 100644 --- a/lib/ncurses/panel/Makefile +++ b/lib/ncurses/panel/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/panel LIB= panelw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ From owner-dev-commits-src-all@freebsd.org Tue Feb 2 01:19: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 7CF9F4F8C2E; Tue, 2 Feb 2021 01:19: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 4DV6RD320zz3nZM; Tue, 2 Feb 2021 01:19: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 5A30D25435; Tue, 2 Feb 2021 01:19: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 1121JKJR079523; Tue, 2 Feb 2021 01:19:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1121JKr0079522; Tue, 2 Feb 2021 01:19:20 GMT (envelope-from git) Date: Tue, 2 Feb 2021 01:19:20 GMT Message-Id: <202102020119.1121JKr0079522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 4cd1807c7d2a - main - Retire the K&R/STD C __P prototype declarations. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4cd1807c7d2a67b633dd0c0bfde15091543a2514 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:19:20 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=4cd1807c7d2a67b633dd0c0bfde15091543a2514 commit 4cd1807c7d2a67b633dd0c0bfde15091543a2514 Author: Cy Schubert AuthorDate: 2021-01-26 06:24:28 +0000 Commit: Cy Schubert CommitDate: 2021-02-02 01:19:15 +0000 Retire the K&R/STD C __P prototype declarations. In the old days when K&R C and STD C were each in use a workaround (read hack) was required to allow the same code to work on each without modification. All C compilers support STD C. We can finally put the __P prototype to rest. MFC after: 1 week --- contrib/ipfilter/bpf_filter.c | 4 +- contrib/ipfilter/ip_dstlist.c | 70 ++--- contrib/ipfilter/ip_dstlist.h | 4 +- contrib/ipfilter/ip_fil.c | 12 +- contrib/ipfilter/ip_fil_compat.c | 122 ++++---- contrib/ipfilter/ip_msnrpc_pxy.c | 12 +- contrib/ipfilter/ipf.h | 340 ++++++++++----------- contrib/ipfilter/iplang/iplang.h | 2 +- contrib/ipfilter/iplang/iplang_l.l | 16 +- contrib/ipfilter/iplang/iplang_y.y | 162 +++++----- contrib/ipfilter/ipmon.h | 14 +- contrib/ipfilter/ipsend/ipresend.c | 4 +- contrib/ipfilter/ipsend/ipsend.c | 8 +- contrib/ipfilter/ipsend/ipsend.h | 52 ++-- contrib/ipfilter/ipsend/iptest.c | 4 +- contrib/ipfilter/ipsend/resend.c | 2 +- contrib/ipfilter/ipsend/sock.c | 4 +- contrib/ipfilter/ipt.h | 6 +- contrib/ipfilter/kmem.h | 6 +- contrib/ipfilter/lib/facpri.h | 8 +- contrib/ipfilter/lib/inet_addr.c | 2 +- contrib/ipfilter/lib/initparse.c | 2 +- contrib/ipfilter/lib/interror.c | 2 +- contrib/ipfilter/lib/ipft_hx.c | 8 +- contrib/ipfilter/lib/ipft_pc.c | 10 +- contrib/ipfilter/lib/ipft_tx.c | 12 +- contrib/ipfilter/lib/kmem.h | 6 +- contrib/ipfilter/lib/printipfexpr.c | 8 +- contrib/ipfilter/lib/save_execute.c | 8 +- contrib/ipfilter/lib/save_file.c | 12 +- contrib/ipfilter/lib/save_nothing.c | 6 +- contrib/ipfilter/lib/save_syslog.c | 8 +- contrib/ipfilter/lib/save_v1trap.c | 20 +- contrib/ipfilter/lib/save_v2trap.c | 24 +- contrib/ipfilter/lib/var.c | 4 +- contrib/ipfilter/man/ipf.4 | 2 +- contrib/ipfilter/md5.c | 2 +- contrib/ipfilter/md5.h | 6 +- contrib/ipfilter/radix_ipf.c | 20 +- contrib/ipfilter/radix_ipf.h | 24 +- contrib/ipfilter/tools/ipf.c | 32 +- contrib/ipfilter/tools/ipf_y.y | 52 ++-- contrib/ipfilter/tools/ipfcomp.c | 38 +-- contrib/ipfilter/tools/ipfs.c | 28 +- contrib/ipfilter/tools/ipfstat.c | 76 ++--- contrib/ipfilter/tools/ipfsyncd.c | 22 +- contrib/ipfilter/tools/ipftest.c | 40 +-- contrib/ipfilter/tools/ipmon.c | 48 +-- contrib/ipfilter/tools/ipmon_y.y | 22 +- contrib/ipfilter/tools/ipnat.c | 24 +- contrib/ipfilter/tools/ipnat_y.y | 38 +-- contrib/ipfilter/tools/ippool.c | 34 +-- contrib/ipfilter/tools/ippool_y.y | 10 +- contrib/ipfilter/tools/ipscan_y.y | 32 +- contrib/ipfilter/tools/ipsyncm.c | 4 +- contrib/ipfilter/tools/ipsyncs.c | 4 +- contrib/ipfilter/tools/lexer.c | 14 +- contrib/ipfilter/tools/lexer.h | 14 +- sys/contrib/ipfilter/netinet/fil.c | 148 +++++----- sys/contrib/ipfilter/netinet/ip_auth.c | 14 +- sys/contrib/ipfilter/netinet/ip_auth.h | 40 +-- sys/contrib/ipfilter/netinet/ip_compat.h | 38 ++- sys/contrib/ipfilter/netinet/ip_dns_pxy.c | 20 +- sys/contrib/ipfilter/netinet/ip_dstlist.c | 70 ++--- sys/contrib/ipfilter/netinet/ip_dstlist.h | 4 +- sys/contrib/ipfilter/netinet/ip_fil.h | 408 +++++++++++++------------- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 6 +- sys/contrib/ipfilter/netinet/ip_frag.c | 28 +- sys/contrib/ipfilter/netinet/ip_frag.h | 54 ++-- sys/contrib/ipfilter/netinet/ip_ftp_pxy.c | 78 ++--- sys/contrib/ipfilter/netinet/ip_htable.c | 76 ++--- sys/contrib/ipfilter/netinet/ip_htable.h | 6 +- sys/contrib/ipfilter/netinet/ip_ipsec_pxy.c | 20 +- sys/contrib/ipfilter/netinet/ip_irc_pxy.c | 14 +- sys/contrib/ipfilter/netinet/ip_lookup.c | 16 +- sys/contrib/ipfilter/netinet/ip_lookup.h | 92 +++--- sys/contrib/ipfilter/netinet/ip_nat.c | 98 +++---- sys/contrib/ipfilter/netinet/ip_nat.h | 176 +++++------ sys/contrib/ipfilter/netinet/ip_nat6.c | 30 +- sys/contrib/ipfilter/netinet/ip_netbios_pxy.c | 6 +- sys/contrib/ipfilter/netinet/ip_pool.c | 74 ++--- sys/contrib/ipfilter/netinet/ip_pool.h | 2 +- sys/contrib/ipfilter/netinet/ip_pptp_pxy.c | 18 +- sys/contrib/ipfilter/netinet/ip_proxy.c | 4 +- sys/contrib/ipfilter/netinet/ip_proxy.h | 76 ++--- sys/contrib/ipfilter/netinet/ip_raudio_pxy.c | 10 +- sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c | 22 +- sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c | 60 ++-- sys/contrib/ipfilter/netinet/ip_rules.h | 16 +- sys/contrib/ipfilter/netinet/ip_scan.c | 12 +- sys/contrib/ipfilter/netinet/ip_scan.h | 16 +- sys/contrib/ipfilter/netinet/ip_state.c | 72 ++--- sys/contrib/ipfilter/netinet/ip_state.h | 66 ++--- sys/contrib/ipfilter/netinet/ip_sync.c | 18 +- sys/contrib/ipfilter/netinet/ip_sync.h | 34 +-- sys/contrib/ipfilter/netinet/ip_tftp_pxy.c | 26 +- sys/contrib/ipfilter/netinet/mlfk_ipl.c | 16 +- sys/contrib/ipfilter/netinet/radix_ipf.c | 20 +- sys/contrib/ipfilter/netinet/radix_ipf.h | 22 +- 99 files changed, 1795 insertions(+), 1801 deletions(-) diff --git a/contrib/ipfilter/bpf_filter.c b/contrib/ipfilter/bpf_filter.c index bd465761a34e..85a38a88bf57 100644 --- a/contrib/ipfilter/bpf_filter.c +++ b/contrib/ipfilter/bpf_filter.c @@ -71,8 +71,8 @@ static const char rcsid[] = #define int32 bpf_int32 #define u_int32 bpf_u_int32 -static int m_xword __P((mb_t *, int, int *)); -static int m_xhalf __P((mb_t *, int, int *)); +static int m_xword(mb_t *, int, int *); +static int m_xhalf(mb_t *, int, int *); #ifndef LBL_ALIGN /* diff --git a/contrib/ipfilter/ip_dstlist.c b/contrib/ipfilter/ip_dstlist.c index 99c7a22668df..14b071b0b95f 100644 --- a/contrib/ipfilter/ip_dstlist.c +++ b/contrib/ipfilter/ip_dstlist.c @@ -73,41 +73,41 @@ typedef struct ipf_dstl_softc_s { } ipf_dstl_softc_t; -static void *ipf_dstlist_soft_create __P((ipf_main_softc_t *)); -static void ipf_dstlist_soft_destroy __P((ipf_main_softc_t *, void *)); -static int ipf_dstlist_soft_init __P((ipf_main_softc_t *, void *)); -static void ipf_dstlist_soft_fini __P((ipf_main_softc_t *, void *)); -static int ipf_dstlist_addr_find __P((ipf_main_softc_t *, void *, int, - void *, u_int)); -static size_t ipf_dstlist_flush __P((ipf_main_softc_t *, void *, - iplookupflush_t *)); -static int ipf_dstlist_iter_deref __P((ipf_main_softc_t *, void *, int, int, - void *)); -static int ipf_dstlist_iter_next __P((ipf_main_softc_t *, void *, ipftoken_t *, - ipflookupiter_t *)); -static int ipf_dstlist_node_add __P((ipf_main_softc_t *, void *, - iplookupop_t *, int)); -static int ipf_dstlist_node_del __P((ipf_main_softc_t *, void *, - iplookupop_t *, int)); -static int ipf_dstlist_stats_get __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_add __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_del __P((ipf_main_softc_t *, void *, - iplookupop_t *)); -static int ipf_dstlist_table_deref __P((ipf_main_softc_t *, void *, void *)); -static void *ipf_dstlist_table_find __P((void *, int, char *)); -static void ipf_dstlist_table_free __P((ipf_dstl_softc_t *, ippool_dst_t *)); -static void ipf_dstlist_table_remove __P((ipf_main_softc_t *, - ipf_dstl_softc_t *, ippool_dst_t *)); -static void ipf_dstlist_table_clearnodes __P((ipf_dstl_softc_t *, - ippool_dst_t *)); -static ipf_dstnode_t *ipf_dstlist_select __P((fr_info_t *, ippool_dst_t *)); -static void *ipf_dstlist_select_ref __P((void *, int, char *)); -static void ipf_dstlist_node_free __P((ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *)); -static int ipf_dstlist_node_deref __P((void *, ipf_dstnode_t *)); -static void ipf_dstlist_expire __P((ipf_main_softc_t *, void *)); -static void ipf_dstlist_sync __P((ipf_main_softc_t *, void *)); +static void *ipf_dstlist_soft_create(ipf_main_softc_t *); +static void ipf_dstlist_soft_destroy(ipf_main_softc_t *, void *); +static int ipf_dstlist_soft_init(ipf_main_softc_t *, void *); +static void ipf_dstlist_soft_fini(ipf_main_softc_t *, void *); +static int ipf_dstlist_addr_find(ipf_main_softc_t *, void *, int, + void *, u_int); +static size_t ipf_dstlist_flush(ipf_main_softc_t *, void *, + iplookupflush_t *); +static int ipf_dstlist_iter_deref(ipf_main_softc_t *, void *, int, int, + void *); +static int ipf_dstlist_iter_next(ipf_main_softc_t *, void *, ipftoken_t *, + ipflookupiter_t *); +static int ipf_dstlist_node_add(ipf_main_softc_t *, void *, + iplookupop_t *, int); +static int ipf_dstlist_node_del(ipf_main_softc_t *, void *, + iplookupop_t *, int); +static int ipf_dstlist_stats_get(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_add(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_del(ipf_main_softc_t *, void *, + iplookupop_t *); +static int ipf_dstlist_table_deref(ipf_main_softc_t *, void *, void *); +static void *ipf_dstlist_table_find(void *, int, char *); +static void ipf_dstlist_table_free(ipf_dstl_softc_t *, ippool_dst_t *); +static void ipf_dstlist_table_remove(ipf_main_softc_t *, + ipf_dstl_softc_t *, ippool_dst_t *); +static void ipf_dstlist_table_clearnodes(ipf_dstl_softc_t *, + ippool_dst_t *); +static ipf_dstnode_t *ipf_dstlist_select(fr_info_t *, ippool_dst_t *); +static void *ipf_dstlist_select_ref(void *, int, char *); +static void ipf_dstlist_node_free(ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *); +static int ipf_dstlist_node_deref(void *, ipf_dstnode_t *); +static void ipf_dstlist_expire(ipf_main_softc_t *, void *); +static void ipf_dstlist_sync(ipf_main_softc_t *, void *); ipf_lookup_t ipf_dstlist_backend = { IPLT_DSTLIST, diff --git a/contrib/ipfilter/ip_dstlist.h b/contrib/ipfilter/ip_dstlist.h index e2885e5c47ad..c4acd78dfd94 100644 --- a/contrib/ipfilter/ip_dstlist.h +++ b/contrib/ipfilter/ip_dstlist.h @@ -62,7 +62,7 @@ typedef struct dstlist_stat_s { extern ipf_lookup_t ipf_dstlist_backend; -extern int ipf_dstlist_select_node __P((fr_info_t *, void *, u_32_t *, - frdest_t *)); +extern int ipf_dstlist_select_node(fr_info_t *, void *, u_32_t *, + frdest_t *); #endif /* __IP_DSTLIST_H__ */ diff --git a/contrib/ipfilter/ip_fil.c b/contrib/ipfilter/ip_fil.c index 794d7e205bb3..327f90fc356c 100644 --- a/contrib/ipfilter/ip_fil.c +++ b/contrib/ipfilter/ip_fil.c @@ -23,12 +23,12 @@ static int nifs = 0; struct rtentry; -static void ipf_setifpaddr __P((struct ifnet *, char *)); -void init_ifp __P((void)); -static int no_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *, struct rtentry *)); -static int write_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *, struct rtentry *)); +static void ipf_setifpaddr(struct ifnet *, char *); +void init_ifp(void); +static int no_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *); +static int write_output(struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *); struct ifaddr { struct sockaddr_storage ifa_addr; diff --git a/contrib/ipfilter/ip_fil_compat.c b/contrib/ipfilter/ip_fil_compat.c index 271c2e065738..fbcfc8a0088f 100644 --- a/contrib/ipfilter/ip_fil_compat.c +++ b/contrib/ipfilter/ip_fil_compat.c @@ -73,7 +73,7 @@ typedef struct tcpinfo4 { tcpdata_t ts_data[2]; } tcpinfo4_t; -static void ipf_v5tcpinfoto4 __P((tcpinfo_t *, tcpinfo4_t *)); +static void ipf_v5tcpinfoto4(tcpinfo_t *, tcpinfo4_t *); static void ipf_v5tcpinfoto4(v5, v4) @@ -1190,66 +1190,66 @@ typedef struct ipfrstat_4_1_1 { } ipfrstat_4_1_1_t; /* ------------------------------------------------------------------------ */ -static int ipf_addfrstr __P((char *, int, char *, int)); -static void ipf_v4iptov5 __P((frip4_t *, fr_ip_t *)); -static void ipf_v5iptov4 __P((fr_ip_t *, frip4_t *)); -static void ipfv4tuctov5 __P((frtuc4_t *, frtuc_t *)); -static void ipfv5tuctov4 __P((frtuc_t *, frtuc4_t *)); -static int ipf_v4fripftov5 __P((fripf4_t *, char *)); -static void ipf_v5fripftov4 __P((fripf_t *, fripf4_t *)); -static int fr_frflags4to5 __P((u_32_t)); -static int fr_frflags5to4 __P((u_32_t)); - -static void friostat_current_to_4_1_0 __P((void *, friostat_4_1_0_t *, int)); -static void friostat_current_to_4_1_33 __P((void *, friostat_4_1_33_t *, int)); -static void ipstate_current_to_4_1_0 __P((void *, ipstate_4_1_0_t *)); -static void ipstate_current_to_4_1_16 __P((void *, ipstate_4_1_16_t *)); -static void ipnat_current_to_4_1_0 __P((void *, ipnat_4_1_0_t *)); -static void ipnat_current_to_4_1_14 __P((void *, ipnat_4_1_14_t *)); -static void frauth_current_to_4_1_11 __P((void *, frauth_4_1_11_t *)); -static void frauth_current_to_4_1_23 __P((void *, frauth_4_1_23_t *)); -static void frauth_current_to_4_1_24 __P((void *, frauth_4_1_24_t *)); -static void frauth_current_to_4_1_29 __P((void *, frauth_4_1_29_t *)); -static void frentry_current_to_4_1_0 __P((void *, frentry_4_1_0_t *)); -static void frentry_current_to_4_1_16 __P((void *, frentry_4_1_16_t *)); -static void frentry_current_to_4_1_34 __P((void *, frentry_4_1_34_t *)); -static void fr_info_current_to_4_1_11 __P((void *, fr_info_4_1_11_t *)); -static void fr_info_current_to_4_1_23 __P((void *, fr_info_4_1_23_t *)); -static void fr_info_current_to_4_1_24 __P((void *, fr_info_4_1_24_t *)); -static void nat_save_current_to_4_1_3 __P((void *, nat_save_4_1_3_t *)); -static void nat_save_current_to_4_1_14 __P((void *, nat_save_4_1_14_t *)); -static void nat_save_current_to_4_1_16 __P((void *, nat_save_4_1_16_t *)); -static void ipstate_save_current_to_4_1_0 __P((void *, ipstate_save_4_1_0_t *)); -static void ipstate_save_current_to_4_1_16 __P((void *, ipstate_save_4_1_16_t *)); -static void ips_stat_current_to_4_1_0 __P((void *, ips_stat_4_1_0_t *)); -static void ips_stat_current_to_4_1_21 __P((void *, ips_stat_4_1_21_t *)); -static void natstat_current_to_4_1_0 __P((void *, natstat_4_1_0_t *)); -static void natstat_current_to_4_1_16 __P((void *, natstat_4_1_16_t *)); -static void natstat_current_to_4_1_27 __P((void *, natstat_4_1_27_t *)); -static void natstat_current_to_4_1_32 __P((void *, natstat_4_1_32_t *)); -static void nat_current_to_4_1_3 __P((void *, nat_4_1_3_t *)); -static void nat_current_to_4_1_14 __P((void *, nat_4_1_14_t *)); -static void nat_current_to_4_1_25 __P((void *, nat_4_1_25_t *)); - -static void friostat_4_1_0_to_current __P((friostat_4_1_0_t *, void *)); -static void friostat_4_1_33_to_current __P((friostat_4_1_33_t *, void *)); -static void ipnat_4_1_0_to_current __P((ipnat_4_1_0_t *, void *, int)); -static void ipnat_4_1_14_to_current __P((ipnat_4_1_14_t *, void *, int)); -static void frauth_4_1_11_to_current __P((frauth_4_1_11_t *, void *)); -static void frauth_4_1_23_to_current __P((frauth_4_1_23_t *, void *)); -static void frauth_4_1_24_to_current __P((frauth_4_1_24_t *, void *)); -static void frauth_4_1_29_to_current __P((frauth_4_1_29_t *, void *)); -static void frauth_4_1_32_to_current __P((frauth_4_1_32_t *, void *)); -static void frentry_4_1_0_to_current __P((ipf_main_softc_t *, frentry_4_1_0_t *, void *, int)); -static void frentry_4_1_16_to_current __P((ipf_main_softc_t *, frentry_4_1_16_t *, void *, int)); -static void frentry_4_1_34_to_current __P((ipf_main_softc_t *, frentry_4_1_34_t *, void *, int)); -static void fr_info_4_1_11_to_current __P((fr_info_4_1_11_t *, void *)); -static void fr_info_4_1_23_to_current __P((fr_info_4_1_23_t *, void *)); -static void fr_info_4_1_24_to_current __P((fr_info_4_1_24_t *, void *)); -static void fr_info_4_1_32_to_current __P((fr_info_4_1_32_t *, void *)); -static void nat_save_4_1_3_to_current __P((ipf_main_softc_t *, nat_save_4_1_3_t *, void *)); -static void nat_save_4_1_14_to_current __P((ipf_main_softc_t *, nat_save_4_1_14_t *, void *)); -static void nat_save_4_1_16_to_current __P((ipf_main_softc_t *, nat_save_4_1_16_t *, void *)); +static int ipf_addfrstr(char *, int, char *, int); +static void ipf_v4iptov5(frip4_t *, fr_ip_t *); +static void ipf_v5iptov4(fr_ip_t *, frip4_t *); +static void ipfv4tuctov5(frtuc4_t *, frtuc_t *); +static void ipfv5tuctov4(frtuc_t *, frtuc4_t *); +static int ipf_v4fripftov5(fripf4_t *, char *); +static void ipf_v5fripftov4(fripf_t *, fripf4_t *); +static int fr_frflags4to5(u_32_t); +static int fr_frflags5to4(u_32_t); + +static void friostat_current_to_4_1_0(void *, friostat_4_1_0_t *, int); +static void friostat_current_to_4_1_33(void *, friostat_4_1_33_t *, int); +static void ipstate_current_to_4_1_0(void *, ipstate_4_1_0_t *); +static void ipstate_current_to_4_1_16(void *, ipstate_4_1_16_t *); +static void ipnat_current_to_4_1_0(void *, ipnat_4_1_0_t *); +static void ipnat_current_to_4_1_14(void *, ipnat_4_1_14_t *); +static void frauth_current_to_4_1_11(void *, frauth_4_1_11_t *); +static void frauth_current_to_4_1_23(void *, frauth_4_1_23_t *); +static void frauth_current_to_4_1_24(void *, frauth_4_1_24_t *); +static void frauth_current_to_4_1_29(void *, frauth_4_1_29_t *); +static void frentry_current_to_4_1_0(void *, frentry_4_1_0_t *); +static void frentry_current_to_4_1_16(void *, frentry_4_1_16_t *); +static void frentry_current_to_4_1_34(void *, frentry_4_1_34_t *); +static void fr_info_current_to_4_1_11(void *, fr_info_4_1_11_t *); +static void fr_info_current_to_4_1_23(void *, fr_info_4_1_23_t *); +static void fr_info_current_to_4_1_24(void *, fr_info_4_1_24_t *); +static void nat_save_current_to_4_1_3(void *, nat_save_4_1_3_t *); +static void nat_save_current_to_4_1_14(void *, nat_save_4_1_14_t *); +static void nat_save_current_to_4_1_16(void *, nat_save_4_1_16_t *); +static void ipstate_save_current_to_4_1_0(void *, ipstate_save_4_1_0_t *); +static void ipstate_save_current_to_4_1_16(void *, ipstate_save_4_1_16_t *); +static void ips_stat_current_to_4_1_0(void *, ips_stat_4_1_0_t *); +static void ips_stat_current_to_4_1_21(void *, ips_stat_4_1_21_t *); +static void natstat_current_to_4_1_0(void *, natstat_4_1_0_t *); +static void natstat_current_to_4_1_16(void *, natstat_4_1_16_t *); +static void natstat_current_to_4_1_27(void *, natstat_4_1_27_t *); +static void natstat_current_to_4_1_32(void *, natstat_4_1_32_t *); +static void nat_current_to_4_1_3(void *, nat_4_1_3_t *); +static void nat_current_to_4_1_14(void *, nat_4_1_14_t *); +static void nat_current_to_4_1_25(void *, nat_4_1_25_t *); + +static void friostat_4_1_0_to_current(friostat_4_1_0_t *, void *); +static void friostat_4_1_33_to_current(friostat_4_1_33_t *, void *); +static void ipnat_4_1_0_to_current(ipnat_4_1_0_t *, void *, int); +static void ipnat_4_1_14_to_current(ipnat_4_1_14_t *, void *, int); +static void frauth_4_1_11_to_current(frauth_4_1_11_t *, void *); +static void frauth_4_1_23_to_current(frauth_4_1_23_t *, void *); +static void frauth_4_1_24_to_current(frauth_4_1_24_t *, void *); +static void frauth_4_1_29_to_current(frauth_4_1_29_t *, void *); +static void frauth_4_1_32_to_current(frauth_4_1_32_t *, void *); +static void frentry_4_1_0_to_current(ipf_main_softc_t *, frentry_4_1_0_t *, void *, int); +static void frentry_4_1_16_to_current(ipf_main_softc_t *, frentry_4_1_16_t *, void *, int); +static void frentry_4_1_34_to_current(ipf_main_softc_t *, frentry_4_1_34_t *, void *, int); +static void fr_info_4_1_11_to_current(fr_info_4_1_11_t *, void *); +static void fr_info_4_1_23_to_current(fr_info_4_1_23_t *, void *); +static void fr_info_4_1_24_to_current(fr_info_4_1_24_t *, void *); +static void fr_info_4_1_32_to_current(fr_info_4_1_32_t *, void *); +static void nat_save_4_1_3_to_current(ipf_main_softc_t *, nat_save_4_1_3_t *, void *); +static void nat_save_4_1_14_to_current(ipf_main_softc_t *, nat_save_4_1_14_t *, void *); +static void nat_save_4_1_16_to_current(ipf_main_softc_t *, nat_save_4_1_16_t *, void *); /* ------------------------------------------------------------------------ */ /* In this section is a series of short routines that deal with translating */ diff --git a/contrib/ipfilter/ip_msnrpc_pxy.c b/contrib/ipfilter/ip_msnrpc_pxy.c index 40bc084cbb5d..9cddd398edde 100644 --- a/contrib/ipfilter/ip_msnrpc_pxy.c +++ b/contrib/ipfilter/ip_msnrpc_pxy.c @@ -33,12 +33,12 @@ typedef struct msnrpchdr { u_char mrh_ans; } msnrpchdr_t; -int ippr_msnrpc_init __P((void)); -void ippr_msnrpc_fini __P((void)); -int ippr_msnrpc_new __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_out __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_in __P((fr_info_t *, ap_session_t *, nat_t *)); -int ippr_msnrpc_check __P((ip_t *, msnrpchdr_t *)); +int ippr_msnrpc_init(void); +void ippr_msnrpc_fini(void); +int ippr_msnrpc_new(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_out(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_in(fr_info_t *, ap_session_t *, nat_t *); +int ippr_msnrpc_check(ip_t *, msnrpchdr_t *); static frentry_t msnfr; diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h index 834ba83f51f0..c7f7308a9ba9 100644 --- a/contrib/ipfilter/ipf.h +++ b/contrib/ipfilter/ipf.h @@ -175,12 +175,12 @@ typedef struct proxyrule { #if defined(__NetBSD__) || defined(__FreeBSD_version) || \ SOLARIS # include -typedef int (* ioctlfunc_t) __P((int, ioctlcmd_t, ...)); +typedef int (* ioctlfunc_t)(int, ioctlcmd_t, ...); #else -typedef int (* ioctlfunc_t) __P((dev_t, ioctlcmd_t, void *)); +typedef int (* ioctlfunc_t)(dev_t, ioctlcmd_t, void *); #endif -typedef int (* addfunc_t) __P((int, ioctlfunc_t, void *)); -typedef int (* copyfunc_t) __P((void *, void *, size_t)); +typedef int (* addfunc_t)(int, ioctlfunc_t, void *); +typedef int (* copyfunc_t)(void *, void *, size_t); extern char thishost[MAXHOSTNAMELEN]; @@ -200,178 +200,178 @@ extern wordtab_t natfields[]; extern wordtab_t poolfields[]; -extern int addicmp __P((char ***, struct frentry *, int)); -extern int addipopt __P((char *, struct ipopt_names *, int, char *)); -extern int addkeep __P((char ***, struct frentry *, int)); -extern alist_t *alist_new __P((int, char *)); -extern void alist_free __P((alist_t *)); -extern void assigndefined __P((char *)); -extern void binprint __P((void *, size_t)); -extern u_32_t buildopts __P((char *, char *, int)); -extern int checkrev __P((char *)); -extern int connecttcp __P((char *, int)); -extern int count6bits __P((u_32_t *)); -extern int count4bits __P((u_32_t)); -extern char *fac_toname __P((int)); -extern int fac_findname __P((char *)); -extern const char *familyname __P((const int)); -extern void fill6bits __P((int, u_int *)); -extern wordtab_t *findword __P((wordtab_t *, char *)); -extern int ftov __P((int)); -extern char *ipf_geterror __P((int, ioctlfunc_t *)); -extern int genmask __P((int, char *, i6addr_t *)); -extern int gethost __P((int, char *, i6addr_t *)); -extern int geticmptype __P((int, char *)); -extern int getport __P((struct frentry *, char *, u_short *, char *)); -extern int getportproto __P((char *, int)); -extern int getproto __P((char *)); -extern char *getnattype __P((struct nat *)); -extern char *getsumd __P((u_32_t)); -extern u_32_t getoptbyname __P((char *)); -extern u_32_t getoptbyvalue __P((int)); -extern u_32_t getv6optbyname __P((char *)); -extern u_32_t getv6optbyvalue __P((int)); -extern char *icmptypename __P((int, int)); -extern void initparse __P((void)); -extern void ipf_dotuning __P((int, char *, ioctlfunc_t)); -extern int ipf_addrule __P((int, ioctlfunc_t, void *)); -extern void ipf_mutex_clean __P((void)); -extern int ipf_parsefile __P((int, addfunc_t, ioctlfunc_t *, char *)); -extern int ipf_parsesome __P((int, addfunc_t, ioctlfunc_t *, FILE *)); -extern void ipf_perror __P((int, char *)); -extern int ipf_perror_fd __P(( int, ioctlfunc_t, char *)); -extern void ipf_rwlock_clean __P((void)); -extern char *ipf_strerror __P((int)); -extern void ipferror __P((int, char *)); -extern int ipmon_parsefile __P((char *)); -extern int ipmon_parsesome __P((FILE *)); -extern int ipnat_addrule __P((int, ioctlfunc_t, void *)); -extern int ipnat_parsefile __P((int, addfunc_t, ioctlfunc_t, char *)); -extern int ipnat_parsesome __P((int, addfunc_t, ioctlfunc_t, FILE *)); -extern int ippool_parsefile __P((int, char *, ioctlfunc_t)); -extern int ippool_parsesome __P((int, FILE *, ioctlfunc_t)); -extern int kmemcpywrap __P((void *, void *, size_t)); -extern char *kvatoname __P((ipfunc_t, ioctlfunc_t)); -extern int load_dstlist __P((struct ippool_dst *, ioctlfunc_t, - ipf_dstnode_t *)); -extern int load_dstlistnode __P((int, char *, struct ipf_dstnode *, - ioctlfunc_t)); -extern alist_t *load_file __P((char *)); -extern int load_hash __P((struct iphtable_s *, struct iphtent_s *, - ioctlfunc_t)); -extern int load_hashnode __P((int, char *, struct iphtent_s *, int, - ioctlfunc_t)); -extern alist_t *load_http __P((char *)); -extern int load_pool __P((struct ip_pool_s *list, ioctlfunc_t)); -extern int load_poolnode __P((int, char *, ip_pool_node_t *, int, ioctlfunc_t)); -extern alist_t *load_url __P((char *)); -extern alist_t *make_range __P((int, struct in_addr, struct in_addr)); -extern void mb_hexdump __P((mb_t *, FILE *)); -extern ipfunc_t nametokva __P((char *, ioctlfunc_t)); -extern void nat_setgroupmap __P((struct ipnat *)); -extern int ntomask __P((int, int, u_32_t *)); -extern u_32_t optname __P((char ***, u_short *, int)); -extern wordtab_t *parsefields __P((wordtab_t *, char *)); -extern int *parseipfexpr __P((char *, char **)); -extern int parsewhoisline __P((char *, addrfamily_t *, addrfamily_t *)); -extern void pool_close __P((void)); -extern int pool_fd __P((void)); -extern int pool_ioctl __P((ioctlfunc_t, ioctlcmd_t, void *)); -extern int pool_open __P((void)); -extern char *portname __P((int, int)); -extern int pri_findname __P((char *)); -extern char *pri_toname __P((int)); -extern void print_toif __P((int, char *, char *, struct frdest *)); -extern void printaps __P((ap_session_t *, int, int)); -extern void printaddr __P((int, int, char *, int, u_32_t *, u_32_t *)); -extern void printbuf __P((char *, int, int)); -extern void printfieldhdr __P((wordtab_t *, wordtab_t *)); -extern void printfr __P((struct frentry *, ioctlfunc_t)); -extern struct iphtable_s *printhash __P((struct iphtable_s *, copyfunc_t, - char *, int, wordtab_t *)); -extern struct iphtable_s *printhash_live __P((iphtable_t *, int, char *, - int, wordtab_t *)); -extern ippool_dst_t *printdstl_live __P((ippool_dst_t *, int, char *, - int, wordtab_t *)); -extern void printhashdata __P((iphtable_t *, int)); -extern struct iphtent_s *printhashnode __P((struct iphtable_s *, +extern int addicmp(char ***, struct frentry *, int); +extern int addipopt(char *, struct ipopt_names *, int, char *); +extern int addkeep(char ***, struct frentry *, int); +extern alist_t *alist_new(int, char *); +extern void alist_free(alist_t *); +extern void assigndefined(char *); +extern void binprint(void *, size_t); +extern u_32_t buildopts(char *, char *, int); +extern int checkrev(char *); +extern int connecttcp(char *, int); +extern int count6bits(u_32_t *); +extern int count4bits(u_32_t); +extern char *fac_toname(int); +extern int fac_findname(char *); +extern const char *familyname(const int); +extern void fill6bits(int, u_int *); +extern wordtab_t *findword(wordtab_t *, char *); +extern int ftov(int); +extern char *ipf_geterror(int, ioctlfunc_t *); +extern int genmask(int, char *, i6addr_t *); +extern int gethost(int, char *, i6addr_t *); +extern int geticmptype(int, char *); +extern int getport(struct frentry *, char *, u_short *, char *); +extern int getportproto(char *, int); +extern int getproto(char *); +extern char *getnattype(struct nat *); +extern char *getsumd(u_32_t); +extern u_32_t getoptbyname(char *); +extern u_32_t getoptbyvalue(int); +extern u_32_t getv6optbyname(char *); +extern u_32_t getv6optbyvalue(int); +extern char *icmptypename(int, int); +extern void initparse(void); +extern void ipf_dotuning(int, char *, ioctlfunc_t); +extern int ipf_addrule(int, ioctlfunc_t, void *); +extern void ipf_mutex_clean(void); +extern int ipf_parsefile(int, addfunc_t, ioctlfunc_t *, char *); +extern int ipf_parsesome(int, addfunc_t, ioctlfunc_t *, FILE *); +extern void ipf_perror(int, char *); +extern int ipf_perror_fd( int, ioctlfunc_t, char *); +extern void ipf_rwlock_clean(void); +extern char *ipf_strerror(int); +extern void ipferror(int, char *); +extern int ipmon_parsefile(char *); +extern int ipmon_parsesome(FILE *); +extern int ipnat_addrule(int, ioctlfunc_t, void *); +extern int ipnat_parsefile(int, addfunc_t, ioctlfunc_t, char *); +extern int ipnat_parsesome(int, addfunc_t, ioctlfunc_t, FILE *); +extern int ippool_parsefile(int, char *, ioctlfunc_t); +extern int ippool_parsesome(int, FILE *, ioctlfunc_t); +extern int kmemcpywrap(void *, void *, size_t); +extern char *kvatoname(ipfunc_t, ioctlfunc_t); +extern int load_dstlist(struct ippool_dst *, ioctlfunc_t, + ipf_dstnode_t *); +extern int load_dstlistnode(int, char *, struct ipf_dstnode *, + ioctlfunc_t); +extern alist_t *load_file(char *); +extern int load_hash(struct iphtable_s *, struct iphtent_s *, + ioctlfunc_t); +extern int load_hashnode(int, char *, struct iphtent_s *, int, + ioctlfunc_t); +extern alist_t *load_http(char *); +extern int load_pool(struct ip_pool_s *list, ioctlfunc_t); +extern int load_poolnode(int, char *, ip_pool_node_t *, int, ioctlfunc_t); +extern alist_t *load_url(char *); +extern alist_t *make_range(int, struct in_addr, struct in_addr); +extern void mb_hexdump(mb_t *, FILE *); +extern ipfunc_t nametokva(char *, ioctlfunc_t); +extern void nat_setgroupmap(struct ipnat *); +extern int ntomask(int, int, u_32_t *); +extern u_32_t optname(char ***, u_short *, int); +extern wordtab_t *parsefields(wordtab_t *, char *); +extern int *parseipfexpr(char *, char **); +extern int parsewhoisline(char *, addrfamily_t *, addrfamily_t *); +extern void pool_close(void); +extern int pool_fd(void); +extern int pool_ioctl(ioctlfunc_t, ioctlcmd_t, void *); +extern int pool_open(void); +extern char *portname(int, int); +extern int pri_findname(char *); +extern char *pri_toname(int); +extern void print_toif(int, char *, char *, struct frdest *); +extern void printaps(ap_session_t *, int, int); +extern void printaddr(int, int, char *, int, u_32_t *, u_32_t *); +extern void printbuf(char *, int, int); +extern void printfieldhdr(wordtab_t *, wordtab_t *); +extern void printfr(struct frentry *, ioctlfunc_t); +extern struct iphtable_s *printhash(struct iphtable_s *, copyfunc_t, + char *, int, wordtab_t *); +extern struct iphtable_s *printhash_live(iphtable_t *, int, char *, + int, wordtab_t *); +extern ippool_dst_t *printdstl_live(ippool_dst_t *, int, char *, + int, wordtab_t *); +extern void printhashdata(iphtable_t *, int); +extern struct iphtent_s *printhashnode(struct iphtable_s *, struct iphtent_s *, - copyfunc_t, int, wordtab_t *)); -extern void printhost __P((int, u_32_t *)); -extern void printhostmask __P((int, u_32_t *, u_32_t *)); -extern void printip __P((int, u_32_t *)); -extern void printlog __P((struct frentry *)); -extern void printlookup __P((char *, i6addr_t *addr, i6addr_t *mask)); -extern void printmask __P((int, u_32_t *)); -extern void printnataddr __P((int, char *, nat_addr_t *, int)); -extern void printnatfield __P((nat_t *, int)); -extern void printnatside __P((char *, nat_stat_side_t *)); -extern void printpacket __P((int, mb_t *)); -extern void printpacket6 __P((int, mb_t *)); -extern struct ippool_dst *printdstlist __P((struct ippool_dst *, copyfunc_t, + copyfunc_t, int, wordtab_t *); +extern void printhost(int, u_32_t *); +extern void printhostmask(int, u_32_t *, u_32_t *); +extern void printip(int, u_32_t *); +extern void printlog(struct frentry *); +extern void printlookup(char *, i6addr_t *addr, i6addr_t *mask); +extern void printmask(int, u_32_t *); +extern void printnataddr(int, char *, nat_addr_t *, int); +extern void printnatfield(nat_t *, int); +extern void printnatside(char *, nat_stat_side_t *); +extern void printpacket(int, mb_t *); +extern void printpacket6(int, mb_t *); +extern struct ippool_dst *printdstlist(struct ippool_dst *, copyfunc_t, char *, int, ipf_dstnode_t *, - wordtab_t *)); -extern void printdstlistdata __P((ippool_dst_t *, int)); -extern ipf_dstnode_t *printdstlistnode __P((ipf_dstnode_t *, copyfunc_t, - int, wordtab_t *)); -extern void printdstlistpolicy __P((ippool_policy_t)); -extern struct ip_pool_s *printpool __P((struct ip_pool_s *, copyfunc_t, - char *, int, wordtab_t *)); -extern struct ip_pool_s *printpool_live __P((struct ip_pool_s *, int, - char *, int, wordtab_t *)); -extern void printpooldata __P((ip_pool_t *, int)); -extern void printpoolfield __P((void *, int, int)); -extern struct ip_pool_node *printpoolnode __P((struct ip_pool_node *, - int, wordtab_t *)); -extern void printproto __P((struct protoent *, int, struct ipnat *)); -extern void printportcmp __P((int, struct frpcmp *)); -extern void printstatefield __P((ipstate_t *, int)); -extern void printtqtable __P((ipftq_t *)); -extern void printtunable __P((ipftune_t *)); -extern void printunit __P((int)); -extern void optprint __P((u_short *, u_long, u_long)); + wordtab_t *); +extern void printdstlistdata(ippool_dst_t *, int); +extern ipf_dstnode_t *printdstlistnode(ipf_dstnode_t *, copyfunc_t, + int, wordtab_t *); +extern void printdstlistpolicy(ippool_policy_t); +extern struct ip_pool_s *printpool(struct ip_pool_s *, copyfunc_t, + char *, int, wordtab_t *); +extern struct ip_pool_s *printpool_live(struct ip_pool_s *, int, + char *, int, wordtab_t *); +extern void printpooldata(ip_pool_t *, int); +extern void printpoolfield(void *, int, int); +extern struct ip_pool_node *printpoolnode(struct ip_pool_node *, + int, wordtab_t *); +extern void printproto(struct protoent *, int, struct ipnat *); +extern void printportcmp(int, struct frpcmp *); +extern void printstatefield(ipstate_t *, int); +extern void printtqtable(ipftq_t *); +extern void printtunable(ipftune_t *); +extern void printunit(int); +extern void optprint(u_short *, u_long, u_long); #ifdef USE_INET6 -extern void optprintv6 __P((u_short *, u_long, u_long)); +extern void optprintv6(u_short *, u_long, u_long); #endif -extern int remove_hash __P((struct iphtable_s *, ioctlfunc_t)); -extern int remove_hashnode __P((int, char *, struct iphtent_s *, ioctlfunc_t)); -extern int remove_pool __P((ip_pool_t *, ioctlfunc_t)); -extern int remove_poolnode __P((int, char *, ip_pool_node_t *, ioctlfunc_t)); -extern u_char tcpflags __P((char *)); -extern void printc __P((struct frentry *)); -extern void printC __P((int)); -extern void emit __P((int, int, void *, struct frentry *)); -extern u_char secbit __P((int)); -extern u_char seclevel __P((char *)); -extern void printfraginfo __P((char *, struct ipfr *)); -extern void printifname __P((char *, char *, void *)); -extern char *hostname __P((int, void *)); -extern struct ipstate *printstate __P((struct ipstate *, int, u_long)); -extern void printsbuf __P((char *)); -extern void printnat __P((struct ipnat *, int)); -extern void printactiveaddress __P((int, char *, i6addr_t *, char *)); -extern void printactivenat __P((struct nat *, int, u_long)); -extern void printhostmap __P((struct hostmap *, u_int)); -extern void printtcpflags __P((u_32_t, u_32_t)); -extern void printipfexpr __P((int *)); -extern void printstatefield __P((ipstate_t *, int)); -extern void printstatefieldhdr __P((int)); -extern int sendtrap_v1_0 __P((int, char *, char *, int, time_t)); -extern int sendtrap_v2_0 __P((int, char *, char *, int)); -extern int vtof __P((int)); - -extern void set_variable __P((char *, char *)); -extern char *get_variable __P((char *, char **, int)); -extern void resetlexer __P((void)); - -extern void debug __P((int, char *, ...)); -extern void verbose __P((int, char *, ...)); -extern void ipfkdebug __P((char *, ...)); -extern void ipfkverbose __P((char *, ...)); +extern int remove_hash(struct iphtable_s *, ioctlfunc_t); +extern int remove_hashnode(int, char *, struct iphtent_s *, ioctlfunc_t); +extern int remove_pool(ip_pool_t *, ioctlfunc_t); +extern int remove_poolnode(int, char *, ip_pool_node_t *, ioctlfunc_t); +extern u_char tcpflags(char *); +extern void printc(struct frentry *); +extern void printC(int); +extern void emit(int, int, void *, struct frentry *); +extern u_char secbit(int); +extern u_char seclevel(char *); +extern void printfraginfo(char *, struct ipfr *); +extern void printifname(char *, char *, void *); +extern char *hostname(int, void *); +extern struct ipstate *printstate(struct ipstate *, int, u_long); +extern void printsbuf(char *); +extern void printnat(struct ipnat *, int); +extern void printactiveaddress(int, char *, i6addr_t *, char *); +extern void printactivenat(struct nat *, int, u_long); +extern void printhostmap(struct hostmap *, u_int); +extern void printtcpflags(u_32_t, u_32_t); +extern void printipfexpr(int *); +extern void printstatefield(ipstate_t *, int); +extern void printstatefieldhdr(int); +extern int sendtrap_v1_0(int, char *, char *, int, time_t); +extern int sendtrap_v2_0(int, char *, char *, int); +extern int vtof(int); + +extern void set_variable(char *, char *); +extern char *get_variable(char *, char **, int); +extern void resetlexer(void); + +extern void debug(int, char *, ...); +extern void verbose(int, char *, ...); +extern void ipfkdebug(char *, ...); +extern void ipfkverbose(char *, ...); #if SOLARIS -extern int gethostname __P((char *, int )); -extern void sync __P((void)); +extern int gethostname(char *, int ); +extern void sync(void); #endif #endif /* __IPF_H__ */ diff --git a/contrib/ipfilter/iplang/iplang.h b/contrib/ipfilter/iplang/iplang.h index 63cc078322a3..f38ef9671701 100644 --- a/contrib/ipfilter/iplang/iplang.h +++ b/contrib/ipfilter/iplang/iplang.h @@ -50,5 +50,5 @@ typedef struct aniphdr { #define ah_udp ah_un.ahu_udp #define ah_icmp ah_un.ahu_icmp -extern int get_arpipv4 __P((char *, char *)); +extern int get_arpipv4(char *, char *); diff --git a/contrib/ipfilter/iplang/iplang_l.l b/contrib/ipfilter/iplang/iplang_l.l index e66867e2a455..f8b1b82d4707 100644 --- a/contrib/ipfilter/iplang/iplang_l.l +++ b/contrib/ipfilter/iplang/iplang_l.l @@ -29,14 +29,14 @@ extern int opts; int lineNum = 0, ipproto = 0, oldipproto = 0, next = -1, laststate = 0; int *prstack = NULL, numpr = 0, state = 0, token = 0; -void yyerror __P((char *)); -void push_proto __P((void)); -void pop_proto __P((void)); -int next_state __P((int, int)); -int next_item __P((int)); -int save_token __P((void)); -void swallow __P((void)); -int yylex __P((void)); +void yyerror(char *); +void push_proto(void); +void pop_proto(void); +int next_state(int, int); +int next_item(int); +int save_token(void); +void swallow(void); +int yylex(void); struct lwordtab { char *word; diff --git a/contrib/ipfilter/iplang/iplang_y.y b/contrib/ipfilter/iplang/iplang_y.y index b4570d390530..f3335636cee1 100644 --- a/contrib/ipfilter/iplang/iplang_y.y +++ b/contrib/ipfilter/iplang/iplang_y.y @@ -59,8 +59,8 @@ arp_t *arplist = NULL, **arptail = &arplist, *carp = NULL; struct in_addr defrouter; send_t sending; char *sclass = NULL; -u_short c_chksum __P((u_short *, u_int, u_long)); -u_long p_chksum __P((u_short *, u_int)); +u_short c_chksum(u_short *, u_int, u_long); +u_long p_chksum(u_short *, u_int); u_long ipbuffer[67584/sizeof(u_long)]; /* 66K */ aniphdr_t *aniphead = NULL, *canip = NULL, **aniptail = &aniphead; @@ -74,85 +74,85 @@ struct statetoopt { int sto_op; }; -struct in_addr getipv4addr __P((char *arg)); -u_short getportnum __P((char *, char *)); -struct ether_addr *geteaddr __P((char *, struct ether_addr *)); -void *new_header __P((int)); -void free_aniplist __P((void)); -void inc_anipheaders __P((int)); -void new_data __P((void)); -void set_datalen __P((char **)); -void set_datafile __P((char **)); -void set_data __P((char **)); -void new_packet __P((void)); -void set_ipv4proto __P((char **)); -void set_ipv4src __P((char **)); -void set_ipv4dst __P((char **)); -void set_ipv4off __P((char **)); -void set_ipv4v __P((char **)); -void set_ipv4hl __P((char **)); -void set_ipv4ttl __P((char **)); -void set_ipv4tos __P((char **)); -void set_ipv4id __P((char **)); -void set_ipv4sum __P((char **)); -void set_ipv4len __P((char **)); -void new_tcpheader __P((void)); -void set_tcpsport __P((char **)); -void set_tcpdport __P((char **)); -void set_tcpseq __P((char **)); -void set_tcpack __P((char **)); -void set_tcpoff __P((char **)); -void set_tcpurp __P((char **)); -void set_tcpwin __P((char **)); -void set_tcpsum __P((char **)); -void set_tcpflags __P((char **)); -void set_tcpopt __P((int, char **)); -void end_tcpopt __P((void)); -void new_udpheader __P((void)); -void set_udplen __P((char **)); -void set_udpsum __P((char **)); -void prep_packet __P((void)); -void packet_done __P((void)); -void new_interface __P((void)); -void check_interface __P((void)); -void set_ifname __P((char **)); -void set_ifmtu __P((int)); -void set_ifv4addr __P((char **)); -void set_ifeaddr __P((char **)); -void new_arp __P((void)); -void set_arpeaddr __P((char **)); -void set_arpv4addr __P((char **)); -void reset_send __P((void)); -void set_sendif __P((char **)); -void set_sendvia __P((char **)); -void set_defaultrouter __P((char **)); -void new_icmpheader __P((void)); -void set_icmpcode __P((int)); -void set_icmptype __P((int)); -void set_icmpcodetok __P((char **)); -void set_icmptypetok __P((char **)); -void set_icmpid __P((int)); -void set_icmpseq __P((int)); -void set_icmpotime __P((int)); -void set_icmprtime __P((int)); -void set_icmpttime __P((int)); -void set_icmpmtu __P((int)); -void set_redir __P((int, char **)); -void new_ipv4opt __P((void)); -void set_icmppprob __P((int)); -void add_ipopt __P((int, void *)); -void end_ipopt __P((void)); -void set_secclass __P((char **)); -void free_anipheader __P((void)); -void end_ipv4 __P((void)); -void end_icmp __P((void)); -void end_udp __P((void)); -void end_tcp __P((void)); -void end_data __P((void)); -void yyerror __P((char *)); -void iplang __P((FILE *)); -int arp_getipv4 __P((char *, char *)); -int yyparse __P((void)); +struct in_addr getipv4addr(char *arg); +u_short getportnum(char *, char *); +struct ether_addr *geteaddr(char *, struct ether_addr *); +void *new_header(int); +void free_aniplist(void); +void inc_anipheaders(int); +void new_data(void); +void set_datalen(char **); +void set_datafile(char **); +void set_data(char **); +void new_packet(void); +void set_ipv4proto(char **); +void set_ipv4src(char **); +void set_ipv4dst(char **); +void set_ipv4off(char **); +void set_ipv4v(char **); +void set_ipv4hl(char **); +void set_ipv4ttl(char **); +void set_ipv4tos(char **); +void set_ipv4id(char **); +void set_ipv4sum(char **); +void set_ipv4len(char **); +void new_tcpheader(void); +void set_tcpsport(char **); +void set_tcpdport(char **); +void set_tcpseq(char **); +void set_tcpack(char **); +void set_tcpoff(char **); +void set_tcpurp(char **); +void set_tcpwin(char **); +void set_tcpsum(char **); +void set_tcpflags(char **); +void set_tcpopt(int, char **); +void end_tcpopt(void); +void new_udpheader(void); +void set_udplen(char **); +void set_udpsum(char **); +void prep_packet(void); +void packet_done(void); +void new_interface(void); +void check_interface(void); +void set_ifname(char **); +void set_ifmtu(int); +void set_ifv4addr(char **); +void set_ifeaddr(char **); +void new_arp(void); +void set_arpeaddr(char **); +void set_arpv4addr(char **); +void reset_send(void); +void set_sendif(char **); +void set_sendvia(char **); +void set_defaultrouter(char **); +void new_icmpheader(void); +void set_icmpcode(int); +void set_icmptype(int); +void set_icmpcodetok(char **); +void set_icmptypetok(char **); +void set_icmpid(int); +void set_icmpseq(int); +void set_icmpotime(int); +void set_icmprtime(int); +void set_icmpttime(int); +void set_icmpmtu(int); +void set_redir(int, char **); +void new_ipv4opt(void); +void set_icmppprob(int); +void add_ipopt(int, void *); +void end_ipopt(void); +void set_secclass(char **); *** 4114 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Feb 2 01:19: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 856AA4F8D45; Tue, 2 Feb 2021 01:19: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 4DV6RF3PHBz3ng7; Tue, 2 Feb 2021 01:19: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 6743525276; Tue, 2 Feb 2021 01:19: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 1121JL6V079541; Tue, 2 Feb 2021 01:19:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1121JL4e079540; Tue, 2 Feb 2021 01:19:21 GMT (envelope-from git) Date: Tue, 2 Feb 2021 01:19:21 GMT Message-Id: <202102020119.1121JL4e079540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 7071734fae60 - main - Indentation cleanup resulting from the cleanup of #ifdefs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7071734fae6019d1e3e44daf7deb4478582081cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:19:21 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=7071734fae6019d1e3e44daf7deb4478582081cc commit 7071734fae6019d1e3e44daf7deb4478582081cc Author: Cy Schubert AuthorDate: 2021-01-27 15:25:00 +0000 Commit: Cy Schubert CommitDate: 2021-02-02 01:19:15 +0000 Indentation cleanup resulting from the cleanup of #ifdefs. The conscious decision was made not to perform any indentation or whitespace cleanup while cleaning out old redunant #ifdefs. The reason for this was to avoid confusing future readers of history and diffs with cosmetic changes, making bisection of any possible bugs introduced more difficult. This commit cleans up the whitespace detritus left behind from the previous #ifdef cleanup commits. MFC after: 1 week --- sys/contrib/ipfilter/netinet/fil.c | 12 +- sys/contrib/ipfilter/netinet/ip_auth.c | 18 +- sys/contrib/ipfilter/netinet/ip_compat.h | 282 +++++++++++++------------- sys/contrib/ipfilter/netinet/ip_dstlist.c | 2 +- sys/contrib/ipfilter/netinet/ip_fil.h | 94 ++++----- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 21 +- sys/contrib/ipfilter/netinet/ip_pool.c | 2 +- 7 files changed, 215 insertions(+), 216 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index 7402437d98c7..a79d441284bf 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -48,7 +48,7 @@ #if !defined(__SVR4) # include #else -# include +# include # if (SOLARIS2 < 5) && defined(sun) # include # endif @@ -4117,11 +4117,11 @@ ipf_sync(softc, ifp) { int i; -# if !SOLARIS +#if !SOLARIS ipf_nat_sync(softc, ifp); ipf_state_sync(softc, ifp); ipf_lookup_sync(softc, ifp); -# endif +#endif WRITE_ENTER(&softc->ipf_mutex); (void) ipf_synclist(softc, softc->ipf_acct[0][softc->ipf_active], ifp); @@ -4168,13 +4168,13 @@ copyinptr(softc, src, dst, size) caddr_t ca; int error; -# if SOLARIS +#if SOLARIS error = COPYIN(src, &ca, sizeof(ca)); if (error != 0) return error; -# else +#else bcopy(src, (caddr_t)&ca, sizeof(ca)); -# endif +#endif error = COPYIN(ca, dst, size); if (error != 0) { IPFERROR(3); diff --git a/sys/contrib/ipfilter/netinet/ip_auth.c b/sys/contrib/ipfilter/netinet/ip_auth.c index 18b8f3a65641..4864a8128494 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.c +++ b/sys/contrib/ipfilter/netinet/ip_auth.c @@ -81,13 +81,13 @@ # undef KERNEL #endif #include -# if defined(__FreeBSD_version) -# include -# define IF_QFULL _IF_QFULL -# define IF_DROP _IF_DROP -# endif -# include -# include +#if defined(__FreeBSD_version) +# include +# define IF_QFULL _IF_QFULL +# define IF_DROP _IF_DROP +#endif +#include +#include #include #include #include "netinet/ip_compat.h" @@ -298,9 +298,9 @@ ipf_auth_soft_destroy(softc, arg) { ipf_auth_softc_t *softa = arg; -# if SOLARIS && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) cv_destroy(&softa->ipf_auth_wait); -# endif +#endif MUTEX_DESTROY(&softa->ipf_auth_mx); RW_DESTROY(&softa->ipf_authlk); diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 4394b732e10c..756731480836 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -56,16 +56,16 @@ /* * This is a workaround for troubles on FreeBSD and OpenBSD. */ -# ifndef _KERNEL -# define ADD_KERNEL -# define _KERNEL -# define KERNEL -# endif -# include -# ifdef ADD_KERNEL -# undef _KERNEL -# undef KERNEL -# endif +#ifndef _KERNEL +# define ADD_KERNEL +# define _KERNEL +# define KERNEL +#endif +#include +#ifdef ADD_KERNEL +# undef _KERNEL +# undef KERNEL +#endif #define NETBSD_GE_REV(x) (defined(__NetBSD_Version__) && \ (__NetBSD_Version__ >= (x))) @@ -78,108 +78,108 @@ /* ----------------------------------------------------------------------- */ /* F R E E B S D */ /* ----------------------------------------------------------------------- */ -# define HAS_SYS_MD5_H 1 -# if defined(_KERNEL) -# include "opt_bpf.h" -# include "opt_inet6.h" -# if defined(INET6) && !defined(USE_INET6) -# define USE_INET6 -# endif -# else -# if !defined(USE_INET6) && !defined(NOINET6) -# define USE_INET6 -# endif +#define HAS_SYS_MD5_H 1 +#if defined(_KERNEL) +# include "opt_bpf.h" +# include "opt_inet6.h" +# if defined(INET6) && !defined(USE_INET6) +# define USE_INET6 # endif +#else +# if !defined(USE_INET6) && !defined(NOINET6) +# define USE_INET6 +# endif +#endif -# if defined(_KERNEL) -# include -# define p_cred td_ucred -# define p_uid td_ucred->cr_ruid +#if defined(_KERNEL) +# include +# define p_cred td_ucred +# define p_uid td_ucred->cr_ruid /* * When #define'd, the 5.2.1 kernel panics when used with the ftp proxy. * There may be other, safe, kernels but this is not extensively tested yet. */ -# define HAVE_M_PULLDOWN -# if !defined(IPFILTER_LKM) && defined(__FreeBSD_version) -# include "opt_ipfilter.h" -# endif -# define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) -# define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) +# define HAVE_M_PULLDOWN +# if !defined(IPFILTER_LKM) && defined(__FreeBSD_version) +# include "opt_ipfilter.h" +# endif +# define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) +# define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) -# else -# include -# endif /* _KERNEL */ +#else +# include +#endif /* _KERNEL */ -# include -# include -# include -# include -# define KRWLOCK_FILL_SZ 56 -# define KMUTEX_FILL_SZ 56 -# include -# define KMUTEX_T struct mtx -# define KRWLOCK_T struct rwlock +#include +#include +#include +#include +#define KRWLOCK_FILL_SZ 56 +#define KMUTEX_FILL_SZ 56 +#include +#define KMUTEX_T struct mtx +#define KRWLOCK_T struct rwlock #ifdef _KERNEL -# define READ_ENTER(x) rw_rlock(&(x)->ipf_lk) -# define WRITE_ENTER(x) rw_wlock(&(x)->ipf_lk) -# define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk) -# define MUTEX_TRY_UPGRADE(x) rw_try_upgrade(&(x)->ipf_lk) -# define RWLOCK_INIT(x,y) rw_init(&(x)->ipf_lk, (y)) -# define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk) -# define RWLOCK_EXIT(x) do { \ +# define READ_ENTER(x) rw_rlock(&(x)->ipf_lk) +# define WRITE_ENTER(x) rw_wlock(&(x)->ipf_lk) +# define MUTEX_DOWNGRADE(x) rw_downgrade(&(x)->ipf_lk) +# define MUTEX_TRY_UPGRADE(x) rw_try_upgrade(&(x)->ipf_lk) +# define RWLOCK_INIT(x,y) rw_init(&(x)->ipf_lk, (y)) +# define RW_DESTROY(x) rw_destroy(&(x)->ipf_lk) +# define RWLOCK_EXIT(x) do { \ if (rw_wowned(&(x)->ipf_lk)) \ rw_wunlock(&(x)->ipf_lk); \ else \ rw_runlock(&(x)->ipf_lk); \ } while (0) -# include -# define GETKTIME(x) microtime((struct timeval *)x) -# define if_addrlist if_addrhead - -# include -# include -# include - -# define USE_MUTEXES -# define MUTEX_ENTER(x) mtx_lock(&(x)->ipf_lk) -# define MUTEX_EXIT(x) mtx_unlock(&(x)->ipf_lk) -# define MUTEX_INIT(x,y) mtx_init(&(x)->ipf_lk, (y), NULL,\ +# include +# define GETKTIME(x) microtime((struct timeval *)x) +# define if_addrlist if_addrhead + +# include +# include +# include + +# define USE_MUTEXES +# define MUTEX_ENTER(x) mtx_lock(&(x)->ipf_lk) +# define MUTEX_EXIT(x) mtx_unlock(&(x)->ipf_lk) +# define MUTEX_INIT(x,y) mtx_init(&(x)->ipf_lk, (y), NULL,\ MTX_DEF) -# define MUTEX_DESTROY(x) mtx_destroy(&(x)->ipf_lk) -# define MUTEX_NUKE(x) bzero((x), sizeof(*(x))) +# define MUTEX_DESTROY(x) mtx_destroy(&(x)->ipf_lk) +# define MUTEX_NUKE(x) bzero((x), sizeof(*(x))) /* * Whilst the sx(9) locks on FreeBSD have the right semantics and interface * for what we want to use them for, despite testing showing they work - * with a WITNESS kernel, it generates LOR messages. */ -# include -# define ATOMIC_INC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)++; \ +# include +# define ATOMIC_INC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)++; \ mtx_unlock(&softc->ipf_rw.ipf_lk); } -# define ATOMIC_DEC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)--; \ +# define ATOMIC_DEC(x) { mtx_lock(&softc->ipf_rw.ipf_lk); (x)--; \ mtx_unlock(&softc->ipf_rw.ipf_lk); } -# define ATOMIC_INCL(x) atomic_add_long(&(x), 1) -# define ATOMIC_INC64(x) ATOMIC_INC(x) -# define ATOMIC_INC32(x) atomic_add_32((u_int *)&(x), 1) -# define ATOMIC_DECL(x) atomic_add_long(&(x), -1) -# define ATOMIC_DEC64(x) ATOMIC_DEC(x) -# define ATOMIC_DEC32(x) atomic_add_32((u_int *)&(x), -1) -# define SPL_X(x) ; -# define SPL_NET(x) ; -# define SPL_IMP(x) ; -# define SPL_SCHED(x) ; -# define GET_MINOR dev2unit -# define MSGDSIZE(m) mbufchainlen(m) -# define M_LEN(m) (m)->m_len -# define M_ADJ(m,x) m_adj(m, x) -# define M_COPY(x) m_copym((x), 0, M_COPYALL, M_NOWAIT) -# define M_DUP(m) m_dup(m, M_NOWAIT) -# define IPF_PANIC(x,y) if (x) { printf y; panic("ipf_panic"); } +# define ATOMIC_INCL(x) atomic_add_long(&(x), 1) +# define ATOMIC_INC64(x) ATOMIC_INC(x) +# define ATOMIC_INC32(x) atomic_add_32((u_int *)&(x), 1) +# define ATOMIC_DECL(x) atomic_add_long(&(x), -1) +# define ATOMIC_DEC64(x) ATOMIC_DEC(x) +# define ATOMIC_DEC32(x) atomic_add_32((u_int *)&(x), -1) +# define SPL_X(x) ; +# define SPL_NET(x) ; +# define SPL_IMP(x) ; +# define SPL_SCHED(x) ; +# define GET_MINOR dev2unit +# define MSGDSIZE(m) mbufchainlen(m) +# define M_LEN(m) (m)->m_len +# define M_ADJ(m,x) m_adj(m, x) +# define M_COPY(x) m_copym((x), 0, M_COPYALL, M_NOWAIT) +# define M_DUP(m) m_dup(m, M_NOWAIT) +# define IPF_PANIC(x,y) if (x) { printf y; panic("ipf_panic"); } typedef struct mbuf mb_t; #else /* !_KERNEL */ -#ifndef _NET_IF_VAR_H_ +# ifndef _NET_IF_VAR_H_ /* * Userland emulation of struct ifnet. */ @@ -191,14 +191,14 @@ struct ifnet { int (*if_output)(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); }; -#endif /* _NET_IF_VAR_H_ */ +# endif /* _NET_IF_VAR_H_ */ #endif /* _KERNEL */ -# define IFNAME(x) ((struct ifnet *)x)->if_xname -# define COPYIFNAME(v, x, b) \ - (void) strncpy(b, \ - ((struct ifnet *)x)->if_xname, \ - LIFNAMSIZ) +#define IFNAME(x) ((struct ifnet *)x)->if_xname +#define COPYIFNAME(v, x, b) \ + (void) strncpy(b, \ + ((struct ifnet *)x)->if_xname, \ + LIFNAMSIZ) typedef u_long ioctlcmd_t; typedef struct uio uio_t; @@ -226,12 +226,12 @@ typedef u_int32_t u_32_t; * Userland locking primitives */ #ifndef _KERNEL -#if !defined(KMUTEX_FILL_SZ) -# define KMUTEX_FILL_SZ 1 -#endif -#if !defined(KRWLOCK_FILL_SZ) -# define KRWLOCK_FILL_SZ 1 -#endif +# if !defined(KMUTEX_FILL_SZ) +# define KMUTEX_FILL_SZ 1 +# endif +# if !defined(KRWLOCK_FILL_SZ) +# define KRWLOCK_FILL_SZ 1 +# endif #endif typedef struct { @@ -455,54 +455,54 @@ typedef struct ip6_hdr ip6_t; # define COPYDATA m_copydata # define COPYBACK m_copyback # endif -# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ - defined(__FreeBSD__) -# include -# endif -# if NETBSD_GE_REV(105180000) -# include -# else -# include +# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ + defined(__FreeBSD__) +# include +# endif +# if NETBSD_GE_REV(105180000) +# include +# else +# include extern vm_map_t kmem_map; -# endif -# include +# endif +# include -# ifdef IPFILTER_M_IPFILTER -# include +# ifdef IPFILTER_M_IPFILTER +# include MALLOC_DECLARE(M_IPFILTER); +# define _M_IPF M_IPFILTER +# else /* IPFILTER_M_IPFILTER */ +# ifdef M_PFIL +# define _M_IPF M_PFIL +# else +# ifdef M_IPFILTER # define _M_IPF M_IPFILTER -# else /* IPFILTER_M_IPFILTER */ -# ifdef M_PFIL -# define _M_IPF M_PFIL # else -# ifdef M_IPFILTER -# define _M_IPF M_IPFILTER -# else -# define _M_IPF M_TEMP -# endif /* M_IPFILTER */ -# endif /* M_PFIL */ -# endif /* IPFILTER_M_IPFILTER */ -# if !defined(KMALLOC) -# define KMALLOC(a, b) (a) = (b)malloc(sizeof(*(a)), _M_IPF, M_NOWAIT) -# endif -# if !defined(KMALLOCS) -# define KMALLOCS(a, b, c) (a) = (b)malloc((c), _M_IPF, M_NOWAIT) -# endif -# if !defined(KFREE) -# define KFREE(x) free((x), _M_IPF) -# endif -# if !defined(KFREES) +# define _M_IPF M_TEMP +# endif /* M_IPFILTER */ +# endif /* M_PFIL */ +# endif /* IPFILTER_M_IPFILTER */ +# if !defined(KMALLOC) +# define KMALLOC(a, b) (a) = (b)malloc(sizeof(*(a)), _M_IPF, M_NOWAIT) +# endif +# if !defined(KMALLOCS) +# define KMALLOCS(a, b, c) (a) = (b)malloc((c), _M_IPF, M_NOWAIT) +# endif +# if !defined(KFREE) +# define KFREE(x) free((x), _M_IPF) +# endif +# if !defined(KFREES) # define KFREES(x,s) free((x), _M_IPF) -# endif -# define UIOMOVE(a,b,c,d) uiomove((caddr_t)a,b,d) -# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0) -# define WAKEUP(id,x) wakeup(id+x) -# if !defined(POLLWAKEUP) -# define POLLWAKEUP(x) selwakeup(softc->ipf_selwait+x) -# endif -# define GETIFP(n, v) ifunit(n) -# define GETIFMTU_4(x) ((struct ifnet *)x)->if_mtu -# define GETIFMTU_6(x) ((struct ifnet *)x)->if_mtu +# endif +# define UIOMOVE(a,b,c,d) uiomove((caddr_t)a,b,d) +# define SLEEP(id, n) tsleep((id), PPAUSE|PCATCH, n, 0) +# define WAKEUP(id,x) wakeup(id+x) +# if !defined(POLLWAKEUP) +# define POLLWAKEUP(x) selwakeup(softc->ipf_selwait+x) +# endif +# define GETIFP(n, v) ifunit(n) +# define GETIFMTU_4(x) ((struct ifnet *)x)->if_mtu +# define GETIFMTU_6(x) ((struct ifnet *)x)->if_mtu # if !defined(USE_MUTEXES) && !defined(SPL_NET) # define SPL_IMP(x) x = splimp() @@ -804,8 +804,8 @@ typedef struct tcpiphdr tcpiphdr_t; #undef IPOPT_AH #define IPOPT_AH 256+IPPROTO_AH -# define ICMP_UNREACH_ADMIN_PROHIBIT ICMP_UNREACH_FILTER_PROHIB -# define ICMP_UNREACH_FILTER ICMP_UNREACH_FILTER_PROHIB +#define ICMP_UNREACH_ADMIN_PROHIBIT ICMP_UNREACH_FILTER_PROHIB +#define ICMP_UNREACH_FILTER ICMP_UNREACH_FILTER_PROHIB #ifndef IPVERSION # define IPVERSION 4 diff --git a/sys/contrib/ipfilter/netinet/ip_dstlist.c b/sys/contrib/ipfilter/netinet/ip_dstlist.c index 0c65e4cd6896..11e1a1846d89 100644 --- a/sys/contrib/ipfilter/netinet/ip_dstlist.c +++ b/sys/contrib/ipfilter/netinet/ip_dstlist.c @@ -27,7 +27,7 @@ # endif #endif #include -# include +#include #include #if defined(_KERNEL) && !defined(__SVR4) # include diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 3121e94f1488..0b5fc7285f93 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -11,7 +11,7 @@ #ifndef __IP_FIL_H__ #define __IP_FIL_H__ -# include +#include #include "netinet/ip_compat.h" #include "netinet/ipf_rb.h" @@ -19,7 +19,7 @@ # include #endif #if defined(BSD) && defined(_KERNEL) -# include +# include #endif #ifndef SOLARIS @@ -31,48 +31,48 @@ #endif #ifndef __P -# define __P(x) x +# define __P(x) x #endif -# define SIOCADAFR _IOW('r', 60, struct ipfobj) -# define SIOCRMAFR _IOW('r', 61, struct ipfobj) -# define SIOCSETFF _IOW('r', 62, u_int) -# define SIOCGETFF _IOR('r', 63, u_int) -# define SIOCGETFS _IOWR('r', 64, struct ipfobj) -# define SIOCIPFFL _IOWR('r', 65, int) -# define SIOCIPFFB _IOR('r', 66, int) -# define SIOCADIFR _IOW('r', 67, struct ipfobj) -# define SIOCRMIFR _IOW('r', 68, struct ipfobj) -# define SIOCSWAPA _IOR('r', 69, u_int) -# define SIOCINAFR _IOW('r', 70, struct ipfobj) -# define SIOCINIFR _IOW('r', 71, struct ipfobj) -# define SIOCFRENB _IOW('r', 72, u_int) -# define SIOCFRSYN _IOW('r', 73, u_int) -# define SIOCFRZST _IOWR('r', 74, struct ipfobj) -# define SIOCZRLST _IOWR('r', 75, struct ipfobj) -# define SIOCAUTHW _IOWR('r', 76, struct ipfobj) -# define SIOCAUTHR _IOWR('r', 77, struct ipfobj) -# define SIOCSTAT1 _IOWR('r', 78, struct ipfobj) -# define SIOCSTLCK _IOWR('r', 79, u_int) -# define SIOCSTPUT _IOWR('r', 80, struct ipfobj) -# define SIOCSTGET _IOWR('r', 81, struct ipfobj) -# define SIOCSTGSZ _IOWR('r', 82, struct ipfobj) -# define SIOCSTAT2 _IOWR('r', 83, struct ipfobj) -# define SIOCSETLG _IOWR('r', 84, int) -# define SIOCGETLG _IOWR('r', 85, int) -# define SIOCFUNCL _IOWR('r', 86, struct ipfunc_resolve) -# define SIOCIPFGETNEXT _IOWR('r', 87, struct ipfobj) -# define SIOCIPFGET _IOWR('r', 88, struct ipfobj) -# define SIOCIPFSET _IOWR('r', 89, struct ipfobj) -# define SIOCIPFL6 _IOWR('r', 90, int) -# define SIOCIPFITER _IOWR('r', 91, struct ipfobj) -# define SIOCGENITER _IOWR('r', 92, struct ipfobj) -# define SIOCGTABL _IOWR('r', 93, struct ipfobj) -# define SIOCIPFDELTOK _IOWR('r', 94, int) -# define SIOCLOOKUPITER _IOWR('r', 95, struct ipfobj) -# define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) -# define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) -# define SIOCIPFINTERROR _IOR('r', 98, int) +#define SIOCADAFR _IOW('r', 60, struct ipfobj) +#define SIOCRMAFR _IOW('r', 61, struct ipfobj) +#define SIOCSETFF _IOW('r', 62, u_int) +#define SIOCGETFF _IOR('r', 63, u_int) +#define SIOCGETFS _IOWR('r', 64, struct ipfobj) +#define SIOCIPFFL _IOWR('r', 65, int) +#define SIOCIPFFB _IOR('r', 66, int) +#define SIOCADIFR _IOW('r', 67, struct ipfobj) +#define SIOCRMIFR _IOW('r', 68, struct ipfobj) +#define SIOCSWAPA _IOR('r', 69, u_int) +#define SIOCINAFR _IOW('r', 70, struct ipfobj) +#define SIOCINIFR _IOW('r', 71, struct ipfobj) +#define SIOCFRENB _IOW('r', 72, u_int) +#define SIOCFRSYN _IOW('r', 73, u_int) +#define SIOCFRZST _IOWR('r', 74, struct ipfobj) +#define SIOCZRLST _IOWR('r', 75, struct ipfobj) +#define SIOCAUTHW _IOWR('r', 76, struct ipfobj) +#define SIOCAUTHR _IOWR('r', 77, struct ipfobj) +#define SIOCSTAT1 _IOWR('r', 78, struct ipfobj) +#define SIOCSTLCK _IOWR('r', 79, u_int) +#define SIOCSTPUT _IOWR('r', 80, struct ipfobj) +#define SIOCSTGET _IOWR('r', 81, struct ipfobj) +#define SIOCSTGSZ _IOWR('r', 82, struct ipfobj) +#define SIOCSTAT2 _IOWR('r', 83, struct ipfobj) +#define SIOCSETLG _IOWR('r', 84, int) +#define SIOCGETLG _IOWR('r', 85, int) +#define SIOCFUNCL _IOWR('r', 86, struct ipfunc_resolve) +#define SIOCIPFGETNEXT _IOWR('r', 87, struct ipfobj) +#define SIOCIPFGET _IOWR('r', 88, struct ipfobj) +#define SIOCIPFSET _IOWR('r', 89, struct ipfobj) +#define SIOCIPFL6 _IOWR('r', 90, int) +#define SIOCIPFITER _IOWR('r', 91, struct ipfobj) +#define SIOCGENITER _IOWR('r', 92, struct ipfobj) +#define SIOCGTABL _IOWR('r', 93, struct ipfobj) +#define SIOCIPFDELTOK _IOWR('r', 94, int) +#define SIOCLOOKUPITER _IOWR('r', 95, struct ipfobj) +#define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) +#define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) +#define SIOCIPFINTERROR _IOR('r', 98, int) #define SIOCADDFR SIOCADAFR #define SIOCDELFR SIOCRMAFR #define SIOCINSFR SIOCINAFR @@ -1640,14 +1640,14 @@ extern int ipf_qout(queue_t *, mblk_t *); extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, mb_t **); extern int (*fr_checkp)(ip_t *, int, void *, int, mb_t **); extern size_t mbufchainlen(mb_t *); -# ifdef IPFILTER_LKM +# ifdef IPFILTER_LKM extern int ipf_identify(char *); -# endif -# if defined(__FreeBSD_version) +# endif +# if defined(__FreeBSD_version) extern int ipfioctl(struct cdev*, u_long, caddr_t, int, struct thread *); -# elif defined(__NetBSD__) +# elif defined(__NetBSD__) extern int ipfioctl(dev_t, u_long, void *, int, struct lwp *); -# endif +# endif # endif /* MENTAT */ # if defined(__FreeBSD_version) diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index 7fc64cefb4c2..338c4e24c03a 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -34,9 +34,9 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -# include +#include #if defined(__FreeBSD_version) -#include +# include #endif #include #include @@ -44,7 +44,6 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include - #include #include #include @@ -75,19 +74,19 @@ static const char rcsid[] = "@(#)$Id$"; #include "netinet/ip_lookup.h" #include "netinet/ip_dstlist.h" #ifdef IPFILTER_SCAN -#include "netinet/ip_scan.h" +# include "netinet/ip_scan.h" #endif #include "netinet/ip_pool.h" #include #include #ifdef CSUM_DATA_VALID -#include +# include #endif extern int ip_optcopy(struct ip *, struct ip *); -# ifdef IPFILTER_M_IPFILTER +#ifdef IPFILTER_M_IPFILTER MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data structures"); -# endif +#endif static int ipf_send_ip(fr_info_t *, mb_t *); @@ -98,8 +97,8 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { }; #define V_ipfmain VNET(ipfmain) -# include -# include +#include +#include VNET_DEFINE_STATIC(eventhandler_tag, ipf_arrivetag); VNET_DEFINE_STATIC(eventhandler_tag, ipf_departtag); @@ -278,8 +277,8 @@ ipfdetach(softc) int ipfioctl(dev, cmd, data, mode, p) struct thread *p; -# define p_cred td_ucred -# define p_uid td_ucred->cr_ruid +#define p_cred td_ucred +#define p_uid td_ucred->cr_ruid struct cdev *dev; ioctlcmd_t cmd; caddr_t data; diff --git a/sys/contrib/ipfilter/netinet/ip_pool.c b/sys/contrib/ipfilter/netinet/ip_pool.c index fc2e78bfe27b..51d810baa310 100644 --- a/sys/contrib/ipfilter/netinet/ip_pool.c +++ b/sys/contrib/ipfilter/netinet/ip_pool.c @@ -732,7 +732,7 @@ ipf_pool_select_add_ref(arg, unit, name) /* */ /* Searches for an exact match of an entry in the pool. */ /* ------------------------------------------------------------------------ */ -extern void printhostmask(int, u_32_t *, u_32_t *)); +extern void printhostmask(int, u_32_t *, u_32_t *); static ip_pool_node_t * ipf_pool_findeq(softp, ipo, addr, mask) ipf_pool_softc_t *softp; From owner-dev-commits-src-all@freebsd.org Tue Feb 2 01:19: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 B98C84F8E24; Tue, 2 Feb 2021 01:19: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 4DV6RG5Z6Sz3njd; Tue, 2 Feb 2021 01:19: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 92498252E8; Tue, 2 Feb 2021 01:19: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 1121JMNm079564; Tue, 2 Feb 2021 01:19:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1121JMsF079563; Tue, 2 Feb 2021 01:19:22 GMT (envelope-from git) Date: Tue, 2 Feb 2021 01:19:22 GMT Message-Id: <202102020119.1121JMsF079563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 0f34c80f3763 - main - Replace the redundant MENTAT macro with SOLARIS. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f34c80f376345b98a972940dd4757e58d7beb06 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:19:24 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0f34c80f376345b98a972940dd4757e58d7beb06 commit 0f34c80f376345b98a972940dd4757e58d7beb06 Author: Cy Schubert AuthorDate: 2021-01-28 05:50:04 +0000 Commit: Cy Schubert CommitDate: 2021-02-02 01:19:15 +0000 Replace the redundant MENTAT macro with SOLARIS. MENTAT and SOLARIS are synonymous. Remove the extraneous duplicate macro. MFC after: 1 week --- contrib/ipfilter/ip_fil_compat.c | 50 +++++++++++++++---------------- contrib/ipfilter/tools/ipmon.c | 4 +-- sys/contrib/ipfilter/netinet/fil.c | 24 +++++++-------- sys/contrib/ipfilter/netinet/ip_auth.c | 6 ++-- sys/contrib/ipfilter/netinet/ip_auth.h | 2 +- sys/contrib/ipfilter/netinet/ip_compat.h | 2 +- sys/contrib/ipfilter/netinet/ip_fil.h | 10 +++---- sys/contrib/ipfilter/netinet/ip_irc_pxy.c | 6 ++-- sys/contrib/ipfilter/netinet/ip_log.c | 4 +-- sys/contrib/ipfilter/netinet/ip_nat.c | 18 +++++------ sys/contrib/ipfilter/netinet/ip_nat6.c | 6 ++-- sys/contrib/ipfilter/netinet/ip_proxy.c | 6 ++-- sys/contrib/ipfilter/netinet/ip_state.c | 2 +- 13 files changed, 69 insertions(+), 71 deletions(-) diff --git a/contrib/ipfilter/ip_fil_compat.c b/contrib/ipfilter/ip_fil_compat.c index fbcfc8a0088f..6184502e0f58 100644 --- a/contrib/ipfilter/ip_fil_compat.c +++ b/contrib/ipfilter/ip_fil_compat.c @@ -333,7 +333,7 @@ typedef struct fr_info_4_1_32 { ip_t *ofin_ip; mb_t **fin_mp; /* pointer to pointer to mbuf */ mb_t *fin_m; /* pointer to mbuf */ -#ifdef MENTAT +#if SOLARIS mb_t *fin_qfm; /* pointer to mblk where pkt starts */ void *fin_qpi; char fin_ifname[LIFNAMSIZ]; @@ -371,7 +371,7 @@ typedef struct fr_info_4_1_24 { ip_t *ofin_ip; mb_t **fin_mp; mb_t *fin_m; -#ifdef MENTAT +#if SOLARIS mb_t *fin_qfm; void *fin_qpi; char fin_ifname[LIFNAMSIZ]; @@ -408,7 +408,7 @@ typedef struct fr_info_4_1_23 { ip_t *ofin_ip; mb_t **fin_mp; mb_t *fin_m; -#ifdef MENTAT +#if SOLARIS mb_t *fin_qfm; void *fin_qpi; char fin_ifname[LIFNAMSIZ]; @@ -444,7 +444,7 @@ typedef struct fr_info_4_1_11 { ip_t *ofin_ip; mb_t **fin_mp; mb_t *fin_m; -#ifdef MENTAT +#if SOLARIS mb_t *fin_qfm; void *fin_qpi; char fin_ifname[LIFNAMSIZ]; @@ -933,7 +933,7 @@ typedef struct frauth_4_1_32 { fr_info_4_1_32_t fra_info; char *fra_buf; u_32_t fra_flx; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif @@ -947,7 +947,7 @@ typedef struct frauth_4_1_29 { fr_info_4_1_24_t fra_info; char *fra_buf; u_32_t fra_flx; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif @@ -960,7 +960,7 @@ typedef struct frauth_4_1_24 { u_32_t fra_pass; fr_info_4_1_24_t fra_info; char *fra_buf; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif @@ -973,7 +973,7 @@ typedef struct frauth_4_1_23 { u_32_t fra_pass; fr_info_4_1_23_t fra_info; char *fra_buf; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif @@ -986,7 +986,7 @@ typedef struct frauth_4_1_11 { u_32_t fra_pass; fr_info_4_1_11_t fra_info; char *fra_buf; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif @@ -2533,7 +2533,7 @@ frauth_4_1_32_to_current(old, current) fr_info_4_1_32_to_current(&old->fra_info, &fra->fra_info); fra->fra_buf = old->fra_buf; fra->fra_flx = old->fra_flx; -#ifdef MENTAT +#if SOLARIS fra->fra_q = old->fra_q; fra->fra_m = old->fra_m; #endif @@ -2554,7 +2554,7 @@ frauth_4_1_29_to_current(old, current) fr_info_4_1_24_to_current(&old->fra_info, &fra->fra_info); fra->fra_buf = old->fra_buf; fra->fra_flx = old->fra_flx; -#ifdef MENTAT +#if SOLARIS fra->fra_q = old->fra_q; fra->fra_m = old->fra_m; #endif @@ -2574,7 +2574,7 @@ frauth_4_1_24_to_current(old, current) fra->fra_pass = old->fra_pass; fr_info_4_1_24_to_current(&old->fra_info, &fra->fra_info); fra->fra_buf = old->fra_buf; -#ifdef MENTAT +#if SOLARIS fra->fra_q = old->fra_q; fra->fra_m = old->fra_m; #endif @@ -2594,7 +2594,7 @@ frauth_4_1_23_to_current(old, current) fra->fra_pass = old->fra_pass; fr_info_4_1_23_to_current(&old->fra_info, &fra->fra_info); fra->fra_buf = old->fra_buf; -#ifdef MENTAT +#if SOLARIS fra->fra_q = old->fra_q; fra->fra_m = old->fra_m; #endif @@ -2614,7 +2614,7 @@ frauth_4_1_11_to_current(old, current) fra->fra_pass = old->fra_pass; fr_info_4_1_11_to_current(&old->fra_info, &fra->fra_info); fra->fra_buf = old->fra_buf; -#ifdef MENTAT +#if SOLARIS fra->fra_q = old->fra_q; fra->fra_m = old->fra_m; #endif @@ -2652,7 +2652,7 @@ fr_info_4_1_32_to_current(old, current) fin->fin_ip = old->ofin_ip; fin->fin_mp = old->fin_mp; fin->fin_m = old->fin_m; -#ifdef MENTAT +#if SOLARIS fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif @@ -2690,7 +2690,7 @@ fr_info_4_1_24_to_current(old, current) fin->fin_ip = old->ofin_ip; fin->fin_mp = old->fin_mp; fin->fin_m = old->fin_m; -#ifdef MENTAT +#if SOLARIS fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif @@ -2727,7 +2727,7 @@ fr_info_4_1_23_to_current(old, current) fin->fin_ip = old->ofin_ip; fin->fin_mp = old->fin_mp; fin->fin_m = old->fin_m; -#ifdef MENTAT +#if SOLARIS fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif @@ -2764,7 +2764,7 @@ fr_info_4_1_11_to_current(old, current) fin->fin_ip = old->ofin_ip; fin->fin_mp = old->fin_mp; fin->fin_m = old->fin_m; -#ifdef MENTAT +#if SOLARIS fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif @@ -4039,7 +4039,7 @@ fr_info_current_to_4_1_24(current, old) old->ofin_ip = fin->fin_ip; old->fin_mp = fin->fin_mp; old->fin_m = fin->fin_m; -#ifdef MENTAT +#if SOLARIS old->fin_qfm = fin->fin_qfm; old->fin_qpi = fin->fin_qpi; old->fin_ifname[0] = '\0'; @@ -4079,7 +4079,7 @@ fr_info_current_to_4_1_23(current, old) old->ofin_ip = fin->fin_ip; old->fin_mp = fin->fin_mp; old->fin_m = fin->fin_m; -#ifdef MENTAT +#if SOLARIS old->fin_qfm = fin->fin_qfm; old->fin_qpi = fin->fin_qpi; old->fin_ifname[0] = '\0'; @@ -4119,7 +4119,7 @@ fr_info_current_to_4_1_11(current, old) old->ofin_ip = fin->fin_ip; old->fin_mp = fin->fin_mp; old->fin_m = fin->fin_m; -#ifdef MENTAT +#if SOLARIS old->fin_qfm = fin->fin_qfm; old->fin_qpi = fin->fin_qpi; old->fin_ifname[0] = '\0'; @@ -4141,7 +4141,7 @@ frauth_current_to_4_1_29(current, old) fr_info_current_to_4_1_24(&fra->fra_info, &old->fra_info); old->fra_buf = fra->fra_buf; old->fra_flx = fra->fra_flx; -#ifdef MENTAT +#if SOLARIS old->fra_q = fra->fra_q; old->fra_m = fra->fra_m; #endif @@ -4161,7 +4161,7 @@ frauth_current_to_4_1_24(current, old) old->fra_pass = fra->fra_pass; fr_info_current_to_4_1_24(&fra->fra_info, &old->fra_info); old->fra_buf = fra->fra_buf; -#ifdef MENTAT +#if SOLARIS old->fra_q = fra->fra_q; old->fra_m = fra->fra_m; #endif @@ -4181,7 +4181,7 @@ frauth_current_to_4_1_23(current, old) old->fra_pass = fra->fra_pass; fr_info_current_to_4_1_23(&fra->fra_info, &old->fra_info); old->fra_buf = fra->fra_buf; -#ifdef MENTAT +#if SOLARIS old->fra_q = fra->fra_q; old->fra_m = fra->fra_m; #endif @@ -4201,7 +4201,7 @@ frauth_current_to_4_1_11(current, old) old->fra_pass = fra->fra_pass; fr_info_current_to_4_1_11(&fra->fra_info, &old->fra_info); old->fra_buf = fra->fra_buf; -#ifdef MENTAT +#if SOLARIS old->fra_q = fra->fra_q; old->fra_m = fra->fra_m; #endif diff --git a/contrib/ipfilter/tools/ipmon.c b/contrib/ipfilter/tools/ipmon.c index 005cd316f91a..f14cef832722 100644 --- a/contrib/ipfilter/tools/ipmon.c +++ b/contrib/ipfilter/tools/ipmon.c @@ -108,7 +108,7 @@ char *reasons[] = { "natv6_in-fail", }; -#ifdef MENTAT +#if SOLARIS static char *pidfile = "/etc/opt/ipf/ipmon.pid"; #else static char *pidfile = "/var/run/ipmon.pid"; @@ -1108,7 +1108,7 @@ static void print_ipflog(conf, buf, blen) ifname[sizeof(ipf->fl_ifname)] = '\0'; sprintf(t, "%s", ifname); t += strlen(t); -# if defined(MENTAT) +# if SOLARIS if (ISALPHA(*(t - 1))) { sprintf(t, "%d", ipf->fl_unit); t += strlen(t); diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index a79d441284bf..2dca1e754b9e 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -2805,7 +2805,7 @@ ipf_firewall(fin, passp) /* ------------------------------------------------------------------------ */ int ipf_check(ctx, ip, hlen, ifp, out -#if defined(_KERNEL) && defined(MENTAT) +#if defined(_KERNEL) && SOLARIS , qif, mp) void *qif; #else @@ -2837,7 +2837,7 @@ ipf_check(ctx, ip, hlen, ifp, out * to hold all the required packet headers. */ #ifdef _KERNEL -# ifdef MENTAT +# if SOLARIS qpktinfo_t *qpi = qif; # ifdef __sparc @@ -2854,7 +2854,7 @@ ipf_check(ctx, ip, hlen, ifp, out bzero((char *)fin, sizeof(*fin)); -# ifdef MENTAT +# if SOLARIS if (qpi->qpi_flags & QF_BROADCAST) fin->fin_flx |= FI_MBCAST|FI_BROADCAST; if (qpi->qpi_flags & QF_MULTICAST) @@ -2862,7 +2862,7 @@ ipf_check(ctx, ip, hlen, ifp, out m = qpi->qpi_m; fin->fin_qfm = m; fin->fin_qpi = qpi; -# else /* MENTAT */ +# else /* SOLARIS */ m = *mp; @@ -2895,7 +2895,7 @@ ipf_check(ctx, ip, hlen, ifp, out m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } # endif /* CSUM_DELAY_DATA */ -# endif /* MENTAT */ +# endif /* SOLARIS */ #else bzero((char *)fin, sizeof(*fin)); m = *mp; @@ -6156,7 +6156,7 @@ ipf_getifname(ifp, buffer) char *buffer; { static char namebuf[LIFNAMSIZ]; -# if defined(MENTAT) || defined(__FreeBSD__) +# if SOLARIS || defined(__FreeBSD__) int unit, space; char temp[20]; char *s; @@ -6166,7 +6166,7 @@ ipf_getifname(ifp, buffer) buffer = namebuf; (void) strncpy(buffer, ifp->if_name, LIFNAMSIZ); buffer[LIFNAMSIZ - 1] = '\0'; -# if defined(MENTAT) || defined(__FreeBSD__) +# if SOLARIS || defined(__FreeBSD__) for (s = buffer; *s; s++) ; unit = ifp->if_unit; @@ -6916,7 +6916,7 @@ ipf_coalesce(fin) DT1(frb_coalesce, fr_info_t *, fin); LBUMP(ipf_stats[fin->fin_out].fr_badcoalesces); -# ifdef MENTAT +# if SOLARIS FREE_MB_T(*fin->fin_mp); # endif fin->fin_reason = FRB_COALESCE; @@ -8397,7 +8397,7 @@ ipf_ipf_ioctl(softc, data, cmd, mode, uid, ctx) error = EPERM; } else { WRITE_ENTER(&softc->ipf_global); -#if (defined(MENTAT) && defined(_KERNEL)) && !defined(INSTANCES) +#if (SOLARIS && defined(_KERNEL)) && !defined(INSTANCES) error = ipfsync(); #else ipf_sync(softc, NULL); @@ -8570,7 +8570,7 @@ ipf_decaps(fin, pass, l5proto) fino = fin; fin = &fin2; elen = hlen; -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr += elen; #else m->m_data += elen; @@ -8609,7 +8609,7 @@ ipf_decaps(fin, pass, l5proto) if (ipf_makefrip(hlen, ip, fin) == -1) { cantdecaps2: if (m != NULL) { -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr -= elen; #else m->m_data -= elen; @@ -8642,7 +8642,7 @@ cantdecaps: fino->fin_m = fin->fin_m; m = fin->fin_m; if (m != NULL) { -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr -= elen; #else m->m_data -= elen; diff --git a/sys/contrib/ipfilter/netinet/ip_auth.c b/sys/contrib/ipfilter/netinet/ip_auth.c index 4864a8128494..c40bb1b435f2 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.c +++ b/sys/contrib/ipfilter/netinet/ip_auth.c @@ -94,7 +94,7 @@ #include #include "netinet/ip_fil.h" #include "netinet/ip_auth.h" -#if !defined(MENTAT) +#if !SOLARIS # include # ifdef __FreeBSD__ # include @@ -466,7 +466,7 @@ ipf_auth_new(m, fin) { ipf_main_softc_t *softc = fin->fin_main_soft; ipf_auth_softc_t *softa = softc->ipf_auth_soft; -#if defined(_KERNEL) && defined(MENTAT) +#if defined(_KERNEL) && SOLARIS qpktinfo_t *qpi = fin->fin_qpi; #endif frauth_t *fra; @@ -508,7 +508,7 @@ ipf_auth_new(m, fin) * them. */ ip = fin->fin_ip; -# if defined(MENTAT) && defined(_KERNEL) +# if SOLARIS && defined(_KERNEL) if ((ip == (ip_t *)m->b_rptr) && (fin->fin_v == 4)) # endif { diff --git a/sys/contrib/ipfilter/netinet/ip_auth.h b/sys/contrib/ipfilter/netinet/ip_auth.h index e914dacacdf0..17df74c31de6 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.h +++ b/sys/contrib/ipfilter/netinet/ip_auth.h @@ -22,7 +22,7 @@ typedef struct frauth { fr_info_t fra_info; char *fra_buf; u_32_t fra_flx; -#ifdef MENTAT +#if SOLARIS queue_t *fra_q; mb_t *fra_m; #endif diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 756731480836..490e939f7f37 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -448,7 +448,7 @@ typedef struct ip6_hdr ip6_t; #endif #if defined(_KERNEL) -# if defined(MENTAT) && !defined(INSTANCES) +# if SOLARIS && !defined(INSTANCES) # define COPYDATA mb_copydata # define COPYBACK mb_copyback # else diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 0b5fc7285f93..72def439b3e8 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -402,7 +402,7 @@ typedef struct fr_info { } fin_ipu; mb_t **fin_mp; /* pointer to pointer to mbuf */ mb_t *fin_m; /* pointer to mbuf */ -#ifdef MENTAT +#if SOLARIS mb_t *fin_qfm; /* pointer to mblk where pkt starts */ void *fin_qpi; char fin_ifname[LIFNAMSIZ]; @@ -1626,8 +1626,7 @@ extern void ipfilterattach(int); # endif extern int ipl_enable(void); extern int ipl_disable(void); -# ifdef MENTAT -/* XXX MENTAT is always defined for Solaris */ +# if SOLARIS extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, void *, mblk_t **); # if SOLARIS @@ -1635,8 +1634,7 @@ extern void ipf_prependmbt(fr_info_t *, mblk_t *); extern int ipfioctl(dev_t, int, intptr_t, int, cred_t *, int *); # endif extern int ipf_qout(queue_t *, mblk_t *); -# else /* MENTAT */ -/* XXX MENTAT is never defined for FreeBSD & NetBSD */ +# else /* SOLARIS */ extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, mb_t **); extern int (*fr_checkp)(ip_t *, int, void *, int, mb_t **); extern size_t mbufchainlen(mb_t *); @@ -1648,7 +1646,7 @@ extern int ipfioctl(struct cdev*, u_long, caddr_t, int, struct thread *); # elif defined(__NetBSD__) extern int ipfioctl(dev_t, u_long, void *, int, struct lwp *); # endif -# endif /* MENTAT */ +# endif /* SOLARIS */ # if defined(__FreeBSD_version) extern int ipf_pfil_hook(void); diff --git a/sys/contrib/ipfilter/netinet/ip_irc_pxy.c b/sys/contrib/ipfilter/netinet/ip_irc_pxy.c index 304fe0c35351..4446b2100645 100644 --- a/sys/contrib/ipfilter/netinet/ip_irc_pxy.c +++ b/sys/contrib/ipfilter/netinet/ip_irc_pxy.c @@ -267,7 +267,7 @@ ipf_p_irc_send(fin, nat) u_int a1; ip_t *ip; mb_t *m; -#ifdef MENTAT +#if SOLARIS mb_t *m1; #endif softc = fin->fin_main_soft; @@ -322,7 +322,7 @@ ipf_p_irc_send(fin, nat) if ((inc + fin->fin_plen) > 65535) return 0; -#ifdef MENTAT +#if SOLARIS for (m1 = m; m1->b_cont; m1 = m1->b_cont) ; if ((inc > 0) && (m1->b_datap->db_lim - m1->b_wptr < inc)) { @@ -357,7 +357,7 @@ ipf_p_irc_send(fin, nat) fin->fin_flx |= FI_DOCKSUM; if (inc != 0) { -#if defined(MENTAT) +#if SOLARIS register u_32_t sum1, sum2; sum1 = fin->fin_plen; diff --git a/sys/contrib/ipfilter/netinet/ip_log.c b/sys/contrib/ipfilter/netinet/ip_log.c index 76d2e3def1fa..e5bf6a78bf1b 100644 --- a/sys/contrib/ipfilter/netinet/ip_log.c +++ b/sys/contrib/ipfilter/netinet/ip_log.c @@ -488,7 +488,7 @@ ipf_log_pkt(fin, flags) ptrs[0] = (void *)&ipfl; sizes[0] = sizeof(ipfl); types[0] = 0; -# if defined(MENTAT) && defined(_KERNEL) +# if SOLARIS && defined(_KERNEL) /* * Are we copied from the mblk or an aligned array ? */ @@ -505,7 +505,7 @@ ipf_log_pkt(fin, flags) ptrs[1] = m; sizes[1] = hlen + mlen; types[1] = 1; -# endif /* MENTAT */ +# endif /* SOLARIS */ return ipf_log_items(softc, IPL_LOGIPF, fin, ptrs, sizes, types, 2); } diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index bc0883ac7382..17c1133e145d 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -3661,7 +3661,7 @@ ipf_nat_icmperrorlookup(fin, dir) mb_t *m; m = fin->fin_m; -# if defined(MENTAT) +# if SOLARIS if ((char *)oip + fin->fin_dlen - ICMPERR_ICMPHLEN > (char *)m->b_wptr) { ATOMIC_INCL(nside->ns_icmp_mbuf); @@ -5116,7 +5116,7 @@ ipf_nat_out(fin, nat, natadd, nflags) ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, msumd, 0); } -#if !defined(_KERNEL) || defined(MENTAT) || \ +#if !defined(_KERNEL) || SOLARIS || \ defined(BRIDGE_IPF) || defined(__FreeBSD__) else { /* @@ -5179,7 +5179,7 @@ ipf_nat_out(fin, nat, natadd, nflags) m = fin->fin_m; -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr += skip; #else m->m_data += skip; @@ -5228,7 +5228,7 @@ ipf_nat_out(fin, nat, natadd, nflags) uh = (udphdr_t *)(ip + 1); uh->uh_ulen += fin->fin_plen; uh->uh_ulen = htons(uh->uh_ulen); -#if !defined(_KERNEL) || defined(MENTAT) || \ +#if !defined(_KERNEL) || SOLARIS || \ defined(BRIDGE_IPF) || defined(__FreeBSD__) ipf_fix_outcksum(0, &ip->ip_sum, sumd, 0); #endif @@ -5631,7 +5631,7 @@ ipf_nat_in(fin, nat, natadd, nflags) } fin->fin_ip->ip_dst = nat->nat_ndstip; fin->fin_daddr = nat->nat_ndstaddr; -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, ipsumd, 0); #endif break; @@ -5648,7 +5648,7 @@ ipf_nat_in(fin, nat, natadd, nflags) } fin->fin_ip->ip_dst = nat->nat_osrcip; fin->fin_daddr = nat->nat_osrcaddr; -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS ipf_fix_incksum(0, &fin->fin_ip->ip_sum, ipsumd, 0); #endif break; @@ -5680,7 +5680,7 @@ ipf_nat_in(fin, nat, natadd, nflags) sum2 += ntohs(ip->ip_off) & IP_DF; CALC_SUMD(sum1, sum2, sumd); -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS ipf_fix_outcksum(0, &ip->ip_sum, sumd, 0); #endif PREP_MB_T(fin, m); @@ -5706,7 +5706,7 @@ ipf_nat_in(fin, nat, natadd, nflags) m = fin->fin_m; -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr += skip; #else m->m_data += skip; @@ -7429,7 +7429,7 @@ ipf_nat_decap(fin, nat) CALC_SUMD(sum1, sum2, sumd); fin->fin_ip->ip_dst = nat->nat_osrcip; fin->fin_daddr = nat->nat_osrcaddr; -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, sumd, 0); #endif } diff --git a/sys/contrib/ipfilter/netinet/ip_nat6.c b/sys/contrib/ipfilter/netinet/ip_nat6.c index 388ee9a67e73..b2713aec812a 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat6.c +++ b/sys/contrib/ipfilter/netinet/ip_nat6.c @@ -1434,7 +1434,7 @@ ipf_nat6_icmperrorlookup(fin, dir) mb_t *m; m = fin->fin_m; -# if defined(MENTAT) +# if SOLARIS if ((char *)oip6 + fin->fin_dlen - ICMPERR_ICMPHLEN > (char *)m->b_wptr) { ATOMIC_INCL(nside->ns_icmp_mbuf); @@ -2858,7 +2858,7 @@ ipf_nat6_out(fin, nat, natadd, nflags) m = fin->fin_m; -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr += skip; #else m->m_data += skip; @@ -3321,7 +3321,7 @@ ipf_nat6_in(fin, nat, natadd, nflags) m = fin->fin_m; -#if defined(MENTAT) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) m->b_rptr += skip; #else m->m_data += skip; diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index 227ca817f6e4..2c6b4eb6369d 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -914,7 +914,7 @@ ipf_proxy_check(fin, nat) ip_t *ip; short rv; int err; -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS u_32_t s1, s2, sd; #endif @@ -942,7 +942,7 @@ ipf_proxy_check(fin, nat) * If there is data in this packet to be proxied then try and * get it all into the one buffer, else drop it. */ -#if defined(MENTAT) || defined(HAVE_M_PULLDOWN) +#if SOLARIS || defined(HAVE_M_PULLDOWN) if ((fin->fin_dlen > 0) && !(fin->fin_flx & FI_COALESCE)) if (ipf_coalesce(fin) == -1) { if (softp->ips_proxy_debug & 0x08) @@ -1006,7 +1006,7 @@ ipf_proxy_check(fin, nat) * packet. */ adjlen = APR_INC(err); -#if !defined(_KERNEL) || defined(MENTAT) +#if !defined(_KERNEL) || SOLARIS s1 = LONG_SUM(fin->fin_plen - adjlen); s2 = LONG_SUM(fin->fin_plen); CALC_SUMD(s1, s2, sd); diff --git a/sys/contrib/ipfilter/netinet/ip_state.c b/sys/contrib/ipfilter/netinet/ip_state.c index 45a641fd86a2..a050a2d324d2 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.c +++ b/sys/contrib/ipfilter/netinet/ip_state.c @@ -2739,7 +2739,7 @@ ipf_checkicmpmatchingstate(fin) mb_t *m; m = fin->fin_m; -# if defined(MENTAT) +# if SOLARIS if ((char *)oip + len > (char *)m->b_wptr) { SBUMPDX(ipf_state_stats, iss_icmp_short, iss_icmp_short_2); return NULL; From owner-dev-commits-src-all@freebsd.org Tue Feb 2 08: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 AEC6752A71E; Tue, 2 Feb 2021 08: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 4DVJQ44RSBz4fRy; Tue, 2 Feb 2021 08:49: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 86E993397; Tue, 2 Feb 2021 08:49: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 1128n0eI065969; Tue, 2 Feb 2021 08:49:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1128n05V065968; Tue, 2 Feb 2021 08:49:00 GMT (envelope-from git) Date: Tue, 2 Feb 2021 08:49:00 GMT Message-Id: <202102020849.1128n05V065968@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: 49429cf9be7f - main - bhyve/vioapic: remove an extra pin masked check 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: 49429cf9be7f43c37723175f90c56b29e29d1680 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 08:49:00 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=49429cf9be7f43c37723175f90c56b29e29d1680 commit 49429cf9be7f43c37723175f90c56b29e29d1680 Author: Roger Pau Monné AuthorDate: 2021-01-19 11:52:44 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-02 08:44:20 +0000 bhyve/vioapic: remove an extra pin masked check vioapic_send_intr does already check whether the pin is masked before injecting the interrupt, there's no need to do it in vioapic_write also. No functional change intended. Reviewed by: grehan Differential revision: https://reviews.freebsd.org/D28236 --- sys/amd64/vmm/io/vioapic.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/amd64/vmm/io/vioapic.c b/sys/amd64/vmm/io/vioapic.c index a8117da4b879..682e862da63e 100644 --- a/sys/amd64/vmm/io/vioapic.c +++ b/sys/amd64/vmm/io/vioapic.c @@ -363,12 +363,10 @@ vioapic_write(struct vioapic *vioapic, int vcpuid, uint32_t addr, uint32_t data) /* * Generate an interrupt if the following conditions are met: - * - pin is not masked * - previous interrupt has been EOIed * - pin level is asserted */ - if ((vioapic->rtbl[pin].reg & IOART_INTMASK) == IOART_INTMCLR && - (vioapic->rtbl[pin].reg & IOART_REM_IRR) == 0 && + if ((vioapic->rtbl[pin].reg & IOART_REM_IRR) == 0 && (vioapic->rtbl[pin].acnt > 0)) { VIOAPIC_CTR2(vioapic, "ioapic pin%d: asserted at rtbl " "write, acnt %d", pin, vioapic->rtbl[pin].acnt); From owner-dev-commits-src-all@freebsd.org Tue Feb 2 08:49: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 B947F52A8C3; Tue, 2 Feb 2021 08:49: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 4DVJQ54xCNz4fV0; Tue, 2 Feb 2021 08:49: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 9CC7A3596; Tue, 2 Feb 2021 08:49: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 1128n1ww065991; Tue, 2 Feb 2021 08:49:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1128n1hu065990; Tue, 2 Feb 2021 08:49:01 GMT (envelope-from git) Date: Tue, 2 Feb 2021 08:49:01 GMT Message-Id: <202102020849.1128n1hu065990@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: d7d067698a38 - main - bhyve/ioapic: only account for asserted line in level mode 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: d7d067698a38a3464a58eb34f68f63e529c45136 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 08:49:01 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=d7d067698a38a3464a58eb34f68f63e529c45136 commit d7d067698a38a3464a58eb34f68f63e529c45136 Author: Roger Pau Monné AuthorDate: 2021-01-19 12:41:03 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-02 08:45:45 +0000 bhyve/ioapic: only account for asserted line in level mode After modifying a redirection entry only try to inject an interrupt if the pin is in level mode, pins in edge mode shouldn't take into account the line assert status as they are triggered by edge changes, not the line status itself. Reviewed by: grehan Differential revision: https://reviews.freebsd.org/D28237 --- sys/amd64/vmm/io/vioapic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/vmm/io/vioapic.c b/sys/amd64/vmm/io/vioapic.c index 682e862da63e..941f7c7364bc 100644 --- a/sys/amd64/vmm/io/vioapic.c +++ b/sys/amd64/vmm/io/vioapic.c @@ -364,9 +364,11 @@ vioapic_write(struct vioapic *vioapic, int vcpuid, uint32_t addr, uint32_t data) /* * Generate an interrupt if the following conditions are met: * - previous interrupt has been EOIed + * - pin trigger mode is level * - pin level is asserted */ if ((vioapic->rtbl[pin].reg & IOART_REM_IRR) == 0 && + (vioapic->rtbl[pin].reg & IOART_TRGRMOD) == IOART_TRGRLVL && (vioapic->rtbl[pin].acnt > 0)) { VIOAPIC_CTR2(vioapic, "ioapic pin%d: asserted at rtbl " "write, acnt %d", pin, vioapic->rtbl[pin].acnt); From owner-dev-commits-src-all@freebsd.org Tue Feb 2 08:49: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 6436C52A34B; Tue, 2 Feb 2021 08:49: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 4DVJQ70kZmz4fVD; Tue, 2 Feb 2021 08:49: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 BDF9D3278; Tue, 2 Feb 2021 08:49: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 1128n2BI066010; Tue, 2 Feb 2021 08:49:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1128n2DU066009; Tue, 2 Feb 2021 08:49:02 GMT (envelope-from git) Date: Tue, 2 Feb 2021 08:49:02 GMT Message-Id: <202102020849.1128n2DU066009@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: 5ea878684f6c - main - bhyve/ioapic: improve the tracking of IRR bit 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: 5ea878684f6cfff4ad05186346ff3a4828d980ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 08:49:03 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=5ea878684f6cfff4ad05186346ff3a4828d980ca commit 5ea878684f6cfff4ad05186346ff3a4828d980ca Author: Roger Pau Monné AuthorDate: 2021-01-19 11:52:28 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-02 08:47:00 +0000 bhyve/ioapic: improve the tracking of IRR bit One common method of EOI'ing an interrupt at the IO-APIC level is to switch the pin to edge triggering mode and then back into level mode. That would cause the IRR bit to be cleared and thus further interrupts to be injected. FreeBSD does indeed use that method if the IO-APIC EOI register is not supported. The bhyve IO-APIC emulation code didn't clear the IRR bit when doing that switch, and was also missing acknowledging the IRR state when trying to inject an interrupt in vioapic_send_intr. Reviewed by: grehan Differential revision: https://reviews.freebsd.org/D28238 --- sys/amd64/vmm/io/vioapic.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/sys/amd64/vmm/io/vioapic.c b/sys/amd64/vmm/io/vioapic.c index 941f7c7364bc..639c1b07eb08 100644 --- a/sys/amd64/vmm/io/vioapic.c +++ b/sys/amd64/vmm/io/vioapic.c @@ -122,8 +122,14 @@ vioapic_send_intr(struct vioapic *vioapic, int pin) phys = ((low & IOART_DESTMOD) == IOART_DESTPHY); delmode = low & IOART_DELMOD; level = low & IOART_TRGRLVL ? true : false; - if (level) + if (level) { + if ((low & IOART_REM_IRR) != 0) { + VIOAPIC_CTR1(vioapic, "ioapic pin%d: irr pending", + pin); + return; + } vioapic->rtbl[pin].reg |= IOART_REM_IRR; + } vector = low & IOART_INTVEC; dest = high >> APIC_ID_SHIFT; @@ -342,6 +348,16 @@ vioapic_write(struct vioapic *vioapic, int vcpuid, uint32_t addr, uint32_t data) vioapic->rtbl[pin].reg &= ~mask64 | RTBL_RO_BITS; vioapic->rtbl[pin].reg |= data64 & ~RTBL_RO_BITS; + /* + * Switching from level to edge triggering will clear the IRR + * bit. This is what FreeBSD will do in order to EOI an + * interrupt when the IO-APIC doesn't support targeted EOI (see + * _ioapic_eoi_source). + */ + if ((vioapic->rtbl[pin].reg & IOART_TRGRMOD) == IOART_TRGREDG && + (vioapic->rtbl[pin].reg & IOART_REM_IRR) != 0) + vioapic->rtbl[pin].reg &= ~IOART_REM_IRR; + VIOAPIC_CTR2(vioapic, "ioapic pin%d: redir table entry %#lx", pin, vioapic->rtbl[pin].reg); @@ -363,12 +379,10 @@ vioapic_write(struct vioapic *vioapic, int vcpuid, uint32_t addr, uint32_t data) /* * Generate an interrupt if the following conditions are met: - * - previous interrupt has been EOIed * - pin trigger mode is level * - pin level is asserted */ - if ((vioapic->rtbl[pin].reg & IOART_REM_IRR) == 0 && - (vioapic->rtbl[pin].reg & IOART_TRGRMOD) == IOART_TRGRLVL && + if ((vioapic->rtbl[pin].reg & IOART_TRGRMOD) == IOART_TRGRLVL && (vioapic->rtbl[pin].acnt > 0)) { VIOAPIC_CTR2(vioapic, "ioapic pin%d: asserted at rtbl " "write, acnt %d", pin, vioapic->rtbl[pin].acnt); From owner-dev-commits-src-all@freebsd.org Tue Feb 2 09:09: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 D5D4A52B1FC; Tue, 2 Feb 2021 09:09: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 4DVJsr5lxnz4jFG; Tue, 2 Feb 2021 09:09: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 B43A3382A; Tue, 2 Feb 2021 09:09: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 11299aFi092321; Tue, 2 Feb 2021 09:09:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11299a3I092320; Tue, 2 Feb 2021 09:09:36 GMT (envelope-from git) Date: Tue, 2 Feb 2021 09:09:36 GMT Message-Id: <202102020909.11299a3I092320@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: c69047ca7526 - main - Revert "diff: eliminate a useless lseek" 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: c69047ca7526090cc2aa92c57d9f21a77a82fc2e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 09:09:36 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c69047ca7526090cc2aa92c57d9f21a77a82fc2e commit c69047ca7526090cc2aa92c57d9f21a77a82fc2e Author: Baptiste Daroussin AuthorDate: 2021-02-02 09:07:57 +0000 Commit: Baptiste Daroussin CommitDate: 2021-02-02 09:08:25 +0000 Revert "diff: eliminate a useless lseek" This changes breaks when one of the files is stdin This reverts commit fa977a3b2bb2d0e6c2957b14474c31b58dd3a8e1. Reported by: olivier --- usr.bin/diff/diffreg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 4c9211510459..1b28281024c6 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -490,6 +490,7 @@ opentemp(const char *f) } } close(ifd); + lseek(ofd, (off_t)0, SEEK_SET); return (fdopen(ofd, "r")); } From owner-dev-commits-src-all@freebsd.org Tue Feb 2 10:08: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 C1AAB52C157; Tue, 2 Feb 2021 10:08: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 4DVL9l54Qbz4lx7; Tue, 2 Feb 2021 10:08: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 A0DC5445E; Tue, 2 Feb 2021 10:08: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 112A8RFA069893; Tue, 2 Feb 2021 10:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112A8RkU069892; Tue, 2 Feb 2021 10:08:27 GMT (envelope-from git) Date: Tue, 2 Feb 2021 10:08:27 GMT Message-Id: <202102021008.112A8RkU069892@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: 83c20b8a2da0 - main - tests/sys/kern/crc32: Check for SSE4.2 before using it 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: 83c20b8a2da04937cf4af127366b3dc92c855784 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 10:08:27 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=83c20b8a2da04937cf4af127366b3dc92c855784 commit 83c20b8a2da04937cf4af127366b3dc92c855784 Author: Alex Richardson AuthorDate: 2021-02-02 09:52:52 +0000 Commit: Alex Richardson CommitDate: 2021-02-02 09:53:39 +0000 tests/sys/kern/crc32: Check for SSE4.2 before using it This avoids a SIGILL when running these tests on QEMU (which defaults to a basic amd64 CPU without SSE4.2). This commit also tests the table-based implementations in addition to testing the hw-accelerated crc32 versions. Reviewed By: cem, kib, markj Differential Revision: https://reviews.freebsd.org/D28395 --- sys/libkern/gsb_crc32.c | 16 ++++++--- sys/sys/gsb_crc32.h | 7 +++- tests/sys/kern/Makefile | 14 ++++---- tests/sys/kern/libkern_crc32.c | 73 ++++++++++++++++++++++++------------------ 4 files changed, 65 insertions(+), 45 deletions(-) diff --git a/sys/libkern/gsb_crc32.c b/sys/libkern/gsb_crc32.c index b2f7421c20eb..170ceb3aa710 100644 --- a/sys/libkern/gsb_crc32.c +++ b/sys/libkern/gsb_crc32.c @@ -46,11 +46,11 @@ __FBSDID("$FreeBSD$"); #include +#include #ifdef _KERNEL #include #include -#include #if defined(__amd64__) || defined(__i386__) #include @@ -216,7 +216,10 @@ static const uint32_t crc32Table[256] = { 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L }; -static uint32_t +#ifndef TESTING +static +#endif +uint32_t singletable_crc32c(uint32_t crc, const void *buf, size_t size) { const uint8_t *p = buf; @@ -730,10 +733,13 @@ crc32c_sb8_64_bit(uint32_t crc, return crc; } -static uint32_t +#ifndef TESTING +static +#endif +uint32_t multitable_crc32c(uint32_t crc32c, - const unsigned char *buffer, - unsigned int length) + const void *buffer, + size_t length) { uint32_t to_even_word; diff --git a/sys/sys/gsb_crc32.h b/sys/sys/gsb_crc32.h index c5a42d3d3152..dc126a5258fb 100644 --- a/sys/sys/gsb_crc32.h +++ b/sys/sys/gsb_crc32.h @@ -32,10 +32,10 @@ crc32(const void *buf, size_t size) crc = crc32_raw(buf, size, ~0U); return (crc ^ ~0U); } +#endif uint32_t calculate_crc32c(uint32_t crc32c, const unsigned char *buffer, unsigned int length); -#endif #if defined(__amd64__) || defined(__i386__) uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); @@ -44,4 +44,9 @@ uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); uint32_t armv8_crc32c(uint32_t, const unsigned char *, unsigned int); #endif +#ifdef TESTING +uint32_t singletable_crc32c(uint32_t, const void *, size_t); +uint32_t multitable_crc32c(uint32_t, const void *, size_t); +#endif + #endif /* !_SYS_GSB_CRC32_H_ */ diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 1806d7ce8597..f350b740b7ea 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -56,15 +56,15 @@ NETBSD_ATF_TESTS_C+= sysv_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt -.if ${MACHINE_ARCH} == "amd64" || \ - ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "aarch64" ATF_TESTS_C+= libkern_crc32 +SRCS.libkern_crc32+= libkern_crc32.c +.PATH: ${SRCTOP}/sys/libkern +SRCS.libkern_crc32+= gsb_crc32.c +CFLAGS.libkern_crc32+= -DTESTING .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" -LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c -.else -LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S -.endif +SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c +.elif ${MACHINE_CPUARCH} == "aarch64" +SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S .endif # subr_unit.c contains functions whose prototypes lie in headers that cannot be diff --git a/tests/sys/kern/libkern_crc32.c b/tests/sys/kern/libkern_crc32.c index 39cb8ca5aeeb..dd9508e1ebd6 100644 --- a/tests/sys/kern/libkern_crc32.c +++ b/tests/sys/kern/libkern_crc32.c @@ -33,10 +33,46 @@ #include -#if !defined(__amd64__) && !defined(__i386__) && !defined(__aarch64__) -#error These tests are not supported on this platform +#if defined(__amd64__) || defined(__i386__) +#include +#include + +static bool +have_sse42(void) +{ + u_int cpu_registers[4]; + + do_cpuid(1, cpu_registers); + + return ((cpu_registers[2] & CPUID2_SSE42) != 0); +} #endif +static void +check_crc32c(uint32_t expected, uint32_t crc32c, const void *buffer, + size_t length) +{ + uint32_t act; + +#if defined(__amd64__) || defined(__i386__) + if (have_sse42()) { + act = sse42_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "sse42_crc32c expected 0x%08x, got 0x%08x", expected, act); + } +#elif defined(__aarch64__) + act = armv8_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "armv8_crc32c expected 0x%08x, got 0x%08x", expected, act); +#endif + act = singletable_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "singletable_crc32c expected 0x%08x, got 0x%08x", expected, act); + act = multitable_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "multitable_crc32c expected 0x%08x, got 0x%08x", expected, act); +} + ATF_TC_WITHOUT_HEAD(crc32c_basic_correctness); ATF_TC_BODY(crc32c_basic_correctness, tc) { @@ -77,21 +113,11 @@ ATF_TC_BODY(crc32c_basic_correctness, tc) 0xfd562dc3, }; size_t i; - uint32_t act; ATF_REQUIRE(nitems(inputs) == nitems(results)); for (i = 0; i < nitems(inputs); i++) { -#if defined(__amd64__) || defined(__i386__) - act = sse42_crc32c(~0, (const void *)&inputs[i], - sizeof(inputs[0])); -#else - act = armv8_crc32c(~0, (const void *)&inputs[i], - sizeof(inputs[0])); -#endif - ATF_REQUIRE_MSG(act == results[i], - "crc32c(0x%jx) = 0x%08x, got 0x%08x", (uintmax_t)inputs[i], - results[i], act); + check_crc32c(results[i], ~0u, &inputs[i], sizeof(inputs[0])); } } @@ -102,20 +128,10 @@ ATF_TC_BODY(crc32c_alignment, tc) const uint32_t result = 0x2ce33ede; unsigned char buf[15]; size_t i; - uint32_t act; - for (i = 1; i < 8; i++) { memcpy(&buf[i], &input, sizeof(input)); - -#if defined(__amd64__) || defined(__i386__) - act = sse42_crc32c(~0, (const void *)&buf[i], sizeof(input)); -#else - act = armv8_crc32c(~0, (const void *)&buf[i], sizeof(input)); -#endif - ATF_REQUIRE_MSG(act == result, - "crc32c(0x%jx) = 0x%08x, got 0x%08x", (uintmax_t)input, - result, act); + check_crc32c(result, ~0u, &buf[i], sizeof(input)); } } @@ -127,15 +143,8 @@ ATF_TC_BODY(crc32c_trailing_bytes, tc) 0xd4, 0x4, 0x5e, 0xa9, 0xb3 }; const uint32_t result = 0xec638d62; - uint32_t act; -#if defined(__amd64__) || defined(__i386__) - act = sse42_crc32c(~0, input, sizeof(input)); -#else - act = armv8_crc32c(~0, input, sizeof(input)); -#endif - ATF_REQUIRE_MSG(act == result, "expected 0x%08x, got 0x%08x", result, - act); + check_crc32c(result, ~0u, input, sizeof(input)); } ATF_TP_ADD_TCS(tp) From owner-dev-commits-src-all@freebsd.org Tue Feb 2 10:08: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 D8C9252C374; Tue, 2 Feb 2021 10:08: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 4DVL9m5nW2z4m0N; Tue, 2 Feb 2021 10:08: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 BA080445F; Tue, 2 Feb 2021 10:08: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 112A8SIa069913; Tue, 2 Feb 2021 10:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112A8Skf069912; Tue, 2 Feb 2021 10:08:28 GMT (envelope-from git) Date: Tue, 2 Feb 2021 10:08:28 GMT Message-Id: <202102021008.112A8Skf069912@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: 40407d3998d1 - main - tests/sys/audit: Skip extattr tests if extattrs are not supported 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: 40407d3998d1a12cbe929721f4dbe72b4be478a6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 10:08:28 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=40407d3998d1a12cbe929721f4dbe72b4be478a6 commit 40407d3998d1a12cbe929721f4dbe72b4be478a6 Author: Alex Richardson AuthorDate: 2021-02-02 09:55:18 +0000 Commit: Alex Richardson CommitDate: 2021-02-02 09:55:19 +0000 tests/sys/audit: Skip extattr tests if extattrs are not supported In the CheriBSD CI, we run the testsuite with /tmp as tmpfs. This causes the extattr audit tests to fail since tmpfs does not (yet) support extattrs. Skip those tests if the target path is on a file system that does not support extended file attributes. While touching these two files also convert the ATF_REQUIRE_EQ(-1, ...) checks to use ATF_REQURIE_ERRNO(). Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D28392 --- tests/sys/audit/file-attribute-access.c | 129 ++++++++++++++++++-------------- tests/sys/audit/file-attribute-modify.c | 106 +++++++++++++++----------- tests/sys/audit/utils.c | 18 +++++ tests/sys/audit/utils.h | 21 ++++++ 4 files changed, 173 insertions(+), 101 deletions(-) diff --git a/tests/sys/audit/file-attribute-access.c b/tests/sys/audit/file-attribute-access.c index 016d5772b933..9f4514bc3fde 100644 --- a/tests/sys/audit/file-attribute-access.c +++ b/tests/sys/audit/file-attribute-access.c @@ -27,13 +27,15 @@ #include #include -#include #include #include #include +#include #include +#include #include +#include #include #include "utils.h" @@ -89,7 +91,7 @@ ATF_TC_BODY(stat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, stat(errpath, &statbuff)); + ATF_REQUIRE_ERRNO(ENOENT, stat(errpath, &statbuff) == -1); check_audit(fds, failurereg, pipefd); } @@ -132,7 +134,7 @@ ATF_TC_BODY(lstat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lstat(errpath, &statbuff)); + ATF_REQUIRE_ERRNO(ENOENT, lstat(errpath, &statbuff) == -1); check_audit(fds, failurereg, pipefd); } @@ -180,7 +182,7 @@ ATF_TC_BODY(fstat_failure, tc) FILE *pipefd = setup(fds, auclass); const char *regex = "fstat.*return,failure : Bad file descriptor"; /* Failure reason: bad file descriptor */ - ATF_REQUIRE_EQ(-1, fstat(-1, &statbuff)); + ATF_REQUIRE_ERRNO(EBADF, fstat(-1, &statbuff) == -1); check_audit(fds, regex, pipefd); } @@ -224,8 +226,8 @@ ATF_TC_BODY(fstatat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, fstatat(AT_FDCWD, path, &statbuff, - AT_SYMLINK_NOFOLLOW)); + ATF_REQUIRE_ERRNO(ENOENT, + fstatat(AT_FDCWD, path, &statbuff, AT_SYMLINK_NOFOLLOW) == -1); check_audit(fds, failurereg, pipefd); } @@ -269,7 +271,7 @@ ATF_TC_BODY(statfs_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, statfs(errpath, &statfsbuff)); + ATF_REQUIRE_ERRNO(ENOENT, statfs(errpath, &statfsbuff) == -1); check_audit(fds, failurereg, pipefd); } @@ -319,7 +321,7 @@ ATF_TC_BODY(fstatfs_failure, tc) FILE *pipefd = setup(fds, auclass); const char *regex = "fstatfs.*return,failure : Bad file descriptor"; /* Failure reason: bad file descriptor */ - ATF_REQUIRE_EQ(-1, fstatfs(-1, &statfsbuff)); + ATF_REQUIRE_ERRNO(EBADF, fstatfs(-1, &statfsbuff) == -1); check_audit(fds, regex, pipefd); } @@ -364,7 +366,7 @@ ATF_TC_BODY(getfsstat_failure, tc) const char *regex = "getfsstat.*return,failure : Invalid argument"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid value for mode */ - ATF_REQUIRE_EQ(-1, getfsstat(NULL, 0, -1)); + ATF_REQUIRE_ERRNO(EINVAL, getfsstat(NULL, 0, -1) == -1); check_audit(fds, regex, pipefd); } @@ -409,7 +411,7 @@ ATF_TC_BODY(lgetfh_failure, tc) const char *regex = "lgetfh.*return,failure"; FILE *pipefd = setup(fds, "fa"); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lgetfh(errpath, &fht)); + ATF_REQUIRE_ERRNO(ENOENT, lgetfh(errpath, &fht) == -1); check_audit(fds, regex, pipefd); } @@ -465,7 +467,7 @@ ATF_TC_BODY(fhopen_failure, tc) * Failure reason: NULL does not represent any file handle * and O_CREAT is not allowed as the flag for fhopen(2) */ - ATF_REQUIRE_EQ(-1, fhopen(NULL, O_CREAT)); + ATF_REQUIRE_ERRNO(EINVAL, fhopen(NULL, O_CREAT) == -1); check_audit(fds, regex, pipefd); } @@ -516,7 +518,7 @@ ATF_TC_BODY(fhstat_failure, tc) const char *regex = "fhstat.*return,failure : Bad address"; FILE *pipefd = setup(fds, auclass); /* Failure reason: NULL does not represent any file handle */ - ATF_REQUIRE_EQ(-1, fhstat(NULL, NULL)); + ATF_REQUIRE_ERRNO(EFAULT, fhstat(NULL, NULL) == -1); check_audit(fds, regex, pipefd); } @@ -567,7 +569,7 @@ ATF_TC_BODY(fhstatfs_failure, tc) const char *regex = "fhstatfs.*return,failure : Bad address"; FILE *pipefd = setup(fds, auclass); /* Failure reason: NULL does not represent any file handle */ - ATF_REQUIRE_EQ(-1, fhstatfs(NULL, NULL)); + ATF_REQUIRE_ERRNO(EFAULT, fhstatfs(NULL, NULL) == -1); check_audit(fds, regex, pipefd); } @@ -611,7 +613,7 @@ ATF_TC_BODY(access_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, access(errpath, F_OK)); + ATF_REQUIRE_ERRNO(ENOENT, access(errpath, F_OK) == -1); check_audit(fds, failurereg, pipefd); } @@ -655,7 +657,7 @@ ATF_TC_BODY(eaccess_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, eaccess(errpath, F_OK)); + ATF_REQUIRE_ERRNO(ENOENT, eaccess(errpath, F_OK) == -1); check_audit(fds, failurereg, pipefd); } @@ -699,7 +701,8 @@ ATF_TC_BODY(faccessat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, faccessat(AT_FDCWD, errpath, F_OK, AT_EACCESS)); + ATF_REQUIRE_ERRNO(ENOENT, + faccessat(AT_FDCWD, errpath, F_OK, AT_EACCESS) == -1); check_audit(fds, failurereg, pipefd); } @@ -744,7 +747,7 @@ ATF_TC_BODY(pathconf_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, pathconf(errpath, _PC_NAME_MAX)); + ATF_REQUIRE_ERRNO(ENOENT, pathconf(errpath, _PC_NAME_MAX) == -1); check_audit(fds, failurereg, pipefd); } @@ -788,7 +791,7 @@ ATF_TC_BODY(lpathconf_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lpathconf(errpath, _PC_SYMLINK_MAX)); + ATF_REQUIRE_ERRNO(ENOENT, lpathconf(errpath, _PC_SYMLINK_MAX) == -1); check_audit(fds, failurereg, pipefd); } @@ -837,7 +840,7 @@ ATF_TC_BODY(fpathconf_failure, tc) FILE *pipefd = setup(fds, auclass); const char *regex = "fpathconf.*return,failure : Bad file descriptor"; /* Failure reason: Bad file descriptor */ - ATF_REQUIRE_EQ(-1, fpathconf(-1, _PC_NAME_MAX)); + ATF_REQUIRE_ERRNO(EBADF, fpathconf(-1, _PC_NAME_MAX) == -1); check_audit(fds, regex, pipefd); } @@ -858,17 +861,20 @@ ATF_TC_BODY(extattr_get_file_success, tc) { /* File needs to exist to call extattr_get_file(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); + /* Set an extended attribute to be retrieved later on */ - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, - EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, buff, + sizeof(buff))); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_get_file.*%s.*%s.*return,success", path, name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_get_file(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_get_file(path, EXTATTR_NAMESPACE_USER, name, NULL, 0)); check_audit(fds, extregex, pipefd); close(filedesc); } @@ -894,8 +900,9 @@ ATF_TC_BODY(extattr_get_file_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, extattr_get_file(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_get_file(path, EXTATTR_NAMESPACE_USER, name, NULL, 0) == + -1); check_audit(fds, extregex, pipefd); } @@ -916,17 +923,20 @@ ATF_TC_BODY(extattr_get_fd_success, tc) { /* File needs to exist to call extattr_get_fd(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); + /* Set an extended attribute to be retrieved later on */ - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, - EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, buff, + sizeof(buff))); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_get_fd.*%s.*return,success", name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_get_fd(filedesc, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_get_fd(filedesc, EXTATTR_NAMESPACE_USER, name, NULL, 0)); check_audit(fds, extregex, pipefd); close(filedesc); } @@ -952,8 +962,8 @@ ATF_TC_BODY(extattr_get_fd_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, extattr_get_fd(-1, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(EBADF, + extattr_get_fd(-1, EXTATTR_NAMESPACE_USER, name, NULL, 0) == -1); check_audit(fds, extregex, pipefd); } @@ -974,17 +984,20 @@ ATF_TC_BODY(extattr_get_link_success, tc) { /* Symbolic link needs to exist to call extattr_get_link(2) */ ATF_REQUIRE_EQ(0, symlink("symlink", path)); + skip_if_extattr_not_supported("."); + /* Set an extended attribute to be retrieved later on */ - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path, - EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, buff, + sizeof(buff))); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_get_link.*%s.*%s.*return,success", path, name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_get_link(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + REQUIRE_EXTATTR_RESULT(sizeof(buff), + extattr_get_link(path, EXTATTR_NAMESPACE_USER, name, NULL, 0)); check_audit(fds, extregex, pipefd); } @@ -1008,8 +1021,8 @@ ATF_TC_BODY(extattr_get_link_failure, tc) "extattr_get_link.*%s.*%s.*failure", path, name); FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, extattr_get_link(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_get_link(path, EXTATTR_NAMESPACE_USER, name, NULL, 0)); check_audit(fds, extregex, pipefd); } @@ -1028,16 +1041,17 @@ ATF_TC_HEAD(extattr_list_file_success, tc) ATF_TC_BODY(extattr_list_file_success, tc) { - int readbuff; + ssize_t readbuff; /* File needs to exist to call extattr_list_file(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((readbuff = extattr_list_file(path, - EXTATTR_NAMESPACE_USER, NULL, 0)) != -1); + readbuff = REQUIRE_EXTATTR_SUCCESS( + extattr_list_file(path, EXTATTR_NAMESPACE_USER, NULL, 0)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), - "extattr_list_file.*%s.*return,success,%d", path, readbuff); + "extattr_list_file.*%s.*return,success,%zd", path, readbuff); check_audit(fds, extregex, pipefd); } @@ -1062,8 +1076,8 @@ ATF_TC_BODY(extattr_list_file_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, extattr_list_file(path, - EXTATTR_NAMESPACE_USER, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_list_file(path, EXTATTR_NAMESPACE_USER, NULL, 0)); check_audit(fds, extregex, pipefd); } @@ -1082,16 +1096,17 @@ ATF_TC_HEAD(extattr_list_fd_success, tc) ATF_TC_BODY(extattr_list_fd_success, tc) { - int readbuff; + ssize_t readbuff; /* File needs to exist to call extattr_list_fd(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((readbuff = extattr_list_fd(filedesc, - EXTATTR_NAMESPACE_USER, NULL, 0)) != -1); + readbuff = REQUIRE_EXTATTR_SUCCESS( + extattr_list_fd(filedesc, EXTATTR_NAMESPACE_USER, NULL, 0)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), - "extattr_list_fd.*return,success,%d", readbuff); + "extattr_list_fd.*return,success,%zd", readbuff); check_audit(fds, extregex, pipefd); close(filedesc); } @@ -1117,8 +1132,8 @@ ATF_TC_BODY(extattr_list_fd_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, - extattr_list_fd(-1, EXTATTR_NAMESPACE_USER, NULL, 0)); + ATF_REQUIRE_ERRNO(EBADF, + extattr_list_fd(-1, EXTATTR_NAMESPACE_USER, NULL, 0) == -1); check_audit(fds, extregex, pipefd); } @@ -1137,16 +1152,17 @@ ATF_TC_HEAD(extattr_list_link_success, tc) ATF_TC_BODY(extattr_list_link_success, tc) { - int readbuff; + ssize_t readbuff; /* Symbolic link needs to exist to call extattr_list_link(2) */ ATF_REQUIRE_EQ(0, symlink("symlink", path)); - FILE *pipefd = setup(fds, auclass); + skip_if_extattr_not_supported("."); - ATF_REQUIRE((readbuff = extattr_list_link(path, - EXTATTR_NAMESPACE_USER, NULL, 0)) != -1); + FILE *pipefd = setup(fds, auclass); + readbuff = REQUIRE_EXTATTR_SUCCESS( + extattr_list_link(path, EXTATTR_NAMESPACE_USER, NULL, 0)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), - "extattr_list_link.*%s.*return,success,%d", path, readbuff); + "extattr_list_link.*%s.*return,success,%zd", path, readbuff); check_audit(fds, extregex, pipefd); } @@ -1170,8 +1186,8 @@ ATF_TC_BODY(extattr_list_link_failure, tc) "extattr_list_link.*%s.*failure", path); FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, extattr_list_link(path, - EXTATTR_NAMESPACE_USER, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_list_link(path, EXTATTR_NAMESPACE_USER, NULL, 0) == -1); check_audit(fds, extregex, pipefd); } @@ -1236,6 +1252,5 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, extattr_list_fd_failure); ATF_TP_ADD_TC(tp, extattr_list_link_success); ATF_TP_ADD_TC(tp, extattr_list_link_failure); - return (atf_no_error()); } diff --git a/tests/sys/audit/file-attribute-modify.c b/tests/sys/audit/file-attribute-modify.c index 8df1d6d2d95f..689d7a0b8d61 100644 --- a/tests/sys/audit/file-attribute-modify.c +++ b/tests/sys/audit/file-attribute-modify.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -92,7 +93,7 @@ ATF_TC_BODY(flock_failure, tc) { const char *regex = "flock.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(-1, flock(-1, LOCK_SH)); + ATF_REQUIRE_ERRNO(EBADF, flock(-1, LOCK_SH) == -1); check_audit(fds, regex, pipefd); } @@ -141,7 +142,7 @@ ATF_TC_BODY(fcntl_failure, tc) { const char *regex = "fcntl.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(-1, fcntl(-1, F_GETFL, 0)); + ATF_REQUIRE_ERRNO(EBADF, fcntl(-1, F_GETFL, 0) == -1); check_audit(fds, regex, pipefd); } @@ -189,7 +190,7 @@ ATF_TC_BODY(fsync_failure, tc) const char *regex = "fsync.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, fsync(-1)); + ATF_REQUIRE_ERRNO(EBADF, fsync(-1) == -1); check_audit(fds, regex, pipefd); } @@ -233,7 +234,7 @@ ATF_TC_BODY(chmod_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, chmod(errpath, mode)); + ATF_REQUIRE_ERRNO(ENOENT, chmod(errpath, mode) == -1); check_audit(fds, failurereg, pipefd); } @@ -281,7 +282,7 @@ ATF_TC_BODY(fchmod_failure, tc) const char *regex = "fchmod.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, fchmod(-1, mode)); + ATF_REQUIRE_ERRNO(EBADF, fchmod(-1, mode) == -1); check_audit(fds, regex, pipefd); } @@ -324,7 +325,7 @@ ATF_TC_BODY(lchmod_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, lchmod(errpath, mode)); + ATF_REQUIRE_ERRNO(ENOENT, lchmod(errpath, mode) == -1); check_audit(fds, failurereg, pipefd); } @@ -368,7 +369,7 @@ ATF_TC_BODY(fchmodat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, fchmodat(AT_FDCWD, errpath, mode, 0)); + ATF_REQUIRE_ERRNO(ENOENT, fchmodat(AT_FDCWD, errpath, mode, 0) == -1); check_audit(fds, failurereg, pipefd); } @@ -412,7 +413,7 @@ ATF_TC_BODY(chown_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, chown(errpath, uid, gid)); + ATF_REQUIRE_ERRNO(ENOENT, chown(errpath, uid, gid) == -1); check_audit(fds, failurereg, pipefd); } @@ -460,7 +461,7 @@ ATF_TC_BODY(fchown_failure, tc) const char *regex = "fchown.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, fchown(-1, uid, gid)); + ATF_REQUIRE_ERRNO(EBADF, fchown(-1, uid, gid) == -1); check_audit(fds, regex, pipefd); } @@ -503,7 +504,7 @@ ATF_TC_BODY(lchown_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: Symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lchown(errpath, uid, gid)); + ATF_REQUIRE_ERRNO(ENOENT, lchown(errpath, uid, gid) == -1); check_audit(fds, failurereg, pipefd); } @@ -547,7 +548,8 @@ ATF_TC_BODY(fchownat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, fchownat(AT_FDCWD, errpath, uid, gid, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + fchownat(AT_FDCWD, errpath, uid, gid, 0) == -1); check_audit(fds, failurereg, pipefd); } @@ -591,7 +593,7 @@ ATF_TC_BODY(chflags_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, chflags(errpath, UF_OFFLINE)); + ATF_REQUIRE_ERRNO(ENOENT, chflags(errpath, UF_OFFLINE) == -1); check_audit(fds, failurereg, pipefd); } @@ -639,7 +641,7 @@ ATF_TC_BODY(fchflags_failure, tc) const char *regex = "fchflags.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, fchflags(-1, UF_OFFLINE)); + ATF_REQUIRE_ERRNO(EBADF, fchflags(-1, UF_OFFLINE) == -1); check_audit(fds, regex, pipefd); } @@ -682,7 +684,7 @@ ATF_TC_BODY(lchflags_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: Symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lchflags(errpath, UF_OFFLINE)); + ATF_REQUIRE_ERRNO(ENOENT, lchflags(errpath, UF_OFFLINE) == -1); check_audit(fds, failurereg, pipefd); } @@ -726,7 +728,8 @@ ATF_TC_BODY(chflagsat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, chflagsat(AT_FDCWD, errpath, UF_OFFLINE, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + chflagsat(AT_FDCWD, errpath, UF_OFFLINE, 0) == -1); check_audit(fds, failurereg, pipefd); } @@ -770,7 +773,7 @@ ATF_TC_BODY(utimes_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, utimes(errpath, NULL)); + ATF_REQUIRE_ERRNO(ENOENT, utimes(errpath, NULL) == -1); check_audit(fds, failurereg, pipefd); } @@ -818,7 +821,7 @@ ATF_TC_BODY(futimes_failure, tc) const char *regex = "futimes.*return,failure : Bad file descriptor"; FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, futimes(-1, NULL)); + ATF_REQUIRE_ERRNO(EBADF, futimes(-1, NULL) == -1); check_audit(fds, regex, pipefd); } @@ -861,7 +864,7 @@ ATF_TC_BODY(lutimes_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, lutimes(errpath, NULL)); + ATF_REQUIRE_ERRNO(ENOENT, lutimes(errpath, NULL) == -1); check_audit(fds, failurereg, pipefd); } @@ -905,7 +908,7 @@ ATF_TC_BODY(futimesat_failure, tc) { FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, futimesat(AT_FDCWD, errpath, NULL)); + ATF_REQUIRE_ERRNO(ENOENT, futimesat(AT_FDCWD, errpath, NULL) == -1); check_audit(fds, failurereg, pipefd); } @@ -949,7 +952,8 @@ ATF_TC_BODY(mprotect_failure, tc) { const char *regex = "mprotect.*return,failure : Invalid argument"; FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(-1, mprotect((void *)SIZE_MAX, -1, PROT_NONE)); + ATF_REQUIRE_ERRNO(EINVAL, + mprotect((void *)SIZE_MAX, -1, PROT_NONE) == -1); check_audit(fds, regex, pipefd); } @@ -977,7 +981,7 @@ ATF_TC_BODY(undelete_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: File does not exist */ - ATF_REQUIRE_EQ(-1, undelete(errpath)); + ATF_REQUIRE_ERRNO(ENOENT, undelete(errpath) == -1); check_audit(fds, extregex, pipefd); } @@ -998,12 +1002,14 @@ ATF_TC_BODY(extattr_set_file_success, tc) { /* File needs to exist to call extattr_set_file(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); + /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_set_file.*%s.*%s.*return,success", path, name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); check_audit(fds, extregex, pipefd); close(filedesc); @@ -1030,8 +1036,9 @@ ATF_TC_BODY(extattr_set_file_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, extattr_set_file(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, NULL, 0) == + -1); check_audit(fds, extregex, pipefd); } @@ -1052,13 +1059,14 @@ ATF_TC_BODY(extattr_set_fd_success, tc) { /* File needs to exist to call extattr_set_fd(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + skip_if_extattr_not_supported(path); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_set_fd.*%s.*return,success", name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_fd(filedesc, + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_fd(filedesc, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); check_audit(fds, extregex, pipefd); close(filedesc); @@ -1085,8 +1093,8 @@ ATF_TC_BODY(extattr_set_fd_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, extattr_set_fd(-1, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(EBADF, + extattr_set_fd(-1, EXTATTR_NAMESPACE_USER, name, NULL, 0) == -1); check_audit(fds, extregex, pipefd); } @@ -1107,12 +1115,14 @@ ATF_TC_BODY(extattr_set_link_success, tc) { /* Symbolic link needs to exist to call extattr_set_link(2) */ ATF_REQUIRE_EQ(0, symlink("symlink", path)); + skip_if_extattr_not_supported("."); + /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_set_link.*%s.*%s.*return,success", path, name); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path, + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); check_audit(fds, extregex, pipefd); @@ -1138,8 +1148,9 @@ ATF_TC_BODY(extattr_set_link_failure, tc) "extattr_set_link.*%s.*%s.*failure", path, name); FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, extattr_set_link(path, - EXTATTR_NAMESPACE_USER, name, NULL, 0)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, NULL, 0) == + -1); check_audit(fds, extregex, pipefd); } @@ -1160,12 +1171,14 @@ ATF_TC_BODY(extattr_delete_file_success, tc) { /* File needs to exist to call extattr_delete_file(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + skip_if_extattr_not_supported(path); + + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((retval = extattr_delete_file(path, - EXTATTR_NAMESPACE_USER, name)) != -1); + retval = REQUIRE_EXTATTR_SUCCESS( + extattr_delete_file(path, EXTATTR_NAMESPACE_USER, name)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_delete_file.*%s.*return,success,%d", path, retval); @@ -1194,8 +1207,8 @@ ATF_TC_BODY(extattr_delete_file_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ - ATF_REQUIRE_EQ(-1, extattr_delete_file(path, - EXTATTR_NAMESPACE_USER, name)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_delete_file(path, EXTATTR_NAMESPACE_USER, name) == -1); check_audit(fds, extregex, pipefd); } @@ -1216,12 +1229,14 @@ ATF_TC_BODY(extattr_delete_fd_success, tc) { /* File needs to exist to call extattr_delete_fd(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + skip_if_extattr_not_supported(path); + + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_file(path, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((retval = extattr_delete_fd(filedesc, - EXTATTR_NAMESPACE_USER, name)) != -1); + retval = REQUIRE_EXTATTR_SUCCESS(extattr_delete_fd(filedesc, + EXTATTR_NAMESPACE_USER, name)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_delete_fd.*return,success,%d", retval); @@ -1250,7 +1265,8 @@ ATF_TC_BODY(extattr_delete_fd_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid file descriptor */ - ATF_REQUIRE_EQ(-1, extattr_delete_fd(-1, EXTATTR_NAMESPACE_USER, name)); + ATF_REQUIRE_ERRNO(EBADF, + extattr_delete_fd(-1, EXTATTR_NAMESPACE_USER, name) == -1); check_audit(fds, extregex, pipefd); } @@ -1271,12 +1287,14 @@ ATF_TC_BODY(extattr_delete_link_success, tc) { /* Symbolic link needs to exist to call extattr_delete_link(2) */ ATF_REQUIRE_EQ(0, symlink("symlink", path)); - ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path, + skip_if_extattr_not_supported("."); + + REQUIRE_EXTATTR_RESULT(sizeof(buff), extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((retval = extattr_delete_link(path, - EXTATTR_NAMESPACE_USER, name)) != -1); + retval = REQUIRE_EXTATTR_SUCCESS(extattr_delete_link(path, + EXTATTR_NAMESPACE_USER, name)); /* Prepare the regex to be checked in the audit record */ snprintf(extregex, sizeof(extregex), "extattr_delete_link.*%s.*return,success,%d", path, retval); @@ -1303,8 +1321,8 @@ ATF_TC_BODY(extattr_delete_link_failure, tc) "extattr_delete_link.*%s.*failure", path); FILE *pipefd = setup(fds, auclass); /* Failure reason: symbolic link does not exist */ - ATF_REQUIRE_EQ(-1, extattr_delete_link(path, - EXTATTR_NAMESPACE_USER, name)); + ATF_REQUIRE_ERRNO(ENOENT, + extattr_delete_link(path, EXTATTR_NAMESPACE_USER, name) == -1); check_audit(fds, extregex, pipefd); } diff --git a/tests/sys/audit/utils.c b/tests/sys/audit/utils.c index d7a1e6792b1c..be31f4138412 100644 --- a/tests/sys/audit/utils.c +++ b/tests/sys/audit/utils.c @@ -25,6 +25,8 @@ * $FreeBSD$ */ +#include +#include #include #include @@ -204,6 +206,22 @@ check_audit(struct pollfd fd[], const char *auditrgx, FILE *pipestream) { ATF_REQUIRE_EQ(0, fclose(pipestream)); } +void +skip_if_extattr_not_supported(const char *path) +{ + ssize_t result; + + /* + * Some file systems (e.g. tmpfs) do not support extattr, so we need + * skip tests that use extattrs. To detect this we can check whether + * the extattr_list_file returns EOPNOTSUPP. + */ + result = extattr_list_file(path, EXTATTR_NAMESPACE_USER, NULL, 0); + if (result == -1 && errno == EOPNOTSUPP) { + atf_tc_skip("File system does not support extattrs."); + } +} + FILE *setup(struct pollfd fd[], const char *name) { diff --git a/tests/sys/audit/utils.h b/tests/sys/audit/utils.h index 51001148c269..2f7a9e5cebb2 100644 --- a/tests/sys/audit/utils.h +++ b/tests/sys/audit/utils.h @@ -37,5 +37,26 @@ void check_audit(struct pollfd [], const char *, FILE *); FILE *setup(struct pollfd [], const char *); void cleanup(void); +void skip_if_extattr_not_supported(const char *); + +#define REQUIRE_EXTATTR_SUCCESS(call) \ + ({ \ + errno = 0; /* Reset errno before call */ \ + ssize_t result = (call); \ + if (result == -1) { \ + atf_tc_fail_requirement(__FILE__, __LINE__, \ + "%s failed with errno %d (%s)", #call, errno, \ + strerror(errno)); \ + } \ + result; \ + }) + +#define REQUIRE_EXTATTR_RESULT(_expected, expr) \ + do { \ + ssize_t expected = (_expected); \ + ssize_t _result = REQUIRE_EXTATTR_SUCCESS(expr); \ + ATF_REQUIRE_EQ_MSG(expected, _result, "%s: %zd != %zd", #expr, \ + expected, _result); \ + } while (0) #endif /* _SETUP_H_ */ From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12:02: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 07EB452F8FD; Tue, 2 Feb 2021 12:02: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 4DVNhn6KVDz4tBn; Tue, 2 Feb 2021 12:02: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 CB8845E14; Tue, 2 Feb 2021 12:02: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 112C21eB024026; Tue, 2 Feb 2021 12:02:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112C21tU024025; Tue, 2 Feb 2021 12:02:01 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:02:01 GMT Message-Id: <202102021202.112C21tU024025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ffd05df71796 - stable/13 - LinuxKPI: add firmware loading support 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ffd05df71796ff4cd56c3f8ef109d00165a9c10a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:02:02 -0000 The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ffd05df71796ff4cd56c3f8ef109d00165a9c10a commit ffd05df71796ff4cd56c3f8ef109d00165a9c10a Author: Bjoern A. Zeeb AuthorDate: 2021-01-28 16:05:32 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-02-02 11:50:38 +0000 LinuxKPI: add firmware loading support Implement linux firmware KPI compat code. This includes: request_firmware() request_firmware_nowait(), request_firmware_direct(), firmware_request_nowarn(), and release_firmware(). Given we will try to map requested names from natively ported or full-linuxkpi-using drivers to a firmware(9) auto-loading name format (.ko file name and image name matching), we quieten firmware(9) and print success or failure (unless the _nowarn() version was called) in the linuxkpi implementation. At the moment we try up-to 4 different naming combinations, with path stripped, original name, and requested name with '/' or '.' replaced. We do not currently defer loading in the "nowait" case. Sponsored-by: The FreeBSD Foundation Sponsored-by: Rubicon Communications, LLC ("Netgate") (firmware(9) nowarn update from D27413) MFC after: 3 days Reviewed by: kib, manu (looked at older versions) Differential Revision: https://reviews.freebsd.org/D27414 (cherry picked from commit a6c2507d1baedb183268e31bc6b6f659a9529904) (cherry picked from commit 4a26380ba6dc487a7525d909ee29fbc710b558d1) --- .../linuxkpi/common/include/linux/firmware.h | 105 ++++++++++++ sys/compat/linuxkpi/common/src/linux_firmware.c | 178 +++++++++++++++++++++ sys/compat/linuxkpi/common/src/linux_kmod.c | 1 + sys/conf/files | 2 + sys/modules/linuxkpi/Makefile | 1 + 5 files changed, 287 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/firmware.h b/sys/compat/linuxkpi/common/include/linux/firmware.h new file mode 100644 index 000000000000..ada7d0d73edf --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/firmware.h @@ -0,0 +1,105 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020-2021 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb 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. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_LINUX_FIRMWARE_H +#define _LINUXKPI_LINUX_FIRMWARE_H + +#include +#include +#include + +struct firmware; + +struct linuxkpi_firmware { + size_t size; + const uint8_t *data; + /* XXX Does Linux expose anything else? */ + + /* This is LinuxKPI implementation private. */ + const struct firmware *fbdfw; +}; + +int linuxkpi_request_firmware_nowait(struct module *, bool, const char *, + struct device *, gfp_t, void *, + void(*cont)(const struct linuxkpi_firmware *, void *)); +int linuxkpi_request_firmware(const struct linuxkpi_firmware **, + const char *, struct device *); +int linuxkpi_firmware_request_nowarn(const struct linuxkpi_firmware **, + const char *, struct device *); +void linuxkpi_release_firmware(const struct linuxkpi_firmware *); + + +static __inline int +request_firmware_nowait(struct module *mod, bool _t, + const char *fw_name, struct device *dev, gfp_t gfp, void *drv, + void(*cont)(const struct linuxkpi_firmware *, void *)) +{ + + + return (linuxkpi_request_firmware_nowait(mod, _t, fw_name, dev, gfp, + drv, cont)); +} + +static __inline int +request_firmware(const struct linuxkpi_firmware **fw, + const char *fw_name, struct device *dev) +{ + + return (linuxkpi_request_firmware(fw, fw_name, dev)); +} + +static __inline int +request_firmware_direct(const struct linuxkpi_firmware **fw, + const char *fw_name, struct device *dev) +{ + + return (linuxkpi_request_firmware(fw, fw_name, dev)); +} + +static __inline int +firmware_request_nowarn(const struct linuxkpi_firmware **fw, + const char *fw_name, struct device *dev) +{ + + return (linuxkpi_firmware_request_nowarn(fw, fw_name, dev)); +} + +static __inline void +release_firmware(const struct linuxkpi_firmware *fw) +{ + + linuxkpi_release_firmware(fw); +} + +#define firmware linuxkpi_firmware + +#endif /* _LINUXKPI_LINUX_FIRMWARE_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_firmware.c b/sys/compat/linuxkpi/common/src/linux_firmware.c new file mode 100644 index 000000000000..75147a311827 --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linux_firmware.c @@ -0,0 +1,178 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020-2021 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb 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. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include +#include + +#include +#undef firmware + +MALLOC_DEFINE(M_LKPI_FW, "lkpifw", "LinuxKPI firmware"); + +static int +_linuxkpi_request_firmware(const char *fw_name, const struct linuxkpi_firmware **fw, + struct device *dev, gfp_t gfp __unused, bool enoentok, bool warn) +{ + const struct firmware *fbdfw; + struct linuxkpi_firmware *lfw; + const char *fwimg; + char *p; + uint32_t flags; + + if (fw_name == NULL || fw == NULL || dev == NULL) + return (-EINVAL); + + /* Set independent on "warn". To debug, bootverbose is avail. */ + flags = FIRMWARE_GET_NOWARN; + + KASSERT(gfp == GFP_KERNEL, ("%s: gfp %#x\n", __func__, gfp)); + lfw = malloc(sizeof(*lfw), M_LKPI_FW, M_WAITOK | M_ZERO); + + /* + * Linux can have a path in the firmware which is hard to replicate + * for auto-firmware-module-loading. + * On FreeBSD, depending on what people do, the firmware will either + * be called "fw", or "dir_fw", or "modname_dir_fw". The latter the + * driver author has to deal with herself (requesting the special name). + * We also optionally flatten '/'s and '.'s as some firmware modules do. + * We probe in the least-of-work order avoiding memory operations. + * It will be preferred to build the firmware .ko in a well matching + * way rather than adding more name-mangling-hacks here in the future + * (though we could if needed). + */ + /* (1) Try any name removed of path. */ + fwimg = strrchr(fw_name, '/'); + if (fwimg != NULL) + fwimg++; + if (fwimg == NULL || *fwimg == '\0') + fwimg = fw_name; + fbdfw = firmware_get_flags(fwimg, flags); + /* (2) Try the original name if we have not yet. */ + if (fbdfw == NULL && fwimg != fw_name) { + fwimg = fw_name; + fbdfw = firmware_get_flags(fwimg, flags); + } + /* (3) Flatten '/' and then '.' to '_' and try with adjusted name. */ + if (fbdfw == NULL && + (strchr(fw_name, '/') != NULL || strchr(fw_name, '.') != NULL)) { + fwimg = strdup(fw_name, M_LKPI_FW); + if (fwimg != NULL) { + while ((p = strchr(fwimg, '/')) != NULL) + *p = '_'; + fbdfw = firmware_get_flags(fwimg, flags); + if (fbdfw == NULL) { + while ((p = strchr(fwimg, '.')) != NULL) + *p = '_'; + fbdfw = firmware_get_flags(fwimg, flags); + } + free(__DECONST(void *, fwimg), M_LKPI_FW); + } + } + if (fbdfw == NULL) { + if (enoentok) + *fw = lfw; + else { + free(lfw, M_LKPI_FW); + *fw = NULL; + } + if (warn) + device_printf(dev->bsddev, "could not load firmware " + "image '%s'\n", fw_name); + return (-ENOENT); + } + + device_printf(dev->bsddev,"successfully loaded firmware image '%s'\n", + fw_name); + lfw->fbdfw = fbdfw; + lfw->data = (const uint8_t *)fbdfw->data; + lfw->size = fbdfw->datasize; + *fw = lfw; + return (0); +} + +int +linuxkpi_request_firmware_nowait(struct module *mod __unused, bool _t __unused, + const char *fw_name, struct device *dev, gfp_t gfp, void *drv, + void(*cont)(const struct linuxkpi_firmware *, void *)) +{ + const struct linuxkpi_firmware *lfw; + int error; + + /* + * Linux seems to run the callback if it cannot find the firmware. + * The fact that this is "_nowait()" and has a callback seems to + * imply that this is run in a deferred conext which we currently + * do not do. Should it become necessary (a driver actually requiring + * it) we would need to implement it here. + */ + error = _linuxkpi_request_firmware(fw_name, &lfw, dev, gfp, true, true); + if (error == -ENOENT) + error = 0; + if (error == 0) + cont(lfw, drv); + + return (error); +} + +int +linuxkpi_request_firmware(const struct linuxkpi_firmware **fw, + const char *fw_name, struct device *dev) +{ + + return (_linuxkpi_request_firmware(fw_name, fw, dev, GFP_KERNEL, false, + true)); +} + +int +linuxkpi_firmware_request_nowarn(const struct linuxkpi_firmware **fw, + const char *fw_name, struct device *dev) +{ + + return (_linuxkpi_request_firmware(fw_name, fw, dev, GFP_KERNEL, false, + false)); +} + +void +linuxkpi_release_firmware(const struct linuxkpi_firmware *fw) +{ + + if (fw == NULL) + return; + + if (fw->fbdfw) + firmware_put(fw->fbdfw, FIRMWARE_UNLOAD); + free(__DECONST(void *, fw), M_LKPI_FW); +} diff --git a/sys/compat/linuxkpi/common/src/linux_kmod.c b/sys/compat/linuxkpi/common/src/linux_kmod.c index b9a916da650f..7fd73f0a7f45 100644 --- a/sys/compat/linuxkpi/common/src/linux_kmod.c +++ b/sys/compat/linuxkpi/common/src/linux_kmod.c @@ -31,5 +31,6 @@ __FBSDID("$FreeBSD$"); #include MODULE_VERSION(linuxkpi, 1); +MODULE_DEPEND(linuxkpi, firmware, 1, 1, 1); MODULE_DEPEND(linuxkpi, backlight, 1, 1, 1); MODULE_DEPEND(linuxkpi, pci, 1, 1, 1); diff --git a/sys/conf/files b/sys/conf/files index 552c496e922a..c7f6e97a6172 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4558,6 +4558,8 @@ compat/linuxkpi/common/src/linux_current.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_dmi.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_firmware.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_hrtimer.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_kthread.c optional compat_linuxkpi \ diff --git a/sys/modules/linuxkpi/Makefile b/sys/modules/linuxkpi/Makefile index f9ae0e60e339..7bb4080fa81d 100644 --- a/sys/modules/linuxkpi/Makefile +++ b/sys/modules/linuxkpi/Makefile @@ -5,6 +5,7 @@ KMOD= linuxkpi SRCS= linux_compat.c \ linux_current.c \ linux_dmi.c \ + linux_firmware.c \ linux_hrtimer.c \ linux_idr.c \ linux_kmod.c \ From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12:02: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 5AEF852FB84; Tue, 2 Feb 2021 12:02: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 4DVNhq1516z4t68; Tue, 2 Feb 2021 12:02: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 15E2B6004; Tue, 2 Feb 2021 12:02: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 112C22tm024049; Tue, 2 Feb 2021 12:02:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112C22KH024048; Tue, 2 Feb 2021 12:02:02 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:02:02 GMT Message-Id: <202102021202.112C22KH024048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ec06521ee872 - stable/13 - LinuxKPI: upstream a collection of drm-kmod conflicting changes 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ec06521ee8728a8d3321bc8eb115a425524dd968 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:02:03 -0000 The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ec06521ee8728a8d3321bc8eb115a425524dd968 commit ec06521ee8728a8d3321bc8eb115a425524dd968 Author: Bjoern A. Zeeb AuthorDate: 2021-01-28 16:15:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-02-02 11:51:15 +0000 LinuxKPI: upstream a collection of drm-kmod conflicting changes The upcoming in-kernel implementations for LinuxKPI based on work on iwlwifi (and other wireless drivers) conflicts in a few places with the drm-kmod graphics work outside the base system. In order to transition smoothly extract the conflicting bits. This included "unaligned" accessor functions, sg_pcopy_from_buffer(), IS_*() macros (to be further restricted in the future), power management bits (possibly no longer conflicting with DRM), and other minor changes. Obtained-from: bz_iwlwifi Sponsored-by: The FreeBSD Foundation MFC after: 3 days Reviewed by: kib, hselasky, manu, bdragon (looked at earlier versions) Differential Revision: https://reviews.freebsd.org/D26598 (cherry picked from commit 4abbf816bf06aa70200c5d1d976dd61c2752bdaf) --- sys/compat/linuxkpi/common/include/asm/unaligned.h | 78 ++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/kernel.h | 42 ++++++++++++ sys/compat/linuxkpi/common/include/linux/kobject.h | 14 ++++ sys/compat/linuxkpi/common/include/linux/lockdep.h | 1 + sys/compat/linuxkpi/common/include/linux/pm.h | 52 +++++++++++++++ .../linuxkpi/common/include/linux/scatterlist.h | 54 +++++++++++++++ 6 files changed, 241 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/asm/unaligned.h b/sys/compat/linuxkpi/common/include/asm/unaligned.h new file mode 100644 index 000000000000..7597f00f7596 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/asm/unaligned.h @@ -0,0 +1,78 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb 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. + * + * $FreeBSD$ + */ + +#ifndef _ASM_UNALIGNED_H +#define _ASM_UNALIGNED_H + +#include +#include + +static __inline uint32_t +get_unaligned_le32(const void *p) +{ + + return (le32_to_cpup((const __le32 *)p)); +} + +static __inline void +put_unaligned_le32(__le32 v, void *p) +{ + __le32 x; + + x = cpu_to_le32(v); + memcpy(p, &x, sizeof(x)); +} + +static __inline void +put_unaligned_le64(__le64 v, void *p) +{ + __le64 x; + + x = cpu_to_le64(v); + memcpy(p, &x, sizeof(x)); +} + +static __inline uint16_t +get_unaligned_be16(const void *p) +{ + + return (be16_to_cpup((const __be16 *)p)); +} + +static __inline uint32_t +get_unaligned_be32(const void *p) +{ + + return (be32_to_cpup((const __be32 *)p)); +} + +#endif /* _ASM_UNALIGNED_H */ diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 9b0a2df72322..daef6216a151 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -593,4 +593,46 @@ linux_ratelimited(linux_ratelimit_t *rl) #define TAINT_WARN 0 #define test_taint(x) (0) +/* + * Checking if an option is defined would be easy if we could do CPP inside CPP. + * The defined case whether -Dxxx or -Dxxx=1 are easy to deal with. In either + * case the defined value is "1". A more general -Dxxx= case will require + * more effort to deal with all possible "true" values. Hope we do not have + * to do this as well. + * The real problem is the undefined case. To avoid this problem we do the + * concat/varargs trick: "yyy" ## xxx can make two arguments if xxx is "1" + * by having a #define for yyy_1 which is "ignore,". + * Otherwise we will just get "yyy". + * Need to be careful about variable substitutions in macros though. + * This way we make a (true, false) problem a (don't care, true, false) or a + * (don't care true, false). Then we can use a variadic macro to only select + * the always well known and defined argument #2. And that seems to be + * exactly what we need. Use 1 for true and 0 for false to also allow + * #if IS_*() checks pre-compiler checks which do not like #if true. + */ +#define ___XAB_1 dontcare, +#define ___IS_XAB(_ignore, _x, ...) (_x) +#define __IS_XAB(_x) ___IS_XAB(_x 1, 0) +#define _IS_XAB(_x) __IS_XAB(__CONCAT(___XAB_, _x)) + +/* This is if CONFIG_ccc=y. */ +#define IS_BUILTIN(_x) _IS_XAB(_x) +/* This is if CONFIG_ccc=m. */ +#define IS_MODULE(_x) _IS_XAB(_x ## _MODULE) +/* This is if CONFIG_ccc is compiled in(=y) or a module(=m). */ +#define IS_ENABLED(_x) (IS_BUILTIN(_x) || IS_MODULE(_x)) +/* + * This is weird case. If the CONFIG_ccc is builtin (=y) this returns true; + * or if the CONFIG_ccc is a module (=m) and the caller is built as a module + * (-DMODULE defined) this returns true, but if the callers is not a module + * (-DMODULE not defined, which means caller is BUILTIN) then it returns + * false. In other words, a module can reach the kernel, a module can reach + * a module, but the kernel cannot reach a module, and code never compiled + * cannot be reached either. + * XXX -- I'd hope the module-to-module case would be handled by a proper + * module dependency definition (MODULE_DEPEND() in FreeBSD). + */ +#define IS_REACHABLE(_x) (IS_BUILTIN(_x) || \ + (IS_MODULE(_x) && IS_BUILTIN(MODULE))) + #endif /* _LINUX_KERNEL_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/kobject.h b/sys/compat/linuxkpi/common/include/linux/kobject.h index bd9e1c4ec6f5..403ec1495c32 100644 --- a/sys/compat/linuxkpi/common/include/linux/kobject.h +++ b/sys/compat/linuxkpi/common/include/linux/kobject.h @@ -41,6 +41,8 @@ struct kobject; struct sysctl_oid; +#define KOBJ_CHANGE 0x01 + struct kobj_type { void (*release)(struct kobject *kobj); const struct sysfs_ops *sysfs_ops; @@ -151,4 +153,16 @@ int kobject_set_name(struct kobject *kobj, const char *fmt, ...); int kobject_init_and_add(struct kobject *kobj, const struct kobj_type *ktype, struct kobject *parent, const char *fmt, ...); +static __inline void +kobject_uevent_env(struct kobject *kobj, int action, char *envp[]) +{ + + /* + * iwlwifi(4) sends an INACCESSIBLE event when it detects that the card + * (pice endpoint) is gone and it attempts a removal cleanup. + * Not sure if we do anything related to udev/sysfs at the moment or + * need a shortcut or simply ignore it (for now). + */ +} + #endif /* _LINUX_KOBJECT_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index d2b3d4485dde..a86157ba5924 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -42,6 +42,7 @@ struct lock_class_key { #define lockdep_set_class_and_name(lock, key, name) #define lockdep_set_current_reclaim_state(g) do { } while (0) #define lockdep_clear_current_reclaim_state() do { } while (0) +#define lockdep_init_map(_map, _name, _key, _x) do { } while(0) #ifdef INVARIANTS #define lockdep_assert_held(m) do { \ diff --git a/sys/compat/linuxkpi/common/include/linux/pm.h b/sys/compat/linuxkpi/common/include/linux/pm.h new file mode 100644 index 000000000000..6b8a7e768a8c --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/pm.h @@ -0,0 +1,52 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb 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. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_LINUX_PM_H +#define _LINUXKPI_LINUX_PM_H + +#ifdef CONFIG_PM_SLEEP +#define SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ +const struct dev_pm_ops _name = { \ + .suspend = _suspendfunc, \ + .resume = _resumefunc, \ + .freeze = _suspendfunc, \ + .thaw = _resumefunc, \ + .poweroff = _suspendfunc, \ + .restore = _resumefunc, \ +} +#else +#define SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \ +const struct dev_pm_ops _name = { \ +} +#endif + +#endif /* _LINUXKPI_LINUX_PM_H */ diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index 9104cb8dd78a..ebf0632f6f58 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -32,6 +32,9 @@ #ifndef _LINUX_SCATTERLIST_H_ #define _LINUX_SCATTERLIST_H_ +#include +#include + #include #include #include @@ -479,4 +482,55 @@ sg_page_iter_page(struct sg_page_iter *piter) return (nth_page(sg_page(piter->sg), piter->sg_pgoffset)); } +static __inline size_t +sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents, + const void *buf, size_t buflen, off_t skip) +{ + struct sg_page_iter piter; + struct page *page; + struct sf_buf *sf; + size_t len, copied; + char *p, *b; + + if (buflen == 0) + return (0); + + b = __DECONST(char *, buf); + copied = 0; + sched_pin(); + for_each_sg_page(sgl, &piter, nents, 0) { + + /* Skip to the start. */ + if (piter.sg->length <= skip) { + skip -= piter.sg->length; + continue; + } + + /* See how much to copy. */ + KASSERT(((piter.sg->length - skip) != 0 && (buflen != 0)), + ("%s: sg len %u - skip %ju || buflen %zu is 0\n", + __func__, piter.sg->length, (uintmax_t)skip, buflen)); + len = min(piter.sg->length - skip, buflen); + + page = sg_page_iter_page(&piter); + sf = sf_buf_alloc(page, SFB_CPUPRIVATE | SFB_NOWAIT); + if (sf == NULL) + break; + p = (char *)sf_buf_kva(sf) + piter.sg_pgoffset + skip; + memcpy(p, b, len); + sf_buf_free(sf); + + copied += len; + /* Either we exactly filled the page, or we are done. */ + buflen -= len; + if (buflen == 0) + break; + skip -= len; + b += len; + } + sched_unpin(); + + return (copied); +} + #endif /* _LINUX_SCATTERLIST_H_ */ From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12:02: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 A9E8052FA19; Tue, 2 Feb 2021 12:02:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVNhr4J3wz4tKZ; Tue, 2 Feb 2021 12:02: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 3B57C5DBA; Tue, 2 Feb 2021 12:02: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 112C24rX024067; Tue, 2 Feb 2021 12:02:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112C24aO024066; Tue, 2 Feb 2021 12:02:04 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:02:04 GMT Message-Id: <202102021202.112C24aO024066@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3ac9e87b762c - stable/13 - LinuxKPI: enhance PCI bits for DRM 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3ac9e87b762c711642c870fb7a43b84d812a6e91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:02:04 -0000 The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3ac9e87b762c711642c870fb7a43b84d812a6e91 commit 3ac9e87b762c711642c870fb7a43b84d812a6e91 Author: Bjoern A. Zeeb AuthorDate: 2021-01-28 16:23:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-02-02 11:51:20 +0000 LinuxKPI: enhance PCI bits for DRM In pci_domain_nr() directly return the domain which got set in lkpifill_pci_dev() in all cases. This was missed between D27550 and 105a37cac76b971f7a94409fbdc4f508a7e97fa0 . In order to implement pci_dev_put() harmonize further code (which was started in the aforementioned commit) and add kobj related bits (through the now common lkpifill_pci_dev() code) to the DRM specific calls without adding the DRM allocated pci devices to the pci_devices list. Add a release for the lkpinew_pci_dev() (DRM) case so freeing will work. This allows the DRM created devices to use the normal kobj/refcount logic and work with, e.g., pci_dev_put(). (For a slightly more detailed code walk see the review). Sponsored-by: The FreeBSD Foundation Obtained-from: bz_iwlwifi (partially) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28188 (cherry picked from commit 1fac2cb4d6e5cfa1b8ff689213011b0fe077ffa7) --- sys/compat/linuxkpi/common/include/linux/pci.h | 10 +++++- sys/compat/linuxkpi/common/src/linux_pci.c | 42 +++++++++++++++----------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 6338f5795f0a..ddb3f0b222a5 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -338,6 +338,14 @@ pci_set_drvdata(struct pci_dev *pdev, void *data) dev_set_drvdata(&pdev->dev, data); } +static __inline void +pci_dev_put(struct pci_dev *pdev) +{ + + if (pdev != NULL) + put_device(&pdev->dev); +} + static inline int pci_enable_device(struct pci_dev *pdev) { @@ -1094,7 +1102,7 @@ static inline int pci_domain_nr(struct pci_bus *pbus) { - return (pci_get_domain(pbus->self->dev.bsddev)); + return (pbus->domain); } static inline int diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 0e184b64884b..075df3c2adf7 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -220,24 +220,42 @@ lkpifill_pci_dev(device_t dev, struct pci_dev *pdev) pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev)); pdev->vendor = pci_get_vendor(dev); pdev->device = pci_get_device(dev); + pdev->subsystem_vendor = pci_get_subvendor(dev); + pdev->subsystem_device = pci_get_subdevice(dev); pdev->class = pci_get_class(dev); pdev->revision = pci_get_revid(dev); - pdev->dev.bsddev = dev; + pdev->bus = malloc(sizeof(*pdev->bus), M_DEVBUF, M_WAITOK | M_ZERO); pdev->bus->self = pdev; pdev->bus->number = pci_get_bus(dev); pdev->bus->domain = pci_get_domain(dev); + pdev->dev.bsddev = dev; + pdev->dev.parent = &linux_root_device; + INIT_LIST_HEAD(&pdev->dev.irqents); + kobject_init(&pdev->dev.kobj, &linux_dev_ktype); + kobject_set_name(&pdev->dev.kobj, device_get_nameunit(dev)); + kobject_add(&pdev->dev.kobj, &linux_root_device.kobj, + kobject_name(&pdev->dev.kobj)); +} + +static void +lkpinew_pci_dev_release(struct device *dev) +{ + struct pci_dev *pdev; + + pdev = to_pci_dev(dev); + free(pdev->bus, M_DEVBUF); + free(pdev, M_DEVBUF); } static struct pci_dev * lkpinew_pci_dev(device_t dev) { struct pci_dev *pdev; - struct pci_bus *pbus; pdev = malloc(sizeof(*pdev), M_DEVBUF, M_WAITOK|M_ZERO); - pbus = malloc(sizeof(*pbus), M_DEVBUF, M_WAITOK|M_ZERO); - pdev->bus = pbus; lkpifill_pci_dev(dev, pdev); + pdev->dev.release = lkpinew_pci_dev_release; + return (pdev); } @@ -309,7 +327,6 @@ linux_pci_attach_device(device_t dev, struct pci_driver *pdrv, const struct pci_device_id *id, struct pci_dev *pdev) { struct resource_list_entry *rle; - struct pci_devinfo *dinfo; device_t parent; uintptr_t rid; int error; @@ -321,30 +338,19 @@ linux_pci_attach_device(device_t dev, struct pci_driver *pdrv, isdrm = pdrv != NULL && pdrv->isdrm; if (isdrm) { + struct pci_devinfo *dinfo; + dinfo = device_get_ivars(parent); device_set_ivars(dev, dinfo); - } else { - dinfo = device_get_ivars(dev); } - pdev->bus = malloc(sizeof(*pdev->bus), M_DEVBUF, M_WAITOK | M_ZERO); lkpifill_pci_dev(dev, pdev); - pdev->dev.parent = &linux_root_device; - INIT_LIST_HEAD(&pdev->dev.irqents); if (isdrm) PCI_GET_ID(device_get_parent(parent), parent, PCI_ID_RID, &rid); else PCI_GET_ID(parent, dev, PCI_ID_RID, &rid); pdev->devfn = rid; - pdev->device = dinfo->cfg.device; - pdev->vendor = dinfo->cfg.vendor; - pdev->subsystem_vendor = dinfo->cfg.subvendor; - pdev->subsystem_device = dinfo->cfg.subdevice; pdev->pdrv = pdrv; - kobject_init(&pdev->dev.kobj, &linux_dev_ktype); - kobject_set_name(&pdev->dev.kobj, device_get_nameunit(dev)); - kobject_add(&pdev->dev.kobj, &linux_root_device.kobj, - kobject_name(&pdev->dev.kobj)); rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 0); if (rle != NULL) pdev->dev.irq = rle->start; From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12:02: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 981BC52FB87; Tue, 2 Feb 2021 12:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVNhs2fh0z4t6J; Tue, 2 Feb 2021 12:02: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 471DC57EC; Tue, 2 Feb 2021 12:02: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 112C25mg024089; Tue, 2 Feb 2021 12:02:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112C25jt024088; Tue, 2 Feb 2021 12:02:05 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:02:05 GMT Message-Id: <202102021202.112C25jt024088@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ff119f7c4a38 - stable/13 - LinuxKPI: implement devres() framework parts and two examples 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ff119f7c4a3894e20190cca37ca00c9fef88a6df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:02:05 -0000 The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ff119f7c4a3894e20190cca37ca00c9fef88a6df commit ff119f7c4a3894e20190cca37ca00c9fef88a6df Author: Bjoern A. Zeeb AuthorDate: 2021-01-28 16:32:43 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-02-02 11:51:26 +0000 LinuxKPI: implement devres() framework parts and two examples This code implements a version of the devres framework found working for various iwlwifi use cases and also providing functions for ttm_page_alloc_dma.c from DRM. Part of the framework replicates the consumed KPI, while others are internal helper functions. In addition the simple devm_k*malloc() consumers were implemented and kvasprintf() was enhanced to also work for the devm_kasprintf() case. Addmittingly lkpi_devm_kmalloc_release() could be avoided but for the overall understanding of the code and possible memory tracing it may still be helpful. Further devsres consumer are implemented for iwlwifi but will follow later as the main reason for this change is to sort out overlap with DRM. Sponsored-by: The FreeBSD Foundation Obtained-from: bz_iwlwifi MFC After: 3 days Reviewed-by: hselasky, manu Differential Revision: https://reviews.freebsd.org/D28189 (cherry picked from commit fa765ca73e553399ffbad382e579e4c2b4d0fc12) --- sys/compat/linuxkpi/common/include/linux/device.h | 42 ++++ sys/compat/linuxkpi/common/src/linux_compat.c | 29 ++- sys/compat/linuxkpi/common/src/linux_devres.c | 226 ++++++++++++++++++++++ sys/conf/files | 2 + sys/modules/linuxkpi/Makefile | 1 + 5 files changed, 297 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index a55f6b0215ce..2ffe70f45c6e 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -562,5 +562,47 @@ dev_to_node(struct device *dev) char *kvasprintf(gfp_t, const char *, va_list); char *kasprintf(gfp_t, const char *, ...); +char *lkpi_devm_kasprintf(struct device *, gfp_t, const char *, ...); + +#define devm_kasprintf(_dev, _gfp, _fmt, ...) \ + lkpi_devm_kasprintf(_dev, _gfp, _fmt, ##__VA_ARGS__) + +void *lkpi_devres_alloc(void(*release)(struct device *, void *), size_t, gfp_t); +void lkpi_devres_add(struct device *, void *); +void lkpi_devres_free(void *); +void *lkpi_devres_find(struct device *, void(*release)(struct device *, void *), + int (*match)(struct device *, void *, void *), void *); +int lkpi_devres_destroy(struct device *, void(*release)(struct device *, void *), + int (*match)(struct device *, void *, void *), void *); +#define devres_alloc(_r, _s, _g) lkpi_devres_alloc(_r, _s, _g) +#define devres_add(_d, _p) lkpi_devres_add(_d, _p) +#define devres_free(_p) lkpi_devres_free(_p) +#define devres_find(_d, _rfn, _mfn, _mp) \ + lkpi_devres_find(_d, _rfn, _mfn, _mp) +#define devres_destroy(_d, _rfn, _mfn, _mp) \ + lkpi_devres_destroy(_d, _rfn, _mfn, _mp) + +/* LinuxKPI internal functions. */ +void lkpi_devres_release_free_list(struct device *); +void lkpi_devres_unlink(struct device *, void *); +void lkpi_devm_kmalloc_release(struct device *, void *); + +static __inline void * +devm_kmalloc(struct device *dev, size_t size, gfp_t gfp) +{ + void *p; + + p = lkpi_devres_alloc(lkpi_devm_kmalloc_release, size, gfp); + if (p != NULL) + lkpi_devres_add(dev, p); + + return (p); +} + +#define devm_kzalloc(_dev, _size, _gfp) \ + devm_kmalloc((_dev), (_size), (_gfp) | __GFP_ZERO) + +#define devm_kcalloc(_dev, _sizen, _size, _gfp) \ + devm_kmalloc((_dev), ((_sizen) * (_size)), (_gfp) | __GFP_ZERO) #endif /* _LINUX_DEVICE_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index b73f6fed03af..2ad936311204 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1854,8 +1854,8 @@ vunmap(void *addr) kfree(vmmap); } -char * -kvasprintf(gfp_t gfp, const char *fmt, va_list ap) +static char * +devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt, va_list ap) { unsigned int len; char *p; @@ -1865,13 +1865,36 @@ kvasprintf(gfp_t gfp, const char *fmt, va_list ap) len = vsnprintf(NULL, 0, fmt, aq); va_end(aq); - p = kmalloc(len + 1, gfp); + if (dev != NULL) + p = devm_kmalloc(dev, len + 1, gfp); + else + p = kmalloc(len + 1, gfp); if (p != NULL) vsnprintf(p, len + 1, fmt, ap); return (p); } +char * +kvasprintf(gfp_t gfp, const char *fmt, va_list ap) +{ + + return (devm_kvasprintf(NULL, gfp, fmt, ap)); +} + +char * +lkpi_devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...) +{ + va_list ap; + char *p; + + va_start(ap, fmt); + p = devm_kvasprintf(dev, gfp, fmt, ap); + va_end(ap); + + return (p); +} + char * kasprintf(gfp_t gfp, const char *fmt, ...) { diff --git a/sys/compat/linuxkpi/common/src/linux_devres.c b/sys/compat/linuxkpi/common/src/linux_devres.c new file mode 100644 index 000000000000..96ff3e486d1d --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linux_devres.c @@ -0,0 +1,226 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020-2021 The FreeBSD Foundation + * + * This software was developed by Bj\xc3\xb6rn Zeeb 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +/* + * Linux devres KPI implementation. + */ + +struct devres { + struct list_head entry; + void (*release)(struct device *, void *); + + /* Must come last. */ + uint8_t __drdata[0] __aligned(CACHE_LINE_SIZE); +}; + +void * +lkpi_devres_alloc(void(*release)(struct device *, void *), + size_t size, gfp_t gfp) +{ + void *p; + struct devres *dr; + size_t total; + + if (size == 0) + return (NULL); + + total = sizeof(*dr) + size; + dr = kmalloc(total, gfp); + if (dr == NULL) + return (NULL); + + INIT_LIST_HEAD(&dr->entry); + dr->release = release; + p = (void *)(dr+1); + + return (p); +} + +static void +lkpi_devres_free_dr(struct devres *dr) +{ + + /* + * We have no dev, so cannot lock. This means someone else has + * to do this prior to us if devres_add() had been called. + */ + KASSERT(list_empty_careful(&dr->entry), + ("%s: dr %p still on devres_head\n", __func__, dr)); + kfree(dr); +} + +void +lkpi_devres_free(void *p) +{ + struct devres *dr; + + if (p == NULL) + return; + + dr = container_of(p, struct devres, __drdata); + lkpi_devres_free_dr(dr); +} + +void +lkpi_devres_add(struct device *dev, void *p) +{ + struct devres *dr; + + KASSERT(dev != NULL && p != NULL, ("%s: dev %p p %p\n", + __func__, dev, p)); + + dr = container_of(p, struct devres, __drdata); + spin_lock(&dev->devres_lock); + list_add(&dr->entry, &dev->devres_head); + spin_unlock(&dev->devres_lock); +} + +static struct devres * +lkpi_devres_find_dr(struct device *dev, void(*release)(struct device *, void *), + int (*match)(struct device *, void *, void *), void *mp) +{ + struct devres *dr, *next; + void *p; + + KASSERT(dev != NULL, ("%s: dev %p\n", __func__, dev)); + assert_spin_locked(&dev->devres_lock); + + list_for_each_entry_safe(dr, next, &dev->devres_head, entry) { + if (dr->release != release) + continue; + p = (void *)(dr+1); + if (match != NULL && match(dev, p, mp) == false) + continue; + return (dr); + } + + return (NULL); +} + +void * +lkpi_devres_find(struct device *dev, void(*release)(struct device *, void *), + int (*match)(struct device *, void *, void *), void *mp) +{ + struct devres *dr; + + KASSERT(dev != NULL, ("%s: dev %p\n", __func__, dev)); + + spin_lock(&dev->devres_lock); + dr = lkpi_devres_find_dr(dev, release, match, mp); + spin_unlock(&dev->devres_lock); + + if (dr == NULL) + return (NULL); + + return ((void *)(dr + 1)); +} + +static void +lkpi_devres_unlink_locked(struct device *dev, struct devres *dr) +{ + KASSERT(dev != NULL, ("%s: dev %p\n", __func__, dev)); + KASSERT(dr != NULL, ("%s: dr %p\n", __func__, dr)); + assert_spin_locked(&dev->devres_lock); + + list_del_init(&dr->entry); +} + +void +lkpi_devres_unlink(struct device *dev, void *p) +{ + struct devres *dr; + + KASSERT(dev != NULL && p != NULL, ("%s: dev %p p %p\n", + __func__, dev, p)); + + dr = container_of(p, struct devres, __drdata); + spin_lock(&dev->devres_lock); + lkpi_devres_unlink_locked(dev, dr); + spin_unlock(&dev->devres_lock); +} + +/* This is called on device free. */ +void +lkpi_devres_release_free_list(struct device *dev) +{ + struct devres *dr, *next; + void *p; + + /* Free any resources allocated on the device. */ + /* No need to lock anymore. */ + list_for_each_entry_safe(dr, next, &dev->devres_head, entry) { + p = (void *)(dr+1); + if (dr->release != NULL) + dr->release(dev, p); + /* This should probably be a function of some kind. */ + list_del_init(&dr->entry); + lkpi_devres_free(p); + } +} + +int +lkpi_devres_destroy(struct device *dev, void(*release)(struct device *, void *), + int (*match)(struct device *, void *, void *), void *mp) +{ + struct devres *dr; + + spin_lock(&dev->devres_lock); + dr = lkpi_devres_find_dr(dev, release, match, mp); + if (dr != NULL) + lkpi_devres_unlink_locked(dev, dr); + spin_unlock(&dev->devres_lock); + + if (dr == NULL) + return (-ENOENT); + lkpi_devres_free_dr(dr); + + return (0); +} + +/* + * Devres release function for k*malloc(). + * While there is nothing to do here adding, e.g., tracing would be + * possible so we leave the empty function here. + * Also good for documentation as it is the simplest example. + */ +void +lkpi_devm_kmalloc_release(struct device *dev __unused, void *p __unused) +{ + + /* Nothing to do. Freed with the devres. */ +} diff --git a/sys/conf/files b/sys/conf/files index c7f6e97a6172..f0bf574b3236 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4556,6 +4556,8 @@ compat/linuxkpi/common/src/linux_compat.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_current.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_devres.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_dmi.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_firmware.c optional compat_linuxkpi \ diff --git a/sys/modules/linuxkpi/Makefile b/sys/modules/linuxkpi/Makefile index 7bb4080fa81d..4274d211b10e 100644 --- a/sys/modules/linuxkpi/Makefile +++ b/sys/modules/linuxkpi/Makefile @@ -4,6 +4,7 @@ KMOD= linuxkpi SRCS= linux_compat.c \ linux_current.c \ + linux_devres.c \ linux_dmi.c \ linux_firmware.c \ linux_hrtimer.c \ From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12:02: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 DC21952FA38; Tue, 2 Feb 2021 12:02: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 4DVNht6DhFz4tFQ; Tue, 2 Feb 2021 12:02: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 5F55357ED; Tue, 2 Feb 2021 12:02: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 112C26bh024109; Tue, 2 Feb 2021 12:02:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112C26KH024108; Tue, 2 Feb 2021 12:02:06 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:02:06 GMT Message-Id: <202102021202.112C26KH024108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 91a07ed50ffc - stable/13 - Bump __FreeBSD_version for multiple LinuxKPI updates conflicting with DRM. Be sure to update your drm-kmod port to after the update. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 91a07ed50ffca4dfada3e7f1f050ea746c1bac66 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:02:08 -0000 The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=91a07ed50ffca4dfada3e7f1f050ea746c1bac66 commit 91a07ed50ffca4dfada3e7f1f050ea746c1bac66 Author: Bjoern A. Zeeb AuthorDate: 2021-02-02 11:52:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-02-02 11:52:50 +0000 Bump __FreeBSD_version for multiple LinuxKPI updates conflicting with DRM. Be sure to update your drm-kmod port to after the update. Sponsored-by: The FreeBSD Foundation --- UPDATING | 5 +++++ sys/sys/param.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 222dc6083ce7..c42fe6639b12 100644 --- a/UPDATING +++ b/UPDATING @@ -11,6 +11,11 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20210202: + Various LinuxKPI functionality was added which conflicts with DRM. + Please update your drm-kmod port to after the __FreeBSD_verison 1300139 + update. + 20210122: The stable/13 branch has been created from main. diff --git a/sys/sys/param.h b/sys/sys/param.h index afa5d9a2e3a8..c243c5072145 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300138 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300139 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12:02: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 63EC952FB8A; Tue, 2 Feb 2021 12:02: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 4DVNhw3F4Sz4tNK; Tue, 2 Feb 2021 12:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A0FD57EE; Tue, 2 Feb 2021 12:02: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 112C27Xp024129; Tue, 2 Feb 2021 12:02:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112C27me024128; Tue, 2 Feb 2021 12:02:07 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:02:07 GMT Message-Id: <202102021202.112C27me024128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4d85bfa41202 - stable/13 - __FreeBSD_version: update the references to the doc tree 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4d85bfa4120256d7d023bcecb3b5efe7a4bea46d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:02:10 -0000 The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4d85bfa4120256d7d023bcecb3b5efe7a4bea46d commit 4d85bfa4120256d7d023bcecb3b5efe7a4bea46d Author: Bjoern A. Zeeb AuthorDate: 2021-01-29 10:57:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-02-02 11:54:30 +0000 __FreeBSD_version: update the references to the doc tree Update the reference of which file to update in the doc tree when bumping __FreeBSD_version. (cherry picked from commit abd619045a54c73f41a95b3e038a5ba083391400) --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index c243c5072145..a19091e17167 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -52,7 +52,7 @@ * there. * Currently this lives here in the doc/ repository: * - * head/en_US.ISO8859-1/books/porters-handbook/versions/chapter.xml + * documentation/content/en/books/porters-handbook/versions/chapter.adoc * * scheme is: Rxx * 'R' is in the range 0 to 4 if this is a release branch or From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12:02: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 4327B52FCA9; Tue, 2 Feb 2021 12:02: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 4DVNjj1jLxz4tZn; Tue, 2 Feb 2021 12:02: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 681655E25; Tue, 2 Feb 2021 12:02: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 112C2ile025203; Tue, 2 Feb 2021 12:02:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112C2iB3025202; Tue, 2 Feb 2021 12:02:44 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:02:44 GMT Message-Id: <202102021202.112C2iB3025202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: d21ce74dcce6 - main - Register the bad read before bailing on terminal errors. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d21ce74dcce6f8b69451b3b2dd291d35cbb70609 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:02:50 -0000 The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=d21ce74dcce6f8b69451b3b2dd291d35cbb70609 commit d21ce74dcce6f8b69451b3b2dd291d35cbb70609 Author: Poul-Henning Kamp AuthorDate: 2021-02-02 12:01:38 +0000 Commit: Poul-Henning Kamp CommitDate: 2021-02-02 12:01:38 +0000 Register the bad read before bailing on terminal errors. This way running recoverdisk in a loop will not get stuck on a bad block which causes the disk or SD card detach. --- sbin/recoverdisk/recoverdisk.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sbin/recoverdisk/recoverdisk.c b/sbin/recoverdisk/recoverdisk.c index 8c4aabebc76f..35d7adc7a5c3 100644 --- a/sbin/recoverdisk/recoverdisk.c +++ b/sbin/recoverdisk/recoverdisk.c @@ -149,12 +149,10 @@ static void set_verbose(void) { struct winsize wsz; - time_t t0; if (!isatty(STDIN_FILENO) || ioctl(STDIN_FILENO, TIOCGWINSZ, &wsz)) return; verbose = 1; - t0 = time(NULL); } static void @@ -587,6 +585,13 @@ if (!(random() & 0xf)) { lp->start, sz, lp->state, strerror(error)); if (verbose) report(lp, sz); + if (fdw >= 0 && strlen(unreadable_pattern)) { + fill_buf(buf, sz, unreadable_pattern); + write_buf(fdw, buf, sz, lp->start); + } + new_lump(lp->start, sz, lp->state + 1); + lp->start += sz; + lp->len -= sz; if (error == EINVAL) { printf("Try with -b 131072 or lower ?\n"); aborting = 1; @@ -597,13 +602,6 @@ if (!(random() & 0xf)) { aborting = 1; break; } - if (fdw >= 0 && strlen(unreadable_pattern)) { - fill_buf(buf, sz, unreadable_pattern); - write_buf(fdw, buf, sz, lp->start); - } - new_lump(lp->start, sz, lp->state + 1); - lp->start += sz; - lp->len -= sz; } if (aborting) save_worklist(); From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12:28: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 9C54B530B85; Tue, 2 Feb 2021 12:28: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 4DVPGm3x0Fz3CH5; Tue, 2 Feb 2021 12:28: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 77F3F5FF9; Tue, 2 Feb 2021 12:28: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 112CS0ob052393; Tue, 2 Feb 2021 12:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112CS0n4052392; Tue, 2 Feb 2021 12:28:00 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:28:00 GMT Message-Id: <202102021228.112CS0n4052392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marcin Wojtas Subject: git: cd1393dfe718 - stable/12 - marvell: ap806_clock: add missing frequency modes 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/stable/12 X-Git-Reftype: branch X-Git-Commit: cd1393dfe7189c21739b4581b9cbdda680c54f59 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:28:00 -0000 The branch stable/12 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=cd1393dfe7189c21739b4581b9cbdda680c54f59 commit cd1393dfe7189c21739b4581b9cbdda680c54f59 Author: Marcin Wojtas AuthorDate: 2021-01-26 10:49:35 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-02 12:27:38 +0000 marvell: ap806_clock: add missing frequency modes In the driver init routine the CPU clock frequency value is obtained from a dedicated register. Until now only part of the values were handled by the mv_ap806_clock driver. Fix that by adding missing cases. Submitted by: Zyta Szpak MFC after: 1 week Obtained from: Semihalf Sponsored by: Marvell (cherry picked from commit a86b0839d7bf3fc06b1ae9c50e055b53c50a9d0b) --- sys/arm/mv/mv_ap806_clock.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/sys/arm/mv/mv_ap806_clock.c b/sys/arm/mv/mv_ap806_clock.c index 2516ce72d35c..bbbe875ee939 100644 --- a/sys/arm/mv/mv_ap806_clock.c +++ b/sys/arm/mv/mv_ap806_clock.c @@ -139,25 +139,51 @@ mv_ap806_clock_attach(device_t dev) return (ENXIO); } - /* - * We might miss some combinations - * Those are the only possible ones on the mcbin - */ reg = RD4(sc, 0x400); switch (reg & 0x1f) { case 0x0: case 0x1: clock_freq = 2000000000; break; + case 0x4: + clock_freq = 1600000000; + break; case 0x6: clock_freq = 1800000000; break; + case 0x7: + clock_freq = 1800000000; + break; + case 0xb: + clock_freq = 1600000000; + break; case 0xd: clock_freq = 1600000000; break; + case 0x13: + clock_freq = 1000000000; + break; case 0x14: clock_freq = 1333000000; break; + case 0x17: + clock_freq = 1333000000; + break; + case 0x19: + clock_freq = 1200000000; + break; + case 0x1a: + clock_freq = 1400000000; + break; + case 0x1b: + clock_freq = 600000000; + break; + case 0x1c: + clock_freq = 800000000; + break; + case 0x1d: + clock_freq = 1000000000; + break; default: device_printf(dev, "Cannot guess clock freq with reg %x\n", reg & 0x1f); From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12:28: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 21CD3530C10; Tue, 2 Feb 2021 12:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVPHn71xbz3CR3; Tue, 2 Feb 2021 12:28: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 E3FA462B5; Tue, 2 Feb 2021 12:28: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 112CSrF9052629; Tue, 2 Feb 2021 12:28:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112CSrGb052628; Tue, 2 Feb 2021 12:28:53 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:28:53 GMT Message-Id: <202102021228.112CSrGb052628@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marcin Wojtas Subject: git: cd925aaa73e1 - stable/13 - marvell: ap806_clock: add missing frequency modes 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/stable/13 X-Git-Reftype: branch X-Git-Commit: cd925aaa73e1bde159bb53ea049a45b6bd86bba3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:28:54 -0000 The branch stable/13 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=cd925aaa73e1bde159bb53ea049a45b6bd86bba3 commit cd925aaa73e1bde159bb53ea049a45b6bd86bba3 Author: Marcin Wojtas AuthorDate: 2021-01-26 10:49:35 +0000 Commit: Marcin Wojtas CommitDate: 2021-02-02 12:28:35 +0000 marvell: ap806_clock: add missing frequency modes In the driver init routine the CPU clock frequency value is obtained from a dedicated register. Until now only part of the values were handled by the mv_ap806_clock driver. Fix that by adding missing cases. Submitted by: Zyta Szpak MFC after: 1 week Obtained from: Semihalf Sponsored by: Marvell (cherry picked from commit a86b0839d7bf3fc06b1ae9c50e055b53c50a9d0b) --- sys/arm/mv/mv_ap806_clock.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/sys/arm/mv/mv_ap806_clock.c b/sys/arm/mv/mv_ap806_clock.c index 378640633c03..56041a48d312 100644 --- a/sys/arm/mv/mv_ap806_clock.c +++ b/sys/arm/mv/mv_ap806_clock.c @@ -136,25 +136,51 @@ mv_ap806_clock_attach(device_t dev) return (ENXIO); } - /* - * We might miss some combinations - * Those are the only possible ones on the mcbin - */ reg = RD4(sc, 0x400); switch (reg & 0x1f) { case 0x0: case 0x1: clock_freq = 2000000000; break; + case 0x4: + clock_freq = 1600000000; + break; case 0x6: clock_freq = 1800000000; break; + case 0x7: + clock_freq = 1800000000; + break; + case 0xb: + clock_freq = 1600000000; + break; case 0xd: clock_freq = 1600000000; break; + case 0x13: + clock_freq = 1000000000; + break; case 0x14: clock_freq = 1333000000; break; + case 0x17: + clock_freq = 1333000000; + break; + case 0x19: + clock_freq = 1200000000; + break; + case 0x1a: + clock_freq = 1400000000; + break; + case 0x1b: + clock_freq = 600000000; + break; + case 0x1c: + clock_freq = 800000000; + break; + case 0x1d: + clock_freq = 1000000000; + break; default: device_printf(dev, "Cannot guess clock freq with reg %x\n", reg & 0x1f); From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12: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 EE324530BEA; Tue, 2 Feb 2021 12: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 4DVPYx6VtHz3DFX; Tue, 2 Feb 2021 12: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 D25AF65AB; Tue, 2 Feb 2021 12: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 112Cf99W073297; Tue, 2 Feb 2021 12: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 112Cf91S073296; Tue, 2 Feb 2021 12:41:09 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:41:09 GMT Message-Id: <202102021241.112Cf91S073296@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: 0d381d1b92e5 - stable/13 - loader: create built in font from bold font face 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: 0d381d1b92e5cc0a83f5fd6b4aa7f063d4d4f2c6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:41:10 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=0d381d1b92e5cc0a83f5fd6b4aa7f063d4d4f2c6 commit 0d381d1b92e5cc0a83f5fd6b4aa7f063d4d4f2c6 Author: Toomas Soome AuthorDate: 2021-01-22 11:06:58 +0000 Commit: Toomas Soome CommitDate: 2021-02-02 10:00:30 +0000 loader: create built in font from bold font face We did replace full version of default font 8x16v with bold, also use bold version for built in font. (cherry picked from commit 6c789c55c4ba11014bfd1b59942c204615412ba6) --- stand/efi/loader/Makefile | 2 +- stand/i386/loader/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index f7032c78926d..dd25c940e0e9 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -87,7 +87,7 @@ VERSION_FILE= ${.CURDIR}/../loader/version CLEANFILES+= 8x16.c -8x16.c: ${SRCTOP}/contrib/terminus/ter-u16v.bdf +8x16.c: ${SRCTOP}/contrib/terminus/ter-u16b.bdf vtfontcvt -f compressed-source -o ${.TARGET} ${.ALLSRC} FILES+= ${LOADER}.efi diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index e80e19dfb9e6..ad95948ec50a 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -70,7 +70,7 @@ CFLAGS+= -I${BOOTSRC}/i386 #CFLAGS+= -g #LDFLAGS+= -g -8x16.c: ${SRCTOP}/contrib/terminus/ter-u16v.bdf +8x16.c: ${SRCTOP}/contrib/terminus/ter-u16b.bdf vtfontcvt -f compressed-source -o ${.TARGET} ${.ALLSRC} ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} From owner-dev-commits-src-all@freebsd.org Tue Feb 2 12:56: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 92BC45314A0; Tue, 2 Feb 2021 12:56: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 4DVPvm3mr7z3DvL; Tue, 2 Feb 2021 12:56: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 704436AE2; Tue, 2 Feb 2021 12:56: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 112Cuabm091534; Tue, 2 Feb 2021 12:56:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112Cuagx091533; Tue, 2 Feb 2021 12:56:36 GMT (envelope-from git) Date: Tue, 2 Feb 2021 12:56:36 GMT Message-Id: <202102021256.112Cuagx091533@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: b79f2bc6c5c7 - stable/13 - vt: panic while changing vt font 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: b79f2bc6c5c7431fa1f7c02937ec97a64653ade1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:56:36 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=b79f2bc6c5c7431fa1f7c02937ec97a64653ade1 commit b79f2bc6c5c7431fa1f7c02937ec97a64653ade1 Author: Toomas Soome AuthorDate: 2021-01-24 18:59:36 +0000 Commit: Toomas Soome CommitDate: 2021-02-02 10:11:38 +0000 vt: panic while changing vt font Set refcount for loader provided font to 1 to prevent this font from being released (so we can reset to default). As we get started with no memory allocator, we set up static font data for font passed by loader (if there is any). At this time, we also must set refcount 1, and refcount will get incremented in cnprobe() callback. At some point the memory allocator will be available, and we will set up properly allocated font data, but we should not disturb the refcount. PR: 252833 PR: 253147 (cherry picked and squashed 93ebd6307efeb95a29bc614edd0c67c2af850e98 and 1912d2b15e6d6f4a1d8c3886b03ab30d2f21f3fd) --- sys/dev/vt/vt_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 2352ed823424..05c383829f49 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -1487,6 +1487,8 @@ parse_font_info_static(struct font_info *fi) vfp = &vt_font_loader; vfp->vf_height = fi->fi_height; vfp->vf_width = fi->fi_width; + /* This is default font, set refcount 1 to disable removal. */ + vfp->vf_refcount = 1; for (unsigned i = 0; i < VFNT_MAPS; i++) { if (fi->fi_map_count[i] == 0) continue; @@ -1499,6 +1501,12 @@ parse_font_info_static(struct font_info *fi) return (vfp); } +/* + * Set up default font with allocated data structures. + * However, we can not set refcount here, because it is already set and + * incremented in vtterm_cnprobe() to avoid being released by font load from + * userland. + */ static struct vt_font * parse_font_info(struct font_info *fi) { From owner-dev-commits-src-all@freebsd.org Tue Feb 2 13: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 AFA63531981; Tue, 2 Feb 2021 13: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 4DVQ1t4WGBz3Fbh; Tue, 2 Feb 2021 13: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 8DB276BD3; Tue, 2 Feb 2021 13: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 112D1s7U000779; Tue, 2 Feb 2021 13: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 112D1sA3000778; Tue, 2 Feb 2021 13:01:54 GMT (envelope-from git) Date: Tue, 2 Feb 2021 13:01:54 GMT Message-Id: <202102021301.112D1sA3000778@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: a66467dcfd65 - stable/13 - userboot: provide stub gfx functions 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: a66467dcfd65bc6d4915a3c2c1b5ab2ca77133d4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 13:01:54 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=a66467dcfd65bc6d4915a3c2c1b5ab2ca77133d4 commit a66467dcfd65bc6d4915a3c2c1b5ab2ca77133d4 Author: Toomas Soome AuthorDate: 2021-01-30 19:16:20 +0000 Commit: Toomas Soome CommitDate: 2021-02-02 10:21:49 +0000 userboot: provide stub gfx functions Make sure we have needed functions present, to avoi getting undefined symbols error(s). PR: 253088 Reported by: John Kennedy (cherry picked b79f2bc6c5c7431fa1f7c02937ec97a64653ade1) --- stand/userboot/userboot/Makefile | 3 +- stand/userboot/userboot/gfx_fb.c | 78 +++++++++++++++++++++++++++++++++ stand/userboot/userboot/userboot_cons.c | 4 -- 3 files changed, 80 insertions(+), 5 deletions(-) diff --git a/stand/userboot/userboot/Makefile b/stand/userboot/userboot/Makefile index 49026375328e..767840101200 100644 --- a/stand/userboot/userboot/Makefile +++ b/stand/userboot/userboot/Makefile @@ -29,13 +29,14 @@ SRCS+= main.c SRCS+= userboot_cons.c SRCS+= userboot_disk.c SRCS+= vers.c +SRCS+= gfx_fb.c CFLAGS+= -Wall CFLAGS+= -I${BOOTSRC}/userboot CFLAGS.main.c+= -I${BOOTSRC}/libsa/zfs CFLAGS.main.c+= -I${SYSDIR}/contrib/openzfs/include CFLAGS.main.c+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs -CFLAGS.userboot_cons.c+= -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite +CFLAGS.gfx_fb.c+= -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite CWARNFLAGS.main.c += -Wno-implicit-function-declaration LDFLAGS+= -nostdlib -Wl,-Bsymbolic diff --git a/stand/userboot/userboot/gfx_fb.c b/stand/userboot/userboot/gfx_fb.c new file mode 100644 index 000000000000..aef61814569a --- /dev/null +++ b/stand/userboot/userboot/gfx_fb.c @@ -0,0 +1,78 @@ +/*- + * Copyright 2021 Toomas Soome + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * userboot-specific gfx stubs. + */ + +#include +#include +#include "bootstrap.h" +#include "gfx_fb.h" + +font_list_t fonts = STAILQ_HEAD_INITIALIZER(fonts); +teken_gfx_t gfx_state = { 0 }; + +void +gfx_fb_setpixel(uint32_t x __unused, uint32_t y __unused) +{ +} + +void +gfx_fb_drawrect(uint32_t x1 __unused, uint32_t y1 __unused, + uint32_t x2 __unused, uint32_t y2 __unused, uint32_t fill __unused) +{ +} + +void +gfx_term_drawrect(uint32_t x1 __unused, uint32_t y1 __unused, + uint32_t x2 __unused, uint32_t y2 __unused) +{ +} + +void +gfx_fb_line(uint32_t x0 __unused, uint32_t y0 __unused, + uint32_t x1 __unused, uint32_t y1 __unused, uint32_t w __unused) +{ +} + +void +gfx_fb_bezier(uint32_t x0 __unused, uint32_t y0 __unused, + uint32_t x1 __unused, uint32_t y1 __unused, uint32_t x2 __unused, + uint32_t y2 __unused, uint32_t w __unused) +{ +} + +int +gfx_fb_putimage(png_t *png __unused, uint32_t ux1 __unused, + uint32_t uy1 __unused, uint32_t ux2 __unused, uint32_t uy2 __unused, + uint32_t flags __unused) +{ + return (1); +} diff --git a/stand/userboot/userboot/userboot_cons.c b/stand/userboot/userboot/userboot_cons.c index 528f9ac40af9..89c1e70b116f 100644 --- a/stand/userboot/userboot/userboot_cons.c +++ b/stand/userboot/userboot/userboot_cons.c @@ -29,13 +29,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include "gfx_fb.h" #include "bootstrap.h" #include "libuserboot.h" -font_list_t fonts = STAILQ_HEAD_INITIALIZER(fonts); -teken_gfx_t gfx_state = { 0 }; - int console; static struct console *userboot_comconsp; From owner-dev-commits-src-all@freebsd.org Tue Feb 2 14:15: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 8DD53533C82; Tue, 2 Feb 2021 14:15: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 4DVRfr3bvwz3LDH; Tue, 2 Feb 2021 14:15: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 6E6B37751; Tue, 2 Feb 2021 14:15: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 112EFWSk095476; Tue, 2 Feb 2021 14:15:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112EFWbc095475; Tue, 2 Feb 2021 14:15:32 GMT (envelope-from git) Date: Tue, 2 Feb 2021 14:15:32 GMT Message-Id: <202102021415.112EFWbc095475@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: 43d44842aef3 - main - rtld: Fix null-pointer dereference 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: 43d44842aef3972cc86ce673e84e31f372257b15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:15:32 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43d44842aef3972cc86ce673e84e31f372257b15 commit 43d44842aef3972cc86ce673e84e31f372257b15 Author: David Chisnall AuthorDate: 2021-02-02 14:06:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-02 14:14:16 +0000 rtld: Fix null-pointer dereference When a library is opened via fdlopen, it has a null pointer for its path and so _rtld_bind can crash as a result of passing the null pointer to basename() (which passes it to strrchr(), which doesn't do a null check). PR: 253081 Submitted by: theraven MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28442 --- libexec/rtld-elf/rtld.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7b8bfba84d7d..b186bebbfefc 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -894,8 +894,10 @@ _rtld_bind(Obj_Entry *obj, Elf_Size reloff) target = (Elf_Addr)(defobj->relocbase + def->st_value); dbg("\"%s\" in \"%s\" ==> %p in \"%s\"", - defobj->strtab + def->st_name, basename(obj->path), - (void *)target, basename(defobj->path)); + defobj->strtab + def->st_name, + obj->path == NULL ? NULL : basename(obj->path), + (void *)target, + defobj->path == NULL ? NULL : basename(defobj->path)); /* * Write the new contents for the jmpslot. Note that depending on From owner-dev-commits-src-all@freebsd.org Tue Feb 2 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 CE397533E64; Tue, 2 Feb 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 4DVRvw5Xwhz3MTV; Tue, 2 Feb 2021 14:26: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 B12247770; Tue, 2 Feb 2021 14:26: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 112EQqAQ009476; Tue, 2 Feb 2021 14:26:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112EQquw009475; Tue, 2 Feb 2021 14:26:52 GMT (envelope-from git) Date: Tue, 2 Feb 2021 14:26:52 GMT Message-Id: <202102021426.112EQquw009475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: 9c40fca6c809 - stable/11 - ixl: Permit 802.1ad frames to pass though the chip MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 9c40fca6c809e845341aade54307f9fc84627480 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:26:52 -0000 The branch stable/11 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=9c40fca6c809e845341aade54307f9fc84627480 commit 9c40fca6c809e845341aade54307f9fc84627480 Author: Lutz Donnerhacke AuthorDate: 2021-02-02 14:22:55 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-02 14:25:19 +0000 ixl: Permit 802.1ad frames to pass though the chip This patch is a quick hack to change the internal Ethertype used within the chip. All frames with this type are dropped silently. This patch allows you to overwrite the factory default 0x88a8, which is used by IEEE 802.1ad VLAN stacking. Reviewed by: kp, philip, brueffer Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D24179 (cherry-picked from commit fa6662b3689eeb71cb63c2b230ca08e7342cabf0) --- share/man/man4/ixl.4 | 11 ++++++++++- sys/dev/ixl/ixl_pf_main.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ixl.4 b/share/man/man4/ixl.4 index 60aa5e67ac40..e7554b7bc854 100644 --- a/share/man/man4/ixl.4 +++ b/share/man/man4/ixl.4 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2015 +.Dd January 19, 2021 .Dt IXL 4 .Os .Sh NAME @@ -151,6 +151,15 @@ this can cause a link at 10GB, 1GB, or 100MB. This is a display of the current setting. .It Va hw.ixl.fw_version This is a display of the Firmware version. +.It Va dev.ixl.#.debug.switch_vlans +Set the Ethertype used by the hardware itself to handle internal +services. +Frames with this Ethertype will be dropped without notice. +Defaults to +.Dv 0x88a8 , +which is a well known number for IEEE 802.1ad VLAN stacking. +If you need 802.1ad support, set this number to any another Ethertype i.e. +.Dv 0xffff . .El .Sh Interrupt Storms It is important to note that 40G operation can generate high diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 1ddc21760d05..7d56e0562071 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -73,6 +73,7 @@ static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_switch_vlans(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_hkey(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_hena(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_hlut(SYSCTL_HANDLER_ARGS); @@ -4529,6 +4530,10 @@ ixl_add_device_sysctls(struct ixl_pf *pf) OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); + SYSCTL_ADD_PROC(ctx, debug_list, + OID_AUTO, "switch_vlans", CTLTYPE_INT | CTLFLAG_WR, + pf, 0, ixl_sysctl_switch_vlans, "I", "HW Switch VLAN Configuration"); + SYSCTL_ADD_PROC(ctx, debug_list, OID_AUTO, "rss_key", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_sysctl_hkey, "A", "View RSS key"); @@ -6069,6 +6074,40 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS) return (error); } +static int +ixl_sysctl_switch_vlans(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + int requested_vlan = -1; + enum i40e_status_code status = 0; + int error = 0; + + error = sysctl_handle_int(oidp, &requested_vlan, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + if ((hw->flags & I40E_HW_FLAG_802_1AD_CAPABLE) == 0) { + device_printf(dev, "Flags disallow setting of vlans\n"); + return (ENODEV); + } + + hw->switch_tag = requested_vlan; + device_printf(dev, + "Setting switch config to switch_tag=%04x, first_tag=%04x, second_tag=%04x\n", + hw->switch_tag, hw->first_tag, hw->second_tag); + status = i40e_aq_set_switch_config(hw, 0, 0, 0, NULL); + if (status) { + device_printf(dev, + "%s: aq_set_switch_config() error %s, aq error %s\n", + __func__, i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + return (status); + } + return (0); +} + static int ixl_sysctl_hkey(SYSCTL_HANDLER_ARGS) { From owner-dev-commits-src-all@freebsd.org Tue Feb 2 14: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 42C7F534807; Tue, 2 Feb 2021 14: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 4DVSHS1N13z3NSg; Tue, 2 Feb 2021 14:43: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 222CC7CCB; Tue, 2 Feb 2021 14:43: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 112EhmY1035404; Tue, 2 Feb 2021 14:43:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112Ehmdb035403; Tue, 2 Feb 2021 14:43:48 GMT (envelope-from git) Date: Tue, 2 Feb 2021 14:43:48 GMT Message-Id: <202102021443.112Ehmdb035403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lutz Donnerhacke Subject: git: a2c37aa836c0 - stable/12 - ixl: Permit 802.1ad frames to pass though the chip MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a2c37aa836c0d24b97102605d65971b887a8e957 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:43:48 -0000 The branch stable/12 has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=a2c37aa836c0d24b97102605d65971b887a8e957 commit a2c37aa836c0d24b97102605d65971b887a8e957 Author: Lutz Donnerhacke AuthorDate: 2021-02-02 14:42:38 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-02 14:42:38 +0000 ixl: Permit 802.1ad frames to pass though the chip This patch is a quick hack to change the internal Ethertype used within the chip. All frames with this type are dropped silently. This patch allows you to overwrite the factory default 0x88a8, which is used by IEEE 802.1ad VLAN stacking. Reviewed by: kp, philip, brueffer Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D24179 (cherry picked from commit fa6662b3689eeb71cb63c2b230ca08e7342cabf0) --- share/man/man4/ixl.4 | 11 ++++++++++- sys/dev/ixl/ixl_pf_main.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ixl.4 b/share/man/man4/ixl.4 index 9f264de9d9c4..8d98d974ac43 100644 --- a/share/man/man4/ixl.4 +++ b/share/man/man4/ixl.4 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2020 +.Dd January 19, 2021 .Dt IXL 4 .Os .Sh NAME @@ -227,6 +227,15 @@ contains the speeds that are allowed to be set. Displays the current speed. .It Va dev.ixl.#.fw_version Displays the current firmware and NVM versions of the adapter. +.It Va dev.ixl.#.debug.switch_vlans +Set the Ethertype used by the hardware itself to handle internal +services. +Frames with this Ethertype will be dropped without notice. +Defaults to +.Dv 0x88a8 , +which is a well known number for IEEE 802.1ad VLAN stacking. +If you need 802.1ad support, set this number to any another Ethertype i.e. +.Dv 0xffff . .El .Sh INTERRUPT STORMS It is important to note that 40G operation can generate high diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 6990ef80a184..c563eca63605 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -67,6 +67,7 @@ static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_switch_vlans(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_hkey(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_hena(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_hlut(SYSCTL_HANDLER_ARGS); @@ -2316,6 +2317,10 @@ ixl_add_device_sysctls(struct ixl_pf *pf) OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); + SYSCTL_ADD_PROC(ctx, debug_list, + OID_AUTO, "switch_vlans", CTLTYPE_INT | CTLFLAG_WR, + pf, 0, ixl_sysctl_switch_vlans, "I", "HW Switch VLAN Configuration"); + SYSCTL_ADD_PROC(ctx, debug_list, OID_AUTO, "rss_key", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_sysctl_hkey, "A", "View RSS key"); @@ -3456,6 +3461,40 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS) return (error); } +static int +ixl_sysctl_switch_vlans(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + int requested_vlan = -1; + enum i40e_status_code status = 0; + int error = 0; + + error = sysctl_handle_int(oidp, &requested_vlan, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + if ((hw->flags & I40E_HW_FLAG_802_1AD_CAPABLE) == 0) { + device_printf(dev, "Flags disallow setting of vlans\n"); + return (ENODEV); + } + + hw->switch_tag = requested_vlan; + device_printf(dev, + "Setting switch config to switch_tag=%04x, first_tag=%04x, second_tag=%04x\n", + hw->switch_tag, hw->first_tag, hw->second_tag); + status = i40e_aq_set_switch_config(hw, 0, 0, 0, NULL); + if (status) { + device_printf(dev, + "%s: aq_set_switch_config() error %s, aq error %s\n", + __func__, i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + return (status); + } + return (0); +} + static int ixl_sysctl_hkey(SYSCTL_HANDLER_ARGS) { From owner-dev-commits-src-all@freebsd.org Tue Feb 2 14:46: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 74F1D534821; Tue, 2 Feb 2021 14:46: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 4DVSLh2ryLz3Nnh; Tue, 2 Feb 2021 14:46: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 50B1B7A7A; Tue, 2 Feb 2021 14:46: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 112Eka9P036053; Tue, 2 Feb 2021 14:46:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112Ekapl036052; Tue, 2 Feb 2021 14:46:36 GMT (envelope-from git) Date: Tue, 2 Feb 2021 14:46:36 GMT Message-Id: <202102021446.112Ekapl036052@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: e40787f900f3 - main - 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/main X-Git-Reftype: branch X-Git-Commit: e40787f900f3c262d5134d342e5a16757dd2193c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:46:36 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=e40787f900f3c262d5134d342e5a16757dd2193c commit e40787f900f3c262d5134d342e5a16757dd2193c Author: Edward Tomasz Napierala AuthorDate: 2021-02-02 14:40:38 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-02 14:40:58 +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 --- 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 Feb 2 16:45: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 1D1E8536DC3; Tue, 2 Feb 2021 16:45: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 4DVVzr0FNnz3lZy; Tue, 2 Feb 2021 16:45: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 EF9D111879; Tue, 2 Feb 2021 16:45: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 112GjRQ6092322; Tue, 2 Feb 2021 16:45:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112GjR8N092321; Tue, 2 Feb 2021 16:45:27 GMT (envelope-from git) Date: Tue, 2 Feb 2021 16:45:27 GMT Message-Id: <202102021645.112GjR8N092321@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: ff975f15d860 - main - WITH_OFED build option: fix 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: ff975f15d86001d5b948ab538de1e4aca852d2f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:45:28 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ff975f15d86001d5b948ab538de1e4aca852d2f5 commit ff975f15d86001d5b948ab538de1e4aca852d2f5 Author: Konstantin Belousov AuthorDate: 2021-02-02 13:01:26 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-02 16:44:52 +0000 WITH_OFED build option: fix Userspace has OFED build enabled for quite some time, but kernel modules were not. This is useless config because any userspace IB code requires kernel support. So enable modules build by default. Move WITH_OFED to WITHOUT_OFED since defaults are now enabled. Reviewed by: emaste, hselasky, kevans MFC after: 3 days Sponsored by: NVidia Networking / Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D28460 --- sys/conf/kern.opts.mk | 2 +- tools/build/options/WITHOUT_OFED | 4 ++++ tools/build/options/WITH_OFED | 4 ---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 5a66849b36da..7361cdd70076 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -41,6 +41,7 @@ __DEFAULT_YES_OPTIONS = \ ISCSI \ KERNEL_SYMBOLS \ NETGRAPH \ + OFED \ PF \ SCTP_SUPPORT \ SOURCELESS_HOST \ @@ -55,7 +56,6 @@ __DEFAULT_NO_OPTIONS = \ INIT_ALL_PATTERN \ INIT_ALL_ZERO \ KERNEL_RETPOLINE \ - OFED \ RATELIMIT \ REPRODUCIBLE_BUILD diff --git a/tools/build/options/WITHOUT_OFED b/tools/build/options/WITHOUT_OFED new file mode 100644 index 000000000000..18a6943b3580 --- /dev/null +++ b/tools/build/options/WITHOUT_OFED @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to disable the build of the +.Dq "OpenFabrics Enterprise Distribution" +Infiniband software stack, including kernel modules and userspace libraries. diff --git a/tools/build/options/WITH_OFED b/tools/build/options/WITH_OFED deleted file mode 100644 index a995fb8cdab8..000000000000 --- a/tools/build/options/WITH_OFED +++ /dev/null @@ -1,4 +0,0 @@ -.\" $FreeBSD$ -Set to build the -.Dq "OpenFabrics Enterprise Distribution" -Infiniband software stack. From owner-dev-commits-src-all@freebsd.org Tue Feb 2 16:48: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 525C1536DF5; Tue, 2 Feb 2021 16:48: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 4DVW3l1sKTz3lkk; Tue, 2 Feb 2021 16:48: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 32B0711C70; Tue, 2 Feb 2021 16:48: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 112GmpZl092949; Tue, 2 Feb 2021 16:48:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112GmpUK092948; Tue, 2 Feb 2021 16:48:51 GMT (envelope-from git) Date: Tue, 2 Feb 2021 16:48:51 GMT Message-Id: <202102021648.112GmpUK092948@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: d0ca28d7c9c7 - main - src.conf.5: regenerate 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: d0ca28d7c9c7da80a62e4307fe37b923e32ca1bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:48:51 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d0ca28d7c9c7da80a62e4307fe37b923e32ca1bb commit d0ca28d7c9c7da80a62e4307fe37b923e32ca1bb Author: Konstantin Belousov AuthorDate: 2021-02-02 16:48:08 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-02 16:48:34 +0000 src.conf.5: regenerate --- share/man/man5/src.conf.5 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 3b57c443353d..ea94bac4d2dc 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 1, 2021 +.Dd February 2, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1245,10 +1245,19 @@ Set to build nvme related tools and kernel modules. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64. -.It Va WITH_OFED -Set to build the +.It Va WITHOUT_OFED +Set to disable the build of the .Dq "OpenFabrics Enterprise Distribution" -Infiniband software stack. +Infiniband software stack, including kernel modules and userspace libraries. +.Pp +This is a default setting on +riscv/riscv64 and riscv/riscv64sf. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_OFED_EXTRA +.El .It Va WITH_OFED_EXTRA Set to build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" From owner-dev-commits-src-all@freebsd.org Tue Feb 2 16:53: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 A456C537408; Tue, 2 Feb 2021 16:53:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVW9S4Jvqz3mFb; Tue, 2 Feb 2021 16:53:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:a03e:f824:f6c:d0c]) (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 193722AC7C; Tue, 2 Feb 2021 16:53:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Mateusz Guzik , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202102011240.111CehGE094845@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: e92ab3adf4f9 - stable/13 - atomic: make atomic_store_ptr type-aware Message-ID: Date: Tue, 2 Feb 2021 08:53:46 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <202102011240.111CehGE094845@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:53:48 -0000 On 2/1/21 4:40 AM, Mateusz Guzik wrote: > The branch stable/13 has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e92ab3adf4f9848933439c9c2fca36df290c0884 > > commit e92ab3adf4f9848933439c9c2fca36df290c0884 > Author: Mateusz Guzik > AuthorDate: 2021-01-25 19:39:14 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-02-01 12:39:16 +0000 > > atomic: make atomic_store_ptr type-aware > > (cherry picked from commit cc96f92a570e05636a20fdd15d4616b127bb9ecc) A couple of folks expressed concerns about this commit when it landed in main due to it being too flexible (it allows you to store pointers to non-pointer types, e.g.: char c; uintptr_t p; atomic_store_ptr(&c, p); Silently becomes: atomic_store_char(&c, (char)p); Are you planning to address this? -- John Baldwin From owner-dev-commits-src-all@freebsd.org Tue Feb 2 16:57: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 9C23053743E; Tue, 2 Feb 2021 16:57:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (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 4DVWFz3vcyz3mqG; Tue, 2 Feb 2021 16:57:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x330.google.com with SMTP id i9so2933616wmq.1; Tue, 02 Feb 2021 08:57: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=ul7ClqMHgQAn/txdLP8TiV/T9fKC/+t+pP67I8pvcBY=; b=d3eSMT7WVmuajBG8aapozyPo2gLfu4zMXN/zsy21qJQMWFBtCJJu8bivDoRad9oMpH 6OtpBrLAZWUJxJT2Ie+BD2ZoOD3a3VMe475oOkFH1X5C6xK83zEUjPJ0fHSwONDp+ICy c28Up8dx2m8oj2DCsjmwuU/J1TvOEjGOSnxjYgFjzqWox/Q+lGd+lw+AIrFfYlHau+Rw ivYH/9tXJlM1ikcPEvwdEPoxpxGJWn+TcHzuJofTdX8VjO93XVe4508IZlrUUEsrh+fi 1HlF18tD6My/tf14Zg4c42RQ1NIfZdkviD7Lp/Y0ZXUp5EwHIVrr0/zvA1mD8T9ZifGi 39iw== 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=ul7ClqMHgQAn/txdLP8TiV/T9fKC/+t+pP67I8pvcBY=; b=KfABeL027ITRyoHOrD2EeFUq0ogTxAMfPp5lVSurvbWairk5pDRz4PUgyWkojXuD/F O7jhQIf/FAfpbh4TMqbSm7TVE86FUteqU4mMdLgFulhDEshZkr9lo3rdLeUFJDhhLrG2 GUh132BCsrOnqlY72dts65nIiFE4VLUqh9EVgoJvHG2SnDwltQLSzKAB+JkkRE+IEQ4d oUn258LmK6MTuekBRQUMH5XU784BeEkReezoMypkB3JfAPVwpnUVbIJzOJPEQA0+P27e OaK7pZqvMzf9u0gt29N1RQvcHzjSRygaooHfOBxlbpXZOv2vQGH0qA/9UlLQtQ7PRP5T n3zw== X-Gm-Message-State: AOAM531ShuyxLtRXpxl0vKnvdlomf+onOJoxD8FDEZt4M6sQTAQ7960H mlwUJZs4EfEc8W+UDmQlS6P5+t2dJs0Vx6a+DYDPjgi5PIw= X-Google-Smtp-Source: ABdhPJwUwvzs4wq8XHzPjEyPgSzI6AhFz+rRi2gGbQ0pOEbcvl6AYFSN1vjW9M01A8elKg37oVeycMFaM0M3xyGexJY= X-Received: by 2002:a1c:2ec2:: with SMTP id u185mr4478901wmu.83.1612285061614; Tue, 02 Feb 2021 08:57:41 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Tue, 2 Feb 2021 08:57:40 -0800 (PST) In-Reply-To: References: <202102011240.111CehGE094845@gitrepo.freebsd.org> From: Mateusz Guzik Date: Tue, 2 Feb 2021 17:57:40 +0100 Message-ID: Subject: Re: git: e92ab3adf4f9 - stable/13 - atomic: make atomic_store_ptr type-aware To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DVWFz3vcyz3mqG 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 Feb 2021 16:57:43 -0000 I thought I responded to this bit, I did not address the (in my opinion incorrect) claim that a fence can't be avoided rendering consume primitive pointless. I have a somewhat reply for this. but tl;dr yes, I'll add validation for pointer types A bug was reported in the namecache which I want to take care of before I do other stuff. On 2/2/21, John Baldwin wrote: > On 2/1/21 4:40 AM, Mateusz Guzik wrote: >> The branch stable/13 has been updated by mjg: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=e92ab3adf4f9848933439c9c2fca36df290c0884 >> >> commit e92ab3adf4f9848933439c9c2fca36df290c0884 >> Author: Mateusz Guzik >> AuthorDate: 2021-01-25 19:39:14 +0000 >> Commit: Mateusz Guzik >> CommitDate: 2021-02-01 12:39:16 +0000 >> >> atomic: make atomic_store_ptr type-aware >> >> (cherry picked from commit cc96f92a570e05636a20fdd15d4616b127bb9ecc) > > A couple of folks expressed concerns about this commit when it landed > in main due to it being too flexible (it allows you to store pointers > to non-pointer types, e.g.: > > char c; > uintptr_t p; > > atomic_store_ptr(&c, p); > > Silently becomes: > > atomic_store_char(&c, (char)p); > > Are you planning to address this? > > -- > John Baldwin > -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Tue Feb 2 16:58: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 565B25371FF; Tue, 2 Feb 2021 16:58:09 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 4DVWGS4mrwz3n2N; Tue, 2 Feb 2021 16:58:08 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x42f.google.com with SMTP id 7so21256487wrz.0; Tue, 02 Feb 2021 08:58:08 -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=iu23osRc+lLe3snSX5n69ppFkr1xRLXH6KjcJIqVSf4=; b=nO2lfMF+3tZZ1TzI/BfNGW4v+GSgNoJs3D9dmvKtJvnFwqUHFSEft9dXErR4LXhR1m n4x3fRvh8WbRZ883xWUg4VyD96jXM1tBfbXL2zgp/+C90i6ScuBr7kpAKmpv7Ja/vU1B aqUKS6X3Pohj0dbV8IIjDciOEyjufxU+OE8eDzKwsAY5nfjGDG4wWQ+MWpEayn/DQ7SY h7BVND5UEYM/J9q8kaxSkZwTmGzbZDat/a6tVvCXzt8Ocz8twCeY6iYXcoBhSFN677UX xjToj21QQjCgs1iSq5zB+7iH4+R7sJewhJObD4/TzVjbu4dkKm3ALNtRCVt8+ZgzVTaX OT5g== 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=iu23osRc+lLe3snSX5n69ppFkr1xRLXH6KjcJIqVSf4=; b=UrT+emRfMDCzkGON+0azLIdqda4jHlqpYD8OG8yX+iFIB7oUHob1xCOywWIFPlazgY pb1aRx4JKgoDLUiAuBNs/QuL+2ucEWgS73OtXXNE5PU44tSiPss9DCtZ/9i8ut7w4yN7 gVz+R8v7egFEaw1xuL2kFqb5gAfGQ6Kuyh23mH2M8b3qrfmhS10C/apAyYwSGTWGxLr2 4VNV2aOW0Z7W4ET99zXkrgx7D37BWKV+f56pSSzJIQEUPkLcSy3TuMmjE03ez9JU/dMc /dbEH2V1jGXit9W5l3vqZKpj3ijfOFUJ13N/msu7sAc7rqGFDBrN3fu8itkSRd1pUmwB ZBqA== X-Gm-Message-State: AOAM531AtYVioeVJYh0QLX6343RI0NdBvptkGAvrVQN2y+AF6iHJ5TsB vIIGwoImHnGKdc86OlVb4kWZBroJIyi7sExSVBw8p6V8sKIlZA== X-Google-Smtp-Source: ABdhPJygkxtsa4PNhItr7x+TrUaw+/GHJBdFs89kRHwCK6mtNL0I20GPq6oGuEzAdFMSWtH174uEG5Urd/dswwOpZHY= X-Received: by 2002:adf:e511:: with SMTP id j17mr24726115wrm.17.1612285086545; Tue, 02 Feb 2021 08:58:06 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Tue, 2 Feb 2021 08:58:05 -0800 (PST) In-Reply-To: References: <202102011240.111CehGE094845@gitrepo.freebsd.org> From: Mateusz Guzik Date: Tue, 2 Feb 2021 17:58:05 +0100 Message-ID: Subject: Re: git: e92ab3adf4f9 - stable/13 - atomic: make atomic_store_ptr type-aware To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DVWGS4mrwz3n2N X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=nO2lfMF+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::42f as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::42f: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)[]; NEURAL_SPAM_SHORT(1.00)[0.998]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::42f: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::42f:from]; 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-branches]; 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: Tue, 02 Feb 2021 16:58:09 -0000 On 2/2/21, Mateusz Guzik wrote: > I thought I responded to this bit, I did not address the (in my > opinion incorrect) claim that a fence can't be avoided rendering > consume primitive pointless. I have a somewhat reply for this. somewhat longer > > but tl;dr yes, I'll add validation for pointer types > > A bug was reported in the namecache which I want to take care of > before I do other stuff. > > On 2/2/21, John Baldwin wrote: >> On 2/1/21 4:40 AM, Mateusz Guzik wrote: >>> The branch stable/13 has been updated by mjg: >>> >>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=e92ab3adf4f9848933439c9c2fca36df290c0884 >>> >>> commit e92ab3adf4f9848933439c9c2fca36df290c0884 >>> Author: Mateusz Guzik >>> AuthorDate: 2021-01-25 19:39:14 +0000 >>> Commit: Mateusz Guzik >>> CommitDate: 2021-02-01 12:39:16 +0000 >>> >>> atomic: make atomic_store_ptr type-aware >>> >>> (cherry picked from commit >>> cc96f92a570e05636a20fdd15d4616b127bb9ecc) >> >> A couple of folks expressed concerns about this commit when it landed >> in main due to it being too flexible (it allows you to store pointers >> to non-pointer types, e.g.: >> >> char c; >> uintptr_t p; >> >> atomic_store_ptr(&c, p); >> >> Silently becomes: >> >> atomic_store_char(&c, (char)p); >> >> Are you planning to address this? >> >> -- >> John Baldwin >> > > > -- > Mateusz Guzik > -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Tue Feb 2 17:19: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 5B3BF5381AB; Tue, 2 Feb 2021 17:19: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 4DVWlS2DJMz3qB3; Tue, 2 Feb 2021 17:19: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 3F82211F64; Tue, 2 Feb 2021 17:19: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 112HJmXL032322; Tue, 2 Feb 2021 17:19:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112HJmSP032320; Tue, 2 Feb 2021 17:19:48 GMT (envelope-from git) Date: Tue, 2 Feb 2021 17:19:48 GMT Message-Id: <202102021719.112HJmSP032320@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: 70dfc101b632 - main - release: update workaround during transition to git 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: 70dfc101b6324b25ba353465f0d6c610399741fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 17:19:48 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=70dfc101b6324b25ba353465f0d6c610399741fc commit 70dfc101b6324b25ba353465f0d6c610399741fc Author: Glen Barber AuthorDate: 2021-02-02 17:19:36 +0000 Commit: Glen Barber CommitDate: 2021-02-02 17:19:36 +0000 release: update workaround during transition to git PR: 253181 Submitted by: Yasuhiro Kimura MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/release.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/release/release.sh b/release/release.sh index fbd64bb8234d..372f69177f7e 100755 --- a/release/release.sh +++ b/release/release.sh @@ -246,8 +246,11 @@ chroot_setup() { fi fi if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then - if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then - git -C ${CHROOTDIR}/usr/ports pull -q + # if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then + # git -C ${CHROOTDIR}/usr/ports pull -q + # XXX: Workaround for the overlap in the Git conversion timeframe. + if [ -d "${CHROOTDIR}/usr/ports/.svn" ]; then + ${SVNCMD} update ${CHROOTDIR}/usr/ports else #${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports # XXX: Workaround for the overlap in the Git From owner-dev-commits-src-all@freebsd.org Tue Feb 2 18:14: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 CC4C3539A07; Tue, 2 Feb 2021 18:14: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 4DVXz05Pn7z3tSy; Tue, 2 Feb 2021 18:14: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 AC509129ED; Tue, 2 Feb 2021 18:14: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 112IEqiJ009597; Tue, 2 Feb 2021 18:14:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112IEqLa009596; Tue, 2 Feb 2021 18:14:52 GMT (envelope-from git) Date: Tue, 2 Feb 2021 18:14:52 GMT Message-Id: <202102021814.112IEqLa009596@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: 45456abc4ce7 - main - cache: fix trailing slash support in face of permission problems 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: 45456abc4ce71053d07cf03ca63bd1ce459fec55 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:14:52 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=45456abc4ce71053d07cf03ca63bd1ce459fec55 commit 45456abc4ce71053d07cf03ca63bd1ce459fec55 Author: Mateusz Guzik AuthorDate: 2021-02-02 18:06:56 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-02 18:13:51 +0000 cache: fix trailing slash support in face of permission problems Reported by: Johan Hendriks Tested by: kevans --- sys/kern/vfs_cache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 7f0e59f1a1ee..db482ea4eba3 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5521,6 +5521,16 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; + /* + * TODO: Due to ignoring slashes lookup will perform a permission check + * on the last dir when it should not have. If it fails, we get here. + * It is possible possible to fix it up fully without resorting to + * regular lookup, but for now just abort. + */ + if (cache_fpl_istrailingslash(fpl)) { + return (cache_fpl_aborted(fpl)); + } + /* * Hack: delayed degenerate path checking. */ From owner-dev-commits-src-all@freebsd.org Tue Feb 2 18:16: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 C2A84539AA9; Tue, 2 Feb 2021 18:16: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 4DVY0Q4wJQz3tsv; Tue, 2 Feb 2021 18:16: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 9A20712E21; Tue, 2 Feb 2021 18:16: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 112IG64X009893; Tue, 2 Feb 2021 18:16:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112IG6AV009892; Tue, 2 Feb 2021 18:16:06 GMT (envelope-from git) Date: Tue, 2 Feb 2021 18:16:06 GMT Message-Id: <202102021816.112IG6AV009892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 4e29933d0936 - stable/13 - cache: fix trailing slash support in face of permission problems 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4e29933d0936fd053f7591ee118dc1fc42617514 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:16:06 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=4e29933d0936fd053f7591ee118dc1fc42617514 commit 4e29933d0936fd053f7591ee118dc1fc42617514 Author: Mateusz Guzik AuthorDate: 2021-02-02 18:06:56 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-02 18:15:48 +0000 cache: fix trailing slash support in face of permission problems Reported by: Johan Hendriks Tested by: kevans (cherry picked from commit 45456abc4ce71053d07cf03ca63bd1ce459fec55) --- sys/kern/vfs_cache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 1780e8235dd3..fe7e70ba1359 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -5494,6 +5494,16 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; + /* + * TODO: Due to ignoring slashes lookup will perform a permission check + * on the last dir when it should not have. If it fails, we get here. + * It is possible possible to fix it up fully without resorting to + * regular lookup, but for now just abort. + */ + if (cache_fpl_istrailingslash(fpl)) { + return (cache_fpl_aborted(fpl)); + } + /* * Hack: delayed name len checking. */ From owner-dev-commits-src-all@freebsd.org Tue Feb 2 18:41: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 93E0B539E2D; Tue, 2 Feb 2021 18:41: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 4DVYZG3nHrz3vsZ; Tue, 2 Feb 2021 18:41: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 74BF61322B; Tue, 2 Feb 2021 18:41: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 112IfwBu048565; Tue, 2 Feb 2021 18:41:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112IfwrK048564; Tue, 2 Feb 2021 18:41:58 GMT (envelope-from git) Date: Tue, 2 Feb 2021 18:41:58 GMT Message-Id: <202102021841.112IfwrK048564@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: 9d0f1092cf90 - main - git hooks: add "Tested by" to commit message template 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: 9d0f1092cf90c8bf161cb946584f703a9998f8cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:41:58 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9d0f1092cf90c8bf161cb946584f703a9998f8cd commit 9d0f1092cf90c8bf161cb946584f703a9998f8cd Author: Ed Maste AuthorDate: 2021-02-02 18:36:45 +0000 Commit: Ed Maste CommitDate: 2021-02-02 18:41:08 +0000 git hooks: add "Tested by" to commit message template Reported by: mjg Reviewed by: imp Sponsored by: The FreeBSD Foundation --- tools/tools/git/hooks/prepare-commit-msg | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index 0ebec48fd9a5..6a8db33649f0 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -45,6 +45,7 @@ $(awk '1;/^#$/{exit}' $1) # PR: # Reported by: # Reviewed by: +# Tested by: # Approved by: # Obtained from: # MFC after: From owner-dev-commits-src-all@freebsd.org Tue Feb 2 18:56: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 E3C78539F7E; Tue, 2 Feb 2021 18:56:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVYvT66GFz3wNV; Tue, 2 Feb 2021 18:56: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 B8EC413781; Tue, 2 Feb 2021 18:56: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 112IurVJ063380; Tue, 2 Feb 2021 18:56:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112IurK4063379; Tue, 2 Feb 2021 18:56:53 GMT (envelope-from git) Date: Tue, 2 Feb 2021 18:56:53 GMT Message-Id: <202102021856.112IurK4063379@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: 3dd2a7a5ea2f - main - 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/main X-Git-Reftype: branch X-Git-Commit: 3dd2a7a5ea2f1641c7525f692eed416fa02c28e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:56:53 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=3dd2a7a5ea2f1641c7525f692eed416fa02c28e6 commit 3dd2a7a5ea2f1641c7525f692eed416fa02c28e6 Author: Alexander Motin AuthorDate: 2021-02-02 18:37:13 +0000 Commit: Alexander Motin CommitDate: 2021-02-02 18:56:47 +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 --- 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 Tue Feb 2 19:14: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 56FCA53A949; Tue, 2 Feb 2021 19:14: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 4DVZHV1wWPz4RQs; Tue, 2 Feb 2021 19:14: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 3426F136FE; Tue, 2 Feb 2021 19:14: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 112JEETS088769; Tue, 2 Feb 2021 19:14:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112JEEqM088768; Tue, 2 Feb 2021 19:14:14 GMT (envelope-from git) Date: Tue, 2 Feb 2021 19:14:14 GMT Message-Id: <202102021914.112JEEqM088768@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: e59d9cb41284 - main - Add a wg(4) 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: e59d9cb412846cb5d2bc4c641d3cc44d243cd52d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:14:14 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e59d9cb412846cb5d2bc4c641d3cc44d243cd52d commit e59d9cb412846cb5d2bc4c641d3cc44d243cd52d Author: Gordon Bergling AuthorDate: 2021-02-02 19:13:53 +0000 Commit: Gordon Bergling CommitDate: 2021-02-02 19:13:53 +0000 Add a wg(4) manual page Reviewed by: brueffer, donner, debdrup, ygy MFC after: 2 days --- share/man/man4/Makefile | 1 + share/man/man4/wg.4 | 244 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 9b6ec7998fc3..4929ec9fd3f6 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -584,6 +584,7 @@ MAN= aac.4 \ vtnet.4 \ watchdog.4 \ ${_wbwd.4} \ + wg.4 \ witness.4 \ wlan.4 \ wlan_acl.4 \ diff --git a/share/man/man4/wg.4 b/share/man/man4/wg.4 new file mode 100644 index 000000000000..e343dceaa0d6 --- /dev/null +++ b/share/man/man4/wg.4 @@ -0,0 +1,244 @@ +.\" Copyright (c) 2020 Gordon Bergling +.\" 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 February 2, 2021 > +.Dt WG 4 > +.Os > +.Sh NAME > +.Nm wg > +.Nd "WireGuard - pseudo-device" > +.Sh SYNOPSIS > +To load the driver as a module at boot time, place the following line in > +.Xr loader.conf 5 : > +.Bd -literal -offset indent > +if_wg_load="YES" > +.Ed > +.Sh DESCRIPTION > +The > +.Nm > +driver provides Virtual Private Network (VPN) interfaces for the secure > +exchange of layer 3 traffic with other WireGuard peers using the WireGuard > +protocol. > +.Pp > +A > +.Nm > +interface recognises one or more peers, establishes a secure tunnel with > +each on demand, and tracks each peer's UDP endpoint for exchanging encrypted > +traffic with. > +.Pp > +The interfaces can be created at runtime using the > +.Ic ifconfig Cm wg Ns Ar N Cm create > +command. > +The interface itself can be configured with > +.Xr ifconfig 8 . > +.Pp > +The following parameters are available: > +.Bl -tag -width indent > +.It Cm listen-port > +The listing port of the > +.Nm > +interface. > +.It Cm public-key > +The public key of the > +.Nm > +interface. > +.It Cm private-key > +The private key of the > +.Nm > +interface. > +.It Cm pre-shared-key > +Defines a pre-shared key for the > +.Nm > +interface. > +.It Cm allowed-ips > +A list of allowed IP addresses. > +.It Cm endpoint > +The IP address of the WiredGuard to connect to. > +.It Cm peer-list > +A list of peering IP addresses to connect to. > +.El > +.Pp > +The > +.Nm > +interfaces support the following > +.Xr ioctl 2 Ns s : > +.Bl -tag -width Ds -offset indent > +.It Dv SIOCSWG Fa "struct wg_device_io *" > +Set the device configuration. > +.It Dv SIOCGWG Fa "struct wg_device_io *" > +Get the device configuration. > +.El > +.Pp > +The following glossary provides a brief overview of WireGuard > +terminology: > +.Bl -tag -width indent -offset 3n > +.It Peer > +Peers exchange IPv4 or IPv6 traffic over secure tunnels. > +Each > +.Nm > +interface may be configured to recognise one or more peers. > +.It Key > +Each peer uses its private key and corresponding public key to > +identify itself to others. > +A peer configures a > +.Nm > +interface with its own private key and with the public keys of its peers. > +.It Pre-shared key > +In addition to the public keys, each peer pair may be configured with a > +unique pre-shared symmetric key. > +This is used in their handshake to guard against future compromise of the > +peers' encrypted tunnel if a quantum-computational attack on their > +Diffie-Hellman exchange becomes feasible. > +It is optional, but recommended. > +.It Allowed IPs > +A single > +.Nm > +interface may maintain concurrent tunnels connecting diverse networks. > +The interface therefore implements rudimentary routing and reverse-path > +filtering functions for its tunneled traffic. > +These functions reference a set of allowed IP ranges configured against > +each peer. > +.Pp > +The interface will route outbound tunneled traffic to the peer configured > +with the most specific matching allowed IP address range, or drop it > +if no such match exists. > +.Pp > +The interface will accept tunneled traffic only from the peer > +configured with the most specific matching allowed IP address range > +for the incoming traffic, or drop it if no such match exists. > +That is, tunneled traffic routed to a given peer cannot return through > +another peer of the same > +.Nm > +interface. > +This ensures that peers cannot spoof another's traffic. > +.It Handshake > +Two peers handshake to mutually authenticate each other and to > +establish a shared series of secret ephemeral encryption keys. > +Any peer may initiate a handshake. > +Handshakes occur only when there is traffic to send, and recur every > +two minutes during transfers. > +.It Connectionless > +Due to the handshake behavior, there is no connected or disconnected > +state. > +.El > +.Ss Keys > +Private keys for WireGuard can be generated from any sufficiently > +secure random source. > +The Curve25519 keys and the pre-shared keys are both 32 bytes > +long and are commonly encoded in base64 for ease of use. > +.Pp > +Keys can be generated with > +.Xr openssl 1 > +as follows: > +.Pp > +.Dl $ openssl rand -base64 32 > +.Pp > +Although a valid Curve25519 key must have 5 bits set to > +specific values, this is done by the interface and so it > +will accept any random 32-byte base64 string. > +.Pp > +When an interface has a private key set with > +.Nm public-key , > +the corresponding > +public key is shown in the status output of the interface: > +.Bd -literal -offset indent > +# ifconfig wg0 | grep public-key > + public-key: 7lWtsDdqaGB3EY9WNxRN3hVaHMtu1zXw71+bOjNOVUw= > +.Ed > +.Sh EXAMPLES > +Create a > +.Nm > +interface and set random private key. > +.Bd -literal -offset indent > +# ifconfig wg0 create listen-port 54321 private-key `openssl rand -base64 32` > +.Ed > +.Pp > +Retrieve the associated public key from a > +.Nm > +interface. > +.Bd -literal -offset indent > +$ ifconfig wg0 | awk '/public-key/ { print $2 }'` > +.Ed > +.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 > +.Ed > +.Sh DIAGNOSTICS > +The > +.Nm > +interface supports runtime debugging, which can be enabled with: > +.Pp > +.D1 Ic ifconfig Cm wg Ns Ar N Cm debug > +.Pp > +Some common error messages include: > +.Bl -diag > +.It "Handshake for peer X did not complete after 5 seconds, retrying" > +Peer X did not reply to our initiation packet, for example because: > +.Bl -bullet > +.It > +The peer does not have the local interface configured as a peer. > +Peers must be able to mutually authenticate each other. > +.It > +The peer endpoint IP address is incorrectly configured. > +.It > +There are firewall rules preventing communication between hosts. > +.El > +.It "Invalid handshake initiation" > +The incoming handshake packet could not be processed. > +This is likely due to the local interface not containing > +the correct public key for the peer. > +.It "Invalid initiation MAC" > +The incoming handshake initiation packet had an invalid MAC. > +This is likely because the initiation sender has the wrong public key > +for the handshake receiver. > +.It "Packet has unallowed src IP from peer X" > +After decryption, an incoming data packet has a source IP address that > +is not assigned to the allowed IPs of Peer X. > +.El > +.Sh SEE ALSO > +.Xr inet 4 , > +.Xr ip 4 , > +.Xr netintro 4 , > +.Xr ipf 5 , > +.Xr pf.conf 5 , > +.Xr ifconfig 8 , > +.Xr ipfw 8 > +.Rs > +.%T WireGuard whitepaper > +.%U https://www.wireguard.com/papers/wireguard.pdf > +.Re > +.Sh HISTORY > +The > +.Nm > +device driver first appeared in > +.Fx 13.0 . > +.Sh AUTHORS > +This manual page was written by > +.An Gordon Bergling Aq Mt gbe@FreeBSD.org > +and is based on the > +.Ox > +counterpart written by > +.An David Gwynne Aq Mt dlg@openbsd.org . > _______________________________________________ > 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 Tue Feb 2 21:14: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 4C47053DFEB; Tue, 2 Feb 2021 21:14: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 4DVcxk1h2sz4ZFm; Tue, 2 Feb 2021 21:14: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 2C62B15059; Tue, 2 Feb 2021 21:14: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 112LE2Md044852; Tue, 2 Feb 2021 21:14:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112LE2oi044851; Tue, 2 Feb 2021 21:14:02 GMT (envelope-from git) Date: Tue, 2 Feb 2021 21:14:02 GMT Message-Id: <202102022114.112LE2oi044851@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: 58a9e1ca8579 - stable/12 - fstyp(8): Show exFAT volume labels with -l flag 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: 58a9e1ca85797a050d3a39bffa6babcb9d3463a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:14:02 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=58a9e1ca85797a050d3a39bffa6babcb9d3463a4 commit 58a9e1ca85797a050d3a39bffa6babcb9d3463a4 Author: Conrad Meyer AuthorDate: 2019-12-22 03:19:17 +0000 Commit: Ed Maste CommitDate: 2021-02-02 21:12:04 +0000 fstyp(8): Show exFAT volume labels with -l flag exfat is fundamentally the same design as fat32. The superblock differs marginally, and there are some additional optional features irrelevant to fstype(8); the structure of dirents has changed slightly to enable, among other things, larger files; the directory entries are no longer DOS 8.3 ASCII or local 8-bit encoding, but instead explicitly UCS-2-LE. (As a result, this change uses iconv to convert a found exfat volume label to the user's locale.) Locating the volume label is identical to FAT32: locate the root directory and walk through dirents until you find a volume label. Like FAT32, follow the FAT chain between root directory clusters as necessary. PR: 242225 Reported by: Victor Sudakov (cherry picked from commit 85b4c344c8c69ff7993bc0ac833aaf9a8108b88d) fstyp(8): Fix WITHOUT_ICONV build Reported by: olivier (cherry picked from commit 5ab1cb52b21fdc5524bd970e9b5cdff21a5bcabf) --- usr.sbin/fstyp/Makefile | 4 + usr.sbin/fstyp/exfat.c | 303 ++++++++++++++++++++++++++++++++++++- usr.sbin/fstyp/fstyp.c | 49 ++++-- usr.sbin/fstyp/fstyp.h | 7 + usr.sbin/fstyp/ntfs.c | 6 + usr.sbin/fstyp/tests/fstyp_test.sh | 10 ++ 6 files changed, 367 insertions(+), 12 deletions(-) diff --git a/usr.sbin/fstyp/Makefile b/usr.sbin/fstyp/Makefile index ebdfcc5ab6b5..f257d6472d8c 100644 --- a/usr.sbin/fstyp/Makefile +++ b/usr.sbin/fstyp/Makefile @@ -13,6 +13,10 @@ MAN= fstyp.8 WARNS?= 2 +.if ${MK_ICONV} == "yes" +CFLAGS+= -DWITH_ICONV +.endif + .include .if ${TARGET_ENDIANNESS} == 1234 diff --git a/usr.sbin/fstyp/exfat.c b/usr.sbin/fstyp/exfat.c index 9c379df0c3f6..d77ba9253d39 100644 --- a/usr.sbin/fstyp/exfat.c +++ b/usr.sbin/fstyp/exfat.c @@ -27,6 +27,16 @@ #include __FBSDID("$FreeBSD$"); +#include +#include + +#include +#include +#include +#ifdef WITH_ICONV +#include +#endif +#include #include #include #include @@ -34,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include "fstyp.h" +/* + * https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification + */ + struct exfat_vbr { char ev_jmp[3]; char ev_fsname[8]; @@ -55,19 +69,304 @@ struct exfat_vbr { uint8_t ev_percent_used; } __packed; +struct exfat_dirent { + uint8_t xde_type; +#define XDE_TYPE_INUSE_MASK 0x80 /* 1=in use */ +#define XDE_TYPE_INUSE_SHIFT 7 +#define XDE_TYPE_CATEGORY_MASK 0x40 /* 0=primary */ +#define XDE_TYPE_CATEGORY_SHIFT 6 +#define XDE_TYPE_IMPORTNC_MASK 0x20 /* 0=critical */ +#define XDE_TYPE_IMPORTNC_SHIFT 5 +#define XDE_TYPE_CODE_MASK 0x1f +/* InUse=0, ..., TypeCode=0: EOD. */ +#define XDE_TYPE_EOD 0x00 +#define XDE_TYPE_ALLOC_BITMAP (XDE_TYPE_INUSE_MASK | 0x01) +#define XDE_TYPE_UPCASE_TABLE (XDE_TYPE_INUSE_MASK | 0x02) +#define XDE_TYPE_VOL_LABEL (XDE_TYPE_INUSE_MASK | 0x03) +#define XDE_TYPE_FILE (XDE_TYPE_INUSE_MASK | 0x05) +#define XDE_TYPE_VOL_GUID (XDE_TYPE_INUSE_MASK | XDE_TYPE_IMPORTNC_MASK) +#define XDE_TYPE_STREAM_EXT (XDE_TYPE_INUSE_MASK | XDE_TYPE_CATEGORY_MASK) +#define XDE_TYPE_FILE_NAME (XDE_TYPE_INUSE_MASK | XDE_TYPE_CATEGORY_MASK | 0x01) +#define XDE_TYPE_VENDOR (XDE_TYPE_INUSE_MASK | XDE_TYPE_CATEGORY_MASK | XDE_TYPE_IMPORTNC_MASK) +#define XDE_TYPE_VENDOR_ALLOC (XDE_TYPE_INUSE_MASK | XDE_TYPE_CATEGORY_MASK | XDE_TYPE_IMPORTNC_MASK | 0x01) + union { + uint8_t xde_generic_[19]; + struct exde_primary { + /* + * Count of "secondary" dirents following this one. + * + * A single logical entity may be composed of a + * sequence of several dirents, starting with a primary + * one; the rest are secondary dirents. + */ + uint8_t xde_secondary_count_; + uint16_t xde_set_chksum_; + uint16_t xde_prim_flags_; + uint8_t xde_prim_generic_[14]; + } __packed xde_primary_; + struct exde_secondary { + uint8_t xde_sec_flags_; + uint8_t xde_sec_generic_[18]; + } __packed xde_secondary_; + } u; + uint32_t xde_first_cluster; + uint64_t xde_data_len; +} __packed; +#define xde_generic u.xde_generic_ +#define xde_secondary_count u.xde_primary_.xde_secondary_count +#define xde_set_chksum u.xde_primary_.xde_set_chksum_ +#define xde_prim_flags u.xde_primary_.xde_prim_flags_ +#define xde_sec_flags u.xde_secondary_.xde_sec_flags_ +_Static_assert(sizeof(struct exfat_dirent) == 32, "spec"); + +struct exfat_de_label { + uint8_t xdel_type; /* XDE_TYPE_VOL_LABEL */ + uint8_t xdel_char_cnt; /* Length of UCS-2 label */ + uint16_t xdel_vol_lbl[11]; + uint8_t xdel_reserved[8]; +} __packed; +_Static_assert(sizeof(struct exfat_de_label) == 32, "spec"); + +#define MAIN_BOOT_REGION_SECT 0 +#define BACKUP_BOOT_REGION_SECT 12 + +#define SUBREGION_CHKSUM_SECT 11 + +#define FIRST_CLUSTER 2 +#define BAD_BLOCK_SENTINEL 0xfffffff7u +#define END_CLUSTER_SENTINEL 0xffffffffu + +static inline void * +read_sectn(FILE *fp, off_t sect, unsigned count, unsigned bytespersec) +{ + return (read_buf(fp, sect * bytespersec, bytespersec * count)); +} + +static inline void * +read_sect(FILE *fp, off_t sect, unsigned bytespersec) +{ + return (read_sectn(fp, sect, 1, bytespersec)); +} + +/* + * Compute the byte-by-byte multi-sector checksum of the given boot region + * (MAIN or BACKUP), for a given bytespersec (typically 512 or 4096). + * + * Endian-safe; result is host endian. + */ +static int +exfat_compute_boot_chksum(FILE *fp, unsigned region, unsigned bytespersec, + uint32_t *result) +{ + unsigned char *sector; + unsigned n, sect; + uint32_t checksum; + + checksum = 0; + for (sect = 0; sect < 11; sect++) { + sector = read_sect(fp, region + sect, bytespersec); + if (sector == NULL) + return (ENXIO); + for (n = 0; n < bytespersec; n++) { + if (sect == 0) { + switch (n) { + case 106: + case 107: + case 112: + continue; + } + } + checksum = ((checksum & 1) ? 0x80000000u : 0u) + + (checksum >> 1) + (uint32_t)sector[n]; + } + free(sector); + } + + *result = checksum; + return (0); +} + +#ifdef WITH_ICONV +static void +convert_label(const uint16_t *ucs2label /* LE */, unsigned ucs2len, char + *label_out, size_t label_sz) +{ + const char *label; + char *label_out_orig; + iconv_t cd; + size_t srcleft, rc; + + /* Currently hardcoded in fstyp.c as 256 or so. */ + assert(label_sz > 1); + + if (ucs2len == 0) { + /* + * Kind of seems bogus, but the spec allows an empty label + * entry with the same meaning as no label. + */ + return; + } + + if (ucs2len > 11) { + warnx("exfat: Bogus volume label length: %u", ucs2len); + return; + } + + /* dstname="" means convert to the current locale. */ + cd = iconv_open("", EXFAT_ENC); + if (cd == (iconv_t)-1) { + warn("exfat: Could not open iconv"); + return; + } + + label_out_orig = label_out; + + /* Dummy up the byte pointer and byte length iconv's API wants. */ + label = (const void *)ucs2label; + srcleft = ucs2len * sizeof(*ucs2label); + + rc = iconv(cd, __DECONST(char **, &label), &srcleft, &label_out, + &label_sz); + if (rc == (size_t)-1) { + warn("exfat: iconv()"); + *label_out_orig = '\0'; + } else { + /* NUL-terminate result (iconv advances label_out). */ + if (label_sz == 0) + label_out--; + *label_out = '\0'; + } + + iconv_close(cd); +} + +/* + * Using the FAT table, look up the next cluster in this chain. + */ +static uint32_t +exfat_fat_next(FILE *fp, const struct exfat_vbr *ev, unsigned BPS, + uint32_t cluster) +{ + uint32_t fat_offset_sect, clsect, clsectoff; + uint32_t *fatsect, nextclust; + + fat_offset_sect = le32toh(ev->ev_fat_offset); + clsect = fat_offset_sect + (cluster / (BPS / sizeof(cluster))); + clsectoff = (cluster % (BPS / sizeof(cluster))); + + /* XXX This is pretty wasteful without a block cache for the FAT. */ + fatsect = read_sect(fp, clsect, BPS); + nextclust = le32toh(fatsect[clsectoff]); + free(fatsect); + + return (nextclust); +} + +static void +exfat_find_label(FILE *fp, const struct exfat_vbr *ev, unsigned BPS, + char *label_out, size_t label_sz) +{ + uint32_t rootdir_cluster, sects_per_clust, cluster_offset_sect; + off_t rootdir_sect; + struct exfat_dirent *declust, *it; + + cluster_offset_sect = le32toh(ev->ev_cluster_offset); + rootdir_cluster = le32toh(ev->ev_rootdir_cluster); + sects_per_clust = (1u << ev->ev_log_sect_per_clust); + + if (rootdir_cluster < FIRST_CLUSTER) { + warnx("%s: invalid rootdir cluster %u < %d", __func__, + rootdir_cluster, FIRST_CLUSTER); + return; + } + + + for (; rootdir_cluster != END_CLUSTER_SENTINEL; + rootdir_cluster = exfat_fat_next(fp, ev, BPS, rootdir_cluster)) { + if (rootdir_cluster == BAD_BLOCK_SENTINEL) { + warnx("%s: Bogus bad block in root directory chain", + __func__); + return; + } + + rootdir_sect = (rootdir_cluster - FIRST_CLUSTER) * + sects_per_clust + cluster_offset_sect; + declust = read_sectn(fp, rootdir_sect, sects_per_clust, BPS); + for (it = declust; + it < declust + (sects_per_clust * BPS / sizeof(*it)); it++) { + bool eod = false; + + /* + * Simplistic directory traversal; doesn't do any + * validation of "MUST" requirements in spec. + */ + switch (it->xde_type) { + case XDE_TYPE_EOD: + eod = true; + break; + case XDE_TYPE_VOL_LABEL: { + struct exfat_de_label *lde = (void*)it; + convert_label(lde->xdel_vol_lbl, + lde->xdel_char_cnt, label_out, label_sz); + free(declust); + return; + } + } + + if (eod) + break; + } + free(declust); + } +} +#endif /* WITH_ICONV */ + int fstyp_exfat(FILE *fp, char *label, size_t size) { struct exfat_vbr *ev; + uint32_t *cksect; + unsigned bytespersec; + uint32_t chksum; + int error; + cksect = NULL; ev = (struct exfat_vbr *)read_buf(fp, 0, 512); if (ev == NULL || strncmp(ev->ev_fsname, "EXFAT ", 8) != 0) goto fail; + if (ev->ev_log_bytes_per_sect < 9 || ev->ev_log_bytes_per_sect > 12) { + warnx("exfat: Invalid BytesPerSectorShift"); + goto done; + } + + bytespersec = (1u << ev->ev_log_bytes_per_sect); + + error = exfat_compute_boot_chksum(fp, MAIN_BOOT_REGION_SECT, + bytespersec, &chksum); + if (error != 0) + goto done; + + cksect = read_sect(fp, MAIN_BOOT_REGION_SECT + SUBREGION_CHKSUM_SECT, + bytespersec); + /* - * Reading the volume label requires walking the root directory to look - * for a special label file. Left as an exercise for the reader. + * Technically the entire sector should be full of repeating 4-byte + * checksum pattern, but we only verify the first. */ + if (chksum != le32toh(cksect[0])) { + warnx("exfat: Found checksum 0x%08x != computed 0x%08x", + le32toh(cksect[0]), chksum); + goto done; + } + +#ifdef WITH_ICONV + if (show_label) + exfat_find_label(fp, ev, bytespersec, label, size); +#endif + +done: + free(cksect); free(ev); return (0); diff --git a/usr.sbin/fstyp/fstyp.c b/usr.sbin/fstyp/fstyp.c index 31f7b34bde40..141090eb4312 100644 --- a/usr.sbin/fstyp/fstyp.c +++ b/usr.sbin/fstyp/fstyp.c @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef WITH_ICONV +#include +#endif +#include #include #include #include @@ -50,24 +54,27 @@ __FBSDID("$FreeBSD$"); #define LABEL_LEN 256 +bool show_label = false; + typedef int (*fstyp_function)(FILE *, char *, size_t); static struct { const char *name; fstyp_function function; bool unmountable; + char *precache_encoding; } fstypes[] = { - { "cd9660", &fstyp_cd9660, false }, - { "exfat", &fstyp_exfat, false }, - { "ext2fs", &fstyp_ext2fs, false }, - { "geli", &fstyp_geli, true }, - { "msdosfs", &fstyp_msdosfs, false }, - { "ntfs", &fstyp_ntfs, false }, - { "ufs", &fstyp_ufs, false }, + { "cd9660", &fstyp_cd9660, false, NULL }, + { "exfat", &fstyp_exfat, false, EXFAT_ENC }, + { "ext2fs", &fstyp_ext2fs, false, NULL }, + { "geli", &fstyp_geli, true, NULL }, + { "msdosfs", &fstyp_msdosfs, false, NULL }, + { "ntfs", &fstyp_ntfs, false, NULL }, + { "ufs", &fstyp_ufs, false, NULL }, #ifdef HAVE_ZFS - { "zfs", &fstyp_zfs, true }, + { "zfs", &fstyp_zfs, true, NULL }, #endif - { NULL, NULL, NULL } + { NULL, NULL, NULL, NULL } }; void * @@ -159,7 +166,7 @@ int main(int argc, char **argv) { int ch, error, i, nbytes; - bool ignore_type = false, show_label = false, show_unmountable = false; + bool ignore_type = false, show_unmountable = false; char label[LABEL_LEN + 1], strvised[LABEL_LEN * 4 + 1]; char *path; FILE *fp; @@ -188,6 +195,28 @@ main(int argc, char **argv) path = argv[0]; + if (setlocale(LC_CTYPE, "") == NULL) + err(1, "setlocale"); + caph_cache_catpages(); + +#ifdef WITH_ICONV + /* Cache iconv conversion data before entering capability mode. */ + if (show_label) { + for (i = 0; i < nitems(fstypes); i++) { + iconv_t cd; + + if (fstypes[i].precache_encoding == NULL) + continue; + cd = iconv_open("", fstypes[i].precache_encoding); + if (cd == (iconv_t)-1) + err(1, "%s: iconv_open %s", fstypes[i].name, + fstypes[i].precache_encoding); + /* Iconv keeps a small cache of unused encodings. */ + iconv_close(cd); + } + } +#endif + fp = fopen(path, "r"); if (fp == NULL) err(1, "%s", path); diff --git a/usr.sbin/fstyp/fstyp.h b/usr.sbin/fstyp/fstyp.h index f858b0c53827..3b8e80cfe71d 100644 --- a/usr.sbin/fstyp/fstyp.h +++ b/usr.sbin/fstyp/fstyp.h @@ -32,8 +32,15 @@ #ifndef FSTYP_H #define FSTYP_H +#include + #define MIN(a,b) (((a)<(b))?(a):(b)) +/* The spec doesn't seem to permit UTF-16 surrogates; definitely LE. */ +#define EXFAT_ENC "UCS-2LE" + +extern bool show_label; /* -l flag */ + void *read_buf(FILE *fp, off_t off, size_t len); char *checked_strdup(const char *s); void rtrim(char *label, size_t size); diff --git a/usr.sbin/fstyp/ntfs.c b/usr.sbin/fstyp/ntfs.c index 905841045e7d..6cf0bec1ae75 100644 --- a/usr.sbin/fstyp/ntfs.c +++ b/usr.sbin/fstyp/ntfs.c @@ -31,6 +31,8 @@ #include __FBSDID("$FreeBSD$"); +#ifdef WITH_ICONV +#endif #include #include #include @@ -92,6 +94,8 @@ struct ntfs_bootfile { uint32_t bf_volsn; } __packed; +#ifdef WITH_ICONV +#endif int fstyp_ntfs(FILE *fp, char *label, size_t size) { @@ -109,6 +113,7 @@ fstyp_ntfs(FILE *fp, char *label, size_t size) bf = (struct ntfs_bootfile *)read_buf(fp, 0, 512); if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) goto fail; +#ifdef WITH_ICONV mftrecsz = bf->bf_mftrecsz; recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz); @@ -150,6 +155,7 @@ fstyp_ntfs(FILE *fp, char *label, size_t size) } } +#endif /* WITH_ICONV */ free(bf); free(filerecp); diff --git a/usr.sbin/fstyp/tests/fstyp_test.sh b/usr.sbin/fstyp/tests/fstyp_test.sh index 5103ba042746..8f76424f5f75 100755 --- a/usr.sbin/fstyp/tests/fstyp_test.sh +++ b/usr.sbin/fstyp/tests/fstyp_test.sh @@ -68,6 +68,15 @@ exfat_body() { atf_check -s exit:0 -o inline:"exfat\n" fstyp -u exfat.img } +atf_test_case exfat_label +exfat_label_head() { + atf_set "descr" "fstyp(8) can read exFAT labels" +} +exfat_label_body() { + bzcat $(atf_get_srcdir)/dfr-01-xfat.img.bz2 > exfat.img + atf_check -s exit:0 -o inline:"exfat exFat\n" fstyp -u -l exfat.img +} + atf_test_case empty empty_head() { atf_set "descr" "fstyp(8) should fail on an empty file" @@ -253,6 +262,7 @@ atf_init_test_cases() { atf_add_test_case dir atf_add_test_case empty atf_add_test_case exfat + atf_add_test_case exfat_label atf_add_test_case ext2 atf_add_test_case ext3 atf_add_test_case ext4 From owner-dev-commits-src-all@freebsd.org Tue Feb 2 21:14: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 705EE53DAE8; Tue, 2 Feb 2021 21:14: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 4DVcxl2MPRz4ZLw; Tue, 2 Feb 2021 21:14: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 42292152D9; Tue, 2 Feb 2021 21:14: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 112LE3BZ044875; Tue, 2 Feb 2021 21:14:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112LE32u044874; Tue, 2 Feb 2021 21:14:03 GMT (envelope-from git) Date: Tue, 2 Feb 2021 21:14:03 GMT Message-Id: <202102022114.112LE32u044874@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: a072e2133ed3 - stable/12 - fstyp(8): fix exfat detection 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: a072e2133ed36f1edf899068e6b026b129c919d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:14:03 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a072e2133ed36f1edf899068e6b026b129c919d8 commit a072e2133ed36f1edf899068e6b026b129c919d8 Author: Conrad Meyer AuthorDate: 2021-01-17 19:55:06 +0000 Commit: Ed Maste CommitDate: 2021-02-02 21:12:31 +0000 fstyp(8): fix exfat detection In the presence of high-level errors (spec violations, bad boot blocks checksum), report non-detection instead of detection. PR: 252787 (related, but does not fully address) (cherry picked from commit ddf61156132b610915325769cbb93ea11be0d433) --- usr.sbin/fstyp/exfat.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/usr.sbin/fstyp/exfat.c b/usr.sbin/fstyp/exfat.c index d77ba9253d39..3f10cb6a9e5a 100644 --- a/usr.sbin/fstyp/exfat.c +++ b/usr.sbin/fstyp/exfat.c @@ -330,14 +330,15 @@ fstyp_exfat(FILE *fp, char *label, size_t size) uint32_t chksum; int error; + error = 1; cksect = NULL; ev = (struct exfat_vbr *)read_buf(fp, 0, 512); if (ev == NULL || strncmp(ev->ev_fsname, "EXFAT ", 8) != 0) - goto fail; + goto out; if (ev->ev_log_bytes_per_sect < 9 || ev->ev_log_bytes_per_sect > 12) { warnx("exfat: Invalid BytesPerSectorShift"); - goto done; + goto out; } bytespersec = (1u << ev->ev_log_bytes_per_sect); @@ -345,7 +346,7 @@ fstyp_exfat(FILE *fp, char *label, size_t size) error = exfat_compute_boot_chksum(fp, MAIN_BOOT_REGION_SECT, bytespersec, &chksum); if (error != 0) - goto done; + goto out; cksect = read_sect(fp, MAIN_BOOT_REGION_SECT + SUBREGION_CHKSUM_SECT, bytespersec); @@ -357,7 +358,8 @@ fstyp_exfat(FILE *fp, char *label, size_t size) if (chksum != le32toh(cksect[0])) { warnx("exfat: Found checksum 0x%08x != computed 0x%08x", le32toh(cksect[0]), chksum); - goto done; + error = 1; + goto out; } #ifdef WITH_ICONV @@ -365,12 +367,8 @@ fstyp_exfat(FILE *fp, char *label, size_t size) exfat_find_label(fp, ev, bytespersec, label, size); #endif -done: +out: free(cksect); free(ev); - return (0); - -fail: - free(ev); - return (1); + return (error != 0); } From owner-dev-commits-src-all@freebsd.org Tue Feb 2 21: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 6DD1753E584; Tue, 2 Feb 2021 21: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 4DVd9B2lXsz4b8Q; Tue, 2 Feb 2021 21: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 511D815683; Tue, 2 Feb 2021 21: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 112LNw5Q058430; Tue, 2 Feb 2021 21: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 112LNwi7058429; Tue, 2 Feb 2021 21:23:58 GMT (envelope-from git) Date: Tue, 2 Feb 2021 21:23:58 GMT Message-Id: <202102022123.112LNwi7058429@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: 090deb5c64cf - stable/11 - Fix mdoc typo in auto_master.5 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/11 X-Git-Reftype: branch X-Git-Commit: 090deb5c64cf9729b9326f0a01349151f3df25c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:23:58 -0000 The branch stable/11 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=090deb5c64cf9729b9326f0a01349151f3df25c9 commit 090deb5c64cf9729b9326f0a01349151f3df25c9 Author: Benjamin Kaduk AuthorDate: 2017-09-01 22:04:45 +0000 Commit: Ed Maste CommitDate: 2021-02-02 21:23:15 +0000 Fix mdoc typo in auto_master.5 There needs to be a space after the no-space macro in order for it to be interpreted. PR: 221986 Submitted by: Paul Townsend (cherry picked from commit fe8b4983b4f200c479846839b2632024136c0ff4) --- usr.sbin/autofs/auto_master.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/autofs/auto_master.5 b/usr.sbin/autofs/auto_master.5 index 89100f75faf5..e630028e0817 100644 --- a/usr.sbin/autofs/auto_master.5 +++ b/usr.sbin/autofs/auto_master.5 @@ -253,7 +253,7 @@ Query the remote NFS server and map exported shares. This map is traditionally mounted on .Pa /net . Access to files on a remote NFS server is provided through the -.Pf /net/ Ar nfs-server-ip Ns / Ns Ar share-name Ns/ +.Pf /net/ Ar nfs-server-ip Ns / Ns Ar share-name Ns / directory without any additional configuration. Directories for individual NFS servers are not present until the first access, when they are automatically created. From owner-dev-commits-src-all@freebsd.org Tue Feb 2 21:25: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 6435053E1FE; Tue, 2 Feb 2021 21:25: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 4DVdCJ2Pfgz4bTR; Tue, 2 Feb 2021 21:25: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 454EF1561C; Tue, 2 Feb 2021 21:25: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 112LPmaP058818; Tue, 2 Feb 2021 21:25:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112LPmxr058817; Tue, 2 Feb 2021 21:25:48 GMT (envelope-from git) Date: Tue, 2 Feb 2021 21:25:48 GMT Message-Id: <202102022125.112LPmxr058817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Neel Chauhan Subject: git: a08cdb6cfb1c - main - Allow setting alias port ranges in libalias and ipfw. This will allow a system to be a true RFC 6598 NAT444 setup, where each network segment (e.g. user, subnet) can have their own dedicated port aliasing ranges. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a08cdb6cfb1c84b80b5337d46c574b55d0e15c63 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:25:48 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a08cdb6cfb1c84b80b5337d46c574b55d0e15c63 commit a08cdb6cfb1c84b80b5337d46c574b55d0e15c63 Author: Neel Chauhan AuthorDate: 2021-02-02 21:24:17 +0000 Commit: Neel Chauhan CommitDate: 2021-02-02 21:24:17 +0000 Allow setting alias port ranges in libalias and ipfw. This will allow a system to be a true RFC 6598 NAT444 setup, where each network segment (e.g. user, subnet) can have their own dedicated port aliasing ranges. Reviewed by: donner, kp Approved by: 0mp (mentor), donner, kp Differential Revision: https://reviews.freebsd.org/D23450 --- sbin/ipfw/ipfw.8 | 3 ++ sbin/ipfw/ipfw2.h | 1 + sbin/ipfw/main.c | 3 +- sbin/ipfw/nat.c | 41 ++++++++++++++++ sys/netinet/ip_fw.h | 2 + sys/netinet/libalias/alias.h | 1 + sys/netinet/libalias/alias_db.c | 30 ++++++++++-- sys/netinet/libalias/alias_local.h | 4 ++ sys/netpfil/ipfw/ip_fw_nat.c | 7 +++ tests/sys/netpfil/common/nat.sh | 99 +++++++++++++++++++++++++++++++++++++- 10 files changed, 186 insertions(+), 5 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index e77930355094..d2c4885bc119 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -3271,6 +3271,9 @@ Reverse the way libalias handles aliasing. Obey transparent proxy rules only, packet aliasing is not performed. .It Cm skip_global Skip instance in case of global state lookup (see below). +.It Cm port_range Ar lower-upper +Set the aliasing ports between the ranges given. Upper port has to be greater +than lower. .El .Pp Some specials value can be supplied instead of diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h index 764e5176e8ef..42e4f4777792 100644 --- a/sbin/ipfw/ipfw2.h +++ b/sbin/ipfw/ipfw2.h @@ -285,6 +285,7 @@ enum tokens { TOK_STATES_CHUNKS, TOK_JMAXLEN, TOK_PORT_RANGE, + TOK_PORT_ALIAS, TOK_HOST_DEL_AGE, TOK_PG_DEL_AGE, TOK_TCP_SYN_AGE, diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c index dc55d0bfa416..89f21062811c 100644 --- a/sbin/ipfw/main.c +++ b/sbin/ipfw/main.c @@ -45,7 +45,8 @@ help(void) "[pipe|queue] {zero|delete|show} [N{,N}]\n" "nat N config {ip IPADDR|if IFNAME|log|deny_in|same_ports|unreg_only|unreg_cgn|\n" " reset|reverse|proxy_only|redirect_addr linkspec|\n" -" redirect_port linkspec|redirect_proto linkspec}\n" +" redirect_port linkspec|redirect_proto linkspec|\n" +" port_range lower-upper}\n" "set [disable N... enable N...] | move [rule] X to Y | swap X Y | show\n" "set N {show|list|zero|resetlog|delete} [N{,N}] | flush\n" "table N {add ip[/bits] [value] | delete ip[/bits] | flush | list}\n" diff --git a/sbin/ipfw/nat.c b/sbin/ipfw/nat.c index bbf5be666ea0..1076e1038b8a 100644 --- a/sbin/ipfw/nat.c +++ b/sbin/ipfw/nat.c @@ -65,6 +65,7 @@ static struct _s_x nat_params[] = { { "reset", TOK_RESET_ADDR }, { "reverse", TOK_ALIAS_REV }, { "proxy_only", TOK_PROXY_ONLY }, + { "port_range", TOK_PORT_ALIAS }, { "redirect_addr", TOK_REDIR_ADDR }, { "redirect_port", TOK_REDIR_PORT }, { "redirect_proto", TOK_REDIR_PROTO }, @@ -753,12 +754,35 @@ nat_show_cfg(struct nat44_cfg_nat *n, void *arg __unused) printf("\n"); } +static int +nat_port_alias_parse(char *str, u_short *lpout, u_short *hpout) { + long lp, hp; + char *ptr; + /* Lower port parsing */ + lp = (long) strtol(str, &ptr, 10); + if (lp < 1024 || lp > 65535) + return 0; + if (!ptr || *ptr != '-') + return 0; + /* Upper port parsing */ + hp = (long) strtol(ptr, &ptr, 10); + if (hp < 1024 || hp > 65535) + return 0; + if (ptr) + return 0; + + *lpout = (u_short) lp; + *hpout = (u_short) hp; + return 1; +} + void ipfw_config_nat(int ac, char **av) { ipfw_obj_header *oh; struct nat44_cfg_nat *n; /* Nat instance configuration. */ int i, off, tok, ac1; + u_short lp, hp; char *id, *buf, **av1, *end; size_t len; @@ -786,6 +810,7 @@ ipfw_config_nat(int ac, char **av) switch (tok) { case TOK_IP: case TOK_IF: + case TOK_PORT_ALIAS: ac1--; av1++; break; @@ -925,8 +950,24 @@ ipfw_config_nat(int ac, char **av) n->redir_cnt++; off += i; break; + case TOK_PORT_ALIAS: + if (ac == 0) + errx(EX_DATAERR, "missing option"); + if (!nat_port_alias_parse(av[0], &lp, &hp)) + errx(EX_DATAERR, + "You need a range of port(s) from 1024 <= x < 65536"); + if (lp >= hp) + errx(EX_DATAERR, + "Upper port has to be greater than lower port"); + n->alias_port_lo = lp; + n->alias_port_hi = hp; + ac--; + av++; + break; } } + if (n->mode & PKT_ALIAS_SAME_PORTS && n->alias_port_lo) + errx(EX_DATAERR, "same_ports and port_range cannot both be selected"); i = do_set3(IP_FW_NAT44_XCONFIG, &oh->opheader, len); if (i != 0) diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h index f0531a67132d..4d3099a781a0 100644 --- a/sys/netinet/ip_fw.h +++ b/sys/netinet/ip_fw.h @@ -549,6 +549,8 @@ struct nat44_cfg_nat { struct in_addr ip; /* nat IPv4 address */ uint32_t mode; /* aliasing mode */ uint32_t redir_cnt; /* number of entry in spool chain */ + u_short alias_port_lo; /* low range for port aliasing */ + u_short alias_port_hi; /* high range for port aliasing */ }; /* Nat command. */ diff --git a/sys/netinet/libalias/alias.h b/sys/netinet/libalias/alias.h index 671241212799..91351a9eb8b9 100644 --- a/sys/netinet/libalias/alias.h +++ b/sys/netinet/libalias/alias.h @@ -86,6 +86,7 @@ struct alias_link; /* Initialization and control functions. */ struct libalias *LibAliasInit(struct libalias *); void LibAliasSetAddress(struct libalias *, struct in_addr _addr); +void LibAliasSetAliasPortRange(struct libalias *la, u_short port_low, u_short port_hi); void LibAliasSetFWBase(struct libalias *, unsigned int _base, unsigned int _num); void LibAliasSetSkinnyPort(struct libalias *, unsigned int _port); unsigned int diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c index 8da9a7fe683a..1f85a606b2d5 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -595,6 +595,11 @@ GetNewPort(struct libalias *la, struct alias_link *lnk, int alias_port_param) */ port_net = lnk->src_port; port_sys = ntohs(port_net); + } else if (la->aliasPortLower) { + /* First trial is a random port in the aliasing range. */ + port_sys = la->aliasPortLower + + (arc4random() % la->aliasPortLength); + port_net = htons(port_sys); } else { /* First trial and all subsequent are random. */ port_sys = arc4random() & ALIAS_PORT_MASK; @@ -647,9 +652,15 @@ GetNewPort(struct libalias *la, struct alias_link *lnk, int alias_port_param) } #endif } - port_sys = arc4random() & ALIAS_PORT_MASK; - port_sys += ALIAS_PORT_BASE; - port_net = htons(port_sys); + if (la->aliasPortLower) { + port_sys = la->aliasPortLower + + (arc4random() % la->aliasPortLength); + port_net = htons(port_sys); + } else { + port_sys = arc4random() & ALIAS_PORT_MASK; + port_sys += ALIAS_PORT_BASE; + port_net = htons(port_sys); + } } #ifdef LIBALIAS_DEBUG @@ -2381,6 +2392,19 @@ LibAliasSetAddress(struct libalias *la, struct in_addr addr) LIBALIAS_UNLOCK(la); } + +void +LibAliasSetAliasPortRange(struct libalias *la, u_short port_low, + u_short port_high) +{ + + LIBALIAS_LOCK(la); + la->aliasPortLower = port_low; + /* Add 1 to the aliasPortLength as modulo has range of 1 to n-1 */ + la->aliasPortLength = port_high - port_low + 1; + LIBALIAS_UNLOCK(la); +} + void LibAliasSetTarget(struct libalias *la, struct in_addr target_addr) { diff --git a/sys/netinet/libalias/alias_local.h b/sys/netinet/libalias/alias_local.h index 5919851a4019..ba128638c1fe 100644 --- a/sys/netinet/libalias/alias_local.h +++ b/sys/netinet/libalias/alias_local.h @@ -163,6 +163,10 @@ struct libalias { struct in_addr true_addr; /* in network byte order. */ u_short true_port; /* in host byte order. */ + /* Port ranges for aliasing. */ + u_short aliasPortLower; + u_short aliasPortLength; + /* * sctp code support */ diff --git a/sys/netpfil/ipfw/ip_fw_nat.c b/sys/netpfil/ipfw/ip_fw_nat.c index 81229b2707e9..bcda3cff011c 100644 --- a/sys/netpfil/ipfw/ip_fw_nat.c +++ b/sys/netpfil/ipfw/ip_fw_nat.c @@ -93,6 +93,8 @@ struct cfg_nat { /* chain of redir instances */ LIST_HEAD(redir_chain, cfg_redir) redir_chain; char if_name[IF_NAMESIZE]; /* interface name */ + u_short alias_port_lo; /* low range for port aliasing */ + u_short alias_port_hi; /* high range for port aliasing */ }; static eventhandler_tag ifaddr_event_tag; @@ -528,9 +530,12 @@ nat44_config(struct ip_fw_chain *chain, struct nat44_cfg_nat *ucfg) ptr->ip = ucfg->ip; ptr->redir_cnt = ucfg->redir_cnt; ptr->mode = ucfg->mode; + ptr->alias_port_lo = ucfg->alias_port_lo; + ptr->alias_port_hi = ucfg->alias_port_hi; strlcpy(ptr->if_name, ucfg->if_name, sizeof(ptr->if_name)); LibAliasSetMode(ptr->lib, ptr->mode, ~0); LibAliasSetAddress(ptr->lib, ptr->ip); + LibAliasSetAliasPortRange(ptr->lib, ptr->alias_port_lo, ptr->alias_port_hi); /* * Redir and LSNAT configuration. @@ -658,6 +663,8 @@ export_nat_cfg(struct cfg_nat *ptr, struct nat44_cfg_nat *ucfg) ucfg->ip = ptr->ip; ucfg->redir_cnt = ptr->redir_cnt; ucfg->mode = ptr->mode; + ucfg->alias_port_lo = ptr->alias_port_lo; + ucfg->alias_port_hi = ptr->alias_port_hi; strlcpy(ucfg->if_name, ptr->if_name, sizeof(ucfg->if_name)); } diff --git a/tests/sys/netpfil/common/nat.sh b/tests/sys/netpfil/common/nat.sh index f74467dce062..9aa06de51337 100644 --- a/tests/sys/netpfil/common/nat.sh +++ b/tests/sys/netpfil/common/nat.sh @@ -147,10 +147,107 @@ userspace_nat_cleanup() firewall_cleanup $firewall } +common_cgn() { + firewall=$1 + portalias=$2 + firewall_init $firewall + nat_init $firewall + + epair_host_nat=$(vnet_mkepair) + epair_client1_nat=$(vnet_mkepair) + epair_client2_nat=$(vnet_mkepair) + + vnet_mkjail nat ${epair_host_nat}b ${epair_client1_nat}a ${epair_client2_nat}a + vnet_mkjail client1 ${epair_client1_nat}b + vnet_mkjail client2 ${epair_client2_nat}b + + ifconfig ${epair_host_nat}a 198.51.100.2/24 up + jexec nat ifconfig ${epair_host_nat}b 198.51.100.1/24 up + + jexec nat ifconfig ${epair_client1_nat}a 100.64.0.1/24 up + jexec client1 ifconfig ${epair_client1_nat}b 100.64.0.2/24 up + + jexec nat ifconfig ${epair_client2_nat}a 100.64.1.1/24 up + jexec client2 ifconfig ${epair_client2_nat}b 100.64.1.2/24 up + + jexec nat sysctl net.inet.ip.forwarding=1 + + jexec client1 route add -net 198.51.100.0/24 100.64.0.1 + jexec client2 route add -net 198.51.100.0/24 100.64.1.1 + + # ping fails without NAT configuration + atf_check -s exit:2 -o ignore jexec client1 ping -t 1 -c 1 198.51.100.2 + atf_check -s exit:2 -o ignore jexec client2 ping -t 1 -c 1 198.51.100.2 + + if [[ $portalias ]]; then + firewall_config nat $firewall \ + "ipfw" \ + "ipfw -q nat 123 config if ${epair_host_nat}b unreg_cgn port_alias 2000-2999" \ + "ipfw -q nat 456 config if ${epair_host_nat}b unreg_cgn port_alias 3000-3999" \ + "ipfw -q add 1000 nat 123 all from any to 198.51.100.2 2000-2999 in via ${epair_host_nat}b" \ + "ipfw -q add 2000 nat 456 all from any to 198.51.100.2 3000-3999 in via ${epair_host_nat}b" \ + "ipfw -q add 3000 nat 123 all from 100.64.0.2 to any out via ${epair_host_nat}b" \ + "ipfw -q add 4000 nat 456 all from 100.64.1.2 to any out via ${epair_host_nat}b" + else + firewall_config nat $firewall \ + "ipfw" \ + "ipfw -q nat 123 config if ${epair_host_nat}b unreg_cgn" \ + "ipfw -q add 1000 nat 123 all from any to any" + fi + + # ping is successful now + atf_check -s exit:0 -o ignore jexec client1 ping -t 1 -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore jexec client2 ping -t 1 -c 1 198.51.100.2 + + # if portalias, test a tcp server/client with nc + if [[ $portalias ]]; then + for inst in 1 2; do + daemon nc -p 198.51.100.2 7 + atf_check -s exit:0 -o ignore jexec client$inst sh -c "echo | nc -N 198.51.100.2 7" + done + fi +} + +cgn_head() +{ + atf_set descr 'IPv4 CGN (RFC 6598) test' + atf_set require.user root +} + +cgn_body() +{ + common_cgn $1 false +} + +cgn_cleanup() +{ + firewall_cleanup ipfw +} + +portalias_head() +{ + atf_set descr 'IPv4 CGN (RFC 6598) port aliasing test' + atf_set require.user root +} + +portalias_body() +{ + common_cgn $1 true +} + +portalias_cleanup() +{ + firewall_cleanup ipfw +} + setup_tests \ basic \ pf \ ipfw \ ipfnat \ userspace_nat \ - ipfw \ No newline at end of file + ipfw \ + cgn \ + ipfw \ + portalias \ + ipfw From owner-dev-commits-src-all@freebsd.org Tue Feb 2 22: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 C257A53EFF4; Tue, 2 Feb 2021 22:01: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 4DVdzx582Fz4dRl; Tue, 2 Feb 2021 22:01: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 A36FD15D84; Tue, 2 Feb 2021 22:01: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 112M11mp005601; Tue, 2 Feb 2021 22:01:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 112M11hg005600; Tue, 2 Feb 2021 22:01:01 GMT (envelope-from git) Date: Tue, 2 Feb 2021 22:01:01 GMT Message-Id: <202102022201.112M11hg005600@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: edc374e7c41d - main - Correct description for kern.proc.proc_td 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: edc374e7c41d3d9e28e0b3a76bc9ed021d7db571 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:01:01 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=edc374e7c41d3d9e28e0b3a76bc9ed021d7db571 commit edc374e7c41d3d9e28e0b3a76bc9ed021d7db571 Author: Ed Maste AuthorDate: 2021-02-02 21:55:51 +0000 Commit: Ed Maste CommitDate: 2021-02-02 22:00:05 +0000 Correct description for kern.proc.proc_td kern.proc.proc_td returns the process table with an entry for each thread. Previously the description included "no threads", presumably a cut-and-pasteo in 2648efa621748. Description suggested by PauAmma. PR: 253146 MFC after: 3 days Sponsored by: The FreeBSD Foundation --- sys/kern/kern_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index ae80ba9ed5ed..305bc7e8a2ef 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -3186,7 +3186,7 @@ static SYSCTL_NODE(_kern_proc, (KERN_PROC_PID | KERN_PROC_INC_THREAD), pid_td, static SYSCTL_NODE(_kern_proc, (KERN_PROC_PROC | KERN_PROC_INC_THREAD), proc_td, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, - "Return process table, no threads"); + "Return process table, including threads"); #ifdef COMPAT_FREEBSD7 static SYSCTL_NODE(_kern_proc, KERN_PROC_OVMMAP, ovmmap, CTLFLAG_RD | From owner-dev-commits-src-all@freebsd.org Wed Feb 3 00:04: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 97F2E4FA4BE; Wed, 3 Feb 2021 00:04: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 4DVhkj3y7Wz4l55; Wed, 3 Feb 2021 00:04: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 7A6111779A; Wed, 3 Feb 2021 00:04: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 11304jgT066686; Wed, 3 Feb 2021 00:04:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11304jNI066685; Wed, 3 Feb 2021 00:04:45 GMT (envelope-from git) Date: Wed, 3 Feb 2021 00:04:45 GMT Message-Id: <202102030004.11304jNI066685@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: 805e2876ec20 - main - release.sh: Skip installing textproc/docproj when NODOC is set 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: 805e2876ec20f89e45f0f9f4164f31b6711ff0ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:04:45 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=805e2876ec20f89e45f0f9f4164f31b6711ff0ea commit 805e2876ec20f89e45f0f9f4164f31b6711ff0ea Author: Glen Barber AuthorDate: 2021-02-03 00:04:11 +0000 Commit: Glen Barber CommitDate: 2021-02-03 00:04:11 +0000 release.sh: Skip installing textproc/docproj when NODOC is set PR: 253192 Submitted by: Yasuhiro Kimura MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.sh b/release/release.sh index 372f69177f7e..4020c27feaa0 100755 --- a/release/release.sh +++ b/release/release.sh @@ -320,7 +320,7 @@ extra_chroot_setup() { pkg clean -y fi fi - if [ -d ${CHROOTDIR}/usr/ports ]; then + if [ -z "${NODOC}" ] && [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right # thing. _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) From owner-dev-commits-src-all@freebsd.org Wed Feb 3 00:47: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 D56834FB816; Wed, 3 Feb 2021 00:47:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVjgt5jBFz4nL9; Wed, 3 Feb 2021 00:47:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:a03e:f824:f6c:d0c]) (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 319F32EB63; Wed, 3 Feb 2021 00:47:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: aa906e2a4957 - main - OpenSSL: Support for kernel TLS offload (KTLS) To: Guido Falsi , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202101281825.10SIPTGJ021104@gitrepo.freebsd.org> <8257bc17-3a2d-f348-a0d5-fbd0f637629f@FreeBSD.org> Cc: Benjamin Kaduk From: John Baldwin Message-ID: <1675730b-f559-a732-be49-d89c97a376f8@FreeBSD.org> Date: Tue, 2 Feb 2021 16:47:20 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <8257bc17-3a2d-f348-a0d5-fbd0f637629f@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: Wed, 03 Feb 2021 00:47:22 -0000 On 1/31/21 10:41 AM, Guido Falsi wrote: > On 28/01/21 19:25, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=aa906e2a4957db700d9e6cc60857e1afe1aecc85 >> >> commit aa906e2a4957db700d9e6cc60857e1afe1aecc85 >> Author: John Baldwin >> AuthorDate: 2021-01-16 00:17:31 +0000 >> Commit: John Baldwin >> CommitDate: 2021-01-28 18:24:13 +0000 >> >> OpenSSL: Support for kernel TLS offload (KTLS) >> >> This merges upstream patches from OpenSSL's master branch to add >> KTLS infrastructure for TLS 1.0-1.3 including both RX and TX >> offload and SSL_sendfile support on both Linux and FreeBSD. >> >> Note that TLS 1.3 only supports TX offload. >> >> A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with >> KTLS support. It defaults to enabled on amd64 and disabled on all >> other architectures. >> >> Reviewed by: jkim (earlier version) >> Approved by: secteam >> Obtained from: OpenSSL (patches from master) >> MFC after: 1 week >> Relnotes: yes >> Sponsored by: Netflix >> Differential Revision: https://reviews.freebsd.org/D28273 >> --- > > This commit causes a strange interaction/regression with subverison > client when using https protocol. > > I filed a bug report about this: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253135 > > Workarounds: > > - Compiling system defining WITHOUT_OPENSSL_KTLS > - using the svn:// scheme I'm still waiting for a build to finish so I can test it, but I believe this is a bug in serf. This is the patch I'm going to test: diff --git a/contrib/serf/buckets/ssl_buckets.c b/contrib/serf/buckets/ssl_buckets.c index b01e5359db08..3c8b7e2a685f 100644 --- a/contrib/serf/buckets/ssl_buckets.c +++ b/contrib/serf/buckets/ssl_buckets.c @@ -407,7 +407,7 @@ static int bio_bucket_destroy(BIO *bio) static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) { - long ret = 1; + long ret = 0; switch (cmd) { default: @@ -415,6 +415,7 @@ static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) break; case BIO_CTRL_FLUSH: /* At this point we can't force a flush. */ + ret = 1; break; case BIO_CTRL_PUSH: case BIO_CTRL_POP: serf defines its own custom OpenSSL BIO classes, and the BIO_ctrl(3) manpage documents that the control methods of custom BIOs are supposed to return 0 for unknown or unsupported requests: Source/sink BIOs return an 0 if they do not recognize the BIO_ctrl() operation. However, the custom BIOs in serf broke this rule and returned 1 for unknown operations instead. OpenSSL uses BIO_ctrl methods to determine if a given BIO for a read or write side of an SSL connection is using KTLS. Because of the serf bug, this caused OpenSSL to believe that these BIOs were using KTLS when they in fact were not. serf will also probably break with OpenSSL 3.0 even without KTLS due to the recently added control for determining if a BIO has hit EOF which also returns 1 to indicate it has hit EOF. -- John Baldwin From owner-dev-commits-src-all@freebsd.org Wed Feb 3 04: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 D44DD528CB1; Wed, 3 Feb 2021 04: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 4DVp8F5g9qz3Gxt; Wed, 3 Feb 2021 04: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 B599E1A6D1; Wed, 3 Feb 2021 04: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 11348jKM080339; Wed, 3 Feb 2021 04: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 11348jKJ080338; Wed, 3 Feb 2021 04:08:45 GMT (envelope-from git) Date: Wed, 3 Feb 2021 04:08:45 GMT Message-Id: <202102030408.11348jKJ080338@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: c738bfc506af - stable/13 - cxgb(4): Remove assumption of physically contiguous mbufs. 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: c738bfc506af1feaff2f138534bb5fc99da7e042 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 04:08:45 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=c738bfc506af1feaff2f138534bb5fc99da7e042 commit c738bfc506af1feaff2f138534bb5fc99da7e042 Author: Alexander Motin AuthorDate: 2021-01-31 17:46:57 +0000 Commit: Alexander Motin CommitDate: 2021-02-03 04:08:43 +0000 cxgb(4): Remove assumption of physically contiguous mbufs. Investigation of iSCSI target data corruption reports brought me to discovery that cxgb(4) expects mbufs to be physically contiguous, that is not true after I've started using m_extaddref() in software iSCSI for large zero-copy transmissions. In case of fragmented memory the driver transmitted garbage from pages following the first one due to simple use of pmap_kextract() for the first pointer instead of proper bus_dmamap_load_mbuf_sg(). Seems like it was done as some optimization many years ago, and at very least it is wrong in a world of IOMMUs. This patch just removes that optimization, plus limits packet coalescing for mbufs crossing page boundary, also depending on assumption of one segment per packet. Sponsored by: iXsystems, Inc. (cherry picked from commit 9dc7c250b8bd2d5e669c7633e189a700a02c0571) --- sys/dev/cxgb/cxgb_sge.c | 3 ++- sys/dev/cxgb/sys/mvec.h | 14 -------------- sys/dev/cxgb/sys/uipc_mvec.c | 24 +++--------------------- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 7f456ccff4ca..491d1a751f4a 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -322,7 +322,8 @@ coalesce_check(struct mbuf *m, void *arg) int *nbytes = &ci->nbytes; if ((*nbytes == 0) || ((*nbytes + m->m_len <= 10500) && - (*count < 7) && (m->m_next == NULL))) { + (*count < 7) && (m->m_next == NULL) && + ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len <= PAGE_SIZE))) { *count += 1; *nbytes += m->m_len; return (1); diff --git a/sys/dev/cxgb/sys/mvec.h b/sys/dev/cxgb/sys/mvec.h index bdd0b55c5489..4989bff29ec4 100644 --- a/sys/dev/cxgb/sys/mvec.h +++ b/sys/dev/cxgb/sys/mvec.h @@ -33,20 +33,6 @@ #define _MVEC_H_ #include -static __inline void -busdma_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map, - struct mbuf *m, bus_dma_segment_t *seg) -{ -#if defined(__i386__) || defined(__amd64__) - seg->ds_addr = pmap_kextract(mtod(m, vm_offset_t)); - seg->ds_len = m->m_len; -#else - int nsegstmp; - - bus_dmamap_load_mbuf_sg(tag, map, m, seg, &nsegstmp, 0); -#endif -} - int busdma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map, struct mbuf **m, bus_dma_segment_t *segs, int *nsegs); void busdma_map_sg_vec(bus_dma_tag_t tag, bus_dmamap_t map, diff --git a/sys/dev/cxgb/sys/uipc_mvec.c b/sys/dev/cxgb/sys/uipc_mvec.c index ca31cf1897c7..02f437079468 100644 --- a/sys/dev/cxgb/sys/uipc_mvec.c +++ b/sys/dev/cxgb/sys/uipc_mvec.c @@ -65,26 +65,7 @@ busdma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map, retry: psegs = segs; seg_count = 0; - if (n->m_next == NULL) { - busdma_map_mbuf_fast(tag, map, n, segs); - *nsegs = 1; - return (0); - } -#if defined(__i386__) || defined(__amd64__) - while (n && seg_count < TX_MAX_SEGS) { - /* - * firmware doesn't like empty segments - */ - if (__predict_true(n->m_len != 0)) { - seg_count++; - busdma_map_mbuf_fast(tag, map, n, psegs); - psegs++; - } - n = n->m_next; - } -#else err = bus_dmamap_load_mbuf_sg(tag, map, *m, segs, &seg_count, 0); -#endif if (seg_count == 0) { if (cxgb_debug) printf("empty segment chain\n"); @@ -117,8 +98,9 @@ void busdma_map_sg_vec(bus_dma_tag_t tag, bus_dmamap_t map, struct mbuf *m, bus_dma_segment_t *segs, int *nsegs) { + int n = 0; - for (*nsegs = 0; m != NULL ; segs++, *nsegs += 1, m = m->m_nextpkt) - busdma_map_mbuf_fast(tag, map, m, segs); + for (*nsegs = 0; m != NULL; segs += n, *nsegs += n, m = m->m_nextpkt) + bus_dmamap_load_mbuf_sg(tag, map, m, segs, &n, 0); } From owner-dev-commits-src-all@freebsd.org Wed Feb 3 04:09: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 9B6E3528F3A; Wed, 3 Feb 2021 04:09: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 4DVp8q43jnz3H6C; Wed, 3 Feb 2021 04:09: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 740A51A73B; Wed, 3 Feb 2021 04:09: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 11349Fji080517; Wed, 3 Feb 2021 04:09:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11349FAt080516; Wed, 3 Feb 2021 04:09:15 GMT (envelope-from git) Date: Wed, 3 Feb 2021 04:09:15 GMT Message-Id: <202102030409.11349FAt080516@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: 4a1ea6a210b2 - stable/12 - cxgb(4): Remove assumption of physically contiguous mbufs. 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: 4a1ea6a210b2729b7599e2e069cc846b7e0390f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 04:09:15 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=4a1ea6a210b2729b7599e2e069cc846b7e0390f8 commit 4a1ea6a210b2729b7599e2e069cc846b7e0390f8 Author: Alexander Motin AuthorDate: 2021-01-31 17:46:57 +0000 Commit: Alexander Motin CommitDate: 2021-02-03 04:09:05 +0000 cxgb(4): Remove assumption of physically contiguous mbufs. Investigation of iSCSI target data corruption reports brought me to discovery that cxgb(4) expects mbufs to be physically contiguous, that is not true after I've started using m_extaddref() in software iSCSI for large zero-copy transmissions. In case of fragmented memory the driver transmitted garbage from pages following the first one due to simple use of pmap_kextract() for the first pointer instead of proper bus_dmamap_load_mbuf_sg(). Seems like it was done as some optimization many years ago, and at very least it is wrong in a world of IOMMUs. This patch just removes that optimization, plus limits packet coalescing for mbufs crossing page boundary, also depending on assumption of one segment per packet. Sponsored by: iXsystems, Inc. (cherry picked from commit 9dc7c250b8bd2d5e669c7633e189a700a02c0571) --- sys/dev/cxgb/cxgb_sge.c | 3 ++- sys/dev/cxgb/sys/mvec.h | 14 -------------- sys/dev/cxgb/sys/uipc_mvec.c | 24 +++--------------------- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 74c3b873f593..489d74459ae1 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -322,7 +322,8 @@ coalesce_check(struct mbuf *m, void *arg) int *nbytes = &ci->nbytes; if ((*nbytes == 0) || ((*nbytes + m->m_len <= 10500) && - (*count < 7) && (m->m_next == NULL))) { + (*count < 7) && (m->m_next == NULL) && + ((mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len <= PAGE_SIZE))) { *count += 1; *nbytes += m->m_len; return (1); diff --git a/sys/dev/cxgb/sys/mvec.h b/sys/dev/cxgb/sys/mvec.h index bdd0b55c5489..4989bff29ec4 100644 --- a/sys/dev/cxgb/sys/mvec.h +++ b/sys/dev/cxgb/sys/mvec.h @@ -33,20 +33,6 @@ #define _MVEC_H_ #include -static __inline void -busdma_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map, - struct mbuf *m, bus_dma_segment_t *seg) -{ -#if defined(__i386__) || defined(__amd64__) - seg->ds_addr = pmap_kextract(mtod(m, vm_offset_t)); - seg->ds_len = m->m_len; -#else - int nsegstmp; - - bus_dmamap_load_mbuf_sg(tag, map, m, seg, &nsegstmp, 0); -#endif -} - int busdma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map, struct mbuf **m, bus_dma_segment_t *segs, int *nsegs); void busdma_map_sg_vec(bus_dma_tag_t tag, bus_dmamap_t map, diff --git a/sys/dev/cxgb/sys/uipc_mvec.c b/sys/dev/cxgb/sys/uipc_mvec.c index ca31cf1897c7..02f437079468 100644 --- a/sys/dev/cxgb/sys/uipc_mvec.c +++ b/sys/dev/cxgb/sys/uipc_mvec.c @@ -65,26 +65,7 @@ busdma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map, retry: psegs = segs; seg_count = 0; - if (n->m_next == NULL) { - busdma_map_mbuf_fast(tag, map, n, segs); - *nsegs = 1; - return (0); - } -#if defined(__i386__) || defined(__amd64__) - while (n && seg_count < TX_MAX_SEGS) { - /* - * firmware doesn't like empty segments - */ - if (__predict_true(n->m_len != 0)) { - seg_count++; - busdma_map_mbuf_fast(tag, map, n, psegs); - psegs++; - } - n = n->m_next; - } -#else err = bus_dmamap_load_mbuf_sg(tag, map, *m, segs, &seg_count, 0); -#endif if (seg_count == 0) { if (cxgb_debug) printf("empty segment chain\n"); @@ -117,8 +98,9 @@ void busdma_map_sg_vec(bus_dma_tag_t tag, bus_dmamap_t map, struct mbuf *m, bus_dma_segment_t *segs, int *nsegs) { + int n = 0; - for (*nsegs = 0; m != NULL ; segs++, *nsegs += 1, m = m->m_nextpkt) - busdma_map_mbuf_fast(tag, map, m, segs); + for (*nsegs = 0; m != NULL; segs += n, *nsegs += n, m = m->m_nextpkt) + bus_dmamap_load_mbuf_sg(tag, map, m, segs, &n, 0); } From owner-dev-commits-src-all@freebsd.org Wed Feb 3 05:06: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 62DB252A564; Wed, 3 Feb 2021 05:06: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 4DVqRF2PX6z3Kyp; Wed, 3 Feb 2021 05:06: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 454561AEF7; Wed, 3 Feb 2021 05:06: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 11356nBH057814; Wed, 3 Feb 2021 05:06:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11356n11057813; Wed, 3 Feb 2021 05:06:49 GMT (envelope-from git) Date: Wed, 3 Feb 2021 05:06:49 GMT Message-Id: <202102030506.11356n11057813@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: 10625515ad47 - stable/13 - MFC: mips: fix early kernel panic when setting up interrupt counters 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: 10625515ad47b52f38c13f4f1d8f8c848e9df4ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 05:06:49 -0000 The branch stable/13 has been updated by gonzo: URL: https://cgit.FreeBSD.org/src/commit/?id=10625515ad47b52f38c13f4f1d8f8c848e9df4ee commit 10625515ad47b52f38c13f4f1d8f8c848e9df4ee Author: Oleksandr Tymoshenko AuthorDate: 2021-02-01 07:56:22 +0000 Commit: Oleksandr Tymoshenko CommitDate: 2021-02-03 05:06:37 +0000 MFC: mips: fix early kernel panic when setting up interrupt counters Commit 248f0ca converted intrcnt and intrnames from u_long[] and char[] to u_long* and char* respectively, but for non-INTRNG mips these symbols were defined in .S file as a pre-allocated static arrays, so the problem wasn't cought at compile time. Conversion from an array to a pointer requires pointer initialization and it wasn't done for MIPS, so whatever happenned to be in the begginning of intcnt[] array was used as a pointer value. Move intrcnt/intrnames to C code and allocate them dynamically although with a fixed size at the moment. Reviewed by: emaste PR: 253051 Differential Revision: https://reviews.freebsd.org/D28424 MFC after: 1 day (cherry picked from commit e0a0a3efcb09a10ad1de29aca622ea580b2663d2) mips: fix NLM platforms breakage caused by e0a0a3ef NetLogic platforms have their own implementation of cpu_init_interrupts. Apply the same logic to it as to intr_machdep.c. PR: 253051 (cherry picked from commit d6f9c5a6d2f87865f9714d2b8dfd1a9f3080c71e) --- sys/mips/mips/exception.S | 36 ------------------------------------ sys/mips/mips/intr_machdep.c | 22 ++++++++++++++++++++++ sys/mips/nlm/intr_machdep.c | 18 ++++++++++++++++++ 3 files changed, 40 insertions(+), 36 deletions(-) diff --git a/sys/mips/mips/exception.S b/sys/mips/mips/exception.S index 892bebc8f37f..719904ac83b7 100644 --- a/sys/mips/mips/exception.S +++ b/sys/mips/mips/exception.S @@ -80,12 +80,6 @@ dtrace_invop_calltrap_addr: .text #endif -/* - * Reasonable limit - */ -#define INTRCNT_COUNT 256 - - /* *---------------------------------------------------------------------------- * @@ -1206,36 +1200,6 @@ FPReturn: .set pop END(MipsFPTrap) -#ifndef INTRNG -/* - * Interrupt counters for vmstat. - */ - .data - .globl intrcnt - .globl sintrcnt - .globl intrnames - .globl sintrnames -intrnames: - .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 -sintrnames: -#ifdef __mips_n64 - .quad INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 -#else - .int INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 -#endif - - .align (_MIPS_SZLONG / 8) -intrcnt: - .space INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 -sintrcnt: -#ifdef __mips_n64 - .quad INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 -#else - .int INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2 -#endif -#endif /* INTRNG */ - - /* * Vector to real handler in KSEG1. */ diff --git a/sys/mips/mips/intr_machdep.c b/sys/mips/mips/intr_machdep.c index 3b278276865c..a36944f657ca 100644 --- a/sys/mips/mips/intr_machdep.c +++ b/sys/mips/mips/intr_machdep.c @@ -50,6 +50,19 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef INTRNG +#define INTRCNT_COUNT 256 +#define INTRNAME_LEN (2*MAXCOMLEN + 1) + +MALLOC_DECLARE(M_MIPSINTR); +MALLOC_DEFINE(M_MIPSINTR, "mipsintr", "MIPS interrupt handling"); + +u_long *intrcnt; +char *intrnames; +size_t sintrcnt; +size_t sintrnames; +#endif + static struct intr_event *hardintr_events[NHARD_IRQS]; static struct intr_event *softintr_events[NSOFT_IRQS]; static mips_intrcnt_t mips_intr_counters[NSOFT_IRQS + NHARD_IRQS]; @@ -121,6 +134,15 @@ cpu_init_interrupts() int i; char name[MAXCOMLEN + 1]; +#ifndef INTRNG + intrcnt = mallocarray(INTRCNT_COUNT, sizeof(u_long), M_MIPSINTR, + M_WAITOK | M_ZERO); + intrnames = mallocarray(INTRCNT_COUNT, INTRNAME_LEN, M_MIPSINTR, + M_WAITOK | M_ZERO); + sintrcnt = INTRCNT_COUNT * sizeof(u_long); + sintrnames = INTRCNT_COUNT * INTRNAME_LEN; +#endif + /* * Initialize all available vectors so spare IRQ * would show up in systat output diff --git a/sys/mips/nlm/intr_machdep.c b/sys/mips/nlm/intr_machdep.c index b66118c06ee8..33bfad1fe882 100644 --- a/sys/mips/nlm/intr_machdep.c +++ b/sys/mips/nlm/intr_machdep.c @@ -59,6 +59,17 @@ __FBSDID("$FreeBSD$"); #include #include +#define INTRCNT_COUNT 256 +#define INTRNAME_LEN (2*MAXCOMLEN + 1) + +MALLOC_DECLARE(M_MIPSINTR); +MALLOC_DEFINE(M_MIPSINTR, "mipsintr", "MIPS interrupt handling"); + +u_long *intrcnt; +char *intrnames; +size_t sintrcnt; +size_t sintrnames; + struct xlp_intrsrc { void (*bus_ack)(int, void *); /* Additional ack */ void *bus_ack_arg; /* arg for additional ack */ @@ -295,6 +306,13 @@ cpu_init_interrupts() int i; char name[MAXCOMLEN + 1]; + intrcnt = mallocarray(INTRCNT_COUNT, sizeof(u_long), M_MIPSINTR, + M_WAITOK | M_ZERO); + intrnames = mallocarray(INTRCNT_COUNT, INTRNAME_LEN, M_MIPSINTR, + M_WAITOK | M_ZERO); + sintrcnt = INTRCNT_COUNT * sizeof(u_long); + sintrnames = INTRCNT_COUNT * INTRNAME_LEN; + /* * Initialize all available vectors so spare IRQ * would show up in systat output From owner-dev-commits-src-all@freebsd.org Wed Feb 3 06:56: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 F29BD52D594; Wed, 3 Feb 2021 06:56: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 4DVssP6YcXz3hGc; Wed, 3 Feb 2021 06:56: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 C97BF1C86F; Wed, 3 Feb 2021 06:56: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 1136u9H4000909; Wed, 3 Feb 2021 06:56:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1136u9OA000908; Wed, 3 Feb 2021 06:56:09 GMT (envelope-from git) Date: Wed, 3 Feb 2021 06:56:09 GMT Message-Id: <202102030656.1136u9OA000908@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: 13de72571eb2 - stable/13 - stand: lua: enhance lfs.dir() to speed up kernels_autodetect 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: 13de72571eb2532e253fb8d40edf47ebabb99e92 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 06:56:10 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=13de72571eb2532e253fb8d40edf47ebabb99e92 commit 13de72571eb2532e253fb8d40edf47ebabb99e92 Author: Kyle Evans AuthorDate: 2021-01-24 01:32:38 +0000 Commit: Kyle Evans CommitDate: 2021-02-03 06:55:47 +0000 stand: lua: enhance lfs.dir() to speed up kernels_autodetect This eliminates a lot of stat() calls that happen when lualoader renders the menu with the default settings, and greatly speeds up rendering on my laptop. ftype is nil if loader/loader.efi hasn't been updated yet, falling back to lfs.attributes() to test. This is technically incompatible with lfs, but not in a particularly terrible way. (cherry picked from commit e25ee296c919d6567aa76058a7049eac974797fb) --- libexec/flua/modules/lfs.c | 28 +++++++++++++++++++++++++++- stand/lua/core.lua | 8 ++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/libexec/flua/modules/lfs.c b/libexec/flua/modules/lfs.c index 52a30c1515a9..e36c78d3b35b 100644 --- a/libexec/flua/modules/lfs.c +++ b/libexec/flua/modules/lfs.c @@ -122,6 +122,27 @@ __FBSDID("$FreeBSD$"); #define DIR_METATABLE "directory iterator metatable" +static int +lua_dir_iter_pushtype(lua_State *L __unused, const struct dirent *ent __unused) +{ + + /* + * This is a non-standard extension to luafilesystem for loader's + * benefit. The extra stat() calls to determine the entry type can + * be quite expensive on some systems, so this speeds up enumeration of + * /boot greatly by providing the type up front. + * + * This extension is compatible enough with luafilesystem, in that we're + * just using an extra return value for the iterator. + */ +#ifdef _STANDALONE + lua_pushinteger(L, ent->d_type); + return 1; +#else + return 0; +#endif +} + static int lua_dir_iter_next(lua_State *L) { @@ -144,7 +165,7 @@ lua_dir_iter_next(lua_State *L) } lua_pushstring(L, entry->d_name); - return 1; + return 1 + lua_dir_iter_pushtype(L, entry); } static int @@ -420,5 +441,10 @@ luaopen_lfs(lua_State *L) { register_metatable(L); luaL_newlib(L, fslib); +#ifdef _STANDALONE + /* Non-standard extension for loader, used with lfs.dir(). */ + lua_pushinteger(L, DT_DIR); + lua_setfield(L, -2, "DT_DIR"); +#endif return 1; } diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 9d331bc0ad3a..a119c3c258f8 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -240,14 +240,18 @@ function core.kernelList() -- Automatically detect other bootable kernel directories using a -- heuristic. Any directory in /boot that contains an ordinary file -- named "kernel" is considered eligible. - for file in lfs.dir("/boot") do + for file, ftype in lfs.dir("/boot") do local fname = "/boot/" .. file if file == "." or file == ".." then goto continue end - if lfs.attributes(fname, "mode") ~= "directory" then + if ftype then + if ftype ~= lfs.DT_DIR then + goto continue + end + elseif lfs.attributes(fname, "mode") ~= "directory" then goto continue end From owner-dev-commits-src-all@freebsd.org Wed Feb 3 06:56: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 133FC52D57B; Wed, 3 Feb 2021 06:56: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 4DVssR05VHz3h9y; Wed, 3 Feb 2021 06:56: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 EA9171CAC0; Wed, 3 Feb 2021 06:56: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 1136uAaP000930; Wed, 3 Feb 2021 06:56:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1136uA5R000929; Wed, 3 Feb 2021 06:56:10 GMT (envelope-from git) Date: Wed, 3 Feb 2021 06:56:10 GMT Message-Id: <202102030656.1136uA5R000929@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: e3cd8246c756 - stable/13 - lualoader: position hyphens at the beginning of character classes 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: e3cd8246c756e568956da1ad8e90e1983d9af89f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 06:56:11 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e3cd8246c756e568956da1ad8e90e1983d9af89f commit e3cd8246c756e568956da1ad8e90e1983d9af89f Author: Kyle Evans AuthorDate: 2021-01-31 15:51:39 +0000 Commit: Kyle Evans CommitDate: 2021-02-03 06:55:51 +0000 lualoader: position hyphens at the beginning of character classes According to the Lua 5.4 manual section 6.4.1 ("Patterns"), the interaction between ranges and classes is not defined and hyphens must be specified at either the beginning or the end of a set if they are not escaped. Move all such occurrences to the beginning. (cherry picked from commit b24872cf7b13314669ed2136c0262bb2eb007695) --- stand/lua/config.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/lua/config.lua b/stand/lua/config.lua index f569b2e00b76..9ef7c0796f46 100644 --- a/stand/lua/config.lua +++ b/stand/lua/config.lua @@ -62,10 +62,10 @@ local MSG_FAILSYN_EOLESC = "Stray escape at end of line" local MSG_FAILSYN_EOLVAR = "Unescaped $ at end of line" local MSG_FAILSYN_BADVAR = "Malformed variable expression at position '%d'" -local MODULEEXPR = '([%w-_]+)' +local MODULEEXPR = '([-%w_]+)' local QVALEXPR = '"(.*)"' local QVALREPL = QVALEXPR:gsub('%%', '%%%%') -local WORDEXPR = "([%w%d-][%w%d-_.]*)" +local WORDEXPR = "([-%w%d][-%w%d_.]*)" local WORDREPL = WORDEXPR:gsub('%%', '%%%%') -- Entries that should never make it into the environment; each one should have @@ -182,7 +182,7 @@ local function processEnvVar(value) -- Skip the $ vinit = i + 1 vdelim = nil - vpat = "^([%w][%w%d-_.]*)" + vpat = "^([%w][-%w%d_.]*)" end local name = value:match(vpat, vinit) @@ -346,7 +346,7 @@ local function getBlacklist() return blacklist end - for mod in blacklist_str:gmatch("[;, ]?([%w-_]+)[;, ]?") do + for mod in blacklist_str:gmatch("[;, ]?([-%w_]+)[;, ]?") do blacklist[mod] = true end return blacklist From owner-dev-commits-src-all@freebsd.org Wed Feb 3 06:58: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 D81A452D6A8; Wed, 3 Feb 2021 06:58: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 4DVsw95nJdz3hhJ; Wed, 3 Feb 2021 06:58: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 AF0441C6D2; Wed, 3 Feb 2021 06:58: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 1136wX2g001394; Wed, 3 Feb 2021 06:58:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1136wXVJ001393; Wed, 3 Feb 2021 06:58:33 GMT (envelope-from git) Date: Wed, 3 Feb 2021 06:58:33 GMT Message-Id: <202102030658.1136wXVJ001393@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: 32b391d4a99c - stable/12 - stand: lua: enhance lfs.dir() to speed up kernels_autodetect 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: 32b391d4a99c8c3a52ea1d2c0c82ee3208b77a19 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 06:58:33 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=32b391d4a99c8c3a52ea1d2c0c82ee3208b77a19 commit 32b391d4a99c8c3a52ea1d2c0c82ee3208b77a19 Author: Kyle Evans AuthorDate: 2021-01-24 01:32:38 +0000 Commit: Kyle Evans CommitDate: 2021-02-03 06:58:18 +0000 stand: lua: enhance lfs.dir() to speed up kernels_autodetect This eliminates a lot of stat() calls that happen when lualoader renders the menu with the default settings, and greatly speeds up rendering on my laptop. ftype is nil if loader/loader.efi hasn't been updated yet, falling back to lfs.attributes() to test. This is technically incompatible with lfs, but not in a particularly terrible way. (cherry picked from commit e25ee296c919d6567aa76058a7049eac974797fb) --- libexec/flua/modules/lfs.c | 28 +++++++++++++++++++++++++++- stand/lua/core.lua | 8 ++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/libexec/flua/modules/lfs.c b/libexec/flua/modules/lfs.c index 52a30c1515a9..e36c78d3b35b 100644 --- a/libexec/flua/modules/lfs.c +++ b/libexec/flua/modules/lfs.c @@ -122,6 +122,27 @@ __FBSDID("$FreeBSD$"); #define DIR_METATABLE "directory iterator metatable" +static int +lua_dir_iter_pushtype(lua_State *L __unused, const struct dirent *ent __unused) +{ + + /* + * This is a non-standard extension to luafilesystem for loader's + * benefit. The extra stat() calls to determine the entry type can + * be quite expensive on some systems, so this speeds up enumeration of + * /boot greatly by providing the type up front. + * + * This extension is compatible enough with luafilesystem, in that we're + * just using an extra return value for the iterator. + */ +#ifdef _STANDALONE + lua_pushinteger(L, ent->d_type); + return 1; +#else + return 0; +#endif +} + static int lua_dir_iter_next(lua_State *L) { @@ -144,7 +165,7 @@ lua_dir_iter_next(lua_State *L) } lua_pushstring(L, entry->d_name); - return 1; + return 1 + lua_dir_iter_pushtype(L, entry); } static int @@ -420,5 +441,10 @@ luaopen_lfs(lua_State *L) { register_metatable(L); luaL_newlib(L, fslib); +#ifdef _STANDALONE + /* Non-standard extension for loader, used with lfs.dir(). */ + lua_pushinteger(L, DT_DIR); + lua_setfield(L, -2, "DT_DIR"); +#endif return 1; } diff --git a/stand/lua/core.lua b/stand/lua/core.lua index ad9a3e353fd1..7f6b809761c4 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -238,14 +238,18 @@ function core.kernelList() -- Automatically detect other bootable kernel directories using a -- heuristic. Any directory in /boot that contains an ordinary file -- named "kernel" is considered eligible. - for file in lfs.dir("/boot") do + for file, ftype in lfs.dir("/boot") do local fname = "/boot/" .. file if file == "." or file == ".." then goto continue end - if lfs.attributes(fname, "mode") ~= "directory" then + if ftype then + if ftype ~= lfs.DT_DIR then + goto continue + end + elseif lfs.attributes(fname, "mode") ~= "directory" then goto continue end From owner-dev-commits-src-all@freebsd.org Wed Feb 3 06:58: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 EFD3A52D2EB; Wed, 3 Feb 2021 06:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DVswB6VQRz3hQb; Wed, 3 Feb 2021 06:58: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 D188C1CAC1; Wed, 3 Feb 2021 06:58: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 1136wY3w001417; Wed, 3 Feb 2021 06:58:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1136wYu7001416; Wed, 3 Feb 2021 06:58:34 GMT (envelope-from git) Date: Wed, 3 Feb 2021 06:58:34 GMT Message-Id: <202102030658.1136wYu7001416@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: eefddc38243d - stable/12 - lualoader: position hyphens at the beginning of character classes 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: eefddc38243d53a6df41f72c17c65b17d8c46e9c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 06:58:35 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=eefddc38243d53a6df41f72c17c65b17d8c46e9c commit eefddc38243d53a6df41f72c17c65b17d8c46e9c Author: Kyle Evans AuthorDate: 2021-01-31 15:51:39 +0000 Commit: Kyle Evans CommitDate: 2021-02-03 06:58:24 +0000 lualoader: position hyphens at the beginning of character classes According to the Lua 5.4 manual section 6.4.1 ("Patterns"), the interaction between ranges and classes is not defined and hyphens must be specified at either the beginning or the end of a set if they are not escaped. Move all such occurrences to the beginning. (cherry picked from commit b24872cf7b13314669ed2136c0262bb2eb007695) --- stand/lua/config.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/lua/config.lua b/stand/lua/config.lua index 886d897b4621..6e779233373c 100644 --- a/stand/lua/config.lua +++ b/stand/lua/config.lua @@ -62,10 +62,10 @@ local MSG_FAILSYN_EOLESC = "Stray escape at end of line" local MSG_FAILSYN_EOLVAR = "Unescaped $ at end of line" local MSG_FAILSYN_BADVAR = "Malformed variable expression at position '%d'" -local MODULEEXPR = '([%w-_]+)' +local MODULEEXPR = '([-%w_]+)' local QVALEXPR = '"(.*)"' local QVALREPL = QVALEXPR:gsub('%%', '%%%%') -local WORDEXPR = "([%w%d-][%w%d-_.]*)" +local WORDEXPR = "([-%w%d][-%w%d_.]*)" local WORDREPL = WORDEXPR:gsub('%%', '%%%%') -- Entries that should never make it into the environment; each one should have @@ -182,7 +182,7 @@ local function processEnvVar(value) -- Skip the $ vinit = i + 1 vdelim = nil - vpat = "^([%w][%w%d-_.]*)" + vpat = "^([%w][-%w%d_.]*)" end local name = value:match(vpat, vinit) @@ -346,7 +346,7 @@ local function getBlacklist() return blacklist end - for mod in blacklist_str:gmatch("[;, ]?([%w-_]+)[;, ]?") do + for mod in blacklist_str:gmatch("[;, ]?([-%w_]+)[;, ]?") do blacklist[mod] = true end return blacklist From owner-dev-commits-src-all@freebsd.org Wed Feb 3 08:24: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 4560852F827; Wed, 3 Feb 2021 08:24:05 +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 4DVvpr5NhJz3mZZ; Wed, 3 Feb 2021 08:24:04 +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 1138Nmdb002718 (version=TLSv1.3 cipher=AEAD-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 Feb 2021 19:23:53 +1100 (AEDT) (envelope-from peter@rulingia.com) DKIM-Filter: OpenDKIM Filter v2.10.3 vtr.rulingia.com 1138Nmdb002718 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 1138Ngia029445 (version=TLSv1.3 cipher=AEAD-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 3 Feb 2021 19:23:42 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.16.1/8.16.1/Submit) id 1138NglL029444; Wed, 3 Feb 2021 19:23:42 +1100 (AEDT) (envelope-from peter) Date: Wed, 3 Feb 2021 19:23:42 +1100 From: Peter Jeremy To: Alex Richardson Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 83c20b8a2da0 - main - tests/sys/kern/crc32: Check for SSE4.2 before using it Message-ID: References: <202102021008.112A8RkU069892@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9d7QdlvvMF1rOrGM" Content-Disposition: inline In-Reply-To: <202102021008.112A8RkU069892@gitrepo.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp X-Rspamd-Queue-Id: 4DVvpr5NhJz3mZZ X-Spamd-Bar: ---- 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 Feb 2021 08:24:05 -0000 --9d7QdlvvMF1rOrGM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-Feb-02 10:08:27 +0000, Alex Richardson wr= ote: >The branch main has been updated by arichardson: > >URL: https://cgit.FreeBSD.org/src/commit/?id=3D83c20b8a2da04937cf4af127366= b3dc92c855784 =2E.. > Differential Revision: https://reviews.freebsd.org/D28395 >--- =2E.. >diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile >index 1806d7ce8597..f350b740b7ea 100644 >--- a/tests/sys/kern/Makefile >+++ b/tests/sys/kern/Makefile >@@ -56,15 +56,15 @@ NETBSD_ATF_TESTS_C+=3D sysv_test > CFLAGS.mqueue_test+=3D -I${SRCTOP}/tests > LIBADD.mqueue_test+=3D rt >=20 >-.if ${MACHINE_ARCH} =3D=3D "amd64" || \ >- ${MACHINE_ARCH} =3D=3D "i386" || \ >- ${MACHINE_CPUARCH} =3D=3D "aarch64" > ATF_TESTS_C+=3D libkern_crc32 >+SRCS.libkern_crc32+=3D libkern_crc32.c >+.PATH: ${SRCTOP}/sys/libkern >+SRCS.libkern_crc32+=3D gsb_crc32.c >+CFLAGS.libkern_crc32+=3D -DTESTING > .if ${MACHINE_ARCH} =3D=3D "amd64" || ${MACHINE_ARCH} =3D=3D "i386" >-LDADD.libkern_crc32+=3D ${SRCTOP}/sys/libkern/x86/crc32_sse42.c >-.else >-LDADD.libkern_crc32+=3D ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S >-.endif >+SRCS.libkern_crc32+=3D ${SRCTOP}/sys/libkern/x86/crc32_sse42.c >+.elif ${MACHINE_CPUARCH} =3D=3D "aarch64" >+SRCS.libkern_crc32+=3D ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S > .endif >=20 > # subr_unit.c contains functions whose prototypes lie in headers that can= not be This breaks buildworld with a RO /usr/src for me: =2E.. =3D=3D=3D> tests/sys/kern (all) =2E.. Building /usr/obj/usr/src/arm64.aarch64/tests/sys/kern/pdeathsig (cd /usr/src/tests/sys/kern && DEPENDFILE=3D.depend.libkern_crc32 NO_SUBD= IR=3D1 make -f /usr/src/tests/sys/kern/Makefile _RECURSING_PROGS=3Dt PROG= =3Dlibkern_crc32 ) Building /usr/src/sys/libkern/arm64/crc32c_armv8.o clang -cc1as: error: unable to open output file '/usr/src/sys/libkern/arm64= /crc32c_armv8.o': 'Read-only file system' *** Error code 1 I do have an (empty) /usr/obj/usr/src/arm64.aarch64/tests/sys/kern/usr/src/sys/libkern/arm64 --=20 Peter Jeremy --9d7QdlvvMF1rOrGM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAmAaXYZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzQfXw//bIZtk9dOl7Mq4sUZ6qbcnkAowDfLQyr8qU4M6Y3lbivV+ZE3uJNLJt7s O7SWXPstmJeu5QN9OCnsWtMg2x/iJvMEmjCRNlxcgeQgkBcorx2oIpoNFlmM5jPP 3v7ymUMxK1/pDa5rMFA3zYOXm0UAqVawHi7qTmnM/ndGu+NOKij1xmHZvFpiTrgD tYLiJoS+/WR0Ql/7PF/3MOtJdqxcQut/uw4ftWxnbimnMGnPnl0sd0EZMpNj/Y40 4nhCVUVBDAPa4nQukytH0wGDjuw9svV5htxOSgdO5ZyuG10XnzxIn1iKzBByVS4d o5xJFt9ksPpdipsLM3lEQBXT+xcEA9r5tRLq8A1sC9B1QR6gi1SiNaa/UjWHDCp/ E/B9ulDneeWFnsdb8IEA/E7+yiI57K9K5CqpczgG9stOEJVbjhwE+sljWYI+MguM bRyjv299uiR6kA7vyAB6YsJucX52q26H9+2YjRDj+BkBSxSPqyRDnqQ18O9h/8+v MXe5vcM4Rkf2WK5nOvcpsYJ9Dxv7sT5Hz0LLpb3osqXu/I3jzVXTIEjvx3UN0bQl V+dpvQvbazbprm9IH4u4wn20yHyfHb4fpfyS7EIEHqVs3KveYxpeCgLuEt4z31hY y/maCXB1Ec8R40K3K+6fM9j/DqLHbaWK8jAyZmxQJe2nbVldYeI= =CNUM -----END PGP SIGNATURE----- --9d7QdlvvMF1rOrGM-- From owner-dev-commits-src-all@freebsd.org Wed Feb 3 08:51: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 B9F1D530418; Wed, 3 Feb 2021 08:51: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 4DVwQD4Sjgz3nw3; Wed, 3 Feb 2021 08:51: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 8C0741E1A0; Wed, 3 Feb 2021 08:51: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 1138pGQ0055805; Wed, 3 Feb 2021 08:51:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1138pGCS055804; Wed, 3 Feb 2021 08:51:16 GMT (envelope-from git) Date: Wed, 3 Feb 2021 08:51:16 GMT Message-Id: <202102030851.1138pGCS055804@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: eb0b1b33d5af - main - Enable multipath routing by default. 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: eb0b1b33d5af4e81ee77732dffc77634e57a5879 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 08:51:16 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=eb0b1b33d5af4e81ee77732dffc77634e57a5879 commit eb0b1b33d5af4e81ee77732dffc77634e57a5879 Author: Alexander V. Chernikov AuthorDate: 2021-02-03 08:49:46 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-03 08:49:58 +0000 Enable multipath routing by default. ROUTE_MPATH was added to the GENERIC kernel in r368648. According to the plan in D27428, it was enabled with `net.route.multipath` sysctl set to 0. Given enough time has passed, this change enables route multipath by default. The goal is to ship FreeBSD 13 with multipath turned on. Reviewed By: donner, olivier MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28423 --- sys/net/route/route_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index c46d0430a164..6b0869196d12 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -101,7 +101,7 @@ SYSCTL_DECL(_net_route); #else #define _MP_FLAGS CTLFLAG_RD #endif -VNET_DEFINE(u_int, rib_route_multipath) = 0; +VNET_DEFINE(u_int, rib_route_multipath) = 1; SYSCTL_UINT(_net_route, OID_AUTO, multipath, _MP_FLAGS | CTLFLAG_VNET, &VNET_NAME(rib_route_multipath), 0, "Enable route multipath"); #undef _MP_FLAGS From owner-dev-commits-src-all@freebsd.org Wed Feb 3 09:25: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 ADFA553146A; Wed, 3 Feb 2021 09:25:05 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 4DVx9F09xrz3rTh; Wed, 3 Feb 2021 09:25:04 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f49.google.com with SMTP id f14so10255964ejc.8; Wed, 03 Feb 2021 01:25: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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FsYh2nSYLSPLoFU54SITZmykM6OZ9mnKgp7tnX86VIk=; b=k+MUtQTMZ/VxwyQTr0WPSlrGeE1I/9YE+/epu2kSlb9pfo6I73og+29mCGvNL3DKaY sXSWsWsnxlNtiBsSIhG8IGNGvDkMyfI5/T+wop99Tj220Gqiy72GCKQZdyBSh+WpxfVC oCvQ9Q8aLrg/I1VCpTSkbPz4ZuGreMhXpKYoLyhM6ym8x+PcM8gymSeIgvpD5omrSBW1 luF3o9AzrR8gqPj9rTrek4Jjo5OX1zAqjS5w3FsZSqWyb7fbvmBkkcZrbiD7l5KBl1C2 hnYrukrSrm4l4P45GDx69i6PqlCtEMgFHJVdFmRc1ojCZavry8fOlvmUjTMfnV320Uez Vr9w== X-Gm-Message-State: AOAM530xE1KwebRvX/Jm/p9qkuV77SXOqo8+g3kVKvN9OYfpve23U9mS 7Hy5JU6O/0UG75dGlCfgLFeUH52c4AJZGw== X-Google-Smtp-Source: ABdhPJxWke3gL6vj41fyOgR/0GSx9HSmy/Z2Gn2JqizSpt8pEOw0Vc7p0A+d4ypxWDtXY3WCSVOrIQ== X-Received: by 2002:a17:906:a48:: with SMTP id x8mr2257407ejf.444.1612344303581; Wed, 03 Feb 2021 01:25:03 -0800 (PST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com. [209.85.221.49]) by smtp.gmail.com with ESMTPSA id ov9sm726209ejb.53.2021.02.03.01.25.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Feb 2021 01:25:03 -0800 (PST) Received: by mail-wr1-f49.google.com with SMTP id d16so23284645wro.11; Wed, 03 Feb 2021 01:25:03 -0800 (PST) X-Received: by 2002:a5d:4443:: with SMTP id x3mr2470061wrr.409.1612344303049; Wed, 03 Feb 2021 01:25:03 -0800 (PST) MIME-Version: 1.0 References: <202102021008.112A8RkU069892@gitrepo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Wed, 3 Feb 2021 09:24:52 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 83c20b8a2da0 - main - tests/sys/kern/crc32: Check for SSE4.2 before using it To: Peter Jeremy Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DVx9F09xrz3rTh 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.218.49 as permitted sender) smtp.mailfrom=arichardsonkde@gmail.com X-Spamd-Result: default: False [-3.00 / 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]; RWL_MAILSPIKE_GOOD(0.00)[209.85.218.49:from]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[arichardson@freebsd.org,arichardsonkde@gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; 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)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.218.49:from]; TAGGED_FROM(0.00)[]; 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)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.218.49:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.218.49:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] 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 Feb 2021 09:25:05 -0000 On Wed, 3 Feb 2021, 08:24 Peter Jeremy, wrote: > On 2021-Feb-02 10:08:27 +0000, Alex Richardson > wrote: > >The branch main has been updated by arichardson: > > > >URL: > https://cgit.FreeBSD.org/src/commit/?id=83c20b8a2da04937cf4af127366b3dc92c855784 > ... > > Differential Revision: https://reviews.freebsd.org/D28395 > >--- > ... > >diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile > >index 1806d7ce8597..f350b740b7ea 100644 > >--- a/tests/sys/kern/Makefile > >+++ b/tests/sys/kern/Makefile > >@@ -56,15 +56,15 @@ NETBSD_ATF_TESTS_C+= sysv_test > > CFLAGS.mqueue_test+= -I${SRCTOP}/tests > > LIBADD.mqueue_test+= rt > > > >-.if ${MACHINE_ARCH} == "amd64" || \ > >- ${MACHINE_ARCH} == "i386" || \ > >- ${MACHINE_CPUARCH} == "aarch64" > > ATF_TESTS_C+= libkern_crc32 > >+SRCS.libkern_crc32+= libkern_crc32.c > >+.PATH: ${SRCTOP}/sys/libkern > >+SRCS.libkern_crc32+= gsb_crc32.c > >+CFLAGS.libkern_crc32+= -DTESTING > > .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" > >-LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c > >-.else > >-LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S > >-.endif > >+SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c > >+.elif ${MACHINE_CPUARCH} == "aarch64" > >+SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S > > .endif > > > > # subr_unit.c contains functions whose prototypes lie in headers that > cannot be > > This breaks buildworld with a RO /usr/src for me: > ... > ===> tests/sys/kern (all) > ... > Building /usr/obj/usr/src/arm64.aarch64/tests/sys/kern/pdeathsig > (cd /usr/src/tests/sys/kern && DEPENDFILE=.depend.libkern_crc32 > NO_SUBDIR=1 make -f /usr/src/tests/sys/kern/Makefile _RECURSING_PROGS=t > PROG=libkern_crc32 ) > Building /usr/src/sys/libkern/arm64/crc32c_armv8.o > clang -cc1as: error: unable to open output file > '/usr/src/sys/libkern/arm64/crc32c_armv8.o': 'Read-only file system' > *** Error code 1 > > I do have an (empty) > /usr/obj/usr/src/arm64.aarch64/tests/sys/kern/usr/src/sys/libkern/arm64 > Hi, I have a fix that I'm currently testing and will commit shortly. It seems the problem is that I changed it from (ab)using LDADD to using SRCS which defaults to creating the .o file in the same directory as the source. Alex From owner-dev-commits-src-all@freebsd.org Wed Feb 3 09:38: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 4560B53190E; Wed, 3 Feb 2021 09:38: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 4DVxSt1SbPz3sGw; Wed, 3 Feb 2021 09:38: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 24FDD1ECA8; Wed, 3 Feb 2021 09:38: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 1139ccBN009815; Wed, 3 Feb 2021 09:38:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1139ccPq009814; Wed, 3 Feb 2021 09:38:38 GMT (envelope-from git) Date: Wed, 3 Feb 2021 09:38:38 GMT Message-Id: <202102030938.1139ccPq009814@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: 8b820df156e0 - main - Fix build with read-only source dir after 83c20b8a2da0 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: 8b820df156e065f48857dca89a89462074659e14 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 09:38:38 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=8b820df156e065f48857dca89a89462074659e14 commit 8b820df156e065f48857dca89a89462074659e14 Author: Alex Richardson AuthorDate: 2021-02-03 09:29:08 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 09:30:53 +0000 Fix build with read-only source dir after 83c20b8a2da0 I changed the Makefile to use SRCS instead of LDADD, but since there is still and absolute path to the source the .o file was created inside the source directory instead of the build directory. It would be nice if this was an error/warning by default, but for now just fix this issue by using .PATH and the base name of the file. Reported by: cy, peterj --- tests/sys/kern/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index f350b740b7ea..6746812d9b4a 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -62,9 +62,11 @@ SRCS.libkern_crc32+= libkern_crc32.c SRCS.libkern_crc32+= gsb_crc32.c CFLAGS.libkern_crc32+= -DTESTING .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" -SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c +.PATH: ${SRCTOP}/sys/libkern/x86 +SRCS.libkern_crc32+= crc32_sse42.c .elif ${MACHINE_CPUARCH} == "aarch64" -SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S +.PATH: ${SRCTOP}/sys/libkern/arm64 +SRCS.libkern_crc32+= crc32c_armv8.S .endif # subr_unit.c contains functions whose prototypes lie in headers that cannot be From owner-dev-commits-src-all@freebsd.org Wed Feb 3 09:38: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 5A2E05318ED; Wed, 3 Feb 2021 09:38: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 4DVxSv28Vhz3sST; Wed, 3 Feb 2021 09:38: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 3BF9A1EBA9; Wed, 3 Feb 2021 09:38: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 1139cdNT009838; Wed, 3 Feb 2021 09:38:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1139cdrG009837; Wed, 3 Feb 2021 09:38:39 GMT (envelope-from git) Date: Wed, 3 Feb 2021 09:38:39 GMT Message-Id: <202102030938.1139cdrG009837@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: d6f4e1a8973d - main - sbin/bectl: Skip tests if sparse files are not supported 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: d6f4e1a8973daff2ffe4480b66c973562982ffc7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 09:38:39 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=d6f4e1a8973daff2ffe4480b66c973562982ffc7 commit d6f4e1a8973daff2ffe4480b66c973562982ffc7 Author: Alex Richardson AuthorDate: 2021-02-03 09:31:32 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 09:31:32 +0000 sbin/bectl: Skip tests if sparse files are not supported The tests create a 1GB test file and this causes the tests to fail in the CheriBSD CI setup where we run tests with a tmpfs mount on /tmp. Tmpfs does not support sparse files and it appears that tmpfs default to creating a 1GB mount, so there is not enough space to run these tests. Instead of checking for at least 1GB of free space, this commit skips the tests on file systems that do not support sparse files. Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D28463 --- sbin/bectl/tests/bectl_test.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 36c92235b6d8..221fe21e29ed 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -49,6 +49,13 @@ bectl_create_setup() atf_check test -n "$zpool" kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" + if ! getconf MIN_HOLE_SIZE "$(pwd)"; then + echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files " \ + "probably not supported by file system" + mount + atf_skip "Test's work directory does not support sparse files;" \ + "try with a different TMPDIR?" + fi atf_check mkdir -p ${mnt} atf_check truncate -s 1G ${disk} atf_check zpool create -R ${mnt} ${zpool} ${disk} From owner-dev-commits-src-all@freebsd.org Wed Feb 3 09:38: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 7EC6B531742; Wed, 3 Feb 2021 09:38: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 4DVxSw4m2Cz3sY6; Wed, 3 Feb 2021 09:38: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 7A1C81E4ED; Wed, 3 Feb 2021 09:38: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 1139ceVD009858; Wed, 3 Feb 2021 09:38:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1139ceOk009857; Wed, 3 Feb 2021 09:38:40 GMT (envelope-from git) Date: Wed, 3 Feb 2021 09:38:40 GMT Message-Id: <202102030938.1139ceOk009857@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: 9b131f1e51a0 - main - atf: Fix ATF_BUILD_* values when not using the bootstrap compiler 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: 9b131f1e51a00c8bbbda32672fb5db88010400f6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 09:38:41 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=9b131f1e51a00c8bbbda32672fb5db88010400f6 commit 9b131f1e51a00c8bbbda32672fb5db88010400f6 Author: Alex Richardson AuthorDate: 2021-02-03 09:32:16 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 09:32:16 +0000 atf: Fix ATF_BUILD_* values when not using the bootstrap compiler Currently, we encode the full path and compile flags for the build compiler in libatf. However, these values are not correct when cross-compiling: For example, when I build on macOS, CC is set to the host path /usr/local/Cellar/llvm/11.0.0_1/bin/clang-11. This path will not exist on the target system. Simplify this logic and use cc/cpp/c++ since those binaries will exist on the target system unless the compiler was explicitly disabled. I'm not convinced ATF needs to encode these values, but this is a minimal fix for these tests when using a non-bootstrapped compiler. Reviewed By: ngie, brooks Differential Revision: https://reviews.freebsd.org/D28414 --- lib/atf/libatf-c/Makefile | 23 +---------------------- lib/atf/libatf-c/Makefile.inc | 7 +++++++ lib/atf/libatf-c/tests/Makefile | 1 + 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/lib/atf/libatf-c/Makefile b/lib/atf/libatf-c/Makefile index 78b821b3c64d..7c9807c24ded 100644 --- a/lib/atf/libatf-c/Makefile +++ b/lib/atf/libatf-c/Makefile @@ -28,22 +28,6 @@ .include .include -# Store the toolchain executable in ATF_BUILD_{CC,CPP,CXX} to ensure other -# values -- like -target, -B ..., etc -- don't get leaked into the tests. -# -# Be sure to omit ${CCACHE_BIN} (if specified) from the variable as it gets -# automatically appended to the variables in bsd.compiler.mk when -# ${MK_CCACHE_BUILD} != no. -ATF_BUILD_CC:= ${CC:N${CCACHE_BIN}:[1]} -ATF_BUILD_CPP:= ${CPP:N${CCACHE_BIN}:[1]} -ATF_BUILD_CXX:= ${CXX:N${CCACHE_BIN}:[1]} - -# Only capture defines, includes, linker flags, optimization levels, warnings -# and preprocessor flags when building ATF_BUILD_{C,CPP,CXX}FLAGS. -ATF_BUILD_CFLAGS:= ${CFLAGS:M-[DILOWf]*} -ATF_BUILD_CPPFLAGS:= ${CPPFLAGS:M-[DILOWf]*} -ATF_BUILD_CXXFLAGS:= ${CXXFLAGS:M-[DILOWf]*} - PACKAGE= tests LIB= atf-c PRIVATELIB= true @@ -54,12 +38,6 @@ ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/atf-c .PATH: ${ATF}/atf-c/detail -CFLAGS+= -DATF_BUILD_CC='"${ATF_BUILD_CC}"' -CFLAGS+= -DATF_BUILD_CFLAGS='"${ATF_BUILD_CFLAGS}"' -CFLAGS+= -DATF_BUILD_CPP='"${ATF_BUILD_CPP}"' -CFLAGS+= -DATF_BUILD_CPPFLAGS='"${ATF_BUILD_CPPFLAGS}"' -CFLAGS+= -DATF_BUILD_CXX='"${ATF_BUILD_CXX}"' -CFLAGS+= -DATF_BUILD_CXXFLAGS='"${ATF_BUILD_CXXFLAGS}"' CFLAGS+= -I${ATF} CFLAGS+= -I${.CURDIR} CFLAGS+= -I. @@ -160,5 +138,6 @@ MLINKS+= atf-c.3 atf-c-api.3 # Backwards compatibility. HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +.include "Makefile.inc" .include "../common.mk" .include diff --git a/lib/atf/libatf-c/Makefile.inc b/lib/atf/libatf-c/Makefile.inc index 265f86d1ed55..f668e36b2d6a 100644 --- a/lib/atf/libatf-c/Makefile.inc +++ b/lib/atf/libatf-c/Makefile.inc @@ -1,3 +1,10 @@ # $FreeBSD$ .include "../Makefile.inc" + +CFLAGS+= -DATF_BUILD_CC='"cc"' +CFLAGS+= -DATF_BUILD_CFLAGS='"-Wall"' +CFLAGS+= -DATF_BUILD_CPP='"cpp"' +CFLAGS+= -DATF_BUILD_CPPFLAGS='""' +CFLAGS+= -DATF_BUILD_CXX='"c++"' +CFLAGS+= -DATF_BUILD_CXXFLAGS='"-Wall"' diff --git a/lib/atf/libatf-c/tests/Makefile b/lib/atf/libatf-c/tests/Makefile index c99b2d115967..3bcdfc8f7071 100644 --- a/lib/atf/libatf-c/tests/Makefile +++ b/lib/atf/libatf-c/tests/Makefile @@ -35,4 +35,5 @@ SRCS.${_T}= ${_T}.c test_helpers.c TEST_METADATA.${_T}+= required_programs="cc" .endfor +.include "Makefile.inc" .include From owner-dev-commits-src-all@freebsd.org Wed Feb 3 10:41: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 CBC24532E12; Wed, 3 Feb 2021 10:41: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 4DVyrx5Pk6z3wCN; Wed, 3 Feb 2021 10:41: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 AC4141FA92; Wed, 3 Feb 2021 10:41: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 113Af5CZ096104; Wed, 3 Feb 2021 10:41:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113Af5X6096103; Wed, 3 Feb 2021 10:41:05 GMT (envelope-from git) Date: Wed, 3 Feb 2021 10:41:05 GMT Message-Id: <202102031041.113Af5X6096103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan Eßer Subject: git: 601ac8219469 - stable/13 - bc: Vendor import of Gavin Howard's bc version 3.2.6 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 601ac82194693fcae9d7d2a7ec7d66ebaf3fd61e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 10:41:05 -0000 The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=601ac82194693fcae9d7d2a7ec7d66ebaf3fd61e commit 601ac82194693fcae9d7d2a7ec7d66ebaf3fd61e Author: Stefan Eßer AuthorDate: 2021-01-31 19:56:48 +0000 Commit: Stefan Eßer CommitDate: 2021-02-03 10:37:34 +0000 bc: Vendor import of Gavin Howard's bc version 3.2.6 (cherry picked from commit 47a52dc4d48f259ab7d9f9ba6b65f4f2331a22dc) --- .gitignore | 27 -- README.md | 82 ----- contrib/bc/.gitignore | 9 + contrib/bc/LICENSE.md | 52 ++- contrib/bc/Makefile.in | 122 ++++-- contrib/bc/NEWS.md | 35 ++ contrib/bc/NOTICE.md | 2 +- contrib/bc/README.md | 1 + contrib/bc/configure.sh | 348 +++++++++++++++--- contrib/bc/exec-install.sh | 2 +- contrib/bc/functions.sh | 90 +++-- contrib/bc/gen/bc_help.txt | 2 +- contrib/bc/gen/dc_help.txt | 2 +- contrib/bc/gen/lib.bc | 2 +- contrib/bc/gen/lib2.bc | 2 +- contrib/bc/gen/strgen.c | 4 +- contrib/bc/gen/strgen.sh | 4 +- contrib/bc/include/args.h | 2 +- contrib/bc/include/bc.h | 2 +- contrib/bc/include/bcl.h | 2 +- contrib/bc/include/dc.h | 2 +- contrib/bc/include/file.h | 2 +- contrib/bc/include/history.h | 2 +- contrib/bc/include/lang.h | 2 +- contrib/bc/include/lex.h | 2 +- contrib/bc/include/library.h | 2 +- contrib/bc/include/num.h | 4 +- contrib/bc/include/opt.h | 2 +- contrib/bc/include/parse.h | 2 +- contrib/bc/include/program.h | 2 +- contrib/bc/include/rand.h | 31 +- contrib/bc/include/read.h | 2 +- contrib/bc/include/status.h | 14 +- contrib/bc/include/vector.h | 3 +- contrib/bc/include/vm.h | 19 +- contrib/bc/karatsuba.py | 2 +- contrib/bc/link.sh | 2 +- contrib/bc/locale_install.sh | 2 +- contrib/bc/locale_uninstall.sh | 2 +- contrib/bc/locales/de_DE.ISO8859-1.msg | 2 +- contrib/bc/locales/de_DE.UTF-8.msg | 2 +- contrib/bc/locales/en_US.msg | 2 +- contrib/bc/locales/es_ES.ISO8859-1.msg | 2 +- contrib/bc/locales/es_ES.UTF-8.msg | 2 +- contrib/bc/locales/fr_FR.ISO8859-1.msg | 2 +- contrib/bc/locales/fr_FR.UTF-8.msg | 2 +- contrib/bc/locales/ja_JP.UTF-8.msg | 2 +- contrib/bc/locales/ja_JP.eucJP.msg | 2 +- contrib/bc/locales/nl_NL.ISO8859-1.msg | 2 +- contrib/bc/locales/nl_NL.UTF-8.msg | 2 +- contrib/bc/locales/pl_PL.ISO8859-2.msg | 2 +- contrib/bc/locales/pl_PL.UTF-8.msg | 2 +- contrib/bc/locales/pt_PT.ISO8859-1.msg | 2 +- contrib/bc/locales/pt_PT.UTF-8.msg | 2 +- contrib/bc/locales/ru_RU.CP1251.msg | 2 +- contrib/bc/locales/ru_RU.CP866.msg | 2 +- contrib/bc/locales/ru_RU.ISO8859-5.msg | 2 +- contrib/bc/locales/ru_RU.KOI8-R.msg | 2 +- contrib/bc/locales/ru_RU.UTF-8.msg | 2 +- contrib/bc/locales/zh_CN.GB18030.msg | 2 +- contrib/bc/locales/zh_CN.GB2312.msg | 2 +- contrib/bc/locales/zh_CN.GBK.msg | 2 +- contrib/bc/locales/zh_CN.UTF-8.msg | 2 +- contrib/bc/locales/zh_CN.eucCN.msg | 2 +- contrib/bc/manpage.sh | 2 +- contrib/bc/manuals/bc.1.md.in | 7 +- contrib/bc/manuals/bc/A.1 | 8 +- contrib/bc/manuals/bc/A.1.md | 7 +- contrib/bc/manuals/bc/E.1 | 4 +- contrib/bc/manuals/bc/E.1.md | 2 +- contrib/bc/manuals/bc/EH.1 | 4 +- contrib/bc/manuals/bc/EH.1.md | 2 +- contrib/bc/manuals/bc/EHN.1 | 4 +- contrib/bc/manuals/bc/EHN.1.md | 2 +- contrib/bc/manuals/bc/EHNP.1 | 4 +- contrib/bc/manuals/bc/EHNP.1.md | 2 +- contrib/bc/manuals/bc/EHP.1 | 4 +- contrib/bc/manuals/bc/EHP.1.md | 2 +- contrib/bc/manuals/bc/EN.1 | 4 +- contrib/bc/manuals/bc/EN.1.md | 2 +- contrib/bc/manuals/bc/ENP.1 | 4 +- contrib/bc/manuals/bc/ENP.1.md | 2 +- contrib/bc/manuals/bc/EP.1 | 4 +- contrib/bc/manuals/bc/EP.1.md | 2 +- contrib/bc/manuals/bc/H.1 | 8 +- contrib/bc/manuals/bc/H.1.md | 7 +- contrib/bc/manuals/bc/HN.1 | 8 +- contrib/bc/manuals/bc/HN.1.md | 7 +- contrib/bc/manuals/bc/HNP.1 | 8 +- contrib/bc/manuals/bc/HNP.1.md | 7 +- contrib/bc/manuals/bc/HP.1 | 8 +- contrib/bc/manuals/bc/HP.1.md | 7 +- contrib/bc/manuals/bc/N.1 | 8 +- contrib/bc/manuals/bc/N.1.md | 7 +- contrib/bc/manuals/bc/NP.1 | 8 +- contrib/bc/manuals/bc/NP.1.md | 7 +- contrib/bc/manuals/bc/P.1 | 8 +- contrib/bc/manuals/bc/P.1.md | 7 +- contrib/bc/manuals/bcl.3 | 4 +- contrib/bc/manuals/bcl.3.md | 2 +- contrib/bc/manuals/dc.1.md.in | 7 +- contrib/bc/manuals/dc/A.1 | 10 +- contrib/bc/manuals/dc/A.1.md | 7 +- contrib/bc/manuals/dc/E.1 | 4 +- contrib/bc/manuals/dc/E.1.md | 2 +- contrib/bc/manuals/dc/EH.1 | 4 +- contrib/bc/manuals/dc/EH.1.md | 2 +- contrib/bc/manuals/dc/EHN.1 | 4 +- contrib/bc/manuals/dc/EHN.1.md | 2 +- contrib/bc/manuals/dc/EHNP.1 | 4 +- contrib/bc/manuals/dc/EHNP.1.md | 2 +- contrib/bc/manuals/dc/EHP.1 | 4 +- contrib/bc/manuals/dc/EHP.1.md | 2 +- contrib/bc/manuals/dc/EN.1 | 4 +- contrib/bc/manuals/dc/EN.1.md | 2 +- contrib/bc/manuals/dc/ENP.1 | 4 +- contrib/bc/manuals/dc/ENP.1.md | 2 +- contrib/bc/manuals/dc/EP.1 | 4 +- contrib/bc/manuals/dc/EP.1.md | 2 +- contrib/bc/manuals/dc/H.1 | 10 +- contrib/bc/manuals/dc/H.1.md | 7 +- contrib/bc/manuals/dc/HN.1 | 10 +- contrib/bc/manuals/dc/HN.1.md | 7 +- contrib/bc/manuals/dc/HNP.1 | 10 +- contrib/bc/manuals/dc/HNP.1.md | 7 +- contrib/bc/manuals/dc/HP.1 | 10 +- contrib/bc/manuals/dc/HP.1.md | 7 +- contrib/bc/manuals/dc/N.1 | 10 +- contrib/bc/manuals/dc/N.1.md | 7 +- contrib/bc/manuals/dc/NP.1 | 10 +- contrib/bc/manuals/dc/NP.1.md | 7 +- contrib/bc/manuals/dc/P.1 | 10 +- contrib/bc/manuals/dc/P.1.md | 7 +- contrib/bc/manuals/header.txt | 2 +- contrib/bc/manuals/header_bc.txt | 2 +- contrib/bc/manuals/header_bcl.txt | 2 +- contrib/bc/manuals/header_dc.txt | 2 +- contrib/bc/release.sh | 18 +- contrib/bc/src/args.c | 2 +- contrib/bc/src/bc.c | 2 +- contrib/bc/src/bc_lex.c | 2 +- contrib/bc/src/bc_parse.c | 2 +- contrib/bc/src/data.c | 4 +- contrib/bc/src/dc.c | 2 +- contrib/bc/src/dc_lex.c | 6 +- contrib/bc/src/dc_parse.c | 2 +- contrib/bc/src/file.c | 4 +- contrib/bc/src/history.c | 15 +- contrib/bc/src/lang.c | 14 +- contrib/bc/src/lex.c | 4 +- contrib/bc/src/library.c | 12 +- contrib/bc/src/main.c | 13 +- contrib/bc/src/num.c | 10 +- contrib/bc/src/opt.c | 2 +- contrib/bc/src/parse.c | 8 +- contrib/bc/src/program.c | 31 +- contrib/bc/src/rand.c | 42 +-- contrib/bc/src/read.c | 6 +- contrib/bc/src/vector.c | 8 +- contrib/bc/src/vm.c | 86 ++++- contrib/bc/tests/afl.py | 22 +- contrib/bc/tests/all.sh | 191 +--------- contrib/bc/tests/bc/all.txt | 6 +- contrib/bc/tests/bc/scripts/all.txt | 15 + contrib/bc/tests/bc/timeconst.sh | 9 +- contrib/bc/tests/bcl.c | 2 +- contrib/bc/tests/dc/errors/30.txt | 1 + contrib/bc/tests/dc/errors/31.txt | 1 + contrib/bc/tests/dc/scripts/all.txt | 9 + contrib/bc/tests/diff.sh | 51 +++ contrib/bc/tests/errors.sh | 20 +- contrib/bc/tests/extra_required.txt | 7 + contrib/bc/tests/fuzzing/bc.dict | 68 ++++ contrib/bc/tests/fuzzing/bc_inputs1/abs.txt | 7 + contrib/bc/tests/fuzzing/bc_inputs1/add.txt | 146 ++++++++ contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt | 26 ++ contrib/bc/tests/fuzzing/bc_inputs1/array.bc | 60 +++ contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt | 10 + .../bc/tests/fuzzing/bc_inputs1/assignments.txt | 122 ++++++ contrib/bc/tests/fuzzing/bc_inputs1/basic.txt | 7 + contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt | 184 ++++++++++ contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt | 44 +++ contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt | 35 ++ contrib/bc/tests/fuzzing/bc_inputs1/divide.txt | 31 ++ .../bc/tests/fuzzing/bc_inputs1/engineering.txt | 19 + contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt | 22 ++ contrib/bc/tests/fuzzing/bc_inputs1/functions.bc | 7 + contrib/bc/tests/fuzzing/bc_inputs1/functions.txt | 13 + contrib/bc/tests/fuzzing/bc_inputs1/globals.txt | 21 ++ contrib/bc/tests/fuzzing/bc_inputs1/len.bc | 48 +++ contrib/bc/tests/fuzzing/bc_inputs1/length.txt | 59 +++ contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt | 15 + contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt | 6 + contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt | 10 + contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt | 5 + contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt | 12 + contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib23.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib24.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/log.txt | 22 ++ contrib/bc/tests/fuzzing/bc_inputs2/misc.txt | 13 + contrib/bc/tests/fuzzing/bc_inputs2/misc1.txt | 76 ++++ contrib/bc/tests/fuzzing/bc_inputs2/misc2.txt | 110 ++++++ contrib/bc/tests/fuzzing/bc_inputs2/misc3.txt | 12 + contrib/bc/tests/fuzzing/bc_inputs2/modulus.txt | 69 ++++ contrib/bc/tests/fuzzing/bc_inputs2/multiply.txt | 40 ++ contrib/bc/tests/fuzzing/bc_inputs2/pi.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs2/places.txt | 19 + contrib/bc/tests/fuzzing/bc_inputs2/power.txt | 44 +++ contrib/bc/tests/fuzzing/bc_inputs2/print2.txt | 194 ++++++++++ contrib/bc/tests/fuzzing/bc_inputs2/references.bc | 408 +++++++++++++++++++++ contrib/bc/tests/fuzzing/bc_inputs2/scale.txt | 57 +++ contrib/bc/tests/fuzzing/bc_inputs2/scientific.txt | 51 +++ contrib/bc/tests/fuzzing/bc_inputs2/shift.txt | 281 ++++++++++++++ contrib/bc/tests/fuzzing/bc_inputs2/sine.txt | 207 +++++++++++ contrib/bc/tests/fuzzing/bc_inputs3/01.txt | 339 +++++++++++++++++ contrib/bc/tests/fuzzing/bc_inputs3/02.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/03.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs3/04.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/05.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/06.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/07.txt | 8 + contrib/bc/tests/fuzzing/bc_inputs3/08.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs3/09.txt | 11 + contrib/bc/tests/fuzzing/bc_inputs3/10.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/11.txt | 99 +++++ contrib/bc/tests/fuzzing/bc_inputs3/12.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs3/13.txt | 56 +++ contrib/bc/tests/fuzzing/bc_inputs3/14.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/15.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs3/16.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/17.txt | 11 + contrib/bc/tests/fuzzing/bc_inputs3/18.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs3/19.txt | 5 + contrib/bc/tests/fuzzing/bc_inputs3/20.txt | 51 +++ contrib/bc/tests/fuzzing/bc_inputs3/21.txt | 10 + contrib/bc/tests/fuzzing/bc_inputs3/22.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs3/23.txt | Bin 0 -> 1024 bytes contrib/bc/tests/fuzzing/bc_inputs3/24.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs3/sqrt.txt | 14 + contrib/bc/tests/fuzzing/bc_inputs3/strings.txt | 12 + contrib/bc/tests/fuzzing/bc_inputs3/subtract.txt | 153 ++++++++ contrib/bc/tests/fuzzing/bc_inputs3/trunc.txt | 15 + contrib/bc/tests/fuzzing/bc_inputs3/void.txt | 20 + contrib/bc/tests/fuzzing/dc_inputs/01.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/02.txt | 5 + contrib/bc/tests/fuzzing/dc_inputs/03.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/04.txt | 9 + contrib/bc/tests/fuzzing/dc_inputs/05.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/06.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/07.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/08.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/09.txt | 9 + contrib/bc/tests/fuzzing/dc_inputs/10.txt | 11 + contrib/bc/tests/fuzzing/dc_inputs/11.txt | 4 + contrib/bc/tests/fuzzing/dc_inputs/12.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/13.txt | 7 + contrib/bc/tests/fuzzing/dc_inputs/14.txt | 7 + contrib/bc/tests/fuzzing/dc_inputs/15.txt | 11 + contrib/bc/tests/fuzzing/dc_inputs/16.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/17.txt | 20 + contrib/bc/tests/fuzzing/dc_inputs/18.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/19.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/20.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/21.txt | 5 + contrib/bc/tests/fuzzing/dc_inputs/22.txt | 36 ++ contrib/bc/tests/fuzzing/dc_inputs/23.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/24.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/25.txt | 6 + contrib/bc/tests/fuzzing/dc_inputs/26.txt | 155 ++++++++ contrib/bc/tests/fuzzing/dc_inputs/27.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/28.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/29.txt | 13 + contrib/bc/tests/fuzzing/dc_inputs/30.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/31.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/abs.txt | 7 + contrib/bc/tests/fuzzing/dc_inputs/add.txt | 33 ++ contrib/bc/tests/fuzzing/dc_inputs/array.dc | 2 + contrib/bc/tests/fuzzing/dc_inputs/boolean.txt | 80 ++++ contrib/bc/tests/fuzzing/dc_inputs/decimal.txt | 36 ++ contrib/bc/tests/fuzzing/dc_inputs/divide.txt | 33 ++ contrib/bc/tests/fuzzing/dc_inputs/divmod.txt | 64 ++++ contrib/bc/tests/fuzzing/dc_inputs/else.dc | 4 + contrib/bc/tests/fuzzing/dc_inputs/engineering.txt | 19 + contrib/bc/tests/fuzzing/dc_inputs/loop.dc | 3 + contrib/bc/tests/fuzzing/dc_inputs/misc.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/modexp.txt | 103 ++++++ contrib/bc/tests/fuzzing/dc_inputs/modulus.txt | 70 ++++ contrib/bc/tests/fuzzing/dc_inputs/multiply.txt | 42 +++ contrib/bc/tests/fuzzing/dc_inputs/places.txt | 14 + contrib/bc/tests/fuzzing/dc_inputs/power.txt | 36 ++ contrib/bc/tests/fuzzing/dc_inputs/quit.dc | 2 + contrib/bc/tests/fuzzing/dc_inputs/scientific.txt | 51 +++ contrib/bc/tests/fuzzing/dc_inputs/shift.txt | 42 +++ contrib/bc/tests/fuzzing/dc_inputs/sqrt.txt | 14 + contrib/bc/tests/fuzzing/dc_inputs/stdin.txt | 205 +++++++++++ contrib/bc/tests/fuzzing/dc_inputs/stream.dc | 2 + contrib/bc/tests/fuzzing/dc_inputs/strings.txt | 50 +++ contrib/bc/tests/fuzzing/dc_inputs/subtract.txt | 33 ++ contrib/bc/tests/fuzzing/dc_inputs/trunc.txt | 11 + contrib/bc/tests/fuzzing/dc_inputs/vars.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/weird.dc | 2 + contrib/bc/tests/other.sh | 271 ++++++++++++++ contrib/bc/tests/radamsa.sh | 2 +- contrib/bc/tests/randmath.py | 2 +- contrib/bc/tests/read.sh | 23 +- contrib/bc/tests/script.sh | 26 +- contrib/bc/tests/scripts.sh | 9 +- contrib/bc/tests/stdin.sh | 23 +- contrib/bc/tests/test.sh | 32 +- tests/dc/errors/30.txt | 1 + tests/dc/errors/31.txt | 1 + tests/dc/scripts/all.txt | 9 + tests/diff.sh | 51 +++ tests/extra_required.txt | 7 + tests/fuzzing/bc.dict | 68 ++++ tests/fuzzing/bc_inputs1/abs.txt | 7 + tests/fuzzing/bc_inputs1/add.txt | 146 ++++++++ tests/fuzzing/bc_inputs1/arctangent.txt | 26 ++ tests/fuzzing/bc_inputs1/array.bc | 60 +++ tests/fuzzing/bc_inputs1/arrays.txt | 10 + tests/fuzzing/bc_inputs1/assignments.txt | 122 ++++++ tests/fuzzing/bc_inputs1/basic.txt | 7 + tests/fuzzing/bc_inputs1/boolean.txt | 184 ++++++++++ tests/fuzzing/bc_inputs1/cosine.txt | 44 +++ tests/fuzzing/bc_inputs1/decimal.txt | 35 ++ tests/fuzzing/bc_inputs1/divide.txt | 31 ++ tests/fuzzing/bc_inputs1/engineering.txt | 19 + tests/fuzzing/bc_inputs1/exponent.txt | 22 ++ tests/fuzzing/bc_inputs1/functions.bc | 7 + tests/fuzzing/bc_inputs1/functions.txt | 13 + tests/fuzzing/bc_inputs1/globals.txt | 21 ++ tests/fuzzing/bc_inputs1/len.bc | 48 +++ tests/fuzzing/bc_inputs1/length.txt | 59 +++ tests/fuzzing/bc_inputs1/lib10.txt | 4 + tests/fuzzing/bc_inputs1/lib11.txt | 4 + tests/fuzzing/bc_inputs1/lib12.txt | 1 + tests/fuzzing/bc_inputs1/lib2.txt | 15 + tests/fuzzing/bc_inputs1/lib3.txt | 6 + tests/fuzzing/bc_inputs1/lib4.txt | 10 + tests/fuzzing/bc_inputs1/lib5.txt | 2 + tests/fuzzing/bc_inputs1/lib6.txt | 5 + tests/fuzzing/bc_inputs1/lib7.txt | 12 + tests/fuzzing/bc_inputs1/lib8.txt | 3 + tests/fuzzing/bc_inputs2/lib13.txt | 1 + tests/fuzzing/bc_inputs2/lib14.txt | 1 + tests/fuzzing/bc_inputs2/lib15.txt | 1 + tests/fuzzing/bc_inputs2/lib16.txt | 1 + tests/fuzzing/bc_inputs2/lib19.txt | 1 + tests/fuzzing/bc_inputs2/lib20.txt | 1 + tests/fuzzing/bc_inputs2/lib21.txt | 1 + tests/fuzzing/bc_inputs2/lib22.txt | 1 + tests/fuzzing/bc_inputs2/lib23.txt | 1 + tests/fuzzing/bc_inputs2/lib24.txt | 1 + tests/fuzzing/bc_inputs2/log.txt | 22 ++ tests/fuzzing/bc_inputs2/misc.txt | 13 + tests/fuzzing/bc_inputs2/misc1.txt | 76 ++++ tests/fuzzing/bc_inputs2/misc2.txt | 110 ++++++ tests/fuzzing/bc_inputs2/misc3.txt | 12 + tests/fuzzing/bc_inputs2/modulus.txt | 69 ++++ tests/fuzzing/bc_inputs2/multiply.txt | 40 ++ tests/fuzzing/bc_inputs2/pi.txt | 4 + tests/fuzzing/bc_inputs2/places.txt | 19 + tests/fuzzing/bc_inputs2/power.txt | 44 +++ tests/fuzzing/bc_inputs2/print2.txt | 194 ++++++++++ tests/fuzzing/bc_inputs2/references.bc | 408 +++++++++++++++++++++ tests/fuzzing/bc_inputs2/scale.txt | 57 +++ tests/fuzzing/bc_inputs2/scientific.txt | 51 +++ tests/fuzzing/bc_inputs2/shift.txt | 281 ++++++++++++++ tests/fuzzing/bc_inputs2/sine.txt | 207 +++++++++++ tests/fuzzing/bc_inputs3/01.txt | 339 +++++++++++++++++ tests/fuzzing/bc_inputs3/02.txt | 1 + tests/fuzzing/bc_inputs3/03.txt | 2 + tests/fuzzing/bc_inputs3/04.txt | 1 + tests/fuzzing/bc_inputs3/05.txt | 1 + tests/fuzzing/bc_inputs3/06.txt | 1 + tests/fuzzing/bc_inputs3/07.txt | 8 + tests/fuzzing/bc_inputs3/08.txt | 3 + tests/fuzzing/bc_inputs3/09.txt | 11 + tests/fuzzing/bc_inputs3/10.txt | 1 + tests/fuzzing/bc_inputs3/11.txt | 99 +++++ tests/fuzzing/bc_inputs3/12.txt | 2 + tests/fuzzing/bc_inputs3/13.txt | 56 +++ tests/fuzzing/bc_inputs3/14.txt | 1 + tests/fuzzing/bc_inputs3/15.txt | 3 + tests/fuzzing/bc_inputs3/16.txt | 1 + tests/fuzzing/bc_inputs3/17.txt | 11 + tests/fuzzing/bc_inputs3/18.txt | 3 + tests/fuzzing/bc_inputs3/19.txt | 5 + tests/fuzzing/bc_inputs3/20.txt | 51 +++ tests/fuzzing/bc_inputs3/21.txt | 10 + tests/fuzzing/bc_inputs3/22.txt | 2 + tests/fuzzing/bc_inputs3/23.txt | Bin 0 -> 1024 bytes tests/fuzzing/bc_inputs3/24.txt | 4 + tests/fuzzing/bc_inputs3/sqrt.txt | 14 + tests/fuzzing/bc_inputs3/strings.txt | 12 + tests/fuzzing/bc_inputs3/subtract.txt | 153 ++++++++ tests/fuzzing/bc_inputs3/trunc.txt | 15 + tests/fuzzing/bc_inputs3/void.txt | 20 + tests/fuzzing/dc_inputs/01.txt | 2 + tests/fuzzing/dc_inputs/02.txt | 5 + tests/fuzzing/dc_inputs/03.txt | 2 + tests/fuzzing/dc_inputs/04.txt | 9 + tests/fuzzing/dc_inputs/05.txt | 3 + tests/fuzzing/dc_inputs/06.txt | 1 + tests/fuzzing/dc_inputs/07.txt | 3 + tests/fuzzing/dc_inputs/08.txt | 1 + tests/fuzzing/dc_inputs/09.txt | 9 + tests/fuzzing/dc_inputs/10.txt | 11 + tests/fuzzing/dc_inputs/11.txt | 4 + tests/fuzzing/dc_inputs/12.txt | 2 + tests/fuzzing/dc_inputs/13.txt | 7 + tests/fuzzing/dc_inputs/14.txt | 7 + tests/fuzzing/dc_inputs/15.txt | 11 + tests/fuzzing/dc_inputs/16.txt | 1 + tests/fuzzing/dc_inputs/17.txt | 20 + tests/fuzzing/dc_inputs/18.txt | 3 + tests/fuzzing/dc_inputs/19.txt | 1 + tests/fuzzing/dc_inputs/20.txt | 3 + tests/fuzzing/dc_inputs/21.txt | 5 + tests/fuzzing/dc_inputs/22.txt | 36 ++ tests/fuzzing/dc_inputs/23.txt | 2 + tests/fuzzing/dc_inputs/24.txt | 1 + tests/fuzzing/dc_inputs/25.txt | 6 + tests/fuzzing/dc_inputs/26.txt | 155 ++++++++ tests/fuzzing/dc_inputs/27.txt | 2 + tests/fuzzing/dc_inputs/28.txt | 1 + tests/fuzzing/dc_inputs/29.txt | 13 + tests/fuzzing/dc_inputs/30.txt | 1 + tests/fuzzing/dc_inputs/31.txt | 1 + tests/fuzzing/dc_inputs/abs.txt | 7 + tests/fuzzing/dc_inputs/add.txt | 33 ++ tests/fuzzing/dc_inputs/array.dc | 2 + tests/fuzzing/dc_inputs/boolean.txt | 80 ++++ tests/fuzzing/dc_inputs/decimal.txt | 36 ++ tests/fuzzing/dc_inputs/divide.txt | 33 ++ tests/fuzzing/dc_inputs/divmod.txt | 64 ++++ tests/fuzzing/dc_inputs/else.dc | 4 + tests/fuzzing/dc_inputs/engineering.txt | 19 + tests/fuzzing/dc_inputs/loop.dc | 3 + tests/fuzzing/dc_inputs/misc.txt | 1 + tests/fuzzing/dc_inputs/modexp.txt | 103 ++++++ tests/fuzzing/dc_inputs/modulus.txt | 70 ++++ tests/fuzzing/dc_inputs/multiply.txt | 42 +++ tests/fuzzing/dc_inputs/places.txt | 14 + tests/fuzzing/dc_inputs/power.txt | 36 ++ tests/fuzzing/dc_inputs/quit.dc | 2 + tests/fuzzing/dc_inputs/scientific.txt | 51 +++ tests/fuzzing/dc_inputs/shift.txt | 42 +++ tests/fuzzing/dc_inputs/sqrt.txt | 14 + tests/fuzzing/dc_inputs/stdin.txt | 205 +++++++++++ tests/fuzzing/dc_inputs/stream.dc | 2 + tests/fuzzing/dc_inputs/strings.txt | 50 +++ tests/fuzzing/dc_inputs/subtract.txt | 33 ++ tests/fuzzing/dc_inputs/trunc.txt | 11 + tests/fuzzing/dc_inputs/vars.txt | 2 + tests/fuzzing/dc_inputs/weird.dc | 2 + tests/other.sh | 271 ++++++++++++++ 470 files changed, 11313 insertions(+), 821 deletions(-) diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c674e06fda50..000000000000 --- a/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -*.a -*.core -*.o -*.so -*.swp -*~ -_.tinderbox.* -_.universe-toolchain -_.amd64.* -_.arm.* -_.arm64.* -_.i386.* -_.ia64.* -_.mips.* -_.pc98.* -_.powerpc.* -_.riscv.* -_.sparc64.* -_.sun4v.* -GPATH -GRTAGS -GTAGS -ID -cscope.files -cscope.in.out -cscope.out -cscope.po.out diff --git a/README.md b/README.md deleted file mode 100644 index 72bd634cd813..000000000000 --- a/README.md +++ /dev/null @@ -1,82 +0,0 @@ -FreeBSD Source: ---------------- -This is the top level of the FreeBSD source directory. This file -was last revised on: -$FreeBSD$ - -FreeBSD is an operating system used to power modern servers, -desktops, and embedded platforms. A large community has -continually developed it for more than thirty years. Its -advanced networking, security, and storage features have -made FreeBSD the platform of choice for many of the -busiest web sites and most pervasive embedded networking -and storage devices. - -For copyright information, please see the file COPYRIGHT in this -directory. Additional copyright information also exists for some -sources in this tree - please see the specific source directories for -more information. - -The Makefile in this directory supports a number of targets for -building components (or all) of the FreeBSD source tree. See build(7), config(8), -https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, and -https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html -for more information, including setting make(1) variables. - -Source Roadmap: ---------------- -``` -bin System/user commands. - -cddl Various commands and libraries under the Common Development - and Distribution License. - -contrib Packages contributed by 3rd parties. - -crypto Cryptography stuff (see crypto/README). - -etc Template files for /etc. - -gnu Various commands and libraries under the GNU Public License. - Please see gnu/COPYING* for more information. - -include System include files. - -kerberos5 Kerberos5 (Heimdal) package. - -lib System libraries. - -libexec System daemons. - -release Release building Makefile & associated tools. - -rescue Build system for statically linked /rescue utilities. - -sbin System commands. - -secure Cryptographic libraries and commands. - -share Shared resources. - -stand Boot loader sources. - -sys Kernel sources. - -sys//conf Kernel configuration files. GENERIC is the configuration - used in release builds. NOTES contains documentation of - all possible entries. - -tests Regression tests which can be run by Kyua. See tests/README - for additional information. - -tools Utilities for regression testing and miscellaneous tasks. - -usr.bin User commands. - -usr.sbin System administration commands. -``` - -For information on synchronizing your source tree with one or more of -the FreeBSD Project's development branches, please see: - - https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html diff --git a/contrib/bc/.gitignore b/contrib/bc/.gitignore index fb9bc5ab6aa2..5c2bbae866c0 100644 --- a/contrib/bc/.gitignore +++ b/contrib/bc/.gitignore @@ -34,6 +34,13 @@ config.mak timeconst.bc Makefile +tests/fuzzing/bc_outputs1/* +tests/fuzzing/bc_outputs2/* +tests/fuzzing/bc_outputs3/* +tests/fuzzing/dc_outputs/* +tests/bc_outputs/* +tests/dc_outputs/* + .gdb_history # Ignore the generated test files @@ -57,5 +64,7 @@ perf.data.old *.html *.profraw +core.* + cscope*.out tags diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md index 1681a053e0de..269e131cc81d 100644 --- a/contrib/bc/LICENSE.md +++ b/contrib/bc/LICENSE.md @@ -1,6 +1,6 @@ # License -Copyright (c) 2018-2020 Gavin D. Howard +Copyright (c) 2018-2021 Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -31,7 +31,7 @@ copyrights and license: Copyright (c) 2010-2014, Salvatore Sanfilippo
Copyright (c) 2010-2013, Pieter Noordhuis
Copyright (c) 2018 rain-1
-Copyright (c) 2018-2020, Gavin D. Howard +Copyright (c) 2018-2021, Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -53,3 +53,51 @@ 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. + +## Rand + +The files `src/rand.c` and `include/rand.h` are under the following copyrights +and license: + +Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors +Copyright (c) 2018-2021 Gavin D. Howard + +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: + +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. + +## `safe-install.sh` + +The file `safe-install.sh` is under the following copyright and license: + +Copyright (c) 2021 Rich Felker + +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: + +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. diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index d17e74163397..8ae982bd99fe 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.2.4 +VERSION = 3.2.6 SRC = %%SRC%% OBJ = %%OBJ%% @@ -41,6 +41,13 @@ BC_ENABLED = %%BC_ENABLED%% DC_ENABLED_NAME = DC_ENABLED DC_ENABLED = %%DC_ENABLED%% +HEADERS = include/args.h include/file.h include/lang.h include/lex.h include/num.h include/opt.h include/parse.h include/program.h include/read.h include/status.h include/vector.h include/vm.h +BC_HEADERS = include/bc.h +DC_HEADERS = include/dc.h +HISTORY_HEADERS = include/history.h +EXTRA_MATH_HEADERS = include/rand.h +LIBRARY_HEADERS = include/bcl.h include/library.h + GEN_DIR = gen GEN = %%GEN%% GEN_EXEC = $(GEN_DIR)/$(GEN) @@ -82,6 +89,11 @@ DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) +BC_TEST_OUTPUTS = tests/bc_outputs +BC_FUZZ_OUTPUTS = tests/fuzzing/bc_outputs1 tests/fuzzing/bc_outputs2 tests/fuzzing/bc_outputs3 +DC_TEST_OUTPUTS = tests/dc_outputs +DC_FUZZ_OUTPUTS = tests/fuzzing/dc_outputs + LIB = libbcl LIB_NAME = $(LIB).a LIBBC = $(BIN)/$(LIB_NAME) @@ -125,6 +137,9 @@ BC_ENABLE_NLS = %%NLS%% BC_ENABLE_PROMPT = %%PROMPT%% BC_LONG_BIT = %%LONG_BIT%% +BC_ENABLE_AFL = %%FUZZ%% +BC_ENABLE_MEMCHECK = %%MEMCHECK%% + RM = rm MKDIR = mkdir @@ -138,6 +153,8 @@ LOCALE_UNINSTALL = ./locale_uninstall.sh VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all +TEST_STARS = "***********************************************************************" + BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%% CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) @@ -147,7 +164,8 @@ CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) -CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) +CPPFLAGS8 = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) +CPPFLAGS = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL) CFLAGS = $(CPPFLAGS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% @@ -159,20 +177,15 @@ HOSTCC = %%HOSTCC%% BC_LIB_C_ARGS = bc_lib bc_lib_name $(BC_ENABLED_NAME) 1 BC_LIB2_C_ARGS = bc_lib2 bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 -OBJS = $(BC_HELP_O) $(DC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) -OBJ_TARGETS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +OBJS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) -.c.o: - $(CC) $(CFLAGS) -o $@ -c $< - -all: %%ALL_PREREQ%% +all: %%DEFAULT_TARGET%% -execs: make_bin $(OBJ_TARGETS) - $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC) - %%LINK%% +%%DEFAULT_TARGET%%: %%DEFAULT_TARGET_PREREQS%% + %%DEFAULT_TARGET_CMD%% -library: make_bin $(OBJ) $(BC_LIB_O) $(BC_LIB2_O) - ar -r -cu $(LIBBC) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +%%SECOND_TARGET%%: %%SECOND_TARGET_PREREQS%% + %%SECOND_TARGET_CMD%% $(GEN_EXEC): %%GEN_EXEC_TARGET%% @@ -180,18 +193,32 @@ $(GEN_EXEC): $(BC_LIB_C): $(GEN_EXEC) $(BC_LIB) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_LIB_C_ARGS) +$(BC_LIB_O): $(BC_LIB_C) + $(CC) $(CFLAGS) -o $@ -c $< + $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS) +$(BC_LIB2_O): $(BC_LIB2_C) + $(CC) $(CFLAGS) -o $@ -c $< + $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME) +$(BC_HELP_O): $(BC_HELP_C) + $(CC) $(CFLAGS) -o $@ -c $< + $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME) -make_bin: +$(DC_HELP_O): $(DC_HELP_C) + $(CC) $(CFLAGS) -o $@ -c $< + +$(BIN): $(MKDIR) -p $(BIN) +headers: %%HEADERS%% + help: @printf 'available targets:\n' @printf '\n' @@ -222,41 +249,68 @@ help: @printf ' valgrind_dc runs the dc test suite, if dc has been built,\n' @printf ' through valgrind\n' +run_all_tests: + %%BC_ALL_TESTS%% + %%TIMECONST_ALL_TESTS%% + %%DC_ALL_TESTS%% + check: test test: %%TESTS%% -test_bc: - %%BC_TEST%% +test_bc: test_bc_header test_bc_tests test_bc_scripts test_bc_stdin test_bc_read test_bc_errors test_bc_other + @printf '\nAll bc tests passed.\n\n$(TEST_STARS)\n' + +test_bc_tests:%%BC_TESTS%% + +test_bc_scripts:%%BC_SCRIPT_TESTS%% + +test_bc_stdin: + @sh tests/stdin.sh bc %%BC_TEST_EXEC%% + +test_bc_read: + @sh tests/read.sh bc %%BC_TEST_EXEC%% + +test_bc_errors: + @sh tests/errors.sh bc %%BC_TEST_EXEC%% + +test_bc_other: + @sh tests/other.sh bc %%BC_TEST_EXEC%% + +test_bc_header: + @printf '$(TEST_STARS)\n\nRunning bc tests...\n\n' -test_dc: - %%DC_TEST%% +test_dc: test_dc_header test_dc_tests test_dc_scripts test_dc_stdin test_dc_read test_dc_errors test_dc_other + @printf '\nAll dc tests passed.\n\n$(TEST_STARS)\n' -time_test: time_test_bc timeconst time_test_dc +test_dc_tests:%%DC_TESTS%% -time_test_bc: - %%BC_TIME_TEST%% +test_dc_scripts:%%DC_SCRIPT_TESTS%% -time_test_dc: - %%DC_TIME_TEST%% +test_dc_stdin: + @sh tests/stdin.sh dc %%DC_TEST_EXEC%% + +test_dc_read: + @sh tests/read.sh dc %%DC_TEST_EXEC%% + +test_dc_errors: + @sh tests/errors.sh dc %%DC_TEST_EXEC%% + +test_dc_other: + @sh tests/other.sh dc %%DC_TEST_EXEC%% + +test_dc_header: + @printf '$(TEST_STARS)\n\nRunning dc tests...\n\n' timeconst: %%TIMECONST%% -library_test: library +library_test: $(LIBBC) $(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST) test_library: library_test $(BCL_TEST) -valgrind: valgrind_bc valgrind_dc - -valgrind_bc: - %%VG_BC_TEST%% - -valgrind_dc: - %%VG_DC_TEST%% - karatsuba: %%KARATSUBA%% @@ -296,6 +350,8 @@ clean:%%CLEAN_PREREQS%% @$(RM) -f $(BC_LIB2_C) $(BC_LIB2_O) @$(RM) -f $(BC_HELP_C) $(BC_HELP_O) @$(RM) -f $(DC_HELP_C) $(DC_HELP_O) + @$(RM) -fr $(BC_TEST_OUTPUTS) $(DC_TEST_OUTPUTS) + @$(RM) -fr $(BC_FUZZ_OUTPUTS) $(DC_FUZZ_OUTPUTS) clean_config: clean @printf 'Cleaning config...\n' diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index f4fc2f5779ce..5982defb754c 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,40 @@ # News +## 3.2.6 + +This is a production release that fixes the build on FreeBSD. + +There was a syntax error in `configure.sh` that the Linux shell did not catch, +and FreeBSD depends on the existence of `tests/all.sh`. + +All users that already upgraded to `3.2.5` should update to this release, with +my apologies for the poor release of `3.2.5`. Other users should skip `3.2.5` in +favor of this version. + +## 3.2.5 + +This is a production release that fixes several bugs and adds a couple small +things. + +The two most important bugs were bugs that causes `dc` to access memory +out-of-bounds (crash in debug builds). This was found by upgrading to `afl++` +from `afl`. Both were caused by a failure to distinguish between the same two +cases. + +Another bug was the failure to put all of the licenses in the `LICENSE.md` file. + +Third, some warnings by `scan-build` were found and eliminated. This needed one +big change: `bc` and `dc` now bail out as fast as possible on fatal errors +instead of unwinding the stack. + +Fourth, the pseudo-random number now attempts to seed itself with `/dev/random` +if `/dev/urandom` fails. + +Finally, this release has a few quality-of-life changes to the build system. The +usage should not change at all; the only thing that changed was making sure the +`Makefile.in` was written to rebuild properly when headers changed and to not +rebuild when not necessary. + ## 3.2.4 This is a production release that fixes a warning on `gcc` 6 or older, which diff --git a/contrib/bc/NOTICE.md b/contrib/bc/NOTICE.md index 92117daa9a6c..56d2935ab4b3 100644 *** 16942 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Wed Feb 3 11:05: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 075B2533503; Wed, 3 Feb 2021 11:05: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 4DVzPQ6rnvz4RWp; Wed, 3 Feb 2021 11:05: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 DDD2D2008D; Wed, 3 Feb 2021 11:05: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 113B5kb9026781; Wed, 3 Feb 2021 11:05:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113B5kLY026780; Wed, 3 Feb 2021 11:05:46 GMT (envelope-from git) Date: Wed, 3 Feb 2021 11:05:46 GMT Message-Id: <202102031105.113B5kLY026780@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: 5aaea4b99e5c - main - Always clamp curve25519 keys prior to use. 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: 5aaea4b99e5cc724e97e24a68876e8768d3d8012 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 11:05:47 -0000 The branch main has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=5aaea4b99e5cc724e97e24a68876e8768d3d8012 commit 5aaea4b99e5cc724e97e24a68876e8768d3d8012 Author: Peter Grehan AuthorDate: 2021-02-03 09:05:09 +0000 Commit: Peter Grehan CommitDate: 2021-02-03 09:05:09 +0000 Always clamp curve25519 keys prior to use. This fixes an issue where a private key contained bits that should have been cleared by the clamping process, but were passed through to the scalar multiplication routine and resulted in an invalid public key. Issue diagnosed (and an initial fix proposed) by shamaz.mazum in PR 252894. This fix suggested by Jason Donenfeld. PR: 252894 Reported by: shamaz.mazum Reviewed by: dch MFC after: 3 days --- sys/dev/if_wg/module/curve25519.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/if_wg/module/curve25519.c b/sys/dev/if_wg/module/curve25519.c index e21d00bd2818..16f0b0337eb6 100644 --- a/sys/dev/if_wg/module/curve25519.c +++ b/sys/dev/if_wg/module/curve25519.c @@ -767,6 +767,7 @@ void curve25519_generic(u8 out[CURVE25519_KEY_SIZE], u8 e[32]; memcpy(e, scalar, 32); + curve25519_clamp_secret(e); /* The following implementation was transcribed to Coq and proven to * correspond to unary scalar multiplication in affine coordinates given From owner-dev-commits-src-all@freebsd.org Wed Feb 3 14:11: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 87AE6537F90; Wed, 3 Feb 2021 14:11: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 4DW3Wx3SgQz4d9H; Wed, 3 Feb 2021 14:11: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 6A04C220E9; Wed, 3 Feb 2021 14:11: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 113EBfF0071727; Wed, 3 Feb 2021 14:11:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113EBftK071725; Wed, 3 Feb 2021 14:11:41 GMT (envelope-from git) Date: Wed, 3 Feb 2021 14:11:41 GMT Message-Id: <202102031411.113EBftK071725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Roger Pau Monné Subject: git: 51ab5e0d82c1 - stable/13 - stand/multiboot: adjust the protocol between loader and kernel 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 51ab5e0d82c1e9607c060976259bb9ae0d656a80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:11:41 -0000 The branch stable/13 has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=51ab5e0d82c1e9607c060976259bb9ae0d656a80 commit 51ab5e0d82c1e9607c060976259bb9ae0d656a80 Author: Roger Pau Monné AuthorDate: 2021-01-27 10:12:07 +0000 Commit: Roger Pau Monné CommitDate: 2021-02-03 13:07:43 +0000 stand/multiboot: adjust the protocol between loader and kernel There's a currently ad-hoc protocol to hand off the FreeBSD kernel payload between the loader and the kernel itself when Xen is in the middle of the picture. Such protocol wasn't very resilient to changes to the loader itself, because it relied on moving metadata around to package it using a certain layout. This has proven to be fragile, so replace it with a more robust version. The new protocol requires using a xen_header structure that will be used to pass data between the FreeBSD loader and the FreeBSD kernel when booting in dom0 mode. At the moment the only data conveyed is the offset of the start of the module metadata relative to the start of the module itself. This is a slightly disruptive change since it also requires a change to the kernel which is contained in this patch. In order to update with this change the kernel must be updated before updating the loader, as described in the handbook. Note this is only required when booting a FreeBSD/Xen dom0. This change doesn't affect the normal FreeBSD boot protocol. This fixes booting FreeBSD/Xen in dom0 mode after 3630506b9daec9167a89bc4525638ea45a00769e. (cherry picked from commit b6d85a5f51e4147452b35d76478fb9e191b7734b) --- stand/i386/libi386/multiboot.c | 156 +++++++++++------------------------------ sys/x86/include/metadata.h | 21 ++++++ sys/x86/xen/pv.c | 67 +++++++++++++----- 3 files changed, 111 insertions(+), 133 deletions(-) diff --git a/stand/i386/libi386/multiboot.c b/stand/i386/libi386/multiboot.c index a29696e4baec..71fd63bb4c88 100644 --- a/stand/i386/libi386/multiboot.c +++ b/stand/i386/libi386/multiboot.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #define _MACHINE_ELF_WANT_32BIT #include +#include #include #include @@ -55,11 +56,6 @@ __FBSDID("$FreeBSD$"); #define MULTIBOOT_SUPPORTED_FLAGS \ (MULTIBOOT_PAGE_ALIGN|MULTIBOOT_MEMORY_INFO) #define NUM_MODULES 2 -#define METADATA_FIXED_SIZE (PAGE_SIZE*4) -#define METADATA_MODULE_SIZE PAGE_SIZE - -#define METADATA_RESV_SIZE(mod_num) \ - roundup(METADATA_FIXED_SIZE + METADATA_MODULE_SIZE * mod_num, PAGE_SIZE) extern int elf32_loadfile_raw(char *filename, uint64_t dest, struct preloaded_file **result, int multiboot); @@ -81,32 +77,6 @@ extern void multiboot_tramp(); static const char mbl_name[] = "FreeBSD Loader"; -static int -num_modules(struct preloaded_file *kfp) -{ - struct kernel_module *kmp; - int mod_num = 0; - - for (kmp = kfp->f_modules; kmp != NULL; kmp = kmp->m_next) - mod_num++; - - return (mod_num); -} - -static vm_offset_t -max_addr(void) -{ - struct preloaded_file *fp; - vm_offset_t addr = 0; - - for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { - if (addr < (fp->f_addr + fp->f_size)) - addr = fp->f_addr + fp->f_size; - } - - return (addr); -} - static int multiboot_loadfile(char *filename, uint64_t dest, struct preloaded_file **result) @@ -188,7 +158,6 @@ out: static int multiboot_exec(struct preloaded_file *fp) { - vm_offset_t module_start, last_addr, metadata_size; vm_offset_t modulep, kernend, entry; struct file_metadata *md; Elf_Ehdr *ehdr; @@ -197,6 +166,9 @@ multiboot_exec(struct preloaded_file *fp) char *cmdline = NULL; size_t len; int error, mod_num; + struct xen_header header; + + CTASSERT(sizeof(header) <= PAGE_SIZE); /* * Don't pass the memory size found by the bootloader, the memory @@ -260,13 +232,11 @@ multiboot_exec(struct preloaded_file *fp) * FreeBSD kernel loaded as a raw file. The second module is going * to contain the metadata info and the loaded modules. * - * On native FreeBSD loads all the modules and then places the - * metadata info at the end, but this is painful when running on Xen, - * because it relocates the second multiboot module wherever it - * likes. In order to workaround this limitation the metadata - * information is placed at the start of the second module and - * the original modulep value is saved together with the other - * metadata, so we can relocate everything. + * There's a small header prefixed in the second module that contains + * some information required to calculate the relocated address of + * modulep based on the original offset of modulep from the start of + * the module address. Note other fields might be added to this header + * if required. * * Native layout: * fp->f_addr + fp->f_size @@ -277,27 +247,16 @@ multiboot_exec(struct preloaded_file *fp) * +---------+----------------+------------+ * fp->f_addr modulep kernend * - * Xen layout: - * - * Initial: - * fp->f_addr + fp->f_size - * +---------+----------+----------------+------------+ - * | | | | | - * | Kernel | Reserved | Modules | Metadata | - * | | | | dry run | - * +---------+----------+----------------+------------+ - * fp->f_addr - * - * After metadata polacement (ie: final): - * fp->f_addr + fp->f_size - * +-----------+---------+----------+----------------+ - * | | | | | - * | Kernel | Free | Metadata | Modules | - * | | | | | - * +-----------+---------+----------+----------------+ - * fp->f_addr modulep kernend - * \__________/ \__________________________/ - * Multiboot module 0 Multiboot module 1 + * Xen dom0 layout: + * fp->f_addr fp->f_addr + fp->f_size + * +---------+------------+----------------+------------+ + * | | | | | + * | Kernel | xen_header | Modules | Metadata | + * | | | | | + * +---------+------------+----------------+------------+ + * modulep kernend + * \________/\__________________________________________/ + * module 0 module 1 */ fp = file_findfile(NULL, "elf kernel"); @@ -307,13 +266,6 @@ multiboot_exec(struct preloaded_file *fp) goto error; } - if (fp->f_metadata != NULL) { - printf("FreeBSD kernel already contains metadata, aborting\n"); - error = EINVAL; - goto error; - } - - mb_mod = malloc(sizeof(struct multiboot_mod_list) * NUM_MODULES); if (mb_mod == NULL) { error = ENOMEM; @@ -322,61 +274,34 @@ multiboot_exec(struct preloaded_file *fp) bzero(mb_mod, sizeof(struct multiboot_mod_list) * NUM_MODULES); - /* - * Calculate how much memory is needed for the metatdata. We did - * an approximation of the maximum size when loading the kernel, - * but now we know the exact size, so we can release some of this - * preallocated memory if not needed. - */ - last_addr = roundup(max_addr(), PAGE_SIZE); - mod_num = num_modules(fp); - - /* - * Place the metadata after the last used address in order to - * calculate it's size, this will not be used. - */ - error = bi_load64(fp->f_args, last_addr, &modulep, &kernend, 0); + error = bi_load64(fp->f_args, 0, &modulep, &kernend, 0); if (error != 0) { printf("bi_load64 failed: %d\n", error); goto error; } - metadata_size = roundup(kernend - last_addr, PAGE_SIZE); - /* Check that the size is not greater than what we have reserved */ - if (metadata_size > METADATA_RESV_SIZE(mod_num)) { - printf("Required memory for metadata is greater than reserved " - "space, please increase METADATA_FIXED_SIZE and " - "METADATA_MODULE_SIZE and rebuild the loader\n"); + mb_mod[0].mod_start = fp->f_addr; + mb_mod[0].mod_end = fp->f_addr + fp->f_size - PAGE_SIZE; + + mb_mod[1].mod_start = mb_mod[0].mod_end; + mb_mod[1].mod_end = kernend; + /* Indicate the kernel metadata is prefixed with a xen_header. */ + cmdline = strdup("header"); + if (cmdline == NULL) { + printf("Out of memory, aborting\n"); error = ENOMEM; goto error; } - - /* Clean the metadata added to the kernel in the bi_load64 dry run */ - file_removemetadata(fp); - - /* - * This is the position where the second multiboot module - * will be placed. - */ - module_start = fp->f_addr + fp->f_size - metadata_size; - - error = bi_load64(fp->f_args, module_start, &modulep, &kernend, 0); - if (error != 0) { - printf("bi_load64 failed: %d\n", error); - goto error; - } - - mb_mod[0].mod_start = fp->f_addr; - mb_mod[0].mod_end = fp->f_addr + fp->f_size; - mb_mod[0].mod_end -= METADATA_RESV_SIZE(mod_num); - - mb_mod[1].mod_start = module_start; - mb_mod[1].mod_end = last_addr; + mb_mod[1].cmdline = VTOP(cmdline); mb_info->mods_count = NUM_MODULES; mb_info->mods_addr = VTOP(mb_mod); mb_info->flags |= MULTIBOOT_INFO_MODS; + header.flags = XENHEADER_HAS_MODULEP_OFFSET; + header.modulep_offset = modulep - mb_mod[1].mod_start; + archsw.arch_copyin(&header, mb_mod[1].mod_start, sizeof(header)); + dev_cleanup(); __exec((void *)VTOP(multiboot_tramp), (void *)entry, (void *)VTOP(mb_info)); @@ -434,17 +359,14 @@ multiboot_obj_loadfile(char *filename, uint64_t dest, return (EINVAL); } + /* - * Save space at the end of the kernel in order to place - * the metadata information. We do an approximation of the - * max metadata size, this is not optimal but it's probably - * the best we can do at this point. Once all modules are - * loaded and the size of the metadata is known this - * space will be recovered if not used. + * Reserve one page at the end of the kernel to place some + * metadata in order to cope for Xen relocating the modules and + * the metadata information. */ - mod_num = num_modules(rfp); rfp->f_size = roundup(rfp->f_size, PAGE_SIZE); - rfp->f_size += METADATA_RESV_SIZE(mod_num); + rfp->f_size += PAGE_SIZE; *result = rfp; } else { /* The rest should be loaded as regular modules */ diff --git a/sys/x86/include/metadata.h b/sys/x86/include/metadata.h index d157df0307fd..be0eae43d34c 100644 --- a/sys/x86/include/metadata.h +++ b/sys/x86/include/metadata.h @@ -68,4 +68,25 @@ struct vbe_fb { uint32_t fb_bpp; }; +/* + * The structure below is used when FreeBSD kernel is booted as a dom0 kernel + * from Xen. In such scenario we need to accommodate the modules and the + * metadata as a contiguous memory region, so it can be passed as a multiboot + * module, and some extra information is required which is conveyed from the + * loader to the kernel using the xen_header structure below. + * + * See the comment in multiboot.c about how the structure below is packaged + * together with the rest of the kernel payload data. + */ +struct xen_header { + uint64_t flags; +#define XENHEADER_HAS_MODULEP_OFFSET (1ull << 0) + + /* + * Offset of the modulep location from the start of the multiboot + * module blob. + */ + uint64_t modulep_offset; +}; + #endif /* !_MACHINE_METADATA_H_ */ diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c index 34fcbd990491..2fd698772f9d 100644 --- a/sys/x86/xen/pv.c +++ b/sys/x86/xen/pv.c @@ -568,25 +568,60 @@ xen_pvh_parse_preload_data(uint64_t modulep) if (start_info->modlist_paddr != 0) { struct hvm_modlist_entry *mod; + const char *cmdline; mod = (struct hvm_modlist_entry *) (start_info->modlist_paddr + KERNBASE); - preload_metadata = (caddr_t)(mod[0].paddr + KERNBASE); - - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - KASSERT(kmdp != NULL, ("unable to find kernel")); - - /* - * Xen has relocated the metadata and the modules, - * so we need to recalculate it's position. This is - * done by saving the original modulep address and - * then calculating the offset with mod_start, - * which contains the relocated modulep address. - */ - metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, vm_paddr_t); - off = mod[0].paddr + KERNBASE - metadata; + cmdline = mod[0].cmdline_paddr ? + (const char *)(mod[0].cmdline_paddr + KERNBASE) : NULL; + + if (strcmp(cmdline, "header") == 0) { + struct xen_header *header; + + header = (struct xen_header *)(mod[0].paddr + KERNBASE); + + if ((header->flags & XENHEADER_HAS_MODULEP_OFFSET) != + XENHEADER_HAS_MODULEP_OFFSET) { + xc_printf("Unable to load module metadata\n"); + HYPERVISOR_shutdown(SHUTDOWN_crash); + } + + preload_metadata = (caddr_t)(mod[0].paddr + + header->modulep_offset + KERNBASE); + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + if (kmdp == NULL) { + xc_printf("Unable to find kernel\n"); + HYPERVISOR_shutdown(SHUTDOWN_crash); + } + + /* + * Xen has relocated the metadata and the modules, so + * we need to recalculate it's position. This is done + * by saving the original modulep address and then + * calculating the offset from the real modulep + * position. + */ + metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, + vm_paddr_t); + off = mod[0].paddr + header->modulep_offset - metadata + + KERNBASE; + } else { + preload_metadata = (caddr_t)(mod[0].paddr + KERNBASE); + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + if (kmdp == NULL) { + xc_printf("Unable to find kernel\n"); + HYPERVISOR_shutdown(SHUTDOWN_crash); + } + + metadata = MD_FETCH(kmdp, MODINFOMD_MODULEP, vm_paddr_t); + off = mod[0].paddr + KERNBASE - metadata; + } preload_bootstrap_relocate(off); From owner-dev-commits-src-all@freebsd.org Wed Feb 3 14: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 896FE537C6E; Wed, 3 Feb 2021 14:20: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 4DW3jZ3X8gz4f7N; Wed, 3 Feb 2021 14:20: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 6C04D22704; Wed, 3 Feb 2021 14:20: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 113EK2Vn077193; Wed, 3 Feb 2021 14:20:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113EK2QT077190; Wed, 3 Feb 2021 14:20:02 GMT (envelope-from git) Date: Wed, 3 Feb 2021 14:20:02 GMT Message-Id: <202102031420.113EK2QT077190@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: 18697b446b95 - stable/13 - pf: Improve pf_rule input validation 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: 18697b446b95722808c65b72d793de5975c5ae4b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:20:02 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=18697b446b95722808c65b72d793de5975c5ae4b commit 18697b446b95722808c65b72d793de5975c5ae4b Author: Kristof Provost AuthorDate: 2021-01-26 07:56:51 +0000 Commit: Kristof Provost CommitDate: 2021-02-03 14:19:52 +0000 pf: Improve pf_rule input validation Move the validation checks to pf_rule_to_krule() to reduce duplication. This also makes the checks consistent across different ioctls. Reported-by: syzbot+e9632d7ad17398f0bd8f@syzkaller.appspotmail.com Reviewed by: tuexen@, donner@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28362 (cherry picked from commit 7a808c5ee3296fdb72d8e8bc6c7ad6f316a520ab) --- sys/netpfil/pf/pf_ioctl.c | 72 +++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 60c38a980d1e..644a091808cd 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1557,10 +1557,39 @@ pf_krule_to_rule(const struct pf_krule *krule, struct pf_rule *rule) rule->u_src_nodes = counter_u64_fetch(krule->src_nodes); } -static void +static int pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) { +#ifndef INET + if (rule->af == AF_INET) { + return (EAFNOSUPPORT); + } +#endif /* INET */ +#ifndef INET6 + if (rule->af == AF_INET6) { + return (EAFNOSUPPORT); + } +#endif /* INET6 */ + + if (rule->src.addr.type != PF_ADDR_ADDRMASK && + rule->src.addr.type != PF_ADDR_DYNIFTL && + rule->src.addr.type != PF_ADDR_TABLE) { + return (EINVAL); + } + if (rule->src.addr.p.dyn != NULL) { + return (EINVAL); + } + + if (rule->dst.addr.type != PF_ADDR_ADDRMASK && + rule->dst.addr.type != PF_ADDR_DYNIFTL && + rule->dst.addr.type != PF_ADDR_TABLE) { + return (EINVAL); + } + if (rule->dst.addr.p.dyn != NULL) { + return (EINVAL); + } + bzero(krule, sizeof(*krule)); bcopy(&rule->src, &krule->src, sizeof(rule->src)); @@ -1641,6 +1670,8 @@ pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) krule->set_prio[1] = rule->set_prio[1]; bcopy(&rule->divert, &krule->divert, sizeof(krule->divert)); + + return (0); } static int @@ -1815,26 +1846,13 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td error = EINVAL; break; } - if (pr->rule.src.addr.p.dyn != NULL || - pr->rule.dst.addr.p.dyn != NULL) { - error = EINVAL; - break; - } -#ifndef INET - if (pr->rule.af == AF_INET) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET */ -#ifndef INET6 - if (pr->rule.af == AF_INET6) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET6 */ rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK); - pf_rule_to_krule(&pr->rule, rule); + error = pf_rule_to_krule(&pr->rule, rule); + if (error != 0) { + free(rule, M_PFRULE); + break; + } if (rule->ifname[0]) kif = pf_kkif_create(M_WAITOK); @@ -2090,20 +2108,12 @@ DIOCADDRULE_error: } if (pcr->action != PF_CHANGE_REMOVE) { -#ifndef INET - if (pcr->rule.af == AF_INET) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET */ -#ifndef INET6 - if (pcr->rule.af == AF_INET6) { - error = EAFNOSUPPORT; + newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK); + error = pf_rule_to_krule(&pcr->rule, newrule); + if (error != 0) { + free(newrule, M_PFRULE); break; } -#endif /* INET6 */ - newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK); - pf_rule_to_krule(&pcr->rule, newrule); if (newrule->ifname[0]) kif = pf_kkif_create(M_WAITOK); From owner-dev-commits-src-all@freebsd.org Wed Feb 3 14:20: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 B58D25380C2; Wed, 3 Feb 2021 14:20: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 4DW3jk2fgNz4f1r; Wed, 3 Feb 2021 14:20: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 CB4F0222E0; Wed, 3 Feb 2021 14:20: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 113EK8O9078374; Wed, 3 Feb 2021 14:20:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113EK8Ig078372; Wed, 3 Feb 2021 14:20:08 GMT (envelope-from git) Date: Wed, 3 Feb 2021 14:20:08 GMT Message-Id: <202102031420.113EK8Ig078372@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: 71abbe15d01f - stable/12 - pf: Improve pf_rule input validation 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: 71abbe15d01f73a4e55a732f21180d339eab631d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:20:13 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=71abbe15d01f73a4e55a732f21180d339eab631d commit 71abbe15d01f73a4e55a732f21180d339eab631d Author: Kristof Provost AuthorDate: 2021-01-26 07:56:51 +0000 Commit: Kristof Provost CommitDate: 2021-02-03 09:09:14 +0000 pf: Improve pf_rule input validation Move the validation checks to pf_rule_to_krule() to reduce duplication. This also makes the checks consistent across different ioctls. Reported-by: syzbot+e9632d7ad17398f0bd8f@syzkaller.appspotmail.com Reviewed by: tuexen@, donner@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28362 (cherry picked from commit 7a808c5ee3296fdb72d8e8bc6c7ad6f316a520ab) --- sys/netpfil/pf/pf_ioctl.c | 72 +++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 48f68fa249e2..bbb9cfe39586 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1558,10 +1558,39 @@ pf_krule_to_rule(const struct pf_krule *krule, struct pf_rule *rule) rule->u_src_nodes = counter_u64_fetch(krule->src_nodes); } -static void +static int pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) { +#ifndef INET + if (rule->af == AF_INET) { + return (EAFNOSUPPORT); + } +#endif /* INET */ +#ifndef INET6 + if (rule->af == AF_INET6) { + return (EAFNOSUPPORT); + } +#endif /* INET6 */ + + if (rule->src.addr.type != PF_ADDR_ADDRMASK && + rule->src.addr.type != PF_ADDR_DYNIFTL && + rule->src.addr.type != PF_ADDR_TABLE) { + return (EINVAL); + } + if (rule->src.addr.p.dyn != NULL) { + return (EINVAL); + } + + if (rule->dst.addr.type != PF_ADDR_ADDRMASK && + rule->dst.addr.type != PF_ADDR_DYNIFTL && + rule->dst.addr.type != PF_ADDR_TABLE) { + return (EINVAL); + } + if (rule->dst.addr.p.dyn != NULL) { + return (EINVAL); + } + bzero(krule, sizeof(*krule)); bcopy(&rule->src, &krule->src, sizeof(rule->src)); @@ -1642,6 +1671,8 @@ pf_rule_to_krule(const struct pf_rule *rule, struct pf_krule *krule) krule->set_prio[1] = rule->set_prio[1]; bcopy(&rule->divert, &krule->divert, sizeof(krule->divert)); + + return (0); } static int @@ -1816,26 +1847,13 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td error = EINVAL; break; } - if (pr->rule.src.addr.p.dyn != NULL || - pr->rule.dst.addr.p.dyn != NULL) { - error = EINVAL; - break; - } -#ifndef INET - if (pr->rule.af == AF_INET) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET */ -#ifndef INET6 - if (pr->rule.af == AF_INET6) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET6 */ rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK); - pf_rule_to_krule(&pr->rule, rule); + error = pf_rule_to_krule(&pr->rule, rule); + if (error != 0) { + free(rule, M_PFRULE); + break; + } if (rule->ifname[0]) kif = pf_kkif_create(M_WAITOK); @@ -2092,20 +2110,12 @@ DIOCADDRULE_error: } if (pcr->action != PF_CHANGE_REMOVE) { -#ifndef INET - if (pcr->rule.af == AF_INET) { - error = EAFNOSUPPORT; - break; - } -#endif /* INET */ -#ifndef INET6 - if (pcr->rule.af == AF_INET6) { - error = EAFNOSUPPORT; + newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK); + error = pf_rule_to_krule(&pcr->rule, newrule); + if (error != 0) { + free(newrule, M_PFRULE); break; } -#endif /* INET6 */ - newrule = malloc(sizeof(*newrule), M_PFRULE, M_WAITOK); - pf_rule_to_krule(&pcr->rule, newrule); if (newrule->ifname[0]) kif = pf_kkif_create(M_WAITOK); From owner-dev-commits-src-all@freebsd.org Wed Feb 3 14:37: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 C191F53871F; Wed, 3 Feb 2021 14:37: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 4DW45d56Fzz4g0v; Wed, 3 Feb 2021 14:37: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 A23A922ABC; Wed, 3 Feb 2021 14:37: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 113EbPbS001734; Wed, 3 Feb 2021 14:37:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113EbPve001733; Wed, 3 Feb 2021 14:37:25 GMT (envelope-from git) Date: Wed, 3 Feb 2021 14:37:25 GMT Message-Id: <202102031437.113EbPve001733@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: 10ed8ab4ab9b - stable/12 - opencrypto: Fix assignment of crypto completions to worker threads 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: 10ed8ab4ab9bd0239f2913ac2f35af9b9f76221d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:37:25 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=10ed8ab4ab9bd0239f2913ac2f35af9b9f76221d commit 10ed8ab4ab9bd0239f2913ac2f35af9b9f76221d Author: Mark Johnston AuthorDate: 2021-01-20 01:34:35 +0000 Commit: Mark Johnston CommitDate: 2021-02-03 14:37:17 +0000 opencrypto: Fix assignment of crypto completions to worker threads Since r336439 we simply take the session pointer value mod the number of worker threads (ncpu by default). On small systems this ends up funneling all completion work through a single thread, which becomes a bottleneck when processing IPSec traffic using hardware crypto drivers. (Software drivers such as aesni(4) are unaffected since they invoke completion handlers synchonously.) Instead, maintain an incrementing counter with a unique value per session, and use that to distribute work to completion threads. Reviewed by: cem, jhb Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D28159 (cherry picked from commit 98d788c867b9e1d7a7e290254443b87ea77d8ab1) --- sys/opencrypto/crypto.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index dfd22662e87f..bc23056e86ad 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -94,6 +94,7 @@ struct crypto_session { void *softc; uint32_t hid; uint32_t capabilities; + uint64_t id; }; SDT_PROVIDER_DEFINE(opencrypto); @@ -572,6 +573,7 @@ again: int crypto_newsession(crypto_session_t *cses, struct cryptoini *cri, int crid) { + static uint64_t sessid = 0; crypto_session_t res; void *softc_mem; struct cryptocap *cap; @@ -616,6 +618,7 @@ restart: softc_mem = malloc(softc_size, M_CRYPTO_DATA, M_WAITOK | M_ZERO); res = uma_zalloc(cryptoses_zone, M_WAITOK | M_ZERO); res->softc = softc_mem; + res->id = atomic_fetchadd_64(&sessid, 1); CRYPTO_DRIVER_LOCK(); cap = crypto_checkdriver(hid); @@ -1016,7 +1019,7 @@ crypto_dispatch(struct cryptop *crp) binuptime(&crp->crp_tstamp); #endif - crp->crp_retw_id = ((uintptr_t)crp->crp_session) % crypto_workers_num; + crp->crp_retw_id = crp->crp_session->id % crypto_workers_num; if (CRYPTOP_ASYNC(crp)) { if (crp->crp_flags & CRYPTO_F_ASYNC_KEEPORDER) { From owner-dev-commits-src-all@freebsd.org Wed Feb 3 14:37: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 CECBD5382EF; Wed, 3 Feb 2021 14:37: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 4DW4635QBTz4gRK; Wed, 3 Feb 2021 14:37: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 ACBC922ABE; Wed, 3 Feb 2021 14:37: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 113EblaC001890; Wed, 3 Feb 2021 14:37:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113EblbP001889; Wed, 3 Feb 2021 14:37:47 GMT (envelope-from git) Date: Wed, 3 Feb 2021 14:37:47 GMT Message-Id: <202102031437.113EblbP001889@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: 1996360d7338 - stable/13 - qat: Add support for separate AAD and output buffers 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: 1996360d7338db8f12b9bda9572d4e2d85c89170 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:37:47 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1996360d7338db8f12b9bda9572d4e2d85c89170 commit 1996360d7338db8f12b9bda9572d4e2d85c89170 Author: Mark Johnston AuthorDate: 2021-01-27 20:30:58 +0000 Commit: Mark Johnston CommitDate: 2021-02-03 14:37:41 +0000 qat: Add support for separate AAD and output buffers Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit bd674d8b1fa808dff1afdcb6afc70226077ee78a) --- sys/dev/qat/qat.c | 293 +++++++++++++++++++++++++++++++++++++------------ sys/dev/qat/qat_hw15.c | 20 +++- sys/dev/qat/qat_hw17.c | 22 +++- sys/dev/qat/qatreg.h | 3 + sys/dev/qat/qatvar.h | 43 ++++---- 5 files changed, 281 insertions(+), 100 deletions(-) diff --git a/sys/dev/qat/qat.c b/sys/dev/qat/qat.c index 1e533d1bebcc..acfe0c6a1e07 100644 --- a/sys/dev/qat/qat.c +++ b/sys/dev/qat/qat.c @@ -1172,9 +1172,8 @@ static void qat_crypto_free_sym_cookie(struct qat_crypto_bank *qcb, struct qat_sym_cookie *qsc) { - - explicit_bzero(qsc->qsc_iv_buf, sizeof(qsc->qsc_iv_buf)); - explicit_bzero(qsc->qsc_auth_res, sizeof(qsc->qsc_auth_res)); + explicit_bzero(qsc->qsc_iv_buf, EALG_MAX_BLOCK_LEN); + explicit_bzero(qsc->qsc_auth_res, QAT_SYM_HASH_BUFFER_LEN); mtx_lock(&qcb->qcb_bank_mtx); qcb->qcb_symck_free[qcb->qcb_symck_free_count++] = qsc; @@ -1350,18 +1349,66 @@ struct qat_crypto_load_cb_arg { int error; }; +static int +qat_crypto_populate_buf_list(struct buffer_list_desc *buffers, + bus_dma_segment_t *segs, int niseg, int noseg, int skip) +{ + struct flat_buffer_desc *flatbuf; + bus_addr_t addr; + bus_size_t len; + int iseg, oseg; + + for (iseg = 0, oseg = noseg; iseg < niseg && oseg < QAT_MAXSEG; + iseg++) { + addr = segs[iseg].ds_addr; + len = segs[iseg].ds_len; + + if (skip > 0) { + if (skip < len) { + addr += skip; + len -= skip; + skip = 0; + } else { + skip -= len; + continue; + } + } + + flatbuf = &buffers->flat_bufs[oseg++]; + flatbuf->data_len_in_bytes = (uint32_t)len; + flatbuf->phy_buffer = (uint64_t)addr; + } + buffers->num_buffers = oseg; + return iseg < niseg ? E2BIG : 0; +} + static void -qat_crypto_load_cb(void *_arg, bus_dma_segment_t *segs, int nseg, +qat_crypto_load_aadbuf_cb(void *_arg, bus_dma_segment_t *segs, int nseg, + int error) +{ + struct qat_crypto_load_cb_arg *arg; + struct qat_sym_cookie *qsc; + + arg = _arg; + if (error != 0) { + arg->error = error; + return; + } + + qsc = arg->qsc; + arg->error = qat_crypto_populate_buf_list(&qsc->qsc_buf_list, segs, + nseg, 0, 0); +} + +static void +qat_crypto_load_buf_cb(void *_arg, bus_dma_segment_t *segs, int nseg, int error) { struct cryptop *crp; - struct flat_buffer_desc *flatbuf; struct qat_crypto_load_cb_arg *arg; struct qat_session *qs; struct qat_sym_cookie *qsc; - bus_addr_t addr; - bus_size_t len; - int iseg, oseg, skip; + int noseg, skip; arg = _arg; if (error != 0) { @@ -1374,43 +1421,70 @@ qat_crypto_load_cb(void *_arg, bus_dma_segment_t *segs, int nseg, qsc = arg->qsc; if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128) { - /* - * The firmware expects AAD to be in a contiguous buffer and - * padded to a multiple of 16 bytes. To satisfy these - * constraints we bounce the AAD into a per-request buffer. - */ - crypto_copydata(crp, crp->crp_aad_start, crp->crp_aad_length, - qsc->qsc_gcm_aad); - memset(qsc->qsc_gcm_aad + crp->crp_aad_length, 0, - roundup2(crp->crp_aad_length, QAT_AES_GCM_AAD_ALIGN) - - crp->crp_aad_length); + /* AAD was handled in qat_crypto_load(). */ skip = crp->crp_payload_start; - } else if (crp->crp_aad_length > 0) { + noseg = 0; + } else if (crp->crp_aad == NULL && crp->crp_aad_length > 0) { skip = crp->crp_aad_start; + noseg = 0; } else { skip = crp->crp_payload_start; + noseg = crp->crp_aad == NULL ? + 0 : qsc->qsc_buf_list.num_buffers; } + arg->error = qat_crypto_populate_buf_list(&qsc->qsc_buf_list, segs, + nseg, noseg, skip); +} - for (iseg = oseg = 0; iseg < nseg; iseg++) { - addr = segs[iseg].ds_addr; - len = segs[iseg].ds_len; +static void +qat_crypto_load_obuf_cb(void *_arg, bus_dma_segment_t *segs, int nseg, + int error) +{ + struct buffer_list_desc *ibufs, *obufs; + struct flat_buffer_desc *ibuf, *obuf; + struct cryptop *crp; + struct qat_crypto_load_cb_arg *arg; + struct qat_session *qs; + struct qat_sym_cookie *qsc; + int buflen, osegs, tocopy; - if (skip > 0) { - if (skip < len) { - addr += skip; - len -= skip; - skip = 0; - } else { - skip -= len; - continue; - } - } + arg = _arg; + if (error != 0) { + arg->error = error; + return; + } - flatbuf = &qsc->qsc_flat_bufs[oseg++]; - flatbuf->data_len_in_bytes = (uint32_t)len; - flatbuf->phy_buffer = (uint64_t)addr; + crp = arg->crp; + qs = arg->qs; + qsc = arg->qsc; + + /* + * The payload must start at the same offset in the output SG list as in + * the input SG list. Copy over SG entries from the input corresponding + * to the AAD buffer. + */ + osegs = 0; + if (qs->qs_auth_algo != HW_AUTH_ALGO_GALOIS_128 && + crp->crp_aad_length > 0) { + tocopy = crp->crp_aad == NULL ? + crp->crp_payload_start - crp->crp_aad_start : + crp->crp_aad_length; + + ibufs = &qsc->qsc_buf_list; + obufs = &qsc->qsc_obuf_list; + for (; osegs < ibufs->num_buffers && tocopy > 0; osegs++) { + ibuf = &ibufs->flat_bufs[osegs]; + obuf = &obufs->flat_bufs[osegs]; + + obuf->phy_buffer = ibuf->phy_buffer; + buflen = imin(ibuf->data_len_in_bytes, tocopy); + obuf->data_len_in_bytes = buflen; + tocopy -= buflen; + } } - qsc->qsc_buf_list.num_buffers = oseg; + + arg->error = qat_crypto_populate_buf_list(&qsc->qsc_obuf_list, segs, + nseg, osegs, crp->crp_payload_output_start); } static int @@ -1426,10 +1500,52 @@ qat_crypto_load(struct qat_session *qs, struct qat_sym_cookie *qsc, arg.qs = qs; arg.qsc = qsc; arg.error = 0; - error = bus_dmamap_load_crp(qsc->qsc_buf_dma_tag, qsc->qsc_buf_dmamap, - crp, qat_crypto_load_cb, &arg, BUS_DMA_NOWAIT); - if (error == 0) - error = arg.error; + + error = 0; + if (qs->qs_auth_algo == HW_AUTH_ALGO_GALOIS_128 && + crp->crp_aad_length > 0) { + /* + * The firmware expects AAD to be in a contiguous buffer and + * padded to a multiple of 16 bytes. To satisfy these + * constraints we bounce the AAD into a per-request buffer. + * There is a small limit on the AAD size so this is not too + * onerous. + */ + memset(qsc->qsc_gcm_aad, 0, QAT_GCM_AAD_SIZE_MAX); + if (crp->crp_aad == NULL) { + crypto_copydata(crp, crp->crp_aad_start, + crp->crp_aad_length, qsc->qsc_gcm_aad); + } else { + memcpy(qsc->qsc_gcm_aad, crp->crp_aad, + crp->crp_aad_length); + } + } else if (crp->crp_aad != NULL) { + error = bus_dmamap_load( + qsc->qsc_dma[QAT_SYM_DMA_AADBUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_AADBUF].qsd_dmamap, + crp->crp_aad, crp->crp_aad_length, + qat_crypto_load_aadbuf_cb, &arg, BUS_DMA_NOWAIT); + if (error == 0) + error = arg.error; + } + if (error == 0) { + error = bus_dmamap_load_crp_buffer( + qsc->qsc_dma[QAT_SYM_DMA_BUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_BUF].qsd_dmamap, + &crp->crp_buf, qat_crypto_load_buf_cb, &arg, + BUS_DMA_NOWAIT); + if (error == 0) + error = arg.error; + } + if (error == 0 && CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + error = bus_dmamap_load_crp_buffer( + qsc->qsc_dma[QAT_SYM_DMA_OBUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_OBUF].qsd_dmamap, + &crp->crp_obuf, qat_crypto_load_obuf_cb, &arg, + BUS_DMA_NOWAIT); + if (error == 0) + error = arg.error; + } return error; } @@ -1444,11 +1560,11 @@ qat_crypto_select_bank(struct qat_crypto *qcy) static int qat_crypto_setup_ring(struct qat_softc *sc, struct qat_crypto_bank *qcb) { - int error, i, bank; - int curname = 0; char *name; + int bank, curname, error, i, j; bank = qcb->qcb_bank; + curname = 0; name = qcb->qcb_ring_names[curname++]; snprintf(name, QAT_RING_NAME_SIZE, "bank%d sym_tx", bank); @@ -1480,10 +1596,16 @@ qat_crypto_setup_ring(struct qat_softc *sc, struct qat_crypto_bank *qcb) qsc->qsc_self_dma_tag = qdm->qdm_dma_tag; qsc->qsc_bulk_req_params_buf_paddr = qdm->qdm_dma_seg.ds_addr + offsetof(struct qat_sym_cookie, - u.qsc_bulk_cookie.qsbc_req_params_buf); + qsc_bulk_cookie.qsbc_req_params_buf); qsc->qsc_buffer_list_desc_paddr = qdm->qdm_dma_seg.ds_addr + offsetof(struct qat_sym_cookie, qsc_buf_list); + qsc->qsc_obuffer_list_desc_paddr = + qdm->qdm_dma_seg.ds_addr + offsetof(struct qat_sym_cookie, + qsc_obuf_list); + qsc->qsc_obuffer_list_desc_paddr = + qdm->qdm_dma_seg.ds_addr + offsetof(struct qat_sym_cookie, + qsc_obuf_list); qsc->qsc_iv_buf_paddr = qdm->qdm_dma_seg.ds_addr + offsetof(struct qat_sym_cookie, qsc_iv_buf); @@ -1499,24 +1621,25 @@ qat_crypto_setup_ring(struct qat_softc *sc, struct qat_crypto_bank *qcb) qcb->qcb_symck_free[i] = qsc; qcb->qcb_symck_free_count++; - error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - QAT_MAXLEN, /* maxsize */ - QAT_MAXSEG, /* nsegments */ - QAT_MAXLEN, /* maxsegsize */ - BUS_DMA_COHERENT, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &qsc->qsc_buf_dma_tag); - if (error != 0) - return error; - - error = bus_dmamap_create(qsc->qsc_buf_dma_tag, - BUS_DMA_COHERENT, &qsc->qsc_buf_dmamap); - if (error) - return error; + for (j = 0; j < QAT_SYM_DMA_COUNT; j++) { + error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + QAT_MAXLEN, /* maxsize */ + QAT_MAXSEG, /* nsegments */ + QAT_MAXLEN, /* maxsegsize */ + BUS_DMA_COHERENT, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &qsc->qsc_dma[j].qsd_dma_tag); + if (error != 0) + return error; + error = bus_dmamap_create(qsc->qsc_dma[j].qsd_dma_tag, + BUS_DMA_COHERENT, &qsc->qsc_dma[j].qsd_dmamap); + if (error != 0) + return error; + } } return 0; @@ -1534,10 +1657,17 @@ static void qat_crypto_bank_deinit(struct qat_softc *sc, struct qat_crypto_bank *qcb) { struct qat_dmamem *qdm; - int i; + struct qat_sym_cookie *qsc; + int i, j; for (i = 0; i < QAT_NSYMCOOKIE; i++) { qdm = &qcb->qcb_symck_dmamems[i]; + qsc = qcb->qcb_symck_free[i]; + for (j = 0; j < QAT_SYM_DMA_COUNT; j++) { + bus_dmamap_destroy(qsc->qsc_dma[j].qsd_dma_tag, + qsc->qsc_dma[j].qsd_dmamap); + bus_dma_tag_destroy(qsc->qsc_dma[j].qsd_dma_tag); + } qat_free_dmamem(sc, qdm); } qat_free_dmamem(sc, &qcb->qcb_sym_tx->qr_dma); @@ -1653,6 +1783,15 @@ qat_crypto_stop(struct qat_softc *sc) (void)crypto_unregister_all(qcy->qcy_cid); } +static void +qat_crypto_sym_dma_unload(struct qat_sym_cookie *qsc, enum qat_sym_dma i) +{ + bus_dmamap_sync(qsc->qsc_dma[i].qsd_dma_tag, qsc->qsc_dma[i].qsd_dmamap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(qsc->qsc_dma[i].qsd_dma_tag, + qsc->qsc_dma[i].qsd_dmamap); +} + static int qat_crypto_sym_rxintr(struct qat_softc *sc, void *arg, void *msg) { @@ -1669,16 +1808,19 @@ qat_crypto_sym_rxintr(struct qat_softc *sc, void *arg, void *msg) qsc = *(void **)((uintptr_t)msg + sc->sc_hw.qhw_crypto_opaque_offset); - qsbc = &qsc->u.qsc_bulk_cookie; + qsbc = &qsc->qsc_bulk_cookie; qcy = qsbc->qsbc_crypto; qs = qsbc->qsbc_session; crp = qsbc->qsbc_cb_tag; bus_dmamap_sync(qsc->qsc_self_dma_tag, qsc->qsc_self_dmamap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_sync(qsc->qsc_buf_dma_tag, qsc->qsc_buf_dmamap, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(qsc->qsc_buf_dma_tag, qsc->qsc_buf_dmamap); + + if (crp->crp_aad != NULL) + qat_crypto_sym_dma_unload(qsc, QAT_SYM_DMA_AADBUF); + qat_crypto_sym_dma_unload(qsc, QAT_SYM_DMA_BUF); + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) + qat_crypto_sym_dma_unload(qsc, QAT_SYM_DMA_OBUF); error = 0; if ((auth_sz = qs->qs_auth_mlen) != 0) { @@ -1719,6 +1861,10 @@ qat_crypto_sym_rxintr(struct qat_softc *sc, void *arg, void *msg) static int qat_probesession(device_t dev, const struct crypto_session_params *csp) { + if ((csp->csp_flags & ~(CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD)) != + 0) + return EINVAL; + if (csp->csp_cipher_alg == CRYPTO_AES_XTS && qat_lookup(dev)->qatp_chip == QAT_CHIP_C2XXX) { /* @@ -2092,15 +2238,26 @@ qat_process(device_t dev, struct cryptop *crp, int hint) if (error != 0) goto fail2; - qsbc = &qsc->u.qsc_bulk_cookie; + qsbc = &qsc->qsc_bulk_cookie; qsbc->qsbc_crypto = qcy; qsbc->qsbc_session = qs; qsbc->qsbc_cb_tag = crp; sc->sc_hw.qhw_crypto_setup_req_params(qcb, qs, desc, qsc, crp); - bus_dmamap_sync(qsc->qsc_buf_dma_tag, qsc->qsc_buf_dmamap, + if (crp->crp_aad != NULL) { + bus_dmamap_sync(qsc->qsc_dma[QAT_SYM_DMA_AADBUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_AADBUF].qsd_dmamap, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + } + bus_dmamap_sync(qsc->qsc_dma[QAT_SYM_DMA_BUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_BUF].qsd_dmamap, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + bus_dmamap_sync(qsc->qsc_dma[QAT_SYM_DMA_OBUF].qsd_dma_tag, + qsc->qsc_dma[QAT_SYM_DMA_OBUF].qsd_dmamap, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + } bus_dmamap_sync(qsc->qsc_self_dma_tag, qsc->qsc_self_dmamap, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); diff --git a/sys/dev/qat/qat_hw15.c b/sys/dev/qat/qat_hw15.c index 4f823a0a9ae4..aab5be9b647d 100644 --- a/sys/dev/qat/qat_hw15.c +++ b/sys/dev/qat/qat_hw15.c @@ -818,7 +818,7 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_bank *qcb, enum fw_la_cmd_id cmd_id = desc->qcd_cmd_id; enum fw_slice next_slice; - qsbc = &qsc->u.qsc_bulk_cookie; + qsbc = &qsc->qsc_bulk_cookie; bulk_req = (struct fw_la_bulk_req *)qsbc->qsbc_msg; memcpy(bulk_req, &desc->qcd_req_cache, QAT_HW15_SESSION_REQ_CACHE_SIZE); @@ -826,7 +826,13 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_bank *qcb, bulk_req->comn_hdr.comn_req_flags = qat_hw15_get_comn_req_flags(qcb->qcb_bank % 2); bulk_req->comn_mid.src_data_addr = qsc->qsc_buffer_list_desc_paddr; - bulk_req->comn_mid.dest_data_addr = qsc->qsc_buffer_list_desc_paddr; + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + bulk_req->comn_mid.dest_data_addr = + qsc->qsc_obuffer_list_desc_paddr; + } else { + bulk_req->comn_mid.dest_data_addr = + qsc->qsc_buffer_list_desc_paddr; + } bulk_req->req_params_addr = qsc->qsc_bulk_req_params_buf_paddr; bulk_req->comn_ftr.next_request_addr = 0; bulk_req->comn_mid.opaque_data = (uint64_t)(uintptr_t)qsc; @@ -918,8 +924,14 @@ qat_hw15_crypto_setup_req_params(struct qat_crypto_bank *qcb, cipher_req->curr_id = FW_SLICE_CIPHER; cipher_req->next_id = next_slice; - cipher_req->cipher_off = crp->crp_aad_length == 0 ? 0 : - crp->crp_payload_start - crp->crp_aad_start; + if (crp->crp_aad_length == 0) { + cipher_req->cipher_off = 0; + } else if (crp->crp_aad == NULL) { + cipher_req->cipher_off = + crp->crp_payload_start - crp->crp_aad_start; + } else { + cipher_req->cipher_off = crp->crp_aad_length; + } cipher_req->cipher_len = crp->crp_payload_length; cipher_req->state_address = qsc->qsc_iv_buf_paddr; } diff --git a/sys/dev/qat/qat_hw17.c b/sys/dev/qat/qat_hw17.c index 643b624ba840..92f2c1ee251d 100644 --- a/sys/dev/qat/qat_hw17.c +++ b/sys/dev/qat/qat_hw17.c @@ -581,13 +581,19 @@ qat_hw17_crypto_setup_req_params(struct qat_crypto_bank *qcb __unused, uint8_t *req_params_ptr; enum fw_la_cmd_id cmd_id = desc->qcd_cmd_id; - qsbc = &qsc->u.qsc_bulk_cookie; + qsbc = &qsc->qsc_bulk_cookie; bulk_req = (struct fw_la_bulk_req *)qsbc->qsbc_msg; memcpy(bulk_req, desc->qcd_req_cache, sizeof(struct fw_la_bulk_req)); bulk_req->comn_mid.opaque_data = (uint64_t)(uintptr_t)qsc; bulk_req->comn_mid.src_data_addr = qsc->qsc_buffer_list_desc_paddr; - bulk_req->comn_mid.dest_data_addr = qsc->qsc_buffer_list_desc_paddr; + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + bulk_req->comn_mid.dest_data_addr = + qsc->qsc_obuffer_list_desc_paddr; + } else { + bulk_req->comn_mid.dest_data_addr = + qsc->qsc_buffer_list_desc_paddr; + } if (__predict_false(crp->crp_cipher_key != NULL || crp->crp_auth_key != NULL)) qat_hw17_crypto_req_setkey(desc, qs, qsc, bulk_req, crp); @@ -643,9 +649,15 @@ qat_hw17_crypto_setup_req_params(struct qat_crypto_bank *qcb __unused, } } else { if (cmd_id != FW_LA_CMD_AUTH) { - cipher_param->cipher_offset = - crp->crp_aad_length == 0 ? 0 : - crp->crp_payload_start - crp->crp_aad_start; + if (crp->crp_aad_length == 0) { + cipher_param->cipher_offset = 0; + } else if (crp->crp_aad == NULL) { + cipher_param->cipher_offset = + crp->crp_payload_start - crp->crp_aad_start; + } else { + cipher_param->cipher_offset = + crp->crp_aad_length; + } cipher_param->cipher_length = crp->crp_payload_length; } if (cmd_id != FW_LA_CMD_CIPHER) { diff --git a/sys/dev/qat/qatreg.h b/sys/dev/qat/qatreg.h index 2a0be321b4f9..076354fc6108 100644 --- a/sys/dev/qat/qatreg.h +++ b/sys/dev/qat/qatreg.h @@ -1550,10 +1550,13 @@ struct flat_buffer_desc { uint64_t phy_buffer; }; +#define HW_MAXSEG 32 + struct buffer_list_desc { uint64_t resrvd; uint32_t num_buffers; uint32_t reserved; + struct flat_buffer_desc flat_bufs[HW_MAXSEG]; }; /* -------------------------------------------------------------------------- */ diff --git a/sys/dev/qat/qatvar.h b/sys/dev/qat/qatvar.h index 3326dc268fc1..3f0ecd411874 100644 --- a/sys/dev/qat/qatvar.h +++ b/sys/dev/qat/qatvar.h @@ -69,13 +69,11 @@ #define QAT_NSYMREQ 256 #define QAT_NSYMCOOKIE ((QAT_NSYMREQ * 2 + 1) * 2) -#define QAT_NASYMREQ 64 -#define QAT_BATCH_SUBMIT_FREE_SPACE 2 #define QAT_EV_NAME_SIZE 32 #define QAT_RING_NAME_SIZE 32 -#define QAT_MAXSEG 32 /* max segments for sg dma */ +#define QAT_MAXSEG HW_MAXSEG /* max segments for sg dma */ #define QAT_MAXLEN 65535 /* IP_MAXPACKET */ #define QAT_HB_INTERVAL 500 /* heartbeat msec */ @@ -519,7 +517,7 @@ struct qat_sym_hash_def { struct qat_sym_bulk_cookie { uint8_t qsbc_req_params_buf[QAT_SYM_REQ_PARAMS_SIZE_PADDED]; - /* memory block reserved for request params + /* memory block reserved for request params, QAT 1.5 only * NOTE: Field must be correctly aligned in memory for access by QAT * engine */ struct qat_crypto *qsbc_crypto; @@ -539,25 +537,26 @@ struct qat_sym_bulk_cookie { HASH_CONTENT_DESC_SIZE + CIPHER_CONTENT_DESC_SIZE, \ QAT_OPTIMAL_ALIGN) +enum qat_sym_dma { + QAT_SYM_DMA_AADBUF = 0, + QAT_SYM_DMA_BUF, + QAT_SYM_DMA_OBUF, + QAT_SYM_DMA_COUNT, +}; + +struct qat_sym_dmamap { + bus_dmamap_t qsd_dmamap; + bus_dma_tag_t qsd_dma_tag; +}; + struct qat_sym_cookie { - union qat_sym_cookie_u { - /* should be 64byte aligned */ - struct qat_sym_bulk_cookie qsc_bulk_cookie; - /* symmetric bulk cookie */ -#ifdef notyet - struct qat_sym_key_cookie qsc_key_cookie; - /* symmetric key cookie */ - struct qat_sym_nrbg_cookie qsc_nrbg_cookie; - /* symmetric NRBG cookie */ -#endif - } u; + struct qat_sym_bulk_cookie qsc_bulk_cookie; /* should be 64-byte aligned */ struct buffer_list_desc qsc_buf_list; - struct flat_buffer_desc qsc_flat_bufs[QAT_MAXSEG]; /* should be here */ + struct buffer_list_desc qsc_obuf_list; - bus_dmamap_t qsc_self_dmamap; /* self DMA mapping and - end of DMA region */ + bus_dmamap_t qsc_self_dmamap; bus_dma_tag_t qsc_self_dma_tag; uint8_t qsc_iv_buf[EALG_MAX_BLOCK_LEN]; @@ -565,12 +564,11 @@ struct qat_sym_cookie { uint8_t qsc_gcm_aad[QAT_GCM_AAD_SIZE_MAX]; uint8_t qsc_content_desc[CONTENT_DESC_MAX_SIZE]; - bus_dmamap_t qsc_buf_dmamap; /* qsc_flat_bufs DMA mapping */ - bus_dma_tag_t qsc_buf_dma_tag; - void *qsc_buf; + struct qat_sym_dmamap qsc_dma[QAT_SYM_DMA_COUNT]; bus_addr_t qsc_bulk_req_params_buf_paddr; bus_addr_t qsc_buffer_list_desc_paddr; + bus_addr_t qsc_obuffer_list_desc_paddr; bus_addr_t qsc_iv_buf_paddr; bus_addr_t qsc_auth_res_paddr; bus_addr_t qsc_gcm_aad_paddr; @@ -578,7 +576,7 @@ struct qat_sym_cookie { }; CTASSERT(offsetof(struct qat_sym_cookie, - u.qsc_bulk_cookie.qsbc_req_params_buf) % QAT_OPTIMAL_ALIGN == 0); + qsc_bulk_cookie.qsbc_req_params_buf) % QAT_OPTIMAL_ALIGN == 0); CTASSERT(offsetof(struct qat_sym_cookie, qsc_buf_list) % QAT_OPTIMAL_ALIGN == 0); #define MAX_CIPHER_SETUP_BLK_SZ \ @@ -614,7 +612,6 @@ struct qat_crypto_desc { uint8_t qcd_req_cache[QAT_MSG_SIZE_TO_BYTES(QAT_MAX_MSG_SIZE)]; } __aligned(QAT_OPTIMAL_ALIGN); -/* should be aligned to 64bytes */ struct qat_session { struct qat_crypto_desc *qs_dec_desc; /* should be at top of struct*/ /* decrypt or auth then decrypt or auth */ From owner-dev-commits-src-all@freebsd.org Wed Feb 3 15:06: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 C7D45539809; Wed, 3 Feb 2021 15:06: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 4DW4lF5MQrz4jJB; Wed, 3 Feb 2021 15:06: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 AB18723019; Wed, 3 Feb 2021 15:06: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 113F6XTx040780; Wed, 3 Feb 2021 15:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113F6XJV040779; Wed, 3 Feb 2021 15:06:33 GMT (envelope-from git) Date: Wed, 3 Feb 2021 15:06:33 GMT Message-Id: <202102031506.113F6XJV040779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 928d45ccff73 - stable/12 - newvers: tweak uname to be more useful 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 928d45ccff730177581977eafcd1622a1923eb80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 15:06:33 -0000 The branch stable/12 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=928d45ccff730177581977eafcd1622a1923eb80 commit 928d45ccff730177581977eafcd1622a1923eb80 Author: Warner Losh AuthorDate: 2021-01-25 19:53:31 +0000 Commit: Li-Wen Hsu CommitDate: 2021-02-03 15:00:44 +0000 newvers: tweak uname to be more useful The current uname is branch-cXXXX-gHASH Three changes to make uname more useful. 1. Move from using git rev-list --count to git rev-lis --count --first-parent since that gives a better, incrementing number. 2. Report this count as 'nXXXXX' rather than 'cXXXXX' because c is part of a hash and we've changed the sematnics of XXXXX 3. Remove g to make HASH cut and pastable. Durting review, #1 & #3 had the largest consensus. There was a diversity of opinion on #2, but on the whole it was positive so I'll acknowledge the dissent, but move forward with something seems to have support since the dissent was all about what letter to use where I chose 'n'. MFC After: 3 days Reviewed by: rgrimes, emaste (earlier version) Differential Revision: https://reviews.freebsd.org/D28338 (cherry picked from commit 8a51f14a7833fd14e1f125e63a0af9d260dcd287) --- sys/conf/newvers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 48f778ed1223..22ef8dd1ac33 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -211,9 +211,9 @@ fi if [ -n "$git_cmd" ] ; then git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null) - git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) + git_cnt=$($git_cmd rev-list --first-parent --count HEAD 2>/dev/null) if [ -n "$git_cnt" ] ; then - git="c${git_cnt}-g${git}" + git="n${git_cnt}-${git}" fi git_b=$($git_cmd rev-parse --abbrev-ref HEAD) if [ -n "$git_b" -a "$git_b" != "HEAD" ] ; then From owner-dev-commits-src-all@freebsd.org Wed Feb 3 15:06: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 874DB53980F; Wed, 3 Feb 2021 15:06: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 4DW4lR5ntZz4jWw; Wed, 3 Feb 2021 15:06: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 864E022D54; Wed, 3 Feb 2021 15:06: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 113F6fl0040901; Wed, 3 Feb 2021 15:06:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113F6fd3040900; Wed, 3 Feb 2021 15:06:41 GMT (envelope-from git) Date: Wed, 3 Feb 2021 15:06:41 GMT Message-Id: <202102031506.113F6fd3040900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: 3c1d72efd751 - stable/11 - newvers: tweak uname to be more useful 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/stable/11 X-Git-Reftype: branch X-Git-Commit: 3c1d72efd7518bde6d96c6470efc85252fa8e64d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 15:06:44 -0000 The branch stable/11 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=3c1d72efd7518bde6d96c6470efc85252fa8e64d commit 3c1d72efd7518bde6d96c6470efc85252fa8e64d Author: Warner Losh AuthorDate: 2021-01-25 19:53:31 +0000 Commit: Li-Wen Hsu CommitDate: 2021-02-03 15:01:51 +0000 newvers: tweak uname to be more useful The current uname is branch-cXXXX-gHASH Three changes to make uname more useful. 1. Move from using git rev-list --count to git rev-lis --count --first-parent since that gives a better, incrementing number. 2. Report this count as 'nXXXXX' rather than 'cXXXXX' because c is part of a hash and we've changed the sematnics of XXXXX 3. Remove g to make HASH cut and pastable. Durting review, #1 & #3 had the largest consensus. There was a diversity of opinion on #2, but on the whole it was positive so I'll acknowledge the dissent, but move forward with something seems to have support since the dissent was all about what letter to use where I chose 'n'. MFC After: 3 days Reviewed by: rgrimes, emaste (earlier version) Differential Revision: https://reviews.freebsd.org/D28338 (cherry picked from commit 8a51f14a7833fd14e1f125e63a0af9d260dcd287) --- sys/conf/newvers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 9b7a1c19991a..e3c54f1649fb 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -213,9 +213,9 @@ fi if [ -n "$git_cmd" ] ; then git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null) - git_cnt=$($git_cmd rev-list --count HEAD 2>/dev/null) + git_cnt=$($git_cmd rev-list --first-parent --count HEAD 2>/dev/null) if [ -n "$git_cnt" ] ; then - git="c${git_cnt}-g${git}" + git="n${git_cnt}-${git}" fi git_b=$($git_cmd rev-parse --abbrev-ref HEAD) if [ -n "$git_b" -a "$git_b" != "HEAD" ] ; then From owner-dev-commits-src-all@freebsd.org Wed Feb 3 15:07: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 DAA2A53988A; Wed, 3 Feb 2021 15:07: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 4DW4lp5vcjz4jb1; Wed, 3 Feb 2021 15:07: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 BDA7A2319F; Wed, 3 Feb 2021 15:07: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 113F720n041057; Wed, 3 Feb 2021 15:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113F72J3041056; Wed, 3 Feb 2021 15:07:02 GMT (envelope-from git) Date: Wed, 3 Feb 2021 15:07:02 GMT Message-Id: <202102031507.113F72J3041056@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: c1b1354789bb - main - wg(4): Add authors of the wg(4) driver to 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: c1b1354789bb15713944f9e6941266de4cb47772 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 15:07:02 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c1b1354789bb15713944f9e6941266de4cb47772 commit c1b1354789bb15713944f9e6941266de4cb47772 Author: Gordon Bergling AuthorDate: 2021-02-03 15:01:32 +0000 Commit: Gordon Bergling CommitDate: 2021-02-03 15:01:32 +0000 wg(4): Add authors of the wg(4) driver to the manual page Glen (@gjb) noticed that I am haven't mentioned the authors of the WireGuard device driver in the manual page. This is commit addressed this commit. Reviewed by: gjb, brueffer Differential Revision: https://reviews.freebsd.org/D28464 X-MFC-with: e59d9cb412846cb5d2bc4c641d3cc44d243cd52d --- share/man/man4/wg.4 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/share/man/man4/wg.4 b/share/man/man4/wg.4 index 096aee50148a..2a13b98f45e9 100644 --- a/share/man/man4/wg.4 +++ b/share/man/man4/wg.4 @@ -236,9 +236,20 @@ The device driver first appeared in .Fx 13.0 . .Sh AUTHORS +The +.Nm +device driver was originally written for +.Ox +by +.An Matt Dunwoodie Aq Mt ncon@nconroy.net +and ported to +.Fx +by +.An Matt Macy Aq Mt mmacy@FreeBSD.org . +.Pp This manual page was written by .An Gordon Bergling Aq Mt gbe@FreeBSD.org and is based on the .Ox -counterpart written by +manual page written by .An David Gwynne Aq Mt dlg@openbsd.org . From owner-dev-commits-src-all@freebsd.org Wed Feb 3 15: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 AE5E953A206; Wed, 3 Feb 2021 15: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 4DW5Cd4q3sz4kyq; Wed, 3 Feb 2021 15:27: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 77AF822FE5; Wed, 3 Feb 2021 15:27: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 113FRf71067435; Wed, 3 Feb 2021 15:27:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113FRfnj067433; Wed, 3 Feb 2021 15:27:41 GMT (envelope-from git) Date: Wed, 3 Feb 2021 15:27:41 GMT Message-Id: <202102031527.113FRfnj067433@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: 65618fdda0f2 - main - arm64: Initialize VFP control register. 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: 65618fdda0f272a823e6701966421bdca0efa301 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 15:27:43 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=65618fdda0f272a823e6701966421bdca0efa301 commit 65618fdda0f272a823e6701966421bdca0efa301 Author: Michal Meloun AuthorDate: 2021-01-23 20:19:07 +0000 Commit: Michal Meloun CommitDate: 2021-02-03 15:27:30 +0000 arm64: Initialize VFP control register. The RW fields in this register reset to architecturally unknown values, so initialize these to the proper rounding and denormal mode. MFC after: 1 week --- sys/arm64/arm64/vfp.c | 4 ++++ sys/arm64/arm64/vm_machdep.c | 3 +++ sys/arm64/include/md_var.h | 2 ++ sys/arm64/include/vfp.h | 23 +++++++++++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index 51fba7a8a300..62244ddc80e8 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -238,6 +239,9 @@ vfp_init(void) /* Disable to be enabled when it's used */ vfp_disable(); + + if (PCPU_GET(cpuid) == 0) + thread0.td_pcb->pcb_fpusaved->vfp_fpcr = initial_fpcr; } SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, vfp_init, NULL); diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index 90d628a7d6ee..9e9b588c7db1 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #endif +uint32_t initial_fpcr = VFPCR_DN | VFPCR_FZ; + #include /* @@ -106,6 +108,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) td2->td_pcb->pcb_sp = (uintptr_t)td2->td_frame; td2->td_pcb->pcb_fpusaved = &td2->td_pcb->pcb_fpustate; td2->td_pcb->pcb_vfpcpu = UINT_MAX; + td2->td_pcb->pcb_fpusaved->vfp_fpcr = initial_fpcr; /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; diff --git a/sys/arm64/include/md_var.h b/sys/arm64/include/md_var.h index 0132ab0dd8fd..73cf642148b5 100644 --- a/sys/arm64/include/md_var.h +++ b/sys/arm64/include/md_var.h @@ -54,4 +54,6 @@ void generic_bs_poke_2(void) __asm(__STRING(generic_bs_poke_2)); void generic_bs_poke_4(void) __asm(__STRING(generic_bs_poke_4)); void generic_bs_poke_8(void) __asm(__STRING(generic_bs_poke_8)); +extern uint32_t initial_fpcr; + #endif /* !_MACHINE_MD_VAR_H_ */ diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h index b4b9bb524d30..b0ba01a2a319 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -32,6 +32,29 @@ #ifndef _MACHINE_VFP_H_ #define _MACHINE_VFP_H_ +/* VFPCR */ +#define VFPCR_AHP (0x04000000) /* alt. half-precision: */ +#define VFPCR_DN (0x02000000) /* default NaN enable */ +#define VFPCR_FZ (0x01000000) /* flush to zero enabled */ + +#define VFPCR_RMODE_OFF 22 /* rounding mode offset */ +#define VFPCR_RMODE_MASK (0x00c00000) /* rounding mode mask */ +#define VFPCR_RMODE_RN (0x00000000) /* round nearest */ +#define VFPCR_RMODE_RPI (0x00400000) /* round to plus infinity */ +#define VFPCR_RMODE_RNI (0x00800000) /* round to neg infinity */ +#define VFPCR_RMODE_RM (0x00c00000) /* round to zero */ + +#define VFPCR_STRIDE_OFF 20 /* vector stride -1 */ +#define VFPCR_STRIDE_MASK (0x00300000) +#define VFPCR_LEN_OFF 16 /* vector length -1 */ +#define VFPCR_LEN_MASK (0x00070000) +#define VFPCR_IDE (0x00008000) /* input subnormal exc enable */ +#define VFPCR_IXE (0x00001000) /* inexact exception enable */ +#define VFPCR_UFE (0x00000800) /* underflow exception enable */ +#define VFPCR_OFE (0x00000400) /* overflow exception enable */ +#define VFPCR_DZE (0x00000200) /* div by zero exception en */ +#define VFPCR_IOE (0x00000100) /* invalid op exec enable */ + #ifndef LOCORE struct vfpstate { __uint128_t vfp_regs[32]; From owner-dev-commits-src-all@freebsd.org Wed Feb 3 15:54: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 1D5EB53AB53; Wed, 3 Feb 2021 15:54:04 +0000 (UTC) (envelope-from madpilot@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 4DW5p40HKwz4nGM; Wed, 3 Feb 2021 15:54:04 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from marvin.madpilot.net (host-79-12-130-69.retail.telecomitalia.it [79.12.130.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 42DDA354EC; Wed, 3 Feb 2021 15:54:03 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Subject: Re: git: aa906e2a4957 - main - OpenSSL: Support for kernel TLS offload (KTLS) To: John Baldwin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Benjamin Kaduk References: <202101281825.10SIPTGJ021104@gitrepo.freebsd.org> <8257bc17-3a2d-f348-a0d5-fbd0f637629f@FreeBSD.org> <1675730b-f559-a732-be49-d89c97a376f8@FreeBSD.org> From: Guido Falsi Message-ID: <20cd3a96-0666-55f7-b389-5e9a7b2fa933@FreeBSD.org> Date: Wed, 3 Feb 2021 16:54:00 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <1675730b-f559-a732-be49-d89c97a376f8@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 15:54:04 -0000 On 03/02/21 01:47, John Baldwin wrote: > On 1/31/21 10:41 AM, Guido Falsi wrote: >> On 28/01/21 19:25, John Baldwin wrote: >>> The branch main has been updated by jhb: >>> >>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=aa906e2a4957db700d9e6cc60857e1afe1aecc85 >>> >>> >>> commit aa906e2a4957db700d9e6cc60857e1afe1aecc85 >>> Author:     John Baldwin >>> AuthorDate: 2021-01-16 00:17:31 +0000 >>> Commit:     John Baldwin >>> CommitDate: 2021-01-28 18:24:13 +0000 >>> >>>       OpenSSL: Support for kernel TLS offload (KTLS) >>>       This merges upstream patches from OpenSSL's master branch to add >>>       KTLS infrastructure for TLS 1.0-1.3 including both RX and TX >>>       offload and SSL_sendfile support on both Linux and FreeBSD. >>>       Note that TLS 1.3 only supports TX offload. >>>       A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built >>> with >>>       KTLS support.  It defaults to enabled on amd64 and disabled on all >>>       other architectures. >>>       Reviewed by:    jkim (earlier version) >>>       Approved by:    secteam >>>       Obtained from:  OpenSSL (patches from master) >>>       MFC after:      1 week >>>       Relnotes:       yes >>>       Sponsored by:   Netflix >>>       Differential Revision:  https://reviews.freebsd.org/D28273 >>> --- >> >> This commit causes a strange interaction/regression with subverison >> client when using https protocol. >> >> I filed a bug report about this: >> >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253135 >> >> Workarounds: >> >> - Compiling system defining WITHOUT_OPENSSL_KTLS >> - using the svn:// scheme > > I'm still waiting for a build to finish so I can test it, but I believe > this is a bug in serf.  This is the patch I'm going to test: > > diff --git a/contrib/serf/buckets/ssl_buckets.c > b/contrib/serf/buckets/ssl_buckets.c > index b01e5359db08..3c8b7e2a685f 100644 > --- a/contrib/serf/buckets/ssl_buckets.c > +++ b/contrib/serf/buckets/ssl_buckets.c > @@ -407,7 +407,7 @@ static int bio_bucket_destroy(BIO *bio) > >  static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) >  { > -    long ret = 1; > +    long ret = 0; > >      switch (cmd) { >      default: > @@ -415,6 +415,7 @@ static long bio_bucket_ctrl(BIO *bio, int cmd, long > num, void *ptr) >          break; >      case BIO_CTRL_FLUSH: >          /* At this point we can't force a flush. */ > +        ret = 1; >          break; >      case BIO_CTRL_PUSH: >      case BIO_CTRL_POP: > > serf defines its own custom OpenSSL BIO classes, and the BIO_ctrl(3) > manpage documents that the control methods of custom BIOs are supposed > to return 0 for unknown or unsupported requests: > >        Source/sink BIOs return an 0 if they do not recognize the > BIO_ctrl() >        operation. > > However, the custom BIOs in serf broke this rule and returned 1 for > unknown operations instead.  OpenSSL uses BIO_ctrl methods to determine > if a given BIO for a read or write side of an SSL connection is using > KTLS.  Because of the serf bug, this caused OpenSSL to believe that > these BIOs were using KTLS when they in fact were not.  serf will also > probably break with OpenSSL 3.0 even without KTLS due to the recently > added control for determining if a BIO has hit EOF which also returns > 1 to indicate it has hit EOF. > Thanks for the feedback. I have tested this patch. After reinstalling the system, from newly compiled sources. svnlite from base works fine now. svn from the package and also rebuilt from port fails. I guess ports provided serf library also has this bug, so we should fix it there too. -- Guido Falsi From owner-dev-commits-src-all@freebsd.org Wed Feb 3 16:04: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 A78A753B426; Wed, 3 Feb 2021 16:04: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 4DW6224JR2z4pBy; Wed, 3 Feb 2021 16:04: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 7F20923BAD; Wed, 3 Feb 2021 16:04: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 113G4QPH018997; Wed, 3 Feb 2021 16:04:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113G4QDm018996; Wed, 3 Feb 2021 16:04:26 GMT (envelope-from git) Date: Wed, 3 Feb 2021 16:04:26 GMT Message-Id: <202102031604.113G4QDm018996@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: 2a39919364b5 - main - readelf: Fix printing NT_FREEBSD_ARCH_TAG 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: 2a39919364b5368e026f656ff41861a3fdd56110 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:04:26 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=2a39919364b5368e026f656ff41861a3fdd56110 commit 2a39919364b5368e026f656ff41861a3fdd56110 Author: Alex Richardson AuthorDate: 2021-02-03 15:24:28 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 15:44:39 +0000 readelf: Fix printing NT_FREEBSD_ARCH_TAG Looking at lib/csu/arm/crt1_s.S, this should be a string and therefore the restriction to 4 characters seems wrong. Found whle updating https://reviews.llvm.org/D74393. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D28470 --- contrib/elftoolchain/readelf/readelf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 88d87f96bb72..0964f3529d1b 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -3741,9 +3741,7 @@ dump_notes_data(struct readelf *re, const char *name, uint32_t type, return; /* NT_FREEBSD_NOINIT_TAG carries no data, treat as unknown. */ case NT_FREEBSD_ARCH_TAG: - if (sz != 4) - goto unknown; - printf(" Arch tag: %x\n", ubuf[0]); + printf(" Arch tag: %s\n", buf); return; case NT_FREEBSD_FEATURE_CTL: if (sz != 4) From owner-dev-commits-src-all@freebsd.org Wed Feb 3 16:04: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 AA4A553B069; Wed, 3 Feb 2021 16:04: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 4DW6234Rb3z4pFX; Wed, 3 Feb 2021 16:04: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 8B64923E85; Wed, 3 Feb 2021 16:04: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 113G4RqL019019; Wed, 3 Feb 2021 16:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113G4Rs1019018; Wed, 3 Feb 2021 16:04:27 GMT (envelope-from git) Date: Wed, 3 Feb 2021 16:04:27 GMT Message-Id: <202102031604.113G4Rs1019018@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: 7791ecf04b48 - main - usr.sbin/praudit: Fix tests after 5619d49e07 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: 7791ecf04b48a0c365b003447f479ec890115dfc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:04:27 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=7791ecf04b48a0c365b003447f479ec890115dfc commit 7791ecf04b48a0c365b003447f479ec890115dfc Author: Alex Richardson AuthorDate: 2021-02-03 15:26:19 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 16:02:46 +0000 usr.sbin/praudit: Fix tests after 5619d49e07 Commit 5619d49e07 made the getgrgid() call inside bsm work as intended so we now print "wheel" instead of a numeric 0 in the rgid field. Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D28462 --- usr.sbin/praudit/tests/input/del_comma | 2 +- usr.sbin/praudit/tests/input/del_underscore | 2 +- usr.sbin/praudit/tests/input/no_args | 2 +- usr.sbin/praudit/tests/input/numeric_form | 2 +- usr.sbin/praudit/tests/input/same_line | 2 +- usr.sbin/praudit/tests/input/short_form | 2 +- usr.sbin/praudit/tests/input/xml_form | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/praudit/tests/input/del_comma b/usr.sbin/praudit/tests/input/del_comma index 3dbec7bd2c5d..09f089450ac3 100644 --- a/usr.sbin/praudit/tests/input/del_comma +++ b/usr.sbin/praudit/tests/input/del_comma @@ -2,6 +2,6 @@ header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec argument,1,0x1c,domain argument,2,0x2,type argument,3,0x0,protocol -subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2 return,success,3 trailer,113 diff --git a/usr.sbin/praudit/tests/input/del_underscore b/usr.sbin/praudit/tests/input/del_underscore index ca515ed49ef3..cfc7d4a932f0 100644 --- a/usr.sbin/praudit/tests/input/del_underscore +++ b/usr.sbin/praudit/tests/input/del_underscore @@ -2,6 +2,6 @@ header_113_11_socket(2)_0_Mon Jun 11 10:18:45 2018_ + 380 msec argument_1_0x1c_domain argument_2_0x2_type argument_3_0x0_protocol -subject_root_root_wheel_root_0_7053_4724_37636_10.0.2.2 +subject_root_root_wheel_root_wheel_7053_4724_37636_10.0.2.2 return_success_3 trailer_113 diff --git a/usr.sbin/praudit/tests/input/no_args b/usr.sbin/praudit/tests/input/no_args index 3dbec7bd2c5d..09f089450ac3 100644 --- a/usr.sbin/praudit/tests/input/no_args +++ b/usr.sbin/praudit/tests/input/no_args @@ -2,6 +2,6 @@ header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec argument,1,0x1c,domain argument,2,0x2,type argument,3,0x0,protocol -subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2 return,success,3 trailer,113 diff --git a/usr.sbin/praudit/tests/input/numeric_form b/usr.sbin/praudit/tests/input/numeric_form index 3dbec7bd2c5d..09f089450ac3 100644 --- a/usr.sbin/praudit/tests/input/numeric_form +++ b/usr.sbin/praudit/tests/input/numeric_form @@ -2,6 +2,6 @@ header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec argument,1,0x1c,domain argument,2,0x2,type argument,3,0x0,protocol -subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2 return,success,3 trailer,113 diff --git a/usr.sbin/praudit/tests/input/same_line b/usr.sbin/praudit/tests/input/same_line index 7662c3c6ed37..5a8f19d8901f 100644 --- a/usr.sbin/praudit/tests/input/same_line +++ b/usr.sbin/praudit/tests/input/same_line @@ -1 +1 @@ -header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec,argument,1,0x1c,domain,argument,2,0x2,type,argument,3,0x0,protocol,subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2,return,success,3,trailer,113, +header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec,argument,1,0x1c,domain,argument,2,0x2,type,argument,3,0x0,protocol,subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2,return,success,3,trailer,113, diff --git a/usr.sbin/praudit/tests/input/short_form b/usr.sbin/praudit/tests/input/short_form index cc1a705940bb..8e5751fd9efe 100644 --- a/usr.sbin/praudit/tests/input/short_form +++ b/usr.sbin/praudit/tests/input/short_form @@ -2,6 +2,6 @@ header,113,11,AUE_SOCKET,0,Mon Jun 11 10:18:45 2018, + 380 msec argument,1,0x1c,domain argument,2,0x2,type argument,3,0x0,protocol -subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2 return,success,3 trailer,113 diff --git a/usr.sbin/praudit/tests/input/xml_form b/usr.sbin/praudit/tests/input/xml_form index e49b00c028da..d19adeed2b3f 100644 --- a/usr.sbin/praudit/tests/input/xml_form +++ b/usr.sbin/praudit/tests/input/xml_form @@ -4,7 +4,7 @@ - + From owner-dev-commits-src-all@freebsd.org Wed Feb 3 16:04: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 570CF53B353; Wed, 3 Feb 2021 16:04: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 4DW6245jNsz4nwN; Wed, 3 Feb 2021 16:04: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 A5A5D23E86; Wed, 3 Feb 2021 16:04: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 113G4SYR019038; Wed, 3 Feb 2021 16:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113G4SQq019037; Wed, 3 Feb 2021 16:04:28 GMT (envelope-from git) Date: Wed, 3 Feb 2021 16:04:28 GMT Message-Id: <202102031604.113G4SQq019037@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: 8fa6abb6f4f6 - main - Expose clang's alignment builtins and use them for roundup2/rounddown2 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: 8fa6abb6f4f64f4f23e2920e2aea7996566851a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:04:32 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=8fa6abb6f4f64f4f23e2920e2aea7996566851a4 commit 8fa6abb6f4f64f4f23e2920e2aea7996566851a4 Author: Alex Richardson AuthorDate: 2021-02-03 15:27:17 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 16:02:54 +0000 Expose clang's alignment builtins and use them for roundup2/rounddown2 This makes roundup2/rounddown2 type- and const-preserving and allows using it on pointer types without casting to uintptr_t first. Not performing pointer-to-integer conversions also helps the compiler's optimization passes and can therefore result in better code generation. When using it with integer values there should be no change other than the compiler checking that the alignment value is a valid power-of-two. I originally implemented these builtins for CHERI a few years ago and they have been very useful for CheriBSD. However, they are also useful for non-CHERI code so I was able to upstream them for Clang 10.0. Rationale from the clang documentation: Clang provides builtins to support checking and adjusting alignment of pointers and integers. These builtins can be used to avoid relying on implementation-defined behavior of arithmetic on integers derived from pointers. Additionally, these builtins retain type information and, unlike bitwise arithmetic, they can perform semantic checking on the alignment value. There is also a feature request for GCC, so GCC may also support it in the future: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 Reviewed By: brooks, jhb, imp Differential Revision: https://reviews.freebsd.org/D28332 --- sys/sys/cdefs.h | 19 +++++++++++++++++++ sys/sys/param.h | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 75bedd4b8128..72ef942084f2 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -884,4 +884,23 @@ #define __guarded_by(x) __lock_annotate(guarded_by(x)) #define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x)) +/* Alignment builtins for better type checking and improved code generation. */ +/* Provide fallback versions for other compilers (GCC/Clang < 10): */ +#if !__has_builtin(__builtin_is_aligned) +#define __builtin_is_aligned(x, align) \ + (((__uintptr_t)x & ((align) - 1)) == 0) +#endif +#if !__has_builtin(__builtin_align_up) +#define __builtin_align_up(x, align) \ + ((__typeof__(x))(((__uintptr_t)(x)+((align)-1))&(~((align)-1)))) +#endif +#if !__has_builtin(__builtin_align_down) +#define __builtin_align_down(x, align) \ + ((__typeof__(x))((x)&(~((align)-1)))) +#endif + +#define __align_up(x, y) __builtin_align_up(x, y) +#define __align_down(x, y) __builtin_align_down(x, y) +#define __is_aligned(x, y) __builtin_is_aligned(x, y) + #endif /* !_SYS_CDEFS_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index 079357a19d47..d6f1eb21dcd2 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -305,9 +305,9 @@ #endif #define nitems(x) (sizeof((x)) / sizeof((x)[0])) #define rounddown(x, y) (((x)/(y))*(y)) -#define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power of two */ +#define rounddown2(x, y) __align_down(x, y) /* if y is power of two */ #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ -#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ +#define roundup2(x, y) __align_up(x, y) /* if y is powers of two */ #define powerof2(x) ((((x)-1)&(x))==0) /* Macros for min/max. */ From owner-dev-commits-src-all@freebsd.org Wed Feb 3 16:23: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 0DE5653BC54; Wed, 3 Feb 2021 16:23: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 4DW6SB6zzxz4qNh; Wed, 3 Feb 2021 16:23: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 E2C9C24203; Wed, 3 Feb 2021 16:23: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 113GNcvU044702; Wed, 3 Feb 2021 16:23:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113GNckF044701; Wed, 3 Feb 2021 16:23:38 GMT (envelope-from git) Date: Wed, 3 Feb 2021 16:23:38 GMT Message-Id: <202102031623.113GNckF044701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Cochard Subject: git: b67df8d7c203 - main - diff: Use unprivileged_user with report_identical test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olivier X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b67df8d7c203a139b5afbe72e1947fbb8c32dc73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:23:39 -0000 The branch main has been updated by olivier (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b67df8d7c203a139b5afbe72e1947fbb8c32dc73 commit b67df8d7c203a139b5afbe72e1947fbb8c32dc73 Author: Olivier Cochard AuthorDate: 2021-02-03 16:18:59 +0000 Commit: Olivier Cochard CommitDate: 2021-02-03 16:18:59 +0000 diff: Use unprivileged_user with report_identical test Approved by: bapt Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28466 --- usr.bin/diff/tests/diff_test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh index 60b56f0d9067..b9d1698d982e 100755 --- a/usr.bin/diff/tests/diff_test.sh +++ b/usr.bin/diff/tests/diff_test.sh @@ -228,13 +228,18 @@ label_body() -s exit:1 diff --label hello --label world `which diff` `which ls` } +report_identical_head() +{ + atf_set "require.config" unprivileged_user +} report_identical_body() { + UNPRIVILEGED_USER=$(atf_config_get unprivileged_user) printf "\tA\n" > A printf "\tB\n" > B chmod -r B atf_check -s exit:2 -e inline:"diff: B: Permission denied\n" \ - -o empty diff -s A B + -o empty su -m "$UNPRIVILEGED_USER" -c 'diff -s A B' } non_regular_file_body() From owner-dev-commits-src-all@freebsd.org Wed Feb 3 17:06: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 4D33553CF76; Wed, 3 Feb 2021 17:06: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 4DW7Px1Tcwz4vJb; Wed, 3 Feb 2021 17:06: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 259ED24A99; Wed, 3 Feb 2021 17:06: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 113H6iEI097360; Wed, 3 Feb 2021 17:06:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113H6i4A097359; Wed, 3 Feb 2021 17:06:44 GMT (envelope-from git) Date: Wed, 3 Feb 2021 17:06:44 GMT Message-Id: <202102031706.113H6i4A097359@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: 39a1f858ad73 - main - du_test: Skip three tests if sparse files are not supported 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: 39a1f858ad735ef816a9b1fb7eeade2c6802eb98 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 17:06:45 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=39a1f858ad735ef816a9b1fb7eeade2c6802eb98 commit 39a1f858ad735ef816a9b1fb7eeade2c6802eb98 Author: Alex Richardson AuthorDate: 2021-02-03 16:07:05 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 17:06:07 +0000 du_test: Skip three tests if sparse files are not supported This fixes running the du tests with /tmp as tmpfs (which is what we do in the CheriBSD CI). Obtained from: CheriBSD Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28398 --- usr.bin/du/tests/du_test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh index 1c283b58fef4..5106307ad66a 100755 --- a/usr.bin/du/tests/du_test.sh +++ b/usr.bin/du/tests/du_test.sh @@ -24,6 +24,17 @@ # # $FreeBSD$ +require_sparse_file_support() +{ + if ! getconf MIN_HOLE_SIZE "$(pwd)"; then + echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files " \ + "probably not supported by file system" + mount + atf_skip "Test's work directory does not support sparse files;" \ + "try with a different TMPDIR?" + fi +} + atf_test_case A_flag A_flag_head() { @@ -31,6 +42,7 @@ A_flag_head() } A_flag_body() { + require_sparse_file_support # XXX: compressed volumes? atf_check truncate -s 10g sparse.file atf_check -o inline:'1\tsparse.file\n' du -g sparse.file @@ -103,6 +115,7 @@ g_flag_head() } g_flag_body() { + require_sparse_file_support atf_check truncate -s 1k A atf_check truncate -s 1m B atf_check truncate -s 1g C @@ -117,6 +130,7 @@ h_flag_head() } h_flag_body() { + require_sparse_file_support atf_check truncate -s 1k A atf_check truncate -s 1m B atf_check truncate -s 1g C From owner-dev-commits-src-all@freebsd.org Wed Feb 3 17:06: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 4F74F53D1A5; Wed, 3 Feb 2021 17:06: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 4DW7Py1rXyz4vJc; Wed, 3 Feb 2021 17:06: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 30E9C24845; Wed, 3 Feb 2021 17:06: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 113H6kM6097379; Wed, 3 Feb 2021 17: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 113H6kT7097378; Wed, 3 Feb 2021 17:06:46 GMT (envelope-from git) Date: Wed, 3 Feb 2021 17:06:46 GMT Message-Id: <202102031706.113H6kT7097378@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: 43e083be8103 - main - tools/build/make.py: -DNO_CLEAN -> -DWITHOUT_CLEAN 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: 43e083be8103685e65582e002d33e861f7d5c794 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 17:06:46 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=43e083be8103685e65582e002d33e861f7d5c794 commit 43e083be8103685e65582e002d33e861f7d5c794 Author: Alex Richardson AuthorDate: 2021-02-03 15:56:03 +0000 Commit: Alex Richardson CommitDate: 2021-02-03 17:06:07 +0000 tools/build/make.py: -DNO_CLEAN -> -DWITHOUT_CLEAN --- tools/build/make.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/build/make.py b/tools/build/make.py index 146d4a7b6d47..e692fef11e05 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -154,10 +154,10 @@ if __name__ == "__main__": help="Print information on inferred env vars") parser.add_argument("--clean", action="store_true", help="Do a clean rebuild instead of building with " - "-DNO_CLEAN") + "-DWITHOUT_CLEAN") parser.add_argument("--no-clean", action="store_false", dest="clean", help="Do a clean rebuild instead of building with " - "-DNO_CLEAN") + "-DWITHOUT_CLEAN") try: import argcomplete # bash completion: @@ -250,10 +250,10 @@ if __name__ == "__main__": and not is_make_var_set("WITHOUT_CLEAN")): # Avoid accidentally deleting all of the build tree and wasting lots of # time cleaning directories instead of just doing a rm -rf ${.OBJDIR} - want_clean = input("You did not set -DNO_CLEAN/--clean/--no-clean." - " Did you really mean to do a clean build? y/[N] ") + want_clean = input("You did not set -DWITHOUT_CLEAN/--clean/--no-clean." + " Did you really mean to do a clean build? y/[N] ") if not want_clean.lower().startswith("y"): - bmake_args.append("-DNO_CLEAN") + bmake_args.append("-DWITHOUT_CLEAN") env_cmd_str = " ".join( shlex.quote(k + "=" + v) for k, v in new_env_vars.items()) From owner-dev-commits-src-all@freebsd.org Wed Feb 3 19:08: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 24D9F52806D; Wed, 3 Feb 2021 19:08: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 4DWB6l0Xkgz3LLX; Wed, 3 Feb 2021 19: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 05622261BA; Wed, 3 Feb 2021 19:08: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 113J8kYs053715; Wed, 3 Feb 2021 19: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 113J8kG1053714; Wed, 3 Feb 2021 19:08:46 GMT (envelope-from git) Date: Wed, 3 Feb 2021 19:08:46 GMT Message-Id: <202102031908.113J8kG1053714@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: ae71b794cbed - main - linux: make timerfd_settime(2) set expirations count to zero 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: ae71b794cbed19e5e25effc3438720ad452ab87c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:08:47 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=ae71b794cbed19e5e25effc3438720ad452ab87c commit ae71b794cbed19e5e25effc3438720ad452ab87c Author: shu AuthorDate: 2021-02-03 16:51:45 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-03 19:08:40 +0000 linux: make timerfd_settime(2) set expirations count to zero On Linux, read(2) from a timerfd file descriptor returns an unsigned 8-byte integer (uint64_t) containing the number of expirations that have occurred, if the timer has already expired one or more times since its settings were last modified using timerfd_settime(), or since the last successful read(2). That's to say, once we do a read or call timerfd_settime(), timer fd's expiration count should be zero. Some Linux applications create timerfd and add it to epoll with LT mode, when event comes, they do timerfd_settime instead of read to stop event source from trigger. On FreeBSD, timerfd_settime(2) didn't set the count to zero, which caused high CPU utilization. Submitted by: ankohuu_outlook.com (Shunchao Hu) Differential Revision: https://reviews.freebsd.org/D28231 --- sys/compat/linux/linux_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index dfb4588392cc..54f6b083adf3 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -981,6 +981,7 @@ linux_timerfd_settime(struct thread *td, struct linux_timerfd_settime_args *args linux_timerfd_curval(tfd, &ots); tfd->tfd_time = nts; + tfd->tfd_count = 0; if (timespecisset(&nts.it_value)) { linux_timerfd_clocktime(tfd, &cts); ts = nts.it_value; From owner-dev-commits-src-all@freebsd.org Wed Feb 3 19:39: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 B024052912B; Wed, 3 Feb 2021 19:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWBnx4chlz3N7s; Wed, 3 Feb 2021 19:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91CB8262F0; Wed, 3 Feb 2021 19:39:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113JdHkL093083; Wed, 3 Feb 2021 19:39:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113JdHI8093082; Wed, 3 Feb 2021 19:39:17 GMT (envelope-from git) Date: Wed, 3 Feb 2021 19:39:17 GMT Message-Id: <202102031939.113JdHI8093082@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: 33f0540b13d9 - main - Revert "Reimplement strlen" 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: 33f0540b13d949c7cc226a79927ddc2062ff98bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:39:17 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=33f0540b13d949c7cc226a79927ddc2062ff98bf commit 33f0540b13d949c7cc226a79927ddc2062ff98bf Author: Mateusz Guzik AuthorDate: 2021-02-03 19:38:10 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-03 19:38:10 +0000 Revert "Reimplement strlen" This reverts commit 710e45c4b8539d028877769f1a4ec088c48fb5f1. It breaks for some corner cases on big endian ppc64. Given the stage of the release process it is best to revert for now. Reported by: jhibbits --- lib/libc/string/strlen.c | 82 +++++++++++++++++++++++++++++++----------------- sys/libkern/strlen.c | 79 +++++++++++++++++++++++++++++++--------------- 2 files changed, 108 insertions(+), 53 deletions(-) diff --git a/lib/libc/string/strlen.c b/lib/libc/string/strlen.c index 0bdc81d7bb9a..a862ffc245ca 100644 --- a/lib/libc/string/strlen.c +++ b/lib/libc/string/strlen.c @@ -35,6 +35,10 @@ __FBSDID("$FreeBSD$"); /* * Portable strlen() for 32-bit and 64-bit systems. * + * Rationale: it is generally much more efficient to do word length + * operations and avoid branches on modern computer systems, as + * compared to byte-length operations with a lot of branches. + * * The expression: * * ((x - 0x01....01) & ~x & 0x80....80) @@ -42,13 +46,18 @@ __FBSDID("$FreeBSD$"); * would evaluate to a non-zero value iff any of the bytes in the * original word is zero. * + * On multi-issue processors, we can divide the above expression into: + * a) (x - 0x01....01) + * b) (~x & 0x80....80) + * c) a & b + * + * Where, a) and b) can be partially computed in parallel. + * * The algorithm above is found on "Hacker's Delight" by * Henry S. Warren, Jr. - * - * Note: this leaves performance on the table and each architecture - * would be best served with a tailor made routine instead. */ +/* Magic numbers for the algorithm */ #if LONG_BIT == 32 static const unsigned long mask01 = 0x01010101; static const unsigned long mask80 = 0x80808080; @@ -61,45 +70,62 @@ static const unsigned long mask80 = 0x8080808080808080; #define LONGPTR_MASK (sizeof(long) - 1) -#if BYTE_ORDER == LITTLE_ENDIAN -#define FINDZERO __builtin_ctzl -#else -#define FINDZERO __builtin_clzl -#endif +/* + * Helper macro to return string length if we caught the zero + * byte. + */ +#define testbyte(x) \ + do { \ + if (p[x] == '\0') \ + return (p - str + x); \ + } while (0) size_t strlen(const char *str) { + const char *p; const unsigned long *lp; - unsigned long mask; long va, vb; - long val; - lp = (unsigned long *) (uintptr_t) str; - if ((uintptr_t)lp & LONGPTR_MASK) { - lp = (__typeof(lp)) ((uintptr_t)lp & ~LONGPTR_MASK); -#if BYTE_ORDER == LITTLE_ENDIAN - mask = ~(~0UL << (((uintptr_t)str & LONGPTR_MASK) << 3)); -#else - mask = ~(~0UL >> (((uintptr_t)str & LONGPTR_MASK) << 3)); -#endif - val = *lp | mask; - va = (val - mask01); - vb = ((~val) & mask80); - if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); - } - lp++; - } + /* + * Before trying the hard (unaligned byte-by-byte access) way + * to figure out whether there is a nul character, try to see + * if there is a nul character is within this accessible word + * first. + * + * p and (p & ~LONGPTR_MASK) must be equally accessible since + * they always fall in the same memory page, as long as page + * boundaries is integral multiple of word size. + */ + lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK); + va = (*lp - mask01); + vb = ((~*lp) & mask80); + lp++; + if (va & vb) + /* Check if we have \0 in the first part */ + for (p = str; p < (const char *)lp; p++) + if (*p == '\0') + return (p - str); + /* Scan the rest of the string using word sized operation */ for (; ; lp++) { va = (*lp - mask01); vb = ((~*lp) & mask80); if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); + p = (const char *)(lp); + testbyte(0); + testbyte(1); + testbyte(2); + testbyte(3); +#if (LONG_BIT >= 64) + testbyte(4); + testbyte(5); + testbyte(6); + testbyte(7); +#endif } } - __builtin_unreachable(); + /* NOTREACHED */ return (0); } diff --git a/sys/libkern/strlen.c b/sys/libkern/strlen.c index 8fa5f3927ea9..a8c7964f69a3 100644 --- a/sys/libkern/strlen.c +++ b/sys/libkern/strlen.c @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); /* * Portable strlen() for 32-bit and 64-bit systems. * + * Rationale: it is generally much more efficient to do word length + * operations and avoid branches on modern computer systems, as + * compared to byte-length operations with a lot of branches. + * * The expression: * * ((x - 0x01....01) & ~x & 0x80....80) @@ -41,10 +45,18 @@ __FBSDID("$FreeBSD$"); * would evaluate to a non-zero value iff any of the bytes in the * original word is zero. * + * On multi-issue processors, we can divide the above expression into: + * a) (x - 0x01....01) + * b) (~x & 0x80....80) + * c) a & b + * + * Where, a) and b) can be partially computed in parallel. + * * The algorithm above is found on "Hacker's Delight" by * Henry S. Warren, Jr. */ +/* Magic numbers for the algorithm */ #if LONG_BIT == 32 static const unsigned long mask01 = 0x01010101; static const unsigned long mask80 = 0x80808080; @@ -57,45 +69,62 @@ static const unsigned long mask80 = 0x8080808080808080; #define LONGPTR_MASK (sizeof(long) - 1) -#if BYTE_ORDER == LITTLE_ENDIAN -#define FINDZERO __builtin_ctzl -#else -#define FINDZERO __builtin_clzl -#endif +/* + * Helper macro to return string length if we caught the zero + * byte. + */ +#define testbyte(x) \ + do { \ + if (p[x] == '\0') \ + return (p - str + x); \ + } while (0) size_t (strlen)(const char *str) { + const char *p; const unsigned long *lp; - unsigned long mask; long va, vb; - long val; - lp = (unsigned long *) (uintptr_t) str; - if ((uintptr_t)lp & LONGPTR_MASK) { - lp = (__typeof(lp)) ((uintptr_t)lp & ~LONGPTR_MASK); -#if BYTE_ORDER == LITTLE_ENDIAN - mask = ~(~0UL << (((uintptr_t)str & LONGPTR_MASK) << 3)); -#else - mask = ~(~0UL >> (((uintptr_t)str & LONGPTR_MASK) << 3)); -#endif - val = *lp | mask; - va = (val - mask01); - vb = ((~val) & mask80); - if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); - } - lp++; - } + /* + * Before trying the hard (unaligned byte-by-byte access) way + * to figure out whether there is a nul character, try to see + * if there is a nul character is within this accessible word + * first. + * + * p and (p & ~LONGPTR_MASK) must be equally accessible since + * they always fall in the same memory page, as long as page + * boundaries is integral multiple of word size. + */ + lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK); + va = (*lp - mask01); + vb = ((~*lp) & mask80); + lp++; + if (va & vb) + /* Check if we have \0 in the first part */ + for (p = str; p < (const char *)lp; p++) + if (*p == '\0') + return (p - str); + /* Scan the rest of the string using word sized operation */ for (; ; lp++) { va = (*lp - mask01); vb = ((~*lp) & mask80); if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); + p = (const char *)(lp); + testbyte(0); + testbyte(1); + testbyte(2); + testbyte(3); +#if (LONG_BIT >= 64) + testbyte(4); + testbyte(5); + testbyte(6); + testbyte(7); +#endif } } - __builtin_unreachable(); + /* NOTREACHED */ return (0); } From owner-dev-commits-src-all@freebsd.org Wed Feb 3 19:39: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 CF34B5292C2; Wed, 3 Feb 2021 19:39: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 4DWBpj5YYjz3NW0; Wed, 3 Feb 2021 19:39: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 B1822268B5; Wed, 3 Feb 2021 19:39: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 113JdvdQ093283; Wed, 3 Feb 2021 19:39:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113JdvYB093282; Wed, 3 Feb 2021 19:39:57 GMT (envelope-from git) Date: Wed, 3 Feb 2021 19:39:57 GMT Message-Id: <202102031939.113JdvYB093282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 8a680912a190 - stable/13 - Revert "Reimplement strlen" 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a680912a190d619be6194f88917052eed327f7b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:39:57 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=8a680912a190d619be6194f88917052eed327f7b commit 8a680912a190d619be6194f88917052eed327f7b Author: Mateusz Guzik AuthorDate: 2021-02-03 19:38:10 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-03 19:39:49 +0000 Revert "Reimplement strlen" This reverts commit 710e45c4b8539d028877769f1a4ec088c48fb5f1. It breaks for some corner cases on big endian ppc64. Given the stage of the release process it is best to revert for now. Reported by: jhibbits (cherry picked from commit 33f0540b13d949c7cc226a79927ddc2062ff98bf) --- lib/libc/string/strlen.c | 82 +++++++++++++++++++++++++++++++----------------- sys/libkern/strlen.c | 79 +++++++++++++++++++++++++++++++--------------- 2 files changed, 108 insertions(+), 53 deletions(-) diff --git a/lib/libc/string/strlen.c b/lib/libc/string/strlen.c index 0bdc81d7bb9a..a862ffc245ca 100644 --- a/lib/libc/string/strlen.c +++ b/lib/libc/string/strlen.c @@ -35,6 +35,10 @@ __FBSDID("$FreeBSD$"); /* * Portable strlen() for 32-bit and 64-bit systems. * + * Rationale: it is generally much more efficient to do word length + * operations and avoid branches on modern computer systems, as + * compared to byte-length operations with a lot of branches. + * * The expression: * * ((x - 0x01....01) & ~x & 0x80....80) @@ -42,13 +46,18 @@ __FBSDID("$FreeBSD$"); * would evaluate to a non-zero value iff any of the bytes in the * original word is zero. * + * On multi-issue processors, we can divide the above expression into: + * a) (x - 0x01....01) + * b) (~x & 0x80....80) + * c) a & b + * + * Where, a) and b) can be partially computed in parallel. + * * The algorithm above is found on "Hacker's Delight" by * Henry S. Warren, Jr. - * - * Note: this leaves performance on the table and each architecture - * would be best served with a tailor made routine instead. */ +/* Magic numbers for the algorithm */ #if LONG_BIT == 32 static const unsigned long mask01 = 0x01010101; static const unsigned long mask80 = 0x80808080; @@ -61,45 +70,62 @@ static const unsigned long mask80 = 0x8080808080808080; #define LONGPTR_MASK (sizeof(long) - 1) -#if BYTE_ORDER == LITTLE_ENDIAN -#define FINDZERO __builtin_ctzl -#else -#define FINDZERO __builtin_clzl -#endif +/* + * Helper macro to return string length if we caught the zero + * byte. + */ +#define testbyte(x) \ + do { \ + if (p[x] == '\0') \ + return (p - str + x); \ + } while (0) size_t strlen(const char *str) { + const char *p; const unsigned long *lp; - unsigned long mask; long va, vb; - long val; - lp = (unsigned long *) (uintptr_t) str; - if ((uintptr_t)lp & LONGPTR_MASK) { - lp = (__typeof(lp)) ((uintptr_t)lp & ~LONGPTR_MASK); -#if BYTE_ORDER == LITTLE_ENDIAN - mask = ~(~0UL << (((uintptr_t)str & LONGPTR_MASK) << 3)); -#else - mask = ~(~0UL >> (((uintptr_t)str & LONGPTR_MASK) << 3)); -#endif - val = *lp | mask; - va = (val - mask01); - vb = ((~val) & mask80); - if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); - } - lp++; - } + /* + * Before trying the hard (unaligned byte-by-byte access) way + * to figure out whether there is a nul character, try to see + * if there is a nul character is within this accessible word + * first. + * + * p and (p & ~LONGPTR_MASK) must be equally accessible since + * they always fall in the same memory page, as long as page + * boundaries is integral multiple of word size. + */ + lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK); + va = (*lp - mask01); + vb = ((~*lp) & mask80); + lp++; + if (va & vb) + /* Check if we have \0 in the first part */ + for (p = str; p < (const char *)lp; p++) + if (*p == '\0') + return (p - str); + /* Scan the rest of the string using word sized operation */ for (; ; lp++) { va = (*lp - mask01); vb = ((~*lp) & mask80); if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); + p = (const char *)(lp); + testbyte(0); + testbyte(1); + testbyte(2); + testbyte(3); +#if (LONG_BIT >= 64) + testbyte(4); + testbyte(5); + testbyte(6); + testbyte(7); +#endif } } - __builtin_unreachable(); + /* NOTREACHED */ return (0); } diff --git a/sys/libkern/strlen.c b/sys/libkern/strlen.c index 8fa5f3927ea9..a8c7964f69a3 100644 --- a/sys/libkern/strlen.c +++ b/sys/libkern/strlen.c @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); /* * Portable strlen() for 32-bit and 64-bit systems. * + * Rationale: it is generally much more efficient to do word length + * operations and avoid branches on modern computer systems, as + * compared to byte-length operations with a lot of branches. + * * The expression: * * ((x - 0x01....01) & ~x & 0x80....80) @@ -41,10 +45,18 @@ __FBSDID("$FreeBSD$"); * would evaluate to a non-zero value iff any of the bytes in the * original word is zero. * + * On multi-issue processors, we can divide the above expression into: + * a) (x - 0x01....01) + * b) (~x & 0x80....80) + * c) a & b + * + * Where, a) and b) can be partially computed in parallel. + * * The algorithm above is found on "Hacker's Delight" by * Henry S. Warren, Jr. */ +/* Magic numbers for the algorithm */ #if LONG_BIT == 32 static const unsigned long mask01 = 0x01010101; static const unsigned long mask80 = 0x80808080; @@ -57,45 +69,62 @@ static const unsigned long mask80 = 0x8080808080808080; #define LONGPTR_MASK (sizeof(long) - 1) -#if BYTE_ORDER == LITTLE_ENDIAN -#define FINDZERO __builtin_ctzl -#else -#define FINDZERO __builtin_clzl -#endif +/* + * Helper macro to return string length if we caught the zero + * byte. + */ +#define testbyte(x) \ + do { \ + if (p[x] == '\0') \ + return (p - str + x); \ + } while (0) size_t (strlen)(const char *str) { + const char *p; const unsigned long *lp; - unsigned long mask; long va, vb; - long val; - lp = (unsigned long *) (uintptr_t) str; - if ((uintptr_t)lp & LONGPTR_MASK) { - lp = (__typeof(lp)) ((uintptr_t)lp & ~LONGPTR_MASK); -#if BYTE_ORDER == LITTLE_ENDIAN - mask = ~(~0UL << (((uintptr_t)str & LONGPTR_MASK) << 3)); -#else - mask = ~(~0UL >> (((uintptr_t)str & LONGPTR_MASK) << 3)); -#endif - val = *lp | mask; - va = (val - mask01); - vb = ((~val) & mask80); - if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); - } - lp++; - } + /* + * Before trying the hard (unaligned byte-by-byte access) way + * to figure out whether there is a nul character, try to see + * if there is a nul character is within this accessible word + * first. + * + * p and (p & ~LONGPTR_MASK) must be equally accessible since + * they always fall in the same memory page, as long as page + * boundaries is integral multiple of word size. + */ + lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK); + va = (*lp - mask01); + vb = ((~*lp) & mask80); + lp++; + if (va & vb) + /* Check if we have \0 in the first part */ + for (p = str; p < (const char *)lp; p++) + if (*p == '\0') + return (p - str); + /* Scan the rest of the string using word sized operation */ for (; ; lp++) { va = (*lp - mask01); vb = ((~*lp) & mask80); if (va & vb) { - return ((const char *)lp - str + (FINDZERO(va & vb) >> 3)); + p = (const char *)(lp); + testbyte(0); + testbyte(1); + testbyte(2); + testbyte(3); +#if (LONG_BIT >= 64) + testbyte(4); + testbyte(5); + testbyte(6); + testbyte(7); +#endif } } - __builtin_unreachable(); + /* NOTREACHED */ return (0); } From owner-dev-commits-src-all@freebsd.org Wed Feb 3 19:47: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 5F949529D24; Wed, 3 Feb 2021 19:47: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 4DWBzp1JZrz3QZd; Wed, 3 Feb 2021 19:47: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 3972F266EB; Wed, 3 Feb 2021 19:47: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 113Jllhq005992; Wed, 3 Feb 2021 19:47:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113Jllbm005991; Wed, 3 Feb 2021 19:47:47 GMT (envelope-from git) Date: Wed, 3 Feb 2021 19:47:47 GMT Message-Id: <202102031947.113Jllbm005991@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: 14c40d2c292d - main - linux: remove locks around callout_drain in timerfd_close() 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: 14c40d2c292deff44be5591add7fdad5f9b371aa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:47:52 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=14c40d2c292deff44be5591add7fdad5f9b371aa commit 14c40d2c292deff44be5591add7fdad5f9b371aa Author: shu AuthorDate: 2021-02-03 19:10:58 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-03 19:47:38 +0000 linux: remove locks around callout_drain in timerfd_close() The lock around callout_drain() is unnecessary and may cause deadlock when one closes a timer descriptor during timer execution. Reviewed By: delphij Submitted By: ankohuu_outlook.com (Shunchao Hu) Differential Revision: https://reviews.freebsd.org/D28148 --- sys/compat/linux/linux_event.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 54f6b083adf3..f6cd9304f5cd 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -736,9 +736,7 @@ timerfd_close(struct file *fp, struct thread *td) timespecclear(&tfd->tfd_time.it_value); timespecclear(&tfd->tfd_time.it_interval); - mtx_lock(&tfd->tfd_lock); callout_drain(&tfd->tfd_callout); - mtx_unlock(&tfd->tfd_lock); seldrain(&tfd->tfd_sel); knlist_destroy(&tfd->tfd_sel.si_note); From owner-dev-commits-src-all@freebsd.org Wed Feb 3 20:32: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 216DE52B74A; Wed, 3 Feb 2021 20:32: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 4DWCzT0BMGz3nBn; Wed, 3 Feb 2021 20:32: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 ED55A27755; Wed, 3 Feb 2021 20:32: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 113KWa0A070619; Wed, 3 Feb 2021 20:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113KWa0D070618; Wed, 3 Feb 2021 20:32:36 GMT (envelope-from git) Date: Wed, 3 Feb 2021 20:32:36 GMT Message-Id: <202102032032.113KWa0D070618@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: 8727c174b0fe - main - dwmmc: Multiple busdma 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: 8727c174b0fe44766bb7ea765dac6d5f82818103 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 20:32:37 -0000 The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=8727c174b0fe44766bb7ea765dac6d5f82818103 commit 8727c174b0fe44766bb7ea765dac6d5f82818103 Author: Michal Meloun AuthorDate: 2021-01-21 14:06:19 +0000 Commit: Michal Meloun CommitDate: 2021-02-03 20:15:11 +0000 dwmmc: Multiple busdma fixes. - limit maximum segment size to 2048 bytes. Although dwmmc supports a buffer fragment with a maximum length of 4095 bytes, use the nearest lower power of two as the maximum fragment size. Otherwise, busdma create excessive buffer fragments. - fix off by one error in computation of the maximum data transfer length. - in addition, reserve two DMA descriptors that can be used by busdma bouncing. The beginning or end of the buffer can be misaligned. - Don’t ignore errors passed to bus_dmamap_load() callback function. - In theory, a DMA engine may be running at time when next dma descriptor is constructed. Create a full DMA descriptor before OWN bit is set. MFC after: 2 weeks --- sys/dev/mmc/host/dwmmc.c | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index 11521257ee0a..b31bb0d4e68b 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -107,8 +107,7 @@ __FBSDID("$FreeBSD$"); #define CARD_INIT_DONE 0x04 #define DWMMC_DATA_ERR_FLAGS (SDMMC_INTMASK_DRT | SDMMC_INTMASK_DCRC \ - |SDMMC_INTMASK_HTO | SDMMC_INTMASK_SBE \ - |SDMMC_INTMASK_EBE) + |SDMMC_INTMASK_SBE | SDMMC_INTMASK_EBE) #define DWMMC_CMD_ERR_FLAGS (SDMMC_INTMASK_RTO | SDMMC_INTMASK_RCRC \ |SDMMC_INTMASK_RE) #define DWMMC_ERR_FLAGS (DWMMC_DATA_ERR_FLAGS | DWMMC_CMD_ERR_FLAGS \ @@ -134,7 +133,16 @@ struct idmac_desc { #define IDMAC_DESC_SEGS (PAGE_SIZE / (sizeof(struct idmac_desc))) #define IDMAC_DESC_SIZE (sizeof(struct idmac_desc) * IDMAC_DESC_SEGS) #define DEF_MSIZE 0x2 /* Burst size of multiple transaction */ -#define IDMAC_MAX_SIZE 4096 +/* + * Size field in DMA descriptor is 13 bits long (up to 4095 bytes), + * but must be a multiple of the data bus size.Additionally, we must ensure + * that bus_dmamap_load() doesn't additionally fragments buffer (because it + * is processed with page size granularity). Thus limit fragment size to half + * of page. + * XXX switch descriptor format to array and use second buffer pointer for + * second half of page + */ +#define IDMAC_MAX_SIZE 2048 static void dwmmc_next_operation(struct dwmmc_softc *); static int dwmmc_setup_bus(struct dwmmc_softc *, int); @@ -165,8 +173,11 @@ static void dwmmc_get1paddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { + if (nsegs != 1) + panic("%s: nsegs != 1 (%d)\n", __func__, nsegs); if (error != 0) - return; + panic("%s: error != 0 (%d)\n", __func__, error); + *(bus_addr_t *)arg = segs[0].ds_addr; } @@ -176,15 +187,13 @@ dwmmc_ring_setup(void *arg, bus_dma_segment_t *segs, int nsegs, int error) struct dwmmc_softc *sc; int idx; - if (error != 0) - return; - sc = arg; - dprintf("nsegs %d seg0len %lu\n", nsegs, segs[0].ds_len); + if (error != 0) + panic("%s: error != 0 (%d)\n", __func__, error); for (idx = 0; idx < nsegs; idx++) { - sc->desc_ring[idx].des0 = (DES0_OWN | DES0_DIC | DES0_CH); + sc->desc_ring[idx].des0 = DES0_DIC | DES0_CH; sc->desc_ring[idx].des1 = segs[idx].ds_len & DES1_BS1_MASK; sc->desc_ring[idx].des2 = segs[idx].ds_addr; @@ -195,6 +204,8 @@ dwmmc_ring_setup(void *arg, bus_dma_segment_t *segs, int nsegs, int error) sc->desc_ring[idx].des0 &= ~(DES0_DIC | DES0_CH); sc->desc_ring[idx].des0 |= DES0_LD; } + wmb(); + sc->desc_ring[idx].des0 |= DES0_OWN; } } @@ -277,7 +288,7 @@ dma_setup(struct dwmmc_softc *sc) error = bus_dma_tag_create( bus_get_dma_tag(sc->dev), /* Parent tag. */ - CACHE_LINE_SIZE, 0, /* alignment, boundary */ + 8, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ @@ -786,7 +797,7 @@ dwmmc_attach(device_t dev) fail: mtx_unlock(&sc->sim_mtx); #endif - /* + /* * Schedule a card detection as we won't get an interrupt * if the card is inserted when we attach */ @@ -900,8 +911,8 @@ dwmmc_update_ios(device_t brdev, device_t reqdev) sc = device_get_softc(brdev); ios = &sc->host.ios; - dprintf("Setting up clk %u bus_width %d\n", - ios->clock, ios->bus_width); + dprintf("Setting up clk %u bus_width %d, timming: %d\n", + ios->clock, ios->bus_width, ios->timing); if (ios->bus_width == bus_width_8) WRITE4(sc, SDMMC_CTYPE, SDMMC_CTYPE_8BIT); @@ -985,7 +996,7 @@ dma_prepare(struct dwmmc_softc *sc, struct mmc_command *cmd) reg = READ4(sc, SDMMC_INTMASK); reg &= ~(SDMMC_INTMASK_TXDR | SDMMC_INTMASK_RXDR); WRITE4(sc, SDMMC_INTMASK, reg); - + dprintf("%s: bus_dmamap_load size: %zu\n", __func__, data->len); err = bus_dmamap_load(sc->buf_tag, sc->buf_map, data->data, data->len, dwmmc_ring_setup, sc, BUS_DMA_NOWAIT); @@ -1358,7 +1369,13 @@ dwmmc_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: - *(int *)result = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / MMC_SECTOR_SIZE; + /* + * Busdma may bounce buffers, so we must reserve 2 descriptors + * (on start and on end) for bounced fragments. + * + */ + *(int *)result = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / + MMC_SECTOR_SIZE - 3; break; case MMCBR_IVAR_TIMING: *(int *)result = sc->host.ios.timing; From owner-dev-commits-src-all@freebsd.org Wed Feb 3 21:18: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 EC4EC52C469; Wed, 3 Feb 2021 21:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWF026Q0Vz3qPQ; Wed, 3 Feb 2021 21:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF29427E8D; Wed, 3 Feb 2021 21:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 113LIA6R023751; Wed, 3 Feb 2021 21:18:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113LIAqO023750; Wed, 3 Feb 2021 21:18:10 GMT (envelope-from git) Date: Wed, 3 Feb 2021 21:18:10 GMT Message-Id: <202102032118.113LIAqO023750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Stone Subject: git: 660344ca44c6 - main - Add a VM flag to prevent reclaim on a failed contig allocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rstone X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 660344ca44c63bfe4a16c3e57d0f6dbcbb5e083e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:18:11 -0000 The branch main has been updated by rstone: URL: https://cgit.FreeBSD.org/src/commit/?id=660344ca44c63bfe4a16c3e57d0f6dbcbb5e083e commit 660344ca44c63bfe4a16c3e57d0f6dbcbb5e083e Author: Ryan Stone AuthorDate: 2021-01-29 21:13:57 +0000 Commit: Ryan Stone CommitDate: 2021-02-03 21:16:51 +0000 Add a VM flag to prevent reclaim on a failed contig allocation If a M_WAITOK contig alloc fails, the VM subsystem will try to reclaim contiguous memory twice before actually failing the request. On a system with 64GB of RAM I've observed this take 400-500ms before it finally gives up, and I believe that this will only be worse on systems with even more memory. In certain contexts this delay is extremely harmful, so add a flag that will skip reclaim for allocation requests to allow those paths to opt-out of doing an expensive reclaim. Sponsored by: Dell Inc Differential Revision: https://reviews.freebsd.org/D28422 Reviewed by: markj, kib --- sys/sys/malloc.h | 1 + sys/vm/vm_kern.c | 9 +++++++-- sys/vm/vm_page.h | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index a11dd767efc5..54a05e94a3a2 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -54,6 +54,7 @@ */ #define M_NOWAIT 0x0001 /* do not block */ #define M_WAITOK 0x0002 /* ok to block */ +#define M_NORECLAIM 0x0080 /* do not reclaim after failure */ #define M_ZERO 0x0100 /* bzero the allocation */ #define M_NOVM 0x0200 /* don't ask VM for pages */ #define M_USE_RESERVE 0x0400 /* can alloc out of reserve memory */ diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index f1704f834157..e8e24c3ca8a3 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -177,17 +177,22 @@ kmem_alloc_contig_pages(vm_object_t object, vm_pindex_t pindex, int domain, { vm_page_t m; int tries; - bool wait; + bool wait, reclaim; VM_OBJECT_ASSERT_WLOCKED(object); + /* Disallow an invalid combination of flags. */ + MPASS((pflags & (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM)) != + (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM)); + wait = (pflags & VM_ALLOC_WAITOK) != 0; + reclaim = (pflags & VM_ALLOC_NORECLAIM) == 0; pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); pflags |= VM_ALLOC_NOWAIT; for (tries = wait ? 3 : 1;; tries--) { m = vm_page_alloc_contig_domain(object, pindex, domain, pflags, npages, low, high, alignment, boundary, memattr); - if (m != NULL || tries == 0) + if (m != NULL || tries == 0 || !reclaim) break; VM_OBJECT_WUNLOCK(object); diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index b05a3d1be861..ed372cae2a3b 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -541,6 +541,7 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_WAITFAIL 0x0010 /* (acf) Sleep and return error */ #define VM_ALLOC_WIRED 0x0020 /* (acfgp) Allocate a wired page */ #define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */ +#define VM_ALLOC_NORECLAIM 0x0080 /* (c) Do not reclaim after failure */ #define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */ #define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */ #define VM_ALLOC_NOCREAT 0x0400 /* (gp) Don't create a page */ @@ -570,6 +571,8 @@ malloc2vm_flags(int malloc_flags) pflags |= VM_ALLOC_NOWAIT; if ((malloc_flags & M_WAITOK)) pflags |= VM_ALLOC_WAITOK; + if ((malloc_flags & M_NORECLAIM)) + pflags |= VM_ALLOC_NORECLAIM; return (pflags); } #endif From owner-dev-commits-src-all@freebsd.org Wed Feb 3 21:18: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 14B3452C8B3; Wed, 3 Feb 2021 21:18: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 4DWF0d01W4z3qbY; Wed, 3 Feb 2021 21:18: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 E7A3427E8E; Wed, 3 Feb 2021 21:18: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 113LIeT0023966; Wed, 3 Feb 2021 21:18:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113LIeVF023965; Wed, 3 Feb 2021 21:18:40 GMT (envelope-from git) Date: Wed, 3 Feb 2021 21:18:40 GMT Message-Id: <202102032118.113LIeVF023965@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: e79b51e2b2e3 - main - readelf: decode LA48 and ASG_DISABLE feature flags 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: e79b51e2b2e35d6256a1ef5311ce02ec4032d21f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:18:41 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e79b51e2b2e35d6256a1ef5311ce02ec4032d21f commit e79b51e2b2e35d6256a1ef5311ce02ec4032d21f Author: Ed Maste AuthorDate: 2021-02-03 21:16:45 +0000 Commit: Ed Maste CommitDate: 2021-02-03 21:17:56 +0000 readelf: decode LA48 and ASG_DISABLE feature flags MFC after: 1 week Sponsored by: The FreeBSD Foundation --- contrib/elftoolchain/readelf/readelf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 0964f3529d1b..479f4a5ba28f 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -3680,6 +3680,8 @@ static struct flag_desc note_feature_ctl_flags[] = { { NT_FREEBSD_FCTL_PROTMAX_DISABLE, "PROTMAX_DISABLE" }, { NT_FREEBSD_FCTL_STKGAP_DISABLE, "STKGAP_DISABLE" }, { NT_FREEBSD_FCTL_WXNEEDED, "WXNEEDED" }, + { NT_FREEBSD_FCTL_LA48, "LA48" }, + { NT_FREEBSD_FCTL_ASG_DISABLE, "ASG_DISABLE" }, { 0, NULL } }; From owner-dev-commits-src-all@freebsd.org Wed Feb 3 21: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 F3C3E52CE24; Wed, 3 Feb 2021 21: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 4DWF866fZRz3qvF; Wed, 3 Feb 2021 21:25: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 D750A2809F; Wed, 3 Feb 2021 21:25: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 113LPARx036990; Wed, 3 Feb 2021 21:25:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113LPACL036989; Wed, 3 Feb 2021 21:25:10 GMT (envelope-from git) Date: Wed, 3 Feb 2021 21:25:10 GMT Message-Id: <202102032125.113LPACL036989@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: 847dfd2803f6 - main - readelf: do not trucate section name with -W 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: 847dfd2803f6c8b077e3ebc68e35adff2c79a65f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:25:11 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=847dfd2803f6c8b077e3ebc68e35adff2c79a65f commit 847dfd2803f6c8b077e3ebc68e35adff2c79a65f Author: Ed Maste AuthorDate: 2021-02-02 14:35:04 +0000 Commit: Ed Maste CommitDate: 2021-02-03 21:24:22 +0000 readelf: do not trucate section name with -W PR: 246015 Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28461 --- contrib/elftoolchain/readelf/readelf.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 479f4a5ba28f..022c9e9066ab 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -2632,16 +2632,21 @@ dump_shdr(struct readelf *re) " %6.6jx %6.6jx %2.2jx %2u %3u %2ju\n" " %s\n", ST_CT); else - printf(" [%2d] %-17.17s %-15.15s %8.8jx" - " %6.6jx %6.6jx %2.2jx %3s %2u %3u %2ju\n", - S_CT); + if (re->options & RE_WW) + printf(" [%2d] %-17s %-15.15s " + "%8.8jx %6.6jx %6.6jx %2.2jx %3s " + "%2u %3u %2ju\n", S_CT); + else + printf(" [%2d] %-17.17s %-15.15s " + "%8.8jx %6.6jx %6.6jx %2.2jx %3s " + "%2u %3u %2ju\n", S_CT); } else if (re->options & RE_WW) { if (re->options & RE_T) printf(" [%2d] %s\n %-15.15s %16.16jx" " %6.6jx %6.6jx %2.2jx %2u %3u %2ju\n" " %s\n", ST_CT); else - printf(" [%2d] %-17.17s %-15.15s %16.16jx" + printf(" [%2d] %-17s %-15.15s %16.16jx" " %6.6jx %6.6jx %2.2jx %3s %2u %3u %2ju\n", S_CT); } else { From owner-dev-commits-src-all@freebsd.org Wed Feb 3 22:08: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 665B052D77E; Wed, 3 Feb 2021 22:08: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 4DWG692S0Lz3t7Y; Wed, 3 Feb 2021 22:08: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 46CC428A82; Wed, 3 Feb 2021 22:08: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 113M8Xhp089637; Wed, 3 Feb 2021 22:08:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113M8Xib089636; Wed, 3 Feb 2021 22:08:33 GMT (envelope-from git) Date: Wed, 3 Feb 2021 22:08:33 GMT Message-Id: <202102032208.113M8Xib089636@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: e34a057ca6eb - main - [POWERPC64BE] mrsas: add 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: e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:08:33 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a commit e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-04 00:52:19 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-04 01:06:21 +0000 [POWERPC64BE] mrsas: add big-endian support Add endiannes conversions in order to support big-endian platforms Submitted by: Andre Fernando da Silva Reviewed by: luporl, alfredo, kadesai (on email) Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D26531 --- sys/dev/mrsas/mrsas.c | 198 ++++++++++++++++--------------- sys/dev/mrsas/mrsas.h | 289 +++++++++++++++++++++++++++++++++++++++++++++- sys/dev/mrsas/mrsas_cam.c | 54 ++++----- sys/dev/mrsas/mrsas_fp.c | 170 ++++++++++++++------------- 4 files changed, 510 insertions(+), 201 deletions(-) diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index 32d85c803938..f4c34e237fc4 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * Function prototypes @@ -619,13 +620,13 @@ mrsas_get_seq_num(struct mrsas_softc *sc, dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0x0; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_evt_log_info); - dcmd->opcode = MR_DCMD_CTRL_EVENT_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = sc->el_info_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_log_info); + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_evt_log_info)); + dcmd->opcode = htole32(MR_DCMD_CTRL_EVENT_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(sc->el_info_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_evt_log_info)); retcode = mrsas_issue_blocked_cmd(sc, cmd); if (retcode == ETIMEDOUT) @@ -681,7 +682,7 @@ mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, curr_aen.word = class_locale_word; if (sc->aen_cmd) { - prev_aen.word = sc->aen_cmd->frame->dcmd.mbox.w[1]; + prev_aen.word = le32toh(sc->aen_cmd->frame->dcmd.mbox.w[1]); /* * A class whose enum value is smaller is inclusive of all @@ -732,16 +733,16 @@ mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0x0; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_evt_detail); - dcmd->opcode = MR_DCMD_CTRL_EVENT_WAIT; - dcmd->mbox.w[0] = seq_num; + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_evt_detail)); + dcmd->opcode = htole32(MR_DCMD_CTRL_EVENT_WAIT); + dcmd->mbox.w[0] = htole32(seq_num); sc->last_seq_num = seq_num; - dcmd->mbox.w[1] = curr_aen.word; - dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->evt_detail_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_detail); + dcmd->mbox.w[1] = htole32(curr_aen.word); + dcmd->sgl.sge32[0].phys_addr = htole32((u_int32_t)sc->evt_detail_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_evt_detail)); if (sc->aen_cmd != NULL) { mrsas_release_mfi_cmd(cmd); @@ -907,9 +908,6 @@ mrsas_attach(device_t dev) * Set up PCI and registers */ cmd = pci_read_config(dev, PCIR_COMMAND, 2); - if ((cmd & PCIM_CMD_PORTEN) == 0) { - return (ENXIO); - } /* Force the busmaster enable bit on. */ cmd |= PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 2); @@ -1704,7 +1702,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) /* Find our reply descriptor for the command and process */ while ((desc_val.u.low != 0xFFFFFFFF) && (desc_val.u.high != 0xFFFFFFFF)) { - smid = reply_desc->SMID; + smid = le16toh(reply_desc->SMID); cmd_mpt = sc->mpt_cmd_list[smid - 1]; scsi_io_req = (MRSAS_RAID_SCSI_IO_REQUEST *) cmd_mpt->io_request; @@ -1736,7 +1734,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) case MRSAS_MPI2_FUNCTION_LD_IO_REQUEST: if (cmd_mpt->r1_alt_dev_handle == MR_DEVHANDLE_INVALID) { mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, - extStatus, data_length, sense); + extStatus, le32toh(data_length), sense); mrsas_cmd_done(sc, cmd_mpt); mrsas_atomic_dec(&sc->fw_outstanding); } else { @@ -1764,7 +1762,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) mrsas_release_mpt_cmd(r1_cmd); mrsas_atomic_dec(&sc->fw_outstanding); mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, - extStatus, data_length, sense); + extStatus, le32toh(data_length), sense); mrsas_cmd_done(sc, cmd_mpt); mrsas_atomic_dec(&sc->fw_outstanding); } @@ -1778,7 +1776,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) * And also make sure that the issue_polled call should only be * used if INTERRUPT IS DISABLED. */ - if (cmd_mfi->frame->hdr.flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) + if (cmd_mfi->frame->hdr.flags & htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)) mrsas_release_mfi_cmd(cmd_mfi); else mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); @@ -2593,6 +2591,13 @@ mrsas_init_adapter(struct mrsas_softc *sc) (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); + + mrsas_dprint(sc, MRSAS_TRACE, "%s: sc->reply_q_depth 0x%x," + "sc->request_alloc_sz 0x%x, sc->reply_alloc_sz 0x%x," + "sc->io_frames_alloc_sz 0x%x\n", __func__, + sc->reply_q_depth, sc->request_alloc_sz, + sc->reply_alloc_sz, sc->io_frames_alloc_sz); + /* * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set, * Firmware support extended IO chain frame which is 4 time more @@ -2617,8 +2622,10 @@ mrsas_init_adapter(struct mrsas_softc *sc) mrsas_dprint(sc, MRSAS_INFO, "max sge: 0x%x, max chain frame size: 0x%x, " - "max fw cmd: 0x%x\n", sc->max_num_sge, - sc->max_chain_frame_sz, sc->max_fw_cmds); + "max fw cmd: 0x%x sc->chain_frames_alloc_sz: 0x%x\n", + sc->max_num_sge, + sc->max_chain_frame_sz, sc->max_fw_cmds, + sc->chain_frames_alloc_sz); /* Used for pass thru MFI frame (DCMD) */ sc->chain_offset_mfi_pthru = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 16; @@ -2738,19 +2745,19 @@ mrsas_ioc_init(struct mrsas_softc *sc) IOCInitMsg = (pMpi2IOCInitRequest_t)(((char *)sc->ioc_init_mem) + 1024); IOCInitMsg->Function = MPI2_FUNCTION_IOC_INIT; IOCInitMsg->WhoInit = MPI2_WHOINIT_HOST_DRIVER; - IOCInitMsg->MsgVersion = MPI2_VERSION; - IOCInitMsg->HeaderVersion = MPI2_HEADER_VERSION; - IOCInitMsg->SystemRequestFrameSize = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4; - IOCInitMsg->ReplyDescriptorPostQueueDepth = sc->reply_q_depth; - IOCInitMsg->ReplyDescriptorPostQueueAddress = sc->reply_desc_phys_addr; - IOCInitMsg->SystemRequestFrameBaseAddress = sc->io_request_phys_addr; + IOCInitMsg->MsgVersion = htole16(MPI2_VERSION); + IOCInitMsg->HeaderVersion = htole16(MPI2_HEADER_VERSION); + IOCInitMsg->SystemRequestFrameSize = htole16(MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4); + IOCInitMsg->ReplyDescriptorPostQueueDepth = htole16(sc->reply_q_depth); + IOCInitMsg->ReplyDescriptorPostQueueAddress = htole64(sc->reply_desc_phys_addr); + IOCInitMsg->SystemRequestFrameBaseAddress = htole64(sc->io_request_phys_addr); IOCInitMsg->HostMSIxVectors = (sc->msix_vectors > 0 ? sc->msix_vectors : 0); IOCInitMsg->HostPageSize = MR_DEFAULT_NVME_PAGE_SHIFT; init_frame = (struct mrsas_init_frame *)sc->ioc_init_mem; init_frame->cmd = MFI_CMD_INIT; init_frame->cmd_status = 0xFF; - init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; + init_frame->flags |= htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE); /* driver support Extended MSIX */ if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { @@ -2768,11 +2775,16 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; if (sc->max_chain_frame_sz > MEGASAS_CHAIN_FRAME_SZ_MIN) init_frame->driver_operations.mfi_capabilities.support_ext_io_size = 1; + + init_frame->driver_operations.reg = htole32(init_frame->driver_operations.reg); + phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; - init_frame->queue_info_new_phys_addr_lo = phys_addr; - init_frame->data_xfer_len = sizeof(Mpi2IOCInitRequest_t); + init_frame->queue_info_new_phys_addr_lo = htole32(phys_addr); + init_frame->data_xfer_len = htole32(sizeof(Mpi2IOCInitRequest_t)); + + req_desc.addr.u.low = htole32((bus_addr_t)sc->ioc_init_phys_mem & 0xFFFFFFFF); + req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); - req_desc.addr.Words = (bus_addr_t)sc->ioc_init_phys_mem; req_desc.MFAIo.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); @@ -2923,9 +2935,9 @@ mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, { mtx_lock(&sc->pci_lock); mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_low_queue_port), - req_desc_lo); + le32toh(req_desc_lo)); mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_high_queue_port), - req_desc_hi); + le32toh(req_desc_hi)); mtx_unlock(&sc->pci_lock); } @@ -2944,7 +2956,7 @@ mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, { if (sc->atomic_desc_support) mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_single_queue_port), - req_desc_lo); + le32toh(req_desc_lo)); else mrsas_write_64bit_req_desc(sc, req_desc_lo, req_desc_hi); } @@ -3103,7 +3115,6 @@ mrsas_ocr_thread(void *arg) sc = (struct mrsas_softc *)arg; mrsas_dprint(sc, MRSAS_TRACE, "%s\n", __func__); - sc->ocr_thread_active = 1; mtx_lock(&sc->sim_lock); for (;;) { @@ -3642,10 +3653,10 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) dcmd->flags = MFI_FRAME_DIR_READ; dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_ctrl_info); - dcmd->opcode = MR_DCMD_CTRL_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = sc->ctlr_info_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_ctrl_info)); + dcmd->opcode = htole32(MR_DCMD_CTRL_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(sc->ctlr_info_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_ctrl_info)); if (!sc->mask_interrupts) retcode = mrsas_issue_blocked_cmd(sc, cmd); @@ -3654,8 +3665,13 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) if (retcode == ETIMEDOUT) goto dcmd_timeout; - else + else { memcpy(sc->ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); + le32_to_cpus(&sc->ctrl_info->properties.OnOffProperties); + le32_to_cpus(&sc->ctrl_info->adapterOperations2); + le32_to_cpus(&sc->ctrl_info->adapterOperations3); + le16_to_cpus(&sc->ctrl_info->adapterOperations4); + } do_ocr = 0; mrsas_update_ext_vd_details(sc); @@ -3813,7 +3829,7 @@ mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) int i, retcode = SUCCESS; frame_hdr->cmd_status = 0xFF; - frame_hdr->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; + frame_hdr->flags |= htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE); /* Issue the frame using inbound queue port */ if (mrsas_issue_dcmd(sc, cmd)) { @@ -3892,7 +3908,7 @@ mrsas_build_mpt_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) req_desc->addr.Words = 0; req_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - req_desc->SCSIIO.SMID = index; + req_desc->SCSIIO.SMID = htole16(index); return (req_desc); } @@ -3927,7 +3943,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cm * mrsas_complete_cmd. */ - if (frame_hdr->flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) + if (frame_hdr->flags & htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)) mpt_cmd->flags = MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; io_req = mpt_cmd->io_request; @@ -3944,12 +3960,12 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cm io_req->SGLOffset0 = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 4; io_req->ChainOffset = sc->chain_offset_mfi_pthru; - mpi25_ieee_chain->Address = mfi_cmd->frame_phys_addr; + mpi25_ieee_chain->Address = htole64(mfi_cmd->frame_phys_addr); mpi25_ieee_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR; - mpi25_ieee_chain->Length = sc->max_chain_frame_sz; + mpi25_ieee_chain->Length = htole32(sc->max_chain_frame_sz); return (0); } @@ -4100,7 +4116,7 @@ mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd break; } /* See if got an event notification */ - if (cmd->frame->dcmd.opcode == MR_DCMD_CTRL_EVENT_WAIT) + if (le32toh(cmd->frame->dcmd.opcode) == MR_DCMD_CTRL_EVENT_WAIT) mrsas_complete_aen(sc, cmd); else mrsas_wakeup(sc, cmd); @@ -4264,14 +4280,14 @@ megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) dcmd->sge_count = 1; dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = (pd_seq_map_sz); - dcmd->opcode = (MR_DCMD_SYSTEM_PD_MAP_GET_INFO); - dcmd->sgl.sge32[0].phys_addr = (pd_seq_h); - dcmd->sgl.sge32[0].length = (pd_seq_map_sz); + dcmd->data_xfer_len = htole32(pd_seq_map_sz); + dcmd->opcode = htole32(MR_DCMD_SYSTEM_PD_MAP_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(pd_seq_h & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(pd_seq_map_sz); if (pend) { dcmd->mbox.b[0] = MRSAS_DCMD_MBOX_PEND_FLAG; - dcmd->flags = (MFI_FRAME_DIR_WRITE); + dcmd->flags = htole16(MFI_FRAME_DIR_WRITE); sc->jbod_seq_cmd = cmd; if (mrsas_issue_dcmd(sc, cmd)) { device_printf(sc->mrsas_dev, @@ -4280,13 +4296,13 @@ megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) } else return 0; } else - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); retcode = mrsas_issue_polled(sc, cmd); if (retcode == ETIMEDOUT) goto dcmd_timeout; - if (pd_sync->count > MAX_PHYSICAL_DEVICES) { + if (le32toh(pd_sync->count) > MAX_PHYSICAL_DEVICES) { device_printf(sc->mrsas_dev, "driver supports max %d JBOD, but FW reports %d\n", MAX_PHYSICAL_DEVICES, pd_sync->count); @@ -4364,13 +4380,13 @@ mrsas_get_ld_map_info(struct mrsas_softc *sc) dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sc->current_map_sz; - dcmd->opcode = MR_DCMD_LD_MAP_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = map_phys_addr; - dcmd->sgl.sge32[0].length = sc->current_map_sz; + dcmd->data_xfer_len = htole32(sc->current_map_sz); + dcmd->opcode = htole32(MR_DCMD_LD_MAP_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(map_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sc->current_map_sz); retcode = mrsas_issue_polled(sc, cmd); if (retcode == ETIMEDOUT) @@ -4427,15 +4443,15 @@ mrsas_sync_map_info(struct mrsas_softc *sc) dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_WRITE; + dcmd->flags = htole16(MFI_FRAME_DIR_WRITE); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sc->current_map_sz; + dcmd->data_xfer_len = htole32(sc->current_map_sz); dcmd->mbox.b[0] = num_lds; dcmd->mbox.b[1] = MRSAS_DCMD_MBOX_PEND_FLAG; - dcmd->opcode = MR_DCMD_LD_MAP_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = map_phys_addr; - dcmd->sgl.sge32[0].length = sc->current_map_sz; + dcmd->opcode = htole32(MR_DCMD_LD_MAP_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(map_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sc->current_map_sz); sc->map_update_cmd = cmd; if (mrsas_issue_dcmd(sc, cmd)) { @@ -4472,17 +4488,17 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) memset(sc->pd_info_mem, 0, sizeof(struct mrsas_pd_info)); memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); - dcmd->mbox.s[0] = device_id; + dcmd->mbox.s[0] = htole16(device_id); dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; dcmd->flags = MFI_FRAME_DIR_READ; dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_pd_info); - dcmd->opcode = MR_DCMD_PD_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->pd_info_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_pd_info); + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_pd_info)); + dcmd->opcode = htole32(MR_DCMD_PD_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32((u_int32_t)sc->pd_info_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_pd_info)); if (!sc->mask_interrupts) retcode = mrsas_issue_blocked_cmd(sc, cmd); @@ -4493,7 +4509,7 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) goto dcmd_timeout; sc->target_list[device_id].interface_type = - sc->pd_info_mem->state.ddf.pdType.intf; + le16toh(sc->pd_info_mem->state.ddf.pdType.intf); do_ocr = 0; @@ -4572,6 +4588,7 @@ mrsas_get_pd_list(struct mrsas_softc *sc) struct MR_PD_ADDRESS *pd_addr; bus_addr_t pd_list_phys_addr = 0; struct mrsas_tmp_dcmd *tcmd; + u_int16_t dev_id; cmd = mrsas_get_mfi_cmd(sc); if (!cmd) { @@ -4601,13 +4618,13 @@ mrsas_get_pd_list(struct mrsas_softc *sc) dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); - dcmd->opcode = MR_DCMD_PD_LIST_QUERY; - dcmd->sgl.sge32[0].phys_addr = pd_list_phys_addr; - dcmd->sgl.sge32[0].length = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); + dcmd->data_xfer_len = htole32(MRSAS_MAX_PD * sizeof(struct MR_PD_LIST)); + dcmd->opcode = htole32(MR_DCMD_PD_LIST_QUERY); + dcmd->sgl.sge32[0].phys_addr = htole32(pd_list_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(MRSAS_MAX_PD * sizeof(struct MR_PD_LIST)); if (!sc->mask_interrupts) retcode = mrsas_issue_blocked_cmd(sc, cmd); @@ -4620,17 +4637,18 @@ mrsas_get_pd_list(struct mrsas_softc *sc) /* Get the instance PD list */ pd_count = MRSAS_MAX_PD; pd_addr = pd_list_mem->addr; - if (pd_list_mem->count < pd_count) { + if (le32toh(pd_list_mem->count) < pd_count) { memset(sc->local_pd_list, 0, MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); - for (pd_index = 0; pd_index < pd_list_mem->count; pd_index++) { - sc->local_pd_list[pd_addr->deviceId].tid = pd_addr->deviceId; - sc->local_pd_list[pd_addr->deviceId].driveType = - pd_addr->scsiDevType; - sc->local_pd_list[pd_addr->deviceId].driveState = + for (pd_index = 0; pd_index < le32toh(pd_list_mem->count); pd_index++) { + dev_id = le16toh(pd_addr->deviceId); + sc->local_pd_list[dev_id].tid = dev_id; + sc->local_pd_list[dev_id].driveType = + le16toh(pd_addr->scsiDevType); + sc->local_pd_list[dev_id].driveState = MR_PD_STATE_SYSTEM; - if (sc->target_list[pd_addr->deviceId].target_id == 0xffff) - mrsas_add_target(sc, pd_addr->deviceId); + if (sc->target_list[dev_id].target_id == 0xffff) + mrsas_add_target(sc, dev_id); pd_addr++; } for (pd_index = 0; pd_index < MRSAS_MAX_PD; pd_index++) { @@ -4711,10 +4729,10 @@ mrsas_get_ld_list(struct mrsas_softc *sc) dcmd->sge_count = 1; dcmd->flags = MFI_FRAME_DIR_READ; dcmd->timeout = 0; - dcmd->data_xfer_len = sizeof(struct MR_LD_LIST); - dcmd->opcode = MR_DCMD_LD_GET_LIST; - dcmd->sgl.sge32[0].phys_addr = ld_list_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct MR_LD_LIST); + dcmd->data_xfer_len = htole32(sizeof(struct MR_LD_LIST)); + dcmd->opcode = htole32(MR_DCMD_LD_GET_LIST); + dcmd->sgl.sge32[0].phys_addr = htole32(ld_list_phys_addr); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct MR_LD_LIST)); dcmd->pad_0 = 0; if (!sc->mask_interrupts) @@ -4730,10 +4748,10 @@ mrsas_get_ld_list(struct mrsas_softc *sc) #endif /* Get the instance LD list */ - if (ld_list_mem->ldCount <= sc->fw_supported_vd_count) { - sc->CurLdCount = ld_list_mem->ldCount; + if (le32toh(ld_list_mem->ldCount) <= sc->fw_supported_vd_count) { + sc->CurLdCount = le32toh(ld_list_mem->ldCount); memset(sc->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT); - for (ld_index = 0; ld_index < ld_list_mem->ldCount; ld_index++) { + for (ld_index = 0; ld_index < le32toh(ld_list_mem->ldCount); ld_index++) { ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; drv_tgt_id = ids + MRSAS_MAX_PD; if (ld_list_mem->ldList[ld_index].state != 0) { diff --git a/sys/dev/mrsas/mrsas.h b/sys/dev/mrsas/mrsas.h index fbb08215b7b1..069db02fadff 100644 --- a/sys/dev/mrsas/mrsas.h +++ b/sys/dev/mrsas/mrsas.h @@ -165,14 +165,22 @@ do { \ device_printf(sc->mrsas_dev, msg, ##args); \ } while (0) +#define le32_to_cpus(x) do { *((u_int32_t *)(x)) = le32toh((*(u_int32_t *)x)); } while (0) +#define le16_to_cpus(x) do { *((u_int16_t *)(x)) = le16toh((*(u_int16_t *)x)); } while (0) + /**************************************************************************** * Raid Context structure which describes MegaRAID specific IO Paramenters * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames ****************************************************************************/ typedef struct _RAID_CONTEXT { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int8_t Type:4; u_int8_t nseg:4; +#else + u_int8_t nseg:4; + u_int8_t Type:4; +#endif u_int8_t resvd0; u_int16_t timeoutValue; u_int8_t regLockFlags; @@ -197,12 +205,19 @@ typedef struct _RAID_CONTEXT { * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames */ typedef struct _RAID_CONTEXT_G35 { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t Type:4; u_int16_t nseg:4; u_int16_t resvd0:8; +#else + u_int16_t resvd0:8; + u_int16_t nseg:4; + u_int16_t Type:4; +#endif u_int16_t timeoutValue; union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t reserved:1; u_int16_t sld:1; u_int16_t c2f:1; @@ -213,6 +228,18 @@ typedef struct _RAID_CONTEXT_G35 { u_int16_t log:1; u_int16_t cpuSel:4; u_int16_t setDivert:4; +#else + u_int16_t setDivert:4; + u_int16_t cpuSel:4; + u_int16_t log:1; + u_int16_t rw:1; + u_int16_t sbs:1; + u_int16_t sqn:1; + u_int16_t fwn:1; + u_int16_t c2f:1; + u_int16_t sld:1; + u_int16_t reserved:1; +#endif } bits; u_int16_t s; } routingFlags; @@ -228,9 +255,15 @@ typedef struct _RAID_CONTEXT_G35 { u_int8_t RAIDFlags; u_int8_t spanArm; u_int16_t configSeqNum; +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t numSGE:12; u_int16_t reserved:3; u_int16_t streamDetected:1; +#else + u_int16_t streamDetected:1; + u_int16_t reserved:3; + u_int16_t numSGE:12; +#endif u_int8_t resvd2[2]; } RAID_CONTEXT_G35; @@ -433,9 +466,15 @@ typedef struct _MR_TASK_MANAGE_REQUEST { MR_TM_REQUEST TmRequest; union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t isTMForLD:1; u_int32_t isTMForPD:1; u_int32_t reserved1:30; +#else + u_int32_t reserved1:30; + u_int32_t isTMForPD:1; + u_int32_t isTMForLD:1; +#endif u_int32_t reserved2; } tmReqFlags; MR_TM_REPLY TMReply; @@ -808,6 +847,7 @@ typedef struct _MR_SPAN_BLOCK_INFO { typedef struct _MR_LD_RAID { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t fpCapable:1; u_int32_t raCapable:1; u_int32_t reserved5:2; @@ -822,6 +862,22 @@ typedef struct _MR_LD_RAID { u_int32_t tmCapable:1; u_int32_t fpCacheBypassCapable:1; u_int32_t reserved4:5; +#else + u_int32_t reserved4:5; + u_int32_t fpCacheBypassCapable:1; + u_int32_t tmCapable:1; + u_int32_t fpNonRWCapable:1; + u_int32_t fpReadAcrossStripe:1; + u_int32_t fpWriteAcrossStripe:1; + u_int32_t fpReadCapable:1; + u_int32_t fpWriteCapable:1; + u_int32_t encryptionType:8; + u_int32_t pdPiMode:4; + u_int32_t ldPiMode:4; + u_int32_t reserved5:2; + u_int32_t raCapable:1; + u_int32_t fpCapable:1; +#endif } capability; u_int32_t reserved6; u_int64_t size; @@ -844,9 +900,15 @@ typedef struct _MR_LD_RAID { u_int16_t seqNum; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + u_int32_t reserved:30; + u_int32_t regTypeReqOnReadLsValid:1; + u_int32_t ldSyncRequired:1; +#else u_int32_t ldSyncRequired:1; u_int32_t regTypeReqOnReadLsValid:1; u_int32_t reserved:30; +#endif } flags; u_int8_t LUN[8]; @@ -854,9 +916,15 @@ typedef struct _MR_LD_RAID { u_int8_t reserved2[3]; u_int32_t logicalBlockLength; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + u_int32_t reserved1:24; + u_int32_t LdLogicalBlockExp:4; + u_int32_t LdPiExp:4; +#else u_int32_t LdPiExp:4; u_int32_t LdLogicalBlockExp:4; u_int32_t reserved1:24; +#endif } exponent; u_int8_t reserved3[0x80 - 0x38]; } MR_LD_RAID; @@ -1039,8 +1107,13 @@ struct MR_PD_CFG_SEQ { u_int16_t seqNum; u_int16_t devHandle; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int8_t tmCapable:1; u_int8_t reserved:7; +#else + u_int8_t reserved:7; + u_int8_t tmCapable:1; +#endif } capability; u_int8_t reserved; u_int16_t pdTargetId; @@ -1868,6 +1941,7 @@ struct mrsas_ctrl_prop { * structure. */ struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t copyBackDisabled:1; u_int32_t SMARTerEnabled:1; u_int32_t prCorrectUnconfiguredAreas:1; @@ -1899,6 +1973,39 @@ struct mrsas_ctrl_prop { u_int32_t enableSwZone:1; u_int32_t limitMaxRateSATA3G:1; u_int32_t reserved:2; +#else + u_int32_t reserved:2; + u_int32_t limitMaxRateSATA3G:1; + u_int32_t enableSwZone:1; + u_int32_t ignore64ldRestriction:1; + u_int32_t disableT10RebuildAssist:1; + u_int32_t disableImmediateIO:1; + u_int32_t enableAutoLockRecovery:1; + u_int32_t enableVirtualCache:1; + u_int32_t enableConfigAutoBalance:1; + u_int32_t forceSGPIOForQuadOnly:1; + u_int32_t useEmergencySparesforSMARTer:1; + u_int32_t useUnconfGoodForEmergency:1; + u_int32_t useGlobalSparesForEmergency:1; + u_int32_t preventPIImport:1; + u_int32_t enablePI:1; + u_int32_t useDiskActivityForLocate:1; + u_int32_t disableCacheBypass:1; + u_int32_t enableJBOD:1; + u_int32_t disableSpinDownHS:1; + u_int32_t allowBootWithPinnedCache:1; + u_int32_t disableOnlineCtrlReset:1; + u_int32_t enableSecretKeyControl:1; + u_int32_t autoEnhancedImport:1; + u_int32_t enableSpinDownUnconfigured:1; + u_int32_t SSDPatrolReadEnabled:1; + u_int32_t SSDSMARTerEnabled:1; + u_int32_t disableNCQ:1; + u_int32_t useFdeOnly:1; + u_int32_t prCorrectUnconfiguredAreas:1; + u_int32_t SMARTerEnabled:1; + u_int32_t copyBackDisabled:1; +#endif } OnOffProperties; u_int8_t autoSnapVDSpace; u_int8_t viewSpace; @@ -2170,6 +2277,7 @@ struct mrsas_ctrl_info { u_int16_t cacheMemorySize; /* 0x7A2 */ struct { /* 0x7A4 */ +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t supportPIcontroller:1; u_int32_t supportLdPIType1:1; u_int32_t supportLdPIType2:1; @@ -2194,6 +2302,30 @@ struct mrsas_ctrl_info { u_int32_t supportUnevenSpans:1; u_int32_t reserved:11; +#else + u_int32_t reserved:11; + u_int32_t supportUnevenSpans:1; + u_int32_t dedicatedHotSparesLimited:1; + u_int32_t headlessMode:1; + u_int32_t supportEmulatedDrives:1; + u_int32_t supportResetNow:1; + u_int32_t realTimeScheduler:1; + u_int32_t supportSSDPatrolRead:1; + u_int32_t supportPerfTuning:1; + u_int32_t disableOnlinePFKChange:1; + u_int32_t supportJBOD:1; + u_int32_t supportBootTimePFKChange:1; + u_int32_t supportSetLinkSpeed:1; + u_int32_t supportEmergencySpares:1; + u_int32_t supportSuspendResumeBGops:1; + u_int32_t blockSSDWriteCacheChange:1; + u_int32_t supportShieldState:1; + u_int32_t supportLdBBMInfo:1; + u_int32_t supportLdPIType3:1; + u_int32_t supportLdPIType2:1; + u_int32_t supportLdPIType1:1; + u_int32_t supportPIcontroller:1; +#endif } adapterOperations2; u_int8_t driverVersion[32]; /* 0x7A8 */ @@ -2206,6 +2338,7 @@ struct mrsas_ctrl_info { u_int8_t reserved5[2]; /* 0x7CD reserved */ struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t peerIsPresent:1; u_int32_t peerIsIncompatible:1; @@ -2214,6 +2347,15 @@ struct mrsas_ctrl_info { u_int32_t ctrlPropIncompatible:1; u_int32_t premiumFeatureMismatch:1; u_int32_t reserved:26; +#else + u_int32_t reserved:26; + u_int32_t premiumFeatureMismatch:1; + u_int32_t ctrlPropIncompatible:1; + u_int32_t fwVersionMismatch:1; + u_int32_t hwIncompatible:1; + u_int32_t peerIsIncompatible:1; + u_int32_t peerIsPresent:1; +#endif } cluster; char clusterId[16]; /* 0x7D4 */ @@ -2221,6 +2363,7 @@ struct mrsas_ctrl_info { char reserved6[4]; /* 0x7E4 RESERVED FOR IOV */ struct { /* 0x7E8 */ +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t supportPersonalityChange:2; u_int32_t supportThermalPollInterval:1; u_int32_t supportDisableImmediateIO:1; @@ -2246,11 +2389,39 @@ struct mrsas_ctrl_info { u_int32_t supportExtendedSSCSize:1; u_int32_t useSeqNumJbodFP:1; u_int32_t reserved:7; +#else + u_int32_t reserved:7; + u_int32_t useSeqNumJbodFP:1; + u_int32_t supportExtendedSSCSize:1; + u_int32_t supportDiskCacheSettingForSysPDs:1; + u_int32_t supportCPLDUpdate:1; + u_int32_t supportTTYLogCompression:1; + u_int32_t discardCacheDuringLDDelete:1; + u_int32_t supportSecurityonJBOD:1; + u_int32_t supportCacheBypassModes:1; + u_int32_t supportDisableSESMonitoring:1; + u_int32_t supportForceFlash:1; + u_int32_t supportNVDRAM:1; + u_int32_t supportDrvActivityLEDSetting:1; + u_int32_t supportAllowedOpsforDrvRemoval:1; + u_int32_t supportHOQRebuild:1; + u_int32_t supportForceTo512e:1; + u_int32_t supportNVCacheErase:1; + u_int32_t supportDebugQueue:1; + u_int32_t supportSwZone:1; + u_int32_t supportCrashDump:1; + u_int32_t supportMaxExtLDs:1; + u_int32_t supportT10RebuildAssist:1; + u_int32_t supportDisableImmediateIO:1; + u_int32_t supportThermalPollInterval:1; + u_int32_t supportPersonalityChange:2; +#endif } adapterOperations3; u_int8_t pad_cpld[16]; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t ctrlInfoExtSupported:1; u_int16_t supportIbuttonLess:1; u_int16_t supportedEncAlgo:1; @@ -2260,6 +2431,17 @@ struct mrsas_ctrl_info { u_int16_t supportPdMapTargetId:1; u_int16_t FWSwapsBBUVPDInfo:1; u_int16_t reserved:8; +#else + u_int16_t reserved:8; + u_int16_t FWSwapsBBUVPDInfo:1; + u_int16_t supportPdMapTargetId:1; + u_int16_t supportSESCtrlInMultipathCfg:1; + u_int16_t imageUploadSupported:1; + u_int16_t supportEncryptedMfc:1; + u_int16_t supportedEncAlgo:1; + u_int16_t supportIbuttonLess:1; + u_int16_t ctrlInfoExtSupported:1; +#endif } adapterOperations4; u_int8_t pad[0x800 - 0x7FE]; /* 0x7FE */ @@ -2332,6 +2514,7 @@ struct mrsas_ctrl_info { typedef union _MFI_CAPABILITIES { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t support_fp_remote_lun:1; u_int32_t support_additional_msix:1; u_int32_t support_fastpath_wb:1; @@ -2342,6 +2525,18 @@ typedef union _MFI_CAPABILITIES { u_int32_t support_ext_queue_depth:1; u_int32_t support_ext_io_size:1; u_int32_t reserved:23; +#else + u_int32_t reserved:23; + u_int32_t support_ext_io_size:1; + u_int32_t support_ext_queue_depth:1; + u_int32_t security_protocol_cmds_fw:1; + u_int32_t support_core_affinity:1; + u_int32_t support_ndrive_r1_lb:1; + u_int32_t support_max_255lds:1; + u_int32_t support_fastpath_wb:1; + u_int32_t support_additional_msix:1; + u_int32_t support_fp_remote_lun:1; +#endif } mfi_capabilities; u_int32_t reg; } MFI_CAPABILITIES; @@ -2602,9 +2797,15 @@ union mrsas_frame { #pragma pack(1) union mrsas_evt_class_locale { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t locale; u_int8_t reserved; int8_t class; +#else + int8_t class; + u_int8_t reserved; + u_int16_t locale; +#endif } __packed members; u_int32_t word; @@ -2890,6 +3091,7 @@ typedef struct _MRSAS_DRV_PCI_COMMON_HEADER { typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t linkSpeed:4; u_int32_t linkWidth:6; u_int32_t aspmSupport:2; @@ -2897,6 +3099,15 @@ typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { u_int32_t l1ExitLatency:3; u_int32_t rsvdp:6; u_int32_t portNumber:8; +#else + u_int32_t portNumber:8; + u_int32_t rsvdp:6; + u_int32_t l1ExitLatency:3; + u_int32_t losExitLatency:3; + u_int32_t aspmSupport:2; + u_int32_t linkWidth:6; + u_int32_t linkSpeed:4; +#endif } bits; u_int32_t asUlong; @@ -2908,12 +3119,21 @@ typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY { union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t linkSpeed:4; u_int16_t negotiatedLinkWidth:6; u_int16_t linkTrainingError:1; u_int16_t linkTraning:1; u_int16_t slotClockConfig:1; u_int16_t rsvdZ:3; +#else + u_int16_t rsvdZ:3; + u_int16_t slotClockConfig:1; + u_int16_t linkTraning:1; + u_int16_t linkTrainingError:1; + u_int16_t negotiatedLinkWidth:6; + u_int16_t linkSpeed:4; +#endif } bits; u_int16_t asUshort; @@ -2967,6 +3187,7 @@ union MR_PD_DDF_TYPE { struct { union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t forcedPDGUID:1; u_int16_t inVD:1; u_int16_t isGlobalSpare:1; @@ -2974,6 +3195,15 @@ union MR_PD_DDF_TYPE { u_int16_t isForeign:1; u_int16_t reserved:7; u_int16_t intf:4; +#else + u_int16_t intf:4; + u_int16_t reserved:7; + u_int16_t isForeign:1; + u_int16_t isSpare:1; + u_int16_t isGlobalSpare:1; + u_int16_t inVD:1; + u_int16_t forcedPDGUID:1; +#endif } pdType; u_int16_t type; }; @@ -3004,6 +3234,7 @@ union MR_PROGRESS { */ struct MR_PD_PROGRESS { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t rbld:1; u_int32_t patrol:1; u_int32_t clear:1; @@ -3011,6 +3242,15 @@ struct MR_PD_PROGRESS { u_int32_t erase:1; u_int32_t locate:1; u_int32_t reserved:26; *** 783 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Wed Feb 3 22:08: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 84B5352DF80; Wed, 3 Feb 2021 22:08:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWG6B3PY4z3tLq; Wed, 3 Feb 2021 22:08: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 67DE4288B5; Wed, 3 Feb 2021 22:08: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 113M8YMC089659; Wed, 3 Feb 2021 22:08:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113M8Yc0089658; Wed, 3 Feb 2021 22:08:34 GMT (envelope-from git) Date: Wed, 3 Feb 2021 22:08:34 GMT Message-Id: <202102032208.113M8Yc0089658@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: 9fac05ba79a4 - main - [POWERPC64BE] add mrsas driver to GENERIC64 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: 9fac05ba79a4ea11c7a1ea45fb928da178e2fe95 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:08:34 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=9fac05ba79a4ea11c7a1ea45fb928da178e2fe95 commit 9fac05ba79a4ea11c7a1ea45fb928da178e2fe95 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-04 01:02:28 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-04 01:06:29 +0000 [POWERPC64BE] add mrsas driver to GENERIC64 Submitted by: Andre Fernando da Silva Reviewed by: luporl, alfredo, kadesai (on email) Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D26531 --- sys/powerpc/conf/GENERIC64 | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 16a33160aa34..e19052379c4a 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -144,6 +144,7 @@ device ahc # AHA2940 and onboard AIC7xxx devices options AHC_ALLOW_MEMIO # Attempt to use memory mapped I/O device isp # Qlogic family 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 sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D From owner-dev-commits-src-all@freebsd.org Wed Feb 3 23:00: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 A5EC752EFF2; Wed, 3 Feb 2021 23:00: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 4DWHFw4LCfz4RMm; Wed, 3 Feb 2021 23:00: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 880F62923F; Wed, 3 Feb 2021 23:00: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 113N0KKa061685; Wed, 3 Feb 2021 23:00:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 113N0KoV061681; Wed, 3 Feb 2021 23:00:20 GMT (envelope-from git) Date: Wed, 3 Feb 2021 23:00:20 GMT Message-Id: <202102032300.113N0KoV061681@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: cb7cc72c546e - main - serf: Fix the default return value of the BIO control method. 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: cb7cc72c546e0f87598961c3860e17391f42866c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:00:20 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cb7cc72c546e0f87598961c3860e17391f42866c commit cb7cc72c546e0f87598961c3860e17391f42866c Author: John Baldwin AuthorDate: 2021-02-03 22:59:32 +0000 Commit: John Baldwin CommitDate: 2021-02-03 22:59:32 +0000 serf: Fix the default return value of the BIO control method. OpenSSL BIO classes provide an abstraction for dealing with I/O. OpenSSL provides BIO classes for commonly used I/O primitives backed by file descriptors, sockets, etc. as well as permitting consumers of OpenSSL to define custom BIO classes. One of the methods BIO classes implement is a control method invoked by BIO_ctrl() for various ancilliary tasks somewhat analgous to fcntl() and ioctl() on file descriptors. According to the BIO_ctrl(3) manual page, control methods should return 0 for unknown control requests. KTLS support in OpenSSL adds new control requests. Two of those new requests are queries to determine if KTLS is enabled for either reading or writing. These control reuquest return 1 if KTLS is enabled and 0 if it is not. serf includes two custom BIO classes for wrapping I/O requests from files and from a buffer in memory. These BIO classes both use a custom control method. However, this custom control method was returning 1 for unknown or unsupported control requests instead of 0. As a result, OpenSSL with KTLS believed that these BIOs were using KTLS and were thus adding headers and doing encryption/decryption in the BIO. Correcting the return value removes this confusion. PR: 253135 Reported by: Guido Falsi Reviewed by: emaste MFC after: 3 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28472 --- contrib/serf/buckets/ssl_buckets.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/serf/buckets/ssl_buckets.c b/contrib/serf/buckets/ssl_buckets.c index b01e5359db08..3c8b7e2a685f 100644 --- a/contrib/serf/buckets/ssl_buckets.c +++ b/contrib/serf/buckets/ssl_buckets.c @@ -407,7 +407,7 @@ static int bio_bucket_destroy(BIO *bio) static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) { - long ret = 1; + long ret = 0; switch (cmd) { default: @@ -415,6 +415,7 @@ static long bio_bucket_ctrl(BIO *bio, int cmd, long num, void *ptr) break; case BIO_CTRL_FLUSH: /* At this point we can't force a flush. */ + ret = 1; break; case BIO_CTRL_PUSH: case BIO_CTRL_POP: From owner-dev-commits-src-all@freebsd.org Thu Feb 4 02:31: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 A3C75534165; Thu, 4 Feb 2021 02:31: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 4DWMy54H2cz4fFY; Thu, 4 Feb 2021 02:31: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 854DC2BF90; Thu, 4 Feb 2021 02:31: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 1142VvoB040070; Thu, 4 Feb 2021 02:31:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1142VvLK040069; Thu, 4 Feb 2021 02:31:57 GMT (envelope-from git) Date: Thu, 4 Feb 2021 02:31:57 GMT Message-Id: <202102040231.1142VvLK040069@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: bf96a6c762a7 - stable/12 - Remove FirstBurstLength limit for software iSCSI. 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: bf96a6c762a79d974bd71322cd37e23984e0f3f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:31:57 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=bf96a6c762a79d974bd71322cd37e23984e0f3f3 commit bf96a6c762a79d974bd71322cd37e23984e0f3f3 Author: Alexander Motin AuthorDate: 2021-01-21 02:33:14 +0000 Commit: Alexander Motin CommitDate: 2021-02-04 02:31:54 +0000 Remove FirstBurstLength limit for software iSCSI. For hardware offload solicited data may potentially be handled more efficiently than unsolicited due to direct data placement. Or there can be some unsolicited write buffering limitations. It may create situations where FirstBurstLength limit is really useful. Software driver though has no those factors, having to do memcopy() any way and having no so hard limit on the temporary storage. Same time more active use of unsolicited transfers allows to avoid some of Ready To Transfer (R2T) PDU round-trip times and processing. This change effectively doubles from 64KB to 128KB the maximum size of write command that can be transferred within one link RTT. Tests of (64KB, 128KB] QD1 writes mixed with simultaneous QD8 reads over the same connection, increasing RTT, shows almost double write speed and half latency, while we should be able to afford few megabytes of RAM for additional buffering on a target these days. Sponsored by: iXsystems, Inc. (cherry picked from commit ff751ee05c939eceab25c26ad60b1d56f989aec9) --- 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 a9b787a25420..dd9210642ffa 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -1454,7 +1454,7 @@ icl_soft_limits(struct icl_drv_limits *idl) idl->idl_max_recv_data_segment_length = 128 * 1024; idl->idl_max_send_data_segment_length = 128 * 1024; idl->idl_max_burst_length = 262144; - idl->idl_first_burst_length = 65536; + idl->idl_first_burst_length = idl->idl_max_burst_length; return (0); } From owner-dev-commits-src-all@freebsd.org Thu Feb 4 02:56: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 81CE253494F; Thu, 4 Feb 2021 02:56: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 4DWNV13KHLz4ggM; Thu, 4 Feb 2021 02:56: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 609B12C536; Thu, 4 Feb 2021 02:56: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 1142u9Zx067038; Thu, 4 Feb 2021 02:56:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1142u9pA067037; Thu, 4 Feb 2021 02:56:09 GMT (envelope-from git) Date: Thu, 4 Feb 2021 02:56:09 GMT Message-Id: <202102040256.1142u9pA067037@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: 1535f6701704 - stable/13 - ofed: fix the WITH_OFED_EXTRA build 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: 1535f6701704ef5bc58768490b05cbf0b0958671 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:56:09 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=1535f6701704ef5bc58768490b05cbf0b0958671 commit 1535f6701704ef5bc58768490b05cbf0b0958671 Author: Kyle Evans AuthorDate: 2021-01-30 05:48:28 +0000 Commit: Kyle Evans CommitDate: 2021-02-04 02:55:56 +0000 ofed: fix the WITH_OFED_EXTRA build This option was not tested when WARNS was globally lifted in the src tree up to 6. Drop WARNS back down to unbreak the build; note that this is still enabling more warnings than it had before the WARNS change, so the gcc build may need to be independently evaluated at this level. PR: 252865 (cherry picked from commit 9ca71db4959f674d75f7b4fd0f72bdc1e2e99abb) --- usr.bin/ofed/opensm/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/ofed/opensm/Makefile b/usr.bin/ofed/opensm/Makefile index 2c1f504dc191..738b6ace31a1 100644 --- a/usr.bin/ofed/opensm/Makefile +++ b/usr.bin/ofed/opensm/Makefile @@ -99,4 +99,6 @@ CFLAGS+= -I${_spath:H} -DHAVE_CONFIG_H=1 CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband LIBADD= opensm osmvendor osmcomp wrap pthread +WARNS?= 2 + .include From owner-dev-commits-src-all@freebsd.org Thu Feb 4 02:56: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 98D0C534950; Thu, 4 Feb 2021 02:56: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 4DWNV240Nhz4gRQ; Thu, 4 Feb 2021 02:56: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 7A7022C2B8; Thu, 4 Feb 2021 02:56: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 1142uA6r067057; Thu, 4 Feb 2021 02:56:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1142uAJa067056; Thu, 4 Feb 2021 02:56:10 GMT (envelope-from git) Date: Thu, 4 Feb 2021 02:56:10 GMT Message-Id: <202102040256.1142uAJa067056@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: f31de79df28a - stable/13 - kerberos5: fix the WITH_OPENLDAP build 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: f31de79df28a75f0ecbac8fc0cd909c5c78eefd0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:56:10 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f31de79df28a75f0ecbac8fc0cd909c5c78eefd0 commit f31de79df28a75f0ecbac8fc0cd909c5c78eefd0 Author: Kyle Evans AuthorDate: 2021-01-30 06:07:17 +0000 Commit: Kyle Evans CommitDate: 2021-02-04 02:55:59 +0000 kerberos5: fix the WITH_OPENLDAP build Restore WARNS to its former glory prior to the global WARNS change to fix the build. (cherry picked from commit e948d980f78dd2789060b46d3d03ba0d96b23b59) --- kerberos5/lib/libhdb/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kerberos5/lib/libhdb/Makefile b/kerberos5/lib/libhdb/Makefile index 29ba7d2c58a2..fda622d6945a 100644 --- a/kerberos5/lib/libhdb/Makefile +++ b/kerberos5/lib/libhdb/Makefile @@ -7,6 +7,8 @@ LIBADD= asn1 com_err krb5 roken sqlite3 LDADD= ${LDAPLDADD} DPADD= ${LDAPDPADD} +WARNS?= 0 + MAN= HDB.3 hdb_entry_ex.3 MLINKS= HDB.3 hdb__del.3 \ From owner-dev-commits-src-all@freebsd.org Thu Feb 4 02:56: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 16714534D5A; Thu, 4 Feb 2021 02:56: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 4DWNV35d7fz4gcp; Thu, 4 Feb 2021 02:56: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 9D98C2C2B9; Thu, 4 Feb 2021 02:56: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 1142uB7e067075; Thu, 4 Feb 2021 02:56:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1142uBgv067074; Thu, 4 Feb 2021 02:56:11 GMT (envelope-from git) Date: Thu, 4 Feb 2021 02:56:11 GMT Message-Id: <202102040256.1142uBgv067074@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: d37a305bc52f - stable/13 - build: options: mention ports in the WITH_OPENLDAP description 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: d37a305bc52fdb6337c012f869fc54dba9408842 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:56:12 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d37a305bc52fdb6337c012f869fc54dba9408842 commit d37a305bc52fdb6337c012f869fc54dba9408842 Author: Kyle Evans AuthorDate: 2021-01-30 06:09:10 +0000 Commit: Kyle Evans CommitDate: 2021-02-04 02:56:01 +0000 build: options: mention ports in the WITH_OPENLDAP description There's a third party dependency on this option; currently, net/openldap24-{,sasl-}client. At least mention that an openldap from ports is needed for this option. PR: 252866 (cherry picked from commit 7587d9823a8257b9a2d5b2e58c707026061058c6) --- share/man/man5/src.conf.5 | 4 ++-- tools/build/options/WITH_OPENLDAP | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index dafeb1efa248..6c02df1ac7de 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 January 28, 2021 +.Dd January 30, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1257,7 +1257,7 @@ Set to build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack, mostly examples. .It Va WITH_OPENLDAP -Enable building openldap support for kerberos. +Enable building LDAP support for kerberos using an openldap client from ports. .It Va WITHOUT_OPENMP Set to not build LLVM's OpenMP runtime. .Pp diff --git a/tools/build/options/WITH_OPENLDAP b/tools/build/options/WITH_OPENLDAP index 75f96822eb8c..c815e6160726 100644 --- a/tools/build/options/WITH_OPENLDAP +++ b/tools/build/options/WITH_OPENLDAP @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Enable building openldap support for kerberos. +Enable building LDAP support for kerberos using an openldap client from ports. From owner-dev-commits-src-all@freebsd.org Thu Feb 4 03: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 38FC6535296; Thu, 4 Feb 2021 03: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 4DWNb80jklz4hXH; Thu, 4 Feb 2021 03:00: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 09DA62BF6F; Thu, 4 Feb 2021 03:00: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 11430Zds075239; Thu, 4 Feb 2021 03:00:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11430Z1N075238; Thu, 4 Feb 2021 03:00:35 GMT (envelope-from git) Date: Thu, 4 Feb 2021 03:00:35 GMT Message-Id: <202102040300.11430Z1N075238@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: d0982de778a6 - stable/13 - [POWERPC64BE] mrsas: add 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d0982de778a678f4558c9444d585689c254f7850 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 03:00:36 -0000 The branch stable/13 has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=d0982de778a678f4558c9444d585689c254f7850 commit d0982de778a678f4558c9444d585689c254f7850 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-04 00:52:19 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-04 05:58:19 +0000 [POWERPC64BE] mrsas: add big-endian support Add endiannes conversions in order to support big-endian platforms Submitted by: Andre Fernando da Silva Reviewed by: luporl, alfredo, kadesai (on email) Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D26531 --- sys/dev/mrsas/mrsas.c | 198 ++++++++++++++++--------------- sys/dev/mrsas/mrsas.h | 289 +++++++++++++++++++++++++++++++++++++++++++++- sys/dev/mrsas/mrsas_cam.c | 54 ++++----- sys/dev/mrsas/mrsas_fp.c | 170 ++++++++++++++------------- 4 files changed, 510 insertions(+), 201 deletions(-) diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index 32d85c803938..f4c34e237fc4 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * Function prototypes @@ -619,13 +620,13 @@ mrsas_get_seq_num(struct mrsas_softc *sc, dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0x0; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_evt_log_info); - dcmd->opcode = MR_DCMD_CTRL_EVENT_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = sc->el_info_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_log_info); + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_evt_log_info)); + dcmd->opcode = htole32(MR_DCMD_CTRL_EVENT_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(sc->el_info_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_evt_log_info)); retcode = mrsas_issue_blocked_cmd(sc, cmd); if (retcode == ETIMEDOUT) @@ -681,7 +682,7 @@ mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, curr_aen.word = class_locale_word; if (sc->aen_cmd) { - prev_aen.word = sc->aen_cmd->frame->dcmd.mbox.w[1]; + prev_aen.word = le32toh(sc->aen_cmd->frame->dcmd.mbox.w[1]); /* * A class whose enum value is smaller is inclusive of all @@ -732,16 +733,16 @@ mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0x0; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_evt_detail); - dcmd->opcode = MR_DCMD_CTRL_EVENT_WAIT; - dcmd->mbox.w[0] = seq_num; + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_evt_detail)); + dcmd->opcode = htole32(MR_DCMD_CTRL_EVENT_WAIT); + dcmd->mbox.w[0] = htole32(seq_num); sc->last_seq_num = seq_num; - dcmd->mbox.w[1] = curr_aen.word; - dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->evt_detail_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_detail); + dcmd->mbox.w[1] = htole32(curr_aen.word); + dcmd->sgl.sge32[0].phys_addr = htole32((u_int32_t)sc->evt_detail_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_evt_detail)); if (sc->aen_cmd != NULL) { mrsas_release_mfi_cmd(cmd); @@ -907,9 +908,6 @@ mrsas_attach(device_t dev) * Set up PCI and registers */ cmd = pci_read_config(dev, PCIR_COMMAND, 2); - if ((cmd & PCIM_CMD_PORTEN) == 0) { - return (ENXIO); - } /* Force the busmaster enable bit on. */ cmd |= PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 2); @@ -1704,7 +1702,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) /* Find our reply descriptor for the command and process */ while ((desc_val.u.low != 0xFFFFFFFF) && (desc_val.u.high != 0xFFFFFFFF)) { - smid = reply_desc->SMID; + smid = le16toh(reply_desc->SMID); cmd_mpt = sc->mpt_cmd_list[smid - 1]; scsi_io_req = (MRSAS_RAID_SCSI_IO_REQUEST *) cmd_mpt->io_request; @@ -1736,7 +1734,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) case MRSAS_MPI2_FUNCTION_LD_IO_REQUEST: if (cmd_mpt->r1_alt_dev_handle == MR_DEVHANDLE_INVALID) { mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, - extStatus, data_length, sense); + extStatus, le32toh(data_length), sense); mrsas_cmd_done(sc, cmd_mpt); mrsas_atomic_dec(&sc->fw_outstanding); } else { @@ -1764,7 +1762,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) mrsas_release_mpt_cmd(r1_cmd); mrsas_atomic_dec(&sc->fw_outstanding); mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, - extStatus, data_length, sense); + extStatus, le32toh(data_length), sense); mrsas_cmd_done(sc, cmd_mpt); mrsas_atomic_dec(&sc->fw_outstanding); } @@ -1778,7 +1776,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) * And also make sure that the issue_polled call should only be * used if INTERRUPT IS DISABLED. */ - if (cmd_mfi->frame->hdr.flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) + if (cmd_mfi->frame->hdr.flags & htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)) mrsas_release_mfi_cmd(cmd_mfi); else mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); @@ -2593,6 +2591,13 @@ mrsas_init_adapter(struct mrsas_softc *sc) (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); + + mrsas_dprint(sc, MRSAS_TRACE, "%s: sc->reply_q_depth 0x%x," + "sc->request_alloc_sz 0x%x, sc->reply_alloc_sz 0x%x," + "sc->io_frames_alloc_sz 0x%x\n", __func__, + sc->reply_q_depth, sc->request_alloc_sz, + sc->reply_alloc_sz, sc->io_frames_alloc_sz); + /* * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set, * Firmware support extended IO chain frame which is 4 time more @@ -2617,8 +2622,10 @@ mrsas_init_adapter(struct mrsas_softc *sc) mrsas_dprint(sc, MRSAS_INFO, "max sge: 0x%x, max chain frame size: 0x%x, " - "max fw cmd: 0x%x\n", sc->max_num_sge, - sc->max_chain_frame_sz, sc->max_fw_cmds); + "max fw cmd: 0x%x sc->chain_frames_alloc_sz: 0x%x\n", + sc->max_num_sge, + sc->max_chain_frame_sz, sc->max_fw_cmds, + sc->chain_frames_alloc_sz); /* Used for pass thru MFI frame (DCMD) */ sc->chain_offset_mfi_pthru = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 16; @@ -2738,19 +2745,19 @@ mrsas_ioc_init(struct mrsas_softc *sc) IOCInitMsg = (pMpi2IOCInitRequest_t)(((char *)sc->ioc_init_mem) + 1024); IOCInitMsg->Function = MPI2_FUNCTION_IOC_INIT; IOCInitMsg->WhoInit = MPI2_WHOINIT_HOST_DRIVER; - IOCInitMsg->MsgVersion = MPI2_VERSION; - IOCInitMsg->HeaderVersion = MPI2_HEADER_VERSION; - IOCInitMsg->SystemRequestFrameSize = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4; - IOCInitMsg->ReplyDescriptorPostQueueDepth = sc->reply_q_depth; - IOCInitMsg->ReplyDescriptorPostQueueAddress = sc->reply_desc_phys_addr; - IOCInitMsg->SystemRequestFrameBaseAddress = sc->io_request_phys_addr; + IOCInitMsg->MsgVersion = htole16(MPI2_VERSION); + IOCInitMsg->HeaderVersion = htole16(MPI2_HEADER_VERSION); + IOCInitMsg->SystemRequestFrameSize = htole16(MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4); + IOCInitMsg->ReplyDescriptorPostQueueDepth = htole16(sc->reply_q_depth); + IOCInitMsg->ReplyDescriptorPostQueueAddress = htole64(sc->reply_desc_phys_addr); + IOCInitMsg->SystemRequestFrameBaseAddress = htole64(sc->io_request_phys_addr); IOCInitMsg->HostMSIxVectors = (sc->msix_vectors > 0 ? sc->msix_vectors : 0); IOCInitMsg->HostPageSize = MR_DEFAULT_NVME_PAGE_SHIFT; init_frame = (struct mrsas_init_frame *)sc->ioc_init_mem; init_frame->cmd = MFI_CMD_INIT; init_frame->cmd_status = 0xFF; - init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; + init_frame->flags |= htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE); /* driver support Extended MSIX */ if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { @@ -2768,11 +2775,16 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; if (sc->max_chain_frame_sz > MEGASAS_CHAIN_FRAME_SZ_MIN) init_frame->driver_operations.mfi_capabilities.support_ext_io_size = 1; + + init_frame->driver_operations.reg = htole32(init_frame->driver_operations.reg); + phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; - init_frame->queue_info_new_phys_addr_lo = phys_addr; - init_frame->data_xfer_len = sizeof(Mpi2IOCInitRequest_t); + init_frame->queue_info_new_phys_addr_lo = htole32(phys_addr); + init_frame->data_xfer_len = htole32(sizeof(Mpi2IOCInitRequest_t)); + + req_desc.addr.u.low = htole32((bus_addr_t)sc->ioc_init_phys_mem & 0xFFFFFFFF); + req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); - req_desc.addr.Words = (bus_addr_t)sc->ioc_init_phys_mem; req_desc.MFAIo.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); @@ -2923,9 +2935,9 @@ mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, { mtx_lock(&sc->pci_lock); mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_low_queue_port), - req_desc_lo); + le32toh(req_desc_lo)); mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_high_queue_port), - req_desc_hi); + le32toh(req_desc_hi)); mtx_unlock(&sc->pci_lock); } @@ -2944,7 +2956,7 @@ mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, { if (sc->atomic_desc_support) mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_single_queue_port), - req_desc_lo); + le32toh(req_desc_lo)); else mrsas_write_64bit_req_desc(sc, req_desc_lo, req_desc_hi); } @@ -3103,7 +3115,6 @@ mrsas_ocr_thread(void *arg) sc = (struct mrsas_softc *)arg; mrsas_dprint(sc, MRSAS_TRACE, "%s\n", __func__); - sc->ocr_thread_active = 1; mtx_lock(&sc->sim_lock); for (;;) { @@ -3642,10 +3653,10 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) dcmd->flags = MFI_FRAME_DIR_READ; dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_ctrl_info); - dcmd->opcode = MR_DCMD_CTRL_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = sc->ctlr_info_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_ctrl_info)); + dcmd->opcode = htole32(MR_DCMD_CTRL_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(sc->ctlr_info_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_ctrl_info)); if (!sc->mask_interrupts) retcode = mrsas_issue_blocked_cmd(sc, cmd); @@ -3654,8 +3665,13 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) if (retcode == ETIMEDOUT) goto dcmd_timeout; - else + else { memcpy(sc->ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); + le32_to_cpus(&sc->ctrl_info->properties.OnOffProperties); + le32_to_cpus(&sc->ctrl_info->adapterOperations2); + le32_to_cpus(&sc->ctrl_info->adapterOperations3); + le16_to_cpus(&sc->ctrl_info->adapterOperations4); + } do_ocr = 0; mrsas_update_ext_vd_details(sc); @@ -3813,7 +3829,7 @@ mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) int i, retcode = SUCCESS; frame_hdr->cmd_status = 0xFF; - frame_hdr->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; + frame_hdr->flags |= htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE); /* Issue the frame using inbound queue port */ if (mrsas_issue_dcmd(sc, cmd)) { @@ -3892,7 +3908,7 @@ mrsas_build_mpt_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) req_desc->addr.Words = 0; req_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - req_desc->SCSIIO.SMID = index; + req_desc->SCSIIO.SMID = htole16(index); return (req_desc); } @@ -3927,7 +3943,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cm * mrsas_complete_cmd. */ - if (frame_hdr->flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) + if (frame_hdr->flags & htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)) mpt_cmd->flags = MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; io_req = mpt_cmd->io_request; @@ -3944,12 +3960,12 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cm io_req->SGLOffset0 = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 4; io_req->ChainOffset = sc->chain_offset_mfi_pthru; - mpi25_ieee_chain->Address = mfi_cmd->frame_phys_addr; + mpi25_ieee_chain->Address = htole64(mfi_cmd->frame_phys_addr); mpi25_ieee_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR; - mpi25_ieee_chain->Length = sc->max_chain_frame_sz; + mpi25_ieee_chain->Length = htole32(sc->max_chain_frame_sz); return (0); } @@ -4100,7 +4116,7 @@ mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd break; } /* See if got an event notification */ - if (cmd->frame->dcmd.opcode == MR_DCMD_CTRL_EVENT_WAIT) + if (le32toh(cmd->frame->dcmd.opcode) == MR_DCMD_CTRL_EVENT_WAIT) mrsas_complete_aen(sc, cmd); else mrsas_wakeup(sc, cmd); @@ -4264,14 +4280,14 @@ megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) dcmd->sge_count = 1; dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = (pd_seq_map_sz); - dcmd->opcode = (MR_DCMD_SYSTEM_PD_MAP_GET_INFO); - dcmd->sgl.sge32[0].phys_addr = (pd_seq_h); - dcmd->sgl.sge32[0].length = (pd_seq_map_sz); + dcmd->data_xfer_len = htole32(pd_seq_map_sz); + dcmd->opcode = htole32(MR_DCMD_SYSTEM_PD_MAP_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(pd_seq_h & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(pd_seq_map_sz); if (pend) { dcmd->mbox.b[0] = MRSAS_DCMD_MBOX_PEND_FLAG; - dcmd->flags = (MFI_FRAME_DIR_WRITE); + dcmd->flags = htole16(MFI_FRAME_DIR_WRITE); sc->jbod_seq_cmd = cmd; if (mrsas_issue_dcmd(sc, cmd)) { device_printf(sc->mrsas_dev, @@ -4280,13 +4296,13 @@ megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) } else return 0; } else - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); retcode = mrsas_issue_polled(sc, cmd); if (retcode == ETIMEDOUT) goto dcmd_timeout; - if (pd_sync->count > MAX_PHYSICAL_DEVICES) { + if (le32toh(pd_sync->count) > MAX_PHYSICAL_DEVICES) { device_printf(sc->mrsas_dev, "driver supports max %d JBOD, but FW reports %d\n", MAX_PHYSICAL_DEVICES, pd_sync->count); @@ -4364,13 +4380,13 @@ mrsas_get_ld_map_info(struct mrsas_softc *sc) dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sc->current_map_sz; - dcmd->opcode = MR_DCMD_LD_MAP_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = map_phys_addr; - dcmd->sgl.sge32[0].length = sc->current_map_sz; + dcmd->data_xfer_len = htole32(sc->current_map_sz); + dcmd->opcode = htole32(MR_DCMD_LD_MAP_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(map_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sc->current_map_sz); retcode = mrsas_issue_polled(sc, cmd); if (retcode == ETIMEDOUT) @@ -4427,15 +4443,15 @@ mrsas_sync_map_info(struct mrsas_softc *sc) dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_WRITE; + dcmd->flags = htole16(MFI_FRAME_DIR_WRITE); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sc->current_map_sz; + dcmd->data_xfer_len = htole32(sc->current_map_sz); dcmd->mbox.b[0] = num_lds; dcmd->mbox.b[1] = MRSAS_DCMD_MBOX_PEND_FLAG; - dcmd->opcode = MR_DCMD_LD_MAP_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = map_phys_addr; - dcmd->sgl.sge32[0].length = sc->current_map_sz; + dcmd->opcode = htole32(MR_DCMD_LD_MAP_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32(map_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sc->current_map_sz); sc->map_update_cmd = cmd; if (mrsas_issue_dcmd(sc, cmd)) { @@ -4472,17 +4488,17 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) memset(sc->pd_info_mem, 0, sizeof(struct mrsas_pd_info)); memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); - dcmd->mbox.s[0] = device_id; + dcmd->mbox.s[0] = htole16(device_id); dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; dcmd->flags = MFI_FRAME_DIR_READ; dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = sizeof(struct mrsas_pd_info); - dcmd->opcode = MR_DCMD_PD_GET_INFO; - dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->pd_info_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_pd_info); + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_pd_info)); + dcmd->opcode = htole32(MR_DCMD_PD_GET_INFO); + dcmd->sgl.sge32[0].phys_addr = htole32((u_int32_t)sc->pd_info_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_pd_info)); if (!sc->mask_interrupts) retcode = mrsas_issue_blocked_cmd(sc, cmd); @@ -4493,7 +4509,7 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) goto dcmd_timeout; sc->target_list[device_id].interface_type = - sc->pd_info_mem->state.ddf.pdType.intf; + le16toh(sc->pd_info_mem->state.ddf.pdType.intf); do_ocr = 0; @@ -4572,6 +4588,7 @@ mrsas_get_pd_list(struct mrsas_softc *sc) struct MR_PD_ADDRESS *pd_addr; bus_addr_t pd_list_phys_addr = 0; struct mrsas_tmp_dcmd *tcmd; + u_int16_t dev_id; cmd = mrsas_get_mfi_cmd(sc); if (!cmd) { @@ -4601,13 +4618,13 @@ mrsas_get_pd_list(struct mrsas_softc *sc) dcmd->cmd = MFI_CMD_DCMD; dcmd->cmd_status = 0xFF; dcmd->sge_count = 1; - dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->flags = htole16(MFI_FRAME_DIR_READ); dcmd->timeout = 0; dcmd->pad_0 = 0; - dcmd->data_xfer_len = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); - dcmd->opcode = MR_DCMD_PD_LIST_QUERY; - dcmd->sgl.sge32[0].phys_addr = pd_list_phys_addr; - dcmd->sgl.sge32[0].length = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); + dcmd->data_xfer_len = htole32(MRSAS_MAX_PD * sizeof(struct MR_PD_LIST)); + dcmd->opcode = htole32(MR_DCMD_PD_LIST_QUERY); + dcmd->sgl.sge32[0].phys_addr = htole32(pd_list_phys_addr & 0xFFFFFFFF); + dcmd->sgl.sge32[0].length = htole32(MRSAS_MAX_PD * sizeof(struct MR_PD_LIST)); if (!sc->mask_interrupts) retcode = mrsas_issue_blocked_cmd(sc, cmd); @@ -4620,17 +4637,18 @@ mrsas_get_pd_list(struct mrsas_softc *sc) /* Get the instance PD list */ pd_count = MRSAS_MAX_PD; pd_addr = pd_list_mem->addr; - if (pd_list_mem->count < pd_count) { + if (le32toh(pd_list_mem->count) < pd_count) { memset(sc->local_pd_list, 0, MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); - for (pd_index = 0; pd_index < pd_list_mem->count; pd_index++) { - sc->local_pd_list[pd_addr->deviceId].tid = pd_addr->deviceId; - sc->local_pd_list[pd_addr->deviceId].driveType = - pd_addr->scsiDevType; - sc->local_pd_list[pd_addr->deviceId].driveState = + for (pd_index = 0; pd_index < le32toh(pd_list_mem->count); pd_index++) { + dev_id = le16toh(pd_addr->deviceId); + sc->local_pd_list[dev_id].tid = dev_id; + sc->local_pd_list[dev_id].driveType = + le16toh(pd_addr->scsiDevType); + sc->local_pd_list[dev_id].driveState = MR_PD_STATE_SYSTEM; - if (sc->target_list[pd_addr->deviceId].target_id == 0xffff) - mrsas_add_target(sc, pd_addr->deviceId); + if (sc->target_list[dev_id].target_id == 0xffff) + mrsas_add_target(sc, dev_id); pd_addr++; } for (pd_index = 0; pd_index < MRSAS_MAX_PD; pd_index++) { @@ -4711,10 +4729,10 @@ mrsas_get_ld_list(struct mrsas_softc *sc) dcmd->sge_count = 1; dcmd->flags = MFI_FRAME_DIR_READ; dcmd->timeout = 0; - dcmd->data_xfer_len = sizeof(struct MR_LD_LIST); - dcmd->opcode = MR_DCMD_LD_GET_LIST; - dcmd->sgl.sge32[0].phys_addr = ld_list_phys_addr; - dcmd->sgl.sge32[0].length = sizeof(struct MR_LD_LIST); + dcmd->data_xfer_len = htole32(sizeof(struct MR_LD_LIST)); + dcmd->opcode = htole32(MR_DCMD_LD_GET_LIST); + dcmd->sgl.sge32[0].phys_addr = htole32(ld_list_phys_addr); + dcmd->sgl.sge32[0].length = htole32(sizeof(struct MR_LD_LIST)); dcmd->pad_0 = 0; if (!sc->mask_interrupts) @@ -4730,10 +4748,10 @@ mrsas_get_ld_list(struct mrsas_softc *sc) #endif /* Get the instance LD list */ - if (ld_list_mem->ldCount <= sc->fw_supported_vd_count) { - sc->CurLdCount = ld_list_mem->ldCount; + if (le32toh(ld_list_mem->ldCount) <= sc->fw_supported_vd_count) { + sc->CurLdCount = le32toh(ld_list_mem->ldCount); memset(sc->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT); - for (ld_index = 0; ld_index < ld_list_mem->ldCount; ld_index++) { + for (ld_index = 0; ld_index < le32toh(ld_list_mem->ldCount); ld_index++) { ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; drv_tgt_id = ids + MRSAS_MAX_PD; if (ld_list_mem->ldList[ld_index].state != 0) { diff --git a/sys/dev/mrsas/mrsas.h b/sys/dev/mrsas/mrsas.h index fbb08215b7b1..069db02fadff 100644 --- a/sys/dev/mrsas/mrsas.h +++ b/sys/dev/mrsas/mrsas.h @@ -165,14 +165,22 @@ do { \ device_printf(sc->mrsas_dev, msg, ##args); \ } while (0) +#define le32_to_cpus(x) do { *((u_int32_t *)(x)) = le32toh((*(u_int32_t *)x)); } while (0) +#define le16_to_cpus(x) do { *((u_int16_t *)(x)) = le16toh((*(u_int16_t *)x)); } while (0) + /**************************************************************************** * Raid Context structure which describes MegaRAID specific IO Paramenters * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames ****************************************************************************/ typedef struct _RAID_CONTEXT { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int8_t Type:4; u_int8_t nseg:4; +#else + u_int8_t nseg:4; + u_int8_t Type:4; +#endif u_int8_t resvd0; u_int16_t timeoutValue; u_int8_t regLockFlags; @@ -197,12 +205,19 @@ typedef struct _RAID_CONTEXT { * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames */ typedef struct _RAID_CONTEXT_G35 { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t Type:4; u_int16_t nseg:4; u_int16_t resvd0:8; +#else + u_int16_t resvd0:8; + u_int16_t nseg:4; + u_int16_t Type:4; +#endif u_int16_t timeoutValue; union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t reserved:1; u_int16_t sld:1; u_int16_t c2f:1; @@ -213,6 +228,18 @@ typedef struct _RAID_CONTEXT_G35 { u_int16_t log:1; u_int16_t cpuSel:4; u_int16_t setDivert:4; +#else + u_int16_t setDivert:4; + u_int16_t cpuSel:4; + u_int16_t log:1; + u_int16_t rw:1; + u_int16_t sbs:1; + u_int16_t sqn:1; + u_int16_t fwn:1; + u_int16_t c2f:1; + u_int16_t sld:1; + u_int16_t reserved:1; +#endif } bits; u_int16_t s; } routingFlags; @@ -228,9 +255,15 @@ typedef struct _RAID_CONTEXT_G35 { u_int8_t RAIDFlags; u_int8_t spanArm; u_int16_t configSeqNum; +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t numSGE:12; u_int16_t reserved:3; u_int16_t streamDetected:1; +#else + u_int16_t streamDetected:1; + u_int16_t reserved:3; + u_int16_t numSGE:12; +#endif u_int8_t resvd2[2]; } RAID_CONTEXT_G35; @@ -433,9 +466,15 @@ typedef struct _MR_TASK_MANAGE_REQUEST { MR_TM_REQUEST TmRequest; union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t isTMForLD:1; u_int32_t isTMForPD:1; u_int32_t reserved1:30; +#else + u_int32_t reserved1:30; + u_int32_t isTMForPD:1; + u_int32_t isTMForLD:1; +#endif u_int32_t reserved2; } tmReqFlags; MR_TM_REPLY TMReply; @@ -808,6 +847,7 @@ typedef struct _MR_SPAN_BLOCK_INFO { typedef struct _MR_LD_RAID { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t fpCapable:1; u_int32_t raCapable:1; u_int32_t reserved5:2; @@ -822,6 +862,22 @@ typedef struct _MR_LD_RAID { u_int32_t tmCapable:1; u_int32_t fpCacheBypassCapable:1; u_int32_t reserved4:5; +#else + u_int32_t reserved4:5; + u_int32_t fpCacheBypassCapable:1; + u_int32_t tmCapable:1; + u_int32_t fpNonRWCapable:1; + u_int32_t fpReadAcrossStripe:1; + u_int32_t fpWriteAcrossStripe:1; + u_int32_t fpReadCapable:1; + u_int32_t fpWriteCapable:1; + u_int32_t encryptionType:8; + u_int32_t pdPiMode:4; + u_int32_t ldPiMode:4; + u_int32_t reserved5:2; + u_int32_t raCapable:1; + u_int32_t fpCapable:1; +#endif } capability; u_int32_t reserved6; u_int64_t size; @@ -844,9 +900,15 @@ typedef struct _MR_LD_RAID { u_int16_t seqNum; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + u_int32_t reserved:30; + u_int32_t regTypeReqOnReadLsValid:1; + u_int32_t ldSyncRequired:1; +#else u_int32_t ldSyncRequired:1; u_int32_t regTypeReqOnReadLsValid:1; u_int32_t reserved:30; +#endif } flags; u_int8_t LUN[8]; @@ -854,9 +916,15 @@ typedef struct _MR_LD_RAID { u_int8_t reserved2[3]; u_int32_t logicalBlockLength; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + u_int32_t reserved1:24; + u_int32_t LdLogicalBlockExp:4; + u_int32_t LdPiExp:4; +#else u_int32_t LdPiExp:4; u_int32_t LdLogicalBlockExp:4; u_int32_t reserved1:24; +#endif } exponent; u_int8_t reserved3[0x80 - 0x38]; } MR_LD_RAID; @@ -1039,8 +1107,13 @@ struct MR_PD_CFG_SEQ { u_int16_t seqNum; u_int16_t devHandle; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int8_t tmCapable:1; u_int8_t reserved:7; +#else + u_int8_t reserved:7; + u_int8_t tmCapable:1; +#endif } capability; u_int8_t reserved; u_int16_t pdTargetId; @@ -1868,6 +1941,7 @@ struct mrsas_ctrl_prop { * structure. */ struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t copyBackDisabled:1; u_int32_t SMARTerEnabled:1; u_int32_t prCorrectUnconfiguredAreas:1; @@ -1899,6 +1973,39 @@ struct mrsas_ctrl_prop { u_int32_t enableSwZone:1; u_int32_t limitMaxRateSATA3G:1; u_int32_t reserved:2; +#else + u_int32_t reserved:2; + u_int32_t limitMaxRateSATA3G:1; + u_int32_t enableSwZone:1; + u_int32_t ignore64ldRestriction:1; + u_int32_t disableT10RebuildAssist:1; + u_int32_t disableImmediateIO:1; + u_int32_t enableAutoLockRecovery:1; + u_int32_t enableVirtualCache:1; + u_int32_t enableConfigAutoBalance:1; + u_int32_t forceSGPIOForQuadOnly:1; + u_int32_t useEmergencySparesforSMARTer:1; + u_int32_t useUnconfGoodForEmergency:1; + u_int32_t useGlobalSparesForEmergency:1; + u_int32_t preventPIImport:1; + u_int32_t enablePI:1; + u_int32_t useDiskActivityForLocate:1; + u_int32_t disableCacheBypass:1; + u_int32_t enableJBOD:1; + u_int32_t disableSpinDownHS:1; + u_int32_t allowBootWithPinnedCache:1; + u_int32_t disableOnlineCtrlReset:1; + u_int32_t enableSecretKeyControl:1; + u_int32_t autoEnhancedImport:1; + u_int32_t enableSpinDownUnconfigured:1; + u_int32_t SSDPatrolReadEnabled:1; + u_int32_t SSDSMARTerEnabled:1; + u_int32_t disableNCQ:1; + u_int32_t useFdeOnly:1; + u_int32_t prCorrectUnconfiguredAreas:1; + u_int32_t SMARTerEnabled:1; + u_int32_t copyBackDisabled:1; +#endif } OnOffProperties; u_int8_t autoSnapVDSpace; u_int8_t viewSpace; @@ -2170,6 +2277,7 @@ struct mrsas_ctrl_info { u_int16_t cacheMemorySize; /* 0x7A2 */ struct { /* 0x7A4 */ +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t supportPIcontroller:1; u_int32_t supportLdPIType1:1; u_int32_t supportLdPIType2:1; @@ -2194,6 +2302,30 @@ struct mrsas_ctrl_info { u_int32_t supportUnevenSpans:1; u_int32_t reserved:11; +#else + u_int32_t reserved:11; + u_int32_t supportUnevenSpans:1; + u_int32_t dedicatedHotSparesLimited:1; + u_int32_t headlessMode:1; + u_int32_t supportEmulatedDrives:1; + u_int32_t supportResetNow:1; + u_int32_t realTimeScheduler:1; + u_int32_t supportSSDPatrolRead:1; + u_int32_t supportPerfTuning:1; + u_int32_t disableOnlinePFKChange:1; + u_int32_t supportJBOD:1; + u_int32_t supportBootTimePFKChange:1; + u_int32_t supportSetLinkSpeed:1; + u_int32_t supportEmergencySpares:1; + u_int32_t supportSuspendResumeBGops:1; + u_int32_t blockSSDWriteCacheChange:1; + u_int32_t supportShieldState:1; + u_int32_t supportLdBBMInfo:1; + u_int32_t supportLdPIType3:1; + u_int32_t supportLdPIType2:1; + u_int32_t supportLdPIType1:1; + u_int32_t supportPIcontroller:1; +#endif } adapterOperations2; u_int8_t driverVersion[32]; /* 0x7A8 */ @@ -2206,6 +2338,7 @@ struct mrsas_ctrl_info { u_int8_t reserved5[2]; /* 0x7CD reserved */ struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t peerIsPresent:1; u_int32_t peerIsIncompatible:1; @@ -2214,6 +2347,15 @@ struct mrsas_ctrl_info { u_int32_t ctrlPropIncompatible:1; u_int32_t premiumFeatureMismatch:1; u_int32_t reserved:26; +#else + u_int32_t reserved:26; + u_int32_t premiumFeatureMismatch:1; + u_int32_t ctrlPropIncompatible:1; + u_int32_t fwVersionMismatch:1; + u_int32_t hwIncompatible:1; + u_int32_t peerIsIncompatible:1; + u_int32_t peerIsPresent:1; +#endif } cluster; char clusterId[16]; /* 0x7D4 */ @@ -2221,6 +2363,7 @@ struct mrsas_ctrl_info { char reserved6[4]; /* 0x7E4 RESERVED FOR IOV */ struct { /* 0x7E8 */ +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t supportPersonalityChange:2; u_int32_t supportThermalPollInterval:1; u_int32_t supportDisableImmediateIO:1; @@ -2246,11 +2389,39 @@ struct mrsas_ctrl_info { u_int32_t supportExtendedSSCSize:1; u_int32_t useSeqNumJbodFP:1; u_int32_t reserved:7; +#else + u_int32_t reserved:7; + u_int32_t useSeqNumJbodFP:1; + u_int32_t supportExtendedSSCSize:1; + u_int32_t supportDiskCacheSettingForSysPDs:1; + u_int32_t supportCPLDUpdate:1; + u_int32_t supportTTYLogCompression:1; + u_int32_t discardCacheDuringLDDelete:1; + u_int32_t supportSecurityonJBOD:1; + u_int32_t supportCacheBypassModes:1; + u_int32_t supportDisableSESMonitoring:1; + u_int32_t supportForceFlash:1; + u_int32_t supportNVDRAM:1; + u_int32_t supportDrvActivityLEDSetting:1; + u_int32_t supportAllowedOpsforDrvRemoval:1; + u_int32_t supportHOQRebuild:1; + u_int32_t supportForceTo512e:1; + u_int32_t supportNVCacheErase:1; + u_int32_t supportDebugQueue:1; + u_int32_t supportSwZone:1; + u_int32_t supportCrashDump:1; + u_int32_t supportMaxExtLDs:1; + u_int32_t supportT10RebuildAssist:1; + u_int32_t supportDisableImmediateIO:1; + u_int32_t supportThermalPollInterval:1; + u_int32_t supportPersonalityChange:2; +#endif } adapterOperations3; u_int8_t pad_cpld[16]; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t ctrlInfoExtSupported:1; u_int16_t supportIbuttonLess:1; u_int16_t supportedEncAlgo:1; @@ -2260,6 +2431,17 @@ struct mrsas_ctrl_info { u_int16_t supportPdMapTargetId:1; u_int16_t FWSwapsBBUVPDInfo:1; u_int16_t reserved:8; +#else + u_int16_t reserved:8; + u_int16_t FWSwapsBBUVPDInfo:1; + u_int16_t supportPdMapTargetId:1; + u_int16_t supportSESCtrlInMultipathCfg:1; + u_int16_t imageUploadSupported:1; + u_int16_t supportEncryptedMfc:1; + u_int16_t supportedEncAlgo:1; + u_int16_t supportIbuttonLess:1; + u_int16_t ctrlInfoExtSupported:1; +#endif } adapterOperations4; u_int8_t pad[0x800 - 0x7FE]; /* 0x7FE */ @@ -2332,6 +2514,7 @@ struct mrsas_ctrl_info { typedef union _MFI_CAPABILITIES { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t support_fp_remote_lun:1; u_int32_t support_additional_msix:1; u_int32_t support_fastpath_wb:1; @@ -2342,6 +2525,18 @@ typedef union _MFI_CAPABILITIES { u_int32_t support_ext_queue_depth:1; u_int32_t support_ext_io_size:1; u_int32_t reserved:23; +#else + u_int32_t reserved:23; + u_int32_t support_ext_io_size:1; + u_int32_t support_ext_queue_depth:1; + u_int32_t security_protocol_cmds_fw:1; + u_int32_t support_core_affinity:1; + u_int32_t support_ndrive_r1_lb:1; + u_int32_t support_max_255lds:1; + u_int32_t support_fastpath_wb:1; + u_int32_t support_additional_msix:1; + u_int32_t support_fp_remote_lun:1; +#endif } mfi_capabilities; u_int32_t reg; } MFI_CAPABILITIES; @@ -2602,9 +2797,15 @@ union mrsas_frame { #pragma pack(1) union mrsas_evt_class_locale { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t locale; u_int8_t reserved; int8_t class; +#else + int8_t class; + u_int8_t reserved; + u_int16_t locale; +#endif } __packed members; u_int32_t word; @@ -2890,6 +3091,7 @@ typedef struct _MRSAS_DRV_PCI_COMMON_HEADER { typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t linkSpeed:4; u_int32_t linkWidth:6; u_int32_t aspmSupport:2; @@ -2897,6 +3099,15 @@ typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { u_int32_t l1ExitLatency:3; u_int32_t rsvdp:6; u_int32_t portNumber:8; +#else + u_int32_t portNumber:8; + u_int32_t rsvdp:6; + u_int32_t l1ExitLatency:3; + u_int32_t losExitLatency:3; + u_int32_t aspmSupport:2; + u_int32_t linkWidth:6; + u_int32_t linkSpeed:4; +#endif } bits; u_int32_t asUlong; @@ -2908,12 +3119,21 @@ typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY { union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t linkSpeed:4; u_int16_t negotiatedLinkWidth:6; u_int16_t linkTrainingError:1; u_int16_t linkTraning:1; u_int16_t slotClockConfig:1; u_int16_t rsvdZ:3; +#else + u_int16_t rsvdZ:3; + u_int16_t slotClockConfig:1; + u_int16_t linkTraning:1; + u_int16_t linkTrainingError:1; + u_int16_t negotiatedLinkWidth:6; + u_int16_t linkSpeed:4; +#endif } bits; u_int16_t asUshort; @@ -2967,6 +3187,7 @@ union MR_PD_DDF_TYPE { struct { union { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int16_t forcedPDGUID:1; u_int16_t inVD:1; u_int16_t isGlobalSpare:1; @@ -2974,6 +3195,15 @@ union MR_PD_DDF_TYPE { u_int16_t isForeign:1; u_int16_t reserved:7; u_int16_t intf:4; +#else + u_int16_t intf:4; + u_int16_t reserved:7; + u_int16_t isForeign:1; + u_int16_t isSpare:1; + u_int16_t isGlobalSpare:1; + u_int16_t inVD:1; + u_int16_t forcedPDGUID:1; +#endif } pdType; u_int16_t type; }; @@ -3004,6 +3234,7 @@ union MR_PROGRESS { */ struct MR_PD_PROGRESS { struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN u_int32_t rbld:1; u_int32_t patrol:1; u_int32_t clear:1; @@ -3011,6 +3242,15 @@ struct MR_PD_PROGRESS { u_int32_t erase:1; u_int32_t locate:1; u_int32_t reserved:26; *** 783 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Feb 4 03:00: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 4BD4853507B; Thu, 4 Feb 2021 03:00: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 4DWNb91XPKz4hLH; Thu, 4 Feb 2021 03: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 262C92C2BB; Thu, 4 Feb 2021 03:00: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 11430bgr075262; Thu, 4 Feb 2021 03:00:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11430bHc075261; Thu, 4 Feb 2021 03:00:37 GMT (envelope-from git) Date: Thu, 4 Feb 2021 03:00:37 GMT Message-Id: <202102040300.11430bHc075261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 37fed6c86003 - stable/13 - [POWERPC64BE] add mrsas driver to GENERIC64 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 37fed6c860035396c306bffb07f2511c12af3f74 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 03:00:37 -0000 The branch stable/13 has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=37fed6c860035396c306bffb07f2511c12af3f74 commit 37fed6c860035396c306bffb07f2511c12af3f74 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-04 01:02:28 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-04 05:58:19 +0000 [POWERPC64BE] add mrsas driver to GENERIC64 Submitted by: Andre Fernando da Silva Reviewed by: luporl, alfredo, kadesai (on email) Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D26531 --- sys/powerpc/conf/GENERIC64 | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 0e201d718b3e..249823d4efa9 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -135,6 +135,7 @@ device ahc # AHA2940 and onboard AIC7xxx devices options AHC_ALLOW_MEMIO # Attempt to use memory mapped I/O device isp # Qlogic family 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 sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D From owner-dev-commits-src-all@freebsd.org Thu Feb 4 03:14: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 5928F535CE2; Thu, 4 Feb 2021 03:14: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 4DWNvh1mDxz4jn6; Thu, 4 Feb 2021 03:14: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 2F0502C849; Thu, 4 Feb 2021 03:14: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 1143EuOY093520; Thu, 4 Feb 2021 03:14:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1143EujL093519; Thu, 4 Feb 2021 03:14:56 GMT (envelope-from git) Date: Thu, 4 Feb 2021 03:14:56 GMT Message-Id: <202102040314.1143EujL093519@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: d6898bc06ae9 - stable/12 - login.conf(5): set a default PATH for the daemon class 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: d6898bc06ae9637ffa35705c5753fdecc518d73b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 03:14:56 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d6898bc06ae9637ffa35705c5753fdecc518d73b commit d6898bc06ae9637ffa35705c5753fdecc518d73b Author: Andrew Gierth AuthorDate: 2020-02-05 04:27:08 +0000 Commit: Kyle Evans CommitDate: 2021-02-04 03:14:12 +0000 login.conf(5): set a default PATH for the daemon class This is a sensible default used by, e.g., cron(8), and useful if one wanted to honor it. This is a part of D21481. (cherry picked from commit ed6f64ff8a90eee579fefef510329b5e9f1f9a65) --- usr.bin/login/login.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.bin/login/login.conf b/usr.bin/login/login.conf index 974d4485eadc..44174dd12d03 100644 --- a/usr.bin/login/login.conf +++ b/usr.bin/login/login.conf @@ -61,7 +61,13 @@ xuser:\ :tc=default: staff:\ :tc=default: + +# This PATH may be clobbered by individual applications. Notably, by default, +# rc(8), service(8), and cron(8) will all override it with a default PATH that +# may not include /usr/local/sbin and /usr/local/bin when starting services or +# jobs. daemon:\ + :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin:\ :mail@:\ :memorylocked=128M:\ :tc=default: From owner-dev-commits-src-all@freebsd.org Thu Feb 4 03:14: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 73EBF535DB1; Thu, 4 Feb 2021 03:14: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 4DWNvj2tS1z4jVP; Thu, 4 Feb 2021 03:14: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 53DF62C7CD; Thu, 4 Feb 2021 03:14: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 1143EvXW093540; Thu, 4 Feb 2021 03:14:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1143EvBT093539; Thu, 4 Feb 2021 03:14:57 GMT (envelope-from git) Date: Thu, 4 Feb 2021 03:14:57 GMT Message-Id: <202102040314.1143EvBT093539@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: f6512d13154a - stable/12 - init(8): set environment variables from the "daemon" class as well 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: f6512d13154acdd324b09a5db8dc56a4dfeca27a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 03:14:57 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f6512d13154acdd324b09a5db8dc56a4dfeca27a commit f6512d13154acdd324b09a5db8dc56a4dfeca27a Author: Andrew Gierth AuthorDate: 2020-02-05 04:27:44 +0000 Commit: Kyle Evans CommitDate: 2021-02-04 03:14:19 +0000 init(8): set environment variables from the "daemon" class as well Specifically, when running /etc/rc. This allows one to specify via login.conf(5) an environment that should be used when running services to ease, e.g., setting up env vars for an HTTP proxy consistently across cron and services alike. Future changes will extend cron(8)/service(8) to use environment vars pecified in login.conf(5) as well to promote a more cohesive experience. This is a part of D21481. (cherry picked from commit 21c1a93c048fdd9c276899e72dcb8dc93cc18e09) --- sbin/init/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/init/init.c b/sbin/init/init.c index 4b75e5763c8d..1bb35dbe5803 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -2033,6 +2033,7 @@ setprocresources(const char *cname) login_cap_t *lc; if ((lc = login_getclassbyname(cname, NULL)) != NULL) { setusercontext(lc, (struct passwd*)NULL, 0, + LOGIN_SETENV | LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETLOGINCLASS | LOGIN_SETCPUMASK); login_close(lc); From owner-dev-commits-src-all@freebsd.org Thu Feb 4 03:15: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 AFBE5535DBB; Thu, 4 Feb 2021 03:15: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 4DWNvm0wvjz4jsp; Thu, 4 Feb 2021 03:14: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 9C88F2C8DB; Thu, 4 Feb 2021 03:14: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 1143ExCg093583; Thu, 4 Feb 2021 03:14:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1143ExiG093582; Thu, 4 Feb 2021 03:14:59 GMT (envelope-from git) Date: Thu, 4 Feb 2021 03:14:59 GMT Message-Id: <202102040314.1143ExiG093582@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: d5461e9a792a - stable/12 - cron(8): set the environment variables of the user and/or login class 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: d5461e9a792ae0d2c4d606046dbe5b425045f5f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 03:15:01 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d5461e9a792ae0d2c4d606046dbe5b425045f5f2 commit d5461e9a792ae0d2c4d606046dbe5b425045f5f2 Author: Andrew Gierth AuthorDate: 2020-02-05 04:35:54 +0000 Commit: Kyle Evans CommitDate: 2021-02-04 03:14:33 +0000 cron(8): set the environment variables of the user and/or login class Prior to processing environment variable set in the crontab file as those should be of higher precedent, pull in the user or login class environment. This is another supporting feature for allowing one to configure system-wide settings that may affect both regular cron jobs as well as services. This is the final part of D21481. (cherry picked from commit 7466dbd684879cbe8d034f388f0c7da703e00c31) --- usr.sbin/cron/cron/do_command.c | 27 +++++++++++++++++++++------ usr.sbin/cron/crontab/crontab.5 | 12 ++++++++++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/usr.sbin/cron/cron/do_command.c b/usr.sbin/cron/cron/do_command.c index 5687323f8c64..214baf2133ed 100644 --- a/usr.sbin/cron/cron/do_command.c +++ b/usr.sbin/cron/cron/do_command.c @@ -42,6 +42,8 @@ static void child_process(entry *, user *); static WAIT_T wait_on_child(PID_T, const char *); +extern char *environ; + void do_command(e, u) entry *e; @@ -275,9 +277,11 @@ child_process(e, u) close(stdin_pipe[READ_PIPE]); close(stdout_pipe[WRITE_PIPE]); + environ = NULL; + # if defined(LOGIN_CAP) - /* Set user's entire context, but skip the environment - * as cron provides a separate interface for this + /* Set user's entire context, but note that PATH will + * be overridden later */ if ((pwd = getpwnam(usernm)) == NULL) pwd = getpwuid(e->uid); @@ -289,7 +293,7 @@ child_process(e, u) } if (pwd && setusercontext(lc, pwd, e->uid, - LOGIN_SETALL & ~(LOGIN_SETPATH|LOGIN_SETENV)) == 0) + LOGIN_SETALL) == 0) (void) endpwent(); else { /* fall back to the old method */ @@ -332,6 +336,18 @@ child_process(e, u) */ { char *shell = env_get("SHELL", e->envp); + char **p; + + /* Apply the environment from the entry, overriding existing + * values (this will always set PATH, LOGNAME, etc.) putenv + * should not fail unless malloc does. + */ + for (p = e->envp; *p; ++p) { + if (putenv(*p) != 0) { + warn("putenv"); + _exit(ERROR_EXIT); + } + } # if DEBUGGING if (DebugFlags & DTEST) { @@ -342,9 +358,8 @@ child_process(e, u) _exit(OK_EXIT); } # endif /*DEBUGGING*/ - execle(shell, shell, "-c", e->cmd, (char *)NULL, - e->envp); - warn("execle: couldn't exec `%s'", shell); + execl(shell, shell, "-c", e->cmd, (char *)NULL); + warn("execl: couldn't exec `%s'", shell); _exit(ERROR_EXIT); } break; diff --git a/usr.sbin/cron/crontab/crontab.5 b/usr.sbin/cron/crontab/crontab.5 index 9943adfaf356..adc2b2b5ae95 100644 --- a/usr.sbin/cron/crontab/crontab.5 +++ b/usr.sbin/cron/crontab/crontab.5 @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2019 +.Dd January 19, 2020 .Dt CRONTAB 5 .Os .Sh NAME @@ -82,10 +82,18 @@ and are set from the .Pa /etc/passwd line of the crontab's owner. +In addition, the environment variables of the +user's login class, with the exception of +.Ev PATH , +will be set from +.Pa /etc/login.conf.db +and +.Pa ~/.login_conf . .Ev HOME , .Ev PATH and -.Ev SHELL +.Ev SHELL , +and any variables set from the login class, may be overridden by settings in the crontab; .Ev LOGNAME may not. From owner-dev-commits-src-all@freebsd.org Thu Feb 4 03:14: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 316A5535CED; Thu, 4 Feb 2021 03:14: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 4DWNvk5R9fz4jsh; Thu, 4 Feb 2021 03:14: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 7247F2C8DA; Thu, 4 Feb 2021 03:14: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 1143EwLg093561; Thu, 4 Feb 2021 03:14:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1143EwZZ093560; Thu, 4 Feb 2021 03:14:58 GMT (envelope-from git) Date: Thu, 4 Feb 2021 03:14:58 GMT Message-Id: <202102040314.1143EwZZ093560@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: f7ba064978f8 - stable/12 - service(8): set the environment of the "daemon" class before invoking 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: f7ba064978f84d07cd3ebbcbba3decc8a515cee3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 03:15:02 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f7ba064978f84d07cd3ebbcbba3decc8a515cee3 commit f7ba064978f84d07cd3ebbcbba3decc8a515cee3 Author: Andrew Gierth AuthorDate: 2020-02-05 04:32:49 +0000 Commit: Kyle Evans CommitDate: 2021-02-04 03:14:27 +0000 service(8): set the environment of the "daemon" class before invoking As mentioned in r357562, this gives the user a single place to configure environment variables that need to be used for various services -- the "daemon" class -- for, e.g., configuring a system-wide HTTP proxy. This is a part of D21481. (cherry picked from commit 736a5a6d1dbbdae68eb102c2ba9c114aafd61821) --- usr.sbin/service/service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index fa002fb0a817..42a50fcf61b9 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 HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin $dir/$script "$@" + exec env -i -L 0/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@" fi done From owner-dev-commits-src-all@freebsd.org Thu Feb 4 03:16: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 180BF536194; Thu, 4 Feb 2021 03:16: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 4DWNy30DVYz4kLw; Thu, 4 Feb 2021 03:16: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 EEDEA2C8DC; Thu, 4 Feb 2021 03:16: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 1143GwxI094013; Thu, 4 Feb 2021 03:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1143GwmV094012; Thu, 4 Feb 2021 03:16:58 GMT (envelope-from git) Date: Thu, 4 Feb 2021 03:16:58 GMT Message-Id: <202102040316.1143GwmV094012@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: ca9e7ac2fbbb - stable/13 - du: tests: use dollar-single quotes where appropriate 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: ca9e7ac2fbbbb393a0221ff96ae03f9cac1745b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 03:16:59 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ca9e7ac2fbbbb393a0221ff96ae03f9cac1745b3 commit ca9e7ac2fbbbb393a0221ff96ae03f9cac1745b3 Author: Kyle Evans AuthorDate: 2021-01-29 03:01:12 +0000 Commit: Kyle Evans CommitDate: 2021-02-04 03:16:51 +0000 du: tests: use dollar-single quotes where appropriate No need for "foo$(printf "\t")", $'\t' is both more readable and still functional. (cherry picked from commit bf59049c27ef86669a94ffd43f7216107b5c57ff) --- usr.bin/du/tests/du_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh index 92a26deae02b..1c283b58fef4 100755 --- a/usr.bin/du/tests/du_test.sh +++ b/usr.bin/du/tests/du_test.sh @@ -46,7 +46,7 @@ H_flag_body() { local paths1='testdir/A/B testdir/A testdir/C testdir' local paths2='testdir/C/B testdir/C' - local lineprefix="^[0-9]+$(printf "\t")" + local lineprefix=$'^[0-9]+\t' local sep="\$\n${lineprefix}" atf_check mkdir testdir From owner-dev-commits-src-all@freebsd.org Thu Feb 4 09:04: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 896E453D78D; Thu, 4 Feb 2021 09:04:34 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (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 4DWXg630jZz3KHs; Thu, 4 Feb 2021 09:04:34 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: by mail-ej1-x629.google.com with SMTP id hs11so4090288ejc.1; Thu, 04 Feb 2021 01:04:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=L4RFJO28usLbqBwQWpVB0AXaN/sNwYLmFUcskdI/Gfg=; b=ijNKzOCvxd3HHKsU5Y2m+aRwiwKQkLbMZRBk8pS5JFSmXMqvp3BjlsaZE4R7KawKrk bNFPi8gA6mAELtaZn/i7WPYXfssw2wBnYVuypflzlB+o0MxlLaHWQT02etgJjuLpsdHU KE+I0hLlk8tyb1vf33UqhbGxl0AmZo8SisgSzW3mIi3u0rXVrMZxZZKm335gVQvNbTFK Y1LryeKMXWq2PG66AN1578GL//PIUq8AjQDn8Dq20w2jSaqOeg4HJGTEHJ/v3JveuQQo ekKDUfq2mrCRkdJ4s+SnisPu3YSAjd+AfT/phbTvooHe3BMAZDVFTjUC7rKGkMz3YZYG iZSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=L4RFJO28usLbqBwQWpVB0AXaN/sNwYLmFUcskdI/Gfg=; b=s+zo/hu3/KgSR+XfxsY/xbqlvAKX1xmXN3coDOODT6X3GaMom2vouEgsrajz1GHQJ6 3fwKyCLykylpp88zxPtWqDmSBiMWiIlMhJddGQL4ex536mfH8qnHaPEdLDbWczcGghsU CxVvybpQ3TplM7H1nUqEeHDXajgDwZPz8drcZ7fKf9oCr+OLy4QTErt8yfKdcGM2ni2F NRlFx/IuwoSmC9BxAyuDU40d7wVKUFl2iIpuZftIADA6WRVUjjLsWLh2LfrEQ0Eb6Ylr yC45JOtRZCR19haMUDdzaIJjzc9iTyqaYqT1ChIFKRuvtdEUHzdHjIzKdBSscbuKuWip RnhA== X-Gm-Message-State: AOAM530gZ42tFJMSerp0VAsmRXA730LCvGdEswSMRM3oPYPxn3rJhp0T ERa7Yb/ACL7AUu9GsjaY11SgGWK630Y= X-Google-Smtp-Source: ABdhPJzJoEHgK+WN4iHhY0aPG+7oqt2MKIGAqlAa9m2AFyZsSWBiKAQDD7UaEeF6+BO8ic4v9/NIYA== X-Received: by 2002:a17:906:fa18:: with SMTP id lo24mr6954231ejb.221.1612429472199; Thu, 04 Feb 2021 01:04:32 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id n5sm2144294edw.7.2021.02.04.01.04.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Feb 2021 01:04:31 -0800 (PST) Sender: Michal Meloun Reply-To: meloun.michal@gmail.com Subject: Re: git: e34a057ca6eb - main - [POWERPC64BE] mrsas: add big-endian support To: Alfredo Dal'Ava Junior , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202102032208.113M8Xib089636@gitrepo.freebsd.org> From: Michal Meloun Message-ID: <39e1f260-b470-6ab5-5511-12e29e395399@gmail.com> Date: Thu, 4 Feb 2021 10:04:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <202102032208.113M8Xib089636@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DWXg630jZz3KHs 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: Thu, 04 Feb 2021 09:04:34 -0000 On 03.02.2021 23:08, Alfredo Dal'Ava Junior wrote: > The branch main has been updated by alfredo: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a > > commit e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a > Author: Alfredo Dal'Ava Junior > AuthorDate: 2021-02-04 00:52:19 +0000 > Commit: Alfredo Dal'Ava Junior > CommitDate: 2021-02-04 01:06:21 +0000 > > [POWERPC64BE] mrsas: add big-endian support > > Add endiannes conversions in order to support big-endian platforms > > Submitted by: Andre Fernando da Silva > Reviewed by: luporl, alfredo, kadesai (on email) > Sponsored by: Eldorado Research Institute (eldorado.org.br) > Differential Revision: https://reviews.freebsd.org/D26531 This caused the following warnings on 32-bit systems(armv7). IMHO, the address should be casted to uint64_t (not bus_addr_t) before the shift. /usr2/Meloun/git/tegra/sys/dev/mrsas/mrsas.c:2786:67: error: shift count >= width of type [-Werror,-Wshift-count-overflow] req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); ^ ~~ /usr2/Meloun/git/tegra/sys/sys/endian.h:74:32: note: expanded from macro 'htole32' #define htole32(x) ((uint32_t)(x)) > --- > sys/dev/mrsas/mrsas.c | 198 ++++++++++++++++--------------- > sys/dev/mrsas/mrsas.h | 289 +++++++++++++++++++++++++++++++++++++++++++++- > sys/dev/mrsas/mrsas_cam.c | 54 ++++----- > sys/dev/mrsas/mrsas_fp.c | 170 ++++++++++++++------------- > 4 files changed, 510 insertions(+), 201 deletions(-) > > diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c > index 32d85c803938..f4c34e237fc4 100644 > --- a/sys/dev/mrsas/mrsas.c > +++ b/sys/dev/mrsas/mrsas.c > @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > /* > * Function prototypes > @@ -619,13 +620,13 @@ mrsas_get_seq_num(struct mrsas_softc *sc, > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0x0; > dcmd->sge_count = 1; > - dcmd->flags = MFI_FRAME_DIR_READ; > + dcmd->flags = htole16(MFI_FRAME_DIR_READ); > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sizeof(struct mrsas_evt_log_info); > - dcmd->opcode = MR_DCMD_CTRL_EVENT_GET_INFO; > - dcmd->sgl.sge32[0].phys_addr = sc->el_info_phys_addr; > - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_log_info); > + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_evt_log_info)); > + dcmd->opcode = htole32(MR_DCMD_CTRL_EVENT_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32(sc->el_info_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_evt_log_info)); > > retcode = mrsas_issue_blocked_cmd(sc, cmd); > if (retcode == ETIMEDOUT) > @@ -681,7 +682,7 @@ mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, > curr_aen.word = class_locale_word; > > if (sc->aen_cmd) { > - prev_aen.word = sc->aen_cmd->frame->dcmd.mbox.w[1]; > + prev_aen.word = le32toh(sc->aen_cmd->frame->dcmd.mbox.w[1]); > > /* > * A class whose enum value is smaller is inclusive of all > @@ -732,16 +733,16 @@ mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0x0; > dcmd->sge_count = 1; > - dcmd->flags = MFI_FRAME_DIR_READ; > + dcmd->flags = htole16(MFI_FRAME_DIR_READ); > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sizeof(struct mrsas_evt_detail); > - dcmd->opcode = MR_DCMD_CTRL_EVENT_WAIT; > - dcmd->mbox.w[0] = seq_num; > + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_evt_detail)); > + dcmd->opcode = htole32(MR_DCMD_CTRL_EVENT_WAIT); > + dcmd->mbox.w[0] = htole32(seq_num); > sc->last_seq_num = seq_num; > - dcmd->mbox.w[1] = curr_aen.word; > - dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->evt_detail_phys_addr; > - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_detail); > + dcmd->mbox.w[1] = htole32(curr_aen.word); > + dcmd->sgl.sge32[0].phys_addr = htole32((u_int32_t)sc->evt_detail_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_evt_detail)); > > if (sc->aen_cmd != NULL) { > mrsas_release_mfi_cmd(cmd); > @@ -907,9 +908,6 @@ mrsas_attach(device_t dev) > * Set up PCI and registers > */ > cmd = pci_read_config(dev, PCIR_COMMAND, 2); > - if ((cmd & PCIM_CMD_PORTEN) == 0) { > - return (ENXIO); > - } > /* Force the busmaster enable bit on. */ > cmd |= PCIM_CMD_BUSMASTEREN; > pci_write_config(dev, PCIR_COMMAND, cmd, 2); > @@ -1704,7 +1702,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) > > /* Find our reply descriptor for the command and process */ > while ((desc_val.u.low != 0xFFFFFFFF) && (desc_val.u.high != 0xFFFFFFFF)) { > - smid = reply_desc->SMID; > + smid = le16toh(reply_desc->SMID); > cmd_mpt = sc->mpt_cmd_list[smid - 1]; > scsi_io_req = (MRSAS_RAID_SCSI_IO_REQUEST *) cmd_mpt->io_request; > > @@ -1736,7 +1734,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) > case MRSAS_MPI2_FUNCTION_LD_IO_REQUEST: > if (cmd_mpt->r1_alt_dev_handle == MR_DEVHANDLE_INVALID) { > mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, > - extStatus, data_length, sense); > + extStatus, le32toh(data_length), sense); > mrsas_cmd_done(sc, cmd_mpt); > mrsas_atomic_dec(&sc->fw_outstanding); > } else { > @@ -1764,7 +1762,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) > mrsas_release_mpt_cmd(r1_cmd); > mrsas_atomic_dec(&sc->fw_outstanding); > mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, > - extStatus, data_length, sense); > + extStatus, le32toh(data_length), sense); > mrsas_cmd_done(sc, cmd_mpt); > mrsas_atomic_dec(&sc->fw_outstanding); > } > @@ -1778,7 +1776,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex) > * And also make sure that the issue_polled call should only be > * used if INTERRUPT IS DISABLED. > */ > - if (cmd_mfi->frame->hdr.flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) > + if (cmd_mfi->frame->hdr.flags & htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)) > mrsas_release_mfi_cmd(cmd_mfi); > else > mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); > @@ -2593,6 +2591,13 @@ mrsas_init_adapter(struct mrsas_softc *sc) > (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); > scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, > outbound_scratch_pad_2)); > + > + mrsas_dprint(sc, MRSAS_TRACE, "%s: sc->reply_q_depth 0x%x," > + "sc->request_alloc_sz 0x%x, sc->reply_alloc_sz 0x%x," > + "sc->io_frames_alloc_sz 0x%x\n", __func__, > + sc->reply_q_depth, sc->request_alloc_sz, > + sc->reply_alloc_sz, sc->io_frames_alloc_sz); > + > /* > * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set, > * Firmware support extended IO chain frame which is 4 time more > @@ -2617,8 +2622,10 @@ mrsas_init_adapter(struct mrsas_softc *sc) > > mrsas_dprint(sc, MRSAS_INFO, > "max sge: 0x%x, max chain frame size: 0x%x, " > - "max fw cmd: 0x%x\n", sc->max_num_sge, > - sc->max_chain_frame_sz, sc->max_fw_cmds); > + "max fw cmd: 0x%x sc->chain_frames_alloc_sz: 0x%x\n", > + sc->max_num_sge, > + sc->max_chain_frame_sz, sc->max_fw_cmds, > + sc->chain_frames_alloc_sz); > > /* Used for pass thru MFI frame (DCMD) */ > sc->chain_offset_mfi_pthru = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 16; > @@ -2738,19 +2745,19 @@ mrsas_ioc_init(struct mrsas_softc *sc) > IOCInitMsg = (pMpi2IOCInitRequest_t)(((char *)sc->ioc_init_mem) + 1024); > IOCInitMsg->Function = MPI2_FUNCTION_IOC_INIT; > IOCInitMsg->WhoInit = MPI2_WHOINIT_HOST_DRIVER; > - IOCInitMsg->MsgVersion = MPI2_VERSION; > - IOCInitMsg->HeaderVersion = MPI2_HEADER_VERSION; > - IOCInitMsg->SystemRequestFrameSize = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4; > - IOCInitMsg->ReplyDescriptorPostQueueDepth = sc->reply_q_depth; > - IOCInitMsg->ReplyDescriptorPostQueueAddress = sc->reply_desc_phys_addr; > - IOCInitMsg->SystemRequestFrameBaseAddress = sc->io_request_phys_addr; > + IOCInitMsg->MsgVersion = htole16(MPI2_VERSION); > + IOCInitMsg->HeaderVersion = htole16(MPI2_HEADER_VERSION); > + IOCInitMsg->SystemRequestFrameSize = htole16(MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4); > + IOCInitMsg->ReplyDescriptorPostQueueDepth = htole16(sc->reply_q_depth); > + IOCInitMsg->ReplyDescriptorPostQueueAddress = htole64(sc->reply_desc_phys_addr); > + IOCInitMsg->SystemRequestFrameBaseAddress = htole64(sc->io_request_phys_addr); > IOCInitMsg->HostMSIxVectors = (sc->msix_vectors > 0 ? sc->msix_vectors : 0); > IOCInitMsg->HostPageSize = MR_DEFAULT_NVME_PAGE_SHIFT; > > init_frame = (struct mrsas_init_frame *)sc->ioc_init_mem; > init_frame->cmd = MFI_CMD_INIT; > init_frame->cmd_status = 0xFF; > - init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; > + init_frame->flags |= htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE); > > /* driver support Extended MSIX */ > if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { > @@ -2768,11 +2775,16 @@ mrsas_ioc_init(struct mrsas_softc *sc) > init_frame->driver_operations.mfi_capabilities.security_protocol_cmds_fw = 1; > if (sc->max_chain_frame_sz > MEGASAS_CHAIN_FRAME_SZ_MIN) > init_frame->driver_operations.mfi_capabilities.support_ext_io_size = 1; > + > + init_frame->driver_operations.reg = htole32(init_frame->driver_operations.reg); > + > phys_addr = (bus_addr_t)sc->ioc_init_phys_mem + 1024; > - init_frame->queue_info_new_phys_addr_lo = phys_addr; > - init_frame->data_xfer_len = sizeof(Mpi2IOCInitRequest_t); > + init_frame->queue_info_new_phys_addr_lo = htole32(phys_addr); > + init_frame->data_xfer_len = htole32(sizeof(Mpi2IOCInitRequest_t)); > + > + req_desc.addr.u.low = htole32((bus_addr_t)sc->ioc_init_phys_mem & 0xFFFFFFFF); > + req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); > > - req_desc.addr.Words = (bus_addr_t)sc->ioc_init_phys_mem; > req_desc.MFAIo.RequestFlags = > (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); > > @@ -2923,9 +2935,9 @@ mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, > { > mtx_lock(&sc->pci_lock); > mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_low_queue_port), > - req_desc_lo); > + le32toh(req_desc_lo)); > mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_high_queue_port), > - req_desc_hi); > + le32toh(req_desc_hi)); > mtx_unlock(&sc->pci_lock); > } > > @@ -2944,7 +2956,7 @@ mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, > { > if (sc->atomic_desc_support) > mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_single_queue_port), > - req_desc_lo); > + le32toh(req_desc_lo)); > else > mrsas_write_64bit_req_desc(sc, req_desc_lo, req_desc_hi); > } > @@ -3103,7 +3115,6 @@ mrsas_ocr_thread(void *arg) > sc = (struct mrsas_softc *)arg; > > mrsas_dprint(sc, MRSAS_TRACE, "%s\n", __func__); > - > sc->ocr_thread_active = 1; > mtx_lock(&sc->sim_lock); > for (;;) { > @@ -3642,10 +3653,10 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) > dcmd->flags = MFI_FRAME_DIR_READ; > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sizeof(struct mrsas_ctrl_info); > - dcmd->opcode = MR_DCMD_CTRL_GET_INFO; > - dcmd->sgl.sge32[0].phys_addr = sc->ctlr_info_phys_addr; > - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); > + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_ctrl_info)); > + dcmd->opcode = htole32(MR_DCMD_CTRL_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32(sc->ctlr_info_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_ctrl_info)); > > if (!sc->mask_interrupts) > retcode = mrsas_issue_blocked_cmd(sc, cmd); > @@ -3654,8 +3665,13 @@ mrsas_get_ctrl_info(struct mrsas_softc *sc) > > if (retcode == ETIMEDOUT) > goto dcmd_timeout; > - else > + else { > memcpy(sc->ctrl_info, sc->ctlr_info_mem, sizeof(struct mrsas_ctrl_info)); > + le32_to_cpus(&sc->ctrl_info->properties.OnOffProperties); > + le32_to_cpus(&sc->ctrl_info->adapterOperations2); > + le32_to_cpus(&sc->ctrl_info->adapterOperations3); > + le16_to_cpus(&sc->ctrl_info->adapterOperations4); > + } > > do_ocr = 0; > mrsas_update_ext_vd_details(sc); > @@ -3813,7 +3829,7 @@ mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) > int i, retcode = SUCCESS; > > frame_hdr->cmd_status = 0xFF; > - frame_hdr->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; > + frame_hdr->flags |= htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE); > > /* Issue the frame using inbound queue port */ > if (mrsas_issue_dcmd(sc, cmd)) { > @@ -3892,7 +3908,7 @@ mrsas_build_mpt_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) > req_desc->addr.Words = 0; > req_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); > > - req_desc->SCSIIO.SMID = index; > + req_desc->SCSIIO.SMID = htole16(index); > > return (req_desc); > } > @@ -3927,7 +3943,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cm > * mrsas_complete_cmd. > */ > > - if (frame_hdr->flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) > + if (frame_hdr->flags & htole16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE)) > mpt_cmd->flags = MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; > > io_req = mpt_cmd->io_request; > @@ -3944,12 +3960,12 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cm > io_req->SGLOffset0 = offsetof(MRSAS_RAID_SCSI_IO_REQUEST, SGL) / 4; > io_req->ChainOffset = sc->chain_offset_mfi_pthru; > > - mpi25_ieee_chain->Address = mfi_cmd->frame_phys_addr; > + mpi25_ieee_chain->Address = htole64(mfi_cmd->frame_phys_addr); > > mpi25_ieee_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT | > MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR; > > - mpi25_ieee_chain->Length = sc->max_chain_frame_sz; > + mpi25_ieee_chain->Length = htole32(sc->max_chain_frame_sz); > > return (0); > } > @@ -4100,7 +4116,7 @@ mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd > break; > } > /* See if got an event notification */ > - if (cmd->frame->dcmd.opcode == MR_DCMD_CTRL_EVENT_WAIT) > + if (le32toh(cmd->frame->dcmd.opcode) == MR_DCMD_CTRL_EVENT_WAIT) > mrsas_complete_aen(sc, cmd); > else > mrsas_wakeup(sc, cmd); > @@ -4264,14 +4280,14 @@ megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) > dcmd->sge_count = 1; > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = (pd_seq_map_sz); > - dcmd->opcode = (MR_DCMD_SYSTEM_PD_MAP_GET_INFO); > - dcmd->sgl.sge32[0].phys_addr = (pd_seq_h); > - dcmd->sgl.sge32[0].length = (pd_seq_map_sz); > + dcmd->data_xfer_len = htole32(pd_seq_map_sz); > + dcmd->opcode = htole32(MR_DCMD_SYSTEM_PD_MAP_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32(pd_seq_h & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(pd_seq_map_sz); > > if (pend) { > dcmd->mbox.b[0] = MRSAS_DCMD_MBOX_PEND_FLAG; > - dcmd->flags = (MFI_FRAME_DIR_WRITE); > + dcmd->flags = htole16(MFI_FRAME_DIR_WRITE); > sc->jbod_seq_cmd = cmd; > if (mrsas_issue_dcmd(sc, cmd)) { > device_printf(sc->mrsas_dev, > @@ -4280,13 +4296,13 @@ megasas_sync_pd_seq_num(struct mrsas_softc *sc, boolean_t pend) > } else > return 0; > } else > - dcmd->flags = MFI_FRAME_DIR_READ; > + dcmd->flags = htole16(MFI_FRAME_DIR_READ); > > retcode = mrsas_issue_polled(sc, cmd); > if (retcode == ETIMEDOUT) > goto dcmd_timeout; > > - if (pd_sync->count > MAX_PHYSICAL_DEVICES) { > + if (le32toh(pd_sync->count) > MAX_PHYSICAL_DEVICES) { > device_printf(sc->mrsas_dev, > "driver supports max %d JBOD, but FW reports %d\n", > MAX_PHYSICAL_DEVICES, pd_sync->count); > @@ -4364,13 +4380,13 @@ mrsas_get_ld_map_info(struct mrsas_softc *sc) > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0xFF; > dcmd->sge_count = 1; > - dcmd->flags = MFI_FRAME_DIR_READ; > + dcmd->flags = htole16(MFI_FRAME_DIR_READ); > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sc->current_map_sz; > - dcmd->opcode = MR_DCMD_LD_MAP_GET_INFO; > - dcmd->sgl.sge32[0].phys_addr = map_phys_addr; > - dcmd->sgl.sge32[0].length = sc->current_map_sz; > + dcmd->data_xfer_len = htole32(sc->current_map_sz); > + dcmd->opcode = htole32(MR_DCMD_LD_MAP_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32(map_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sc->current_map_sz); > > retcode = mrsas_issue_polled(sc, cmd); > if (retcode == ETIMEDOUT) > @@ -4427,15 +4443,15 @@ mrsas_sync_map_info(struct mrsas_softc *sc) > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0xFF; > dcmd->sge_count = 1; > - dcmd->flags = MFI_FRAME_DIR_WRITE; > + dcmd->flags = htole16(MFI_FRAME_DIR_WRITE); > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sc->current_map_sz; > + dcmd->data_xfer_len = htole32(sc->current_map_sz); > dcmd->mbox.b[0] = num_lds; > dcmd->mbox.b[1] = MRSAS_DCMD_MBOX_PEND_FLAG; > - dcmd->opcode = MR_DCMD_LD_MAP_GET_INFO; > - dcmd->sgl.sge32[0].phys_addr = map_phys_addr; > - dcmd->sgl.sge32[0].length = sc->current_map_sz; > + dcmd->opcode = htole32(MR_DCMD_LD_MAP_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32(map_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sc->current_map_sz); > > sc->map_update_cmd = cmd; > if (mrsas_issue_dcmd(sc, cmd)) { > @@ -4472,17 +4488,17 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) > memset(sc->pd_info_mem, 0, sizeof(struct mrsas_pd_info)); > memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); > > - dcmd->mbox.s[0] = device_id; > + dcmd->mbox.s[0] = htole16(device_id); > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0xFF; > dcmd->sge_count = 1; > dcmd->flags = MFI_FRAME_DIR_READ; > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = sizeof(struct mrsas_pd_info); > - dcmd->opcode = MR_DCMD_PD_GET_INFO; > - dcmd->sgl.sge32[0].phys_addr = (u_int32_t)sc->pd_info_phys_addr; > - dcmd->sgl.sge32[0].length = sizeof(struct mrsas_pd_info); > + dcmd->data_xfer_len = htole32(sizeof(struct mrsas_pd_info)); > + dcmd->opcode = htole32(MR_DCMD_PD_GET_INFO); > + dcmd->sgl.sge32[0].phys_addr = htole32((u_int32_t)sc->pd_info_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(sizeof(struct mrsas_pd_info)); > > if (!sc->mask_interrupts) > retcode = mrsas_issue_blocked_cmd(sc, cmd); > @@ -4493,7 +4509,7 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t device_id) > goto dcmd_timeout; > > sc->target_list[device_id].interface_type = > - sc->pd_info_mem->state.ddf.pdType.intf; > + le16toh(sc->pd_info_mem->state.ddf.pdType.intf); > > do_ocr = 0; > > @@ -4572,6 +4588,7 @@ mrsas_get_pd_list(struct mrsas_softc *sc) > struct MR_PD_ADDRESS *pd_addr; > bus_addr_t pd_list_phys_addr = 0; > struct mrsas_tmp_dcmd *tcmd; > + u_int16_t dev_id; > > cmd = mrsas_get_mfi_cmd(sc); > if (!cmd) { > @@ -4601,13 +4618,13 @@ mrsas_get_pd_list(struct mrsas_softc *sc) > dcmd->cmd = MFI_CMD_DCMD; > dcmd->cmd_status = 0xFF; > dcmd->sge_count = 1; > - dcmd->flags = MFI_FRAME_DIR_READ; > + dcmd->flags = htole16(MFI_FRAME_DIR_READ); > dcmd->timeout = 0; > dcmd->pad_0 = 0; > - dcmd->data_xfer_len = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); > - dcmd->opcode = MR_DCMD_PD_LIST_QUERY; > - dcmd->sgl.sge32[0].phys_addr = pd_list_phys_addr; > - dcmd->sgl.sge32[0].length = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); > + dcmd->data_xfer_len = htole32(MRSAS_MAX_PD * sizeof(struct MR_PD_LIST)); > + dcmd->opcode = htole32(MR_DCMD_PD_LIST_QUERY); > + dcmd->sgl.sge32[0].phys_addr = htole32(pd_list_phys_addr & 0xFFFFFFFF); > + dcmd->sgl.sge32[0].length = htole32(MRSAS_MAX_PD * sizeof(struct MR_PD_LIST)); > > if (!sc->mask_interrupts) > retcode = mrsas_issue_blocked_cmd(sc, cmd); > @@ -4620,17 +4637,18 @@ mrsas_get_pd_list(struct mrsas_softc *sc) > /* Get the instance PD list */ > pd_count = MRSAS_MAX_PD; > pd_addr = pd_list_mem->addr; > - if (pd_list_mem->count < pd_count) { > + if (le32toh(pd_list_mem->count) < pd_count) { > memset(sc->local_pd_list, 0, > MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); > - for (pd_index = 0; pd_index < pd_list_mem->count; pd_index++) { > - sc->local_pd_list[pd_addr->deviceId].tid = pd_addr->deviceId; > - sc->local_pd_list[pd_addr->deviceId].driveType = > - pd_addr->scsiDevType; > - sc->local_pd_list[pd_addr->deviceId].driveState = > + for (pd_index = 0; pd_index < le32toh(pd_list_mem->count); pd_index++) { > + dev_id = le16toh(pd_addr->deviceId); > + sc->local_pd_list[dev_id].tid = dev_id; > + sc->local_pd_list[dev_id].driveType = > + le16toh(pd_addr->scsiDevType); > + sc->local_pd_list[dev_id].driveState = > MR_PD_STATE_SYSTEM; > - if (sc->target_list[pd_addr->deviceId].target_id == 0xffff) > - mrsas_add_target(sc, pd_addr->deviceId); > + if (sc->target_list[dev_id].target_id == 0xffff) > + mrsas_add_target(sc, dev_id); > pd_addr++; > } > for (pd_index = 0; pd_index < MRSAS_MAX_PD; pd_index++) { > @@ -4711,10 +4729,10 @@ mrsas_get_ld_list(struct mrsas_softc *sc) > dcmd->sge_count = 1; > dcmd->flags = MFI_FRAME_DIR_READ; > dcmd->timeout = 0; > - dcmd->data_xfer_len = sizeof(struct MR_LD_LIST); > - dcmd->opcode = MR_DCMD_LD_GET_LIST; > - dcmd->sgl.sge32[0].phys_addr = ld_list_phys_addr; > - dcmd->sgl.sge32[0].length = sizeof(struct MR_LD_LIST); > + dcmd->data_xfer_len = htole32(sizeof(struct MR_LD_LIST)); > + dcmd->opcode = htole32(MR_DCMD_LD_GET_LIST); > + dcmd->sgl.sge32[0].phys_addr = htole32(ld_list_phys_addr); > + dcmd->sgl.sge32[0].length = htole32(sizeof(struct MR_LD_LIST)); > dcmd->pad_0 = 0; > > if (!sc->mask_interrupts) > @@ -4730,10 +4748,10 @@ mrsas_get_ld_list(struct mrsas_softc *sc) > #endif > > /* Get the instance LD list */ > - if (ld_list_mem->ldCount <= sc->fw_supported_vd_count) { > - sc->CurLdCount = ld_list_mem->ldCount; > + if (le32toh(ld_list_mem->ldCount) <= sc->fw_supported_vd_count) { > + sc->CurLdCount = le32toh(ld_list_mem->ldCount); > memset(sc->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT); > - for (ld_index = 0; ld_index < ld_list_mem->ldCount; ld_index++) { > + for (ld_index = 0; ld_index < le32toh(ld_list_mem->ldCount); ld_index++) { > ids = ld_list_mem->ldList[ld_index].ref.ld_context.targetId; > drv_tgt_id = ids + MRSAS_MAX_PD; > if (ld_list_mem->ldList[ld_index].state != 0) { > diff --git a/sys/dev/mrsas/mrsas.h b/sys/dev/mrsas/mrsas.h > index fbb08215b7b1..069db02fadff 100644 > --- a/sys/dev/mrsas/mrsas.h > +++ b/sys/dev/mrsas/mrsas.h > @@ -165,14 +165,22 @@ do { \ > device_printf(sc->mrsas_dev, msg, ##args); \ > } while (0) > > +#define le32_to_cpus(x) do { *((u_int32_t *)(x)) = le32toh((*(u_int32_t *)x)); } while (0) > +#define le16_to_cpus(x) do { *((u_int16_t *)(x)) = le16toh((*(u_int16_t *)x)); } while (0) > + > /**************************************************************************** > * Raid Context structure which describes MegaRAID specific IO Paramenters > * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames > ****************************************************************************/ > > typedef struct _RAID_CONTEXT { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int8_t Type:4; > u_int8_t nseg:4; > +#else > + u_int8_t nseg:4; > + u_int8_t Type:4; > +#endif > u_int8_t resvd0; > u_int16_t timeoutValue; > u_int8_t regLockFlags; > @@ -197,12 +205,19 @@ typedef struct _RAID_CONTEXT { > * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames > */ > typedef struct _RAID_CONTEXT_G35 { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t Type:4; > u_int16_t nseg:4; > u_int16_t resvd0:8; > +#else > + u_int16_t resvd0:8; > + u_int16_t nseg:4; > + u_int16_t Type:4; > +#endif > u_int16_t timeoutValue; > union { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t reserved:1; > u_int16_t sld:1; > u_int16_t c2f:1; > @@ -213,6 +228,18 @@ typedef struct _RAID_CONTEXT_G35 { > u_int16_t log:1; > u_int16_t cpuSel:4; > u_int16_t setDivert:4; > +#else > + u_int16_t setDivert:4; > + u_int16_t cpuSel:4; > + u_int16_t log:1; > + u_int16_t rw:1; > + u_int16_t sbs:1; > + u_int16_t sqn:1; > + u_int16_t fwn:1; > + u_int16_t c2f:1; > + u_int16_t sld:1; > + u_int16_t reserved:1; > +#endif > } bits; > u_int16_t s; > } routingFlags; > @@ -228,9 +255,15 @@ typedef struct _RAID_CONTEXT_G35 { > u_int8_t RAIDFlags; > u_int8_t spanArm; > u_int16_t configSeqNum; > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t numSGE:12; > u_int16_t reserved:3; > u_int16_t streamDetected:1; > +#else > + u_int16_t streamDetected:1; > + u_int16_t reserved:3; > + u_int16_t numSGE:12; > +#endif > u_int8_t resvd2[2]; > } RAID_CONTEXT_G35; > > @@ -433,9 +466,15 @@ typedef struct _MR_TASK_MANAGE_REQUEST { > MR_TM_REQUEST TmRequest; > union { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t isTMForLD:1; > u_int32_t isTMForPD:1; > u_int32_t reserved1:30; > +#else > + u_int32_t reserved1:30; > + u_int32_t isTMForPD:1; > + u_int32_t isTMForLD:1; > +#endif > u_int32_t reserved2; > } tmReqFlags; > MR_TM_REPLY TMReply; > @@ -808,6 +847,7 @@ typedef struct _MR_SPAN_BLOCK_INFO { > > typedef struct _MR_LD_RAID { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t fpCapable:1; > u_int32_t raCapable:1; > u_int32_t reserved5:2; > @@ -822,6 +862,22 @@ typedef struct _MR_LD_RAID { > u_int32_t tmCapable:1; > u_int32_t fpCacheBypassCapable:1; > u_int32_t reserved4:5; > +#else > + u_int32_t reserved4:5; > + u_int32_t fpCacheBypassCapable:1; > + u_int32_t tmCapable:1; > + u_int32_t fpNonRWCapable:1; > + u_int32_t fpReadAcrossStripe:1; > + u_int32_t fpWriteAcrossStripe:1; > + u_int32_t fpReadCapable:1; > + u_int32_t fpWriteCapable:1; > + u_int32_t encryptionType:8; > + u_int32_t pdPiMode:4; > + u_int32_t ldPiMode:4; > + u_int32_t reserved5:2; > + u_int32_t raCapable:1; > + u_int32_t fpCapable:1; > +#endif > } capability; > u_int32_t reserved6; > u_int64_t size; > @@ -844,9 +900,15 @@ typedef struct _MR_LD_RAID { > u_int16_t seqNum; > > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > + u_int32_t reserved:30; > + u_int32_t regTypeReqOnReadLsValid:1; > + u_int32_t ldSyncRequired:1; > +#else > u_int32_t ldSyncRequired:1; > u_int32_t regTypeReqOnReadLsValid:1; > u_int32_t reserved:30; > +#endif > } flags; > > u_int8_t LUN[8]; > @@ -854,9 +916,15 @@ typedef struct _MR_LD_RAID { > u_int8_t reserved2[3]; > u_int32_t logicalBlockLength; > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > + u_int32_t reserved1:24; > + u_int32_t LdLogicalBlockExp:4; > + u_int32_t LdPiExp:4; > +#else > u_int32_t LdPiExp:4; > u_int32_t LdLogicalBlockExp:4; > u_int32_t reserved1:24; > +#endif > } exponent; > u_int8_t reserved3[0x80 - 0x38]; > } MR_LD_RAID; > @@ -1039,8 +1107,13 @@ struct MR_PD_CFG_SEQ { > u_int16_t seqNum; > u_int16_t devHandle; > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int8_t tmCapable:1; > u_int8_t reserved:7; > +#else > + u_int8_t reserved:7; > + u_int8_t tmCapable:1; > +#endif > } capability; > u_int8_t reserved; > u_int16_t pdTargetId; > @@ -1868,6 +1941,7 @@ struct mrsas_ctrl_prop { > * structure. > */ > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t copyBackDisabled:1; > u_int32_t SMARTerEnabled:1; > u_int32_t prCorrectUnconfiguredAreas:1; > @@ -1899,6 +1973,39 @@ struct mrsas_ctrl_prop { > u_int32_t enableSwZone:1; > u_int32_t limitMaxRateSATA3G:1; > u_int32_t reserved:2; > +#else > + u_int32_t reserved:2; > + u_int32_t limitMaxRateSATA3G:1; > + u_int32_t enableSwZone:1; > + u_int32_t ignore64ldRestriction:1; > + u_int32_t disableT10RebuildAssist:1; > + u_int32_t disableImmediateIO:1; > + u_int32_t enableAutoLockRecovery:1; > + u_int32_t enableVirtualCache:1; > + u_int32_t enableConfigAutoBalance:1; > + u_int32_t forceSGPIOForQuadOnly:1; > + u_int32_t useEmergencySparesforSMARTer:1; > + u_int32_t useUnconfGoodForEmergency:1; > + u_int32_t useGlobalSparesForEmergency:1; > + u_int32_t preventPIImport:1; > + u_int32_t enablePI:1; > + u_int32_t useDiskActivityForLocate:1; > + u_int32_t disableCacheBypass:1; > + u_int32_t enableJBOD:1; > + u_int32_t disableSpinDownHS:1; > + u_int32_t allowBootWithPinnedCache:1; > + u_int32_t disableOnlineCtrlReset:1; > + u_int32_t enableSecretKeyControl:1; > + u_int32_t autoEnhancedImport:1; > + u_int32_t enableSpinDownUnconfigured:1; > + u_int32_t SSDPatrolReadEnabled:1; > + u_int32_t SSDSMARTerEnabled:1; > + u_int32_t disableNCQ:1; > + u_int32_t useFdeOnly:1; > + u_int32_t prCorrectUnconfiguredAreas:1; > + u_int32_t SMARTerEnabled:1; > + u_int32_t copyBackDisabled:1; > +#endif > } OnOffProperties; > u_int8_t autoSnapVDSpace; > u_int8_t viewSpace; > @@ -2170,6 +2277,7 @@ struct mrsas_ctrl_info { > u_int16_t cacheMemorySize; /* 0x7A2 */ > > struct { /* 0x7A4 */ > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t supportPIcontroller:1; > u_int32_t supportLdPIType1:1; > u_int32_t supportLdPIType2:1; > @@ -2194,6 +2302,30 @@ struct mrsas_ctrl_info { > > u_int32_t supportUnevenSpans:1; > u_int32_t reserved:11; > +#else > + u_int32_t reserved:11; > + u_int32_t supportUnevenSpans:1; > + u_int32_t dedicatedHotSparesLimited:1; > + u_int32_t headlessMode:1; > + u_int32_t supportEmulatedDrives:1; > + u_int32_t supportResetNow:1; > + u_int32_t realTimeScheduler:1; > + u_int32_t supportSSDPatrolRead:1; > + u_int32_t supportPerfTuning:1; > + u_int32_t disableOnlinePFKChange:1; > + u_int32_t supportJBOD:1; > + u_int32_t supportBootTimePFKChange:1; > + u_int32_t supportSetLinkSpeed:1; > + u_int32_t supportEmergencySpares:1; > + u_int32_t supportSuspendResumeBGops:1; > + u_int32_t blockSSDWriteCacheChange:1; > + u_int32_t supportShieldState:1; > + u_int32_t supportLdBBMInfo:1; > + u_int32_t supportLdPIType3:1; > + u_int32_t supportLdPIType2:1; > + u_int32_t supportLdPIType1:1; > + u_int32_t supportPIcontroller:1; > +#endif > } adapterOperations2; > > u_int8_t driverVersion[32]; /* 0x7A8 */ > @@ -2206,6 +2338,7 @@ struct mrsas_ctrl_info { > u_int8_t reserved5[2]; /* 0x7CD reserved */ > > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t peerIsPresent:1; > u_int32_t peerIsIncompatible:1; > > @@ -2214,6 +2347,15 @@ struct mrsas_ctrl_info { > u_int32_t ctrlPropIncompatible:1; > u_int32_t premiumFeatureMismatch:1; > u_int32_t reserved:26; > +#else > + u_int32_t reserved:26; > + u_int32_t premiumFeatureMismatch:1; > + u_int32_t ctrlPropIncompatible:1; > + u_int32_t fwVersionMismatch:1; > + u_int32_t hwIncompatible:1; > + u_int32_t peerIsIncompatible:1; > + u_int32_t peerIsPresent:1; > +#endif > } cluster; > > char clusterId[16]; /* 0x7D4 */ > @@ -2221,6 +2363,7 @@ struct mrsas_ctrl_info { > char reserved6[4]; /* 0x7E4 RESERVED FOR IOV */ > > struct { /* 0x7E8 */ > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t supportPersonalityChange:2; > u_int32_t supportThermalPollInterval:1; > u_int32_t supportDisableImmediateIO:1; > @@ -2246,11 +2389,39 @@ struct mrsas_ctrl_info { > u_int32_t supportExtendedSSCSize:1; > u_int32_t useSeqNumJbodFP:1; > u_int32_t reserved:7; > +#else > + u_int32_t reserved:7; > + u_int32_t useSeqNumJbodFP:1; > + u_int32_t supportExtendedSSCSize:1; > + u_int32_t supportDiskCacheSettingForSysPDs:1; > + u_int32_t supportCPLDUpdate:1; > + u_int32_t supportTTYLogCompression:1; > + u_int32_t discardCacheDuringLDDelete:1; > + u_int32_t supportSecurityonJBOD:1; > + u_int32_t supportCacheBypassModes:1; > + u_int32_t supportDisableSESMonitoring:1; > + u_int32_t supportForceFlash:1; > + u_int32_t supportNVDRAM:1; > + u_int32_t supportDrvActivityLEDSetting:1; > + u_int32_t supportAllowedOpsforDrvRemoval:1; > + u_int32_t supportHOQRebuild:1; > + u_int32_t supportForceTo512e:1; > + u_int32_t supportNVCacheErase:1; > + u_int32_t supportDebugQueue:1; > + u_int32_t supportSwZone:1; > + u_int32_t supportCrashDump:1; > + u_int32_t supportMaxExtLDs:1; > + u_int32_t supportT10RebuildAssist:1; > + u_int32_t supportDisableImmediateIO:1; > + u_int32_t supportThermalPollInterval:1; > + u_int32_t supportPersonalityChange:2; > +#endif > } adapterOperations3; > > u_int8_t pad_cpld[16]; > > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t ctrlInfoExtSupported:1; > u_int16_t supportIbuttonLess:1; > u_int16_t supportedEncAlgo:1; > @@ -2260,6 +2431,17 @@ struct mrsas_ctrl_info { > u_int16_t supportPdMapTargetId:1; > u_int16_t FWSwapsBBUVPDInfo:1; > u_int16_t reserved:8; > +#else > + u_int16_t reserved:8; > + u_int16_t FWSwapsBBUVPDInfo:1; > + u_int16_t supportPdMapTargetId:1; > + u_int16_t supportSESCtrlInMultipathCfg:1; > + u_int16_t imageUploadSupported:1; > + u_int16_t supportEncryptedMfc:1; > + u_int16_t supportedEncAlgo:1; > + u_int16_t supportIbuttonLess:1; > + u_int16_t ctrlInfoExtSupported:1; > +#endif > } adapterOperations4; > > u_int8_t pad[0x800 - 0x7FE]; /* 0x7FE */ > @@ -2332,6 +2514,7 @@ struct mrsas_ctrl_info { > > typedef union _MFI_CAPABILITIES { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t support_fp_remote_lun:1; > u_int32_t support_additional_msix:1; > u_int32_t support_fastpath_wb:1; > @@ -2342,6 +2525,18 @@ typedef union _MFI_CAPABILITIES { > u_int32_t support_ext_queue_depth:1; > u_int32_t support_ext_io_size:1; > u_int32_t reserved:23; > +#else > + u_int32_t reserved:23; > + u_int32_t support_ext_io_size:1; > + u_int32_t support_ext_queue_depth:1; > + u_int32_t security_protocol_cmds_fw:1; > + u_int32_t support_core_affinity:1; > + u_int32_t support_ndrive_r1_lb:1; > + u_int32_t support_max_255lds:1; > + u_int32_t support_fastpath_wb:1; > + u_int32_t support_additional_msix:1; > + u_int32_t support_fp_remote_lun:1; > +#endif > } mfi_capabilities; > u_int32_t reg; > } MFI_CAPABILITIES; > @@ -2602,9 +2797,15 @@ union mrsas_frame { > #pragma pack(1) > union mrsas_evt_class_locale { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t locale; > u_int8_t reserved; > int8_t class; > +#else > + int8_t class; > + u_int8_t reserved; > + u_int16_t locale; > +#endif > } __packed members; > > u_int32_t word; > @@ -2890,6 +3091,7 @@ typedef struct _MRSAS_DRV_PCI_COMMON_HEADER { > typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { > union { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t linkSpeed:4; > u_int32_t linkWidth:6; > u_int32_t aspmSupport:2; > @@ -2897,6 +3099,15 @@ typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { > u_int32_t l1ExitLatency:3; > u_int32_t rsvdp:6; > u_int32_t portNumber:8; > +#else > + u_int32_t portNumber:8; > + u_int32_t rsvdp:6; > + u_int32_t l1ExitLatency:3; > + u_int32_t losExitLatency:3; > + u_int32_t aspmSupport:2; > + u_int32_t linkWidth:6; > + u_int32_t linkSpeed:4; > +#endif > } bits; > > u_int32_t asUlong; > @@ -2908,12 +3119,21 @@ typedef struct _MRSAS_DRV_PCI_LINK_CAPABILITY { > typedef struct _MRSAS_DRV_PCI_LINK_STATUS_CAPABILITY { > union { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t linkSpeed:4; > u_int16_t negotiatedLinkWidth:6; > u_int16_t linkTrainingError:1; > u_int16_t linkTraning:1; > u_int16_t slotClockConfig:1; > u_int16_t rsvdZ:3; > +#else > + u_int16_t rsvdZ:3; > + u_int16_t slotClockConfig:1; > + u_int16_t linkTraning:1; > + u_int16_t linkTrainingError:1; > + u_int16_t negotiatedLinkWidth:6; > + u_int16_t linkSpeed:4; > +#endif > } bits; > > u_int16_t asUshort; > @@ -2967,6 +3187,7 @@ union MR_PD_DDF_TYPE { > struct { > union { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int16_t forcedPDGUID:1; > u_int16_t inVD:1; > u_int16_t isGlobalSpare:1; > @@ -2974,6 +3195,15 @@ union MR_PD_DDF_TYPE { > u_int16_t isForeign:1; > u_int16_t reserved:7; > u_int16_t intf:4; > +#else > + u_int16_t intf:4; > + u_int16_t reserved:7; > + u_int16_t isForeign:1; > + u_int16_t isSpare:1; > + u_int16_t isGlobalSpare:1; > + u_int16_t inVD:1; > + u_int16_t forcedPDGUID:1; > +#endif > } pdType; > u_int16_t type; > }; > @@ -3004,6 +3234,7 @@ union MR_PROGRESS { > */ > struct MR_PD_PROGRESS { > struct { > +#if _BYTE_ORDER == _LITTLE_ENDIAN > u_int32_t rbld:1; > u_int32_t patrol:1; > u_int32_t clear:1; > @@ -3011,6 +3242,15 @@ struct MR_PD_PROGRESS { > u_int32_t erase:1; > u_int32_t locate:1; > u_int32_t reserved:26; > *** 783 LINES SKIPPED *** > From owner-dev-commits-src-all@freebsd.org Thu Feb 4 14:03: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 7F2BF5440CF; Thu, 4 Feb 2021 14:03: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 4DWgHx37vRz3tHr; Thu, 4 Feb 2021 14:03: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 5EAF55055; Thu, 4 Feb 2021 14:03: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 114E3P5C040110; Thu, 4 Feb 2021 14:03:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114E3Plx040109; Thu, 4 Feb 2021 14:03:25 GMT (envelope-from git) Date: Thu, 4 Feb 2021 14:03:25 GMT Message-Id: <202102041403.114E3Plx040109@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: 63a3f5906676 - stable/13 - src.opts.mk: set MK_ZFS conditional on MK_OPENSSL 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: 63a3f59066765c251de8cb80bf841b916b4f4061 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:03:25 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=63a3f59066765c251de8cb80bf841b916b4f4061 commit 63a3f59066765c251de8cb80bf841b916b4f4061 Author: Mitchell Horne AuthorDate: 2021-01-30 19:04:08 +0000 Commit: Mitchell Horne CommitDate: 2021-02-04 13:57:31 +0000 src.opts.mk: set MK_ZFS conditional on MK_OPENSSL PR: 252841 Reviewed by: kevans, freqlabs (cherry picked from commit e5cc1c47484160969e0a7c13cdbc71081d7dd60e) --- share/mk/src.opts.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index a7eddb12d2c8..6c8100bac548 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -432,6 +432,7 @@ MK_LDNS:= no MK_PKGBOOTSTRAP:= no MK_SVN:= no MK_SVNLITE:= no +MK_ZFS:= no .endif .if ${MK_LDNS} == "no" From owner-dev-commits-src-all@freebsd.org Thu Feb 4 14:03: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 CDC205443F2; Thu, 4 Feb 2021 14:03: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 4DWgHy50hcz3t6p; Thu, 4 Feb 2021 14:03: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 8642C4F3C; Thu, 4 Feb 2021 14:03: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 114E3QKn040133; Thu, 4 Feb 2021 14:03:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114E3QqN040132; Thu, 4 Feb 2021 14:03:26 GMT (envelope-from git) Date: Thu, 4 Feb 2021 14:03:26 GMT Message-Id: <202102041403.114E3QqN040132@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: b6cbf02ad87e - stable/13 - src.conf.5: regenerate 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: b6cbf02ad87e2aa088aefb3176b94225890ce1b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:03:27 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=b6cbf02ad87e2aa088aefb3176b94225890ce1b6 commit b6cbf02ad87e2aa088aefb3176b94225890ce1b6 Author: Mitchell Horne AuthorDate: 2021-02-04 14:00:11 +0000 Commit: Mitchell Horne CommitDate: 2021-02-04 14:02:56 +0000 src.conf.5: regenerate Direct commit to stable/13. --- share/man/man5/src.conf.5 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 6c02df1ac7de..a3802b59a3f5 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 January 30, 2021 +.Dd February 4, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -400,6 +400,8 @@ When set, it enforces these options: .Va WITHOUT_SVNLITE .It .Va WITHOUT_UNBOUND +.It +.Va WITHOUT_ZFS .El .Pp When set, these options are also in effect: @@ -1295,6 +1297,8 @@ When set, it enforces these options: .Va WITHOUT_SVNLITE .It .Va WITHOUT_UNBOUND +.It +.Va WITHOUT_ZFS .El .Pp When set, these options are also in effect: From owner-dev-commits-src-all@freebsd.org Thu Feb 4 14:23: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 518A55449E3; Thu, 4 Feb 2021 14:23: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 4DWgkX1y2wz3vHr; Thu, 4 Feb 2021 14:23: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 35C1755B1; Thu, 4 Feb 2021 14:23: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 114EN0L3066371; Thu, 4 Feb 2021 14:23:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114EN0qv066370; Thu, 4 Feb 2021 14:23:00 GMT (envelope-from git) Date: Thu, 4 Feb 2021 14:23:00 GMT Message-Id: <202102041423.114EN0qv066370@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: 683d086626cd - stable/13 - bridge: fix STP roles and protos strings 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: 683d086626cd41a1c22c7ab5cd1c3c52591c5bf7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:23:00 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=683d086626cd41a1c22c7ab5cd1c3c52591c5bf7 commit 683d086626cd41a1c22c7ab5cd1c3c52591c5bf7 Author: Jonah Caplan AuthorDate: 2021-01-30 13:54:09 +0000 Commit: Kristof Provost CommitDate: 2021-02-04 14:22:45 +0000 bridge: fix STP roles and protos strings Add the missing commas that got lost in e5539fb618cc7. PR: 252532 Reviewd by: kp@, donner@, freqlabs@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28425 (cherry picked from commit 88be0e11205e4a2dc77e29f7b4a2e82b8d7c9a5c) --- sys/net/if_bridgevar.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h index fef252821be7..c12ee4598548 100644 --- a/sys/net/if_bridgevar.h +++ b/sys/net/if_bridgevar.h @@ -278,15 +278,15 @@ struct ifbpstpconf { "discarding" #define STP_PROTOS \ - "stp" \ - "-" \ + "stp", \ + "-", \ "rstp" #define STP_ROLES \ - "disabled" \ - "root" \ - "designated" \ - "alternate" \ + "disabled", \ + "root", \ + "designated", \ + "alternate", \ "backup" #define PV2ID(pv, epri, eaddr) do { \ From owner-dev-commits-src-all@freebsd.org Thu Feb 4 14:23: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 65C1B544D02; Thu, 4 Feb 2021 14:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWgkY2QCCz3v7K; Thu, 4 Feb 2021 14:23: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 4609F55B2; Thu, 4 Feb 2021 14:23: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 114EN1AB066402; Thu, 4 Feb 2021 14:23:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114EN1cZ066401; Thu, 4 Feb 2021 14:23:01 GMT (envelope-from git) Date: Thu, 4 Feb 2021 14:23:01 GMT Message-Id: <202102041423.114EN1cZ066401@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: 620455079f47 - stable/13 - ipfw(8) crashes when ext6hdr option is omitted 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: 620455079f47a9d7361b46b965abf273ac6787de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:23:01 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=620455079f47a9d7361b46b965abf273ac6787de commit 620455079f47a9d7361b46b965abf273ac6787de Author: Evgeniy Khramtsov <2khramtsov@gmail.com> AuthorDate: 2021-02-01 19:03:57 +0000 Commit: Kristof Provost CommitDate: 2021-02-04 14:22:45 +0000 ipfw(8) crashes when ext6hdr option is omitted Verify that the option is passed, error out if it's not. The problem can be trivially triggered with `ipfw add allow ext6hdr`. PR: 253169 Reviewed by: kp@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28447 (cherry picked from commit 682c31db4ecfb8fc6cac0e8ad4945c03379ea3d1) --- sbin/ipfw/ipfw2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 67303d8bb1e7..19f7f331091d 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -4961,6 +4961,7 @@ read_options: break; case TOK_EXT6HDR: + NEED1("missing extension header"); fill_ext6hdr( cmd, *av ); av++; break; From owner-dev-commits-src-all@freebsd.org Thu Feb 4 14:23: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 578B1544D81; Thu, 4 Feb 2021 14:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWgkZ4TsNz3vHy; Thu, 4 Feb 2021 14:23: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 66E695536; Thu, 4 Feb 2021 14:23: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 114EN2x3066486; Thu, 4 Feb 2021 14:23:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114EN2Zb066479; Thu, 4 Feb 2021 14:23:02 GMT (envelope-from git) Date: Thu, 4 Feb 2021 14:23:02 GMT Message-Id: <202102041423.114EN2Zb066479@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: ad6079266683 - stable/12 - bridge: fix STP roles and protos strings 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: ad60792666831d6beafbc555cc1fec0305d7f8f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:23:03 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ad60792666831d6beafbc555cc1fec0305d7f8f5 commit ad60792666831d6beafbc555cc1fec0305d7f8f5 Author: Jonah Caplan AuthorDate: 2021-01-30 13:54:09 +0000 Commit: Kristof Provost CommitDate: 2021-02-04 08:13:43 +0000 bridge: fix STP roles and protos strings Add the missing commas that got lost in e5539fb618cc7. PR: 252532 Reviewd by: kp@, donner@, freqlabs@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28425 (cherry picked from commit 88be0e11205e4a2dc77e29f7b4a2e82b8d7c9a5c) --- sys/net/if_bridgevar.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h index fef252821be7..c12ee4598548 100644 --- a/sys/net/if_bridgevar.h +++ b/sys/net/if_bridgevar.h @@ -278,15 +278,15 @@ struct ifbpstpconf { "discarding" #define STP_PROTOS \ - "stp" \ - "-" \ + "stp", \ + "-", \ "rstp" #define STP_ROLES \ - "disabled" \ - "root" \ - "designated" \ - "alternate" \ + "disabled", \ + "root", \ + "designated", \ + "alternate", \ "backup" #define PV2ID(pv, epri, eaddr) do { \ From owner-dev-commits-src-all@freebsd.org Thu Feb 4 14: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 E973E544D8A; Thu, 4 Feb 2021 14: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 4DWgkc04xMz3vWd; Thu, 4 Feb 2021 14:23: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 83DFE5537; Thu, 4 Feb 2021 14:23: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 114EN36t066541; Thu, 4 Feb 2021 14:23:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114EN3ZC066540; Thu, 4 Feb 2021 14:23:03 GMT (envelope-from git) Date: Thu, 4 Feb 2021 14:23:03 GMT Message-Id: <202102041423.114EN3ZC066540@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: d2eeacf7728a - stable/12 - ipfw(8) crashes when ext6hdr option is omitted 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: d2eeacf7728a04ee04be8a69b2b1bf375ff24994 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:23:05 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d2eeacf7728a04ee04be8a69b2b1bf375ff24994 commit d2eeacf7728a04ee04be8a69b2b1bf375ff24994 Author: Evgeniy Khramtsov <2khramtsov@gmail.com> AuthorDate: 2021-02-01 19:03:57 +0000 Commit: Kristof Provost CommitDate: 2021-02-04 08:13:46 +0000 ipfw(8) crashes when ext6hdr option is omitted Verify that the option is passed, error out if it's not. The problem can be trivially triggered with `ipfw add allow ext6hdr`. PR: 253169 Reviewed by: kp@ MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28447 (cherry picked from commit 682c31db4ecfb8fc6cac0e8ad4945c03379ea3d1) --- sbin/ipfw/ipfw2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 85347b1add03..30a4da92343f 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -4961,6 +4961,7 @@ read_options: break; case TOK_EXT6HDR: + NEED1("missing extension header"); fill_ext6hdr( cmd, *av ); av++; break; From owner-dev-commits-src-all@freebsd.org Thu Feb 4 14:44: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 0879E545A87; Thu, 4 Feb 2021 14:44: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 4DWhCt6dhfz4S6J; Thu, 4 Feb 2021 14: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 D6B5E5A16; Thu, 4 Feb 2021 14: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 114Eiwma092740; Thu, 4 Feb 2021 14: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 114Eiw8J092739; Thu, 4 Feb 2021 14:44:58 GMT (envelope-from git) Date: Thu, 4 Feb 2021 14:44:58 GMT Message-Id: <202102041444.114Eiw8J092739@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: 40a37d24a8ed - stable/12 - Revert "opencrypto: Fix assignment of crypto completions to worker threads" 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: 40a37d24a8ed2d6e81919ed3c124494cbcf5c527 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:44:59 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=40a37d24a8ed2d6e81919ed3c124494cbcf5c527 commit 40a37d24a8ed2d6e81919ed3c124494cbcf5c527 Author: Mark Johnston AuthorDate: 2021-02-04 14:43:10 +0000 Commit: Mark Johnston CommitDate: 2021-02-04 14:44:53 +0000 Revert "opencrypto: Fix assignment of crypto completions to worker threads" atomic_fetchadd_64 is not available on all platforms on stable/12. This reverts commit 10ed8ab4ab9bd0239f2913ac2f35af9b9f76221d. Reported by: Mark Millard --- sys/opencrypto/crypto.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index bc23056e86ad..dfd22662e87f 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -94,7 +94,6 @@ struct crypto_session { void *softc; uint32_t hid; uint32_t capabilities; - uint64_t id; }; SDT_PROVIDER_DEFINE(opencrypto); @@ -573,7 +572,6 @@ again: int crypto_newsession(crypto_session_t *cses, struct cryptoini *cri, int crid) { - static uint64_t sessid = 0; crypto_session_t res; void *softc_mem; struct cryptocap *cap; @@ -618,7 +616,6 @@ restart: softc_mem = malloc(softc_size, M_CRYPTO_DATA, M_WAITOK | M_ZERO); res = uma_zalloc(cryptoses_zone, M_WAITOK | M_ZERO); res->softc = softc_mem; - res->id = atomic_fetchadd_64(&sessid, 1); CRYPTO_DRIVER_LOCK(); cap = crypto_checkdriver(hid); @@ -1019,7 +1016,7 @@ crypto_dispatch(struct cryptop *crp) binuptime(&crp->crp_tstamp); #endif - crp->crp_retw_id = crp->crp_session->id % crypto_workers_num; + crp->crp_retw_id = ((uintptr_t)crp->crp_session) % crypto_workers_num; if (CRYPTOP_ASYNC(crp)) { if (crp->crp_flags & CRYPTO_F_ASYNC_KEEPORDER) { From owner-dev-commits-src-all@freebsd.org Thu Feb 4 15:10: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 D3D92546226; Thu, 4 Feb 2021 15:10: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 4DWhnd5bNWz4TYH; Thu, 4 Feb 2021 15:10: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 B2BD65A74; Thu, 4 Feb 2021 15:10: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 114FAjO8027601; Thu, 4 Feb 2021 15:10:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114FAjrx027600; Thu, 4 Feb 2021 15:10:45 GMT (envelope-from git) Date: Thu, 4 Feb 2021 15:10:45 GMT Message-Id: <202102041510.114FAjrx027600@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: c203bd70b595 - main - Import atf 0.22 snapshot ca73d08c3fc1ecffc1f1c97458c31ab82c12bb01 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: c203bd70b5957f85616424b6fa374479372d06e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 15:10:45 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c203bd70b5957f85616424b6fa374479372d06e3 commit c203bd70b5957f85616424b6fa374479372d06e3 Merge: cb7cc72c546e a3330ae73660 Author: Alex Richardson AuthorDate: 2021-02-04 14:48:10 +0000 Commit: Alex Richardson CommitDate: 2021-02-04 15:03:05 +0000 Import atf 0.22 snapshot ca73d08c3fc1ecffc1f1c97458c31ab82c12bb01 This includes improvements to the atf-sh helper functions that significantly reduce the number of spawned processes for each test and therefore speeds up running the testsuite noticeably. contrib/atf/.cirrus.yml | 26 ++++++ contrib/atf/.gitignore | 25 ++++++ contrib/atf/.travis.yml | 25 ++++++ contrib/atf/NEWS | 18 ++++ contrib/atf/README.md | 47 ++++++++++ contrib/atf/atf-c++/atf-c++.3 | 4 +- contrib/atf/atf-c++/detail/test_helpers.hpp | 5 ++ contrib/atf/atf-c++/tests.hpp | 2 +- contrib/atf/atf-c++/utils.cpp | 7 ++ contrib/atf/atf-c++/utils.hpp | 1 + contrib/atf/atf-c++/utils_test.cpp | 1 + contrib/atf/atf-c/.gitignore | 1 + contrib/atf/atf-c/check.c | 3 +- contrib/atf/atf-c/detail/fs_test.c | 9 +- contrib/atf/atf-c/detail/list.c | 2 +- contrib/atf/atf-c/detail/process.c | 3 +- contrib/atf/atf-c/detail/test_helpers.h | 7 ++ contrib/atf/atf-c/tc.c | 116 +++++++++++++++++++------ contrib/atf/atf-c/utils.c | 10 +++ contrib/atf/atf-c/utils.h | 1 + contrib/atf/atf-c/utils_test.c | 1 + contrib/atf/atf-sh/.gitignore | 2 + contrib/atf/atf-sh/atf-check.1 | 15 +++- contrib/atf/atf-sh/atf-check.cpp | 128 +++++++++++++++++++++++++--- contrib/atf/atf-sh/atf-sh.3 | 11 ++- contrib/atf/atf-sh/atf_check_test.sh | 24 ++++++ contrib/atf/atf-sh/libatf-sh.subr | 32 ++++++- contrib/atf/atf-sh/misc_helpers.sh | 48 +++++++++++ contrib/atf/doc/.gitignore | 1 + contrib/atf/doc/atf-test-case.4 | 17 ++-- lib/atf/libatf-c++/tests/Makefile | 2 + 31 files changed, 541 insertions(+), 53 deletions(-) diff --cc contrib/atf/.cirrus.yml index 000000000000,000000000000..fd9b6e4a47df new file mode 100644 --- /dev/null +++ b/contrib/atf/.cirrus.yml @@@ -1,0 -1,0 +1,26 @@@ ++env: ++ CIRRUS_CLONE_DEPTH: 1 ++ ARCH: amd64 ++ ++task: ++ matrix: ++ - name: 13.0-CURRENT ++ freebsd_instance: ++ image_family: freebsd-13-0-snap ++ - name: 12.2-STABLE ++ freebsd_instance: ++ image_family: freebsd-12-2-snap ++ - name: 12.1-RELEASE ++ freebsd_instance: ++ image_family: freebsd-12-1 ++ install_script: ++ - sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf ++ - ASSUME_ALWAYS_YES=yes pkg bootstrap -f ++ - pkg install -y autoconf automake libtool kyua ++ script: ++ - env JUNIT_OUTPUT=$(pwd)/test-results.xml ./admin/travis-build.sh ++ always: ++ junit_artifacts: ++ path: "test-results.xml" ++ type: text/xml ++ format: junit diff --cc contrib/atf/.gitignore index 000000000000,000000000000..396785ce2052 new file mode 100644 --- /dev/null +++ b/contrib/atf/.gitignore @@@ -1,0 -1,0 +1,25 @@@ ++*.la ++*.lo ++*.o ++*.pc ++*_helper ++*_helpers ++*_test ++.deps ++.dirstamp ++.libs ++ ++Makefile ++Makefile.in ++aclocal.m4 ++autom4te.cache ++config.h ++config.h.in ++config.h.in~ ++config.log ++config.status ++configure ++installcheck.log ++libtool ++stamp-h1 ++testsuite.log diff --cc contrib/atf/.travis.yml index 000000000000,1949aae54468..1949aae54468 mode 000000,100644..100644 --- a/contrib/atf/.travis.yml +++ b/contrib/atf/.travis.yml diff --cc contrib/atf/NEWS index f1764e0d9dda,000000000000..671ee81ff6ff mode 100644,000000..100644 --- a/contrib/atf/NEWS +++ b/contrib/atf/NEWS @@@ -1,726 -1,0 +1,744 @@@ +Major changes between releases Automated Testing Framework +=========================================================================== + ++Changes in version 0.22 ++*********************** ++ ++STILL UNDER DEVELOPMENT; NOT RELEASED YET. ++DON'T FORGET TO BUMP THE -version-info PRE-RELEASE IF NECESSARY! ++ ++* Issue #23: Fix double-free triggered by atf_map_insert in low memory ++ scenarios, caused by an overlook in the atf_list code. ++ ++* Issue #29: Fixed various typos and formatting errors in manual pages. ++ ++* Issue #31: Added require.progs metadata properties to the tests that ++ need a compiler to run. ++ ++* Added the atf_check_not_equal function to atf-sh to check for ++ unequal values. ++ ++ +Changes in version 0.21 +*********************** + +Released on October 23rd, 2014. + +* Restored the atf(7) manual page to serve as a reference to all the other + manual pages shipped by ATF. + +* Added the -s flag to atf-sh to support specifying the shell interpreter + to be used. + +* Removed ATF_WORKDIR. The only remaining consumers have been converted to + use the standard TMPDIR environment variable. As a benefit, and because + Kyua forces the TMPDIR to live within the test case's work directory, + any stale files left behind by ATF will be automatically cleaned up. + +* Documented the environment variables recognized by each component in the + relevant manual pages. This information was lost with the atf-config(1) + removal. + +* Added a new "require.diskspace" metadata property to test cases so that + they can specify the minimum amount of disk space required for the test + to run. + +* Renamed the atf-{c,c++,sh}-api(3) manual pages to atf-{c,c++,sh}(3) for + discoverability purposes. Symbolic links are provided for the time + being to still make the old names visible. + +* Issue #5: Recommend the (expected, actual) idiom for calls to the test + macros in the manual pages. + +* Issue #7: Stopped catching unhandled exceptions in atf-c++ tests. This + propagates the crash to the caller, which in turn allows it to obtain + proper debugging information. In particular, Kyua should now be able to + extract a stacktrace pinpointing the problem. + +* Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang + that ships with FreeBSD 11.0-CURRENT. + +* Issue #12: Improved documentation of atf-sh(3) and atf-check(1) by better + explaining how they relate to each other. + +* Issue #14: Stopped setting 'set -e' in atf-sh. This setting was + initially added as a way to enable a "strict" mode in the library and to + make test cases fail fast when they run unprotected commands. However, + doing so in the library is surprising as the responsibility of enabling + 'set -e' should be on the user's code. Also, 'set -e' introduces + inconsistent behavior on subshells and users do not expect that. + +* Issue #15: Fixed atf_utils_{fork,wait} to support nested calls. + +* Issue #16: Fixed test failures (by removing a long-standing hack) on + systems that lack \e support in printf(1). + +* Issue #19: Removed stale references to atf-config and atf-run. + + +Changes in version 0.20 +*********************** + +Experimental version released on February 7th, 2014. + +This is the first release without the code for the deprecated tools. If +you require such code, please fetch a copy of the 0.19 release and extract +the 'tools' directory for your own consumption. + +* Removed the deprecated tools. This includes atf-config, atf-report, + atf-run and atf-version. + +* Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang + that ships with FreeBSD 11.0-CURRENT. + + +Changes in version 0.19 +*********************** + +Experimental version released on February 7th, 2014. + +This is the last release to bundle the code for the deprecated tools. +The next release will drop their code and will stop worrying about +backwards compatibility between the ATF libraries and what the old tools +may or may not support. + +If you still require the old tools for some reason, grab a copy of the +'tools' directory now. The code in this directory is standalone and +does not depend on any internal details of atf-c++ any longer. + +* Various fixes and improvements to support running as part of the FreeBSD + test suite. + +* Project hosting moved from Google Code (as a subproject of Kyua) to + GitHub (as a first-class project). The main reason for the change is + the suppression of binary downloads in Google Code on Jan 15th, 2014. + See https://github.com/jmmv/atf/ + +* Removed builtin help from atf-sh(1) and atf-check(1) for simplicity + reasons. In other words, their -h option is gone. + +* Moved the code of the deprecated tools into a 'tools' directory and + completely decoupled their code from the internals of atf-c++. The + reason for this is to painlessly allow a third-party to maintain a + copy of these tools after we delete them because upcoming changes to + atf-c++ would break the stale tools. + + +Changes in version 0.18 +*********************** + +Experimental version released on November 16th, 2013. + +* Issue 45: Added require.memory support in atf-run for FreeBSD. + +* Fixed an issue with the handling of cin with libc++. + +* Issue 64: Fixed various mandoc formatting warnings. + +* NetBSD PR bin/48284: Made atf-check flush its progress message to + stdout so that an interrupted test case always shows the last message + being executed. + +* NetBSD PR bin/48285: Fixed atf_check examples in atf-sh-api(3). + + +Changes in version 0.17 +*********************** + +Experimental version released on February 14th, 2013. + +* Added the atf_utils_cat_file, atf_utils_compare_file, + atf_utils_copy_file, atf_utils_create_file, atf_utils_file_exists, + atf_utils_fork, atf_utils_grep_file, atf_utils_grep_string, + atf_utils_readline, atf_utils_redirect and atf_utils_wait utility + functions to atf-c-api. Documented the already-public + atf_utils_free_charpp function. + +* Added the cat_file, compare_file, copy_file, create_file, file_exists, + fork, grep_collection, grep_file, grep_string, redirect and wait + functions to the atf::utils namespace of atf-c++-api. These are + wrappers around the same functions added to the atf-c-api library. + +* Added the ATF_CHECK_MATCH, ATF_CHECK_MATCH_MSG, ATF_REQUIRE_MATCH and + ATF_REQUIRE_MATCH_MSG macros to atf-c to simplify the validation of a + string against a regular expression. + +* Miscellaneous fixes for manpage typos and compilation problems with + clang. + +* Added caching of the results of those configure tests that rely on + executing a test program. This should help crossbuild systems by + providing a mechanism to pre-specify what the results should be. + +* PR bin/45690: Make atf-report convert any non-printable characters to + a plain-text representation (matching their corresponding hexadecimal + entities) in XML output files. This is to prevent the output of test + cases from breaking xsltproc later. + + +Changes in version 0.16 +*********************** + +Experimental version released on July 10th, 2012. + +* Added a --enable-tools flag to configure to request the build of the + deprecated ATF tools, whose build is now disabled by default. In order + to continue running tests, you should migrate to Kyua instead of enabling + the build of the deprecated tools. The kyua-atf-compat package provides + transitional compatibility versions of atf-run and atf-report built on + top of Kyua. + +* Tweaked the ATF_TEST_CASE macro of atf-c++ so that the compiler can + detect defined but unused test cases. + +* PR bin/45859: Fixed some XSLT bugs that resulted in the tc-time and + tp-time XML tags leaking into the generated HTML file. Also improved + the CSS file slightly to correct alignment and color issues with the + timestamps column. + +* Optimized atf-c++/macros.hpp so that GNU G++ consumes less memory during + compilation with GNU G++. + +* Flipped the default to building shared libraries for atf-c and atf-c++, + and started versioning them. As a side-effect, this removes the + --enable-unstable-shared flag from configure that appears to not work any + more (under NetBSD). Additionally, some distributions require the use of + shared libraries for proper dependency tracking (e.g. Fedora), so it is + better if we do the right versioning upstream. + +* Project hosting moved from an adhoc solution (custom web site and + Monotone repository) to Google Code (standard wiki and Git). ATF now + lives in a subcomponent of the Kyua project. + + +Changes in version 0.15 +*********************** + +Experimental version released on January 16th, 2012. + +* Respect stdin in atf-check. The previous release silenced stdin for any + processes spawned by atf, not only test programs, which caused breakage + in tests that pipe data through atf-check. + +* Performance improvements to atf-sh. + +* Enabled detection of unused parameters and variables in the code and + fixed all warnings. + +* Changed the behavior of "developer mode". Compiler warnings are now + enabled unconditionally regardless of whether we are in developer mode or + not; developer mode is now only used to perform strict warning checks and + to enable assertions. Additionally, developer mode is now only + automatically enabled when building from the repository, not for formal + releases. + +* Added new Autoconf M4 macros (ATF_ARG_WITH, ATF_CHECK_C and + ATF_CHECK_CXX) to provide a consistent way of defining a --with-arg flag + in configure scripts and detecting the presence of any of the ATF + bindings. Note that ATF_CHECK_SH was already introduced in 0.14, but it + has now been modified to also honor --with-atf if instantiated. + +* Added timing support to atf-run / atf-report. + +* Added support for a 'require.memory' property, to specify the minimum + amount of physical memory needed by the test case to yield valid results. + +* PR bin/45690: Force an ISO-8859-1 encoding in the XML files generated by + atf-report so that invalid data in the output of test cases does not + mangle our report. + + +Changes in version 0.14 +*********************** + +Experimental version released on June 14th, 2011. + +* Added a pkg-config file for atf-sh and an aclocal file to ease the + detection of atf-sh from autoconf scripts. + +* Made the default test case body defined by atf_sh fail. This is to + ensure that test cases are properly defined in test programs and helps + in catching typos in the names of the body functions. + +* PR bin/44882: Made atf-run connect the stdin of test cases to /dev/zero. + This provides more consistent results with "normal" execution (in + particular, when tests are executed detached from a terminal). + +* Made atf-run hardcode TZ=UTC for test cases. It used to undefine TZ, but + that does not take into account that libc determines the current timezone + from a configuration file. + +* All test programs will now print a warning when they are not run through + atf-run(1) stating that this is unsupported and may deliver incorrect + results. + +* Added support for the 'require.files' test-case property. This allows + test cases to specify installed files that must be present for the test + case to run. + + +Changes in version 0.13 +*********************** + +Experimental version released on March 31st, 2011. + +This is the first release after the creation of the Kyua project, a more +modular and reliable replacement for ATF. From now on, ATF will change to +accomodate the transition to this new codebase, but ATF will still continue +to see development in the short/medium term. Check out the project page at +http://code.google.com/p/kyua/ for more details. + +The changes in this release are: + +* Added support to run the tests with the Kyua runtime engine (kyua-cli), a + new package that aims to replace atf-run and atf-report. The ATF tests + can be run with the new system by issuing a 'make installcheck-kyua' from + the top-level directory of the project (assuming the 'kyua' binary is + available during the configuration stage of ATF). + +* atf-run and atf-report are now in maintenance mode (but *not* deprecated + yet!). Kyua already implements a new, much more reliable runtime engine + that provides similar features to these tools. That said, it is not + complete yet so all development efforts should go towards it. + +* If GDB is installed, atf-run dumps the stack trace of crashing test + programs in an attempt to aid debugging. Contributed by Antti Kantee. + +* Reverted default timeout change in previous release and reset its value + to 5 minutes. This was causing several issues, specially when running + the existing NetBSD test suite in qemu. + +* Fixed the 'match' output checker in atf-check to properly validate the + last line of a file even if it does not have a newline. + +* Added the ATF_REQUIRE_IN and ATF_REQUIRE_NOT_IN macros to atf-c++ to + check for the presence (or lack thereof) of an element in a collection. + +* PR bin/44176: Fixed a race condition in atf-run that would crash atf-run + when the cleanup of a test case triggered asynchronous modifications to + its work directory (e.g. killing a daemon process that cleans up a pid + file in the work directory). + +* PR bin/44301: Fixed the sample XSLT file to report bogus test programs + instead of just listing them as having 0 test cases. + + +Changes in version 0.12 +*********************** + +Experimental version released on November 7th, 2010. + +* Added the ATF_REQUIRE_THROW_RE to atf-c++, which is the same as + ATF_REQUIRE_THROW but allows checking for the validity of the exception's + error message by means of a regular expression. + +* Added the ATF_REQUIRE_MATCH to atf-c++, which allows checking for a + regular expression match in a string. + +* Changed the default timeout for test cases from 5 minutes to 30 seconds. + 30 seconds is long enough for virtually all tests to complete, and 5 + minutes is a way too long pause in a test suite where a single test case + stalls. + +* Deprecated the use.fs property. While this seemed like a good idea in + the first place to impose more control on what test cases can do, it + turns out to be bad. First, use.fs=false prevents bogus test cases + from dumping core so after-the-fact debugging is harder. Second, + supporting use.fs adds a lot of unnecessary complexity. atf-run will + now ignore any value provided to use.fs and will allow test cases to + freely access the file system if they wish to. + +* Added the atf_tc_get_config_var_as_{bool,long}{,_wd} functions to the atf-c + library. The 'text' module became private in 0.11 but was being used + externally to simplify the parsing of configuration variables. + +* Made atf-run recognize the 'unprivileged-user' configuration variable + and automatically drop root privileges when a test case sets + require.user=unprivileged. Note that this is, by no means, done for + security purposes; this is just for user convenience; tests should, in + general, not be blindly run as root in the first place. + + +Changes in version 0.11 +*********************** + +Experimental version released on October 20th, 2010. + +* The ATF_CHECK* macros in atf-c++ were renamed to ATF_REQUIRE* to match + their counterparts in atf-c. + +* Clearly separated the modules in atf-c that are supposed to be public + from those that are implementation details. The header files for the + internal modules are not installed any more. + +* Made the atf-check tool private. It is only required by atf-sh and being + public has the danger of causing confusion. Also, making it private + simplifies the public API of atf. + +* Changed atf-sh to enable per-command error checking (set -e) by default. + This catches many cases in which a test case is broken but it is not + reported as such because execution continues. + +* Fixed the XSTL and CSS stylesheets to support expected failures. + + +Changes in version 0.10 +*********************** + +Experimental version released on July 2nd, 2010. + +Miscellaneous features + +* Added expected failures support to test cases and atf-run. These + include, for example, expected clean exits, expected reception of fatal + signals, expected timeouts and expected errors in condition checks. + These statuses can be used to denote test cases that are known to fail + due to a bug in the code they are testing. atf-report reports these + tests separately but they do not count towards the failed test cases + amount. + +* Added the ATF_CHECK_ERRNO and ATF_REQUIRE_ERRNO to the C library to + allow easy checking of call failures that update errno. + +* Added the has.cleanup meta-data property to test caes that specifies + whether the test case has a cleanup routine or not; its value is + automatically set. This property is read by atf-run to know if it has to + run the cleanup routine; skipping this run for every test case + significantly speeds up the run time of test suites. + +* Reversed the order of the ATF_CHECK_THROW macro in the C++ binding to + take the expected exception as the first argument and the statement to + execute as the second argument. + +Changes in atf-check + +* Changed atf-check to support negating the status and output checks by + prefixing them with not- and added support to specify multiple checkers + for stdout and stderr, not only one. + +* Added the match output checker to atf-check to look for regular + expressions in the stdout and stderr of commands. + +* Modified the exit checks in atf-check to support checking for the + reception of signals. + +Code simplifications and cleanups + +* Removed usage messages from test programs to simplify the + implementation of every binding by a significant amount. They just now + refer the user to the appropriate manual page and do not attempt to wrap + lines on terminal boundaries. Test programs are not supposed to be run + by users directly so this minor interface regression is not important. + +* Removed the atf-format internal utility, which is unused after the + change documented above. + +* Removed the atf-cleanup internal utility. It has been unused since the + test case isolation was moved to atf-run in 0.8 + +* Splitted the Makefile.am into smaller files for easier maintenance and + dropped the use of M4. Only affects users building from the repository + sources. + +* Intermixed tests with the source files in the source tree to provide + them more visibility and easier access. The tests directory is gone from + the source tree and tests are now suffixed by _test, not prefixed by t_. + +* Simplifications to the atf-c library: removed the io, tcr and ui + modules as they had become unnecessary after all simplifications + introduced since the 0.8 release. + +* Removed the application/X-atf-tcr format introduced in 0.8 release. + Tests now print a much simplified format that is easy to parse and nicer + to read by end users. As a side effect, the default for test cases is + now to print their results to stdout unless otherwise stated by providing + the -r flag. + +* Removed XML distribution documents and replaced them with plain-text + documents. They provided little value and introduced a lot of complexity + to the build system. + +* Simplified the output of atf-version by not attempting to print a + revision number when building form a distfile. Makes the build system + easier to maintain. + + +Changes in version 0.9 +********************** + +Experimental version released on June 3rd, 2010. + +* Added atf-sh, an interpreter to process test programs written using + the shell API. This is not really a shell interpreter by itself though: + it is just a wrapper around the system shell that eases the loading of + the necessary ATF libraries. + +* Removed atf-compile in favour of atf-sh. + +* Added the use.fs metadata property to test case, which is used to + specify which test cases require file system access. This is to + highlight dependencies on external resources more clearly and to speed up + the execution of test suites by skipping the creation of many unnecessary + work directories. + +* Fixed test programs to get a sane default value for their source + directory. This means that it should not be necessary any more to pass + -s when running test programs that do not live in the current directory. + +* Defining test case headers became optional. This is trivial to achieve + in shell-based tests but a bit ugly in C and C++. In C, use the new + ATF_TC_WITHOUT_HEAD macro to define the test case, and in C++ use + ATF_TEST_CASE_WITHOUT_HEAD. + + +Changes in version 0.8 +********************** + +Experimental version released on May 7th, 2010. + +* Test programs no longer run several test cases in a row. The execution + of a test program now requires a test case name, and that single test + case is executed. To execute several test cases, use the atf-run utility + as usual. + +* Test programs no longer fork a subprocess to isolate the execution of + test cases. They run the test case code in-process, and a crash of the + test case will result in a crash of the test program. This is to ease + debugging of faulty test cases. + +* Test programs no longer isolate their test cases. This means that they + will not create temporary directories nor sanitize the environment any + more. Yes: running a test case that depends on system state by hand will + most likely yield different results depending on where (machine, + directory, user environment, etc.) it is run. Isolation has been moved + to atf-run. + +* Test programs no longer print a cryptic format (application/X-atf-tcs) + on a special file channel. They can now print whatever they want on the + screen. Because test programs can now only run one test case every time, + providing controlled output is not necessary any more. + +* Test programs no longer write their status into a special file + descriptor. Instead, they create a file with the results, which is later + parsed by atf-run. This changes the semantics of the -r flag. + +* atf-run has been adjusted to perform the test case isolation. As a + result, there is now a single canonical place that implements the + isolation of test caes. In previous releases, the three language + bindings (C, C++ and shell) had to be kept in sync with each other (read: + not a nice thing to do at all). As a side effect of this change, writing + bindings for other languages will be much, much easier from now on. + +* atf-run forks test programs on a test case basis, instead of on a test + program basis as it did before. This is to provide the test case + isolation that was before implemented by the test programs themselves. + +* Removed the atf-exec tool. This was used to implement test case + isolation in atf-sh, but it is now unnecessary. + +* It is now optional to define the descr meta-data property. It has been + proven to be mostly useless, because test cases often carry a descriptive + name of their own. + + +Changes in version 0.7 +********************** + +Experimental version released on December 22nd, 2009. + +* Added build-time checks to atf-c and atf-c++. A binding for atf-sh + will come later. + +* Migrated all build-time checks for header files to proper ATF tests. + This demonstrates the use of the new feature described above. + +* Added an internal API for child process management. + +* Converted all plain-text distribution documents to a Docbook canonical + version, and include pre-generated plain text and HTML copies in the + distribution file. + +* Simplified the contents of the Makefile.am by regenerating it from a + canonical Makefile.am.m4 source. As a side-effect, some dependency + specifications were fixed. + +* Migrated all checks from the check target to installcheck, as these + require ATF to be installed. + +* Fixed sign comparison mismatches triggered by the now-enabled + -Wsign-compare. + +* Fixed many memory and object leaks. + + +Changes in version 0.6 +********************** + +Experimental version released on January 18th, 2009. + +* Make atf-exec be able to kill its child process after a certain period + of time; this is controlled through the new -t option. + +* Change atf-sh to use atf-exec's -t option to control the test case's + timeouts, instead of doing it internally. Same behavior as before, but + noticeably faster. + +* atf-exec's -g option and atf-killpg are gone due to the previous + change. + +* Added the atf-check(1) tool, a program that executes a given command + and checks its exit code against a known value and allows the management + of stdout and stderr in multiple ways. This replaces the previous + atf_check function in the atf-sh library and exposes this functionality + to both atf-c and atf-c++. + +* Added the ATF_REQUIRE family of macros to the C interface. These help + in checking for fatal test conditions. The old ATF_CHECK macros now + perform non-fatal checks only. I.e. by using ATF_CHECK, the test case + can now continue its execution and the failures will not be reported + until the end of the whole run. + +* Extended the amount of ATF_CHECK_* C macros with new ones to provide + more features to the developer. These also have their corresponding + counterparts in the ATF_REQUIRE_* family. The new macros (listing the + suffixes only) are: _EQ (replaces _EQUAL), _EQ_MSG, _STREQ and + _STREQ_MSG. + + +Changes in version 0.5 +********************** + +Experimental version released on May 1st, 2008. + +* Clauses 3 and 4 of the BSD license used by the project were dropped. + All the code is now under a 2-clause BSD license compatible with the GNU + General Public License (GPL). + +* Added a C-only binding so that binary test programs do not need to be + tied to C++ at all. This binding is now known as the atf-c library. + +* Renamed the C++ binding to atf-c++ for consistency with the new atf-c. + +* Renamed the POSIX shell binding to atf-sh for consistency with the new + atf-c and atf-c++. + +* Added a -w flag to test programs through which it is possible to + specify the work directory to be used. This was possible in prior + releases by defining the workdir configuration variable (-v workdir=...), + but was a conceptually incorrect mechanism. + +* Test programs now preserve the execution order of test cases when they + are given in the command line. Even those mentioned more than once are + executed multiple times to comply with the user's requests. + + +Changes in version 0.4 +********************** + +Experimental version released on February 4th, 2008. + +* Added two new manual pages, atf-c++-api and atf-sh-api, describing the + C++ and POSIX shell interfaces used to write test programs. + +* Added a pkg-config file, useful to get the flags to build against the + C++ library or to easily detect the presence of ATF. + +* Added a way for test cases to require a specific architecture and/or + machine type through the new 'require.arch' and 'require.machine' + meta-data properties, respectively. + +* Added the 'timeout' property to test cases, useful to set an + upper-bound limit for the test's run time and thus prevent global test + program stalls due to the test case's misbehavior. + +* Added the atf-exec(1) internal utility, used to execute a command + after changing the process group it belongs to. + +* Added the atf-killpg(1) internal utility, used to kill process groups. + +* Multiple portability fixes. Of special interest, full support for + SunOS (Solaris Express Developer Edition 2007/09) using the Sun Studio 12 + C++ compiler. + +* Fixed a serious bug that prevented atf-run(1) from working at all + under Fedora 8 x86_64. Due to the nature of the bug, other platforms + were likely affected too. + + +Changes in version 0.3 +********************** + +Experimental version released on November 11th, 2007. + +* Added XML output support to atf-report. This is accompanied by a DTD + for the format's structure and sample XSLT/CSS files to post-process this + output and convert it to a plain HTML report. + +* Changed atf-run to add system information to the report it generates. + This is currently used by atf-report's XML output only, and is later + printed in the HTML reports in a nice and useful summary table. The user + and system administrator are allowed to tune this feature by means of + hooks. + +* Removed the test cases' 'isolated' property. This was intended to + avoid touching the file system at all when running the related test case, + but this has not been true for a long while: some control files are + unconditionally required for several purposes, and we cannot easily get + rid of them. This way we remove several critical and delicate pieces of + code. + +* Improved atf-report's CSV output format to include information about + test programs too. + +* Fixed the tests that used atf-compile to not require this tool as a + helper. Avoids systems without build-time utilities to skip many tests + that could otherwise be run. (E.g. NetBSD without the comp.tgz set + installed.) + +* Many general cleanups: Fixed many pieces of code marked as ugly and/or + incomplete. + + +Changes in version 0.2 +********************** + +Experimental version released on September 20th, 2007. + +* Test cases now get a known umask on entry. + +* atf-run now detects many unexpected failures caused by test programs and + reports them as bogus tests. atf-report is able to handle these new + errors and nicely reports them to the user. + +* All the data formats read and written by the tools have been + documented and cleaned up. These include those grammars that define how + the different components communicate with each other as well as the + format of files written by the developers and users: the Atffiles and the + configuration files. + +* Added the atf-version tool, a utility that displays information about + the currently installed version of ATF. + +* Test cases can now define an optional cleanup routine to undo their + actions regardless of their exit status. + +* atf-report now summarizes the list of failed (bogus) test programs + when using the ticker output format. + +* Test programs now capture some termination signals and clean up any + temporary files before exiting the program. + +* Multiple bug fixes and improvements all around. + + +Changes in version 0.1 +********************** + +Experimental version released on August 20th, 2007. + +* First public version. This was released coinciding with the end of the + Google Summer of Code 2007 program. + + +=========================================================================== +vim: filetype=text:textwidth=75:expandtab:shiftwidth=2:softtabstop=2 diff --cc contrib/atf/README.md index 000000000000,000000000000..d245552f35c9 new file mode 100644 --- /dev/null +++ b/contrib/atf/README.md @@@ -1,0 -1,0 +1,47 @@@ ++# Welcome to the ATF project! ++ ++ATF, or Automated Testing Framework, is a **collection of libraries** to ++write test programs in **C, C++ and POSIX shell**. ++ ++The ATF libraries offer a simple API. The API is orthogonal through the ++various bindings, allowing developers to quickly learn how to write test ++programs in different languages. ++ ++ATF-based test programs offer a **consistent end-user command-line ++interface** to allow both humans and automation to run the tests. ++ ++ATF-based test programs **rely on an execution engine** to be run and ++this execution engine is *not* shipped with ATF. ++**[Kyua](https://github.com/jmmv/kyua/) is the engine of choice.** ++ ++## Download ++ ++Formal releases for source files are available for download from GitHub: ++ ++* [atf 0.20](../../releases/tag/atf-0.20), released on February 7th, 2014. ++ ++## Installation ++ ++You are encouraged to install binary packages for your operating system ++wherever available: ++ ++* Fedora 20 and above: install the `atf` package with `yum install atf`. ++ ++* FreeBSD 10.0 and above: install the `atf` package with `pkg install atf`. ++ ++* NetBSD with pkgsrc: install the `pkgsrc/devel/atf` package. ++ ++* OpenBSD: install the `devel/atf` package with `pkg_add atf`. ++ ++Should you want to build and install ATF from the source tree provided ++here, follow the instructions in the [INSTALL file](INSTALL). ++ ++## Support ++ ++Please use the ++[atf-discuss mailing list](https://groups.google.com/forum/#!forum/atf-discuss) ++for any support inquiries related to `atf-c`, `atf-c++` or `atf-sh`. ++ ++If you have any questions on Kyua proper, please use the ++[kyua-discuss mailing list](https://groups.google.com/forum/#!forum/kyua-discuss) ++instead. diff --cc contrib/atf/atf-c++/atf-c++.3 index 601efaf6fd5b,000000000000..fead776755af mode 100644,000000..100644 --- a/contrib/atf/atf-c++/atf-c++.3 +++ b/contrib/atf/atf-c++/atf-c++.3 @@@ -1,649 -1,0 +1,649 @@@ +.\" Copyright (c) 2008 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY +.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.Dd March 6, 2017 +.Dt ATF-C++ 3 +.Os +.Sh NAME +.Nm atf-c++ , +.Nm ATF_ADD_TEST_CASE , +.Nm ATF_CHECK_ERRNO , +.Nm ATF_FAIL , +.Nm ATF_INIT_TEST_CASES , +.Nm ATF_PASS , +.Nm ATF_REQUIRE , +.Nm ATF_REQUIRE_EQ , +.Nm ATF_REQUIRE_ERRNO , +.Nm ATF_REQUIRE_IN , +.Nm ATF_REQUIRE_MATCH , +.Nm ATF_REQUIRE_NOT_IN , +.Nm ATF_REQUIRE_THROW , +.Nm ATF_REQUIRE_THROW_RE , +.Nm ATF_SKIP , +.Nm ATF_TEST_CASE , +.Nm ATF_TEST_CASE_BODY , +.Nm ATF_TEST_CASE_CLEANUP , +.Nm ATF_TEST_CASE_HEAD , +.Nm ATF_TEST_CASE_NAME , +.Nm ATF_TEST_CASE_USE , +.Nm ATF_TEST_CASE_WITH_CLEANUP , +.Nm ATF_TEST_CASE_WITHOUT_HEAD , +.Nm atf::utils::cat_file , +.Nm atf::utils::compare_file , +.Nm atf::utils::copy_file , +.Nm atf::utils::create_file , +.Nm atf::utils::file_exists , +.Nm atf::utils::fork , +.Nm atf::utils::grep_collection , +.Nm atf::utils::grep_file , +.Nm atf::utils::grep_string , *** 2340 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Feb 4 16:18: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 1FC60547EA5; Thu, 4 Feb 2021 16:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWkHQ0R1fz4YPm; Thu, 4 Feb 2021 16:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB37F6BAE; Thu, 4 Feb 2021 16:18: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 114GI9rD011044; Thu, 4 Feb 2021 16:18:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114GI9YP011043; Thu, 4 Feb 2021 16:18:09 GMT (envelope-from git) Date: Thu, 4 Feb 2021 16:18:09 GMT Message-Id: <202102041618.114GI9YP011043@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: b680dba47653 - stable/13 - riscv: add SBI system reset extension 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: b680dba47653451aeda9292dd6dcda2f79b905e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:18:10 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=b680dba47653451aeda9292dd6dcda2f79b905e7 commit b680dba47653451aeda9292dd6dcda2f79b905e7 Author: Mitchell Horne AuthorDate: 2021-01-27 21:27:15 +0000 Commit: Mitchell Horne CommitDate: 2021-02-04 16:17:31 +0000 riscv: add SBI system reset extension (cherry picked from commit 9bae4ce661c59be88fec89b2531148e36dd1a23e) (cherry picked from commit a6405133b7e14929f8e8e61cf30d7152b1410e59) --- sys/riscv/include/sbi.h | 28 +++++++++++++++++++++------- sys/riscv/riscv/sbi.c | 34 ++++++++++++++++++++++++++-------- sys/riscv/riscv/vm_machdep.c | 2 +- 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/sys/riscv/include/sbi.h b/sys/riscv/include/sbi.h index 50cacb3e6e5a..9d3f4076dcb2 100644 --- a/sys/riscv/include/sbi.h +++ b/sys/riscv/include/sbi.h @@ -99,6 +99,15 @@ #define SBI_HSM_STATUS_START_PENDING 2 #define SBI_HSM_STATUS_STOP_PENDING 3 +/* System Reset (SRST) Extension */ +#define SBI_EXT_ID_SRST 0x53525354 +#define SBI_SRST_SYSTEM_RESET 0 +#define SBI_SRST_TYPE_SHUTDOWN 0 +#define SBI_SRST_TYPE_COLD_REBOOT 1 +#define SBI_SRST_TYPE_WARM_REBOOT 2 +#define SBI_SRST_REASON_NONE 0 +#define SBI_SRST_REASON_SYSTEM_FAILURE 1 + /* Legacy Extensions */ #define SBI_SET_TIMER 0 #define SBI_CONSOLE_PUTCHAR 1 @@ -199,6 +208,18 @@ void sbi_hsm_hart_stop(void); */ int sbi_hsm_hart_status(u_long hart); +/* System Reset extension functions. */ + +/* + * Reset the system based on the following 'type' and 'reason' chosen from: + * - SBI_SRST_TYPE_SHUTDOWN + * - SBI_SRST_TYPE_COLD_REBOOT + * - SBI_SRST_TYPE_WARM_REBOOT + * - SBI_SRST_REASON_NONE + * - SBI_SRST_REASON_SYSTEM_FAILURE + */ +void sbi_system_reset(u_long reset_type, u_long reset_reason); + /* Legacy extension functions. */ static __inline void sbi_console_putchar(int ch) @@ -218,13 +239,6 @@ sbi_console_getchar(void) return (SBI_CALL0(SBI_CONSOLE_GETCHAR, 0).error); } -static __inline void -sbi_shutdown(void) -{ - - (void)SBI_CALL0(SBI_SHUTDOWN, 0); -} - void sbi_print_version(void); void sbi_init(void); diff --git a/sys/riscv/riscv/sbi.c b/sys/riscv/riscv/sbi.c index d529d2d08351..6897fce9cad3 100644 --- a/sys/riscv/riscv/sbi.c +++ b/sys/riscv/riscv/sbi.c @@ -49,6 +49,7 @@ u_long sbi_impl_version; static bool has_time_extension = false; static bool has_ipi_extension = false; static bool has_rfnc_extension = false; +static bool has_srst_extension = false; static struct sbi_ret sbi_get_spec_version(void) @@ -90,7 +91,18 @@ static void sbi_shutdown_final(void *dummy __unused, int howto) { if ((howto & RB_POWEROFF) != 0) - sbi_shutdown(); + sbi_system_reset(SBI_SRST_TYPE_SHUTDOWN, SBI_SRST_REASON_NONE); +} + +void +sbi_system_reset(u_long reset_type, u_long reset_reason) +{ + /* Use the SRST extension, if available. */ + if (has_srst_extension) { + (void)SBI_CALL2(SBI_EXT_ID_SRST, SBI_SRST_SYSTEM_RESET, + reset_type, reset_reason); + } + (void)SBI_CALL0(SBI_SHUTDOWN, 0); } void @@ -111,10 +123,12 @@ sbi_print_version(void) printf("SBI: Berkely Boot Loader %lu\n", sbi_impl_version); break; case (SBI_IMPL_ID_XVISOR): - printf("SBI: eXtensible Versatile hypervISOR %lu\n", sbi_impl_version); + printf("SBI: eXtensible Versatile hypervISOR %lu\n", + sbi_impl_version); break; case (SBI_IMPL_ID_KVM): - printf("SBI: Kernel-based Virtual Machine %lu\n", sbi_impl_version); + printf("SBI: Kernel-based Virtual Machine %lu\n", + sbi_impl_version); break; case (SBI_IMPL_ID_RUSTSBI): printf("SBI: RustSBI %lu\n", sbi_impl_version); @@ -206,8 +220,9 @@ sbi_remote_sfence_vma_asid(const u_long *hart_mask, u_long start, u_long size, /* Use the RFENCE legacy replacement extension, if available. */ if (has_rfnc_extension) { - ret = SBI_CALL5(SBI_EXT_ID_RFNC, SBI_RFNC_REMOTE_SFENCE_VMA_ASID, - *hart_mask, 0, start, size, asid); + ret = SBI_CALL5(SBI_EXT_ID_RFNC, + SBI_RFNC_REMOTE_SFENCE_VMA_ASID, *hart_mask, 0, start, + size, asid); MPASS(ret.error == SBI_SUCCESS); } else { (void)SBI_CALL4(SBI_REMOTE_SFENCE_VMA_ASID, 0, @@ -220,7 +235,8 @@ sbi_hsm_hart_start(u_long hart, u_long start_addr, u_long priv) { struct sbi_ret ret; - ret = SBI_CALL3(SBI_EXT_ID_HSM, SBI_HSM_HART_START, hart, start_addr, priv); + ret = SBI_CALL3(SBI_EXT_ID_HSM, SBI_HSM_HART_START, hart, start_addr, + priv); return (ret.error != 0 ? (int)ret.error : 0); } @@ -273,6 +289,8 @@ sbi_init(void) has_ipi_extension = true; if (sbi_probe_extension(SBI_EXT_ID_RFNC) != 0) has_rfnc_extension = true; + if (sbi_probe_extension(SBI_EXT_ID_SRST) != 0) + has_srst_extension = true; /* * Probe for legacy extensions. We still rely on many of them to be @@ -295,8 +313,8 @@ sbi_init(void) KASSERT(has_rfnc_extension || sbi_probe_extension(SBI_REMOTE_SFENCE_VMA_ASID) != 0, ("SBI doesn't implement sbi_remote_sfence_vma_asid()")); - KASSERT(sbi_probe_extension(SBI_SHUTDOWN) != 0, - ("SBI doesn't implement sbi_shutdown()")); + KASSERT(has_srst_extension || sbi_probe_extension(SBI_SHUTDOWN) != 0, + ("SBI doesn't implement a shutdown or reset extension")); } static void diff --git a/sys/riscv/riscv/vm_machdep.c b/sys/riscv/riscv/vm_machdep.c index f38f1c04caa8..094662413f4e 100644 --- a/sys/riscv/riscv/vm_machdep.c +++ b/sys/riscv/riscv/vm_machdep.c @@ -110,7 +110,7 @@ void cpu_reset(void) { - sbi_shutdown(); + sbi_system_reset(SBI_SRST_TYPE_COLD_REBOOT, SBI_SRST_REASON_NONE); while(1); } From owner-dev-commits-src-all@freebsd.org Thu Feb 4 16:39: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 2B30A5284A7; Thu, 4 Feb 2021 16:39: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 4DWklj0hkJz4ZbC; Thu, 4 Feb 2021 16:39: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 0A91C68F5; Thu, 4 Feb 2021 16:39: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 114GdCE2037058; Thu, 4 Feb 2021 16:39:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114GdC1b037057; Thu, 4 Feb 2021 16:39:12 GMT (envelope-from git) Date: Thu, 4 Feb 2021 16:39:12 GMT Message-Id: <202102041639.114GdC1b037057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 4295dd589e05 - stable/13 - Add a wg(4) 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4295dd589e05de2d20c97381318efd8cd001a6c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:39:13 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4295dd589e05de2d20c97381318efd8cd001a6c5 commit 4295dd589e05de2d20c97381318efd8cd001a6c5 Author: Gordon Bergling AuthorDate: 2021-02-02 19:13:53 +0000 Commit: Gordon Bergling CommitDate: 2021-02-04 16:37:18 +0000 Add a wg(4) manual page Reviewed by: brueffer, donner, debdrup, ygy MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D27783 (cherry picked from commit e59d9cb412846cb5d2bc4c641d3cc44d243cd52d) --- share/man/man4/Makefile | 1 + share/man/man4/wg.4 | 244 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index ffc7a08292e9..b66dcf135733 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -583,6 +583,7 @@ MAN= aac.4 \ vtnet.4 \ watchdog.4 \ ${_wbwd.4} \ + wg.4 \ witness.4 \ wlan.4 \ wlan_acl.4 \ diff --git a/share/man/man4/wg.4 b/share/man/man4/wg.4 new file mode 100644 index 000000000000..e343dceaa0d6 --- /dev/null +++ b/share/man/man4/wg.4 @@ -0,0 +1,244 @@ +.\" Copyright (c) 2020 Gordon Bergling Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D14DA529FC7; Thu, 4 Feb 2021 17:41: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 4DWm7T5cqNz4fmJ; Thu, 4 Feb 2021 17:41: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 B3BAE7F05; Thu, 4 Feb 2021 17:41: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 114HfPKp026750; Thu, 4 Feb 2021 17:41:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114HfPK1026749; Thu, 4 Feb 2021 17:41:25 GMT (envelope-from git) Date: Thu, 4 Feb 2021 17:41:25 GMT Message-Id: <202102041741.114HfPK1026749@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: 9c829699aa3c - stable/13 - zfs: update zfs_config.h to match OpenZFS gf11b09dec 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: 9c829699aa3cae4fa2b736de489c8aac1da068e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 17:41:25 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=9c829699aa3cae4fa2b736de489c8aac1da068e6 commit 9c829699aa3cae4fa2b736de489c8aac1da068e6 Author: Martin Matuska AuthorDate: 2021-02-01 21:08:19 +0000 Commit: Martin Matuska CommitDate: 2021-02-04 17:40:55 +0000 zfs: update zfs_config.h to match OpenZFS gf11b09dec Update zfs_config.h to match latest merge in FreeBSD The version string is declared as 2.0.0-FreeBSD_gf11b09dec to provide more information about the loaded module: - the OpenZFS version in base is 2.0 - we are using the in tree-module ("FreeBSD") - the last merged OpenZFS git revision ("gf11b09dec") With future merges the git revision tag should be updated. As we are merging from OpenZFS master branch and already include features like dRAID, referencing patchlevel releases (2.0.1, 2.0.2) is pointless. Reviewed by: freqlabs Differential Revision: https://reviews.freebsd.org/D28447 (cherry picked from commit 8fb966790e1c87276cc26932efee1b29c046cb8a) --- sys/modules/zfs/zfs_config.h | 131 ++++++++++++++++++++++++++++++++----------- 1 file changed, 97 insertions(+), 34 deletions(-) diff --git a/sys/modules/zfs/zfs_config.h b/sys/modules/zfs/zfs_config.h index 6d73d1b8a341..358ecb609a05 100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@ -21,9 +21,6 @@ /* bdi_setup_and_register() wants 2 args */ /* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ -/* lookup_bdev() wants 2 args */ -/* #undef HAVE_2ARGS_LOOKUP_BDEV */ - /* vfs_getattr wants 2 args */ /* #undef HAVE_2ARGS_VFS_GETATTR */ @@ -85,6 +82,12 @@ #define HAVE_AVX512VL 1 #endif +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + /* bio->bi_opf is defined */ /* #undef HAVE_BIO_BI_OPF */ @@ -94,6 +97,9 @@ /* bio has bi_iter */ /* #undef HAVE_BIO_BVEC_ITER */ +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + /* bio_set_dev() is available */ /* #undef HAVE_BIO_SET_DEV */ @@ -115,6 +121,9 @@ /* blk_alloc_queue() expects request function */ /* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + /* blk queue backing_dev_info is dynamic */ /* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ @@ -154,12 +163,24 @@ the CoreFoundation framework. */ /* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + /* clear_inode() is available */ /* #undef HAVE_CLEAR_INODE */ /* dentry uses const struct dentry_operations */ /* #undef HAVE_CONST_DENTRY_OPERATIONS */ +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + /* current_time() exists */ /* #undef HAVE_CURRENT_TIME */ @@ -170,6 +191,9 @@ /* DECLARE_EVENT_CLASS() is available */ /* #undef HAVE_DECLARE_EVENT_CLASS */ +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + /* sops->dirty_inode() wants flags */ /* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ @@ -212,10 +236,10 @@ /* fops->fsync() without dentry */ /* #undef HAVE_FSYNC_WITHOUT_DENTRY */ -/* generic_start_io_acct()/generic_end_io_acct() available */ +/* generic_*_io_acct() 3 arg available */ /* #undef HAVE_GENERIC_IO_ACCT_3ARG */ -/* generic_start_io_acct()/generic_end_io_acct() 4 arg available */ +/* generic_*_io_acct() 4 arg available */ /* #undef HAVE_GENERIC_IO_ACCT_4ARG */ /* generic_readlink is global */ @@ -230,9 +254,6 @@ /* Define if the GNU gettext() function is already present or preinstalled. */ /* #undef HAVE_GETTEXT */ -/* get_disk_and_module() is available */ -/* #undef HAVE_GET_DISK_AND_MODULE */ - /* iops->get_link() cookie */ /* #undef HAVE_GET_LINK_COOKIE */ @@ -242,6 +263,9 @@ /* group_info->gid exists */ /* #undef HAVE_GROUP_INFO_GID */ +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + /* Define if you have the iconv() function and it works. */ #define HAVE_ICONV 1 @@ -266,6 +290,27 @@ /* in_compat_syscall() is available */ /* #undef HAVE_IN_COMPAT_SYSCALL */ +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT */ + +/* iov_iter_init() is available */ +/* #undef HAVE_IOV_ITER_INIT_LEGACY */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + /* yes */ /* #undef HAVE_IO_SCHEDULE_TIMEOUT */ @@ -287,6 +332,9 @@ /* kernel does stack verification */ /* #undef HAVE_KERNEL_OBJTOOL */ +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + /* kernel_read() take loff_t pointer */ /* #undef HAVE_KERNEL_READ_PPOS */ @@ -320,25 +368,22 @@ /* kernel has large stacks */ /* #undef HAVE_LARGE_STACKS */ -/* Define if you have libaio */ +/* Define if you have [aio] */ /* #undef HAVE_LIBAIO */ -/* Define if you have libblkid */ +/* Define if you have [blkid] */ /* #undef HAVE_LIBBLKID */ -/* Define if you have libssl */ -#define HAVE_LIBSSL 1 +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 -/* Define to 1 if you have the `tirpc' library (-ltirpc). */ +/* Define if you have [tirpc] */ /* #undef HAVE_LIBTIRPC */ -/* Define if you have libudev */ +/* Define if you have [udev] */ /* #undef HAVE_LIBUDEV */ -/* Define if udev_device_get_is_initialized is available */ -/* #undef HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED */ - -/* Define if you have libuuid */ +/* Define if you have [uuid] */ /* #undef HAVE_LIBUUID */ /* lseek_execute() is available */ @@ -365,6 +410,9 @@ /* Define to 1 if you have the `mlockall' function. */ #define HAVE_MLOCKALL 1 +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + /* Define if host toolchain supports MOVBE */ #define HAVE_MOVBE 1 @@ -377,6 +425,9 @@ /* Define if host toolchain supports PCLMULQDQ */ #define HAVE_PCLMULQDQ 1 +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + /* posix_acl_chmod() exists */ /* #undef HAVE_POSIX_ACL_CHMOD */ @@ -431,6 +482,12 @@ /* REQ_PREFLUSH is defined */ /* #undef HAVE_REQ_PREFLUSH */ +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + /* struct rw_semaphore has member activity */ /* #undef HAVE_RWSEM_ACTIVITY */ @@ -440,6 +497,9 @@ /* linux/sched/signal.h exists */ /* #undef HAVE_SCHED_SIGNAL_HEADER */ +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + /* setattr_prepare() is available */ /* #undef HAVE_SETATTR_PREPARE */ @@ -499,6 +559,9 @@ /* Define to 1 if you have the `strlcpy' function. */ #define HAVE_STRLCPY 1 +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + /* super_setup_bdi_name() exits */ /* #undef HAVE_SUPER_SETUP_BDI_NAME */ @@ -520,6 +583,9 @@ /* kernel has totalram_pages() */ /* #undef HAVE_TOTALRAM_PAGES_FUNC */ +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + /* kernel has __kernel_fpu_* functions */ /* #undef HAVE_UNDERSCORE_KERNEL_FPU */ @@ -541,6 +607,9 @@ /* aops->direct_IO() uses iov_iter with rw and offset */ /* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + /* fops->iterate() is available */ /* #undef HAVE_VFS_ITERATE */ @@ -595,15 +664,12 @@ /* xattr_handler->set() wants xattr_handler */ /* #undef HAVE_XATTR_SET_HANDLER */ -/* Define if you have zlib */ +/* Define if you have [z] */ #define HAVE_ZLIB 1 /* __posix_acl_chmod() exists */ /* #undef HAVE___POSIX_ACL_CHMOD */ -/* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST - /* kernel exports FPU functions */ /* #undef KERNEL_EXPORTS_X86_FPU */ @@ -635,7 +701,7 @@ /* #undef SYSTEM_LINUX */ /* zfs debugging enabled */ -/* #define ZFS_DEBUG 1 */ +/* #undef ZFS_DEBUG */ /* /dev/zfs minor */ /* #undef ZFS_DEVICE_MINOR */ @@ -649,9 +715,6 @@ /* enum node_stat_item contains NR_INACTIVE_FILE */ /* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */ -/* enum node_stat_item contains NR_SLAB_RECLAIMABLE */ -/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE */ - /* enum zone_stat_item contains NR_FILE_PAGES */ /* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */ @@ -661,9 +724,6 @@ /* enum zone_stat_item contains NR_INACTIVE_FILE */ /* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */ -/* enum zone_stat_item contains NR_SLAB_RECLAIMABLE */ -/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_SLAB_RECLAIMABLE */ - /* global_node_page_state() exists */ /* #undef ZFS_GLOBAL_NODE_PAGE_STATE */ @@ -674,16 +734,16 @@ /* #undef ZFS_IS_GPL_COMPATIBLE */ /* Define the project alias string. */ -#define ZFS_META_ALIAS "zfs-0.8.0-1" +#define ZFS_META_ALIAS "zfs-2.0.0-FreeBSD_gf11b09dec" /* Define the project author. */ -#define ZFS_META_AUTHOR "OpenZFS on Linux" +#define ZFS_META_AUTHOR "OpenZFS" /* Define the project release date. */ /* #undef ZFS_META_DATA */ /* Define the maximum compatible kernel version. */ -#define ZFS_META_KVER_MAX "5.6" +#define ZFS_META_KVER_MAX "5.10" /* Define the minimum compatible kernel version. */ #define ZFS_META_KVER_MIN "3.10" @@ -704,8 +764,11 @@ #define ZFS_META_NAME "zfs" /* Define the project release. */ -#define ZFS_META_RELEASE "1" +#define ZFS_META_RELEASE "FreeBSD_gf11b09dec" /* Define the project version. */ -#define ZFS_META_VERSION "0.8.0" +#define ZFS_META_VERSION "2.0.0" + +/* count is located in percpu_ref.data */ +/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */ From owner-dev-commits-src-all@freebsd.org Thu Feb 4 17:46: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 CBFC752A01E; Thu, 4 Feb 2021 17:46: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 4DWmFW5JxFz4g51; Thu, 4 Feb 2021 17:46: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 A47EB7E51; Thu, 4 Feb 2021 17:46: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 114HkdJk028401; Thu, 4 Feb 2021 17:46:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114HkdxE028400; Thu, 4 Feb 2021 17:46:39 GMT (envelope-from git) Date: Thu, 4 Feb 2021 17:46:39 GMT Message-Id: <202102041746.114HkdxE028400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 397aaa3bcc78 - stable/13 - cxgbe(4): Fixes to tx coalescing. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 397aaa3bcc78196f5c794ebd1de751568562a7a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 17:46:39 -0000 The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=397aaa3bcc78196f5c794ebd1de751568562a7a3 commit 397aaa3bcc78196f5c794ebd1de751568562a7a3 Author: Navdeep Parhar AuthorDate: 2021-02-01 11:00:09 +0000 Commit: Navdeep Parhar CommitDate: 2021-02-04 17:43:36 +0000 cxgbe(4): Fixes to tx coalescing. - The behavior implemented in r362905 resulted in delayed transmission of packets in some cases, causing performance issues. Use a different heuristic to predict tx requests. - Add a tunable/sysctl (hw.cxgbe.tx_coalesce) to disable tx coalescing entirely. It can be changed at any time. There is no change in default behavior. (cherry picked from commit 3447df8bc5b342bd88d565641435284ff620ee2a) --- sys/dev/cxgbe/adapter.h | 4 ++- sys/dev/cxgbe/t4_main.c | 1 + sys/dev/cxgbe/t4_sge.c | 69 ++++++++++++++++++++++++++++++++++++++++--------- sys/dev/cxgbe/t4_vf.c | 1 + 4 files changed, 62 insertions(+), 13 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 37afa7cf7780..4b2f86d00052 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -561,7 +561,7 @@ struct txpkts { uint8_t wr_type; /* type 0 or type 1 */ uint8_t npkt; /* # of packets in this work request */ uint8_t len16; /* # of 16B pieces used by this work request */ - uint8_t score; /* 1-10. coalescing attempted if score > 3 */ + uint8_t score; uint8_t max_npkt; /* maximum number of packets allowed */ uint16_t plen; /* total payload (sum of all packets) */ @@ -584,6 +584,7 @@ struct sge_txq { struct sglist *gl; __be32 cpl_ctrl0; /* for convenience */ int tc_idx; /* traffic class */ + uint64_t last_tx; /* cycle count when eth_tx was last called */ struct txpkts txp; struct task tx_reclaim_task; @@ -599,6 +600,7 @@ struct sge_txq { uint64_t txpkts1_wrs; /* # of type1 coalesced tx work requests */ uint64_t txpkts0_pkts; /* # of frames in type0 coalesced tx WRs */ uint64_t txpkts1_pkts; /* # of frames in type1 coalesced tx WRs */ + uint64_t txpkts_flush; /* # of times txp had to be sent by tx_update */ uint64_t raw_wrs; /* # of raw work requests (alloc_wr_mbuf) */ uint64_t vxlan_tso_wrs; /* # of VXLAN TSO work requests */ uint64_t vxlan_txcsum; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 32a229bed52b..e01429f93825 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -10718,6 +10718,7 @@ clear_stats(struct adapter *sc, u_int port_id) txq->txpkts1_wrs = 0; txq->txpkts0_pkts = 0; txq->txpkts1_pkts = 0; + txq->txpkts_flush = 0; txq->raw_wrs = 0; txq->vxlan_tso_wrs = 0; txq->vxlan_txcsum = 0; diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index f9553bbbce67..45f07358f0db 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -212,6 +212,22 @@ static counter_u64_t defrags; SYSCTL_COUNTER_U64(_hw_cxgbe, OID_AUTO, defrags, CTLFLAG_RD, &defrags, "Number of mbuf defrags performed"); +static int t4_tx_coalesce = 1; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_coalesce, CTLFLAG_RWTUN, &t4_tx_coalesce, 0, + "tx coalescing allowed"); + +/* + * The driver will make aggressive attempts at tx coalescing if it sees these + * many packets eligible for coalescing in quick succession, with no more than + * the specified gap in between the eth_tx calls that delivered the packets. + */ +static int t4_tx_coalesce_pkts = 32; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_coalesce_pkts, CTLFLAG_RWTUN, + &t4_tx_coalesce_pkts, 0, + "# of consecutive packets (1 - 255) that will trigger tx coalescing"); +static int t4_tx_coalesce_gap = 5; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_coalesce_gap, CTLFLAG_RWTUN, + &t4_tx_coalesce_gap, 0, "tx gap (in microseconds)"); static int service_iq(struct sge_iq *, int); static int service_iq_fl(struct sge_iq *, int); @@ -3120,6 +3136,26 @@ set_txupdate_flags(struct sge_txq *txq, u_int avail, } } +#if defined(__i386__) || defined(__amd64__) +extern uint64_t tsc_freq; +#endif + +static inline bool +record_eth_tx_time(struct sge_txq *txq) +{ + const uint64_t cycles = get_cyclecount(); + const uint64_t last_tx = txq->last_tx; +#if defined(__i386__) || defined(__amd64__) + const uint64_t itg = tsc_freq * t4_tx_coalesce_gap / 1000000; +#else + const uint64_t itg = 0; +#endif + + MPASS(cycles >= last_tx); + txq->last_tx = cycles; + return (cycles - last_tx < itg); +} + /* * r->items[cidx] to r->items[pidx], with a wraparound at r->size, are ready to * be consumed. Return the actual number consumed. 0 indicates a stall. @@ -3137,10 +3173,11 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) u_int n, avail, dbdiff; /* # of hardware descriptors */ int i, rc; struct mbuf *m0; - bool snd; + bool snd, recent_tx; void *wr; /* start of the last WR written to the ring */ TXQ_LOCK_ASSERT_OWNED(txq); + recent_tx = record_eth_tx_time(txq); remaining = IDXDIFF(pidx, cidx, r->size); if (__predict_false(discard_tx(eq))) { @@ -3159,17 +3196,15 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) } /* How many hardware descriptors do we have readily available. */ - if (eq->pidx == eq->cidx) { + if (eq->pidx == eq->cidx) avail = eq->sidx - 1; - if (txp->score++ >= 5) - txp->score = 5; /* tx is completely idle, reset. */ - } else + else avail = IDXDIFF(eq->cidx, eq->pidx, eq->sidx) - 1; total = 0; if (remaining == 0) { - if (txp->score-- == 1) /* egr_update had to drain txpkts */ - txp->score = 1; + txp->score = 0; + txq->txpkts_flush++; goto send_txpkts; } @@ -3183,7 +3218,17 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) if (avail < 2 * SGE_MAX_WR_NDESC) avail += reclaim_tx_descs(txq, 64); - if (txp->npkt > 0 || remaining > 1 || txp->score > 3 || + if (t4_tx_coalesce == 0 && txp->npkt == 0) + goto skip_coalescing; + if (cannot_use_txpkts(m0)) + txp->score = 0; + else if (recent_tx) { + if (++txp->score == 0) + txp->score = UINT8_MAX; + } else + txp->score = 1; + if (txp->npkt > 0 || remaining > 1 || + txp->score >= t4_tx_coalesce_pkts || atomic_load_int(&txq->eq.equiq) != 0) { if (vi->flags & TX_USES_VM_WR) rc = add_to_txpkts_vf(sc, txq, m0, avail, &snd); @@ -3198,8 +3243,6 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) for (i = 0; i < txp->npkt; i++) ETHER_BPF_MTAP(ifp, txp->mb[i]); if (txp->npkt > 1) { - if (txp->score++ >= 10) - txp->score = 10; MPASS(avail >= tx_len16_to_desc(txp->len16)); if (vi->flags & TX_USES_VM_WR) n = write_txpkts_vm_wr(sc, txq); @@ -3239,7 +3282,7 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool *coalescing) MPASS(rc != 0 && rc != EAGAIN); MPASS(txp->npkt == 0); - +skip_coalescing: n = tx_len16_to_desc(mbuf_len16(m0)); if (__predict_false(avail < n)) { avail += reclaim_tx_descs(txq, min(n, 32)); @@ -4304,7 +4347,6 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx, M_ZERO | M_WAITOK); txp = &txq->txp; - txp->score = 5; MPASS(nitems(txp->mb) >= sc->params.max_pkts_per_eth_tx_pkts_wr); txq->txp.max_npkt = min(nitems(txp->mb), sc->params.max_pkts_per_eth_tx_pkts_wr); @@ -4363,6 +4405,9 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx, SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts1_pkts", CTLFLAG_RD, &txq->txpkts1_pkts, "# of frames tx'd using type1 txpkts work requests"); + SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts_flush", + CTLFLAG_RD, &txq->txpkts_flush, + "# of times txpkts had to be flushed out by an egress-update"); SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "raw_wrs", CTLFLAG_RD, &txq->raw_wrs, "# of raw work requests (non-packets)"); SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "vxlan_tso_wrs", diff --git a/sys/dev/cxgbe/t4_vf.c b/sys/dev/cxgbe/t4_vf.c index 223ffe7aeaa0..6c736e37faac 100644 --- a/sys/dev/cxgbe/t4_vf.c +++ b/sys/dev/cxgbe/t4_vf.c @@ -893,6 +893,7 @@ t4vf_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, txq->txpkts1_wrs = 0; txq->txpkts0_pkts = 0; txq->txpkts1_pkts = 0; + txq->txpkts_flush = 0; mp_ring_reset_stats(txq->r); } } From owner-dev-commits-src-all@freebsd.org Thu Feb 4 17: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 39B2052A41E; Thu, 4 Feb 2021 17:58: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 4DWmVr0w7Nz4ggP; Thu, 4 Feb 2021 17:58: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 125A710330; Thu, 4 Feb 2021 17:58: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 114HwC8c042229; Thu, 4 Feb 2021 17:58:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114HwChc042228; Thu, 4 Feb 2021 17:58:12 GMT (envelope-from git) Date: Thu, 4 Feb 2021 17:58:12 GMT Message-Id: <202102041758.114HwChc042228@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: 58de61b9967b - main - sbin/pfctl: fix tests after recent output changes 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: 58de61b9967b36f5fbd34e8b51ece7b4b772f104 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 17:58:12 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=58de61b9967b36f5fbd34e8b51ece7b4b772f104 commit 58de61b9967b36f5fbd34e8b51ece7b4b772f104 Author: Alex Richardson AuthorDate: 2021-02-04 17:56:26 +0000 Commit: Alex Richardson CommitDate: 2021-02-04 17:56:26 +0000 sbin/pfctl: fix tests after recent output changes The output now contains http-alt instead of 8080 and personal-agent instead of 5555. This was probably caused by 228e2087a32847fa51168f3f0c58f931cb2cb0f8. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28481 --- sbin/pfctl/tests/files/pf0089.ok | 2 +- sbin/pfctl/tests/files/pf0096.ok | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/tests/files/pf0089.ok b/sbin/pfctl/tests/files/pf0089.ok index 1f80e22b92b8..c2403e775da1 100644 --- a/sbin/pfctl/tests/files/pf0089.ok +++ b/sbin/pfctl/tests/files/pf0089.ok @@ -8,4 +8,4 @@ pass in on lo1000001 inet proto tcp from any to 10.0.0.1 port = ssh flags S/SA k pass in on lo1000001 inet proto tcp from any to 10.0.0.2 port = ssh flags S/SA keep state (source-track rule, max-src-conn 10) pass in on lo1000001 inet proto tcp from any to 10.0.0.3 port = ssh flags S/SA keep state (source-track rule, max-src-conn-rate 3/99, src.track 99) pass in on lo1000000 inet proto tcp from any to 10.0.0.1 port = http flags S/SA modulate state (source-track rule, max-src-conn 100, max-src-conn-rate 10/5, overload flush, src.track 5) -pass in on lo1000000 inet proto tcp from any to 10.0.0.1 port = 8080 flags S/SA synproxy state (source-track rule, max-src-conn 1000, max-src-conn-rate 1000/5, overload flush global, src.track 5) +pass in on lo1000000 inet proto tcp from any to 10.0.0.1 port = http-alt flags S/SA synproxy state (source-track rule, max-src-conn 1000, max-src-conn-rate 1000/5, overload flush global, src.track 5) diff --git a/sbin/pfctl/tests/files/pf0096.ok b/sbin/pfctl/tests/files/pf0096.ok index e1d9efe31f93..df7af0a3a157 100644 --- a/sbin/pfctl/tests/files/pf0096.ok +++ b/sbin/pfctl/tests/files/pf0096.ok @@ -1,5 +1,5 @@ myports = "5555 6666" moreports = "5555 6666 7777" -pass in proto tcp from any to any port = 5555 flags S/SA keep state +pass in proto tcp from any to any port = personal-agent flags S/SA keep state pass in proto tcp from any to any port = 6666 flags S/SA keep state pass in proto tcp from any to any port = 7777 flags S/SA keep state From owner-dev-commits-src-all@freebsd.org Thu Feb 4 17:58: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 762F152A1CE; Thu, 4 Feb 2021 17:58: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 4DWmVs1mR6z4ggQ; Thu, 4 Feb 2021 17:58: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 2D9287EE2; Thu, 4 Feb 2021 17:58: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 114HwDjH042248; Thu, 4 Feb 2021 17:58:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114HwDFw042247; Thu, 4 Feb 2021 17:58:13 GMT (envelope-from git) Date: Thu, 4 Feb 2021 17:58:13 GMT Message-Id: <202102041758.114HwDFw042247@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: 72692dfdfe7b - main - usr.bin/jail: Fix tests when using kyua -v parallelism=N 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: 72692dfdfe7b4ffd894afd67959651ca1b01a105 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 17:58:13 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=72692dfdfe7b4ffd894afd67959651ca1b01a105 commit 72692dfdfe7b4ffd894afd67959651ca1b01a105 Author: Alex Richardson AuthorDate: 2021-02-04 17:56:54 +0000 Commit: Alex Richardson CommitDate: 2021-02-04 17:56:55 +0000 usr.bin/jail: Fix tests when using kyua -v parallelism=N These tests create jails with the same name, so they cannot be run in parallel. Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D28482 --- usr.sbin/jail/tests/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/jail/tests/Makefile b/usr.sbin/jail/tests/Makefile index 24c0c6c05194..216a5a581980 100644 --- a/usr.sbin/jail/tests/Makefile +++ b/usr.sbin/jail/tests/Makefile @@ -5,5 +5,7 @@ PACKAGE= tests ATF_TESTS_SH+= jail_basic_test ${PACKAGE}FILES+= commands.jail.conf +# The different test cases create jails with the same name. +TEST_METADATA+= is_exclusive="true" .include From owner-dev-commits-src-all@freebsd.org Thu Feb 4 17:58: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 BCA7C52A499; Thu, 4 Feb 2021 17:58: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 4DWmVt3D0yz4gWm; Thu, 4 Feb 2021 17:58: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 51C6A10434; Thu, 4 Feb 2021 17:58: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 114HwEvH042270; Thu, 4 Feb 2021 17:58:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114HwEte042269; Thu, 4 Feb 2021 17:58:14 GMT (envelope-from git) Date: Thu, 4 Feb 2021 17:58:14 GMT Message-Id: <202102041758.114HwEte042269@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: 1eec5861d52e - main - tests/sys/vfs/lookup_cap_dotdot: No longer aborts after ATF update 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: 1eec5861d52e074bc20d08aef051af59cc70040e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 17:58:14 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=1eec5861d52e074bc20d08aef051af59cc70040e commit 1eec5861d52e074bc20d08aef051af59cc70040e Author: Alex Richardson AuthorDate: 2021-02-04 17:48:29 +0000 Commit: Alex Richardson CommitDate: 2021-02-04 17:57:27 +0000 tests/sys/vfs/lookup_cap_dotdot: No longer aborts after ATF update It appears this test no longer fails after c203bd70b5957f85616424b6fa374479372d06e3. PR: 215690 --- tests/sys/vfs/lookup_cap_dotdot.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/sys/vfs/lookup_cap_dotdot.c b/tests/sys/vfs/lookup_cap_dotdot.c index 6363471d55ff..dee1e0b11780 100644 --- a/tests/sys/vfs/lookup_cap_dotdot.c +++ b/tests/sys/vfs/lookup_cap_dotdot.c @@ -80,6 +80,7 @@ check_capsicum(void) { ATF_REQUIRE_FEATURE("security_capabilities"); ATF_REQUIRE_FEATURE("security_capability_mode"); + ATF_REQUIRE_SYSCTL_INT("kern.trap_enotcap", 0); } /* @@ -124,8 +125,6 @@ ATF_TC_BODY(lookup_cap_dotdot__basic, tc) cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); - atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); - ATF_REQUIRE(cap_enter() >= 0); ATF_REQUIRE_MSG(openat(dirfd, "d1/..", O_RDONLY) >= 0, "%s", @@ -146,8 +145,6 @@ ATF_TC_BODY(lookup_cap_dotdot__advanced, tc) check_capsicum(); prepare_dotdot_tests(); - atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); - cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); @@ -191,8 +188,6 @@ ATF_TC_BODY(capmode__negative, tc) check_capsicum(); prepare_dotdot_tests(); - atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); - ATF_REQUIRE(cap_enter() == 0); /* open() not permitted in capability mode */ @@ -231,8 +226,6 @@ ATF_TC_BODY(lookup_cap_dotdot__negative, tc) cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); - atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); - ATF_REQUIRE(cap_enter() >= 0); ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0); From owner-dev-commits-src-all@freebsd.org Thu Feb 4 18:01: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 52FBF52A759; Thu, 4 Feb 2021 18:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWmb21wz2z4hP7; Thu, 4 Feb 2021 18:01: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 3510A10451; Thu, 4 Feb 2021 18:01: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 114I1ob1052678; Thu, 4 Feb 2021 18:01:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114I1odP052677; Thu, 4 Feb 2021 18:01:50 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:01:50 GMT Message-Id: <202102041801.114I1odP052677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 068f2402d28b - stable/13 - amd64: add a note about simd to libc memset, memmove and memcmp 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 068f2402d28bf2ddee884c83be1dff3a7631569b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:01:50 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=068f2402d28bf2ddee884c83be1dff3a7631569b commit 068f2402d28bf2ddee884c83be1dff3a7631569b Author: Mateusz Guzik AuthorDate: 2021-01-31 15:50:34 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-04 17:59:05 +0000 amd64: add a note about simd to libc memset, memmove and memcmp (cherry picked from commit 0db6aef407f30c138982b8cde43189aad098b337) --- lib/libc/amd64/string/memcmp.S | 6 ++++++ lib/libc/amd64/string/memmove.S | 6 ++++++ lib/libc/amd64/string/memset.S | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/lib/libc/amd64/string/memcmp.S b/lib/libc/amd64/string/memcmp.S index 231ab2175804..67c7df280679 100644 --- a/lib/libc/amd64/string/memcmp.S +++ b/lib/libc/amd64/string/memcmp.S @@ -31,6 +31,12 @@ #include __FBSDID("$FreeBSD$"); +/* + * Note: this routine was written with kernel use in mind (read: no simd), + * it is only present in userspace as a temporary measure until something + * better gets imported. + */ + #define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ ENTRY(memcmp) diff --git a/lib/libc/amd64/string/memmove.S b/lib/libc/amd64/string/memmove.S index 4797140a1c16..3d75ff45c798 100644 --- a/lib/libc/amd64/string/memmove.S +++ b/lib/libc/amd64/string/memmove.S @@ -29,6 +29,12 @@ #include __FBSDID("$FreeBSD$"); +/* + * Note: this routine was written with kernel use in mind (read: no simd), + * it is only present in userspace as a temporary measure until something + * better gets imported. + */ + #define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ /* diff --git a/lib/libc/amd64/string/memset.S b/lib/libc/amd64/string/memset.S index 0639573a4a3e..050711302354 100644 --- a/lib/libc/amd64/string/memset.S +++ b/lib/libc/amd64/string/memset.S @@ -31,6 +31,12 @@ #include __FBSDID("$FreeBSD$"); +/* + * Note: this routine was written with kernel use in mind (read: no simd), + * it is only present in userspace as a temporary measure until something + * better gets imported. + */ + #define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ .macro MEMSET erms From owner-dev-commits-src-all@freebsd.org Thu Feb 4 18:01: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 69DC452A767; Thu, 4 Feb 2021 18:01: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 4DWmb32csSz4hJb; Thu, 4 Feb 2021 18:01: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 4CAA21078D; Thu, 4 Feb 2021 18:01: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 114I1p0i052701; Thu, 4 Feb 2021 18:01:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114I1pt0052700; Thu, 4 Feb 2021 18:01:51 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:01:51 GMT Message-Id: <202102041801.114I1pt0052700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 88a580ebeea1 - stable/13 - amd64: move memcmp checks upfront 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 88a580ebeea10e7bf9eb823dbbf48349eb8da540 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:01:51 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=88a580ebeea10e7bf9eb823dbbf48349eb8da540 commit 88a580ebeea10e7bf9eb823dbbf48349eb8da540 Author: Mateusz Guzik AuthorDate: 2021-01-31 15:46:18 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-04 17:59:10 +0000 amd64: move memcmp checks upfront This is a tradeoff which saves jumps for smaller sizes while making the 8-16 range slower (roughly in line with the other cases). Tested with glibc test suite. For example size 3 (most common with vfs namecache) (ops/s): before: 407086026 after: 461391995 The regressed range of 8-16 (with 8 as example): before: 540850489 after: 461671032 (cherry picked from commit f1be262ec11c1c35e6485f432415b5b52adb505d) --- lib/libc/amd64/string/memcmp.S | 50 ++++++++++++++++++++++------------------ sys/amd64/amd64/support.S | 52 +++++++++++++++++++++++------------------- 2 files changed, 57 insertions(+), 45 deletions(-) diff --git a/lib/libc/amd64/string/memcmp.S b/lib/libc/amd64/string/memcmp.S index 67c7df280679..0c8121f9d885 100644 --- a/lib/libc/amd64/string/memcmp.S +++ b/lib/libc/amd64/string/memcmp.S @@ -45,9 +45,25 @@ ENTRY(memcmp) cmpq $16,%rdx ja 101632f -100816: cmpb $8,%dl - jl 100408f + jg 100816f + + cmpb $4,%dl + jg 100408f + + cmpb $2,%dl + jge 100204f + + cmpb $1,%dl + jl 100000f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + subl %r8d,%eax +100000: + ret + + ALIGN_TEXT +100816: movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 @@ -57,9 +73,8 @@ ENTRY(memcmp) cmpq %r8,%r9 jne 10081608f ret + ALIGN_TEXT 100408: - cmpb $4,%dl - jl 100204f movl (%rdi),%r8d movl (%rsi),%r9d cmpl %r8d,%r9d @@ -69,9 +84,8 @@ ENTRY(memcmp) cmpl %r8d,%r9d jne 10040804f ret + ALIGN_TEXT 100204: - cmpb $2,%dl - jl 100001f movzwl (%rdi),%r8d movzwl (%rsi),%r9d cmpl %r8d,%r9d @@ -81,15 +95,7 @@ ENTRY(memcmp) cmpl %r8d,%r9d jne 1f ret -100001: - cmpb $1,%dl - jl 100000f - movzbl (%rdi),%eax - movzbl (%rsi),%r8d - subl %r8d,%eax -100000: - ret -ALIGN_TEXT + ALIGN_TEXT 101632: cmpq $32,%rdx ja 103200f @@ -110,7 +116,7 @@ ALIGN_TEXT cmpq %r8,%r9 jne 10163224f ret -ALIGN_TEXT + ALIGN_TEXT 103200: movq (%rdi),%r8 movq 8(%rdi),%r9 @@ -140,7 +146,7 @@ ALIGN_TEXT * * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). */ -ALIGN_TEXT + ALIGN_TEXT 10320016: leaq 16(%rdi),%rdi leaq 16(%rsi),%rsi @@ -152,29 +158,29 @@ ALIGN_TEXT leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10081608: 10163224: leaq -8(%rdi,%rdx),%rdi leaq -8(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163216: leaq -16(%rdi,%rdx),%rdi leaq -16(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163208: leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10040804: leaq -4(%rdi,%rdx),%rdi leaq -4(%rsi,%rdx),%rsi jmp 1f -ALIGN_TEXT + ALIGN_TEXT 80: movl (%rdi),%r8d movl (%rsi),%r9d diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 49baa50ac294..b623fba277db 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -93,9 +93,26 @@ ENTRY(memcmp) cmpq $16,%rdx ja 101632f -100816: cmpb $8,%dl - jl 100408f + jg 100816f + + cmpb $4,%dl + jg 100408f + + cmpb $2,%dl + jge 100204f + + cmpb $1,%dl + jl 100000f + movzbl (%rdi),%eax + movzbl (%rsi),%r8d + subl %r8d,%eax +100000: + POP_FRAME_POINTER + ret + + ALIGN_TEXT +100816: movq (%rdi),%r8 movq (%rsi),%r9 cmpq %r8,%r9 @@ -106,9 +123,8 @@ ENTRY(memcmp) jne 10081608f POP_FRAME_POINTER ret + ALIGN_TEXT 100408: - cmpb $4,%dl - jl 100204f movl (%rdi),%r8d movl (%rsi),%r9d cmpl %r8d,%r9d @@ -119,9 +135,8 @@ ENTRY(memcmp) jne 10040804f POP_FRAME_POINTER ret + ALIGN_TEXT 100204: - cmpb $2,%dl - jl 100001f movzwl (%rdi),%r8d movzwl (%rsi),%r9d cmpl %r8d,%r9d @@ -132,16 +147,7 @@ ENTRY(memcmp) jne 1f POP_FRAME_POINTER ret -100001: - cmpb $1,%dl - jl 100000f - movzbl (%rdi),%eax - movzbl (%rsi),%r8d - subl %r8d,%eax -100000: - POP_FRAME_POINTER - ret -ALIGN_TEXT + ALIGN_TEXT 101632: cmpq $32,%rdx ja 103200f @@ -163,7 +169,7 @@ ALIGN_TEXT jne 10163224f POP_FRAME_POINTER ret -ALIGN_TEXT + ALIGN_TEXT 103200: movq (%rdi),%r8 movq 8(%rdi),%r9 @@ -194,7 +200,7 @@ ALIGN_TEXT * * Before we compute it we narrow down the range (16 -> 8 -> 4 bytes). */ -ALIGN_TEXT + ALIGN_TEXT 10320016: leaq 16(%rdi),%rdi leaq 16(%rsi),%rsi @@ -206,29 +212,29 @@ ALIGN_TEXT leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10081608: 10163224: leaq -8(%rdi,%rdx),%rdi leaq -8(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163216: leaq -16(%rdi,%rdx),%rdi leaq -16(%rsi,%rdx),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10163208: leaq 8(%rdi),%rdi leaq 8(%rsi),%rsi jmp 80f -ALIGN_TEXT + ALIGN_TEXT 10040804: leaq -4(%rdi,%rdx),%rdi leaq -4(%rsi,%rdx),%rsi jmp 1f -ALIGN_TEXT + ALIGN_TEXT 80: movl (%rdi),%r8d movl (%rsi),%r9d From owner-dev-commits-src-all@freebsd.org Thu Feb 4 18:01: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 DAA1252A4D8; Thu, 4 Feb 2021 18:01:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWmb44FY7z4hLk; Thu, 4 Feb 2021 18:01: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 799421078E; Thu, 4 Feb 2021 18:01: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 114I1q7X052722; Thu, 4 Feb 2021 18:01:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114I1q8a052720; Thu, 4 Feb 2021 18:01:52 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:01:52 GMT Message-Id: <202102041801.114I1q8a052720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 55764c48f5f8 - stable/13 - cache: move hash computation into the parsing loop 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 55764c48f5f8535d8441764d392bb90dd6a6c9e0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:01:53 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=55764c48f5f8535d8441764d392bb90dd6a6c9e0 commit 55764c48f5f8535d8441764d392bb90dd6a6c9e0 Author: Mateusz Guzik AuthorDate: 2021-01-31 18:25:18 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-04 17:59:15 +0000 cache: move hash computation into the parsing loop (cherry picked from commit bbfb1edd70e15241d852d82eb7e1c1049a01b886) --- sys/kern/vfs_cache.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index fe7e70ba1359..b13ebf66c49a 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -722,6 +722,27 @@ cache_get_hash(char *name, u_char len, struct vnode *dvp) return (fnv_32_buf(name, len, dvp->v_nchash)); } +static uint32_t +cache_get_hash_iter_start(struct vnode *dvp) +{ + + return (dvp->v_nchash); +} + +static uint32_t +cache_get_hash_iter(char c, uint32_t hash) +{ + + return (fnv_32_buf(&c, 1, hash)); +} + +static uint32_t +cache_get_hash_iter_finish(uint32_t hash) +{ + + return (hash); +} + static inline struct nchashhead * NCP2BUCKET(struct namecache *ncp) { @@ -3693,11 +3714,11 @@ struct cache_fpl { struct nameidata *ndp; struct componentname *cnp; char *nulchar; - struct pwd **pwd; struct vnode *dvp; struct vnode *tvp; seqc_t dvp_seqc; seqc_t tvp_seqc; + uint32_t hash; struct nameidata_saved snd; struct nameidata_outer snd_outer; int line; @@ -3705,6 +3726,7 @@ struct cache_fpl { bool in_smr; bool fsearch; bool savename; + struct pwd **pwd; #ifdef INVARIANTS struct cache_fpl_debug debug; #endif @@ -4951,6 +4973,7 @@ cache_fplookup_next(struct cache_fpl *fpl) cnp = fpl->cnp; dvp = fpl->dvp; + hash = fpl->hash; if (__predict_false(cnp->cn_nameptr[0] == '.')) { if (cnp->cn_namelen == 1) { @@ -4963,8 +4986,6 @@ cache_fplookup_next(struct cache_fpl *fpl) MPASS(!cache_fpl_isdotdot(cnp)); - hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); - CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) @@ -5246,10 +5267,13 @@ cache_fplookup_parse(struct cache_fpl *fpl) { struct nameidata *ndp; struct componentname *cnp; + struct vnode *dvp; char *cp; + uint32_t hash; ndp = fpl->ndp; cnp = fpl->cnp; + dvp = fpl->dvp; /* * Find the end of this path component, it is either / or nul. @@ -5257,6 +5281,8 @@ cache_fplookup_parse(struct cache_fpl *fpl) * Store / as a temporary sentinel so that we only have one character * to test for. Pathnames tend to be short so this should not be * resulting in cache misses. + * + * TODO: fix this to be word-sized. */ KASSERT(&cnp->cn_nameptr[fpl->debug.ni_pathlen - 1] == fpl->nulchar, ("%s: mismatch between pathlen (%zu) and nulchar (%p != %p), string [%s]\n", @@ -5265,17 +5291,30 @@ cache_fplookup_parse(struct cache_fpl *fpl) KASSERT(*fpl->nulchar == '\0', ("%s: expected nul at %p; string [%s]\n", __func__, fpl->nulchar, cnp->cn_pnbuf)); + hash = cache_get_hash_iter_start(dvp); *fpl->nulchar = '/'; for (cp = cnp->cn_nameptr; *cp != '/'; cp++) { KASSERT(*cp != '\0', ("%s: encountered unexpected nul; string [%s]\n", __func__, cnp->cn_nameptr)); + hash = cache_get_hash_iter(*cp, hash); continue; } *fpl->nulchar = '\0'; + fpl->hash = cache_get_hash_iter_finish(hash); cnp->cn_namelen = cp - cnp->cn_nameptr; cache_fpl_pathlen_sub(fpl, cnp->cn_namelen); + +#ifdef INVARIANTS + if (cnp->cn_namelen <= NAME_MAX) { + if (fpl->hash != cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp)) { + panic("%s: mismatched hash for [%s] len %ld", __func__, + cnp->cn_nameptr, cnp->cn_namelen); + } + } +#endif + /* * Hack: we have to check if the found path component's length exceeds * NAME_MAX. However, the condition is very rarely true and check can From owner-dev-commits-src-all@freebsd.org Thu Feb 4 18:01: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 36D1A52A855; Thu, 4 Feb 2021 18:01: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 4DWmb56kwfz4hdL; Thu, 4 Feb 2021 18:01: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 A399C10452; Thu, 4 Feb 2021 18:01: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 114I1r45052741; Thu, 4 Feb 2021 18:01:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114I1rQV052740; Thu, 4 Feb 2021 18:01:53 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:01:53 GMT Message-Id: <202102041801.114I1rQV052740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 2edd6140e9a1 - stable/13 - cache: add delayed degenerate path handling 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2edd6140e9a157b5493cb287e30f8a15038eb95e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:01:56 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2edd6140e9a157b5493cb287e30f8a15038eb95e commit 2edd6140e9a157b5493cb287e30f8a15038eb95e Author: Mateusz Guzik AuthorDate: 2021-01-31 20:54:35 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-04 18:00:57 +0000 cache: add delayed degenerate path handling (cherry picked from commit 6f19dc2124a31aadf419743288d2ec1abd895563) --- sys/kern/vfs_cache.c | 57 +++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index b13ebf66c49a..db482ea4eba3 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3737,7 +3737,6 @@ static int cache_fplookup_cross_mount(struct cache_fpl *fpl); static int cache_fplookup_partial_setup(struct cache_fpl *fpl); static int cache_fplookup_skip_slashes(struct cache_fpl *fpl); static int cache_fplookup_trailingslash(struct cache_fpl *fpl); -static int cache_fplookup_preparse(struct cache_fpl *fpl); static void cache_fpl_pathlen_dec(struct cache_fpl *fpl); static void cache_fpl_pathlen_inc(struct cache_fpl *fpl); static void cache_fpl_pathlen_add(struct cache_fpl *fpl, size_t n); @@ -4518,6 +4517,9 @@ cache_fplookup_degenerate(struct cache_fpl *fpl) struct vnode *dvp; enum vgetstate dvs; int error, lkflags; +#ifdef INVARIANTS + char *cp; +#endif fpl->tvp = fpl->dvp; fpl->tvp_seqc = fpl->dvp_seqc; @@ -4525,6 +4527,14 @@ cache_fplookup_degenerate(struct cache_fpl *fpl) cnp = fpl->cnp; dvp = fpl->dvp; +#ifdef INVARIANTS + for (cp = cnp->cn_pnbuf; *cp != '\0'; cp++) { + KASSERT(*cp == '/', + ("%s: encountered non-slash; string [%s]\n", __func__, + cnp->cn_pnbuf)); + } +#endif + if (__predict_false(cnp->cn_nameiop != LOOKUP)) { cache_fpl_smr_exit(fpl); return (cache_fpl_handled_error(fpl, EISDIR)); @@ -4589,6 +4599,9 @@ cache_fplookup_noentry(struct cache_fpl *fpl) } if (cnp->cn_nameptr[0] == '\0') { + if (fpl->tvp == NULL) { + return (cache_fplookup_degenerate(fpl)); + } return (cache_fplookup_trailingslash(fpl)); } @@ -4897,7 +4910,7 @@ cache_symlink_resolve(struct cache_fpl *fpl, const char *string, size_t len) cache_fpl_pathlen_add(fpl, adjust); cnp->cn_nameptr = cnp->cn_pnbuf; fpl->nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; - + fpl->tvp = NULL; return (0); } @@ -4957,8 +4970,7 @@ cache_fplookup_symlink(struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } } - - return (cache_fplookup_preparse(fpl)); + return (0); } static int @@ -5238,30 +5250,6 @@ cache_fpl_pathlen_dec(struct cache_fpl *fpl) } #endif -static int __always_inline -cache_fplookup_preparse(struct cache_fpl *fpl) -{ - struct componentname *cnp; - - cnp = fpl->cnp; - - if (__predict_false(cnp->cn_nameptr[0] == '\0')) { - return (cache_fplookup_degenerate(fpl)); - } - - /* - * By this point the shortest possible pathname is one character + nul - * terminator, hence 2. - */ - KASSERT(fpl->debug.ni_pathlen >= 2, ("%s: pathlen %zu\n", __func__, - fpl->debug.ni_pathlen)); - KASSERT(&cnp->cn_nameptr[fpl->debug.ni_pathlen - 2] == fpl->nulchar - 1, - ("%s: mismatch on string (%p != %p) [%s]\n", __func__, - &cnp->cn_nameptr[fpl->debug.ni_pathlen - 2], fpl->nulchar - 1, - cnp->cn_pnbuf)); - return (0); -} - static void cache_fplookup_parse(struct cache_fpl *fpl) { @@ -5543,6 +5531,13 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) return (cache_fpl_aborted(fpl)); } + /* + * Hack: delayed degenerate path checking. + */ + if (cnp->cn_nameptr[0] == '\0' && fpl->tvp == NULL) { + return (cache_fplookup_degenerate(fpl)); + } + /* * Hack: delayed name len checking. */ @@ -5634,10 +5629,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } - error = cache_fplookup_preparse(fpl); - if (__predict_false(cache_fpl_terminated(fpl))) { - return (error); - } + MPASS(fpl->tvp == NULL); for (;;) { cache_fplookup_parse(fpl); @@ -5797,6 +5789,7 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, fpl.nulchar = &cnp->cn_nameptr[ndp->ni_pathlen - 1]; fpl.fsearch = false; fpl.savename = (cnp->cn_flags & SAVENAME) != 0; + fpl.tvp = NULL; /* for degenerate path handling */ fpl.pwd = pwdp; pwd = pwd_get_smr(); *(fpl.pwd) = pwd; From owner-dev-commits-src-all@freebsd.org Thu Feb 4 18: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 9477552A6E0; Thu, 4 Feb 2021 18: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 4DWmb85Swxz4hdW; Thu, 4 Feb 2021 18:01: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 EB8F47EFD; Thu, 4 Feb 2021 18: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 114I1sPV052763; Thu, 4 Feb 2021 18: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 114I1scD052762; Thu, 4 Feb 2021 18:01:54 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:01:54 GMT Message-Id: <202102041801.114I1scD052762@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 6d3ce617f398 - stable/13 - amd64: use compiler intrinsics for bsf* and bsr* 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d3ce617f398d4066780555210270b97c30e7c0e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:01:58 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6d3ce617f398d4066780555210270b97c30e7c0e commit 6d3ce617f398d4066780555210270b97c30e7c0e Author: Mateusz Guzik AuthorDate: 2021-01-31 23:35:30 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-04 18:01:08 +0000 amd64: use compiler intrinsics for bsf* and bsr* (cherry picked from commit aae89f6f09576351cc3a9a54959649e60fdd849b) --- sys/amd64/include/cpufunc.h | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 763ed2c64c8a..8ef298e1d7d5 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -65,41 +65,13 @@ breakpoint(void) __asm __volatile("int $3"); } -static __inline __pure2 u_int -bsfl(u_int mask) -{ - u_int result; - - __asm __volatile("bsfl %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} - -static __inline __pure2 u_long -bsfq(u_long mask) -{ - u_long result; - - __asm __volatile("bsfq %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} - -static __inline __pure2 u_int -bsrl(u_int mask) -{ - u_int result; +#define bsfl(mask) __builtin_ctz(mask) - __asm __volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} +#define bsfq(mask) __builtin_ctzl(mask) -static __inline __pure2 u_long -bsrq(u_long mask) -{ - u_long result; +#define bsrl(mask) (__builtin_clz(mask) ^ 0x1f) - __asm __volatile("bsrq %1,%0" : "=r" (result) : "rm" (mask)); - return (result); -} +#define bsrq(mask) (__builtin_clzl(mask) ^ 0x3f) static __inline void clflush(u_long addr) From owner-dev-commits-src-all@freebsd.org Thu Feb 4 18:02: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 E319152AA03; Thu, 4 Feb 2021 18:02: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 4DWmbD36vRz4hQ4; Thu, 4 Feb 2021 18:01: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 04D8B7EFE; Thu, 4 Feb 2021 18:01: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 114I1taa052783; Thu, 4 Feb 2021 18:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114I1tWv052782; Thu, 4 Feb 2021 18:01:55 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:01:55 GMT Message-Id: <202102041801.114I1tWv052782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 1a2bc12c4b25 - stable/13 - x86: use compiler intrinsics for bswap* 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a2bc12c4b2563628f329e2e971d1619e0240429 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:02:02 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1a2bc12c4b2563628f329e2e971d1619e0240429 commit 1a2bc12c4b2563628f329e2e971d1619e0240429 Author: Mateusz Guzik AuthorDate: 2021-02-01 03:00:13 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-04 18:01:13 +0000 x86: use compiler intrinsics for bswap* (cherry picked from commit e6ff6154d2034c13f3d0da73c1e00d69fdb36516) --- sys/x86/include/endian.h | 62 +++--------------------------------------------- 1 file changed, 3 insertions(+), 59 deletions(-) diff --git a/sys/x86/include/endian.h b/sys/x86/include/endian.h index 9c39f4fddf80..18d52fb8a6fa 100644 --- a/sys/x86/include/endian.h +++ b/sys/x86/include/endian.h @@ -65,65 +65,9 @@ #define BYTE_ORDER _BYTE_ORDER #endif -#define __bswap16_gen(x) (__uint16_t)((x) << 8 | (x) >> 8) -#define __bswap32_gen(x) \ - (((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16)) -#define __bswap64_gen(x) \ - (((__uint64_t)__bswap32((x) & 0xffffffff) << 32) | __bswap32((x) >> 32)) - -#ifdef __GNUCLIKE_BUILTIN_CONSTANT_P -#define __bswap16(x) \ - ((__uint16_t)(__builtin_constant_p(x) ? \ - __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))) -#define __bswap32(x) \ - (__builtin_constant_p(x) ? \ - __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x)) -#define __bswap64(x) \ - (__builtin_constant_p(x) ? \ - __bswap64_gen((__uint64_t)(x)) : __bswap64_var(x)) -#else -/* XXX these are broken for use in static initializers. */ -#define __bswap16(x) __bswap16_var(x) -#define __bswap32(x) __bswap32_var(x) -#define __bswap64(x) __bswap64_var(x) -#endif - -/* These are defined as functions to avoid multiple evaluation of x. */ - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - - return (__bswap16_gen(_x)); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - -#ifdef __GNUCLIKE_ASM - __asm("bswap %0" : "+r" (_x)); - return (_x); -#else - return (__bswap32_gen(_x)); -#endif -} - -static __inline __uint64_t -__bswap64_var(__uint64_t _x) -{ - -#if defined(__amd64__) && defined(__GNUCLIKE_ASM) - __asm("bswap %0" : "+r" (_x)); - return (_x); -#else - /* - * It is important for the optimizations that the following is not - * really generic, but expands to 2 __bswap32_var()'s. - */ - return (__bswap64_gen(_x)); -#endif -} +#define __bswap16(x) __builtin_bswap16(x) +#define __bswap32(x) __builtin_bswap32(x) +#define __bswap64(x) __builtin_bswap64(x) #define __htonl(x) __bswap32(x) #define __htons(x) __bswap16(x) From owner-dev-commits-src-all@freebsd.org Thu Feb 4 18:04: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 5EB6452ABA5; Thu, 4 Feb 2021 18:04: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 4DWmdt2Gw6z4jTn; Thu, 4 Feb 2021 18:04: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 413CF1059F; Thu, 4 Feb 2021 18:04: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 114I4IhA055041; Thu, 4 Feb 2021 18:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114I4IEr055040; Thu, 4 Feb 2021 18:04:18 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:04:18 GMT Message-Id: <202102041804.114I4IEr055040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Ambrisko Subject: git: 1fb5b2860444 - stable/13 - VMD support for new devices. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ambrisko X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1fb5b2860444ba8954abcf14a4e2f5f1ddd2fcd3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:04:18 -0000 The branch stable/13 has been updated by ambrisko: URL: https://cgit.FreeBSD.org/src/commit/?id=1fb5b2860444ba8954abcf14a4e2f5f1ddd2fcd3 commit 1fb5b2860444ba8954abcf14a4e2f5f1ddd2fcd3 Author: Doug Ambrisko AuthorDate: 2021-01-28 23:12:14 +0000 Commit: Doug Ambrisko CommitDate: 2021-02-04 18:04:09 +0000 VMD support for new devices. Add support for some more Intel VMD controllers. Some of the newer controller have a sparce bus space that can be figured out by probing the HW. This gives the starting bus number. When reading the PCI config. space behind the VMD controller, the offset of the starting bus needs to be subtracted from the bus being read. Fixed a bug in which in which not all of the devices directly attached to the VMD controller would be probed. On my initial test HW, a switch was found at bus 0, slot 0 and function 0. All of the NVME drives were behind that switch. Now scan for all slots and functions attached to bus 0. If a something was found then run attach after the scan. On detach also go through all slots and functions on bus 0. Tested with device ID's: 0x201d & 0x9a0b Tested by: nc@ MFC: 5c689e21361 PR: 252253 (cherry picked from commit 0c852bb9b9282b30fd047ac1de398358f33777f4) --- sys/dev/vmd/vmd.c | 75 ++++++++++++++++++++++++++++++++++++++++++++------- sys/dev/vmd/vmd.h | 1 + sys/dev/vmd/vmd_bus.c | 73 ++++++++++++++++++++++++++++++------------------- 3 files changed, 113 insertions(+), 36 deletions(-) diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c index 616fd4c8373e..80eeda4639fa 100644 --- a/sys/dev/vmd/vmd.c +++ b/sys/dev/vmd/vmd.c @@ -61,16 +61,32 @@ struct vmd_type { u_int16_t vmd_vid; u_int16_t vmd_did; char *vmd_name; + int flags; +#define BUS_RESTRICT 1 }; #define INTEL_VENDOR_ID 0x8086 -#define INTEL_DEVICE_ID_VMD 0x201d -#define INTEL_DEVICE_ID_VMD2 0x28c0 +#define INTEL_DEVICE_ID_201d 0x201d +#define INTEL_DEVICE_ID_28c0 0x28c0 +#define INTEL_DEVICE_ID_467f 0x467f +#define INTEL_DEVICE_ID_4c3d 0x4c3d +#define INTEL_DEVICE_ID_9a0b 0x9a0b + +#define VMD_CAP 0x40 +#define VMD_BUS_RESTRICT 0x1 + +#define VMD_CONFIG 0x44 +#define VMD_BUS_START(x) ((x >> 8) & 0x3) + +#define VMD_LOCK 0x70 static struct vmd_type vmd_devs[] = { - { INTEL_VENDOR_ID, INTEL_DEVICE_ID_VMD, "Intel Volume Management Device" }, - { INTEL_VENDOR_ID, INTEL_DEVICE_ID_VMD2, "Intel Volume Management Device" }, - { 0, 0, NULL } + { INTEL_VENDOR_ID, INTEL_DEVICE_ID_201d, "Intel Volume Management Device", 0 }, + { INTEL_VENDOR_ID, INTEL_DEVICE_ID_28c0, "Intel Volume Management Device", BUS_RESTRICT }, + { INTEL_VENDOR_ID, INTEL_DEVICE_ID_467f, "Intel Volume Management Device", BUS_RESTRICT }, + { INTEL_VENDOR_ID, INTEL_DEVICE_ID_4c3d, "Intel Volume Management Device", BUS_RESTRICT }, + { INTEL_VENDOR_ID, INTEL_DEVICE_ID_9a0b, "Intel Volume Management Device", BUS_RESTRICT }, + { 0, 0, NULL, 0 } }; static int @@ -92,7 +108,7 @@ vmd_probe(device_t dev) t++; } -return (ENXIO); + return (ENXIO); } static void @@ -157,8 +173,12 @@ vmd_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width) struct vmd_softc *sc; bus_addr_t offset; - offset = (b << 20) + (s << 15) + (f << 12) + reg; sc = device_get_softc(dev); + if (b < sc->vmd_bus_start) + return (0xffffffff); + + offset = ((b - sc->vmd_bus_start) << 20) + (s << 15) + (f << 12) + reg; + switch(width) { case 4: return (bus_space_read_4(sc->vmd_btag, sc->vmd_bhandle, @@ -183,8 +203,11 @@ vmd_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, struct vmd_softc *sc; bus_addr_t offset; - offset = (b << 20) + (s << 15) + (f << 12) + reg; sc = device_get_softc(dev); + if (b < sc->vmd_bus_start) + return; + + offset = ((b - sc->vmd_bus_start) << 20) + (s << 15) + (f << 12) + reg; switch(width) { case 4: @@ -271,6 +294,8 @@ vmd_attach(device_t dev) { struct vmd_softc *sc; struct pcib_secbus *bus; + struct vmd_type *t; + uint16_t vid, did; uint32_t bar; int i, j, error; int rid, sec_reg; @@ -325,13 +350,45 @@ vmd_attach(device_t dev) pci_write_config(dev, PCIR_PRIBUS_2, pcib_get_bus(device_get_parent(dev)), 1); + t = vmd_devs; + vid = pci_get_vendor(dev); + did = pci_get_device(dev); + + sc->vmd_bus_start = 0; + while (t->vmd_name != NULL) { + if (vid == t->vmd_vid && + did == t->vmd_did) { + if (t->flags == BUS_RESTRICT) { + if (pci_read_config(dev, VMD_CAP, 2) & + VMD_BUS_RESTRICT) + switch (VMD_BUS_START(pci_read_config( + dev, VMD_CONFIG, 2))) { + case 1: + sc->vmd_bus_start = 128; + break; + case 2: + sc->vmd_bus_start = 224; + break; + case 3: + device_printf(dev, + "Unknown bug offset\n"); + goto fail; + break; + } + } + } + t++; + } + + device_printf(dev, "VMD bus starts at %d\n", sc->vmd_bus_start); + sec_reg = PCIR_SECBUS_1; bus = &sc->vmd_bus; bus->sub_reg = PCIR_SUBBUS_1; bus->sec = vmd_read_config(dev, b, s, f, sec_reg, 1); bus->sub = vmd_read_config(dev, b, s, f, bus->sub_reg, 1); bus->dev = dev; - bus->rman.rm_start = 0; + bus->rman.rm_start = sc->vmd_bus_start; bus->rman.rm_end = PCI_BUSMAX; bus->rman.rm_type = RMAN_ARRAY; snprintf(buf, sizeof(buf), "%s bus numbers", device_get_nameunit(dev)); diff --git a/sys/dev/vmd/vmd.h b/sys/dev/vmd/vmd.h index f86630d72c24..e51448c7733e 100644 --- a/sys/dev/vmd/vmd.h +++ b/sys/dev/vmd/vmd.h @@ -78,6 +78,7 @@ struct vmd_softc void *vmd_intr; struct vmd_irq *vmd_irq; int vmd_msix_count; + uint8_t vmd_bus_start; #ifdef TASK_QUEUE_INTR struct taskqueue *vmd_irq_tq; struct task vmd_irq_task; diff --git a/sys/dev/vmd/vmd_bus.c b/sys/dev/vmd/vmd_bus.c index 74a6faa812b1..5eed6176630f 100644 --- a/sys/dev/vmd/vmd_bus.c +++ b/sys/dev/vmd/vmd_bus.c @@ -71,32 +71,45 @@ vmd_bus_attach(device_t dev) struct pci_devinfo *dinfo; rman_res_t start, end; int b, s, f; + int found; sc = device_get_softc(device_get_parent(dev)); - /* Start at max PCI vmd_domain and work down */ - b = s = f = 0; - dinfo = pci_read_device(device_get_parent(dev), dev, - PCI_DOMAINMAX - device_get_unit(device_get_parent(dev)), - b, s, f); - if (dinfo == NULL) { - device_printf(dev, "Cannot allocate dinfo!\n"); - return (ENOENT); + /* + * Start at max PCI vmd_domain and work down. Only VMD + * starting bus is connect to VMD device directly. Scan al + * lslots and function connected to starting bus. + */ + + b = sc->vmd_bus_start; + + found = 0; + for (s = 0; s < PCI_SLOTMAX; s++) { + for (f = 0; f < PCI_FUNCMAX; f++) { + dinfo = pci_read_device(device_get_parent(dev), dev, + PCI_DOMAINMAX - device_get_unit( + device_get_parent(dev)), b, s, f); + if (dinfo != NULL) { + found = 1; + pci_add_child(dev, dinfo); + + start = rman_get_start(sc->vmd_regs_resource[1]); + end = rman_get_end(sc->vmd_regs_resource[1]); + resource_list_add_next(&dinfo->resources, + SYS_RES_MEMORY, start, end, end - start + 1); + + start = rman_get_start(sc->vmd_io_resource); + end = rman_get_end(sc->vmd_io_resource); + resource_list_add_next(&dinfo->resources, + SYS_RES_IOPORT, start, end, end - start + 1); + + } + } } - pci_add_child(dev, dinfo); - - start = rman_get_start(sc->vmd_regs_resource[1]); - end = rman_get_end(sc->vmd_regs_resource[1]); - resource_list_add_next(&dinfo->resources, SYS_RES_MEMORY, start, end, - end - start + 1); - - start = rman_get_start(sc->vmd_io_resource); - end = rman_get_end(sc->vmd_io_resource); - resource_list_add_next(&dinfo->resources, SYS_RES_IOPORT, start, end, - end - start + 1); - - bus_generic_attach(dev); + if (found) { + bus_generic_attach(dev); + } return (0); } @@ -104,17 +117,23 @@ vmd_bus_attach(device_t dev) static int vmd_bus_detach(device_t dev) { + struct vmd_softc *sc; struct pci_devinfo *dinfo; int b, s, f; device_delete_children(dev); - b = s = f = 0; - dinfo = pci_read_device(device_get_parent(dev), dev, - PCI_DOMAINMAX - device_get_unit(device_get_parent(dev)), - b, s, f); - if (dinfo == NULL) { - resource_list_free(&dinfo->resources); + sc = device_get_softc(device_get_parent(dev)); + b = sc->vmd_bus_start; + + for (s = 0; s < PCI_SLOTMAX; s++) { + for (f = 0; f < PCI_FUNCMAX; f++) { + dinfo = pci_read_device(device_get_parent(dev), dev, + PCI_DOMAINMAX - device_get_unit( + device_get_parent(dev)), b, s, f); + if (dinfo != NULL) + resource_list_free(&dinfo->resources); + } } return (0); } From owner-dev-commits-src-all@freebsd.org Thu Feb 4 18:55: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 A949452BE1D; Thu, 4 Feb 2021 18:55: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 4DWnnD3W58z4mHn; Thu, 4 Feb 2021 18:55: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 6B0F610F3F; Thu, 4 Feb 2021 18:55: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 114Iti7T020378; Thu, 4 Feb 2021 18:55:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114Itiod020377; Thu, 4 Feb 2021 18:55:44 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:55:44 GMT Message-Id: <202102041855.114Itiod020377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Stone Subject: git: b58cf1cb35ab - main - Fix race condition in linuxkpi workqueue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rstone X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b58cf1cb35abc095d7fb9773630794b38bbc6b1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:55:44 -0000 The branch main has been updated by rstone: URL: https://cgit.FreeBSD.org/src/commit/?id=b58cf1cb35abc095d7fb9773630794b38bbc6b1d commit b58cf1cb35abc095d7fb9773630794b38bbc6b1d Author: Ryan Stone AuthorDate: 2021-01-07 17:25:56 +0000 Commit: Ryan Stone CommitDate: 2021-02-04 18:54:53 +0000 Fix race condition in linuxkpi workqueue Consider the following scenario: 1. A delayed_work struct in the WORK_ST_TIMER state. 2. Thread A calls mod_delayed_work() 3. Thread B (a callout thread) simultaneously calls linux_delayed_work_timer_fn() The following sequence of events is possible: A: Call linux_cancel_delayed_work() A: Change state from TIMER TO CANCEL B: Change state from CANCEL to TASK B: taskqueue_enqueue() the task A: taskqueue_cancel() the task A: Call linux_queue_delayed_work_on(). This is a no-op because the state is WORK_ST_TASK. As a result, the delayed_work struct will never be invoked. This is causing address resolution in ib_addr.c to stop permanently, as it never tries to reschedule a task that it thinks is already scheduled. Fix this by introducing locking into the cancel path (which corresponds with the lock held while the callout runs). This will prevent the callout from changing the state of the task until the cancel is complete, preventing the race. Differential Revision: https://reviews.freebsd.org/D28420 Reviewed by: hselasky MFC after: 2 months --- sys/compat/linuxkpi/common/src/linux_work.c | 49 ++++++++++++++++------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_work.c b/sys/compat/linuxkpi/common/src/linux_work.c index 45025378baa9..f9cf62928760 100644 --- a/sys/compat/linuxkpi/common/src/linux_work.c +++ b/sys/compat/linuxkpi/common/src/linux_work.c @@ -435,13 +435,17 @@ linux_cancel_delayed_work(struct delayed_work *dwork) [WORK_ST_CANCEL] = WORK_ST_CANCEL, /* NOP */ }; struct taskqueue *tq; + bool cancelled; + mtx_lock(&dwork->timer.mtx); switch (linux_update_state(&dwork->work.state, states)) { case WORK_ST_TIMER: case WORK_ST_CANCEL: - if (linux_cancel_timer(dwork, 0)) { + cancelled = (callout_stop(&dwork->timer.callout) == 1); + if (cancelled) { atomic_cmpxchg(&dwork->work.state, WORK_ST_CANCEL, WORK_ST_IDLE); + mtx_unlock(&dwork->timer.mtx); return (true); } /* FALLTHROUGH */ @@ -450,10 +454,12 @@ linux_cancel_delayed_work(struct delayed_work *dwork) if (taskqueue_cancel(tq, &dwork->work.work_task, NULL) == 0) { atomic_cmpxchg(&dwork->work.state, WORK_ST_CANCEL, WORK_ST_IDLE); + mtx_unlock(&dwork->timer.mtx); return (true); } /* FALLTHROUGH */ default: + mtx_unlock(&dwork->timer.mtx); return (false); } } @@ -475,37 +481,36 @@ linux_cancel_delayed_work_sync(struct delayed_work *dwork) }; struct taskqueue *tq; bool retval = false; + int ret, state; + bool cancelled; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "linux_cancel_delayed_work_sync() might sleep"); -retry: - switch (linux_update_state(&dwork->work.state, states)) { + mtx_lock(&dwork->timer.mtx); + + state = linux_update_state(&dwork->work.state, states); + switch (state) { case WORK_ST_IDLE: + mtx_unlock(&dwork->timer.mtx); return (retval); - case WORK_ST_EXEC: - tq = dwork->work.work_queue->taskqueue; - if (taskqueue_cancel(tq, &dwork->work.work_task, NULL) != 0) - taskqueue_drain(tq, &dwork->work.work_task); - goto retry; /* work may have restarted itself */ case WORK_ST_TIMER: case WORK_ST_CANCEL: - if (linux_cancel_timer(dwork, 1)) { - /* - * Make sure taskqueue is also drained before - * returning: - */ - tq = dwork->work.work_queue->taskqueue; - taskqueue_drain(tq, &dwork->work.work_task); - retval = true; - goto retry; - } - /* FALLTHROUGH */ + cancelled = (callout_stop(&dwork->timer.callout) == 1); + + tq = dwork->work.work_queue->taskqueue; + ret = taskqueue_cancel(tq, &dwork->work.work_task, NULL); + mtx_unlock(&dwork->timer.mtx); + + callout_drain(&dwork->timer.callout); + taskqueue_drain(tq, &dwork->work.work_task); + return (cancelled || (ret != 0)); default: tq = dwork->work.work_queue->taskqueue; - if (taskqueue_cancel(tq, &dwork->work.work_task, NULL) != 0) + ret = taskqueue_cancel(tq, &dwork->work.work_task, NULL); + mtx_unlock(&dwork->timer.mtx); + if (ret != 0) taskqueue_drain(tq, &dwork->work.work_task); - retval = true; - goto retry; + return (ret != 0); } } From owner-dev-commits-src-all@freebsd.org Thu Feb 4 18:58: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 2525B52C122; Thu, 4 Feb 2021 18:58: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 4DWnrR0Xczz4mRm; Thu, 4 Feb 2021 18:58: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 054801123B; Thu, 4 Feb 2021 18:58: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 114IwURA020892; Thu, 4 Feb 2021 18:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114IwUHP020891; Thu, 4 Feb 2021 18:58:30 GMT (envelope-from git) Date: Thu, 4 Feb 2021 18:58:30 GMT Message-Id: <202102041858.114IwUHP020891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Stone Subject: git: 8a06ca2f734c - main - Fix mismerge in OFED update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rstone X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a06ca2f734c726799688d65a7dad67284275438 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 18:58:31 -0000 The branch main has been updated by rstone: URL: https://cgit.FreeBSD.org/src/commit/?id=8a06ca2f734c726799688d65a7dad67284275438 commit 8a06ca2f734c726799688d65a7dad67284275438 Author: Ryan Stone AuthorDate: 2021-01-29 20:48:50 +0000 Commit: Ryan Stone CommitDate: 2021-02-04 18:58:24 +0000 Fix mismerge in OFED update When OFED was upgraded to Linux v4.9, a bunch of Linux-specific netlink changes were dropped. Unfortunately, there was a mismerge in this process and as a result ib_sa_cancel_query() would fail to cancel an outstanding MAD. This was causing rdma_destroy_id() to hang indefinitely waiting for the MAD to complete and release the final reference. Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D28421 Reviewed by: hselasky, kib MFC after: 2 months --- sys/ofed/drivers/infiniband/core/ib_sa_query.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/ofed/drivers/infiniband/core/ib_sa_query.c b/sys/ofed/drivers/infiniband/core/ib_sa_query.c index cd3ffe667716..2b19e42020d2 100644 --- a/sys/ofed/drivers/infiniband/core/ib_sa_query.c +++ b/sys/ofed/drivers/infiniband/core/ib_sa_query.c @@ -622,6 +622,8 @@ void ib_sa_cancel_query(int id, struct ib_sa_query *query) agent = query->port->agent; mad_buf = query->mad_buf; spin_unlock_irqrestore(&idr_lock, flags); + + ib_cancel_mad(agent, mad_buf); } EXPORT_SYMBOL(ib_sa_cancel_query); From owner-dev-commits-src-all@freebsd.org Thu Feb 4 20: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 8025452E6E7; Thu, 4 Feb 2021 20: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 4DWrBK3CGPz4t7v; Thu, 4 Feb 2021 20: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 60E92125D5; Thu, 4 Feb 2021 20: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 114Ki9ZN063321; Thu, 4 Feb 2021 20:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114Ki94o063320; Thu, 4 Feb 2021 20:44:09 GMT (envelope-from git) Date: Thu, 4 Feb 2021 20:44:09 GMT Message-Id: <202102042044.114Ki94o063320@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: 06eda1d83cbb - stable/13 - release: update workaround during transition to git 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 06eda1d83cbb80eb05711cfa5509b6b0df580973 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 20:44:09 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=06eda1d83cbb80eb05711cfa5509b6b0df580973 commit 06eda1d83cbb80eb05711cfa5509b6b0df580973 Author: Glen Barber AuthorDate: 2021-02-02 17:19:36 +0000 Commit: Glen Barber CommitDate: 2021-02-04 20:43:40 +0000 release: update workaround during transition to git PR: 253181 Submitted by: Yasuhiro Kimura Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 70dfc101b6324b25ba353465f0d6c610399741fc) --- release/release.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/release/release.sh b/release/release.sh index fbd64bb8234d..372f69177f7e 100755 --- a/release/release.sh +++ b/release/release.sh @@ -246,8 +246,11 @@ chroot_setup() { fi fi if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then - if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then - git -C ${CHROOTDIR}/usr/ports pull -q + # if [ -d "${CHROOTDIR}/usr/ports/.git" ]; then + # git -C ${CHROOTDIR}/usr/ports pull -q + # XXX: Workaround for the overlap in the Git conversion timeframe. + if [ -d "${CHROOTDIR}/usr/ports/.svn" ]; then + ${SVNCMD} update ${CHROOTDIR}/usr/ports else #${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports # XXX: Workaround for the overlap in the Git From owner-dev-commits-src-all@freebsd.org Thu Feb 4 21:01: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 3297852EDD6; Thu, 4 Feb 2021 21:01: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 4DWrZ80TZqz4tbM; Thu, 4 Feb 2021 21:01: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 036B912999; Thu, 4 Feb 2021 21:01: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 114L1JwG086265; Thu, 4 Feb 2021 21:01:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114L1Jve086264; Thu, 4 Feb 2021 21:01:19 GMT (envelope-from git) Date: Thu, 4 Feb 2021 21:01:19 GMT Message-Id: <202102042101.114L1Jve086264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 31026a4677d0 - stable/13 - hcons: Fix manpage typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 31026a4677d0bbfc55433ba4f375700ec919e3bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:01:20 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=31026a4677d0bbfc55433ba4f375700ec919e3bf commit 31026a4677d0bbfc55433ba4f375700ec919e3bf Author: Vladimir Kondratyev AuthorDate: 2021-01-23 19:19:50 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-04 20:59:43 +0000 hcons: Fix manpage typo Submitted by: Shunchao Hu Reviewed by: wulf, gbe Differential revision: https://reviews.freebsd.org/D28294 (cherry picked from commit 0d528e6354141dd097f8719e858b3ae3686d2062) --- share/man/man4/hcons.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/hcons.4 b/share/man/man4/hcons.4 index a8fe22983453..68a920fba9d8 100644 --- a/share/man/man4/hcons.4 +++ b/share/man/man4/hcons.4 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2020 +.Dd January 23, 2021 .Dt HCONS 4 .Os .Sh NAME @@ -45,7 +45,7 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -hgame_load="YES" +hcons_load="YES" .Ed .Sh DESCRIPTION The From owner-dev-commits-src-all@freebsd.org Thu Feb 4 21:01: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 2EF7452F127; Thu, 4 Feb 2021 21:01: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 4DWrZ90vXjz4tkR; Thu, 4 Feb 2021 21:01: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 121EB127EC; Thu, 4 Feb 2021 21:01: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 114L1LKP086283; Thu, 4 Feb 2021 21:01:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114L1LBS086282; Thu, 4 Feb 2021 21:01:21 GMT (envelope-from git) Date: Thu, 4 Feb 2021 21:01:21 GMT Message-Id: <202102042101.114L1LBS086282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 6d4bc364ab5a - stable/13 - hsctrl: Fix manpage typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d4bc364ab5ae7559caef8c6e62a8d26694e6bde Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:01:21 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=6d4bc364ab5ae7559caef8c6e62a8d26694e6bde commit 6d4bc364ab5ae7559caef8c6e62a8d26694e6bde Author: Vladimir Kondratyev AuthorDate: 2021-01-28 21:35:11 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-04 20:59:49 +0000 hsctrl: Fix manpage typo Use hsctrl_load to load the module at boot time. Submitted by: Shunchao Hu Reviewed by: wulf Differential revision: https://reviews.freebsd.org/D28343 (cherry picked from commit 5c689e213614bff65e9789875f839aa05053126b) --- share/man/man4/hsctrl.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/hsctrl.4 b/share/man/man4/hsctrl.4 index ba7976c3c03d..e4a44ce11630 100644 --- a/share/man/man4/hsctrl.4 +++ b/share/man/man4/hsctrl.4 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2020 +.Dd January 26, 2021 .Dt HSCTRL 4 .Os .Sh NAME @@ -45,7 +45,7 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -hgame_load="YES" +hsctrl_load="YES" .Ed .Sh DESCRIPTION The From owner-dev-commits-src-all@freebsd.org Thu Feb 4 21:08: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 F413D52F3CE; Thu, 4 Feb 2021 21:08: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 4DWrkT6VS7z4vMN; Thu, 4 Feb 2021 21:08: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 D011F12B8F; Thu, 4 Feb 2021 21:08: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 114L8XmD090492; Thu, 4 Feb 2021 21:08:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114L8Xri090491; Thu, 4 Feb 2021 21:08:33 GMT (envelope-from git) Date: Thu, 4 Feb 2021 21:08:33 GMT Message-Id: <202102042108.114L8Xri090491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: aa77662373e3 - main - Add a comment notifying that "device axp" requires miibus for build. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa77662373e378c05dfe9ce328be60bd792b5354 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:08:34 -0000 The branch main has been updated by bofh (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=aa77662373e378c05dfe9ce328be60bd792b5354 commit aa77662373e378c05dfe9ce328be60bd792b5354 Author: Muhammad Moinur Rahman AuthorDate: 2021-02-04 21:05:47 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2021-02-04 21:05:47 +0000 Add a comment notifying that "device axp" requires miibus for build. Although if RJ-45 interface is not being used the miibus is not required but miibus is a build time dependency. Reviewed by: imp, manu, rajesh1.kumar@amd.com Approved by: imp, manu, rajesh1.kumar@amd.com Differential Revision: https://reviews.freebsd.org/D28465 --- sys/amd64/conf/GENERIC | 2 +- sys/amd64/conf/NOTES | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 9f55a935f8a5..387128f7cba8 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -251,7 +251,7 @@ device ixl # Intel 700 Series Physical Function device iavf # Intel Adaptive Virtual Function device ice # Intel 800 Series Physical Function device vmx # VMware VMXNET3 Ethernet -device axp # AMD EPYC integrated NIC +device axp # AMD EPYC integrated NIC (requires miibus) # PCI Ethernet NICs. device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index a1691f66a4cb..60d171721cf1 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -309,6 +309,8 @@ device cpufreq # vmx: VMware VMXNET3 Ethernet (BSD open source) # wpi: Intel 3945ABG Wireless LAN controller # Requires the wpi firmware module +# axp: AMD EPYC integrated NIC +# Requires the miibus module device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE options ED_3C503 From owner-dev-commits-src-all@freebsd.org Thu Feb 4 21:30: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 ED20C52F76A; Thu, 4 Feb 2021 21:30: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 4DWsCL6LJhz3C43; Thu, 4 Feb 2021 21:30: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 CCA6C1320A; Thu, 4 Feb 2021 21:30: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 114LU6gU018594; Thu, 4 Feb 2021 21:30:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114LU6Vk018591; Thu, 4 Feb 2021 21:30:06 GMT (envelope-from git) Date: Thu, 4 Feb 2021 21:30:06 GMT Message-Id: <202102042130.114LU6Vk018591@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: 2bd4ff2d8911 - main - loader.efi: There are systems without ConOut, also use ConOutDev 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: 2bd4ff2d8911009283e4e615ca4aad35a845f48b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:30:07 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=2bd4ff2d8911009283e4e615ca4aad35a845f48b commit 2bd4ff2d8911009283e4e615ca4aad35a845f48b Author: Toomas Soome AuthorDate: 2021-02-04 20:49:02 +0000 Commit: Toomas Soome CommitDate: 2021-02-04 21:29:38 +0000 loader.efi: There are systems without ConOut, also use ConOutDev Conout does contian the default output device name. ConOutDev does contain all possible output device names, so we can use it as fallback, when there is no ConOut. PR: 253253 --- stand/efi/loader/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index ca41cd4a2610..32b278950745 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -735,6 +735,8 @@ parse_uefi_con_out(void) how = 0; sz = sizeof(buf); rv = efi_global_getenv("ConOut", buf, &sz); + if (rv != EFI_SUCCESS) + rv = efi_global_getenv("ConOutDev", buf, &sz); if (rv != EFI_SUCCESS) { /* If we don't have any ConOut default to serial */ how = RB_SERIAL; From owner-dev-commits-src-all@freebsd.org Thu Feb 4 21:34: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 34E3F52FF17; Thu, 4 Feb 2021 21:34: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 4DWsJD151dz3CL5; Thu, 4 Feb 2021 21:34: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 1815A12E74; Thu, 4 Feb 2021 21:34: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 114LYKME029526; Thu, 4 Feb 2021 21:34:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114LYKEp029525; Thu, 4 Feb 2021 21:34:20 GMT (envelope-from git) Date: Thu, 4 Feb 2021 21:34:20 GMT Message-Id: <202102042134.114LYKEp029525@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: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev 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: 0c839497c174e961fc71f7d3329d05b10ec5525b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:34:20 -0000 The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=0c839497c174e961fc71f7d3329d05b10ec5525b commit 0c839497c174e961fc71f7d3329d05b10ec5525b Author: Toomas Soome AuthorDate: 2021-02-04 20:49:02 +0000 Commit: Toomas Soome CommitDate: 2021-02-04 21:33:15 +0000 loader.efi: There are systems without ConOut, also use ConOutDev Conout does contian the default output device name. ConOutDev does contain all possible output device names, so we can use it as fallback, when there is no ConOut. PR: 253253 (cherry picked from commit 2bd4ff2d8911009283e4e615ca4aad35a845f48b) --- stand/efi/loader/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index ca41cd4a2610..32b278950745 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -735,6 +735,8 @@ parse_uefi_con_out(void) how = 0; sz = sizeof(buf); rv = efi_global_getenv("ConOut", buf, &sz); + if (rv != EFI_SUCCESS) + rv = efi_global_getenv("ConOutDev", buf, &sz); if (rv != EFI_SUCCESS) { /* If we don't have any ConOut default to serial */ how = RB_SERIAL; From owner-dev-commits-src-all@freebsd.org Thu Feb 4 22:34: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 DD0FE5312C0; Thu, 4 Feb 2021 22:34: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 4DWtf25sChz3Gmn; Thu, 4 Feb 2021 22:34: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 BBFEB13CC2; Thu, 4 Feb 2021 22:34: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 114MYovG007460; Thu, 4 Feb 2021 22:34:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114MYoY5007457; Thu, 4 Feb 2021 22:34:50 GMT (envelope-from git) Date: Thu, 4 Feb 2021 22:34:50 GMT Message-Id: <202102042234.114MYoY5007457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 87cefd5c3dc6 - stable/13 - MFC eb0b1b33: Enable multipath routing by default. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 87cefd5c3dc6e52609be1b01087b33511f1d16a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:34:50 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=87cefd5c3dc6e52609be1b01087b33511f1d16a8 commit 87cefd5c3dc6e52609be1b01087b33511f1d16a8 Author: Alexander V. Chernikov AuthorDate: 2021-02-03 08:49:46 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-04 22:17:17 +0000 MFC eb0b1b33: Enable multipath routing by default. ROUTE_MPATH was added to the GENERIC kernel in r368648. According to the plan in D27428, it was enabled with `net.route.multipath` sysctl set to 0. Given enough time has passed, this change enables route multipath by default. The goal is to ship FreeBSD 13 with multipath turned on. Reviewed By: donner, olivier Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28423 --- sys/net/route/route_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index 230d23845c64..955b1df9029f 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -101,7 +101,7 @@ SYSCTL_DECL(_net_route); #else #define _MP_FLAGS CTLFLAG_RD #endif -VNET_DEFINE(u_int, rib_route_multipath) = 0; +VNET_DEFINE(u_int, rib_route_multipath) = 1; SYSCTL_UINT(_net_route, OID_AUTO, multipath, _MP_FLAGS | CTLFLAG_VNET, &VNET_NAME(rib_route_multipath), 0, "Enable route multipath"); #undef _MP_FLAGS From owner-dev-commits-src-all@freebsd.org Thu Feb 4 22:34: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 06B1D53149B; Thu, 4 Feb 2021 22:34: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 4DWtf36qL9z3H0S; Thu, 4 Feb 2021 22:34: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 DD02513E21; Thu, 4 Feb 2021 22:34: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 114MYp2R007480; Thu, 4 Feb 2021 22:34:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114MYpAI007479; Thu, 4 Feb 2021 22:34:51 GMT (envelope-from git) Date: Thu, 4 Feb 2021 22:34:51 GMT Message-Id: <202102042234.114MYpAI007479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 8efe1ef1c741 - stable/13 - MFC 53729367d388: Fix subinterface vlan creation. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8efe1ef1c7415c17899e6d1b5e1984bb3a95c55b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:34:52 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=8efe1ef1c7415c17899e6d1b5e1984bb3a95c55b commit 8efe1ef1c7415c17899e6d1b5e1984bb3a95c55b Author: Alexander V. Chernikov AuthorDate: 2021-01-26 07:22:23 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-04 22:21:00 +0000 MFC 53729367d388: Fix subinterface vlan creation. D26436 introduced support for stacked vlans that changed the way vlans are configured. In particular, this change broke setups that have same-number vlans as subinterfaces. Vlan support was initially created assuming "vlanX" semantics. In this paradigm, automatic number assignment supported by cloning (ifconfig vlan create) was a natural fit. When "ifaceX.Y" support was added, allowing to have the same vlan number on multiple devices, cloning code became more complex, as the is no unified "vlan" namespace anymore. Such interfaces got the first spare index from "vlan" cloner. This, in turn, led to the following problem: ifconfig ix0.333 create -> index 1 ifconfig ix0.444 create -> index 2 ifconfig vlan2 create -> allocation failure This change fixes such allocations by using cloning indexes only for "vlanX" interfaces. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D27505 --- sys/net/if_clone.c | 7 +++-- sys/net/if_vlan.c | 75 +++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 54 insertions(+), 28 deletions(-) diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index a55ce9c3005d..a98e43328e0c 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -571,7 +571,7 @@ if_clone_addgroup(struct ifnet *ifp, struct if_clone *ifc) /* * A utility function to extract unit numbers from interface names of - * the form name###[.###]. + * the form name###. * * Returns 0 on success and an error on failure. */ @@ -582,9 +582,8 @@ ifc_name2unit(const char *name, int *unit) int cutoff = INT_MAX / 10; int cutlim = INT_MAX % 10; - if ((cp = strrchr(name, '.')) == NULL) - cp = name; - for (; *cp != '\0' && (*cp < '0' || *cp > '9'); cp++); + for (cp = name; *cp != '\0' && (*cp < '0' || *cp > '9'); cp++) + ; if (*cp == '\0') { *unit = -1; } else if (cp[0] == '0' && cp[1] != '\0') { diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 9358724844cb..26fb48257c11 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -977,63 +977,86 @@ static int vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) { char *dp; - int wildcard; + bool wildcard = false; + bool subinterface = false; int unit; int error; - int vid; - uint16_t proto; + int vid = 0; + uint16_t proto = ETHERTYPE_VLAN; struct ifvlan *ifv; struct ifnet *ifp; - struct ifnet *p; + struct ifnet *p = NULL; struct ifaddr *ifa; struct sockaddr_dl *sdl; struct vlanreq vlr; static const u_char eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ - proto = ETHERTYPE_VLAN; /* - * There are two ways to specify the cloned device: + * There are three ways to specify the cloned device: * o pass a parameter block with the clone request. + * o specify parameters in the text of the clone device name * o specify no parameters and get an unattached device that * must be configured separately. - * The first technique is preferred; the latter is supported + * The first technique is preferred; the latter two are supported * for backwards compatibility. * * XXXRW: Note historic use of the word "tag" here. New ioctls may be * called for. */ + if (params) { error = copyin(params, &vlr, sizeof(vlr)); if (error) return error; + vid = vlr.vlr_tag; + proto = vlr.vlr_proto; + p = ifunit_ref(vlr.vlr_parent); if (p == NULL) return (ENXIO); - error = ifc_name2unit(name, &unit); - if (error != 0) { - if_rele(p); - return (error); - } - vid = vlr.vlr_tag; - proto = vlr.vlr_proto; - wildcard = (unit < 0); - } else { - p = NULL; - error = ifc_name2unit(name, &unit); - if (error != 0) - return (error); + } + + if ((error = ifc_name2unit(name, &unit)) == 0) { + /* + * vlanX interface. Set wildcard to true if the unit number + * is not fixed (-1) + */ wildcard = (unit < 0); + } else { + struct ifnet *p_tmp = vlan_clone_match_ethervid(name, &vid); + if (p_tmp != NULL) { + error = 0; + subinterface = true; + unit = IF_DUNIT_NONE; + wildcard = false; + if (p != NULL) { + if_rele(p_tmp); + if (p != p_tmp) + error = EINVAL; + } else + p = p_tmp; + } else + error = ENXIO; } - error = ifc_alloc_unit(ifc, &unit); if (error != 0) { if (p != NULL) if_rele(p); return (error); } + if (!subinterface) { + /* vlanX interface, mark X as busy or allocate new unit # */ + error = ifc_alloc_unit(ifc, &unit); + if (error != 0) { + if (p != NULL) + if_rele(p); + return (error); + } + } + /* In the wildcard case, we need to update the name. */ if (wildcard) { for (dp = name; *dp != '\0'; dp++); @@ -1046,7 +1069,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifv = malloc(sizeof(struct ifvlan), M_VLAN, M_WAITOK | M_ZERO); ifp = ifv->ifv_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - ifc_free_unit(ifc, unit); + if (!subinterface) + ifc_free_unit(ifc, unit); free(ifv, M_VLAN); if (p != NULL) if_rele(p); @@ -1094,7 +1118,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ether_ifdetach(ifp); vlan_unconfig(ifp); if_free(ifp); - ifc_free_unit(ifc, unit); + if (!subinterface) + ifc_free_unit(ifc, unit); free(ifv, M_VLAN); return (error); @@ -1108,6 +1133,7 @@ static int vlan_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) { struct ifvlan *ifv = ifp->if_softc; + int unit = ifp->if_dunit; if (ifp->if_vlantrunk) return (EBUSY); @@ -1123,7 +1149,8 @@ vlan_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) NET_EPOCH_WAIT(); if_free(ifp); free(ifv, M_VLAN); - ifc_free_unit(ifc, ifp->if_dunit); + if (unit != IF_DUNIT_NONE) + ifc_free_unit(ifc, unit); return (0); } From owner-dev-commits-src-all@freebsd.org Thu Feb 4 22:34: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 660FA5312C5; Thu, 4 Feb 2021 22:34: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 4DWtf515WMz3Gtn; Thu, 4 Feb 2021 22:34: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 0DA6313C23; Thu, 4 Feb 2021 22:34: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 114MYqOw007498; Thu, 4 Feb 2021 22:34:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114MYqmj007497; Thu, 4 Feb 2021 22:34:52 GMT (envelope-from git) Date: Thu, 4 Feb 2021 22:34:52 GMT Message-Id: <202102042234.114MYqmj007497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 88452cb15155 - stable/13 - MFC cb984c62d705: Fix multipath support for rib_lookup_info(). 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 88452cb1515550b5a9eb78ed2d88c97d09a57ee4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:34:53 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=88452cb1515550b5a9eb78ed2d88c97d09a57ee4 commit 88452cb1515550b5a9eb78ed2d88c97d09a57ee4 Author: Alexander V. Chernikov AuthorDate: 2021-01-29 23:10:52 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-04 22:33:20 +0000 MFC cb984c62d705: Fix multipath support for rib_lookup_info(). The initial plan was to remove rib_lookup_info() before FreeBSD 13. As several customers are still remaining, fix rib_lookup_info() for the multipath use case. --- sys/net/route.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sys/net/route.c b/sys/net/route.c index 7e087569d45f..a68e46c37861 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -79,8 +79,8 @@ EVENTHANDLER_LIST_DEFINE(rt_addrmsg); static int rt_ifdelroute(const struct rtentry *rt, const struct nhop_object *, void *arg); -static int rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, - int flags); +static int rt_exportinfo(struct rtentry *rt, struct nhop_object *nh, + struct rt_addrinfo *info, int flags); /* * route initialization must occur before ip6_init2(), which happenas at @@ -330,15 +330,14 @@ ifa_ifwithroute(int flags, const struct sockaddr *dst, * * Returns 0 on success. */ -int -rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, int flags) +static int +rt_exportinfo(struct rtentry *rt, struct nhop_object *nh, + struct rt_addrinfo *info, int flags) { struct rt_metrics *rmx; struct sockaddr *src, *dst; - struct nhop_object *nh; int sa_len; - nh = rt->rt_nhop; if (flags & NHR_COPY) { /* Copy destination if dst is non-zero */ src = rt_key(rt); @@ -424,6 +423,7 @@ rib_lookup_info(uint32_t fibnum, const struct sockaddr *dst, uint32_t flags, struct rib_head *rh; struct radix_node *rn; struct rtentry *rt; + struct nhop_object *nh; int error; KASSERT((fibnum < rt_numfibs), ("rib_lookup_rte: bad fibnum")); @@ -435,10 +435,11 @@ rib_lookup_info(uint32_t fibnum, const struct sockaddr *dst, uint32_t flags, rn = rh->rnh_matchaddr(__DECONST(void *, dst), &rh->head); if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { rt = RNTORT(rn); + nh = nhop_select(rt->rt_nhop, flowid); /* Ensure route & ifp is UP */ - if (RT_LINK_IS_UP(rt->rt_nhop->nh_ifp)) { + if (RT_LINK_IS_UP(nh->nh_ifp)) { flags = (flags & NHR_REF) | NHR_COPY; - error = rt_exportinfo(rt, info, flags); + error = rt_exportinfo(rt, nh, info, flags); RIB_RUNLOCK(rh); return (error); From owner-dev-commits-src-all@freebsd.org Thu Feb 4 22: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 4FCB453147F; Thu, 4 Feb 2021 22:34: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 4DWtf66WHCz3Gtt; Thu, 4 Feb 2021 22:34: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 5B00E13E22; Thu, 4 Feb 2021 22:34: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 114MYse3007517; Thu, 4 Feb 2021 22:34:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114MYsbr007516; Thu, 4 Feb 2021 22:34:54 GMT (envelope-from git) Date: Thu, 4 Feb 2021 22:34:54 GMT Message-Id: <202102042234.114MYsbr007516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 10977b9f8435 - stable/13 - MFC 91f2c69ec206: Fix unused-function waring when compiling with FIB_ALGO. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 10977b9f84352c7312a192e99f03dc155db79c54 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:34:57 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=10977b9f84352c7312a192e99f03dc155db79c54 commit 10977b9f84352c7312a192e99f03dc155db79c54 Author: Alexander V. Chernikov AuthorDate: 2021-01-30 23:24:26 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-04 22:33:53 +0000 MFC 91f2c69ec206: Fix unused-function waring when compiling with FIB_ALGO. --- sys/netinet6/in6_fib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet6/in6_fib.c b/sys/netinet6/in6_fib.c index 3fbddbc28e3d..614f8111409a 100644 --- a/sys/netinet6/in6_fib.c +++ b/sys/netinet6/in6_fib.c @@ -218,6 +218,7 @@ check_urpf(struct nhop_object *nh, uint32_t flags, return (check_urpf_nhop(nh, flags, src_if)); } +#ifndef FIB_ALGO static struct nhop_object * lookup_nhop(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid) @@ -251,6 +252,7 @@ lookup_nhop(uint32_t fibnum, const struct in6_addr *dst6, return (nh); } +#endif /* * Performs reverse path forwarding lookup. From owner-dev-commits-src-all@freebsd.org Thu Feb 4 22:34: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 3DB9053158E; Thu, 4 Feb 2021 22:34: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 4DWtf80wTtz3Gps; Thu, 4 Feb 2021 22:34: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 B1D6E13CC3; Thu, 4 Feb 2021 22:34: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 114MYt91007537; Thu, 4 Feb 2021 22:34:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114MYtPD007536; Thu, 4 Feb 2021 22:34:55 GMT (envelope-from git) Date: Thu, 4 Feb 2021 22:34:55 GMT Message-Id: <202102042234.114MYtPD007536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 74216f4caef2 - stable/13 - MFC f8b7ebea4905: Improve fib_algo debug messages. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 74216f4caef2a4772c2903a04ac2843278fe00a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:34:59 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=74216f4caef2a4772c2903a04ac2843278fe00a8 commit 74216f4caef2a4772c2903a04ac2843278fe00a8 Author: Alexander V. Chernikov AuthorDate: 2021-01-30 22:06:40 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-04 22:34:15 +0000 MFC f8b7ebea4905: Improve fib_algo debug messages. * Move per-prefix debug lines under LOG_DEBUG2 * Create fib instance counter to distingush log messages between instances * Add more messages on rebuild reason. MFC after: 3 days --- sys/net/route/fib_algo.c | 62 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index b84217034e16..1f040ad259c5 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -118,6 +118,9 @@ SYSCTL_NODE(_net_route_algo, OID_AUTO, inet, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "IPv4 longest prefix match lookups"); #endif +/* Fib instance counter */ +static uint32_t fib_gen = 0; + struct nhop_ref_table { uint32_t count; int32_t refcnt[0]; @@ -137,7 +140,7 @@ struct fib_data { uint8_t fd_family; /* family */ uint32_t fd_fibnum; /* fibnum */ uint32_t fd_failed_rebuilds; /* stat: failed rebuilds */ - uint32_t fd_algo_mask; /* bitmask for algo data */ + uint32_t fd_gen; /* instance gen# */ struct callout fd_callout; /* rebuild callout */ void *fd_algo_data; /* algorithm data */ struct nhop_object **nh_idx; /* nhop idx->ptr array */ @@ -191,12 +194,15 @@ static int flm_debug_level = LOG_NOTICE; SYSCTL_INT(_net_route_algo, OID_AUTO, debug_level, CTLFLAG_RW | CTLFLAG_RWTUN, &flm_debug_level, 0, "debuglevel"); #define FLM_MAX_DEBUG_LEVEL LOG_DEBUG +#ifndef LOG_DEBUG2 +#define LOG_DEBUG2 8 +#endif #define _PASS_MSG(_l) (flm_debug_level >= (_l)) #define ALGO_PRINTF(_fmt, ...) printf("[fib_algo] %s: " _fmt "\n", __func__, ##__VA_ARGS__) -#define _ALGO_PRINTF(_fib, _fam, _aname, _func, _fmt, ...) \ - printf("[fib_algo] %s.%u (%s) %s: " _fmt "\n",\ - print_family(_fam), _fib, _aname, _func, ## __VA_ARGS__) +#define _ALGO_PRINTF(_fib, _fam, _aname, _gen, _func, _fmt, ...) \ + printf("[fib_algo] %s.%u (%s#%u) %s: " _fmt "\n",\ + print_family(_fam), _fib, _aname, _gen, _func, ## __VA_ARGS__) #define _RH_PRINTF(_fib, _fam, _func, _fmt, ...) \ printf("[fib_algo] %s.%u %s: " _fmt "\n", print_family(_fam), _fib, _func, ## __VA_ARGS__) #define RH_PRINTF(_l, _rh, _fmt, ...) if (_PASS_MSG(_l)) { \ @@ -205,8 +211,13 @@ SYSCTL_INT(_net_route_algo, OID_AUTO, debug_level, CTLFLAG_RW | CTLFLAG_RWTUN, #define FD_PRINTF(_l, _fd, _fmt, ...) FD_PRINTF_##_l(_l, _fd, _fmt, ## __VA_ARGS__) #define _FD_PRINTF(_l, _fd, _fmt, ...) if (_PASS_MSG(_l)) { \ _ALGO_PRINTF(_fd->fd_fibnum, _fd->fd_family, _fd->fd_flm->flm_name, \ - __func__, _fmt, ## __VA_ARGS__); \ + _fd->fd_gen, __func__, _fmt, ## __VA_ARGS__); \ } +#if FLM_MAX_DEBUG_LEVEL>=LOG_DEBUG2 +#define FD_PRINTF_LOG_DEBUG2 _FD_PRINTF +#else +#define FD_PRINTF_LOG_DEBUG2(_l, _fd, _fmt, ...) +#endif #if FLM_MAX_DEBUG_LEVEL>=LOG_DEBUG #define FD_PRINTF_LOG_DEBUG _FD_PRINTF #else @@ -371,7 +382,7 @@ fib_printf(int level, struct fib_data *fd, const char *func, char *fmt, ...) va_end(ap); _ALGO_PRINTF(fd->fd_fibnum, fd->fd_family, fd->fd_flm->flm_name, - func, "%s", buf); + fd->fd_gen, func, "%s", buf); } /* @@ -450,7 +461,7 @@ schedule_callout(struct fib_data *fd, int delay_ms) } static void -schedule_fd_rebuild(struct fib_data *fd) +schedule_fd_rebuild(struct fib_data *fd, const char *reason) { FIB_MOD_LOCK(); @@ -461,7 +472,8 @@ schedule_fd_rebuild(struct fib_data *fd) * Potentially re-schedules pending callout * initiated by schedule_algo_eval. */ - FD_PRINTF(LOG_INFO, fd, "Scheduling rebuilt"); + FD_PRINTF(LOG_INFO, fd, "Scheduling rebuild: %s (failures=%d)", + reason, fd->fd_failed_rebuilds); schedule_callout(fd, callout_calc_delay_ms(fd)); } FIB_MOD_UNLOCK(); @@ -527,7 +539,7 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, if (rc->rc_nh_new != NULL) { if (fib_ref_nhop(fd, rc->rc_nh_new) == 0) { /* ran out of indexes */ - schedule_fd_rebuild(fd); + schedule_fd_rebuild(fd, "ran out of nhop indexes"); return; } } @@ -546,7 +558,7 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, * Algo is not able to apply the update. * Schedule algo rebuild. */ - schedule_fd_rebuild(fd); + schedule_fd_rebuild(fd, "algo requested rebuild"); break; case FLM_ERROR: @@ -558,7 +570,7 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, FD_PRINTF(LOG_ERR, fd, "algo reported non-recoverable error"); if (!flm_error_add(fd->fd_flm, fd->fd_fibnum)) FD_PRINTF(LOG_ERR, fd, "failed to ban algo"); - schedule_fd_rebuild(fd); + schedule_fd_rebuild(fd, "algo reported non-recoverable error"); } } @@ -667,8 +679,9 @@ sync_algo(struct fib_data *fd) rib_walk_ext_internal(fd->fd_rh, true, sync_algo_cb, sync_algo_end_cb, &w); - FD_PRINTF(LOG_INFO, fd, "initial dump completed, result: %s", - print_op_result(w.result)); + FD_PRINTF(LOG_INFO, fd, + "initial dump completed (rtable version: %d), result: %s", + fd->fd_rh->rnh_gen, print_op_result(w.result)); return (w.result); } @@ -794,7 +807,7 @@ destroy_fd_instance(struct fib_data *fd) if ((fd->nh_idx != NULL) && (fd->nh_ref_table != NULL)) { for (int i = 0; i < fd->number_nhops; i++) { if (!is_idx_free(fd, i)) { - FD_PRINTF(LOG_DEBUG, fd, " FREE nhop %d %p", + FD_PRINTF(LOG_DEBUG2, fd, " FREE nhop %d %p", i, fd->nh_idx[i]); nhop_free_any(fd->nh_idx[i]); } @@ -845,6 +858,7 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, fd = malloc(sizeof(struct fib_data), M_RTABLE, M_NOWAIT | M_ZERO); if (fd == NULL) { *pfd = NULL; + RH_PRINTF(LOG_INFO, rh, "Unable to allocate fib_data structure"); return (FLM_REBUILD); } *pfd = fd; @@ -852,12 +866,15 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, estimate_nhop_scale(old_fd, fd); fd->fd_rh = rh; + fd->fd_gen = ++fib_gen; fd->fd_family = rh->rib_family; fd->fd_fibnum = rh->rib_fibnum; callout_init(&fd->fd_callout, 1); fd->fd_vnet = curvnet; fd->fd_flm = flm; + FD_PRINTF(LOG_DEBUG, fd, "allocated fd %p", fd); + FIB_MOD_LOCK(); flm->flm_refcount++; FIB_MOD_UNLOCK(); @@ -883,21 +900,27 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, /* Okay, we're ready for algo init */ void *old_algo_data = (old_fd != NULL) ? old_fd->fd_algo_data : NULL; result = flm->flm_init_cb(fd->fd_fibnum, fd, old_algo_data, &fd->fd_algo_data); - if (result != FLM_SUCCESS) + if (result != FLM_SUCCESS) { + FD_PRINTF(LOG_INFO, fd, "%s algo init failed", flm->flm_name); return (result); + } /* Try to subscribe */ if (flm->flm_change_rib_item_cb != NULL) { fd->fd_rs = rib_subscribe_internal(fd->fd_rh, handle_rtable_change_cb, fd, RIB_NOTIFY_IMMEDIATE, 0); - if (fd->fd_rs == NULL) + if (fd->fd_rs == NULL) { + FD_PRINTF(LOG_INFO, fd, "failed to subscribe to the rib changes"); return (FLM_REBUILD); + } } /* Dump */ result = sync_algo(fd); - if (result != FLM_SUCCESS) + if (result != FLM_SUCCESS) { + FD_PRINTF(LOG_INFO, fd, "rib sync failed"); return (result); + } FD_PRINTF(LOG_INFO, fd, "DUMP completed successfully."); FIB_MOD_LOCK(); @@ -953,6 +976,9 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, } if (result != FLM_SUCCESS) { + RH_PRINTF(LOG_WARNING, rh, + "%s algo instance setup failed, failures=%d", flm->flm_name, + orig_fd ? orig_fd->fd_failed_rebuilds + 1 : 0); /* update failure count */ FIB_MOD_LOCK(); if (orig_fd != NULL) @@ -1370,7 +1396,7 @@ fib_ref_nhop(struct fib_data *fd, struct nhop_object *nh) nhop_ref_any(nh); fd->nh_idx[idx] = nh; fd->nh_ref_table->count++; - FD_PRINTF(LOG_DEBUG, fd, " REF nhop %u %p", idx, fd->nh_idx[idx]); + FD_PRINTF(LOG_DEBUG2, fd, " REF nhop %u %p", idx, fd->nh_idx[idx]); } fd->nh_ref_table->refcnt[idx]++; From owner-dev-commits-src-all@freebsd.org Thu Feb 4 22:35: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 9B149531331; Thu, 4 Feb 2021 22:35: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 4DWtfC2pFtz3GsQ; Thu, 4 Feb 2021 22:34: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 A462D13EA9; Thu, 4 Feb 2021 22:34: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 114MYuE5007555; Thu, 4 Feb 2021 22:34:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114MYu5E007554; Thu, 4 Feb 2021 22:34:56 GMT (envelope-from git) Date: Thu, 4 Feb 2021 22:34:56 GMT Message-Id: <202102042234.114MYu5E007554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: f5f50ec15688 - stable/13 - MFC ab6d9aaed76e: Move business logic from rebuild_fd_callout() into rebuild_fd(). 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f5f50ec15688d6aab67d3fb8fb0c98b89e4dbce0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:35:01 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=f5f50ec15688d6aab67d3fb8fb0c98b89e4dbce0 commit f5f50ec15688d6aab67d3fb8fb0c98b89e4dbce0 Author: Alexander V. Chernikov AuthorDate: 2021-01-30 22:32:42 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-04 22:34:15 +0000 MFC ab6d9aaed76e: Move business logic from rebuild_fd_callout() into rebuild_fd(). This simplifies code a bit and allows for future non-callout callers to request rebuild. --- sys/net/route/fib_algo.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 1f040ad259c5..f7a8b3f82431 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -155,6 +155,7 @@ struct fib_data { TAILQ_ENTRY(fib_data) entries; /* list of all fds in vnet */ }; +static bool rebuild_fd(struct fib_data *fd); static void rebuild_fd_callout(void *_data); static void destroy_fd_instance_epoch(epoch_context_t ctx); static enum flm_op_result attach_datapath(struct fib_data *fd); @@ -1011,13 +1012,28 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, static void rebuild_fd_callout(void *_data) { - struct fib_data *fd, *fd_new, *fd_tmp; + struct fib_data *fd = (struct fib_data *)_data; + + FD_PRINTF(LOG_INFO, fd, "running callout rebuild"); + + CURVNET_SET(fd->fd_vnet); + rebuild_fd(fd); + CURVNET_RESTORE(); +} + +/* + * Tries to create new algo instance based on @fd data. + * Returns true on success. + */ +static bool +rebuild_fd(struct fib_data *fd) +{ + struct fib_data *fd_new, *fd_tmp; struct fib_lookup_module *flm_new = NULL; struct epoch_tracker et; enum flm_op_result result; bool need_rebuild = false; - fd = (struct fib_data *)_data; FIB_MOD_LOCK(); need_rebuild = fd->fd_need_rebuild; @@ -1026,15 +1042,12 @@ rebuild_fd_callout(void *_data) fd->fd_num_changes = 0; FIB_MOD_UNLOCK(); - CURVNET_SET(fd->fd_vnet); - /* First, check if we're still OK to use this algo */ if (!is_algo_fixed(fd->fd_rh)) flm_new = fib_check_best_algo(fd->fd_rh, fd->fd_flm); if ((flm_new == NULL) && (!need_rebuild)) { /* Keep existing algo, no need to rebuild. */ - CURVNET_RESTORE(); - return; + return (true); } if (flm_new == NULL) { @@ -1051,19 +1064,16 @@ rebuild_fd_callout(void *_data) } if (result != FLM_SUCCESS) { FD_PRINTF(LOG_NOTICE, fd, "table rebuild failed"); - CURVNET_RESTORE(); - return; + return (false); } FD_PRINTF(LOG_INFO, fd_new, "switched to new instance"); - /* Remove old instance removal */ - if (fd != NULL) { - NET_EPOCH_ENTER(et); - schedule_destroy_fd_instance(fd, true); - NET_EPOCH_EXIT(et); - } + /* Remove old instance */ + NET_EPOCH_ENTER(et); + schedule_destroy_fd_instance(fd, true); + NET_EPOCH_EXIT(et); - CURVNET_RESTORE(); + return (true); } /* From owner-dev-commits-src-all@freebsd.org Thu Feb 4 22:35: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 9825D5311BF; Thu, 4 Feb 2021 22:35: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 4DWtfD0mGJz3Gy1; Thu, 4 Feb 2021 22:35: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 BDB0113FF7; Thu, 4 Feb 2021 22:34: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 114MYwOC007595; Thu, 4 Feb 2021 22:34:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114MYwDq007594; Thu, 4 Feb 2021 22:34:58 GMT (envelope-from git) Date: Thu, 4 Feb 2021 22:34:58 GMT Message-Id: <202102042234.114MYwDq007594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 6bc5d49aba14 - stable/13 - MFC 151ec796a230: Fix the design problem with delayed algorithm sync. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6bc5d49aba14c6ce102d4392cd53bcdf8b61c2fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:35:01 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6bc5d49aba14c6ce102d4392cd53bcdf8b61c2fc commit 6bc5d49aba14c6ce102d4392cd53bcdf8b61c2fc Author: Alexander V. Chernikov AuthorDate: 2021-01-30 22:45:46 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-04 22:34:15 +0000 MFC 151ec796a230: Fix the design problem with delayed algorithm sync. Currently, if the immutable algorithm like bsearch or radix_lockless receives rtable update notification, it schedules algorithm rebuild. This rebuild is executed by the callout after ~50 milliseconds. It is possible that a script adding an interface address and than route with the gateway bound to that address will fail. It can happen due to the fact that fib is not updated by the time the route addition request arrives. Fix this by allowing synchronous algorithm rebuilds based on certain conditions. By default, these conditions assume: 1) less than net.route.algo.fib_sync_limit=100 routes 2) routes without gateway. * Move algo instance build entirely under rib WLOCK. Rib lock is only used for control plane (except radix algo, but there are no rebuilds). * Add rib_walk_ext_locked() function to allow RIB iteration with rib lock already held. * Fix rare potential callout use-after-free for fds by binding fd callout to the relevant rib rmlock. In that case, callout_stop() under rib WLOCK guarantees no callout will be executed afterwards. --- sys/net/route/fib_algo.c | 110 ++++++++++++++++++++++++++++-------------- sys/net/route/route_ctl.h | 2 + sys/net/route/route_helpers.c | 17 +++++-- 3 files changed, 87 insertions(+), 42 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index f7a8b3f82431..21b6ba924069 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -105,6 +105,11 @@ SYSCTL_DECL(_net_route); SYSCTL_NODE(_net_route, OID_AUTO, algo, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Fib algorithm lookups"); +VNET_DEFINE(int, fib_sync_limit) = 100; +#define V_fib_sync_limit VNET(fib_sync_limit) +SYSCTL_INT(_net_route_algo, OID_AUTO, fib_sync_limit, CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(fib_sync_limit), 0, "Guarantee synchronous fib till route limit"); + #ifdef INET6 VNET_DEFINE_STATIC(bool, algo_fixed_inet6) = false; #define V_algo_fixed_inet6 VNET(algo_fixed_inet6) @@ -465,7 +470,8 @@ static void schedule_fd_rebuild(struct fib_data *fd, const char *reason) { - FIB_MOD_LOCK(); + RIB_WLOCK_ASSERT(fd->fd_rh); + if (!fd->fd_need_rebuild) { fd->fd_need_rebuild = true; @@ -477,30 +483,52 @@ schedule_fd_rebuild(struct fib_data *fd, const char *reason) reason, fd->fd_failed_rebuilds); schedule_callout(fd, callout_calc_delay_ms(fd)); } - FIB_MOD_UNLOCK(); } static void schedule_algo_eval(struct fib_data *fd) { + RIB_WLOCK_ASSERT(fd->fd_rh); + if (fd->fd_num_changes++ == 0) { /* Start callout to consider switch */ - FIB_MOD_LOCK(); if (!callout_pending(&fd->fd_callout)) schedule_callout(fd, ALGO_EVAL_DELAY_MS); - FIB_MOD_UNLOCK(); } else if (fd->fd_num_changes > ALGO_EVAL_NUM_ROUTES && !fd->fd_force_eval) { /* Reset callout to exec immediately */ - FIB_MOD_LOCK(); if (!fd->fd_need_rebuild) { fd->fd_force_eval = true; schedule_callout(fd, 1); } - FIB_MOD_UNLOCK(); } } +static bool +need_immediate_rebuild(struct fib_data *fd, struct rib_cmd_info *rc) +{ + struct nhop_object *nh; + + if ((V_fib_sync_limit == 0) || (fd->fd_rh->rnh_prefixes <= V_fib_sync_limit)) + return (true); + + /* Sync addition/removal of interface routes */ + switch (rc->rc_cmd) { + case RTM_ADD: + nh = rc->rc_nh_new; + if (!NH_IS_NHGRP(nh) && (!(nh->nh_flags & NHF_GATEWAY))) + return (true); + break; + case RTM_DELETE: + nh = rc->rc_nh_old; + if (!NH_IS_NHGRP(nh) && (!(nh->nh_flags & NHF_GATEWAY))) + return (true); + break; + } + + return (false); +} + /* * Rib subscription handler. Checks if the algorithm is ready to * receive updates, handles nexthop refcounting and passes change @@ -559,7 +587,15 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, * Algo is not able to apply the update. * Schedule algo rebuild. */ - schedule_fd_rebuild(fd, "algo requested rebuild"); + if (!need_immediate_rebuild(fd, rc)) { + schedule_fd_rebuild(fd, "algo requested rebuild"); + break; + } + + fd->fd_need_rebuild = true; + FD_PRINTF(LOG_INFO, fd, "running sync rebuild"); + if (!rebuild_fd(fd)) + schedule_fd_rebuild(fd, "sync rebuild failed"); break; case FLM_ERROR: @@ -678,7 +714,7 @@ sync_algo(struct fib_data *fd) .result = FLM_SUCCESS, }; - rib_walk_ext_internal(fd->fd_rh, true, sync_algo_cb, sync_algo_end_cb, &w); + rib_walk_ext_locked(fd->fd_rh, sync_algo_cb, sync_algo_end_cb, &w); FD_PRINTF(LOG_INFO, fd, "initial dump completed (rtable version: %d), result: %s", @@ -702,6 +738,7 @@ schedule_destroy_fd_instance(struct fib_data *fd, bool in_callout) bool is_dead; NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(fd->fd_rh); FIB_MOD_LOCK(); is_dead = fd->fd_dead; @@ -718,27 +755,13 @@ schedule_destroy_fd_instance(struct fib_data *fd, bool in_callout) FD_PRINTF(LOG_INFO, fd, "DETACH"); if (fd->fd_rs != NULL) - rib_unsibscribe(fd->fd_rs); + rib_unsibscribe_locked(fd->fd_rs); /* * After rib_unsubscribe() no _new_ handle_rtable_change_cb() calls * will be executed, hence no _new_ callout schedules will happen. - * - * There can be 2 possible scenarious here: - * 1) we're running inside a callout when we're deleting ourselves - * due to migration to a newer fd - * 2) we're running from rt_table_destroy() and callout is scheduled - * for execution OR is executing - * - * For (2) we need to wait for the callout termination, as the routing table - * will be destroyed after this function returns. - * For (1) we cannot call drain, but can ensure that this is the last invocation. */ - - if (in_callout) - callout_stop(&fd->fd_callout); - else - callout_drain(&fd->fd_callout); + callout_stop(&fd->fd_callout); epoch_call(net_epoch_preempt, destroy_fd_instance_epoch, &fd->fd_epoch_ctx); @@ -774,7 +797,11 @@ fib_cleanup_algo(struct rib_head *rh, bool keep_first, bool in_callout) /* Pass 2: remove each entry */ NET_EPOCH_ENTER(et); TAILQ_FOREACH_SAFE(fd, &tmp_head, entries, fd_tmp) { + if (!in_callout) + RIB_WLOCK(fd->fd_rh); schedule_destroy_fd_instance(fd, in_callout); + if (!in_callout) + RIB_WUNLOCK(fd->fd_rh); } NET_EPOCH_EXIT(et); } @@ -870,7 +897,7 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, fd->fd_gen = ++fib_gen; fd->fd_family = rh->rib_family; fd->fd_fibnum = rh->rib_fibnum; - callout_init(&fd->fd_callout, 1); + callout_init_rm(&fd->fd_callout, &rh->rib_lock, 0); fd->fd_vnet = curvnet; fd->fd_flm = flm; @@ -908,8 +935,8 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, /* Try to subscribe */ if (flm->flm_change_rib_item_cb != NULL) { - fd->fd_rs = rib_subscribe_internal(fd->fd_rh, - handle_rtable_change_cb, fd, RIB_NOTIFY_IMMEDIATE, 0); + fd->fd_rs = rib_subscribe_locked(fd->fd_rh, + handle_rtable_change_cb, fd, RIB_NOTIFY_IMMEDIATE); if (fd->fd_rs == NULL) { FD_PRINTF(LOG_INFO, fd, "failed to subscribe to the rib changes"); return (FLM_REBUILD); @@ -946,13 +973,14 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, struct fib_data *orig_fd, struct fib_data **pfd, bool attach) { struct fib_data *prev_fd, *new_fd; - struct epoch_tracker et; enum flm_op_result result; + NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(rh); + prev_fd = orig_fd; new_fd = NULL; for (int i = 0; i < FIB_MAX_TRIES; i++) { - NET_EPOCH_ENTER(et); result = try_setup_fd_instance(flm, rh, prev_fd, &new_fd); if ((result == FLM_SUCCESS) && attach) @@ -962,7 +990,6 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, schedule_destroy_fd_instance(prev_fd, false); prev_fd = NULL; } - NET_EPOCH_EXIT(et); RH_PRINTF(LOG_INFO, rh, "try %d: fib algo result: %s", i, print_op_result(result)); @@ -990,14 +1017,12 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, if (result == FLM_ERROR) flm_error_add(flm, rh->rib_fibnum); - NET_EPOCH_ENTER(et); if ((prev_fd != NULL) && (prev_fd != orig_fd)) schedule_destroy_fd_instance(prev_fd, false); if (new_fd != NULL) { schedule_destroy_fd_instance(new_fd, false); new_fd = NULL; } - NET_EPOCH_EXIT(et); } *pfd = new_fd; @@ -1013,12 +1038,15 @@ static void rebuild_fd_callout(void *_data) { struct fib_data *fd = (struct fib_data *)_data; + struct epoch_tracker et; FD_PRINTF(LOG_INFO, fd, "running callout rebuild"); + NET_EPOCH_ENTER(et); CURVNET_SET(fd->fd_vnet); rebuild_fd(fd); CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); } /* @@ -1030,17 +1058,16 @@ rebuild_fd(struct fib_data *fd) { struct fib_data *fd_new, *fd_tmp; struct fib_lookup_module *flm_new = NULL; - struct epoch_tracker et; enum flm_op_result result; bool need_rebuild = false; + NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(fd->fd_rh); - FIB_MOD_LOCK(); need_rebuild = fd->fd_need_rebuild; fd->fd_need_rebuild = false; fd->fd_force_eval = false; fd->fd_num_changes = 0; - FIB_MOD_UNLOCK(); /* First, check if we're still OK to use this algo */ if (!is_algo_fixed(fd->fd_rh)) @@ -1069,9 +1096,7 @@ rebuild_fd(struct fib_data *fd) FD_PRINTF(LOG_INFO, fd_new, "switched to new instance"); /* Remove old instance */ - NET_EPOCH_ENTER(et); schedule_destroy_fd_instance(fd, true); - NET_EPOCH_EXIT(et); return (true); } @@ -1116,6 +1141,7 @@ set_fib_algo(uint32_t fibnum, int family, struct sysctl_oid *oidp, struct sysctl char old_algo_name[32], algo_name[32]; struct rib_head *rh = NULL; enum flm_op_result result; + struct epoch_tracker et; int error; /* Fetch current algo/rib for af/family */ @@ -1149,7 +1175,11 @@ set_fib_algo(uint32_t fibnum, int family, struct sysctl_oid *oidp, struct sysctl } fd = NULL; + NET_EPOCH_ENTER(et); + RIB_WLOCK(rh); result = setup_fd_instance(flm, rh, NULL, &fd, true); + RIB_WUNLOCK(rh); + NET_EPOCH_EXIT(et); fib_unref_algo(flm); if (result != FLM_SUCCESS) return (EINVAL); @@ -1558,6 +1588,7 @@ fib_select_algo_initial(struct rib_head *rh) struct fib_lookup_module *flm; struct fib_data *fd = NULL; enum flm_op_result result; + struct epoch_tracker et; int error = 0; flm = fib_check_best_algo(rh, NULL); @@ -1567,7 +1598,12 @@ fib_select_algo_initial(struct rib_head *rh) } RH_PRINTF(LOG_INFO, rh, "selected algo %s", flm->flm_name); + NET_EPOCH_ENTER(et); + RIB_WLOCK(rh); result = setup_fd_instance(flm, rh, NULL, &fd, false); + RIB_WUNLOCK(rh); + NET_EPOCH_EXIT(et); + RH_PRINTF(LOG_DEBUG, rh, "result=%d fd=%p", result, fd); if (result == FLM_SUCCESS) { diff --git a/sys/net/route/route_ctl.h b/sys/net/route/route_ctl.h index bd256e9f0834..46dba759f8df 100644 --- a/sys/net/route/route_ctl.h +++ b/sys/net/route/route_ctl.h @@ -75,6 +75,8 @@ void rib_walk_ext(uint32_t fibnum, int af, bool wlock, rib_walktree_f_t *wa_f, rib_walk_hook_f_t *hook_f, void *arg); void rib_walk_ext_internal(struct rib_head *rnh, bool wlock, rib_walktree_f_t *wa_f, rib_walk_hook_f_t *hook_f, void *arg); +void rib_walk_ext_locked(struct rib_head *rnh, rib_walktree_f_t *wa_f, + rib_walk_hook_f_t *hook_f, void *arg); void rib_walk_del(u_int fibnum, int family, rib_filter_f_t *filter_f, void *arg, bool report); diff --git a/sys/net/route/route_helpers.c b/sys/net/route/route_helpers.c index 88733fff419b..782e160ca51b 100644 --- a/sys/net/route/route_helpers.c +++ b/sys/net/route/route_helpers.c @@ -67,6 +67,17 @@ __FBSDID("$FreeBSD$"); * RIB helper functions. */ +void +rib_walk_ext_locked(struct rib_head *rnh, rib_walktree_f_t *wa_f, + rib_walk_hook_f_t *hook_f, void *arg) +{ + if (hook_f != NULL) + hook_f(rnh, RIB_WALK_HOOK_PRE, arg); + rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f, arg); + if (hook_f != NULL) + hook_f(rnh, RIB_WALK_HOOK_POST, arg); +} + /* * Calls @wa_f with @arg for each entry in the table specified by * @af and @fibnum. @@ -86,11 +97,7 @@ rib_walk_ext_internal(struct rib_head *rnh, bool wlock, rib_walktree_f_t *wa_f, RIB_WLOCK(rnh); else RIB_RLOCK(rnh); - if (hook_f != NULL) - hook_f(rnh, RIB_WALK_HOOK_PRE, arg); - rnh->rnh_walktree(&rnh->head, (walktree_f_t *)wa_f, arg); - if (hook_f != NULL) - hook_f(rnh, RIB_WALK_HOOK_POST, arg); + rib_walk_ext_locked(rnh, wa_f, hook_f, arg); if (wlock) RIB_WUNLOCK(rnh); else From owner-dev-commits-src-all@freebsd.org Thu Feb 4 22:35: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 28571531332; Thu, 4 Feb 2021 22:35: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 4DWtfD0lmlz3GsS; Thu, 4 Feb 2021 22:35: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 B3ED913E23; Thu, 4 Feb 2021 22:34: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 114MYvI9007573; Thu, 4 Feb 2021 22:34:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114MYvk4007572; Thu, 4 Feb 2021 22:34:57 GMT (envelope-from git) Date: Thu, 4 Feb 2021 22:34:57 GMT Message-Id: <202102042234.114MYvk4007572@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 2a3cbb6c8954 - stable/13 - MFC dd9163003cb1: Add rib_subscribe_locked() and rib_unsubsribe_locked() to support subscriptions during RIB modifications. Add new subscriptions to the beginning of the lists instead of the end. This fixes the situation when new subscription is created int the callback for the existing subscription, leading to the subscription notification handler pick it. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a3cbb6c8954b71ee5bcd49cd2d05e41b960975d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:35:01 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=2a3cbb6c8954b71ee5bcd49cd2d05e41b960975d commit 2a3cbb6c8954b71ee5bcd49cd2d05e41b960975d Author: Alexander V. Chernikov AuthorDate: 2021-01-30 21:52:44 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-04 22:34:15 +0000 MFC dd9163003cb1: Add rib_subscribe_locked() and rib_unsubsribe_locked() to support subscriptions during RIB modifications. Add new subscriptions to the beginning of the lists instead of the end. This fixes the situation when new subscription is created int the callback for the existing subscription, leading to the subscription notification handler pick it. --- sys/net/route/route_ctl.c | 34 +++++++++++++++++++++++++++++++++- sys/net/route/route_ctl.h | 3 +++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index 955b1df9029f..6b0869196d12 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -1407,13 +1407,31 @@ rib_subscribe_internal(struct rib_head *rnh, rib_subscription_cb_t *f, void *arg NET_EPOCH_ENTER(et); RIB_WLOCK(rnh); - CK_STAILQ_INSERT_TAIL(&rnh->rnh_subscribers, rs, next); + CK_STAILQ_INSERT_HEAD(&rnh->rnh_subscribers, rs, next); RIB_WUNLOCK(rnh); NET_EPOCH_EXIT(et); return (rs); } +struct rib_subscription * +rib_subscribe_locked(struct rib_head *rnh, rib_subscription_cb_t *f, void *arg, + enum rib_subscription_type type) +{ + struct rib_subscription *rs; + + NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(rnh); + + if ((rs = allocate_subscription(f, arg, type, false)) == NULL) + return (NULL); + rs->rnh = rnh; + + CK_STAILQ_INSERT_HEAD(&rnh->rnh_subscribers, rs, next); + + return (rs); +} + /* * Remove rtable subscription @rs from the routing table. * Needs to be run in network epoch. @@ -1433,6 +1451,20 @@ rib_unsibscribe(struct rib_subscription *rs) &rs->epoch_ctx); } +void +rib_unsibscribe_locked(struct rib_subscription *rs) +{ + struct rib_head *rnh = rs->rnh; + + NET_EPOCH_ASSERT(); + RIB_WLOCK_ASSERT(rnh); + + CK_STAILQ_REMOVE(&rnh->rnh_subscribers, rs, rib_subscription, next); + + epoch_call(net_epoch_preempt, destroy_subscription_epoch, + &rs->epoch_ctx); +} + /* * Epoch callback indicating subscription is safe to destroy */ diff --git a/sys/net/route/route_ctl.h b/sys/net/route/route_ctl.h index ecbc9ee91dc0..bd256e9f0834 100644 --- a/sys/net/route/route_ctl.h +++ b/sys/net/route/route_ctl.h @@ -144,6 +144,9 @@ struct rib_subscription *rib_subscribe(uint32_t fibnum, int family, struct rib_subscription *rib_subscribe_internal(struct rib_head *rnh, rib_subscription_cb_t *f, void *arg, enum rib_subscription_type type, bool waitok); +struct rib_subscription *rib_subscribe_locked(struct rib_head *rnh, + rib_subscription_cb_t *f, void *arg, enum rib_subscription_type type); void rib_unsibscribe(struct rib_subscription *rs); +void rib_unsibscribe_locked(struct rib_subscription *rs); #endif From owner-dev-commits-src-all@freebsd.org Thu Feb 4 22:35: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 050E75311BB; Thu, 4 Feb 2021 22:35: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 4DWtfD0lgbz3GsR; Thu, 4 Feb 2021 22:35: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 D56ED14003; Thu, 4 Feb 2021 22:34: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 114MYxYL007615; Thu, 4 Feb 2021 22:34:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114MYxM3007614; Thu, 4 Feb 2021 22:34:59 GMT (envelope-from git) Date: Thu, 4 Feb 2021 22:34:59 GMT Message-Id: <202102042234.114MYxM3007614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 211afd1e2391 - stable/13 - MFC 78c93a172114: Use process fib for inet/inet6 fib_algo sysctls. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 211afd1e2391ba5aa7a7a5af5b4b7d71d404d15e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:35:01 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=211afd1e2391ba5aa7a7a5af5b4b7d71d404d15e commit 211afd1e2391ba5aa7a7a5af5b4b7d71d404d15e Author: Alexander V. Chernikov AuthorDate: 2021-01-31 10:48:47 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-02-04 22:34:15 +0000 MFC 78c93a172114: Use process fib for inet/inet6 fib_algo sysctls. This allows to set/query fib algo for non-default fibs. --- sys/net/route/fib_algo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 21b6ba924069..b2aa2de087de 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -1202,7 +1202,7 @@ static int set_algo_inet_sysctl_handler(SYSCTL_HANDLER_ARGS) { - return (set_fib_algo(RT_DEFAULT_FIB, AF_INET, oidp, req)); + return (set_fib_algo(curthread->td_proc->p_fibnum, AF_INET, oidp, req)); } SYSCTL_PROC(_net_route_algo_inet, OID_AUTO, algo, CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, @@ -1214,7 +1214,7 @@ static int set_algo_inet6_sysctl_handler(SYSCTL_HANDLER_ARGS) { - return (set_fib_algo(RT_DEFAULT_FIB, AF_INET6, oidp, req)); + return (set_fib_algo(curthread->td_proc->p_fibnum, AF_INET6, oidp, req)); } SYSCTL_PROC(_net_route_algo_inet6, OID_AUTO, algo, CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, From owner-dev-commits-src-all@freebsd.org Thu Feb 4 22: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 01B0C53243B; Thu, 4 Feb 2021 22:59:41 +0000 (UTC) (envelope-from rob.fx907@gmail.com) Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) (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 4DWvBh6TGGz3KTt; Thu, 4 Feb 2021 22:59:40 +0000 (UTC) (envelope-from rob.fx907@gmail.com) Received: by mail-oi1-x230.google.com with SMTP id m7so5476226oiw.12; Thu, 04 Feb 2021 14:59:40 -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=JCW8DKbgrNIRCcT7Nl9UCt2G+fKTq9upCpSmxZ8TWnY=; b=YF7m26ShpkH3P3tbvWfYEbl78K5Tnq/axMXPRNNIol7YczjtdoSnfXsB9Ils1srqCT MQsL4RsB168svPJdIJ0WSBoeBkVPS54w+VamDSgG0M5E5wiBJvhI5veVNqE2RM6ztSyw p/I1Z1KbpjUbMm/MsFZfFJERHjLcvoyqkmyivSU9f5JwWFbZgpzExzFbXmkkuzWrxpVx gerWGvIfbEPgok4nomaB7FJlA8sfDVTOEybj0apscfCw8kqe7HJPTvIiIAV+UxvePxx9 2UH0RIjEocne8hmbrOhbAaCTmjGjEl5jSbAOqSVVMxcSik2R9AHi9luQVvND0OQZdM3e bMtw== 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=JCW8DKbgrNIRCcT7Nl9UCt2G+fKTq9upCpSmxZ8TWnY=; b=k4T9FGa2NZkH39hcjmbLarvP20vmbkAJ5Y8adjrIQ0Th6spV06wRSwQzYsij8xU9tD 2AMAk66cxm4CX3s1eQ9w37+ENRpXN9bdzYWH60iNi7EW32zzvaOvomdPRkt2XCrpdxtl zIkEUlxgmrlNSryvLUZOnUPAlfXwzBTp0EXJ6TMhheU4COEVhtkTW6AwwhLalTngTAZt /cSxlYO4voDbwEhuLgxvpQwte7qEmGHOLJp9BELgrSnLAQwpl9Xe1kFig/zoPM3tDyyu Z+RGK05gACiysEyrTs1yOgcGNJ2XRNWcr0FyftByuqKzqU6vpS7yt+rvVWzYILaWJcVg ir+w== X-Gm-Message-State: AOAM533Qca5LHkaf3BcSLIsB6yr44FQDxF3aOCvP53DaM4BVdE+tmh0S ssfw/e73B2aZ6k0GJCNO56HbZqPejZdl25HIwTcmYU01ibs= X-Google-Smtp-Source: ABdhPJx4HsXVt4pGR4yUVZiGQyxRhKF0syU52p6A0r4lxsjKMoJxMq5NQcBhK+KJTD9YtjnTCwVSH8z7fukAtSKolEk= X-Received: by 2002:a05:6808:8a:: with SMTP id s10mr1253858oic.152.1612479579877; Thu, 04 Feb 2021 14:59:39 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac9:3170:0:0:0:0:0 with HTTP; Thu, 4 Feb 2021 14:59:39 -0800 (PST) In-Reply-To: <202102042234.114MYu5E007554@gitrepo.freebsd.org> References: <202102042234.114MYu5E007554@gitrepo.freebsd.org> From: Rob Wing Date: Thu, 4 Feb 2021 13:59:39 -0900 Message-ID: Subject: Re: git: f5f50ec15688 - stable/13 - MFC ab6d9aaed76e: Move business logic from rebuild_fd_callout() into rebuild_fd(). To: "Alexander V. Chernikov" Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" X-Rspamd-Queue-Id: 4DWvBh6TGGz3KTt 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)[] 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: Thu, 04 Feb 2021 22:59:41 -0000 I=E2=80=99m not opinionated on this, only pointing out that most MFC commit= s lately have trended towards using git cherry-pick and dropping the MFC: xxxxxx in the commit message. I know Warner encourages this, as documented at https://github.com/bsdimp/freebsd-git-docs/blob/main/MFC.md#marking-mfcs -Rob On Thursday, February 4, 2021, Alexander V. Chernikov wrote: > The branch stable/13 has been updated by melifaro: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D > f5f50ec15688d6aab67d3fb8fb0c98b89e4dbce0 > > commit f5f50ec15688d6aab67d3fb8fb0c98b89e4dbce0 > Author: Alexander V. Chernikov > AuthorDate: 2021-01-30 22:32:42 +0000 > Commit: Alexander V. Chernikov > CommitDate: 2021-02-04 22:34:15 +0000 > > MFC ab6d9aaed76e: Move business logic from rebuild_fd_callout() into > rebuild_fd(). > > This simplifies code a bit and allows for future non-callout > callers to request rebuild. > --- > sys/net/route/fib_algo.c | 40 +++++++++++++++++++++++++--------------- > 1 file changed, 25 insertions(+), 15 deletions(-) > > diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c > index 1f040ad259c5..f7a8b3f82431 100644 > --- a/sys/net/route/fib_algo.c > +++ b/sys/net/route/fib_algo.c > @@ -155,6 +155,7 @@ struct fib_data { > TAILQ_ENTRY(fib_data) entries; /* list of all fds in vne= t > */ > }; > > +static bool rebuild_fd(struct fib_data *fd); > static void rebuild_fd_callout(void *_data); > static void destroy_fd_instance_epoch(epoch_context_t ctx); > static enum flm_op_result attach_datapath(struct fib_data *fd); > @@ -1011,13 +1012,28 @@ setup_fd_instance(struct fib_lookup_module *flm, > struct rib_head *rh, > static void > rebuild_fd_callout(void *_data) > { > - struct fib_data *fd, *fd_new, *fd_tmp; > + struct fib_data *fd =3D (struct fib_data *)_data; > + > + FD_PRINTF(LOG_INFO, fd, "running callout rebuild"); > + > + CURVNET_SET(fd->fd_vnet); > + rebuild_fd(fd); > + CURVNET_RESTORE(); > +} > + > +/* > + * Tries to create new algo instance based on @fd data. > + * Returns true on success. > + */ > +static bool > +rebuild_fd(struct fib_data *fd) > +{ > + struct fib_data *fd_new, *fd_tmp; > struct fib_lookup_module *flm_new =3D NULL; > struct epoch_tracker et; > enum flm_op_result result; > bool need_rebuild =3D false; > > - fd =3D (struct fib_data *)_data; > > FIB_MOD_LOCK(); > need_rebuild =3D fd->fd_need_rebuild; > @@ -1026,15 +1042,12 @@ rebuild_fd_callout(void *_data) > fd->fd_num_changes =3D 0; > FIB_MOD_UNLOCK(); > > - CURVNET_SET(fd->fd_vnet); > - > /* First, check if we're still OK to use this algo */ > if (!is_algo_fixed(fd->fd_rh)) > flm_new =3D fib_check_best_algo(fd->fd_rh, fd->fd_flm); > if ((flm_new =3D=3D NULL) && (!need_rebuild)) { > /* Keep existing algo, no need to rebuild. */ > - CURVNET_RESTORE(); > - return; > + return (true); > } > > if (flm_new =3D=3D NULL) { > @@ -1051,19 +1064,16 @@ rebuild_fd_callout(void *_data) > } > if (result !=3D FLM_SUCCESS) { > FD_PRINTF(LOG_NOTICE, fd, "table rebuild failed"); > - CURVNET_RESTORE(); > - return; > + return (false); > } > FD_PRINTF(LOG_INFO, fd_new, "switched to new instance"); > > - /* Remove old instance removal */ > - if (fd !=3D NULL) { > - NET_EPOCH_ENTER(et); > - schedule_destroy_fd_instance(fd, true); > - NET_EPOCH_EXIT(et); > - } > + /* Remove old instance */ > + NET_EPOCH_ENTER(et); > + schedule_destroy_fd_instance(fd, true); > + NET_EPOCH_EXIT(et); > > - CURVNET_RESTORE(); > + return (true); > } > > /* > From owner-dev-commits-src-all@freebsd.org Thu Feb 4 23:15: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 CB0F1532A56; Thu, 4 Feb 2021 23:15: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 4DWvYS4rktz3LQ7; Thu, 4 Feb 2021 23:15: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 99C3414471; Thu, 4 Feb 2021 23:15: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 114NFuoB061507; Thu, 4 Feb 2021 23:15:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114NFunx061506; Thu, 4 Feb 2021 23:15:56 GMT (envelope-from git) Date: Thu, 4 Feb 2021 23:15:56 GMT Message-Id: <202102042315.114NFunx061506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: 3f3b216c0b4b - stable/13 - MFC jail: A jail could be removed without calling OSD methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3f3b216c0b4b90e02b5637f5b07cc9446e1bcee7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:15:56 -0000 The branch stable/13 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=3f3b216c0b4b90e02b5637f5b07cc9446e1bcee7 commit 3f3b216c0b4b90e02b5637f5b07cc9446e1bcee7 Author: Jamie Gritton AuthorDate: 2021-01-22 18:50:10 +0000 Commit: Jamie Gritton CommitDate: 2021-02-04 23:13:36 +0000 MFC jail: A jail could be removed without calling OSD methods Fix a long-standing bug where setting nopersist on a process-less jail would remove it without calling the the OSD PR_METHOD_REMOVE methods. (cherry picked from commit 39c8ef90f6d035cd3c3ab40e051b1c0f419c76be) --- sys/kern/kern_jail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index e869bafc96b8..318f81fb13be 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1741,8 +1741,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) prison_hold(pr); refcount_acquire(&pr->pr_uref); } else { - refcount_release(&pr->pr_uref); refcount_release(&pr->pr_ref); + drflags |= PD_DEUREF; } } pr->pr_flags = (pr->pr_flags & ~ch_flags) | pr_flags; From owner-dev-commits-src-all@freebsd.org Thu Feb 4 23:15: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 7CCBB532AA9; Thu, 4 Feb 2021 23:15: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 4DWvYT5pkQz3Lhf; Thu, 4 Feb 2021 23:15: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 BA17014807; Thu, 4 Feb 2021 23:15: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 114NFvXX061530; Thu, 4 Feb 2021 23:15:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114NFvKS061529; Thu, 4 Feb 2021 23:15:57 GMT (envelope-from git) Date: Thu, 4 Feb 2021 23:15:57 GMT Message-Id: <202102042315.114NFvKS061529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: 7726fc9940d6 - stable/13 - MFC jail: fix dangling reference bug from 6754ae2572eb MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7726fc9940d688af35753a374391de48bad1e1ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:15:58 -0000 The branch stable/13 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=7726fc9940d688af35753a374391de48bad1e1ca commit 7726fc9940d688af35753a374391de48bad1e1ca Author: Jamie Gritton AuthorDate: 2021-01-22 18:56:24 +0000 Commit: Jamie Gritton CommitDate: 2021-02-04 23:13:47 +0000 MFC jail: fix dangling reference bug from 6754ae2572eb The change to use refcounts for pr_uref was mishandled in prison_proc_free, so killing a jail's last process could add an extra reference, leaving it an unkillable zombie. (cherry picked from commit 195cd6ae2481dd5ad555ed65c226b6f20908d66a) --- sys/kern/kern_jail.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 318f81fb13be..064f1afa4133 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -2705,7 +2705,6 @@ prison_proc_hold(struct prison *pr) void prison_proc_free(struct prison *pr) { - int lasturef; /* * Locking is only required when releasing the last reference. @@ -2714,11 +2713,7 @@ prison_proc_free(struct prison *pr) */ KASSERT(refcount_load(&pr->pr_uref) > 0, ("Trying to kill a process in a dead prison (jid=%d)", pr->pr_id)); - if (refcount_release_if_not_last(&pr->pr_uref)) - return; - mtx_lock(&pr->pr_mtx); - lasturef = refcount_release(&pr->pr_uref); - if (lasturef) { + if (!refcount_release_if_not_last(&pr->pr_uref)) { /* * Don't remove the last user reference in this context, * which is expected to be a process that is not only locked, @@ -2726,11 +2721,8 @@ prison_proc_free(struct prison *pr) * prison_free() won't re-submit the task. */ refcount_acquire(&pr->pr_ref); - mtx_unlock(&pr->pr_mtx); taskqueue_enqueue(taskqueue_thread, &pr->pr_task); - return; } - mtx_unlock(&pr->pr_mtx); } /* From owner-dev-commits-src-all@freebsd.org Thu Feb 4 23: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 C9B60532C99; Thu, 4 Feb 2021 23: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 4DWvYV6sRzz3Lf7; Thu, 4 Feb 2021 23:15: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 DD03D14555; Thu, 4 Feb 2021 23:15: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 114NFwPr061550; Thu, 4 Feb 2021 23:15:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114NFwvS061549; Thu, 4 Feb 2021 23:15:58 GMT (envelope-from git) Date: Thu, 4 Feb 2021 23:15:58 GMT Message-Id: <202102042315.114NFwvS061549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: 4c44dbde5491 - stable/13 - MFC jail: Handle a parent jail when a child is added to it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c44dbde5491516eba8725dc51d39c1dcc817472 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:15:59 -0000 The branch stable/13 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=4c44dbde5491516eba8725dc51d39c1dcc817472 commit 4c44dbde5491516eba8725dc51d39c1dcc817472 Author: Jamie Gritton AuthorDate: 2021-01-29 05:51:09 +0000 Commit: Jamie Gritton CommitDate: 2021-02-04 23:13:54 +0000 MFC jail: Handle a parent jail when a child is added to it It's possible when adding a jail that its dying parent comes back to life. Only allow that to happen when JAIL_DYING is specified. And if it does happen, call PR_METHOD_CREATE on it. (cherry picked from commit c050ea803eaa1087313b86628b5d486c0e59e41b) --- sys/kern/kern_jail.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 064f1afa4133..ece0aa33e642 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1105,6 +1105,14 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) "jail \"%s\" not found", name); goto done_deref; } + if (!(flags & JAIL_DYING) && + !prison_isalive(ppr)) { + mtx_unlock(&ppr->pr_mtx); + error = ENOENT; + vfs_opterror(opts, + "jail \"%s\" is dying", name); + goto done_deref; + } mtx_unlock(&ppr->pr_mtx); *namelc = '.'; } @@ -1200,8 +1208,18 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) goto done_deref; } prison_hold(ppr); - refcount_acquire(&ppr->pr_uref); - mtx_unlock(&ppr->pr_mtx); + if (refcount_acquire(&ppr->pr_uref)) + mtx_unlock(&ppr->pr_mtx); + else { + /* This brings the parent back to life. */ + mtx_unlock(&ppr->pr_mtx); + error = osd_jail_call(ppr, PR_METHOD_CREATE, opts); + if (error) { + pr = ppr; + drflags |= PD_DEREF | PD_DEUREF; + goto done_deref; + } + } if (jid == 0 && (jid = get_next_prid(&inspr)) == 0) { error = EAGAIN; From owner-dev-commits-src-all@freebsd.org Thu Feb 4 23:33: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 9E01D5334AA; Thu, 4 Feb 2021 23:33: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 4DWvy63l1Tz3N2m; Thu, 4 Feb 2021 23:33: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 1FB6B14966; Thu, 4 Feb 2021 23:33: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 114NXoh8086994; Thu, 4 Feb 2021 23:33:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 114NXowE086993; Thu, 4 Feb 2021 23:33:50 GMT (envelope-from git) Date: Thu, 4 Feb 2021 23:33:50 GMT Message-Id: <202102042333.114NXowE086993@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: 7d4dceec1030 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 7d4dceec103039e2b2fa90793ceeb71a8d6684aa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:33:50 -0000 The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=7d4dceec103039e2b2fa90793ceeb71a8d6684aa commit 7d4dceec103039e2b2fa90793ceeb71a8d6684aa Author: Krzysztof Galazka AuthorDate: 2021-02-03 23:22:55 +0000 Commit: Eric Joyner CommitDate: 2021-02-04 23:33:42 +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 --- 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; pf = vsi->back; dev = pf->dev; *** 549 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Feb 4 23:56: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 C42A7533C2F for ; Thu, 4 Feb 2021 23:56:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) 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 4DWwSG4zXNz3PPx for ; Thu, 4 Feb 2021 23:56:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id d15so3781498qtw.12 for ; Thu, 04 Feb 2021 15:56:30 -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=Jx30byh333ior8Gj6CbNspcK76/Tlh5/RkJlrIk3B28=; b=iWEbtIkOvloJJja1Wft/gFqYR+Btv4mn31WRBW3PfYPruaoHvSbGxn8a3gRuKIP5p9 pUHmcvHP/MLvkG+x9WN3pFhfvLcJ7pg+s2VfNjKdIq6j9RdpGgZw6UcxAOf18XzwXXaW nV1FoRuilgPfn9aXOVkFRZWg5jTxrZZb3dTYrykVvu/Aun1iWc06I73yz93ezckturXl kFj23mFO+p0jo8bjMQ2ABb+7d1DejUOHzEzTx5M14uXGUp9mN775ytOCjk4gi1wI/vOb 4PH6sSzevW176LIpfF5UNjM9ZNo8LjlKC0U9rsqrHujb1ESI585nOHDEqAQl9vkwsd66 GlCg== 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=Jx30byh333ior8Gj6CbNspcK76/Tlh5/RkJlrIk3B28=; b=Ry63e24SYDyBcYRxjLxB1jk0KzCO0mY58TtsNzlEI9o6xfVnsxxuTbmn0hxodntKfC RW4AiLgpdmrO/3R1H2Ttj32GltByeoljD9G570U4pbsuztCcekwOeO4MB3pa0h5ctAwB mJLZBAmANfsWjBCf6E9BbKd/pI4Tp7PE0Y1+zWHkzT4E2F+Ykm9uh5GdkF1djcdO/Hbu PuORxVd6dI2hD+IMHTWD8widvwPu2YBSUR1A6MlE8ihMKrbcXvDz5tbb6F+6/lGAOuMG zDtduFOX2Dxo8mwh9E/kUOJNQ/CZ83vZ9hAHq9foIiOsOlpGXwYLLO7CKc2kkslM953q zaBw== X-Gm-Message-State: AOAM531TrFiwVVWBPrvdfZW72lJd9Gxb/dXKDMtnCXjLUSwx9gqO6z9m QYiWP2Zdx0YLKI2GmWv+mjFS3H+XyvQNuPbz2bAEnvhQufc= X-Google-Smtp-Source: ABdhPJzf3cfojyc7Q8kgzzjo4JEtl7wTM4WfwLOLg6VrMFfQa+ddyr5kpXvIBT+a0lwDChGtsOkWeO+GNopbCPz1NZo= X-Received: by 2002:a05:622a:1c9:: with SMTP id t9mr2072560qtw.244.1612482989370; Thu, 04 Feb 2021 15:56:29 -0800 (PST) MIME-Version: 1.0 References: <202102042134.114LYKEp029525@gitrepo.freebsd.org> In-Reply-To: <202102042134.114LYKEp029525@gitrepo.freebsd.org> From: Warner Losh Date: Thu, 4 Feb 2021 16:56:17 -0700 Message-ID: Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev To: Toomas Soome Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org X-Rspamd-Queue-Id: 4DWwSG4zXNz3PPx 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: Thu, 04 Feb 2021 23:56:30 -0000 And why the instaMFC? Changes are supposed to cook force days before merging... I have questions about the wisdom of this change... Warner On Thu, Feb 4, 2021, 2:34 PM Toomas Soome wrote: > The branch stable/13 has been updated by tsoome: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=0c839497c174e961fc71f7d3329d05b10ec5525b > > commit 0c839497c174e961fc71f7d3329d05b10ec5525b > Author: Toomas Soome > AuthorDate: 2021-02-04 20:49:02 +0000 > Commit: Toomas Soome > CommitDate: 2021-02-04 21:33:15 +0000 > > loader.efi: There are systems without ConOut, also use ConOutDev > > Conout does contian the default output device name. > ConOutDev does contain all possible output device names, so we can > use it as fallback, when there is no ConOut. > > PR: 253253 > > (cherry picked from commit 2bd4ff2d8911009283e4e615ca4aad35a845f48b) > --- > stand/efi/loader/main.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c > index ca41cd4a2610..32b278950745 100644 > --- a/stand/efi/loader/main.c > +++ b/stand/efi/loader/main.c > @@ -735,6 +735,8 @@ parse_uefi_con_out(void) > how = 0; > sz = sizeof(buf); > rv = efi_global_getenv("ConOut", buf, &sz); > + if (rv != EFI_SUCCESS) > + rv = efi_global_getenv("ConOutDev", buf, &sz); > if (rv != EFI_SUCCESS) { > /* If we don't have any ConOut default to serial */ > how = RB_SERIAL; > From owner-dev-commits-src-all@freebsd.org Fri Feb 5 00:01: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 B413B534065 for ; Fri, 5 Feb 2021 00:01: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 4DWwZ64cKbz3PsH; Fri, 5 Feb 2021 00:01: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 914D01512C; Fri, 5 Feb 2021 00:01: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 11501YhT022858; Fri, 5 Feb 2021 00:01:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11501Y13022857; Fri, 5 Feb 2021 00:01:34 GMT (envelope-from git) Date: Fri, 5 Feb 2021 00:01:34 GMT Message-Id: <202102050001.11501Y13022857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Glen Barber Subject: git: 638e531019fd - releng/13.0 - Branch releng/13.0 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: 638e531019fd360ec43d2662c89d12ae632f168f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:01:34 -0000 The branch releng/13.0 has been created by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=638e531019fd360ec43d2662c89d12ae632f168f commit 638e531019fd360ec43d2662c89d12ae632f168f Author: Glen Barber AuthorDate: 2021-02-04 23:58:51 +0000 Commit: Glen Barber CommitDate: 2021-02-05 00:01:10 +0000 Branch releng/13.0 Update releng/13.0 to BETA1 in preparation for the first BETA builds. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/pkg_repos/release-dvd.conf | 2 +- sys/conf/newvers.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/release/pkg_repos/release-dvd.conf b/release/pkg_repos/release-dvd.conf index 95413592b719..34997f2c7067 100644 --- a/release/pkg_repos/release-dvd.conf +++ b/release/pkg_repos/release-dvd.conf @@ -1,6 +1,6 @@ # $FreeBSD$ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 12d4daa771be..d436c4b61c62 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH="ALPHA3" +BRANCH="BETA1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-dev-commits-src-all@freebsd.org Fri Feb 5 00:02: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 6D30653435F; Fri, 5 Feb 2021 00:02: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 4DWwb82hFYz3QPC; Fri, 5 Feb 2021 00:02: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 4EE4B15060; Fri, 5 Feb 2021 00:02: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 11502SU3026367; Fri, 5 Feb 2021 00:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11502Sro026366; Fri, 5 Feb 2021 00:02:28 GMT (envelope-from git) Date: Fri, 5 Feb 2021 00:02:28 GMT Message-Id: <202102050002.11502Sro026366@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: 3d544e6b0bc4 - stable/13 - Rename stable/13 to -STABLE now that releng/13.0 has branched 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d544e6b0bc4000c0a485d84c95ed2b699916f3a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:02:28 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=3d544e6b0bc4000c0a485d84c95ed2b699916f3a commit 3d544e6b0bc4000c0a485d84c95ed2b699916f3a Author: Glen Barber AuthorDate: 2021-02-05 00:02:14 +0000 Commit: Glen Barber CommitDate: 2021-02-05 00:02:14 +0000 Rename stable/13 to -STABLE now that releng/13.0 has branched Bump __FreeBSD_version Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/conf/newvers.sh | 2 +- sys/sys/param.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 12d4daa771be..0b5b76847320 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH="ALPHA3" +BRANCH="STABLE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/sys/sys/param.h b/sys/sys/param.h index a19091e17167..497832e1ba15 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300139 /* Master, propagated to newvers */ +#define __FreeBSD_version 1305000 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Fri Feb 5 00:04: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 7D49753454F; Fri, 5 Feb 2021 00:04: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 4DWwdW37dzz3QRs; Fri, 5 Feb 2021 00:04: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 5DE3215286; Fri, 5 Feb 2021 00:04: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 11504V2V026816; Fri, 5 Feb 2021 00:04:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11504VeU026815; Fri, 5 Feb 2021 00:04:31 GMT (envelope-from git) Date: Fri, 5 Feb 2021 00:04:31 GMT Message-Id: <202102050004.11504VeU026815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: fa3b2ad265d3 - stable/13 - Fix ldd to work with more ELF files. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fa3b2ad265d311191c1c8337bf3aa356f28480cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:04:31 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fa3b2ad265d311191c1c8337bf3aa356f28480cb commit fa3b2ad265d311191c1c8337bf3aa356f28480cb Author: John Baldwin AuthorDate: 2021-01-29 18:53:50 +0000 Commit: John Baldwin CommitDate: 2021-02-05 00:03:20 +0000 Fix ldd to work with more ELF files. - Use libelf to parse ELF data structures and remove code duplication for ELF32. - Don't require the OSABI field to be set to the FreeBSD OSABI for shared libraries. Both AArch64 and RISC-V leave it set to "none" and instead depend on the ABI tag note. For ldd, this means falling back to walking the notes in PT_NOTE segments to find the ABI tag note to determine if an ELF shared library without OSABI set in the header file is a FreeBSD shared library. (cherry picked from commit 9d4104b214963bb3371ada05cae8006940121634) --- usr.bin/ldd/Makefile | 2 + usr.bin/ldd/ldd.c | 335 ++++++++++++++++++++++++++++----------------------- 2 files changed, 187 insertions(+), 150 deletions(-) diff --git a/usr.bin/ldd/Makefile b/usr.bin/ldd/Makefile index 5d2beb7bb6c0..78e551d80a33 100644 --- a/usr.bin/ldd/Makefile +++ b/usr.bin/ldd/Makefile @@ -3,4 +3,6 @@ PROG?= ldd SRCS= ldd.c +LIBADD= elf + .include diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c index 08c91d829bd7..f948b7312863 100644 --- a/usr.bin/ldd/ldd.c +++ b/usr.bin/ldd/ldd.c @@ -33,6 +33,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -43,6 +44,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include #include @@ -259,179 +263,210 @@ usage(void) exit(1); } -static int -is_executable(const char *fname, int fd, int *is_shlib, int *type) +static bool +has_freebsd_abi_tag(const char *fname, Elf *elf, GElf_Ehdr *ehdr, off_t offset, + size_t len) { - union { -#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) - Elf32_Ehdr elf32; -#endif - Elf_Ehdr elf; - } hdr; - Elf_Phdr phdr, dynphdr; - Elf_Dyn *dynp; - void *dyndata; -#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) - Elf32_Phdr phdr32, dynphdr32; - Elf32_Dyn *dynp32; -#endif - int df1pie, dynamic, i, n; - - *is_shlib = 0; - *type = TYPE_UNKNOWN; - df1pie = 0; + Elf_Data dst, src; + const Elf_Note *note; + char *buf; + const char *name; + void *copy; + size_t namesz, descsz; + bool has_abi_tag; + + buf = elf_rawfile(elf, NULL); + if (buf == NULL) { + warnx("%s: %s", fname, elf_errmsg(0)); + return (false); + } - if ((n = read(fd, &hdr, sizeof(hdr))) == -1) { - warn("%s: can't read program header", fname); - return (0); + memset(&src, 0, sizeof(src)); + src.d_buf = buf + offset; + src.d_size = len; + src.d_type = ELF_T_NOTE; + src.d_version = EV_CURRENT; + + memset(&dst, 0, sizeof(dst)); + dst.d_buf = copy = malloc(len); + dst.d_size = len; + dst.d_type = ELF_T_NOTE; + dst.d_version = EV_CURRENT; + + if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { + warnx("%s: failed to parse notes: %s", fname, elf_errmsg(0)); + free(copy); + return (false); } -#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) - if ((size_t)n >= sizeof(hdr.elf32) && IS_ELF(hdr.elf32) && - hdr.elf32.e_ident[EI_CLASS] == ELFCLASS32) { - /* Handle 32 bit ELF objects */ + buf = copy; + has_abi_tag = false; + for (;;) { + if (len < sizeof(*note)) + break; - dynamic = 0; - *type = TYPE_ELF32; + note = (const void *)buf; + buf += sizeof(*note); + len -= sizeof(*note); - if (lseek(fd, hdr.elf32.e_phoff, SEEK_SET) == -1) { - warnx("%s: header too short", fname); - return (0); - } - for (i = 0; i < hdr.elf32.e_phnum; i++) { - if (read(fd, &phdr32, hdr.elf32.e_phentsize) != - sizeof(phdr32)) { - warnx("%s: can't read program header", fname); - return (0); - } - if (phdr32.p_type == PT_DYNAMIC) { - dynamic = 1; - dynphdr32 = phdr32; - break; - } - } + namesz = roundup2(note->n_namesz, sizeof(uint32_t)); + descsz = roundup2(note->n_descsz, sizeof(uint32_t)); + if (len < namesz + descsz) + break; - if (!dynamic) { - warnx("%s: not a dynamic ELF executable", fname); - return (0); + name = buf; + if (note->n_namesz == sizeof(ELF_NOTE_FREEBSD) && + strncmp(name, ELF_NOTE_FREEBSD, note->n_namesz) == 0 && + note->n_type == NT_FREEBSD_ABI_TAG && + note->n_descsz == sizeof(uint32_t)) { + has_abi_tag = true; + break; } - if (hdr.elf32.e_type == ET_DYN) { - if (lseek(fd, dynphdr32.p_offset, SEEK_SET) == -1) { - warnx("%s: dynamic segment out of range", - fname); - return (0); - } - dyndata = malloc(dynphdr32.p_filesz); - if (dyndata == NULL) { - warn("malloc"); - return (0); - } - if (read(fd, dyndata, dynphdr32.p_filesz) != - (ssize_t)dynphdr32.p_filesz) { - free(dyndata); - warnx("%s: can't read dynamic segment", fname); - return (0); - } - for (dynp32 = dyndata; dynp32->d_tag != DT_NULL; - dynp32++) { - if (dynp32->d_tag != DT_FLAGS_1) - continue; - df1pie = (dynp32->d_un.d_val & DF_1_PIE) != 0; - break; - } - free(dyndata); + buf += namesz + descsz; + len -= namesz + descsz; + } - if (hdr.elf32.e_ident[EI_OSABI] == ELFOSABI_FREEBSD) { - if (!df1pie) - *is_shlib = 1; - return (1); - } - warnx("%s: not a FreeBSD ELF shared object", fname); - return (0); - } + free(copy); + return (has_abi_tag); +} - return (1); +static bool +is_pie(const char *fname, Elf *elf, GElf_Ehdr *ehdr, off_t offset, size_t len) +{ + Elf_Data dst, src; + char *buf; + void *copy; + const GElf_Dyn *dyn; + size_t dynsize; + u_int count, i; + bool pie; + + buf = elf_rawfile(elf, NULL); + if (buf == NULL) { + warnx("%s: %s", fname, elf_errmsg(0)); + return (false); } -#endif - if ((size_t)n >= sizeof(hdr.elf) && IS_ELF(hdr.elf) && - hdr.elf.e_ident[EI_CLASS] == ELF_TARG_CLASS) { - /* Handle default ELF objects on this architecture */ + dynsize = gelf_fsize(elf, ELF_T_DYN, 1, EV_CURRENT); + if (dynsize == 0) { + warnx("%s: %s", fname, elf_errmsg(0)); + return (false); + } + count = len / dynsize; + + memset(&src, 0, sizeof(src)); + src.d_buf = buf + offset; + src.d_size = len; + src.d_type = ELF_T_DYN; + src.d_version = EV_CURRENT; + + memset(&dst, 0, sizeof(dst)); + dst.d_buf = copy = malloc(count * sizeof(*dyn)); + dst.d_size = count * sizeof(*dyn); + dst.d_type = ELF_T_DYN; + dst.d_version = EV_CURRENT; + + if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { + warnx("%s: failed to parse .dynamic: %s", fname, elf_errmsg(0)); + free(copy); + return (false); + } + + dyn = copy; + pie = false; + for (i = 0; i < count; i++) { + if (dyn[i].d_tag != DT_FLAGS_1) + continue; + + pie = (dyn[i].d_un.d_val & DF_1_PIE) != 0; + break; + } + + free(copy); + return (pie); +} + +static int +is_executable(const char *fname, int fd, int *is_shlib, int *type) +{ + Elf *elf; + GElf_Ehdr ehdr; + GElf_Phdr phdr; + bool dynamic, freebsd, pie; + int i; + + *is_shlib = 0; + *type = TYPE_UNKNOWN; + dynamic = false; + freebsd = false; + pie = false; + + if (elf_version(EV_CURRENT) == EV_NONE) { + warnx("unsupported libelf"); + return (0); + } + elf = elf_begin(fd, ELF_C_READ, NULL); + if (elf == NULL) { + warnx("%s: %s", fname, elf_errmsg(0)); + return (0); + } + if (elf_kind(elf) != ELF_K_ELF) { + elf_end(elf); + warnx("%s: not a dynamic ELF executable", fname); + return (0); + } + if (gelf_getehdr(elf, &ehdr) == NULL) { + warnx("%s: %s", fname, elf_errmsg(0)); + elf_end(elf); + return (0); + } - dynamic = 0; - *type = TYPE_ELF; + *type = TYPE_ELF; +#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) + if (gelf_getclass(elf) == ELFCLASS32) { + *type = TYPE_ELF32; + } +#endif - if (lseek(fd, hdr.elf.e_phoff, SEEK_SET) == -1) { - warnx("%s: header too short", fname); + freebsd = ehdr.e_ident[EI_OSABI] == ELFOSABI_FREEBSD; + for (i = 0; i < ehdr.e_phnum; i++) { + if (gelf_getphdr(elf, i, &phdr) == NULL) { + warnx("%s: %s", fname, elf_errmsg(0)); + elf_end(elf); return (0); } - for (i = 0; i < hdr.elf.e_phnum; i++) { - if (read(fd, &phdr, hdr.elf.e_phentsize) - != sizeof(phdr)) { - warnx("%s: can't read program header", fname); - return (0); - } - if (phdr.p_type == PT_DYNAMIC) { - dynamic = 1; - dynphdr = phdr; - break; - } + switch (phdr.p_type) { + case PT_NOTE: + if (ehdr.e_ident[EI_OSABI] == ELFOSABI_NONE && !freebsd) + freebsd = has_freebsd_abi_tag(fname, elf, &ehdr, + phdr.p_offset, phdr.p_filesz); + break; + case PT_DYNAMIC: + dynamic = true; + if (ehdr.e_type == ET_DYN) + pie = is_pie(fname, elf, &ehdr, phdr.p_offset, + phdr.p_filesz); + break; } + } - if (!dynamic) { - warnx("%s: not a dynamic ELF executable", fname); - return (0); - } + if (!dynamic) { + elf_end(elf); + warnx("%s: not a dynamic ELF executable", fname); + return (0); + } - if (hdr.elf.e_type == ET_DYN) { - if (lseek(fd, dynphdr.p_offset, SEEK_SET) == -1) { - warnx("%s: dynamic segment out of range", - fname); - return (0); - } - dyndata = malloc(dynphdr.p_filesz); - if (dyndata == NULL) { - warn("malloc"); - return (0); - } - if (read(fd, dyndata, dynphdr.p_filesz) != - (ssize_t)dynphdr.p_filesz) { - free(dyndata); - warnx("%s: can't read dynamic segment", fname); - return (0); - } - for (dynp = dyndata; dynp->d_tag != DT_NULL; dynp++) { - if (dynp->d_tag != DT_FLAGS_1) - continue; - df1pie = (dynp->d_un.d_val & DF_1_PIE) != 0; - break; - } - free(dyndata); - - switch (hdr.elf.e_ident[EI_OSABI]) { - case ELFOSABI_FREEBSD: - if (!df1pie) - *is_shlib = 1; - return (1); -#ifdef __ARM_EABI__ - case ELFOSABI_NONE: - if (hdr.elf.e_machine != EM_ARM) - break; - if (EF_ARM_EABI_VERSION(hdr.elf.e_flags) < - EF_ARM_EABI_FREEBSD_MIN) - break; - *is_shlib = 1; - return (1); -#endif - } + if (ehdr.e_type == ET_DYN && !pie) { + *is_shlib = 1; + + if (!freebsd) { + elf_end(elf); warnx("%s: not a FreeBSD ELF shared object", fname); return (0); } - - return (1); } - warnx("%s: not a dynamic executable", fname); - return (0); + elf_end(elf); + return (1); } From owner-dev-commits-src-all@freebsd.org Fri Feb 5 00:04: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 A5BC253470E; Fri, 5 Feb 2021 00:04: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 4DWwdX4GsMz3Q26; Fri, 5 Feb 2021 00:04: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 859FE15287; Fri, 5 Feb 2021 00:04: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 11504WfQ026834; Fri, 5 Feb 2021 00:04:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11504WtX026833; Fri, 5 Feb 2021 00:04:32 GMT (envelope-from git) Date: Fri, 5 Feb 2021 00:04:32 GMT Message-Id: <202102050004.11504WtX026833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c1c52cd57e88 - stable/13 - OpenSSL: Support for kernel TLS offload (KTLS) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c1c52cd57e8810ca294d02220dfa72607c9a5567 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:04:32 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c1c52cd57e8810ca294d02220dfa72607c9a5567 commit c1c52cd57e8810ca294d02220dfa72607c9a5567 Author: John Baldwin AuthorDate: 2021-01-16 00:17:31 +0000 Commit: John Baldwin CommitDate: 2021-02-05 00:03:20 +0000 OpenSSL: Support for kernel TLS offload (KTLS) This merges upstream patches from OpenSSL's master branch to add KTLS infrastructure for TLS 1.0-1.3 including both RX and TX offload and SSL_sendfile support on both Linux and FreeBSD. Note that TLS 1.3 only supports TX offload. A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with KTLS support. It defaults to enabled on amd64 and disabled on all other architectures. Sponsored by: Netflix (cherry picked from commit aa906e2a4957db700d9e6cc60857e1afe1aecc85) --- crypto/openssl/CHANGES | 5 + crypto/openssl/Configure | 29 ++ crypto/openssl/INSTALL | 9 + crypto/openssl/apps/s_client.c | 6 + crypto/openssl/apps/s_server.c | 6 + crypto/openssl/crypto/bio/b_sock2.c | 12 + crypto/openssl/crypto/bio/bss_conn.c | 46 ++- crypto/openssl/crypto/bio/bss_sock.c | 57 ++- crypto/openssl/crypto/err/openssl.txt | 1 + crypto/openssl/crypto/evp/e_aes.c | 8 + crypto/openssl/doc/man3/BIO_ctrl.pod | 21 +- crypto/openssl/doc/man3/SSL_CTX_set_mode.pod | 17 + .../man3/SSL_CTX_set_record_padding_callback.pod | 10 +- crypto/openssl/doc/man3/SSL_write.pod | 31 +- crypto/openssl/engines/e_afalg.c | 3 +- crypto/openssl/include/internal/bio.h | 39 ++ crypto/openssl/include/internal/ktls.h | 403 +++++++++++++++++++++ crypto/openssl/include/openssl/bio.h | 20 + crypto/openssl/include/openssl/err.h | 1 + crypto/openssl/include/openssl/evp.h | 2 + crypto/openssl/include/openssl/ssl.h | 12 +- crypto/openssl/include/openssl/sslerr.h | 1 + crypto/openssl/ssl/build.info | 5 + crypto/openssl/ssl/ktls.c | 221 +++++++++++ crypto/openssl/ssl/record/rec_layer_s3.c | 137 +++++-- crypto/openssl/ssl/record/record.h | 2 + crypto/openssl/ssl/record/record_local.h | 3 + crypto/openssl/ssl/record/ssl3_buffer.c | 33 +- crypto/openssl/ssl/record/ssl3_record.c | 47 ++- crypto/openssl/ssl/ssl_err.c | 1 + crypto/openssl/ssl/ssl_lib.c | 104 +++++- crypto/openssl/ssl/ssl_local.h | 13 + crypto/openssl/ssl/t1_enc.c | 128 +++++++ crypto/openssl/ssl/tls13_enc.c | 81 ++++- secure/lib/libcrypto/Makefile | 18 +- secure/lib/libcrypto/opensslconf.h.in | 3 + secure/lib/libssl/Makefile | 6 + secure/lib/libssl/Version.map | 6 + share/mk/src.opts.mk | 7 + tools/build/options/WITHOUT_OPENSSL_KTLS | 1 + tools/build/options/WITH_OPENSSL_KTLS | 1 + 41 files changed, 1465 insertions(+), 91 deletions(-) diff --git a/crypto/openssl/CHANGES b/crypto/openssl/CHANGES index 37dd60b726ee..4d61c1dadbaa 100644 --- a/crypto/openssl/CHANGES +++ b/crypto/openssl/CHANGES @@ -390,6 +390,11 @@ necessary to configure just to create a source distribution. [Richard Levitte] + *) Added support for Linux Kernel TLS data-path. The Linux Kernel data-path + improves application performance by removing data copies and providing + applications with zero-copy system calls such as sendfile and splice. + [Boris Pismenny] + Changes between 1.1.1 and 1.1.1a [20 Nov 2018] *) Timing vulnerability in DSA signature generation diff --git a/crypto/openssl/Configure b/crypto/openssl/Configure index 1d73d06e1b3b..1423e1bfe14f 100755 --- a/crypto/openssl/Configure +++ b/crypto/openssl/Configure @@ -387,6 +387,7 @@ my @disablables = ( "heartbeats", "hw(-.+)?", "idea", + "ktls", "makedepend", "md2", "md4", @@ -474,6 +475,7 @@ our %disabled = ( # "what" => "comment" "weak-ssl-ciphers" => "default", "zlib" => "default", "zlib-dynamic" => "default", + "ktls" => "default", ); # Note: => pair form used for aesthetics, not to truly make a hash table @@ -1580,6 +1582,33 @@ unless ($disabled{devcryptoeng}) { } } +unless ($disabled{ktls}) { + $config{ktls}=""; + if ($target =~ m/^linux/) { + my $usr = "/usr/$config{cross_compile_prefix}"; + chop($usr); + if ($config{cross_compile_prefix} eq "") { + $usr = "/usr"; + } + my $minver = (4 << 16) + (13 << 8) + 0; + my @verstr = split(" ",`cat $usr/include/linux/version.h | grep LINUX_VERSION_CODE`); + + if ($verstr[2] < $minver) { + disable('too-old-kernel', 'ktls'); + } + } elsif ($target =~ m/^BSD/) { + my $cc = $config{CROSS_COMPILE}.$config{CC}; + system("printf '#include \n#include ' | $cc -E - >/dev/null 2>&1"); + if ($? != 0) { + disable('too-old-freebsd', 'ktls'); + } + } else { + disable('not-linux-or-freebsd', 'ktls'); + } +} + +push @{$config{openssl_other_defines}}, "OPENSSL_NO_KTLS" if ($disabled{ktls}); + # Get the extra flags used when building shared libraries and modules. We # do this late because some of them depend on %disabled. diff --git a/crypto/openssl/INSTALL b/crypto/openssl/INSTALL index f5118428b3bc..be84f2aa8e5d 100644 --- a/crypto/openssl/INSTALL +++ b/crypto/openssl/INSTALL @@ -262,6 +262,15 @@ Don't build the AFALG engine. This option will be forced if on a platform that does not support AFALG. + enable-ktls + Build with Kernel TLS support. This option will enable the + use of the Kernel TLS data-path, which can improve + performance and allow for the use of sendfile and splice + system calls on TLS sockets. The Kernel may use TLS + accelerators if any are available on the system. + This option will be forced off on systems that do not support + the Kernel TLS data-path. + enable-asan Build with the Address sanitiser. This is a developer option only. It may not work on all platforms and should never be diff --git a/crypto/openssl/apps/s_client.c b/crypto/openssl/apps/s_client.c index 83b3fc9c7f13..68bd9ced015f 100644 --- a/crypto/openssl/apps/s_client.c +++ b/crypto/openssl/apps/s_client.c @@ -3282,6 +3282,12 @@ static void print_stuff(BIO *bio, SSL *s, int full) BIO_printf(bio, "Expansion: %s\n", expansion ? SSL_COMP_get_name(expansion) : "NONE"); #endif +#ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_send(SSL_get_wbio(s))) + BIO_printf(bio_err, "Using Kernel TLS for sending\n"); + if (BIO_get_ktls_recv(SSL_get_rbio(s))) + BIO_printf(bio_err, "Using Kernel TLS for receiving\n"); +#endif #ifdef SSL_DEBUG { diff --git a/crypto/openssl/apps/s_server.c b/crypto/openssl/apps/s_server.c index 0ba75999fd28..ddc0b4bcd76d 100644 --- a/crypto/openssl/apps/s_server.c +++ b/crypto/openssl/apps/s_server.c @@ -2923,6 +2923,12 @@ static void print_connection_info(SSL *con) } OPENSSL_free(exportedkeymat); } +#ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_send(SSL_get_wbio(con))) + BIO_printf(bio_err, "Using Kernel TLS for sending\n"); + if (BIO_get_ktls_recv(SSL_get_rbio(con))) + BIO_printf(bio_err, "Using Kernel TLS for receiving\n"); +#endif (void)BIO_flush(bio_s_out); } diff --git a/crypto/openssl/crypto/bio/b_sock2.c b/crypto/openssl/crypto/bio/b_sock2.c index 335dfabc6180..80ef348d9254 100644 --- a/crypto/openssl/crypto/bio/b_sock2.c +++ b/crypto/openssl/crypto/bio/b_sock2.c @@ -12,6 +12,7 @@ #include #include "bio_local.h" +#include "internal/ktls.h" #include @@ -50,6 +51,17 @@ int BIO_socket(int domain, int socktype, int protocol, int options) BIOerr(BIO_F_BIO_SOCKET, BIO_R_UNABLE_TO_CREATE_SOCKET); return INVALID_SOCKET; } +# ifndef OPENSSL_NO_KTLS + { + /* + * The new socket is created successfully regardless of ktls_enable. + * ktls_enable doesn't change any functionality of the socket, except + * changing the setsockopt to enable the processing of ktls_start. + * Thus, it is not a problem to call it for non-TLS sockets. + */ + ktls_enable(sock); + } +# endif return sock; } diff --git a/crypto/openssl/crypto/bio/bss_conn.c b/crypto/openssl/crypto/bio/bss_conn.c index 807a82b23ba2..d4786442803e 100644 --- a/crypto/openssl/crypto/bio/bss_conn.c +++ b/crypto/openssl/crypto/bio/bss_conn.c @@ -11,6 +11,7 @@ #include #include "bio_local.h" +#include "internal/ktls.h" #ifndef OPENSSL_NO_SOCK @@ -20,6 +21,9 @@ typedef struct bio_connect_st { char *param_hostname; char *param_service; int connect_mode; +# ifndef OPENSSL_NO_KTLS + unsigned char record_type; +# endif BIO_ADDRINFO *addr_first; const BIO_ADDRINFO *addr_iter; @@ -320,7 +324,12 @@ static int conn_read(BIO *b, char *out, int outl) if (out != NULL) { clear_socket_error(); - ret = readsocket(b->num, out, outl); +# ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_recv(b)) + ret = ktls_read_record(b->num, out, outl); + else +# endif + ret = readsocket(b->num, out, outl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -345,7 +354,16 @@ static int conn_write(BIO *b, const char *in, int inl) } clear_socket_error(); - ret = writesocket(b->num, in, inl); +# ifndef OPENSSL_NO_KTLS + if (BIO_should_ktls_ctrl_msg_flag(b)) { + ret = ktls_send_ctrl_message(b->num, data->record_type, in, inl); + if (ret >= 0) { + ret = inl; + BIO_clear_ktls_ctrl_msg_flag(b); + } + } else +# endif + ret = writesocket(b->num, in, inl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -361,6 +379,9 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) const char **pptr = NULL; long ret = 1; BIO_CONNECT *data; +# ifndef OPENSSL_NO_KTLS + ktls_crypto_info_t *crypto_info; +# endif data = (BIO_CONNECT *)b->ptr; @@ -520,6 +541,27 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_CTRL_EOF: ret = (b->flags & BIO_FLAGS_IN_EOF) != 0 ? 1 : 0; break; +# ifndef OPENSSL_NO_KTLS + case BIO_CTRL_SET_KTLS: + crypto_info = (ktls_crypto_info_t *)ptr; + ret = ktls_start(b->num, crypto_info, num); + if (ret) + BIO_set_ktls_flag(b, num); + break; + case BIO_CTRL_GET_KTLS_SEND: + return BIO_should_ktls_flag(b, 1); + case BIO_CTRL_GET_KTLS_RECV: + return BIO_should_ktls_flag(b, 0); + case BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG: + BIO_set_ktls_ctrl_msg_flag(b); + data->record_type = num; + ret = 0; + break; + case BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG: + BIO_clear_ktls_ctrl_msg_flag(b); + ret = 0; + break; +# endif default: ret = 0; break; diff --git a/crypto/openssl/crypto/bio/bss_sock.c b/crypto/openssl/crypto/bio/bss_sock.c index 6251f3d46a17..a1fc23c7c938 100644 --- a/crypto/openssl/crypto/bio/bss_sock.c +++ b/crypto/openssl/crypto/bio/bss_sock.c @@ -11,6 +11,7 @@ #include #include "bio_local.h" #include "internal/cryptlib.h" +#include "internal/ktls.h" #ifndef OPENSSL_NO_SOCK @@ -64,6 +65,17 @@ BIO *BIO_new_socket(int fd, int close_flag) if (ret == NULL) return NULL; BIO_set_fd(ret, fd, close_flag); +# ifndef OPENSSL_NO_KTLS + { + /* + * The new socket is created successfully regardless of ktls_enable. + * ktls_enable doesn't change any functionality of the socket, except + * changing the setsockopt to enable the processing of ktls_start. + * Thus, it is not a problem to call it for non-TLS sockets. + */ + ktls_enable(fd); + } +# endif return ret; } @@ -96,7 +108,12 @@ static int sock_read(BIO *b, char *out, int outl) if (out != NULL) { clear_socket_error(); - ret = readsocket(b->num, out, outl); +# ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_recv(b)) + ret = ktls_read_record(b->num, out, outl); + else +# endif + ret = readsocket(b->num, out, outl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -110,10 +127,20 @@ static int sock_read(BIO *b, char *out, int outl) static int sock_write(BIO *b, const char *in, int inl) { - int ret; + int ret = 0; clear_socket_error(); - ret = writesocket(b->num, in, inl); +# ifndef OPENSSL_NO_KTLS + if (BIO_should_ktls_ctrl_msg_flag(b)) { + unsigned char record_type = (intptr_t)b->ptr; + ret = ktls_send_ctrl_message(b->num, record_type, in, inl); + if (ret >= 0) { + ret = inl; + BIO_clear_ktls_ctrl_msg_flag(b); + } + } else +# endif + ret = writesocket(b->num, in, inl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -126,6 +153,9 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) { long ret = 1; int *ip; +# ifndef OPENSSL_NO_KTLS + ktls_crypto_info_t *crypto_info; +# endif switch (cmd) { case BIO_C_SET_FD: @@ -153,6 +183,27 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_CTRL_FLUSH: ret = 1; break; +# ifndef OPENSSL_NO_KTLS + case BIO_CTRL_SET_KTLS: + crypto_info = (ktls_crypto_info_t *)ptr; + ret = ktls_start(b->num, crypto_info, num); + if (ret) + BIO_set_ktls_flag(b, num); + break; + case BIO_CTRL_GET_KTLS_SEND: + return BIO_should_ktls_flag(b, 1); + case BIO_CTRL_GET_KTLS_RECV: + return BIO_should_ktls_flag(b, 0); + case BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG: + BIO_set_ktls_ctrl_msg_flag(b); + b->ptr = (void *)num; + ret = 0; + break; + case BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG: + BIO_clear_ktls_ctrl_msg_flag(b); + ret = 0; + break; +# endif case BIO_CTRL_EOF: ret = (b->flags & BIO_FLAGS_IN_EOF) != 0 ? 1 : 0; break; diff --git a/crypto/openssl/crypto/err/openssl.txt b/crypto/openssl/crypto/err/openssl.txt index 815460b24f67..d547c45913d6 100644 --- a/crypto/openssl/crypto/err/openssl.txt +++ b/crypto/openssl/crypto/err/openssl.txt @@ -1318,6 +1318,7 @@ SSL_F_SSL_RENEGOTIATE:516:SSL_renegotiate SSL_F_SSL_RENEGOTIATE_ABBREVIATED:546:SSL_renegotiate_abbreviated SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT:320:* SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT:321:* +SSL_F_SSL_SENDFILE:639:SSL_sendfile SSL_F_SSL_SESSION_DUP:348:ssl_session_dup SSL_F_SSL_SESSION_NEW:189:SSL_SESSION_new SSL_F_SSL_SESSION_PRINT_FP:190:SSL_SESSION_print_fp diff --git a/crypto/openssl/crypto/evp/e_aes.c b/crypto/openssl/crypto/evp/e_aes.c index 405ddbf9bf09..4640c7528a20 100644 --- a/crypto/openssl/crypto/evp/e_aes.c +++ b/crypto/openssl/crypto/evp/e_aes.c @@ -2895,6 +2895,14 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) memcpy(ptr, c->buf, arg); return 1; + case EVP_CTRL_GET_IV: + if (gctx->iv_gen != 1) + return 0; + if (gctx->ivlen != arg) + return 0; + memcpy(ptr, gctx->iv, arg); + return 1; + case EVP_CTRL_GCM_SET_IV_FIXED: /* Special case: -1 length restores whole IV */ if (arg == -1) { diff --git a/crypto/openssl/doc/man3/BIO_ctrl.pod b/crypto/openssl/doc/man3/BIO_ctrl.pod index 2e438c3ce952..31b18b2879fe 100644 --- a/crypto/openssl/doc/man3/BIO_ctrl.pod +++ b/crypto/openssl/doc/man3/BIO_ctrl.pod @@ -5,7 +5,8 @@ BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close, BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending, -BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb +BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb, BIO_get_ktls_send, +BIO_get_ktls_recv - BIO control operations =head1 SYNOPSIS @@ -34,6 +35,9 @@ BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb int BIO_get_info_callback(BIO *b, BIO_info_cb **cbp); int BIO_set_info_callback(BIO *b, BIO_info_cb *cb); + int BIO_get_ktls_send(BIO *b); + int BIO_get_ktls_recv(BIO *b); + =head1 DESCRIPTION BIO_ctrl(), BIO_callback_ctrl(), BIO_ptr_ctrl() and BIO_int_ctrl() @@ -72,6 +76,11 @@ Not all BIOs support these calls. BIO_ctrl_pending() and BIO_ctrl_wpending() return a size_t type and are functions, BIO_pending() and BIO_wpending() are macros which call BIO_ctrl(). +BIO_get_ktls_send() returns 1 if the BIO is using the Kernel TLS data-path for +sending. Otherwise, it returns zero. +BIO_get_ktls_recv() returns 1 if the BIO is using the Kernel TLS data-path for +receiving. Otherwise, it returns zero. + =head1 RETURN VALUES BIO_reset() normally returns 1 for success and 0 or -1 for failure. File @@ -92,6 +101,11 @@ BIO_get_close() returns the close flag value: BIO_CLOSE or BIO_NOCLOSE. BIO_pending(), BIO_ctrl_pending(), BIO_wpending() and BIO_ctrl_wpending() return the amount of pending data. +BIO_get_ktls_send() returns 1 if the BIO is using the Kernel TLS data-path for +sending. Otherwise, it returns zero. +BIO_get_ktls_recv() returns 1 if the BIO is using the Kernel TLS data-path for +receiving. Otherwise, it returns zero. + =head1 NOTES BIO_flush(), because it can write data may return 0 or -1 indicating @@ -124,6 +138,11 @@ particular a return value of 0 can be returned if an operation is not supported, if an error occurred, if EOF has not been reached and in the case of BIO_seek() on a file BIO for a successful operation. +=head1 HISTORY + +The BIO_get_ktls_send() and BIO_get_ktls_recv() functions were added in +OpenSSL 3.0.0. + =head1 COPYRIGHT Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. diff --git a/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod b/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod index 85e3353e0e2c..27eaebad1ea0 100644 --- a/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod +++ b/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod @@ -114,6 +114,22 @@ enables this behaviour to allow interoperability with such broken implementations. Please note that setting this option breaks interoperability with correct implementations. This option only applies to DTLS over SCTP. +=item SSL_MODE_NO_KTLS_TX + +Disable the use of the kernel TLS egress data-path. +By default kernel TLS is enabled if it is supported by the negotiated ciphersuites +and extensions and OpenSSL has been compiled with support for it. +The kernel TLS data-path implements the record layer, +and the crypto algorithm. The kernel will utilize the best hardware +available for crypto. Using the kernel data-path should reduce the memory +footprint of OpenSSL because no buffering is required. Also, the throughput +should improve because data copy is avoided when user data is encrypted into +kernel memory instead of the usual encrypt than copy to kernel. + +Kernel TLS might not support all the features of OpenSSL. For instance, +renegotiation, and setting the maximum fragment size is not possible as of +Linux 4.20. + =back All modes are off by default except for SSL_MODE_AUTO_RETRY which is on by @@ -134,6 +150,7 @@ L, L =head1 HISTORY SSL_MODE_ASYNC was added in OpenSSL 1.1.0. +SSL_MODE_NO_KTLS_TX was first added to OpenSSL 3.0.0. =head1 COPYRIGHT diff --git a/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod b/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod index 13e56f0c57f6..247a39fc0355 100644 --- a/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod +++ b/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod @@ -16,7 +16,7 @@ SSL_set_block_padding - install callback to specify TLS 1.3 record padding #include void SSL_CTX_set_record_padding_callback(SSL_CTX *ctx, size_t (*cb)(SSL *s, int type, size_t len, void *arg)); - void SSL_set_record_padding_callback(SSL *ssl, size_t (*cb)(SSL *s, int type, size_t len, void *arg)); + int SSL_set_record_padding_callback(SSL *ssl, size_t (*cb)(SSL *s, int type, size_t len, void *arg)); void SSL_CTX_set_record_padding_callback_arg(SSL_CTX *ctx, void *arg); void *SSL_CTX_get_record_padding_callback_arg(const SSL_CTX *ctx); @@ -32,6 +32,8 @@ SSL_set_block_padding - install callback to specify TLS 1.3 record padding SSL_CTX_set_record_padding_callback() or SSL_set_record_padding_callback() can be used to assign a callback function I to specify the padding for TLS 1.3 records. The value set in B is copied to a new SSL by SSL_new(). +Kernel TLS is not possible if the record padding callback is set, and the callback +function cannot be set if Kernel TLS is already configured for the current SSL object. SSL_CTX_set_record_padding_callback_arg() and SSL_set_record_padding_callback_arg() assign a value B that is passed to the callback when it is invoked. The value @@ -64,6 +66,9 @@ indicates no padding will be added. A return value that causes the record to exceed the maximum record size (SSL3_RT_MAX_PLAIN_LENGTH) will pad out to the maximum record size. +The SSL_CTX_get_record_padding_callback_arg() function returns 1 on success or 0 if +the callback function is not set because Kernel TLS is configured for the SSL object. + =head1 NOTES The default behavior is to add no padding to the record. @@ -84,6 +89,9 @@ L, L The record padding API was added for TLS 1.3 support in OpenSSL 1.1.1. +The return type of SSL_CTX_set_record_padding_callback() function was +changed to int in OpenSSL 3.0. + =head1 COPYRIGHT Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved. diff --git a/crypto/openssl/doc/man3/SSL_write.pod b/crypto/openssl/doc/man3/SSL_write.pod index 5e3ce1e7e4dd..20c7953deb06 100644 --- a/crypto/openssl/doc/man3/SSL_write.pod +++ b/crypto/openssl/doc/man3/SSL_write.pod @@ -2,12 +2,13 @@ =head1 NAME -SSL_write_ex, SSL_write - write bytes to a TLS/SSL connection +SSL_write_ex, SSL_write, SSL_sendfile - write bytes to a TLS/SSL connection =head1 SYNOPSIS #include + ossl_ssize_t SSL_sendfile(SSL *s, int fd, off_t offset, size_t size, int flags); int SSL_write_ex(SSL *s, const void *buf, size_t num, size_t *written); int SSL_write(SSL *ssl, const void *buf, int num); @@ -17,6 +18,14 @@ SSL_write_ex() and SSL_write() write B bytes from the buffer B into the specified B connection. On success SSL_write_ex() will store the number of bytes written in B<*written>. +SSL_sendfile() writes B bytes from offset B in the file +descriptor B to the specified SSL connection B. This function provides +efficient zero-copy semantics. SSL_sendfile() is available only when +Kernel TLS is enabled, which can be checked by calling BIO_get_ktls_send(). +It is provided here to allow users to maintain the same interface. +The meaning of B is platform dependent. +Currently, under Linux it is ignored. + =head1 NOTES In the paragraphs below a "write function" is defined as one of either @@ -104,17 +113,35 @@ You should instead call SSL_get_error() to find out if it's retryable. =back +For SSL_sendfile(), the following return values can occur: + +=over 4 + +=item Z<>>= 0 + +The write operation was successful, the return value is the number +of bytes of the file written to the TLS/SSL connection. + +=item E 0 + +The write operation was not successful, because either the connection was +closed, an error occured or action must be taken by the calling process. +Call SSL_get_error() with the return value to find out the reason. + +=back + =head1 SEE ALSO L, L, L L, L, L, L -L, +L, L, L, L =head1 HISTORY The SSL_write_ex() function was added in OpenSSL 1.1.1. +The SSL_sendfile() function was added in OpenSSL 3.0.0. =head1 COPYRIGHT diff --git a/crypto/openssl/engines/e_afalg.c b/crypto/openssl/engines/e_afalg.c index 4b1722846133..5ef3a8d457e6 100644 --- a/crypto/openssl/engines/e_afalg.c +++ b/crypto/openssl/engines/e_afalg.c @@ -407,7 +407,7 @@ static int afalg_start_cipher_sk(afalg_ctx *actx, const unsigned char *in, size_t inl, const unsigned char *iv, unsigned int enc) { - struct msghdr msg = { 0 }; + struct msghdr msg; struct cmsghdr *cmsg; struct iovec iov; ssize_t sbytes; @@ -416,6 +416,7 @@ static int afalg_start_cipher_sk(afalg_ctx *actx, const unsigned char *in, # endif char cbuf[CMSG_SPACE(ALG_IV_LEN(ALG_AES_IV_LEN)) + CMSG_SPACE(ALG_OP_LEN)]; + memset(&msg, 0, sizeof(msg)); memset(cbuf, 0, sizeof(cbuf)); msg.msg_control = cbuf; msg.msg_controllen = sizeof(cbuf); diff --git a/crypto/openssl/include/internal/bio.h b/crypto/openssl/include/internal/bio.h index c343b276295c..521b5fa2198f 100644 --- a/crypto/openssl/include/internal/bio.h +++ b/crypto/openssl/include/internal/bio.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#ifndef HEADER_INTERNAL_BIO_H +# define HEADER_INTERNAL_BIO_H + #include struct bio_method_st { @@ -31,3 +34,39 @@ void bio_cleanup(void); /* Old style to new style BIO_METHOD conversion functions */ int bwrite_conv(BIO *bio, const char *data, size_t datal, size_t *written); int bread_conv(BIO *bio, char *data, size_t datal, size_t *read); + +/* Changes to these internal BIOs must also update include/openssl/bio.h */ +# define BIO_CTRL_SET_KTLS 72 +# define BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG 74 +# define BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG 75 + +/* + * This is used with socket BIOs: + * BIO_FLAGS_KTLS_TX means we are using ktls with this BIO for sending. + * BIO_FLAGS_KTLS_TX_CTRL_MSG means we are about to send a ctrl message next. + * BIO_FLAGS_KTLS_RX means we are using ktls with this BIO for receiving. + */ +# define BIO_FLAGS_KTLS_TX 0x800 +# define BIO_FLAGS_KTLS_TX_CTRL_MSG 0x1000 +# define BIO_FLAGS_KTLS_RX 0x2000 + +/* KTLS related controls and flags */ +# define BIO_set_ktls_flag(b, is_tx) \ + BIO_set_flags(b, (is_tx) ? BIO_FLAGS_KTLS_TX : BIO_FLAGS_KTLS_RX) +# define BIO_should_ktls_flag(b, is_tx) \ + BIO_test_flags(b, (is_tx) ? BIO_FLAGS_KTLS_TX : BIO_FLAGS_KTLS_RX) +# define BIO_set_ktls_ctrl_msg_flag(b) \ + BIO_set_flags(b, BIO_FLAGS_KTLS_TX_CTRL_MSG) +# define BIO_should_ktls_ctrl_msg_flag(b) \ + BIO_test_flags(b, BIO_FLAGS_KTLS_TX_CTRL_MSG) +# define BIO_clear_ktls_ctrl_msg_flag(b) \ + BIO_clear_flags(b, BIO_FLAGS_KTLS_TX_CTRL_MSG) + +# define BIO_set_ktls(b, keyblob, is_tx) \ + BIO_ctrl(b, BIO_CTRL_SET_KTLS, is_tx, keyblob) +# define BIO_set_ktls_ctrl_msg(b, record_type) \ + BIO_ctrl(b, BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG, record_type, NULL) +# define BIO_clear_ktls_ctrl_msg(b) \ + BIO_ctrl(b, BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG, 0, NULL) + +#endif diff --git a/crypto/openssl/include/internal/ktls.h b/crypto/openssl/include/internal/ktls.h new file mode 100644 index 000000000000..9032c0ed6174 --- /dev/null +++ b/crypto/openssl/include/internal/ktls.h @@ -0,0 +1,403 @@ +/* + * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (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 + */ + +#if defined(OPENSSL_SYS_LINUX) +# ifndef OPENSSL_NO_KTLS +# include +# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) +# define OPENSSL_NO_KTLS +# ifndef PEDANTIC +# warning "KTLS requires Kernel Headers >= 4.13.0" +# warning "Skipping Compilation of KTLS" +# endif +# endif +# endif +#endif + +#ifndef HEADER_INTERNAL_KTLS +# define HEADER_INTERNAL_KTLS +# ifndef OPENSSL_NO_KTLS + +# if defined(__FreeBSD__) +# include +# include +# include +# include +# include +# include "openssl/ssl3.h" + +# ifndef TCP_RXTLS_ENABLE +# define OPENSSL_NO_KTLS_RX +# endif +# define OPENSSL_KTLS_AES_GCM_128 +# define OPENSSL_KTLS_AES_GCM_256 +# define OPENSSL_KTLS_TLS13 + +/* + * Only used by the tests in sslapitest.c. + */ +# define TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE 8 +# define TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE 8 + +typedef struct tls_enable ktls_crypto_info_t; + +/* + * FreeBSD does not require any additional steps to enable KTLS before + * setting keys. + */ +static ossl_inline int ktls_enable(int fd) +{ + return 1; +} + +/* + * The TCP_TXTLS_ENABLE socket option marks the outgoing socket buffer + * as using TLS. If successful, then data sent using this socket will + * be encrypted and encapsulated in TLS records using the tls_en + * provided here. + * + * The TCP_RXTLS_ENABLE socket option marks the incoming socket buffer + * as using TLS. If successful, then data received for this socket will + * be authenticated and decrypted using the tls_en provided here. + */ +static ossl_inline int ktls_start(int fd, ktls_crypto_info_t *tls_en, int is_tx) +{ + if (is_tx) + return setsockopt(fd, IPPROTO_TCP, TCP_TXTLS_ENABLE, + tls_en, sizeof(*tls_en)) ? 0 : 1; +# ifndef OPENSSL_NO_KTLS_RX + return setsockopt(fd, IPPROTO_TCP, TCP_RXTLS_ENABLE, tls_en, + sizeof(*tls_en)) ? 0 : 1; +# else + return 0; +# endif +} + +/* + * Send a TLS record using the tls_en provided in ktls_start and use + * record_type instead of the default SSL3_RT_APPLICATION_DATA. + * When the socket is non-blocking, then this call either returns EAGAIN or + * the entire record is pushed to TCP. It is impossible to send a partial + * record using this control message. + */ +static ossl_inline int ktls_send_ctrl_message(int fd, unsigned char record_type, + const void *data, size_t length) +{ + struct msghdr msg = { 0 }; + int cmsg_len = sizeof(record_type); + struct cmsghdr *cmsg; + char buf[CMSG_SPACE(cmsg_len)]; + struct iovec msg_iov; /* Vector of data to send/receive into */ + + msg.msg_control = buf; + msg.msg_controllen = sizeof(buf); + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_TCP; + cmsg->cmsg_type = TLS_SET_RECORD_TYPE; + cmsg->cmsg_len = CMSG_LEN(cmsg_len); + *((unsigned char *)CMSG_DATA(cmsg)) = record_type; + msg.msg_controllen = cmsg->cmsg_len; + + msg_iov.iov_base = (void *)data; + msg_iov.iov_len = length; + msg.msg_iov = &msg_iov; + msg.msg_iovlen = 1; + + return sendmsg(fd, &msg, 0); +} + +# ifdef OPENSSL_NO_KTLS_RX + +static ossl_inline int ktls_read_record(int fd, void *data, size_t length) +{ + return -1; +} + +# else /* !defined(OPENSSL_NO_KTLS_RX) */ + +/* + * Receive a TLS record using the tls_en provided in ktls_start. The + * kernel strips any explicit IV and authentication tag, but provides + * the TLS record header via a control message. If there is an error + * with the TLS record such as an invalid header, invalid padding, or + * authentication failure recvmsg() will fail with an error. + */ +static ossl_inline int ktls_read_record(int fd, void *data, size_t length) +{ + struct msghdr msg = { 0 }; + int cmsg_len = sizeof(struct tls_get_record); + struct tls_get_record *tgr; + struct cmsghdr *cmsg; + char buf[CMSG_SPACE(cmsg_len)]; + struct iovec msg_iov; /* Vector of data to send/receive into */ + int ret; + unsigned char *p = data; + const size_t prepend_length = SSL3_RT_HEADER_LENGTH; + + if (length <= prepend_length) { + errno = EINVAL; + return -1; + } + + msg.msg_control = buf; + msg.msg_controllen = sizeof(buf); + + msg_iov.iov_base = p + prepend_length; + msg_iov.iov_len = length - prepend_length; + msg.msg_iov = &msg_iov; + msg.msg_iovlen = 1; + + ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + return ret; + + if ((msg.msg_flags & (MSG_EOR | MSG_CTRUNC)) != MSG_EOR) { + errno = EMSGSIZE; + return -1; + } + + if (msg.msg_controllen == 0) { + errno = EBADMSG; + return -1; + } + + cmsg = CMSG_FIRSTHDR(&msg); + if (cmsg->cmsg_level != IPPROTO_TCP || cmsg->cmsg_type != TLS_GET_RECORD + || cmsg->cmsg_len != CMSG_LEN(cmsg_len)) { + errno = EBADMSG; + return -1; + } + + tgr = (struct tls_get_record *)CMSG_DATA(cmsg); + p[0] = tgr->tls_type; + p[1] = tgr->tls_vmajor; + p[2] = tgr->tls_vminor; + *(uint16_t *)(p + 3) = htons(ret); + + return ret + prepend_length; +} + +# endif /* OPENSSL_NO_KTLS_RX */ + +/* + * KTLS enables the sendfile system call to send data from a file over + * TLS. + */ +static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off, + size_t size, int flags) +{ + off_t sbytes; + int ret; + + ret = sendfile(fd, s, off, size, NULL, &sbytes, flags); + if (ret == -1) { + if (errno == EAGAIN && sbytes != 0) + return sbytes; + return -1; + } + return sbytes; +} + +# endif /* __FreeBSD__ */ + +# if defined(OPENSSL_SYS_LINUX) + +# include +# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) +# define OPENSSL_NO_KTLS_RX +# ifndef PEDANTIC +# warning "KTLS requires Kernel Headers >= 4.17.0 for receiving" +# warning "Skipping Compilation of KTLS receive data path" +# endif +# endif +# define OPENSSL_KTLS_AES_GCM_128 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +# define OPENSSL_KTLS_AES_GCM_256 +# define OPENSSL_KTLS_TLS13 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) +# define OPENSSL_KTLS_AES_CCM_128 +# endif +# endif + +# include +# include +# include +# include "openssl/ssl3.h" +# include "openssl/tls1.h" +# include "openssl/evp.h" + +# ifndef SOL_TLS +# define SOL_TLS 282 +# endif + +# ifndef TCP_ULP +# define TCP_ULP 31 +# endif + +# ifndef TLS_RX +# define TLS_RX 2 +# endif + +struct tls_crypto_info_all { *** 1677 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Feb 5 00:04: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 9B0E4534558; Fri, 5 Feb 2021 00:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWwdZ1Dq6z3QJ5; Fri, 5 Feb 2021 00:04: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 06DF3150C7; Fri, 5 Feb 2021 00:04: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 11504XlX026857; Fri, 5 Feb 2021 00:04:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11504X09026856; Fri, 5 Feb 2021 00:04:33 GMT (envelope-from git) Date: Fri, 5 Feb 2021 00:04:33 GMT Message-Id: <202102050004.11504X09026856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3e09120f7984 - stable/13 - OpenSSL: Regenerate manual pages. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e09120f7984c990530d6e6860941ffb1e281f8b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:04:36 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3e09120f7984c990530d6e6860941ffb1e281f8b commit 3e09120f7984c990530d6e6860941ffb1e281f8b Author: Jung-uk Kim AuthorDate: 2021-01-26 22:26:51 +0000 Commit: John Baldwin CommitDate: 2021-02-05 00:03:21 +0000 OpenSSL: Regenerate manual pages. (cherry picked from commit bb8acd558e66bd4bae31602fcbe569863f47382c) --- secure/lib/libcrypto/man/man3/ADMISSIONS.3 | 2 +- .../libcrypto/man/man3/ASN1_INTEGER_get_int64.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 | 2 +- .../lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 | 2 +- .../lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 | 2 +- .../lib/libcrypto/man/man3/ASN1_generate_nconf.3 | 2 +- secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/ASYNC_start_job.3 | 2 +- secure/lib/libcrypto/man/man3/BF_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ADDR.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_connect.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ctrl.3 | 23 +- secure/lib/libcrypto/man/man3/BIO_f_base64.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_f_buffer.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_md.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_null.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_f_ssl.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_find_type.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_get_data.3 | 2 +- .../lib/libcrypto/man/man3/BIO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 | 280 +++++++++++++++++++++ secure/lib/libcrypto/man/man3/BIO_get_ktls_send.3 | 280 +++++++++++++++++++++ secure/lib/libcrypto/man/man3/BIO_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_new.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_new_CMS.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_printf.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_push.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_read.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_accept.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_bio.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_connect.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_fd.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_file.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_mem.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_null.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_s_socket.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_set_callback.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_should_retry.3 | 2 +- secure/lib/libcrypto/man/man3/BN_BLINDING_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_CTX_start.3 | 2 +- secure/lib/libcrypto/man/man3/BN_add.3 | 2 +- secure/lib/libcrypto/man/man3/BN_add_word.3 | 2 +- secure/lib/libcrypto/man/man3/BN_bn2bin.3 | 2 +- secure/lib/libcrypto/man/man3/BN_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/BN_copy.3 | 2 +- secure/lib/libcrypto/man/man3/BN_generate_prime.3 | 2 +- secure/lib/libcrypto/man/man3/BN_mod_inverse.3 | 4 +- .../lib/libcrypto/man/man3/BN_mod_mul_montgomery.3 | 2 +- .../lib/libcrypto/man/man3/BN_mod_mul_reciprocal.3 | 2 +- secure/lib/libcrypto/man/man3/BN_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_num_bytes.3 | 2 +- secure/lib/libcrypto/man/man3/BN_rand.3 | 2 +- secure/lib/libcrypto/man/man3/BN_security_bits.3 | 4 +- secure/lib/libcrypto/man/man3/BN_set_bit.3 | 2 +- secure/lib/libcrypto/man/man3/BN_swap.3 | 4 +- secure/lib/libcrypto/man/man3/BN_zero.3 | 2 +- secure/lib/libcrypto/man/man3/BUF_MEM_new.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add0_cert.3 | 2 +- .../libcrypto/man/man3/CMS_add1_recipient_cert.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add1_signer.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_compress.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_decrypt.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_encrypt.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_final.3 | 4 +- .../libcrypto/man/man3/CMS_get0_RecipientInfos.3 | 2 +- .../lib/libcrypto/man/man3/CMS_get0_SignerInfos.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_type.3 | 2 +- .../libcrypto/man/man3/CMS_get1_ReceiptRequest.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_sign.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_sign_receipt.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_uncompress.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_verify.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_verify_receipt.3 | 4 +- secure/lib/libcrypto/man/man3/CONF_modules_free.3 | 2 +- .../libcrypto/man/man3/CONF_modules_load_file.3 | 2 +- .../libcrypto/man/man3/CRYPTO_THREAD_run_once.3 | 2 +- .../libcrypto/man/man3/CRYPTO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_memcmp.3 | 4 +- .../man/man3/CTLOG_STORE_get0_log_by_id.3 | 4 +- secure/lib/libcrypto/man/man3/CTLOG_STORE_new.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_new.3 | 2 +- .../libcrypto/man/man3/CT_POLICY_EVAL_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/DEFINE_STACK_OF.3 | 2 +- secure/lib/libcrypto/man/man3/DES_random_key.3 | 2 +- secure/lib/libcrypto/man/man3/DH_generate_key.3 | 2 +- .../libcrypto/man/man3/DH_generate_parameters.3 | 2 +- secure/lib/libcrypto/man/man3/DH_get0_pqg.3 | 2 +- secure/lib/libcrypto/man/man3/DH_get_1024_160.3 | 2 +- secure/lib/libcrypto/man/man3/DH_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/DH_new.3 | 2 +- secure/lib/libcrypto/man/man3/DH_new_by_nid.3 | 2 +- secure/lib/libcrypto/man/man3/DH_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/DH_size.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_SIG_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_do_sign.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_dup_DH.3 | 4 +- secure/lib/libcrypto/man/man3/DSA_generate_key.3 | 4 +- .../libcrypto/man/man3/DSA_generate_parameters.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_get0_pqg.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_sign.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_size.3 | 2 +- secure/lib/libcrypto/man/man3/DTLS_get_data_mtu.3 | 4 +- secure/lib/libcrypto/man/man3/DTLS_set_timer_cb.3 | 2 +- secure/lib/libcrypto/man/man3/DTLSv1_listen.3 | 2 +- secure/lib/libcrypto/man/man3/ECDSA_SIG_new.3 | 2 +- .../lib/libcrypto/man/man3/ECPKParameters_print.3 | 2 +- .../lib/libcrypto/man/man3/EC_GFp_simple_method.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GROUP_copy.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GROUP_new.3 | 2 +- .../lib/libcrypto/man/man3/EC_KEY_get_enc_flags.3 | 2 +- secure/lib/libcrypto/man/man3/EC_KEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/EC_POINT_add.3 | 2 +- secure/lib/libcrypto/man/man3/EC_POINT_new.3 | 2 +- secure/lib/libcrypto/man/man3/ENGINE_add.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_GET_LIB.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_clear_error.3 | 4 +- secure/lib/libcrypto/man/man3/ERR_error_string.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_get_error.3 | 2 +- .../libcrypto/man/man3/ERR_load_crypto_strings.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_load_strings.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_print_errors.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_put_error.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_remove_state.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_set_mark.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_BytesToKey.3 | 4 +- .../man/man3/EVP_CIPHER_CTX_get_cipher_data.3 | 2 +- .../lib/libcrypto/man/man3/EVP_CIPHER_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestSignInit.3 | 2 +- .../lib/libcrypto/man/man3/EVP_DigestVerifyInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_EncodeInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_EncryptInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_MD_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_OpenInit.3 | 2 +- .../lib/libcrypto/man/man3/EVP_PKEY_ASN1_METHOD.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_ctrl.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_new.3 | 2 +- .../man/man3/EVP_PKEY_CTX_set1_pbe_pass.3 | 4 +- .../libcrypto/man/man3/EVP_PKEY_CTX_set_hkdf_md.3 | 2 +- .../man/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_CTX_set_scrypt_N.3 | 2 +- .../man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_asn1_get_count.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_derive.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_encrypt.3 | 2 +- .../man/man3/EVP_PKEY_get_default_digest_nid.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_PKEY_keygen.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_meth_get_count.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_new.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_print_private.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_set1_RSA.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_sign.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_size.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_verify.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_verify_recover.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_SealInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_SignInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_VerifyInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_aes.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_aria.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_bf_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_blake2b512.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_camellia.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_cast5_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_chacha20.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_des.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_desx_cbc.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_idea_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md2.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_md4.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_md5.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_mdc2.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_rc2_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc4.3 | 2 +- .../lib/libcrypto/man/man3/EVP_rc5_32_12_16_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_ripemd160.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_seed_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha1.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_sha224.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha3_224.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sm3.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_sm4_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_whirlpool.3 | 4 +- secure/lib/libcrypto/man/man3/HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/MD5.3 | 2 +- secure/lib/libcrypto/man/man3/MDC2_Init.3 | 2 +- secure/lib/libcrypto/man/man3/Makefile | 3 + secure/lib/libcrypto/man/man3/OBJ_nid2obj.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_REQUEST_new.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_cert_to_id.3 | 2 +- .../libcrypto/man/man3/OCSP_request_add1_nonce.3 | 2 +- .../lib/libcrypto/man/man3/OCSP_resp_find_status.3 | 2 +- .../lib/libcrypto/man/man3/OCSP_response_status.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_sendreq_new.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_Applink.3 | 4 +- .../lib/libcrypto/man/man3/OPENSSL_LH_COMPFUNC.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_LH_stats.3 | 2 +- .../libcrypto/man/man3/OPENSSL_VERSION_NUMBER.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_config.3 | 2 +- .../lib/libcrypto/man/man3/OPENSSL_fork_prepare.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_ia32cap.3 | 4 +- .../lib/libcrypto/man/man3/OPENSSL_init_crypto.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_init_ssl.3 | 4 +- .../libcrypto/man/man3/OPENSSL_instrument_bus.3 | 2 +- .../man/man3/OPENSSL_load_builtin_modules.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_malloc.3 | 2 +- .../lib/libcrypto/man/man3/OPENSSL_secure_malloc.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_INFO.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_LOADER.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_SEARCH.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_expect.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_open.3 | 2 +- .../man/man3/OpenSSL_add_all_algorithms.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_bytes_read_bio.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_CMS.3 | 2 +- .../libcrypto/man/man3/PEM_read_bio_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_bio_ex.3 | 2 +- .../libcrypto/man/man3/PEM_write_bio_CMS_stream.3 | 4 +- .../man/man3/PEM_write_bio_PKCS7_stream.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS12_create.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS12_newpass.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS12_parse.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS5_PBKDF2_HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_decrypt.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS7_encrypt.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS7_sign.3 | 4 +- .../lib/libcrypto/man/man3/PKCS7_sign_add_signer.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS7_verify.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_generate.3 | 2 +- .../lib/libcrypto/man/man3/RAND_DRBG_get0_master.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_new.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_reseed.3 | 2 +- .../libcrypto/man/man3/RAND_DRBG_set_callbacks.3 | 2 +- .../lib/libcrypto/man/man3/RAND_DRBG_set_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_add.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_bytes.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_cleanup.3 | 4 +- secure/lib/libcrypto/man/man3/RAND_egd.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_load_file.3 | 2 +- .../lib/libcrypto/man/man3/RAND_set_rand_method.3 | 2 +- secure/lib/libcrypto/man/man3/RC4_set_key.3 | 2 +- secure/lib/libcrypto/man/man3/RIPEMD160_Init.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_blinding_on.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_check_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_generate_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_get0_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_new.3 | 2 +- .../man/man3/RSA_padding_add_PKCS1_type_1.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_print.3 | 2 +- .../lib/libcrypto/man/man3/RSA_private_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_public_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_sign.3 | 2 +- .../man/man3/RSA_sign_ASN1_OCTET_STRING.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_size.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_new.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_print.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_validate.3 | 2 +- secure/lib/libcrypto/man/man3/SHA256_Init.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_read_CMS.3 | 4 +- secure/lib/libcrypto/man/man3/SMIME_read_PKCS7.3 | 4 +- secure/lib/libcrypto/man/man3/SMIME_write_CMS.3 | 4 +- secure/lib/libcrypto/man/man3/SMIME_write_PKCS7.3 | 4 +- .../lib/libcrypto/man/man3/SSL_CIPHER_get_name.3 | 2 +- .../man/man3/SSL_COMP_add_compression_method.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_new.3 | 2 +- .../libcrypto/man/man3/SSL_CONF_CTX_set1_prefix.3 | 4 +- .../libcrypto/man/man3/SSL_CONF_CTX_set_flags.3 | 2 +- .../libcrypto/man/man3/SSL_CONF_CTX_set_ssl_ctx.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_cmd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_cmd_argv.3 | 4 +- .../libcrypto/man/man3/SSL_CTX_add1_chain_cert.3 | 2 +- .../man/man3/SSL_CTX_add_extra_chain_cert.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_add_session.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_config.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_ctrl.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_dane_enable.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_flush_sessions.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_CTX_free.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_CTX_get0_param.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_get_verify_mode.3 | 2 +- .../man/man3/SSL_CTX_has_client_custom_ext.3 | 4 +- .../man/man3/SSL_CTX_load_verify_locations.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_new.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_sess_number.3 | 2 +- .../man/man3/SSL_CTX_sess_set_cache_size.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_sess_set_get_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sessions.3 | 4 +- .../lib/libcrypto/man/man3/SSL_CTX_set0_CA_list.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set1_curves.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set1_sigalgs.3 | 2 +- .../man/man3/SSL_CTX_set1_verify_cert_store.3 | 2 +- .../man/man3/SSL_CTX_set_alpn_select_cb.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_cert_cb.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_cert_store.3 | 2 +- .../man/man3/SSL_CTX_set_cert_verify_callback.3 | 4 +- .../libcrypto/man/man3/SSL_CTX_set_cipher_list.3 | 2 +- .../man/man3/SSL_CTX_set_client_cert_cb.3 | 2 +- .../man/man3/SSL_CTX_set_client_hello_cb.3 | 2 +- .../man/man3/SSL_CTX_set_ct_validation_callback.3 | 2 +- .../man/man3/SSL_CTX_set_ctlog_list_file.3 | 2 +- .../man/man3/SSL_CTX_set_default_passwd_cb.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_ex_data.3 | 2 +- .../man/man3/SSL_CTX_set_generate_session_id.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_info_callback.3 | 2 +- .../man/man3/SSL_CTX_set_keylog_callback.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_max_cert_list.3 | 2 +- .../man/man3/SSL_CTX_set_min_proto_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_mode.3 | 20 +- .../libcrypto/man/man3/SSL_CTX_set_msg_callback.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_num_tickets.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_options.3 | 2 +- .../man/man3/SSL_CTX_set_psk_client_callback.3 | 2 +- .../man/man3/SSL_CTX_set_quiet_shutdown.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_read_ahead.3 | 2 +- .../man/man3/SSL_CTX_set_record_padding_callback.3 | 14 +- .../man/man3/SSL_CTX_set_security_level.3 | 2 +- .../man/man3/SSL_CTX_set_session_cache_mode.3 | 2 +- .../man/man3/SSL_CTX_set_session_id_context.3 | 2 +- .../man/man3/SSL_CTX_set_session_ticket_cb.3 | 2 +- .../man/man3/SSL_CTX_set_split_send_fragment.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_ssl_version.3 | 2 +- .../SSL_CTX_set_stateless_cookie_generate_cb.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_timeout.3 | 2 +- .../man3/SSL_CTX_set_tlsext_servername_callback.3 | 2 +- .../man/man3/SSL_CTX_set_tlsext_status_cb.3 | 2 +- .../man/man3/SSL_CTX_set_tlsext_ticket_key_cb.3 | 4 +- .../man/man3/SSL_CTX_set_tlsext_use_srtp.3 | 2 +- .../man/man3/SSL_CTX_set_tmp_dh_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_verify.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_use_certificate.3 | 2 +- .../man/man3/SSL_CTX_use_psk_identity_hint.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_use_serverinfo.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_free.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_get0_cipher.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_get0_hostname.3 | 2 +- .../man/man3/SSL_SESSION_get0_id_context.3 | 2 +- .../lib/libcrypto/man/man3/SSL_SESSION_get0_peer.3 | 4 +- .../man/man3/SSL_SESSION_get_compress_id.3 | 4 +- .../libcrypto/man/man3/SSL_SESSION_get_ex_data.3 | 2 +- .../man/man3/SSL_SESSION_get_protocol_version.3 | 2 +- .../lib/libcrypto/man/man3/SSL_SESSION_get_time.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_has_ticket.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_is_resumable.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_SESSION_print.3 | 2 +- .../lib/libcrypto/man/man3/SSL_SESSION_set1_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_accept.3 | 4 +- .../lib/libcrypto/man/man3/SSL_alert_type_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_alloc_buffers.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_check_chain.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_clear.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_connect.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_do_handshake.3 | 4 +- .../man/man3/SSL_export_keying_material.3 | 2 +- .../libcrypto/man/man3/SSL_extension_supported.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_free.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get0_peer_scts.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_SSL_CTX.3 | 4 +- .../lib/libcrypto/man/man3/SSL_get_all_async_fds.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_ciphers.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_client_random.3 | 2 +- .../libcrypto/man/man3/SSL_get_current_cipher.3 | 2 +- .../libcrypto/man/man3/SSL_get_default_timeout.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_error.3 | 4 +- .../lib/libcrypto/man/man3/SSL_get_extms_support.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_fd.3 | 2 +- .../libcrypto/man/man3/SSL_get_peer_cert_chain.3 | 2 +- .../libcrypto/man/man3/SSL_get_peer_certificate.3 | 4 +- .../man/man3/SSL_get_peer_signature_nid.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_peer_tmp_key.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_psk_identity.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_rbio.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_session.3 | 2 +- .../libcrypto/man/man3/SSL_get_shared_sigalgs.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_verify_result.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_in_init.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_key_update.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_library_init.3 | 2 +- .../libcrypto/man/man3/SSL_load_client_CA_file.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_pending.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_read.3 | 2 +- .../lib/libcrypto/man/man3/SSL_read_early_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_rstate_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_session_reused.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_set1_host.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_bio.3 | 2 +- .../lib/libcrypto/man/man3/SSL_set_connect_state.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_fd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_session.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_set_shutdown.3 | 2 +- .../lib/libcrypto/man/man3/SSL_set_verify_result.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_shutdown.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_state_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_want.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_write.3 | 29 ++- secure/lib/libcrypto/man/man3/UI_STRING.3 | 2 +- secure/lib/libcrypto/man/man3/UI_UTIL_read_pw.3 | 2 +- secure/lib/libcrypto/man/man3/UI_create_method.3 | 2 +- secure/lib/libcrypto/man/man3/UI_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509V3_get_d2i.3 | 2 +- secure/lib/libcrypto/man/man3/X509_ALGOR_dup.3 | 2 +- .../libcrypto/man/man3/X509_CRL_get0_by_serial.3 | 2 +- .../libcrypto/man/man3/X509_EXTENSION_set_object.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP.3 | 2 +- .../lib/libcrypto/man/man3/X509_LOOKUP_hash_dir.3 | 2 +- .../lib/libcrypto/man/man3/X509_LOOKUP_meth_new.3 | 2 +- .../man/man3/X509_NAME_ENTRY_get_object.3 | 2 +- .../man/man3/X509_NAME_add_entry_by_txt.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_get0_der.3 | 4 +- .../man/man3/X509_NAME_get_index_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_print_ex.3 | 2 +- secure/lib/libcrypto/man/man3/X509_PUBKEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_SIG_get0.3 | 2 +- .../libcrypto/man/man3/X509_STORE_CTX_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_new.3 | 2 +- .../man/man3/X509_STORE_CTX_set_verify_cb.3 | 2 +- .../lib/libcrypto/man/man3/X509_STORE_add_cert.3 | 2 +- .../lib/libcrypto/man/man3/X509_STORE_get0_param.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_new.3 | 2 +- .../man/man3/X509_STORE_set_verify_cb_func.3 | 2 +- .../man/man3/X509_VERIFY_PARAM_set_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_ca.3 | 4 +- secure/lib/libcrypto/man/man3/X509_check_host.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_issued.3 | 4 +- .../libcrypto/man/man3/X509_check_private_key.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_purpose.3 | 4 +- secure/lib/libcrypto/man/man3/X509_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/X509_cmp_time.3 | 2 +- secure/lib/libcrypto/man/man3/X509_digest.3 | 2 +- secure/lib/libcrypto/man/man3/X509_dup.3 | 2 +- .../lib/libcrypto/man/man3/X509_get0_notBefore.3 | 2 +- .../lib/libcrypto/man/man3/X509_get0_signature.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_uids.3 | 4 +- .../libcrypto/man/man3/X509_get_extension_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_pubkey.3 | 2 +- .../lib/libcrypto/man/man3/X509_get_serialNumber.3 | 2 +- .../lib/libcrypto/man/man3/X509_get_subject_name.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_version.3 | 2 +- secure/lib/libcrypto/man/man3/X509_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_sign.3 | 2 +- secure/lib/libcrypto/man/man3/X509_verify_cert.3 | 4 +- .../lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_DHparams.3 | 2 +- .../libcrypto/man/man3/d2i_PKCS8PrivateKey_bio.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_SSL_SESSION.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_X509.3 | 2 +- secure/lib/libcrypto/man/man3/i2d_CMS_bio_stream.3 | 4 +- .../lib/libcrypto/man/man3/i2d_PKCS7_bio_stream.3 | 4 +- secure/lib/libcrypto/man/man3/i2d_re_X509_tbs.3 | 2 +- secure/lib/libcrypto/man/man3/o2i_SCT_LIST.3 | 2 +- secure/lib/libcrypto/man/man5/x509v3_config.5 | 2 +- secure/lib/libcrypto/man/man7/Ed25519.7 | 2 +- secure/lib/libcrypto/man/man7/RAND.7 | 4 +- secure/lib/libcrypto/man/man7/RAND_DRBG.7 | 4 +- secure/lib/libcrypto/man/man7/RSA-PSS.7 | 4 +- secure/lib/libcrypto/man/man7/SM2.7 | 4 +- secure/lib/libcrypto/man/man7/X25519.7 | 2 +- secure/lib/libcrypto/man/man7/bio.7 | 4 +- secure/lib/libcrypto/man/man7/ct.7 | 4 +- secure/lib/libcrypto/man/man7/des_modes.7 | 4 +- secure/lib/libcrypto/man/man7/evp.7 | 4 +- secure/lib/libcrypto/man/man7/ossl_store-file.7 | 4 +- secure/lib/libcrypto/man/man7/ossl_store.7 | 4 +- .../lib/libcrypto/man/man7/passphrase-encoding.7 | 4 +- secure/lib/libcrypto/man/man7/proxy-certificates.7 | 4 +- secure/lib/libcrypto/man/man7/scrypt.7 | 4 +- secure/lib/libcrypto/man/man7/ssl.7 | 4 +- secure/lib/libcrypto/man/man7/x509.7 | 4 +- secure/usr.bin/openssl/man/CA.pl.1 | 4 +- secure/usr.bin/openssl/man/asn1parse.1 | 2 +- secure/usr.bin/openssl/man/ca.1 | 2 +- secure/usr.bin/openssl/man/ciphers.1 | 2 +- secure/usr.bin/openssl/man/cms.1 | 2 +- secure/usr.bin/openssl/man/crl.1 | 2 +- secure/usr.bin/openssl/man/crl2pkcs7.1 | 2 +- secure/usr.bin/openssl/man/dgst.1 | 2 +- secure/usr.bin/openssl/man/dhparam.1 | 2 +- secure/usr.bin/openssl/man/dsa.1 | 2 +- secure/usr.bin/openssl/man/dsaparam.1 | 2 +- secure/usr.bin/openssl/man/ec.1 | 2 +- secure/usr.bin/openssl/man/ecparam.1 | 2 +- secure/usr.bin/openssl/man/enc.1 | 2 +- secure/usr.bin/openssl/man/engine.1 | 2 +- secure/usr.bin/openssl/man/errstr.1 | 2 +- secure/usr.bin/openssl/man/gendsa.1 | 2 +- secure/usr.bin/openssl/man/genpkey.1 | 2 +- secure/usr.bin/openssl/man/genrsa.1 | 2 +- secure/usr.bin/openssl/man/list.1 | 2 +- secure/usr.bin/openssl/man/nseq.1 | 2 +- secure/usr.bin/openssl/man/ocsp.1 | 2 +- secure/usr.bin/openssl/man/openssl.1 | 4 +- secure/usr.bin/openssl/man/passwd.1 | 2 +- secure/usr.bin/openssl/man/pkcs12.1 | 2 +- secure/usr.bin/openssl/man/pkcs7.1 | 2 +- secure/usr.bin/openssl/man/pkcs8.1 | 2 +- secure/usr.bin/openssl/man/pkey.1 | 2 +- secure/usr.bin/openssl/man/pkeyparam.1 | 2 +- secure/usr.bin/openssl/man/pkeyutl.1 | 2 +- secure/usr.bin/openssl/man/prime.1 | 2 +- secure/usr.bin/openssl/man/rand.1 | 2 +- secure/usr.bin/openssl/man/req.1 | 2 +- secure/usr.bin/openssl/man/rsa.1 | 2 +- secure/usr.bin/openssl/man/rsautl.1 | 2 +- secure/usr.bin/openssl/man/s_client.1 | 2 +- secure/usr.bin/openssl/man/s_server.1 | 2 +- secure/usr.bin/openssl/man/s_time.1 | 2 +- secure/usr.bin/openssl/man/sess_id.1 | 2 +- secure/usr.bin/openssl/man/smime.1 | 2 +- secure/usr.bin/openssl/man/speed.1 | 2 +- secure/usr.bin/openssl/man/spkac.1 | 2 +- secure/usr.bin/openssl/man/srp.1 | 2 +- secure/usr.bin/openssl/man/storeutl.1 | 2 +- secure/usr.bin/openssl/man/ts.1 | 2 +- secure/usr.bin/openssl/man/tsget.1 | 2 +- secure/usr.bin/openssl/man/verify.1 | 2 +- secure/usr.bin/openssl/man/version.1 | 2 +- secure/usr.bin/openssl/man/x509.1 | 2 +- 537 files changed, 1269 insertions(+), 644 deletions(-) diff --git a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 index 787f87e8f013..048d4fc2b64b 100644 --- a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 +++ b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 index 4277347439b2..135a622a91c8 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 index f469ec947480..9ac1969ef577 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 index 3e36faa9efcc..f5a4c0f68510 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 index af133ca346e2..9b9613637d3a 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 index 1976aa20db2a..ad33ca4b7b2a 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 index 15a6dfc41f63..f2c2afe53015 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 index 193dd4715024..d2394acf12e7 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 index fc26c41498f0..562929c6cd9f 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 index bbcf08b8fdd4..930a32de6d33 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 index bb8ab5bebd01..c139f0a79d4a 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 index ab3b56231eba..b09d540d97e5 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 index f9bb9aea0fe9..0917cbf28d0a 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BF_encrypt.3 b/secure/lib/libcrypto/man/man3/BF_encrypt.3 index 263e9f4aee6a..1e67cea75097 100644 --- a/secure/lib/libcrypto/man/man3/BF_encrypt.3 +++ b/secure/lib/libcrypto/man/man3/BF_encrypt.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 index 4867c770113f..3f0f0cfd2170 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 index 4f6558313eaf..5df20d27fde8 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_connect.3 b/secure/lib/libcrypto/man/man3/BIO_connect.3 index 72e03a6d0908..f9fdd9b15d37 100644 --- a/secure/lib/libcrypto/man/man3/BIO_connect.3 +++ b/secure/lib/libcrypto/man/man3/BIO_connect.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 index 31c70dbb37a8..487f6d192c8c 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,13 +133,13 @@ .\" ======================================================================== .\" .IX Title "BIO_CTRL 3" -.TH BIO_CTRL 3 "2020-12-08" "1.1.1i" "OpenSSL" +.TH BIO_CTRL 3 "2021-01-21" "1.1.1i" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" -BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close, BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending, BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb \&\- BIO control operations +BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close, BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending, BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb, BIO_get_ktls_send, BIO_get_ktls_recv \&\- BIO control operations .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 @@ -166,6 +166,9 @@ BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BI \& \& int BIO_get_info_callback(BIO *b, BIO_info_cb **cbp); \& int BIO_set_info_callback(BIO *b, BIO_info_cb *cb); +\& +\& int BIO_get_ktls_send(BIO *b); +\& int BIO_get_ktls_recv(BIO *b); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" @@ -204,6 +207,11 @@ return the number of pending characters in the BIOs read and write buffers. Not all BIOs support these calls. \fBBIO_ctrl_pending()\fR and \fBBIO_ctrl_wpending()\fR return a size_t type and are functions, \fBBIO_pending()\fR and \fBBIO_wpending()\fR are macros which call \fBBIO_ctrl()\fR. +.PP +\&\fBBIO_get_ktls_send()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +sending. Otherwise, it returns zero. +\&\fBBIO_get_ktls_recv()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +receiving. Otherwise, it returns zero. .SH "RETURN VALUES" .IX Header "RETURN VALUES" \&\fBBIO_reset()\fR normally returns 1 for success and 0 or \-1 for failure. File @@ -223,6 +231,11 @@ for success and \-1 for failure. .PP \&\fBBIO_pending()\fR, \fBBIO_ctrl_pending()\fR, \fBBIO_wpending()\fR and \fBBIO_ctrl_wpending()\fR return the amount of pending data. +.PP +\&\fBBIO_get_ktls_send()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +sending. Otherwise, it returns zero. +\&\fBBIO_get_ktls_recv()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +receiving. Otherwise, it returns zero. .SH "NOTES" .IX Header "NOTES" \&\fBBIO_flush()\fR, because it can write data may return 0 or \-1 indicating @@ -253,6 +266,10 @@ Some of the return values are ambiguous and care should be taken. In particular a return value of 0 can be returned if an operation is not supported, if an error occurred, if \s-1EOF\s0 has not been reached and in the case of \fBBIO_seek()\fR on a file \s-1BIO\s0 for a successful operation. +.SH "HISTORY" +.IX Header "HISTORY" +The \fBBIO_get_ktls_send()\fR and \fBBIO_get_ktls_recv()\fR functions were added in +OpenSSL 3.0.0. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2000\-2020 The OpenSSL Project Authors. All Rights Reserved. diff --git a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 index 6c2c7de56ed1..d42d2eb6c9ec 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_BASE64 3" -.TH BIO_F_BASE64 3 "2020-09-22" "1.1.1h" "OpenSSL" +.TH BIO_F_BASE64 3 "2020-12-08" "1.1.1i" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 index 6105f2a83361..9b4bc1c800c5 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 index ae9a6747fcb4..a26d0f5cca2f 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_f_md.3 b/secure/lib/libcrypto/man/man3/BIO_f_md.3 index 8e3cd75c5553..ba7f598a14fc 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_md.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_md.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_f_null.3 b/secure/lib/libcrypto/man/man3/BIO_f_null.3 index e01f9b021520..44d680123203 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_null.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_null.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_NULL 3" -.TH BIO_F_NULL 3 "2020-09-22" "1.1.1h" "OpenSSL" +.TH BIO_F_NULL 3 "2020-12-08" "1.1.1i" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 index 3779dfbfeba3..ce95b5d29fd3 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_find_type.3 b/secure/lib/libcrypto/man/man3/BIO_find_type.3 index 878e2c65b24f..8ed77ea8ae03 100644 --- a/secure/lib/libcrypto/man/man3/BIO_find_type.3 +++ b/secure/lib/libcrypto/man/man3/BIO_find_type.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_get_data.3 b/secure/lib/libcrypto/man/man3/BIO_get_data.3 index 4069639cc4aa..dc9eb33aba84 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_data.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_data.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 index 93a2e5521f3a..a1ff83189d93 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 b/secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 new file mode 100644 index 000000000000..487f6d192c8c --- /dev/null +++ b/secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 @@ -0,0 +1,280 @@ +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 *** 6631 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Feb 5 00:04: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 C6FCB5344D8; Fri, 5 Feb 2021 00:04: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 4DWwdb4nVGz3QSG; Fri, 5 Feb 2021 00:04: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 185E914E49; Fri, 5 Feb 2021 00:04: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 11504YT2026890; Fri, 5 Feb 2021 00:04:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11504YCI026889; Fri, 5 Feb 2021 00:04:34 GMT (envelope-from git) Date: Fri, 5 Feb 2021 00:04:34 GMT Message-Id: <202102050004.11504YCI026889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3cf25a7802a2 - stable/13 - Disable MK_OPENSSL_KTLS for stable/13. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3cf25a7802a26ae3be9159c585fda6aea3d0dc08 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:04:37 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3cf25a7802a26ae3be9159c585fda6aea3d0dc08 commit 3cf25a7802a26ae3be9159c585fda6aea3d0dc08 Author: John Baldwin AuthorDate: 2021-02-04 21:40:25 +0000 Commit: John Baldwin CommitDate: 2021-02-05 00:03:21 +0000 Disable MK_OPENSSL_KTLS for stable/13. Due to the pending release of 13.0 and the recent bug in serf exposed by the KTLS changes, disable OpenSSL's KTLS by default. This keeps crypto/openssl in sync with main while lowering the risk of introducing instability into 13.0. Discussed with: gjb (re), jkim, emaste (secteam) --- share/mk/src.opts.mk | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 75405c1bc050..d01472c7fae6 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -212,6 +212,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_VERIEXEC_PASS_MANIFEST \ OFED_EXTRA \ OPENLDAP \ + OPENSSL_KTLS \ RPCBIND_WARMSTART_SUPPORT \ SORT_THREADS \ SVN \ @@ -330,13 +331,6 @@ BROKEN_OPTIONS+=LOADER_UBOOT BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA .endif -# Kernel TLS is enabled by default on amd64 -.if ${__T} == "amd64" -__DEFAULT_YES_OPTIONS+=OPENSSL_KTLS -.else -__DEFAULT_NO_OPTIONS+=OPENSSL_KTLS -.endif - .if ${__T:Mmips64*} # profiling won't work on MIPS64 because there is only assembly for o32 BROKEN_OPTIONS+=PROFILE From owner-dev-commits-src-all@freebsd.org Fri Feb 5 00:04: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 82C9C53480C; Fri, 5 Feb 2021 00:04: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 4DWwdc4hcQz3Q9q; Fri, 5 Feb 2021 00:04: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 2F60A14E4A; Fri, 5 Feb 2021 00:04: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 11504amU026909; Fri, 5 Feb 2021 00:04:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11504aXk026908; Fri, 5 Feb 2021 00:04:36 GMT (envelope-from git) Date: Fri, 5 Feb 2021 00:04:36 GMT Message-Id: <202102050004.11504aXk026908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ab537343065a - stable/13 - Regenerate src.conf(5). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ab537343065a6925e62001165a4743a17e050118 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:04:39 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ab537343065a6925e62001165a4743a17e050118 commit ab537343065a6925e62001165a4743a17e050118 Author: John Baldwin AuthorDate: 2021-02-04 21:47:26 +0000 Commit: John Baldwin CommitDate: 2021-02-05 00:03:21 +0000 Regenerate src.conf(5). --- share/man/man5/src.conf.5 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index a3802b59a3f5..90905413175e 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1309,6 +1309,8 @@ When set, these options are also in effect: .Va WITH_GSSAPI is set explicitly) .El +.It Va WITH_OPENSSL_KTLS +Set to include kernel TLS support in OpenSSL. .It Va WITHOUT_PAM Set to not build PAM library and modules. .Bf -symbolic From owner-dev-commits-src-all@freebsd.org Fri Feb 5 00:22: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 E806C5356C6; Fri, 5 Feb 2021 00:22: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 4DWx2668zdz3hb6; Fri, 5 Feb 2021 00:22: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 C64741549F; Fri, 5 Feb 2021 00:22: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 1150MMkQ052578; Fri, 5 Feb 2021 00:22:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1150MMJf052577; Fri, 5 Feb 2021 00:22:22 GMT (envelope-from git) Date: Fri, 5 Feb 2021 00:22:22 GMT Message-Id: <202102050022.1150MMJf052577@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: 375d797b8191 - main - Enable pvscsi and vmx in arm64 GENERIC 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: 375d797b81916eb3d16927c9dac8c42975784252 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:22:23 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=375d797b81916eb3d16927c9dac8c42975784252 commit 375d797b81916eb3d16927c9dac8c42975784252 Author: Ed Maste AuthorDate: 2021-02-05 00:14:12 +0000 Commit: Ed Maste CommitDate: 2021-02-05 00:21:38 +0000 Enable pvscsi and vmx in arm64 GENERIC FreeBSD pvscsi and vmx work with VMware ESXi Arm "Fling"; provide these in GENERIC for a convenient out-of-the-box experience. PR: 253202 Reported by: Vincent Milum Jr MFC after: 3 days Sponsored by: The FreeBSD Foundation --- sys/arm64/conf/GENERIC | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index 59f89555dd88..5eb0a270f006 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -159,6 +159,7 @@ options PCI_IOV # PCI SR-IOV support device ahci device scbus device da +device pvscsi # VMware PVSCSI # ATA/SCSI peripherals device cd # CD @@ -272,6 +273,7 @@ device pl011 device iflib device em # Intel PRO/1000 Gigabit Ethernet Family device ix # Intel 10Gb Ethernet Family +device vmx # VMware VMXNET3 Ethernet # Ethernet NICs device mdio From owner-dev-commits-src-all@freebsd.org Fri Feb 5 00:27: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 5082F535A4D; Fri, 5 Feb 2021 00:27: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 4DWx801qzYz3jKK; Fri, 5 Feb 2021 00: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 31D7015444; Fri, 5 Feb 2021 00: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 1150RShw054304; Fri, 5 Feb 2021 00: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 1150RSY9054303; Fri, 5 Feb 2021 00:27:28 GMT (envelope-from git) Date: Fri, 5 Feb 2021 00:27:28 GMT Message-Id: <202102050027.1150RSY9054303@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: dbe043d42cda - stable/13 - Correct description for kern.proc.proc_td 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: dbe043d42cda38e7f4186f0c0ed39569b713f05b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 00:27:28 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dbe043d42cda38e7f4186f0c0ed39569b713f05b commit dbe043d42cda38e7f4186f0c0ed39569b713f05b Author: Ed Maste AuthorDate: 2021-02-02 21:55:51 +0000 Commit: Ed Maste CommitDate: 2021-02-05 00:26:10 +0000 Correct description for kern.proc.proc_td kern.proc.proc_td returns the process table with an entry for each thread. Previously the description included "no threads", presumably a cut-and-pasteo in 2648efa621748. Description suggested by PauAmma. PR: 253146 MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit edc374e7c41d3d9e28e0b3a76bc9ed021d7db571) --- sys/kern/kern_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index ae80ba9ed5ed..305bc7e8a2ef 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -3186,7 +3186,7 @@ static SYSCTL_NODE(_kern_proc, (KERN_PROC_PID | KERN_PROC_INC_THREAD), pid_td, static SYSCTL_NODE(_kern_proc, (KERN_PROC_PROC | KERN_PROC_INC_THREAD), proc_td, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, - "Return process table, no threads"); + "Return process table, including threads"); #ifdef COMPAT_FREEBSD7 static SYSCTL_NODE(_kern_proc, KERN_PROC_OVMMAP, ovmmap, CTLFLAG_RD | From owner-dev-commits-src-all@freebsd.org Fri Feb 5 01:22: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 D0D32537F7E; Fri, 5 Feb 2021 01:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWyMp5GVNz3mvf; Fri, 5 Feb 2021 01:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7CBE16296; Fri, 5 Feb 2021 01:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1151MkCG031621; Fri, 5 Feb 2021 01:22:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1151MkMR031620; Fri, 5 Feb 2021 01:22:46 GMT (envelope-from git) Date: Fri, 5 Feb 2021 01:22:46 GMT Message-Id: <202102050122.1151MkMR031620@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: 5832a3e39864 - main - amd64 GENERIC: compile in mlx5en(4) 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: 5832a3e398642f721381dc2bdc8e954ae43c17a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:22:46 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5832a3e398642f721381dc2bdc8e954ae43c17a7 commit 5832a3e398642f721381dc2bdc8e954ae43c17a7 Author: Konstantin Belousov AuthorDate: 2021-02-03 12:19:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-05 01:22:26 +0000 amd64 GENERIC: compile in mlx5en(4) Reviewed by: hselasky, manu Sponsored by: NVidia Networking/Mellanox Technologies MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28469 --- sys/amd64/conf/GENERIC | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 387128f7cba8..cdee2a91554b 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -134,6 +134,8 @@ device pci options PCI_HP # PCI-Express native HotPlug options PCI_IOV # PCI SR-IOV support +options COMPAT_LINUXKPI + # Floppy drives device fdc @@ -258,6 +260,12 @@ device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet +# Nvidia/Mellanox Connect-X 4 and later, Ethernet only +# mlx5ib requires ibcore infra and is not included by default +device mlx5 # Base driver +device mlxfw # Firmware update +device mlx5en # Ethernet driver + # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support @@ -326,6 +334,7 @@ device tuntap # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module +device xz # lzma decompression # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! From owner-dev-commits-src-all@freebsd.org Fri Feb 5 01:22: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 DAE8C537F7F; Fri, 5 Feb 2021 01:22: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 4DWyMq5tyrz3mxq; Fri, 5 Feb 2021 01:22: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 BD39315D5C; Fri, 5 Feb 2021 01:22:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1151MlCl031644; Fri, 5 Feb 2021 01:22:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1151Ml6Z031643; Fri, 5 Feb 2021 01:22:47 GMT (envelope-from git) Date: Fri, 5 Feb 2021 01:22:47 GMT Message-Id: <202102050122.1151Ml6Z031643@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: 856789c123d6 - main - cpucontrol(8): Fix display. 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: 856789c123d69de86684c5aa1ad8a53427dd47fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:22:47 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=856789c123d69de86684c5aa1ad8a53427dd47fc commit 856789c123d69de86684c5aa1ad8a53427dd47fc Author: Konstantin Belousov AuthorDate: 2021-02-05 01:00:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-05 01:22:26 +0000 cpucontrol(8): Fix display. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- usr.sbin/cpucontrol/cpucontrol.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/cpucontrol/cpucontrol.8 b/usr.sbin/cpucontrol/cpucontrol.8 index 4e54bb51bafc..e347d5e49bfe 100644 --- a/usr.sbin/cpucontrol/cpucontrol.8 +++ b/usr.sbin/cpucontrol/cpucontrol.8 @@ -33,8 +33,8 @@ .Xr cpuctl 4 device .Sh SYNOPSIS -.Nm .Bk +.Nm .Op Fl v .Fl m Ar msr .Ar device From owner-dev-commits-src-all@freebsd.org Fri Feb 5 01:28: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 D6B0D538715; Fri, 5 Feb 2021 01:28:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DWyTw5kXzz3nTB; Fri, 5 Feb 2021 01:28: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 B75FC163A3; Fri, 5 Feb 2021 01:28: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 1151S4OK032572; Fri, 5 Feb 2021 01:28:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1151S4FV032571; Fri, 5 Feb 2021 01:28:04 GMT (envelope-from git) Date: Fri, 5 Feb 2021 01:28:04 GMT Message-Id: <202102050128.1151S4FV032571@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: e4a6846c34d2 - stable/13 - WITH_OFED build option: fix 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: e4a6846c34d2bf5365199411a5ad680462ab8f9d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:28:04 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e4a6846c34d2bf5365199411a5ad680462ab8f9d commit e4a6846c34d2bf5365199411a5ad680462ab8f9d Author: Konstantin Belousov AuthorDate: 2021-02-02 13:01:26 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-05 01:27:33 +0000 WITH_OFED build option: fix (cherry picked from commit ff975f15d86001d5b948ab538de1e4aca852d2f5) --- sys/conf/kern.opts.mk | 2 +- tools/build/options/WITHOUT_OFED | 4 ++++ tools/build/options/WITH_OFED | 4 ---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 5a66849b36da..7361cdd70076 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -41,6 +41,7 @@ __DEFAULT_YES_OPTIONS = \ ISCSI \ KERNEL_SYMBOLS \ NETGRAPH \ + OFED \ PF \ SCTP_SUPPORT \ SOURCELESS_HOST \ @@ -55,7 +56,6 @@ __DEFAULT_NO_OPTIONS = \ INIT_ALL_PATTERN \ INIT_ALL_ZERO \ KERNEL_RETPOLINE \ - OFED \ RATELIMIT \ REPRODUCIBLE_BUILD diff --git a/tools/build/options/WITHOUT_OFED b/tools/build/options/WITHOUT_OFED new file mode 100644 index 000000000000..18a6943b3580 --- /dev/null +++ b/tools/build/options/WITHOUT_OFED @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to disable the build of the +.Dq "OpenFabrics Enterprise Distribution" +Infiniband software stack, including kernel modules and userspace libraries. diff --git a/tools/build/options/WITH_OFED b/tools/build/options/WITH_OFED deleted file mode 100644 index a995fb8cdab8..000000000000 --- a/tools/build/options/WITH_OFED +++ /dev/null @@ -1,4 +0,0 @@ -.\" $FreeBSD$ -Set to build the -.Dq "OpenFabrics Enterprise Distribution" -Infiniband software stack. From owner-dev-commits-src-all@freebsd.org Fri Feb 5 02:00: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 3C673538E49; Fri, 5 Feb 2021 02:00: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 4DWzCG1CDTz3pm2; Fri, 5 Feb 2021 02: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 1C3D6165B0; Fri, 5 Feb 2021 02: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 11520QwG079786; Fri, 5 Feb 2021 02: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 11520QCt079785; Fri, 5 Feb 2021 02:00:26 GMT (envelope-from git) Date: Fri, 5 Feb 2021 02:00:26 GMT Message-Id: <202102050200.11520QCt079785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6e1fe6d26ea2 - stable/13 - Bump shared library versions after ncurses bump in 13. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6e1fe6d26ea2939656c8286ccbd105a89d3349a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:00:26 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6e1fe6d26ea2939656c8286ccbd105a89d3349a3 commit 6e1fe6d26ea2939656c8286ccbd105a89d3349a3 Author: John Baldwin AuthorDate: 2021-02-02 01:09:33 +0000 Commit: John Baldwin CommitDate: 2021-02-05 01:51:45 +0000 Bump shared library versions after ncurses bump in 13. A few shared libraries in the base system link against ncurses. An upgrade from a 12.x host to 13 results in ABI breakage for existing binaries since the newer versions of these libraries link against the newer ncurses while the binary itself links against the older ncurses. For example, dialog4ports built on 12.x sometimes crashes on 13 since it depends on libdialog which links against ncurses internally. (cherry picked from commit 0b7f1af804f06a285717b490bef80e24648adcbe) --- ObsoleteFiles.inc | 11 +++++++++++ gnu/lib/libdialog/Makefile | 2 +- lib/libdpv/Makefile | 2 +- lib/libedit/Makefile | 2 +- lib/ncurses/form/Makefile | 1 + lib/ncurses/menu/Makefile | 1 + lib/ncurses/panel/Makefile | 1 + 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1d0766ec894a..7ebff0441581 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20210204: bump shared libraries which link against ncurses +OLD_LIBS+=lib/libedit.so.7 +OLD_LIBS+=usr/lib/libdialog.so.8 +OLD_LIBS+=usr/lib/libdpv.so.1 +OLD_LIBS+=usr/lib/libform.so.5 +OLD_LIBS+=usr/lib/libformw.so.5 +OLD_LIBS+=usr/lib/libmenu.so.5 +OLD_LIBS+=usr/lib/libmenuw.so.5 +OLD_LIBS+=usr/lib/libpanel.so.5 +OLD_LIBS+=usr/lib/libpanelw.so.5 + # 20210116: if_wl_wavelan.h removed .if ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/if_wl_wavelan.h diff --git a/gnu/lib/libdialog/Makefile b/gnu/lib/libdialog/Makefile index 69d8dbd3fdb8..e4f1b62121d9 100644 --- a/gnu/lib/libdialog/Makefile +++ b/gnu/lib/libdialog/Makefile @@ -3,7 +3,7 @@ DIALOG= ${SRCTOP}/contrib/dialog LIB= dialog -SHLIB_MAJOR= 8 +SHLIB_MAJOR= 9 SRCS= argv.c arrows.c buildlist.c buttons.c calendar.c checklist.c \ columns.c dlg_keys.c editbox.c fselect.c formbox.c guage.c \ help.c inputbox.c inputstr.c menubox.c mixedform.c \ diff --git a/lib/libdpv/Makefile b/lib/libdpv/Makefile index d2334ee38186..be28debc70bc 100644 --- a/lib/libdpv/Makefile +++ b/lib/libdpv/Makefile @@ -2,7 +2,7 @@ PACKAGE= dpv LIB= dpv -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 INCS= dpv.h MAN= dpv.3 MLINKS= dpv.3 dpv_free.3 diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index f1dbad42db22..963063ef90fa 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -7,7 +7,7 @@ PACKAGE=clibs EDITDIR= ${SRCTOP}/contrib/libedit .PATH: ${EDITDIR} -SHLIB_MAJOR= 7 +SHLIB_MAJOR= 8 SHLIBDIR?= /lib WARNS?= 3 diff --git a/lib/ncurses/form/Makefile b/lib/ncurses/form/Makefile index a8e636d6ce1b..a6b186936dc5 100644 --- a/lib/ncurses/form/Makefile +++ b/lib/ncurses/form/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/form LIB= formw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ diff --git a/lib/ncurses/menu/Makefile b/lib/ncurses/menu/Makefile index 7844cd4d936c..9bd92723fed9 100644 --- a/lib/ncurses/menu/Makefile +++ b/lib/ncurses/menu/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/menu LIB= menuw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ diff --git a/lib/ncurses/panel/Makefile b/lib/ncurses/panel/Makefile index a22df4d89570..9dd950496b1b 100644 --- a/lib/ncurses/panel/Makefile +++ b/lib/ncurses/panel/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/panel LIB= panelw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ From owner-dev-commits-src-all@freebsd.org Fri Feb 5 02:52: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 7AE2853A6E6; Fri, 5 Feb 2021 02:52: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 4DX0Mh33Lgz3sbX; Fri, 5 Feb 2021 02:52: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 5B1FB16CFD; Fri, 5 Feb 2021 02:52: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 1152qmun050511; Fri, 5 Feb 2021 02:52:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1152qmtd050510; Fri, 5 Feb 2021 02:52:48 GMT (envelope-from git) Date: Fri, 5 Feb 2021 02:52:48 GMT Message-Id: <202102050252.1152qmtd050510@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: 7523914d08f9 - stable/12 - Correct description for kern.proc.proc_td 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: 7523914d08f9afba1b15f051bc34245cd551c725 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:52:48 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7523914d08f9afba1b15f051bc34245cd551c725 commit 7523914d08f9afba1b15f051bc34245cd551c725 Author: Ed Maste AuthorDate: 2021-02-02 21:55:51 +0000 Commit: Ed Maste CommitDate: 2021-02-05 02:51:45 +0000 Correct description for kern.proc.proc_td kern.proc.proc_td returns the process table with an entry for each thread. Previously the description included "no threads", presumably a cut-and-pasteo in 2648efa621748. Description suggested by PauAmma. PR: 253146 MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit edc374e7c41d3d9e28e0b3a76bc9ed021d7db571) --- sys/kern/kern_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 566b9a8ea43a..04d82d30f8c2 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -3167,7 +3167,7 @@ static SYSCTL_NODE(_kern_proc, (KERN_PROC_PID | KERN_PROC_INC_THREAD), pid_td, static SYSCTL_NODE(_kern_proc, (KERN_PROC_PROC | KERN_PROC_INC_THREAD), proc_td, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc, - "Return process table, no threads"); + "Return process table, including threads"); #ifdef COMPAT_FREEBSD7 static SYSCTL_NODE(_kern_proc, KERN_PROC_OVMMAP, ovmmap, CTLFLAG_RD | From owner-dev-commits-src-all@freebsd.org Fri Feb 5 02:59: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 C59FC53A27C; Fri, 5 Feb 2021 02:59: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 4DX0Wy57qdz3tGC; Fri, 5 Feb 2021 02:59: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 9F7D2175A7; Fri, 5 Feb 2021 02:59: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 1152xwag051463; Fri, 5 Feb 2021 02:59:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1152xw7F051462; Fri, 5 Feb 2021 02:59:58 GMT (envelope-from git) Date: Fri, 5 Feb 2021 02:59:58 GMT Message-Id: <202102050259.1152xw7F051462@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: f823c6dc730b - main - grep: fix null pattern and empty pattern file behavior 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: f823c6dc730b0dd08b54a53be1d8fd587eee7021 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:59:58 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f823c6dc730b0dd08b54a53be1d8fd587eee7021 commit f823c6dc730b0dd08b54a53be1d8fd587eee7021 Author: Kyle Evans AuthorDate: 2021-02-04 21:26:45 +0000 Commit: Kyle Evans CommitDate: 2021-02-05 02:59:42 +0000 grep: fix null pattern and empty pattern file behavior The null pattern semantics were terrible because I tried to match gnugrep, but I got it wrong. Let's unwind that: - The null pattern should match every line if neither -w nor -x. - The null pattern should match empty lines if -x. - The null pattern should not match any lines if -w. The first two will stop processing (shortcut) even if additional patterns are specified. In any other case, we will continue processing other patterns. If no other patterns are specified beside a null pattern, then we match if neither -w nor -x or set and do not match if either of those are specified. The justification for -w is that it should match on a whole word, but the null pattern deos not have a whole word to match on. Empty pattern files should never match anything, and more importantly, -v should cause everything to be written. PR: 253209 MFC-after: 4 days --- contrib/netbsd-tests/usr.bin/grep/t_grep.sh | 22 +++++++++++++++--- usr.bin/grep/grep.c | 11 --------- usr.bin/grep/util.c | 35 +++++++++++++---------------- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh index e094b15c6d67..ef3f0617465e 100755 --- a/contrib/netbsd-tests/usr.bin/grep/t_grep.sh +++ b/contrib/netbsd-tests/usr.bin/grep/t_grep.sh @@ -489,11 +489,11 @@ wflag_emptypat_body() atf_check -s exit:1 -o empty grep -w -e "" test1 - atf_check -o file:test2 grep -w -e "" test2 + atf_check -o file:test2 grep -vw -e "" test2 atf_check -s exit:1 -o empty grep -w -e "" test3 - atf_check -o file:test4 grep -w -e "" test4 + atf_check -o file:test4 grep -vw -e "" test4 } atf_test_case xflag_emptypat @@ -504,7 +504,6 @@ xflag_emptypat_body() printf "qaz" > test3 printf " qaz\n" > test4 - # -x is whole-line, more strict than -w. atf_check -s exit:1 -o empty grep -x -e "" test1 atf_check -o file:test2 grep -x -e "" test2 @@ -550,6 +549,22 @@ xflag_emptypat_plus_body() atf_check -o file:spacelines grep -Fxvf patlist1 target_spacelines } +atf_test_case emptyfile +emptyfile_descr() +{ + atf_set "descr" "Check for proper handling of empty pattern files (PR 253209)" +} +emptyfile_body() +{ + :> epatfile + echo "blubb" > subj + + # From PR 253209, bsdgrep was short-circuiting completely on an empty + # file, but we should have still been processing lines. + atf_check -s exit:1 -o empty fgrep -f epatfile subj + atf_check -o file:subj fgrep -vf epatfile subj +} + atf_test_case excessive_matches excessive_matches_head() { @@ -946,6 +961,7 @@ atf_init_test_cases() atf_add_test_case wflag_emptypat atf_add_test_case xflag_emptypat atf_add_test_case xflag_emptypat_plus + atf_add_test_case emptyfile atf_add_test_case excessive_matches atf_add_test_case wv_combo_break atf_add_test_case fgrep_sanity diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 307a91353b66..33541e4fe734 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -69,13 +69,6 @@ const char *errstr[] = { int cflags = REG_NOSUB | REG_NEWLINE; int eflags = REG_STARTEND; -/* XXX TODO: Get rid of this flag. - * matchall is a gross hack that means that an empty pattern was passed to us. - * It is a necessary evil at the moment because our regex(3) implementation - * does not allow for empty patterns, as supported by POSIX's definition of - * grammar for BREs/EREs. When libregex becomes available, it would be wise - * to remove this and let regex(3) handle the dirty details of empty patterns. - */ bool matchall; /* Searching patterns */ @@ -637,10 +630,6 @@ main(int argc, char *argv[]) aargc -= optind; aargv += optind; - /* Empty pattern file matches nothing */ - if (!needpattern && (patterns == 0) && !matchall) - exit(1); - /* Fail if we don't have any pattern */ if (aargc == 0 && needpattern) usage(); diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index e517e4eaee6d..f22b7abd79ef 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -471,31 +471,28 @@ procline(struct parsec *pc) matchidx = pc->matchidx; - /* - * With matchall (empty pattern), we can try to take some shortcuts. - * Emtpy patterns trivially match every line except in the -w and -x - * cases. For -w (whole-word) cases, we only match if the first - * character isn't a word-character. For -x (whole-line) cases, we only - * match if the line is empty. - */ + /* Null pattern shortcuts. */ if (matchall) { - if (pc->ln.len == 0) + if (xflag && pc->ln.len == 0) { + /* Matches empty lines (-x). */ return (true); - if (wflag) { - wend = L' '; - if (sscanf(&pc->ln.dat[0], "%lc", &wend) == 1 && - !iswword(wend)) - return (true); - } else if (!xflag) + } else if (!wflag && !xflag) { + /* Matches every line (no -w or -x). */ return (true); + } /* - * If we don't have any other patterns, we really don't match. - * If we do have other patterns, we must fall through and check - * them. + * If we only have the NULL pattern, whether we match or not + * depends on if we got here with -w or -x. If either is set, + * the answer is no. If we have other patterns, we'll defer + * to them. */ - if (patterns == 0) - return (false); + if (patterns == 0) { + return (!(wflag || xflag)); + } + } else if (patterns == 0) { + /* Pattern file with no patterns. */ + return (false); } matched = false; From owner-dev-commits-src-all@freebsd.org Fri Feb 5 02:59: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 D607253A4F2; Fri, 5 Feb 2021 02:59: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 4DX0Wz5kRVz3tGD; Fri, 5 Feb 2021 02:59: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 B77DA16CFF; Fri, 5 Feb 2021 02:59: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 1152xxRI051486; Fri, 5 Feb 2021 02:59:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1152xxBw051485; Fri, 5 Feb 2021 02:59:59 GMT (envelope-from git) Date: Fri, 5 Feb 2021 02:59:59 GMT Message-Id: <202102050259.1152xxBw051485@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: 2373acbbb77d - main - grep: turn off -w if -x is specified 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: 2373acbbb77d694b997d90f3251810c6edf5d6d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:59:59 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2373acbbb77d694b997d90f3251810c6edf5d6d8 commit 2373acbbb77d694b997d90f3251810c6edf5d6d8 Author: Kyle Evans AuthorDate: 2021-02-04 21:35:58 +0000 Commit: Kyle Evans CommitDate: 2021-02-05 02:59:43 +0000 grep: turn off -w if -x is specified -x overcomes -w in gnugrep, and it should here as well. Flip it off as needed to avoid confusing other parts of grep. --- usr.bin/grep/grep.1 | 5 ++++- usr.bin/grep/grep.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.bin/grep/grep.1 b/usr.bin/grep/grep.1 index d3b30828c821..338af7e6d454 100644 --- a/usr.bin/grep/grep.1 +++ b/usr.bin/grep/grep.1 @@ -30,7 +30,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd November 19, 2020 +.Dd February 4, 2021 .Dt GREP 1 .Os .Sh NAME @@ -405,6 +405,9 @@ and .Sq [[:>:]] ; see .Xr re_format 7 ) . +This option has no effect if +.Fl x +is also specified. .It Fl x , Fl Fl line-regexp Only input lines selected against an entire fixed string or regular expression are considered to be matching lines. diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 33541e4fe734..166d3451774a 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -630,6 +630,10 @@ main(int argc, char *argv[]) aargc -= optind; aargv += optind; + /* xflag takes precedence, don't confuse the matching bits. */ + if (wflag && xflag) + wflag = false; + /* Fail if we don't have any pattern */ if (aargc == 0 && needpattern) usage(); From owner-dev-commits-src-all@freebsd.org Fri Feb 5 06:38: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 3934053E46F for ; Fri, 5 Feb 2021 06:38:44 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-zteg10011501.me.com (pv50p00im-zteg10011501.me.com [17.58.6.42]) (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 4DX5NN0H5fz4ZBV for ; Fri, 5 Feb 2021 06:38:43 +0000 (UTC) (envelope-from tsoome@me.com) Received: from [192.168.150.141] (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id EA24AB00459; Fri, 5 Feb 2021 06:38:41 +0000 (UTC) From: Toomas Soome Mime-Version: 1.0 (1.0) Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev Date: Fri, 5 Feb 2021 08:38:39 +0200 Message-Id: References: Cc: Toomas Soome , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org In-Reply-To: To: Warner Losh X-Mailer: iPhone Mail (18D52) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.737 definitions=2021-02-05_04:2021-02-05, 2021-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2102050043 X-Rspamd-Queue-Id: 4DX5NN0H5fz4ZBV X-Spamd-Bar: ---- 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: Fri, 05 Feb 2021 06:38:44 -0000 > On 5. Feb 2021, at 01:56, Warner Losh wrote: >=20 > =EF=BB=BF > And why the instaMFC? Changes are supposed to cook force days before mergi= ng... I have questions about the wisdom of this change... >=20 > Warner=20 >=20 Reason is in PR. There is someone with the system without ConOut but ConOutD= ev is set. Instead of falling back to arbitrary device (which in this case w= as totally wrong choice), we can try the possible devices list. We do not ch= ange the ConOut parsing. If it would appear, there are systems with unusable devices listed in ConOut= Dev, then we need to think how to handle such case. Thanks, Toomas >> On Thu, Feb 4, 2021, 2:34 PM Toomas Soome wrote: >> The branch stable/13 has been updated by tsoome: >>=20 >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D0c839497c174e961fc71f7d332= 9d05b10ec5525b >>=20 >> commit 0c839497c174e961fc71f7d3329d05b10ec5525b >> Author: Toomas Soome >> AuthorDate: 2021-02-04 20:49:02 +0000 >> Commit: Toomas Soome >> CommitDate: 2021-02-04 21:33:15 +0000 >>=20 >> loader.efi: There are systems without ConOut, also use ConOutDev >>=20 >> Conout does contian the default output device name. >> ConOutDev does contain all possible output device names, so we can >> use it as fallback, when there is no ConOut. >>=20 >> PR: 253253 >>=20 >> (cherry picked from commit 2bd4ff2d8911009283e4e615ca4aad35a845f48b) >> --- >> stand/efi/loader/main.c | 2 ++ >> 1 file changed, 2 insertions(+) >>=20 >> diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c >> index ca41cd4a2610..32b278950745 100644 >> --- a/stand/efi/loader/main.c >> +++ b/stand/efi/loader/main.c >> @@ -735,6 +735,8 @@ parse_uefi_con_out(void) >> how =3D 0; >> sz =3D sizeof(buf); >> rv =3D efi_global_getenv("ConOut", buf, &sz); >> + if (rv !=3D EFI_SUCCESS) >> + rv =3D efi_global_getenv("ConOutDev", buf, &sz); >> if (rv !=3D EFI_SUCCESS) { >> /* If we don't have any ConOut default to serial */ >> how =3D RB_SERIAL; From owner-dev-commits-src-all@freebsd.org Fri Feb 5 09: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 96D0D541F72 for ; Fri, 5 Feb 2021 09:16:25 +0000 (UTC) (envelope-from khng@freebsdfoundation.org) 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 4DX8tK3fbRz4kG2 for ; Fri, 5 Feb 2021 09:16:25 +0000 (UTC) (envelope-from khng@freebsdfoundation.org) Received: by mail-pl1-x62f.google.com with SMTP id d13so3265309plg.0 for ; Fri, 05 Feb 2021 01:16:25 -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=0hOcAvqjqpBoUp4ViNz/yzjX+q/vjIhFYzjQlyn90lM=; b=QhqXOLN2XBeSI25pL0c2GucVR2gKZXvGqRp8H3HAPyitqZZkfUkRwyvdjpI7M4NCdP wjTjohIvhu1KH5JZRxLkhOBmVVt/A3WGbDZ81rzsupXUbrq0IDpzQcSUmwR3DoYhJVvy CAwOhVtJxtfSGCZv2dtXibt1Hpw3t4/qtbdKB8Yn2PPIrlamo6rQn5rbdiiJ3GXdlYON u1GaxHTIoWIoDnaVKx07+hqD4w0nkk4+xS0mY5wK1lTgMECYrUf2PyB2LsTNH+fudhou omY5q8UX4ZmBwv4kcaeKtAxEIswQh9n9bENG9yRDtCndJnH824qD2N0ERAuHDZeBA3ZW 7Y0g== X-Gm-Message-State: AOAM53156JygLbeNCJ5SuGiEOlqMC0Cf8QtiaATMqCvUwWL6MKF6e8GZ sYGski67lTKiGmnGxAwHX3/7NnoO X-Google-Smtp-Source: ABdhPJycfcCq/L3xrFh1wNCHa1G7eh2Y6dh04Z52IU83DIS58gi3uWa0l6c2M2sTBY2eAthZYryG8w== X-Received: by 2002:a17:90a:8e82:: with SMTP id f2mr3240226pjo.234.1612516583829; Fri, 05 Feb 2021 01:16:23 -0800 (PST) Received: from ?IPv6:2001:470:19:fc1:505f:9eec:d6c3:aa8d? ([2001:470:19:fc1:505f:9eec:d6c3:aa8d]) by smtp.gmail.com with ESMTPSA id b25sm1500209pfp.26.2021.02.05.01.16.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2021 01:16:23 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 3d544e6b0bc4 - stable/13 - Rename stable/13 to -STABLE now that releng/13.0 has branched From: Ka Ho Ng In-Reply-To: <202102050002.11502Sro026366@gitrepo.freebsd.org> Date: Fri, 5 Feb 2021 17:16:21 +0800 Cc: dev-commits-src-all@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <45841159-3C53-45AF-90EB-7A8798E32242@freebsdfoundation.org> References: <202102050002.11502Sro026366@gitrepo.freebsd.org> To: "gjb@freebsd.org" X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4DX8tK3fbRz4kG2 X-Spamd-Bar: ---- 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 Feb 2021 09:16:25 -0000 > On Feb 5, 2021, at 8:02 AM, Glen Barber wrote: >=20 > #undef __FreeBSD_version > -#define __FreeBSD_version 1300139 /* Master, propagated to newvers = */ > +#define __FreeBSD_version 1305000 /* Master, propagated to newvers = */ >=20 > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of = FreeBSD, >=20 I think 1305000 is too high that it breaks os_note also. Now file = command gives FreeBSD 13.5 on binaries. Or should it actually be = 1300500? Ka Ho= From owner-dev-commits-src-all@freebsd.org Fri Feb 5 09:19: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 9532054234F for ; Fri, 5 Feb 2021 09:19:42 +0000 (UTC) (envelope-from khng@freebsdfoundation.org) Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) (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 4DX8y56QWkz4kD4 for ; Fri, 5 Feb 2021 09:19:41 +0000 (UTC) (envelope-from khng@freebsdfoundation.org) Received: by mail-pg1-x52d.google.com with SMTP id t11so430501pgu.8 for ; Fri, 05 Feb 2021 01:19:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=mb3I6Huahil3d1tjlBURzpbqEEpQ6ykTxBxBQ9zLd+k=; b=kN5CK+mbfa8nSBI5X990M8JnBQcmKGSyoYycDVIUJTPovplc6rkgnUeRAwNrDIzY6d 3Mv2xaWdYgBTtRZ9WC4ov5of9iVKy38DvOV68K5tMymChT/nGvFIaL9bBBXwac1jGnpD EsOE04sLiBtwwkUYrhELEh5vTFjaCh86iiCNTzadExTsRBQkwWecArNTjARiBnefb7PU LwENk4BXrcGg0mBPJvzZe9QQF7/jnJ1myWqboRavzdoTzlhqgUJes+XvxHPKC1I8ENLr BBsrVg/TDLUvDiT7MQQz2Tqi/j9QqIIaC6E2L4DoqLu9DKAoIwNDBVv++vT+hvHewV8P +HIA== X-Gm-Message-State: AOAM5314oEjNboe37KMQPGQf8l0y9/SbcN50bwWxrbA+e2ponBcPft4o fmsiV3CVe/iGlzUB4Fc1XtPyv/Ic X-Google-Smtp-Source: ABdhPJyAl03ovxriT76G7AEMBk27y9IS8CDSq01jttXIj9ucZd9EGHCRK19ptzO8VTfms54WU8/C9w== X-Received: by 2002:a62:528c:0:b029:19e:4a39:d9ea with SMTP id g134-20020a62528c0000b029019e4a39d9eamr3767113pfb.20.1612516780491; Fri, 05 Feb 2021 01:19:40 -0800 (PST) Received: from ?IPv6:2001:470:19:fc1:505f:9eec:d6c3:aa8d? ([2001:470:19:fc1:505f:9eec:d6c3:aa8d]) by smtp.gmail.com with ESMTPSA id l3sm9913869pgn.8.2021.02.05.01.19.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2021 01:19:39 -0800 (PST) From: Ka Ho Ng Message-Id: <54BB4038-0F97-416F-B66B-8B2DDD06C6C1@freebsdfoundation.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 3d544e6b0bc4 - stable/13 - Rename stable/13 to -STABLE now that releng/13.0 has branched Date: Fri, 5 Feb 2021 17:19:38 +0800 In-Reply-To: <45841159-3C53-45AF-90EB-7A8798E32242@freebsdfoundation.org> Cc: dev-commits-src-all@freebsd.org To: "gjb@freebsd.org" References: <202102050002.11502Sro026366@gitrepo.freebsd.org> <45841159-3C53-45AF-90EB-7A8798E32242@freebsdfoundation.org> X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4DX8y56QWkz4kD4 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[freebsdfoundation.org:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[freebsdfoundation.org,quarantine]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::52d:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[freebsdfoundation.org:s=gfnp-20170908]; FROM_HAS_DN(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]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::52d:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::52d:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all] Content-Type: text/plain; charset=us-ascii 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 Feb 2021 09:19:42 -0000 > On Feb 5, 2021, at 5:16 PM, Ka Ho Ng = wrote: >=20 >> On Feb 5, 2021, at 8:02 AM, Glen Barber wrote: >>=20 >> #undef __FreeBSD_version >> -#define __FreeBSD_version 1300139 /* Master, propagated to newvers = */ >> +#define __FreeBSD_version 1305000 /* Master, propagated to newvers = */ >>=20 >> /* >> * __FreeBSD_kernel__ indicates that this system uses the kernel of = FreeBSD, >>=20 >=20 > I think 1305000 is too high that it breaks os_note also. Now file = command gives FreeBSD 13.5 on binaries. Or should it actually be = 1300500? >=20 > Ka Ho Nevermind. It seems normal to bump it that high: = https://github.com/freebsd/freebsd-src/commit/2f88c6c939bff4237856b165d92a= 0e258da00176 = = https://github.com/freebsd/freebsd-src/commit/f8dbe6487a39362f3cf8400994c0= cc00af6b6917 = Ka Ho= From owner-dev-commits-src-all@freebsd.org Fri Feb 5 10: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 2EC12543858; Fri, 5 Feb 2021 10: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 4DXBGp0r93z4nMt; Fri, 5 Feb 2021 10:19: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 0F8DB1CCEF; Fri, 5 Feb 2021 10:19: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 115AJDHW029907; Fri, 5 Feb 2021 10:19:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115AJDam029906; Fri, 5 Feb 2021 10:19:13 GMT (envelope-from git) Date: Fri, 5 Feb 2021 10:19:13 GMT Message-Id: <202102051019.115AJDam029906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 4e33793cf41c - stable/12 - psm(4): Always initialize Synaptics touchpad report range with defaults MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4e33793cf41c0ec6b5db68bca1451db3e3d79a91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 10:19:14 -0000 The branch stable/12 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=4e33793cf41c0ec6b5db68bca1451db3e3d79a91 commit 4e33793cf41c0ec6b5db68bca1451db3e3d79a91 Author: Vladimir Kondratyev AuthorDate: 2020-12-22 20:44:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-05 10:15:00 +0000 psm(4): Always initialize Synaptics touchpad report range with defaults Otherwise libinput refuses to recoginize some Synaptics touchpads with "kernel bug: device has min == max on ABS_X" message in Xorg.log. PR: 251149 Reported-by: Jens Grassel Tested-by: Jens Grassel MFC-after: 2 weeks (cherry picked from commit 2ac1c1927258e649e3ca3269aea40fb4c63e2296) --- sys/dev/atkbdc/psm.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index d15adb63acb0..f9b8b098ea87 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -6387,6 +6387,15 @@ enable_synaptics(struct psm_softc *sc, enum probearg arg) printf(" infoGeometry: %d\n", synhw.infoGeometry); } + /* + * Typical bezel limits. Taken from 'Synaptics + * PS/2 * TouchPad Interfacing Guide' p.3.2.3. + */ + synhw.maximumXCoord = 5472; + synhw.maximumYCoord = 4448; + synhw.minimumXCoord = 1472; + synhw.minimumYCoord = 1408; + /* Read the extended capability bits. */ if (mouse_ext_command(kbdc, SYNAPTICS_READ_CAPABILITIES) == 0) return (FALSE); @@ -6528,13 +6537,6 @@ enable_synaptics(struct psm_softc *sc, enum probearg arg) ((status[1] & 0x0f) << 1); synhw.maximumYCoord = (status[2] << 5) | ((status[1] & 0xf0) >> 3); - } else { - /* - * Typical bezel limits. Taken from 'Synaptics - * PS/2 * TouchPad Interfacing Guide' p.3.2.3. - */ - synhw.maximumXCoord = 5472; - synhw.maximumYCoord = 4448; } if (synhw.capReportsMin) { @@ -6550,13 +6552,6 @@ enable_synaptics(struct psm_softc *sc, enum probearg arg) ((status[1] & 0x0f) << 1); synhw.minimumYCoord = (status[2] << 5) | ((status[1] & 0xf0) >> 3); - } else { - /* - * Typical bezel limits. Taken from 'Synaptics - * PS/2 * TouchPad Interfacing Guide' p.3.2.3. - */ - synhw.minimumXCoord = 1472; - synhw.minimumYCoord = 1408; } /* From owner-dev-commits-src-all@freebsd.org Fri Feb 5 10:19: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 4F9F654366A; Fri, 5 Feb 2021 10:19: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 4DXBGq1pCtz4nFd; Fri, 5 Feb 2021 10:19: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 30D461D042; Fri, 5 Feb 2021 10:19: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 115AJF07029925; Fri, 5 Feb 2021 10:19:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115AJFUd029924; Fri, 5 Feb 2021 10:19:15 GMT (envelope-from git) Date: Fri, 5 Feb 2021 10:19:15 GMT Message-Id: <202102051019.115AJFUd029924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 4932ef733d23 - stable/12 - ukbd(4): Do not serialize evdev key events MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4932ef733d2336a7f76b753824091be6f9f1197a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 10:19:15 -0000 The branch stable/12 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=4932ef733d2336a7f76b753824091be6f9f1197a commit 4932ef733d2336a7f76b753824091be6f9f1197a Author: Vladimir Kondratyev AuthorDate: 2020-12-24 18:56:33 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-05 10:17:41 +0000 ukbd(4): Do not serialize evdev key events Unlike AT keyboards, HID devices are able to send all pc105 key states within a single report. Let evdev to transmit all key state changes within a single report too. Reviewed by: hselasky Obtained from: sysutils/iichid MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27749 (cherry picked from commit 769935a4edf8a75805000900d44a66ad5d2eaabe) --- sys/dev/usb/input/ukbd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index e058a55cc661..cf1c11069ffc 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -389,11 +389,9 @@ ukbd_put_key(struct ukbd_softc *sc, uint32_t key) (key & KEY_RELEASE) ? "released" : "pressed"); #ifdef EVDEV_SUPPORT - if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && sc->sc_evdev != NULL) { + if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && sc->sc_evdev != NULL) evdev_push_event(sc->sc_evdev, EV_KEY, evdev_hid2key(KEY_INDEX(key)), !(key & KEY_RELEASE)); - evdev_sync(sc->sc_evdev); - } #endif if (sc->sc_inputs < UKBD_IN_BUF_SIZE) { @@ -560,6 +558,11 @@ ukbd_interrupt(struct ukbd_softc *sc) } } +#ifdef EVDEV_SUPPORT + if (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD && sc->sc_evdev != NULL) + evdev_sync(sc->sc_evdev); +#endif + /* wakeup keyboard system */ ukbd_event_keyinput(sc); } From owner-dev-commits-src-all@freebsd.org Fri Feb 5 10:19: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 B44095435F9; Fri, 5 Feb 2021 10:19: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 4DXBGs1MJGz4ndx; Fri, 5 Feb 2021 10:19:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8246D1CCF0; Fri, 5 Feb 2021 10:19: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 115AJGOh029948; Fri, 5 Feb 2021 10:19:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115AJGBr029947; Fri, 5 Feb 2021 10:19:16 GMT (envelope-from git) Date: Fri, 5 Feb 2021 10:19:16 GMT Message-Id: <202102051019.115AJGBr029947@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: e8eded55f237 - stable/12 - ukbd(4): Push LED events in ioctl handler rather than in xfer callback MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e8eded55f2372406e872282914a48adcba5dfeef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 10:19:20 -0000 The branch stable/12 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e8eded55f2372406e872282914a48adcba5dfeef commit e8eded55f2372406e872282914a48adcba5dfeef Author: Vladimir Kondratyev AuthorDate: 2020-12-24 19:08:04 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-05 10:17:52 +0000 ukbd(4): Push LED events in ioctl handler rather than in xfer callback If LED state is set through evdev interface, than asynchronous nature of USB transfer callback can lead to change of order of events echoed back to userland as it causes LED events to be echoed with some lag. Fix that with echoing of LED events synchronously in ioctl handler. Reviewed by: hselasky Obtained from: sysutils/iichid MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27750 (cherry picked from commit 30f34a519372ebce29c4439d0e6a7bc8c2df0566) --- sys/dev/usb/input/ukbd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index cf1c11069ffc..e438a1521f97 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -846,11 +846,6 @@ ukbd_set_leds_callback(struct usb_xfer *xfer, usb_error_t error) if (!any) break; -#ifdef EVDEV_SUPPORT - if (sc->sc_evdev != NULL) - evdev_push_leds(sc->sc_evdev, sc->sc_leds); -#endif - /* range check output report length */ len = sc->sc_led_size; if (len > (UKBD_BUFFER_SIZE - 1)) @@ -1978,6 +1973,11 @@ ukbd_set_leds(struct ukbd_softc *sc, uint8_t leds) UKBD_LOCK_ASSERT(); DPRINTF("leds=0x%02x\n", leds); +#ifdef EVDEV_SUPPORT + if (sc->sc_evdev != NULL) + evdev_push_leds(sc->sc_evdev, leds); +#endif + sc->sc_leds = leds; sc->sc_flags |= UKBD_FLAG_SET_LEDS; From owner-dev-commits-src-all@freebsd.org Fri Feb 5 14:04: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 9E80854893F; Fri, 5 Feb 2021 14:04: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 4DXHGv454wz3JW1; Fri, 5 Feb 2021 14:04: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 74A2B1FC67; Fri, 5 Feb 2021 14:04: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 115E4dqe028011; Fri, 5 Feb 2021 14:04:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115E4d1W028010; Fri, 5 Feb 2021 14:04:39 GMT (envelope-from git) Date: Fri, 5 Feb 2021 14:04:39 GMT Message-Id: <202102051404.115E4d1W028010@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: 13ec5a6da04b - main - Add support for arm64 nGnRE device memory 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: 13ec5a6da04b14c4d40d3b37335dfaef7469aeb5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:04:39 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=13ec5a6da04b14c4d40d3b37335dfaef7469aeb5 commit 13ec5a6da04b14c4d40d3b37335dfaef7469aeb5 Author: Andrew Turner AuthorDate: 2021-02-05 10:50:29 +0000 Commit: Andrew Turner CommitDate: 2021-02-05 12:25:56 +0000 Add support for arm64 nGnRE device memory On arm64 we can select how strongly we order device memory. Currently we use the strongest type of non-Gathering, non-Reordering, no Early write acknowledgement. This is equivalent to VM_MEMATTR_SO in the 32-bit arm code. Create a new memory type to remove the no Early write acknowledgement option to create a memory attribute that is equivalent to the arm VM_MEMATTR_DEVICE. Keep the the old nGnRnE memory as what we provide for VM_MEMATTR_DEVICE until we can test nGnRE on more hardware. A method for dynamically switching back may be needed as at least one vendor is known to have broken nGnRE memory. Sponsored by: Innovate UK --- sys/arm64/arm64/locore.S | 5 +++-- sys/arm64/include/armreg.h | 1 + sys/arm64/include/vm.h | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index c62a2a5bd626..b340041eb163 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -733,10 +733,11 @@ LENTRY(start_mmu) .align 3 mair: - .quad MAIR_ATTR(MAIR_DEVICE_nGnRnE, VM_MEMATTR_DEVICE) | \ + .quad MAIR_ATTR(MAIR_DEVICE_nGnRnE, VM_MEMATTR_DEVICE_nGnRnE) | \ MAIR_ATTR(MAIR_NORMAL_NC, VM_MEMATTR_UNCACHEABLE) | \ MAIR_ATTR(MAIR_NORMAL_WB, VM_MEMATTR_WRITE_BACK) | \ - MAIR_ATTR(MAIR_NORMAL_WT, VM_MEMATTR_WRITE_THROUGH) + MAIR_ATTR(MAIR_NORMAL_WT, VM_MEMATTR_WRITE_THROUGH) | \ + MAIR_ATTR(MAIR_DEVICE_nGnRE, VM_MEMATTR_DEVICE_nGnRE) tcr: .quad (TCR_TxSZ(64 - VIRT_BITS) | TCR_TG1_4K | \ TCR_CACHE_ATTRS | TCR_SMP_ATTRS) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 201d7559320b..f5d25a572466 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -734,6 +734,7 @@ #define MAIR_ATTR_MASK(idx) (0xff << ((n)* 8)) #define MAIR_ATTR(attr, idx) ((attr) << ((idx) * 8)) #define MAIR_DEVICE_nGnRnE 0x00 +#define MAIR_DEVICE_nGnRE 0x04 #define MAIR_NORMAL_NC 0x44 #define MAIR_NORMAL_WT 0xbb #define MAIR_NORMAL_WB 0xff diff --git a/sys/arm64/include/vm.h b/sys/arm64/include/vm.h index dac13980060e..3df3af24c010 100644 --- a/sys/arm64/include/vm.h +++ b/sys/arm64/include/vm.h @@ -30,10 +30,13 @@ #define _MACHINE_VM_H_ /* Memory attribute configuration. */ -#define VM_MEMATTR_DEVICE 0 +#define VM_MEMATTR_DEVICE_nGnRnE 0 #define VM_MEMATTR_UNCACHEABLE 1 #define VM_MEMATTR_WRITE_BACK 2 #define VM_MEMATTR_WRITE_THROUGH 3 +#define VM_MEMATTR_DEVICE_nGnRE 4 + +#define VM_MEMATTR_DEVICE VM_MEMATTR_DEVICE_nGnRnE #ifdef _KERNEL /* If defined vmstat will try to use both of these in a switch statement */ From owner-dev-commits-src-all@freebsd.org Fri Feb 5 14:47: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 9DF54549BBF; Fri, 5 Feb 2021 14:47: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 4DXJD74738z3M6C; Fri, 5 Feb 2021 14:47: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 806E120793; Fri, 5 Feb 2021 14:47: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 115ElJRt080327; Fri, 5 Feb 2021 14:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115ElJGV080326; Fri, 5 Feb 2021 14:47:19 GMT (envelope-from git) Date: Fri, 5 Feb 2021 14:47:19 GMT Message-Id: <202102051447.115ElJGV080326@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: 3279329b2dca - main - tools/git: Add git-arc 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: 3279329b2dca12b6f882db7a295b9e790c82f968 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:47:19 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3279329b2dca12b6f882db7a295b9e790c82f968 commit 3279329b2dca12b6f882db7a295b9e790c82f968 Author: Mark Johnston AuthorDate: 2021-02-05 14:44:47 +0000 Commit: Mark Johnston CommitDate: 2021-02-05 14:47:05 +0000 tools/git: Add git-arc This is a handy script for creating and updating Differential revisions from git commits. It tries to avoid forcing the user to manage their git tree in any particular way, but makes two major assumptions: - there is a one-to-one mapping between git commits and Differential revisions, - the title of a Differential revision is the same as the summary line of the corresponding commit. A verbose description of the script's functionality is provided in its usage message, which should probably be converted to a man page. A description of workflows using git-arc is here: https://lists.freebsd.org/pipermail/freebsd-hackers/2021-January/056979.html There are some loose ends but this is functional enough to be useful. Discussed with: jhb Differential Revision: https://reviews.freebsd.org/D28334 --- tools/tools/git/Makefile | 4 + tools/tools/git/git-arc.sh | 596 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 600 insertions(+) diff --git a/tools/tools/git/Makefile b/tools/tools/git/Makefile new file mode 100644 index 000000000000..228a41d65275 --- /dev/null +++ b/tools/tools/git/Makefile @@ -0,0 +1,4 @@ +SCRIPTS= git-arc.sh +BINDIR?= /usr/local/bin + +.include diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh new file mode 100644 index 000000000000..3b85d851319f --- /dev/null +++ b/tools/tools/git/git-arc.sh @@ -0,0 +1,596 @@ +#!/bin/sh +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019-2021 Mark Johnston +# Copyright (c) 2021 John Baldwin +# +# 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. +# + +# TODO: +# - roll back after errors or SIGINT +# - current checkout +# - created revs +# - main (for git arc stage) + +warn() +{ + echo "$(basename $0): $1" >&2 +} + +err() +{ + warn "$1" + exit 1 +} + +err_usage() +{ + cat >&2 <<__EOF__ +Usage: git arc [-vy] + +Commands: + create [-l] [-r [,...]] [-s subscriber[,...]] [|] + list | + patch [ ...] + stage [-b branch] [|] + update + +Description: + Create or manage FreeBSD Phabricator reviews based on git commits. There + is a one-to one relationship between git commits and Differential revisions, + and the Differential revision title must match the summary line of the + corresponding commit. In particular, commit summaries must be unique across + all open Differential revisions authored by you. + + The first parameter must be a verb. The available verbs are: + + create -- Create new Differential revisions from the specified commits. + list -- Print the associated Differential revisions for the specified + commits. + patch -- Try to apply a patch from a Differential revision to the + currently checked out tree. + stage -- Prepare a series of commits to be pushed to the upstream FreeBSD + repository. The commits are cherry-picked to a branch (main by + default), review tags are added to the commit log message, and + the log message is opened in an editor for any last-minute + updates. The commits need not have associated Differential + revisions. + update -- Synchronize the Differential revisions associated with the + specified commits. Currently only the diff is updated; the + review description and other metadata is not synchronized. + + The typical end-to-end usage looks something like this: + + $ git commit -m "kern: Rewrite in Rust" + $ git arc create HEAD + + $ git commit --amend + $ git arc update HEAD + + $ git arc stage HEAD + $ git push freebsd HEAD:main + +Config Variables: + These are manipulated by git-config(1). + + arc.assume_yes [bool] + -- Assume a "yes" answer to all prompts instead of + prompting the user. Equivalent to the -y flag. + + arc.browse [bool] -- Try to open newly created reviews in a browser tab. + Defaults to false. + + arc.list [bool] -- Always use "list mode" (-l) with create. In this + mode, the list of git revisions to create reviews for + is listed with a single prompt before creating + reviews. The diffs for individual commits are not + shown. + + arc.verbose [bool] -- Verbose output. Equivalent to the -v flag. + +Examples: + Create a Phabricator review using the contents of the most recent commit in + your git checkout. The commit title is used as the review title, the commit + log message is used as the review description, markj@FreeBSD.org is added as + a reviewer. + + $ git arc create -r markj HEAD + + Create a series of Phabricator reviews for each of HEAD~2, HEAD~ and HEAD. + Pairs of consecutive commits are linked into a patch stack. Note that the + first commit in the specified range is excluded. + + $ git arc create HEAD~3..HEAD + + Update the review corresponding to commit b409afcfedcdda. The title of the + commit must be the same as it was when the review was created. The review + description is not automatically updated. + + $ git arc update b409afcfedcdda + + Apply the patch in review D12345 to the currently checked-out tree, and stage + it. + + $ git arc patch D12345 + + List the status of reviews for all the commits in the branch "feature": + + $ git arc list main..feature + +__EOF__ + + exit 1 +} + +diff2phid() +{ + local diff + + diff=$1 + if ! expr "$diff" : 'D[1-9][0-9]*$' >/dev/null; then + err "invalid diff ID $diff" + fi + + echo '{"names":["'$diff'"]}' | + arc call-conduit -- phid.lookup | + jq -r "select(.response != []) | .response.${diff}.phid" +} + +diff2status() +{ + local diff tmp status summary + + diff=$1 + if ! expr "$diff" : 'D[1-9][0-9]*$' >/dev/null; then + err "invalid diff ID $diff" + fi + + tmp=$(mktemp) + echo '{"names":["'$diff'"]}' | + arc call-conduit -- phid.lookup > $tmp + status=$(jq -r "select(.response != []) | .response.${diff}.status" < $tmp) + summary=$(jq -r "select(.response != []) | + .response.${diff}.fullName" < $tmp) + printf "%-14s %s\n" "${status}" "${summary}" +} + +log2diff() +{ + local diff + + diff=$(git show -s --format=%B $commit | + sed -nE '/^Differential Revision:[[:space:]]+(https:\/\/reviews.freebsd.org\/)?(D[0-9]+)$/{s//\2/;p;}') + if [ -n "$diff" ] && [ $(echo "$diff" | wc -l) -eq 1 ]; then + echo $diff + else + echo + fi +} + +commit2diff() +{ + local commit diff title + + commit=$1 + + # First, look for a valid differential reference in the commit + # log. + diff=$(log2diff $commit) + if [ -n "$diff" ]; then + echo $diff + return + fi + + # Second, search the open reviews returned by 'arc list' looking + # for a subject match. + title=$(git show -s --format=%s $commit) + diff=$(arc list | fgrep "$title" | egrep -o 'D[1-9][0-9]*:' | tr -d ':') + if [ -z "$diff" ]; then + err "could not find review for '${title}'" + elif [ $(echo "$diff" | wc -l) -ne 1 ]; then + err "found multiple reviews with the same title" + fi + + echo $diff +} + +create_one_review() +{ + local childphid commit dir doprompt msg parent parentphid reviewers + local subscribers + + commit=$1 + reviewers=$2 + subscribers=$3 + parent=$4 + doprompt=$5 + + if [ "$doprompt" ] && ! show_and_prompt $commit; then + return 1 + fi + + git checkout -q $commit + + dir=$(git rev-parse --git-dir)/arc + mkdir -p "$dir" + + msg=${dir}/create-message + git show -s --format='%B' $commit > $msg + printf "\nTest Plan:\n" >> $msg + printf "\nReviewers:\n" >> $msg + printf "${reviewers}\n" >> $msg + printf "\nSubscribers:\n" >> $msg + printf "${subscribers}\n" >> $msg + + yes | env EDITOR=true \ + arc diff --never-apply-patches --create --allow-untracked $BROWSE HEAD~ + [ $? -eq 0 ] || err "could not create Phabricator diff" + + if [ -n "$parent" ]; then + diff=$(commit2diff $commit) + [ -n "$diff" ] || err "failed to look up review ID for $commit" + + childphid=$(diff2phid $diff) + parentphid=$(diff2phid $parent) + echo '{ + "objectIdentifier": "'${childphid}'", + "transactions": [ + { + "type": "parents.add", + "value": ["'${parentphid}'"] + } + ]}' | + arc call-conduit -- differential.revision.edit >&3 + fi + return 0 +} + +# Get a list of reviewers who accepted the specified diff. +diff2reviewers() +{ + local diff phid reviewid userids + + diff=$1 + reviewid=$(diff2phid $diff) + userids=$( \ + echo '{ + "constraints": {"phids": ["'$reviewid'"]}, + "attachments": {"reviewers": true} + }' | + arc call-conduit -- differential.revision.search | + jq '.response.data[0].attachments.reviewers.reviewers[] | select(.status == "accepted").reviewerPHID') + if [ -n "$userids" ]; then + echo '{ + "constraints": {"phids": ['$(echo -n $userids | tr '[:space:]' ',')']} + }' | + arc call-conduit -- user.search | + jq -r '.response.data[].fields.username' + fi +} + +prompt() +{ + local resp + + if [ "$ASSUME_YES" ]; then + return 1 + fi + + printf "\nDoes this look OK? [y/N] " + read resp + + case $resp in + [Yy]) + return 0 + ;; + *) + return 1 + ;; + esac +} + +show_and_prompt() +{ + local commit + + commit=$1 + + git show $commit + prompt +} + +save_head() +{ + local commit orig + + if ! orig=$(git symbolic-ref --short -q HEAD); then + orig=$(git show -s --pretty=%H HEAD) + fi + echo $orig +} + +restore_head() +{ + local orig + + orig=$1 + git checkout -q $orig +} + +build_commit_list() +{ + local chash _commits commits + + for chash in $@; do + _commits=$(git rev-parse "${chash}") + if ! git cat-file -e "${chash}"'^{commit}' >/dev/null 2>&1; then + _commits=$(git rev-list $_commits | tail -r) + fi + [ -n "$_commits" ] || err "invalid commit ID ${chash}" + commits="$commits $_commits" + done + echo $commits +} + +gitarc::create() +{ + local commit commits doprompt list o orig prev reviewers + local subscribers + + list= + if eval $(git config --bool --default false --get arc.list); then + list=1 + fi + doprompt=1 + while getopts lr:s: o; do + case "$o" in + l) + list=1 + ;; + r) + reviewers="$OPTARG" + ;; + s) + subscribers="$OPTARG" + ;; + *) + err_usage + ;; + esac + done + shift $((OPTIND-1)) + + commits=$(build_commit_list $@) + + if [ "$list" ]; then + for commit in ${commits}; do + git --no-pager show --oneline --no-patch $commit + done | git_pager + if ! prompt; then + return + fi + doprompt= + fi + + orig=$(save_head) + prev="" + for commit in ${commits}; do + if create_one_review "$commit" "$reviewers" "$subscribers" "$prev" \ + "$doprompt"; then + prev=$(commit2diff "$commit") + else + prev="" + fi + done + restore_head $orig +} + +gitarc::list() +{ + local chash commit commits diff title + + commits=$(build_commit_list $@) + + for commit in $commits; do + chash=$(git show -s --format='%C(auto)%h' $commit) + echo -n "${chash} " + + diff=$(log2diff $commit) + if [ -n "$diff" ]; then + diff2status $diff + continue + fi + + # This does not use commit2diff as it needs to handle errors + # differently and keep the entire status. The extra 'cat' + # after 'fgrep' avoids erroring due to -e. + title=$(git show -s --format=%s $commit) + diff=$(arc list | fgrep "$title" | cat) + if [ -z "$diff" ]; then + echo "No Review : $title" + elif [ $(echo "$diff" | wc -l) -ne 1 ]; then + echo -n "Ambiguous Reviews: " + echo "$diff" | egrep -o 'D[1-9][0-9]*:' | tr -d ':' \ + | paste -sd ',' - | sed 's/,/, /g' + else + echo "$diff" | sed -e 's/^[^ ]* *//' + fi + done +} + +gitarc::patch() +{ + local rev + + if [ $# -eq 0 ]; then + err_usage + fi + + for rev in $@; do + arc patch --skip-dependencies --nocommit --nobranch --force $rev + echo "Applying ${rev}..." + [ $? -eq 0 ] || break + done +} + +gitarc::stage() +{ + local branch commit commits diff reviewers tmp + + branch=main + while getopts b: o; do + case "$o" in + b) + branch="$OPTARG" + ;; + *) + err_usage + ;; + esac + done + shift $((OPTIND-1)) + + commits=$(build_commit_list $@) + + if [ "$branch" = "main" ]; then + git checkout -q main + else + git checkout -q -b ${branch} main + fi + + tmp=$(mktemp) + for commit in $commits; do + git show -s --format=%B $commit > $tmp + diff=$(arc list | fgrep "$(git show -s --format=%s $commit)" | + egrep -o 'D[1-9][0-9]*:' | tr -d ':') + if [ -n "$diff" ]; then + # XXX this leaves an extra newline in some cases. + reviewers=$(diff2reviewers $diff | sed '/^$/d' | paste -sd ',' - | sed 's/,/, /g') + if [ -n "$reviewers" ]; then + printf "Reviewed by:\t${reviewers}\n" >> $tmp + fi + printf "Differential Revision:\thttps://reviews.freebsd.org/${diff}" >> $tmp + fi + if ! git cherry-pick --no-commit ${commit}; then + warn "Failed to apply $(git rev-parse --short ${commit}). Are you staging patches in the wrong order?" + git checkout -f + break + fi + git commit --edit --file $tmp + done +} + +gitarc::update() +{ + local commit diff orig + + commit=$1 + diff=$(commit2diff $commit) + + if ! show_and_prompt $commit; then + return + fi + + orig=$(save_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~ + + restore_head $orig +} + +set -e + +ASSUME_YES= +if eval $(git config --bool --default false --get arc.assume-yes); then + ASSUME_YES=1 +fi + +VERBOSE= +while getopts vy o; do + case "$o" in + v) + VERBOSE=1 + ;; + y) + ASSUME_YES=1 + ;; + *) + err_usage + ;; + esac +done +shift $((OPTIND-1)) + +[ $# -ge 1 ] || err_usage + +which arc >/dev/null 2>&1 || err "arc is required, install devel/arcanist" +which jq >/dev/null 2>&1 || err "jq is required, install textproc/jq" + +if [ "$VERBOSE" ]; then + exec 3>&1 +else + exec 3> /dev/null +fi + +case "$1" in +create|list|patch|stage|update) + ;; +*) + err_usage + ;; +esac +verb=$1 +shift + +# All subcommands require at least one parameter. +if [ $# -eq 0 ]; then + err_usage +fi + +# Pull in some git helper functions. +git_sh_setup=$(git --exec-path)/git-sh-setup +[ -f "$git_sh_setup" ] || err "cannot find git-sh-setup" +SUBDIRECTORY_OK=y +USAGE= +. "$git_sh_setup" + +# Bail if the working tree is unclean, except for "list" and "patch" +# operations. +case $verb in +list|patch) + ;; +*) + require_clean_work_tree $verb + ;; +esac + +if eval $(git config --bool --default false --get arc.browse); then + BROWSE=--browse +fi + +gitarc::${verb} $@ From owner-dev-commits-src-all@freebsd.org Fri Feb 5 15:08: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 70D7554A0CB; Fri, 5 Feb 2021 15:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXJhm2mRDz3NBg; Fri, 5 Feb 2021 15:08: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 51E1B20A2D; Fri, 5 Feb 2021 15:08: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 115F8e7x006986; Fri, 5 Feb 2021 15:08:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115F8e8k006985; Fri, 5 Feb 2021 15:08:40 GMT (envelope-from git) Date: Fri, 5 Feb 2021 15:08:40 GMT Message-Id: <202102051508.115F8e8k006985@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: 35e39fd95fda - main - Improve ACPI_NFIT_CONTROL_REGION formatting. 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: 35e39fd95fda64699b638192f3bab955d0f1cf0c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 15:08:40 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=35e39fd95fda64699b638192f3bab955d0f1cf0c commit 35e39fd95fda64699b638192f3bab955d0f1cf0c Author: Alexander Motin AuthorDate: 2021-02-05 15:07:37 +0000 Commit: Alexander Motin CommitDate: 2021-02-05 15:08:34 +0000 Improve ACPI_NFIT_CONTROL_REGION formatting. MFC after: 1 week --- usr.sbin/acpi/acpidump/acpi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index c573c02b7f92..2753fb26bdd9 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1659,20 +1659,20 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) printf("\tRegionIndex=%u\n", (u_int)ctlreg->RegionIndex); printf("\tVendorId=0x%04x\n", (u_int)ctlreg->VendorId); printf("\tDeviceId=0x%04x\n", (u_int)ctlreg->DeviceId); - printf("\tRevisionId=%u\n", (u_int)ctlreg->RevisionId); + printf("\tRevisionId=0x%02x\n", (u_int)ctlreg->RevisionId); printf("\tSubsystemVendorId=0x%04x\n", (u_int)ctlreg->SubsystemVendorId); printf("\tSubsystemDeviceId=0x%04x\n", (u_int)ctlreg->SubsystemDeviceId); - printf("\tSubsystemRevisionId=%u\n", + printf("\tSubsystemRevisionId=0x%02x\n", (u_int)ctlreg->SubsystemRevisionId); printf("\tValidFields=0x%02x\n", (u_int)ctlreg->ValidFields); - printf("\tManufacturingLocation=%u\n", + printf("\tManufacturingLocation=0x%02x\n", (u_int)ctlreg->ManufacturingLocation); - printf("\tManufacturingDate=%u\n", - (u_int)ctlreg->ManufacturingDate); - printf("\tSerialNumber=%u\n", - (u_int)ctlreg->SerialNumber); + printf("\tManufacturingDate=%04x\n", + (u_int)be16toh(ctlreg->ManufacturingDate)); + printf("\tSerialNumber=%08X\n", + (u_int)be32toh(ctlreg->SerialNumber)); printf("\tCode=0x%04x\n", (u_int)ctlreg->Code); printf("\tWindows=%u\n", (u_int)ctlreg->Windows); printf("\tWindowSize=0x%016jx\n", From owner-dev-commits-src-all@freebsd.org Fri Feb 5 15:55: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 853C354B2A1; Fri, 5 Feb 2021 15:55: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 4DXKl03KMSz3QrF; Fri, 5 Feb 2021 15:55: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 603F4215C1; Fri, 5 Feb 2021 15:55: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 115FteAg071309; Fri, 5 Feb 2021 15:55:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115FteFo071308; Fri, 5 Feb 2021 15:55:40 GMT (envelope-from git) Date: Fri, 5 Feb 2021 15:55:40 GMT Message-Id: <202102051555.115FteFo071308@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: 59fffbcf46ba - main - mrsas: unbreak i386 build 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: 59fffbcf46ba6369420e655ff9173571410c643d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 15:55:40 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=59fffbcf46ba6369420e655ff9173571410c643d commit 59fffbcf46ba6369420e655ff9173571410c643d Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-05 18:43:48 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-05 18:43:48 +0000 mrsas: unbreak i386 build Fix build regression introduced by e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D28494 --- sys/dev/mrsas/mrsas.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index f4c34e237fc4..01173387c8d4 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -2782,9 +2782,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->queue_info_new_phys_addr_lo = htole32(phys_addr); init_frame->data_xfer_len = htole32(sizeof(Mpi2IOCInitRequest_t)); - req_desc.addr.u.low = htole32((bus_addr_t)sc->ioc_init_phys_mem & 0xFFFFFFFF); - req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); - + req_desc.addr.Words = htole64((bus_addr_t)sc->ioc_init_phys_mem); req_desc.MFAIo.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); From owner-dev-commits-src-all@freebsd.org Fri Feb 5 16:29: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 F2AB454B67E; Fri, 5 Feb 2021 16:29: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 4DXLTZ6Ww1z3jMk; Fri, 5 Feb 2021 16:29: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 D347D21BF4; Fri, 5 Feb 2021 16: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 115GT6tk011083; Fri, 5 Feb 2021 16: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 115GT6sD011082; Fri, 5 Feb 2021 16:29:06 GMT (envelope-from git) Date: Fri, 5 Feb 2021 16:29:06 GMT Message-Id: <202102051629.115GT6sD011082@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: 90da2c797bfa - main - truss: Decode sendfile(2) arguments 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: 90da2c797bfa7639005ed46ab9173feb8bd85ecd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:29:07 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=90da2c797bfa7639005ed46ab9173feb8bd85ecd commit 90da2c797bfa7639005ed46ab9173feb8bd85ecd Author: Mark Johnston AuthorDate: 2021-02-05 16:28:09 +0000 Commit: Mark Johnston CommitDate: 2021-02-05 16:28:29 +0000 truss: Decode sendfile(2) arguments MFC after: 2 weeks --- usr.bin/truss/syscall.h | 2 ++ usr.bin/truss/syscalls.c | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h index 5f8babf4c407..af918fed4f1b 100644 --- a/usr.bin/truss/syscall.h +++ b/usr.bin/truss/syscall.h @@ -117,6 +117,8 @@ enum Argtype { Procctl, Priowhich, Ptraceop, + Sendfileflags, + Sendfilehdtr, Quotactlcmd, Reboothowto, Resource, diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 319f3d8b0793..f52a82ed97c0 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -478,6 +478,10 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Iovec | IN, 1 }, { Int, 2 }, { Sockaddr | IN, 3 }, { Socklent, 4 }, { Sctpsndrcvinfo | IN, 5 }, { Msgflags, 6 } } }, + { .name = "sendfile", .ret_type = 1, .nargs = 7, + .args = { { Int, 0 }, { Int, 1 }, { QuadHex, 2 }, { Sizet, 3 }, + { Sendfilehdtr, 4 }, { QuadHex | OUT, 5 }, + { Sendfileflags, 6 } } }, { .name = "select", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, @@ -2670,6 +2674,24 @@ print_arg(struct syscall_args *sc, unsigned long *args, register_t *retval, print_integer_arg(sysdecode_ptrace_request, fp, args[sc->offset]); break; + case Sendfileflags: + print_mask_arg(sysdecode_sendfile_flags, fp, args[sc->offset]); + break; + case Sendfilehdtr: { + struct sf_hdtr hdtr; + + if (get_struct(pid, args[sc->offset], &hdtr, sizeof(hdtr)) != + -1) { + fprintf(fp, "{"); + print_iovec(fp, trussinfo, (uintptr_t)hdtr.headers, + hdtr.hdr_cnt); + print_iovec(fp, trussinfo, (uintptr_t)hdtr.trailers, + hdtr.trl_cnt); + fprintf(fp, "}"); + } else + print_pointer(fp, args[sc->offset]); + break; + } case Quotactlcmd: if (!sysdecode_quotactl_cmd(fp, args[sc->offset])) fprintf(fp, "%#x", (int)args[sc->offset]); From owner-dev-commits-src-all@freebsd.org Fri Feb 5 16:37: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 9FA7754BF89 for ; Fri, 5 Feb 2021 16:37:36 +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 4DXLgN43ZHz3k77; Fri, 5 Feb 2021 16:37:36 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612543056; 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=i7wF6jWETiraB9sm5USNN78aOZenVluBQ7LkBynZPDM=; b=TBOC+QDjau/4FsLue0vduNJuzjG64k+gn6x0HoQnB514M+aQIcd3uW3EkN3jLX01jgNEmE iMowAEkY/6cjv+tKn1/O1kb86szsTSAWiekpRZ+PpfrlIww3512YN1RtEou5sAab9Vt5QL PvFgQYg79hr3nCKQlM3/wlKiLqgYX+DvGabiZToJ1Sale9qAevDzYX7E1Xe8mPzHrPVAkg HEZ+9KS2vRSsiq/EW/zOR8mtujkgTHWXGJexnzfg1SvvULXIgVHGBB8jQ7XI315yVoSdKA U9JTz/FrbZhWf/TyfsjxWuM+cpRW3NZoX2LFGn7Y7GuT9RwiNxbVJNIFwPcPVA== 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 1146B1D5A5; Fri, 5 Feb 2021 16:37:36 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Fri, 5 Feb 2021 16:37:34 +0000 From: Glen Barber To: Ka Ho Ng Cc: dev-commits-src-all@freebsd.org Subject: Re: git: 3d544e6b0bc4 - stable/13 - Rename stable/13 to -STABLE now that releng/13.0 has branched Message-ID: <20210205163734.GR77557@FreeBSD.org> References: <202102050002.11502Sro026366@gitrepo.freebsd.org> <45841159-3C53-45AF-90EB-7A8798E32242@freebsdfoundation.org> <54BB4038-0F97-416F-B66B-8B2DDD06C6C1@freebsdfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aqslNqCJIrCDm17C" Content-Disposition: inline In-Reply-To: <54BB4038-0F97-416F-B66B-8B2DDD06C6C1@freebsdfoundation.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1612543056; 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=i7wF6jWETiraB9sm5USNN78aOZenVluBQ7LkBynZPDM=; b=rhpGC5LLL5y8uvkNREMJP87+s5tmi7dIhj88k+FN6abwVb65sLVN3+zh4GcZxnnwgvesyo alSH+aVVXhP6pz8LFKN6RiP9XqmVORlsEdEwnz9jEK9moonIyW6NjtuQT+5OHjaxzzsOdO wTN3+9RA5ujni8dZF6zlHjxll0gjMMdKmPYyU/eZDPHmCvRS/FI7lHQCbw3CJAz9KyUdrX KwT+tn7j+CQYaN7S7bbB7H9/LUWfd35HarnepuYL++BTgkqoHeiAIKiA/RDpzDX1b28Pve x1LTFgv3Di+TEfircVQb5z9ZZikwNBLb9wCVKLxFRwW5Sbf70Zx1gsLlxN5njg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1612543056; a=rsa-sha256; cv=none; b=Au1gx9756Cbt9BThAyvboxLl9otE1t3QhTHsuJz1rlT4T1w2Wghy75IgVjKRXvTdQJRr/H IvNe4XPiAlBVbQhRYxiZP1uMk9VtYfCSx7sxkhDJKNKlYTaeOxbxInFNEiBGUqEJ7ixKY7 woDpVXCkC2iqojpfoxvlrldu7CFdqh40MvVhyaXndW4f2zZIGJIzU6Q7uOKz1i9KPRKbKL FTf8UbuZCByGvJpke7rRVhJGuiyx5mPW56ZuAYet+IpyVqnm5o2O/yHJWxT5ryCuXwe+P7 H6iHjpLvOu1QVOqD302nxOlDP35d2t1tIoAwdf6eBpCj9yIxQBIztn7svxneiw== 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: Fri, 05 Feb 2021 16:37:36 -0000 --aqslNqCJIrCDm17C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 05, 2021 at 05:19:38PM +0800, Ka Ho Ng wrote: > > On Feb 5, 2021, at 5:16 PM, Ka Ho Ng wrote: > >=20 > >> On Feb 5, 2021, at 8:02 AM, Glen Barber wrote: > >>=20 > >> #undef __FreeBSD_version > >> -#define __FreeBSD_version 1300139 /* Master, propagated to newvers */ > >> +#define __FreeBSD_version 1305000 /* Master, propagated to newvers */ > >>=20 > >> /* > >> * __FreeBSD_kernel__ indicates that this system uses the kernel of Fre= eBSD, > >>=20 > >=20 > > I think 1305000 is too high that it breaks os_note also. Now file comma= nd gives FreeBSD 13.5 on binaries. Or should it actually be 1300500? > >=20 > > Ka Ho >=20 > Nevermind. It seems normal to bump it that high: > https://github.com/freebsd/freebsd-src/commit/2f88c6c939bff4237856b165d92= a0e258da00176 > https://github.com/freebsd/freebsd-src/commit/f8dbe6487a39362f3cf8400994c= 0cc00af6b6917 >=20 No, this is in fact wrong. Thank you for the report. Glen --aqslNqCJIrCDm17C Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAmAddE4ACgkQAxRYpUeP 4pNoBBAAkqvdRE0ebNzEzOyuoSo+JJOPcN84Yiry6p+r415CctTjFiH5F3ZlTRnz EJ9GIx1vA+YTB9R/lCKpMki0l2dq8mmCZcMKcGiylfsMgBPH1EaY1yjVeelTdNkY 0VB6QViNRhko0zP4WNc46qRG5sLBkqrc1Pq5X78gSZ89E6ZTayyJuMHTcWQm4bnx m9q5Dx2dvdjkmXzuVzr0lzwb5kkYbR7mux4GwhKe+0cK2CGerUiLhHtY918Kl4Go l80WxDW1lmTM4EM1Z802hExsdVPmITNOg+FKmhafB8+G1dzxQSAgrV8wbn0+HUYK qigPVc/BOEDCR27R8zQ0qbu+5YDgwo4w+nb9oze5UcW6OzQpQfYBBLcmrKvQFqGh 2HqdhwObTzhRkMQjSj/WiyFWeDM6SJ4AMV2t6HQCoYcRZwen8kzuAI8npL0BMS2z AFMsikNUCZljAniB907/1omju/mmwMiT6UsgTBZIYMh2ZoYT/GO0XigPgGxroyoL vU0VswXB7iLLa2uIMLY1PQ6aiM/Icl+FQ1ktg56UcCv/G5DA0U+TXkD1dzOJv+Wd 7GDuIjfFnmkr7Sr+DbfSLQocZRMm8uP+SRQm/ynQjMuez4O5OzB6bS657yZStLMd CQhNGzOstVrlSOQ0M96yFw1ggVcI+Yki4fUTV39iWT8VsuSaxe4= =PTBX -----END PGP SIGNATURE----- --aqslNqCJIrCDm17C-- From owner-dev-commits-src-all@freebsd.org Fri Feb 5 16:40: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 A8EAA54BF58; Fri, 5 Feb 2021 16:40: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 4DXLkR4NHCz3jjP; Fri, 5 Feb 2021 16:40: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 8913921F61; Fri, 5 Feb 2021 16:40: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 115GeFk2029023; Fri, 5 Feb 2021 16:40:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115GeFdP029017; Fri, 5 Feb 2021 16:40:15 GMT (envelope-from git) Date: Fri, 5 Feb 2021 16:40:15 GMT Message-Id: <202102051640.115GeFdP029017@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: 3c6a89748a01 - stable/13 - param.h: fix __FreeBSD_version convention 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3c6a89748a01869c18955d5e3bfcdf35f6705d26 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:40:15 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=3c6a89748a01869c18955d5e3bfcdf35f6705d26 commit 3c6a89748a01869c18955d5e3bfcdf35f6705d26 Author: Glen Barber AuthorDate: 2021-02-05 16:38:27 +0000 Commit: Glen Barber CommitDate: 2021-02-05 16:38:27 +0000 param.h: fix __FreeBSD_version convention Note, this has the side effect of __FreeBSD_version going backwards. If this causes too many problems, I will bump it to 1301500 with a comment in the file as a reminder for 13.1. Submitted by: Ka Ho Ng Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 497832e1ba15..28a1cf981a58 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1305000 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300500 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Fri Feb 5 16:44: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 8738954BFD6 for ; Fri, 5 Feb 2021 16:44:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (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 4DXLqq5Wdnz3l3n for ; Fri, 5 Feb 2021 16:44:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf31.google.com with SMTP id w11so3716893qvz.12 for ; Fri, 05 Feb 2021 08:44: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=fMmUFIIiiUyxZLeFcAIKiNQmlWZuvXNzqd7lqK7ZSn0=; b=of1s0PTuBf3VrEHi0hdc94GjXYQ17xyOAoTt/z3wFX889QegY1K17OC9G0FiDaR0cO 92LqO+v5VBEX5cig9hFeLVGaT3ia4v1FMVIGNdGw0fTe5kvRr/307hep7cNb9uGRvJC5 YJDA3Q8fT7FnC+Cu5lithUDoVUT7Ckv0LD0f+gT8J2FPeADbodnjFv1rXSHRpvYrE/kd sjy0BWTrk/W3M3KHrURbYHDtOgtrrs6gK4ml4eTx9P3tWVBhXmrtlbAPS+ity8OGXec9 jbFfB0RJef0ois+zySqjUyqHKlM3Pv0nQY8WGMM+CjFZcGJ+Eoy328L9VKhghErEm2AQ Nk9Q== 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=fMmUFIIiiUyxZLeFcAIKiNQmlWZuvXNzqd7lqK7ZSn0=; b=NJd8Xvjl5d3MchZ9uEHCN5A48eQBFJo1KxGhmJE4LQlqnk3Qn+PLIBIgpnwt82WOIh R6V4X1i5rD26EfJ0a2XrnM+LyvYbz8OqwF5aKZsX40v4ldT6Ri40pNjO5reuXJmC12iW UstmJHRIesOzOm+5bgAANyLh59wHkmZTPz6c/s4MhlvngE2ts+cvfzcu8WdBRlFTRnu3 pNj4rfMIio3kmAVEHvQibFEBducCJ9tO/XIg16q+c7yyYlJ7TUCnmioIYyvWdua70KXi O2kSwLrWvs0GyScgExQfqubA0/dGpj8PKgAmSdy+o2dXZKqxHbFmiaSDfH9rpuWHSwGJ d3og== X-Gm-Message-State: AOAM531SRFkzXnPgmbznrSUtTikMdrc1V02vCO1s4+Oubc5kGFodLDMb C8jXIVOsFilT7e+kzl+PWNtT4IYO8RSYA54Qk3n0bcFFc0GZ8w== X-Google-Smtp-Source: ABdhPJw2kUseLNjyPrJTBvdBz8h4bQ5UDgeFYY6bX0JImwWyiOG0YBAEcbKnyqRoXDz6vKMauxvpVJveAFCHNfdn6vU= X-Received: by 2002:ad4:576a:: with SMTP id r10mr5029232qvx.29.1612543493274; Fri, 05 Feb 2021 08:44:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Fri, 5 Feb 2021 09:44:42 -0700 Message-ID: Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev To: Toomas Soome Cc: Toomas Soome , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org X-Rspamd-Queue-Id: 4DXLqq5Wdnz3l3n X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=of1s0PTu; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f31) 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)[5]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::f31: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::f31:from]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[me.com]; 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::f31:from]; RCVD_COUNT_TWO(0.00)[2]; 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] 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: Fri, 05 Feb 2021 16:44:56 -0000 On Thu, Feb 4, 2021 at 11:38 PM Toomas Soome wrote: > > > On 5. Feb 2021, at 01:56, Warner Losh wrote: > > =EF=BB=BF > And why the instaMFC? Changes are supposed to cook force days before > merging... I have questions about the wisdom of this change... > > Warner > > > Reason is in PR. There is someone with the system without ConOut but > ConOutDev is set. Instead of falling back to arbitrary device (which in > this case was totally wrong choice), we can try the possible devices list= . > We do not change the ConOut parsing. > We could have the same effect defaulting to Video. This bug should have been discussed / reviewed before it was committed. If it would appear, there are systems with unusable devices listed in > ConOutDev, then we need to think how to handle such case. > Yes. We fall back to the arbitrary device... It's just a flag that can be overridden. We can easily fall back to video too. Please seek more review is the point I'd hoped to make in the private email. This could easily have been reviewed. There was no urgent rush that required it to go in w/o review or even discussion. However, you didn't answer my question: Why the instant MFC? There's a 3 day minimum for changes in head... And there's nothing so urgent that requires a short-circuit. Warner > Thanks, > Toomas > > On Thu, Feb 4, 2021, 2:34 PM Toomas Soome wrote: > >> The branch stable/13 has been updated by tsoome: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3D0c839497c174e961fc71f7d3329d05= b10ec5525b >> >> commit 0c839497c174e961fc71f7d3329d05b10ec5525b >> Author: Toomas Soome >> AuthorDate: 2021-02-04 20:49:02 +0000 >> Commit: Toomas Soome >> CommitDate: 2021-02-04 21:33:15 +0000 >> >> loader.efi: There are systems without ConOut, also use ConOutDev >> >> Conout does contian the default output device name. >> ConOutDev does contain all possible output device names, so we can >> use it as fallback, when there is no ConOut. >> >> PR: 253253 >> >> (cherry picked from commit 2bd4ff2d8911009283e4e615ca4aad35a845f48b) >> --- >> stand/efi/loader/main.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c >> index ca41cd4a2610..32b278950745 100644 >> --- a/stand/efi/loader/main.c >> +++ b/stand/efi/loader/main.c >> @@ -735,6 +735,8 @@ parse_uefi_con_out(void) >> how =3D 0; >> sz =3D sizeof(buf); >> rv =3D efi_global_getenv("ConOut", buf, &sz); >> + if (rv !=3D EFI_SUCCESS) >> + rv =3D efi_global_getenv("ConOutDev", buf, &sz); >> if (rv !=3D EFI_SUCCESS) { >> /* If we don't have any ConOut default to serial */ >> how =3D RB_SERIAL; >> > From owner-dev-commits-src-all@freebsd.org Fri Feb 5 16:47: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 9F5FA54BDF8; Fri, 5 Feb 2021 16:47: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 4DXLtd46KPz3l4c; Fri, 5 Feb 2021 16:47: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 8023421E32; Fri, 5 Feb 2021 16:47: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 115GlLZ3036912; Fri, 5 Feb 2021 16:47:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115GlLMa036911; Fri, 5 Feb 2021 16:47:21 GMT (envelope-from git) Date: Fri, 5 Feb 2021 16:47:21 GMT Message-Id: <202102051647.115GlLMa036911@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: 7b1d1a1658ff - main - release: disable the 'reldoc' target after the ASCIIDoctor switch 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: 7b1d1a1658ffb69eff93afc713f9e88ed8b20eac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:47:21 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=7b1d1a1658ffb69eff93afc713f9e88ed8b20eac commit 7b1d1a1658ffb69eff93afc713f9e88ed8b20eac Author: Glen Barber AuthorDate: 2021-02-05 16:46:49 +0000 Commit: Glen Barber CommitDate: 2021-02-05 16:47:15 +0000 release: disable the 'reldoc' target after the ASCIIDoctor switch The 'reldoc' target includes release-related documentation on installation medium. Since the switch from XML to ASCIIDoctor, the file locations have moved, and it will take some time to sort out how this target should work now. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- release/Makefile | 62 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/release/Makefile b/release/Makefile index 3df1e461d64e..77df7762e412 100644 --- a/release/Makefile +++ b/release/Makefile @@ -88,9 +88,9 @@ EXTRA_PACKAGES+= ports.txz .if !defined(NOSRC) EXTRA_PACKAGES+= src.txz .endif -.if !defined(NODOC) -EXTRA_PACKAGES+= reldoc -.endif +#.if !defined(NODOC) +#EXTRA_PACKAGES+= reldoc +#.endif RELEASE_TARGETS= ftp IMAGES= @@ -119,9 +119,9 @@ CLEANFILES+= ${I}.xz CLEANFILES+= pkg-stage .endif CLEANDIRS= dist ftp disc1 bootonly dvd -.if !defined(NODOC) -CLEANDIRS+= reldoc rdoc -.endif +#.if !defined(NODOC) +#CLEANDIRS+= reldoc rdoc +#.endif beforeclean: chflags -R noschg . .include @@ -161,22 +161,22 @@ ports.txz: --exclude 'usr/ports/INDEX*' --exclude work usr/ports | \ ${XZ_CMD} > ${.OBJDIR}/ports.txz -reldoc: - cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ - env MAN4DIR=${WORLDDIR}/share/man/man4 \ - _BRANCH=${BRANCH} \ - ${MAKE} all install clean "FORMATS=html txt" \ - INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \ - WEBDIR=${DOCDIR} DESTDIR=${.OBJDIR}/rdoc - mkdir -p reldoc -.for i in hardware readme relnotes errata - ln -f ${.OBJDIR}/rdoc/${i:tl}.txt \ - reldoc/${i:tu}.TXT - ln -f ${.OBJDIR}/rdoc/${i:tl}.html \ - reldoc/${i:tu}.HTML -.endfor - cp ${.OBJDIR}/rdoc/docbook.css \ - reldoc/ +#reldoc: +# cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ +# env MAN4DIR=${WORLDDIR}/share/man/man4 \ +# _BRANCH=${BRANCH} \ +# ${MAKE} all install clean "FORMATS=html txt" \ +# INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \ +# WEBDIR=${DOCDIR} DESTDIR=${.OBJDIR}/rdoc +# mkdir -p reldoc +#.for i in hardware readme relnotes errata +# ln -f ${.OBJDIR}/rdoc/${i:tl}.txt \ +# reldoc/${i:tu}.TXT +# ln -f ${.OBJDIR}/rdoc/${i:tl}.html \ +# reldoc/${i:tu}.HTML +#.endfor +# cp ${.OBJDIR}/rdoc/docbook.css \ +# reldoc/ disc1: packagesystem # Install system @@ -194,9 +194,9 @@ disc1: packagesystem do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated -.if !defined(NODOC) - cp reldoc/* ${.TARGET} -.endif +#.if !defined(NODOC) +# cp reldoc/* ${.TARGET} +#.endif # Set up installation environment ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf @@ -222,9 +222,9 @@ bootonly: packagesystem mkdir -p ${.TARGET}/usr/freebsd-dist cp MANIFEST ${.TARGET}/usr/freebsd-dist # Copy documentation, if generated -.if !defined(NODOC) - cp reldoc/* ${.TARGET} -.endif +#.if !defined(NODOC) +# cp reldoc/* ${.TARGET} +#.endif # Set up installation environment ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf @@ -247,9 +247,9 @@ dvd: packagesystem do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done # Copy documentation, if generated -.if !defined(NODOC) - cp reldoc/* ${.TARGET} -.endif +#.if !defined(NODOC) +# cp reldoc/* ${.TARGET} +#.endif # Set up installation environment ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf From owner-dev-commits-src-all@freebsd.org Fri Feb 5 16:52: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 5501754C3E1; Fri, 5 Feb 2021 16:52: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 4DXM0f1vvsz3lYK; Fri, 5 Feb 2021 16:52: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 346ED21CCB; Fri, 5 Feb 2021 16:52: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 115GqY8D049750; Fri, 5 Feb 2021 16:52:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115GqYVS049749; Fri, 5 Feb 2021 16:52:34 GMT (envelope-from git) Date: Fri, 5 Feb 2021 16:52:34 GMT Message-Id: <202102051652.115GqYVS049749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: 6bf9668d9d02 - stable/13 - mrsas: unbreak i386 build 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:52:34 -0000 The branch stable/13 has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247 commit 6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-05 18:43:48 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-05 19:50:21 +0000 mrsas: unbreak i386 build Fix build regression introduced by e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D28494 (cherry picked from commit 59fffbcf46ba6369420e655ff9173571410c643d) --- sys/dev/mrsas/mrsas.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index f4c34e237fc4..01173387c8d4 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -2782,9 +2782,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->queue_info_new_phys_addr_lo = htole32(phys_addr); init_frame->data_xfer_len = htole32(sizeof(Mpi2IOCInitRequest_t)); - req_desc.addr.u.low = htole32((bus_addr_t)sc->ioc_init_phys_mem & 0xFFFFFFFF); - req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); - + req_desc.addr.Words = htole64((bus_addr_t)sc->ioc_init_phys_mem); req_desc.MFAIo.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); From owner-dev-commits-src-all@freebsd.org Fri Feb 5 16: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 6D12B54C7B4; Fri, 5 Feb 2021 16:56:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (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 4DXM4d5wx9z3ljc; Fri, 5 Feb 2021 16:56:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) X-Originating-IP: 195.64.148.76 Received: from [192.168.0.88] (unknown [195.64.148.76]) (Authenticated sender: andriy.gapon@uabsd.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id E4D4DC0012; Fri, 5 Feb 2021 16:55:58 +0000 (UTC) Subject: Re: git: 6bf9668d9d02 - stable/13 - mrsas: unbreak i386 build To: Alfredo Dal'Ava Junior , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202102051652.115GqYVS049749@gitrepo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; keydata= mDMEX1iFDhYJKwYBBAHaRw8BAQdAiu8JG/oLFkVkOAJqJc7Dx5KI/Q6C3SBI20EQm+DXnAu0 HkFuZHJpeSBHYXBvbiA8YXZnQEZyZWVCU0Qub3JnPoiWBBMWCAA+FiEEyCHHZM09l0OE3Ir/ 1A1+Gq8+L1EFAl9YhQ4CGwMFCQeEzgAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ1A1+ Gq8+L1Fc0wD/ZjmhHfbCJywZU3aOxXIPjcz73FYEGMvqMCCLAWyLbSABALFL+1ZNrjV3BGjq 889cOYFuboA/Yn3eWezS+tfqYBsGuDgEX1iFDhIKKwYBBAGXVQEFAQEHQL6B20Xi600TrkpG P9fWjl7JtHNxqrHKhX6Kg7kgb4ILAwEIB4h+BBgWCAAmFiEEyCHHZM09l0OE3Ir/1A1+Gq8+ L1EFAl9YhQ4CGwwFCQeEzgAACgkQ1A1+Gq8+L1F3cgEAktp4h+IJUJxL1vn6zMOt//znni/J TanKfQuA8wGXcGkBAKpZJhqMkg+pKk7MGvJhgJ6nCpTZ+rMK6vZVZLUWc3QF Message-ID: <9f35a234-4c6f-7c86-523f-824dc52656aa@FreeBSD.org> Date: Fri, 5 Feb 2021 18:55:57 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <202102051652.115GqYVS049749@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DXM4d5wx9z3ljc 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 Feb 2021 16:56:02 -0000 On 05/02/2021 18:52, Alfredo Dal'Ava Junior wrote: > The branch stable/13 has been updated by alfredo: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247 > > commit 6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247 > Author: Alfredo Dal'Ava Junior > AuthorDate: 2021-02-05 18:43:48 +0000 > Commit: Alfredo Dal'Ava Junior > CommitDate: 2021-02-05 19:50:21 +0000 > > mrsas: unbreak i386 build > > Fix build regression introduced by > e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a > > Reviewed by: jhibbits Was it? I do not see an approval in the review request. > Sponsored by: Eldorado Research Institute (eldorado.org.br) > Differential Revision: https://reviews.freebsd.org/D28494 > > (cherry picked from commit 59fffbcf46ba6369420e655ff9173571410c643d) Why the insta-MFC _again_? Especially while there is still a discussion in the review request. > sys/dev/mrsas/mrsas.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c > index f4c34e237fc4..01173387c8d4 100644 > --- a/sys/dev/mrsas/mrsas.c > +++ b/sys/dev/mrsas/mrsas.c > @@ -2782,9 +2782,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) > init_frame->queue_info_new_phys_addr_lo = htole32(phys_addr); > init_frame->data_xfer_len = htole32(sizeof(Mpi2IOCInitRequest_t)); > > - req_desc.addr.u.low = htole32((bus_addr_t)sc->ioc_init_phys_mem & 0xFFFFFFFF); > - req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); > - > + req_desc.addr.Words = htole64((bus_addr_t)sc->ioc_init_phys_mem); > req_desc.MFAIo.RequestFlags = > (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); > > -- Andriy Gapon From owner-dev-commits-src-all@freebsd.org Fri Feb 5 17:12: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 B0BF454CBFA; Fri, 5 Feb 2021 17:12:59 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 4DXMSC3yn4z3nGk; Fri, 5 Feb 2021 17:12:59 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io1-xd34.google.com with SMTP id n201so7815552iod.12; Fri, 05 Feb 2021 09:12:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-transfer-encoding; bh=8mOdqa7kHQu3XbuZn0Eda5R7aV0IVQCQCG8vRfzSva4=; b=gC/ebv+gsV13wmVOCvJE+IVu2ichfIcoPbYDM3NNv/MSoxWVUyqsMc//poPBF8EXhc 7NUCfN15KPA9PVT3eF5J8AWdMBMiXkhj9CnCwFuHnfhjcgQBRqG5NrNcFbtpBRpHGDDk EsmyCVD4RCQThllORVE/mJ3t5NBbd37sp3XtOldnpD0EgfSEfav5jfrlhnkO2kgx7y0i nV23V7qhGXn7V5em63t3cgZMQinQ24xgPOgorbC0H5grOr+1GBVZhwJHFQpULAjn/GKG 0sjyvh01KTlfgn8ptd83qAO0DZpFz54pOVMhPU/tvT3AxMkBbIqRcsG6IFxuOVOsRB/g InKg== 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:message-id:in-reply-to :references:subject:mime-version:content-transfer-encoding; bh=8mOdqa7kHQu3XbuZn0Eda5R7aV0IVQCQCG8vRfzSva4=; b=YL4ZI2GYs3G+spiEP2PEFrhGmf58z9VabIx7lKvvOe/G7C0JyTuRxMzbc0jtSC+zue izkf1IZrUNRb5TIXkA42Z+t7Lzrec1UK59EQB86a+vyUN58jmIn2zlM/YyU3YkCT8tuT phXVkrtmyqGVS/J4Ym+Pe4qzURQpvyxEN+TUwJ1mY08Z5QVkOQ3DOzxbPOLL/64+jy3g /O0tp/1qdS3RHvS9fnFuaNmbt0yF0jcJk5OB5hLihETiDn6hL6I4GgziaW7EZyZSkfwI lEvAPjUchJeifmNUdJ8ffNzy/DuM5cUI7XrWo9wUIBFiCAf78Vn8ADiWX6yIBSsIGAXm a7NA== X-Gm-Message-State: AOAM532kItfE4UQdkBihSc7F02nrRM5mkZW1NG9llFHeyHu3xYJs4BdS AFSa2F2bv1UmWZ+1voUitv+c5YyYu9GYaQ== X-Google-Smtp-Source: ABdhPJxazJkwoQhjV5zFfANKq+ubO9+6/bhoeDDPyzlvjqZKRWnm1fpQTaSVAhVNzw1aq3jMx4McaQ== X-Received: by 2002:a05:6638:a36:: with SMTP id 22mr6074822jao.109.1612545178156; Fri, 05 Feb 2021 09:12:58 -0800 (PST) Received: from [127.0.0.1] (173-18-9-215.client.mchsi.com. [173.18.9.215]) by smtp.gmail.com with ESMTPSA id f16sm4594967iob.16.2021.02.05.09.12.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Feb 2021 09:12:57 -0800 (PST) Date: Fri, 5 Feb 2021 17:12:50 +0000 (UTC) From: Justin Hibbits To: Andriy Gapon Cc: Alfredo Dal'Ava Junior , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Message-ID: <5066e1e2-e4ce-48c3-8015-74810e7b727c@gmail.com> In-Reply-To: <9f35a234-4c6f-7c86-523f-824dc52656aa@FreeBSD.org> References: <202102051652.115GqYVS049749@gitrepo.freebsd.org> <9f35a234-4c6f-7c86-523f-824dc52656aa@FreeBSD.org> Subject: Re: git: 6bf9668d9d02 - stable/13 - mrsas: unbreak i386 build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: <5066e1e2-e4ce-48c3-8015-74810e7b727c@gmail.com> X-Rspamd-Queue-Id: 4DXMSC3yn4z3nGk 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 Feb 2021 17:12:59 -0000 Feb 5, 2021 10:56:13 Andriy Gapon : > On 05/02/2021 18:52, Alfredo Dal'Ava Junior wrote: >> The branch stable/13 has been updated by alfredo: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D6bf9668d9d02bdf3e0dafc4ba= 1010ef6a9b12247 >> >> commit 6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247 >> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Alfredo Dal'Ava Junior >> AuthorDate: 2021-02-05 18:43:48 +0000 >> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Alfredo Dal'Ava Junior >> CommitDate: 2021-02-05 19:50:21 +0000 >> >> =C2=A0=C2=A0=C2=A0 mrsas: unbreak i386 build >> =C2=A0=C2=A0=C2=A0 >> =C2=A0=C2=A0=C2=A0 Fix build regression introduced by >> =C2=A0=C2=A0=C2=A0 e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a >> =C2=A0=C2=A0=C2=A0 >> =C2=A0=C2=A0=C2=A0 Reviewed by:=C2=A0=C2=A0=C2=A0 jhibbits > > Was it?=C2=A0 I do not see an approval in the review request. Yes,=C2=A0 it was reviewed by me,=C2=A0 since he took exactly what I sugges= ted, and we discussed over IRC. > >> =C2=A0=C2=A0=C2=A0 Sponsored by:=C2=A0=C2=A0 Eldorado Research Institute= (eldorado.org.br) >> =C2=A0=C2=A0=C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd.= org/D28494 >> =C2=A0=C2=A0=C2=A0 >> =C2=A0=C2=A0=C2=A0 (cherry picked from commit 59fffbcf46ba6369420e655ff9= 173571410c643d) > > Why the insta-MFC _again_? > Especially while there is still a discussion in the review request. Agree here, but not sure the best resolution for the breakage in this case. > >> sys/dev/mrsas/mrsas.c | 4 +--- >> 1 file changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c >> index f4c34e237fc4..01173387c8d4 100644 >> --- a/sys/dev/mrsas/mrsas.c >> +++ b/sys/dev/mrsas/mrsas.c >> @@ -2782,9 +2782,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) >> =C2=A0 init_frame->queue_info_new_phys_addr_lo =3D htole32(phys_addr); >> =C2=A0 init_frame->data_xfer_len =3D htole32(sizeof(Mpi2IOCInitRequest_t= )); >> >> - req_desc.addr.u.low =3D htole32((bus_addr_t)sc->ioc_init_phys_mem & 0x= FFFFFFFF); >> - req_desc.addr.u.high =3D htole32((bus_addr_t)sc->ioc_init_phys_mem >> = 32); >> - >> + req_desc.addr.Words =3D htole64((bus_addr_t)sc->ioc_init_phys_mem); >> =C2=A0 req_desc.MFAIo.RequestFlags =3D >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_RE= Q_DESCRIPT_FLAGS_TYPE_SHIFT); >> >> > > > -- > Andriy Gapon - Justin From owner-dev-commits-src-all@freebsd.org Fri Feb 5 17:14: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 36D8854CCE4; Fri, 5 Feb 2021 17:14:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 4DXMV52qZJz3nMq; Fri, 5 Feb 2021 17:14:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) X-Originating-IP: 195.64.148.76 Received: from [192.168.0.88] (unknown [195.64.148.76]) (Authenticated sender: andriy.gapon@uabsd.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id DA5E420016; Fri, 5 Feb 2021 17:14:32 +0000 (UTC) Subject: Re: git: 6bf9668d9d02 - stable/13 - mrsas: unbreak i386 build To: Justin Hibbits , Alfredo Dal'Ava Junior Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202102051652.115GqYVS049749@gitrepo.freebsd.org> <9f35a234-4c6f-7c86-523f-824dc52656aa@FreeBSD.org> <5066e1e2-e4ce-48c3-8015-74810e7b727c@gmail.com> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; keydata= mDMEX1iFDhYJKwYBBAHaRw8BAQdAiu8JG/oLFkVkOAJqJc7Dx5KI/Q6C3SBI20EQm+DXnAu0 HkFuZHJpeSBHYXBvbiA8YXZnQEZyZWVCU0Qub3JnPoiWBBMWCAA+FiEEyCHHZM09l0OE3Ir/ 1A1+Gq8+L1EFAl9YhQ4CGwMFCQeEzgAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ1A1+ Gq8+L1Fc0wD/ZjmhHfbCJywZU3aOxXIPjcz73FYEGMvqMCCLAWyLbSABALFL+1ZNrjV3BGjq 889cOYFuboA/Yn3eWezS+tfqYBsGuDgEX1iFDhIKKwYBBAGXVQEFAQEHQL6B20Xi600TrkpG P9fWjl7JtHNxqrHKhX6Kg7kgb4ILAwEIB4h+BBgWCAAmFiEEyCHHZM09l0OE3Ir/1A1+Gq8+ L1EFAl9YhQ4CGwwFCQeEzgAACgkQ1A1+Gq8+L1F3cgEAktp4h+IJUJxL1vn6zMOt//znni/J TanKfQuA8wGXcGkBAKpZJhqMkg+pKk7MGvJhgJ6nCpTZ+rMK6vZVZLUWc3QF Message-ID: <2c848b11-ea07-8107-bf7a-5fa617fe3265@FreeBSD.org> Date: Fri, 5 Feb 2021 19:14:31 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <5066e1e2-e4ce-48c3-8015-74810e7b727c@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DXMV52qZJz3nMq 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 Feb 2021 17:14:38 -0000 On 05/02/2021 19:12, Justin Hibbits wrote: > Feb 5, 2021 10:56:13 Andriy Gapon : > >> On 05/02/2021 18:52, Alfredo Dal'Ava Junior wrote: >>> The branch stable/13 has been updated by alfredo: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247 >>> >>> commit 6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247 >>> Author:     Alfredo Dal'Ava Junior >>> AuthorDate: 2021-02-05 18:43:48 +0000 >>> Commit:     Alfredo Dal'Ava Junior >>> CommitDate: 2021-02-05 19:50:21 +0000 >>> >>>     mrsas: unbreak i386 build >>>     >>>     Fix build regression introduced by >>>     e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a >>>     >>>     Reviewed by:    jhibbits >> Was it?  I do not see an approval in the review request. > Yes,  it was reviewed by me,  since he took exactly what I suggested, and we discussed over IRC. > My apologies then. I was confused by the fact that you commented in phabricator but accepted over IRC (which I didn't know). -- Andriy Gapon From owner-dev-commits-src-all@freebsd.org Fri Feb 5 17:24: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 D6D7B54D5BD for ; Fri, 5 Feb 2021 17:24:42 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-ztbu10011701.me.com (pv50p00im-ztbu10011701.me.com [17.58.6.53]) (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 4DXMjk4tWfz3ntg for ; Fri, 5 Feb 2021 17:24:42 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-ztbu10011701.me.com (Postfix) with ESMTPSA id A33468A05D5; Fri, 5 Feb 2021 17:24:37 +0000 (UTC) From: Toomas Soome Message-Id: <97F5C09F-7AE3-4763-AD32-BFEA25101CE5@me.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev Date: Fri, 5 Feb 2021 19:24:35 +0200 In-Reply-To: Cc: Toomas Soome , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org To: Warner Losh References: X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.737 definitions=2021-02-05_10:2021-02-05, 2021-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2102050110 X-Rspamd-Queue-Id: 4DXMjk4tWfz3ntg X-Spamd-Bar: ---- 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: Fri, 05 Feb 2021 17:24:42 -0000 > On 5. Feb 2021, at 18:44, Warner Losh wrote: >=20 >=20 >=20 > On Thu, Feb 4, 2021 at 11:38 PM Toomas Soome > wrote: >=20 >=20 >> On 5. Feb 2021, at 01:56, Warner Losh > wrote: >>=20 >> =EF=BB=BF >> And why the instaMFC? Changes are supposed to cook force days before = merging... I have questions about the wisdom of this change... >>=20 >> Warner=20 >>=20 >=20 > Reason is in PR. There is someone with the system without ConOut but = ConOutDev is set. Instead of falling back to arbitrary device (which in = this case was totally wrong choice), we can try the possible devices = list. We do not change the ConOut parsing. >=20 > We could have the same effect defaulting to Video. This bug should = have been discussed / reviewed before it was committed. How is is different from defaulting to serial, it is just as bad? we can = not guess there, thats why we do have ConOutDev list. >=20 > If it would appear, there are systems with unusable devices listed in = ConOutDev, then we need to think how to handle such case. >=20 > Yes. We fall back to the arbitrary device... It's just a flag that can = be overridden. We can easily fall back to video too. We *should not* fall back on arbitrary devices when there is source for = alternate options. And that option is from specification: "The ConInDev, ConOutDev, and ErrOutDev variables each contain an = EFI_DEVICE_PATH_PROTOCOL descriptor that defines all the possible = default devices to use on boot. These variables are volatile, and are = set dynamically on every boot. ConIn, ConOut, and ErrOut are always = proper subsets of ConInDev, ConOutDev, and ErrOutDev.=E2=80=9D UEFI Spec 2.8A, Page 82. There may or may not be Video (or Serial) device listed. If not, there = are good chance we will be in trouble because the firmware internals may = not be set up properly and we can just as well end up in hung system. >=20 > Please seek more review is the point I'd hoped to make in the private = email. This could easily have been reviewed. There was no urgent rush = that required it to go in w/o review or even discussion. >=20 > However, you didn't answer my question: Why the instant MFC? There's a = 3 day minimum for changes in head... And there's nothing so urgent that = requires a short-circuit. >=20 > Warner Because the issues is reported on 13. well, I guess You are right there, = could have waited a bit more. thanks, toomas >=20 > =20 > Thanks, > Toomas >=20 >> On Thu, Feb 4, 2021, 2:34 PM Toomas Soome > wrote: >> The branch stable/13 has been updated by tsoome: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D0c839497c174e961fc71f7d3329d05b1= 0ec5525b = >>=20 >> commit 0c839497c174e961fc71f7d3329d05b10ec5525b >> Author: Toomas Soome >> AuthorDate: 2021-02-04 20:49:02 +0000 >> Commit: Toomas Soome >> CommitDate: 2021-02-04 21:33:15 +0000 >>=20 >> loader.efi: There are systems without ConOut, also use ConOutDev >>=20 >> Conout does contian the default output device name. >> ConOutDev does contain all possible output device names, so we = can >> use it as fallback, when there is no ConOut. >>=20 >> PR: 253253 >>=20 >> (cherry picked from commit = 2bd4ff2d8911009283e4e615ca4aad35a845f48b) >> --- >> stand/efi/loader/main.c | 2 ++ >> 1 file changed, 2 insertions(+) >>=20 >> diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c >> index ca41cd4a2610..32b278950745 100644 >> --- a/stand/efi/loader/main.c >> +++ b/stand/efi/loader/main.c >> @@ -735,6 +735,8 @@ parse_uefi_con_out(void) >> how =3D 0; >> sz =3D sizeof(buf); >> rv =3D efi_global_getenv("ConOut", buf, &sz); >> + if (rv !=3D EFI_SUCCESS) >> + rv =3D efi_global_getenv("ConOutDev", buf, &sz); >> if (rv !=3D EFI_SUCCESS) { >> /* If we don't have any ConOut default to serial */ >> how =3D RB_SERIAL; From owner-dev-commits-src-all@freebsd.org Fri Feb 5 17: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 3EC3F54D460; Fri, 5 Feb 2021 17:24:58 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (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 4DXMk212gfz3pCs; Fri, 5 Feb 2021 17:24:57 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-io1-xd2d.google.com with SMTP id s24so7911173iob.6; Fri, 05 Feb 2021 09:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-transfer-encoding; bh=YXUQ8fCAtlUWut/gGqMSZzYn1GOP6xiHeTMGTn7JSx8=; b=C+FxP5Om84F7xm6yM7I6YUL+MBe5suJyNY47nHAu9O2F8M60lIxR2zlOpDCwS2AZwe aK3xyXgTjEFxyBc0FpcNDjxCBRxZeNUR5Ii7b3uy/4pNeONNs9V7tbkUJ9bMb3Tn6NXV LVYARllYlbMfiBz/yRGpCPe3IQdZk/L8Owzl5itgT1xu16Mvpjzq7lu82xCzWDIWda8u jYEFHjW27Uhn8aTmn72/TvTnFdcbH5TsYIWhUsCHIS5WMNYRHAt3HvWGCjBXshCA07ub tcOC34fsibwVbhRRb+M4X/aU3nSi9bfrDFhYlwO31zvxSMn2jtQI0GmM7Gwt8gj/fWSc i+eA== 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:message-id:in-reply-to :references:subject:mime-version:content-transfer-encoding; bh=YXUQ8fCAtlUWut/gGqMSZzYn1GOP6xiHeTMGTn7JSx8=; b=VfXaN5wgS6/AH1othaH2I8DTTsErQUz3quC/iFPZNQPFBcyQHTiXPsolRh7/4E0f2e /T1UqaQu1hoDP4cAzjwsDRAfeBwtfwexW+uzC0R7ivT5GryghdgAt1bBr9XoRuuMZ2bQ CyjoYwR9qmDhOHDwivvLF2pWRPrYDcPVqrQweEL45sfVdMEld5ErznOh0OUoKBt/1kZV ls6c8a6ey9Ac0nxAXeaBeGSYCypOiliFkhxHMyNB8IGeGv+cJ3XIhN5ay4KVXhOMq51E DTT5f31re1iXnLssDa7cQ5Tam6oJMxQBVyAEkLGAfbS8vEky4/gnwFCwFCRV4appDP01 eYEA== X-Gm-Message-State: AOAM530IPZcbTxX6DSVbd/e3p+UoK4GKjfCM+1be41Yy8e4fJiYcT4Xq csSRX4Clh85zjrMA+S/CYS0GPi+MCDVc6w== X-Google-Smtp-Source: ABdhPJxXPJNCRNRrxNEKxavKyKsiPgoH3pQNgfRN0PCh69lXwmdTuK2Zw0LqihXkMJwn86lkJkjN4A== X-Received: by 2002:a5d:9413:: with SMTP id v19mr4788516ion.46.1612545896798; Fri, 05 Feb 2021 09:24:56 -0800 (PST) Received: from [127.0.0.1] (173-18-9-215.client.mchsi.com. [173.18.9.215]) by smtp.gmail.com with ESMTPSA id k3sm4758273ioq.22.2021.02.05.09.24.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Feb 2021 09:24:56 -0800 (PST) Date: Fri, 5 Feb 2021 17:24:55 +0000 (UTC) From: Justin Hibbits To: Andriy Gapon Cc: Alfredo Dal'Ava Junior , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Message-ID: In-Reply-To: <2c848b11-ea07-8107-bf7a-5fa617fe3265@FreeBSD.org> References: <202102051652.115GqYVS049749@gitrepo.freebsd.org> <9f35a234-4c6f-7c86-523f-824dc52656aa@FreeBSD.org> <5066e1e2-e4ce-48c3-8015-74810e7b727c@gmail.com> <2c848b11-ea07-8107-bf7a-5fa617fe3265@FreeBSD.org> Subject: Re: git: 6bf9668d9d02 - stable/13 - mrsas: unbreak i386 build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: X-Rspamd-Queue-Id: 4DXMk212gfz3pCs 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 Feb 2021 17:24:58 -0000 Feb 5, 2021 11:14:34 Andriy Gapon : > On 05/02/2021 19:12, Justin Hibbits wrote: >> Feb 5, 2021 10:56:13 Andriy Gapon : >> >>> On 05/02/2021 18:52, Alfredo Dal'Ava Junior wrote: >>>> The branch stable/13 has been updated by alfredo: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D6bf9668d9d02bdf3e0dafc4= ba1010ef6a9b12247 >>>> >>>> commit 6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247 >>>> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Alfredo Dal'Ava Junior >>>> AuthorDate: 2021-02-05 18:43:48 +0000 >>>> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Alfredo Dal'Ava Junior >>>> CommitDate: 2021-02-05 19:50:21 +0000 >>>> >>>> =C2=A0=C2=A0=C2=A0 mrsas: unbreak i386 build >>>> =C2=A0=C2=A0=C2=A0 >>>> =C2=A0=C2=A0=C2=A0 Fix build regression introduced by >>>> =C2=A0=C2=A0=C2=A0 e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a >>>> =C2=A0=C2=A0=C2=A0 >>>> =C2=A0=C2=A0=C2=A0 Reviewed by:=C2=A0=C2=A0=C2=A0 jhibbits >>> Was it?=C2=A0 I do not see an approval in the review request. >> Yes,=C2=A0 it was reviewed by me,=C2=A0 since he took exactly what I sug= gested, and we discussed over IRC. >> > > My apologies then. > I was confused by the fact that you commented in phabricator but accepted= over > IRC (which I didn't know). > > -- > Andriy Gapon Fully understandable,=C2=A0 especially given the timing of the review to co= mmit,=C2=A0 and in relation to the release process going on. - Justin From owner-dev-commits-src-all@freebsd.org Fri Feb 5 19:10: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 E0B0F54F4E7 for ; Fri, 5 Feb 2021 19:10: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 4DXQ3r64SWz3vhX; Fri, 5 Feb 2021 19:10: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 C37CF23F0D; Fri, 5 Feb 2021 19:10: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 115JAWi1027863; Fri, 5 Feb 2021 19:10:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115JAWJH027862; Fri, 5 Feb 2021 19:10:32 GMT (envelope-from git) Date: Fri, 5 Feb 2021 19:10:32 GMT Message-Id: <202102051910.115JAWJH027862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: b94f25eb626f - releng/13.0 - mrsas: unbreak i386 build 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: b94f25eb626fadba144e9b9e8d08b83ba22134d7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:10:32 -0000 The branch releng/13.0 has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=b94f25eb626fadba144e9b9e8d08b83ba22134d7 commit b94f25eb626fadba144e9b9e8d08b83ba22134d7 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-05 18:43:48 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-05 22:07:28 +0000 mrsas: unbreak i386 build Fix build regression introduced by e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a Approved by: re (gjb) Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D28494 (cherry picked from commit 59fffbcf46ba6369420e655ff9173571410c643d) (cherry picked from commit 6bf9668d9d02bdf3e0dafc4ba1010ef6a9b12247) --- sys/dev/mrsas/mrsas.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index f4c34e237fc4..01173387c8d4 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -2782,9 +2782,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->queue_info_new_phys_addr_lo = htole32(phys_addr); init_frame->data_xfer_len = htole32(sizeof(Mpi2IOCInitRequest_t)); - req_desc.addr.u.low = htole32((bus_addr_t)sc->ioc_init_phys_mem & 0xFFFFFFFF); - req_desc.addr.u.high = htole32((bus_addr_t)sc->ioc_init_phys_mem >> 32); - + req_desc.addr.Words = htole64((bus_addr_t)sc->ioc_init_phys_mem); req_desc.MFAIo.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); From owner-dev-commits-src-all@freebsd.org Fri Feb 5 19:44: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 8FCE052826B for ; Fri, 5 Feb 2021 19:44:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (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 4DXQpf630Rz4RZX for ; Fri, 5 Feb 2021 19:44:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id a7so8064568qkb.13 for ; Fri, 05 Feb 2021 11:44:10 -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=CXdXexmwjSVSsGxsH8Sl8jXqJi9f4fMaUazAdgHRWrk=; b=WFVyXTOLGxpUJ43KSqUmYcZ2Fk26aJLPRjrWgqPtmeWm6ne1ldKkg6bhNDXQKvmTtS 6wZkGR6pJpvS1ebIbWaYgq9hy53DFr9CWFrp+6l/izAuy2cG3wKtyFv30dVQ9lnyxB0M ZZwx2CjzWhmJIKHHftV0XpV1zK3D6/dSQ46SzF64rHloR9Xz1t3oOdyvekihJLtDXuSN 7noCk6hFibvZ4SPwr0k/ocnTSkVAmDaC1nGwmDBQgYAeBWfwcL+1EFGEYZYumjurwCQV mn8veMV3FXo8jLgBesaH3lNkqgmANvHf8t5pLahXabHkDyE71gIPck8T08aKkFbvgUm4 oNzQ== 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=CXdXexmwjSVSsGxsH8Sl8jXqJi9f4fMaUazAdgHRWrk=; b=ed7VOeRq7Ezg54GSp22sJaxZoQADQaSSg9R+u7I803a61LzAepQDiWOluN8rogzsvE weX1CsPHX2WRiOCs1BG7Nmr205dN+231bQWzVh/Uc1/l4aOkSbW42Q2YVUf+ivdl0/Jp nUWDKFl1ht5fBdYPKNWkf7bC8lJQrvbTxCHe4d6ycTkGx1r3JN0jHHBg/gPK6Hb+V87g T5KoIs/GNRvKEyeNkaQxQkbpk/Xk/EKO+5KCPiaIKEx/3BvET1rWOu4HYrq7DBPejG6W isVRbLwIEhFnSfZsLNHmNbFU8GyNVdiTpbX4Zk+hEUtXjH6czjqmfmz0TKbxbxh3/nZl EBMw== X-Gm-Message-State: AOAM533gKhZWmvoc2PP9H3Yxl1lgips76xOhdWPFSgKsEdqyIeO3b/9k qaSB4mkowavsVPHHW5JrYxzzz8vFqHZjWwlEULrfTA== X-Google-Smtp-Source: ABdhPJzQRLpmj7Rvr85T+kJaihERtYVIvhOJ/+ZxGm/h2cFKC29ONLlfItUijPW020dIIKjXVSqc1LQVnnYnRD0Qz9Q= X-Received: by 2002:a37:a34f:: with SMTP id m76mr5862632qke.89.1612554249518; Fri, 05 Feb 2021 11:44:09 -0800 (PST) MIME-Version: 1.0 References: <97F5C09F-7AE3-4763-AD32-BFEA25101CE5@me.com> In-Reply-To: <97F5C09F-7AE3-4763-AD32-BFEA25101CE5@me.com> From: Warner Losh Date: Fri, 5 Feb 2021 12:43:58 -0700 Message-ID: Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev To: Toomas Soome Cc: Toomas Soome , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org X-Rspamd-Queue-Id: 4DXQpf630Rz4RZX X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=WFVyXTOL; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72e) 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)[5]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::72e: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::72e:from]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[me.com]; 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::72e: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" 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 Feb 2021 19:44:11 -0000 On Fri, Feb 5, 2021 at 10:24 AM Toomas Soome wrote: > > > On 5. Feb 2021, at 18:44, Warner Losh wrote: > > > > On Thu, Feb 4, 2021 at 11:38 PM Toomas Soome wrote: > >> >> >> On 5. Feb 2021, at 01:56, Warner Losh wrote: >> >> =EF=BB=BF >> And why the instaMFC? Changes are supposed to cook force days before >> merging... I have questions about the wisdom of this change... >> >> Warner >> >> >> Reason is in PR. There is someone with the system without ConOut but >> ConOutDev is set. Instead of falling back to arbitrary device (which in >> this case was totally wrong choice), we can try the possible devices lis= t. >> We do not change the ConOut parsing. >> > > We could have the same effect defaulting to Video. This bug should have > been discussed / reviewed before it was committed. > > > How is is different from defaulting to serial, it is just as bad? we can > not guess there, thats why we do have ConOutDev list. > > > > If it would appear, there are systems with unusable devices listed in >> ConOutDev, then we need to think how to handle such case. >> > > Yes. We fall back to the arbitrary device... It's just a flag that can be > overridden. We can easily fall back to video too. > > > We *should not* fall back on arbitrary devices when there is source for > alternate options. And that option is from specification: > > "The ConInDev, ConOutDev, and ErrOutDev variables each contain an EFI_DEV= ICE_PATH_PROTOCOL > descriptor that defines all the possible default devices to use on boot. > These variables are volatile, and are set dynamically on every boot. ConI= n, > ConOut, and ErrOut are always proper subsets of ConInDev, ConOutDev, and > ErrOutDev.*=E2=80=9D* > Right. Except they aren't a proper subset in this case. Since they aren't a proper subset, can you count on them having any meaningful meaning? In the cases you found they do, but it's just as arbitrary. > UEFI Spec 2.8A, Page 82. > > There may or may not be Video (or Serial) device listed. If not, there ar= e > good chance we will be in trouble because the firmware internals may not = be > set up properly and we can just as well end up in hung system. > For x86, there's almost always Video. For !x86 it gets more troublesome. The kernel shouldn't hang when we give it the wrong console because if the device isn't there, it won't cninit won't work. > Please seek more review is the point I'd hoped to make in the private > email. This could easily have been reviewed. There was no urgent rush tha= t > required it to go in w/o review or even discussion. > > > However, you didn't answer my question: Why the instant MFC? There's a 3 > day minimum for changes in head... And there's nothing so urgent that > requires a short-circuit. > > Warner > > > > Because the issues is reported on 13. well, I guess You are right there, > could have waited a bit more. > Right. Exactly my point.... Warner > thanks, > toomas > > > > > > >> Thanks, >> Toomas >> >> On Thu, Feb 4, 2021, 2:34 PM Toomas Soome wrote: >> >>> The branch stable/13 has been updated by tsoome: >>> >>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=3D0c839497c174e961fc71f7d3329d0= 5b10ec5525b >>> >>> >>> commit 0c839497c174e961fc71f7d3329d05b10ec5525b >>> Author: Toomas Soome >>> AuthorDate: 2021-02-04 20:49:02 +0000 >>> Commit: Toomas Soome >>> CommitDate: 2021-02-04 21:33:15 +0000 >>> >>> loader.efi: There are systems without ConOut, also use ConOutDev >>> >>> Conout does contian the default output device name. >>> ConOutDev does contain all possible output device names, so we can >>> use it as fallback, when there is no ConOut. >>> >>> PR: 253253 >>> >>> (cherry picked from commit 2bd4ff2d8911009283e4e615ca4aad35a845f48b= ) >>> --- >>> stand/efi/loader/main.c | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c >>> index ca41cd4a2610..32b278950745 100644 >>> --- a/stand/efi/loader/main.c >>> +++ b/stand/efi/loader/main.c >>> @@ -735,6 +735,8 @@ parse_uefi_con_out(void) >>> how =3D 0; >>> sz =3D sizeof(buf); >>> rv =3D efi_global_getenv("ConOut", buf, &sz); >>> + if (rv !=3D EFI_SUCCESS) >>> + rv =3D efi_global_getenv("ConOutDev", buf, &sz); >>> if (rv !=3D EFI_SUCCESS) { >>> /* If we don't have any ConOut default to serial */ >>> how =3D RB_SERIAL; >> >> > From owner-dev-commits-src-all@freebsd.org Fri Feb 5 19:50: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 CC99252881D; Fri, 5 Feb 2021 19:50: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 4DXQy95WWyz4SB0; Fri, 5 Feb 2021 19:50: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 B060E246B6; Fri, 5 Feb 2021 19:50: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 115JofiX079902; Fri, 5 Feb 2021 19:50:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115Jof5Q079901; Fri, 5 Feb 2021 19:50:41 GMT (envelope-from git) Date: Fri, 5 Feb 2021 19:50:41 GMT Message-Id: <202102051950.115Jof5Q079901@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: 20e1817f9a68 - main - mrsas: update man page 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: 20e1817f9a68abd9a232367e04d2afeaf4a3c2f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:50:41 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=20e1817f9a68abd9a232367e04d2afeaf4a3c2f8 commit 20e1817f9a68abd9a232367e04d2afeaf4a3c2f8 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-04 06:13:13 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-05 22:47:45 +0000 mrsas: update man page update mrsas(4) since big-endian is supported since e34a057ca6ebdf8e30ec8b0dc21d18eb450bf36a Reviewed by: bdragon, gbe Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28475 --- share/man/man4/mrsas.4 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/share/man/man4/mrsas.4 b/share/man/man4/mrsas.4 index fb2288d91f80..0528ee2fa1bd 100644 --- a/share/man/man4/mrsas.4 +++ b/share/man/man4/mrsas.4 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2019 +.Dd February 4, 2021 .Dt MRSAS 4 .Os .Sh NAME @@ -385,8 +385,6 @@ The driver and this manual page were written by .An Kashyap Desai Aq Mt Kashyap.Desai@lsi.com . .Sh TODO -The driver does not support big-endian architectures at this time. -.Pp The driver does not support alias for device name (it is required when the user switches between two drivers and does not want to edit .Pa /etc/fstab From owner-dev-commits-src-all@freebsd.org Fri Feb 5 19:50: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 EF78652867A; Fri, 5 Feb 2021 19:50: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 4DXQyB6S3Kz4S3X; Fri, 5 Feb 2021 19:50: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 D0BE924781; Fri, 5 Feb 2021 19:50: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 115JogIt079922; Fri, 5 Feb 2021 19:50:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115JogR2079921; Fri, 5 Feb 2021 19:50:42 GMT (envelope-from git) Date: Fri, 5 Feb 2021 19:50:42 GMT Message-Id: <202102051950.115JogR2079921@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: eaffd270d872 - main - [POWERPC64LE] add mrsas to 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: eaffd270d8729c4d79f6ce268275ef4c0e6f7b04 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:50:43 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=eaffd270d8729c4d79f6ce268275ef4c0e6f7b04 commit eaffd270d8729c4d79f6ce268275ef4c0e6f7b04 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-02-04 06:12:38 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-02-05 22:47:57 +0000 [POWERPC64LE] add mrsas to GENERIC64LE Reviewed by: bdragon Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28475 --- sys/powerpc/conf/GENERIC64LE | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 06bdb4c43124..2e16ff5d5edb 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -134,6 +134,7 @@ device ahc # AHA2940 and onboard AIC7xxx devices options AHC_ALLOW_MEMIO # Attempt to use memory mapped I/O device isp # Qlogic family 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 sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D From owner-dev-commits-src-all@freebsd.org Fri Feb 5 20:09: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 5A8A5529083 for ; Fri, 5 Feb 2021 20:09:24 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-tydg10011801.me.com (pv50p00im-tydg10011801.me.com [17.58.6.52]) (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 4DXRMm1M0Zz4Tc1 for ; Fri, 5 Feb 2021 20:09:23 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-tydg10011801.me.com (Postfix) with ESMTPSA id CA7C5660531; Fri, 5 Feb 2021 20:09:19 +0000 (UTC) From: Toomas Soome Message-Id: <014891C8-7B1F-4908-9495-2ED1A5FAABCF@me.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev Date: Fri, 5 Feb 2021 22:09:16 +0200 In-Reply-To: Cc: Toomas Soome , src-committers , "" , dev-commits-src-branches@freebsd.org To: Warner Losh References: <97F5C09F-7AE3-4763-AD32-BFEA25101CE5@me.com> X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.737 definitions=2021-02-05_11:2021-02-05, 2021-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2102050125 X-Rspamd-Queue-Id: 4DXRMm1M0Zz4Tc1 X-Spamd-Bar: ---- 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: Fri, 05 Feb 2021 20:09:24 -0000 > On 5. Feb 2021, at 21:43, Warner Losh wrote: >=20 >=20 >=20 > On Fri, Feb 5, 2021 at 10:24 AM Toomas Soome > wrote: >=20 >=20 >> On 5. Feb 2021, at 18:44, Warner Losh > wrote: >>=20 >>=20 >>=20 >> On Thu, Feb 4, 2021 at 11:38 PM Toomas Soome > wrote: >>=20 >>=20 >>> On 5. Feb 2021, at 01:56, Warner Losh > wrote: >>>=20 >>> =EF=BB=BF >>> And why the instaMFC? Changes are supposed to cook force days before = merging... I have questions about the wisdom of this change... >>>=20 >>> Warner=20 >>>=20 >>=20 >> Reason is in PR. There is someone with the system without ConOut but = ConOutDev is set. Instead of falling back to arbitrary device (which in = this case was totally wrong choice), we can try the possible devices = list. We do not change the ConOut parsing. >>=20 >> We could have the same effect defaulting to Video. This bug should = have been discussed / reviewed before it was committed. >=20 > How is is different from defaulting to serial, it is just as bad? we = can not guess there, thats why we do have ConOutDev list. >=20 >=20 >>=20 >> If it would appear, there are systems with unusable devices listed in = ConOutDev, then we need to think how to handle such case. >>=20 >> Yes. We fall back to the arbitrary device... It's just a flag that = can be overridden. We can easily fall back to video too. >=20 > We *should not* fall back on arbitrary devices when there is source = for alternate options. And that option is from specification: >=20 > "The ConInDev, ConOutDev, and ErrOutDev variables each contain an = EFI_DEVICE_PATH_PROTOCOL descriptor that defines all the possible = default devices to use on boot. These variables are volatile, and are = set dynamically on every boot. ConIn, ConOut, and ErrOut are always = proper subsets of ConInDev, ConOutDev, and ErrOutDev.=E2=80=9D >=20 > Right. Except they aren't a proper subset in this case. Since they = aren't a proper subset, can you count on them having any meaningful = meaning? In the cases you found they do, but it's just as arbitrary. Well, we can argue if empty set is or is not subset of (any) other set. = But, we do have specification. And we should not arbitrary pick what = part we are going to follow and what not. > =20 > UEFI Spec 2.8A, Page 82. >=20 > There may or may not be Video (or Serial) device listed. If not, there = are good chance we will be in trouble because the firmware internals may = not be set up properly and we can just as well end up in hung system. >=20 > For x86, there's almost always Video. For !x86 it gets more = troublesome. There is almost always ConOut as well. Except when there is not. And in = this case, there is not. I still do not get what it is we are arguing about. Do we have case = where ConOut is not set and ConOutDev does have garbage? rgds, toomas >=20 > The kernel shouldn't hang when we give it the wrong console because if = the device isn't there, it won't cninit won't work. >> Please seek more review is the point I'd hoped to make in the private = email. This could easily have been reviewed. There was no urgent rush = that required it to go in w/o review or even discussion. >>=20 >> However, you didn't answer my question: Why the instant MFC? There's = a 3 day minimum for changes in head... And there's nothing so urgent = that requires a short-circuit. >>=20 >> Warner >=20 >=20 > Because the issues is reported on 13. well, I guess You are right = there, could have waited a bit more. >=20 > Right. Exactly my point.... >=20 > Warner > =20 > thanks, > toomas >=20 >=20 >=20 >>=20 >> =20 >> Thanks, >> Toomas >>=20 >>> On Thu, Feb 4, 2021, 2:34 PM Toomas Soome > wrote: >>> The branch stable/13 has been updated by tsoome: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D0c839497c174e961fc71f7d3329d05b1= 0ec5525b = >>>=20 >>> commit 0c839497c174e961fc71f7d3329d05b10ec5525b >>> Author: Toomas Soome > >>> AuthorDate: 2021-02-04 20:49:02 +0000 >>> Commit: Toomas Soome > >>> CommitDate: 2021-02-04 21:33:15 +0000 >>>=20 >>> loader.efi: There are systems without ConOut, also use ConOutDev >>>=20 >>> Conout does contian the default output device name. >>> ConOutDev does contain all possible output device names, so we = can >>> use it as fallback, when there is no ConOut. >>>=20 >>> PR: 253253 >>>=20 >>> (cherry picked from commit = 2bd4ff2d8911009283e4e615ca4aad35a845f48b) >>> --- >>> stand/efi/loader/main.c | 2 ++ >>> 1 file changed, 2 insertions(+) >>>=20 >>> diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c >>> index ca41cd4a2610..32b278950745 100644 >>> --- a/stand/efi/loader/main.c >>> +++ b/stand/efi/loader/main.c >>> @@ -735,6 +735,8 @@ parse_uefi_con_out(void) >>> how =3D 0; >>> sz =3D sizeof(buf); >>> rv =3D efi_global_getenv("ConOut", buf, &sz); >>> + if (rv !=3D EFI_SUCCESS) >>> + rv =3D efi_global_getenv("ConOutDev", buf, &sz); >>> if (rv !=3D EFI_SUCCESS) { >>> /* If we don't have any ConOut default to serial */ >>> how =3D RB_SERIAL; From owner-dev-commits-src-all@freebsd.org Fri Feb 5 20:21: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 AB1DB529507 for ; Fri, 5 Feb 2021 20:21:51 +0000 (UTC) (envelope-from wlosh@bsdimp.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 4DXRf61CPrz4V6S for ; Fri, 5 Feb 2021 20:21:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf29.google.com with SMTP id r13so4071445qvm.11 for ; Fri, 05 Feb 2021 12:21:50 -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=ktaCHAHoDKFDrx5XZH9UWMchOoQVyW2RernLwvgZELM=; b=q1P2KxcpGwS6L64Xr0gmxm4/r36DgqfJVw1ih2P/NM2Jom/Rsq5KQPm1IKr2Odcb4M nvCSNyOUUO2GsCQnj1G8XflGlBQffIZ8zzgsOsfrVFxHBUIlFM3ar/uGgAH9d9BgLON4 ATZuWghnKsleP3r9Utw8kNpIohly+DJMMBN6Yn7g6bO5YSUEkcN3GStir7AKWpMIueJk 9hqFAqdHeHC4mE2STU1VHTZaSFodGuDj4cJ33ZBNwYAyZq59tKsZMZFhS4vq32uXHN+J KxfZ+/xno/0c/Hy4ZP55WTTGN1N8kx3WIfWxGeiYjoK+2qTTSX6jipPjN16WWZtFAvlq 9VOA== 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=ktaCHAHoDKFDrx5XZH9UWMchOoQVyW2RernLwvgZELM=; b=sduVLZZ560gUdAayVdkVe7fsU5dcbV6ikeRw5O3ujAiNR5aTmJkrj6tMUD692hgdlp NUJEVbqrG5pB+wnPxIwWHCkxkbXdU2tLj+gjOejFGD2Gm2VjglcPiK1CsuKxvTlj9gs1 tKycioNlBmlOmMMxwGB5OM2pR4tl8t8IAFG93SAbTpMx1cOlU3PzNbZrQ1EdoH7PInqq vrhoUwdWgrH9qEAX2fcXTWOFCrblmdLdB5y9AdaGTrFePV1CQkJXNucasYlZ3zc7LSh6 Lac5+5rdK9hnNwb/rbmPFAhif2Ln4BIV8RWRQO0sWE/ZNWNHmsUPvMmG6Kxr9+vcNsNf 6XGw== X-Gm-Message-State: AOAM5328Af9Q6mE8VsjRctufyadagampscdfI2cH0tOP/rxGoEqSdbyo OENj0dTY8qyw6Y+3mXTBAzgsumKRHChgLreGMnb/DQ== X-Google-Smtp-Source: ABdhPJzwhPZT50fr4LJ/RbuLv+Dywwt+/hi8dK8HrbcaNGh5SV0H5ecQ18XpwnOEodKZ74C6O0RuF+TCoBUUa7N9PSY= X-Received: by 2002:a05:6214:14e2:: with SMTP id k2mr5986069qvw.24.1612556509269; Fri, 05 Feb 2021 12:21:49 -0800 (PST) MIME-Version: 1.0 References: <97F5C09F-7AE3-4763-AD32-BFEA25101CE5@me.com> <014891C8-7B1F-4908-9495-2ED1A5FAABCF@me.com> In-Reply-To: <014891C8-7B1F-4908-9495-2ED1A5FAABCF@me.com> From: Warner Losh Date: Fri, 5 Feb 2021 13:21:38 -0700 Message-ID: Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev To: Toomas Soome Cc: Toomas Soome , src-committers , "" , dev-commits-src-branches@freebsd.org X-Rspamd-Queue-Id: 4DXRf61CPrz4V6S X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=q1P2Kxcp; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f29) 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)[5]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::f29: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::f29:from]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[me.com]; 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::f29: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" 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 Feb 2021 20:21:51 -0000 On Fri, Feb 5, 2021 at 1:09 PM Toomas Soome wrote: > > > On 5. Feb 2021, at 21:43, Warner Losh wrote: > > > > On Fri, Feb 5, 2021 at 10:24 AM Toomas Soome wrote: > >> >> >> On 5. Feb 2021, at 18:44, Warner Losh wrote: >> >> >> >> On Thu, Feb 4, 2021 at 11:38 PM Toomas Soome wrote: >> >>> >>> >>> On 5. Feb 2021, at 01:56, Warner Losh wrote: >>> >>> =EF=BB=BF >>> And why the instaMFC? Changes are supposed to cook force days before >>> merging... I have questions about the wisdom of this change... >>> >>> Warner >>> >>> >>> Reason is in PR. There is someone with the system without ConOut but >>> ConOutDev is set. Instead of falling back to arbitrary device (which in >>> this case was totally wrong choice), we can try the possible devices li= st. >>> We do not change the ConOut parsing. >>> >> >> We could have the same effect defaulting to Video. This bug should have >> been discussed / reviewed before it was committed. >> >> >> How is is different from defaulting to serial, it is just as bad? we can >> not guess there, thats why we do have ConOutDev list. >> >> >> >> If it would appear, there are systems with unusable devices listed in >>> ConOutDev, then we need to think how to handle such case. >>> >> >> Yes. We fall back to the arbitrary device... It's just a flag that can b= e >> overridden. We can easily fall back to video too. >> >> >> We *should not* fall back on arbitrary devices when there is source for >> alternate options. And that option is from specification: >> >> "The ConInDev, ConOutDev, and ErrOutDev variables each contain an >> EFI_DEVICE_PATH_PROTOCOL descriptor that defines all the possible >> default devices to use on boot. These variables are volatile, and are se= t >> dynamically on every boot. ConIn, ConOut, and ErrOut are always proper >> subsets of ConInDev, ConOutDev, and ErrOutDev.*=E2=80=9D* >> > > Right. Except they aren't a proper subset in this case. Since they aren't > a proper subset, can you count on them having any meaningful meaning? In > the cases you found they do, but it's just as arbitrary. > > > Well, we can argue if empty set is or is not subset of (any) other set. > But, we do have specification. And we should not arbitrary pick what part > we are going to follow and what not. > The empty set isn't a proper subset. It is a subset, but not a proper subset, by definition. Therefore, it's not standards complaint. > > >> UEFI Spec 2.8A, Page 82. >> >> There may or may not be Video (or Serial) device listed. If not, there >> are good chance we will be in trouble because the firmware internals may >> not be set up properly and we can just as well end up in hung system. >> > > For x86, there's almost always Video. For !x86 it gets more troublesome. > > > There is almost always ConOut as well. Except when there is not. And in > this case, there is not. > > I still do not get what it is we are arguing about. Do we have case where > ConOut is not set and ConOutDev does have garbage? > We have one sighting of 'ConOut' being missing. Any extrapolation from there is tricky. We know in this one case the info appears to be good. But this is not standards compliant, so how can we be sure that others will be similar? Warner > rgds, > toomas > > > The kernel shouldn't hang when we give it the wrong console because if th= e > device isn't there, it won't cninit won't work. > >> Please seek more review is the point I'd hoped to make in the private >> email. This could easily have been reviewed. There was no urgent rush th= at >> required it to go in w/o review or even discussion. >> >> >> However, you didn't answer my question: Why the instant MFC? There's a 3 >> day minimum for changes in head... And there's nothing so urgent that >> requires a short-circuit. >> >> Warner >> >> >> >> Because the issues is reported on 13. well, I guess You are right there, >> could have waited a bit more. >> > > Right. Exactly my point.... > > Warner > > >> thanks, >> toomas >> >> >> >> >> >> >>> Thanks, >>> Toomas >>> >>> On Thu, Feb 4, 2021, 2:34 PM Toomas Soome wrote: >>> >>>> The branch stable/13 has been updated by tsoome: >>>> >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=3D0c839497c174e961fc71f7d3329d= 05b10ec5525b >>>> >>>> >>>> commit 0c839497c174e961fc71f7d3329d05b10ec5525b >>>> Author: Toomas Soome >>>> AuthorDate: 2021-02-04 20:49:02 +0000 >>>> Commit: Toomas Soome >>>> CommitDate: 2021-02-04 21:33:15 +0000 >>>> >>>> loader.efi: There are systems without ConOut, also use ConOutDev >>>> >>>> Conout does contian the default output device name. >>>> ConOutDev does contain all possible output device names, so we can >>>> use it as fallback, when there is no ConOut. >>>> >>>> PR: 253253 >>>> >>>> (cherry picked from commit >>>> 2bd4ff2d8911009283e4e615ca4aad35a845f48b) >>>> --- >>>> stand/efi/loader/main.c | 2 ++ >>>> 1 file changed, 2 insertions(+) >>>> >>>> diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c >>>> index ca41cd4a2610..32b278950745 100644 >>>> --- a/stand/efi/loader/main.c >>>> +++ b/stand/efi/loader/main.c >>>> @@ -735,6 +735,8 @@ parse_uefi_con_out(void) >>>> how =3D 0; >>>> sz =3D sizeof(buf); >>>> rv =3D efi_global_getenv("ConOut", buf, &sz); >>>> + if (rv !=3D EFI_SUCCESS) >>>> + rv =3D efi_global_getenv("ConOutDev", buf, &sz); >>>> if (rv !=3D EFI_SUCCESS) { >>>> /* If we don't have any ConOut default to serial */ >>>> how =3D RB_SERIAL; >>> >>> > From owner-dev-commits-src-all@freebsd.org Fri Feb 5 20:26: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 15880529597 for ; Fri, 5 Feb 2021 20:26:01 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXRkw6v4Tz4VDf for ; Fri, 5 Feb 2021 20:26:00 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f52.google.com with SMTP id v15so9103094wrx.4 for ; Fri, 05 Feb 2021 12:26:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=hcZB/9ER0d7HW414f5dvOlXvkYUP+L8mV/Jym18iz3Y=; b=m0RhDnTOpvQwwc23N0jOpPbrC2aRzdPKUOURV8brcKf1lTcFt7WA645x73W3f5f3a6 rHt+LeSkBJEwQD+cK/hIrn3h05EWa3AYDOi3HNqnwlPrP7/z2e7Iylr08yjpI+96zbTg kY//W7LWg1eVF0HXuLEK/qHTld4ZSWAB+FNCW407bQ+ZeoHGe10DfDHoOTqG6XZhqHH+ u1fiDZqkuGV0b1Iqx/XkutlcaJ0o0sd1Z3HXCxtscnYKLPik1v8lUmG47gbm6wLpvv2X leMVddFGysjO6knfdZ+x7UMYi849b4uK0i+NmMmLZ7hMQkoZQoGuCekG2DV9mzHTa7Le pR7w== X-Gm-Message-State: AOAM532YMpVKQoOEUBr5QpUmQEtdytM1h8NoNaN4Wrq36T3JwYvv3jLs hd/1jEsRWWYSLJ0lpsHjWKmDuA== X-Google-Smtp-Source: ABdhPJzS1GD/ytChZge60aAM10DlBJEoyAAeQzrZKCE44R4z9LfD574k43ilfcUx4BT3IKEVmHePow== X-Received: by 2002:a5d:4a11:: with SMTP id m17mr6714571wrq.39.1612556759465; Fri, 05 Feb 2021 12:25:59 -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 w25sm9981726wmc.42.2021.02.05.12.25.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2021 12:25:58 -0800 (PST) From: Jessica Clarke Message-Id: Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev Date: Fri, 5 Feb 2021 20:25:56 +0000 In-Reply-To: Cc: Toomas Soome , Toomas Soome , src-committers , "" , dev-commits-src-branches@freebsd.org To: Warner Losh References: <97F5C09F-7AE3-4763-AD32-BFEA25101CE5@me.com> <014891C8-7B1F-4908-9495-2ED1A5FAABCF@me.com> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DXRkw6v4Tz4VDf 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: Fri, 05 Feb 2021 20:26:01 -0000 > On 5 Feb 2021, at 20:21, Warner Losh wrote: >=20 >=20 >=20 > On Fri, Feb 5, 2021 at 1:09 PM Toomas Soome > wrote: >=20 >=20 >> On 5. Feb 2021, at 21:43, Warner Losh > wrote: >>=20 >>=20 >>=20 >> On Fri, Feb 5, 2021 at 10:24 AM Toomas Soome > wrote: >>=20 >>=20 >>> On 5. Feb 2021, at 18:44, Warner Losh > wrote: >>>=20 >>>=20 >>>=20 >>> On Thu, Feb 4, 2021 at 11:38 PM Toomas Soome > wrote: >>>=20 >>>=20 >>>> On 5. Feb 2021, at 01:56, Warner Losh > wrote: >>>>=20 >>>> =EF=BB=BF >>>> And why the instaMFC? Changes are supposed to cook force days = before merging... I have questions about the wisdom of this change... >>>>=20 >>>> Warner=20 >>>>=20 >>>=20 >>> Reason is in PR. There is someone with the system without ConOut but = ConOutDev is set. Instead of falling back to arbitrary device (which in = this case was totally wrong choice), we can try the possible devices = list. We do not change the ConOut parsing. >>>=20 >>> We could have the same effect defaulting to Video. This bug should = have been discussed / reviewed before it was committed. >>=20 >> How is is different from defaulting to serial, it is just as bad? we = can not guess there, thats why we do have ConOutDev list. >>=20 >>=20 >>>=20 >>> If it would appear, there are systems with unusable devices listed = in ConOutDev, then we need to think how to handle such case. >>>=20 >>> Yes. We fall back to the arbitrary device... It's just a flag that = can be overridden. We can easily fall back to video too. >>=20 >> We *should not* fall back on arbitrary devices when there is source = for alternate options. And that option is from specification: >>=20 >> "The ConInDev, ConOutDev, and ErrOutDev variables each contain an = EFI_DEVICE_PATH_PROTOCOL descriptor that defines all the possible = default devices to use on boot. These variables are volatile, and are = set dynamically on every boot. ConIn, ConOut, and ErrOut are always = proper subsets of ConInDev, ConOutDev, and ErrOutDev.=E2=80=9D >>=20 >> Right. Except they aren't a proper subset in this case. Since they = aren't a proper subset, can you count on them having any meaningful = meaning? In the cases you found they do, but it's just as arbitrary. >=20 > Well, we can argue if empty set is or is not subset of (any) other = set. But, we do have specification. And we should not arbitrary pick = what part we are going to follow and what not. >=20 > The empty set isn't a proper subset. It is a subset, but not a proper = subset, by definition. Therefore, it's not standards complaint. The empty set is a proper subset of any non-empty set. Proper just means = that it's not equal to the original set. Perhaps you're thinking of = trivial subsets (which are the empty set and, if not empty, the original = set)? Jess From owner-dev-commits-src-all@freebsd.org Fri Feb 5 20:26: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 DCFAE5295AF for ; Fri, 5 Feb 2021 20:26:47 +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 4DXRlq1Hnrz4VSc for ; Fri, 5 Feb 2021 20:26:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf30.google.com with SMTP id w11so4083819qvz.12 for ; Fri, 05 Feb 2021 12:26:46 -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=mDi1cuBJfAjZD6twYIxn+1LpY1MeNrzofV545yAOJMc=; b=byh4yTE3bV+MFaD9F4rsSq5zeJ0PYRw7ffapDtSS2c3/g25LdeJSMMWtu+oe6mfcI5 FBugx09+TljN2e1O7Ihvm6QqnVHCT4bNfVMNr7x3NOWYDXIjXELhItBNO+YmJB5NxQf4 IZZBgxPvb4M794/Vj5rztSBgwCTlayohloXuB+FG3+LjO4Eo8YjobnF9QmmDM339Z2Pi Xw5djy8FuWAfCSn2EaJgBNs4SJz2e6+/01gA0PNvvkg9Kr0bg5H9dxL+08cvW9bnnJgx 6wYVzPOm2czLr6NEpd3g89JanRCZfJqj51yU2b8mVYVvyKLx2ee3pEl+EWQeEqWdJiVX VsyQ== 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=mDi1cuBJfAjZD6twYIxn+1LpY1MeNrzofV545yAOJMc=; b=Zr0YIg+1GC37lpjIL1WgfO6oygpYJxSRncAPu0QWo9NdmyM85ZlcZQsh7WfP24iMhS SFfHWlFr/C3a/7lCPZ7pdZ8bx8Pd+LrD14daTJYaUuLxbBilw/i1Wws+XQp9DcOroVhp lY2rOpfWMphoc2inLXFp/UGdglaYIB+1vNr59ENfRNTEZRHhchq6UMpOLRfVnJqcffvs 4tjTDPEzZOEcviLyq7syor++9/beE/j3uhAJRTAYR6jk0S3KdKBUYMptvG++LPctI72V Z0AAobwSrA09S8OVd1kH0LfcVONN2oPI/cRlmNMmuMRp0I6FScV7y3ynydtIszfHJPZV IgAg== X-Gm-Message-State: AOAM533N7iiyRfW0zv6op9+TOVUhJMHn8bZ6eFLFcrRtQGUp+cx2l6x0 JDHqxB02DTYue8Py7CunVAaC8Uv6hHQBI0fNrcT8ww== X-Google-Smtp-Source: ABdhPJystaQ4SKUGGFMzBQoXE0TBCYcXv5xtnlClv3bW/HimE6naHkQXXIQE9QX2Bn7IphHgmHe4lfuKRpXG2BlawLo= X-Received: by 2002:a0c:eb4c:: with SMTP id c12mr5969951qvq.62.1612556806222; Fri, 05 Feb 2021 12:26:46 -0800 (PST) MIME-Version: 1.0 References: <97F5C09F-7AE3-4763-AD32-BFEA25101CE5@me.com> <014891C8-7B1F-4908-9495-2ED1A5FAABCF@me.com> In-Reply-To: From: Warner Losh Date: Fri, 5 Feb 2021 13:26:35 -0700 Message-ID: Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev To: Toomas Soome Cc: Toomas Soome , src-committers , "" , dev-commits-src-branches@freebsd.org X-Rspamd-Queue-Id: 4DXRlq1Hnrz4VSc X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=byh4yTE3; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f30) 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)[5]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::f30: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::f30:from]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[me.com]; 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::f30: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" 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 Feb 2021 20:26:47 -0000 On Fri, Feb 5, 2021 at 1:21 PM Warner Losh wrote: > > > On Fri, Feb 5, 2021 at 1:09 PM Toomas Soome wrote: > >> >> >> On 5. Feb 2021, at 21:43, Warner Losh wrote: >> >> >> >> On Fri, Feb 5, 2021 at 10:24 AM Toomas Soome wrote: >> >>> >>> >>> On 5. Feb 2021, at 18:44, Warner Losh wrote: >>> >>> >>> >>> On Thu, Feb 4, 2021 at 11:38 PM Toomas Soome wrote: >>> >>>> >>>> >>>> On 5. Feb 2021, at 01:56, Warner Losh wrote: >>>> >>>> =EF=BB=BF >>>> And why the instaMFC? Changes are supposed to cook force days before >>>> merging... I have questions about the wisdom of this change... >>>> >>>> Warner >>>> >>>> >>>> Reason is in PR. There is someone with the system without ConOut but >>>> ConOutDev is set. Instead of falling back to arbitrary device (which i= n >>>> this case was totally wrong choice), we can try the possible devices l= ist. >>>> We do not change the ConOut parsing. >>>> >>> >>> We could have the same effect defaulting to Video. This bug should have >>> been discussed / reviewed before it was committed. >>> >>> >>> How is is different from defaulting to serial, it is just as bad? we ca= n >>> not guess there, thats why we do have ConOutDev list. >>> >>> >>> >>> If it would appear, there are systems with unusable devices listed in >>>> ConOutDev, then we need to think how to handle such case. >>>> >>> >>> Yes. We fall back to the arbitrary device... It's just a flag that can >>> be overridden. We can easily fall back to video too. >>> >>> >>> We *should not* fall back on arbitrary devices when there is source for >>> alternate options. And that option is from specification: >>> >>> "The ConInDev, ConOutDev, and ErrOutDev variables each contain an >>> EFI_DEVICE_PATH_PROTOCOL descriptor that defines all the possible >>> default devices to use on boot. These variables are volatile, and are s= et >>> dynamically on every boot. ConIn, ConOut, and ErrOut are always proper >>> subsets of ConInDev, ConOutDev, and ErrOutDev.*=E2=80=9D* >>> >> >> Right. Except they aren't a proper subset in this case. Since they aren'= t >> a proper subset, can you count on them having any meaningful meaning? In >> the cases you found they do, but it's just as arbitrary. >> >> >> Well, we can argue if empty set is or is not subset of (any) other set. >> But, we do have specification. And we should not arbitrary pick what par= t >> we are going to follow and what not. >> > > The empty set isn't a proper subset. It is a subset, but not a proper > subset, by definition. Therefore, it's not standards complaint. > Hmmm, I just looked up 'proper subset' and it's the other end: ConOut must be smaller than ConOutDev according to this wording. However, that makes no sense here. > >> >>> UEFI Spec 2.8A, Page 82. >>> >>> There may or may not be Video (or Serial) device listed. If not, there >>> are good chance we will be in trouble because the firmware internals ma= y >>> not be set up properly and we can just as well end up in hung system. >>> >> >> For x86, there's almost always Video. For !x86 it gets more troublesome. >> >> >> There is almost always ConOut as well. Except when there is not. And in >> this case, there is not. >> >> I still do not get what it is we are arguing about. Do we have case wher= e >> ConOut is not set and ConOutDev does have garbage? >> > > We have one sighting of 'ConOut' being missing. Any extrapolation from > there is tricky. We know in this one case the info appears to be good. Bu= t > this is not standards compliant, so how can we be sure that others will b= e > similar? > > Warner > > >> rgds, >> toomas >> >> >> The kernel shouldn't hang when we give it the wrong console because if >> the device isn't there, it won't cninit won't work. >> >>> Please seek more review is the point I'd hoped to make in the private >>> email. This could easily have been reviewed. There was no urgent rush t= hat >>> required it to go in w/o review or even discussion. >>> >>> >>> However, you didn't answer my question: Why the instant MFC? There's a = 3 >>> day minimum for changes in head... And there's nothing so urgent that >>> requires a short-circuit. >>> >>> Warner >>> >>> >>> >>> Because the issues is reported on 13. well, I guess You are right there= , >>> could have waited a bit more. >>> >> >> Right. Exactly my point.... >> >> Warner >> >> >>> thanks, >>> toomas >>> >>> >>> >>> >>> >>> >>>> Thanks, >>>> Toomas >>>> >>>> On Thu, Feb 4, 2021, 2:34 PM Toomas Soome wrote: >>>> >>>>> The branch stable/13 has been updated by tsoome: >>>>> >>>>> URL: >>>>> https://cgit.FreeBSD.org/src/commit/?id=3D0c839497c174e961fc71f7d3329= d05b10ec5525b >>>>> >>>>> >>>>> commit 0c839497c174e961fc71f7d3329d05b10ec5525b >>>>> Author: Toomas Soome >>>>> AuthorDate: 2021-02-04 20:49:02 +0000 >>>>> Commit: Toomas Soome >>>>> CommitDate: 2021-02-04 21:33:15 +0000 >>>>> >>>>> loader.efi: There are systems without ConOut, also use ConOutDev >>>>> >>>>> Conout does contian the default output device name. >>>>> ConOutDev does contain all possible output device names, so we ca= n >>>>> use it as fallback, when there is no ConOut. >>>>> >>>>> PR: 253253 >>>>> >>>>> (cherry picked from commit >>>>> 2bd4ff2d8911009283e4e615ca4aad35a845f48b) >>>>> --- >>>>> stand/efi/loader/main.c | 2 ++ >>>>> 1 file changed, 2 insertions(+) >>>>> >>>>> diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c >>>>> index ca41cd4a2610..32b278950745 100644 >>>>> --- a/stand/efi/loader/main.c >>>>> +++ b/stand/efi/loader/main.c >>>>> @@ -735,6 +735,8 @@ parse_uefi_con_out(void) >>>>> how =3D 0; >>>>> sz =3D sizeof(buf); >>>>> rv =3D efi_global_getenv("ConOut", buf, &sz); >>>>> + if (rv !=3D EFI_SUCCESS) >>>>> + rv =3D efi_global_getenv("ConOutDev", buf, &sz); >>>>> if (rv !=3D EFI_SUCCESS) { >>>>> /* If we don't have any ConOut default to serial */ >>>>> how =3D RB_SERIAL; >>>> >>>> >> From owner-dev-commits-src-all@freebsd.org Fri Feb 5 20:28: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 513DB529361 for ; Fri, 5 Feb 2021 20:28:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (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 4DXRny1bHRz4Vhx for ; Fri, 5 Feb 2021 20:28:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x729.google.com with SMTP id r77so8211839qka.12 for ; Fri, 05 Feb 2021 12:28:38 -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=9cDzxxaoaqNvi8c4xHh4L5Xcdvn7rwTTsZ2JgJdMo3E=; b=bPfC96bE/fxLUoGRbk6ALk1JZKUGY39Gyz3XxiK4KDxob4Ne2spjx02sQ2FQiDJDnR QOz1M3ByjbA9rCw9xMTLQqXNZf0UAogpapuUsVc58lV8x0Suc/wjaSebCAPJm+/elR9j EChZdRN905HyaRbsDCJYSlx/+STP90FsXdUhkttosnKujwG3nrl2UBWaA5Wit27FVJsZ L8p3i7IxoxeHXCmgo7PRH6EWst4hcV9ncH9pZnStkN0LOOhi3tZRoXhGaSUfczLnX2yk unR3OAKMnPXuITiI1Rp/ofgujxnOiWGU9LzVVIYd0w7Vj0IzqaPN5CQNMu/HPcl8Qt9Z prtw== 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=9cDzxxaoaqNvi8c4xHh4L5Xcdvn7rwTTsZ2JgJdMo3E=; b=KA9YbZQeKMwTSu8MqX/4VOyQW1nuUM82bxAT3IQgNu3EfHQqv49caXj9+NKw0MZrpF Ef3ij98FvqD17ZPlrU/4fuZhoK36jA8bBTJOgeIpQd/v9iafOp22jwiDsDhNM+FoJgUR 73x4ybNoAzfTBwQpRWsyaKUYdMwa2rZf5YZzYEzqSx5TFbddsICC1gE/uz6X4JnDUGXh P+OGZ8ODyBbncbHAsDRpIr1bazz5jZuXEgdRk3gXWz92fwTK+ABvGMvjJW5uMNFTqgYQ IE1Z2m4K44PJ1MI4y1PvLBxEk1/VcnDk5QOEhW3JdIFZ2x5YBfoGsxnneIOLjCrX4V89 v4Tg== X-Gm-Message-State: AOAM531bfZW5wmbWKHjq9S+70Bf8xAMZ7Drffj+2TRQPjmtlEpMFPvt0 0uyJ5nlRDf+jkno/gss7B7tfds2QtNojP/O2YcLzAA== X-Google-Smtp-Source: ABdhPJyBN5iOjYDObbjg7cCD0FlatJ7IlB6hWS141ztQRPFt7nzYaSnfYeNskG5keRntxUqNEW8ytrC/Jm4eAv5RmPY= X-Received: by 2002:a37:a34f:: with SMTP id m76mr6053390qke.89.1612556917322; Fri, 05 Feb 2021 12:28:37 -0800 (PST) MIME-Version: 1.0 References: <97F5C09F-7AE3-4763-AD32-BFEA25101CE5@me.com> <014891C8-7B1F-4908-9495-2ED1A5FAABCF@me.com> In-Reply-To: From: Warner Losh Date: Fri, 5 Feb 2021 13:28:26 -0700 Message-ID: Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev To: Jessica Clarke Cc: Toomas Soome , Toomas Soome , src-committers , "" , dev-commits-src-branches@freebsd.org X-Rspamd-Queue-Id: 4DXRny1bHRz4Vhx 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: Fri, 05 Feb 2021 20:28:38 -0000 On Fri, Feb 5, 2021 at 1:25 PM Jessica Clarke wrote: > On 5 Feb 2021, at 20:21, Warner Losh wrote: > > > > On Fri, Feb 5, 2021 at 1:09 PM Toomas Soome wrote: > >> >> >> On 5. Feb 2021, at 21:43, Warner Losh wrote: >> >> >> >> On Fri, Feb 5, 2021 at 10:24 AM Toomas Soome wrote: >> >>> >>> >>> On 5. Feb 2021, at 18:44, Warner Losh wrote: >>> >>> >>> >>> On Thu, Feb 4, 2021 at 11:38 PM Toomas Soome wrote: >>> >>>> >>>> >>>> On 5. Feb 2021, at 01:56, Warner Losh wrote: >>>> >>>> =EF=BB=BF >>>> And why the instaMFC? Changes are supposed to cook force days before >>>> merging... I have questions about the wisdom of this change... >>>> >>>> Warner >>>> >>>> >>>> Reason is in PR. There is someone with the system without ConOut but >>>> ConOutDev is set. Instead of falling back to arbitrary device (which i= n >>>> this case was totally wrong choice), we can try the possible devices l= ist. >>>> We do not change the ConOut parsing. >>>> >>> >>> We could have the same effect defaulting to Video. This bug should have >>> been discussed / reviewed before it was committed. >>> >>> >>> How is is different from defaulting to serial, it is just as bad? we ca= n >>> not guess there, thats why we do have ConOutDev list. >>> >>> >>> >>> If it would appear, there are systems with unusable devices listed in >>>> ConOutDev, then we need to think how to handle such case. >>>> >>> >>> Yes. We fall back to the arbitrary device... It's just a flag that can >>> be overridden. We can easily fall back to video too. >>> >>> >>> We *should not* fall back on arbitrary devices when there is source for >>> alternate options. And that option is from specification: >>> >>> "The ConInDev, ConOutDev, and ErrOutDev variables each contain an >>> EFI_DEVICE_PATH_PROTOCOL descriptor that defines all the possible >>> default devices to use on boot. These variables are volatile, and are s= et >>> dynamically on every boot. ConIn, ConOut, and ErrOut are always proper >>> subsets of ConInDev, ConOutDev, and ErrOutDev.*=E2=80=9D* >>> >> >> Right. Except they aren't a proper subset in this case. Since they aren'= t >> a proper subset, can you count on them having any meaningful meaning? In >> the cases you found they do, but it's just as arbitrary. >> >> >> Well, we can argue if empty set is or is not subset of (any) other set. >> But, we do have specification. And we should not arbitrary pick what par= t >> we are going to follow and what not. >> > > The empty set isn't a proper subset. It is a subset, but not a proper > subset, by definition. Therefore, it's not standards complaint. > > > The empty set is a proper subset of any non-empty set. Proper just means > that it's not equal to the original set. Perhaps you're thinking of trivi= al > subsets (which are the empty set and, if not empty, the original set)? > Yes. I was confusing the two, but 'proper subset' doesn't make sense in the original standard wording since it's often the case that ConOut and ConOutDev are exactly the same. And there's a difference between ConOut being present, but empty (which would be a subset) and it being absent, imho, that puts us in 'what to do in non-standard-compliant' behavior of the BIOS... Warner From owner-dev-commits-src-all@freebsd.org Fri Feb 5 20:33: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 26D83529765 for ; Fri, 5 Feb 2021 20:33:08 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-ztdg10012101.me.com (pv50p00im-ztdg10012101.me.com [17.58.6.49]) (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 4DXRv76rV0z4VsX for ; Fri, 5 Feb 2021 20:33:07 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-ztdg10012101.me.com (Postfix) with ESMTPSA id CD7A084020B; Fri, 5 Feb 2021 20:33:04 +0000 (UTC) From: Toomas Soome Message-Id: <68A78067-CE19-4024-B6A9-D924F8972A35@me.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 0c839497c174 - stable/13 - loader.efi: There are systems without ConOut, also use ConOutDev Date: Fri, 5 Feb 2021 22:33:02 +0200 In-Reply-To: Cc: Toomas Soome , src-committers , "" , dev-commits-src-branches@freebsd.org To: Warner Losh References: <97F5C09F-7AE3-4763-AD32-BFEA25101CE5@me.com> <014891C8-7B1F-4908-9495-2ED1A5FAABCF@me.com> X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.737 definitions=2021-02-05_11:2021-02-05, 2021-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2006250000 definitions=main-2102050128 X-Rspamd-Queue-Id: 4DXRv76rV0z4VsX X-Spamd-Bar: ---- 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: Fri, 05 Feb 2021 20:33:08 -0000 > On 5. Feb 2021, at 22:21, Warner Losh wrote: >=20 >=20 >=20 > On Fri, Feb 5, 2021 at 1:09 PM Toomas Soome > wrote: >=20 >=20 >> On 5. Feb 2021, at 21:43, Warner Losh > wrote: >>=20 >>=20 >>=20 >> On Fri, Feb 5, 2021 at 10:24 AM Toomas Soome > wrote: >>=20 >>=20 >>> On 5. Feb 2021, at 18:44, Warner Losh > wrote: >>>=20 >>>=20 >>>=20 >>> On Thu, Feb 4, 2021 at 11:38 PM Toomas Soome > wrote: >>>=20 >>>=20 >>>> On 5. Feb 2021, at 01:56, Warner Losh > wrote: >>>>=20 >>>> =EF=BB=BF >>>> And why the instaMFC? Changes are supposed to cook force days = before merging... I have questions about the wisdom of this change... >>>>=20 >>>> Warner=20 >>>>=20 >>>=20 >>> Reason is in PR. There is someone with the system without ConOut but = ConOutDev is set. Instead of falling back to arbitrary device (which in = this case was totally wrong choice), we can try the possible devices = list. We do not change the ConOut parsing. >>>=20 >>> We could have the same effect defaulting to Video. This bug should = have been discussed / reviewed before it was committed. >>=20 >> How is is different from defaulting to serial, it is just as bad? we = can not guess there, thats why we do have ConOutDev list. >>=20 >>=20 >>>=20 >>> If it would appear, there are systems with unusable devices listed = in ConOutDev, then we need to think how to handle such case. >>>=20 >>> Yes. We fall back to the arbitrary device... It's just a flag that = can be overridden. We can easily fall back to video too. >>=20 >> We *should not* fall back on arbitrary devices when there is source = for alternate options. And that option is from specification: >>=20 >> "The ConInDev, ConOutDev, and ErrOutDev variables each contain an = EFI_DEVICE_PATH_PROTOCOL descriptor that defines all the possible = default devices to use on boot. These variables are volatile, and are = set dynamically on every boot. ConIn, ConOut, and ErrOut are always = proper subsets of ConInDev, ConOutDev, and ErrOutDev.=E2=80=9D >>=20 >> Right. Except they aren't a proper subset in this case. Since they = aren't a proper subset, can you count on them having any meaningful = meaning? In the cases you found they do, but it's just as arbitrary. >=20 > Well, we can argue if empty set is or is not subset of (any) other = set. But, we do have specification. And we should not arbitrary pick = what part we are going to follow and what not. >=20 > The empty set isn't a proper subset. It is a subset, but not a proper = subset, by definition. Therefore, it's not standards complaint. >> =20 >> UEFI Spec 2.8A, Page 82. >>=20 >> There may or may not be Video (or Serial) device listed. If not, = there are good chance we will be in trouble because the firmware = internals may not be set up properly and we can just as well end up in = hung system. >>=20 >> For x86, there's almost always Video. For !x86 it gets more = troublesome. >=20 > There is almost always ConOut as well. Except when there is not. And = in this case, there is not. >=20 > I still do not get what it is we are arguing about. Do we have case = where ConOut is not set and ConOutDev does have garbage? >=20 > We have one sighting of 'ConOut' being missing. Any extrapolation from = there is tricky. We know in this one case the info appears to be good. = But this is not standards compliant, so how can we be sure that others = will be similar? >=20 > Warner It is tricky, agree. But we also have other assumptions. Like we can = get handles for all devices (vmware devs at one point in time did decide = to only give handles for devices used at boot time - no handles fot = non-boot disks, serial ports and such). But we are not going to tell user to buy better computer, do we?:) = Otherwise, we should tell the same for other non-standard cases we = already do know about=E2=80=A6 Thanks for all the feedback, toomas From owner-dev-commits-src-all@freebsd.org Fri Feb 5 21:15: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 AA0E552A178; Fri, 5 Feb 2021 21:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXSqn4PhVz4YMC; Fri, 5 Feb 2021 21:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89DD4258B3; Fri, 5 Feb 2021 21:15:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115LFHWm089167; Fri, 5 Feb 2021 21:15:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115LFHYK089164; Fri, 5 Feb 2021 21:15:17 GMT (envelope-from git) Date: Fri, 5 Feb 2021 21:15:17 GMT Message-Id: <202102052115.115LFHYK089164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan Eßer Subject: git: bf77fadc22c4 - stable/13 - Revert "bc: Vendor import of Gavin Howard's bc version 3.2.6" 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bf77fadc22c4c73f5e300309551e07c48bbe3a86 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:15:17 -0000 The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=bf77fadc22c4c73f5e300309551e07c48bbe3a86 commit bf77fadc22c4c73f5e300309551e07c48bbe3a86 Author: Stefan Eßer AuthorDate: 2021-02-05 19:53:34 +0000 Commit: Stefan Eßer CommitDate: 2021-02-05 19:53:34 +0000 Revert "bc: Vendor import of Gavin Howard's bc version 3.2.6" This reverts commit 601ac82194693fcae9d7d2a7ec7d66ebaf3fd61e. Seems that git cherry-pick mis-merges files for this software. It associates files in completely unrelated sub-trees with same name files from this package, e.g. README.md and .gitignore. My attempt to fix the mis-merge was incomplete and wrong. Therefore I'm reverting the commit that as a result of my failed attempt at conflict resolution lead to README.md and .gitignore in the top source directory to be deleted. This mistake has been carried over to releng/13.0, which now also lacks README.md and .gitignore in /usr/src. I'll try to re-apply the failed commit over the next hours and to get the fix merged to releng/13.0 with re approval. --- .gitignore | 27 ++ README.md | 82 +++++ contrib/bc/.gitignore | 9 - contrib/bc/LICENSE.md | 52 +-- contrib/bc/Makefile.in | 122 ++---- contrib/bc/NEWS.md | 35 -- contrib/bc/NOTICE.md | 2 +- contrib/bc/README.md | 1 - contrib/bc/configure.sh | 348 +++--------------- contrib/bc/exec-install.sh | 2 +- contrib/bc/functions.sh | 90 ++--- contrib/bc/gen/bc_help.txt | 2 +- contrib/bc/gen/dc_help.txt | 2 +- contrib/bc/gen/lib.bc | 2 +- contrib/bc/gen/lib2.bc | 2 +- contrib/bc/gen/strgen.c | 4 +- contrib/bc/gen/strgen.sh | 4 +- contrib/bc/include/args.h | 2 +- contrib/bc/include/bc.h | 2 +- contrib/bc/include/bcl.h | 2 +- contrib/bc/include/dc.h | 2 +- contrib/bc/include/file.h | 2 +- contrib/bc/include/history.h | 2 +- contrib/bc/include/lang.h | 2 +- contrib/bc/include/lex.h | 2 +- contrib/bc/include/library.h | 2 +- contrib/bc/include/num.h | 4 +- contrib/bc/include/opt.h | 2 +- contrib/bc/include/parse.h | 2 +- contrib/bc/include/program.h | 2 +- contrib/bc/include/rand.h | 31 +- contrib/bc/include/read.h | 2 +- contrib/bc/include/status.h | 14 +- contrib/bc/include/vector.h | 3 +- contrib/bc/include/vm.h | 19 +- contrib/bc/karatsuba.py | 2 +- contrib/bc/link.sh | 2 +- contrib/bc/locale_install.sh | 2 +- contrib/bc/locale_uninstall.sh | 2 +- contrib/bc/locales/de_DE.ISO8859-1.msg | 2 +- contrib/bc/locales/de_DE.UTF-8.msg | 2 +- contrib/bc/locales/en_US.msg | 2 +- contrib/bc/locales/es_ES.ISO8859-1.msg | 2 +- contrib/bc/locales/es_ES.UTF-8.msg | 2 +- contrib/bc/locales/fr_FR.ISO8859-1.msg | 2 +- contrib/bc/locales/fr_FR.UTF-8.msg | 2 +- contrib/bc/locales/ja_JP.UTF-8.msg | 2 +- contrib/bc/locales/ja_JP.eucJP.msg | 2 +- contrib/bc/locales/nl_NL.ISO8859-1.msg | 2 +- contrib/bc/locales/nl_NL.UTF-8.msg | 2 +- contrib/bc/locales/pl_PL.ISO8859-2.msg | 2 +- contrib/bc/locales/pl_PL.UTF-8.msg | 2 +- contrib/bc/locales/pt_PT.ISO8859-1.msg | 2 +- contrib/bc/locales/pt_PT.UTF-8.msg | 2 +- contrib/bc/locales/ru_RU.CP1251.msg | 2 +- contrib/bc/locales/ru_RU.CP866.msg | 2 +- contrib/bc/locales/ru_RU.ISO8859-5.msg | 2 +- contrib/bc/locales/ru_RU.KOI8-R.msg | 2 +- contrib/bc/locales/ru_RU.UTF-8.msg | 2 +- contrib/bc/locales/zh_CN.GB18030.msg | 2 +- contrib/bc/locales/zh_CN.GB2312.msg | 2 +- contrib/bc/locales/zh_CN.GBK.msg | 2 +- contrib/bc/locales/zh_CN.UTF-8.msg | 2 +- contrib/bc/locales/zh_CN.eucCN.msg | 2 +- contrib/bc/manpage.sh | 2 +- contrib/bc/manuals/bc.1.md.in | 7 +- contrib/bc/manuals/bc/A.1 | 8 +- contrib/bc/manuals/bc/A.1.md | 7 +- contrib/bc/manuals/bc/E.1 | 4 +- contrib/bc/manuals/bc/E.1.md | 2 +- contrib/bc/manuals/bc/EH.1 | 4 +- contrib/bc/manuals/bc/EH.1.md | 2 +- contrib/bc/manuals/bc/EHN.1 | 4 +- contrib/bc/manuals/bc/EHN.1.md | 2 +- contrib/bc/manuals/bc/EHNP.1 | 4 +- contrib/bc/manuals/bc/EHNP.1.md | 2 +- contrib/bc/manuals/bc/EHP.1 | 4 +- contrib/bc/manuals/bc/EHP.1.md | 2 +- contrib/bc/manuals/bc/EN.1 | 4 +- contrib/bc/manuals/bc/EN.1.md | 2 +- contrib/bc/manuals/bc/ENP.1 | 4 +- contrib/bc/manuals/bc/ENP.1.md | 2 +- contrib/bc/manuals/bc/EP.1 | 4 +- contrib/bc/manuals/bc/EP.1.md | 2 +- contrib/bc/manuals/bc/H.1 | 8 +- contrib/bc/manuals/bc/H.1.md | 7 +- contrib/bc/manuals/bc/HN.1 | 8 +- contrib/bc/manuals/bc/HN.1.md | 7 +- contrib/bc/manuals/bc/HNP.1 | 8 +- contrib/bc/manuals/bc/HNP.1.md | 7 +- contrib/bc/manuals/bc/HP.1 | 8 +- contrib/bc/manuals/bc/HP.1.md | 7 +- contrib/bc/manuals/bc/N.1 | 8 +- contrib/bc/manuals/bc/N.1.md | 7 +- contrib/bc/manuals/bc/NP.1 | 8 +- contrib/bc/manuals/bc/NP.1.md | 7 +- contrib/bc/manuals/bc/P.1 | 8 +- contrib/bc/manuals/bc/P.1.md | 7 +- contrib/bc/manuals/bcl.3 | 4 +- contrib/bc/manuals/bcl.3.md | 2 +- contrib/bc/manuals/dc.1.md.in | 7 +- contrib/bc/manuals/dc/A.1 | 10 +- contrib/bc/manuals/dc/A.1.md | 7 +- contrib/bc/manuals/dc/E.1 | 4 +- contrib/bc/manuals/dc/E.1.md | 2 +- contrib/bc/manuals/dc/EH.1 | 4 +- contrib/bc/manuals/dc/EH.1.md | 2 +- contrib/bc/manuals/dc/EHN.1 | 4 +- contrib/bc/manuals/dc/EHN.1.md | 2 +- contrib/bc/manuals/dc/EHNP.1 | 4 +- contrib/bc/manuals/dc/EHNP.1.md | 2 +- contrib/bc/manuals/dc/EHP.1 | 4 +- contrib/bc/manuals/dc/EHP.1.md | 2 +- contrib/bc/manuals/dc/EN.1 | 4 +- contrib/bc/manuals/dc/EN.1.md | 2 +- contrib/bc/manuals/dc/ENP.1 | 4 +- contrib/bc/manuals/dc/ENP.1.md | 2 +- contrib/bc/manuals/dc/EP.1 | 4 +- contrib/bc/manuals/dc/EP.1.md | 2 +- contrib/bc/manuals/dc/H.1 | 10 +- contrib/bc/manuals/dc/H.1.md | 7 +- contrib/bc/manuals/dc/HN.1 | 10 +- contrib/bc/manuals/dc/HN.1.md | 7 +- contrib/bc/manuals/dc/HNP.1 | 10 +- contrib/bc/manuals/dc/HNP.1.md | 7 +- contrib/bc/manuals/dc/HP.1 | 10 +- contrib/bc/manuals/dc/HP.1.md | 7 +- contrib/bc/manuals/dc/N.1 | 10 +- contrib/bc/manuals/dc/N.1.md | 7 +- contrib/bc/manuals/dc/NP.1 | 10 +- contrib/bc/manuals/dc/NP.1.md | 7 +- contrib/bc/manuals/dc/P.1 | 10 +- contrib/bc/manuals/dc/P.1.md | 7 +- contrib/bc/manuals/header.txt | 2 +- contrib/bc/manuals/header_bc.txt | 2 +- contrib/bc/manuals/header_bcl.txt | 2 +- contrib/bc/manuals/header_dc.txt | 2 +- contrib/bc/release.sh | 18 +- contrib/bc/src/args.c | 2 +- contrib/bc/src/bc.c | 2 +- contrib/bc/src/bc_lex.c | 2 +- contrib/bc/src/bc_parse.c | 2 +- contrib/bc/src/data.c | 4 +- contrib/bc/src/dc.c | 2 +- contrib/bc/src/dc_lex.c | 6 +- contrib/bc/src/dc_parse.c | 2 +- contrib/bc/src/file.c | 4 +- contrib/bc/src/history.c | 15 +- contrib/bc/src/lang.c | 14 +- contrib/bc/src/lex.c | 4 +- contrib/bc/src/library.c | 12 +- contrib/bc/src/main.c | 13 +- contrib/bc/src/num.c | 10 +- contrib/bc/src/opt.c | 2 +- contrib/bc/src/parse.c | 8 +- contrib/bc/src/program.c | 31 +- contrib/bc/src/rand.c | 42 ++- contrib/bc/src/read.c | 6 +- contrib/bc/src/vector.c | 8 +- contrib/bc/src/vm.c | 86 +---- contrib/bc/tests/afl.py | 22 +- contrib/bc/tests/all.sh | 191 +++++++++- contrib/bc/tests/bc/all.txt | 6 +- contrib/bc/tests/bc/scripts/all.txt | 15 - contrib/bc/tests/bc/timeconst.sh | 9 +- contrib/bc/tests/bcl.c | 2 +- contrib/bc/tests/dc/errors/30.txt | 1 - contrib/bc/tests/dc/errors/31.txt | 1 - contrib/bc/tests/dc/scripts/all.txt | 9 - contrib/bc/tests/diff.sh | 51 --- contrib/bc/tests/errors.sh | 20 +- contrib/bc/tests/extra_required.txt | 7 - contrib/bc/tests/fuzzing/bc.dict | 68 ---- contrib/bc/tests/fuzzing/bc_inputs1/abs.txt | 7 - contrib/bc/tests/fuzzing/bc_inputs1/add.txt | 146 -------- contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt | 26 -- contrib/bc/tests/fuzzing/bc_inputs1/array.bc | 60 --- contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt | 10 - .../bc/tests/fuzzing/bc_inputs1/assignments.txt | 122 ------ contrib/bc/tests/fuzzing/bc_inputs1/basic.txt | 7 - contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt | 184 ---------- contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt | 44 --- contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt | 35 -- contrib/bc/tests/fuzzing/bc_inputs1/divide.txt | 31 -- .../bc/tests/fuzzing/bc_inputs1/engineering.txt | 19 - contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt | 22 -- contrib/bc/tests/fuzzing/bc_inputs1/functions.bc | 7 - contrib/bc/tests/fuzzing/bc_inputs1/functions.txt | 13 - contrib/bc/tests/fuzzing/bc_inputs1/globals.txt | 21 -- contrib/bc/tests/fuzzing/bc_inputs1/len.bc | 48 --- contrib/bc/tests/fuzzing/bc_inputs1/length.txt | 59 --- contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt | 4 - contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt | 4 - contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt | 15 - contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt | 6 - contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt | 10 - contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt | 2 - contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt | 5 - contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt | 12 - contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt | 3 - contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs2/lib23.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs2/lib24.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs2/log.txt | 22 -- contrib/bc/tests/fuzzing/bc_inputs2/misc.txt | 13 - contrib/bc/tests/fuzzing/bc_inputs2/misc1.txt | 76 ---- contrib/bc/tests/fuzzing/bc_inputs2/misc2.txt | 110 ------ contrib/bc/tests/fuzzing/bc_inputs2/misc3.txt | 12 - contrib/bc/tests/fuzzing/bc_inputs2/modulus.txt | 69 ---- contrib/bc/tests/fuzzing/bc_inputs2/multiply.txt | 40 -- contrib/bc/tests/fuzzing/bc_inputs2/pi.txt | 4 - contrib/bc/tests/fuzzing/bc_inputs2/places.txt | 19 - contrib/bc/tests/fuzzing/bc_inputs2/power.txt | 44 --- contrib/bc/tests/fuzzing/bc_inputs2/print2.txt | 194 ---------- contrib/bc/tests/fuzzing/bc_inputs2/references.bc | 408 --------------------- contrib/bc/tests/fuzzing/bc_inputs2/scale.txt | 57 --- contrib/bc/tests/fuzzing/bc_inputs2/scientific.txt | 51 --- contrib/bc/tests/fuzzing/bc_inputs2/shift.txt | 281 -------------- contrib/bc/tests/fuzzing/bc_inputs2/sine.txt | 207 ----------- contrib/bc/tests/fuzzing/bc_inputs3/01.txt | 339 ----------------- contrib/bc/tests/fuzzing/bc_inputs3/02.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs3/03.txt | 2 - contrib/bc/tests/fuzzing/bc_inputs3/04.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs3/05.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs3/06.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs3/07.txt | 8 - contrib/bc/tests/fuzzing/bc_inputs3/08.txt | 3 - contrib/bc/tests/fuzzing/bc_inputs3/09.txt | 11 - contrib/bc/tests/fuzzing/bc_inputs3/10.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs3/11.txt | 99 ----- contrib/bc/tests/fuzzing/bc_inputs3/12.txt | 2 - contrib/bc/tests/fuzzing/bc_inputs3/13.txt | 56 --- contrib/bc/tests/fuzzing/bc_inputs3/14.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs3/15.txt | 3 - contrib/bc/tests/fuzzing/bc_inputs3/16.txt | 1 - contrib/bc/tests/fuzzing/bc_inputs3/17.txt | 11 - contrib/bc/tests/fuzzing/bc_inputs3/18.txt | 3 - contrib/bc/tests/fuzzing/bc_inputs3/19.txt | 5 - contrib/bc/tests/fuzzing/bc_inputs3/20.txt | 51 --- contrib/bc/tests/fuzzing/bc_inputs3/21.txt | 10 - contrib/bc/tests/fuzzing/bc_inputs3/22.txt | 2 - contrib/bc/tests/fuzzing/bc_inputs3/23.txt | Bin 1024 -> 0 bytes contrib/bc/tests/fuzzing/bc_inputs3/24.txt | 4 - contrib/bc/tests/fuzzing/bc_inputs3/sqrt.txt | 14 - contrib/bc/tests/fuzzing/bc_inputs3/strings.txt | 12 - contrib/bc/tests/fuzzing/bc_inputs3/subtract.txt | 153 -------- contrib/bc/tests/fuzzing/bc_inputs3/trunc.txt | 15 - contrib/bc/tests/fuzzing/bc_inputs3/void.txt | 20 - contrib/bc/tests/fuzzing/dc_inputs/01.txt | 2 - contrib/bc/tests/fuzzing/dc_inputs/02.txt | 5 - contrib/bc/tests/fuzzing/dc_inputs/03.txt | 2 - contrib/bc/tests/fuzzing/dc_inputs/04.txt | 9 - contrib/bc/tests/fuzzing/dc_inputs/05.txt | 3 - contrib/bc/tests/fuzzing/dc_inputs/06.txt | 1 - contrib/bc/tests/fuzzing/dc_inputs/07.txt | 3 - contrib/bc/tests/fuzzing/dc_inputs/08.txt | 1 - contrib/bc/tests/fuzzing/dc_inputs/09.txt | 9 - contrib/bc/tests/fuzzing/dc_inputs/10.txt | 11 - contrib/bc/tests/fuzzing/dc_inputs/11.txt | 4 - contrib/bc/tests/fuzzing/dc_inputs/12.txt | 2 - contrib/bc/tests/fuzzing/dc_inputs/13.txt | 7 - contrib/bc/tests/fuzzing/dc_inputs/14.txt | 7 - contrib/bc/tests/fuzzing/dc_inputs/15.txt | 11 - contrib/bc/tests/fuzzing/dc_inputs/16.txt | 1 - contrib/bc/tests/fuzzing/dc_inputs/17.txt | 20 - contrib/bc/tests/fuzzing/dc_inputs/18.txt | 3 - contrib/bc/tests/fuzzing/dc_inputs/19.txt | 1 - contrib/bc/tests/fuzzing/dc_inputs/20.txt | 3 - contrib/bc/tests/fuzzing/dc_inputs/21.txt | 5 - contrib/bc/tests/fuzzing/dc_inputs/22.txt | 36 -- contrib/bc/tests/fuzzing/dc_inputs/23.txt | 2 - contrib/bc/tests/fuzzing/dc_inputs/24.txt | 1 - contrib/bc/tests/fuzzing/dc_inputs/25.txt | 6 - contrib/bc/tests/fuzzing/dc_inputs/26.txt | 155 -------- contrib/bc/tests/fuzzing/dc_inputs/27.txt | 2 - contrib/bc/tests/fuzzing/dc_inputs/28.txt | 1 - contrib/bc/tests/fuzzing/dc_inputs/29.txt | 13 - contrib/bc/tests/fuzzing/dc_inputs/30.txt | 1 - contrib/bc/tests/fuzzing/dc_inputs/31.txt | 1 - contrib/bc/tests/fuzzing/dc_inputs/abs.txt | 7 - contrib/bc/tests/fuzzing/dc_inputs/add.txt | 33 -- contrib/bc/tests/fuzzing/dc_inputs/array.dc | 2 - contrib/bc/tests/fuzzing/dc_inputs/boolean.txt | 80 ---- contrib/bc/tests/fuzzing/dc_inputs/decimal.txt | 36 -- contrib/bc/tests/fuzzing/dc_inputs/divide.txt | 33 -- contrib/bc/tests/fuzzing/dc_inputs/divmod.txt | 64 ---- contrib/bc/tests/fuzzing/dc_inputs/else.dc | 4 - contrib/bc/tests/fuzzing/dc_inputs/engineering.txt | 19 - contrib/bc/tests/fuzzing/dc_inputs/loop.dc | 3 - contrib/bc/tests/fuzzing/dc_inputs/misc.txt | 1 - contrib/bc/tests/fuzzing/dc_inputs/modexp.txt | 103 ------ contrib/bc/tests/fuzzing/dc_inputs/modulus.txt | 70 ---- contrib/bc/tests/fuzzing/dc_inputs/multiply.txt | 42 --- contrib/bc/tests/fuzzing/dc_inputs/places.txt | 14 - contrib/bc/tests/fuzzing/dc_inputs/power.txt | 36 -- contrib/bc/tests/fuzzing/dc_inputs/quit.dc | 2 - contrib/bc/tests/fuzzing/dc_inputs/scientific.txt | 51 --- contrib/bc/tests/fuzzing/dc_inputs/shift.txt | 42 --- contrib/bc/tests/fuzzing/dc_inputs/sqrt.txt | 14 - contrib/bc/tests/fuzzing/dc_inputs/stdin.txt | 205 ----------- contrib/bc/tests/fuzzing/dc_inputs/stream.dc | 2 - contrib/bc/tests/fuzzing/dc_inputs/strings.txt | 50 --- contrib/bc/tests/fuzzing/dc_inputs/subtract.txt | 33 -- contrib/bc/tests/fuzzing/dc_inputs/trunc.txt | 11 - contrib/bc/tests/fuzzing/dc_inputs/vars.txt | 2 - contrib/bc/tests/fuzzing/dc_inputs/weird.dc | 2 - contrib/bc/tests/other.sh | 271 -------------- contrib/bc/tests/radamsa.sh | 2 +- contrib/bc/tests/randmath.py | 2 +- contrib/bc/tests/read.sh | 23 +- contrib/bc/tests/script.sh | 26 +- contrib/bc/tests/scripts.sh | 9 +- contrib/bc/tests/stdin.sh | 23 +- contrib/bc/tests/test.sh | 32 +- tests/dc/errors/30.txt | 1 - tests/dc/errors/31.txt | 1 - tests/dc/scripts/all.txt | 9 - tests/diff.sh | 51 --- tests/extra_required.txt | 7 - tests/fuzzing/bc.dict | 68 ---- tests/fuzzing/bc_inputs1/abs.txt | 7 - tests/fuzzing/bc_inputs1/add.txt | 146 -------- tests/fuzzing/bc_inputs1/arctangent.txt | 26 -- tests/fuzzing/bc_inputs1/array.bc | 60 --- tests/fuzzing/bc_inputs1/arrays.txt | 10 - tests/fuzzing/bc_inputs1/assignments.txt | 122 ------ tests/fuzzing/bc_inputs1/basic.txt | 7 - tests/fuzzing/bc_inputs1/boolean.txt | 184 ---------- tests/fuzzing/bc_inputs1/cosine.txt | 44 --- tests/fuzzing/bc_inputs1/decimal.txt | 35 -- tests/fuzzing/bc_inputs1/divide.txt | 31 -- tests/fuzzing/bc_inputs1/engineering.txt | 19 - tests/fuzzing/bc_inputs1/exponent.txt | 22 -- tests/fuzzing/bc_inputs1/functions.bc | 7 - tests/fuzzing/bc_inputs1/functions.txt | 13 - tests/fuzzing/bc_inputs1/globals.txt | 21 -- tests/fuzzing/bc_inputs1/len.bc | 48 --- tests/fuzzing/bc_inputs1/length.txt | 59 --- tests/fuzzing/bc_inputs1/lib10.txt | 4 - tests/fuzzing/bc_inputs1/lib11.txt | 4 - tests/fuzzing/bc_inputs1/lib12.txt | 1 - tests/fuzzing/bc_inputs1/lib2.txt | 15 - tests/fuzzing/bc_inputs1/lib3.txt | 6 - tests/fuzzing/bc_inputs1/lib4.txt | 10 - tests/fuzzing/bc_inputs1/lib5.txt | 2 - tests/fuzzing/bc_inputs1/lib6.txt | 5 - tests/fuzzing/bc_inputs1/lib7.txt | 12 - tests/fuzzing/bc_inputs1/lib8.txt | 3 - tests/fuzzing/bc_inputs2/lib13.txt | 1 - tests/fuzzing/bc_inputs2/lib14.txt | 1 - tests/fuzzing/bc_inputs2/lib15.txt | 1 - tests/fuzzing/bc_inputs2/lib16.txt | 1 - tests/fuzzing/bc_inputs2/lib19.txt | 1 - tests/fuzzing/bc_inputs2/lib20.txt | 1 - tests/fuzzing/bc_inputs2/lib21.txt | 1 - tests/fuzzing/bc_inputs2/lib22.txt | 1 - tests/fuzzing/bc_inputs2/lib23.txt | 1 - tests/fuzzing/bc_inputs2/lib24.txt | 1 - tests/fuzzing/bc_inputs2/log.txt | 22 -- tests/fuzzing/bc_inputs2/misc.txt | 13 - tests/fuzzing/bc_inputs2/misc1.txt | 76 ---- tests/fuzzing/bc_inputs2/misc2.txt | 110 ------ tests/fuzzing/bc_inputs2/misc3.txt | 12 - tests/fuzzing/bc_inputs2/modulus.txt | 69 ---- tests/fuzzing/bc_inputs2/multiply.txt | 40 -- tests/fuzzing/bc_inputs2/pi.txt | 4 - tests/fuzzing/bc_inputs2/places.txt | 19 - tests/fuzzing/bc_inputs2/power.txt | 44 --- tests/fuzzing/bc_inputs2/print2.txt | 194 ---------- tests/fuzzing/bc_inputs2/references.bc | 408 --------------------- tests/fuzzing/bc_inputs2/scale.txt | 57 --- tests/fuzzing/bc_inputs2/scientific.txt | 51 --- tests/fuzzing/bc_inputs2/shift.txt | 281 -------------- tests/fuzzing/bc_inputs2/sine.txt | 207 ----------- tests/fuzzing/bc_inputs3/01.txt | 339 ----------------- tests/fuzzing/bc_inputs3/02.txt | 1 - tests/fuzzing/bc_inputs3/03.txt | 2 - tests/fuzzing/bc_inputs3/04.txt | 1 - tests/fuzzing/bc_inputs3/05.txt | 1 - tests/fuzzing/bc_inputs3/06.txt | 1 - tests/fuzzing/bc_inputs3/07.txt | 8 - tests/fuzzing/bc_inputs3/08.txt | 3 - tests/fuzzing/bc_inputs3/09.txt | 11 - tests/fuzzing/bc_inputs3/10.txt | 1 - tests/fuzzing/bc_inputs3/11.txt | 99 ----- tests/fuzzing/bc_inputs3/12.txt | 2 - tests/fuzzing/bc_inputs3/13.txt | 56 --- tests/fuzzing/bc_inputs3/14.txt | 1 - tests/fuzzing/bc_inputs3/15.txt | 3 - tests/fuzzing/bc_inputs3/16.txt | 1 - tests/fuzzing/bc_inputs3/17.txt | 11 - tests/fuzzing/bc_inputs3/18.txt | 3 - tests/fuzzing/bc_inputs3/19.txt | 5 - tests/fuzzing/bc_inputs3/20.txt | 51 --- tests/fuzzing/bc_inputs3/21.txt | 10 - tests/fuzzing/bc_inputs3/22.txt | 2 - tests/fuzzing/bc_inputs3/23.txt | Bin 1024 -> 0 bytes tests/fuzzing/bc_inputs3/24.txt | 4 - tests/fuzzing/bc_inputs3/sqrt.txt | 14 - tests/fuzzing/bc_inputs3/strings.txt | 12 - tests/fuzzing/bc_inputs3/subtract.txt | 153 -------- tests/fuzzing/bc_inputs3/trunc.txt | 15 - tests/fuzzing/bc_inputs3/void.txt | 20 - tests/fuzzing/dc_inputs/01.txt | 2 - tests/fuzzing/dc_inputs/02.txt | 5 - tests/fuzzing/dc_inputs/03.txt | 2 - tests/fuzzing/dc_inputs/04.txt | 9 - tests/fuzzing/dc_inputs/05.txt | 3 - tests/fuzzing/dc_inputs/06.txt | 1 - tests/fuzzing/dc_inputs/07.txt | 3 - tests/fuzzing/dc_inputs/08.txt | 1 - tests/fuzzing/dc_inputs/09.txt | 9 - tests/fuzzing/dc_inputs/10.txt | 11 - tests/fuzzing/dc_inputs/11.txt | 4 - tests/fuzzing/dc_inputs/12.txt | 2 - tests/fuzzing/dc_inputs/13.txt | 7 - tests/fuzzing/dc_inputs/14.txt | 7 - tests/fuzzing/dc_inputs/15.txt | 11 - tests/fuzzing/dc_inputs/16.txt | 1 - tests/fuzzing/dc_inputs/17.txt | 20 - tests/fuzzing/dc_inputs/18.txt | 3 - tests/fuzzing/dc_inputs/19.txt | 1 - tests/fuzzing/dc_inputs/20.txt | 3 - tests/fuzzing/dc_inputs/21.txt | 5 - tests/fuzzing/dc_inputs/22.txt | 36 -- tests/fuzzing/dc_inputs/23.txt | 2 - tests/fuzzing/dc_inputs/24.txt | 1 - tests/fuzzing/dc_inputs/25.txt | 6 - tests/fuzzing/dc_inputs/26.txt | 155 -------- tests/fuzzing/dc_inputs/27.txt | 2 - tests/fuzzing/dc_inputs/28.txt | 1 - tests/fuzzing/dc_inputs/29.txt | 13 - tests/fuzzing/dc_inputs/30.txt | 1 - tests/fuzzing/dc_inputs/31.txt | 1 - tests/fuzzing/dc_inputs/abs.txt | 7 - tests/fuzzing/dc_inputs/add.txt | 33 -- tests/fuzzing/dc_inputs/array.dc | 2 - tests/fuzzing/dc_inputs/boolean.txt | 80 ---- tests/fuzzing/dc_inputs/decimal.txt | 36 -- tests/fuzzing/dc_inputs/divide.txt | 33 -- tests/fuzzing/dc_inputs/divmod.txt | 64 ---- tests/fuzzing/dc_inputs/else.dc | 4 - tests/fuzzing/dc_inputs/engineering.txt | 19 - tests/fuzzing/dc_inputs/loop.dc | 3 - tests/fuzzing/dc_inputs/misc.txt | 1 - tests/fuzzing/dc_inputs/modexp.txt | 103 ------ tests/fuzzing/dc_inputs/modulus.txt | 70 ---- tests/fuzzing/dc_inputs/multiply.txt | 42 --- tests/fuzzing/dc_inputs/places.txt | 14 - tests/fuzzing/dc_inputs/power.txt | 36 -- tests/fuzzing/dc_inputs/quit.dc | 2 - tests/fuzzing/dc_inputs/scientific.txt | 51 --- tests/fuzzing/dc_inputs/shift.txt | 42 --- tests/fuzzing/dc_inputs/sqrt.txt | 14 - tests/fuzzing/dc_inputs/stdin.txt | 205 ----------- tests/fuzzing/dc_inputs/stream.dc | 2 - tests/fuzzing/dc_inputs/strings.txt | 50 --- tests/fuzzing/dc_inputs/subtract.txt | 33 -- tests/fuzzing/dc_inputs/trunc.txt | 11 - tests/fuzzing/dc_inputs/vars.txt | 2 - tests/fuzzing/dc_inputs/weird.dc | 2 - tests/other.sh | 271 -------------- 470 files changed, 821 insertions(+), 11313 deletions(-) diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..c674e06fda50 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +*.a +*.core +*.o +*.so +*.swp +*~ +_.tinderbox.* +_.universe-toolchain +_.amd64.* +_.arm.* +_.arm64.* +_.i386.* +_.ia64.* +_.mips.* +_.pc98.* +_.powerpc.* +_.riscv.* +_.sparc64.* +_.sun4v.* +GPATH +GRTAGS +GTAGS +ID +cscope.files +cscope.in.out +cscope.out +cscope.po.out diff --git a/README.md b/README.md new file mode 100644 index 000000000000..72bd634cd813 --- /dev/null +++ b/README.md @@ -0,0 +1,82 @@ +FreeBSD Source: +--------------- +This is the top level of the FreeBSD source directory. This file +was last revised on: +$FreeBSD$ + +FreeBSD is an operating system used to power modern servers, +desktops, and embedded platforms. A large community has +continually developed it for more than thirty years. Its +advanced networking, security, and storage features have +made FreeBSD the platform of choice for many of the +busiest web sites and most pervasive embedded networking +and storage devices. + +For copyright information, please see the file COPYRIGHT in this +directory. Additional copyright information also exists for some +sources in this tree - please see the specific source directories for +more information. + +The Makefile in this directory supports a number of targets for +building components (or all) of the FreeBSD source tree. See build(7), config(8), +https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, and +https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html +for more information, including setting make(1) variables. + +Source Roadmap: +--------------- +``` +bin System/user commands. + +cddl Various commands and libraries under the Common Development + and Distribution License. + +contrib Packages contributed by 3rd parties. + +crypto Cryptography stuff (see crypto/README). + +etc Template files for /etc. + +gnu Various commands and libraries under the GNU Public License. + Please see gnu/COPYING* for more information. + +include System include files. + +kerberos5 Kerberos5 (Heimdal) package. + +lib System libraries. + +libexec System daemons. + +release Release building Makefile & associated tools. + +rescue Build system for statically linked /rescue utilities. + +sbin System commands. + +secure Cryptographic libraries and commands. + +share Shared resources. + +stand Boot loader sources. + +sys Kernel sources. + +sys//conf Kernel configuration files. GENERIC is the configuration + used in release builds. NOTES contains documentation of + all possible entries. + +tests Regression tests which can be run by Kyua. See tests/README + for additional information. + +tools Utilities for regression testing and miscellaneous tasks. + +usr.bin User commands. + +usr.sbin System administration commands. +``` + +For information on synchronizing your source tree with one or more of +the FreeBSD Project's development branches, please see: + + https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html diff --git a/contrib/bc/.gitignore b/contrib/bc/.gitignore index 5c2bbae866c0..fb9bc5ab6aa2 100644 --- a/contrib/bc/.gitignore +++ b/contrib/bc/.gitignore @@ -34,13 +34,6 @@ config.mak timeconst.bc Makefile -tests/fuzzing/bc_outputs1/* -tests/fuzzing/bc_outputs2/* -tests/fuzzing/bc_outputs3/* -tests/fuzzing/dc_outputs/* -tests/bc_outputs/* -tests/dc_outputs/* - .gdb_history # Ignore the generated test files @@ -64,7 +57,5 @@ perf.data.old *.html *.profraw -core.* - cscope*.out tags diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md index 269e131cc81d..1681a053e0de 100644 --- a/contrib/bc/LICENSE.md +++ b/contrib/bc/LICENSE.md @@ -1,6 +1,6 @@ # License -Copyright (c) 2018-2021 Gavin D. Howard +Copyright (c) 2018-2020 Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -31,7 +31,7 @@ copyrights and license: Copyright (c) 2010-2014, Salvatore Sanfilippo
Copyright (c) 2010-2013, Pieter Noordhuis
Copyright (c) 2018 rain-1
-Copyright (c) 2018-2021, Gavin D. Howard +Copyright (c) 2018-2020, Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -53,51 +53,3 @@ 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. - -## Rand - -The files `src/rand.c` and `include/rand.h` are under the following copyrights -and license: - -Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors -Copyright (c) 2018-2021 Gavin D. Howard - -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: - -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. - -## `safe-install.sh` - -The file `safe-install.sh` is under the following copyright and license: - -Copyright (c) 2021 Rich Felker - -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: - -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. diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index 8ae982bd99fe..d17e74163397 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.2.6 +VERSION = 3.2.4 SRC = %%SRC%% OBJ = %%OBJ%% @@ -41,13 +41,6 @@ BC_ENABLED = %%BC_ENABLED%% DC_ENABLED_NAME = DC_ENABLED DC_ENABLED = %%DC_ENABLED%% -HEADERS = include/args.h include/file.h include/lang.h include/lex.h include/num.h include/opt.h include/parse.h include/program.h include/read.h include/status.h include/vector.h include/vm.h -BC_HEADERS = include/bc.h -DC_HEADERS = include/dc.h -HISTORY_HEADERS = include/history.h -EXTRA_MATH_HEADERS = include/rand.h -LIBRARY_HEADERS = include/bcl.h include/library.h - GEN_DIR = gen GEN = %%GEN%% GEN_EXEC = $(GEN_DIR)/$(GEN) @@ -89,11 +82,6 @@ DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) -BC_TEST_OUTPUTS = tests/bc_outputs -BC_FUZZ_OUTPUTS = tests/fuzzing/bc_outputs1 tests/fuzzing/bc_outputs2 tests/fuzzing/bc_outputs3 -DC_TEST_OUTPUTS = tests/dc_outputs -DC_FUZZ_OUTPUTS = tests/fuzzing/dc_outputs - LIB = libbcl LIB_NAME = $(LIB).a LIBBC = $(BIN)/$(LIB_NAME) @@ -137,9 +125,6 @@ BC_ENABLE_NLS = %%NLS%% BC_ENABLE_PROMPT = %%PROMPT%% BC_LONG_BIT = %%LONG_BIT%% -BC_ENABLE_AFL = %%FUZZ%% -BC_ENABLE_MEMCHECK = %%MEMCHECK%% - RM = rm MKDIR = mkdir @@ -153,8 +138,6 @@ LOCALE_UNINSTALL = ./locale_uninstall.sh VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all -TEST_STARS = "***********************************************************************" - BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%% CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) @@ -164,8 +147,7 @@ CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) -CPPFLAGS8 = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) -CPPFLAGS = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL) +CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) CFLAGS = $(CPPFLAGS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% @@ -177,15 +159,20 @@ HOSTCC = %%HOSTCC%% BC_LIB_C_ARGS = bc_lib bc_lib_name $(BC_ENABLED_NAME) 1 BC_LIB2_C_ARGS = bc_lib2 bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 -OBJS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +OBJS = $(BC_HELP_O) $(DC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +OBJ_TARGETS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) -all: %%DEFAULT_TARGET%% +.c.o: + $(CC) $(CFLAGS) -o $@ -c $< + +all: %%ALL_PREREQ%% -%%DEFAULT_TARGET%%: %%DEFAULT_TARGET_PREREQS%% - %%DEFAULT_TARGET_CMD%% +execs: make_bin $(OBJ_TARGETS) + $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC) + %%LINK%% -%%SECOND_TARGET%%: %%SECOND_TARGET_PREREQS%% - %%SECOND_TARGET_CMD%% +library: make_bin $(OBJ) $(BC_LIB_O) $(BC_LIB2_O) + ar -r -cu $(LIBBC) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) $(GEN_EXEC): %%GEN_EXEC_TARGET%% @@ -193,32 +180,18 @@ $(GEN_EXEC): $(BC_LIB_C): $(GEN_EXEC) $(BC_LIB) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_LIB_C_ARGS) -$(BC_LIB_O): $(BC_LIB_C) - $(CC) $(CFLAGS) -o $@ -c $< - $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS) -$(BC_LIB2_O): $(BC_LIB2_C) - $(CC) $(CFLAGS) -o $@ -c $< - $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME) -$(BC_HELP_O): $(BC_HELP_C) - $(CC) $(CFLAGS) -o $@ -c $< - $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME) -$(DC_HELP_O): $(DC_HELP_C) - $(CC) $(CFLAGS) -o $@ -c $< - -$(BIN): +make_bin: $(MKDIR) -p $(BIN) -headers: %%HEADERS%% - help: @printf 'available targets:\n' @printf '\n' @@ -249,68 +222,41 @@ help: @printf ' valgrind_dc runs the dc test suite, if dc has been built,\n' @printf ' through valgrind\n' -run_all_tests: - %%BC_ALL_TESTS%% - %%TIMECONST_ALL_TESTS%% - %%DC_ALL_TESTS%% - check: test test: %%TESTS%% -test_bc: test_bc_header test_bc_tests test_bc_scripts test_bc_stdin test_bc_read test_bc_errors test_bc_other - @printf '\nAll bc tests passed.\n\n$(TEST_STARS)\n' - -test_bc_tests:%%BC_TESTS%% - -test_bc_scripts:%%BC_SCRIPT_TESTS%% - -test_bc_stdin: - @sh tests/stdin.sh bc %%BC_TEST_EXEC%% - -test_bc_read: - @sh tests/read.sh bc %%BC_TEST_EXEC%% - -test_bc_errors: - @sh tests/errors.sh bc %%BC_TEST_EXEC%% - -test_bc_other: - @sh tests/other.sh bc %%BC_TEST_EXEC%% - -test_bc_header: - @printf '$(TEST_STARS)\n\nRunning bc tests...\n\n' +test_bc: + %%BC_TEST%% -test_dc: test_dc_header test_dc_tests test_dc_scripts test_dc_stdin test_dc_read test_dc_errors test_dc_other - @printf '\nAll dc tests passed.\n\n$(TEST_STARS)\n' +test_dc: + %%DC_TEST%% -test_dc_tests:%%DC_TESTS%% +time_test: time_test_bc timeconst time_test_dc -test_dc_scripts:%%DC_SCRIPT_TESTS%% +time_test_bc: + %%BC_TIME_TEST%% -test_dc_stdin: - @sh tests/stdin.sh dc %%DC_TEST_EXEC%% - -test_dc_read: - @sh tests/read.sh dc %%DC_TEST_EXEC%% - -test_dc_errors: - @sh tests/errors.sh dc %%DC_TEST_EXEC%% - -test_dc_other: - @sh tests/other.sh dc %%DC_TEST_EXEC%% - -test_dc_header: - @printf '$(TEST_STARS)\n\nRunning dc tests...\n\n' +time_test_dc: + %%DC_TIME_TEST%% timeconst: %%TIMECONST%% -library_test: $(LIBBC) +library_test: library $(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST) test_library: library_test $(BCL_TEST) +valgrind: valgrind_bc valgrind_dc + +valgrind_bc: + %%VG_BC_TEST%% + +valgrind_dc: + %%VG_DC_TEST%% + karatsuba: %%KARATSUBA%% @@ -350,8 +296,6 @@ clean:%%CLEAN_PREREQS%% @$(RM) -f $(BC_LIB2_C) $(BC_LIB2_O) @$(RM) -f $(BC_HELP_C) $(BC_HELP_O) @$(RM) -f $(DC_HELP_C) $(DC_HELP_O) - @$(RM) -fr $(BC_TEST_OUTPUTS) $(DC_TEST_OUTPUTS) - @$(RM) -fr $(BC_FUZZ_OUTPUTS) $(DC_FUZZ_OUTPUTS) clean_config: clean @printf 'Cleaning config...\n' diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 5982defb754c..f4fc2f5779ce 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,40 +1,5 @@ # News -## 3.2.6 - -This is a production release that fixes the build on FreeBSD. - -There was a syntax error in `configure.sh` that the Linux shell did not catch, -and FreeBSD depends on the existence of `tests/all.sh`. - -All users that already upgraded to `3.2.5` should update to this release, with -my apologies for the poor release of `3.2.5`. Other users should skip `3.2.5` in -favor of this version. - -## 3.2.5 - -This is a production release that fixes several bugs and adds a couple small -things. - -The two most important bugs were bugs that causes `dc` to access memory -out-of-bounds (crash in debug builds). This was found by upgrading to `afl++` -from `afl`. Both were caused by a failure to distinguish between the same two -cases. - -Another bug was the failure to put all of the licenses in the `LICENSE.md` file. - -Third, some warnings by `scan-build` were found and eliminated. This needed one -big change: `bc` and `dc` now bail out as fast as possible on fatal errors *** 16957 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Feb 5 21:15: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 E4CBD52A434; Fri, 5 Feb 2021 21:15: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 4DXSqp68SWz4YMG; Fri, 5 Feb 2021 21:15: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 C68A125A29; Fri, 5 Feb 2021 21:15: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 115LFIPc089188; Fri, 5 Feb 2021 21:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115LFIer089187; Fri, 5 Feb 2021 21:15:18 GMT (envelope-from git) Date: Fri, 5 Feb 2021 21:15:18 GMT Message-Id: <202102052115.115LFIer089187@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan Eßer Subject: git: 106efdb060ae - stable/13 - Vendor import of Gavin Howard's bc version 3.2.6 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 106efdb060ae523a88caf5ddc3516500cf5b1d64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:15:19 -0000 The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=106efdb060ae523a88caf5ddc3516500cf5b1d64 commit 106efdb060ae523a88caf5ddc3516500cf5b1d64 Author: Stefan Eßer AuthorDate: 2021-01-31 19:56:48 +0000 Commit: Stefan Eßer CommitDate: 2021-02-05 21:01:25 +0000 Vendor import of Gavin Howard's bc version 3.2.6 (cherry picked from commit 47a52dc4d48f259ab7d9f9ba6b65f4f2331a22dc) Second attempt after revert of a previous commit that affected files with similar names in unrelated directories. Thanks go to Martin Birgmaier for reporting the issue and identifying the cause of git getting confused: files from the root of the vendor files were associated with files in the FreeBSD base root directory. Martin Birgmaier points out that to make this cherry-pick succeed, the option -Xsubtree=contrib/bc has to be passed to prevent files outside that path to be considered. --- contrib/bc/.gitignore | 9 + contrib/bc/LICENSE.md | 52 ++- contrib/bc/Makefile.in | 122 ++++-- contrib/bc/NEWS.md | 35 ++ contrib/bc/NOTICE.md | 2 +- contrib/bc/README.md | 1 + contrib/bc/configure.sh | 348 +++++++++++++++--- contrib/bc/exec-install.sh | 2 +- contrib/bc/functions.sh | 90 +++-- contrib/bc/gen/bc_help.txt | 2 +- contrib/bc/gen/dc_help.txt | 2 +- contrib/bc/gen/lib.bc | 2 +- contrib/bc/gen/lib2.bc | 2 +- contrib/bc/gen/strgen.c | 4 +- contrib/bc/gen/strgen.sh | 4 +- contrib/bc/include/args.h | 2 +- contrib/bc/include/bc.h | 2 +- contrib/bc/include/bcl.h | 2 +- contrib/bc/include/dc.h | 2 +- contrib/bc/include/file.h | 2 +- contrib/bc/include/history.h | 2 +- contrib/bc/include/lang.h | 2 +- contrib/bc/include/lex.h | 2 +- contrib/bc/include/library.h | 2 +- contrib/bc/include/num.h | 4 +- contrib/bc/include/opt.h | 2 +- contrib/bc/include/parse.h | 2 +- contrib/bc/include/program.h | 2 +- contrib/bc/include/rand.h | 31 +- contrib/bc/include/read.h | 2 +- contrib/bc/include/status.h | 14 +- contrib/bc/include/vector.h | 3 +- contrib/bc/include/vm.h | 19 +- contrib/bc/karatsuba.py | 2 +- contrib/bc/link.sh | 2 +- contrib/bc/locale_install.sh | 2 +- contrib/bc/locale_uninstall.sh | 2 +- contrib/bc/locales/de_DE.ISO8859-1.msg | 2 +- contrib/bc/locales/de_DE.UTF-8.msg | 2 +- contrib/bc/locales/en_US.msg | 2 +- contrib/bc/locales/es_ES.ISO8859-1.msg | 2 +- contrib/bc/locales/es_ES.UTF-8.msg | 2 +- contrib/bc/locales/fr_FR.ISO8859-1.msg | 2 +- contrib/bc/locales/fr_FR.UTF-8.msg | 2 +- contrib/bc/locales/ja_JP.UTF-8.msg | 2 +- contrib/bc/locales/ja_JP.eucJP.msg | 2 +- contrib/bc/locales/nl_NL.ISO8859-1.msg | 2 +- contrib/bc/locales/nl_NL.UTF-8.msg | 2 +- contrib/bc/locales/pl_PL.ISO8859-2.msg | 2 +- contrib/bc/locales/pl_PL.UTF-8.msg | 2 +- contrib/bc/locales/pt_PT.ISO8859-1.msg | 2 +- contrib/bc/locales/pt_PT.UTF-8.msg | 2 +- contrib/bc/locales/ru_RU.CP1251.msg | 2 +- contrib/bc/locales/ru_RU.CP866.msg | 2 +- contrib/bc/locales/ru_RU.ISO8859-5.msg | 2 +- contrib/bc/locales/ru_RU.KOI8-R.msg | 2 +- contrib/bc/locales/ru_RU.UTF-8.msg | 2 +- contrib/bc/locales/zh_CN.GB18030.msg | 2 +- contrib/bc/locales/zh_CN.GB2312.msg | 2 +- contrib/bc/locales/zh_CN.GBK.msg | 2 +- contrib/bc/locales/zh_CN.UTF-8.msg | 2 +- contrib/bc/locales/zh_CN.eucCN.msg | 2 +- contrib/bc/manpage.sh | 2 +- contrib/bc/manuals/bc.1.md.in | 7 +- contrib/bc/manuals/bc/A.1 | 8 +- contrib/bc/manuals/bc/A.1.md | 7 +- contrib/bc/manuals/bc/E.1 | 4 +- contrib/bc/manuals/bc/E.1.md | 2 +- contrib/bc/manuals/bc/EH.1 | 4 +- contrib/bc/manuals/bc/EH.1.md | 2 +- contrib/bc/manuals/bc/EHN.1 | 4 +- contrib/bc/manuals/bc/EHN.1.md | 2 +- contrib/bc/manuals/bc/EHNP.1 | 4 +- contrib/bc/manuals/bc/EHNP.1.md | 2 +- contrib/bc/manuals/bc/EHP.1 | 4 +- contrib/bc/manuals/bc/EHP.1.md | 2 +- contrib/bc/manuals/bc/EN.1 | 4 +- contrib/bc/manuals/bc/EN.1.md | 2 +- contrib/bc/manuals/bc/ENP.1 | 4 +- contrib/bc/manuals/bc/ENP.1.md | 2 +- contrib/bc/manuals/bc/EP.1 | 4 +- contrib/bc/manuals/bc/EP.1.md | 2 +- contrib/bc/manuals/bc/H.1 | 8 +- contrib/bc/manuals/bc/H.1.md | 7 +- contrib/bc/manuals/bc/HN.1 | 8 +- contrib/bc/manuals/bc/HN.1.md | 7 +- contrib/bc/manuals/bc/HNP.1 | 8 +- contrib/bc/manuals/bc/HNP.1.md | 7 +- contrib/bc/manuals/bc/HP.1 | 8 +- contrib/bc/manuals/bc/HP.1.md | 7 +- contrib/bc/manuals/bc/N.1 | 8 +- contrib/bc/manuals/bc/N.1.md | 7 +- contrib/bc/manuals/bc/NP.1 | 8 +- contrib/bc/manuals/bc/NP.1.md | 7 +- contrib/bc/manuals/bc/P.1 | 8 +- contrib/bc/manuals/bc/P.1.md | 7 +- contrib/bc/manuals/bcl.3 | 4 +- contrib/bc/manuals/bcl.3.md | 2 +- contrib/bc/manuals/dc.1.md.in | 7 +- contrib/bc/manuals/dc/A.1 | 10 +- contrib/bc/manuals/dc/A.1.md | 7 +- contrib/bc/manuals/dc/E.1 | 4 +- contrib/bc/manuals/dc/E.1.md | 2 +- contrib/bc/manuals/dc/EH.1 | 4 +- contrib/bc/manuals/dc/EH.1.md | 2 +- contrib/bc/manuals/dc/EHN.1 | 4 +- contrib/bc/manuals/dc/EHN.1.md | 2 +- contrib/bc/manuals/dc/EHNP.1 | 4 +- contrib/bc/manuals/dc/EHNP.1.md | 2 +- contrib/bc/manuals/dc/EHP.1 | 4 +- contrib/bc/manuals/dc/EHP.1.md | 2 +- contrib/bc/manuals/dc/EN.1 | 4 +- contrib/bc/manuals/dc/EN.1.md | 2 +- contrib/bc/manuals/dc/ENP.1 | 4 +- contrib/bc/manuals/dc/ENP.1.md | 2 +- contrib/bc/manuals/dc/EP.1 | 4 +- contrib/bc/manuals/dc/EP.1.md | 2 +- contrib/bc/manuals/dc/H.1 | 10 +- contrib/bc/manuals/dc/H.1.md | 7 +- contrib/bc/manuals/dc/HN.1 | 10 +- contrib/bc/manuals/dc/HN.1.md | 7 +- contrib/bc/manuals/dc/HNP.1 | 10 +- contrib/bc/manuals/dc/HNP.1.md | 7 +- contrib/bc/manuals/dc/HP.1 | 10 +- contrib/bc/manuals/dc/HP.1.md | 7 +- contrib/bc/manuals/dc/N.1 | 10 +- contrib/bc/manuals/dc/N.1.md | 7 +- contrib/bc/manuals/dc/NP.1 | 10 +- contrib/bc/manuals/dc/NP.1.md | 7 +- contrib/bc/manuals/dc/P.1 | 10 +- contrib/bc/manuals/dc/P.1.md | 7 +- contrib/bc/manuals/header.txt | 2 +- contrib/bc/manuals/header_bc.txt | 2 +- contrib/bc/manuals/header_bcl.txt | 2 +- contrib/bc/manuals/header_dc.txt | 2 +- contrib/bc/release.sh | 18 +- contrib/bc/src/args.c | 2 +- contrib/bc/src/bc.c | 2 +- contrib/bc/src/bc_lex.c | 2 +- contrib/bc/src/bc_parse.c | 2 +- contrib/bc/src/data.c | 4 +- contrib/bc/src/dc.c | 2 +- contrib/bc/src/dc_lex.c | 6 +- contrib/bc/src/dc_parse.c | 2 +- contrib/bc/src/file.c | 4 +- contrib/bc/src/history.c | 15 +- contrib/bc/src/lang.c | 14 +- contrib/bc/src/lex.c | 4 +- contrib/bc/src/library.c | 12 +- contrib/bc/src/main.c | 13 +- contrib/bc/src/num.c | 10 +- contrib/bc/src/opt.c | 2 +- contrib/bc/src/parse.c | 8 +- contrib/bc/src/program.c | 31 +- contrib/bc/src/rand.c | 42 +-- contrib/bc/src/read.c | 6 +- contrib/bc/src/vector.c | 8 +- contrib/bc/src/vm.c | 86 ++++- contrib/bc/tests/afl.py | 22 +- contrib/bc/tests/all.sh | 191 +--------- contrib/bc/tests/bc/all.txt | 6 +- contrib/bc/tests/bc/scripts/all.txt | 15 + contrib/bc/tests/bc/timeconst.sh | 9 +- contrib/bc/tests/bcl.c | 2 +- contrib/bc/tests/dc/errors/30.txt | 1 + contrib/bc/tests/dc/errors/31.txt | 1 + contrib/bc/tests/dc/scripts/all.txt | 9 + contrib/bc/tests/diff.sh | 51 +++ contrib/bc/tests/errors.sh | 20 +- contrib/bc/tests/extra_required.txt | 7 + contrib/bc/tests/fuzzing/bc.dict | 68 ++++ contrib/bc/tests/fuzzing/bc_inputs1/abs.txt | 7 + contrib/bc/tests/fuzzing/bc_inputs1/add.txt | 146 ++++++++ contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt | 26 ++ contrib/bc/tests/fuzzing/bc_inputs1/array.bc | 60 +++ contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt | 10 + .../bc/tests/fuzzing/bc_inputs1/assignments.txt | 122 ++++++ contrib/bc/tests/fuzzing/bc_inputs1/basic.txt | 7 + contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt | 184 ++++++++++ contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt | 44 +++ contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt | 35 ++ contrib/bc/tests/fuzzing/bc_inputs1/divide.txt | 31 ++ .../bc/tests/fuzzing/bc_inputs1/engineering.txt | 19 + contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt | 22 ++ contrib/bc/tests/fuzzing/bc_inputs1/functions.bc | 7 + contrib/bc/tests/fuzzing/bc_inputs1/functions.txt | 13 + contrib/bc/tests/fuzzing/bc_inputs1/globals.txt | 21 ++ contrib/bc/tests/fuzzing/bc_inputs1/len.bc | 48 +++ contrib/bc/tests/fuzzing/bc_inputs1/length.txt | 59 +++ contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt | 15 + contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt | 6 + contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt | 10 + contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt | 5 + contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt | 12 + contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib23.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/lib24.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs2/log.txt | 22 ++ contrib/bc/tests/fuzzing/bc_inputs2/misc.txt | 13 + contrib/bc/tests/fuzzing/bc_inputs2/misc1.txt | 76 ++++ contrib/bc/tests/fuzzing/bc_inputs2/misc2.txt | 110 ++++++ contrib/bc/tests/fuzzing/bc_inputs2/misc3.txt | 12 + contrib/bc/tests/fuzzing/bc_inputs2/modulus.txt | 69 ++++ contrib/bc/tests/fuzzing/bc_inputs2/multiply.txt | 40 ++ contrib/bc/tests/fuzzing/bc_inputs2/pi.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs2/places.txt | 19 + contrib/bc/tests/fuzzing/bc_inputs2/power.txt | 44 +++ contrib/bc/tests/fuzzing/bc_inputs2/print2.txt | 194 ++++++++++ contrib/bc/tests/fuzzing/bc_inputs2/references.bc | 408 +++++++++++++++++++++ contrib/bc/tests/fuzzing/bc_inputs2/scale.txt | 57 +++ contrib/bc/tests/fuzzing/bc_inputs2/scientific.txt | 51 +++ contrib/bc/tests/fuzzing/bc_inputs2/shift.txt | 281 ++++++++++++++ contrib/bc/tests/fuzzing/bc_inputs2/sine.txt | 207 +++++++++++ contrib/bc/tests/fuzzing/bc_inputs3/01.txt | 339 +++++++++++++++++ contrib/bc/tests/fuzzing/bc_inputs3/02.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/03.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs3/04.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/05.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/06.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/07.txt | 8 + contrib/bc/tests/fuzzing/bc_inputs3/08.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs3/09.txt | 11 + contrib/bc/tests/fuzzing/bc_inputs3/10.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/11.txt | 99 +++++ contrib/bc/tests/fuzzing/bc_inputs3/12.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs3/13.txt | 56 +++ contrib/bc/tests/fuzzing/bc_inputs3/14.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/15.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs3/16.txt | 1 + contrib/bc/tests/fuzzing/bc_inputs3/17.txt | 11 + contrib/bc/tests/fuzzing/bc_inputs3/18.txt | 3 + contrib/bc/tests/fuzzing/bc_inputs3/19.txt | 5 + contrib/bc/tests/fuzzing/bc_inputs3/20.txt | 51 +++ contrib/bc/tests/fuzzing/bc_inputs3/21.txt | 10 + contrib/bc/tests/fuzzing/bc_inputs3/22.txt | 2 + contrib/bc/tests/fuzzing/bc_inputs3/23.txt | Bin 0 -> 1024 bytes contrib/bc/tests/fuzzing/bc_inputs3/24.txt | 4 + contrib/bc/tests/fuzzing/bc_inputs3/sqrt.txt | 14 + contrib/bc/tests/fuzzing/bc_inputs3/strings.txt | 12 + contrib/bc/tests/fuzzing/bc_inputs3/subtract.txt | 153 ++++++++ contrib/bc/tests/fuzzing/bc_inputs3/trunc.txt | 15 + contrib/bc/tests/fuzzing/bc_inputs3/void.txt | 20 + contrib/bc/tests/fuzzing/dc_inputs/01.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/02.txt | 5 + contrib/bc/tests/fuzzing/dc_inputs/03.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/04.txt | 9 + contrib/bc/tests/fuzzing/dc_inputs/05.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/06.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/07.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/08.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/09.txt | 9 + contrib/bc/tests/fuzzing/dc_inputs/10.txt | 11 + contrib/bc/tests/fuzzing/dc_inputs/11.txt | 4 + contrib/bc/tests/fuzzing/dc_inputs/12.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/13.txt | 7 + contrib/bc/tests/fuzzing/dc_inputs/14.txt | 7 + contrib/bc/tests/fuzzing/dc_inputs/15.txt | 11 + contrib/bc/tests/fuzzing/dc_inputs/16.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/17.txt | 20 + contrib/bc/tests/fuzzing/dc_inputs/18.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/19.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/20.txt | 3 + contrib/bc/tests/fuzzing/dc_inputs/21.txt | 5 + contrib/bc/tests/fuzzing/dc_inputs/22.txt | 36 ++ contrib/bc/tests/fuzzing/dc_inputs/23.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/24.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/25.txt | 6 + contrib/bc/tests/fuzzing/dc_inputs/26.txt | 155 ++++++++ contrib/bc/tests/fuzzing/dc_inputs/27.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/28.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/29.txt | 13 + contrib/bc/tests/fuzzing/dc_inputs/30.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/31.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/abs.txt | 7 + contrib/bc/tests/fuzzing/dc_inputs/add.txt | 33 ++ contrib/bc/tests/fuzzing/dc_inputs/array.dc | 2 + contrib/bc/tests/fuzzing/dc_inputs/boolean.txt | 80 ++++ contrib/bc/tests/fuzzing/dc_inputs/decimal.txt | 36 ++ contrib/bc/tests/fuzzing/dc_inputs/divide.txt | 33 ++ contrib/bc/tests/fuzzing/dc_inputs/divmod.txt | 64 ++++ contrib/bc/tests/fuzzing/dc_inputs/else.dc | 4 + contrib/bc/tests/fuzzing/dc_inputs/engineering.txt | 19 + contrib/bc/tests/fuzzing/dc_inputs/loop.dc | 3 + contrib/bc/tests/fuzzing/dc_inputs/misc.txt | 1 + contrib/bc/tests/fuzzing/dc_inputs/modexp.txt | 103 ++++++ contrib/bc/tests/fuzzing/dc_inputs/modulus.txt | 70 ++++ contrib/bc/tests/fuzzing/dc_inputs/multiply.txt | 42 +++ contrib/bc/tests/fuzzing/dc_inputs/places.txt | 14 + contrib/bc/tests/fuzzing/dc_inputs/power.txt | 36 ++ contrib/bc/tests/fuzzing/dc_inputs/quit.dc | 2 + contrib/bc/tests/fuzzing/dc_inputs/scientific.txt | 51 +++ contrib/bc/tests/fuzzing/dc_inputs/shift.txt | 42 +++ contrib/bc/tests/fuzzing/dc_inputs/sqrt.txt | 14 + contrib/bc/tests/fuzzing/dc_inputs/stdin.txt | 205 +++++++++++ contrib/bc/tests/fuzzing/dc_inputs/stream.dc | 2 + contrib/bc/tests/fuzzing/dc_inputs/strings.txt | 50 +++ contrib/bc/tests/fuzzing/dc_inputs/subtract.txt | 33 ++ contrib/bc/tests/fuzzing/dc_inputs/trunc.txt | 11 + contrib/bc/tests/fuzzing/dc_inputs/vars.txt | 2 + contrib/bc/tests/fuzzing/dc_inputs/weird.dc | 2 + contrib/bc/tests/other.sh | 271 ++++++++++++++ contrib/bc/tests/radamsa.sh | 2 +- contrib/bc/tests/randmath.py | 2 +- contrib/bc/tests/read.sh | 23 +- contrib/bc/tests/script.sh | 26 +- contrib/bc/tests/scripts.sh | 9 +- contrib/bc/tests/stdin.sh | 23 +- contrib/bc/tests/test.sh | 32 +- 320 files changed, 6246 insertions(+), 712 deletions(-) diff --git a/contrib/bc/.gitignore b/contrib/bc/.gitignore index fb9bc5ab6aa2..5c2bbae866c0 100644 --- a/contrib/bc/.gitignore +++ b/contrib/bc/.gitignore @@ -34,6 +34,13 @@ config.mak timeconst.bc Makefile +tests/fuzzing/bc_outputs1/* +tests/fuzzing/bc_outputs2/* +tests/fuzzing/bc_outputs3/* +tests/fuzzing/dc_outputs/* +tests/bc_outputs/* +tests/dc_outputs/* + .gdb_history # Ignore the generated test files @@ -57,5 +64,7 @@ perf.data.old *.html *.profraw +core.* + cscope*.out tags diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md index 1681a053e0de..269e131cc81d 100644 --- a/contrib/bc/LICENSE.md +++ b/contrib/bc/LICENSE.md @@ -1,6 +1,6 @@ # License -Copyright (c) 2018-2020 Gavin D. Howard +Copyright (c) 2018-2021 Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -31,7 +31,7 @@ copyrights and license: Copyright (c) 2010-2014, Salvatore Sanfilippo
Copyright (c) 2010-2013, Pieter Noordhuis
Copyright (c) 2018 rain-1
-Copyright (c) 2018-2020, Gavin D. Howard +Copyright (c) 2018-2021, Gavin D. Howard Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -53,3 +53,51 @@ 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. + +## Rand + +The files `src/rand.c` and `include/rand.h` are under the following copyrights +and license: + +Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors +Copyright (c) 2018-2021 Gavin D. Howard + +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: + +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. + +## `safe-install.sh` + +The file `safe-install.sh` is under the following copyright and license: + +Copyright (c) 2021 Rich Felker + +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: + +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. diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index d17e74163397..8ae982bd99fe 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.2.4 +VERSION = 3.2.6 SRC = %%SRC%% OBJ = %%OBJ%% @@ -41,6 +41,13 @@ BC_ENABLED = %%BC_ENABLED%% DC_ENABLED_NAME = DC_ENABLED DC_ENABLED = %%DC_ENABLED%% +HEADERS = include/args.h include/file.h include/lang.h include/lex.h include/num.h include/opt.h include/parse.h include/program.h include/read.h include/status.h include/vector.h include/vm.h +BC_HEADERS = include/bc.h +DC_HEADERS = include/dc.h +HISTORY_HEADERS = include/history.h +EXTRA_MATH_HEADERS = include/rand.h +LIBRARY_HEADERS = include/bcl.h include/library.h + GEN_DIR = gen GEN = %%GEN%% GEN_EXEC = $(GEN_DIR)/$(GEN) @@ -82,6 +89,11 @@ DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) +BC_TEST_OUTPUTS = tests/bc_outputs +BC_FUZZ_OUTPUTS = tests/fuzzing/bc_outputs1 tests/fuzzing/bc_outputs2 tests/fuzzing/bc_outputs3 +DC_TEST_OUTPUTS = tests/dc_outputs +DC_FUZZ_OUTPUTS = tests/fuzzing/dc_outputs + LIB = libbcl LIB_NAME = $(LIB).a LIBBC = $(BIN)/$(LIB_NAME) @@ -125,6 +137,9 @@ BC_ENABLE_NLS = %%NLS%% BC_ENABLE_PROMPT = %%PROMPT%% BC_LONG_BIT = %%LONG_BIT%% +BC_ENABLE_AFL = %%FUZZ%% +BC_ENABLE_MEMCHECK = %%MEMCHECK%% + RM = rm MKDIR = mkdir @@ -138,6 +153,8 @@ LOCALE_UNINSTALL = ./locale_uninstall.sh VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all +TEST_STARS = "***********************************************************************" + BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%% CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) @@ -147,7 +164,8 @@ CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) -CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) +CPPFLAGS8 = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) +CPPFLAGS = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL) CFLAGS = $(CPPFLAGS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% @@ -159,20 +177,15 @@ HOSTCC = %%HOSTCC%% BC_LIB_C_ARGS = bc_lib bc_lib_name $(BC_ENABLED_NAME) 1 BC_LIB2_C_ARGS = bc_lib2 bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 -OBJS = $(BC_HELP_O) $(DC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) -OBJ_TARGETS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +OBJS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) -.c.o: - $(CC) $(CFLAGS) -o $@ -c $< - -all: %%ALL_PREREQ%% +all: %%DEFAULT_TARGET%% -execs: make_bin $(OBJ_TARGETS) - $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC) - %%LINK%% +%%DEFAULT_TARGET%%: %%DEFAULT_TARGET_PREREQS%% + %%DEFAULT_TARGET_CMD%% -library: make_bin $(OBJ) $(BC_LIB_O) $(BC_LIB2_O) - ar -r -cu $(LIBBC) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +%%SECOND_TARGET%%: %%SECOND_TARGET_PREREQS%% + %%SECOND_TARGET_CMD%% $(GEN_EXEC): %%GEN_EXEC_TARGET%% @@ -180,18 +193,32 @@ $(GEN_EXEC): $(BC_LIB_C): $(GEN_EXEC) $(BC_LIB) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_LIB_C_ARGS) +$(BC_LIB_O): $(BC_LIB_C) + $(CC) $(CFLAGS) -o $@ -c $< + $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS) +$(BC_LIB2_O): $(BC_LIB2_C) + $(CC) $(CFLAGS) -o $@ -c $< + $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME) +$(BC_HELP_O): $(BC_HELP_C) + $(CC) $(CFLAGS) -o $@ -c $< + $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME) -make_bin: +$(DC_HELP_O): $(DC_HELP_C) + $(CC) $(CFLAGS) -o $@ -c $< + +$(BIN): $(MKDIR) -p $(BIN) +headers: %%HEADERS%% + help: @printf 'available targets:\n' @printf '\n' @@ -222,41 +249,68 @@ help: @printf ' valgrind_dc runs the dc test suite, if dc has been built,\n' @printf ' through valgrind\n' +run_all_tests: + %%BC_ALL_TESTS%% + %%TIMECONST_ALL_TESTS%% + %%DC_ALL_TESTS%% + check: test test: %%TESTS%% -test_bc: - %%BC_TEST%% +test_bc: test_bc_header test_bc_tests test_bc_scripts test_bc_stdin test_bc_read test_bc_errors test_bc_other + @printf '\nAll bc tests passed.\n\n$(TEST_STARS)\n' + +test_bc_tests:%%BC_TESTS%% + +test_bc_scripts:%%BC_SCRIPT_TESTS%% + +test_bc_stdin: + @sh tests/stdin.sh bc %%BC_TEST_EXEC%% + +test_bc_read: + @sh tests/read.sh bc %%BC_TEST_EXEC%% + +test_bc_errors: + @sh tests/errors.sh bc %%BC_TEST_EXEC%% + +test_bc_other: + @sh tests/other.sh bc %%BC_TEST_EXEC%% + +test_bc_header: + @printf '$(TEST_STARS)\n\nRunning bc tests...\n\n' -test_dc: - %%DC_TEST%% +test_dc: test_dc_header test_dc_tests test_dc_scripts test_dc_stdin test_dc_read test_dc_errors test_dc_other + @printf '\nAll dc tests passed.\n\n$(TEST_STARS)\n' -time_test: time_test_bc timeconst time_test_dc +test_dc_tests:%%DC_TESTS%% -time_test_bc: - %%BC_TIME_TEST%% +test_dc_scripts:%%DC_SCRIPT_TESTS%% -time_test_dc: - %%DC_TIME_TEST%% +test_dc_stdin: + @sh tests/stdin.sh dc %%DC_TEST_EXEC%% + +test_dc_read: + @sh tests/read.sh dc %%DC_TEST_EXEC%% + +test_dc_errors: + @sh tests/errors.sh dc %%DC_TEST_EXEC%% + +test_dc_other: + @sh tests/other.sh dc %%DC_TEST_EXEC%% + +test_dc_header: + @printf '$(TEST_STARS)\n\nRunning dc tests...\n\n' timeconst: %%TIMECONST%% -library_test: library +library_test: $(LIBBC) $(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST) test_library: library_test $(BCL_TEST) -valgrind: valgrind_bc valgrind_dc - -valgrind_bc: - %%VG_BC_TEST%% - -valgrind_dc: - %%VG_DC_TEST%% - karatsuba: %%KARATSUBA%% @@ -296,6 +350,8 @@ clean:%%CLEAN_PREREQS%% @$(RM) -f $(BC_LIB2_C) $(BC_LIB2_O) @$(RM) -f $(BC_HELP_C) $(BC_HELP_O) @$(RM) -f $(DC_HELP_C) $(DC_HELP_O) + @$(RM) -fr $(BC_TEST_OUTPUTS) $(DC_TEST_OUTPUTS) + @$(RM) -fr $(BC_FUZZ_OUTPUTS) $(DC_FUZZ_OUTPUTS) clean_config: clean @printf 'Cleaning config...\n' diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index f4fc2f5779ce..5982defb754c 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,40 @@ # News +## 3.2.6 + +This is a production release that fixes the build on FreeBSD. + +There was a syntax error in `configure.sh` that the Linux shell did not catch, +and FreeBSD depends on the existence of `tests/all.sh`. + +All users that already upgraded to `3.2.5` should update to this release, with +my apologies for the poor release of `3.2.5`. Other users should skip `3.2.5` in +favor of this version. + +## 3.2.5 + +This is a production release that fixes several bugs and adds a couple small +things. + +The two most important bugs were bugs that causes `dc` to access memory +out-of-bounds (crash in debug builds). This was found by upgrading to `afl++` +from `afl`. Both were caused by a failure to distinguish between the same two +cases. + +Another bug was the failure to put all of the licenses in the `LICENSE.md` file. + +Third, some warnings by `scan-build` were found and eliminated. This needed one +big change: `bc` and `dc` now bail out as fast as possible on fatal errors +instead of unwinding the stack. + +Fourth, the pseudo-random number now attempts to seed itself with `/dev/random` +if `/dev/urandom` fails. + +Finally, this release has a few quality-of-life changes to the build system. The +usage should not change at all; the only thing that changed was making sure the +`Makefile.in` was written to rebuild properly when headers changed and to not +rebuild when not necessary. + ## 3.2.4 This is a production release that fixes a warning on `gcc` 6 or older, which diff --git a/contrib/bc/NOTICE.md b/contrib/bc/NOTICE.md index 92117daa9a6c..56d2935ab4b3 100644 --- a/contrib/bc/NOTICE.md +++ b/contrib/bc/NOTICE.md @@ -1,6 +1,6 @@ # Notice -Copyright 2018-2020 Gavin D. Howard and contributors. +Copyright 2018-2021 Gavin D. Howard and contributors. ## Contributors diff --git a/contrib/bc/README.md b/contrib/bc/README.md index 6f3c3f252cbc..beda88d23f90 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -39,6 +39,7 @@ Systems that are known to work: * Mac OSX * Solaris* (as long as the Solaris version supports POSIX 2008) * AIX +* HP-UX* (except for history) Please submit bug reports if this `bc` does not build out of the box on any system besides Windows. If Windows binaries are needed, they can be found at diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh index b6caf3debba3..ae1675cde97d 100755 --- a/contrib/bc/configure.sh +++ b/contrib/bc/configure.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -33,6 +33,8 @@ script=$(basename "$script") . "$scriptdir/functions.sh" +cd "$scriptdir" + usage() { if [ $# -gt 0 ]; then @@ -48,7 +50,7 @@ usage() { printf 'usage:\n' printf ' %s -h\n' "$script" printf ' %s --help\n' "$script" - printf ' %s [-a|-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" + printf ' %s [-a|-bD|-dB|-c] [-CEfgGHlmMNPtTvz] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" printf ' %s \\\n' "$script" printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage]\\\n' printf ' [--force --debug --disable-extra-math --disable-generated-tests] \\\n' @@ -73,6 +75,8 @@ usage() { printf ' Generate test coverage code. Requires gcov and regcovr.\n' printf ' It is an error if either "-b" ("-D") or "-d" ("-B") is specified.\n' printf ' Requires a compiler that use gcc-compatible coverage options\n' + printf ' -C, --disable-clean\n' + printf ' Disable the clean that configure.sh does before configure.\n' printf ' -d, --dc-only\n' printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or\n' printf ' "--disable-dc" are specified too.\n' @@ -107,6 +111,8 @@ usage() { printf ' Installs all locales, regardless of how many are on the system. This\n' printf ' option is useful for package maintainers who want to make sure that\n' printf ' a package contains all of the locales that end users might need.\n' + printf ' -m, --enable-memcheck\n' + printf ' Enable memcheck mode, to ensure no memory leaks. For development only.\n' printf ' -M, --disable-man-pages\n' printf ' Disable installing manpages.\n' printf ' -N, --disable-nls\n' @@ -119,9 +125,15 @@ usage() { printf ' Disables the prompt in the built bc. The prompt will never show up,\n' printf ' or in other words, it will be permanently disabled and cannot be\n' printf ' enabled.\n' + printf ' -t, --enable-test-timing\n' + printf ' Enable the timing of tests. This is for development only.\n' printf ' -T, --disable-strip\n' printf ' Disable stripping symbols from the compiled binary or binaries.\n' printf ' Stripping symbols only happens when debug mode is off.\n' + printf ' -v, --enable-valgrind\n' + printf ' Enable a build appropriate for valgrind. For development only.\n' + printf ' -z, --enable-fuzz-mode\n' + printf ' Enable fuzzing mode. THIS IS FOR DEVELOPMENT ONLY.\n' printf ' --prefix PREFIX\n' printf ' The prefix to install to. Overrides "$PREFIX" if it exists.\n' printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' @@ -277,6 +289,23 @@ replace() { substring_replace "$_replace_str" "%%$_replace_needle%%" "$_replace_replacement" } +find_src_files() { + + if [ "$#" -ge 1 ] && [ "$1" != "" ]; then + + while [ "$#" -ge 1 ]; do + _find_src_files_a="${1## }" + shift + _find_src_files_args="$_find_src_files_args ! -path src/${_find_src_files_a}" + done + + else + _find_src_files_args="-print" + fi + + printf '%s\n' $(find src/ -depth -name "*.c" $_find_src_files_args) +} + gen_file_list() { if [ "$#" -lt 1 ]; then @@ -291,15 +320,9 @@ gen_file_list() { cd "$scriptdir" if [ "$#" -ge 1 ]; then - - while [ "$#" -ge 1 ]; do - a="$1" - shift - args="$args ! -path src/${a}" - done - + _gen_file_list_unneeded="$@" else - args="-print" + _gen_file_list_unneeded="" fi _gen_file_list_needle_src="SRC" @@ -307,7 +330,7 @@ gen_file_list() { _gen_file_list_needle_gcda="GCDA" _gen_file_list_needle_gcno="GCNO" - _gen_file_list_replacement=$(find src/ -depth -name "*.c" $args | tr '\n' ' ') + _gen_file_list_replacement=$(find_src_files $_gen_file_list_unneeded | tr '\n' ' ') _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ "$_gen_file_list_needle_src" "$_gen_file_list_replacement") @@ -328,6 +351,101 @@ gen_file_list() { printf '%s\n' "$_gen_file_list_contents" } +gen_tests() { + + _gen_tests_name="$1" + shift + + _gen_tests_uname="$1" + shift + + _gen_tests_extra_math="$1" + shift + + _gen_tests_time_tests="$1" + shift + + _gen_tests_extra_required=$(cat tests/extra_required.txt) + + for _gen_tests_t in $(cat "$scriptdir/tests/$_gen_tests_name/all.txt"); do + + if [ "$_gen_tests_extra_math" -eq 0 ]; then + + if [ -z "${_gen_tests_extra_required##*$_gen_tests_t*}" ]; then + printf 'test_%s_%s:\n\t@printf "Skipping %s %s\\n"\n\n' \ + "$_gen_tests_name" "$_gen_tests_t" "$_gen_tests_name" \ + "$_gen_tests_t" >> "$scriptdir/Makefile" + continue + fi + + fi + + printf 'test_%s_%s:\n\t@sh tests/test.sh %s %s %s %s %s\n\n' \ + "$_gen_tests_name" "$_gen_tests_t" "$_gen_tests_name" \ + "$_gen_tests_t" "$generate_tests" "$time_tests" \ + "$*" >> "$scriptdir/Makefile" + + done +} + +gen_test_targets() { + + _gen_test_targets_name="$1" + shift + + _gen_test_targets_tests=$(cat "$scriptdir/tests/${_gen_test_targets_name}/all.txt") + + for _gen_test_targets_t in $_gen_test_targets_tests; do + printf ' test_%s_%s' "$_gen_test_targets_name" "$_gen_test_targets_t" + done + + printf '\n' +} + +gen_script_tests() { + + _gen_script_tests_name="$1" + shift + + _gen_script_tests_extra_math="$1" + shift + + _gen_script_tests_generate="$1" + shift + + _gen_script_tests_time="$1" + shift + + _gen_script_tests_tests=$(cat "$scriptdir/tests/$_gen_script_tests_name/scripts/all.txt") + + for _gen_script_tests_f in $_gen_script_tests_tests; do + + _gen_script_tests_b=$(basename "$_gen_script_tests_f" ".${_gen_script_tests_name}") + + printf 'test_%s_script_%s:\n\t@sh tests/script.sh %s %s %s 1 %s %s %s\n\n' \ + "$_gen_script_tests_name" "$_gen_script_tests_b" "$_gen_script_tests_name" \ + "$_gen_script_tests_f" "$_gen_script_tests_extra_math" "$_gen_script_tests_generate" \ + "$_gen_script_tests_time" "$*" >> "$scriptdir/Makefile" + done +} + +gen_script_test_targets() { + + _gen_script_test_targets_name="$1" + shift + + _gen_script_test_targets_tests=$(cat "$scriptdir/tests/$_gen_script_test_targets_name/scripts/all.txt") + + for _gen_script_test_targets_f in $_gen_script_test_targets_tests; do + _gen_script_test_targets_b=$(basename "$_gen_script_test_targets_f" \ + ".$_gen_script_test_targets_name") + printf ' test_%s_script_%s' "$_gen_script_test_targets_name" \ + "$_gen_script_test_targets_b" + done + + printf '\n' +} + bc_only=0 dc_only=0 coverage=0 @@ -344,14 +462,20 @@ force=0 strip_bin=1 all_locales=0 library=0 +fuzz=0 +time_tests=0 +vg=0 +memcheck=0 +clean=1 -while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do +while getopts "abBcdDEfgGhHk:lMmNO:PStTvz-" opt; do case "$opt" in a) library=1 ;; b) bc_only=1 ;; B) dc_only=1 ;; c) coverage=1 ;; + C) clean=0 ;; d) dc_only=1 ;; *** 10727 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Feb 5 21: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 29F5352A69B; Fri, 5 Feb 2021 21: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 4DXSrY2qNPz4Z3C; Fri, 5 Feb 2021 21:15: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 2E447259A2; Fri, 5 Feb 2021 21:15: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 115LFvdv089403; Fri, 5 Feb 2021 21:15:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115LFvRT089402; Fri, 5 Feb 2021 21:15:57 GMT (envelope-from git) Date: Fri, 5 Feb 2021 21:15:57 GMT Message-Id: <202102052115.115LFvRT089402@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: 92d0d6bb14d2 - main - Print DeviceHandle and PhysicalId in hex. 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: 92d0d6bb14d24abea0786edf546af316ff4a2afe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:15:59 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=92d0d6bb14d24abea0786edf546af316ff4a2afe commit 92d0d6bb14d24abea0786edf546af316ff4a2afe Author: Alexander Motin AuthorDate: 2021-02-05 21:13:55 +0000 Commit: Alexander Motin CommitDate: 2021-02-05 21:15:53 +0000 Print DeviceHandle and PhysicalId in hex. The first is actually a bitfield. The second is printed in hex by dmidecode, so uniformidy should be good. MFC after: 1 week --- usr.sbin/acpi/acpidump/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 2753fb26bdd9..adb5b968f441 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1615,8 +1615,8 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit) break; case ACPI_NFIT_TYPE_MEMORY_MAP: mmap = (ACPI_NFIT_MEMORY_MAP *)nfit; - printf("\tDeviceHandle=%u\n", (u_int)mmap->DeviceHandle); - printf("\tPhysicalId=%u\n", (u_int)mmap->PhysicalId); + printf("\tDeviceHandle=0x%x\n", (u_int)mmap->DeviceHandle); + printf("\tPhysicalId=0x%04x\n", (u_int)mmap->PhysicalId); printf("\tRegionId=%u\n", (u_int)mmap->RegionId); printf("\tRangeIndex=%u\n", (u_int)mmap->RangeIndex); printf("\tRegionIndex=%u\n", (u_int)mmap->RegionIndex); From owner-dev-commits-src-all@freebsd.org Fri Feb 5 23:40: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 1323552D275; Fri, 5 Feb 2021 23:40: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 4DXX3800G8z4hxb; Fri, 5 Feb 2021 23:40: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 E299F2717A; Fri, 5 Feb 2021 23:40: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 115NeJt0078358; Fri, 5 Feb 2021 23:40:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115NeJmE078351; Fri, 5 Feb 2021 23:40:19 GMT (envelope-from git) Date: Fri, 5 Feb 2021 23:40:19 GMT Message-Id: <202102052340.115NeJmE078351@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: b54ed778fe45 - main - cache: comment on FNV 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: b54ed778fe45d482bd1e2009df802fda26f94495 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:40:20 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b54ed778fe45d482bd1e2009df802fda26f94495 commit b54ed778fe45d482bd1e2009df802fda26f94495 Author: Mateusz Guzik AuthorDate: 2021-02-03 20:44:54 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-05 23:13:57 +0000 cache: comment on FNV --- sys/kern/vfs_cache.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index db482ea4eba3..47abe0feb152 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -704,9 +704,31 @@ out: SDT_PROBE1(vfs, namecache, purge, batch, i); } +/* + * Hashing. + * + * The code was made to use FNV in 2001 and this choice needs to be revisited. + * + * Short summary of the difficulty: + * The longest name which can be inserted is NAME_MAX characters in length (or + * 255 at the time of writing this comment), while majority of names used in + * practice are significantly shorter (mostly below 10). More importantly + * majority of lookups performed find names are even shorter than that. + * + * This poses a problem where hashes which do better than FNV past word size + * (or so) tend to come with additional overhead when finalizing the result, + * making them noticeably slower for the most commonly used range. + * + * Consider a path like: /usr/obj/usr/src/sys/amd64/GENERIC/vnode_if.c + * + * When looking it up the most time consuming part by a large margin (at least + * on amd64) is hashing. Replacing FNV with something which pessimizes short + * input would make the slowest part stand out even more. + */ + /* * TODO: With the value stored we can do better than computing the hash based - * on the address. The choice of FNV should also be revisited. + * on the address. */ static void cache_prehash(struct vnode *vp) From owner-dev-commits-src-all@freebsd.org Fri Feb 5 23:40: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 1D09E52D58A; Fri, 5 Feb 2021 23:40: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 4DXX390BLBz4hxd; Fri, 5 Feb 2021 23:40: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 EDD1B26E76; Fri, 5 Feb 2021 23:40: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 115NeK30078815; Fri, 5 Feb 2021 23:40:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115NeKSg078812; Fri, 5 Feb 2021 23:40:20 GMT (envelope-from git) Date: Fri, 5 Feb 2021 23:40:20 GMT Message-Id: <202102052340.115NeKSg078812@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: 2e96132a7d8b - main - cache: drop spurious arg from panic in cache_validate 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: 2e96132a7d8bbb2347a3b4776806324f984aa49f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:40:21 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2e96132a7d8bbb2347a3b4776806324f984aa49f commit 2e96132a7d8bbb2347a3b4776806324f984aa49f Author: Mateusz Guzik AuthorDate: 2021-02-05 22:49:59 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-05 23:28:39 +0000 cache: drop spurious arg from panic in cache_validate vp is already reported when noting mismatch --- sys/kern/vfs_cache.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 47abe0feb152..5cfc23779c42 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -2824,9 +2824,8 @@ cache_validate(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) { if (ncp->nc_vp != vp) - panic("%s: mismatch (%p != %p); ncp %p [%s] dvp %p vp %p\n", - __func__, vp, ncp->nc_vp, ncp, ncp->nc_name, ncp->nc_dvp, - ncp->nc_vp); + panic("%s: mismatch (%p != %p); ncp %p [%s] dvp %p\n", + __func__, vp, ncp->nc_vp, ncp, ncp->nc_name, ncp->nc_dvp); } } mtx_unlock(blp); From owner-dev-commits-src-all@freebsd.org Fri Feb 5 23:40: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 E9A3252D526; Fri, 5 Feb 2021 23:40: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 4DXX3C4HC8z4hxv; Fri, 5 Feb 2021 23:40: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 49F8B27608; Fri, 5 Feb 2021 23:40: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 115NeNDu079167; Fri, 5 Feb 2021 23:40:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115NeNTi079166; Fri, 5 Feb 2021 23:40:23 GMT (envelope-from git) Date: Fri, 5 Feb 2021 23:40:23 GMT Message-Id: <202102052340.115NeNTi079166@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: 2f8a84463531 - main - cache: remove the largely obsolete general description 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: 2f8a844635312b0f25028a87459fdd2d2a1cbfd6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:40:24 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2f8a844635312b0f25028a87459fdd2d2a1cbfd6 commit 2f8a844635312b0f25028a87459fdd2d2a1cbfd6 Author: Mateusz Guzik AuthorDate: 2021-02-05 23:16:55 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-05 23:28:40 +0000 cache: remove the largely obsolete general description Examples of inconsistencies with the current state: - references LRU of all entries, removed years ago - references a non-existent lock (neglist) - claims negative entries have a NULL target It will be replaced with a more accurate and more informative description. In the meantime take it out so it stops misleading. --- sys/kern/vfs_cache.c | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 50ec6face6ac..21eb436681fc 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -276,52 +276,6 @@ cache_ncp_invalidate(struct namecache *ncp) __predict_true((_nc_flag & (NCF_INVALID | NCF_WIP | NCF_WHITE)) == 0); \ }) -/* - * Name caching works as follows: - * - * Names found by directory scans are retained in a cache - * for future reference. It is managed LRU, so frequently - * used names will hang around. Cache is indexed by hash value - * obtained from (dvp, name) where dvp refers to the directory - * containing name. - * - * If it is a "negative" entry, (i.e. for a name that is known NOT to - * exist) the vnode pointer will be NULL. - * - * Upon reaching the last segment of a path, if the reference - * is for DELETE, or NOCACHE is set (rewrite), and the - * name is located in the cache, it will be dropped. - * - * These locks are used (in the order in which they can be taken): - * NAME TYPE ROLE - * vnodelock mtx vnode lists and v_cache_dd field protection - * bucketlock mtx for access to given set of hash buckets - * neglist mtx negative entry LRU management - * - * It is legal to take multiple vnodelock and bucketlock locks. The locking - * order is lower address first. Both are recursive. - * - * "." lookups are lockless. - * - * ".." and vnode -> name lookups require vnodelock. - * - * name -> vnode lookup requires the relevant bucketlock to be held for reading. - * - * Insertions and removals of entries require involved vnodes and bucketlocks - * to be locked to provide safe operation against other threads modifying the - * cache. - * - * Some lookups result in removal of the found entry (e.g. getting rid of a - * negative entry with the intent to create a positive one), which poses a - * problem when multiple threads reach the state. Similarly, two different - * threads can purge two different vnodes and try to remove the same name. - * - * If the already held vnode lock is lower than the second required lock, we - * can just take the other lock. However, in the opposite case, this could - * deadlock. As such, this is resolved by trylocking and if that fails unlocking - * the first node, locking everything in order and revalidating the state. - */ - VFS_SMR_DECLARE; static SYSCTL_NODE(_vfs_cache, OID_AUTO, param, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, From owner-dev-commits-src-all@freebsd.org Fri Feb 5 23:40: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 969C552D604; Fri, 5 Feb 2021 23:40: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 4DXX3B300Nz4j5g; Fri, 5 Feb 2021 23:40: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 22E3827688; Fri, 5 Feb 2021 23:40: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 115NeMaq079145; Fri, 5 Feb 2021 23:40:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115NeM4I079144; Fri, 5 Feb 2021 23:40:22 GMT (envelope-from git) Date: Fri, 5 Feb 2021 23:40:22 GMT Message-Id: <202102052340.115NeM4I079144@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: 0e1594e60e5e - main - cache: fix vfs:namecache:lookup:miss probe call sites 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: 0e1594e60e5e0b1fddc33225171f1d1c6a421ed4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:40:22 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0e1594e60e5e0b1fddc33225171f1d1c6a421ed4 commit 0e1594e60e5e0b1fddc33225171f1d1c6a421ed4 Author: Mateusz Guzik AuthorDate: 2021-02-05 22:58:27 +0000 Commit: Mateusz Guzik CommitDate: 2021-02-05 23:28:40 +0000 cache: fix vfs:namecache:lookup:miss probe call sites --- sys/kern/vfs_cache.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 5cfc23779c42..50ec6face6ac 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1767,7 +1767,7 @@ retry: mtx_lock(dvlp); ncp = dvp->v_cache_dd; if (ncp == NULL) { - SDT_PROBE3(vfs, namecache, lookup, miss, dvp, "..", NULL); + SDT_PROBE2(vfs, namecache, lookup, miss, dvp, ".."); mtx_unlock(dvlp); return (0); } @@ -1894,8 +1894,7 @@ retry: if (__predict_false(ncp == NULL)) { mtx_unlock(blp); - SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, - NULL); + SDT_PROBE2(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr); counter_u64_add(nummiss, 1); return (0); } @@ -1990,8 +1989,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, if (__predict_false(ncp == NULL)) { vfs_smr_exit(); - SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, - NULL); + SDT_PROBE2(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr); counter_u64_add(nummiss, 1); return (0); } From owner-dev-commits-src-all@freebsd.org Sat Feb 6 01:20: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 6D96552F475 for ; Sat, 6 Feb 2021 01:20: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 4DXZGx2NL7z4p7m; Sat, 6 Feb 2021 01:20: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 448ABBC1; Sat, 6 Feb 2021 01:20: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 1161Kf88009629; Sat, 6 Feb 2021 01:20:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1161KfLD009628; Sat, 6 Feb 2021 01:20:41 GMT (envelope-from git) Date: Sat, 6 Feb 2021 01:20:41 GMT Message-Id: <202102060120.1161KfLD009628@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: John Baldwin Subject: git: e45bb3902e80 - releng/13.0 - Bump shared library versions after ncurses bump in 13. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: e45bb3902e80da374500a3dc077d7d11cfb3d6ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:20:41 -0000 The branch releng/13.0 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e45bb3902e80da374500a3dc077d7d11cfb3d6ba commit e45bb3902e80da374500a3dc077d7d11cfb3d6ba Author: John Baldwin AuthorDate: 2021-02-02 01:09:33 +0000 Commit: John Baldwin CommitDate: 2021-02-06 01:18:07 +0000 Bump shared library versions after ncurses bump in 13. A few shared libraries in the base system link against ncurses. An upgrade from a 12.x host to 13 results in ABI breakage for existing binaries since the newer versions of these libraries link against the newer ncurses while the binary itself links against the older ncurses. For example, dialog4ports built on 12.x sometimes crashes on 13 since it depends on libdialog which links against ncurses internally. Approved by: re (gjb) (cherry picked from commit 0b7f1af804f06a285717b490bef80e24648adcbe) (cherry picked from commit 6e1fe6d26ea2939656c8286ccbd105a89d3349a3) --- ObsoleteFiles.inc | 11 +++++++++++ gnu/lib/libdialog/Makefile | 2 +- lib/libdpv/Makefile | 2 +- lib/libedit/Makefile | 2 +- lib/ncurses/form/Makefile | 1 + lib/ncurses/menu/Makefile | 1 + lib/ncurses/panel/Makefile | 1 + 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1d0766ec894a..7ebff0441581 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20210204: bump shared libraries which link against ncurses +OLD_LIBS+=lib/libedit.so.7 +OLD_LIBS+=usr/lib/libdialog.so.8 +OLD_LIBS+=usr/lib/libdpv.so.1 +OLD_LIBS+=usr/lib/libform.so.5 +OLD_LIBS+=usr/lib/libformw.so.5 +OLD_LIBS+=usr/lib/libmenu.so.5 +OLD_LIBS+=usr/lib/libmenuw.so.5 +OLD_LIBS+=usr/lib/libpanel.so.5 +OLD_LIBS+=usr/lib/libpanelw.so.5 + # 20210116: if_wl_wavelan.h removed .if ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/if_wl_wavelan.h diff --git a/gnu/lib/libdialog/Makefile b/gnu/lib/libdialog/Makefile index 69d8dbd3fdb8..e4f1b62121d9 100644 --- a/gnu/lib/libdialog/Makefile +++ b/gnu/lib/libdialog/Makefile @@ -3,7 +3,7 @@ DIALOG= ${SRCTOP}/contrib/dialog LIB= dialog -SHLIB_MAJOR= 8 +SHLIB_MAJOR= 9 SRCS= argv.c arrows.c buildlist.c buttons.c calendar.c checklist.c \ columns.c dlg_keys.c editbox.c fselect.c formbox.c guage.c \ help.c inputbox.c inputstr.c menubox.c mixedform.c \ diff --git a/lib/libdpv/Makefile b/lib/libdpv/Makefile index d2334ee38186..be28debc70bc 100644 --- a/lib/libdpv/Makefile +++ b/lib/libdpv/Makefile @@ -2,7 +2,7 @@ PACKAGE= dpv LIB= dpv -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 INCS= dpv.h MAN= dpv.3 MLINKS= dpv.3 dpv_free.3 diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index f1dbad42db22..963063ef90fa 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -7,7 +7,7 @@ PACKAGE=clibs EDITDIR= ${SRCTOP}/contrib/libedit .PATH: ${EDITDIR} -SHLIB_MAJOR= 7 +SHLIB_MAJOR= 8 SHLIBDIR?= /lib WARNS?= 3 diff --git a/lib/ncurses/form/Makefile b/lib/ncurses/form/Makefile index a8e636d6ce1b..a6b186936dc5 100644 --- a/lib/ncurses/form/Makefile +++ b/lib/ncurses/form/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/form LIB= formw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ diff --git a/lib/ncurses/menu/Makefile b/lib/ncurses/menu/Makefile index 7844cd4d936c..9bd92723fed9 100644 --- a/lib/ncurses/menu/Makefile +++ b/lib/ncurses/menu/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/menu LIB= menuw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ diff --git a/lib/ncurses/panel/Makefile b/lib/ncurses/panel/Makefile index a22df4d89570..9dd950496b1b 100644 --- a/lib/ncurses/panel/Makefile +++ b/lib/ncurses/panel/Makefile @@ -6,6 +6,7 @@ SRCDIR= ${NCURSES_DIR}/panel LIB= panelw +SHLIB_MAJOR= 6 .PATH: ${SRCDIR} SRCS= \ From owner-dev-commits-src-all@freebsd.org Sat Feb 6 01:58: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 3EBDA53006A for ; Sat, 6 Feb 2021 01:58: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 4DXb6x1GFdz4rrZ; Sat, 6 Feb 2021 01:58: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 1E44E1137; Sat, 6 Feb 2021 01:58: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 1161wnud054131; Sat, 6 Feb 2021 01:58:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1161wnVg054130; Sat, 6 Feb 2021 01:58:49 GMT (envelope-from git) Date: Sat, 6 Feb 2021 01:58:49 GMT Message-Id: <202102060158.1161wnVg054130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: John Baldwin Subject: git: afdbccbf4017 - releng/13.0 - OpenSSL: Support for kernel TLS offload (KTLS) 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: afdbccbf4017c17eed95640bd9daad743388a22b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:58:49 -0000 The branch releng/13.0 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=afdbccbf4017c17eed95640bd9daad743388a22b commit afdbccbf4017c17eed95640bd9daad743388a22b Author: John Baldwin AuthorDate: 2021-01-16 00:17:31 +0000 Commit: John Baldwin CommitDate: 2021-02-06 01:57:55 +0000 OpenSSL: Support for kernel TLS offload (KTLS) This merges upstream patches from OpenSSL's master branch to add KTLS infrastructure for TLS 1.0-1.3 including both RX and TX offload and SSL_sendfile support on both Linux and FreeBSD. Note that TLS 1.3 only supports TX offload. A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with KTLS support. It defaults to enabled on amd64 and disabled on all other architectures. Approved by: re (gjb) Sponsored by: Netflix (cherry picked from commit aa906e2a4957db700d9e6cc60857e1afe1aecc85) (cherry picked from commit c1c52cd57e8810ca294d02220dfa72607c9a5567) --- crypto/openssl/CHANGES | 5 + crypto/openssl/Configure | 29 ++ crypto/openssl/INSTALL | 9 + crypto/openssl/apps/s_client.c | 6 + crypto/openssl/apps/s_server.c | 6 + crypto/openssl/crypto/bio/b_sock2.c | 12 + crypto/openssl/crypto/bio/bss_conn.c | 46 ++- crypto/openssl/crypto/bio/bss_sock.c | 57 ++- crypto/openssl/crypto/err/openssl.txt | 1 + crypto/openssl/crypto/evp/e_aes.c | 8 + crypto/openssl/doc/man3/BIO_ctrl.pod | 21 +- crypto/openssl/doc/man3/SSL_CTX_set_mode.pod | 17 + .../man3/SSL_CTX_set_record_padding_callback.pod | 10 +- crypto/openssl/doc/man3/SSL_write.pod | 31 +- crypto/openssl/engines/e_afalg.c | 3 +- crypto/openssl/include/internal/bio.h | 39 ++ crypto/openssl/include/internal/ktls.h | 403 +++++++++++++++++++++ crypto/openssl/include/openssl/bio.h | 20 + crypto/openssl/include/openssl/err.h | 1 + crypto/openssl/include/openssl/evp.h | 2 + crypto/openssl/include/openssl/ssl.h | 12 +- crypto/openssl/include/openssl/sslerr.h | 1 + crypto/openssl/ssl/build.info | 5 + crypto/openssl/ssl/ktls.c | 221 +++++++++++ crypto/openssl/ssl/record/rec_layer_s3.c | 137 +++++-- crypto/openssl/ssl/record/record.h | 2 + crypto/openssl/ssl/record/record_local.h | 3 + crypto/openssl/ssl/record/ssl3_buffer.c | 33 +- crypto/openssl/ssl/record/ssl3_record.c | 47 ++- crypto/openssl/ssl/ssl_err.c | 1 + crypto/openssl/ssl/ssl_lib.c | 104 +++++- crypto/openssl/ssl/ssl_local.h | 13 + crypto/openssl/ssl/t1_enc.c | 128 +++++++ crypto/openssl/ssl/tls13_enc.c | 81 ++++- secure/lib/libcrypto/Makefile | 18 +- secure/lib/libcrypto/opensslconf.h.in | 3 + secure/lib/libssl/Makefile | 6 + secure/lib/libssl/Version.map | 6 + share/mk/src.opts.mk | 7 + tools/build/options/WITHOUT_OPENSSL_KTLS | 1 + tools/build/options/WITH_OPENSSL_KTLS | 1 + 41 files changed, 1465 insertions(+), 91 deletions(-) diff --git a/crypto/openssl/CHANGES b/crypto/openssl/CHANGES index 37dd60b726ee..4d61c1dadbaa 100644 --- a/crypto/openssl/CHANGES +++ b/crypto/openssl/CHANGES @@ -390,6 +390,11 @@ necessary to configure just to create a source distribution. [Richard Levitte] + *) Added support for Linux Kernel TLS data-path. The Linux Kernel data-path + improves application performance by removing data copies and providing + applications with zero-copy system calls such as sendfile and splice. + [Boris Pismenny] + Changes between 1.1.1 and 1.1.1a [20 Nov 2018] *) Timing vulnerability in DSA signature generation diff --git a/crypto/openssl/Configure b/crypto/openssl/Configure index 1d73d06e1b3b..1423e1bfe14f 100755 --- a/crypto/openssl/Configure +++ b/crypto/openssl/Configure @@ -387,6 +387,7 @@ my @disablables = ( "heartbeats", "hw(-.+)?", "idea", + "ktls", "makedepend", "md2", "md4", @@ -474,6 +475,7 @@ our %disabled = ( # "what" => "comment" "weak-ssl-ciphers" => "default", "zlib" => "default", "zlib-dynamic" => "default", + "ktls" => "default", ); # Note: => pair form used for aesthetics, not to truly make a hash table @@ -1580,6 +1582,33 @@ unless ($disabled{devcryptoeng}) { } } +unless ($disabled{ktls}) { + $config{ktls}=""; + if ($target =~ m/^linux/) { + my $usr = "/usr/$config{cross_compile_prefix}"; + chop($usr); + if ($config{cross_compile_prefix} eq "") { + $usr = "/usr"; + } + my $minver = (4 << 16) + (13 << 8) + 0; + my @verstr = split(" ",`cat $usr/include/linux/version.h | grep LINUX_VERSION_CODE`); + + if ($verstr[2] < $minver) { + disable('too-old-kernel', 'ktls'); + } + } elsif ($target =~ m/^BSD/) { + my $cc = $config{CROSS_COMPILE}.$config{CC}; + system("printf '#include \n#include ' | $cc -E - >/dev/null 2>&1"); + if ($? != 0) { + disable('too-old-freebsd', 'ktls'); + } + } else { + disable('not-linux-or-freebsd', 'ktls'); + } +} + +push @{$config{openssl_other_defines}}, "OPENSSL_NO_KTLS" if ($disabled{ktls}); + # Get the extra flags used when building shared libraries and modules. We # do this late because some of them depend on %disabled. diff --git a/crypto/openssl/INSTALL b/crypto/openssl/INSTALL index f5118428b3bc..be84f2aa8e5d 100644 --- a/crypto/openssl/INSTALL +++ b/crypto/openssl/INSTALL @@ -262,6 +262,15 @@ Don't build the AFALG engine. This option will be forced if on a platform that does not support AFALG. + enable-ktls + Build with Kernel TLS support. This option will enable the + use of the Kernel TLS data-path, which can improve + performance and allow for the use of sendfile and splice + system calls on TLS sockets. The Kernel may use TLS + accelerators if any are available on the system. + This option will be forced off on systems that do not support + the Kernel TLS data-path. + enable-asan Build with the Address sanitiser. This is a developer option only. It may not work on all platforms and should never be diff --git a/crypto/openssl/apps/s_client.c b/crypto/openssl/apps/s_client.c index 83b3fc9c7f13..68bd9ced015f 100644 --- a/crypto/openssl/apps/s_client.c +++ b/crypto/openssl/apps/s_client.c @@ -3282,6 +3282,12 @@ static void print_stuff(BIO *bio, SSL *s, int full) BIO_printf(bio, "Expansion: %s\n", expansion ? SSL_COMP_get_name(expansion) : "NONE"); #endif +#ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_send(SSL_get_wbio(s))) + BIO_printf(bio_err, "Using Kernel TLS for sending\n"); + if (BIO_get_ktls_recv(SSL_get_rbio(s))) + BIO_printf(bio_err, "Using Kernel TLS for receiving\n"); +#endif #ifdef SSL_DEBUG { diff --git a/crypto/openssl/apps/s_server.c b/crypto/openssl/apps/s_server.c index 0ba75999fd28..ddc0b4bcd76d 100644 --- a/crypto/openssl/apps/s_server.c +++ b/crypto/openssl/apps/s_server.c @@ -2923,6 +2923,12 @@ static void print_connection_info(SSL *con) } OPENSSL_free(exportedkeymat); } +#ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_send(SSL_get_wbio(con))) + BIO_printf(bio_err, "Using Kernel TLS for sending\n"); + if (BIO_get_ktls_recv(SSL_get_rbio(con))) + BIO_printf(bio_err, "Using Kernel TLS for receiving\n"); +#endif (void)BIO_flush(bio_s_out); } diff --git a/crypto/openssl/crypto/bio/b_sock2.c b/crypto/openssl/crypto/bio/b_sock2.c index 335dfabc6180..80ef348d9254 100644 --- a/crypto/openssl/crypto/bio/b_sock2.c +++ b/crypto/openssl/crypto/bio/b_sock2.c @@ -12,6 +12,7 @@ #include #include "bio_local.h" +#include "internal/ktls.h" #include @@ -50,6 +51,17 @@ int BIO_socket(int domain, int socktype, int protocol, int options) BIOerr(BIO_F_BIO_SOCKET, BIO_R_UNABLE_TO_CREATE_SOCKET); return INVALID_SOCKET; } +# ifndef OPENSSL_NO_KTLS + { + /* + * The new socket is created successfully regardless of ktls_enable. + * ktls_enable doesn't change any functionality of the socket, except + * changing the setsockopt to enable the processing of ktls_start. + * Thus, it is not a problem to call it for non-TLS sockets. + */ + ktls_enable(sock); + } +# endif return sock; } diff --git a/crypto/openssl/crypto/bio/bss_conn.c b/crypto/openssl/crypto/bio/bss_conn.c index 807a82b23ba2..d4786442803e 100644 --- a/crypto/openssl/crypto/bio/bss_conn.c +++ b/crypto/openssl/crypto/bio/bss_conn.c @@ -11,6 +11,7 @@ #include #include "bio_local.h" +#include "internal/ktls.h" #ifndef OPENSSL_NO_SOCK @@ -20,6 +21,9 @@ typedef struct bio_connect_st { char *param_hostname; char *param_service; int connect_mode; +# ifndef OPENSSL_NO_KTLS + unsigned char record_type; +# endif BIO_ADDRINFO *addr_first; const BIO_ADDRINFO *addr_iter; @@ -320,7 +324,12 @@ static int conn_read(BIO *b, char *out, int outl) if (out != NULL) { clear_socket_error(); - ret = readsocket(b->num, out, outl); +# ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_recv(b)) + ret = ktls_read_record(b->num, out, outl); + else +# endif + ret = readsocket(b->num, out, outl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -345,7 +354,16 @@ static int conn_write(BIO *b, const char *in, int inl) } clear_socket_error(); - ret = writesocket(b->num, in, inl); +# ifndef OPENSSL_NO_KTLS + if (BIO_should_ktls_ctrl_msg_flag(b)) { + ret = ktls_send_ctrl_message(b->num, data->record_type, in, inl); + if (ret >= 0) { + ret = inl; + BIO_clear_ktls_ctrl_msg_flag(b); + } + } else +# endif + ret = writesocket(b->num, in, inl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -361,6 +379,9 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) const char **pptr = NULL; long ret = 1; BIO_CONNECT *data; +# ifndef OPENSSL_NO_KTLS + ktls_crypto_info_t *crypto_info; +# endif data = (BIO_CONNECT *)b->ptr; @@ -520,6 +541,27 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_CTRL_EOF: ret = (b->flags & BIO_FLAGS_IN_EOF) != 0 ? 1 : 0; break; +# ifndef OPENSSL_NO_KTLS + case BIO_CTRL_SET_KTLS: + crypto_info = (ktls_crypto_info_t *)ptr; + ret = ktls_start(b->num, crypto_info, num); + if (ret) + BIO_set_ktls_flag(b, num); + break; + case BIO_CTRL_GET_KTLS_SEND: + return BIO_should_ktls_flag(b, 1); + case BIO_CTRL_GET_KTLS_RECV: + return BIO_should_ktls_flag(b, 0); + case BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG: + BIO_set_ktls_ctrl_msg_flag(b); + data->record_type = num; + ret = 0; + break; + case BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG: + BIO_clear_ktls_ctrl_msg_flag(b); + ret = 0; + break; +# endif default: ret = 0; break; diff --git a/crypto/openssl/crypto/bio/bss_sock.c b/crypto/openssl/crypto/bio/bss_sock.c index 6251f3d46a17..a1fc23c7c938 100644 --- a/crypto/openssl/crypto/bio/bss_sock.c +++ b/crypto/openssl/crypto/bio/bss_sock.c @@ -11,6 +11,7 @@ #include #include "bio_local.h" #include "internal/cryptlib.h" +#include "internal/ktls.h" #ifndef OPENSSL_NO_SOCK @@ -64,6 +65,17 @@ BIO *BIO_new_socket(int fd, int close_flag) if (ret == NULL) return NULL; BIO_set_fd(ret, fd, close_flag); +# ifndef OPENSSL_NO_KTLS + { + /* + * The new socket is created successfully regardless of ktls_enable. + * ktls_enable doesn't change any functionality of the socket, except + * changing the setsockopt to enable the processing of ktls_start. + * Thus, it is not a problem to call it for non-TLS sockets. + */ + ktls_enable(fd); + } +# endif return ret; } @@ -96,7 +108,12 @@ static int sock_read(BIO *b, char *out, int outl) if (out != NULL) { clear_socket_error(); - ret = readsocket(b->num, out, outl); +# ifndef OPENSSL_NO_KTLS + if (BIO_get_ktls_recv(b)) + ret = ktls_read_record(b->num, out, outl); + else +# endif + ret = readsocket(b->num, out, outl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -110,10 +127,20 @@ static int sock_read(BIO *b, char *out, int outl) static int sock_write(BIO *b, const char *in, int inl) { - int ret; + int ret = 0; clear_socket_error(); - ret = writesocket(b->num, in, inl); +# ifndef OPENSSL_NO_KTLS + if (BIO_should_ktls_ctrl_msg_flag(b)) { + unsigned char record_type = (intptr_t)b->ptr; + ret = ktls_send_ctrl_message(b->num, record_type, in, inl); + if (ret >= 0) { + ret = inl; + BIO_clear_ktls_ctrl_msg_flag(b); + } + } else +# endif + ret = writesocket(b->num, in, inl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_sock_should_retry(ret)) @@ -126,6 +153,9 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) { long ret = 1; int *ip; +# ifndef OPENSSL_NO_KTLS + ktls_crypto_info_t *crypto_info; +# endif switch (cmd) { case BIO_C_SET_FD: @@ -153,6 +183,27 @@ static long sock_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_CTRL_FLUSH: ret = 1; break; +# ifndef OPENSSL_NO_KTLS + case BIO_CTRL_SET_KTLS: + crypto_info = (ktls_crypto_info_t *)ptr; + ret = ktls_start(b->num, crypto_info, num); + if (ret) + BIO_set_ktls_flag(b, num); + break; + case BIO_CTRL_GET_KTLS_SEND: + return BIO_should_ktls_flag(b, 1); + case BIO_CTRL_GET_KTLS_RECV: + return BIO_should_ktls_flag(b, 0); + case BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG: + BIO_set_ktls_ctrl_msg_flag(b); + b->ptr = (void *)num; + ret = 0; + break; + case BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG: + BIO_clear_ktls_ctrl_msg_flag(b); + ret = 0; + break; +# endif case BIO_CTRL_EOF: ret = (b->flags & BIO_FLAGS_IN_EOF) != 0 ? 1 : 0; break; diff --git a/crypto/openssl/crypto/err/openssl.txt b/crypto/openssl/crypto/err/openssl.txt index 815460b24f67..d547c45913d6 100644 --- a/crypto/openssl/crypto/err/openssl.txt +++ b/crypto/openssl/crypto/err/openssl.txt @@ -1318,6 +1318,7 @@ SSL_F_SSL_RENEGOTIATE:516:SSL_renegotiate SSL_F_SSL_RENEGOTIATE_ABBREVIATED:546:SSL_renegotiate_abbreviated SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT:320:* SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT:321:* +SSL_F_SSL_SENDFILE:639:SSL_sendfile SSL_F_SSL_SESSION_DUP:348:ssl_session_dup SSL_F_SSL_SESSION_NEW:189:SSL_SESSION_new SSL_F_SSL_SESSION_PRINT_FP:190:SSL_SESSION_print_fp diff --git a/crypto/openssl/crypto/evp/e_aes.c b/crypto/openssl/crypto/evp/e_aes.c index 405ddbf9bf09..4640c7528a20 100644 --- a/crypto/openssl/crypto/evp/e_aes.c +++ b/crypto/openssl/crypto/evp/e_aes.c @@ -2895,6 +2895,14 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) memcpy(ptr, c->buf, arg); return 1; + case EVP_CTRL_GET_IV: + if (gctx->iv_gen != 1) + return 0; + if (gctx->ivlen != arg) + return 0; + memcpy(ptr, gctx->iv, arg); + return 1; + case EVP_CTRL_GCM_SET_IV_FIXED: /* Special case: -1 length restores whole IV */ if (arg == -1) { diff --git a/crypto/openssl/doc/man3/BIO_ctrl.pod b/crypto/openssl/doc/man3/BIO_ctrl.pod index 2e438c3ce952..31b18b2879fe 100644 --- a/crypto/openssl/doc/man3/BIO_ctrl.pod +++ b/crypto/openssl/doc/man3/BIO_ctrl.pod @@ -5,7 +5,8 @@ BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close, BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending, -BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb +BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb, BIO_get_ktls_send, +BIO_get_ktls_recv - BIO control operations =head1 SYNOPSIS @@ -34,6 +35,9 @@ BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb int BIO_get_info_callback(BIO *b, BIO_info_cb **cbp); int BIO_set_info_callback(BIO *b, BIO_info_cb *cb); + int BIO_get_ktls_send(BIO *b); + int BIO_get_ktls_recv(BIO *b); + =head1 DESCRIPTION BIO_ctrl(), BIO_callback_ctrl(), BIO_ptr_ctrl() and BIO_int_ctrl() @@ -72,6 +76,11 @@ Not all BIOs support these calls. BIO_ctrl_pending() and BIO_ctrl_wpending() return a size_t type and are functions, BIO_pending() and BIO_wpending() are macros which call BIO_ctrl(). +BIO_get_ktls_send() returns 1 if the BIO is using the Kernel TLS data-path for +sending. Otherwise, it returns zero. +BIO_get_ktls_recv() returns 1 if the BIO is using the Kernel TLS data-path for +receiving. Otherwise, it returns zero. + =head1 RETURN VALUES BIO_reset() normally returns 1 for success and 0 or -1 for failure. File @@ -92,6 +101,11 @@ BIO_get_close() returns the close flag value: BIO_CLOSE or BIO_NOCLOSE. BIO_pending(), BIO_ctrl_pending(), BIO_wpending() and BIO_ctrl_wpending() return the amount of pending data. +BIO_get_ktls_send() returns 1 if the BIO is using the Kernel TLS data-path for +sending. Otherwise, it returns zero. +BIO_get_ktls_recv() returns 1 if the BIO is using the Kernel TLS data-path for +receiving. Otherwise, it returns zero. + =head1 NOTES BIO_flush(), because it can write data may return 0 or -1 indicating @@ -124,6 +138,11 @@ particular a return value of 0 can be returned if an operation is not supported, if an error occurred, if EOF has not been reached and in the case of BIO_seek() on a file BIO for a successful operation. +=head1 HISTORY + +The BIO_get_ktls_send() and BIO_get_ktls_recv() functions were added in +OpenSSL 3.0.0. + =head1 COPYRIGHT Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. diff --git a/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod b/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod index 85e3353e0e2c..27eaebad1ea0 100644 --- a/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod +++ b/crypto/openssl/doc/man3/SSL_CTX_set_mode.pod @@ -114,6 +114,22 @@ enables this behaviour to allow interoperability with such broken implementations. Please note that setting this option breaks interoperability with correct implementations. This option only applies to DTLS over SCTP. +=item SSL_MODE_NO_KTLS_TX + +Disable the use of the kernel TLS egress data-path. +By default kernel TLS is enabled if it is supported by the negotiated ciphersuites +and extensions and OpenSSL has been compiled with support for it. +The kernel TLS data-path implements the record layer, +and the crypto algorithm. The kernel will utilize the best hardware +available for crypto. Using the kernel data-path should reduce the memory +footprint of OpenSSL because no buffering is required. Also, the throughput +should improve because data copy is avoided when user data is encrypted into +kernel memory instead of the usual encrypt than copy to kernel. + +Kernel TLS might not support all the features of OpenSSL. For instance, +renegotiation, and setting the maximum fragment size is not possible as of +Linux 4.20. + =back All modes are off by default except for SSL_MODE_AUTO_RETRY which is on by @@ -134,6 +150,7 @@ L, L =head1 HISTORY SSL_MODE_ASYNC was added in OpenSSL 1.1.0. +SSL_MODE_NO_KTLS_TX was first added to OpenSSL 3.0.0. =head1 COPYRIGHT diff --git a/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod b/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod index 13e56f0c57f6..247a39fc0355 100644 --- a/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod +++ b/crypto/openssl/doc/man3/SSL_CTX_set_record_padding_callback.pod @@ -16,7 +16,7 @@ SSL_set_block_padding - install callback to specify TLS 1.3 record padding #include void SSL_CTX_set_record_padding_callback(SSL_CTX *ctx, size_t (*cb)(SSL *s, int type, size_t len, void *arg)); - void SSL_set_record_padding_callback(SSL *ssl, size_t (*cb)(SSL *s, int type, size_t len, void *arg)); + int SSL_set_record_padding_callback(SSL *ssl, size_t (*cb)(SSL *s, int type, size_t len, void *arg)); void SSL_CTX_set_record_padding_callback_arg(SSL_CTX *ctx, void *arg); void *SSL_CTX_get_record_padding_callback_arg(const SSL_CTX *ctx); @@ -32,6 +32,8 @@ SSL_set_block_padding - install callback to specify TLS 1.3 record padding SSL_CTX_set_record_padding_callback() or SSL_set_record_padding_callback() can be used to assign a callback function I to specify the padding for TLS 1.3 records. The value set in B is copied to a new SSL by SSL_new(). +Kernel TLS is not possible if the record padding callback is set, and the callback +function cannot be set if Kernel TLS is already configured for the current SSL object. SSL_CTX_set_record_padding_callback_arg() and SSL_set_record_padding_callback_arg() assign a value B that is passed to the callback when it is invoked. The value @@ -64,6 +66,9 @@ indicates no padding will be added. A return value that causes the record to exceed the maximum record size (SSL3_RT_MAX_PLAIN_LENGTH) will pad out to the maximum record size. +The SSL_CTX_get_record_padding_callback_arg() function returns 1 on success or 0 if +the callback function is not set because Kernel TLS is configured for the SSL object. + =head1 NOTES The default behavior is to add no padding to the record. @@ -84,6 +89,9 @@ L, L The record padding API was added for TLS 1.3 support in OpenSSL 1.1.1. +The return type of SSL_CTX_set_record_padding_callback() function was +changed to int in OpenSSL 3.0. + =head1 COPYRIGHT Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved. diff --git a/crypto/openssl/doc/man3/SSL_write.pod b/crypto/openssl/doc/man3/SSL_write.pod index 5e3ce1e7e4dd..20c7953deb06 100644 --- a/crypto/openssl/doc/man3/SSL_write.pod +++ b/crypto/openssl/doc/man3/SSL_write.pod @@ -2,12 +2,13 @@ =head1 NAME -SSL_write_ex, SSL_write - write bytes to a TLS/SSL connection +SSL_write_ex, SSL_write, SSL_sendfile - write bytes to a TLS/SSL connection =head1 SYNOPSIS #include + ossl_ssize_t SSL_sendfile(SSL *s, int fd, off_t offset, size_t size, int flags); int SSL_write_ex(SSL *s, const void *buf, size_t num, size_t *written); int SSL_write(SSL *ssl, const void *buf, int num); @@ -17,6 +18,14 @@ SSL_write_ex() and SSL_write() write B bytes from the buffer B into the specified B connection. On success SSL_write_ex() will store the number of bytes written in B<*written>. +SSL_sendfile() writes B bytes from offset B in the file +descriptor B to the specified SSL connection B. This function provides +efficient zero-copy semantics. SSL_sendfile() is available only when +Kernel TLS is enabled, which can be checked by calling BIO_get_ktls_send(). +It is provided here to allow users to maintain the same interface. +The meaning of B is platform dependent. +Currently, under Linux it is ignored. + =head1 NOTES In the paragraphs below a "write function" is defined as one of either @@ -104,17 +113,35 @@ You should instead call SSL_get_error() to find out if it's retryable. =back +For SSL_sendfile(), the following return values can occur: + +=over 4 + +=item Z<>>= 0 + +The write operation was successful, the return value is the number +of bytes of the file written to the TLS/SSL connection. + +=item E 0 + +The write operation was not successful, because either the connection was +closed, an error occured or action must be taken by the calling process. +Call SSL_get_error() with the return value to find out the reason. + +=back + =head1 SEE ALSO L, L, L L, L, L, L -L, +L, L, L, L =head1 HISTORY The SSL_write_ex() function was added in OpenSSL 1.1.1. +The SSL_sendfile() function was added in OpenSSL 3.0.0. =head1 COPYRIGHT diff --git a/crypto/openssl/engines/e_afalg.c b/crypto/openssl/engines/e_afalg.c index 4b1722846133..5ef3a8d457e6 100644 --- a/crypto/openssl/engines/e_afalg.c +++ b/crypto/openssl/engines/e_afalg.c @@ -407,7 +407,7 @@ static int afalg_start_cipher_sk(afalg_ctx *actx, const unsigned char *in, size_t inl, const unsigned char *iv, unsigned int enc) { - struct msghdr msg = { 0 }; + struct msghdr msg; struct cmsghdr *cmsg; struct iovec iov; ssize_t sbytes; @@ -416,6 +416,7 @@ static int afalg_start_cipher_sk(afalg_ctx *actx, const unsigned char *in, # endif char cbuf[CMSG_SPACE(ALG_IV_LEN(ALG_AES_IV_LEN)) + CMSG_SPACE(ALG_OP_LEN)]; + memset(&msg, 0, sizeof(msg)); memset(cbuf, 0, sizeof(cbuf)); msg.msg_control = cbuf; msg.msg_controllen = sizeof(cbuf); diff --git a/crypto/openssl/include/internal/bio.h b/crypto/openssl/include/internal/bio.h index c343b276295c..521b5fa2198f 100644 --- a/crypto/openssl/include/internal/bio.h +++ b/crypto/openssl/include/internal/bio.h @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +#ifndef HEADER_INTERNAL_BIO_H +# define HEADER_INTERNAL_BIO_H + #include struct bio_method_st { @@ -31,3 +34,39 @@ void bio_cleanup(void); /* Old style to new style BIO_METHOD conversion functions */ int bwrite_conv(BIO *bio, const char *data, size_t datal, size_t *written); int bread_conv(BIO *bio, char *data, size_t datal, size_t *read); + +/* Changes to these internal BIOs must also update include/openssl/bio.h */ +# define BIO_CTRL_SET_KTLS 72 +# define BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG 74 +# define BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG 75 + +/* + * This is used with socket BIOs: + * BIO_FLAGS_KTLS_TX means we are using ktls with this BIO for sending. + * BIO_FLAGS_KTLS_TX_CTRL_MSG means we are about to send a ctrl message next. + * BIO_FLAGS_KTLS_RX means we are using ktls with this BIO for receiving. + */ +# define BIO_FLAGS_KTLS_TX 0x800 +# define BIO_FLAGS_KTLS_TX_CTRL_MSG 0x1000 +# define BIO_FLAGS_KTLS_RX 0x2000 + +/* KTLS related controls and flags */ +# define BIO_set_ktls_flag(b, is_tx) \ + BIO_set_flags(b, (is_tx) ? BIO_FLAGS_KTLS_TX : BIO_FLAGS_KTLS_RX) +# define BIO_should_ktls_flag(b, is_tx) \ + BIO_test_flags(b, (is_tx) ? BIO_FLAGS_KTLS_TX : BIO_FLAGS_KTLS_RX) +# define BIO_set_ktls_ctrl_msg_flag(b) \ + BIO_set_flags(b, BIO_FLAGS_KTLS_TX_CTRL_MSG) +# define BIO_should_ktls_ctrl_msg_flag(b) \ + BIO_test_flags(b, BIO_FLAGS_KTLS_TX_CTRL_MSG) +# define BIO_clear_ktls_ctrl_msg_flag(b) \ + BIO_clear_flags(b, BIO_FLAGS_KTLS_TX_CTRL_MSG) + +# define BIO_set_ktls(b, keyblob, is_tx) \ + BIO_ctrl(b, BIO_CTRL_SET_KTLS, is_tx, keyblob) +# define BIO_set_ktls_ctrl_msg(b, record_type) \ + BIO_ctrl(b, BIO_CTRL_SET_KTLS_TX_SEND_CTRL_MSG, record_type, NULL) +# define BIO_clear_ktls_ctrl_msg(b) \ + BIO_ctrl(b, BIO_CTRL_CLEAR_KTLS_TX_CTRL_MSG, 0, NULL) + +#endif diff --git a/crypto/openssl/include/internal/ktls.h b/crypto/openssl/include/internal/ktls.h new file mode 100644 index 000000000000..9032c0ed6174 --- /dev/null +++ b/crypto/openssl/include/internal/ktls.h @@ -0,0 +1,403 @@ +/* + * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (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 + */ + +#if defined(OPENSSL_SYS_LINUX) +# ifndef OPENSSL_NO_KTLS +# include +# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) +# define OPENSSL_NO_KTLS +# ifndef PEDANTIC +# warning "KTLS requires Kernel Headers >= 4.13.0" +# warning "Skipping Compilation of KTLS" +# endif +# endif +# endif +#endif + +#ifndef HEADER_INTERNAL_KTLS +# define HEADER_INTERNAL_KTLS +# ifndef OPENSSL_NO_KTLS + +# if defined(__FreeBSD__) +# include +# include +# include +# include +# include +# include "openssl/ssl3.h" + +# ifndef TCP_RXTLS_ENABLE +# define OPENSSL_NO_KTLS_RX +# endif +# define OPENSSL_KTLS_AES_GCM_128 +# define OPENSSL_KTLS_AES_GCM_256 +# define OPENSSL_KTLS_TLS13 + +/* + * Only used by the tests in sslapitest.c. + */ +# define TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE 8 +# define TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE 8 + +typedef struct tls_enable ktls_crypto_info_t; + +/* + * FreeBSD does not require any additional steps to enable KTLS before + * setting keys. + */ +static ossl_inline int ktls_enable(int fd) +{ + return 1; +} + +/* + * The TCP_TXTLS_ENABLE socket option marks the outgoing socket buffer + * as using TLS. If successful, then data sent using this socket will + * be encrypted and encapsulated in TLS records using the tls_en + * provided here. + * + * The TCP_RXTLS_ENABLE socket option marks the incoming socket buffer + * as using TLS. If successful, then data received for this socket will + * be authenticated and decrypted using the tls_en provided here. + */ +static ossl_inline int ktls_start(int fd, ktls_crypto_info_t *tls_en, int is_tx) +{ + if (is_tx) + return setsockopt(fd, IPPROTO_TCP, TCP_TXTLS_ENABLE, + tls_en, sizeof(*tls_en)) ? 0 : 1; +# ifndef OPENSSL_NO_KTLS_RX + return setsockopt(fd, IPPROTO_TCP, TCP_RXTLS_ENABLE, tls_en, + sizeof(*tls_en)) ? 0 : 1; +# else + return 0; +# endif +} + +/* + * Send a TLS record using the tls_en provided in ktls_start and use + * record_type instead of the default SSL3_RT_APPLICATION_DATA. + * When the socket is non-blocking, then this call either returns EAGAIN or + * the entire record is pushed to TCP. It is impossible to send a partial + * record using this control message. + */ +static ossl_inline int ktls_send_ctrl_message(int fd, unsigned char record_type, + const void *data, size_t length) +{ + struct msghdr msg = { 0 }; + int cmsg_len = sizeof(record_type); + struct cmsghdr *cmsg; + char buf[CMSG_SPACE(cmsg_len)]; + struct iovec msg_iov; /* Vector of data to send/receive into */ + + msg.msg_control = buf; + msg.msg_controllen = sizeof(buf); + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_TCP; + cmsg->cmsg_type = TLS_SET_RECORD_TYPE; + cmsg->cmsg_len = CMSG_LEN(cmsg_len); + *((unsigned char *)CMSG_DATA(cmsg)) = record_type; + msg.msg_controllen = cmsg->cmsg_len; + + msg_iov.iov_base = (void *)data; + msg_iov.iov_len = length; + msg.msg_iov = &msg_iov; + msg.msg_iovlen = 1; + + return sendmsg(fd, &msg, 0); +} + +# ifdef OPENSSL_NO_KTLS_RX + +static ossl_inline int ktls_read_record(int fd, void *data, size_t length) +{ + return -1; +} + +# else /* !defined(OPENSSL_NO_KTLS_RX) */ + +/* + * Receive a TLS record using the tls_en provided in ktls_start. The + * kernel strips any explicit IV and authentication tag, but provides + * the TLS record header via a control message. If there is an error + * with the TLS record such as an invalid header, invalid padding, or + * authentication failure recvmsg() will fail with an error. + */ +static ossl_inline int ktls_read_record(int fd, void *data, size_t length) +{ + struct msghdr msg = { 0 }; + int cmsg_len = sizeof(struct tls_get_record); + struct tls_get_record *tgr; + struct cmsghdr *cmsg; + char buf[CMSG_SPACE(cmsg_len)]; + struct iovec msg_iov; /* Vector of data to send/receive into */ + int ret; + unsigned char *p = data; + const size_t prepend_length = SSL3_RT_HEADER_LENGTH; + + if (length <= prepend_length) { + errno = EINVAL; + return -1; + } + + msg.msg_control = buf; + msg.msg_controllen = sizeof(buf); + + msg_iov.iov_base = p + prepend_length; + msg_iov.iov_len = length - prepend_length; + msg.msg_iov = &msg_iov; + msg.msg_iovlen = 1; + + ret = recvmsg(fd, &msg, 0); + if (ret <= 0) + return ret; + + if ((msg.msg_flags & (MSG_EOR | MSG_CTRUNC)) != MSG_EOR) { + errno = EMSGSIZE; + return -1; + } + + if (msg.msg_controllen == 0) { + errno = EBADMSG; + return -1; + } + + cmsg = CMSG_FIRSTHDR(&msg); + if (cmsg->cmsg_level != IPPROTO_TCP || cmsg->cmsg_type != TLS_GET_RECORD + || cmsg->cmsg_len != CMSG_LEN(cmsg_len)) { + errno = EBADMSG; + return -1; + } + + tgr = (struct tls_get_record *)CMSG_DATA(cmsg); + p[0] = tgr->tls_type; + p[1] = tgr->tls_vmajor; + p[2] = tgr->tls_vminor; + *(uint16_t *)(p + 3) = htons(ret); + + return ret + prepend_length; +} + +# endif /* OPENSSL_NO_KTLS_RX */ + +/* + * KTLS enables the sendfile system call to send data from a file over + * TLS. + */ +static ossl_inline ossl_ssize_t ktls_sendfile(int s, int fd, off_t off, + size_t size, int flags) +{ + off_t sbytes; + int ret; + + ret = sendfile(fd, s, off, size, NULL, &sbytes, flags); + if (ret == -1) { + if (errno == EAGAIN && sbytes != 0) + return sbytes; + return -1; + } + return sbytes; +} + +# endif /* __FreeBSD__ */ + +# if defined(OPENSSL_SYS_LINUX) + +# include +# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) +# define OPENSSL_NO_KTLS_RX +# ifndef PEDANTIC +# warning "KTLS requires Kernel Headers >= 4.17.0 for receiving" +# warning "Skipping Compilation of KTLS receive data path" +# endif +# endif +# define OPENSSL_KTLS_AES_GCM_128 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +# define OPENSSL_KTLS_AES_GCM_256 +# define OPENSSL_KTLS_TLS13 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) +# define OPENSSL_KTLS_AES_CCM_128 +# endif +# endif + +# include +# include +# include +# include "openssl/ssl3.h" +# include "openssl/tls1.h" +# include "openssl/evp.h" + +# ifndef SOL_TLS +# define SOL_TLS 282 +# endif + +# ifndef TCP_ULP +# define TCP_ULP 31 +# endif + +# ifndef TLS_RX +# define TLS_RX 2 +# endif *** 1679 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sat Feb 6 01:58: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 9571353006B for ; Sat, 6 Feb 2021 01:58: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 4DXb6y3Xqrz4rds; Sat, 6 Feb 2021 01:58: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 6AFF31384; Sat, 6 Feb 2021 01:58: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 1161woEk054153; Sat, 6 Feb 2021 01:58:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1161wot5054152; Sat, 6 Feb 2021 01:58:50 GMT (envelope-from git) Date: Sat, 6 Feb 2021 01:58:50 GMT Message-Id: <202102060158.1161wot5054152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: John Baldwin Subject: git: 25a4522f88d2 - releng/13.0 - OpenSSL: Regenerate manual pages. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 25a4522f88d2def4e3ef497dad3c491ac9afc9c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:58:50 -0000 The branch releng/13.0 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=25a4522f88d2def4e3ef497dad3c491ac9afc9c7 commit 25a4522f88d2def4e3ef497dad3c491ac9afc9c7 Author: Jung-uk Kim AuthorDate: 2021-01-26 22:26:51 +0000 Commit: John Baldwin CommitDate: 2021-02-06 01:58:11 +0000 OpenSSL: Regenerate manual pages. Approved by: re (gjb) (cherry picked from commit bb8acd558e66bd4bae31602fcbe569863f47382c) (cherry picked from commit 3e09120f7984c990530d6e6860941ffb1e281f8b) --- secure/lib/libcrypto/man/man3/ADMISSIONS.3 | 2 +- .../libcrypto/man/man3/ASN1_INTEGER_get_int64.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 | 2 +- .../lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 | 2 +- .../lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 | 2 +- secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 | 2 +- .../lib/libcrypto/man/man3/ASN1_generate_nconf.3 | 2 +- secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/ASYNC_start_job.3 | 2 +- secure/lib/libcrypto/man/man3/BF_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ADDR.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_connect.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_ctrl.3 | 23 +- secure/lib/libcrypto/man/man3/BIO_f_base64.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_f_buffer.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_md.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_null.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_f_ssl.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_find_type.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_get_data.3 | 2 +- .../lib/libcrypto/man/man3/BIO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 | 280 +++++++++++++++++++++ secure/lib/libcrypto/man/man3/BIO_get_ktls_send.3 | 280 +++++++++++++++++++++ secure/lib/libcrypto/man/man3/BIO_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_new.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_new_CMS.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_printf.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_push.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_read.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_accept.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_bio.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_connect.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_fd.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_file.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_mem.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_s_null.3 | 4 +- secure/lib/libcrypto/man/man3/BIO_s_socket.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_set_callback.3 | 2 +- secure/lib/libcrypto/man/man3/BIO_should_retry.3 | 2 +- secure/lib/libcrypto/man/man3/BN_BLINDING_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_CTX_start.3 | 2 +- secure/lib/libcrypto/man/man3/BN_add.3 | 2 +- secure/lib/libcrypto/man/man3/BN_add_word.3 | 2 +- secure/lib/libcrypto/man/man3/BN_bn2bin.3 | 2 +- secure/lib/libcrypto/man/man3/BN_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/BN_copy.3 | 2 +- secure/lib/libcrypto/man/man3/BN_generate_prime.3 | 2 +- secure/lib/libcrypto/man/man3/BN_mod_inverse.3 | 4 +- .../lib/libcrypto/man/man3/BN_mod_mul_montgomery.3 | 2 +- .../lib/libcrypto/man/man3/BN_mod_mul_reciprocal.3 | 2 +- secure/lib/libcrypto/man/man3/BN_new.3 | 2 +- secure/lib/libcrypto/man/man3/BN_num_bytes.3 | 2 +- secure/lib/libcrypto/man/man3/BN_rand.3 | 2 +- secure/lib/libcrypto/man/man3/BN_security_bits.3 | 4 +- secure/lib/libcrypto/man/man3/BN_set_bit.3 | 2 +- secure/lib/libcrypto/man/man3/BN_swap.3 | 4 +- secure/lib/libcrypto/man/man3/BN_zero.3 | 2 +- secure/lib/libcrypto/man/man3/BUF_MEM_new.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add0_cert.3 | 2 +- .../libcrypto/man/man3/CMS_add1_recipient_cert.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_add1_signer.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_compress.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_decrypt.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_encrypt.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_final.3 | 4 +- .../libcrypto/man/man3/CMS_get0_RecipientInfos.3 | 2 +- .../lib/libcrypto/man/man3/CMS_get0_SignerInfos.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_type.3 | 2 +- .../libcrypto/man/man3/CMS_get1_ReceiptRequest.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_sign.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_sign_receipt.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_uncompress.3 | 4 +- secure/lib/libcrypto/man/man3/CMS_verify.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_verify_receipt.3 | 4 +- secure/lib/libcrypto/man/man3/CONF_modules_free.3 | 2 +- .../libcrypto/man/man3/CONF_modules_load_file.3 | 2 +- .../libcrypto/man/man3/CRYPTO_THREAD_run_once.3 | 2 +- .../libcrypto/man/man3/CRYPTO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_memcmp.3 | 4 +- .../man/man3/CTLOG_STORE_get0_log_by_id.3 | 4 +- secure/lib/libcrypto/man/man3/CTLOG_STORE_new.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_new.3 | 2 +- .../libcrypto/man/man3/CT_POLICY_EVAL_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/DEFINE_STACK_OF.3 | 2 +- secure/lib/libcrypto/man/man3/DES_random_key.3 | 2 +- secure/lib/libcrypto/man/man3/DH_generate_key.3 | 2 +- .../libcrypto/man/man3/DH_generate_parameters.3 | 2 +- secure/lib/libcrypto/man/man3/DH_get0_pqg.3 | 2 +- secure/lib/libcrypto/man/man3/DH_get_1024_160.3 | 2 +- secure/lib/libcrypto/man/man3/DH_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/DH_new.3 | 2 +- secure/lib/libcrypto/man/man3/DH_new_by_nid.3 | 2 +- secure/lib/libcrypto/man/man3/DH_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/DH_size.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_SIG_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_do_sign.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_dup_DH.3 | 4 +- secure/lib/libcrypto/man/man3/DSA_generate_key.3 | 4 +- .../libcrypto/man/man3/DSA_generate_parameters.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_get0_pqg.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_new.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_sign.3 | 2 +- secure/lib/libcrypto/man/man3/DSA_size.3 | 2 +- secure/lib/libcrypto/man/man3/DTLS_get_data_mtu.3 | 4 +- secure/lib/libcrypto/man/man3/DTLS_set_timer_cb.3 | 2 +- secure/lib/libcrypto/man/man3/DTLSv1_listen.3 | 2 +- secure/lib/libcrypto/man/man3/ECDSA_SIG_new.3 | 2 +- .../lib/libcrypto/man/man3/ECPKParameters_print.3 | 2 +- .../lib/libcrypto/man/man3/EC_GFp_simple_method.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GROUP_copy.3 | 2 +- secure/lib/libcrypto/man/man3/EC_GROUP_new.3 | 2 +- .../lib/libcrypto/man/man3/EC_KEY_get_enc_flags.3 | 2 +- secure/lib/libcrypto/man/man3/EC_KEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/EC_POINT_add.3 | 2 +- secure/lib/libcrypto/man/man3/EC_POINT_new.3 | 2 +- secure/lib/libcrypto/man/man3/ENGINE_add.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_GET_LIB.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_clear_error.3 | 4 +- secure/lib/libcrypto/man/man3/ERR_error_string.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_get_error.3 | 2 +- .../libcrypto/man/man3/ERR_load_crypto_strings.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_load_strings.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_print_errors.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_put_error.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_remove_state.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_set_mark.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_BytesToKey.3 | 4 +- .../man/man3/EVP_CIPHER_CTX_get_cipher_data.3 | 2 +- .../lib/libcrypto/man/man3/EVP_CIPHER_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_DigestSignInit.3 | 2 +- .../lib/libcrypto/man/man3/EVP_DigestVerifyInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_EncodeInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_EncryptInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_MD_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_OpenInit.3 | 2 +- .../lib/libcrypto/man/man3/EVP_PKEY_ASN1_METHOD.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_ctrl.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_new.3 | 2 +- .../man/man3/EVP_PKEY_CTX_set1_pbe_pass.3 | 4 +- .../libcrypto/man/man3/EVP_PKEY_CTX_set_hkdf_md.3 | 2 +- .../man/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_CTX_set_scrypt_N.3 | 2 +- .../man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_asn1_get_count.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_derive.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_encrypt.3 | 2 +- .../man/man3/EVP_PKEY_get_default_digest_nid.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_PKEY_keygen.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_meth_get_count.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_new.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_print_private.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_set1_RSA.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_sign.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_size.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_verify.3 | 2 +- .../libcrypto/man/man3/EVP_PKEY_verify_recover.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_SealInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_SignInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_VerifyInit.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_aes.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_aria.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_bf_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_blake2b512.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_camellia.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_cast5_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_chacha20.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_des.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_desx_cbc.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_idea_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md2.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_md4.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_md5.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_mdc2.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_rc2_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc4.3 | 2 +- .../lib/libcrypto/man/man3/EVP_rc5_32_12_16_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_ripemd160.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_seed_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha1.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_sha224.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha3_224.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sm3.3 | 4 +- secure/lib/libcrypto/man/man3/EVP_sm4_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_whirlpool.3 | 4 +- secure/lib/libcrypto/man/man3/HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/MD5.3 | 2 +- secure/lib/libcrypto/man/man3/MDC2_Init.3 | 2 +- secure/lib/libcrypto/man/man3/Makefile | 3 + secure/lib/libcrypto/man/man3/OBJ_nid2obj.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_REQUEST_new.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_cert_to_id.3 | 2 +- .../libcrypto/man/man3/OCSP_request_add1_nonce.3 | 2 +- .../lib/libcrypto/man/man3/OCSP_resp_find_status.3 | 2 +- .../lib/libcrypto/man/man3/OCSP_response_status.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_sendreq_new.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_Applink.3 | 4 +- .../lib/libcrypto/man/man3/OPENSSL_LH_COMPFUNC.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_LH_stats.3 | 2 +- .../libcrypto/man/man3/OPENSSL_VERSION_NUMBER.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_config.3 | 2 +- .../lib/libcrypto/man/man3/OPENSSL_fork_prepare.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_ia32cap.3 | 4 +- .../lib/libcrypto/man/man3/OPENSSL_init_crypto.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_init_ssl.3 | 4 +- .../libcrypto/man/man3/OPENSSL_instrument_bus.3 | 2 +- .../man/man3/OPENSSL_load_builtin_modules.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_malloc.3 | 2 +- .../lib/libcrypto/man/man3/OPENSSL_secure_malloc.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_INFO.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_LOADER.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_SEARCH.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_expect.3 | 2 +- secure/lib/libcrypto/man/man3/OSSL_STORE_open.3 | 2 +- .../man/man3/OpenSSL_add_all_algorithms.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_bytes_read_bio.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_CMS.3 | 2 +- .../libcrypto/man/man3/PEM_read_bio_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_bio_ex.3 | 2 +- .../libcrypto/man/man3/PEM_write_bio_CMS_stream.3 | 4 +- .../man/man3/PEM_write_bio_PKCS7_stream.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS12_create.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS12_newpass.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS12_parse.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS5_PBKDF2_HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_decrypt.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS7_encrypt.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS7_sign.3 | 4 +- .../lib/libcrypto/man/man3/PKCS7_sign_add_signer.3 | 4 +- secure/lib/libcrypto/man/man3/PKCS7_verify.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_generate.3 | 2 +- .../lib/libcrypto/man/man3/RAND_DRBG_get0_master.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_new.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_reseed.3 | 2 +- .../libcrypto/man/man3/RAND_DRBG_set_callbacks.3 | 2 +- .../lib/libcrypto/man/man3/RAND_DRBG_set_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_add.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_bytes.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_cleanup.3 | 4 +- secure/lib/libcrypto/man/man3/RAND_egd.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_load_file.3 | 2 +- .../lib/libcrypto/man/man3/RAND_set_rand_method.3 | 2 +- secure/lib/libcrypto/man/man3/RC4_set_key.3 | 2 +- secure/lib/libcrypto/man/man3/RIPEMD160_Init.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_blinding_on.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_check_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_generate_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_get0_key.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_new.3 | 2 +- .../man/man3/RSA_padding_add_PKCS1_type_1.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_print.3 | 2 +- .../lib/libcrypto/man/man3/RSA_private_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_public_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_set_method.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_sign.3 | 2 +- .../man/man3/RSA_sign_ASN1_OCTET_STRING.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_size.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_new.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_print.3 | 2 +- secure/lib/libcrypto/man/man3/SCT_validate.3 | 2 +- secure/lib/libcrypto/man/man3/SHA256_Init.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_read_CMS.3 | 4 +- secure/lib/libcrypto/man/man3/SMIME_read_PKCS7.3 | 4 +- secure/lib/libcrypto/man/man3/SMIME_write_CMS.3 | 4 +- secure/lib/libcrypto/man/man3/SMIME_write_PKCS7.3 | 4 +- .../lib/libcrypto/man/man3/SSL_CIPHER_get_name.3 | 2 +- .../man/man3/SSL_COMP_add_compression_method.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_new.3 | 2 +- .../libcrypto/man/man3/SSL_CONF_CTX_set1_prefix.3 | 4 +- .../libcrypto/man/man3/SSL_CONF_CTX_set_flags.3 | 2 +- .../libcrypto/man/man3/SSL_CONF_CTX_set_ssl_ctx.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_cmd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_cmd_argv.3 | 4 +- .../libcrypto/man/man3/SSL_CTX_add1_chain_cert.3 | 2 +- .../man/man3/SSL_CTX_add_extra_chain_cert.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_add_session.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_config.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_ctrl.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_dane_enable.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_flush_sessions.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_CTX_free.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_CTX_get0_param.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_get_verify_mode.3 | 2 +- .../man/man3/SSL_CTX_has_client_custom_ext.3 | 4 +- .../man/man3/SSL_CTX_load_verify_locations.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_new.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_sess_number.3 | 2 +- .../man/man3/SSL_CTX_sess_set_cache_size.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_sess_set_get_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sessions.3 | 4 +- .../lib/libcrypto/man/man3/SSL_CTX_set0_CA_list.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set1_curves.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set1_sigalgs.3 | 2 +- .../man/man3/SSL_CTX_set1_verify_cert_store.3 | 2 +- .../man/man3/SSL_CTX_set_alpn_select_cb.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_cert_cb.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_cert_store.3 | 2 +- .../man/man3/SSL_CTX_set_cert_verify_callback.3 | 4 +- .../libcrypto/man/man3/SSL_CTX_set_cipher_list.3 | 2 +- .../man/man3/SSL_CTX_set_client_cert_cb.3 | 2 +- .../man/man3/SSL_CTX_set_client_hello_cb.3 | 2 +- .../man/man3/SSL_CTX_set_ct_validation_callback.3 | 2 +- .../man/man3/SSL_CTX_set_ctlog_list_file.3 | 2 +- .../man/man3/SSL_CTX_set_default_passwd_cb.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_ex_data.3 | 2 +- .../man/man3/SSL_CTX_set_generate_session_id.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_info_callback.3 | 2 +- .../man/man3/SSL_CTX_set_keylog_callback.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_max_cert_list.3 | 2 +- .../man/man3/SSL_CTX_set_min_proto_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_mode.3 | 20 +- .../libcrypto/man/man3/SSL_CTX_set_msg_callback.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_num_tickets.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_options.3 | 2 +- .../man/man3/SSL_CTX_set_psk_client_callback.3 | 2 +- .../man/man3/SSL_CTX_set_quiet_shutdown.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_read_ahead.3 | 2 +- .../man/man3/SSL_CTX_set_record_padding_callback.3 | 14 +- .../man/man3/SSL_CTX_set_security_level.3 | 2 +- .../man/man3/SSL_CTX_set_session_cache_mode.3 | 2 +- .../man/man3/SSL_CTX_set_session_id_context.3 | 2 +- .../man/man3/SSL_CTX_set_session_ticket_cb.3 | 2 +- .../man/man3/SSL_CTX_set_split_send_fragment.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_set_ssl_version.3 | 2 +- .../SSL_CTX_set_stateless_cookie_generate_cb.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_timeout.3 | 2 +- .../man3/SSL_CTX_set_tlsext_servername_callback.3 | 2 +- .../man/man3/SSL_CTX_set_tlsext_status_cb.3 | 2 +- .../man/man3/SSL_CTX_set_tlsext_ticket_key_cb.3 | 4 +- .../man/man3/SSL_CTX_set_tlsext_use_srtp.3 | 2 +- .../man/man3/SSL_CTX_set_tmp_dh_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_verify.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_use_certificate.3 | 2 +- .../man/man3/SSL_CTX_use_psk_identity_hint.3 | 2 +- .../libcrypto/man/man3/SSL_CTX_use_serverinfo.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_free.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_get0_cipher.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_get0_hostname.3 | 2 +- .../man/man3/SSL_SESSION_get0_id_context.3 | 2 +- .../lib/libcrypto/man/man3/SSL_SESSION_get0_peer.3 | 4 +- .../man/man3/SSL_SESSION_get_compress_id.3 | 4 +- .../libcrypto/man/man3/SSL_SESSION_get_ex_data.3 | 2 +- .../man/man3/SSL_SESSION_get_protocol_version.3 | 2 +- .../lib/libcrypto/man/man3/SSL_SESSION_get_time.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_has_ticket.3 | 2 +- .../libcrypto/man/man3/SSL_SESSION_is_resumable.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_SESSION_print.3 | 2 +- .../lib/libcrypto/man/man3/SSL_SESSION_set1_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_accept.3 | 4 +- .../lib/libcrypto/man/man3/SSL_alert_type_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_alloc_buffers.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_check_chain.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_clear.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_connect.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_do_handshake.3 | 4 +- .../man/man3/SSL_export_keying_material.3 | 2 +- .../libcrypto/man/man3/SSL_extension_supported.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_free.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get0_peer_scts.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_SSL_CTX.3 | 4 +- .../lib/libcrypto/man/man3/SSL_get_all_async_fds.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_ciphers.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_client_random.3 | 2 +- .../libcrypto/man/man3/SSL_get_current_cipher.3 | 2 +- .../libcrypto/man/man3/SSL_get_default_timeout.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_error.3 | 4 +- .../lib/libcrypto/man/man3/SSL_get_extms_support.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_fd.3 | 2 +- .../libcrypto/man/man3/SSL_get_peer_cert_chain.3 | 2 +- .../libcrypto/man/man3/SSL_get_peer_certificate.3 | 4 +- .../man/man3/SSL_get_peer_signature_nid.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_peer_tmp_key.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_psk_identity.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_rbio.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_session.3 | 2 +- .../libcrypto/man/man3/SSL_get_shared_sigalgs.3 | 2 +- .../lib/libcrypto/man/man3/SSL_get_verify_result.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_get_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_in_init.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_key_update.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_library_init.3 | 2 +- .../libcrypto/man/man3/SSL_load_client_CA_file.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_pending.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_read.3 | 2 +- .../lib/libcrypto/man/man3/SSL_read_early_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_rstate_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_session_reused.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_set1_host.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_bio.3 | 2 +- .../lib/libcrypto/man/man3/SSL_set_connect_state.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_fd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_session.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_set_shutdown.3 | 2 +- .../lib/libcrypto/man/man3/SSL_set_verify_result.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_shutdown.3 | 4 +- secure/lib/libcrypto/man/man3/SSL_state_string.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_want.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_write.3 | 29 ++- secure/lib/libcrypto/man/man3/UI_STRING.3 | 2 +- secure/lib/libcrypto/man/man3/UI_UTIL_read_pw.3 | 2 +- secure/lib/libcrypto/man/man3/UI_create_method.3 | 2 +- secure/lib/libcrypto/man/man3/UI_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509V3_get_d2i.3 | 2 +- secure/lib/libcrypto/man/man3/X509_ALGOR_dup.3 | 2 +- .../libcrypto/man/man3/X509_CRL_get0_by_serial.3 | 2 +- .../libcrypto/man/man3/X509_EXTENSION_set_object.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP.3 | 2 +- .../lib/libcrypto/man/man3/X509_LOOKUP_hash_dir.3 | 2 +- .../lib/libcrypto/man/man3/X509_LOOKUP_meth_new.3 | 2 +- .../man/man3/X509_NAME_ENTRY_get_object.3 | 2 +- .../man/man3/X509_NAME_add_entry_by_txt.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_get0_der.3 | 4 +- .../man/man3/X509_NAME_get_index_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_print_ex.3 | 2 +- secure/lib/libcrypto/man/man3/X509_PUBKEY_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_SIG_get0.3 | 2 +- .../libcrypto/man/man3/X509_STORE_CTX_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_new.3 | 2 +- .../man/man3/X509_STORE_CTX_set_verify_cb.3 | 2 +- .../lib/libcrypto/man/man3/X509_STORE_add_cert.3 | 2 +- .../lib/libcrypto/man/man3/X509_STORE_get0_param.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_new.3 | 2 +- .../man/man3/X509_STORE_set_verify_cb_func.3 | 2 +- .../man/man3/X509_VERIFY_PARAM_set_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_ca.3 | 4 +- secure/lib/libcrypto/man/man3/X509_check_host.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_issued.3 | 4 +- .../libcrypto/man/man3/X509_check_private_key.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_purpose.3 | 4 +- secure/lib/libcrypto/man/man3/X509_cmp.3 | 2 +- secure/lib/libcrypto/man/man3/X509_cmp_time.3 | 2 +- secure/lib/libcrypto/man/man3/X509_digest.3 | 2 +- secure/lib/libcrypto/man/man3/X509_dup.3 | 2 +- .../lib/libcrypto/man/man3/X509_get0_notBefore.3 | 2 +- .../lib/libcrypto/man/man3/X509_get0_signature.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_uids.3 | 4 +- .../libcrypto/man/man3/X509_get_extension_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_pubkey.3 | 2 +- .../lib/libcrypto/man/man3/X509_get_serialNumber.3 | 2 +- .../lib/libcrypto/man/man3/X509_get_subject_name.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_version.3 | 2 +- secure/lib/libcrypto/man/man3/X509_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_sign.3 | 2 +- secure/lib/libcrypto/man/man3/X509_verify_cert.3 | 4 +- .../lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_DHparams.3 | 2 +- .../libcrypto/man/man3/d2i_PKCS8PrivateKey_bio.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_SSL_SESSION.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_X509.3 | 2 +- secure/lib/libcrypto/man/man3/i2d_CMS_bio_stream.3 | 4 +- .../lib/libcrypto/man/man3/i2d_PKCS7_bio_stream.3 | 4 +- secure/lib/libcrypto/man/man3/i2d_re_X509_tbs.3 | 2 +- secure/lib/libcrypto/man/man3/o2i_SCT_LIST.3 | 2 +- secure/lib/libcrypto/man/man5/x509v3_config.5 | 2 +- secure/lib/libcrypto/man/man7/Ed25519.7 | 2 +- secure/lib/libcrypto/man/man7/RAND.7 | 4 +- secure/lib/libcrypto/man/man7/RAND_DRBG.7 | 4 +- secure/lib/libcrypto/man/man7/RSA-PSS.7 | 4 +- secure/lib/libcrypto/man/man7/SM2.7 | 4 +- secure/lib/libcrypto/man/man7/X25519.7 | 2 +- secure/lib/libcrypto/man/man7/bio.7 | 4 +- secure/lib/libcrypto/man/man7/ct.7 | 4 +- secure/lib/libcrypto/man/man7/des_modes.7 | 4 +- secure/lib/libcrypto/man/man7/evp.7 | 4 +- secure/lib/libcrypto/man/man7/ossl_store-file.7 | 4 +- secure/lib/libcrypto/man/man7/ossl_store.7 | 4 +- .../lib/libcrypto/man/man7/passphrase-encoding.7 | 4 +- secure/lib/libcrypto/man/man7/proxy-certificates.7 | 4 +- secure/lib/libcrypto/man/man7/scrypt.7 | 4 +- secure/lib/libcrypto/man/man7/ssl.7 | 4 +- secure/lib/libcrypto/man/man7/x509.7 | 4 +- secure/usr.bin/openssl/man/CA.pl.1 | 4 +- secure/usr.bin/openssl/man/asn1parse.1 | 2 +- secure/usr.bin/openssl/man/ca.1 | 2 +- secure/usr.bin/openssl/man/ciphers.1 | 2 +- secure/usr.bin/openssl/man/cms.1 | 2 +- secure/usr.bin/openssl/man/crl.1 | 2 +- secure/usr.bin/openssl/man/crl2pkcs7.1 | 2 +- secure/usr.bin/openssl/man/dgst.1 | 2 +- secure/usr.bin/openssl/man/dhparam.1 | 2 +- secure/usr.bin/openssl/man/dsa.1 | 2 +- secure/usr.bin/openssl/man/dsaparam.1 | 2 +- secure/usr.bin/openssl/man/ec.1 | 2 +- secure/usr.bin/openssl/man/ecparam.1 | 2 +- secure/usr.bin/openssl/man/enc.1 | 2 +- secure/usr.bin/openssl/man/engine.1 | 2 +- secure/usr.bin/openssl/man/errstr.1 | 2 +- secure/usr.bin/openssl/man/gendsa.1 | 2 +- secure/usr.bin/openssl/man/genpkey.1 | 2 +- secure/usr.bin/openssl/man/genrsa.1 | 2 +- secure/usr.bin/openssl/man/list.1 | 2 +- secure/usr.bin/openssl/man/nseq.1 | 2 +- secure/usr.bin/openssl/man/ocsp.1 | 2 +- secure/usr.bin/openssl/man/openssl.1 | 4 +- secure/usr.bin/openssl/man/passwd.1 | 2 +- secure/usr.bin/openssl/man/pkcs12.1 | 2 +- secure/usr.bin/openssl/man/pkcs7.1 | 2 +- secure/usr.bin/openssl/man/pkcs8.1 | 2 +- secure/usr.bin/openssl/man/pkey.1 | 2 +- secure/usr.bin/openssl/man/pkeyparam.1 | 2 +- secure/usr.bin/openssl/man/pkeyutl.1 | 2 +- secure/usr.bin/openssl/man/prime.1 | 2 +- secure/usr.bin/openssl/man/rand.1 | 2 +- secure/usr.bin/openssl/man/req.1 | 2 +- secure/usr.bin/openssl/man/rsa.1 | 2 +- secure/usr.bin/openssl/man/rsautl.1 | 2 +- secure/usr.bin/openssl/man/s_client.1 | 2 +- secure/usr.bin/openssl/man/s_server.1 | 2 +- secure/usr.bin/openssl/man/s_time.1 | 2 +- secure/usr.bin/openssl/man/sess_id.1 | 2 +- secure/usr.bin/openssl/man/smime.1 | 2 +- secure/usr.bin/openssl/man/speed.1 | 2 +- secure/usr.bin/openssl/man/spkac.1 | 2 +- secure/usr.bin/openssl/man/srp.1 | 2 +- secure/usr.bin/openssl/man/storeutl.1 | 2 +- secure/usr.bin/openssl/man/ts.1 | 2 +- secure/usr.bin/openssl/man/tsget.1 | 2 +- secure/usr.bin/openssl/man/verify.1 | 2 +- secure/usr.bin/openssl/man/version.1 | 2 +- secure/usr.bin/openssl/man/x509.1 | 2 +- 537 files changed, 1269 insertions(+), 644 deletions(-) diff --git a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 index 787f87e8f013..048d4fc2b64b 100644 --- a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 +++ b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 index 4277347439b2..135a622a91c8 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 index f469ec947480..9ac1969ef577 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 index 3e36faa9efcc..f5a4c0f68510 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 index af133ca346e2..9b9613637d3a 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 index 1976aa20db2a..ad33ca4b7b2a 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 index 15a6dfc41f63..f2c2afe53015 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 index 193dd4715024..d2394acf12e7 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 index fc26c41498f0..562929c6cd9f 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 index bbcf08b8fdd4..930a32de6d33 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 index bb8ab5bebd01..c139f0a79d4a 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 index ab3b56231eba..b09d540d97e5 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 index f9bb9aea0fe9..0917cbf28d0a 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BF_encrypt.3 b/secure/lib/libcrypto/man/man3/BF_encrypt.3 index 263e9f4aee6a..1e67cea75097 100644 --- a/secure/lib/libcrypto/man/man3/BF_encrypt.3 +++ b/secure/lib/libcrypto/man/man3/BF_encrypt.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 index 4867c770113f..3f0f0cfd2170 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 index 4f6558313eaf..5df20d27fde8 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_connect.3 b/secure/lib/libcrypto/man/man3/BIO_connect.3 index 72e03a6d0908..f9fdd9b15d37 100644 --- a/secure/lib/libcrypto/man/man3/BIO_connect.3 +++ b/secure/lib/libcrypto/man/man3/BIO_connect.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 index 31c70dbb37a8..487f6d192c8c 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,13 +133,13 @@ .\" ======================================================================== .\" .IX Title "BIO_CTRL 3" -.TH BIO_CTRL 3 "2020-12-08" "1.1.1i" "OpenSSL" +.TH BIO_CTRL 3 "2021-01-21" "1.1.1i" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" -BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close, BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending, BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb \&\- BIO control operations +BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close, BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending, BIO_get_info_callback, BIO_set_info_callback, BIO_info_cb, BIO_get_ktls_send, BIO_get_ktls_recv \&\- BIO control operations .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 @@ -166,6 +166,9 @@ BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BI \& \& int BIO_get_info_callback(BIO *b, BIO_info_cb **cbp); \& int BIO_set_info_callback(BIO *b, BIO_info_cb *cb); +\& +\& int BIO_get_ktls_send(BIO *b); +\& int BIO_get_ktls_recv(BIO *b); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" @@ -204,6 +207,11 @@ return the number of pending characters in the BIOs read and write buffers. Not all BIOs support these calls. \fBBIO_ctrl_pending()\fR and \fBBIO_ctrl_wpending()\fR return a size_t type and are functions, \fBBIO_pending()\fR and \fBBIO_wpending()\fR are macros which call \fBBIO_ctrl()\fR. +.PP +\&\fBBIO_get_ktls_send()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +sending. Otherwise, it returns zero. +\&\fBBIO_get_ktls_recv()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +receiving. Otherwise, it returns zero. .SH "RETURN VALUES" .IX Header "RETURN VALUES" \&\fBBIO_reset()\fR normally returns 1 for success and 0 or \-1 for failure. File @@ -223,6 +231,11 @@ for success and \-1 for failure. .PP \&\fBBIO_pending()\fR, \fBBIO_ctrl_pending()\fR, \fBBIO_wpending()\fR and \fBBIO_ctrl_wpending()\fR return the amount of pending data. +.PP +\&\fBBIO_get_ktls_send()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +sending. Otherwise, it returns zero. +\&\fBBIO_get_ktls_recv()\fR returns 1 if the \s-1BIO\s0 is using the Kernel \s-1TLS\s0 data-path for +receiving. Otherwise, it returns zero. .SH "NOTES" .IX Header "NOTES" \&\fBBIO_flush()\fR, because it can write data may return 0 or \-1 indicating @@ -253,6 +266,10 @@ Some of the return values are ambiguous and care should be taken. In particular a return value of 0 can be returned if an operation is not supported, if an error occurred, if \s-1EOF\s0 has not been reached and in the case of \fBBIO_seek()\fR on a file \s-1BIO\s0 for a successful operation. +.SH "HISTORY" +.IX Header "HISTORY" +The \fBBIO_get_ktls_send()\fR and \fBBIO_get_ktls_recv()\fR functions were added in +OpenSSL 3.0.0. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2000\-2020 The OpenSSL Project Authors. All Rights Reserved. diff --git a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 index 6c2c7de56ed1..d42d2eb6c9ec 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_BASE64 3" -.TH BIO_F_BASE64 3 "2020-09-22" "1.1.1h" "OpenSSL" +.TH BIO_F_BASE64 3 "2020-12-08" "1.1.1i" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 index 6105f2a83361..9b4bc1c800c5 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 index ae9a6747fcb4..a26d0f5cca2f 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_f_md.3 b/secure/lib/libcrypto/man/man3/BIO_f_md.3 index 8e3cd75c5553..ba7f598a14fc 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_md.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_md.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_f_null.3 b/secure/lib/libcrypto/man/man3/BIO_f_null.3 index e01f9b021520..44d680123203 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_null.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_null.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_NULL 3" -.TH BIO_F_NULL 3 "2020-09-22" "1.1.1h" "OpenSSL" +.TH BIO_F_NULL 3 "2020-12-08" "1.1.1i" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 index 3779dfbfeba3..ce95b5d29fd3 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_find_type.3 b/secure/lib/libcrypto/man/man3/BIO_find_type.3 index 878e2c65b24f..8ed77ea8ae03 100644 --- a/secure/lib/libcrypto/man/man3/BIO_find_type.3 +++ b/secure/lib/libcrypto/man/man3/BIO_find_type.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_get_data.3 b/secure/lib/libcrypto/man/man3/BIO_get_data.3 index 4069639cc4aa..dc9eb33aba84 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_data.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_data.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 index 93a2e5521f3a..a1ff83189d93 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.41) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== diff --git a/secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 b/secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 new file mode 100644 index 000000000000..487f6d192c8c --- /dev/null +++ b/secure/lib/libcrypto/man/man3/BIO_get_ktls_recv.3 @@ -0,0 +1,280 @@ +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 *** 6634 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sat Feb 6 01:58: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 DE52F530388 for ; Sat, 6 Feb 2021 01:58: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 4DXb6z5Sjnz4rdy; Sat, 6 Feb 2021 01:58: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 8F3911385; Sat, 6 Feb 2021 01:58: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 1161wprR054171; Sat, 6 Feb 2021 01:58:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1161wpLa054170; Sat, 6 Feb 2021 01:58:51 GMT (envelope-from git) Date: Sat, 6 Feb 2021 01:58:51 GMT Message-Id: <202102060158.1161wpLa054170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: John Baldwin Subject: git: b494fc41b79c - releng/13.0 - Disable MK_OPENSSL_KTLS for stable/13. 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: b494fc41b79c9fe1b48a19c28969a7e663a3f86d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:58:52 -0000 The branch releng/13.0 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b494fc41b79c9fe1b48a19c28969a7e663a3f86d commit b494fc41b79c9fe1b48a19c28969a7e663a3f86d Author: John Baldwin AuthorDate: 2021-02-04 21:40:25 +0000 Commit: John Baldwin CommitDate: 2021-02-06 01:58:16 +0000 Disable MK_OPENSSL_KTLS for stable/13. Due to the pending release of 13.0 and the recent bug in serf exposed by the KTLS changes, disable OpenSSL's KTLS by default. This keeps crypto/openssl in sync with main while lowering the risk of introducing instability into 13.0. Approved by: re (gjb) Discussed with: gjb (re), jkim, emaste (secteam) (cherry picked from commit 3cf25a7802a26ae3be9159c585fda6aea3d0dc08) --- share/mk/src.opts.mk | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 75405c1bc050..d01472c7fae6 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -212,6 +212,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_VERIEXEC_PASS_MANIFEST \ OFED_EXTRA \ OPENLDAP \ + OPENSSL_KTLS \ RPCBIND_WARMSTART_SUPPORT \ SORT_THREADS \ SVN \ @@ -330,13 +331,6 @@ BROKEN_OPTIONS+=LOADER_UBOOT BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA .endif -# Kernel TLS is enabled by default on amd64 -.if ${__T} == "amd64" -__DEFAULT_YES_OPTIONS+=OPENSSL_KTLS -.else -__DEFAULT_NO_OPTIONS+=OPENSSL_KTLS -.endif - .if ${__T:Mmips64*} # profiling won't work on MIPS64 because there is only assembly for o32 BROKEN_OPTIONS+=PROFILE From owner-dev-commits-src-all@freebsd.org Sat Feb 6 01:58: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 E854F52FF74 for ; Sat, 6 Feb 2021 01:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXb706DX5z4rrr; Sat, 6 Feb 2021 01:58: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 AE55C1386; Sat, 6 Feb 2021 01:58: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 1161wqir054189; Sat, 6 Feb 2021 01:58:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1161wq2T054188; Sat, 6 Feb 2021 01:58:52 GMT (envelope-from git) Date: Sat, 6 Feb 2021 01:58:52 GMT Message-Id: <202102060158.1161wq2T054188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: John Baldwin Subject: git: 9fb4377f4102 - releng/13.0 - Regenerate src.conf(5). 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/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 9fb4377f4102c02207b4231af76b0e9522fe1230 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 01:58:53 -0000 The branch releng/13.0 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9fb4377f4102c02207b4231af76b0e9522fe1230 commit 9fb4377f4102c02207b4231af76b0e9522fe1230 Author: John Baldwin AuthorDate: 2021-02-04 21:47:26 +0000 Commit: John Baldwin CommitDate: 2021-02-06 01:58:26 +0000 Regenerate src.conf(5). Approved by: re (gjb) (cherry picked from commit ab537343065a6925e62001165a4743a17e050118) --- share/man/man5/src.conf.5 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index a3802b59a3f5..90905413175e 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1309,6 +1309,8 @@ When set, these options are also in effect: .Va WITH_GSSAPI is set explicitly) .El +.It Va WITH_OPENSSL_KTLS +Set to include kernel TLS support in OpenSSL. .It Va WITHOUT_PAM Set to not build PAM library and modules. .Bf -symbolic From owner-dev-commits-src-all@freebsd.org Sat Feb 6 02:27: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 BB0A0530CAF; Sat, 6 Feb 2021 02:27: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 4DXblk4t2qz4trk; Sat, 6 Feb 2021 02:27: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 95FEA1360; Sat, 6 Feb 2021 02:27: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 1162REmR093199; Sat, 6 Feb 2021 02:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1162REuL093198; Sat, 6 Feb 2021 02:27:14 GMT (envelope-from git) Date: Sat, 6 Feb 2021 02:27:14 GMT Message-Id: <202102060227.1162REuL093198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Kubaj Subject: git: 8b804ee616b4 - main - powerpc64le: readd COMPAT_FREEBSD11 and COMPAT_FREEBSD12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b804ee616b4c8810015b69e37e31ef0c4161511 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:27:14 -0000 The branch main has been updated by pkubaj (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8b804ee616b4c8810015b69e37e31ef0c4161511 commit 8b804ee616b4c8810015b69e37e31ef0c4161511 Author: Piotr Kubaj AuthorDate: 2021-02-06 02:21:55 +0000 Commit: Piotr Kubaj CommitDate: 2021-02-06 02:21:55 +0000 powerpc64le: readd COMPAT_FREEBSD11 and COMPAT_FREEBSD12 lang/rust needs COMPAT_FREEBSD11 to build, even though powerpc64le itself is supported only since 13.0. I also corrected a comment, because if we ever have lib32 for powerpc64le, it will be for powerpcle. Reviewed by: bdragon (on IRC) --- sys/powerpc/conf/GENERIC64LE | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 2e16ff5d5edb..fc4fc4ceac7c 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -65,7 +65,9 @@ options TMPFS #Efficient memory filesystem options GEOM_PART_APM #Apple Partition Maps. options GEOM_PART_GPT #GUID Partition Tables. options GEOM_LABEL #Provides labelization -#options COMPAT_FREEBSD32 #Compatible with FreeBSD/powerpc binaries +#options COMPAT_FREEBSD32 #Compatible with FreeBSD/powerpcle binaries +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support From owner-dev-commits-src-all@freebsd.org Sat Feb 6 02: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 299E1531294; Sat, 6 Feb 2021 02: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 4DXbvF6xdzz4vLL; Sat, 6 Feb 2021 02:33: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 E07351C04; Sat, 6 Feb 2021 02: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 1162XjiH005858; Sat, 6 Feb 2021 02: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 1162XjpB005857; Sat, 6 Feb 2021 02:33:45 GMT (envelope-from git) Date: Sat, 6 Feb 2021 02:33:45 GMT Message-Id: <202102060233.1162XjpB005857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Kubaj Subject: git: 154207a59bd2 - stable/13 - powerpc64le: readd COMPAT_FREEBSD11 and COMPAT_FREEBSD12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 154207a59bd296d7192c9e4659d64992606e9cd2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:33:46 -0000 The branch stable/13 has been updated by pkubaj (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=154207a59bd296d7192c9e4659d64992606e9cd2 commit 154207a59bd296d7192c9e4659d64992606e9cd2 Author: Piotr Kubaj AuthorDate: 2021-02-06 02:21:55 +0000 Commit: Piotr Kubaj CommitDate: 2021-02-06 02:33:36 +0000 powerpc64le: readd COMPAT_FREEBSD11 and COMPAT_FREEBSD12 lang/rust needs COMPAT_FREEBSD11 to build, even though powerpc64le itself is supported only since 13.0. I also corrected a comment, because if we ever have lib32 for powerpc64le, it will be for powerpcle. Reviewed by: bdragon (on IRC) (cherry picked from commit 8b804ee616b4c8810015b69e37e31ef0c4161511) --- sys/powerpc/conf/GENERIC64LE | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index fd87f22df334..d3b00a63c31f 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -65,7 +65,9 @@ options TMPFS #Efficient memory filesystem options GEOM_PART_APM #Apple Partition Maps. options GEOM_PART_GPT #GUID Partition Tables. options GEOM_LABEL #Provides labelization -#options COMPAT_FREEBSD32 #Compatible with FreeBSD/powerpc binaries +#options COMPAT_FREEBSD32 #Compatible with FreeBSD/powerpcle binaries +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support From owner-dev-commits-src-all@freebsd.org Sat Feb 6 02:40: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 DF38453148D; Sat, 6 Feb 2021 02:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXc2m62hJz4vjr; Sat, 6 Feb 2021 02:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1CE31A87; Sat, 6 Feb 2021 02:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1162eGQc012156; Sat, 6 Feb 2021 02:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1162eGuu012146; Sat, 6 Feb 2021 02:40:16 GMT (envelope-from git) Date: Sat, 6 Feb 2021 02:40:16 GMT Message-Id: <202102060240.1162eGuu012146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: e673debe7db8 - main - Simplify BSD macro tests. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e673debe7db8ba95e4ee3b549d2570e71d19b596 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:40:16 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=e673debe7db8ba95e4ee3b549d2570e71d19b596 commit e673debe7db8ba95e4ee3b549d2570e71d19b596 Author: Cy Schubert AuthorDate: 2021-02-03 03:18:48 +0000 Commit: Cy Schubert CommitDate: 2021-02-06 02:39:38 +0000 Simplify BSD macro tests. All FreeBSD and NetBSD are BSD >= 199306 and have been for a long time. MFC after: 1 week --- contrib/ipfilter/ipsend/sbpf.c | 3 --- contrib/ipfilter/ipsend/sock.c | 4 ---- contrib/ipfilter/man/ipf.4 | 4 ++-- contrib/ipfilter/tools/ipfsyncd.c | 2 +- contrib/ipfilter/tools/ipmon.c | 2 +- sys/contrib/ipfilter/netinet/ip_compat.h | 4 ++-- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 4 ---- sys/contrib/ipfilter/netinet/ip_log.c | 2 +- sys/contrib/ipfilter/netinet/mlfk_ipl.c | 8 -------- 9 files changed, 7 insertions(+), 26 deletions(-) diff --git a/contrib/ipfilter/ipsend/sbpf.c b/contrib/ipfilter/ipsend/sbpf.c index fcb66bc9ca2f..97559650f3b4 100644 --- a/contrib/ipfilter/ipsend/sbpf.c +++ b/contrib/ipfilter/ipsend/sbpf.c @@ -12,9 +12,6 @@ #include #include #include -#if BSD < 199103 -#include -#endif #if (__FreeBSD_version >= 300000) # include #else diff --git a/contrib/ipfilter/ipsend/sock.c b/contrib/ipfilter/ipsend/sock.c index a39f9de16345..ddb59eb029f8 100644 --- a/contrib/ipfilter/ipsend/sock.c +++ b/contrib/ipfilter/ipsend/sock.c @@ -95,11 +95,7 @@ struct proc *proc; #endif -#if BSD < 199103 -static struct proc *getproc(void); -#else static struct kinfo_proc *getproc(void); -#endif int kmemcpy(buf, pos, n) diff --git a/contrib/ipfilter/man/ipf.4 b/contrib/ipfilter/man/ipf.4 index 9b82e01bfc76..73a17a0cc8d3 100644 --- a/contrib/ipfilter/man/ipf.4 +++ b/contrib/ipfilter/man/ipf.4 @@ -60,7 +60,7 @@ typedef struct frentry { struct frentry *fr_grp; int fr_ref; /* reference count - for grouping */ void *fr_ifa; -#if BSD >= 199306 +#ifdef BSD void *fr_oifa; #endif /* @@ -93,7 +93,7 @@ typedef struct frentry { int (*fr_func)(int, ip_t *, fr_info_t *)); char fr_icode; /* return ICMP code */ char fr_ifname[IFNAMSIZ]; -#if BSD > 199306 +#ifdef BSD char fr_oifname[IFNAMSIZ]; #endif struct frdest fr_tif; /* "to" interface */ diff --git a/contrib/ipfilter/tools/ipfsyncd.c b/contrib/ipfilter/tools/ipfsyncd.c index 0ccc15542f6b..a75075059763 100644 --- a/contrib/ipfilter/tools/ipfsyncd.c +++ b/contrib/ipfilter/tools/ipfsyncd.c @@ -131,7 +131,7 @@ main(argc, argv) if (!debuglevel) { -#if BSD >= 199306 +#ifdef BSD daemon(0, 0); #else int fd = open("/dev/null", O_RDWR); diff --git a/contrib/ipfilter/tools/ipmon.c b/contrib/ipfilter/tools/ipmon.c index f14cef832722..9022f12b6149 100644 --- a/contrib/ipfilter/tools/ipmon.c +++ b/contrib/ipfilter/tools/ipmon.c @@ -1702,7 +1702,7 @@ int main(argc, argv) if (make_daemon && ((config.log != stdout) || (ipmonopts & IPMON_SYSLOG))) { -#if BSD >= 199306 +#ifdef BSD daemon(0, !(ipmonopts & IPMON_SYSLOG)); #else int pid; diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 490e939f7f37..3de517b4559d 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -424,12 +424,12 @@ extern mb_t *allocmbt(size_t); # define USE_QUAD_T # define U_QUAD_T unsigned long long # define QUAD_T long long -#else /* BSD > 199306 */ +#else /* BSD */ # if !defined(U_QUAD_T) # define U_QUAD_T u_long # define QUAD_T long # endif -#endif /* BSD > 199306 */ +#endif /* BSD */ #ifdef USE_INET6 diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index 338c4e24c03a..39fe0933f417 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -288,14 +288,12 @@ ipfioctl(dev, cmd, data, mode, p) SPL_INT(s); CURVNET_SET(TD_TO_VNET(p)); -#if (BSD >= 199306) if (securelevel_ge(p->p_cred, 3) && (mode & FWRITE)) { V_ipfmain.ipf_interror = 130001; CURVNET_RESTORE(); return EPERM; } -#endif unit = GET_MINOR(dev); if ((IPL_LOGMAX < unit) || (unit < 0)) { @@ -382,11 +380,9 @@ ipf_send_reset(fin) } m->m_len = sizeof(*tcp2) + hlen; -#if (BSD >= 199103) m->m_data += max_linkhdr; m->m_pkthdr.len = m->m_len; m->m_pkthdr.rcvif = (struct ifnet *)0; -#endif ip = mtod(m, struct ip *); bzero((char *)ip, hlen); #ifdef USE_INET6 diff --git a/sys/contrib/ipfilter/netinet/ip_log.c b/sys/contrib/ipfilter/netinet/ip_log.c index e5bf6a78bf1b..d7acaf1ebf4e 100644 --- a/sys/contrib/ipfilter/netinet/ip_log.c +++ b/sys/contrib/ipfilter/netinet/ip_log.c @@ -734,7 +734,7 @@ ipf_log_read(softc, unit, uio) return EIO; } -# if (defined(BSD) && (BSD >= 199101)) || defined(__FreeBSD__) +# if defined(BSD) uio->uio_rw = UIO_READ; # endif diff --git a/sys/contrib/ipfilter/netinet/mlfk_ipl.c b/sys/contrib/ipfilter/netinet/mlfk_ipl.c index 0b9fdb76263e..1f4daf28824d 100644 --- a/sys/contrib/ipfilter/netinet/mlfk_ipl.c +++ b/sys/contrib/ipfilter/netinet/mlfk_ipl.c @@ -536,12 +536,8 @@ static int ipfclose(dev, flags * called during packet processing and cause an inconsistancy to appear in * the filter lists. */ -#if (BSD >= 199306) static int ipfread(dev, uio, ioflag) int ioflag; -#else -static int ipfread(dev, uio) -#endif #ifdef __FreeBSD_version struct cdev *dev; #else @@ -583,12 +579,8 @@ static int ipfread(dev, uio) * called during packet processing and cause an inconsistancy to appear in * the filter lists. */ -#if (BSD >= 199306) static int ipfwrite(dev, uio, ioflag) int ioflag; -#else -static int ipfwrite(dev, uio) -#endif #ifdef __FreeBSD_version struct cdev *dev; #else From owner-dev-commits-src-all@freebsd.org Sat Feb 6 02:40: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 EB59D5310F1; Sat, 6 Feb 2021 02:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXc2n6K9nz4vh9; Sat, 6 Feb 2021 02:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB5A61A88; Sat, 6 Feb 2021 02:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1162eHAZ012659; Sat, 6 Feb 2021 02:40:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1162eHYJ012657; Sat, 6 Feb 2021 02:40:17 GMT (envelope-from git) Date: Sat, 6 Feb 2021 02:40:17 GMT Message-Id: <202102060240.1162eHYJ012657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 10990cb46027 - main - Simplify FreeBSD check. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10990cb46027b4cc4339540b1217117863b2cd15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:40:18 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=10990cb46027b4cc4339540b1217117863b2cd15 commit 10990cb46027b4cc4339540b1217117863b2cd15 Author: Cy Schubert AuthorDate: 2021-02-03 03:24:05 +0000 Commit: Cy Schubert CommitDate: 2021-02-06 02:39:38 +0000 Simplify FreeBSD check. MFC after: 1 week --- contrib/ipfilter/ipsend/sbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ipfilter/ipsend/sbpf.c b/contrib/ipfilter/ipsend/sbpf.c index 97559650f3b4..9b4f20c3fea9 100644 --- a/contrib/ipfilter/ipsend/sbpf.c +++ b/contrib/ipfilter/ipsend/sbpf.c @@ -12,7 +12,7 @@ #include #include #include -#if (__FreeBSD_version >= 300000) +#ifdef __FreeBSD_version # include #else # include From owner-dev-commits-src-all@freebsd.org Sat Feb 6 02:40: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 B598D531499; Sat, 6 Feb 2021 02:40: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 4DXc2q0pfPz4vhD; Sat, 6 Feb 2021 02:40: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 013EF191A; Sat, 6 Feb 2021 02:40: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 1162eIlH013185; Sat, 6 Feb 2021 02:40:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1162eIcl013179; Sat, 6 Feb 2021 02:40:18 GMT (envelope-from git) Date: Sat, 6 Feb 2021 02:40:18 GMT Message-Id: <202102060240.1162eIcl013179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 344f1083e128 - main - ipfilter: Use the softn (NAT softc) host map size in ip_nat6 calculation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 344f1083e128d8d41ca31853dac513ca3efd9d1f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 02:40:19 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=344f1083e128d8d41ca31853dac513ca3efd9d1f commit 344f1083e128d8d41ca31853dac513ca3efd9d1f Author: Cy Schubert AuthorDate: 2021-02-05 14:26:04 +0000 Commit: Cy Schubert CommitDate: 2021-02-06 02:39:38 +0000 ipfilter: Use the softn (NAT softc) host map size in ip_nat6 calculation. The ipfilter NAT table host map size is a tunable that defaults to a macro value defined at build time. HOSTMAP_SIZE is saved in softn (the ipnat softc) at initialization. It can be tuned (changed) at runtime using the ipf -T command. If the hostmap_size tunable is adjusted the calculation to determine where to put new entries in the table was incorrect. Use the tunable in the NAT softc instead of the static build time value. MFC after: 1 week --- sys/contrib/ipfilter/netinet/ip_nat6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/ipfilter/netinet/ip_nat6.c b/sys/contrib/ipfilter/netinet/ip_nat6.c index b2713aec812a..13fa6fb6bc30 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat6.c +++ b/sys/contrib/ipfilter/netinet/ip_nat6.c @@ -390,7 +390,7 @@ ipf_nat6_hostmap(softn, np, src, dst, map, port) hv += dst->i6[2]; hv += dst->i6[1]; hv += dst->i6[0]; - hv %= HOSTMAP_SIZE; + hv %= softn->ipf_nat_hostmap_sz; for (hm = softn->ipf_hm_maptable[hv]; hm; hm = hm->hm_next) if (IP6_EQ(&hm->hm_osrc6, src) && IP6_EQ(&hm->hm_odst6, dst) && From owner-dev-commits-src-all@freebsd.org Sat Feb 6 06:10: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 C778B53BA25; Sat, 6 Feb 2021 06:10: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 4DXhht5G5gz3Prp; Sat, 6 Feb 2021 06:10: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 A612147D9; Sat, 6 Feb 2021 06:10: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 1166A6tf085681; Sat, 6 Feb 2021 06:10:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1166A6hq085678; Sat, 6 Feb 2021 06:10:06 GMT (envelope-from git) Date: Sat, 6 Feb 2021 06:10:06 GMT Message-Id: <202102060610.1166A6hq085678@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: 6136a10e355a - stable/13 - Always clamp curve25519 keys prior to use. 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: 6136a10e355a7a837edecbccbed04c34b4bc32c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 06:10:06 -0000 The branch stable/13 has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=6136a10e355a7a837edecbccbed04c34b4bc32c9 commit 6136a10e355a7a837edecbccbed04c34b4bc32c9 Author: Peter Grehan AuthorDate: 2021-02-03 09:05:09 +0000 Commit: Peter Grehan CommitDate: 2021-02-06 04:01:18 +0000 Always clamp curve25519 keys prior to use. This fixes an issue where a private key contained bits that should have been cleared by the clamping process, but were passed through to the scalar multiplication routine and resulted in an invalid public key. Issue diagnosed (and an initial fix proposed) by shamaz.mazum in PR 252894. This fix suggested by Jason Donenfeld. PR: 252894 Reported by: shamaz.mazum (cherry picked from commit 5aaea4b99e5cc724e97e24a68876e8768d3d8012) --- sys/dev/if_wg/module/curve25519.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/if_wg/module/curve25519.c b/sys/dev/if_wg/module/curve25519.c index e21d00bd2818..16f0b0337eb6 100644 --- a/sys/dev/if_wg/module/curve25519.c +++ b/sys/dev/if_wg/module/curve25519.c @@ -767,6 +767,7 @@ void curve25519_generic(u8 out[CURVE25519_KEY_SIZE], u8 e[32]; memcpy(e, scalar, 32); + curve25519_clamp_secret(e); /* The following implementation was transcribed to Coq and proven to * correspond to unary scalar multiplication in affine coordinates given From owner-dev-commits-src-all@freebsd.org Sat Feb 6 10:11: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 DDF315434CD; Sat, 6 Feb 2021 10:11: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 4DXp3p5vD4z3v0c; Sat, 6 Feb 2021 10:11: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 BD58F7A9E; Sat, 6 Feb 2021 10: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 116ABoQf005519; Sat, 6 Feb 2021 10: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 116ABoRN005518; Sat, 6 Feb 2021 10:11:50 GMT (envelope-from git) Date: Sat, 6 Feb 2021 10:11:50 GMT Message-Id: <202102061011.116ABoRN005518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: f961caf2184c - main - netgraph/ng_bridge: Introduce "uplink" ports without MAC learning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f961caf2184c94d6f59c8d522207156b3533d977 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 10:11:50 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=f961caf2184c94d6f59c8d522207156b3533d977 commit f961caf2184c94d6f59c8d522207156b3533d977 Author: Lutz Donnerhacke AuthorDate: 2021-02-06 10:08:24 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-06 10:09:26 +0000 netgraph/ng_bridge: Introduce "uplink" ports without MAC learning The ng_bridge(4) node is designed to work in moderately small environments. Connecting such a node to a larger network rapidly fills the MAC table for no reason. It even become complicated to obtain data from the gettable message, because the result is too large to transmit. This patch introduces, two new functionality bits on the hooks: - Allow or disallow MAC address learning for incoming patckets. - Allow or disallow sending unknown MACs through this hook. Uplinks are characterized by denied learing while sending out unknowns. Normal links are charaterized by allowed learning and sending out unknowns. Reviewed by: kp Approved by: kp (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D23963 --- share/man/man4/ng_bridge.4 | 30 +++++++++++++-- sys/netgraph/ng_bridge.c | 95 +++++++++++++++++++++++++++++----------------- sys/netgraph/ng_bridge.h | 2 + 3 files changed, 89 insertions(+), 38 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index 85c2d8871c7c..b5937375e87a 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 2, 2019 +.Dd February 6, 2021 .Dt NG_BRIDGE 4 .Os .Sh NAME @@ -92,6 +92,23 @@ To connect the host machine to a bridged network, simply connect the hook of an .Xr ng_ether 4 node to the bridge node. +.Pp +Instead of naming a hook +.Dv linkX +the hook might be also named +.Dv uplinkX . +The node does not learn MAC addresses on uplink hooks, which keeps +the internal address table small. +This way it is desirable to connect the +.Dv lower +hook of an +.Xr ng_ether 4 +node to an +.Dv uplink +hook of the bridge, and ignore the complexity of the outside world. +Frames with unknown MACs are always sent out to +.Dv uplink +hooks, so no functionality is lost. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: @@ -141,8 +158,9 @@ The node configuration is not changed. This command takes a four byte link number as an argument and returns a .Dv "struct ng_bridge_link_stats" -containing statistics for the corresponding link, which must be -currently connected: +containing statistics for the corresponding +.Dv link , +which must be currently connected: .Bd -literal -offset 0n /* Statistics structure (one for each link) */ struct ng_bridge_link_stats { @@ -162,6 +180,12 @@ struct ng_bridge_link_stats { uint64_t memoryFailures; /* times couldn't get mem or mbuf */ }; .Ed +.Pp +Negative numbers refer to the +.Dv uplink +hooks. +So querying for -7 will get the statistics for hook +.Dv uplink7 . .It Dv NGM_BRIDGE_CLR_STATS Pq Ic clrstats This command takes a four byte link number as an argument and clears the statistics for that link. diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 1521b1cee901..a21da545e210 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -91,6 +91,8 @@ static MALLOC_DEFINE(M_NETGRAPH_BRIDGE, "netgraph_bridge", struct ng_bridge_link { hook_p hook; /* netgraph hook */ u_int16_t loopCount; /* loop ignore timer */ + unsigned int learnMac : 1, /* autolearn macs */ + sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_stats stats; /* link stats */ }; @@ -334,38 +336,49 @@ static int ng_bridge_newhook(node_p node, hook_p hook, const char *name) { const priv_p priv = NG_NODE_PRIVATE(node); + char linkName[NG_HOOKSIZ]; + u_int32_t linkNum; + link_p link; + const char *prefix = NG_BRIDGE_HOOK_LINK_PREFIX; + bool isUplink; /* Check for a link hook */ - if (strlen(name) > strlen(NG_BRIDGE_HOOK_LINK_PREFIX)) { - char linkName[NG_HOOKSIZ]; - u_int32_t linkNum; - link_p link; - - /* primitive parsing */ - linkNum = strtoul(name + strlen(NG_BRIDGE_HOOK_LINK_PREFIX), - NULL, 10); - /* validation by comparing against the reconstucted name */ - snprintf(linkName, sizeof(linkName), - "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, - linkNum); - if (strcmp(linkName, name) != 0) - return (EINVAL); - - if(NG_PEER_NODE(hook) == node) - return (ELOOP); - - link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, - M_WAITOK|M_ZERO); - if (link == NULL) - return (ENOMEM); - link->hook = hook; - NG_HOOK_SET_PRIVATE(hook, link); - priv->numLinks++; - return (0); + if (strlen(name) <= strlen(prefix)) + return (EINVAL); /* Unknown hook name */ + + isUplink = (name[0] == 'u'); + if (isUplink) + prefix = NG_BRIDGE_HOOK_UPLINK_PREFIX; + + /* primitive parsing */ + linkNum = strtoul(name + strlen(prefix), NULL, 10); + /* validation by comparing against the reconstucted name */ + snprintf(linkName, sizeof(linkName), "%s%u", prefix, linkNum); + if (strcmp(linkName, name) != 0) + return (EINVAL); + + if (linkNum == 0 && isUplink) + return (EINVAL); + + if(NG_PEER_NODE(hook) == node) + return (ELOOP); + + link = malloc(sizeof(*link), M_NETGRAPH_BRIDGE, M_ZERO); + if (link == NULL) + return (ENOMEM); + + link->hook = hook; + if (isUplink) { + link->learnMac = 0; + link->sendUnknown = 1; + } else { + link->learnMac = 1; + link->sendUnknown = 1; } - /* Unknown hook name */ - return (EINVAL); + NG_HOOK_SET_PRIVATE(hook, link); + priv->numLinks++; + return (0); } /* @@ -438,6 +451,11 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) i = 0; for (bucket = 0; bucket < priv->numBuckets; bucket++) { SLIST_FOREACH(hent, &priv->tab[bucket], next) { + const char *name = NG_HOOK_NAME(hent->host.link->hook); + const char *prefix = name[0] == 'u' ? + NG_BRIDGE_HOOK_UPLINK_PREFIX : + NG_BRIDGE_HOOK_LINK_PREFIX; + memcpy(ary->hosts[i].addr, hent->host.addr, sizeof(ary->hosts[i].addr)); @@ -445,9 +463,7 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) ary->hosts[i].staleness = hent->host.staleness; ary->hosts[i].linkNum = strtol( - NG_HOOK_NAME(hent->host.link->hook) + - strlen(NG_BRIDGE_HOOK_LINK_PREFIX), - NULL, 10); + name + strlen(prefix), NULL, 10); i++; } } @@ -506,15 +522,20 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) hook_p hook; link_p link; char linkName[NG_HOOKSIZ]; + int linkNum; /* Get link number */ if (msg->header.arglen != sizeof(u_int32_t)) { error = EINVAL; break; } - snprintf(linkName, sizeof(linkName), - "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, - *((u_int32_t *)msg->data)); + linkNum = *((int32_t *)msg->data); + if (linkNum < 0) + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_UPLINK_PREFIX, -linkNum); + else + snprintf(linkName, sizeof(linkName), + "%s%u", NG_BRIDGE_HOOK_LINK_PREFIX, linkNum); if ((hook = ng_findhook(node, linkName)) == NULL) { error = ENOTCONN; @@ -609,6 +630,10 @@ ng_bridge_send_ctx(hook_p dst, void *arg) return (1); } + /* Skip sending unknowns to undesired links */ + if (!ctx->manycast && !destLink->sendUnknown) + return (1); + if (ctx->foundFirst == NULL) { /* * This is the first usable link we have found. @@ -750,7 +775,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) host->link = ctx.incoming; host->age = 0; } - } else { + } else if (ctx.incoming->learnMac) { if (!ng_bridge_put(priv, eh->ether_shost, ctx.incoming)) { ctx.incoming->stats.memoryFailures++; NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h index e4b74efbfc5e..2aecf7f9f9cb 100644 --- a/sys/netgraph/ng_bridge.h +++ b/sys/netgraph/ng_bridge.h @@ -64,6 +64,8 @@ /* Hook names */ #define NG_BRIDGE_HOOK_LINK_PREFIX "link" /* append decimal integer */ #define NG_BRIDGE_HOOK_LINK_FMT "link%d" /* for use with printf(3) */ +#define NG_BRIDGE_HOOK_UPLINK_PREFIX "uplink" /* append decimal integer */ +#define NG_BRIDGE_HOOK_UPLINK_FMT "uplink%d" /* for use with printf(3) */ /* Node configuration structure */ struct ng_bridge_config { From owner-dev-commits-src-all@freebsd.org Sat Feb 6 10:36: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 4C175544156; Sat, 6 Feb 2021 10:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXpck1hVsz3wTM; Sat, 6 Feb 2021 10:36: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 2CB09102EF; Sat, 6 Feb 2021 10:36: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 116AasIU035909; Sat, 6 Feb 2021 10:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116Aas53035908; Sat, 6 Feb 2021 10:36:54 GMT (envelope-from git) Date: Sat, 6 Feb 2021 10:36:54 GMT Message-Id: <202102061036.116Aas53035908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 689561d40322 - main - ng_bridge.4: Use more suitable mandoc macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 689561d4032233bc171cff30d6756c3cf3b22720 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 10:36:54 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=689561d4032233bc171cff30d6756c3cf3b22720 commit 689561d4032233bc171cff30d6756c3cf3b22720 Author: Lutz Donnerhacke AuthorDate: 2021-02-05 21:24:06 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-06 10:36:11 +0000 ng_bridge.4: Use more suitable mandoc macros yuripv@ suggested to replace inapprobriate macros by better ones. Reviewed by: philip Approved by: philip (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28510 --- share/man/man4/ng_bridge.4 | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index b5937375e87a..1f3831e3fb75 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -79,44 +79,44 @@ mechanism on a per-link basis is not yet implemented. This node type supports an unlimited number of hooks. Each connected hook represents a bridged link. The hooks are named -.Dv link0 , -.Dv link1 , +.Ar link0 , +.Ar link1 , etc. Typically these hooks are connected to the -.Dv lower +.Ar lower hooks of one or more .Xr ng_ether 4 nodes. To connect the host machine to a bridged network, simply connect the -.Dv upper +.Ar upper hook of an .Xr ng_ether 4 node to the bridge node. .Pp Instead of naming a hook -.Dv linkX +.Ar linkX the hook might be also named -.Dv uplinkX . +.Ar uplinkX . The node does not learn MAC addresses on uplink hooks, which keeps the internal address table small. This way it is desirable to connect the -.Dv lower +.Ar lower hook of an .Xr ng_ether 4 node to an -.Dv uplink +.Ar uplink hook of the bridge, and ignore the complexity of the outside world. Frames with unknown MACs are always sent out to -.Dv uplink +.Ar uplink hooks, so no functionality is lost. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo -.It Dv NGM_BRIDGE_SET_CONFIG Pq Ic setconfig +.It Dv NGM_BRIDGE_SET_CONFIG Pq Ar setconfig Set the node configuration. This command takes a -.Dv "struct ng_bridge_config" +.Vt "struct ng_bridge_config" as an argument: .Bd -literal -offset 0n /* Node configuration structure */ @@ -129,37 +129,37 @@ struct ng_bridge_config { .Ed .Pp The -.Dv debugLevel +.Va debugLevel field sets the debug level on the node. At level of 2 or greater, detected loops are logged. The default level is 1. .Pp The -.Dv loopTimeout +.Va loopTimeout determines how long (in seconds) a looped link is muted. The default is 60 seconds. The -.Dv maxStaleness +.Va maxStaleness parameter determines how long a period of inactivity before a host's entry is forgotten. The default is 15 minutes. The -.Dv minStableAge +.Va minStableAge determines how quickly a host must jump from one link to another before we declare a loopback condition. The default is one second. -.It Dv NGM_BRIDGE_GET_CONFIG Pq Ic getconfig +.It Dv NGM_BRIDGE_GET_CONFIG Pq Ar getconfig Returns the current configuration as a -.Dv "struct ng_bridge_config" . -.It Dv NGM_BRIDGE_RESET Pq Ic reset +.Vt "struct ng_bridge_config" . +.It Dv NGM_BRIDGE_RESET Pq Ar reset Causes the node to forget all hosts and unmute all links. The node configuration is not changed. -.It Dv NGM_BRIDGE_GET_STATS Pq Ic getstats +.It Dv NGM_BRIDGE_GET_STATS Pq Ar getstats This command takes a four byte link number as an argument and returns a -.Dv "struct ng_bridge_link_stats" +.Vt "struct ng_bridge_link_stats" containing statistics for the corresponding -.Dv link , +.Ar link , which must be currently connected: .Bd -literal -offset 0n /* Statistics structure (one for each link) */ @@ -182,21 +182,21 @@ struct ng_bridge_link_stats { .Ed .Pp Negative numbers refer to the -.Dv uplink +.Ar uplink hooks. So querying for -7 will get the statistics for hook -.Dv uplink7 . -.It Dv NGM_BRIDGE_CLR_STATS Pq Ic clrstats +.Ar uplink7 . +.It Dv NGM_BRIDGE_CLR_STATS Pq Ar clrstats This command takes a four byte link number as an argument and clears the statistics for that link. -.It Dv NGM_BRIDGE_GETCLR_STATS Pq Ic getclrstats +.It Dv NGM_BRIDGE_GETCLR_STATS Pq Ar getclrstats Same as .Dv NGM_BRIDGE_GET_STATS , but also atomically clears the statistics as well. -.It Dv NGM_BRIDGE_GET_TABLE Pq Ic gettable +.It Dv NGM_BRIDGE_GET_TABLE Pq Ar gettable Returns the current host mapping table used to direct packets, in a -.Dv "struct ng_bridge_host_ary" . -.It Dv NGM_BRIDGE_SET_PERSISTENT Pq Ic setpersistent +.Vt "struct ng_bridge_host_ary" . +.It Dv NGM_BRIDGE_SET_PERSISTENT Pq Ar setpersistent This command sets the persistent flag on the node, and takes no arguments. .El .Sh SHUTDOWN From owner-dev-commits-src-all@freebsd.org Sat Feb 6 14:03: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 3BD9452A52D; Sat, 6 Feb 2021 14:03: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 4DXvCJ1D3Vz4dn8; Sat, 6 Feb 2021 14:03: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 1CB7112ACB; Sat, 6 Feb 2021 14:03: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 116E3eUm008532; Sat, 6 Feb 2021 14:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116E3edf008531; Sat, 6 Feb 2021 14:03:40 GMT (envelope-from git) Date: Sat, 6 Feb 2021 14:03:40 GMT Message-Id: <202102061403.116E3edf008531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: c869d905baa4 - main - netgraph/ng_bridge: Derive forwarding mode from first attached hook MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c869d905baa4e329dfd6793e7487b5985248ddb6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:03:40 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=c869d905baa4e329dfd6793e7487b5985248ddb6 commit c869d905baa4e329dfd6793e7487b5985248ddb6 Author: Lutz Donnerhacke AuthorDate: 2021-02-06 10:25:04 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-06 14:01:15 +0000 netgraph/ng_bridge: Derive forwarding mode from first attached hook Handling of unknown MACs on an bridge with incomplete learning capabilites (aka uplink ports) can be defined in different ways. The classical approach is to broadcast unicast frames send to an unknown MAC, because the unknown devices can be everywhere. This mode is default for ng_bridge(4). In the case of dedicated uplink ports, which prohibit learning of MAC addresses in order to save memory and CPU cycles, the broadcast approach is dangerous. All traffic to the uplink port is broadcasted to every downlink port, too. In this case, it's better to restrict the distribution of frames to unknown MAC to the uplink ports only. In order to keep the chance small and the handling as natural as possible, the first attached link is used to determine the behaviour of the bridge: If it is an "uplink" port, then the bridge switch from classical mode to restricted mode. Reviewed By: kp Approved by: kp (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28487 --- share/man/man4/ng_bridge.4 | 16 ++++++++++++++++ sys/netgraph/ng_bridge.c | 8 ++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ng_bridge.4 b/share/man/man4/ng_bridge.4 index 1f3831e3fb75..be128d62c938 100644 --- a/share/man/man4/ng_bridge.4 +++ b/share/man/man4/ng_bridge.4 @@ -109,6 +109,22 @@ hook of the bridge, and ignore the complexity of the outside world. Frames with unknown MACs are always sent out to .Ar uplink hooks, so no functionality is lost. +.Pp +Frames with unknown destination MAC addresses are replicated to any +available hook, unless the first connected hook is an +.Ar uplink +hook. +In this case the node assumes, that all unknown MAC addresses are +located soley on the +.Ar uplink +hooks and only those hooks will be used to send out frames with +unknown destination MACs. +If the first connected hook is an +.Ar link +hook, the node will replicate such frames to all types of hooks, +even if +.Ar uplink +hooks are connected later. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index a21da545e210..ed08020ead70 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -105,7 +105,8 @@ struct ng_bridge_private { u_int numBuckets; /* num buckets in table */ u_int hashMask; /* numBuckets - 1 */ int numLinks; /* num connected links */ - int persistent; /* can exist w/o hooks */ + unsigned int persistent : 1, /* can exist w/o hooks */ + sendUnknown : 1;/* links receive unknowns by default */ struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; @@ -309,6 +310,7 @@ ng_bridge_constructor(node_p node) priv->conf.loopTimeout = DEFAULT_LOOP_TIMEOUT; priv->conf.maxStaleness = DEFAULT_MAX_STALENESS; priv->conf.minStableAge = DEFAULT_MIN_STABLE_AGE; + priv->sendUnknown = 1; /* classic bridge */ /* * This node has all kinds of stuff that could be screwed by SMP. @@ -371,9 +373,11 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) if (isUplink) { link->learnMac = 0; link->sendUnknown = 1; + if (priv->numLinks == 0) /* if the first link is an uplink */ + priv->sendUnknown = 0; /* switch to restrictive mode */ } else { link->learnMac = 1; - link->sendUnknown = 1; + link->sendUnknown = priv->sendUnknown; } NG_HOOK_SET_PRIVATE(hook, link); From owner-dev-commits-src-all@freebsd.org Sat Feb 6 14:58: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 18BF752B99C for ; Sat, 6 Feb 2021 14:58: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 4DXwQj73BCz4hT2; Sat, 6 Feb 2021 14:58: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 E47AE134ED; Sat, 6 Feb 2021 14:58: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 116Ewb4C074841; Sat, 6 Feb 2021 14:58:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116EwbDM074840; Sat, 6 Feb 2021 14:58:37 GMT (envelope-from git) Date: Sat, 6 Feb 2021 14:58:37 GMT Message-Id: <202102061458.116EwbDM074840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Philip Paeps Subject: git: cf60d924183f - internal/admin - mentors: release donner from mentorship 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/internal/admin X-Git-Reftype: branch X-Git-Commit: cf60d924183f886ccebb618bd794270be2ad1a73 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:58:38 -0000 The branch internal/admin has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=cf60d924183f886ccebb618bd794270be2ad1a73 commit cf60d924183f886ccebb618bd794270be2ad1a73 Author: Philip Paeps AuthorDate: 2021-02-06 14:53:11 +0000 Commit: Philip Paeps CommitDate: 2021-02-06 14:58:17 +0000 mentors: release donner from mentorship Lutz has proved himself more than capable of committing without his mentors holding him back. :-) Approved by: kp (co-mentor), core (implicit) --- mentors | 1 - 1 file changed, 1 deletion(-) diff --git a/mentors b/mentors index 2c3772f009bb..09d7a232a7ea 100644 --- a/mentors +++ b/mentors @@ -14,7 +14,6 @@ afedorov vmaffione Co-mentor: jhb anish jhb brd allanjude Co-mentor: bapt bryanv grehan -donner kp Co-mentor: philip gordon delphij Co-mentor: emaste jceel trasz jkh rwatson From owner-dev-commits-src-all@freebsd.org Sat Feb 6 15:25: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 97DC352C524; Sat, 6 Feb 2021 15:25:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 4DXx2H3rNRz4kfJ; Sat, 6 Feb 2021 15:25:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f180.google.com with SMTP id p15so8675401ilq.8; Sat, 06 Feb 2021 07:25:59 -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=vy4GTvvNAFT3z5DkrqecsrjGsm/rLFeMlcpdqJQaZ+k=; b=aGxSJQNar/K20th/Azj3Yfs8jxjSEim35ysBUwOy2o+dhoDQWQwiCegeo6uvTFvGFl 7+BsWo+I017ThmcX0QDgHskpEdjLbeoJTrC+87MpKQIGtg+3ZFI/x36sD9Eb6LdL+wiI RBk0nP5FpBiR11Gzfo6v2w5rIVk345eRMyZMPNquoyGNLpCFvPHLuho1Z3sOuqCOy/NI 1IDlZgwNYAo96pc71V1xl9nBEamwCZBVY1ciYNtt9NfhNRgcaguE+SWb8xy0Y8j/Jx85 +F8tW+MRLmT8PdJU5oK80RJHNco4vafrQI0OBn5KFCpHotNvkg2uU8fLQ9w4t5s1DxzE D5xQ== X-Gm-Message-State: AOAM532tcgJ7B1FZuxSLWjBigCekSrsC8FReHT/rFuBQSw0s4Wx90Tcm EHQf261gRze1FXUK4HWlV0KWIBnU4H3LUkj252nPNJpDbZE= X-Google-Smtp-Source: ABdhPJykZ1jPl8DqSKSdBE2d/wZPJLritQrNehRiRCbubuDEDH36ngzG6HRa1ePZpoaqpFPemGnfTXfDulnPNhOgfjk= X-Received: by 2002:a92:ab10:: with SMTP id v16mr8910786ilh.100.1612625157626; Sat, 06 Feb 2021 07:25:57 -0800 (PST) MIME-Version: 1.0 References: <202102060240.1162eHYJ012657@gitrepo.freebsd.org> In-Reply-To: <202102060240.1162eHYJ012657@gitrepo.freebsd.org> From: Ed Maste Date: Sat, 6 Feb 2021 10:24:58 -0500 Message-ID: Subject: Re: git: 10990cb46027 - main - Simplify FreeBSD check. To: Cy Schubert 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: 4DXx2H3rNRz4kfJ 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: Sat, 06 Feb 2021 15:25:59 -0000 On Fri, 5 Feb 2021 at 21:40, Cy Schubert wrote: > > -#if (__FreeBSD_version >= 300000) > +#ifdef __FreeBSD_version FWIW I think #ifdef __FreeBSD__ is the typical spelling of this test, and it is built in to the compiler. From owner-dev-commits-src-all@freebsd.org Sat Feb 6 15:30: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 B100F52C9A9; Sat, 6 Feb 2021 15:30:46 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (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 4DXx7p1b9nz4l0S; Sat, 6 Feb 2021 15:30:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id 8PXmlcFy6HmS38PXnlqgv3; Sat, 06 Feb 2021 08:30:44 -0700 X-Authority-Analysis: v=2.4 cv=MaypB7zf c=1 sm=1 tr=0 ts=601eb624 a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=qa6Q16uM49sA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=kj8YTp4bdCVK2V1MK6wA:9 a=CjuIK1q_8ugA:10 a=vRcdKC0ogzYA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id E714882A; Sat, 6 Feb 2021 07:30:41 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 116FUfla008751; Sat, 6 Feb 2021 07:30:41 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102061530.116FUfla008751@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: Ed Maste cc: Cy Schubert , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 10990cb46027 - main - Simplify FreeBSD check. In-reply-to: References: <202102060240.1162eHYJ012657@gitrepo.freebsd.org> Comments: In-reply-to Ed Maste message dated "Sat, 06 Feb 2021 10:24:58 -0500." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 06 Feb 2021 07:30:41 -0800 X-CMAE-Envelope: MS4xfIuiOSJjMnxGLnP869ALHUMosbDzNucAPrpkC7B3be5bc63jAUqLdYBt6Fr6MWh0q7aMdUnXi35aliQFceo0GRm/NjunXrBM8/zgUYC87blNZAtrfSWs zXop4EG1nybvaW2Row+/3jOA+Zfd/fzdtjTqf3sVLUPQZ6lkTi2VmPyFh0bCeim2xUOUrZQp5H3MQoSSiVxLzEL3aoVJDuH7ZhARzAAwiW/cgwGvfzEGLhgZ 2qHG+UoO9bXtVdNBqpC9QyDbaY/ccVxzFnt1P02DHzZEggFL8ke+JLjHKU2q2aGt8pfzGI2m9TzWuRCuU7c2pi7kM0588sHBJ3qe8RJk5otIX+IhrQfMrjS+ fk8i7Q1P X-Rspamd-Queue-Id: 4DXx7p1b9nz4l0S 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: Sat, 06 Feb 2021 15:30:46 -0000 In message , Ed Maste writes: > On Fri, 5 Feb 2021 at 21:40, Cy Schubert wrote: > > > > -#if (__FreeBSD_version >= 300000) > > +#ifdef __FreeBSD_version > > FWIW I think #ifdef __FreeBSD__ is the typical spelling of this test, > and it is built in to the compiler. Thanks. I'll change that. -- 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 Sat Feb 6 17:17: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 6E6FD52F35C; Sat, 6 Feb 2021 17:17: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 4DXzWD2dJZz4rWB; Sat, 6 Feb 2021 17:17: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 4CDB0155F3; Sat, 6 Feb 2021 17:17: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 116HHic6057018; Sat, 6 Feb 2021 17:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116HHirV057017; Sat, 6 Feb 2021 17:17:44 GMT (envelope-from git) Date: Sat, 6 Feb 2021 17:17:44 GMT Message-Id: <202102061717.116HHirV057017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 66c72859f66d - main - netgraph/ng_bridge: switch stats to counter framework MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66c72859f66dc6c852234589f3508ce5d36d0336 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 17:17:44 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=66c72859f66dc6c852234589f3508ce5d36d0336 commit 66c72859f66dc6c852234589f3508ce5d36d0336 Author: Lutz Donnerhacke AuthorDate: 2021-01-13 06:16:34 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-06 17:14:23 +0000 netgraph/ng_bridge: switch stats to counter framework This is the first patch of a series of necessary steps to make ng_bridge(4) multithreaded. Reviewed by: melifaro (network), afedorov MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D28125 --- sys/netgraph/ng_bridge.c | 133 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 108 insertions(+), 25 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index ed08020ead70..49d8aae87ccf 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -65,6 +65,8 @@ #include #include #include +#include +#include #include #include @@ -87,13 +89,31 @@ static MALLOC_DEFINE(M_NETGRAPH_BRIDGE, "netgraph_bridge", #define M_NETGRAPH_BRIDGE M_NETGRAPH #endif +/* Counter based stats */ +struct ng_bridge_link_kernel_stats { + counter_u64_t recvOctets; /* total octets rec'd on link */ + counter_u64_t recvPackets; /* total pkts rec'd on link */ + counter_u64_t recvMulticasts; /* multicast pkts rec'd on link */ + counter_u64_t recvBroadcasts; /* broadcast pkts rec'd on link */ + counter_u64_t recvUnknown; /* pkts rec'd with unknown dest addr */ + counter_u64_t recvRunts; /* pkts rec'd less than 14 bytes */ + counter_u64_t recvInvalid; /* pkts rec'd with bogus source addr */ + counter_u64_t xmitOctets; /* total octets xmit'd on link */ + counter_u64_t xmitPackets; /* total pkts xmit'd on link */ + counter_u64_t xmitMulticasts; /* multicast pkts xmit'd on link */ + counter_u64_t xmitBroadcasts; /* broadcast pkts xmit'd on link */ + counter_u64_t loopDrops; /* pkts dropped due to loopback */ + counter_u64_t loopDetects; /* number of loop detections */ + counter_u64_t memoryFailures; /* times couldn't get mem or mbuf */ +}; + /* Per-link private data */ struct ng_bridge_link { hook_p hook; /* netgraph hook */ u_int16_t loopCount; /* loop ignore timer */ unsigned int learnMac : 1, /* autolearn macs */ sendUnknown : 1;/* send unknown macs out */ - struct ng_bridge_link_stats stats; /* link stats */ + struct ng_bridge_link_kernel_stats stats; /* link stats */ }; /* Per-node private data */ @@ -369,6 +389,21 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) if (link == NULL) return (ENOMEM); + link->stats.recvOctets = counter_u64_alloc(M_WAITOK); + link->stats.recvPackets = counter_u64_alloc(M_WAITOK); + link->stats.recvMulticasts = counter_u64_alloc(M_WAITOK); + link->stats.recvBroadcasts = counter_u64_alloc(M_WAITOK); + link->stats.recvUnknown = counter_u64_alloc(M_WAITOK); + link->stats.recvRunts = counter_u64_alloc(M_WAITOK); + link->stats.recvInvalid = counter_u64_alloc(M_WAITOK); + link->stats.xmitOctets = counter_u64_alloc(M_WAITOK); + link->stats.xmitPackets = counter_u64_alloc(M_WAITOK); + link->stats.xmitMulticasts = counter_u64_alloc(M_WAITOK); + link->stats.xmitBroadcasts = counter_u64_alloc(M_WAITOK); + link->stats.loopDrops = counter_u64_alloc(M_WAITOK); + link->stats.loopDetects = counter_u64_alloc(M_WAITOK); + link->stats.memoryFailures = counter_u64_alloc(M_WAITOK); + link->hook = hook; if (isUplink) { link->learnMac = 0; @@ -388,14 +423,31 @@ ng_bridge_newhook(node_p node, hook_p hook, const char *name) /* * Receive a control message */ +static void ng_bridge_clear_link_stats(struct ng_bridge_link_kernel_stats * p) +{ + counter_u64_zero(p->recvOctets); + counter_u64_zero(p->recvPackets); + counter_u64_zero(p->recvMulticasts); + counter_u64_zero(p->recvBroadcasts); + counter_u64_zero(p->recvUnknown); + counter_u64_zero(p->recvRunts); + counter_u64_zero(p->recvInvalid); + counter_u64_zero(p->xmitOctets); + counter_u64_zero(p->xmitPackets); + counter_u64_zero(p->xmitMulticasts); + counter_u64_zero(p->xmitBroadcasts); + counter_u64_zero(p->loopDrops); + counter_u64_zero(p->loopDetects); + counter_u64_zero(p->memoryFailures); +}; + static int ng_bridge_reset_link(hook_p hook, void *arg __unused) { link_p priv = NG_HOOK_PRIVATE(hook); priv->loopCount = 0; - bzero(&priv->stats, sizeof(priv->stats)); - + ng_bridge_clear_link_stats(&priv->stats); return (1); } @@ -549,17 +601,34 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) /* Get/clear stats */ if (msg->header.cmd != NGM_BRIDGE_CLR_STATS) { + struct ng_bridge_link_stats *rs; + NG_MKRESPONSE(resp, msg, sizeof(link->stats), M_NOWAIT); if (resp == NULL) { error = ENOMEM; break; } - bcopy(&link->stats, - resp->data, sizeof(link->stats)); + rs = (struct ng_bridge_link_stats *)resp->data; +#define FETCH(x) rs->x = counter_u64_fetch(link->stats.x) + FETCH(recvOctets); + FETCH(recvPackets); + FETCH(recvMulticasts); + FETCH(recvBroadcasts); + FETCH(recvUnknown); + FETCH(recvRunts); + FETCH(recvInvalid); + FETCH(xmitOctets); + FETCH(xmitPackets); + FETCH(xmitMulticasts); + FETCH(xmitBroadcasts); + FETCH(loopDrops); + FETCH(loopDetects); + FETCH(memoryFailures); +#undef FETCH } if (msg->header.cmd != NGM_BRIDGE_GET_STATS) - bzero(&link->stats, sizeof(link->stats)); + ng_bridge_clear_link_stats(&link->stats); break; } case NGM_BRIDGE_GET_TABLE: @@ -654,22 +723,22 @@ ng_bridge_send_ctx(hook_p dst, void *arg) */ m2 = m_dup(ctx->m, M_NOWAIT); /* XXX m_copypacket() */ if (m2 == NULL) { - ctx->incoming->stats.memoryFailures++; + counter_u64_add(ctx->incoming->stats.memoryFailures, 1); ctx->error = ENOBUFS; return (0); /* abort loop */ } /* Update stats */ - destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += m2->m_pkthdr.len; + counter_u64_add(destLink->stats.xmitPackets, 1); + counter_u64_add(destLink->stats.xmitOctets, m2->m_pkthdr.len); switch (ctx->manycast) { default: /* unknown unicast */ break; case 1: /* multicast */ - destLink->stats.xmitMulticasts++; + counter_u64_add(destLink->stats.xmitMulticasts, 1); break; case 2: /* broadcast */ - destLink->stats.xmitBroadcasts++; + counter_u64_add(destLink->stats.xmitBroadcasts, 1); break; } @@ -695,19 +764,19 @@ ng_bridge_rcvdata(hook_p hook, item_p item) ctx.incoming = NG_HOOK_PRIVATE(hook); /* Sanity check packet and pull up header */ if (ctx.m->m_pkthdr.len < ETHER_HDR_LEN) { - ctx.incoming->stats.recvRunts++; + counter_u64_add(ctx.incoming->stats.recvRunts, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (EINVAL); } if (ctx.m->m_len < ETHER_HDR_LEN && !(ctx.m = m_pullup(ctx.m, ETHER_HDR_LEN))) { - ctx.incoming->stats.memoryFailures++; + counter_u64_add(ctx.incoming->stats.memoryFailures, 1); NG_FREE_ITEM(item); return (ENOBUFS); } eh = mtod(ctx.m, struct ether_header *); if ((eh->ether_shost[0] & 1) != 0) { - ctx.incoming->stats.recvInvalid++; + counter_u64_add(ctx.incoming->stats.recvInvalid, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (EINVAL); @@ -715,21 +784,21 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Is link disabled due to a loopback condition? */ if (ctx.incoming->loopCount != 0) { - ctx.incoming->stats.loopDrops++; + counter_u64_add(ctx.incoming->stats.loopDrops, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ELOOP); /* XXX is this an appropriate error? */ } /* Update stats */ - ctx.incoming->stats.recvPackets++; - ctx.incoming->stats.recvOctets += ctx.m->m_pkthdr.len; + counter_u64_add(ctx.incoming->stats.recvPackets, 1); + counter_u64_add(ctx.incoming->stats.recvOctets, ctx.m->m_pkthdr.len); if ((ctx.manycast = (eh->ether_dhost[0] & 1)) != 0) { if (ETHER_EQUAL(eh->ether_dhost, ng_bridge_bcast_addr)) { - ctx.incoming->stats.recvBroadcasts++; + counter_u64_add(ctx.incoming->stats.recvBroadcasts, 1); ctx.manycast = 2; } else - ctx.incoming->stats.recvMulticasts++; + counter_u64_add(ctx.incoming->stats.recvMulticasts, 1); } /* Look up packet's source Ethernet address in hashtable */ @@ -763,13 +832,13 @@ ng_bridge_rcvdata(hook_p hook, item_p item) /* Mark link as linka non grata */ ctx.incoming->loopCount = priv->conf.loopTimeout; - ctx.incoming->stats.loopDetects++; + counter_u64_add(ctx.incoming->stats.loopDetects, 1); /* Forget all hosts on this link */ ng_bridge_remove_hosts(priv, ctx.incoming); /* Drop packet */ - ctx.incoming->stats.loopDrops++; + counter_u64_add(ctx.incoming->stats.loopDrops, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ELOOP); /* XXX appropriate? */ @@ -781,7 +850,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } } else if (ctx.incoming->learnMac) { if (!ng_bridge_put(priv, eh->ether_shost, ctx.incoming)) { - ctx.incoming->stats.memoryFailures++; + counter_u64_add(ctx.incoming->stats.memoryFailures, 1); NG_FREE_ITEM(item); NG_FREE_M(ctx.m); return (ENOMEM); @@ -812,14 +881,14 @@ ng_bridge_rcvdata(hook_p hook, item_p item) } /* Deliver packet out the destination link */ - destLink->stats.xmitPackets++; - destLink->stats.xmitOctets += ctx.m->m_pkthdr.len; + counter_u64_add(destLink->stats.xmitPackets, 1); + counter_u64_add(destLink->stats.xmitOctets, ctx.m->m_pkthdr.len); NG_FWD_NEW_DATA(ctx.error, item, destLink->hook, ctx.m); return (ctx.error); } /* Destination host is not known */ - ctx.incoming->stats.recvUnknown++; + counter_u64_add(ctx.incoming->stats.recvUnknown, 1); } /* Distribute unknown, multicast, broadcast pkts to all other links */ @@ -879,6 +948,20 @@ ng_bridge_disconnect(hook_p hook) ng_bridge_remove_hosts(priv, link); /* Free associated link information */ + counter_u64_free(link->stats.recvOctets); + counter_u64_free(link->stats.recvPackets); + counter_u64_free(link->stats.recvMulticasts); + counter_u64_free(link->stats.recvBroadcasts); + counter_u64_free(link->stats.recvUnknown); + counter_u64_free(link->stats.recvRunts); + counter_u64_free(link->stats.recvInvalid); + counter_u64_free(link->stats.xmitOctets); + counter_u64_free(link->stats.xmitPackets); + counter_u64_free(link->stats.xmitMulticasts); + counter_u64_free(link->stats.xmitBroadcasts); + counter_u64_free(link->stats.loopDrops); + counter_u64_free(link->stats.loopDetects); + counter_u64_free(link->stats.memoryFailures); free(link, M_NETGRAPH_BRIDGE); priv->numLinks--; From owner-dev-commits-src-all@freebsd.org Sat Feb 6 17: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 5328252F67C; Sat, 6 Feb 2021 17:22:29 +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 4DXzcj0Sshz4rsf; Sat, 6 Feb 2021 17:22:28 +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 116HMHiO027736 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 6 Feb 2021 18:22:17 +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 116HMHS9002374; Sat, 6 Feb 2021 18:22:17 +0100 Date: Sat, 6 Feb 2021 18:22:17 +0100 From: Lutz Donnerhacke To: Lutz Donnerhacke Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 66c72859f66d - main - netgraph/ng_bridge: switch stats to counter framework Message-ID: <20210206172217.GA2212@belenus.iks-jena.de> References: <202102061717.116HHirV057017@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202102061717.116HHirV057017@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: 4DXzcj0Sshz4rsf 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: Sat, 06 Feb 2021 17:22:29 -0000 On Sat, Feb 06, 2021 at 05:17:44PM +0000, Lutz Donnerhacke wrote: > commit 66c72859f66dc6c852234589f3508ce5d36d0336 > Author: Lutz Donnerhacke > AuthorDate: 2021-01-13 06:16:34 +0000 > Commit: Lutz Donnerhacke > CommitDate: 2021-02-06 17:14:23 +0000 There are still some "pre-committer" branches in the local tree. My fault. From owner-dev-commits-src-all@freebsd.org Sat Feb 6 18:30: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 4F5495311EF; Sat, 6 Feb 2021 18:30:37 +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 4DY17K1ncQz3CKC; Sat, 6 Feb 2021 18:30:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.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 2B2851107; Sat, 6 Feb 2021 18:30:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f180.google.com with SMTP id h8so157481qkk.6; Sat, 06 Feb 2021 10:30:37 -0800 (PST) X-Gm-Message-State: AOAM531/vl1dGhbSRF9lgk7AqE9++r/jdddj+KQNxtd5O7tlQLzbEO9b L4Sd+do9wJlBI2o+vsbSJxBF+FUjbrMUit0yD+I= X-Google-Smtp-Source: ABdhPJzr0jmPVy+PgJElcFTHy+pLiB8G4YZu20aOLLLa1qdxsBnrrcC4j9E8jNWtAT2Z+zYhcvwmDbGihige2zWsujc= X-Received: by 2002:ae9:e80e:: with SMTP id a14mr390928qkg.103.1612636236740; Sat, 06 Feb 2021 10:30:36 -0800 (PST) MIME-Version: 1.0 References: <202102042333.114NXowE086993@gitrepo.freebsd.org> In-Reply-To: <202102042333.114NXowE086993@gitrepo.freebsd.org> From: Kyle Evans Date: Sat, 6 Feb 2021 12:30:19 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 7d4dceec1030 - main - ixl(4): Fix VLAN HW filtering To: Eric Joyner , Krzysztof Galazka Cc: src-committers , dev-commits-src-all@freebsd.org, 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: Sat, 06 Feb 2021 18:30:37 -0000 On Thu, Feb 4, 2021 at 5:34 PM Eric Joyner wrote: > > The branch main has been updated by erj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7d4dceec103039e2b2fa90793ceeb71a8d6684aa > > commit 7d4dceec103039e2b2fa90793ceeb71a8d6684aa > Author: Krzysztof Galazka > AuthorDate: 2021-02-03 23:22:55 +0000 > Commit: Eric Joyner > CommitDate: 2021-02-04 23:33:42 +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. > Hi, This adds a dependency on `device ixl` for `device iavf` since M_IXL is defined in ixl_pf_main.c, but I think that particular part should be partially reverted anyways. There's an M_IAVF already that's more appropriate for i40e_osdep.c -- proposed patch here: https://people.freebsd.org/~kevans/0001-ixl-switch-i40e_osdep.c-allocations-to-M_IAVF.patch Thanks, Kyle Evans From owner-dev-commits-src-all@freebsd.org Sat Feb 6 18:32: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 5F85A53154B for ; Sat, 6 Feb 2021 18:32:54 +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 4DY19y2Cvhz3ClN for ; Sat, 6 Feb 2021 18:32:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 33C05D6D for ; Sat, 6 Feb 2021 18:32:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f177.google.com with SMTP id 19so10425699qkh.3 for ; Sat, 06 Feb 2021 10:32:54 -0800 (PST) X-Gm-Message-State: AOAM532hki6+0VUDXBsvcHn2LcXTFVSu8ylslqPZUdB9WNZkEVkQARPu wj4LUSb57yoZU7qdk2BnhFaYz4CNmY0wPRE/4Uw= X-Received: by 2002:a37:591:: with SMTP id 139mt10758334qkf.493.1612636373868; Sat, 06 Feb 2021 10:32:53 -0800 (PST) MIME-Version: 1.0 References: <202102042333.114NXowE086993@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Sat, 6 Feb 2021 12:32:37 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 7d4dceec1030 - main - ixl(4): Fix VLAN HW filtering Cc: Eric Joyner , Krzysztof Galazka , src-committers , dev-commits-src-all@freebsd.org, 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: Sat, 06 Feb 2021 18:32:54 -0000 On Sat, Feb 6, 2021 at 12:30 PM Kyle Evans wrote: > > On Thu, Feb 4, 2021 at 5:34 PM Eric Joyner wrote: > > > > The branch main has been updated by erj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=7d4dceec103039e2b2fa90793ceeb71a8d6684aa > > > > commit 7d4dceec103039e2b2fa90793ceeb71a8d6684aa > > Author: Krzysztof Galazka > > AuthorDate: 2021-02-03 23:22:55 +0000 > > Commit: Eric Joyner > > CommitDate: 2021-02-04 23:33:42 +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. > > > > Hi, > > This adds a dependency on `device ixl` for `device iavf` since M_IXL > is defined in ixl_pf_main.c, but I think that particular part should > be partially reverted anyways. There's an M_IAVF already that's more > appropriate for i40e_osdep.c -- proposed patch here: > https://people.freebsd.org/~kevans/0001-ixl-switch-i40e_osdep.c-allocations-to-M_IAVF.patch > Ah crud, nope. I missed that i40e_osdep is pulled in for ixl as well. :-( From owner-dev-commits-src-all@freebsd.org Sat Feb 6 19:42: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 E3279533220; Sat, 6 Feb 2021 19:42: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 4DY2k568SYz3HmR; Sat, 6 Feb 2021 19:42: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 C61F6171E8; Sat, 6 Feb 2021 19:42: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 116JgLxm050773; Sat, 6 Feb 2021 19:42:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116JgLMC050772; Sat, 6 Feb 2021 19:42:21 GMT (envelope-from git) Date: Sat, 6 Feb 2021 19:42:21 GMT Message-Id: <202102061942.116JgLMC050772@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: 8af54bdfcaec - main - lastcomm(1): Only install if MK_ACCT is on 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: 8af54bdfcaecf922f936a14d1d9efcf84076029f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:42:21 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=8af54bdfcaecf922f936a14d1d9efcf84076029f commit 8af54bdfcaecf922f936a14d1d9efcf84076029f Author: Emmanuel Vadot AuthorDate: 2021-02-06 19:41:39 +0000 Commit: Emmanuel Vadot CommitDate: 2021-02-06 19:41:39 +0000 lastcomm(1): Only install if MK_ACCT is on MFC after: 3 days --- usr.bin/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/Makefile b/usr.bin/Makefile index c557d85b535c..fcc406d2efc5 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -67,7 +67,6 @@ SUBDIR= alias \ ktrace \ ktrdump \ lam \ - lastcomm \ ldd \ leave \ less \ @@ -192,6 +191,7 @@ SUBDIR= alias \ # NB: keep these sorted by MK_* knobs +SUBDIR.${MK_ACCT}+= lastcomm SUBDIR.${MK_AT}+= at SUBDIR.${MK_ATM}+= atm SUBDIR.${MK_BLUETOOTH}+= bluetooth From owner-dev-commits-src-all@freebsd.org Sat Feb 6 23:46: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 E1AE353EBAC; Sat, 6 Feb 2021 23:46:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DY88J62Lwz4r9L; Sat, 6 Feb 2021 23:46: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 C1F801A3B1; Sat, 6 Feb 2021 23:46: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 116NkuCl063765; Sat, 6 Feb 2021 23:46:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 116Nkuam063764; Sat, 6 Feb 2021 23:46:56 GMT (envelope-from git) Date: Sat, 6 Feb 2021 23:46:56 GMT Message-Id: <202102062346.116Nkuam063764@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: f6e8256a965d - main - 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/main X-Git-Reftype: branch X-Git-Commit: f6e8256a965d5b7a7d43034ea31b2430a3b51066 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:46:56 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=f6e8256a965d5b7a7d43034ea31b2430a3b51066 commit f6e8256a965d5b7a7d43034ea31b2430a3b51066 Author: Edward Tomasz Napierala AuthorDate: 2021-02-05 17:24:23 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-06 23:21: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 --- 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 Sun Feb 7 12:10: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 9F88A52AF89; Sun, 7 Feb 2021 12:10: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 4DYSfc3mYHz4YSs; Sun, 7 Feb 2021 12:10: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 741792409E; Sun, 7 Feb 2021 12:10: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 117CAmSW037640; Sun, 7 Feb 2021 12:10:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117CAmqP037639; Sun, 7 Feb 2021 12:10:48 GMT (envelope-from git) Date: Sun, 7 Feb 2021 12:10:48 GMT Message-Id: <202102071210.117CAmqP037639@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 5c9700a7fe3f - stable/12 - Add a manual page for axp(4) / AMD 10G Ethernet driver 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 5c9700a7fe3f80132a78628f10dd6bcf1b663a71 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 12:10:48 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5c9700a7fe3f80132a78628f10dd6bcf1b663a71 commit 5c9700a7fe3f80132a78628f10dd6bcf1b663a71 Author: Gordon Bergling AuthorDate: 2021-01-24 13:57:16 +0000 Commit: Gordon Bergling CommitDate: 2021-02-07 12:10:22 +0000 Add a manual page for axp(4) / AMD 10G Ethernet driver Submitted by: Rajesh Kumar Reviewed by: bcr, brueffer, rpokala Differential Revision: https://reviews.freebsd.org/D27800 (cherry picked from commit 1f73236b0302cdf47630c99687c2dfd4e514ab54) --- share/man/man4/Makefile | 1 + share/man/man4/axp.4 | 225 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 226 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5a3365a888b0..f3b227efcfde 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -74,6 +74,7 @@ MAN= aac.4 \ aue.4 \ axe.4 \ axge.4 \ + axp.4 \ bce.4 \ bcma.4 \ bfe.4 \ diff --git a/share/man/man4/axp.4 b/share/man/man4/axp.4 new file mode 100644 index 000000000000..598e6a968e7a --- /dev/null +++ b/share/man/man4/axp.4 @@ -0,0 +1,225 @@ +.\" 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 January 24, 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.single_fl +This variable must be set before loading the driver, either via +.Xr loader.conf 5 +or through the use of +.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.single_fl\&, +which will configure all AMD interfaces with single freelist per receive queue. +Default is 2 freelist per receive queue. +.Pp +This variable is to configure the interface when single freelist is needed. +(For Eg. netmap). +Basically, this will control the software behavior of how the receive +descriptors are used. +.Pp +Setting this variable to 1, will use 1 Freelist per receive queue. +.Pp +Setting this variable to 0, will use 2 Freelist per receive queue. +.Pp +Based on the setting, the receive buffers are programmed accordingly on the +received descriptors. +.Pp +By default, this variable will be set to 0, meaning the interfaces will be +configured for regular data traffic (not netmap traffic). +.It Va dev.ax.X.sph_enabled +This variable must be set before loading the driver, either via +.Xr loader.conf 5 +or through the use of +.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 in all +AMD interfaces. +.Pp +This variable is to control enable/disable of the split header feature in +the interface. +.Pp +Setting this variable to 1, will enable split header feature. +.Pp +Setting this variable to 0, will disable split header feature. +.Pp +By default, this variable will be set to 1, meaning the Split header support be +enabled. +.Pp +NOTE: It is recommended to use this variable only when +.Va single_fl\& +is configured. +Otherwise let it be default value. +.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 Sun Feb 7 13:49: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 7F4F652D1BA; Sun, 7 Feb 2021 13:49: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 4DYVrQ326Zz4db7; Sun, 7 Feb 2021 13:49: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 568EC24FC8; Sun, 7 Feb 2021 13:49: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 117DnQWw060234; Sun, 7 Feb 2021 13:49:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117DnQ7c060233; Sun, 7 Feb 2021 13:49:26 GMT (envelope-from git) Date: Sun, 7 Feb 2021 13:49:26 GMT Message-Id: <202102071349.117DnQ7c060233@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nuno Eduardo Simões Leal Teixeira Subject: git: 7b51ac027529 - main - Update Mentor and Mentee Information (eduardo) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eduardo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b51ac027529b698a1fc07f31963a8754b7117c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 13:49:26 -0000 The branch main has been updated by eduardo (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7b51ac027529b698a1fc07f31963a8754b7117c4 commit 7b51ac027529b698a1fc07f31963a8754b7117c4 Author: Nuno Eduardo Simões Leal Teixeira AuthorDate: 2021-02-07 13:46:13 +0000 Commit: Nuno Eduardo Simões Leal Teixeira CommitDate: 2021-02-07 13:46:13 +0000 Update Mentor and Mentee Information (eduardo) --- share/misc/committers-ports.dot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index d23bcff6e8c6..eda6c33fc82f 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -102,6 +102,7 @@ dteske [label="Devin Teske\ndteske@FreeBSD.org\n2018/03/01"] dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2017/01/10"] dvl [label="Dan Langille\ndvl@FreeBSD.org\n2014/08/10"] eadler [label="Eitan Adler\neadler@FreeBSD.org\n2011/08/17"] +eduardo [label="Nuno Teixeira\neduardo@FreeBSD.org\n2021/01/27"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002/10/22"] egypcio [label="Vinícius Zavam\negypcio@FreeBSD.org\n2018/10/04"] ehaupt [label="Emanuel Haupt\nehaupt@FreeBSD.org\n2005/10/03"] @@ -396,6 +397,8 @@ culot -> wg db -> tj db -> shurd +dbaio -> eduardo + decke -> sperber delphij -> junovitch @@ -466,6 +469,7 @@ gabor -> scheidell garga -> acm garga -> alepulver garga -> dbaio +garga -> eduardo garga -> mandree garga -> mm garga -> rnoland From owner-dev-commits-src-all@freebsd.org Sun Feb 7 14:29: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 5563B52E225; Sun, 7 Feb 2021 14:29:49 +0000 (UTC) (envelope-from dbaio@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 4DYWl11zvgz4h0l; Sun, 7 Feb 2021 14:29:49 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from t480.local (unknown [187.59.152.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: dbaio/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 22C82ABBD; Sun, 7 Feb 2021 14:29:47 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Date: Sun, 7 Feb 2021 11:29:44 -0300 From: "Danilo G. Baio" To: Nuno Eduardo =?utf-8?Q?Sim=C3=B5es?= Leal Teixeira Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org, garga@FreeBSD.org Subject: Re: git: 7b51ac027529 - main - Update Mentor and Mentee Information (eduardo) Message-ID: <20210207142944.bbsf7o5c5faalvph@t480.local> References: <202102071349.117DnQ7c060233@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3hnvjfzcd6ndna7c" Content-Disposition: inline In-Reply-To: <202102071349.117DnQ7c060233@gitrepo.freebsd.org> X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:29:49 -0000 --3hnvjfzcd6ndna7c Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 07, 2021 at 01:49:26PM +0000, Nuno Eduardo Sim=F5es Leal Teixei= ra wrote: > The branch main has been updated by eduardo (ports committer): >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D7b51ac027529b698a1fc07f319= 63a8754b7117c4 >=20 > commit 7b51ac027529b698a1fc07f31963a8754b7117c4 > Author: Nuno Eduardo Sim=F5es Leal Teixeira > AuthorDate: 2021-02-07 13:46:13 +0000 > Commit: Nuno Eduardo Sim=F5es Leal Teixeira > CommitDate: 2021-02-07 13:46:13 +0000 >=20 > Update Mentor and Mentee Information (eduardo) Approved by: garga (mentor), dbaio (mentor) Differential Revision: https://reviews.freebsd.org/D28477 Next commits will have all info. Regards. --=20 Danilo G. Baio (dbaio) --3hnvjfzcd6ndna7c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEORj0UTsjzCy+enIkmpN7LfMuiNcFAmAf+VVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDM5 MThGNDUxM0IyM0NDMkNCRTdBNzIyNDlBOTM3QjJERjMyRTg4RDcACgkQmpN7LfMu iNcT0RAAwVbiVgqdh8ANU08i0zwMkSW7wWsKFHM/3AWvESmjduVifgqajR5ccLoX Yv+VsHkoPgK4B1/E3vvLqv3v8D9orms7gg0NR+HjS2pP7Jw4oaYkp6R10PAUkwJN I9NxV18JcQAzREPk3P+OlGVdou9tzmuyo9x2LGNHh7ji2zXPePGJdgMShTbsfKY1 H8uiepdmcONyZz+paMUPapeZWPVBXz02RZiPMDTn34RLRYsCyks4xKSSivlaRafK Hk1tci3siF7cMFHep1qtOjbXN1V7wIE0U1KON5jLCdHvxsOPreGYoybGjCGjpNHA vnjRR3lqfy8vHDB0Rqyl427pBM7fET3jzOjgZbwSWvZOciJzDREV1PV609Lcdmbp CiT6sdOF3t98m0got5lvJ/q1n44CA9BBp1im9eKV6Q5cbPN+CFRiGr6wAqopwdr1 uzPcTkb2J9gO+z37hcV/AkQQYfCb8K5BCHqDB1x/e+FVcRSROxPQBpNaM9Kf9PcO V/5GV5x65YAE3hPoSJz1kPr4NLpmgWIiUlYz01xyTVH33rcspRcVnnlXKR3qA8fi V88ekzCjl3q6QRIb/WQYhHsH48H0CHmgvyT4oTIRwnKMl94aycrpaYprO4LECSqN s9p7DzlcNBqCFoFNxiVnW7j3D05imlGkCk7gCVwgqbWth4eTgfY= =XXOz -----END PGP SIGNATURE----- --3hnvjfzcd6ndna7c-- From owner-dev-commits-src-all@freebsd.org Sun Feb 7 14:32: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 22EFD52E47C; Sun, 7 Feb 2021 14:32: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 4DYWpR0QT2z4hR9; Sun, 7 Feb 2021 14:32: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 0118325D94; Sun, 7 Feb 2021 14:32: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 117EWktV024535; Sun, 7 Feb 2021 14:32:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117EWk0Z024534; Sun, 7 Feb 2021 14:32:46 GMT (envelope-from git) Date: Sun, 7 Feb 2021 14:32:46 GMT Message-Id: <202102071432.117EWk0Z024534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: ed0a1527507e - main - netgraph/ng_bridge: Remove old table ABI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed0a1527507e916c78e6937bcc4061bb81fd9da8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:32:47 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=ed0a1527507e916c78e6937bcc4061bb81fd9da8 commit ed0a1527507e916c78e6937bcc4061bb81fd9da8 Author: Lutz Donnerhacke AuthorDate: 2021-02-06 22:09:52 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-07 14:29:07 +0000 netgraph/ng_bridge: Remove old table ABI This was announced to happen after the 12 relases. Remove a depeciated ABI. The complete removal is for HEAD only. I'll remove the #define in stable/13 as MFC, so the code will still exist in 13.x, but will not included by default. Earlier versions will not be affected. Reviewed by: kp MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D28518 --- sys/netgraph/ng_bridge.c | 69 ------------------------------------------------ sys/netgraph/ng_bridge.h | 43 ------------------------------ 2 files changed, 112 deletions(-) diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 49d8aae87ccf..4898a55f1463 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -461,75 +461,6 @@ ng_bridge_rcvmsg(node_p node, item_p item, hook_p lasthook) NGI_GET_MSG(item, msg); switch (msg->header.typecookie) { -#ifdef NGM_BRIDGE_TABLE_ABI - case NGM_BRIDGE_COOKIE_TBL: - switch (msg->header.cmd) { - case NGM_BRIDGE_GET_CONFIG: - { - struct ng_bridge_config_tbl *conf; - - NG_MKRESPONSE(resp, msg, sizeof(*conf), - M_NOWAIT|M_ZERO); - if (resp == NULL) { - error = ENOMEM; - break; - } - conf = (struct ng_bridge_config_tbl *)resp->data; - conf->cfg = priv->conf; - break; - } - case NGM_BRIDGE_SET_CONFIG: - { - struct ng_bridge_config_tbl *conf; - - if (msg->header.arglen != sizeof(*conf)) { - error = EINVAL; - break; - } - conf = (struct ng_bridge_config_tbl *)msg->data; - priv->conf = conf->cfg; - break; - } - case NGM_BRIDGE_GET_TABLE: - { - struct ng_bridge_host_tbl_ary *ary; - struct ng_bridge_hent *hent; - int i, bucket; - - NG_MKRESPONSE(resp, msg, sizeof(*ary) + - (priv->numHosts * sizeof(*ary->hosts)), M_NOWAIT); - if (resp == NULL) { - error = ENOMEM; - break; - } - ary = (struct ng_bridge_host_tbl_ary *)resp->data; - ary->numHosts = priv->numHosts; - i = 0; - for (bucket = 0; bucket < priv->numBuckets; bucket++) { - SLIST_FOREACH(hent, &priv->tab[bucket], next) { - const char *name = NG_HOOK_NAME(hent->host.link->hook); - const char *prefix = name[0] == 'u' ? - NG_BRIDGE_HOOK_UPLINK_PREFIX : - NG_BRIDGE_HOOK_LINK_PREFIX; - - memcpy(ary->hosts[i].addr, - hent->host.addr, - sizeof(ary->hosts[i].addr)); - ary->hosts[i].age = hent->host.age; - ary->hosts[i].staleness = - hent->host.staleness; - ary->hosts[i].linkNum = strtol( - name + strlen(prefix), NULL, 10); - i++; - } - } - break; - } - } - /* If already handled break, otherwise use new ABI. */ - if (resp != NULL || error != 0) - break; -#endif /* NGM_BRIDGE_TABLE_ABI */ case NGM_BRIDGE_COOKIE: switch (msg->header.cmd) { case NGM_BRIDGE_GET_CONFIG: diff --git a/sys/netgraph/ng_bridge.h b/sys/netgraph/ng_bridge.h index 2aecf7f9f9cb..f4771cc401d4 100644 --- a/sys/netgraph/ng_bridge.h +++ b/sys/netgraph/ng_bridge.h @@ -43,24 +43,10 @@ #ifndef _NETGRAPH_NG_BRIDGE_H_ #define _NETGRAPH_NG_BRIDGE_H_ -/* - * Support the older ABI based on fixed size tables. - * ABI is deprecated, to be removed in releases > 12 - * Please note: There is no API support! - * You canno create new messages using the old API but messages conforming the - * old ABI are understood. - */ -#define NGM_BRIDGE_TABLE_ABI - /* Node type name and magic cookie */ #define NG_BRIDGE_NODE_TYPE "bridge" #define NGM_BRIDGE_COOKIE 1569321993 -#ifdef NGM_BRIDGE_TABLE_ABI -#define NGM_BRIDGE_COOKIE_TBL 967239368 -#define NG_BRIDGE_MAX_LINKS 32 -#endif /* NGM_BRIDGE_TABLE_ABI */ - /* Hook names */ #define NG_BRIDGE_HOOK_LINK_PREFIX "link" /* append decimal integer */ #define NG_BRIDGE_HOOK_LINK_FMT "link%d" /* for use with printf(3) */ @@ -75,13 +61,6 @@ struct ng_bridge_config { u_int32_t minStableAge; /* min time for a stable host */ }; -#ifdef NGM_BRIDGE_TABLE_ABI -struct ng_bridge_config_tbl { - u_char ipfw[NG_BRIDGE_MAX_LINKS]; - struct ng_bridge_config cfg; -}; -#endif /* NGM_BRIDGE_TABLE_ABI */ - /* Keep this in sync with the above structure definition */ #define NG_BRIDGE_CONFIG_TYPE_INFO { \ { "debugLevel", &ng_parse_uint8_type }, \ @@ -138,15 +117,6 @@ struct ng_bridge_host { u_int16_t staleness; /* seconds ago host last heard from */ }; -#ifdef NGM_BRIDGE_TABLE_ABI -struct ng_bridge_host_tbl { - u_char addr[6]; /* ethernet address */ - u_int16_t linkNum; /* link where addr can be found */ - u_int16_t age; /* seconds ago entry was created */ - u_int16_t staleness; /* seconds ago host last heard from */ -}; -#endif /* NGM_BRIDGE_TABLE_ABI */ - /* external representation of the host */ struct ng_bridge_hostent { u_char addr[6]; /* ethernet address */ @@ -177,19 +147,6 @@ struct ng_bridge_host_ary { { NULL } \ } -#ifdef NGM_BRIDGE_TABLE_ABI -struct ng_bridge_hostent_tbl { - u_char addr[6]; /* ethernet address */ - u_int16_t linkNum; /* link where addr can be found */ - u_int16_t age; /* seconds ago entry was created */ - u_int16_t staleness; /* seconds ago host last heard from */ -}; -struct ng_bridge_host_tbl_ary { - u_int32_t numHosts; - struct ng_bridge_hostent_tbl hosts[]; -}; -#endif /* NGM_BRIDGE_TABLE_ABI */ - /* Netgraph control messages */ enum { NGM_BRIDGE_SET_CONFIG = 1, /* set node configuration */ From owner-dev-commits-src-all@freebsd.org Sun Feb 7 14:40: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 E993652E363; Sun, 7 Feb 2021 14:40: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 4DYWzl6MFrz4hZM; Sun, 7 Feb 2021 14:40: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 CD31D25A62; Sun, 7 Feb 2021 14:40: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 117EepR1033224; Sun, 7 Feb 2021 14:40:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117Eep3U033223; Sun, 7 Feb 2021 14:40:51 GMT (envelope-from git) Date: Sun, 7 Feb 2021 14:40:51 GMT Message-Id: <202102071440.117Eep3U033223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: bb67e52db143 - main - netgraph/ng_bridge: Make simple internal functions read-only MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb67e52db143b699bdac1830717930b26a7b5766 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 14:40:52 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=bb67e52db143b699bdac1830717930b26a7b5766 commit bb67e52db143b699bdac1830717930b26a7b5766 Author: Lutz Donnerhacke AuthorDate: 2021-01-13 22:18:55 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-07 14:39:57 +0000 netgraph/ng_bridge: Make simple internal functions read-only The data path in netgraph is designed to work on an read only state of the whole netgraph network. Currently this is achived by convetion, there is no technical enforcment. This patch is part of a series to make ng_brigde multithreaded, which is done by rewrite the data path to const handling. Reviewed By: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28141 --- sys/netgraph/netgraph.h | 5 ++++- sys/netgraph/ng_base.c | 2 +- sys/netgraph/ng_bridge.c | 10 ++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 7535472dc631..5040471c5ce0 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -87,6 +87,9 @@ struct ng_item ; typedef struct ng_item *item_p; typedef struct ng_node *node_p; typedef struct ng_hook *hook_p; +typedef struct ng_item const *item_cp; +typedef struct ng_node const *node_cp; +typedef struct ng_hook const *hook_cp; /* node method definitions */ typedef int ng_constructor_t(node_p node); @@ -1139,7 +1142,7 @@ int ng_make_node_common(struct ng_type *typep, node_p *nodep); int ng_name_node(node_p node, const char *name); node_p ng_name2noderef(node_p node, const char *name); int ng_newtype(struct ng_type *tp); -ng_ID_t ng_node2ID(node_p node); +ng_ID_t ng_node2ID(node_cp node); item_p ng_package_data(struct mbuf *m, int flags); item_p ng_package_msg(struct ng_mesg *msg, int flags); item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index dadf86eb8dde..6ab39421b255 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -836,7 +836,7 @@ ng_ID2noderef(ng_ID_t ID) } ng_ID_t -ng_node2ID(node_p node) +ng_node2ID(node_cp node) { return (node ? NG_NODE_ID(node) : 0); } diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 4898a55f1463..d5b3b520a497 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -115,6 +115,7 @@ struct ng_bridge_link { sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_kernel_stats stats; /* link stats */ }; +typedef struct ng_bridge_link const *link_cp; /* read only access */ /* Per-node private data */ struct ng_bridge_private { @@ -130,6 +131,7 @@ struct ng_bridge_private { struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; +typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ struct ng_bridge_hent { @@ -149,12 +151,12 @@ static ng_rcvdata_t ng_bridge_rcvdata; static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ -static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char *addr); +static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char *addr); static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); static void ng_bridge_remove_hosts(priv_p priv, link_p link); static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); -static const char *ng_bridge_nodename(node_p node); +static const char *ng_bridge_nodename(node_cp node); /* Ethernet broadcast */ static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = @@ -920,7 +922,7 @@ ng_bridge_disconnect(hook_p hook) * Find a host entry in the table. */ static struct ng_bridge_host * -ng_bridge_get(priv_p priv, const u_char *addr) +ng_bridge_get(priv_cp priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); struct ng_bridge_hent *hent; @@ -1131,7 +1133,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) * Return node's "name", even if it doesn't have one. */ static const char * -ng_bridge_nodename(node_p node) +ng_bridge_nodename(node_cp node) { static char name[NG_NODESIZ]; From owner-dev-commits-src-all@freebsd.org Sun Feb 7 15:27: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 A782052F2CF; Sun, 7 Feb 2021 15:27:14 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 4DYY1G3hNMz4kXH; Sun, 7 Feb 2021 15:27:14 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x42d.google.com with SMTP id r7so4562567wrq.9; Sun, 07 Feb 2021 07:27:14 -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=0wSozjItnSq03tsCWQrJgEP0Gvy+ZSrQZcyyTaDk1+g=; b=lV+HQvYazG3aLbC+ZAY6ozK+tkWhxcMt+ahuTOCGJ32H8DV2PQHlRQKlHiS8yYKNTM B7AaJ410UcFPGm08ULlK4KS1pmSSOslcuBU8lKqmJnwrLBJwb1LwYH7v0d+ZxANe6zGV gvp3vdblg/bmjIWJ6PoiNVJvi3iDv7RCZ7vvS8BvEdzxG3p+w5Npx73osOWHPLeyCrh0 GhKtrYuBMOnuFG8rr8srA/w9m6BCq6FN5HPj/dWN1nX0LkapxQeXAtbP9rfM1hVzwqpG OTLDyjxTiDrOzYjlL1rnkJ790TS8FbUQzqwOC9JlEdqiLO0oJR5Rr2lrI3UpFDVnh0NZ YtDg== 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=0wSozjItnSq03tsCWQrJgEP0Gvy+ZSrQZcyyTaDk1+g=; b=g7XsKDcgfCY1W7lAjffmBOEQHsFdh4uVihM/P6IQsidGJo3NnH191OeiD4USkEsg+W C7f9/T2mu9qD1mrlSLvqrzB65EHCxVSLiSHTyMHNGqIfF8VFPZn2GJz18rp8+W2qpxA1 o80dO4YyLjsOl/KSt1Y40H842vrnNljQEXltdEGZKRFTgcXF0XSi+AS5g4YzOLdSEcAO yP5qzSyQRx40H6HJYkqwgt17R/EP2zygCd/I5FfRAkx+3AmXwdmgr+52Q0KbIr3l95c5 K8mfqqaIf+drrcHsV3o7vDhwJcsrXeaYrV47YQpGP68H5EUeoSrII2LS7a9ObhMFoGWK P82w== X-Gm-Message-State: AOAM533cDr+LG2npfe0bUqKHJS3y73pikiU/xf2z3Fjp1EBjV0FQaD4b he3Jr0PCC5/Kn1vIjtsH7VGSIPKuR7S5lJusfnrCkFRROPQ= X-Google-Smtp-Source: ABdhPJxapNvzX9SC9rjh6QGOZ1FfwipFnGjnpf2N5f1kizW3koZPMtuGKfg5DI9lQjZ5JYF5w6w40qG6vaL3sYSDLJc= X-Received: by 2002:a05:6000:186f:: with SMTP id d15mr15556831wri.237.1612711632989; Sun, 07 Feb 2021 07:27:12 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:464c:0:0:0:0:0 with HTTP; Sun, 7 Feb 2021 07:27:11 -0800 (PST) In-Reply-To: <202102071440.117Eep3U033223@gitrepo.freebsd.org> References: <202102071440.117Eep3U033223@gitrepo.freebsd.org> From: Mateusz Guzik Date: Sun, 7 Feb 2021 16:27:11 +0100 Message-ID: Subject: Re: git: bb67e52db143 - main - netgraph/ng_bridge: Make simple internal functions read-only To: Lutz Donnerhacke 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: 4DYY1G3hNMz4kXH 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: Sun, 07 Feb 2021 15:27:14 -0000 One of your commits mass breaks LINT kernels: arm LINT kernel failed, check _.arm.LINT for details riscv LINT kernel failed, check _.riscv.LINT for details arm64 LINT kernel failed, check _.arm64.LINT for details i386 LINT-NOIP kernel failed, check _.i386.LINT-NOIP for details i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details i386 LINT kernel failed, check _.i386.LINT for details i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details powerpc LINT64 kernel failed, check _.powerpc.LINT64 for details powerpc LINT kernel failed, check _.powerpc.LINT for details amd64 LINT kernel failed, check _.amd64.LINT for details amd64 LINT-NOIP kernel failed, check _.amd64.LINT-NOIP for details amd64 LINT-NOINET kernel failed, check _.amd64.LINT-NOINET for details amd64 LINT-NOINET6 kernel failed, check _.amd64.LINT-NOINET6 for details /usr/src/sys/netgraph/ng_base.c:841:28: error: passing 'node_cp' (aka 'const struct ng_node *') to parameter of type 'node_p' (aka 'stru ct ng_node *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] return (node ? NG_NODE_ID(node) : 0); ^~~~ /usr/src/sys/netgraph/netgraph.h:580:39: note: expanded from macro 'NG_NODE_ID' #define NG_NODE_ID(node) _ng_node_id(node, _NN_) ^~~~ /usr/src/sys/netgraph/netgraph.h:485:20: note: passing argument to parameter 'node' here _ng_node_id(node_p node, char *file, int line) On 2/7/21, Lutz Donnerhacke wrote: > The branch main has been updated by donner: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=bb67e52db143b699bdac1830717930b26a7b5766 > > commit bb67e52db143b699bdac1830717930b26a7b5766 > Author: Lutz Donnerhacke > AuthorDate: 2021-01-13 22:18:55 +0000 > Commit: Lutz Donnerhacke > CommitDate: 2021-02-07 14:39:57 +0000 > > netgraph/ng_bridge: Make simple internal functions read-only > > The data path in netgraph is designed to work on an read only state of > the whole netgraph network. Currently this is achived by convetion, > there is no technical enforcment. This patch is part of a series to > make ng_brigde multithreaded, which is done by rewrite the data path > to const handling. > > Reviewed By: kp > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D28141 > --- > sys/netgraph/netgraph.h | 5 ++++- > sys/netgraph/ng_base.c | 2 +- > sys/netgraph/ng_bridge.c | 10 ++++++---- > 3 files changed, 11 insertions(+), 6 deletions(-) > > diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h > index 7535472dc631..5040471c5ce0 100644 > --- a/sys/netgraph/netgraph.h > +++ b/sys/netgraph/netgraph.h > @@ -87,6 +87,9 @@ struct ng_item ; > typedef struct ng_item *item_p; > typedef struct ng_node *node_p; > typedef struct ng_hook *hook_p; > +typedef struct ng_item const *item_cp; > +typedef struct ng_node const *node_cp; > +typedef struct ng_hook const *hook_cp; > > /* node method definitions */ > typedef int ng_constructor_t(node_p node); > @@ -1139,7 +1142,7 @@ int ng_make_node_common(struct ng_type *typep, node_p > *nodep); > int ng_name_node(node_p node, const char *name); > node_p ng_name2noderef(node_p node, const char *name); > int ng_newtype(struct ng_type *tp); > -ng_ID_t ng_node2ID(node_p node); > +ng_ID_t ng_node2ID(node_cp node); > item_p ng_package_data(struct mbuf *m, int flags); > item_p ng_package_msg(struct ng_mesg *msg, int flags); > item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); > diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c > index dadf86eb8dde..6ab39421b255 100644 > --- a/sys/netgraph/ng_base.c > +++ b/sys/netgraph/ng_base.c > @@ -836,7 +836,7 @@ ng_ID2noderef(ng_ID_t ID) > } > > ng_ID_t > -ng_node2ID(node_p node) > +ng_node2ID(node_cp node) > { > return (node ? NG_NODE_ID(node) : 0); > } > diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c > index 4898a55f1463..d5b3b520a497 100644 > --- a/sys/netgraph/ng_bridge.c > +++ b/sys/netgraph/ng_bridge.c > @@ -115,6 +115,7 @@ struct ng_bridge_link { > sendUnknown : 1;/* send unknown macs out */ > struct ng_bridge_link_kernel_stats stats; /* link stats */ > }; > +typedef struct ng_bridge_link const *link_cp; /* read only access */ > > /* Per-node private data */ > struct ng_bridge_private { > @@ -130,6 +131,7 @@ struct ng_bridge_private { > struct callout timer; /* one second periodic timer */ > }; > typedef struct ng_bridge_private *priv_p; > +typedef struct ng_bridge_private const *priv_cp; /* read only access */ > > /* Information about a host, stored in a hash table entry */ > struct ng_bridge_hent { > @@ -149,12 +151,12 @@ static ng_rcvdata_t ng_bridge_rcvdata; > static ng_disconnect_t ng_bridge_disconnect; > > /* Other internal functions */ > -static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char > *addr); > +static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char > *addr); > static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); > static void ng_bridge_rehash(priv_p priv); > static void ng_bridge_remove_hosts(priv_p priv, link_p link); > static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int > arg2); > -static const char *ng_bridge_nodename(node_p node); > +static const char *ng_bridge_nodename(node_cp node); > > /* Ethernet broadcast */ > static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = > @@ -920,7 +922,7 @@ ng_bridge_disconnect(hook_p hook) > * Find a host entry in the table. > */ > static struct ng_bridge_host * > -ng_bridge_get(priv_p priv, const u_char *addr) > +ng_bridge_get(priv_cp priv, const u_char *addr) > { > const int bucket = HASH(addr, priv->hashMask); > struct ng_bridge_hent *hent; > @@ -1131,7 +1133,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void > *arg1, int arg2) > * Return node's "name", even if it doesn't have one. > */ > static const char * > -ng_bridge_nodename(node_p node) > +ng_bridge_nodename(node_cp node) > { > static char name[NG_NODESIZ]; > > -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Sun Feb 7 16:39: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 2A55053162C; Sun, 7 Feb 2021 16:39:21 +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 4DYZcS69lxz4pVV; Sun, 7 Feb 2021 16:39:20 +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 117Gd3RC003790 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 7 Feb 2021 17:39:03 +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 117Gd3Df001397; Sun, 7 Feb 2021 17:39:03 +0100 Date: Sun, 7 Feb 2021 17:39:03 +0100 From: Lutz Donnerhacke To: Mateusz Guzik Cc: Lutz Donnerhacke , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bb67e52db143 - main - netgraph/ng_bridge: Make simple internal functions read-only Message-ID: <20210207163903.GA1311@belenus.iks-jena.de> References: <202102071440.117Eep3U033223@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4DYZcS69lxz4pVV 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: Sun, 07 Feb 2021 16:39:21 -0000 On Sun, Feb 07, 2021 at 04:27:11PM +0100, Mateusz Guzik wrote: > One of your commits mass breaks LINT kernels: That was not the plan. I did compile all the netgraph code after the üatch without any problems. Thank you for detecting this. I'll revert the patch and rework it. From owner-dev-commits-src-all@freebsd.org Sun Feb 7 16:40: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 392FE53146A; Sun, 7 Feb 2021 16:40: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 4DYZf31BPbz4pYf; Sun, 7 Feb 2021 16:40: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 1C67E272BC; Sun, 7 Feb 2021 16:40: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 117GehxH089689; Sun, 7 Feb 2021 16:40:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117GehC2089688; Sun, 7 Feb 2021 16:40:43 GMT (envelope-from git) Date: Sun, 7 Feb 2021 16:40:43 GMT Message-Id: <202102071640.117GehC2089688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: cef689f45b9d - main - Revert "netgraph/ng_bridge: Make simple internal functions read-only" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cef689f45b9d5785ede463bcd23fea51bc1143ed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 16:40:43 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=cef689f45b9d5785ede463bcd23fea51bc1143ed commit cef689f45b9d5785ede463bcd23fea51bc1143ed Author: Lutz Donnerhacke AuthorDate: 2021-02-07 16:39:35 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-07 16:39:35 +0000 Revert "netgraph/ng_bridge: Make simple internal functions read-only" Patch mass breaks LINT kernels. This reverts commit bb67e52db143b699bdac1830717930b26a7b5766. --- sys/netgraph/netgraph.h | 5 +---- sys/netgraph/ng_base.c | 2 +- sys/netgraph/ng_bridge.c | 10 ++++------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 5040471c5ce0..7535472dc631 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -87,9 +87,6 @@ struct ng_item ; typedef struct ng_item *item_p; typedef struct ng_node *node_p; typedef struct ng_hook *hook_p; -typedef struct ng_item const *item_cp; -typedef struct ng_node const *node_cp; -typedef struct ng_hook const *hook_cp; /* node method definitions */ typedef int ng_constructor_t(node_p node); @@ -1142,7 +1139,7 @@ int ng_make_node_common(struct ng_type *typep, node_p *nodep); int ng_name_node(node_p node, const char *name); node_p ng_name2noderef(node_p node, const char *name); int ng_newtype(struct ng_type *tp); -ng_ID_t ng_node2ID(node_cp node); +ng_ID_t ng_node2ID(node_p node); item_p ng_package_data(struct mbuf *m, int flags); item_p ng_package_msg(struct ng_mesg *msg, int flags); item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 6ab39421b255..dadf86eb8dde 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -836,7 +836,7 @@ ng_ID2noderef(ng_ID_t ID) } ng_ID_t -ng_node2ID(node_cp node) +ng_node2ID(node_p node) { return (node ? NG_NODE_ID(node) : 0); } diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index d5b3b520a497..4898a55f1463 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -115,7 +115,6 @@ struct ng_bridge_link { sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_kernel_stats stats; /* link stats */ }; -typedef struct ng_bridge_link const *link_cp; /* read only access */ /* Per-node private data */ struct ng_bridge_private { @@ -131,7 +130,6 @@ struct ng_bridge_private { struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; -typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ struct ng_bridge_hent { @@ -151,12 +149,12 @@ static ng_rcvdata_t ng_bridge_rcvdata; static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ -static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char *addr); +static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char *addr); static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); static void ng_bridge_remove_hosts(priv_p priv, link_p link); static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); -static const char *ng_bridge_nodename(node_cp node); +static const char *ng_bridge_nodename(node_p node); /* Ethernet broadcast */ static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = @@ -922,7 +920,7 @@ ng_bridge_disconnect(hook_p hook) * Find a host entry in the table. */ static struct ng_bridge_host * -ng_bridge_get(priv_cp priv, const u_char *addr) +ng_bridge_get(priv_p priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); struct ng_bridge_hent *hent; @@ -1133,7 +1131,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) * Return node's "name", even if it doesn't have one. */ static const char * -ng_bridge_nodename(node_cp node) +ng_bridge_nodename(node_p node) { static char name[NG_NODESIZ]; From owner-dev-commits-src-all@freebsd.org Sun Feb 7 17:31: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 3CD4D53242F; Sun, 7 Feb 2021 17:31:40 +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 4DYbmq6zl7z4rtS; Sun, 7 Feb 2021 17:31:39 +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 117HVafW010297 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 7 Feb 2021 18:31:36 +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 117HVZ4M002629; Sun, 7 Feb 2021 18:31:35 +0100 Date: Sun, 7 Feb 2021 18:31:35 +0100 From: Lutz Donnerhacke To: Mateusz Guzik Cc: Lutz Donnerhacke , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bb67e52db143 - main - netgraph/ng_bridge: Make simple internal functions read-only Message-ID: <20210207173135.GA2488@belenus.iks-jena.de> References: <202102071440.117Eep3U033223@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-message-flag: Please send plain text messages only. Thank you. User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: 4DYbmq6zl7z4rtS 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: Sun, 07 Feb 2021 17:31:40 -0000 On Sun, Feb 07, 2021 at 04:27:11PM +0100, Mateusz Guzik wrote: > One of your commits mass breaks LINT kernels: Got the error trigger. LINT includes all configuration options, even NETGRAPH_DEBUG. This option includes a complete different set of code, which is amost never used (it annotate and logs all netgraph calls to the kernel console and never frees any allocated memory). This is done by replaceing macros by functions calls. And those calls are now checked. Thank you for pointing this out. From owner-dev-commits-src-all@freebsd.org Sun Feb 7 19:36: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 8C586535042; Sun, 7 Feb 2021 19:36: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 4DYfXw3GbSz3Glc; Sun, 7 Feb 2021 19:36: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 62AAD1A3F; Sun, 7 Feb 2021 19:36: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 117JaWMj015459; Sun, 7 Feb 2021 19:36:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117JaW9B015458; Sun, 7 Feb 2021 19:36:32 GMT (envelope-from git) Date: Sun, 7 Feb 2021 19:36:32 GMT Message-Id: <202102071936.117JaW9B015458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 6117aa58fa4f - main - netgraph/ng_bridge: Make simple internal functions read-only MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6117aa58fa4f5891badf58b13c759976983f4f04 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 19:36:32 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=6117aa58fa4f5891badf58b13c759976983f4f04 commit 6117aa58fa4f5891badf58b13c759976983f4f04 Author: Lutz Donnerhacke AuthorDate: 2021-01-13 22:18:55 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-02-07 19:31:33 +0000 netgraph/ng_bridge: Make simple internal functions read-only The data path in netgraph is designed to work on an read only state of the whole netgraph network. Currently this is achived by convention, there is no technical enforcment. In the case of NETGRAPH_DEBUG all nodes can be annotated for debugging purposes, so the strict enforcment needs to be lifted for this purpose. This patch is part of a series to make ng_bridge multithreaded, which is done by rewrite the data path to operate on const. Reviewed By: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28141 --- sys/netgraph/netgraph.h | 9 ++++++++- sys/netgraph/ng_base.c | 2 +- sys/netgraph/ng_bridge.c | 10 ++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 7535472dc631..9cc298b38236 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -87,6 +87,13 @@ struct ng_item ; typedef struct ng_item *item_p; typedef struct ng_node *node_p; typedef struct ng_hook *hook_p; +typedef struct ng_item const *item_cp; +typedef struct ng_hook const *hook_cp; +#ifdef NETGRAPH_DEBUG +typedef struct ng_node *node_cp; /* annotated during debug */ +#else /* NETGRAPH_DEBUG */ +typedef struct ng_node const *node_cp; +#endif /* NETGRAPH_DEBUG */ /* node method definitions */ typedef int ng_constructor_t(node_p node); @@ -1139,7 +1146,7 @@ int ng_make_node_common(struct ng_type *typep, node_p *nodep); int ng_name_node(node_p node, const char *name); node_p ng_name2noderef(node_p node, const char *name); int ng_newtype(struct ng_type *tp); -ng_ID_t ng_node2ID(node_p node); +ng_ID_t ng_node2ID(node_cp node); item_p ng_package_data(struct mbuf *m, int flags); item_p ng_package_msg(struct ng_mesg *msg, int flags); item_p ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg); diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index dadf86eb8dde..6ab39421b255 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -836,7 +836,7 @@ ng_ID2noderef(ng_ID_t ID) } ng_ID_t -ng_node2ID(node_p node) +ng_node2ID(node_cp node) { return (node ? NG_NODE_ID(node) : 0); } diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 4898a55f1463..d5b3b520a497 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -115,6 +115,7 @@ struct ng_bridge_link { sendUnknown : 1;/* send unknown macs out */ struct ng_bridge_link_kernel_stats stats; /* link stats */ }; +typedef struct ng_bridge_link const *link_cp; /* read only access */ /* Per-node private data */ struct ng_bridge_private { @@ -130,6 +131,7 @@ struct ng_bridge_private { struct callout timer; /* one second periodic timer */ }; typedef struct ng_bridge_private *priv_p; +typedef struct ng_bridge_private const *priv_cp; /* read only access */ /* Information about a host, stored in a hash table entry */ struct ng_bridge_hent { @@ -149,12 +151,12 @@ static ng_rcvdata_t ng_bridge_rcvdata; static ng_disconnect_t ng_bridge_disconnect; /* Other internal functions */ -static struct ng_bridge_host *ng_bridge_get(priv_p priv, const u_char *addr); +static struct ng_bridge_host *ng_bridge_get(priv_cp priv, const u_char *addr); static int ng_bridge_put(priv_p priv, const u_char *addr, link_p link); static void ng_bridge_rehash(priv_p priv); static void ng_bridge_remove_hosts(priv_p priv, link_p link); static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); -static const char *ng_bridge_nodename(node_p node); +static const char *ng_bridge_nodename(node_cp node); /* Ethernet broadcast */ static const u_char ng_bridge_bcast_addr[ETHER_ADDR_LEN] = @@ -920,7 +922,7 @@ ng_bridge_disconnect(hook_p hook) * Find a host entry in the table. */ static struct ng_bridge_host * -ng_bridge_get(priv_p priv, const u_char *addr) +ng_bridge_get(priv_cp priv, const u_char *addr) { const int bucket = HASH(addr, priv->hashMask); struct ng_bridge_hent *hent; @@ -1131,7 +1133,7 @@ ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2) * Return node's "name", even if it doesn't have one. */ static const char * -ng_bridge_nodename(node_p node) +ng_bridge_nodename(node_cp node) { static char name[NG_NODESIZ]; From owner-dev-commits-src-all@freebsd.org Sun Feb 7 21:28: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 71232539A6D; Sun, 7 Feb 2021 21:28: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 4DYj1y2kz9z3h6H; Sun, 7 Feb 2021 21:28: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 50D563825; Sun, 7 Feb 2021 21:28: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 117LSM3p058860; Sun, 7 Feb 2021 21:28:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117LSM6k058859; Sun, 7 Feb 2021 21:28:22 GMT (envelope-from git) Date: Sun, 7 Feb 2021 21:28:22 GMT Message-Id: <202102072128.117LSM6k058859@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: e44a78ce6f24 - main - 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/main X-Git-Reftype: branch X-Git-Commit: e44a78ce6f249f1eb7df94cb6953698953ebd88b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 21:28:22 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=e44a78ce6f249f1eb7df94cb6953698953ebd88b commit e44a78ce6f249f1eb7df94cb6953698953ebd88b Author: Edward Tomasz Napierala AuthorDate: 2021-02-07 20:28:35 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-02-07 20:42:04 +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 --- 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 Sun Feb 7 22:14: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 F1ADB53B1F1; Sun, 7 Feb 2021 22:14: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 4DYk3Y6V4Cz3lFt; Sun, 7 Feb 2021 22:14: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 D1ACE42AA; Sun, 7 Feb 2021 22:14: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 117MEnbI023825; Sun, 7 Feb 2021 22:14:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117MEnF7023824; Sun, 7 Feb 2021 22:14:49 GMT (envelope-from git) Date: Sun, 7 Feb 2021 22:14:49 GMT Message-Id: <202102072214.117MEnF7023824@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: d26f2a50ff48 - main - powerpc64: Fix boot on virtual-mode OF (PowerMac G5) 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: d26f2a50ff48dacd38ba358d658882d51f7bdbc4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 22:14:50 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=d26f2a50ff48dacd38ba358d658882d51f7bdbc4 commit d26f2a50ff48dacd38ba358d658882d51f7bdbc4 Author: Brandon Bergren AuthorDate: 2021-02-07 22:05:41 +0000 Commit: Brandon Bergren CommitDate: 2021-02-07 22:13:55 +0000 powerpc64: Fix boot on virtual-mode OF (PowerMac G5) In 78599c32efed3247d165302a1fbe8d9203e38974, CFI endproc decoration was added to locore64.S. However, it missed the subtle detail that __restartkernel_virtual() falls through to __restartkernel(). This was causing boot failure on PowerMac G5, as it tried to execute the epilogue as code. Fix this by branching to __restartkernel() instead of intentionally running off the end of the function. While here, add some additional notes on how the virtual mode restart works. MFC after: 3 days --- sys/powerpc/aim/locore64.S | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/powerpc/aim/locore64.S b/sys/powerpc/aim/locore64.S index 0bc0619620d9..f0a183c4b331 100644 --- a/sys/powerpc/aim/locore64.S +++ b/sys/powerpc/aim/locore64.S @@ -255,6 +255,16 @@ ASENTRY_NOPROF(__restartkernel_virtual) addi %r14, %r14, 1 cmpdi %r14, 16 blt 1b + + /* + * Now that we are set up with a temporary direct map, we can + * continue with __restartkernel. Translation will be switched + * back on at the rfid, at which point we will be executing from + * the temporary direct map we just installed, until the kernel + * takes over responsibility for the MMU. + */ + bl __restartkernel + nop ASEND(__restartkernel_virtual) ASENTRY_NOPROF(__restartkernel) From owner-dev-commits-src-all@freebsd.org Sun Feb 7 23:49: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 A0F9A53D3EA; Sun, 7 Feb 2021 23:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DYm9848hyz3rNK; Sun, 7 Feb 2021 23:49: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 8147551DF; Sun, 7 Feb 2021 23:49: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 117Nnmwi041463; Sun, 7 Feb 2021 23:49:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 117NnmB2041462; Sun, 7 Feb 2021 23:49:48 GMT (envelope-from git) Date: Sun, 7 Feb 2021 23:49:48 GMT Message-Id: <202102072349.117NnmB2041462@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: b3c6fe663bb9 - main - epoll: Store epoll_event udata member in ext member of kevent. 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: b3c6fe663bb90240f8bda6b5ba9c6a761f09f078 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-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 Feb 2021 23:49:48 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b3c6fe663bb90240f8bda6b5ba9c6a761f09f078 commit b3c6fe663bb90240f8bda6b5ba9c6a761f09f078 Author: Vladimir Kondratyev AuthorDate: 2021-02-07 23:46:14 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-02-07 23:46:14 +0000 epoll: Store epoll_event udata member in ext member of kevent. Current epoll implementation stores udata fields of epoll_event structure in special dynamically-sized table rather than in udata field of backing kevent structure because of 2 reasons: 1. Kevent's udata size is smaller than epoll's on 32-bit archs. 2. Kevent's udata can be clobbered on execution EPOLL_CTL_ADD as kqueue modifies existing event while epoll returns error in this case. After r320043 has introduced four new 64bit user data members (ext[]), we can store epoll udata in one of them and drop aforementioned table. According to kqueue_register() source code ext members are not updated when existing kevent is modified that fixes p.2. As a side effect the patch fixes PR/252582. Reviewed by: trasz MFC after: 1 month Differential revision: https://reviews.freebsd.org/D28169 --- sys/compat/linux/linux_emul.c | 21 ---------- sys/compat/linux/linux_emul.h | 1 - sys/compat/linux/linux_event.c | 88 ++++++------------------------------------ 3 files changed, 11 insertions(+), 99 deletions(-) diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 1dfbe239ccc4..499bebe8926a 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -143,7 +143,6 @@ linux_proc_init(struct thread *td, struct thread *newtd, int flags) { struct linux_emuldata *em; struct linux_pemuldata *pem; - struct epoll_emuldata *emd; struct proc *p; if (newtd != NULL) { @@ -185,15 +184,9 @@ linux_proc_init(struct thread *td, struct thread *newtd, int flags) em->child_clear_tid = NULL; em->child_set_tid = NULL; - /* epoll should be destroyed in a case of exec. */ pem = pem_find(p); KASSERT(pem != NULL, ("proc_exit: proc emuldata not found.\n")); pem->persona = 0; - if (pem->epoll != NULL) { - emd = pem->epoll; - pem->epoll = NULL; - free(emd, M_EPOLL); - } } } @@ -202,7 +195,6 @@ void linux_on_exit(struct proc *p) { struct linux_pemuldata *pem; - struct epoll_emuldata *emd; struct thread *td = curthread; MPASS(SV_CURPROC_ABI() == SV_ABI_LINUX); @@ -217,12 +209,6 @@ linux_on_exit(struct proc *p) p->p_emuldata = NULL; - if (pem->epoll != NULL) { - emd = pem->epoll; - pem->epoll = NULL; - free(emd, M_EPOLL); - } - sx_destroy(&pem->pem_sx); free(pem, M_LINUX); } @@ -267,7 +253,6 @@ int linux_common_execve(struct thread *td, struct image_args *eargs) { struct linux_pemuldata *pem; - struct epoll_emuldata *emd; struct vmspace *oldvmspace; struct linux_emuldata *em; struct proc *p; @@ -299,12 +284,6 @@ linux_common_execve(struct thread *td, struct image_args *eargs) p->p_emuldata = NULL; PROC_UNLOCK(p); - if (pem->epoll != NULL) { - emd = pem->epoll; - pem->epoll = NULL; - free(emd, M_EPOLL); - } - free(em, M_TEMP); free(pem, M_LINUX); } diff --git a/sys/compat/linux/linux_emul.h b/sys/compat/linux/linux_emul.h index 1bbc69ad98be..de66a7a4c82a 100644 --- a/sys/compat/linux/linux_emul.h +++ b/sys/compat/linux/linux_emul.h @@ -68,7 +68,6 @@ int linux_common_execve(struct thread *, struct image_args *); struct linux_pemuldata { uint32_t flags; /* process emuldata flags */ struct sx pem_sx; /* lock for this struct */ - void *epoll; /* epoll data */ uint32_t persona; /* process execution domain */ uint32_t ptrace_flags; /* used by ptrace(2) */ }; diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index f6cd9304f5cd..991af1b539e4 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -71,25 +71,8 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * epoll defines 'struct epoll_event' with the field 'data' as 64 bits - * on all architectures. But on 32 bit architectures BSD 'struct kevent' only - * has 32 bit opaque pointer as 'udata' field. So we can't pass epoll supplied - * data verbatuim. Therefore we allocate 64-bit memory block to pass - * user supplied data for every file descriptor. - */ - typedef uint64_t epoll_udata_t; -struct epoll_emuldata { - uint32_t fdc; /* epoll udata max index */ - epoll_udata_t udata[1]; /* epoll user data vector */ -}; - -#define EPOLL_DEF_SZ 16 -#define EPOLL_SIZE(fdn) \ - (sizeof(struct epoll_emuldata)+(fdn) * sizeof(epoll_udata_t)) - struct epoll_event { uint32_t events; epoll_udata_t data; @@ -101,7 +84,6 @@ __attribute__((packed)) #define LINUX_MAX_EVENTS (INT_MAX / sizeof(struct epoll_event)) -static void epoll_fd_install(struct thread *td, int fd, epoll_udata_t udata); static int epoll_to_kevent(struct thread *td, int fd, struct epoll_event *l_event, struct kevent *kevent, int *nkevents); @@ -175,47 +157,11 @@ struct timerfd { static void linux_timerfd_expire(void *); static void linux_timerfd_curval(struct timerfd *, struct itimerspec *); -static void -epoll_fd_install(struct thread *td, int fd, epoll_udata_t udata) -{ - struct linux_pemuldata *pem; - struct epoll_emuldata *emd; - struct proc *p; - - p = td->td_proc; - - pem = pem_find(p); - KASSERT(pem != NULL, ("epoll proc emuldata not found.\n")); - - LINUX_PEM_XLOCK(pem); - if (pem->epoll == NULL) { - emd = malloc(EPOLL_SIZE(fd), M_EPOLL, M_WAITOK); - emd->fdc = fd; - pem->epoll = emd; - } else { - emd = pem->epoll; - if (fd > emd->fdc) { - emd = realloc(emd, EPOLL_SIZE(fd), M_EPOLL, M_WAITOK); - emd->fdc = fd; - pem->epoll = emd; - } - } - emd->udata[fd] = udata; - LINUX_PEM_XUNLOCK(pem); -} - static int epoll_create_common(struct thread *td, int flags) { - int error; - - error = kern_kqueue(td, flags, NULL); - if (error != 0) - return (error); - - epoll_fd_install(td, EPOLL_DEF_SZ, 0); - return (0); + return (kern_kqueue(td, flags, NULL)); } #ifdef LINUX_LEGACY_SYSCALLS @@ -271,11 +217,15 @@ epoll_to_kevent(struct thread *td, int fd, struct epoll_event *l_event, /* flags related to what event is registered */ if ((levents & LINUX_EPOLL_EVRD) != 0) { - EV_SET(kevent++, fd, EVFILT_READ, kev_flags, 0, 0, 0); + EV_SET(kevent, fd, EVFILT_READ, kev_flags, 0, 0, 0); + kevent->ext[0] = l_event->data; + ++kevent; ++(*nkevents); } if ((levents & LINUX_EPOLL_EVWR) != 0) { - EV_SET(kevent++, fd, EVFILT_WRITE, kev_flags, 0, 0, 0); + EV_SET(kevent, fd, EVFILT_WRITE, kev_flags, 0, 0, 0); + kevent->ext[0] = l_event->data; + ++kevent; ++(*nkevents); } /* zero event mask is legal */ @@ -289,7 +239,6 @@ epoll_to_kevent(struct thread *td, int fd, struct epoll_event *l_event, pem = pem_find(p); KASSERT(pem != NULL, ("epoll proc emuldata not found.\n")); - KASSERT(pem->epoll != NULL, ("epoll proc epolldata not found.\n")); LINUX_PEM_XLOCK(pem); if ((pem->flags & LINUX_XUNSUP_EPOLL) == 0) { @@ -314,6 +263,8 @@ static void kevent_to_epoll(struct kevent *kevent, struct epoll_event *l_event) { + l_event->data = kevent->ext[0]; + if ((kevent->flags & EV_ERROR) != 0) { l_event->events = LINUX_EPOLLERR; return; @@ -342,30 +293,15 @@ static int epoll_kev_copyout(void *arg, struct kevent *kevp, int count) { struct epoll_copyout_args *args; - struct linux_pemuldata *pem; - struct epoll_emuldata *emd; struct epoll_event *eep; - int error, fd, i; + int error, i; args = (struct epoll_copyout_args*) arg; eep = malloc(sizeof(*eep) * count, M_EPOLL, M_WAITOK | M_ZERO); - pem = pem_find(args->p); - KASSERT(pem != NULL, ("epoll proc emuldata not found.\n")); - LINUX_PEM_SLOCK(pem); - emd = pem->epoll; - KASSERT(emd != NULL, ("epoll proc epolldata not found.\n")); - - for (i = 0; i < count; i++) { + for (i = 0; i < count; i++) kevent_to_epoll(&kevp[i], &eep[i]); - fd = kevp[i].ident; - KASSERT(fd <= emd->fdc, ("epoll user data vector" - " is too small.\n")); - eep[i].data = emd->udata[fd]; - } - LINUX_PEM_SUNLOCK(pem); - error = copyout(eep, args->leventlist, count * sizeof(*eep)); if (error == 0) { args->leventlist += count; @@ -473,8 +409,6 @@ linux_epoll_ctl(struct thread *td, struct linux_epoll_ctl_args *args) goto leave0; } - epoll_fd_install(td, args->fd, le.data); - error = kern_kevent_fp(td, epfp, nchanges, 0, &k_ops, NULL); leave0: