From owner-dev-commits-src-main@freebsd.org Mon Mar 22 00:02:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5026057261F; Mon, 22 Mar 2021 00:02: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 4F3ZSf1RbLz4cSM; Mon, 22 Mar 2021 00:02: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 245E423BFF; Mon, 22 Mar 2021 00: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 12M02g75049111; Mon, 22 Mar 2021 00: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 12M02ggA049110; Mon, 22 Mar 2021 00:02:42 GMT (envelope-from git) Date: Mon, 22 Mar 2021 00:02:42 GMT Message-Id: <202103220002.12M02ggA049110@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 25bfa448602c - main - Add device and ifnet logging methods, similar to device_printf / if_printf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25bfa448602cac74723115d0b0bd145ac795b685 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 00:02:42 -0000 The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=25bfa448602cac74723115d0b0bd145ac795b685 commit 25bfa448602cac74723115d0b0bd145ac795b685 Author: Adrian Chadd AuthorDate: 2021-03-21 18:49:05 +0000 Commit: Adrian Chadd CommitDate: 2021-03-22 00:02:34 +0000 Add device and ifnet logging methods, similar to device_printf / if_printf * device_printf() is effectively a printf * if_printf() is effectively a LOG_INFO This allows subsystems to log device/netif stuff using different log levels, rather than having to invent their own way to prefix unit/netif names. Differential Revision: https://reviews.freebsd.org/D29320 Reviewed by: imp --- sys/kern/subr_bus.c | 41 +++++++++++++++++++++++++++++++++++++++++ sys/net/if.c | 26 +++++++++++++++++++++++--- sys/net/if_var.h | 1 + sys/sys/bus.h | 1 + 4 files changed, 66 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index ecd6c9685e36..31975fb8977c 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2435,6 +2435,47 @@ device_printf(device_t dev, const char * fmt, ...) return (retval); } +/** + * @brief Print the name of the device followed by a colon, a space + * and the result of calling log() with the value of @p fmt and + * the following arguments. + * + * @returns the number of characters printed + */ +int +device_log(device_t dev, int pri, const char * fmt, ...) +{ + char buf[128]; + struct sbuf sb; + const char *name; + va_list ap; + size_t retval; + + retval = 0; + + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + + name = device_get_name(dev); + + if (name == NULL) + sbuf_cat(&sb, "unknown: "); + else + sbuf_printf(&sb, "%s%d: ", name, device_get_unit(dev)); + + va_start(ap, fmt); + sbuf_vprintf(&sb, fmt, ap); + va_end(ap); + + sbuf_finish(&sb); + + log(pri, "%.*s", (int) sbuf_len(&sb), sbuf_data(&sb)); + retval = sbuf_len(&sb); + + sbuf_delete(&sb); + + return (retval); +} + /** * @internal */ diff --git a/sys/net/if.c b/sys/net/if.c index 86c60cfcfa7f..bbd677e0153c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -3968,15 +3968,35 @@ if_initname(struct ifnet *ifp, const char *name, int unit) strlcpy(ifp->if_xname, name, IFNAMSIZ); } +static int +if_vlog(struct ifnet *ifp, int pri, const char *fmt, va_list ap) +{ + char if_fmt[256]; + + snprintf(if_fmt, sizeof(if_fmt), "%s: %s", ifp->if_xname, fmt); + vlog(pri, if_fmt, ap); + return (0); +} + + int if_printf(struct ifnet *ifp, const char *fmt, ...) { - char if_fmt[256]; va_list ap; - snprintf(if_fmt, sizeof(if_fmt), "%s: %s", ifp->if_xname, fmt); va_start(ap, fmt); - vlog(LOG_INFO, if_fmt, ap); + if_vlog(ifp, LOG_INFO, fmt, ap); + va_end(ap); + return (0); +} + +int +if_log(struct ifnet *ifp, int pri, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + if_vlog(ifp, pri, fmt, ap); va_end(ap); return (0); } diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 33a737880a8d..1f82dd028379 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -659,6 +659,7 @@ void if_free(struct ifnet *); void if_initname(struct ifnet *, const char *, int); void if_link_state_change(struct ifnet *, int); int if_printf(struct ifnet *, const char *, ...) __printflike(2, 3); +int if_log(struct ifnet *, int, const char *, ...) __printflike(3, 4); void if_ref(struct ifnet *); void if_rele(struct ifnet *); bool if_try_ref(struct ifnet *); diff --git a/sys/sys/bus.h b/sys/sys/bus.h index fbc69ca625c1..25fb86d3c42d 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -607,6 +607,7 @@ int device_is_quiet(device_t dev); device_t device_lookup_by_name(const char *name); int device_print_prettyname(device_t dev); int device_printf(device_t dev, const char *, ...) __printflike(2, 3); +int device_log(device_t dev, int pri, const char *, ...) __printflike(3, 4); int device_probe(device_t dev); int device_probe_and_attach(device_t dev); int device_probe_child(device_t bus, device_t dev); From owner-dev-commits-src-main@freebsd.org Mon Mar 22 09:34:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FCCE57F330; Mon, 22 Mar 2021 09:34: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 4F3q7x72wdz56Gt; Mon, 22 Mar 2021 09:34: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 E3F9938E8; Mon, 22 Mar 2021 09:34: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 12M9Y5dp046847; Mon, 22 Mar 2021 09:34:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12M9Y5Oc046846; Mon, 22 Mar 2021 09:34:05 GMT (envelope-from git) Date: Mon, 22 Mar 2021 09:34:05 GMT Message-Id: <202103220934.12M9Y5Oc046846@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: ede14736fd6d - main - ivrs_drv: Fix IVHDs with duplicated BaseAddress MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ede14736fd6d74db0374f4a233491ad5dc0e9b1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 09:34:06 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=ede14736fd6d74db0374f4a233491ad5dc0e9b1d commit ede14736fd6d74db0374f4a233491ad5dc0e9b1d Author: Ka Ho Ng AuthorDate: 2021-03-22 09:33:43 +0000 Commit: Ka Ho Ng CommitDate: 2021-03-22 09:33:43 +0000 ivrs_drv: Fix IVHDs with duplicated BaseAddress Reviewed by: jhb Approved by: philip (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28945 --- sys/amd64/vmm/amd/ivrs_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/amd64/vmm/amd/ivrs_drv.c b/sys/amd64/vmm/amd/ivrs_drv.c index da3e0e17d140..d33229623a96 100644 --- a/sys/amd64/vmm/amd/ivrs_drv.c +++ b/sys/amd64/vmm/amd/ivrs_drv.c @@ -366,10 +366,11 @@ ivhd_identify(driver_t *driver, device_t parent) for (i = ivhd_count - 1 ; i > 0 ; i--){ if (ivhd_is_newer(&ivhd_hdrs[i-1]->Header, &ivhd_hdrs[i]->Header)) { - ivhd_hdrs[i-1] = ivhd_hdrs[i]; + memmove(&ivhd_hdrs[i-1], &ivhd_hdrs[i], + sizeof(void *) * (ivhd_count - i)); ivhd_count--; } - } + } ivhd_devs = malloc(sizeof(device_t) * ivhd_count, M_DEVBUF, M_WAITOK | M_ZERO); From owner-dev-commits-src-main@freebsd.org Mon Mar 22 09:34:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E69E57F8F6; Mon, 22 Mar 2021 09:34: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 4F3q7z0N1Fz565s; Mon, 22 Mar 2021 09:34: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 F36FA34BA; Mon, 22 Mar 2021 09:34: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 12M9Y6af046870; Mon, 22 Mar 2021 09:34:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12M9Y61V046869; Mon, 22 Mar 2021 09:34:06 GMT (envelope-from git) Date: Mon, 22 Mar 2021 09:34:06 GMT Message-Id: <202103220934.12M9Y61V046869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 74ada297e897 - main - AMD-vi: Fix IOMMU device interrupts being overridden MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 74ada297e8978b8efda3dffdd1bb24aee7c5faa4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 09:34:07 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=74ada297e8978b8efda3dffdd1bb24aee7c5faa4 commit 74ada297e8978b8efda3dffdd1bb24aee7c5faa4 Author: Ka Ho Ng AuthorDate: 2021-03-22 09:33:43 +0000 Commit: Ka Ho Ng CommitDate: 2021-03-22 09:33:43 +0000 AMD-vi: Fix IOMMU device interrupts being overridden Currently, AMD-vi PCI-e passthrough will lead to the following lines in dmesg: "kernel: CPU0: local APIC error 0x40 ivhd0: Error: completion failed tail:0x720, head:0x0." After some tracing, the problem is due to the interaction with amdvi_alloc_intr_resources() and pci_driver_added(). In ivrs_drv, the identification of AMD-vi IVHD is done by walking over the ACPI IVRS table and ivhdX device_ts are added under the acpi bus, while there are no driver handling the corresponding IOMMU PCI function. In amdvi_alloc_intr_resources(), the MSI intr are allocated with the ivhdX device_t instead of the IOMMU PCI function device_t. bus_setup_intr() is called on ivhdX. the IOMMU pci function device_t is only used for pci_enable_msi(). Since bus_setup_intr() is not called on IOMMU pci function, the IOMMU PCI function device_t's dinfo->cfg.msi is never updated to reflect the supposed msi_data and msi_addr. So the msi_data and msi_addr stay in the value 0. When pci_driver_added() tried to loop over the children of a pci bus, and do pci_cfg_restore() on each of them, msi_addr and msi_data with value 0 will be written to the MSI capability of the IOMMU pci function, thus explaining the errors in dmesg. This change includes an amdiommu driver which currently does attaching, detaching and providing DEVMETHODs for setting up and tearing down interrupt. The purpose of the driver is to prevent pci_driver_added() from calling pci_cfg_restore() on the IOMMU PCI function device_t. The introduction of the amdiommu driver handles allocation of an IRQ resource within the IOMMU PCI function, so that the dinfo->cfg.msi is populated. This has been tested on EPYC Rome 7282 with Radeon 5700XT GPU. Sponsored by: The FreeBSD Foundation Reviewed by: jhb Approved by: philip (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28984 --- sys/amd64/vmm/amd/amdiommu.c | 185 +++++++++++++++++++++++++++++++++++++++++ sys/amd64/vmm/amd/amdvi_hw.c | 89 +++----------------- sys/amd64/vmm/amd/amdvi_priv.h | 5 +- sys/amd64/vmm/amd/ivhd_if.m | 46 ++++++++++ sys/amd64/vmm/amd/ivrs_drv.c | 6 ++ sys/modules/vmm/Makefile | 3 + 6 files changed, 253 insertions(+), 81 deletions(-) diff --git a/sys/amd64/vmm/amd/amdiommu.c b/sys/amd64/vmm/amd/amdiommu.c new file mode 100644 index 000000000000..4ded23dff003 --- /dev/null +++ b/sys/amd64/vmm/amd/amdiommu.c @@ -0,0 +1,185 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Fondation + * + * Portions of this software were developed by Ka Ho Ng + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + +#include "amdvi_priv.h" +#include "ivhd_if.h" + +struct amdiommu_softc { + struct resource *event_res; /* Event interrupt resource. */ + void *event_tag; /* Event interrupt tag. */ + int event_rid; +}; + +static int amdiommu_probe(device_t); +static int amdiommu_attach(device_t); +static int amdiommu_detach(device_t); +static int ivhd_setup_intr(device_t, driver_intr_t, void *, + const char *); +static int ivhd_teardown_intr(device_t); + +static device_method_t amdiommu_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, amdiommu_probe), + DEVMETHOD(device_attach, amdiommu_attach), + DEVMETHOD(device_detach, amdiommu_detach), + DEVMETHOD(ivhd_setup_intr, ivhd_setup_intr), + DEVMETHOD(ivhd_teardown_intr, ivhd_teardown_intr), + DEVMETHOD_END +}; +static driver_t amdiommu_driver = { + "amdiommu", + amdiommu_methods, + sizeof(struct amdiommu_softc), +}; + +static int +amdiommu_probe(device_t dev) +{ + int error; + int capoff; + + /* + * Check base class and sub-class + */ + if (pci_get_class(dev) != PCIC_BASEPERIPH || + pci_get_subclass(dev) != PCIS_BASEPERIPH_IOMMU) + return (ENXIO); + + /* + * A IOMMU capability block carries a 0Fh capid. + */ + error = pci_find_cap(dev, PCIY_SECDEV, &capoff); + if (error) + return (ENXIO); + + /* + * bit [18:16] == 011b indicates the capability block is IOMMU + * capability block. If the field is not set to 011b, bail out. + */ + if ((pci_read_config(dev, capoff + 2, 2) & 0x7) != 0x3) + return (ENXIO); + + return (BUS_PROBE_SPECIFIC); +} + +static int +amdiommu_attach(device_t dev) +{ + + device_set_desc(dev, "AMD-Vi/IOMMU PCI function"); + return (0); +} + +static int +amdiommu_detach(device_t dev) +{ + + return (0); +} + +static int +ivhd_setup_intr(device_t dev, driver_intr_t handler, void *arg, + const char *desc) +{ + struct amdiommu_softc *sc; + int error, msicnt; + + sc = device_get_softc(dev); + msicnt = 1; + if (sc->event_res != NULL) + panic("%s is called without intr teardown", __func__); + sc->event_rid = 1; + + error = pci_alloc_msi(dev, &msicnt); + if (error) { + device_printf(dev, "Couldn't find event MSI IRQ resource.\n"); + return (ENOENT); + } + + sc->event_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->event_rid, RF_ACTIVE); + if (sc->event_res == NULL) { + device_printf(dev, "Unable to allocate event INTR resource.\n"); + error = ENOMEM; + goto fail; + } + + error = bus_setup_intr(dev, sc->event_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, handler, arg, &sc->event_tag); + if (error) { + device_printf(dev, "Fail to setup event intr\n"); + goto fail; + } + + bus_describe_intr(dev, sc->event_res, sc->event_tag, "%s", desc); + return (0); + +fail: + ivhd_teardown_intr(dev); + return (error); +} + +static int +ivhd_teardown_intr(device_t dev) +{ + struct amdiommu_softc *sc; + + sc = device_get_softc(dev); + + if (sc->event_res != NULL) { + bus_teardown_intr(dev, sc->event_res, sc->event_tag); + sc->event_tag = NULL; + } + if (sc->event_res != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, sc->event_rid, + sc->event_res); + sc->event_res = NULL; + } + pci_release_msi(dev); + return (0); +} + +static devclass_t amdiommu_devclass; + +/* This driver has to be loaded before ivhd */ +DRIVER_MODULE(amdiommu, pci, amdiommu_driver, amdiommu_devclass, 0, 0); +MODULE_DEPEND(amdiommu, pci, 1, 1, 1); diff --git a/sys/amd64/vmm/amd/amdvi_hw.c b/sys/amd64/vmm/amd/amdvi_hw.c index 62aba04de050..3fe84cc1445a 100644 --- a/sys/amd64/vmm/amd/amdvi_hw.c +++ b/sys/amd64/vmm/amd/amdvi_hw.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ivhd_if.h" #include "pcib_if.h" #include "io/iommu.h" @@ -772,99 +773,33 @@ amdvi_free_evt_intr_res(device_t dev) { struct amdvi_softc *softc; + device_t mmio_dev; softc = device_get_softc(dev); - if (softc->event_tag != NULL) { - bus_teardown_intr(dev, softc->event_res, softc->event_tag); - } - if (softc->event_res != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, softc->event_rid, - softc->event_res); - } - bus_delete_resource(dev, SYS_RES_IRQ, softc->event_rid); - PCIB_RELEASE_MSI(device_get_parent(device_get_parent(dev)), - dev, 1, &softc->event_irq); + mmio_dev = softc->pci_dev; + + IVHD_TEARDOWN_INTR(mmio_dev); } static bool amdvi_alloc_intr_resources(struct amdvi_softc *softc) { struct amdvi_ctrl *ctrl; - device_t dev, pcib; - device_t mmio_dev; - uint64_t msi_addr; - uint32_t msi_data; + device_t dev, mmio_dev; int err; dev = softc->dev; - pcib = device_get_parent(device_get_parent(dev)); - mmio_dev = pci_find_bsf(PCI_RID2BUS(softc->pci_rid), - PCI_RID2SLOT(softc->pci_rid), PCI_RID2FUNC(softc->pci_rid)); - if (device_is_attached(mmio_dev)) { - device_printf(dev, - "warning: IOMMU device is claimed by another driver %s\n", - device_get_driver(mmio_dev)->name); - } - - softc->event_irq = -1; - softc->event_rid = 0; - - /* - * Section 3.7.1 of IOMMU rev 2.0. With MSI, there is only one - * interrupt. XXX: Enable MSI/X support. - */ - err = PCIB_ALLOC_MSI(pcib, dev, 1, 1, &softc->event_irq); - if (err) { - device_printf(dev, - "Couldn't find event MSI IRQ resource.\n"); - return (ENOENT); - } - - err = bus_set_resource(dev, SYS_RES_IRQ, softc->event_rid, - softc->event_irq, 1); - if (err) { - device_printf(dev, "Couldn't set event MSI resource.\n"); - return (ENXIO); - } - - softc->event_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &softc->event_rid, RF_ACTIVE); - if (!softc->event_res) { - device_printf(dev, - "Unable to allocate event INTR resource.\n"); - return (ENOMEM); - } - - if (bus_setup_intr(dev, softc->event_res, - INTR_TYPE_MISC | INTR_MPSAFE, NULL, amdvi_event_intr, - softc, &softc->event_tag)) { - device_printf(dev, "Fail to setup event intr\n"); - bus_release_resource(softc->dev, SYS_RES_IRQ, - softc->event_rid, softc->event_res); - softc->event_res = NULL; - return (ENXIO); - } - - bus_describe_intr(dev, softc->event_res, softc->event_tag, - "fault"); - - err = PCIB_MAP_MSI(pcib, dev, softc->event_irq, &msi_addr, - &msi_data); - if (err) { - device_printf(dev, - "Event interrupt config failed, err=%d.\n", - err); - amdvi_free_evt_intr_res(softc->dev); - return (err); - } + mmio_dev = softc->pci_dev; /* Clear interrupt status bits. */ ctrl = softc->ctrl; ctrl->status &= AMDVI_STATUS_EV_OF | AMDVI_STATUS_EV_INTR; - /* Now enable MSI interrupt. */ - pci_enable_msi(mmio_dev, msi_addr, msi_data); - return (0); + err = IVHD_SETUP_INTR(mmio_dev, amdvi_event_intr, softc, "fault"); + if (err) + device_printf(dev, "Interrupt setup failed on %s\n", + device_get_nameunit(mmio_dev)); + return (err); } static void diff --git a/sys/amd64/vmm/amd/amdvi_priv.h b/sys/amd64/vmm/amd/amdvi_priv.h index 2db6914f08f4..0eae7ca6ca4c 100644 --- a/sys/amd64/vmm/amd/amdvi_priv.h +++ b/sys/amd64/vmm/amd/amdvi_priv.h @@ -375,17 +375,14 @@ enum IvrsType struct amdvi_softc { struct amdvi_ctrl *ctrl; /* Control area. */ device_t dev; /* IOMMU device. */ + device_t pci_dev; /* IOMMU PCI function device. */ enum IvrsType ivhd_type; /* IOMMU IVHD type. */ bool iotlb; /* IOTLB supported by IOMMU */ struct amdvi_cmd *cmd; /* Command descriptor area. */ int cmd_max; /* Max number of commands. */ uint64_t cmp_data; /* Command completion write back. */ struct amdvi_event *event; /* Event descriptor area. */ - struct resource *event_res; /* Event interrupt resource. */ - void *event_tag; /* Event interrupt tag. */ int event_max; /* Max number of events. */ - int event_irq; - int event_rid; /* ACPI various flags. */ uint32_t ivhd_flag; /* ACPI IVHD flag. */ uint32_t ivhd_feature; /* ACPI v1 Reserved or v2 attribute. */ diff --git a/sys/amd64/vmm/amd/ivhd_if.m b/sys/amd64/vmm/amd/ivhd_if.m new file mode 100644 index 000000000000..eaae01ae0131 --- /dev/null +++ b/sys/amd64/vmm/amd/ivhd_if.m @@ -0,0 +1,46 @@ +#- +# Copyright (c) 2021 The FreeBSD Fondation +# +# Portions of this software were developed by Ka Ho Ng +# 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 + +INTERFACE ivhd; + +METHOD int setup_intr { + device_t dev; + driver_intr_t handler; + void *arg; + const char *desc; +}; + +METHOD int teardown_intr { + device_t dev; +}; diff --git a/sys/amd64/vmm/amd/ivrs_drv.c b/sys/amd64/vmm/amd/ivrs_drv.c index d33229623a96..6291895c212f 100644 --- a/sys/amd64/vmm/amd/ivrs_drv.c +++ b/sys/amd64/vmm/amd/ivrs_drv.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2016, Anish Gupta (anish@freebsd.org) + * Copyright (c) 2021 The FreeBSD Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "io/iommu.h" #include "amdvi_priv.h" @@ -628,6 +631,9 @@ ivhd_attach(device_t dev) softc->dev = dev; ivhd = ivhd_hdrs[unit]; KASSERT(ivhd, ("ivhd is NULL")); + softc->pci_dev = pci_find_bsf(PCI_RID2BUS(ivhd->Header.DeviceId), + PCI_RID2SLOT(ivhd->Header.DeviceId), + PCI_RID2FUNC(ivhd->Header.DeviceId)); softc->ivhd_type = ivhd->Header.Type; softc->pci_seg = ivhd->PciSegmentGroup; diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile index b5d62c358272..ef0d9dcb6786 100644 --- a/sys/modules/vmm/Makefile +++ b/sys/modules/vmm/Makefile @@ -51,6 +51,9 @@ SRCS+= ept.c \ # amd-specific files .PATH: ${SRCTOP}/sys/amd64/vmm/amd SRCS+= vmcb.c \ + amdiommu.c \ + ivhd_if.c \ + ivhd_if.h \ svm.c \ svm_support.S \ npt.c \ From owner-dev-commits-src-main@freebsd.org Mon Mar 22 10:27:40 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B655E5A909D; Mon, 22 Mar 2021 10:27: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 4F3rKm4mrGz5936; Mon, 22 Mar 2021 10:27: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 96AC33F7D; Mon, 22 Mar 2021 10:27: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 12MARe83017322; Mon, 22 Mar 2021 10:27:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MARe2Z017321; Mon, 22 Mar 2021 10:27:40 GMT (envelope-from git) Date: Mon, 22 Mar 2021 10:27:40 GMT Message-Id: <202103221027.12MARe2Z017321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 6d5586da633b - main - stress2: Added two syzkaller reproducers. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d5586da633bc76d02010ef73c9be768de98966c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 10:27:40 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=6d5586da633bc76d02010ef73c9be768de98966c commit 6d5586da633bc76d02010ef73c9be768de98966c Author: Peter Holm AuthorDate: 2021-03-22 10:26:39 +0000 Commit: Peter Holm CommitDate: 2021-03-22 10:26:39 +0000 stress2: Added two syzkaller reproducers. --- tools/test/stress2/misc/syzkaller31.sh | 324 +++++++++++++++++++++++++++++++++ tools/test/stress2/misc/syzkaller32.sh | 299 ++++++++++++++++++++++++++++++ 2 files changed, 623 insertions(+) diff --git a/tools/test/stress2/misc/syzkaller31.sh b/tools/test/stress2/misc/syzkaller31.sh new file mode 100755 index 000000000000..af93a89a127c --- /dev/null +++ b/tools/test/stress2/misc/syzkaller31.sh @@ -0,0 +1,324 @@ +#!/bin/sh + +# panic: Bad tailq NEXT(0xfffffe0079608f00->tqh_last) != NULL +# cpuid = 20 +# time = 1616404997 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01af6d8580 +# vpanic() at vpanic+0x181/frame 0xfffffe01af6d85d0 +# panic() at panic+0x43/frame 0xfffffe01af6d8630 +# sctp_ss_default_add() at sctp_ss_default_add+0xd7/frame 0xfffffe01af6d8660 +# sctp_lower_sosend() at sctp_lower_sosend+0x3b24/frame 0xfffffe01af6d8830 +# sctp_sosend() at sctp_sosend+0x344/frame 0xfffffe01af6d8950 +# sosend() at sosend+0x66/frame 0xfffffe01af6d8980 +# kern_sendit() at kern_sendit+0x1ec/frame 0xfffffe01af6d8a10 +# sendit() at sendit+0x1db/frame 0xfffffe01af6d8a60 +# sys_sendmsg() at sys_sendmsg+0x61/frame 0xfffffe01af6d8ac0 +# amd64_syscall() at amd64_syscall+0x147/frame 0xfffffe01af6d8bf0 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01af6d8bf0 +# --- syscall (0, FreeBSD ELF64, nosys), rip = 0x8003b042a, rsp = 0x7fffdffdcf68, rbp = 0x7fffdffdcf90 --- +# KDB: enter: panic +# [ thread pid 7402 tid 730532 ] +# Stopped at kdb_enter+0x37: movq $0,0x1286f8e(%rip) +# db> x/s version +# version: FreeBSD 14.0-CURRENT #0 main-n245565-25bfa448602: Mon Mar 22 09:13:03 CET 2021 +# pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO\012 +# db> + +[ `uname -p` != "amd64" ] && exit 0 + +. ../default.cfg +kldstat -v | grep -q sctp || kldload sctp.ko + +cat > /tmp/syzkaller31.c < + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void kill_and_wait(int pid, int* status) +{ + kill(pid, SIGKILL); + while (waitpid(-1, status, 0) != pid) { + } +} + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void thread_start(void* (*fn)(void*), void* arg) +{ + pthread_t th; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 128 << 10); + int i = 0; + for (; i < 100; i++) { + if (pthread_create(&th, &attr, fn, arg) == 0) { + pthread_attr_destroy(&attr); + return; + } + if (errno == EAGAIN) { + usleep(50); + continue; + } + break; + } + exit(1); +} + +typedef struct { + pthread_mutex_t mu; + pthread_cond_t cv; + int state; +} event_t; + +static void event_init(event_t* ev) +{ + if (pthread_mutex_init(&ev->mu, 0)) + exit(1); + if (pthread_cond_init(&ev->cv, 0)) + exit(1); + ev->state = 0; +} + +static void event_reset(event_t* ev) +{ + ev->state = 0; +} + +static void event_set(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + if (ev->state) + exit(1); + ev->state = 1; + pthread_mutex_unlock(&ev->mu); + pthread_cond_broadcast(&ev->cv); +} + +static void event_wait(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + while (!ev->state) + pthread_cond_wait(&ev->cv, &ev->mu); + pthread_mutex_unlock(&ev->mu); +} + +static int event_isset(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +static int event_timedwait(event_t* ev, uint64_t timeout) +{ + uint64_t start = current_time_ms(); + uint64_t now = start; + pthread_mutex_lock(&ev->mu); + for (;;) { + if (ev->state) + break; + uint64_t remain = timeout - (now - start); + struct timespec ts; + ts.tv_sec = remain / 1000; + ts.tv_nsec = (remain % 1000) * 1000 * 1000; + pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); + now = current_time_ms(); + if (now - start > timeout) + break; + } + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +struct thread_t { + int created, call; + event_t ready, done; +}; + +static struct thread_t threads[16]; +static void execute_call(int call); +static int running; + +static void* thr(void* arg) +{ + struct thread_t* th = (struct thread_t*)arg; + for (;;) { + event_wait(&th->ready); + event_reset(&th->ready); + execute_call(th->call); + __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); + event_set(&th->done); + } + return 0; +} + +static void execute_one(void) +{ + int i, call, thread; + int collide = 0; +again: + for (call = 0; call < 3; call++) { + for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); + thread++) { + struct thread_t* th = &threads[thread]; + if (!th->created) { + th->created = 1; + event_init(&th->ready); + event_init(&th->done); + event_set(&th->done); + thread_start(thr, th); + } + if (!event_isset(&th->done)) + continue; + event_reset(&th->done); + th->call = call; + __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); + event_set(&th->ready); + if (collide && (call % 2) == 0) + break; + event_timedwait(&th->done, 50); + break; + } + } + for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) + sleep_ms(1); + if (!collide) { + collide = 1; + goto again; + } +} + +static void execute_one(void); + +#define WAIT_FLAGS 0 + +static void loop(void) +{ + int iter = 0; + for (;; iter++) { + int pid = fork(); + if (pid < 0) + exit(1); + if (pid == 0) { + execute_one(); + exit(0); + } + int status = 0; + uint64_t start = current_time_ms(); + for (;;) { + if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) + break; + sleep_ms(1); + if (current_time_ms() - start < 5000) { + continue; + } + kill_and_wait(pid, &status); + break; + } + } +} + +uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; + +void execute_call(int call) +{ + intptr_t res = 0; + switch (call) { + case 0: + res = syscall(SYS_socket, 2ul, 5ul, 0x84); + if (res != -1) + r[0] = res; + break; + case 1: + res = syscall(SYS_fcntl, r[0], 0ul, r[0]); + if (res != -1) + r[1] = res; + break; + case 2: + *(uint64_t*)0x20000040 = 0x20000000; + *(uint8_t*)0x20000000 = 0x1c; + *(uint8_t*)0x20000001 = 0x1c; + *(uint16_t*)0x20000002 = htobe16(0x4e22); + *(uint32_t*)0x20000004 = 0; + *(uint8_t*)0x20000008 = 0; + *(uint8_t*)0x20000009 = 0; + *(uint8_t*)0x2000000a = 0; + *(uint8_t*)0x2000000b = 0; + *(uint8_t*)0x2000000c = 0; + *(uint8_t*)0x2000000d = 0; + *(uint8_t*)0x2000000e = 0; + *(uint8_t*)0x2000000f = 0; + *(uint8_t*)0x20000010 = 0; + *(uint8_t*)0x20000011 = 0; + *(uint8_t*)0x20000012 = -1; + *(uint8_t*)0x20000013 = -1; + *(uint32_t*)0x20000014 = htobe32(0x203); + *(uint32_t*)0x20000018 = 0; + *(uint32_t*)0x20000048 = 0x1c; + *(uint64_t*)0x20000050 = 0x20000100; + *(uint64_t*)0x20000100 = 0x20000080; + memcpy((void*)0x20000080, "\000", 1); + *(uint64_t*)0x20000108 = 1; + *(uint32_t*)0x20000058 = 1; + *(uint64_t*)0x20000060 = 0x20000200; + memcpy( + (void*)0x20000200, + "\x1c\x00\x00\x00\x84\x00\x00\x00\x01\x00\x00\x00\x40\x08\xec\x70\xa0", + 17); + *(uint32_t*)0x20000068 = 0x1c; + *(uint32_t*)0x2000006c = 0; + syscall(SYS_sendmsg, r[1], 0x20000040ul, 0ul); + break; + } +} +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + loop(); + return 0; +} +EOF +mycc -o /tmp/syzkaller31 -Wall -Wextra -O0 /tmp/syzkaller31.c -lpthread || + exit 1 + +(cd ../testcases/swap; ./swap -t 1m -i 20 -h > /dev/null 2>&1) & +(cd /tmp; timeout 3m ./syzkaller31) +while pkill swap; do :; done +wait + +rm -rf /tmp/syzkaller31 syzkaller31.c /tmp/syzkaller.* +exit 0 diff --git a/tools/test/stress2/misc/syzkaller32.sh b/tools/test/stress2/misc/syzkaller32.sh new file mode 100755 index 000000000000..a95871969d5c --- /dev/null +++ b/tools/test/stress2/misc/syzkaller32.sh @@ -0,0 +1,299 @@ +#!/bin/sh + +# Fatal trap 18: integer divide fault while in kernel mode +# cpuid = 0; apic id = 00 +# instruction pointer = 0x20:0xffffffff80c2f828 +# stack pointer = 0x0:0xfffffe0131a5d9e0 +# frame pointer = 0x0:0xfffffe0131a5da30 +# code segment = base 0x0, limit 0xfffff, type 0x1b +# = DPL 0, pres 1, long 1, def32 0, gran 1 +# processor eflags = interrupt enabled, resume, IOPL = 0 +# current process = 12 (swi4: clock (0)) +# trap number = 18 +# panic: integer divide fault +# cpuid = 0 +# time = 1616401924 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0131a5d6f0 +# vpanic() at vpanic+0x181/frame 0xfffffe0131a5d740 +# panic() at panic+0x43/frame 0xfffffe0131a5d7a0 +# trap_fatal() at trap_fatal+0x387/frame 0xfffffe0131a5d800 +# trap() at trap+0xa4/frame 0xfffffe0131a5d910 +# calltrap() at calltrap+0x8/frame 0xfffffe0131a5d910 +# --- trap 0x12, rip = 0xffffffff80c2f828, rsp = 0xfffffe0131a5d9e0, rbp = 0xfffffe0131a5da30 --- +# realtimer_expire() at realtimer_expire+0x1a8/frame 0xfffffe0131a5da30 +# softclock_call_cc() at softclock_call_cc+0x15d/frame 0xfffffe0131a5db00 +# softclock() at softclock+0x66/frame 0xfffffe0131a5db20 +# ithread_loop() at ithread_loop+0x279/frame 0xfffffe0131a5dbb0 +# fork_exit() at fork_exit+0x80/frame 0xfffffe0131a5dbf0 +# fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0131a5dbf0 +# --- trap 0, rip = 0, rsp = 0, rbp = 0 --- +# KDB: enter: panic +# [ thread pid 12 tid 100160 ] +# Stopped at kdb_enter+0x37: movq $0,0x1286f8e(%rip) +# db> x/s version +# version: FreeBSD 14.0-CURRENT #0 main-n245565-25bfa448602: Mon Mar 22 09:13:03 CET 2021 +# pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO\012 +# db> + +[ `uname -p` != "amd64" ] && exit 0 + +. ../default.cfg +cat > /tmp/syzkaller32.c < + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static unsigned long long procid; + +static void kill_and_wait(int pid, int* status) +{ + kill(pid, SIGKILL); + while (waitpid(-1, status, 0) != pid) { + } +} + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void thread_start(void* (*fn)(void*), void* arg) +{ + pthread_t th; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 128 << 10); + int i = 0; + for (; i < 100; i++) { + if (pthread_create(&th, &attr, fn, arg) == 0) { + pthread_attr_destroy(&attr); + return; + } + if (errno == EAGAIN) { + usleep(50); + continue; + } + break; + } + exit(1); +} + +typedef struct { + pthread_mutex_t mu; + pthread_cond_t cv; + int state; +} event_t; + +static void event_init(event_t* ev) +{ + if (pthread_mutex_init(&ev->mu, 0)) + exit(1); + if (pthread_cond_init(&ev->cv, 0)) + exit(1); + ev->state = 0; +} + +static void event_reset(event_t* ev) +{ + ev->state = 0; +} + +static void event_set(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + if (ev->state) + exit(1); + ev->state = 1; + pthread_mutex_unlock(&ev->mu); + pthread_cond_broadcast(&ev->cv); +} + +static void event_wait(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + while (!ev->state) + pthread_cond_wait(&ev->cv, &ev->mu); + pthread_mutex_unlock(&ev->mu); +} + +static int event_isset(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +static int event_timedwait(event_t* ev, uint64_t timeout) +{ + uint64_t start = current_time_ms(); + uint64_t now = start; + pthread_mutex_lock(&ev->mu); + for (;;) { + if (ev->state) + break; + uint64_t remain = timeout - (now - start); + struct timespec ts; + ts.tv_sec = remain / 1000; + ts.tv_nsec = (remain % 1000) * 1000 * 1000; + pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); + now = current_time_ms(); + if (now - start > timeout) + break; + } + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +struct thread_t { + int created, call; + event_t ready, done; +}; + +static struct thread_t threads[16]; +static void execute_call(int call); +static int running; + +static void* thr(void* arg) +{ + struct thread_t* th = (struct thread_t*)arg; + for (;;) { + event_wait(&th->ready); + event_reset(&th->ready); + execute_call(th->call); + __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); + event_set(&th->done); + } + return 0; +} + +static void execute_one(void) +{ + int i, call, thread; + for (call = 0; call < 2; call++) { + for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); + thread++) { + struct thread_t* th = &threads[thread]; + if (!th->created) { + th->created = 1; + event_init(&th->ready); + event_init(&th->done); + event_set(&th->done); + thread_start(thr, th); + } + if (!event_isset(&th->done)) + continue; + event_reset(&th->done); + th->call = call; + __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); + event_set(&th->ready); + event_timedwait(&th->done, 50); + break; + } + } + for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) + sleep_ms(1); +} + +static void execute_one(void); + +#define WAIT_FLAGS 0 + +static void loop(void) +{ + int iter = 0; + for (;; iter++) { + int pid = fork(); + if (pid < 0) + exit(1); + if (pid == 0) { + execute_one(); + exit(0); + } + int status = 0; + uint64_t start = current_time_ms(); + for (;;) { + if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) + break; + sleep_ms(1); + if (current_time_ms() - start < 5000) { + continue; + } + kill_and_wait(pid, &status); + break; + } + } +} + +uint64_t r[1] = {0x0}; + +void execute_call(int call) +{ + intptr_t res = 0; + switch (call) { + case 0: + res = syscall(SYS_ktimer_create, 4ul, 0ul, 0x20000500ul); + if (res != -1) + r[0] = *(uint32_t*)0x20000500; + break; + case 1: + *(uint64_t*)0x20000100 = 0x200000000000000; + *(uint64_t*)0x20000108 = 0; + *(uint64_t*)0x20000110 = 0; + *(uint64_t*)0x20000118 = 0x10000; + syscall(SYS_ktimer_settime, r[0], 0ul, 0x20000100ul, 0ul); + break; + } +} +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + for (procid = 0; procid < 4; procid++) { + if (fork() == 0) { + loop(); + } + } + sleep(1000000); + return 0; +} +EOF +mycc -o /tmp/syzkaller32 -Wall -Wextra -O0 /tmp/syzkaller32.c -lpthread || + exit 1 + +(cd ../testcases/swap; ./swap -t 1m -i 20 -h > /dev/null 2>&1) & +(cd /tmp; timeout 3m ./syzkaller32) +while pkill swap; do :; done +wait + +rm -rf /tmp/syzkaller32 syzkaller32.c /tmp/syzkaller.* +exit 0 From owner-dev-commits-src-main@freebsd.org Mon Mar 22 10:32:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7022B5A90B1; Mon, 22 Mar 2021 10:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3rRR2q0Yz3Bq5; Mon, 22 Mar 2021 10:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53AB64598; Mon, 22 Mar 2021 10:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MAWZm7030821; Mon, 22 Mar 2021 10:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MAWZM8030820; Mon, 22 Mar 2021 10:32:35 GMT (envelope-from git) Date: Mon, 22 Mar 2021 10:32:35 GMT Message-Id: <202103221032.12MAWZM8030820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: e54257d92a7a - main - stress2: Updated the exclude list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e54257d92a7acf617c24b47ada961447ef09afee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 10:32:35 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=e54257d92a7acf617c24b47ada961447ef09afee commit e54257d92a7acf617c24b47ada961447ef09afee Author: Peter Holm AuthorDate: 2021-03-22 10:32:05 +0000 Commit: Peter Holm CommitDate: 2021-03-22 10:32:05 +0000 stress2: Updated the exclude list --- tools/test/stress2/misc/all.exclude | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index f04766c3c2ec..decd2e233a46 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -24,6 +24,7 @@ gnop10.sh Waiting for patch commit 20210105 graid1_8.sh Known issue 20170909 graid1_9.sh panic: Bad effnlink 20180212 lockf5.sh Spinning threads seen 20160718 +ifconfig.sh Bug 253824 20210322 ifconfig2.sh https://people.freebsd.org/~pho/stress/log/log0051.txt 20210210 maxvnodes.sh Only supposed to work in single user mode 20190412 maxvnodes2.sh Only supposed to work in single user mode 20190412 @@ -76,6 +77,8 @@ syzkaller25.sh WiP 20201116 syzkaller28.sh WiP 20201120 syzkaller29.sh May change policy for random threads to to domainset_fixed 20210104 syzkaller30.sh May change policy for random threads to to domainset_fixed 20210104 +syzkaller31.sh panic: Bad tailq NEXT(0xfffffe0079608f00->tqh_last) != NULL 20210322 +syzkaller32.sh Fatal trap 18: integer divide fault while in kernel mode 20210322 truss3.sh WiP 20200915 unionfs.sh insmntque: non-locked vp: xx is not exclusive locked... 20130909 unionfs2.sh insmntque: mp-safe fs and non-locked vp is not ... 20111219 From owner-dev-commits-src-main@freebsd.org Mon Mar 22 12:00:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2A9D5ABA34; Mon, 22 Mar 2021 12:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3tNl61VPz3HCd; Mon, 22 Mar 2021 12:00:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2A475278; Mon, 22 Mar 2021 12:00: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 12MC0MVa055041; Mon, 22 Mar 2021 12:00:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MC0Mrl055040; Mon, 22 Mar 2021 12:00:22 GMT (envelope-from git) Date: Mon, 22 Mar 2021 12:00:22 GMT Message-Id: <202103221200.12MC0Mrl055040@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: aa05775ef014 - main - tests/sys/net/if_lagg_test: Fix syntax error 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: aa05775ef014f975e3abb04587770e337d8ac5b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 12:00:25 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=aa05775ef014f975e3abb04587770e337d8ac5b3 commit aa05775ef014f975e3abb04587770e337d8ac5b3 Author: Alex Richardson AuthorDate: 2021-03-22 10:30:41 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 11:55:06 +0000 tests/sys/net/if_lagg_test: Fix syntax error Fixes: ee231b27ff ("Also skip sys/net/if_lagg_test:witness on non-i386") --- tests/sys/net/if_lagg_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/net/if_lagg_test.sh b/tests/sys/net/if_lagg_test.sh index 5aed9fd7c61b..1c9cc5551ae3 100755 --- a/tests/sys/net/if_lagg_test.sh +++ b/tests/sys/net/if_lagg_test.sh @@ -402,7 +402,7 @@ witness_head() } witness_body() { - if [ "$(atf_config_get ci false)" = "true" ] && \ + if [ "$(atf_config_get ci false)" = "true" ]; then atf_skip "https://bugs.freebsd.org/244163 and https://bugs.freebsd.org/251726" fi if [ `sysctl -n debug.witness.watch` -ne 1 ]; then From owner-dev-commits-src-main@freebsd.org Mon Mar 22 12:00:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D1A95ABE16; Mon, 22 Mar 2021 12: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 4F3tNn6Q3zz3H95; Mon, 22 Mar 2021 12:00:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E9945279; Mon, 22 Mar 2021 12:00:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MC0PbX055082; Mon, 22 Mar 2021 12:00:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MC0PYs055081; Mon, 22 Mar 2021 12:00:25 GMT (envelope-from git) Date: Mon, 22 Mar 2021 12:00:25 GMT Message-Id: <202103221200.12MC0PYs055081@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: b358534ab1a9 - main - Remove XFAILs from fmaxmin test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b358534ab1a953fac5830012751232e2f0807cc0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 12:00:26 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=b358534ab1a953fac5830012751232e2f0807cc0 commit b358534ab1a953fac5830012751232e2f0807cc0 Author: Alex Richardson AuthorDate: 2021-03-22 11:40:17 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 11:55:06 +0000 Remove XFAILs from fmaxmin test These appears to have been resolved by compiling the test with -fno-builtin and/or using a newer compiler. PR: 208703 Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28884 --- lib/msun/tests/fmaxmin_test.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/msun/tests/fmaxmin_test.c b/lib/msun/tests/fmaxmin_test.c index a89c10cc2554..06bd0a1ba7e0 100644 --- a/lib/msun/tests/fmaxmin_test.c +++ b/lib/msun/tests/fmaxmin_test.c @@ -94,13 +94,6 @@ testall(long double big, long double small) } } -/* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */ -#if defined(__clang__) && \ - ((__clang_major__ > 3)) || \ - ((__clang_major__ == 3 && __clang_minor__ >= 8)) -#define affected_by_bug_208703 -#endif - ATF_TC_WITHOUT_HEAD(test1); ATF_TC_BODY(test1, tc) { @@ -133,17 +126,11 @@ ATF_TC_BODY(test5, tc) ATF_TC_WITHOUT_HEAD(test6); ATF_TC_BODY(test6, tc) { -#ifdef affected_by_bug_208703 - atf_tc_expect_fail("fails invariant with clang 3.8+ (bug 208703)"); -#endif testall(1.0, NAN); } ATF_TC_WITHOUT_HEAD(test7); ATF_TC_BODY(test7, tc) { -#ifdef affected_by_bug_208703 - atf_tc_expect_fail("fails invariant with clang 3.8+ (bug 208703)"); -#endif testall(INFINITY, NAN); } @@ -162,18 +149,12 @@ ATF_TC_BODY(test9, tc) ATF_TC_WITHOUT_HEAD(test10); ATF_TC_BODY(test10, tc) { -#ifdef affected_by_bug_208703 - atf_tc_expect_fail("fails invariant with clang 3.8+ (bug 208703)"); -#endif testall(3.0, -INFINITY); } ATF_TC_WITHOUT_HEAD(test11); ATF_TC_BODY(test11, tc) { -#ifdef affected_by_bug_208703 - atf_tc_expect_fail("fails invariant with clang 3.8+ (bug 208703)"); -#endif testall(NAN, NAN); } From owner-dev-commits-src-main@freebsd.org Mon Mar 22 12:00:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CECA5ABC3A; Mon, 22 Mar 2021 12: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 4F3tNn47mSz3H8y; Mon, 22 Mar 2021 12:00:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A2424EEF; Mon, 22 Mar 2021 12:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MC0NDL055063; Mon, 22 Mar 2021 12:00:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MC0NYE055062; Mon, 22 Mar 2021 12:00:23 GMT (envelope-from git) Date: Mon, 22 Mar 2021 12:00:23 GMT Message-Id: <202103221200.12MC0NYE055062@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: 133bc645077d - main - Convert the msun tests to ATF 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: 133bc645077d77ddb3c7d49130b4ec6fd93e7d34 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 12:00:27 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=133bc645077d77ddb3c7d49130b4ec6fd93e7d34 commit 133bc645077d77ddb3c7d49130b4ec6fd93e7d34 Author: Alex Richardson AuthorDate: 2021-03-22 11:15:13 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 11:55:06 +0000 Convert the msun tests to ATF This provides better error messages that just an assertion failure and also makes it easier to mark individual tests as XFAIL. It was also helpful when coming up with D28786 and D28787. Differential Revision: https://reviews.freebsd.org/D28798 --- lib/msun/tests/Makefile | 36 +++-- lib/msun/tests/cexp_test.c | 80 ++++------ lib/msun/tests/conj_test.c | 85 +++++------ lib/msun/tests/csqrt_test.c | 79 +++++----- lib/msun/tests/ctrig_test.c | 2 - lib/msun/tests/exponential_test.c | 84 ++++++----- lib/msun/tests/fenv_test.c | 298 ++++++++++++++++++-------------------- lib/msun/tests/fma_test.c | 96 ++++++------ lib/msun/tests/fmaxmin_test.c | 176 ++++++++++++++-------- lib/msun/tests/ilogb_test.c | 70 +++++---- lib/msun/tests/invctrig_test.c | 68 ++++----- lib/msun/tests/invtrig_test.c | 85 ++++------- lib/msun/tests/logarithm_test.c | 85 ++++------- lib/msun/tests/lrint_test.c | 49 +++---- lib/msun/tests/lround_test.c | 49 ++++--- lib/msun/tests/lround_test.t | 10 -- lib/msun/tests/nan_test.c | 53 +++---- lib/msun/tests/nearbyint_test.c | 72 +++++---- lib/msun/tests/next_test.c | 86 +++++++---- lib/msun/tests/rem_test.c | 109 +++++++------- lib/msun/tests/test-utils.h | 11 ++ lib/msun/tests/trig_test.c | 8 +- 22 files changed, 845 insertions(+), 846 deletions(-) diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 85a558bb0733..309f49c6dddd 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -52,30 +52,28 @@ NETBSD_ATF_TESTS_C+= sqrt_test NETBSD_ATF_TESTS_C+= tan_test NETBSD_ATF_TESTS_C+= tanh_test -TAP_TESTS_C+= cexp_test -TAP_TESTS_C+= conj_test +ATF_TESTS_C+= cexp_test +ATF_TESTS_C+= conj_test .if ${MACHINE_CPUARCH} != "aarch64" # Hits an assert in llvm when building for arm64: # https://llvm.org/bugs/show_bug.cgi?id=26081 -TAP_TESTS_C+= csqrt_test +ATF_TESTS_C+= csqrt_test .endif ATF_TESTS_C+= ctrig_test -TAP_TESTS_C+= exponential_test -TAP_TESTS_C+= fenv_test -TAP_TESTS_C+= fma_test -TAP_TESTS_C+= fmaxmin_test -TAP_TESTS_C+= ilogb2_test -TAP_TESTS_C+= invtrig_test -TAP_TESTS_C+= invctrig_test -TAP_TESTS_C+= logarithm_test -TAP_TESTS_C+= lrint_test -# XXX: the testcase crashes on all platforms, but only on head -# (bug 205451) -#TAP_TESTS_C+= lround_test -TAP_TESTS_C+= nan_test -TAP_TESTS_C+= nearbyint_test -TAP_TESTS_C+= next_test -TAP_TESTS_C+= rem_test +ATF_TESTS_C+= exponential_test +ATF_TESTS_C+= fenv_test +ATF_TESTS_C+= fma_test +ATF_TESTS_C+= fmaxmin_test +ATF_TESTS_C+= ilogb2_test +ATF_TESTS_C+= invtrig_test +ATF_TESTS_C+= invctrig_test +ATF_TESTS_C+= logarithm_test +ATF_TESTS_C+= lrint_test +ATF_TESTS_C+= lround_test +ATF_TESTS_C+= nan_test +ATF_TESTS_C+= nearbyint_test +ATF_TESTS_C+= next_test +ATF_TESTS_C+= rem_test ATF_TESTS_C+= trig_test .if !empty(PROG) && !empty(TAP_TESTS_C:M${PROG}) diff --git a/lib/msun/tests/cexp_test.c b/lib/msun/tests/cexp_test.c index 8e342f8e0070..3a0f5dc39a5e 100644 --- a/lib/msun/tests/cexp_test.c +++ b/lib/msun/tests/cexp_test.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -63,9 +62,10 @@ __FBSDID("$FreeBSD$"); do { \ volatile long double complex _d = z; \ volatile type complex _r = result; \ - assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert(cfpequal_cs((func)(_d), (_r), (checksign))); \ - assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ + ATF_CHECK(cfpequal_cs((func)(_d), (_r), (checksign))); \ + CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ + #func, #z); \ } while (0) #define test(func, z, result, exceptmask, excepts, checksign) \ @@ -77,7 +77,7 @@ do { \ /* Test within a given tolerance. */ #define test_tol(func, z, result, tol) do { \ volatile long double complex _d = z; \ - assert(cfpequal_tol((func)(_d), (result), (tol), \ + ATF_CHECK(cfpequal_tol((func)(_d), (result), (tol), \ FPE_ABS_ZERO | CS_BOTH)); \ } while (0) @@ -102,8 +102,8 @@ static const float finites[] = /* Tests for 0 */ -static void -test_zero(void) +ATF_TC_WITHOUT_HEAD(zero); +ATF_TC_BODY(zero, tc) { /* cexp(0) = 1, no exceptions raised */ @@ -117,15 +117,14 @@ test_zero(void) * Tests for NaN. The signs of the results are indeterminate unless the * imaginary part is 0. */ -static void -test_nan(void) +ATF_TC_WITHOUT_HEAD(nan); +ATF_TC_BODY(nan, tc) { unsigned i; /* cexp(x + NaNi) = NaN + NaNi and optionally raises invalid */ /* cexp(NaN + yi) = NaN + NaNi and optionally raises invalid (|y|>0) */ for (i = 0; i < nitems(finites); i++) { - printf("# Run %d..\n", i); testall(CMPLXL(finites[i], NAN), CMPLXL(NAN, NAN), ALL_STD_EXCEPT & ~FE_INVALID, 0, 0); if (finites[i] == 0.0) @@ -150,14 +149,13 @@ test_nan(void) ALL_STD_EXCEPT, 0, 0); } -static void -test_inf(void) +ATF_TC_WITHOUT_HEAD(inf); +ATF_TC_BODY(inf, tc) { unsigned i; /* cexp(x + inf i) = NaN + NaNi and raises invalid */ for (i = 0; i < nitems(finites); i++) { - printf("# Run %d..\n", i); testall(CMPLXL(finites[i], INFINITY), CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 1); } @@ -192,14 +190,13 @@ test_inf(void) ALL_STD_EXCEPT, 0, 1); } -static void -test_reals(void) +ATF_TC_WITHOUT_HEAD(reals); +ATF_TC_BODY(reals, tc) { unsigned i; for (i = 0; i < nitems(finites); i++) { /* XXX could check exceptions more meticulously */ - printf("# Run %d..\n", i); test(cexp, CMPLXL(finites[i], 0.0), CMPLXL(exp(finites[i]), 0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); @@ -215,13 +212,12 @@ test_reals(void) } } -static void -test_imaginaries(void) +ATF_TC_WITHOUT_HEAD(imaginaries); +ATF_TC_BODY(imaginaries, tc) { unsigned i; for (i = 0; i < nitems(finites); i++) { - printf("# Run %d..\n", i); test(cexp, CMPLXL(0.0, finites[i]), CMPLXL(cos(finites[i]), sin(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); @@ -237,8 +233,8 @@ test_imaginaries(void) } } -static void -test_small(void) +ATF_TC_WITHOUT_HEAD(small); +ATF_TC_BODY(small, tc) { static const double tests[] = { /* csqrt(a + bI) = x + yI */ @@ -253,7 +249,6 @@ test_small(void) unsigned i; for (i = 0; i < nitems(tests); i += 4) { - printf("# Run %d..\n", i); a = tests[i]; b = tests[i + 1]; x = tests[i + 2]; @@ -268,8 +263,8 @@ test_small(void) } /* Test inputs with a real part r that would overflow exp(r). */ -static void -test_large(void) +ATF_TC_WITHOUT_HEAD(large); +ATF_TC_BODY(large, tc) { test_tol(cexp, CMPLXL(709.79, 0x1p-1074), @@ -295,32 +290,15 @@ test_large(void) CMPLXL(INFINITY, 5.7878851079e+37f), 2 * FLT_ULP()); } -int -main(void) +ATF_TP_ADD_TCS(tp) { - - printf("1..7\n"); - - test_zero(); - printf("ok 1 - cexp zero\n"); - - test_nan(); - printf("ok 2 - cexp nan\n"); - - test_inf(); - printf("ok 3 - cexp inf\n"); - - test_reals(); - printf("ok 4 - cexp reals\n"); - - test_imaginaries(); - printf("ok 5 - cexp imaginaries\n"); - - test_small(); - printf("ok 6 - cexp small\n"); - - test_large(); - printf("ok 7 - cexp large\n"); - - return (0); + ATF_TP_ADD_TC(tp, zero); + ATF_TP_ADD_TC(tp, nan); + ATF_TP_ADD_TC(tp, inf); + ATF_TP_ADD_TC(tp, reals); + ATF_TP_ADD_TC(tp, imaginaries); + ATF_TP_ADD_TC(tp, small); + ATF_TP_ADD_TC(tp, large); + + return (atf_no_error()); } diff --git a/lib/msun/tests/conj_test.c b/lib/msun/tests/conj_test.c index 960fed5074b5..5e9868939277 100644 --- a/lib/msun/tests/conj_test.c +++ b/lib/msun/tests/conj_test.c @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -70,70 +69,54 @@ static const double tests[] = { -INFINITY, INFINITY, }; -int -main(void) +ATF_TC_WITHOUT_HEAD(main); +ATF_TC_BODY(main, tc) { static const int ntests = sizeof(tests) / sizeof(tests[0]) / 2; complex float in; complex long double expected; int i; - printf("1..%d\n", ntests * 3); - for (i = 0; i < ntests; i++) { __real__ expected = __real__ in = tests[2 * i]; __imag__ in = tests[2 * i + 1]; __imag__ expected = -cimag(in); - assert(fpequal(libcrealf(in), __real__ in)); - assert(fpequal(libcreal(in), __real__ in)); - assert(fpequal(libcreall(in), __real__ in)); - assert(fpequal(libcimagf(in), __imag__ in)); - assert(fpequal(libcimag(in), __imag__ in)); - assert(fpequal(libcimagl(in), __imag__ in)); + ATF_REQUIRE(fpequal(libcrealf(in), __real__ in)); + ATF_REQUIRE(fpequal(libcreal(in), __real__ in)); + ATF_REQUIRE(fpequal(libcreall(in), __real__ in)); + ATF_REQUIRE(fpequal(libcimagf(in), __imag__ in)); + ATF_REQUIRE(fpequal(libcimag(in), __imag__ in)); + ATF_REQUIRE(fpequal(libcimagl(in), __imag__ in)); - feclearexcept(FE_ALL_EXCEPT); - if (!cfpequal(libconjf(in), expected)) { - printf("not ok %d\t# conjf(%#.2g + %#.2gI): " - "wrong value\n", - 3 * i + 1, creal(in), cimag(in)); - } else if (fetestexcept(FE_ALL_EXCEPT)) { - printf("not ok %d\t# conjf(%#.2g + %#.2gI): " - "threw an exception\n", - 3 * i + 1, creal(in), cimag(in)); - } else { - printf("ok %d\t\t# conjf(%#.2g + %#.2gI)\n", - 3 * i + 1, creal(in), cimag(in)); - } + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + ATF_REQUIRE_MSG( + cfpequal(libconjf(in), expected), + "conjf(%#.2g + %#.2gI): wrong value", creal(in), cimag(in) + ); + ATF_REQUIRE_EQ_MSG(0, fetestexcept(FE_ALL_EXCEPT), + "conj(%#.2g + %#.2gI): threw an exception: %#x", creal(in), + cimag(in), fetestexcept(FE_ALL_EXCEPT)); - feclearexcept(FE_ALL_EXCEPT); - if (!cfpequal(libconj(in), expected)) { - printf("not ok %d\t# conj(%#.2g + %#.2gI): " - "wrong value\n", - 3 * i + 2, creal(in), cimag(in)); - } else if (fetestexcept(FE_ALL_EXCEPT)) { - printf("not ok %d\t# conj(%#.2g + %#.2gI): " - "threw an exception\n", - 3 * i + 2, creal(in), cimag(in)); - } else { - printf("ok %d\t\t# conj(%#.2g + %#.2gI)\n", - 3 * i + 2, creal(in), cimag(in)); - } + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + ATF_REQUIRE_MSG(cfpequal(libconj(in), expected), + "conj(%#.2g + %#.2gI): wrong value", creal(in), cimag(in)); + ATF_REQUIRE_EQ_MSG(0, fetestexcept(FE_ALL_EXCEPT), + "conj(%#.2g + %#.2gI): threw an exception: %#x", creal(in), + cimag(in), fetestexcept(FE_ALL_EXCEPT)); - feclearexcept(FE_ALL_EXCEPT); - if (!cfpequal(libconjl(in), expected)) { - printf("not ok %d\t# conjl(%#.2g + %#.2gI): " - "wrong value\n", - 3 * i + 3, creal(in), cimag(in)); - } else if (fetestexcept(FE_ALL_EXCEPT)) { - printf("not ok %d\t# conjl(%#.2g + %#.2gI): " - "threw an exception\n", - 3 * i + 3, creal(in), cimag(in)); - } else { - printf("ok %d\t\t# conjl(%#.2g + %#.2gI)\n", - 3 * i + 3, creal(in), cimag(in)); - } + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + ATF_REQUIRE_MSG(cfpequal(libconjl(in), expected), + "conjl(%#.2g + %#.2gI): wrong value", creal(in), cimag(in)); + ATF_REQUIRE_EQ_MSG(0, fetestexcept(FE_ALL_EXCEPT), + "conjl(%#.2g + %#.2gI): threw an exception: %#x", creal(in), + cimag(in), fetestexcept(FE_ALL_EXCEPT)); } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, main); - return (0); + return (atf_no_error()); } diff --git a/lib/msun/tests/csqrt_test.c b/lib/msun/tests/csqrt_test.c index 9f596ed67596..a84605a379de 100644 --- a/lib/msun/tests/csqrt_test.c +++ b/lib/msun/tests/csqrt_test.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -72,7 +71,7 @@ static void assert_equal(long double complex d1, long double complex d2) { - assert(cfpequal(d1, d2)); + ATF_CHECK(cfpequal(d1, d2)); } /* @@ -133,7 +132,7 @@ test_finite(void) b = tests[i + 1] * mults[j] * mults[j]; x = tests[i + 2] * mults[j]; y = tests[i + 3] * mults[j]; - assert(t_csqrt(CMPLXL(a, b)) == CMPLXL(x, y)); + ATF_CHECK(t_csqrt(CMPLXL(a, b)) == CMPLXL(x, y)); } } @@ -190,11 +189,11 @@ static void test_nans(void) { - assert(creall(t_csqrt(CMPLXL(INFINITY, NAN))) == INFINITY); - assert(isnan(cimagl(t_csqrt(CMPLXL(INFINITY, NAN))))); + ATF_CHECK(creall(t_csqrt(CMPLXL(INFINITY, NAN))) == INFINITY); + ATF_CHECK(isnan(cimagl(t_csqrt(CMPLXL(INFINITY, NAN))))); - assert(isnan(creall(t_csqrt(CMPLXL(-INFINITY, NAN))))); - assert(isinf(cimagl(t_csqrt(CMPLXL(-INFINITY, NAN))))); + ATF_CHECK(isnan(creall(t_csqrt(CMPLXL(-INFINITY, NAN))))); + ATF_CHECK(isinf(cimagl(t_csqrt(CMPLXL(-INFINITY, NAN))))); assert_equal(t_csqrt(CMPLXL(NAN, INFINITY)), CMPLXL(INFINITY, INFINITY)); @@ -224,7 +223,7 @@ test_overflow(int maxexp) long double complex result; int exp, i; - assert(maxexp > 0 && maxexp % 2 == 0); + ATF_CHECK(maxexp > 0 && maxexp % 2 == 0); for (i = 0; i < 4; i++) { exp = maxexp - 2 * i; @@ -233,22 +232,22 @@ test_overflow(int maxexp) a = ldexpl(115 * 0x1p-8, exp); b = ldexpl(252 * 0x1p-8, exp); result = t_csqrt(CMPLXL(a, b)); - assert(creall(result) == ldexpl(14 * 0x1p-4, exp / 2)); - assert(cimagl(result) == ldexpl(9 * 0x1p-4, exp / 2)); + ATF_CHECK_EQ(creall(result), ldexpl(14 * 0x1p-4, exp / 2)); + ATF_CHECK_EQ(cimagl(result), ldexpl(9 * 0x1p-4, exp / 2)); /* csqrt(-11 + 60*I) = 5 + 6*I */ a = ldexpl(-11 * 0x1p-6, exp); b = ldexpl(60 * 0x1p-6, exp); result = t_csqrt(CMPLXL(a, b)); - assert(creall(result) == ldexpl(5 * 0x1p-3, exp / 2)); - assert(cimagl(result) == ldexpl(6 * 0x1p-3, exp / 2)); + ATF_CHECK_EQ(creall(result), ldexpl(5 * 0x1p-3, exp / 2)); + ATF_CHECK_EQ(cimagl(result), ldexpl(6 * 0x1p-3, exp / 2)); /* csqrt(225 + 0*I) == 15 + 0*I */ a = ldexpl(225 * 0x1p-8, exp); b = 0; result = t_csqrt(CMPLXL(a, b)); - assert(creall(result) == ldexpl(15 * 0x1p-4, exp / 2)); - assert(cimagl(result) == 0); + ATF_CHECK_EQ(creall(result), ldexpl(15 * 0x1p-4, exp / 2)); + ATF_CHECK_EQ(cimagl(result), 0); } } @@ -266,8 +265,8 @@ test_precision(int maxexp, int mantdig) uint64_t mantbits, sq_mantbits; int exp, i; - assert(maxexp > 0 && maxexp % 2 == 0); - assert(mantdig <= 64); + ATF_CHECK(maxexp > 0 && maxexp % 2 == 0); + ATF_CHECK(mantdig <= 64); mantdig = rounddown(mantdig, 2); for (exp = 0; exp <= maxexp; exp += 2) { @@ -289,79 +288,67 @@ test_precision(int maxexp, int mantdig) b = ldexpl((long double)sq_mantbits, exp - 1 - mantdig); x = ldexpl(mantbits, (exp - 2 - mantdig) / 2); - assert(b == x * x * 2); + ATF_CHECK_EQ(b, x * x * 2); result = t_csqrt(CMPLXL(0, b)); - assert(creall(result) == x); - assert(cimagl(result) == x); + ATF_CHECK_EQ(x, creall(result)); + ATF_CHECK_EQ(x, cimagl(result)); } } } -int -main(void) +ATF_TC_WITHOUT_HEAD(csqrt); +ATF_TC_BODY(csqrt, tc) { - - printf("1..18\n"); - /* Test csqrt() */ t_csqrt = _csqrt; test_finite(); - printf("ok 1 - csqrt\n"); test_zeros(); - printf("ok 2 - csqrt\n"); test_infinities(); - printf("ok 3 - csqrt\n"); test_nans(); - printf("ok 4 - csqrt\n"); test_overflow(DBL_MAX_EXP); - printf("ok 5 - csqrt\n"); test_precision(DBL_MAX_EXP, DBL_MANT_DIG); - printf("ok 6 - csqrt\n"); +} +ATF_TC_WITHOUT_HEAD(csqrtf); +ATF_TC_BODY(csqrtf, tc) +{ /* Now test csqrtf() */ t_csqrt = _csqrtf; test_finite(); - printf("ok 7 - csqrt\n"); test_zeros(); - printf("ok 8 - csqrt\n"); test_infinities(); - printf("ok 9 - csqrt\n"); test_nans(); - printf("ok 10 - csqrt\n"); test_overflow(FLT_MAX_EXP); - printf("ok 11 - csqrt\n"); test_precision(FLT_MAX_EXP, FLT_MANT_DIG); - printf("ok 12 - csqrt\n"); +} +ATF_TC_WITHOUT_HEAD(csqrtl); +ATF_TC_BODY(csqrtl, tc) +{ /* Now test csqrtl() */ t_csqrt = csqrtl; test_finite(); - printf("ok 13 - csqrt\n"); test_zeros(); - printf("ok 14 - csqrt\n"); test_infinities(); - printf("ok 15 - csqrt\n"); test_nans(); - printf("ok 16 - csqrt\n"); test_overflow(LDBL_MAX_EXP); - printf("ok 17 - csqrt\n"); test_precision(LDBL_MAX_EXP, #ifndef __i386__ @@ -370,7 +357,13 @@ main(void) DBL_MANT_DIG #endif ); - printf("ok 18 - csqrt\n"); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, csqrt); + ATF_TP_ADD_TC(tp, csqrtf); + ATF_TP_ADD_TC(tp, csqrtl); - return (0); + return (atf_no_error()); } diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index 2499e53ab4d5..f3951c575ceb 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "test-utils.h" #pragma STDC FENV_ACCESS ON diff --git a/lib/msun/tests/exponential_test.c b/lib/msun/tests/exponential_test.c index 5b39d29fa5bf..14cedf8f9190 100644 --- a/lib/msun/tests/exponential_test.c +++ b/lib/msun/tests/exponential_test.c @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -60,9 +59,10 @@ __FBSDID("$FreeBSD$"); */ #define test(func, x, result, exceptmask, excepts) do { \ volatile long double _d = x; \ - assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert(fpequal((func)(_d), (result))); \ - assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ + ATF_CHECK(fpequal((func)(_d), (result))); \ + CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ + #func, #x); \ } while (0) /* Test all the functions that compute b^x. */ @@ -122,48 +122,66 @@ run_generic_tests(void) testall1(-50000.0, -1.0, ALL_STD_EXCEPT, FE_INEXACT); } -static void -run_exp2_tests(void) + +/* + * We should insist that exp2() return exactly the correct + * result and not raise an inexact exception for integer + * arguments. + */ +ATF_TC_WITHOUT_HEAD(exp2f); +ATF_TC_BODY(exp2f, tc) { - unsigned i; - - /* - * We should insist that exp2() return exactly the correct - * result and not raise an inexact exception for integer - * arguments. - */ - feclearexcept(FE_ALL_EXCEPT); - for (i = FLT_MIN_EXP - FLT_MANT_DIG; i < FLT_MAX_EXP; i++) { - assert(exp2f(i) == ldexpf(1.0, i)); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); - } - for (i = DBL_MIN_EXP - DBL_MANT_DIG; i < DBL_MAX_EXP; i++) { - assert(exp2(i) == ldexp(1.0, i)); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); - } - for (i = LDBL_MIN_EXP - LDBL_MANT_DIG; i < LDBL_MAX_EXP; i++) { - assert(exp2l(i) == ldexpl(1.0, i)); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + for (int i = FLT_MIN_EXP - FLT_MANT_DIG; i < FLT_MAX_EXP; i++) { + ATF_CHECK_EQ(exp2f(i), ldexpf(1.0, i)); + CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); } } -int -main(void) +ATF_TC_WITHOUT_HEAD(exp2); +ATF_TC_BODY(exp2, tc) { + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + for (int i = DBL_MIN_EXP - DBL_MANT_DIG; i < DBL_MAX_EXP; i++) { + ATF_CHECK_EQ(exp2(i), ldexp(1.0, i)); + CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); + } +} - printf("1..3\n"); +ATF_TC_WITHOUT_HEAD(exp2l); +ATF_TC_BODY(exp2l, tc) +{ + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + for (int i = LDBL_MIN_EXP - LDBL_MANT_DIG; i < LDBL_MAX_EXP; i++) { + ATF_CHECK_EQ(exp2l(i), ldexpl(1.0, i)); + CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); + } +} +ATF_TC_WITHOUT_HEAD(generic); +ATF_TC_BODY(generic, tc) +{ run_generic_tests(); - printf("ok 1 - exponential\n"); +} #ifdef __i386__ +ATF_TC_WITHOUT_HEAD(generic_fp_pe); +ATF_TC_BODY(generic_fp_pe, tc) +{ fpsetprec(FP_PE); run_generic_tests(); +} #endif - printf("ok 2 - exponential\n"); - run_exp2_tests(); - printf("ok 3 - exponential\n"); +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, generic); +#ifdef __i386__ + ATF_TP_ADD_TC(tp, generic_fp_pe); +#endif + ATF_TP_ADD_TC(tp, exp2); + ATF_TP_ADD_TC(tp, exp2f); + ATF_TP_ADD_TC(tp, exp2l); - return (0); + return (atf_no_error()); } diff --git a/lib/msun/tests/fenv_test.c b/lib/msun/tests/fenv_test.c index 62abfefb4a8a..b80b591cf52b 100644 --- a/lib/msun/tests/fenv_test.c +++ b/lib/msun/tests/fenv_test.c @@ -63,11 +63,14 @@ static int std_except_sets[1 << NEXCEPTS]; /* * Initialize std_except_sets[] to the power set of std_excepts[] */ -static void -init_exceptsets(void) +static __attribute__((constructor)) void +do_setup(void) { unsigned i, j, sr; + /* Avoid double output after fork() */ + setvbuf(stdout, NULL, _IONBF, 0); + for (i = 0; i < 1 << NEXCEPTS; i++) { for (sr = i, j = 0; sr != 0; sr >>= 1, j++) std_except_sets[i] |= std_excepts[j] & ((~sr & 1) - 1); @@ -154,7 +157,7 @@ static void trap_handler(int sig) { - assert(sig == SIGFPE); + ATF_CHECK_EQ(SIGFPE, sig); _exit(0); } @@ -163,8 +166,8 @@ trap_handler(int sig) * The memcmp() test below may be too much to ask for, since there * could be multiple machine-specific default environments. */ -static void -test_dfl_env(void) +ATF_TC_WITHOUT_HEAD(dfl_env); +ATF_TC_BODY(dfl_env, tc) { #ifndef NO_STRICT_DFL_ENV fenv_t env; @@ -186,52 +189,51 @@ test_dfl_env(void) * 1. http://support.amd.com/TechDocs/26569_APM_v5.pdf * 2. http://www.intel.com/Assets/en_US/PDF/manual/253666.pdf */ - assert(memcmp(&env.__mxcsr, &FE_DFL_ENV->__mxcsr, + ATF_CHECK(memcmp(&env.__mxcsr, &FE_DFL_ENV->__mxcsr, sizeof(env.__mxcsr)) == 0); - assert(memcmp(&env.__x87.__control, &FE_DFL_ENV->__x87.__control, + ATF_CHECK(memcmp(&env.__x87.__control, &FE_DFL_ENV->__x87.__control, sizeof(env.__x87.__control)) == 0); - assert(memcmp(&env.__x87.__status, &FE_DFL_ENV->__x87.__status, + ATF_CHECK(memcmp(&env.__x87.__status, &FE_DFL_ENV->__x87.__status, sizeof(env.__x87.__status)) == 0); - assert(memcmp(&env.__x87.__tag, &FE_DFL_ENV->__x87.__tag, + ATF_CHECK(memcmp(&env.__x87.__tag, &FE_DFL_ENV->__x87.__tag, sizeof(env.__x87.__tag)) == 0); #else - assert(memcmp(&env, FE_DFL_ENV, sizeof(env)) == 0); + ATF_CHECK_EQ(0, memcmp(&env, FE_DFL_ENV, sizeof(env))); #endif #endif - assert(fetestexcept(FE_ALL_EXCEPT) == 0); + ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); } /* * Test fetestexcept() and feclearexcept(). */ -static void -test_fetestclearexcept(void) +ATF_TC_WITHOUT_HEAD(fetestclearexcept); +ATF_TC_BODY(fetestclearexcept, tc) { int excepts, i; for (i = 0; i < 1 << NEXCEPTS; i++) - assert(fetestexcept(std_except_sets[i]) == 0); + ATF_CHECK_EQ(0, fetestexcept(std_except_sets[i])); for (i = 0; i < 1 << NEXCEPTS; i++) { excepts = std_except_sets[i]; /* FE_ALL_EXCEPT might be special-cased, as on i386. */ raiseexcept(excepts); - assert(fetestexcept(excepts) == excepts); - assert(feclearexcept(FE_ALL_EXCEPT) == 0); - assert(fetestexcept(FE_ALL_EXCEPT) == 0); + ATF_CHECK_EQ(excepts, fetestexcept(excepts)); + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); raiseexcept(excepts); - assert(fetestexcept(excepts) == excepts); + ATF_CHECK_EQ(excepts, fetestexcept(excepts)); if ((excepts & (FE_UNDERFLOW | FE_OVERFLOW)) != 0) { excepts |= FE_INEXACT; - assert((fetestexcept(ALL_STD_EXCEPT) | FE_INEXACT) == - excepts); + ATF_CHECK_EQ(excepts, (fetestexcept(ALL_STD_EXCEPT) | FE_INEXACT)); } else { - assert(fetestexcept(ALL_STD_EXCEPT) == excepts); + ATF_CHECK_EQ(excepts, fetestexcept(ALL_STD_EXCEPT)); } - assert(feclearexcept(excepts) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); + ATF_CHECK_EQ(0, feclearexcept(excepts)); + ATF_CHECK_EQ(0, fetestexcept(ALL_STD_EXCEPT)); } } @@ -240,31 +242,29 @@ test_fetestclearexcept(void) * * Prerequisites: fetestexcept(), feclearexcept() */ -static void -test_fegsetexceptflag(void) +ATF_TC_WITHOUT_HEAD(fegsetexceptflag); +ATF_TC_BODY(fegsetexceptflag, tc) { fexcept_t flag; int excepts, i; - assert(fetestexcept(FE_ALL_EXCEPT) == 0); + ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); for (i = 0; i < 1 << NEXCEPTS; i++) { excepts = std_except_sets[i]; - assert(fegetexceptflag(&flag, excepts) == 0); + ATF_CHECK_EQ(0, fegetexceptflag(&flag, excepts)); raiseexcept(ALL_STD_EXCEPT); - assert(fesetexceptflag(&flag, excepts) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == - (ALL_STD_EXCEPT ^ excepts)); - - assert(fegetexceptflag(&flag, FE_ALL_EXCEPT) == 0); - assert(feclearexcept(FE_ALL_EXCEPT) == 0); - assert(fesetexceptflag(&flag, excepts) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); - assert(fesetexceptflag(&flag, ALL_STD_EXCEPT ^ excepts) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == - (ALL_STD_EXCEPT ^ excepts)); - - assert(feclearexcept(FE_ALL_EXCEPT) == 0); + ATF_CHECK_EQ(0, fesetexceptflag(&flag, excepts)); + ATF_CHECK_EQ((ALL_STD_EXCEPT ^ excepts), fetestexcept(ALL_STD_EXCEPT)); + + ATF_CHECK_EQ(0, fegetexceptflag(&flag, FE_ALL_EXCEPT)); + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + ATF_CHECK_EQ(0, fesetexceptflag(&flag, excepts)); + ATF_CHECK_EQ(0, fetestexcept(ALL_STD_EXCEPT)); + ATF_CHECK_EQ(0, fesetexceptflag(&flag, ALL_STD_EXCEPT ^ excepts)); + ATF_CHECK_EQ((ALL_STD_EXCEPT ^ excepts), fetestexcept(ALL_STD_EXCEPT)); + + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); } } @@ -273,63 +273,62 @@ test_fegsetexceptflag(void) * * Prerequisites: fetestexcept(), feclearexcept() */ -static void -test_feraiseexcept(void) +ATF_TC_WITHOUT_HEAD(feraiseexcept); +ATF_TC_BODY(feraiseexcept, tc) { int excepts, i; for (i = 0; i < 1 << NEXCEPTS; i++) { excepts = std_except_sets[i]; - assert(fetestexcept(FE_ALL_EXCEPT) == 0); - assert(feraiseexcept(excepts) == 0); + ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); + ATF_CHECK_EQ(0, feraiseexcept(excepts)); if ((excepts & (FE_UNDERFLOW | FE_OVERFLOW)) != 0) { excepts |= FE_INEXACT; - assert((fetestexcept(ALL_STD_EXCEPT) | FE_INEXACT) == - excepts); + ATF_CHECK_EQ(excepts, (fetestexcept(ALL_STD_EXCEPT) | FE_INEXACT)); } else { - assert(fetestexcept(ALL_STD_EXCEPT) == excepts); + ATF_CHECK_EQ(excepts, fetestexcept(ALL_STD_EXCEPT)); } - assert(feclearexcept(FE_ALL_EXCEPT) == 0); + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); } - assert(feraiseexcept(FE_INVALID | FE_DIVBYZERO) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == (FE_INVALID | FE_DIVBYZERO)); - assert(feraiseexcept(FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == ALL_STD_EXCEPT); - assert(feclearexcept(FE_ALL_EXCEPT) == 0); + ATF_CHECK_EQ(0, feraiseexcept(FE_INVALID | FE_DIVBYZERO)); + ATF_CHECK_EQ((FE_INVALID | FE_DIVBYZERO), fetestexcept(ALL_STD_EXCEPT)); + ATF_CHECK_EQ(0, feraiseexcept(FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)); + ATF_CHECK_EQ(ALL_STD_EXCEPT, fetestexcept(ALL_STD_EXCEPT)); + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); } /* * Test fegetround() and fesetround(). */ -static void -test_fegsetround(void) +ATF_TC_WITHOUT_HEAD(fegsetround); +ATF_TC_BODY(fegsetround, tc) { - assert(fegetround() == FE_TONEAREST); - assert(getround() == FE_TONEAREST); - assert(FLT_ROUNDS == 1); + ATF_CHECK_EQ(FE_TONEAREST, fegetround()); + ATF_CHECK_EQ(FE_TONEAREST, getround()); + ATF_CHECK_EQ(1, FLT_ROUNDS); - assert(fesetround(FE_DOWNWARD) == 0); - assert(fegetround() == FE_DOWNWARD); - assert(getround() == FE_DOWNWARD); - assert(FLT_ROUNDS == 3); + ATF_CHECK_EQ(0, fesetround(FE_DOWNWARD)); + ATF_CHECK_EQ(FE_DOWNWARD, fegetround()); + ATF_CHECK_EQ(FE_DOWNWARD, getround()); + ATF_CHECK_EQ(3, FLT_ROUNDS); - assert(fesetround(FE_UPWARD) == 0); - assert(getround() == FE_UPWARD); - assert(fegetround() == FE_UPWARD); - assert(FLT_ROUNDS == 2); + ATF_CHECK_EQ(0, fesetround(FE_UPWARD)); + ATF_CHECK_EQ(FE_UPWARD, getround()); + ATF_CHECK_EQ(FE_UPWARD, fegetround()); + ATF_CHECK_EQ(2, FLT_ROUNDS); - assert(fesetround(FE_TOWARDZERO) == 0); - assert(getround() == FE_TOWARDZERO); - assert(fegetround() == FE_TOWARDZERO); - assert(FLT_ROUNDS == 0); + ATF_CHECK_EQ(0, fesetround(FE_TOWARDZERO)); + ATF_CHECK_EQ(FE_TOWARDZERO, getround()); + ATF_CHECK_EQ(FE_TOWARDZERO, fegetround()); + ATF_CHECK_EQ(0, FLT_ROUNDS); - assert(fesetround(FE_TONEAREST) == 0); - assert(getround() == FE_TONEAREST); - assert(FLT_ROUNDS == 1); + ATF_CHECK_EQ(0, fesetround(FE_TONEAREST)); + ATF_CHECK_EQ(FE_TONEAREST, getround()); + ATF_CHECK_EQ(1, FLT_ROUNDS); *** 2135 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Mon Mar 22 12:00:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53B995ABC3F; Mon, 22 Mar 2021 12:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3tNp6CT8z3HLn; Mon, 22 Mar 2021 12: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 44F28527A; Mon, 22 Mar 2021 12: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 12MC0QY7055104; Mon, 22 Mar 2021 12: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 12MC0QOG055103; Mon, 22 Mar 2021 12:00:26 GMT (envelope-from git) Date: Mon, 22 Mar 2021 12:00:26 GMT Message-Id: <202103221200.12MC0QOG055103@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: b424e0038a00 - main - Improve test messages for msun tests 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: b424e0038a00dffbec800a6f0778db0ffdabe9d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 12:00:27 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=b424e0038a00dffbec800a6f0778db0ffdabe9d6 commit b424e0038a00dffbec800a6f0778db0ffdabe9d6 Author: Alex Richardson AuthorDate: 2021-03-22 11:42:07 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 11:55:06 +0000 Improve test messages for msun tests Also print the mismatched values when numbers compare not equal. Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D29091 --- lib/msun/tests/cexp_test.c | 9 ++-- lib/msun/tests/conj_test.c | 12 +++--- lib/msun/tests/csqrt_test.c | 7 +--- lib/msun/tests/ctrig_test.c | 11 ++--- lib/msun/tests/exponential_test.c | 2 +- lib/msun/tests/fenv_test.c | 2 +- lib/msun/tests/fma_test.c | 2 +- lib/msun/tests/fmaxmin_test.c | 2 +- lib/msun/tests/invctrig_test.c | 7 ++-- lib/msun/tests/invtrig_test.c | 4 +- lib/msun/tests/logarithm_test.c | 6 +-- lib/msun/tests/lrint_test.c | 18 ++++---- lib/msun/tests/nearbyint_test.c | 36 ++++++++-------- lib/msun/tests/next_test.c | 2 +- lib/msun/tests/test-utils.h | 86 ++++++++++++++++++++++----------------- lib/msun/tests/trig_test.c | 2 +- 16 files changed, 102 insertions(+), 106 deletions(-) diff --git a/lib/msun/tests/cexp_test.c b/lib/msun/tests/cexp_test.c index 3a0f5dc39a5e..bb5b45b38492 100644 --- a/lib/msun/tests/cexp_test.c +++ b/lib/msun/tests/cexp_test.c @@ -63,7 +63,7 @@ do { \ volatile long double complex _d = z; \ volatile type complex _r = result; \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(cfpequal_cs((func)(_d), (_r), (checksign))); \ + CHECK_CFPEQUAL_CS((func)(_d), (_r), (checksign)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #z); \ } while (0) @@ -75,10 +75,9 @@ do { \ test_t(float, func, z, result, exceptmask, excepts, checksign) /* Test within a given tolerance. */ -#define test_tol(func, z, result, tol) do { \ - volatile long double complex _d = z; \ - ATF_CHECK(cfpequal_tol((func)(_d), (result), (tol), \ - FPE_ABS_ZERO | CS_BOTH)); \ +#define test_tol(func, z, result, tol) do { \ + CHECK_CFPEQUAL_TOL((func)(z), (result), (tol), \ + FPE_ABS_ZERO | CS_BOTH); \ } while (0) /* Test all the functions that compute cexp(x). */ diff --git a/lib/msun/tests/conj_test.c b/lib/msun/tests/conj_test.c index 5e9868939277..d0256c13b229 100644 --- a/lib/msun/tests/conj_test.c +++ b/lib/msun/tests/conj_test.c @@ -82,12 +82,12 @@ ATF_TC_BODY(main, tc) __imag__ in = tests[2 * i + 1]; __imag__ expected = -cimag(in); - ATF_REQUIRE(fpequal(libcrealf(in), __real__ in)); - ATF_REQUIRE(fpequal(libcreal(in), __real__ in)); - ATF_REQUIRE(fpequal(libcreall(in), __real__ in)); - ATF_REQUIRE(fpequal(libcimagf(in), __imag__ in)); - ATF_REQUIRE(fpequal(libcimag(in), __imag__ in)); - ATF_REQUIRE(fpequal(libcimagl(in), __imag__ in)); + ATF_REQUIRE(fpequal_cs(libcrealf(in), __real__ in, true)); + ATF_REQUIRE(fpequal_cs(libcreal(in), __real__ in, true)); + ATF_REQUIRE(fpequal_cs(libcreall(in), __real__ in, true)); + ATF_REQUIRE(fpequal_cs(libcimagf(in), __imag__ in, true)); + ATF_REQUIRE(fpequal_cs(libcimag(in), __imag__ in, true)); + ATF_REQUIRE(fpequal_cs(libcimagl(in), __imag__ in, true)); ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); ATF_REQUIRE_MSG( diff --git a/lib/msun/tests/csqrt_test.c b/lib/msun/tests/csqrt_test.c index a84605a379de..a46d0ddd45c5 100644 --- a/lib/msun/tests/csqrt_test.c +++ b/lib/msun/tests/csqrt_test.c @@ -67,12 +67,7 @@ _csqrt(long double complex d) * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0. * Fail an assertion if they differ. */ -static void -assert_equal(long double complex d1, long double complex d2) -{ - - ATF_CHECK(cfpequal(d1, d2)); -} +#define assert_equal(d1, d2) CHECK_CFPEQUAL_CS(d1, d2, CS_BOTH) /* * Test csqrt for some finite arguments where the answer is exact. diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index f3951c575ceb..f5d52a0c06f1 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -62,11 +62,7 @@ __FBSDID("$FreeBSD$"); debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ creall(_d), cimagl(_d), creall(result), cimagl(result)); \ ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ - volatile long double complex _r = (func)(_d); \ - ATF_CHECK_MSG(cfpequal_cs(_r, (result), (checksign)), \ - "%s (%Lg + %Lg I) != expected (%Lg + %Lg I)", \ - __XSTRING((func)(_d)), creall(_r), cimagl(_r), \ - creall(result), cimagl(result)); \ + CHECK_CFPEQUAL_CS((func)(_d), (result), (checksign)); \ volatile int _e = fetestexcept(exceptmask); \ ATF_CHECK_MSG(_e == (excepts), \ "%s fetestexcept(%s) (%#x) != %#x", __XSTRING(func), \ @@ -79,10 +75,9 @@ __FBSDID("$FreeBSD$"); * of _EPSILON. */ #define test_p_tol(func, z, result, tol) do { \ - volatile long double complex _d = z; \ debug(" testing %s(%Lg + %Lg I) ~= %Lg + %Lg I\n", #func, \ - creall(_d), cimagl(_d), creall(result), cimagl(result)); \ - ATF_CHECK(cfpequal_tol((func)(_d), (result), (tol), FPE_ABS_ZERO)); \ + creall(z), cimagl(z), creall(result), cimagl(result)); \ + CHECK_CFPEQUAL_TOL((func)(z), (result), (tol), FPE_ABS_ZERO); \ } while (0) /* These wrappers apply the identities f(conj(z)) = conj(f(z)). */ diff --git a/lib/msun/tests/exponential_test.c b/lib/msun/tests/exponential_test.c index 14cedf8f9190..280f3e483d06 100644 --- a/lib/msun/tests/exponential_test.c +++ b/lib/msun/tests/exponential_test.c @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #define test(func, x, result, exceptmask, excepts) do { \ volatile long double _d = x; \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(fpequal((func)(_d), (result))); \ + CHECK_FPEQUAL((func)(_d), (result)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #x); \ } while (0) diff --git a/lib/msun/tests/fenv_test.c b/lib/msun/tests/fenv_test.c index b80b591cf52b..76998a7cb2d5 100644 --- a/lib/msun/tests/fenv_test.c +++ b/lib/msun/tests/fenv_test.c @@ -248,7 +248,7 @@ ATF_TC_BODY(fegsetexceptflag, tc) fexcept_t flag; int excepts, i; - ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); + CHECK_FP_EXCEPTIONS(0, FE_ALL_EXCEPT); for (i = 0; i < 1 << NEXCEPTS; i++) { excepts = std_except_sets[i]; diff --git a/lib/msun/tests/fma_test.c b/lib/msun/tests/fma_test.c index e601c3e248b2..4e3df40be9c9 100644 --- a/lib/msun/tests/fma_test.c +++ b/lib/msun/tests/fma_test.c @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #define test(func, x, y, z, result, exceptmask, excepts) do { \ volatile long double _vx = (x), _vy = (y), _vz = (z); \ ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ - ATF_CHECK(fpequal((func)(_vx, _vy, _vz), (result))); \ + CHECK_FPEQUAL((func)(_vx, _vy, _vz), (result)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #x); \ } while (0) diff --git a/lib/msun/tests/fmaxmin_test.c b/lib/msun/tests/fmaxmin_test.c index 06bd0a1ba7e0..12d845b76395 100644 --- a/lib/msun/tests/fmaxmin_test.c +++ b/lib/msun/tests/fmaxmin_test.c @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); long double __result = func((__x), (__y)); \ CHECK_FP_EXCEPTIONS_MSG(0, ALL_STD_EXCEPT, \ #func "(%.20Lg, %.20Lg) rmode%d", (x), (y), rmode); \ - ATF_CHECK_MSG(fpequal(__result, (expected)), \ + ATF_CHECK_MSG(fpequal_cs(__result, (expected), true), \ #func "(%.20Lg, %.20Lg) rmode%d = %.20Lg, expected %.20Lg\n", \ (x), (y), rmode, __result, (expected)); \ } while (0) diff --git a/lib/msun/tests/invctrig_test.c b/lib/msun/tests/invctrig_test.c index 537d73d1319c..179499f9f0b2 100644 --- a/lib/msun/tests/invctrig_test.c +++ b/lib/msun/tests/invctrig_test.c @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ creall(_d), cimagl(_d), creall(result), cimagl(result)); \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(cfpequal_cs((func)(_d), (result), (checksign))); \ + CHECK_CFPEQUAL_CS((func)(_d), (result), (checksign)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #z); \ } while (0) @@ -71,10 +71,9 @@ __FBSDID("$FreeBSD$"); * in ulps. */ #define test_p_tol(func, z, result, tol) do { \ - volatile long double complex _d = z; \ debug(" testing %s(%Lg + %Lg I) ~= %Lg + %Lg I\n", #func, \ - creall(_d), cimagl(_d), creall(result), cimagl(result)); \ - ATF_CHECK(cfpequal_tol((func)(_d), (result), (tol), CS_BOTH)); \ + creall(z), cimagl(z), creall(result), cimagl(result)); \ + CHECK_CFPEQUAL_TOL((func)(z), (result), (tol), CS_BOTH); \ } while (0) /* These wrappers apply the identities f(conj(z)) = conj(f(z)). */ diff --git a/lib/msun/tests/invtrig_test.c b/lib/msun/tests/invtrig_test.c index 9376ecea8658..7dd8b26f652f 100644 --- a/lib/msun/tests/invtrig_test.c +++ b/lib/msun/tests/invtrig_test.c @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #define test_tol(func, x, result, tol, excepts) do { \ volatile long double _in = (x), _out = (result); \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(fpequal_tol(func(_in), _out, (tol), CS_BOTH)); \ + CHECK_FPEQUAL_TOL(func(_in), _out, (tol), CS_BOTH); \ CHECK_FP_EXCEPTIONS_MSG(excepts, ALL_STD_EXCEPT, "for %s(%s)", \ #func, #x); \ } while (0) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); #define test2_tol(func, y, x, result, tol, excepts) do { \ volatile long double _iny = (y), _inx = (x), _out = (result); \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(fpequal_tol(func(_iny, _inx), _out, (tol), CS_BOTH)); \ + CHECK_FPEQUAL_TOL(func(_iny, _inx), _out, (tol), CS_BOTH); \ CHECK_FP_EXCEPTIONS_MSG(excepts, ALL_STD_EXCEPT, "for %s(%s)", \ #func, #x); \ } while (0) diff --git a/lib/msun/tests/logarithm_test.c b/lib/msun/tests/logarithm_test.c index 0a6728681a30..48a368765b71 100644 --- a/lib/msun/tests/logarithm_test.c +++ b/lib/msun/tests/logarithm_test.c @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #define test(func, x, result, exceptmask, excepts) do { \ volatile long double _d = x; \ ATF_CHECK_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(fpequal((func)(_d), (result))); \ + CHECK_FPEQUAL((func)(_d), (result)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #x); \ } while (0) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #define test_tol(func, z, result, tol) do { \ volatile long double _d = z; \ debug(" testing %6s(%15La) ~= % .36Le\n", #func, _d, result); \ - ATF_CHECK(fpequal_tol((func)(_d), (result), (tol), CS_BOTH)); \ + CHECK_FPEQUAL_TOL((func)(_d), (result), (tol), CS_BOTH); \ } while (0) /* Test all the functions that compute log(x). */ @@ -207,7 +207,7 @@ ATF_TC_BODY(accuracy_tests, tc) 1.29556709996247903756734359702926363e0L }, { 19.75 * 0x1p100, 1.043037807481771029244272863419411534e2L, - 7.229787154734166181706169344438271459e1L, + 72.29787154734166181706169344438271459357255439172762452L, 3.139856666636059855894123306947856631e1L }, }; unsigned i; diff --git a/lib/msun/tests/lrint_test.c b/lib/msun/tests/lrint_test.c index 2606f88a41a3..a2a93180e97e 100644 --- a/lib/msun/tests/lrint_test.c +++ b/lib/msun/tests/lrint_test.c @@ -42,16 +42,14 @@ __FBSDID("$FreeBSD$"); #include "test-utils.h" -/* - * XXX The volatile here is to avoid gcc's bogus constant folding and work - * around the lack of support for the FENV_ACCESS pragma. - */ -#define test(func, x, result, excepts) do { \ - volatile double _d = x; \ - ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ - ATF_CHECK((func)(_d) == (result) || fetestexcept(FE_INVALID)); \ - CHECK_FP_EXCEPTIONS_MSG(excepts, FE_ALL_EXCEPT & ALL_STD_EXCEPT,\ - "for %s(%s)", #func, #x); \ +#define test(func, x, result, excepts) do { \ + ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ + long long _r = (func)(x); \ + ATF_CHECK_MSG(_r == (result) || fetestexcept(FE_INVALID), \ + #func "(%Lg) returned %lld, expected %lld", (long double)x, _r, \ + (long long)(result)); \ + CHECK_FP_EXCEPTIONS_MSG(excepts, FE_ALL_EXCEPT & ALL_STD_EXCEPT, \ + "for %s(%s)", #func, #x); \ } while (0) #define testall(x, result, excepts) do { \ diff --git a/lib/msun/tests/nearbyint_test.c b/lib/msun/tests/nearbyint_test.c index 6bcf6694fe90..25950eedd5d0 100644 --- a/lib/msun/tests/nearbyint_test.c +++ b/lib/msun/tests/nearbyint_test.c @@ -97,16 +97,16 @@ test_nearby(int testindex) in = tests[testindex].in; out = get_output(testindex, i, 0); - ATF_CHECK(fpequal(out, libnearbyintf(in))); - ATF_CHECK(fpequal(out, nearbyint(in))); - ATF_CHECK(fpequal(out, nearbyintl(in))); + CHECK_FPEQUAL(out, libnearbyintf(in)); + CHECK_FPEQUAL(out, nearbyint(in)); + CHECK_FPEQUAL(out, nearbyintl(in)); CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); in = -tests[testindex].in; out = get_output(testindex, i, 1); - ATF_CHECK(fpequal(out, nearbyintf(in))); - ATF_CHECK(fpequal(out, nearbyint(in))); - ATF_CHECK(fpequal(out, nearbyintl(in))); + CHECK_FPEQUAL(out, nearbyintf(in)); + CHECK_FPEQUAL(out, nearbyint(in)); + CHECK_FPEQUAL(out, nearbyintl(in)); CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); } } @@ -130,24 +130,24 @@ test_modf(int testindex) isinf(ipart_expected) ? 0.0 : in - ipart_expected, in); ipartl = ipart = ipartf = 42.0; - ATF_CHECK(fpequal(out, modff(in, &ipartf))); - ATF_CHECK(fpequal(ipart_expected, ipartf)); - ATF_CHECK(fpequal(out, modf(in, &ipart))); - ATF_CHECK(fpequal(ipart_expected, ipart)); - ATF_CHECK(fpequal(out, modfl(in, &ipartl))); - ATF_CHECK(fpequal(ipart_expected, ipartl)); + CHECK_FPEQUAL(out, modff(in, &ipartf)); + CHECK_FPEQUAL(ipart_expected, ipartf); + CHECK_FPEQUAL(out, modf(in, &ipart)); + CHECK_FPEQUAL(ipart_expected, ipart); + CHECK_FPEQUAL(out, modfl(in, &ipartl)); + CHECK_FPEQUAL(ipart_expected, ipartl); CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); in = -in; ipart_expected = -ipart_expected; out = -out; ipartl = ipart = ipartf = 42.0; - ATF_CHECK(fpequal(out, modff(in, &ipartf))); - ATF_CHECK(fpequal(ipart_expected, ipartf)); - ATF_CHECK(fpequal(out, modf(in, &ipart))); - ATF_CHECK(fpequal(ipart_expected, ipart)); - ATF_CHECK(fpequal(out, modfl(in, &ipartl))); - ATF_CHECK(fpequal(ipart_expected, ipartl)); + CHECK_FPEQUAL(out, modff(in, &ipartf)); + CHECK_FPEQUAL(ipart_expected, ipartf); + CHECK_FPEQUAL(out, modf(in, &ipart)); + CHECK_FPEQUAL(ipart_expected, ipart); + CHECK_FPEQUAL(out, modfl(in, &ipartl)); + CHECK_FPEQUAL(ipart_expected, ipartl); CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); } } diff --git a/lib/msun/tests/next_test.c b/lib/msun/tests/next_test.c index 5801dc0e3589..763b1cc14e60 100644 --- a/lib/msun/tests/next_test.c +++ b/lib/msun/tests/next_test.c @@ -247,7 +247,7 @@ _testl(const char *exp, int line, long double actual, long double expected, int actual_except; actual_except = fetestexcept(ALL_STD_EXCEPT); - if (!fpequal(actual, expected)) { + if (!fpequal_cs(actual, expected, true)) { atf_tc_fail_check(__FILE__, line, "%s returned %La, expecting %La\n", exp, actual, expected); } diff --git a/lib/msun/tests/test-utils.h b/lib/msun/tests/test-utils.h index a20e30a2440a..615e8f8fafba 100644 --- a/lib/msun/tests/test-utils.h +++ b/lib/msun/tests/test-utils.h @@ -31,6 +31,7 @@ #include #include +#include #include @@ -90,34 +91,21 @@ CMPLXL(long double x, long double y) } #endif -static int fpequal(long double, long double) __used; -static int cfpequal(long double complex, long double complex) __used; -static int cfpequal_cs(long double complex, long double complex, - int) __used; -static int cfpequal_tol(long double complex, long double complex, - long double, unsigned int) __used; - /* - * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0. - * Fail an assertion if they differ. + * The compiler-rt fp128 builtins do not update FP exceptions. + * See https://llvm.org/PR34126 */ -static int -fpequal(long double d1, long double d2) -{ - if (d1 != d2) - return (isnan(d1) && isnan(d2)); - return (copysignl(1.0, d1) == copysignl(1.0, d2)); -} +static int cfpequal(long double complex, long double complex) __used; /* * Determine whether x and y are equal, with two special rules: * +0.0 != -0.0 * NaN == NaN - * If checksign is 0, we compare the absolute values instead. + * If checksign is false, we compare the absolute values instead. */ -static int -fpequal_cs(long double x, long double y, int checksign) +static inline int +fpequal_cs(long double x, long double y, bool checksign) { if (isnan(x) && isnan(y)) return (1); @@ -127,7 +115,7 @@ fpequal_cs(long double x, long double y, int checksign) return (fabsl(x) == fabsl(y)); } -static int +static inline int fpequal_tol(long double x, long double y, long double tol, unsigned int flags) { @@ -158,32 +146,54 @@ fpequal_tol(long double x, long double y, long double tol, return (ret); } -static int +#define CHECK_FPEQUAL(x, y) CHECK_FPEQUAL_CS(x, y, true) + +#define CHECK_FPEQUAL_CS(x, y, checksign) do { \ + long double _x = x; \ + long double _y = y; \ + ATF_CHECK_MSG(fpequal_cs(_x, _y, checksign), \ + "%s (%.25Lg) ~= %s (%.25Lg)", #x, _x, #y, _y); \ +} while (0) + +#define CHECK_FPEQUAL_TOL(x, y, tol, flags) do { \ + long double _x = x; \ + long double _y = y; \ + bool eq = fpequal_tol(_x, _y, tol, flags); \ + long double _diff = eq ? 0.0L : fabsl(_x - _y); \ + ATF_CHECK_MSG(eq, "%s (%.25Lg) ~= %s (%.25Lg), diff=%Lg, maxdiff=%Lg,", \ + #x, _x, #y, _y, _diff, fabsl(_y * tol)); \ +} while (0) + +static inline int cfpequal(long double complex d1, long double complex d2) { - return (fpequal(creall(d1), creall(d2)) && - fpequal(cimagl(d1), cimagl(d2))); + return (fpequal_cs(creall(d1), creall(d2), true) && + fpequal_cs(cimagl(d1), cimagl(d2), true)); } -static int -cfpequal_cs(long double complex x, long double complex y, int checksign) -{ - return (fpequal_cs(creal(x), creal(y), checksign) - && fpequal_cs(cimag(x), cimag(y), checksign)); -} - -static int -cfpequal_tol(long double complex x, long double complex y, long double tol, - unsigned int flags) -{ - return (fpequal_tol(creal(x), creal(y), tol, flags) - && fpequal_tol(cimag(x), cimag(y), tol, flags)); -} +#define CHECK_CFPEQUAL_CS(x, y, checksign) do { \ + long double _x = x; \ + long double _y = y; \ + bool equal_cs = \ + fpequal_cs(creal(_x), creal(_y), (checksign & CS_REAL) != 0) && \ + fpequal_cs(cimag(_x), cimag(_y), (checksign & CS_IMAG) != 0); \ + ATF_CHECK_MSG(equal_cs, "%s (%Lg + %Lg I) ~= %s (%Lg + %Lg I)", \ + #x, creall(_x), cimagl(_x), #y, creall(_y), cimagl(_y)); \ +} while (0) + +#define CHECK_CFPEQUAL_TOL(x, y, tol, flags) do { \ + long double _x = x; \ + long double _y = y; \ + bool equal_tol = (fpequal_tol(creal(_x), creal(_y), tol, flags) && \ + fpequal_tol(cimag(_x), cimag(_y), tol, flags)); \ + ATF_CHECK_MSG(equal_tol, "%s (%Lg + %Lg I) ~= %s (%Lg + %Lg I)", \ + #x, creall(_x), cimagl(_x), #y, creall(_y), cimagl(_y)); \ +} while (0) #define CHECK_FP_EXCEPTIONS(excepts, exceptmask) \ ATF_CHECK_EQ_MSG((excepts), fetestexcept(exceptmask), \ - "unexpected exception flags: %#x not %#x", \ + "unexpected exception flags: got %#x not %#x", \ fetestexcept(exceptmask), (excepts)) #define CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, fmt, ...) \ ATF_CHECK_EQ_MSG((excepts), fetestexcept(exceptmask), \ diff --git a/lib/msun/tests/trig_test.c b/lib/msun/tests/trig_test.c index 55fd97ef4eef..2660c3f2c476 100644 --- a/lib/msun/tests/trig_test.c +++ b/lib/msun/tests/trig_test.c @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #define test(func, x, result, exceptmask, excepts) do { \ volatile long double _d = x; \ ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ - ATF_CHECK(fpequal((func)(_d), (result))); \ + CHECK_FPEQUAL((func)(_d), (result)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #x); \ } while (0) From owner-dev-commits-src-main@freebsd.org Mon Mar 22 12:00:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 564275ABEAC; Mon, 22 Mar 2021 12:00: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 4F3tNv008Qz3H54; Mon, 22 Mar 2021 12:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B606A527C; Mon, 22 Mar 2021 12:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MC0TvJ055166; Mon, 22 Mar 2021 12:00:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MC0TqN055165; Mon, 22 Mar 2021 12:00:29 GMT (envelope-from git) Date: Mon, 22 Mar 2021 12:00:29 GMT Message-Id: <202103221200.12MC0TqN055165@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: 2b181156c893 - main - tools/build/make.py: Avoid calling brew --prefix on macOS unnecessarily 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: 2b181156c893843266c2825098360db2364dbd23 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 12:00:32 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=2b181156c893843266c2825098360db2364dbd23 commit 2b181156c893843266c2825098360db2364dbd23 Author: Alex Richardson AuthorDate: 2021-03-05 10:21:12 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 11:55:07 +0000 tools/build/make.py: Avoid calling brew --prefix on macOS unnecessarily If all the require variables (XCC/XCXX/XCPP/XLD) are already set in the environment, we don't have to infer a default value for the cross toolchain path. This avoids an additional `brew --prefix` call when building with cheribuild (since it already sets all these variables). --- tools/build/make.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tools/build/make.py b/tools/build/make.py index c34147f6ac21..0cf831a3c966 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -119,6 +119,15 @@ def check_required_make_env_var(varname, binary_name, bindir): if parsed_args.debug: run([guess, "--version"]) +def check_xtool_make_env_var(varname, binary_name): + # Avoid calling brew --prefix on macOS if all variables are already set: + if os.getenv(varname): + return + global parsed_args + if parsed_args.cross_bindir is None: + parsed_args.cross_bindir = default_cross_toolchain() + return check_required_make_env_var(varname, binary_name, + parsed_args.cross_bindir) def default_cross_toolchain(): # default to homebrew-installed clang on MacOS if available @@ -170,8 +179,6 @@ if __name__ == "__main__": except ImportError: pass parsed_args, bmake_args = parser.parse_known_args() - if parsed_args.cross_bindir is None: - parsed_args.cross_bindir = default_cross_toolchain() MAKEOBJDIRPREFIX = os.getenv("MAKEOBJDIRPREFIX") if not MAKEOBJDIRPREFIX: @@ -209,16 +216,11 @@ if __name__ == "__main__": # On non-FreeBSD we need to explicitly pass XCC/XLD/X_COMPILER_TYPE use_cross_gcc = parsed_args.cross_compiler_type == "gcc" - check_required_make_env_var("XCC", "gcc" if use_cross_gcc else "clang", - parsed_args.cross_bindir) - check_required_make_env_var("XCXX", - "g++" if use_cross_gcc else "clang++", - parsed_args.cross_bindir) - check_required_make_env_var("XCPP", - "cpp" if use_cross_gcc else "clang-cpp", - parsed_args.cross_bindir) - check_required_make_env_var("XLD", "ld" if use_cross_gcc else "ld.lld", - parsed_args.cross_bindir) + check_xtool_make_env_var("XCC", "gcc" if use_cross_gcc else "clang") + check_xtool_make_env_var("XCXX", "g++" if use_cross_gcc else "clang++") + check_xtool_make_env_var("XCPP", + "cpp" if use_cross_gcc else "clang-cpp") + check_xtool_make_env_var("XLD", "ld" if use_cross_gcc else "ld.lld") # We also need to set STRIPBIN if there is no working strip binary # in $PATH. @@ -232,7 +234,7 @@ if __name__ == "__main__": else: strip_binary = "strip" check_required_make_env_var("STRIPBIN", strip_binary, - parsed_args.cross_bindir) + parsed_args.host_bindir) if os.getenv("STRIPBIN") or "STRIPBIN" in new_env_vars: # If we are setting STRIPBIN, we have to set XSTRIPBIN to the # default if it is not set otherwise already. From owner-dev-commits-src-main@freebsd.org Mon Mar 22 12:00:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25EA55ABC67; Mon, 22 Mar 2021 12:00:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3tNw5SKNz3HM3; Mon, 22 Mar 2021 12:00: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 16EC65344; Mon, 22 Mar 2021 12:00:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MC0Vwb055208; Mon, 22 Mar 2021 12:00:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MC0VXE055207; Mon, 22 Mar 2021 12:00:31 GMT (envelope-from git) Date: Mon, 22 Mar 2021 12:00:31 GMT Message-Id: <202103221200.12MC0VXE055207@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: c8c62548bffb - main - Don't add -Winline for WARNS=6 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: c8c62548bffb83f3d25e062929c45d66fea755f1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 12:00:34 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c8c62548bffb83f3d25e062929c45d66fea755f1 commit c8c62548bffb83f3d25e062929c45d66fea755f1 Author: Alex Richardson AuthorDate: 2021-03-22 11:55:45 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 11:55:45 +0000 Don't add -Winline for WARNS=6 This warning is very rarely useful (inline is a hint and not mandatory). This flag results in many warnings being printed when compiling C++ code that uses the standard library with GCC. This flag was originally added in back in r94332 but the flag is a no-op in Clang ("This diagnostic flag exists for GCC compatibility, and has no effect in Clang"). Removing it should make the GCC build output slightly more readable. Reviewed By: jrtc27, imp Differential Revision: https://reviews.freebsd.org/D29235 --- lib/librt/Makefile | 2 +- lib/libthr/Makefile | 1 - share/mk/bsd.sys.mk | 3 +-- stand/i386/boot2/Makefile | 3 +-- stand/i386/isoboot/Makefile | 2 +- sys/conf/kern.mk | 1 - sys/conf/kern.pre.mk | 3 +-- tools/regression/capsicum/syscalls/Makefile | 2 +- 8 files changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/librt/Makefile b/lib/librt/Makefile index 389e0280a6bc..6a751b7a3aa3 100644 --- a/lib/librt/Makefile +++ b/lib/librt/Makefile @@ -8,7 +8,7 @@ CFLAGS+=-I${SRCTOP}/lib/libc/include -I${.CURDIR} .ifndef NO_THREAD_STACK_UNWIND CFLAGS+=-fexceptions .endif -CFLAGS+=-Winline -Wall +CFLAGS+=-Wall LIBADD= pthread WARNS?= 2 diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index c77b6b565a87..1a5dfa18dca7 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -25,7 +25,6 @@ CFLAGS+=-I${.CURDIR}/sys CFLAGS+=-I${SRCTOP}/libexec/rtld-elf CFLAGS+=-I${SRCTOP}/libexec/rtld-elf/${MACHINE_CPUARCH} CFLAGS+=-I${SRCTOP}/lib/libthread_db -CFLAGS+=-Winline CFLAGS.thr_stack.c+= -Wno-cast-align CFLAGS.rtld_malloc.c+= -Wno-cast-align diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index fad487cf5630..6341800d5c70 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -60,7 +60,7 @@ CWARNFLAGS+= -Wcast-align .endif # !NO_WCAST_ALIGN !NO_WCAST_ALIGN.${COMPILER_TYPE} .endif # WARNS >= 4 .if ${WARNS} >= 6 -CWARNFLAGS+= -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls\ +CWARNFLAGS+= -Wchar-subscripts -Wnested-externs -Wredundant-decls\ -Wold-style-definition .if !defined(NO_WMISSING_VARIABLE_DECLARATIONS) CWARNFLAGS.clang+= -Wmissing-variable-declarations @@ -147,7 +147,6 @@ CWARNFLAGS+= -Wno-error=address \ -Wno-error=deprecated-declarations \ -Wno-error=enum-compare \ -Wno-error=extra \ - -Wno-error=inline \ -Wno-error=logical-not-parentheses \ -Wno-error=strict-aliasing \ -Wno-error=uninitialized \ diff --git a/stand/i386/boot2/Makefile b/stand/i386/boot2/Makefile index 8758261ad45f..d5ad0f6bd12c 100644 --- a/stand/i386/boot2/Makefile +++ b/stand/i386/boot2/Makefile @@ -31,8 +31,7 @@ CFLAGS+=-fomit-frame-pointer \ -I${LDRSRC} \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ - -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings CFLAGS.gcc+= -Os \ -fno-asynchronous-unwind-tables \ diff --git a/stand/i386/isoboot/Makefile b/stand/i386/isoboot/Makefile index 67936e16176a..7732882b1e5c 100644 --- a/stand/i386/isoboot/Makefile +++ b/stand/i386/isoboot/Makefile @@ -29,7 +29,7 @@ CFLAGS+=-DBOOTPROG=\"isoboot\" \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline -Wno-pointer-sign + -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 35e873783cf0..f8ea372b1d93 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -48,7 +48,6 @@ CWARNEXTRA?= -Wno-error=address \ -Wno-error=attributes \ -Wno-error=cast-qual \ -Wno-error=enum-compare \ - -Wno-error=inline \ -Wno-error=maybe-uninitialized \ -Wno-error=misleading-indentation \ -Wno-error=nonnull-compare \ diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 75f59a90484d..bb52d1b9fbc4 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -192,7 +192,7 @@ NORMAL_FWO= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} -o ${.TARGET} \ # for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} \ -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} \ - -Wno-inline -Wno-missing-prototypes ${PROF} -U__BMI__ \ + -Wno-missing-prototypes ${PROF} -U__BMI__ \ -DZSTD_NO_INTRINSICS \ ${.IMPSRC} # https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1] @@ -222,7 +222,6 @@ CDDL_CFLAGS= \ ${CFLAGS} \ -Wno-cast-qual \ -Wno-duplicate-decl-specifier \ - -Wno-inline \ -Wno-missing-braces \ -Wno-missing-prototypes \ -Wno-nested-externs \ diff --git a/tools/regression/capsicum/syscalls/Makefile b/tools/regression/capsicum/syscalls/Makefile index 5d3422656281..2380193d7d7a 100644 --- a/tools/regression/capsicum/syscalls/Makefile +++ b/tools/regression/capsicum/syscalls/Makefile @@ -6,7 +6,7 @@ CFLAGS= -O2 -pipe -std=gnu99 -fstack-protector CFLAGS+= -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type CFLAGS+= -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -CFLAGS+= -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls +CFLAGS+= -Wcast-align -Wchar-subscripts -Wnested-externs -Wredundant-decls CFLAGS+= -Wold-style-definition -Wno-pointer-sign all: ${SYSCALLS} ${SYSCALLS:=.t} From owner-dev-commits-src-main@freebsd.org Mon Mar 22 12:00:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90E6F5ABDC0; Mon, 22 Mar 2021 12:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3tNs3rjvz3H2R; Mon, 22 Mar 2021 12:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8189A54FD; Mon, 22 Mar 2021 12:00: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 12MC0SlT055144; Mon, 22 Mar 2021 12:00:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MC0Sje055143; Mon, 22 Mar 2021 12:00:28 GMT (envelope-from git) Date: Mon, 22 Mar 2021 12:00:28 GMT Message-Id: <202103221200.12MC0Sje055143@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: 2b9dbcd390df - main - lib/msun/tests: Skip fenv_test:masking if exceptions can't be trapped 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: 2b9dbcd390dfbd573d3403360a36c5ade9815266 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 12:00:30 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=2b9dbcd390dfbd573d3403360a36c5ade9815266 commit 2b9dbcd390dfbd573d3403360a36c5ade9815266 Author: Alex Richardson AuthorDate: 2021-03-22 11:53:40 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 11:55:07 +0000 lib/msun/tests: Skip fenv_test:masking if exceptions can't be trapped Some CPUs (e.g. AArch64 QEMU) cannot trap on floating point exceptions and therefore ignore the writes to the floating point control register inside feenableexcept(). If no exceptions are enabled after feenableexcept(FE_ALL_EXCEPT), we can assume that the CPU does not support exceptions and we can then skip the test. Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D29095 --- lib/msun/tests/fenv_test.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/msun/tests/fenv_test.c b/lib/msun/tests/fenv_test.c index 76998a7cb2d5..f275f0725504 100644 --- a/lib/msun/tests/fenv_test.c +++ b/lib/msun/tests/fenv_test.c @@ -392,7 +392,27 @@ ATF_TC_BODY(masking, tc) int except, pass, raise, status; unsigned i; - ATF_CHECK_EQ(0, (fegetexcept() & ALL_STD_EXCEPT)); + ATF_REQUIRE_EQ(0, (fegetexcept() & ALL_STD_EXCEPT)); + + /* + * Some CPUs, e.g. AArch64 QEMU does not support trapping on FP + * exceptions. In that case the trap enable bits are all RAZ/WI, so + * writing to those bits will be ignored and the the next read will + * return all zeroes for those bits. Skip the test if no floating + * point exceptions are supported and mark it XFAIL if some are missing. + */ + ATF_REQUIRE_EQ(0, (feenableexcept(FE_ALL_EXCEPT))); + except = fegetexcept(); + if (except == 0) { + atf_tc_skip("CPU does not support trapping on floating point " + "exceptions."); + } else if ((except & ALL_STD_EXCEPT) != ALL_STD_EXCEPT) { + atf_tc_expect_fail("Not all floating point exceptions can be " + "set to trap: %#x vs %#x", except, ALL_STD_EXCEPT); + } + fedisableexcept(FE_ALL_EXCEPT); + + ATF_CHECK_EQ(0, (feenableexcept(FE_INVALID|FE_OVERFLOW) & ALL_STD_EXCEPT)); ATF_CHECK_EQ((FE_INVALID | FE_OVERFLOW), (feenableexcept(FE_UNDERFLOW) & ALL_STD_EXCEPT)); ATF_CHECK_EQ((FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW), (fedisableexcept(FE_OVERFLOW) & ALL_STD_EXCEPT)); From owner-dev-commits-src-main@freebsd.org Mon Mar 22 12:00:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FD275ABCFB; Mon, 22 Mar 2021 12:00:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3tNv5h7zz3H9F; Mon, 22 Mar 2021 12:00:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0F40527D; Mon, 22 Mar 2021 12:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MC0UGr055188; Mon, 22 Mar 2021 12:00:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MC0UXT055187; Mon, 22 Mar 2021 12:00:30 GMT (envelope-from git) Date: Mon, 22 Mar 2021 12:00:30 GMT Message-Id: <202103221200.12MC0UXT055187@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: 6ccdee8ab576 - main - lib/msun/tests: Add more debug output to fenv_test.c 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: 6ccdee8ab576577224fb9e4baed05bd0efe933fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 12:00:33 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=6ccdee8ab576577224fb9e4baed05bd0efe933fd commit 6ccdee8ab576577224fb9e4baed05bd0efe933fd Author: Alex Richardson AuthorDate: 2021-03-04 18:41:06 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 11:55:07 +0000 lib/msun/tests: Add more debug output to fenv_test.c Output a hex dump of the current fenv and the expected value to allow comparing them without having to resort to interactive use of GDB. --- lib/msun/tests/Makefile | 1 + lib/msun/tests/fenv_test.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 4ef25c0a909a..7da1944c8ed8 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -86,6 +86,7 @@ IGNORE_PRAGMA= SRCS.ilogb2_test= ilogb_test.c +LIBADD.fenv_test+= util LIBADD+= m WARNS?= 6 diff --git a/lib/msun/tests/fenv_test.c b/lib/msun/tests/fenv_test.c index f275f0725504..aafdd32b7fbd 100644 --- a/lib/msun/tests/fenv_test.c +++ b/lib/msun/tests/fenv_test.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -173,7 +174,10 @@ ATF_TC_BODY(dfl_env, tc) fenv_t env; fegetenv(&env); - + /* Print the default environment for debugging purposes. */ + hexdump(&env, sizeof(env), "current fenv ", HD_OMIT_CHARS); + hexdump(FE_DFL_ENV, sizeof(env), "default fenv ", HD_OMIT_CHARS); + CHECK_FP_EXCEPTIONS(0, FE_ALL_EXCEPT); #ifdef __amd64__ /* * Compare the fields that the AMD [1] and Intel [2] specs say will be @@ -202,7 +206,7 @@ ATF_TC_BODY(dfl_env, tc) #endif #endif - ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); + CHECK_FP_EXCEPTIONS(0, FE_ALL_EXCEPT); } /* From owner-dev-commits-src-main@freebsd.org Mon Mar 22 12:00:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 728935ABD43; Mon, 22 Mar 2021 12:00: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 4F3tNq4ktBz3H2L; Mon, 22 Mar 2021 12:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BF94527B; Mon, 22 Mar 2021 12:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MC0R1I055126; Mon, 22 Mar 2021 12:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MC0Rja055125; Mon, 22 Mar 2021 12:00:27 GMT (envelope-from git) Date: Mon, 22 Mar 2021 12:00:27 GMT Message-Id: <202103221200.12MC0Rja055125@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: 87d65c747a43 - main - lib/msun: Allow building tests with WARNS=6 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: 87d65c747a4389901c2bbbcb1ec4878b2df7b32c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 12:00:29 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=87d65c747a4389901c2bbbcb1ec4878b2df7b32c commit 87d65c747a4389901c2bbbcb1ec4878b2df7b32c Author: Alex Richardson AuthorDate: 2021-02-25 14:28:17 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 11:55:07 +0000 lib/msun: Allow building tests with WARNS=6 The only change needed is to mark a few variables as static. --- contrib/netbsd-tests/lib/libm/t_ldexp.c | 19 +++++++++---------- contrib/netbsd-tests/lib/libm/t_precision.c | 4 ++-- contrib/netbsd-tests/lib/libm/t_round.c | 2 +- contrib/netbsd-tests/lib/libm/t_scalbn.c | 2 +- lib/msun/tests/Makefile | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/contrib/netbsd-tests/lib/libm/t_ldexp.c b/contrib/netbsd-tests/lib/libm/t_ldexp.c index 977b2219873b..40c69206e741 100644 --- a/contrib/netbsd-tests/lib/libm/t_ldexp.c +++ b/contrib/netbsd-tests/lib/libm/t_ldexp.c @@ -53,7 +53,7 @@ struct ldexp_test { const char *result; }; -struct ldexp_test ldexp_basic[] = { +static struct ldexp_test ldexp_basic[] = { { 1.0, 5, SKIP, " 32" }, { 1.0, 1022, SKIP, "4.4942328371557897693233e+307" }, { 1.0, 1023, -1, "4.4942328371557897693233e+307" }, @@ -71,7 +71,7 @@ struct ldexp_test ldexp_basic[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_zero[] = { +static struct ldexp_test ldexp_zero[] = { { 0.0, -1, SKIP, " 0" }, { 0.0, 0, SKIP, " 0" }, { 0.0, 1, SKIP, " 0" }, @@ -82,7 +82,7 @@ struct ldexp_test ldexp_zero[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_infinity[] = { +static struct ldexp_test ldexp_infinity[] = { { 1.0, 1024, -1, " inf" }, { 1.0, 1024, 0, " inf" }, { 1.0, 1024, 1, " inf" }, @@ -92,7 +92,7 @@ struct ldexp_test ldexp_infinity[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_overflow[] = { +static struct ldexp_test ldexp_overflow[] = { { 1.0, 1024, SKIP, " inf" }, { 1.0, 1023, 1, " inf" }, { 1.0, -1022, 2046, " inf" }, @@ -106,7 +106,7 @@ struct ldexp_test ldexp_overflow[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_denormal[] = { +static struct ldexp_test ldexp_denormal[] = { { 1.0, -1023, SKIP, "1.1125369292536006915451e-308" }, { 1.0, -1022, -1, "1.1125369292536006915451e-308" }, { 1.0, 1023, -2046, "1.1125369292536006915451e-308" }, @@ -120,7 +120,7 @@ struct ldexp_test ldexp_denormal[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_underflow[] = { +static struct ldexp_test ldexp_underflow[] = { { 1.0, -1075, SKIP, " 0" }, { 1.0, -1074, -1, " 0" }, { 1.0, 1023, -2098, " 0" }, @@ -132,7 +132,7 @@ struct ldexp_test ldexp_underflow[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_denormal_large[] = { +static struct ldexp_test ldexp_denormal_large[] = { { 1.0, -1028, 1024, " 0.0625" }, { 1.0, -1028, 1025, " 0.125" }, { 1.0, -1028, 1026, " 0.25" }, @@ -177,10 +177,9 @@ run_test(struct ldexp_test *table) v = ldexp(v, table->exp2); (void)snprintf(outbuf, sizeof(outbuf), FORMAT, v); - ATF_CHECK_STREQ_MSG(table->result, outbuf, - "Entry %zu:\n\tExp: \"%s\"\n\tAct: \"%s\"", - i, table->result, outbuf); + "Entry %zu:\n\tExp: \"%s\"\n\tAct: \"%s\"/%a", + i, table->result, outbuf, v); } } diff --git a/contrib/netbsd-tests/lib/libm/t_precision.c b/contrib/netbsd-tests/lib/libm/t_precision.c index eb8e29546eb6..b953845c21f4 100644 --- a/contrib/netbsd-tests/lib/libm/t_precision.c +++ b/contrib/netbsd-tests/lib/libm/t_precision.c @@ -44,9 +44,9 @@ ATF_TC_HEAD(t_precision, tc) "Basic precision test for double and long double"); } -volatile double x = 1; +static volatile double x = 1; #if __HAVE_LONG_DOUBLE -volatile long double y = 1; +static volatile long double y = 1; #endif ATF_TC_BODY(t_precision, tc) diff --git a/contrib/netbsd-tests/lib/libm/t_round.c b/contrib/netbsd-tests/lib/libm/t_round.c index 7d32586f1aa5..bafc894943ce 100644 --- a/contrib/netbsd-tests/lib/libm/t_round.c +++ b/contrib/netbsd-tests/lib/libm/t_round.c @@ -117,7 +117,7 @@ ATF_TC_HEAD(rounding_alpha_simple, tc) } -double rounding_alpha_simple_even = 9223372036854775808.000000; /* 2^63 */ +static double rounding_alpha_simple_even = 9223372036854775808.000000; /* 2^63 */ ATF_TC_BODY(rounding_alpha_simple, tc) { diff --git a/contrib/netbsd-tests/lib/libm/t_scalbn.c b/contrib/netbsd-tests/lib/libm/t_scalbn.c index f6adaaa993ec..dce07aac3c78 100644 --- a/contrib/netbsd-tests/lib/libm/t_scalbn.c +++ b/contrib/netbsd-tests/lib/libm/t_scalbn.c @@ -49,7 +49,7 @@ struct testcase { int error; int except; }; -struct testcase test_vals[] = { +static struct testcase test_vals[] = { { 0, 1.00085, 1.00085, 0, 0 }, { 0, 0.99755, 0.99755, 0, 0 }, { 0, -1.00085, -1.00085, 0, 0 }, diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 309f49c6dddd..4ef25c0a909a 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -88,7 +88,7 @@ SRCS.ilogb2_test= ilogb_test.c LIBADD+= m -WARNS?= 1 +WARNS?= 6 # Copied from lib/msun/Makefile .if ${MACHINE_CPUARCH} == "i386" From owner-dev-commits-src-main@freebsd.org Mon Mar 22 13:06:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E0545AE459; Mon, 22 Mar 2021 13:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3vrt3Vs1z3Nr9; Mon, 22 Mar 2021 13:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60DEE6038; Mon, 22 Mar 2021 13:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MD6MNd044156; Mon, 22 Mar 2021 13:06:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MD6MAt044155; Mon, 22 Mar 2021 13:06:22 GMT (envelope-from git) Date: Mon, 22 Mar 2021 13:06:22 GMT Message-Id: <202103221306.12MD6MAt044155@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: 7f5693d05329 - main - Fix unused functions in invtrig_test.c 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: 7f5693d05329ab976287b8d449e694e7a0f99e88 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 13:06:22 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=7f5693d05329ab976287b8d449e694e7a0f99e88 commit 7f5693d05329ab976287b8d449e694e7a0f99e88 Author: Alex Richardson AuthorDate: 2021-03-22 13:05:28 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 13:06:02 +0000 Fix unused functions in invtrig_test.c I only tested the WARNS=6 change on AArch64 and AMD64, but this file has unused functions for architectures with LDBL_PREC == 53. While touching this file change the LDBL_PREC == 53 checks to i386 checks. The long double tests should only be disabled for i386 (due to the rather odd rounding mode that it uses) not all architectures where long double is the same as double. PR: 205449 Fixes: 87d65c747a43 ("lib/msun: Allow building tests with WARNS=6") Reported by: Jenkins --- lib/msun/tests/invtrig_test.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/msun/tests/invtrig_test.c b/lib/msun/tests/invtrig_test.c index 7dd8b26f652f..90ebcc5dfdad 100644 --- a/lib/msun/tests/invtrig_test.c +++ b/lib/msun/tests/invtrig_test.c @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); (tol) * ldexpf(1.0, 1 - FLT_MANT_DIG), (excepts)); \ } while (0) -#if LDBL_PREC == 53 +#ifdef __i386__ #define testall_tol _testall_tol #else #define testall_tol(prefix, x, result, tol, excepts) do { \ @@ -98,7 +98,7 @@ __FBSDID("$FreeBSD$"); (tol) * ldexpf(1.0, 1 - FLT_MANT_DIG), (excepts)); \ } while (0) -#if LDBL_PREC == 53 +#ifdef __i386__ #define testall2_tol _testall2_tol #else #define testall2_tol(prefix, y, x, result, tol, excepts) do { \ @@ -380,12 +380,14 @@ sinasin(double x) return (sinl(asin(x))); } +#ifndef __i386__ static long double sinasinl(long double x) { return (sinl(asinl(x))); } +#endif static long double cosacosf(float x) @@ -401,12 +403,14 @@ cosacos(double x) return (cosl(acos(x))); } +#ifndef __i386__ static long double cosacosl(long double x) { return (cosl(acosl(x))); } +#endif static long double tanatanf(float x) @@ -422,12 +426,14 @@ tanatan(double x) return (tanl(atan(x))); } +#ifndef __i386__ static long double tanatanl(long double x) { return (tanl(atanl(x))); } +#endif ATF_TC_WITHOUT_HEAD(inverse); ATF_TC_BODY(inverse, tc) From owner-dev-commits-src-main@freebsd.org Mon Mar 22 13:35:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DFED5AF131; Mon, 22 Mar 2021 13:35: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 4F3wV61l2Sz3QCm; Mon, 22 Mar 2021 13:35: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 2A5936C13; Mon, 22 Mar 2021 13:35: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 12MDZATc085607; Mon, 22 Mar 2021 13:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MDZAAE085606; Mon, 22 Mar 2021 13:35:10 GMT (envelope-from git) Date: Mon, 22 Mar 2021 13:35:10 GMT Message-Id: <202103221335.12MDZAAE085606@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: 64a790d26480 - main - DTrace: remove sparc64 remnants in non-contrib code 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: 64a790d264808116469914c19265e905b3929e00 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 13:35:10 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=64a790d264808116469914c19265e905b3929e00 commit 64a790d264808116469914c19265e905b3929e00 Author: Ed Maste AuthorDate: 2021-03-21 01:19:35 +0000 Commit: Ed Maste CommitDate: 2021-03-22 13:34:57 +0000 DTrace: remove sparc64 remnants in non-contrib code Sponsored by: The FreeBSD Foundation --- sys/cddl/dev/profile/profile.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c index 4fc9f6f22eef..6074354af18d 100644 --- a/sys/cddl/dev/profile/profile.c +++ b/sys/cddl/dev/profile/profile.c @@ -83,15 +83,6 @@ * appears as its own stack frame. All of this means that we need to add one * frame for amd64, and then take one away for both amd64 and i386. * - * On SPARC, the picture is further complicated because the compiler - * optimizes away tail-calls -- so the following frames are optimized away: - * - * profile_fire - * cyclic_expire - * - * This gives three frames. However, on DEBUG kernels, the cyclic_expire - * frame cannot be tail-call eliminated, yielding four frames in this case. - * * All of the above constraints lead to the mess below. Yes, the profile * provider should ideally figure this out on-the-fly by hiting one of its own * probes and then walking its own stack trace. This is complicated, however, @@ -103,14 +94,6 @@ #else #ifdef __i386 #define PROF_ARTIFICIAL_FRAMES 6 -#else -#ifdef __sparc -#ifdef DEBUG -#define PROF_ARTIFICIAL_FRAMES 4 -#else -#define PROF_ARTIFICIAL_FRAMES 3 -#endif -#endif #endif #endif From owner-dev-commits-src-main@freebsd.org Mon Mar 22 14:16:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0293A5B0506; Mon, 22 Mar 2021 14:16: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 4F3xPH6VQ9z3k0F; Mon, 22 Mar 2021 14:16: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 D19596DFC; Mon, 22 Mar 2021 14:16: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 12MEG3hP043303; Mon, 22 Mar 2021 14:16:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MEG3w9043302; Mon, 22 Mar 2021 14:16:03 GMT (envelope-from git) Date: Mon, 22 Mar 2021 14:16:03 GMT Message-Id: <202103221416.12MEG3w9043302@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: a0409676120c - main - libucl: vendor import snapshort 20210314 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: a0409676120c1e558d0ade943019934e0f15118d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 14:16:04 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=a0409676120c1e558d0ade943019934e0f15118d commit a0409676120c1e558d0ade943019934e0f15118d Merge: 64a790d26480 3c319408d0de Author: Baptiste Daroussin AuthorDate: 2021-03-22 14:13:02 +0000 Commit: Baptiste Daroussin CommitDate: 2021-03-22 14:13:02 +0000 libucl: vendor import snapshort 20210314 contrib/libucl/CMakeLists.txt | 105 ++- contrib/libucl/ChangeLog.md | 38 +- contrib/libucl/README.md | 64 +- contrib/libucl/configure.ac | 8 +- contrib/libucl/doc/api.md | 17 +- contrib/libucl/doc/libucl.3 | 26 +- contrib/libucl/doc/lua_api.md | 4 +- contrib/libucl/include/lua_ucl.h | 20 +- contrib/libucl/include/ucl++.h | 191 ++++- contrib/libucl/include/ucl.h | 191 ++++- contrib/libucl/klib/kvec.h | 78 ++- contrib/libucl/lua/lua_ucl.c | 450 ++++++++++-- contrib/libucl/python/MANIFEST.in | 5 + contrib/libucl/python/setup.py | 42 +- contrib/libucl/python/src/uclmodule.c | 3 +- contrib/libucl/python/tests/test_example.py | 59 ++ contrib/libucl/python/tests/test_load.py | 17 +- contrib/libucl/src/mum.h | 8 +- contrib/libucl/src/ucl_chartable.h | 4 +- contrib/libucl/src/ucl_emitter.c | 12 +- contrib/libucl/src/ucl_emitter_utils.c | 57 +- contrib/libucl/src/ucl_hash.c | 218 +++++- contrib/libucl/src/ucl_hash.h | 20 +- contrib/libucl/src/ucl_internal.h | 105 ++- contrib/libucl/src/ucl_msgpack.c | 82 ++- contrib/libucl/src/ucl_parser.c | 552 ++++++++++++--- contrib/libucl/src/ucl_schema.c | 29 +- contrib/libucl/src/ucl_util.c | 780 ++++++++++++++++----- contrib/libucl/tests/basic.test | 2 +- contrib/libucl/tests/basic/13.in | 2 +- contrib/libucl/tests/basic/20.in | 2 - contrib/libucl/tests/basic/20.res | 5 - contrib/libucl/tests/basic/21.in | 2 - contrib/libucl/tests/basic/21.res | 10 - contrib/libucl/tests/basic/9.in | 2 +- contrib/libucl/tests/basic/9.res | 8 +- contrib/libucl/tests/basic/squote.in | 8 + contrib/libucl/tests/basic/squote.res | 7 + .../libucl/tests/fuzzers/ucl_add_string_fuzzer.c | 25 + contrib/libucl/tests/fuzzers/ucl_msgpack_fuzzer.c | 29 + contrib/libucl/tests/generate.test | 2 +- contrib/libucl/tests/run_tests.sh | 4 +- contrib/libucl/tests/streamline.test | 2 +- contrib/libucl/tests/test_basic.c | 11 +- contrib/libucl/tests/test_generate.c | 15 +- contrib/libucl/tests/test_msgpack.c | 1 + contrib/libucl/utils/CMakeLists.txt | 12 + contrib/libucl/utils/objdump.c | 17 +- contrib/libucl/utils/ucl-tool.c | 100 +-- 49 files changed, 2820 insertions(+), 631 deletions(-) diff --cc contrib/libucl/README.md index 44983c57d643,000000000000..53d8a651d73b mode 100644,000000..100644 --- a/contrib/libucl/README.md +++ b/contrib/libucl/README.md @@@ -1,384 -1,0 +1,418 @@@ +# LIBUCL + - [![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl) ++[![CircleCI](https://circleci.com/gh/vstakhov/libucl.svg?style=svg)](https://circleci.com/gh/vstakhov/libucl) +[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) +[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master) + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Introduction](#introduction) +- [Basic structure](#basic-structure) +- [Improvements to the json notation](#improvements-to-the-json-notation) + - [General syntax sugar](#general-syntax-sugar) + - [Automatic arrays creation](#automatic-arrays-creation) + - [Named keys hierarchy](#named-keys-hierarchy) + - [Convenient numbers and booleans](#convenient-numbers-and-booleans) +- [General improvements](#general-improvements) + - [Comments](#comments) + - [Macros support](#macros-support) + - [Variables support](#variables-support) + - [Multiline strings](#multiline-strings) ++ - [Single quoted strings](#single-quoted-strings) +- [Emitter](#emitter) +- [Validation](#validation) +- [Performance](#performance) +- [Conclusion](#conclusion) + +## Introduction + +This document describes the main features and principles of the configuration +language called `UCL` - universal configuration language. + +If you are looking for the libucl API documentation you can find it at [this page](doc/api.md). + +## Basic structure + +UCL is heavily infused by `nginx` configuration as the example of a convenient configuration +system. However, UCL is fully compatible with `JSON` format and is able to parse json files. +For example, you can write the same configuration in the following ways: + +* in nginx like: + +```nginx +param = value; +section { + param = value; + param1 = value1; + flag = true; + number = 10k; + time = 0.2s; + string = "something"; + subsection { + host = { + host = "hostname"; + port = 900; + } + host = { + host = "hostname"; + port = 901; + } + } +} +``` + +* or in JSON: + +```json +{ + "param": "value", - "param1": "value1", - "flag": true, - "subsection": { - "host": [ - { - "host": "hostname", - "port": 900 - }, - { - "host": "hostname", - "port": 901 ++ "section": { ++ "param": "value", ++ "param1": "value1", ++ "flag": true, ++ "number": 10000, ++ "time": "0.2s", ++ "string": "something", ++ "subsection": { ++ "host": [ ++ { ++ "host": "hostname", ++ "port": 900 ++ }, ++ { ++ "host": "hostname", ++ "port": 901 ++ } ++ ] + } - ] + } +} +``` + +## Improvements to the json notation. + +There are various things that make ucl configuration more convenient for editing than strict json: + +### General syntax sugar + +* Braces are not necessary to enclose a top object: it is automatically treated as an object: + +```json +"key": "value" +``` +is equal to: +```json +{"key": "value"} +``` + +* There is no requirement of quotes for strings and keys, moreover, `:` may be replaced `=` or even be skipped for objects: + +```nginx +key = value; +section { + key = value; +} +``` +is equal to: +```json +{ + "key": "value", + "section": { + "key": "value" + } +} +``` + +* No commas mess: you can safely place a comma or semicolon for the last element in an array or an object: + +```json +{ + "key1": "value", + "key2": "value", +} +``` +### Automatic arrays creation + +* Non-unique keys in an object are allowed and are automatically converted to the arrays internally: + +```json +{ + "key": "value1", + "key": "value2" +} +``` +is converted to: +```json +{ + "key": ["value1", "value2"] +} +``` + +### Named keys hierarchy + +UCL accepts named keys and organize them into objects hierarchy internally. Here is an example of this process: +```nginx +section "blah" { + key = value; +} +section foo { + key = value; +} +``` + +is converted to the following object: + +```nginx +section { + blah { + key = value; + } + foo { + key = value; + } +} +``` + +Plain definitions may be more complex and contain more than a single level of nested objects: + +```nginx +section "blah" "foo" { + key = value; +} +``` + +is presented as: + +```nginx +section { + blah { + foo { + key = value; + } + } +} +``` + +### Convenient numbers and booleans + +* Numbers can have suffixes to specify standard multipliers: + + `[kKmMgG]` - standard 10 base multipliers (so `1k` is translated to 1000) + + `[kKmMgG]b` - 2 power multipliers (so `1kb` is translated to 1024) + + `[s|min|d|w|y]` - time multipliers, all time values are translated to float number of seconds, for example `10min` is translated to 600.0 and `10ms` is translated to 0.01 +* Hexadecimal integers can be used by `0x` prefix, for example `key = 0xff`. However, floating point values can use decimal base only. +* Booleans can be specified as `true` or `yes` or `on` and `false` or `no` or `off`. +* It is still possible to treat numbers and booleans as strings by enclosing them in double quotes. + +## General improvements + +### Comments + +UCL supports different style of comments: + +* single line: `#` +* multiline: `/* ... */` + +Multiline comments may be nested: +```c +# Sample single line comment +/* + some comment + /* nested comment */ + end of comment +*/ +``` + +### Macros support + +UCL supports external macros both multiline and single line ones: +```nginx +.macro_name "sometext"; +.macro_name { + Some long text + .... +}; +``` + +Moreover, each macro can accept an optional list of arguments in braces. These +arguments themselves are the UCL object that is parsed and passed to a macro as +options: + +```nginx +.macro_name(param=value) "something"; +.macro_name(param={key=value}) "something"; +.macro_name(.include "params.conf") "something"; +.macro_name(#this is multiline macro +param = [value1, value2]) "something"; +.macro_name(key="()") "something"; +``` + +UCL also provide a convenient `include` macro to load content from another files +to the current UCL object. This macro accepts either path to file: + +```nginx +.include "/full/path.conf" +.include "./relative/path.conf" +.include "${CURDIR}/path.conf" +``` + +or URL (if ucl is built with url support provided by either `libcurl` or `libfetch`): + + .include "http://example.com/file.conf" + +`.include` macro supports a set of options: + +* `try` (default: **false**) - if this option is `true` than UCL treats errors on loading of +this file as non-fatal. For example, such a file can be absent but it won't stop the parsing +of the top-level document. +* `sign` (default: **false**) - if this option is `true` UCL loads and checks the signature for +a file from path named `.sig`. Trusted public keys should be provided for UCL API after +parser is created but before any configurations are parsed. +* `glob` (default: **false**) - if this option is `true` UCL treats the filename as GLOB pattern and load +all files that matches the specified pattern (normally the format of patterns is defined in `glob` manual page +for your operating system). This option is meaningless for URL includes. +* `url` (default: **true**) - allow URL includes. +* `path` (default: empty) - A UCL_ARRAY of directories to search for the include file. +Search ends after the first match, unless `glob` is true, then all matches are included. +* `prefix` (default false) - Put included contents inside an object, instead +of loading them into the root. If no `key` is provided, one is automatically generated based on each files basename() +* `key` (default: ) - Key to load contents of include into. If +the key already exists, it must be the correct type +* `target` (default: object) - Specify if the `prefix` `key` should be an +object or an array. +* `priority` (default: 0) - specify priority for the include (see below). +* `duplicate` (default: 'append') - specify policy of duplicates resolving: + - `append` - default strategy, if we have new object of higher priority then it replaces old one, if we have new object with less priority it is ignored completely, and if we have two duplicate objects with the same priority then we have a multi-value key (implicit array) + - `merge` - if we have object or array, then new keys are merged inside, if we have a plain object then an implicit array is formed (regardless of priorities) + - `error` - create error on duplicate keys and stop parsing + - `rewrite` - always rewrite an old value with new one (ignoring priorities) + +Priorities are used by UCL parser to manage the policy of objects rewriting during including other files +as following: + +* If we have two objects with the same priority then we form an implicit array +* If a new object has bigger priority then we overwrite an old one +* If a new object has lower priority then we ignore it + +By default, the priority of top-level object is set to zero (lowest priority). Currently, +you can define up to 16 priorities (from 0 to 15). Includes with bigger priorities will - rewrite keys from the objects with lower priorities as specified by the policy. ++rewrite keys from the objects with lower priorities as specified by the policy. The priority ++of the top-level or any other object can be changed with the `.priority` macro, which has no ++options and takes the new priority: ++ ++``` ++# Default priority: 0. ++foo = 6 ++.priority 5 ++# The following will have priority 5. ++bar = 6 ++baz = 7 ++# The following will be included with a priority of 3, 5, and 6 respectively. ++.include(priority=3) "path.conf" ++.include(priority=5) "equivalent-path.conf" ++.include(priority=6) "highpriority-path.conf" ++``` + +### Variables support + +UCL supports variables in input. Variables are registered by a user of the UCL parser and can be presented in the following forms: + +* `${VARIABLE}` +* `$VARIABLE` + +UCL currently does not support nested variables. To escape variables one could use double dollar signs: + +* `$${VARIABLE}` is converted to `${VARIABLE}` +* `$$VARIABLE` is converted to `$VARIABLE` + +However, if no valid variables are found in a string, no expansion will be performed (and `$$` thus remains unchanged). This may be a subject +to change in future libucl releases. + +### Multiline strings + +UCL can handle multiline strings as well as single line ones. It uses shell/perl like notation for such objects: +``` +key = < + + 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. +*/ + +/* This file implements MUM (MUltiply and Mix) hashing. We randomize + input data by 64x64-bit multiplication and mixing hi- and low-parts + of the multiplication result by using an addition and then mix it + into the current state. We use prime numbers randomly generated + with the equal probability of their bit values for the + multiplication. When all primes are used once, the state is + randomized and the same prime numbers are used again for data + randomization. + + The MUM hashing passes all SMHasher tests. Pseudo Random Number + Generator based on MUM also passes NIST Statistical Test Suite for + Random and Pseudorandom Number Generators for Cryptographic + Applications (version 2.2.1) with 1000 bitstreams each containing + 1M bits. MUM hashing is also faster Spooky64 and City64 on small - strings (at least upto 512-bit) on Haswell and Power7. The MUM bulk ++ strings (at least up to 512-bit) on Haswell and Power7. The MUM bulk + speed (speed on very long data) is bigger than Spooky and City on + Power7. On Haswell the bulk speed is bigger than Spooky one and + close to City speed. */ + +#ifndef __MUM_HASH__ +#define __MUM_HASH__ + +#include +#include +#include +#include + +#ifdef _MSC_VER +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; +#else +#include +#endif + +/* Macro saying to use 128-bit integers implemented by GCC for some + targets. */ +#ifndef _MUM_USE_INT128 +/* In GCC uint128_t is defined if HOST_BITS_PER_WIDE_INT >= 64. + HOST_WIDE_INT is long if HOST_BITS_PER_LONG > HOST_BITS_PER_INT, + otherwise int. */ +#if defined(__GNUC__) && UINT_MAX != ULONG_MAX +#define _MUM_USE_INT128 1 +#else +#define _MUM_USE_INT128 0 +#endif +#endif + +#if 0 +#if defined(__GNUC__) && ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9) || (__GNUC__ > 4)) +#define _MUM_FRESH_GCC +#endif +#endif + +#if defined(__GNUC__) && !defined(__llvm__) && defined(_MUM_FRESH_GCC) +#define _MUM_ATTRIBUTE_UNUSED __attribute__((unused)) +#define _MUM_OPTIMIZE(opts) __attribute__((__optimize__ (opts))) +#define _MUM_TARGET(opts) __attribute__((__target__ (opts))) +#else +#define _MUM_ATTRIBUTE_UNUSED +#define _MUM_OPTIMIZE(opts) +#define _MUM_TARGET(opts) +#endif + + +/* Here are different primes randomly generated with the equal + probability of their bit values. They are used to randomize input + values. */ +static uint64_t _mum_hash_step_prime = 0x2e0bb864e9ea7df5ULL; +static uint64_t _mum_key_step_prime = 0xcdb32970830fcaa1ULL; +static uint64_t _mum_block_start_prime = 0xc42b5e2e6480b23bULL; +static uint64_t _mum_unroll_prime = 0x7b51ec3d22f7096fULL; +static uint64_t _mum_tail_prime = 0xaf47d47c99b1461bULL; +static uint64_t _mum_finish_prime1 = 0xa9a7ae7ceff79f3fULL; +static uint64_t _mum_finish_prime2 = 0xaf47d47c99b1461bULL; + +static uint64_t _mum_primes [] = { + 0X9ebdcae10d981691, 0X32b9b9b97a27ac7d, 0X29b5584d83d35bbd, 0X4b04e0e61401255f, + 0X25e8f7b1f1c9d027, 0X80d4c8c000f3e881, 0Xbd1255431904b9dd, 0X8a3bd4485eee6d81, + 0X3bc721b2aad05197, 0X71b1a19b907d6e33, 0X525e6c1084a8534b, 0X9e4c2cd340c1299f, + 0Xde3add92e94caa37, 0X7e14eadb1f65311d, 0X3f5aa40f89812853, 0X33b15a3b587d15c9, +}; + +/* Multiply 64-bit V and P and return sum of high and low parts of the + result. */ +static inline uint64_t +_mum (uint64_t v, uint64_t p) { + uint64_t hi, lo; +#if _MUM_USE_INT128 +#if defined(__aarch64__) + /* AARCH64 needs 2 insns to calculate 128-bit result of the + multiplication. If we use a generic code we actually call a + function doing 128x128->128 bit multiplication. The function is + very slow. */ + lo = v * p, hi; + asm ("umulh %0, %1, %2" : "=r" (hi) : "r" (v), "r" (p)); +#else + __uint128_t r = (__uint128_t) v * (__uint128_t) p; + hi = (uint64_t) (r >> 64); + lo = (uint64_t) r; +#endif +#else + /* Implementation of 64x64->128-bit multiplication by four 32x32->64 + bit multiplication. */ + uint64_t hv = v >> 32, hp = p >> 32; + uint64_t lv = (uint32_t) v, lp = (uint32_t) p; + uint64_t rh = hv * hp; + uint64_t rm_0 = hv * lp; + uint64_t rm_1 = hp * lv; + uint64_t rl = lv * lp; + uint64_t t, carry = 0; + + /* We could ignore a carry bit here if we did not care about the + same hash for 32-bit and 64-bit targets. */ + t = rl + (rm_0 << 32); +#ifdef MUM_TARGET_INDEPENDENT_HASH + carry = t < rl; +#endif + lo = t + (rm_1 << 32); +#ifdef MUM_TARGET_INDEPENDENT_HASH + carry += lo < t; +#endif + hi = rh + (rm_0 >> 32) + (rm_1 >> 32) + carry; +#endif + /* We could use XOR here too but, for some reasons, on Haswell and + Power7 using an addition improves hashing performance by 10% for + small strings. */ + return hi + lo; +} + +#if defined(_MSC_VER) +#define _mum_bswap_32(x) _byteswap_uint32_t (x) +#define _mum_bswap_64(x) _byteswap_uint64_t (x) +#elif defined(__APPLE__) +#include +#define _mum_bswap_32(x) OSSwapInt32 (x) +#define _mum_bswap_64(x) OSSwapInt64 (x) +#elif defined(__GNUC__) +#define _mum_bswap32(x) __builtin_bswap32 (x) +#define _mum_bswap64(x) __builtin_bswap64 (x) +#else +#include +#define _mum_bswap32(x) bswap32 (x) +#define _mum_bswap64(x) bswap64 (x) +#endif + +static inline uint64_t +_mum_le (uint64_t v) { +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || !defined(MUM_TARGET_INDEPENDENT_HASH) + return v; +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + return _mum_bswap64 (v); +#else - #error "Unknown endianess" ++#error "Unknown endianness" +#endif +} + +static inline uint32_t +_mum_le32 (uint32_t v) { +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || !defined(MUM_TARGET_INDEPENDENT_HASH) + return v; +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + return _mum_bswap32 (v); +#else - #error "Unknown endianess" ++#error "Unknown endianness" +#endif +} + +/* Macro defining how many times the most nested loop in + _mum_hash_aligned will be unrolled by the compiler (although it can + make an own decision:). Use only a constant here to help a + compiler to unroll a major loop. + + The macro value affects the result hash for strings > 128 bit. The + unroll factor greatly affects the hashing speed. We prefer the + speed. */ +#ifndef _MUM_UNROLL_FACTOR_POWER +#if defined(__PPC64__) && !defined(MUM_TARGET_INDEPENDENT_HASH) +#define _MUM_UNROLL_FACTOR_POWER 3 +#elif defined(__aarch64__) && !defined(MUM_TARGET_INDEPENDENT_HASH) +#define _MUM_UNROLL_FACTOR_POWER 4 +#else +#define _MUM_UNROLL_FACTOR_POWER 2 +#endif +#endif + +#if _MUM_UNROLL_FACTOR_POWER < 1 +#error "too small unroll factor" +#elif _MUM_UNROLL_FACTOR_POWER > 4 +#error "We have not enough primes for such unroll factor" +#endif + +#define _MUM_UNROLL_FACTOR (1 << _MUM_UNROLL_FACTOR_POWER) + +static inline uint64_t _MUM_OPTIMIZE("unroll-loops") +_mum_hash_aligned (uint64_t start, const void *key, size_t len) { + uint64_t result = start; + const unsigned char *str = (const unsigned char *) key; + uint64_t u64; + int i; + size_t n; + + result = _mum (result, _mum_block_start_prime); + while (len > _MUM_UNROLL_FACTOR * sizeof (uint64_t)) { + /* This loop could be vectorized when we have vector insns for + 64x64->128-bit multiplication. AVX2 currently only have a + vector insn for 4 32x32->64-bit multiplication. */ + for (i = 0; i < _MUM_UNROLL_FACTOR; i++) + result ^= _mum (_mum_le (((uint64_t *) str)[i]), _mum_primes[i]); + len -= _MUM_UNROLL_FACTOR * sizeof (uint64_t); + str += _MUM_UNROLL_FACTOR * sizeof (uint64_t); + /* We will use the same prime numbers on the next iterations -- + randomize the state. */ + result = _mum (result, _mum_unroll_prime); + } + n = len / sizeof (uint64_t); + for (i = 0; i < (int)n; i++) + result ^= _mum (_mum_le (((uint64_t *) str)[i]), _mum_primes[i]); + len -= n * sizeof (uint64_t); str += n * sizeof (uint64_t); + switch (len) { + case 7: + u64 = _mum_le32 (*(uint32_t *) str); + u64 |= (uint64_t) str[4] << 32; + u64 |= (uint64_t) str[5] << 40; + u64 |= (uint64_t) str[6] << 48; + return result ^ _mum (u64, _mum_tail_prime); + case 6: + u64 = _mum_le32 (*(uint32_t *) str); + u64 |= (uint64_t) str[4] << 32; + u64 |= (uint64_t) str[5] << 40; + return result ^ _mum (u64, _mum_tail_prime); + case 5: + u64 = _mum_le32 (*(uint32_t *) str); + u64 |= (uint64_t) str[4] << 32; + return result ^ _mum (u64, _mum_tail_prime); + case 4: + u64 = _mum_le32 (*(uint32_t *) str); + return result ^ _mum (u64, _mum_tail_prime); + case 3: + u64 = str[0]; + u64 |= (uint64_t) str[1] << 8; + u64 |= (uint64_t) str[2] << 16; + return result ^ _mum (u64, _mum_tail_prime); + case 2: + u64 = str[0]; + u64 |= (uint64_t) str[1] << 8; + return result ^ _mum (u64, _mum_tail_prime); + case 1: + u64 = str[0]; + return result ^ _mum (u64, _mum_tail_prime); + } + return result; +} + +/* Final randomization of H. */ +static inline uint64_t +_mum_final (uint64_t h) { + h ^= _mum (h, _mum_finish_prime1); + h ^= _mum (h, _mum_finish_prime2); + return h; +} + +#if defined(__x86_64__) && defined(_MUM_FRESH_GCC) + +/* We want to use AVX2 insn MULX instead of generic x86-64 MULQ where + it is possible. Although on modern Intel processors MULQ takes + 3-cycles vs. 4 for MULX, MULX permits more freedom in insn + scheduling as it uses less fixed registers. */ +static inline uint64_t _MUM_TARGET("arch=haswell") +_mum_hash_avx2 (const void * key, size_t len, uint64_t seed) { + return _mum_final (_mum_hash_aligned (seed + len, key, len)); +} +#endif + +#ifndef _MUM_UNALIGNED_ACCESS +#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) \ + || defined(__s390__) || defined(__m32c__) || defined(cris) \ + || defined(__CR16__) || defined(__vax__) || defined(__m68k__) \ + || defined(__aarch64__) +#define _MUM_UNALIGNED_ACCESS 1 +#else +#define _MUM_UNALIGNED_ACCESS 0 +#endif +#endif + +/* When we need an aligned access to data being hashed we move part of + the unaligned data to an aligned block of given size and then + process it, repeating processing the data by the block. */ +#ifndef _MUM_BLOCK_LEN +#define _MUM_BLOCK_LEN 1024 +#endif + +#if _MUM_BLOCK_LEN < 8 +#error "too small block length" +#endif + +static inline uint64_t +#if defined(__x86_64__) +_MUM_TARGET("inline-all-stringops") +#endif +_mum_hash_default (const void *key, size_t len, uint64_t seed) { + uint64_t result; + const unsigned char *str = (const unsigned char *) key; + size_t block_len; + uint64_t buf[_MUM_BLOCK_LEN / sizeof (uint64_t)]; + + result = seed + len; + if (_MUM_UNALIGNED_ACCESS || ((size_t) str & 0x7) == 0) + result = _mum_hash_aligned (result, key, len); + else { + while (len != 0) { + block_len = len < _MUM_BLOCK_LEN ? len : _MUM_BLOCK_LEN; + memmove (buf, str, block_len); + result = _mum_hash_aligned (result, buf, block_len); + len -= block_len; + str += block_len; + } + } + return _mum_final (result); +} + +static inline uint64_t +_mum_next_factor (void) { + uint64_t start = 0; + int i; + + for (i = 0; i < 8; i++) + start = (start << 8) | rand() % 256; + return start; +} + +/* ++++++++++++++++++++++++++ Interface functions: +++++++++++++++++++ */ + +/* Set random multiplicators depending on SEED. */ +static inline void +mum_hash_randomize (uint64_t seed) { + int i; + + srand (seed); + _mum_hash_step_prime = _mum_next_factor (); + _mum_key_step_prime = _mum_next_factor (); + _mum_finish_prime1 = _mum_next_factor (); + _mum_finish_prime2 = _mum_next_factor (); + _mum_block_start_prime = _mum_next_factor (); + _mum_unroll_prime = _mum_next_factor (); + _mum_tail_prime = _mum_next_factor (); + for (i = 0; i < (int)(sizeof (_mum_primes) / sizeof (uint64_t)); i++) + _mum_primes[i] = _mum_next_factor (); +} + +/* Start hashing data with SEED. Return the state. */ +static inline uint64_t +mum_hash_init (uint64_t seed) { + return seed; +} + +/* Process data KEY with the state H and return the updated state. */ +static inline uint64_t +mum_hash_step (uint64_t h, uint64_t key) +{ + return _mum (h, _mum_hash_step_prime) ^ _mum (key, _mum_key_step_prime); +} + +/* Return the result of hashing using the current state H. */ +static inline uint64_t +mum_hash_finish (uint64_t h) { + return _mum_final (h); +} + +/* Fast hashing of KEY with SEED. The hash is always the same for the + same key on any target. */ +static inline size_t +mum_hash64 (uint64_t key, uint64_t seed) { + return mum_hash_finish (mum_hash_step (mum_hash_init (seed), key)); +} + +/* Hash data KEY of length LEN and SEED. The hash depends on the - target endianess and the unroll factor. */ ++ target endianness and the unroll factor. */ +static inline uint64_t +mum_hash (const void *key, size_t len, uint64_t seed) { +#if defined(__x86_64__) && defined(_MUM_FRESH_GCC) + static int avx2_support = 0; + + if (avx2_support > 0) + return _mum_hash_avx2 (key, len, seed); + else if (! avx2_support) { + __builtin_cpu_init (); + avx2_support = __builtin_cpu_supports ("avx2") ? 1 : -1; + if (avx2_support > 0) + return _mum_hash_avx2 (key, len, seed); + } +#endif + return _mum_hash_default (key, len, seed); +} + +#endif diff --cc contrib/libucl/tests/basic/squote.in index 000000000000,2ee9d25d8122..2ee9d25d8122 mode 000000,100644..100644 --- a/contrib/libucl/tests/basic/squote.in +++ b/contrib/libucl/tests/basic/squote.in diff --cc contrib/libucl/tests/basic/squote.res index 000000000000,a595269567bd..a595269567bd mode 000000,100644..100644 --- a/contrib/libucl/tests/basic/squote.res +++ b/contrib/libucl/tests/basic/squote.res diff --cc contrib/libucl/tests/fuzzers/ucl_add_string_fuzzer.c index 000000000000,388ce5dffebb..388ce5dffebb mode 000000,100644..100644 --- a/contrib/libucl/tests/fuzzers/ucl_add_string_fuzzer.c +++ b/contrib/libucl/tests/fuzzers/ucl_add_string_fuzzer.c diff --cc contrib/libucl/tests/fuzzers/ucl_msgpack_fuzzer.c index 000000000000,6989ec0e4375..6989ec0e4375 mode 000000,100644..100644 --- a/contrib/libucl/tests/fuzzers/ucl_msgpack_fuzzer.c +++ b/contrib/libucl/tests/fuzzers/ucl_msgpack_fuzzer.c diff --cc contrib/libucl/utils/CMakeLists.txt index 000000000000,4de95fd7b4b0..4de95fd7b4b0 mode 000000,100644..100644 --- a/contrib/libucl/utils/CMakeLists.txt +++ b/contrib/libucl/utils/CMakeLists.txt From owner-dev-commits-src-main@freebsd.org Mon Mar 22 14:35:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFFBA5B10E5; Mon, 22 Mar 2021 14:35: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 4F3xqn4ZRNz3lWL; Mon, 22 Mar 2021 14:35: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 8BB8074AA; Mon, 22 Mar 2021 14:35: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 12MEZXNk071145; Mon, 22 Mar 2021 14:35:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MEZXVl071144; Mon, 22 Mar 2021 14:35:33 GMT (envelope-from git) Date: Mon, 22 Mar 2021 14:35:33 GMT Message-Id: <202103221435.12MEZXVl071144@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: f9a159da2a29 - main - libedit: vendor import snapshot 2020-07-10 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: f9a159da2a292968cd5c37b56a6c43b6af8c5eed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 14:35:33 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f9a159da2a292968cd5c37b56a6c43b6af8c5eed commit f9a159da2a292968cd5c37b56a6c43b6af8c5eed Merge: a0409676120c 881fcf9c3caf Author: Baptiste Daroussin AuthorDate: 2021-03-22 14:34:14 +0000 Commit: Baptiste Daroussin CommitDate: 2021-03-22 14:34:14 +0000 libedit: vendor import snapshot 2020-07-10 contrib/libedit/Makefile | 6 +- contrib/libedit/chartype.h | 2 +- contrib/libedit/common.c | 8 +- contrib/libedit/filecomplete.c | 221 +++++++++++++++++++++-------------------- contrib/libedit/history.c | 14 +-- contrib/libedit/map.c | 10 +- contrib/libedit/readline.c | 18 ++-- contrib/libedit/refresh.c | 5 +- contrib/libedit/search.c | 26 +++-- contrib/libedit/terminal.c | 61 +++++++----- contrib/libedit/tty.c | 7 +- 11 files changed, 196 insertions(+), 182 deletions(-) diff --cc contrib/libedit/Makefile index 8a02211504a8,000000000000..105a6a92e0ee mode 100644,000000..100644 --- a/contrib/libedit/Makefile +++ b/contrib/libedit/Makefile @@@ -1,139 -1,0 +1,143 @@@ - # $NetBSD: Makefile,v 1.65 2017/06/30 20:26:52 kre Exp $ ++# $NetBSD: Makefile,v 1.66 2019/10/13 07:28:10 mrg Exp $ +# @(#)Makefile 8.1 (Berkeley) 6/4/93 + +USE_SHLIBDIR= yes + +WARNS?= 5 +LIB= edit + +LIBDPLIBS+= terminfo ${.CURDIR}/../libterminfo + +.include "bsd.own.mk" + +COPTS+= -Wunused-parameter +CWARNFLAGS.gcc+= -Wconversion +CWARNFLAGS.clang+= -Wno-cast-qual + +SRCS = chared.c chartype.c common.c el.c eln.c emacs.c filecomplete.c \ + hist.c history.c historyn.c keymacro.c literal.c map.c \ + parse.c prompt.c read.c readline.c refresh.c search.c sig.c \ + terminal.c tokenizer.c tokenizern.c tty.c vi.c + +MAN= editline.3 editrc.5 editline.7 + +MLINKS= \ +editline.3 el_deletestr.3 \ +editline.3 el_end.3 \ +editline.3 el_get.3 \ +editline.3 el_getc.3 \ +editline.3 el_gets.3 \ +editline.3 el_init.3 \ +editline.3 el_init_fd.3 \ +editline.3 el_insertstr.3 \ +editline.3 el_line.3 \ +editline.3 el_parse.3 \ +editline.3 el_push.3 \ +editline.3 el_reset.3 \ +editline.3 el_resize.3 \ +editline.3 el_set.3 \ +editline.3 el_source.3 \ +editline.3 history.3 \ +editline.3 history_end.3 \ +editline.3 history_init.3 \ +editline.3 tok_end.3 \ +editline.3 tok_init.3 \ +editline.3 tok_line.3 \ +editline.3 tok_reset.3 \ +editline.3 tok_str.3 + +MLINKS+= \ +editline.3 el_wdeletestr.3 \ +editline.3 el_wget.3 \ +editline.3 el_wgetc.3 \ +editline.3 el_wgets.3 \ +editline.3 el_winsertstr.3 \ +editline.3 el_wline.3 \ +editline.3 el_wparse.3 \ +editline.3 el_wpush.3 \ +editline.3 el_wset.3 \ +editline.3 history_w.3 \ +editline.3 history_wend.3 \ +editline.3 history_winit.3 \ +editline.3 tok_wend.3 \ +editline.3 tok_winit.3 \ +editline.3 tok_wline.3 \ +editline.3 tok_wreset.3 \ +editline.3 tok_wstr.3 + +LIBEDITDIR?=${.CURDIR} + +INCS= histedit.h +INCSDIR=/usr/include + +CLEANFILES+=common.h.tmp emacs.h.tmp fcns.h.tmp func.h.tmp +CLEANFILES+=help.h.tmp vi.h.tmp tc1.o tc1 .depend + +CPPFLAGS+=-I. -I${LIBEDITDIR} +CPPFLAGS+=-I. -I${.CURDIR} +#CPPFLAGS+=-DDEBUG_TTY -DDEBUG_KEY -DDEBUG -DDEBUG_REFRESH +#CPPFLAGS+=-DDEBUG_PASTE -DDEBUG_EDIT + +AHDR=vi.h emacs.h common.h +ASRC=${LIBEDITDIR}/vi.c ${LIBEDITDIR}/emacs.c ${LIBEDITDIR}/common.c + +DPSRCS+= ${AHDR} fcns.h func.h help.h +CLEANFILES+= ${AHDR} fcns.h func.h help.h + +SUBDIR= readline + +.depend: ${AHDR} fcns.h func.h help.h + +vi.h: vi.c makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +emacs.h: emacs.c makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/emacs.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +common.h: common.c makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/common.c \ + > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +fcns.h: ${AHDR} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -fh ${AHDR} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +func.h: ${AHDR} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -fc ${AHDR} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +help.h: ${ASRC} makelist Makefile + ${_MKTARGET_CREATE} + ${HOST_SH} ${LIBEDITDIR}/makelist -bh ${ASRC} > ${.TARGET}.tmp && \ + mv ${.TARGET}.tmp ${.TARGET} + +tc1.o: ${LIBEDITDIR}/TEST/tc1.c + +tc1: libedit.a tc1.o + ${_MKTARGET_LINK} + ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD} -ltermlib + +.include +.include + +# XXX +.if defined(HAVE_GCC) +COPTS.editline.c+= -Wno-cast-qual +COPTS.literal.c+= -Wno-sign-conversion +COPTS.tokenizer.c+= -Wno-cast-qual +COPTS.tokenizern.c+= -Wno-cast-qual +.endif ++ ++COPTS.history.c+= ${GCC_NO_STRINGOP_OVERFLOW} ++COPTS.historyn.c+= ${GCC_NO_STRINGOP_OVERFLOW} ++COPTS.readline.c+= ${GCC_NO_STRINGOP_TRUNCATION} ${GCC_NO_STRINGOP_OVERFLOW} diff --cc contrib/libedit/filecomplete.c index 662a0bb85d0b,000000000000..61579024926c mode 100644,000000..100644 --- a/contrib/libedit/filecomplete.c +++ b/contrib/libedit/filecomplete.c @@@ -1,835 -1,0 +1,840 @@@ - /* $NetBSD: filecomplete.c,v 1.58 2019/09/08 05:50:58 abhinav Exp $ */ ++/* $NetBSD: filecomplete.c,v 1.64 2020/01/05 07:12:05 abhinav Exp $ */ + +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jaromir Dolecek. + * + * 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. + */ + +#include "config.h" +#if !defined(lint) && !defined(SCCSID) - __RCSID("$NetBSD: filecomplete.c,v 1.58 2019/09/08 05:50:58 abhinav Exp $"); ++__RCSID("$NetBSD: filecomplete.c,v 1.64 2020/01/05 07:12:05 abhinav Exp $"); +#endif /* not lint && not SCCSID */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "el.h" +#include "filecomplete.h" + +static const wchar_t break_chars[] = L" \t\n\"\\'`@$><=;|&{("; + +/********************************/ +/* completion functions */ + +/* + * does tilde expansion of strings of type ``~user/foo'' + * if ``user'' isn't valid user name or ``txt'' doesn't start + * w/ '~', returns pointer to strdup()ed copy of ``txt'' + * + * it's the caller's responsibility to free() the returned string + */ +char * +fn_tilde_expand(const char *txt) +{ +#if defined(HAVE_GETPW_R_POSIX) || defined(HAVE_GETPW_R_DRAFT) + struct passwd pwres; + char pwbuf[1024]; +#endif + struct passwd *pass; + char *temp; + size_t len = 0; + + if (txt[0] != '~') + return strdup(txt); + + temp = strchr(txt + 1, '/'); + if (temp == NULL) { + temp = strdup(txt + 1); + if (temp == NULL) + return NULL; + } else { + /* text until string after slash */ + len = (size_t)(temp - txt + 1); + temp = el_calloc(len, sizeof(*temp)); + if (temp == NULL) + return NULL; - (void)strncpy(temp, txt + 1, len - 2); - temp[len - 2] = '\0'; ++ (void)strlcpy(temp, txt + 1, len - 1); + } + if (temp[0] == 0) { +#ifdef HAVE_GETPW_R_POSIX + if (getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf), + &pass) != 0) + pass = NULL; +#elif HAVE_GETPW_R_DRAFT + pass = getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf)); +#else + pass = getpwuid(getuid()); +#endif + } else { +#ifdef HAVE_GETPW_R_POSIX + if (getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf), &pass) != 0) + pass = NULL; +#elif HAVE_GETPW_R_DRAFT + pass = getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf)); +#else + pass = getpwnam(temp); +#endif + } + el_free(temp); /* value no more needed */ + if (pass == NULL) + return strdup(txt); + + /* update pointer txt to point at string immedially following */ + /* first slash */ + txt += len; + + len = strlen(pass->pw_dir) + 1 + strlen(txt) + 1; + temp = el_calloc(len, sizeof(*temp)); + if (temp == NULL) + return NULL; + (void)snprintf(temp, len, "%s/%s", pass->pw_dir, txt); + + return temp; +} + +static int +needs_escaping(char c) +{ + switch (c) { + case '\'': + case '"': + case '(': + case ')': + case '\\': + case '<': + case '>': + case '$': + case '#': + case ' ': + case '\n': + case '\t': + case '?': + case ';': + case '`': + case '@': + case '=': + case '|': + case '{': + case '}': + case '&': + case '*': + case '[': + return 1; + default: + return 0; + } +} + +static int +needs_dquote_escaping(char c) +{ + switch (c) { + case '"': + case '\\': + case '`': + case '$': + return 1; + default: + return 0; + } +} + + +static wchar_t * +unescape_string(const wchar_t *string, size_t length) +{ + size_t i; + size_t j = 0; + wchar_t *unescaped = el_calloc(length + 1, sizeof(*string)); + if (unescaped == NULL) + return NULL; + for (i = 0; i < length ; i++) { + if (string[i] == '\\') + continue; + unescaped[j++] = string[i]; + } + unescaped[j] = 0; + return unescaped; +} + +static char * +escape_filename(EditLine * el, const char *filename, int single_match, + const char *(*app_func)(const char *)) +{ + size_t original_len = 0; + size_t escaped_character_count = 0; + size_t offset = 0; + size_t newlen; + const char *s; + char c; + size_t s_quoted = 0; /* does the input contain a single quote */ + size_t d_quoted = 0; /* does the input contain a double quote */ + char *escaped_str; + wchar_t *temp = el->el_line.buffer; + const char *append_char = NULL; + + if (filename == NULL) + return NULL; + + while (temp != el->el_line.cursor) { + /* + * If we see a single quote but have not seen a double quote + * so far set/unset s_quote + */ + if (temp[0] == '\'' && !d_quoted) + s_quoted = !s_quoted; + /* + * vice versa to the above condition + */ + else if (temp[0] == '"' && !s_quoted) + d_quoted = !d_quoted; + temp++; + } + + /* Count number of special characters so that we can calculate + * number of extra bytes needed in the new string + */ + for (s = filename; *s; s++, original_len++) { + c = *s; + /* Inside a single quote only single quotes need escaping */ + if (s_quoted && c == '\'') { + escaped_character_count += 3; + continue; + } + /* Inside double quotes only ", \, ` and $ need escaping */ + if (d_quoted && needs_dquote_escaping(c)) { + escaped_character_count++; + continue; + } + if (!s_quoted && !d_quoted && needs_escaping(c)) + escaped_character_count++; + } + + newlen = original_len + escaped_character_count + 1; + if (s_quoted || d_quoted) + newlen++; + + if (single_match && app_func) + newlen++; + + if ((escaped_str = el_malloc(newlen)) == NULL) + return NULL; + + for (s = filename; *s; s++) { + c = *s; + if (!needs_escaping(c)) { + /* no escaping is required continue as usual */ + escaped_str[offset++] = c; + continue; + } + + /* single quotes inside single quotes require special handling */ + if (c == '\'' && s_quoted) { + escaped_str[offset++] = '\''; + escaped_str[offset++] = '\\'; + escaped_str[offset++] = '\''; + escaped_str[offset++] = '\''; + continue; + } + + /* Otherwise no escaping needed inside single quotes */ + if (s_quoted) { + escaped_str[offset++] = c; + continue; + } + + /* No escaping needed inside a double quoted string either + * unless we see a '$', '\', '`', or '"' (itself) + */ + if (d_quoted && !needs_dquote_escaping(c)) { + escaped_str[offset++] = c; + continue; + } + + /* If we reach here that means escaping is actually needed */ + escaped_str[offset++] = '\\'; + escaped_str[offset++] = c; + } + + if (single_match && app_func) { + escaped_str[offset] = 0; + append_char = app_func(escaped_str); + /* we want to append space only if we are not inside quotes */ + if (append_char[0] == ' ') { + if (!s_quoted && !d_quoted) + escaped_str[offset++] = append_char[0]; + } else + escaped_str[offset++] = append_char[0]; + } + + /* close the quotes if single match and the match is not a directory */ + if (single_match && (append_char && append_char[0] == ' ')) { + if (s_quoted) + escaped_str[offset++] = '\''; + else if (d_quoted) + escaped_str[offset++] = '"'; + } + + escaped_str[offset] = 0; + return escaped_str; +} + +/* + * return first found file name starting by the ``text'' or NULL if no + * such file can be found + * value of ``state'' is ignored + * + * it's the caller's responsibility to free the returned string + */ +char * +fn_filename_completion_function(const char *text, int state) +{ + static DIR *dir = NULL; + static char *filename = NULL, *dirname = NULL, *dirpath = NULL; + static size_t filename_len = 0; + struct dirent *entry; + char *temp; + size_t len; + + if (state == 0 || dir == NULL) { + temp = strrchr(text, '/'); + if (temp) { + char *nptr; + temp++; + nptr = el_realloc(filename, (strlen(temp) + 1) * + sizeof(*nptr)); + if (nptr == NULL) { + el_free(filename); + filename = NULL; + return NULL; + } + filename = nptr; + (void)strcpy(filename, temp); + len = (size_t)(temp - text); /* including last slash */ + + nptr = el_realloc(dirname, (len + 1) * + sizeof(*nptr)); + if (nptr == NULL) { + el_free(dirname); + dirname = NULL; + return NULL; + } + dirname = nptr; - (void)strncpy(dirname, text, len); - dirname[len] = '\0'; ++ (void)strlcpy(dirname, text, len + 1); + } else { + el_free(filename); + if (*text == 0) + filename = NULL; + else { + filename = strdup(text); + if (filename == NULL) + return NULL; + } + el_free(dirname); + dirname = NULL; + } + + if (dir != NULL) { + (void)closedir(dir); + dir = NULL; + } + + /* support for ``~user'' syntax */ + + el_free(dirpath); + dirpath = NULL; + if (dirname == NULL) { + if ((dirname = strdup("")) == NULL) + return NULL; + dirpath = strdup("./"); + } else if (*dirname == '~') + dirpath = fn_tilde_expand(dirname); + else + dirpath = strdup(dirname); + + if (dirpath == NULL) + return NULL; + + dir = opendir(dirpath); + if (!dir) + return NULL; /* cannot open the directory */ + + /* will be used in cycle */ + filename_len = filename ? strlen(filename) : 0; + } + + /* find the match */ + while ((entry = readdir(dir)) != NULL) { + /* skip . and .. */ + if (entry->d_name[0] == '.' && (!entry->d_name[1] + || (entry->d_name[1] == '.' && !entry->d_name[2]))) + continue; + if (filename_len == 0) + break; + /* otherwise, get first entry where first */ + /* filename_len characters are equal */ + if (entry->d_name[0] == filename[0] +#if HAVE_STRUCT_DIRENT_D_NAMLEN + && entry->d_namlen >= filename_len +#else + && strlen(entry->d_name) >= filename_len +#endif + && strncmp(entry->d_name, filename, + filename_len) == 0) + break; + } + + if (entry) { /* match found */ + +#if HAVE_STRUCT_DIRENT_D_NAMLEN + len = entry->d_namlen; +#else + len = strlen(entry->d_name); +#endif + + len = strlen(dirname) + len + 1; + temp = el_calloc(len, sizeof(*temp)); + if (temp == NULL) + return NULL; + (void)snprintf(temp, len, "%s%s", dirname, entry->d_name); + } else { + (void)closedir(dir); + dir = NULL; + temp = NULL; + } + + return temp; +} + + +static const char * +append_char_function(const char *name) +{ + struct stat stbuf; + char *expname = *name == '~' ? fn_tilde_expand(name) : NULL; + const char *rs = " "; + + if (stat(expname ? expname : name, &stbuf) == -1) + goto out; + if (S_ISDIR(stbuf.st_mode)) + rs = "/"; +out: + if (expname) + el_free(expname); + return rs; +} +/* + * returns list of completions for text given + * non-static for readline. + */ +char ** completion_matches(const char *, char *(*)(const char *, int)); +char ** +completion_matches(const char *text, char *(*genfunc)(const char *, int)) +{ + char **match_list = NULL, *retstr, *prevstr; + size_t match_list_len, max_equal, which, i; + size_t matches; + + matches = 0; + match_list_len = 1; + while ((retstr = (*genfunc) (text, (int)matches)) != NULL) { + /* allow for list terminator here */ + if (matches + 3 >= match_list_len) { + char **nmatch_list; + while (matches + 3 >= match_list_len) + match_list_len <<= 1; + nmatch_list = el_realloc(match_list, + match_list_len * sizeof(*nmatch_list)); + if (nmatch_list == NULL) { + el_free(match_list); + return NULL; + } + match_list = nmatch_list; + + } + match_list[++matches] = retstr; + } + + if (!match_list) + return NULL; /* nothing found */ + + /* find least denominator and insert it to match_list[0] */ + which = 2; + prevstr = match_list[1]; + max_equal = strlen(prevstr); + for (; which <= matches; which++) { + for (i = 0; i < max_equal && + prevstr[i] == match_list[which][i]; i++) + continue; + max_equal = i; + } + + retstr = el_calloc(max_equal + 1, sizeof(*retstr)); + if (retstr == NULL) { + el_free(match_list); + return NULL; + } - (void)strncpy(retstr, match_list[1], max_equal); - retstr[max_equal] = '\0'; ++ (void)strlcpy(retstr, match_list[1], max_equal + 1); + match_list[0] = retstr; + + /* add NULL as last pointer to the array */ + match_list[matches + 1] = NULL; + + return match_list; +} + +/* + * Sort function for qsort(). Just wrapper around strcasecmp(). + */ +static int +_fn_qsort_string_compare(const void *i1, const void *i2) +{ + const char *s1 = ((const char * const *)i1)[0]; + const char *s2 = ((const char * const *)i2)[0]; + + return strcasecmp(s1, s2); +} + +/* + * Display list of strings in columnar format on readline's output stream. + * 'matches' is list of strings, 'num' is number of strings in 'matches', + * 'width' is maximum length of string in 'matches'. + * + * matches[0] is not one of the match strings, but it is counted in + * num, so the strings are matches[1] *through* matches[num-1]. + */ +void +fn_display_match_list(EditLine * el, char **matches, size_t num, size_t width, + const char *(*app_func) (const char *)) +{ + size_t line, lines, col, cols, thisguy; + int screenwidth = el->el_terminal.t_size.h; + if (app_func == NULL) + app_func = append_char_function; + + /* Ignore matches[0]. Avoid 1-based array logic below. */ + matches++; + num--; + + /* + * Find out how many entries can be put on one line; count + * with one space between strings the same way it's printed. + */ + cols = (size_t)screenwidth / (width + 2); + if (cols == 0) + cols = 1; + + /* how many lines of output, rounded up */ + lines = (num + cols - 1) / cols; + + /* Sort the items. */ + qsort(matches, num, sizeof(char *), _fn_qsort_string_compare); + + /* + * On the ith line print elements i, i+lines, i+lines*2, etc. + */ + for (line = 0; line < lines; line++) { + for (col = 0; col < cols; col++) { + thisguy = line + col * lines; + if (thisguy >= num) + break; + (void)fprintf(el->el_outfile, "%s%s%s", + col == 0 ? "" : " ", matches[thisguy], + (*app_func)(matches[thisguy])); + (void)fprintf(el->el_outfile, "%-*s", + (int) (width - strlen(matches[thisguy])), ""); + } + (void)fprintf(el->el_outfile, "\n"); + } +} + +static wchar_t * +find_word_to_complete(const wchar_t * cursor, const wchar_t * buffer, - const wchar_t * word_break, const wchar_t * special_prefixes, size_t * length) ++ const wchar_t * word_break, const wchar_t * special_prefixes, size_t * length, ++ int do_unescape) +{ + /* We now look backwards for the start of a filename/variable word */ + const wchar_t *ctemp = cursor; ++ wchar_t *temp; + size_t len; + + /* if the cursor is placed at a slash or a quote, we need to find the + * word before it + */ + if (ctemp > buffer) { + switch (ctemp[-1]) { + case '\\': + case '\'': + case '"': + ctemp--; + break; + default: + break; + } + } + + for (;;) { + if (ctemp <= buffer) + break; + if (wcschr(word_break, ctemp[-1])) { + if (ctemp - buffer >= 2 && ctemp[-2] == '\\') { + ctemp -= 2; + continue; - } else if (ctemp - buffer >= 2 && - (ctemp[-2] == '\'' || ctemp[-2] == '"')) { - ctemp--; - continue; - } else - break; ++ } ++ break; + } + if (special_prefixes && wcschr(special_prefixes, ctemp[-1])) + break; + ctemp--; + } + + len = (size_t) (cursor - ctemp); + if (len == 1 && (ctemp[0] == '\'' || ctemp[0] == '"')) { + len = 0; + ctemp++; + } + *length = len; - wchar_t *unescaped_word = unescape_string(ctemp, len); - if (unescaped_word == NULL) - return NULL; - return unescaped_word; ++ if (do_unescape) { ++ wchar_t *unescaped_word = unescape_string(ctemp, len); ++ if (unescaped_word == NULL) ++ return NULL; ++ return unescaped_word; ++ } ++ temp = el_malloc((len + 1) * sizeof(*temp)); ++ (void) wcsncpy(temp, ctemp, len); ++ temp[len] = '\0'; ++ return temp; +} + +/* + * Complete the word at or before point, + * 'what_to_do' says what to do with the completion. + * \t means do standard completion. + * `?' means list the possible completions. + * `*' means insert all of the possible completions. + * `!' means to do standard completion, and list all possible completions if + * there is more than one. + * + * Note: '*' support is not implemented + * '!' could never be invoked + */ +int +fn_complete(EditLine *el, + char *(*complet_func)(const char *, int), + char **(*attempted_completion_function)(const char *, int, int), + const wchar_t *word_break, const wchar_t *special_prefixes, + const char *(*app_func)(const char *), size_t query_items, + int *completion_type, int *over, int *point, int *end) +{ + const LineInfoW *li; + wchar_t *temp; + char **matches; + char *completion; + size_t len; + int what_to_do = '\t'; + int retval = CC_NORM; ++ int do_unescape = attempted_completion_function == NULL? 1: 0; + + if (el->el_state.lastcmd == el->el_state.thiscmd) + what_to_do = '?'; + + /* readline's rl_complete() has to be told what we did... */ + if (completion_type != NULL) + *completion_type = what_to_do; + + if (!complet_func) + complet_func = fn_filename_completion_function; + if (!app_func) + app_func = append_char_function; + + li = el_wline(el); + temp = find_word_to_complete(li->cursor, - li->buffer, word_break, special_prefixes, &len); ++ li->buffer, word_break, special_prefixes, &len, do_unescape); + if (temp == NULL) + goto out; + + /* these can be used by function called in completion_matches() */ + /* or (*attempted_completion_function)() */ + if (point != NULL) + *point = (int)(li->cursor - li->buffer); + if (end != NULL) + *end = (int)(li->lastchar - li->buffer); + + if (attempted_completion_function) { + int cur_off = (int)(li->cursor - li->buffer); + matches = (*attempted_completion_function)( + ct_encode_string(temp, &el->el_scratch), + cur_off - (int)len, cur_off); + } else + matches = NULL; + if (!attempted_completion_function || + (over != NULL && !*over && !matches)) + matches = completion_matches( + ct_encode_string(temp, &el->el_scratch), complet_func); + + if (over != NULL) + *over = 0; + - if (matches) { - int i; - size_t matches_num, maxlen, match_len, match_display=1; - int single_match = matches[2] == NULL && - (matches[1] == NULL || strcmp(matches[0], matches[1]) == 0); - - retval = CC_REFRESH; - - if (matches[0][0] != '\0') { - el_deletestr(el, (int)len); - if (!attempted_completion_function) - completion = escape_filename(el, matches[0], - single_match, app_func); - else - completion = strdup(matches[0]); - if (completion == NULL) - goto out; - if (single_match) { - /* We found exact match. Add a space after it, - * unless we do filename completion and the - * object is a directory. Also do necessary - * escape quoting - */ - el_winsertstr(el, - ct_decode_string(completion, &el->el_scratch)); - } else { - /* Only replace the completed string with - * common part of possible matches if there is - * possible completion. - */ - el_winsertstr(el, - ct_decode_string(completion, &el->el_scratch)); - } - free(completion); - } ++ if (matches == NULL) { ++ goto out; ++ } ++ int i; ++ size_t matches_num, maxlen, match_len, match_display=1; ++ int single_match = matches[2] == NULL && ++ (matches[1] == NULL || strcmp(matches[0], matches[1]) == 0); ++ ++ retval = CC_REFRESH; ++ ++ if (matches[0][0] != '\0') { ++ el_deletestr(el, (int)len); ++ if (!attempted_completion_function) ++ completion = escape_filename(el, matches[0], ++ single_match, app_func); ++ else ++ completion = strdup(matches[0]); ++ if (completion == NULL) ++ goto out; + ++ /* ++ * Replace the completed string with the common part of ++ * all possible matches if there is a possible completion. ++ */ ++ el_winsertstr(el, ++ ct_decode_string(completion, &el->el_scratch)); + - if (!single_match && (what_to_do == '!' || what_to_do == '?')) { ++ if (single_match && attempted_completion_function) { + /* - * More than one match and requested to list possible - * matches. ++ * We found an exact match. Add a space after ++ * it, unless we do filename completion and the ++ * object is a directory. Also do necessary ++ * escape quoting + */ ++ el_winsertstr(el, ct_decode_string( ++ (*app_func)(completion), &el->el_scratch)); ++ } *** 143 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Mon Mar 22 14:37:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FBBC5B0F5B; Mon, 22 Mar 2021 14:37:30 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3xt22Bypz3lgP; Mon, 22 Mar 2021 14:37:30 +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 38259A540; Mon, 22 Mar 2021 14:37:30 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f177.google.com with SMTP id g20so10716572qkk.1; Mon, 22 Mar 2021 07:37:30 -0700 (PDT) X-Gm-Message-State: AOAM531UZQszFi5zOeD1wxMKYddiwuTBVBjx9bEzwzi3C+h3/NWSu0rn KUvA3hmbTesg4UZnHF7vH3G8YjzcUKN9ZvucWAM= X-Google-Smtp-Source: ABdhPJw0+ihjKZhX/4uS2JKnB9rsIyE4/Pi7LnI/8Y2kt/7RONJDYTYuSX0NucLI9EnJB2hNZ1IiiVJE161dR3ho2YI= X-Received: by 2002:a37:de14:: with SMTP id h20mr372270qkj.34.1616423849681; Mon, 22 Mar 2021 07:37:29 -0700 (PDT) MIME-Version: 1.0 References: <202103221200.12MC0Rja055125@gitrepo.freebsd.org> In-Reply-To: <202103221200.12MC0Rja055125@gitrepo.freebsd.org> From: Kyle Evans Date: Mon, 22 Mar 2021 09:37:17 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 87d65c747a43 - main - lib/msun: Allow building tests with WARNS=6 To: Alex Richardson Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 14:37:30 -0000 On Mon, Mar 22, 2021 at 7:01 AM Alex Richardson wrote: > > The branch main has been updated by arichardson: > > URL: https://cgit.FreeBSD.org/src/commit/?id=87d65c747a4389901c2bbbcb1ec4878b2df7b32c > > commit 87d65c747a4389901c2bbbcb1ec4878b2df7b32c > Author: Alex Richardson > AuthorDate: 2021-02-25 14:28:17 +0000 > Commit: Alex Richardson > CommitDate: 2021-03-22 11:55:07 +0000 > > lib/msun: Allow building tests with WARNS=6 > > The only change needed is to mark a few variables as static. > --- > contrib/netbsd-tests/lib/libm/t_ldexp.c | 19 +++++++++---------- > contrib/netbsd-tests/lib/libm/t_precision.c | 4 ++-- > contrib/netbsd-tests/lib/libm/t_round.c | 2 +- > contrib/netbsd-tests/lib/libm/t_scalbn.c | 2 +- > lib/msun/tests/Makefile | 2 +- > 5 files changed, 14 insertions(+), 15 deletions(-) > > [... snip ...] > diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile > index 309f49c6dddd..4ef25c0a909a 100644 > --- a/lib/msun/tests/Makefile > +++ b/lib/msun/tests/Makefile > @@ -88,7 +88,7 @@ SRCS.ilogb2_test= ilogb_test.c > > LIBADD+= m > > -WARNS?= 1 > +WARNS?= 6 > > # Copied from lib/msun/Makefile > .if ${MACHINE_CPUARCH} == "i386" Hi, IMO, we should go ahead and drop this WARNS entirely now that it's the default -- I changed it a while back so that all depths of userland should get a natural WARNS=6 if it's undefined. Thanks, Kyle Evans From owner-dev-commits-src-main@freebsd.org Mon Mar 22 14:38:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E63A95B121C; Mon, 22 Mar 2021 14:38:02 +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 4F3xtf67sKz3lb9; Mon, 22 Mar 2021 14:38:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 C51FCAD84; Mon, 22 Mar 2021 14:38:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f47.google.com with SMTP id 30so8698566qva.9; Mon, 22 Mar 2021 07:38:02 -0700 (PDT) X-Gm-Message-State: AOAM5315WRvAy8feB4pT/eNzNO6jdFlEdfZ77RfOeyMqR/ORDnNnUytT j/HF19YAkoepcwaASSnk4YSskdIWab77JdJnX9E= X-Google-Smtp-Source: ABdhPJwg2bW80UxZKwG/EvlT8Scyg2Jli+JIFNVeyArz5o6//+UyCZE7rlsMqxtJj3EJSEp7aTAT2iYG+NUDVqu3cuM= X-Received: by 2002:a05:6214:1424:: with SMTP id o4mr16457qvx.34.1616423882301; Mon, 22 Mar 2021 07:38:02 -0700 (PDT) MIME-Version: 1.0 References: <202103200142.12K1gHmv016001@gitrepo.freebsd.org> In-Reply-To: <202103200142.12K1gHmv016001@gitrepo.freebsd.org> From: Kyle Evans Date: Mon, 22 Mar 2021 09:37:49 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 9c5aac8f2e84 - main - fusefs: fix a dead store in fuse_vnop_advlock To: Alan Somers Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 14:38:03 -0000 On Fri, Mar 19, 2021 at 8:42 PM Alan Somers wrote: > > The branch main has been updated by asomers: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9c5aac8f2e84ca4bbdf82514302c08c0453ec59b > > commit 9c5aac8f2e84ca4bbdf82514302c08c0453ec59b > Author: Alan Somers > AuthorDate: 2021-03-20 01:38:57 +0000 > Commit: Alan Somers > CommitDate: 2021-03-20 01:38:57 +0000 > > fusefs: fix a dead store in fuse_vnop_advlock > > kevans actually caught this in the original review and I fixed it, but > then I committed an older copy of the branch. Whoops. > Thanks! From owner-dev-commits-src-main@freebsd.org Mon Mar 22 14:47:14 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C0C45B153A; Mon, 22 Mar 2021 14:47:14 +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 4F3y5G1xbmz3mRW; Mon, 22 Mar 2021 14:47:14 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f48.google.com with SMTP id b7so21747748ejv.1; Mon, 22 Mar 2021 07:47:14 -0700 (PDT) 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=9LWRKdkKR4H6O/bmr/3BsNlhXh8kHW23A8aLYeiIloI=; b=bY7xgKd6u7/6L/FWJL1PRzWBZFIiHtQGuRnqONURAc9bNCCJALucy7zIctRdxNAme/ yy8NXryZacn6ecdPWHCAjgtSJ4pCNDkEjRBbDaUf2gZlZ8nHbPLQgsjcvUsPE+y7Nlj4 9cQt+pMh4sXsbAyOOTXbOSPPIrNypQUV55YyShcSw9PbijT1ZawsotSDiObv4h9ndftH dL91cROl4ZrMtUMF7ia2JTIDzp4W9gPqWTN+tDP2LRkyCKG7fx3Eg+enaeBtowwSGtai bclvqsoQn6T29zJDmrB2ZukeCCvBdKq8M/CRU98ceQDNH0LbiN0Te69qhj50doXHhhvF 0QPw== X-Gm-Message-State: AOAM533SejFzmOD1KVfN/GFHn6nf74fgFyrBpp5FC4MgaOB/4If5jQ4J wv8CITEFapWXJ4qK4hQMlo5FFaAu9ho= X-Google-Smtp-Source: ABdhPJwctdCAcBQGB7gT1rNjSCR124u+NQSnKgWleyDA2xY47fwoQN+xdApmz5oePYk1XiznBwOvMw== X-Received: by 2002:a17:907:3e92:: with SMTP id hs18mr113095ejc.396.1616424432731; Mon, 22 Mar 2021 07:47:12 -0700 (PDT) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com. [209.85.221.42]) by smtp.gmail.com with ESMTPSA id ym4sm1989230ejb.100.2021.03.22.07.47.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Mar 2021 07:47:12 -0700 (PDT) Received: by mail-wr1-f42.google.com with SMTP id j7so17321021wrd.1; Mon, 22 Mar 2021 07:47:12 -0700 (PDT) X-Received: by 2002:a5d:4281:: with SMTP id k1mr18460993wrq.374.1616424432273; Mon, 22 Mar 2021 07:47:12 -0700 (PDT) MIME-Version: 1.0 References: <202103221200.12MC0Rja055125@gitrepo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Mon, 22 Mar 2021 14:47:01 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 87d65c747a43 - main - lib/msun: Allow building tests with WARNS=6 To: Kyle Evans Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4F3y5G1xbmz3mRW 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-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 14:47:14 -0000 On Mon, 22 Mar 2021 at 14:37, Kyle Evans wrote: > > On Mon, Mar 22, 2021 at 7:01 AM Alex Richardson wrote: > > > > The branch main has been updated by arichardson: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=87d65c747a4389901c2bbbcb1ec4878b2df7b32c > > > > commit 87d65c747a4389901c2bbbcb1ec4878b2df7b32c > > Author: Alex Richardson > > AuthorDate: 2021-02-25 14:28:17 +0000 > > Commit: Alex Richardson > > CommitDate: 2021-03-22 11:55:07 +0000 > > > > lib/msun: Allow building tests with WARNS=6 > > > > The only change needed is to mark a few variables as static. > > --- > > contrib/netbsd-tests/lib/libm/t_ldexp.c | 19 +++++++++---------- > > contrib/netbsd-tests/lib/libm/t_precision.c | 4 ++-- > > contrib/netbsd-tests/lib/libm/t_round.c | 2 +- > > contrib/netbsd-tests/lib/libm/t_scalbn.c | 2 +- > > lib/msun/tests/Makefile | 2 +- > > 5 files changed, 14 insertions(+), 15 deletions(-) > > > > [... snip ...] > > diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile > > index 309f49c6dddd..4ef25c0a909a 100644 > > --- a/lib/msun/tests/Makefile > > +++ b/lib/msun/tests/Makefile > > @@ -88,7 +88,7 @@ SRCS.ilogb2_test= ilogb_test.c > > > > LIBADD+= m > > > > -WARNS?= 1 > > +WARNS?= 6 > > > > # Copied from lib/msun/Makefile > > .if ${MACHINE_CPUARCH} == "i386" > > Hi, > > IMO, we should go ahead and drop this WARNS entirely now that it's the > default -- I changed it a while back so that all depths of userland > should get a natural WARNS=6 if it's undefined. > > Thanks, > > Kyle Evans Hi Kyle, I forgot that it's the default now. Will commit a change shortly to remove it. Alex From owner-dev-commits-src-main@freebsd.org Mon Mar 22 15:03:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1DB55B1B0C; Mon, 22 Mar 2021 15:03: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 4F3yRj4gGNz3nHt; Mon, 22 Mar 2021 15:03: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 92E397C5D; Mon, 22 Mar 2021 15:03: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 12MF3D9q013438; Mon, 22 Mar 2021 15:03:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MF3DAB013437; Mon, 22 Mar 2021 15:03:13 GMT (envelope-from git) Date: Mon, 22 Mar 2021 15:03:13 GMT Message-Id: <202103221503.12MF3DAB013437@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: 40f41ece765d - main - tcp: improve handling of SYN segments in SYN-SENT state 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: 40f41ece765dc0b0907ca90796a1af4f4f89b2a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 15:03:13 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=40f41ece765dc0b0907ca90796a1af4f4f89b2a0 commit 40f41ece765dc0b0907ca90796a1af4f4f89b2a0 Author: Michael Tuexen AuthorDate: 2021-03-22 14:58:49 +0000 Commit: Michael Tuexen CommitDate: 2021-03-22 14:58:49 +0000 tcp: improve handling of SYN segments in SYN-SENT state Ensure that the stack does not generate a DSACK block for user data received on a SYN segment in SYN-SENT state. Reviewed by: rscheff MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29376 Sponsored by: Netflix, Inc. --- sys/netinet/tcp_input.c | 4 +++- sys/netinet/tcp_stacks/bbr.c | 4 +++- sys/netinet/tcp_stacks/rack.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7dfe1dbd4e4f..bdc0e872c36e 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3179,7 +3179,9 @@ dodata: /* XXX */ thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { + if ((tp->t_flags & TF_SACK_PERMIT) && + (save_tlen > 0) && + TCPS_HAVEESTABLISHED(tp->t_state)) { if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { /* * DSACK actually handled in the fastpath diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index f9535935a9db..673dee911c87 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -8371,7 +8371,9 @@ bbr_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { + if ((tp->t_flags & TF_SACK_PERMIT) && + (save_tlen > 0) && + TCPS_HAVEESTABLISHED(tp->t_state)) { if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { /* * DSACK actually handled in the fastpath diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 5bea540c6ab6..beae1bf9cba7 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -8683,7 +8683,9 @@ rack_process_data(struct mbuf *m, struct tcphdr *th, struct socket *so, thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { + if ((tp->t_flags & TF_SACK_PERMIT) && + (save_tlen > 0) && + TCPS_HAVEESTABLISHED(tp->t_state)) { if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { /* * DSACK actually handled in the fastpath From owner-dev-commits-src-main@freebsd.org Mon Mar 22 15:21:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 145665B23B1; Mon, 22 Mar 2021 15:21:04 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3yrH47FXz3q1L; Mon, 22 Mar 2021 15:21:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.66.148.124]) by shaw.ca with ESMTPA id OMMVlxWUHeHr9OMMWlHj12; Mon, 22 Mar 2021 09:21:01 -0600 X-Authority-Analysis: v=2.4 cv=Yq/K+6UX c=1 sm=1 tr=0 ts=6058b5dd a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=dESyimp9J3IA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=Iw09oBtGyujXmLUXvDoA:9 a=CjuIK1q_8ugA: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 29519136; Mon, 22 Mar 2021 08:20:57 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 12MFKvNg004480; Mon, 22 Mar 2021 08:20:57 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202103221520.12MFKvNg004480@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: Baptiste Daroussin cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a0409676120c - main - libucl: vendor import snapshort 20210314 In-reply-to: <202103221416.12MEG3w9043302@gitrepo.freebsd.org> References: <202103221416.12MEG3w9043302@gitrepo.freebsd.org> Comments: In-reply-to Baptiste Daroussin message dated "Mon, 22 Mar 2021 14:16:03 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 22 Mar 2021 08:20:57 -0700 X-CMAE-Envelope: MS4xfFKz1PDml0sbWv30AVEGisDnip75Dg9gX2+apB/VL29F1eaqN9hEng4TzV49j7K74JUIVEVrV+dexDSee672PYbeD67gdvihmA2qYAN8z/hJ1wvG9Wpp DTN4upSDJoh/gXUw8h3B2tfGPigWtN9WcpmSc0Wu3RxYYxsWIv0TLh6HIviAiyEcaN87JJ7r9VXImThYBtsPk1qQrDx1ztk0ht36rhlsV0TzWddqHxJXv2+h FUkU0M7I/vPUgezOghsczPWylZi0a/SjxeSQnLjXErRUz2XYbLc+XEYUeb8gGNuDnWyKZnMK9S2d/bP3OtUWim4xZH1LFh/LRjezc0PIQAw= X-Rspamd-Queue-Id: 4F3yrH47FXz3q1L 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-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 15:21:04 -0000 In message <202103221416.12MEG3w9043302@gitrepo.freebsd.org>, Baptiste Daroussi n writes: > The branch main has been updated by bapt: > > URL: https://cgit.FreeBSD.org/src/commit/?id=a0409676120c1e558d0ade943019934e > 0f15118d > > commit a0409676120c1e558d0ade943019934e0f15118d > Merge: 64a790d26480 3c319408d0de > Author: Baptiste Daroussin > AuthorDate: 2021-03-22 14:13:02 +0000 > Commit: Baptiste Daroussin > CommitDate: 2021-03-22 14:13:02 +0000 > > libucl: vendor import snapshort 20210314 > > contrib/libucl/CMakeLists.txt | 105 ++- > contrib/libucl/ChangeLog.md | 38 +- > contrib/libucl/README.md | 64 +- > contrib/libucl/configure.ac | 8 +- > contrib/libucl/doc/api.md | 17 +- > contrib/libucl/doc/libucl.3 | 26 +- > contrib/libucl/doc/lua_api.md | 4 +- > contrib/libucl/include/lua_ucl.h | 20 +- > contrib/libucl/include/ucl++.h | 191 ++++- > contrib/libucl/include/ucl.h | 191 ++++- > contrib/libucl/klib/kvec.h | 78 ++- > contrib/libucl/lua/lua_ucl.c | 450 ++++++++++-- > contrib/libucl/python/MANIFEST.in | 5 + > contrib/libucl/python/setup.py | 42 +- > contrib/libucl/python/src/uclmodule.c | 3 +- > contrib/libucl/python/tests/test_example.py | 59 ++ > contrib/libucl/python/tests/test_load.py | 17 +- > contrib/libucl/src/mum.h | 8 +- > contrib/libucl/src/ucl_chartable.h | 4 +- > contrib/libucl/src/ucl_emitter.c | 12 +- > contrib/libucl/src/ucl_emitter_utils.c | 57 +- > contrib/libucl/src/ucl_hash.c | 218 +++++- > contrib/libucl/src/ucl_hash.h | 20 +- > contrib/libucl/src/ucl_internal.h | 105 ++- > contrib/libucl/src/ucl_msgpack.c | 82 ++- > contrib/libucl/src/ucl_parser.c | 552 ++++++++++++--- > contrib/libucl/src/ucl_schema.c | 29 +- > contrib/libucl/src/ucl_util.c | 780 ++++++++++++++++--- > -- > contrib/libucl/tests/basic.test | 2 +- > contrib/libucl/tests/basic/13.in | 2 +- > contrib/libucl/tests/basic/20.in | 2 - > contrib/libucl/tests/basic/20.res | 5 - > contrib/libucl/tests/basic/21.in | 2 - > contrib/libucl/tests/basic/21.res | 10 - > contrib/libucl/tests/basic/9.in | 2 +- > contrib/libucl/tests/basic/9.res | 8 +- > contrib/libucl/tests/basic/squote.in | 8 + > contrib/libucl/tests/basic/squote.res | 7 + > .../libucl/tests/fuzzers/ucl_add_string_fuzzer.c | 25 + > contrib/libucl/tests/fuzzers/ucl_msgpack_fuzzer.c | 29 + > contrib/libucl/tests/generate.test | 2 +- > contrib/libucl/tests/run_tests.sh | 4 +- > contrib/libucl/tests/streamline.test | 2 +- > contrib/libucl/tests/test_basic.c | 11 +- > contrib/libucl/tests/test_generate.c | 15 +- > contrib/libucl/tests/test_msgpack.c | 1 + > contrib/libucl/utils/CMakeLists.txt | 12 + > contrib/libucl/utils/objdump.c | 17 +- > contrib/libucl/utils/ucl-tool.c | 100 +-- > 49 files changed, 2820 insertions(+), 631 deletions(-) This broke buildworld. --- ucl_msgpack.po --- /opt/src/git-src/contrib/libucl/src/ucl_msgpack.c:1250:6: error: format specifie s type 'size_t' (aka 'unsigned int') but the argument has type 'uintmax_t' (aka 'unsigned long long') [-Werror,-Wformat] (uintmax_t)len); ^~~~~~~~~~~~~~ 1 error generated. *** [ucl_msgpack.po] Error code 1 make[5]: stopped in /opt/src/git-src/lib/libucl make[3]: stopped in /opt/src/git-src -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-main@freebsd.org Mon Mar 22 15:42:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 199A75B2D50; Mon, 22 Mar 2021 15:42: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 4F3zKG0ClNz3rFj; Mon, 22 Mar 2021 15:42: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 EE6D1107C6; Mon, 22 Mar 2021 15:42: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 12MFgfPC068573; Mon, 22 Mar 2021 15:42:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MFgfwi068572; Mon, 22 Mar 2021 15:42:41 GMT (envelope-from git) Date: Mon, 22 Mar 2021 15:42:41 GMT Message-Id: <202103221542.12MFgfwi068572@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: 048488c0c4e4 - main - Fix build post a0409676120c1e558d0ade943019934e0f15118d. 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: 048488c0c4e47aa2aac9709b18d7da14b06f78cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 15:42:42 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=048488c0c4e47aa2aac9709b18d7da14b06f78cd commit 048488c0c4e47aa2aac9709b18d7da14b06f78cd Author: Cy Schubert AuthorDate: 2021-03-22 15:42:18 +0000 Commit: Cy Schubert CommitDate: 2021-03-22 15:42:18 +0000 Fix build post a0409676120c1e558d0ade943019934e0f15118d. --- contrib/libucl/src/ucl_msgpack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/libucl/src/ucl_msgpack.c b/contrib/libucl/src/ucl_msgpack.c index 3335e39cd9e7..08e690a4728a 100644 --- a/contrib/libucl/src/ucl_msgpack.c +++ b/contrib/libucl/src/ucl_msgpack.c @@ -1247,7 +1247,7 @@ ucl_msgpack_consume (struct ucl_parser *parser) if (len != 0) { ucl_create_err (&parser->err, "invalid non-empty container at the end; len=%zu", - (uintmax_t)len); + (size_t)len); return false; } From owner-dev-commits-src-main@freebsd.org Mon Mar 22 15:44:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A5025B310B; Mon, 22 Mar 2021 15:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F3zMD19xlz3rbC; Mon, 22 Mar 2021 15:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B5B410641; Mon, 22 Mar 2021 15:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MFiOTg068967; Mon, 22 Mar 2021 15:44:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MFiOXI068966; Mon, 22 Mar 2021 15:44:24 GMT (envelope-from git) Date: Mon, 22 Mar 2021 15:44:24 GMT Message-Id: <202103221544.12MFiOXI068966@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: d995cc7e5431 - main - sctp: fix handling of RTO.initial of 1 ms 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: d995cc7e5431873b839269fe22577acfa3b157bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 15:44:24 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d995cc7e5431873b839269fe22577acfa3b157bd commit d995cc7e5431873b839269fe22577acfa3b157bd Author: Michael Tuexen AuthorDate: 2021-03-22 15:40:41 +0000 Commit: Michael Tuexen CommitDate: 2021-03-22 15:44:18 +0000 sctp: fix handling of RTO.initial of 1 ms MFC after: 3 days Reported by: syzbot+5eb0e009147050056ce9@syzkaller.appspotmail.com --- sys/netinet/sctputil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 7ddb4c3710df..5d4b3347a2c9 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2277,7 +2277,9 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, } rndval = sctp_select_initial_TSN(&inp->sctp_ep); jitter = rndval % to_ticks; - to_ticks >>= 1; + if (to_ticks > 1) { + to_ticks >>= 1; + } if (jitter < (UINT32_MAX - to_ticks)) { to_ticks += jitter; } else { From owner-dev-commits-src-main@freebsd.org Mon Mar 22 16:56:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A25945B5196; Mon, 22 Mar 2021 16:56: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 4F40yF4DQhz4RYr; Mon, 22 Mar 2021 16:56: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 83A2011557; Mon, 22 Mar 2021 16:56: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 12MGuLI5067689; Mon, 22 Mar 2021 16:56:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MGuLuN067688; Mon, 22 Mar 2021 16:56:21 GMT (envelope-from git) Date: Mon, 22 Mar 2021 16:56:21 GMT Message-Id: <202103221656.12MGuLuN067688@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: 71ba16a0a02f - main - xnb: Don't pass SIOC{ADD, DEL}MULTI to ifmedia_ioctl(). 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: 71ba16a0a02f4a3fd56d03e908615a8b5f701ba4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 16:56:21 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=71ba16a0a02f4a3fd56d03e908615a8b5f701ba4 commit 71ba16a0a02f4a3fd56d03e908615a8b5f701ba4 Author: John Baldwin AuthorDate: 2021-03-22 16:55:49 +0000 Commit: John Baldwin CommitDate: 2021-03-22 16:55:49 +0000 xnb: Don't pass SIOC{ADD,DEL}MULTI to ifmedia_ioctl(). ifmedia_ioctl() doesn't handle these requests, and this matches what xn does. Reviewed by: royger MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D29296 --- sys/dev/xen/netback/netback.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/xen/netback/netback.c b/sys/dev/xen/netback/netback.c index 44159f60d996..8710120ecef3 100644 --- a/sys/dev/xen/netback/netback.c +++ b/sys/dev/xen/netback/netback.c @@ -2296,6 +2296,7 @@ xnb_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCADDMULTI: case SIOCDELMULTI: + break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &xnb->sc_media, cmd); From owner-dev-commits-src-main@freebsd.org Mon Mar 22 16:58:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 289C75B5306; Mon, 22 Mar 2021 16:58: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 4F41090dnHz4RZc; Mon, 22 Mar 2021 16:58: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 08F07117A1; Mon, 22 Mar 2021 16:58: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 12MGw0HO068056; Mon, 22 Mar 2021 16:58:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MGw0Td068055; Mon, 22 Mar 2021 16:58:00 GMT (envelope-from git) Date: Mon, 22 Mar 2021 16:58:00 GMT Message-Id: <202103221658.12MGw0Td068055@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: ce88eb476b86 - main - Fix lib/msun/tests/csqrt_test on platforms with 128-bit long double 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: ce88eb476b86cac63cef7466bd71f14b611ab03a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 16:58:01 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=ce88eb476b86cac63cef7466bd71f14b611ab03a commit ce88eb476b86cac63cef7466bd71f14b611ab03a Author: Alex Richardson AuthorDate: 2021-03-22 16:54:02 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 16:57:43 +0000 Fix lib/msun/tests/csqrt_test on platforms with 128-bit long double If long double has more than 64 mantissa bits, using uint64_t to hold the mantissa bits will truncate the value and result in test failures. To fix this problem use __uint128_t since all platforms that have __LDBL_MANT_DIG__ > 64 also have compiler support for 128-bit integers. Reviewed By: rlibby Differential Revision: https://reviews.freebsd.org/D29076 --- lib/msun/tests/csqrt_test.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/msun/tests/csqrt_test.c b/lib/msun/tests/csqrt_test.c index a46d0ddd45c5..895aec481b60 100644 --- a/lib/msun/tests/csqrt_test.c +++ b/lib/msun/tests/csqrt_test.c @@ -257,17 +257,24 @@ test_precision(int maxexp, int mantdig) { long double b, x; long double complex result; - uint64_t mantbits, sq_mantbits; +#if LDBL_MANT_DIG <= 64 + typedef uint64_t ldbl_mant_type; +#elif LDBL_MANT_DIG <= 128 + typedef __uint128_t ldbl_mant_type; +#else +#error "Unsupported long double format" +#endif + ldbl_mant_type mantbits, sq_mantbits; int exp, i; - ATF_CHECK(maxexp > 0 && maxexp % 2 == 0); - ATF_CHECK(mantdig <= 64); + ATF_REQUIRE(maxexp > 0 && maxexp % 2 == 0); + ATF_REQUIRE(mantdig <= LDBL_MANT_DIG); mantdig = rounddown(mantdig, 2); for (exp = 0; exp <= maxexp; exp += 2) { - mantbits = ((uint64_t)1 << (mantdig / 2 )) - 1; - for (i = 0; - i < 100 && mantbits > ((uint64_t)1 << (mantdig / 2 - 1)); + mantbits = ((ldbl_mant_type)1 << (mantdig / 2)) - 1; + for (i = 0; i < 100 && + mantbits > ((ldbl_mant_type)1 << (mantdig / 2 - 1)); i++, mantbits--) { sq_mantbits = mantbits * mantbits; /* @@ -283,10 +290,10 @@ test_precision(int maxexp, int mantdig) b = ldexpl((long double)sq_mantbits, exp - 1 - mantdig); x = ldexpl(mantbits, (exp - 2 - mantdig) / 2); - ATF_CHECK_EQ(b, x * x * 2); + CHECK_FPEQUAL(b, x * x * 2); result = t_csqrt(CMPLXL(0, b)); - ATF_CHECK_EQ(x, creall(result)); - ATF_CHECK_EQ(x, cimagl(result)); + CHECK_FPEQUAL(x, creall(result)); + CHECK_FPEQUAL(x, cimagl(result)); } } } @@ -345,6 +352,7 @@ ATF_TC_BODY(csqrtl, tc) test_overflow(LDBL_MAX_EXP); + /* i386 is configured to use 53-bit rounding precision for long double. */ test_precision(LDBL_MAX_EXP, #ifndef __i386__ LDBL_MANT_DIG From owner-dev-commits-src-main@freebsd.org Mon Mar 22 16:58:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CED85B5039; Mon, 22 Mar 2021 16:58: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 4F410B1p7qz4RZl; Mon, 22 Mar 2021 16:58: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 2FBEE117A2; Mon, 22 Mar 2021 16:58: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 12MGw2N2068079; Mon, 22 Mar 2021 16:58:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MGw2VB068078; Mon, 22 Mar 2021 16:58:02 GMT (envelope-from git) Date: Mon, 22 Mar 2021 16:58:02 GMT Message-Id: <202103221658.12MGw2VB068078@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: dbb2d6f5e123 - main - lib/msun/tests: Re-enable csqrt_test on AArch64 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: dbb2d6f5e1231a9f6b49efdc720ce97b520da2ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 16:58:02 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=dbb2d6f5e1231a9f6b49efdc720ce97b520da2ba commit dbb2d6f5e1231a9f6b49efdc720ce97b520da2ba Author: Alex Richardson AuthorDate: 2021-03-22 16:54:38 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 16:57:43 +0000 lib/msun/tests: Re-enable csqrt_test on AArch64 The LLVM bug was fixed a long time ago and with D29076 this test actually passes now. Reviewed By: andrew Differential Revision: https://reviews.freebsd.org/D29092 --- lib/msun/tests/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 7da1944c8ed8..793d2e29639c 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -54,11 +54,7 @@ NETBSD_ATF_TESTS_C+= tanh_test ATF_TESTS_C+= cexp_test ATF_TESTS_C+= conj_test -.if ${MACHINE_CPUARCH} != "aarch64" -# Hits an assert in llvm when building for arm64: -# https://llvm.org/bugs/show_bug.cgi?id=26081 ATF_TESTS_C+= csqrt_test -.endif ATF_TESTS_C+= ctrig_test ATF_TESTS_C+= exponential_test ATF_TESTS_C+= fenv_test From owner-dev-commits-src-main@freebsd.org Mon Mar 22 16:58:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 689BB5B5290; Mon, 22 Mar 2021 16:58: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 4F410C2RPYz4RmF; Mon, 22 Mar 2021 16:58: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 43A72117A3; Mon, 22 Mar 2021 16:58: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 12MGw3eX068101; Mon, 22 Mar 2021 16:58:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MGw3bL068100; Mon, 22 Mar 2021 16:58:03 GMT (envelope-from git) Date: Mon, 22 Mar 2021 16:58:03 GMT Message-Id: <202103221658.12MGw3bL068100@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: f33b4fa2f0d4 - main - lib/msun/tests: Drop WARNS=6 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: f33b4fa2f0d4acf3978c7490b25c999b319c543b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 16:58:03 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=f33b4fa2f0d4acf3978c7490b25c999b319c543b commit f33b4fa2f0d4acf3978c7490b25c999b319c543b Author: Alex Richardson AuthorDate: 2021-03-22 16:56:10 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 16:57:43 +0000 lib/msun/tests: Drop WARNS=6 This is the default already, so there is no need to override it. Reported by: kevans --- lib/msun/tests/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 793d2e29639c..70f7d2fe5135 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -85,8 +85,6 @@ SRCS.ilogb2_test= ilogb_test.c LIBADD.fenv_test+= util LIBADD+= m -WARNS?= 6 - # Copied from lib/msun/Makefile .if ${MACHINE_CPUARCH} == "i386" ARCH_SUBDIR= i387 From owner-dev-commits-src-main@freebsd.org Mon Mar 22 17:05:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 706305B586D; Mon, 22 Mar 2021 17:05: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 4F418W2pwRz4T4N; Mon, 22 Mar 2021 17:05: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 4F3EE11946; Mon, 22 Mar 2021 17:05: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 12MH5FuT082516; Mon, 22 Mar 2021 17:05:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MH5Fd8082515; Mon, 22 Mar 2021 17:05:15 GMT (envelope-from git) Date: Mon, 22 Mar 2021 17:05:15 GMT Message-Id: <202103221705.12MH5Fd8082515@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: 52c11c3f744c - main - cxgbei: Set vnet around tcp_drop() in do_rx_iscsi_ddp(). 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: 52c11c3f744c8a68fb71a1343e8ffb4a9f70072a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 17:05:15 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=52c11c3f744c8a68fb71a1343e8ffb4a9f70072a commit 52c11c3f744c8a68fb71a1343e8ffb4a9f70072a Author: John Baldwin AuthorDate: 2021-03-22 16:58:28 +0000 Commit: John Baldwin CommitDate: 2021-03-22 17:05:02 +0000 cxgbei: Set vnet around tcp_drop() in do_rx_iscsi_ddp(). Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29298 --- sys/dev/cxgbe/cxgbei/cxgbei.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index bf5bb7b9ad62..fb5843b0b51a 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -412,12 +412,14 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) SOCKBUF_UNLOCK(sb); INP_WUNLOCK(inp); + CURVNET_SET(so->so_vnet); NET_EPOCH_ENTER(et); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); icl_cxgbei_conn_pdu_free(NULL, ip); #ifdef INVARIANTS From owner-dev-commits-src-main@freebsd.org Mon Mar 22 17:05:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9100F5B575A; Mon, 22 Mar 2021 17:05: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 4F418X3N4Cz4Syc; Mon, 22 Mar 2021 17:05: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 6745411B05; Mon, 22 Mar 2021 17:05: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 12MH5G4K082538; Mon, 22 Mar 2021 17:05:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MH5G2U082537; Mon, 22 Mar 2021 17:05:16 GMT (envelope-from git) Date: Mon, 22 Mar 2021 17:05:16 GMT Message-Id: <202103221705.12MH5G2U082537@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: 45eed2331e8f - main - cxgbei: Move some function prototypes to cxgbei.h. 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: 45eed2331e8f796a6c315374d85a9485a29e2536 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 17:05:16 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=45eed2331e8f796a6c315374d85a9485a29e2536 commit 45eed2331e8f796a6c315374d85a9485a29e2536 Author: John Baldwin AuthorDate: 2021-03-22 16:58:54 +0000 Commit: John Baldwin CommitDate: 2021-03-22 17:05:02 +0000 cxgbei: Move some function prototypes to cxgbei.h. Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29299 --- sys/dev/cxgbe/cxgbei/cxgbei.c | 5 ----- sys/dev/cxgbe/cxgbei/cxgbei.h | 4 ++++ sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 4 ---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c index fb5843b0b51a..4acdc726e75c 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c @@ -96,11 +96,6 @@ static int worker_thread_count; static struct cxgbei_worker_thread_softc *cwt_softc; static struct proc *cxgbei_proc; -/* XXXNP some header instead. */ -struct icl_pdu *icl_cxgbei_new_pdu(int); -void icl_cxgbei_new_pdu_set_conn(struct icl_pdu *, struct icl_conn *); -void icl_cxgbei_conn_pdu_free(struct icl_conn *, struct icl_pdu *); - static void free_ci_counters(struct cxgbei_data *ci) { diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.h b/sys/dev/cxgbe/cxgbei/cxgbei.h index 798a1cf49665..b0369b974136 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.h +++ b/sys/dev/cxgbe/cxgbei/cxgbei.h @@ -127,4 +127,8 @@ u_int cxgbei_select_worker_thread(struct icl_cxgbei_conn *); /* icl_cxgbei.c */ int icl_cxgbei_mod_load(void); int icl_cxgbei_mod_unload(void); +struct icl_pdu *icl_cxgbei_new_pdu(int); +void icl_cxgbei_new_pdu_set_conn(struct icl_pdu *, struct icl_conn *); +void icl_cxgbei_conn_pdu_free(struct icl_conn *, struct icl_pdu *); + #endif diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 5588d3cb9511..6b25568e112b 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -124,11 +124,7 @@ static volatile u_int icl_cxgbei_ncons; #define ICL_CONN_LOCK_ASSERT(X) mtx_assert(X->ic_lock, MA_OWNED) #define ICL_CONN_LOCK_ASSERT_NOT(X) mtx_assert(X->ic_lock, MA_NOTOWNED) -struct icl_pdu *icl_cxgbei_new_pdu(int); -void icl_cxgbei_new_pdu_set_conn(struct icl_pdu *, struct icl_conn *); - static icl_conn_new_pdu_t icl_cxgbei_conn_new_pdu; -icl_conn_pdu_free_t icl_cxgbei_conn_pdu_free; static icl_conn_pdu_data_segment_length_t icl_cxgbei_conn_pdu_data_segment_length; static icl_conn_pdu_append_data_t icl_cxgbei_conn_pdu_append_data; From owner-dev-commits-src-main@freebsd.org Mon Mar 22 17:05:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0079D5B58CC; Mon, 22 Mar 2021 17:05: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 4F418Y5PxRz4T4V; Mon, 22 Mar 2021 17:05: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 8D68611947; Mon, 22 Mar 2021 17:05: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 12MH5H4Q082557; Mon, 22 Mar 2021 17:05:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MH5HYl082556; Mon, 22 Mar 2021 17:05:17 GMT (envelope-from git) Date: Mon, 22 Mar 2021 17:05:17 GMT Message-Id: <202103221705.12MH5HYl082556@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: 8855ed61b5b7 - main - cxgbei: Pass ULP submode directly to set_ulp_mode_iscsi(). 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: 8855ed61b5b7de94744fc415e5f049fee342d6b5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 17:05:18 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8855ed61b5b7de94744fc415e5f049fee342d6b5 commit 8855ed61b5b7de94744fc415e5f049fee342d6b5 Author: John Baldwin AuthorDate: 2021-03-22 16:59:02 +0000 Commit: John Baldwin CommitDate: 2021-03-22 17:05:02 +0000 cxgbei: Pass ULP submode directly to set_ulp_mode_iscsi(). Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29300 --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 6b25568e112b..72626e60b58e 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -575,18 +575,14 @@ send_iscsi_flowc_wr(struct adapter *sc, struct toepcb *toep, int maxlen) } static void -set_ulp_mode_iscsi(struct adapter *sc, struct toepcb *toep, int hcrc, int dcrc) +set_ulp_mode_iscsi(struct adapter *sc, struct toepcb *toep, u_int ulp_submode) { - uint64_t val = ULP_MODE_ISCSI; + uint64_t val; - if (hcrc) - val |= ULP_CRC_HEADER << 4; - if (dcrc) - val |= ULP_CRC_DATA << 4; - - CTR4(KTR_CXGBE, "%s: tid %u, ULP_MODE_ISCSI, CRC hdr=%d data=%d", - __func__, toep->tid, hcrc, dcrc); + CTR3(KTR_CXGBE, "%s: tid %u, ULP_MODE_ISCSI, submode=%#x", + __func__, toep->tid, ulp_submode); + val = V_TCB_ULP_TYPE(ULP_MODE_ISCSI) | V_TCB_ULP_RAW(ulp_submode); t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_ULP_TYPE, V_TCB_ULP_TYPE(M_TCB_ULP_TYPE) | V_TCB_ULP_RAW(M_TCB_ULP_RAW), val, 0, 0); @@ -698,8 +694,7 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) toep->ulpcb = icc; send_iscsi_flowc_wr(icc->sc, toep, ci->max_tx_pdu_len); - set_ulp_mode_iscsi(icc->sc, toep, ic->ic_header_crc32c, - ic->ic_data_crc32c); + set_ulp_mode_iscsi(icc->sc, toep, icc->ulp_submode); error = 0; } INP_WUNLOCK(inp); From owner-dev-commits-src-main@freebsd.org Mon Mar 22 17:05:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B86585B575C; Mon, 22 Mar 2021 17:05: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 4F418c5pg7z4SvB; Mon, 22 Mar 2021 17: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 0330D11826; Mon, 22 Mar 2021 17:05: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 12MH5Jix082603; Mon, 22 Mar 2021 17:05:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MH5J9i082602; Mon, 22 Mar 2021 17:05:19 GMT (envelope-from git) Date: Mon, 22 Mar 2021 17:05:19 GMT Message-Id: <202103221705.12MH5J9i082602@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: 90c74b2b6004 - main - cxgbei: Enter network epoch and set vnet around t4_push_pdus(). 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: 90c74b2b6004bc50f89378ac689fd179aa2d2ad6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 17:05:25 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=90c74b2b6004bc50f89378ac689fd179aa2d2ad6 commit 90c74b2b6004bc50f89378ac689fd179aa2d2ad6 Author: John Baldwin AuthorDate: 2021-03-22 16:59:16 +0000 Commit: John Baldwin CommitDate: 2021-03-22 17:05:02 +0000 cxgbei: Enter network epoch and set vnet around t4_push_pdus(). Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29302 --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 72626e60b58e..6292dfc8dc75 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -369,6 +369,7 @@ icl_cxgbei_conn_pdu_get_data(struct icl_conn *ic, struct icl_pdu *ip, void icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) { + struct epoch_tracker et; struct icl_cxgbei_conn *icc = ic_to_icc(ic); struct icl_cxgbei_pdu *icp = ip_to_icp(ip); struct socket *so = ic->ic_socket; @@ -397,6 +398,8 @@ icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) * already. */ inp = sotoinpcb(so); + CURVNET_SET(toep->vnet); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); if (__predict_false(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) || __predict_false((toep->flags & TPF_ATTACHED) == 0)) @@ -406,6 +409,8 @@ icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip) t4_push_pdus(icc->sc, toep, 0); } INP_WUNLOCK(inp); + NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); } static struct icl_conn * From owner-dev-commits-src-main@freebsd.org Mon Mar 22 17:05:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 051295B56FB; Mon, 22 Mar 2021 17: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 4F418b25fWz4Sv1; Mon, 22 Mar 2021 17:05: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 B9CE411371; Mon, 22 Mar 2021 17:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MH5ID8082579; Mon, 22 Mar 2021 17:05:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MH5INP082578; Mon, 22 Mar 2021 17:05:18 GMT (envelope-from git) Date: Mon, 22 Mar 2021 17:05:18 GMT Message-Id: <202103221705.12MH5INP082578@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: 017902fc5f07 - main - cxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED. 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: 017902fc5f07114e7baba94bb4720c8b41ddea0f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 17:05:31 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=017902fc5f07114e7baba94bb4720c8b41ddea0f commit 017902fc5f07114e7baba94bb4720c8b41ddea0f Author: John Baldwin AuthorDate: 2021-03-22 16:59:09 +0000 Commit: John Baldwin CommitDate: 2021-03-22 17:05:02 +0000 cxgbe ddp: Use CPL_COOKIE_DDP* instead of DDP_BUF*_INVALIDATED. This avoids mixing the use of two different enums which modern C compilers warn about. Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29301 --- sys/dev/cxgbe/tom/t4_ddp.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index a901efc11894..b0d53dd63997 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -609,12 +609,7 @@ handle_ddp_indicate(struct toepcb *toep) ddp_queue_toep(toep); } -enum { - DDP_BUF0_INVALIDATED = 0x2, - DDP_BUF1_INVALIDATED -}; - -CTASSERT(DDP_BUF0_INVALIDATED == CPL_COOKIE_DDP0); +CTASSERT(CPL_COOKIE_DDP0 + 1 == CPL_COOKIE_DDP1); static int do_ddp_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) @@ -635,12 +630,12 @@ do_ddp_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) toep = lookup_tid(sc, tid); inp = toep->inp; switch (cpl->cookie) { - case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(DDP_BUF0_INVALIDATED): - case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(DDP_BUF1_INVALIDATED): + case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(CPL_COOKIE_DDP0): + case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(CPL_COOKIE_DDP1): /* * XXX: This duplicates a lot of code with handle_ddp_data(). */ - db_idx = G_COOKIE(cpl->cookie) - DDP_BUF0_INVALIDATED; + db_idx = G_COOKIE(cpl->cookie) - CPL_COOKIE_DDP0; MPASS(db_idx < nitems(toep->ddp.db)); INP_WLOCK(inp); DDP_LOCK(toep); @@ -1845,7 +1840,7 @@ t4_aio_cancel_active(struct kaiocb *job) V_TF_DDP_BUF1_VALID(1); t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_RX_DDP_FLAGS, valid_flag, 0, 1, - i + DDP_BUF0_INVALIDATED); + CPL_COOKIE_DDP0 + i); toep->ddp.db[i].cancel_pending = 1; CTR2(KTR_CXGBE, "%s: request %p marked pending", __func__, job); From owner-dev-commits-src-main@freebsd.org Mon Mar 22 17:06:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC4565B59E2; Mon, 22 Mar 2021 17:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F41BH4wWNz4TVC; Mon, 22 Mar 2021 17:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BF0B11A0C; Mon, 22 Mar 2021 17:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12MH6lhE083028; Mon, 22 Mar 2021 17:06:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MH6lnE083027; Mon, 22 Mar 2021 17:06:47 GMT (envelope-from git) Date: Mon, 22 Mar 2021 17:06:47 GMT Message-Id: <202103221706.12MH6lnE083027@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: 54399caa2f84 - main - Correct "Fondation" typo (missing "u") 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: 54399caa2f8470d9f7c404ce419362bc62d5a094 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 17:06:47 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=54399caa2f8470d9f7c404ce419362bc62d5a094 commit 54399caa2f8470d9f7c404ce419362bc62d5a094 Author: Ed Maste AuthorDate: 2021-03-22 17:06:03 +0000 Commit: Ed Maste CommitDate: 2021-03-22 17:06:31 +0000 Correct "Fondation" typo (missing "u") --- sys/amd64/vmm/amd/amdiommu.c | 2 +- sys/amd64/vmm/amd/ivhd_if.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/vmm/amd/amdiommu.c b/sys/amd64/vmm/amd/amdiommu.c index 4ded23dff003..26c4b10d7807 100644 --- a/sys/amd64/vmm/amd/amdiommu.c +++ b/sys/amd64/vmm/amd/amdiommu.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2021 The FreeBSD Fondation + * Copyright (c) 2021 The FreeBSD Foundation * * Portions of this software were developed by Ka Ho Ng * under sponsorship from the FreeBSD Foundation. diff --git a/sys/amd64/vmm/amd/ivhd_if.m b/sys/amd64/vmm/amd/ivhd_if.m index eaae01ae0131..f2994243c91e 100644 --- a/sys/amd64/vmm/amd/ivhd_if.m +++ b/sys/amd64/vmm/amd/ivhd_if.m @@ -1,5 +1,5 @@ #- -# Copyright (c) 2021 The FreeBSD Fondation +# Copyright (c) 2021 The FreeBSD Foundation # # Portions of this software were developed by Ka Ho Ng # under sponsorship from the FreeBSD Foundation. From owner-dev-commits-src-main@freebsd.org Mon Mar 22 17:49:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDA955B6EF9; Mon, 22 Mar 2021 17:49: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 4F427X6Rnkz4XSn; Mon, 22 Mar 2021 17:49: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 D06E71213F; Mon, 22 Mar 2021 17:49: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 12MHnSqx039593; Mon, 22 Mar 2021 17:49:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MHnSUE039592; Mon, 22 Mar 2021 17:49:28 GMT (envelope-from git) Date: Mon, 22 Mar 2021 17:49:28 GMT Message-Id: <202103221749.12MHnSUE039592@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: 15211f195092 - main - Silence unused parameter warnings in the RISC-V fenv.h 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: 15211f19509282d9c9a418d4e5b6ac75d9d1fc85 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 17:49:29 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=15211f19509282d9c9a418d4e5b6ac75d9d1fc85 commit 15211f19509282d9c9a418d4e5b6ac75d9d1fc85 Author: Alex Richardson AuthorDate: 2021-03-22 17:47:50 +0000 Commit: Alex Richardson CommitDate: 2021-03-22 17:49:24 +0000 Silence unused parameter warnings in the RISC-V fenv.h After increasing the lib/msun/tests WARNS to 6, this triggers a compilation error for RISC-V. Fixes: 87d65c747a43 ("lib/msun: Allow building tests with WARNS=6") Reported by: Jenkins --- lib/msun/riscv/fenv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/msun/riscv/fenv.h b/lib/msun/riscv/fenv.h index f9d840d156fa..6c8c2861bc97 100644 --- a/lib/msun/riscv/fenv.h +++ b/lib/msun/riscv/fenv.h @@ -186,7 +186,7 @@ fegetenv(fenv_t *__envp) } __fenv_static inline int -feholdexcept(fenv_t *__envp) +feholdexcept(fenv_t *__envp __unused) { /* No exception traps. */ @@ -226,7 +226,7 @@ int fedisableexcept(int __mask); int fegetexcept(void); #else static inline int -feenableexcept(int __mask) +feenableexcept(int __mask __unused) { /* No exception traps. */ @@ -235,7 +235,7 @@ feenableexcept(int __mask) } static inline int -fedisableexcept(int __mask) +fedisableexcept(int __mask __unused) { /* No exception traps. */ From owner-dev-commits-src-main@freebsd.org Mon Mar 22 18:35:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 654605B8336; Mon, 22 Mar 2021 18:35: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 4F43992Ry8z4bFK; Mon, 22 Mar 2021 18:35: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 46F4612B4C; Mon, 22 Mar 2021 18:35: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 12MIZvcO008994; Mon, 22 Mar 2021 18:35:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MIZvdJ008993; Mon, 22 Mar 2021 18:35:57 GMT (envelope-from git) Date: Mon, 22 Mar 2021 18:35:57 GMT Message-Id: <202103221835.12MIZvdJ008993@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: 453d8a7ee2fc - main - rsu: add KASSERT to document maximum mbuf size in rsu_tx_start MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 453d8a7ee2fc862f3a5e98185d57c8ad05cbc047 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 18:35:57 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=453d8a7ee2fc862f3a5e98185d57c8ad05cbc047 commit 453d8a7ee2fc862f3a5e98185d57c8ad05cbc047 Author: Ed Maste AuthorDate: 2021-03-22 18:34:31 +0000 Commit: Ed Maste CommitDate: 2021-03-22 18:34:44 +0000 rsu: add KASSERT to document maximum mbuf size in rsu_tx_start PR: 254479 Reviewed by: markj Sponsored by: The FreeBSD Foundation --- sys/dev/usb/wlan/if_rsu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c index f2dc6657026e..4dd1c624b9d0 100644 --- a/sys/dev/usb/wlan/if_rsu.c +++ b/sys/dev/usb/wlan/if_rsu.c @@ -2897,6 +2897,7 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_node *ni, } xferlen = sizeof(*txd) + m0->m_pkthdr.len; + KASSERT(xferlen <= RSU_TXBUFSZ, ("%s: invalid length", __func__)); m_copydata(m0, 0, m0->m_pkthdr.len, (caddr_t)&txd[1]); data->buflen = xferlen; From owner-dev-commits-src-main@freebsd.org Mon Mar 22 19:07:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A19805B8D3C; Mon, 22 Mar 2021 19:07: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 4F43sR48qKz4dTn; Mon, 22 Mar 2021 19:07: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 8176B12FE0; Mon, 22 Mar 2021 19:07: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 12MJ7NrU051688; Mon, 22 Mar 2021 19:07:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MJ7NJq051686; Mon, 22 Mar 2021 19:07:23 GMT (envelope-from git) Date: Mon, 22 Mar 2021 19:07:23 GMT Message-Id: <202103221907.12MJ7NJq051686@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: 0cff00ae682a - main - retire obsolete mn(4) sync serial driver 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: 0cff00ae682a032dec29494f88c76d78a08edfa1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 19:07:23 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0cff00ae682a032dec29494f88c76d78a08edfa1 commit 0cff00ae682a032dec29494f88c76d78a08edfa1 Author: Ed Maste AuthorDate: 2021-03-22 19:06:51 +0000 Commit: Ed Maste CommitDate: 2021-03-22 19:06:51 +0000 retire obsolete mn(4) sync serial driver Approved by: phk Relnotes: yes --- ObsoleteFiles.inc | 4 + share/man/man4/Makefile | 2 - share/man/man4/mn.4 | 61 -- sys/conf/NOTES | 2 - sys/conf/files | 1 - sys/dev/mn/if_mn.c | 1431 ----------------------------------------------- 6 files changed, 4 insertions(+), 1497 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 2132dc4289b4..f4c6909cc10a 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20210322: retire mn(4) sync serial driver +OLD_FILES+=usr/share/man/man4/if_mn.4.gz +OLD_FILES+=usr/share/man/man4/mn.4.gz + # 20210318: remove the terminfo database OLD_FILES+=usr/share/terminfo/1/1178 OLD_FILES+=usr/share/terminfo/1/1730-lm diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index c29bb80c7a58..f5a8f98b5bab 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -307,7 +307,6 @@ MAN= aac.4 \ mly.4 \ mmc.4 \ mmcsd.4 \ - mn.4 \ mod_cc.4 \ mos.4 \ mouse.4 \ @@ -710,7 +709,6 @@ MLINKS+=mem.4 kmem.4 MLINKS+=mfi.4 mfi_linux.4 \ mfi.4 mfip.4 MLINKS+=mlx5en.4 mce.4 -MLINKS+=mn.4 if_mn.4 MLINKS+=mos.4 if_mos.4 MLINKS+=msk.4 if_msk.4 MLINKS+=mwl.4 if_mwl.4 diff --git a/share/man/man4/mn.4 b/share/man/man4/mn.4 deleted file mode 100644 index f034a1b10d45..000000000000 --- a/share/man/man4/mn.4 +++ /dev/null @@ -1,61 +0,0 @@ -.\" Copyright (c) 2005 Christian Brueffer -.\" 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 AUTHORS AND ITS 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 THE 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 December 6, 2020 -.Dt MN 4 -.Os -.Sh NAME -.Nm mn -.Nd "Siemens Easy321-R1 E1/T1 device driver" -.Sh SYNOPSIS -.Cd "device mn" -.Cd "options NETGRAPH" -.Sh DEPRECATION NOTICE -The -.Nm -driver is not present in -.Fx 13.0 -and later. -.Sh HARDWARE -The -.Nm -driver provides support for the Siemens Easy321-R1 E1/T1 reference -design card. -.Sh SEE ALSO -.Xr netgraph 4 , -.Xr netintro 4 , -.Xr pci 4 , -.Xr ifconfig 8 -.Sh HISTORY -The -.Nm -driver first appeared in -.Fx 4.0 . -.Sh AUTHORS -The -.Nm -driver was written by -.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org . diff --git a/sys/conf/NOTES b/sys/conf/NOTES index f73b5a466366..0d9a64a88b0f 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -824,8 +824,6 @@ options NGATM_SSCFU options NGATM_UNI options NGATM_CCATM -device mn # Munich32x/Falc54 Nx64kbit/sec cards. - # Network stack virtualization. options VIMAGE options VNET_DEBUG # debug for VIMAGE diff --git a/sys/conf/files b/sys/conf/files index ea2bd6db4ab0..c3f36ca07022 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2475,7 +2475,6 @@ dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd !mmccam dev/mmc/mmc_fdt_helpers.c optional mmc fdt | mmccam fdt dev/mmcnull/mmcnull.c optional mmcnull -dev/mn/if_mn.c optional mn pci dev/mpr/mpr.c optional mpr dev/mpr/mpr_config.c optional mpr # XXX Work around clang warning, until maintainer approves fix. diff --git a/sys/dev/mn/if_mn.c b/sys/dev/mn/if_mn.c deleted file mode 100644 index bb329b24c24e..000000000000 --- a/sys/dev/mn/if_mn.c +++ /dev/null @@ -1,1431 +0,0 @@ -/*- - * SPDX-License-Identifier: Beerware - * - * ---------------------------------------------------------------------------- - * "THE BEER-WARE LICENSE" (Revision 42): - * wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - * ---------------------------------------------------------------------------- - */ - -/* - * Driver for Siemens reference design card "Easy321-R1". - * - * This card contains a FALC54 E1/T1 framer and a MUNICH32X 32-channel HDLC - * controller. - * - * The driver supports E1 mode with up to 31 channels. We send CRC4 but don't - * check it coming in. - * - * The FALC54 and MUNICH32X have far too many registers and weird modes for - * comfort, so I have not bothered typing it all into a "fooreg.h" file, - * you will (badly!) need the documentation anyway if you want to mess with - * this gadget. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * Stuff to describe the MUNIC32X and FALC54 chips. - */ - -#define M32_CHAN 32 /* We have 32 channels */ -#define M32_TS 32 /* We have 32 timeslots */ - -#define NG_MN_NODE_TYPE "mn" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "pci_if.h" - -#include -#include - -#include - -#include -#include - -#include -#include - - -static int mn_maxlatency = 1000; -SYSCTL_INT(_debug, OID_AUTO, mn_maxlatency, CTLFLAG_RW, - &mn_maxlatency, 0, - "The number of milliseconds a packet is allowed to spend in the output queue. " - "If the output queue is longer than this number of milliseconds when the packet " - "arrives for output, the packet will be dropped." -); - -#ifndef NMN -/* Most machines don't support more than 4 busmaster PCI slots, if even that many */ -#define NMN 4 -#endif - -/* From: PEB 20321 data sheet, p187, table 22 */ -struct m32xreg { - u_int32_t conf, cmd, stat, imask; - u_int32_t fill10, piqba, piql, fill1c; - u_int32_t mode1, mode2, ccba, txpoll; - u_int32_t tiqba, tiql, riqba, riql; - u_int32_t lconf, lccba, fill48, ltran; - u_int32_t ltiqba, ltiql, lriqba, lriql; - u_int32_t lreg0, lreg1, lreg2, lreg3; - u_int32_t lreg4, lreg5, lre6, lstat; - u_int32_t gpdir, gpdata, gpod, fill8c; - u_int32_t ssccon, sscbr, ssctb, sscrb; - u_int32_t ssccse, sscim, fillab, fillac; - u_int32_t iomcon1, iomcon2, iomstat, fillbc; - u_int32_t iomcit0, iomcit1, iomcir0, iomcir1; - u_int32_t iomtmo, iomrmo, filld8, filldc; - u_int32_t mbcmd, mbdata1, mbdata2, mbdata3; - u_int32_t mbdata4, mbdata5, mbdata6, mbdata7; -}; - -/* From: PEB 2254 data sheet, p80, table 10 */ -struct f54wreg { - u_int16_t xfifo; - u_int8_t cmdr, mode, rah1, rah2, ral1, ral2; - u_int8_t ipc, ccr1, ccr3, pre, rtr1, rtr2, rtr3, rtr4; - u_int8_t ttr1, ttr2, ttr3, ttr4, imr0, imr1, imr2, imr3; - u_int8_t imr4, fill19, fmr0, fmr1, fmr2, loop, xsw, xsp; - u_int8_t xc0, xc1, rc0, rc1, xpm0, xpm1, xpm2, tswm; - u_int8_t test1, idle, xsa4, xsa5, xsa6, xsa7, xsa8, fmr3; - u_int8_t icb1, icb2, icb3, icb4, lim0, lim1, pcd, pcr; - u_int8_t lim2, fill39[7]; - u_int8_t fill40[8]; - u_int8_t fill48[8]; - u_int8_t fill50[8]; - u_int8_t fill58[8]; - u_int8_t dec, fill61, test2, fill63[5]; - u_int8_t fill68[8]; - u_int8_t xs[16]; -}; - -/* From: PEB 2254 data sheet, p117, table 10 */ -struct f54rreg { - u_int16_t rfifo; - u_int8_t fill2, mode, rah1, rah2, ral1, ral2; - u_int8_t ipc, ccr1, ccr3, pre, rtr1, rtr2, rtr3, rtr4; - u_int8_t ttr1, ttr2, ttr3, ttr4, imr0, imr1, imr2, imr3; - u_int8_t imr4, fill19, fmr0, fmr1, fmr2, loop, xsw, xsp; - u_int8_t xc0, xc1, rc0, rc1, xpm0, xpm1, xpm2, tswm; - u_int8_t test, idle, xsa4, xsa5, xsa6, xsa7, xsa8, fmr13; - u_int8_t icb1, icb2, icb3, icb4, lim0, lim1, pcd, pcr; - u_int8_t lim2, fill39[7]; - u_int8_t fill40[8]; - u_int8_t fill48[4], frs0, frs1, rsw, rsp; - u_int16_t fec, cvc, cec1, ebc; - u_int16_t cec2, cec3; - u_int8_t rsa4, rsa5, rsa6, rsa7; - u_int8_t rsa8, rsa6s, tsr0, tsr1, sis, rsis; - u_int16_t rbc; - u_int8_t isr0, isr1, isr2, isr3, fill6c, fill6d, gis, vstr; - u_int8_t rs[16]; -}; - -/* Transmit & receive descriptors */ -struct trxd { - u_int32_t flags; - vm_offset_t next; - vm_offset_t data; - u_int32_t status; /* only used for receive */ - struct mbuf *m; /* software use only */ - struct trxd *vnext; /* software use only */ -}; - -/* Channel specification */ -struct cspec { - u_int32_t flags; - vm_offset_t rdesc; - vm_offset_t tdesc; - u_int32_t itbs; -}; - -struct m32_mem { - vm_offset_t csa; - u_int32_t ccb; - u_int32_t reserve1[2]; - u_int32_t ts[M32_TS]; - struct cspec cs[M32_CHAN]; - vm_offset_t crxd[M32_CHAN]; - vm_offset_t ctxd[M32_CHAN]; -}; - -struct mn_softc; -struct sockaddr; - -static int mn_probe(device_t self); -static int mn_attach(device_t self); -static void mn_create_channel(struct mn_softc *sc, int chan); -static int mn_reset(struct mn_softc *sc); -static struct trxd * mn_alloc_desc(void); -static void mn_free_desc(struct trxd *dp); -static void mn_intr(void *xsc); -static u_int32_t mn_parse_ts(const char *s, int *nbit); -#ifdef notyet -static void m32_dump(struct mn_softc *sc); -static void f54_dump(struct mn_softc *sc); -static void mn_fmt_ts(char *p, u_int32_t ts); -#endif /* notyet */ -static void f54_init(struct mn_softc *sc); - -static ng_constructor_t ngmn_constructor; -static ng_rcvmsg_t ngmn_rcvmsg; -static ng_shutdown_t ngmn_shutdown; -static ng_newhook_t ngmn_newhook; -static ng_connect_t ngmn_connect; -static ng_rcvdata_t ngmn_rcvdata; -static ng_disconnect_t ngmn_disconnect; - -static struct ng_type mntypestruct = { - .version = NG_ABI_VERSION, - .name = NG_MN_NODE_TYPE, - .constructor = ngmn_constructor, - .rcvmsg = ngmn_rcvmsg, - .shutdown = ngmn_shutdown, - .newhook = ngmn_newhook, - .connect = ngmn_connect, - .rcvdata = ngmn_rcvdata, - .disconnect = ngmn_disconnect, -}; - -static MALLOC_DEFINE(M_MN, "mn", "Mx driver related"); - -#define NIQB 64 - -struct schan { - enum {DOWN, UP} state; - struct mn_softc *sc; - int chan; - u_int32_t ts; - char name[8]; - struct trxd *r1, *rl; - struct trxd *x1, *xl; - hook_p hook; - - time_t last_recv; - time_t last_rxerr; - time_t last_xmit; - - u_long rx_error; - - u_long short_error; - u_long crc_error; - u_long dribble_error; - u_long long_error; - u_long abort_error; - u_long overflow_error; - - int last_error; - int prev_error; - - u_long tx_pending; - u_long tx_limit; -}; - -enum framing {WHOKNOWS, E1, E1U, T1, T1U}; - -struct mn_softc { - int unit; - device_t dev; - struct resource *irq; - void *intrhand; - enum framing framing; - int nhooks; - void *m0v, *m1v; - vm_offset_t m0p, m1p; - struct m32xreg *m32x; - struct f54wreg *f54w; - struct f54rreg *f54r; - struct m32_mem m32_mem; - u_int32_t tiqb[NIQB]; - u_int32_t riqb[NIQB]; - u_int32_t piqb[NIQB]; - u_int32_t ltiqb[NIQB]; - u_int32_t lriqb[NIQB]; - char name[8]; - u_int32_t falc_irq, falc_state, framer_state; - struct schan *ch[M32_CHAN]; - char nodename[NG_NODESIZ]; - node_p node; - - u_long cnt_fec; - u_long cnt_cvc; - u_long cnt_cec1; - u_long cnt_ebc; - u_long cnt_cec2; - u_long cnt_cec3; - u_long cnt_rbc; -}; - -static int -ngmn_constructor(node_p node) -{ - - return (EINVAL); -} - -static int -ngmn_shutdown(node_p nodep) -{ - - return (EINVAL); -} - -static void -ngmn_config(node_p node, char *set, char *ret) -{ - struct mn_softc *sc; - enum framing wframing; - - sc = NG_NODE_PRIVATE(node); - - if (set != NULL) { - if (!strncmp(set, "line ", 5)) { - wframing = sc->framing; - if (!strcmp(set, "line e1")) { - wframing = E1; - } else if (!strcmp(set, "line e1u")) { - wframing = E1U; - } else { - strcat(ret, "ENOGROK\n"); - return; - } - if (wframing == sc->framing) - return; - if (sc->nhooks > 0) { - sprintf(ret, "Cannot change line when %d hooks open\n", sc->nhooks); - return; - } - sc->framing = wframing; -#if 1 - f54_init(sc); -#else - mn_reset(sc); -#endif - } else { - printf("%s CONFIG SET [%s]\n", sc->nodename, set); - strcat(ret, "ENOGROK\n"); - return; - } - } - -} - -static int -ngmn_rcvmsg(node_p node, item_p item, hook_p lasthook) -{ - struct mn_softc *sc; - struct ng_mesg *resp = NULL; - struct schan *sch; - char *s, *r; - int pos, i; - struct ng_mesg *msg; - - NGI_GET_MSG(item, msg); - sc = NG_NODE_PRIVATE(node); - - if (msg->header.typecookie != NGM_GENERIC_COOKIE) { - NG_FREE_ITEM(item); - NG_FREE_MSG(msg); - return (EINVAL); - } - - if (msg->header.cmd != NGM_TEXT_CONFIG && - msg->header.cmd != NGM_TEXT_STATUS) { - NG_FREE_ITEM(item); - NG_FREE_MSG(msg); - return (EINVAL); - } - - NG_MKRESPONSE(resp, msg, sizeof(struct ng_mesg) + NG_TEXTRESPONSE, - M_NOWAIT); - if (resp == NULL) { - NG_FREE_ITEM(item); - NG_FREE_MSG(msg); - return (ENOMEM); - } - - if (msg->header.arglen) - s = (char *)msg->data; - else - s = NULL; - r = (char *)resp->data; - *r = '\0'; - - if (msg->header.cmd == NGM_TEXT_CONFIG) { - ngmn_config(node, s, r); - resp->header.arglen = strlen(r) + 1; - NG_RESPOND_MSG(i, node, item, resp); - NG_FREE_MSG(msg); - return (0); - } - pos = 0; - pos += sprintf(pos + r,"Framer status %b;\n", sc->framer_state, "\20" - "\40LOS\37AIS\36LFA\35RRA" - "\34AUXP\33NMF\32LMFA\31frs0.0" - "\30frs1.7\27TS16RA\26TS16LOS\25TS16AIS" - "\24TS16LFA\23frs1.2\22XLS\21XLO" - "\20RS1\17rsw.6\16RRA\15RY0" - "\14RY1\13RY2\12RY3\11RY4" - "\10SI1\7SI2\6rsp.5\5rsp.4" - "\4rsp.3\3RSIF\2RS13\1RS15"); - pos += sprintf(pos + r," Framing errors: %lu", sc->cnt_fec); - pos += sprintf(pos + r," Code Violations: %lu\n", sc->cnt_cvc); - - pos += sprintf(pos + r," Falc State %b;\n", sc->falc_state, "\20" - "\40LOS\37AIS\36LFA\35RRA" - "\34AUXP\33NMF\32LMFA\31frs0.0" - "\30frs1.7\27TS16RA\26TS16LOS\25TS16AIS" - "\24TS16LFA\23frs1.2\22XLS\21XLO" - "\20RS1\17rsw.6\16RRA\15RY0" - "\14RY1\13RY2\12RY3\11RY4" - "\10SI1\7SI2\6rsp.5\5rsp.4" - "\4rsp.3\3RSIF\2RS13\1RS15"); - pos += sprintf(pos + r, " Falc IRQ %b\n", sc->falc_irq, "\20" - "\40RME\37RFS\36T8MS\35RMB\34CASC\33CRC4\32SA6SC\31RPF" - "\30b27\27RDO\26ALLS\25XDU\24XMB\23b22\22XLSC\21XPR" - "\20FAR\17LFA\16MFAR\15T400MS\14AIS\13LOS\12RAR\11RA" - "\10ES\7SEC\6LMFA16\5AIS16\4RA16\3API\2SLN\1SLP"); - for (i = 0; i < M32_CHAN; i++) { - if (!sc->ch[i]) - continue; - sch = sc->ch[i]; - - pos += sprintf(r + pos, " Chan %d <%s> ", - i, NG_HOOK_NAME(sch->hook)); - - pos += sprintf(r + pos, " Last Rx: "); - if (sch->last_recv) - pos += sprintf(r + pos, "%lu s", - (unsigned long)(time_second - sch->last_recv)); - else - pos += sprintf(r + pos, "never"); - - pos += sprintf(r + pos, ", last RxErr: "); - if (sch->last_rxerr) - pos += sprintf(r + pos, "%lu s", - (unsigned long)(time_second - sch->last_rxerr)); - else - pos += sprintf(r + pos, "never"); - - pos += sprintf(r + pos, ", last Tx: "); - if (sch->last_xmit) - pos += sprintf(r + pos, "%lu s\n", - (unsigned long)(time_second - sch->last_xmit)); - else - pos += sprintf(r + pos, "never\n"); - - pos += sprintf(r + pos, " RX error(s) %lu", sch->rx_error); - pos += sprintf(r + pos, " Short: %lu", sch->short_error); - pos += sprintf(r + pos, " CRC: %lu", sch->crc_error); - pos += sprintf(r + pos, " Mod8: %lu", sch->dribble_error); - pos += sprintf(r + pos, " Long: %lu", sch->long_error); - pos += sprintf(r + pos, " Abort: %lu", sch->abort_error); - pos += sprintf(r + pos, " Overflow: %lu\n", sch->overflow_error); - - pos += sprintf(r + pos, " Last error: %b Prev error: %b\n", - sch->last_error, "\20\7SHORT\5CRC\4MOD8\3LONG\2ABORT\1OVERRUN", - sch->prev_error, "\20\7SHORT\5CRC\4MOD8\3LONG\2ABORT\1OVERRUN"); - pos += sprintf(r + pos, " Xmit bytes pending %ld\n", - sch->tx_pending); - } - resp->header.arglen = pos + 1; - - /* Take care of synchronous response, if any */ - NG_RESPOND_MSG(i, node, item, resp); - NG_FREE_MSG(msg); - return (0); -} - -static int -ngmn_newhook(node_p node, hook_p hook, const char *name) -{ - u_int32_t ts, chan; - struct mn_softc *sc; - int nbit; - - sc = NG_NODE_PRIVATE(node); - - if (name[0] != 't' || name[1] != 's') - return (EINVAL); - - ts = mn_parse_ts(name + 2, &nbit); - printf("%d bits %x\n", nbit, ts); - if (sc->framing == E1 && (ts & 1)) - return (EINVAL); - if (sc->framing == E1U && nbit != 32) - return (EINVAL); - if (ts == 0) - return (EINVAL); - if (sc->framing == E1) - chan = ffs(ts) - 1; - else - chan = 1; - if (!sc->ch[chan]) - mn_create_channel(sc, chan); - else if (sc->ch[chan]->state == UP) - return (EBUSY); - sc->ch[chan]->ts = ts; - sc->ch[chan]->hook = hook; - sc->ch[chan]->tx_limit = nbit * 8; - NG_HOOK_SET_PRIVATE(hook, sc->ch[chan]); - sc->nhooks++; - return(0); -} - - -static struct trxd *mn_desc_free; - -static struct trxd * -mn_alloc_desc(void) -{ - struct trxd *dp; - - dp = mn_desc_free; - if (dp) - mn_desc_free = dp->vnext; - else - dp = (struct trxd *)malloc(sizeof *dp, M_MN, M_NOWAIT); - return (dp); -} - -static void -mn_free_desc(struct trxd *dp) -{ - dp->vnext = mn_desc_free; - mn_desc_free = dp; -} - -static u_int32_t -mn_parse_ts(const char *s, int *nbit) -{ - unsigned r; - int i, j; - char *p; - - r = 0; - j = -1; - *nbit = 0; - while(*s) { - i = strtol(s, &p, 0); - if (i < 0 || i > 31) - return (0); - while (j != -1 && j < i) { - r |= 1 << j++; - (*nbit)++; - } - j = -1; - r |= 1 << i; - (*nbit)++; - if (*p == ',') { - s = p + 1; - continue; - } else if (*p == '-') { - j = i + 1; - s = p + 1; - continue; - } else if (!*p) { - break; - } else { - return (0); - } - } - return (r); -} - -#ifdef notyet -static void -mn_fmt_ts(char *p, u_int32_t ts) -{ - char *s; - int j; - - s = ""; - ts &= 0xffffffff; - for (j = 0; j < 32; j++) { - if (!(ts & (1 << j))) - continue; - sprintf(p, "%s%d", s, j); - p += strlen(p); - s = ","; - if (!(ts & (1 << (j+1)))) - continue; - for (; j < 32; j++) - if (!(ts & (1 << (j+1)))) - break; - sprintf(p, "-%d", j); - p += strlen(p); - s = ","; - } -} -#endif /* notyet */ - -/* - * OUTPUT - */ - -static int -ngmn_rcvdata(hook_p hook, item_p item) -{ - struct mbuf *m2; - struct trxd *dp, *dp2; - struct schan *sch; - struct mn_softc *sc; - int chan, pitch, len; - struct mbuf *m; - - sch = NG_HOOK_PRIVATE(hook); - sc = sch->sc; - chan = sch->chan; - - if (sch->state != UP) { - NG_FREE_ITEM(item); - return (0); - } - NGI_GET_M(item, m); - if (sch->tx_pending + m->m_pkthdr.len > sch->tx_limit * mn_maxlatency) { - NG_FREE_M(m); - NG_FREE_ITEM(item); - return (0); - } - NG_FREE_ITEM(item); - pitch = 0; - m2 = m; - dp2 = sc->ch[chan]->xl; - len = m->m_pkthdr.len; - while (len) { - dp = mn_alloc_desc(); - if (!dp) { - pitch++; - m_freem(m); - sc->ch[chan]->xl = dp2; - dp = dp2->vnext; - while (dp) { - dp2 = dp->vnext; - mn_free_desc(dp); - dp = dp2; - } - sc->ch[chan]->xl->vnext = NULL; - break; - } - dp->data = vtophys(m2->m_data); - dp->flags = m2->m_len << 16; - dp->flags += 1; - len -= m2->m_len; - dp->next = vtophys(dp); - dp->vnext = NULL; - sc->ch[chan]->xl->next = vtophys(dp); - sc->ch[chan]->xl->vnext = dp; - sc->ch[chan]->xl = dp; - if (!len) { - dp->m = m; - dp->flags |= 0xc0000000; - dp2->flags &= ~0x40000000; - } else { - dp->m = NULL; - m2 = m2->m_next; - } - } - if (pitch) - printf("%s%d: Short on mem, pitched %d packets\n", - sc->name, chan, pitch); - else { -#if 0 - printf("%d = %d + %d (%p)\n", - sch->tx_pending + m->m_pkthdr.len, - sch->tx_pending , m->m_pkthdr.len, m); -#endif - sch->tx_pending += m->m_pkthdr.len; - sc->m32x->txpoll &= ~(1 << chan); - } - return (0); -} - -/* - * OPEN - */ -static int -ngmn_connect(hook_p hook) -{ - int i, nts, chan; - struct trxd *dp, *dp2; - struct mbuf *m; - struct mn_softc *sc; - struct schan *sch; - u_int32_t u; - - sch = NG_HOOK_PRIVATE(hook); - chan = sch->chan; - sc = sch->sc; - - if (sch->state == UP) - return (0); - sch->state = UP; - - /* Count and configure the timeslots for this channel */ - for (nts = i = 0; i < 32; i++) - if (sch->ts & (1 << i)) { - sc->m32_mem.ts[i] = 0x00ff00ff | - (chan << 24) | (chan << 8); - nts++; - } - - /* Init the receiver & xmitter to HDLC */ - sc->m32_mem.cs[chan].flags = 0x80e90006; - /* Allocate two buffers per timeslot */ - if (nts == 32) - sc->m32_mem.cs[chan].itbs = 63; - else - sc->m32_mem.cs[chan].itbs = nts * 2; - - /* Setup a transmit chain with one descriptor */ - /* XXX: we actually send a 1 byte packet */ - dp = mn_alloc_desc(); - MGETHDR(m, M_WAITOK, MT_DATA); - m->m_pkthdr.len = 0; - dp->m = m; - dp->flags = 0xc0000000 + (1 << 16); - dp->next = vtophys(dp); - dp->vnext = NULL; - dp->data = vtophys(sc->name); - sc->m32_mem.cs[chan].tdesc = vtophys(dp); - sc->ch[chan]->x1 = dp; - sc->ch[chan]->xl = dp; - - /* Setup a receive chain with 5 + NTS descriptors */ - - dp = mn_alloc_desc(); - m = NULL; - MGETHDR(m, M_WAITOK, MT_DATA); - MCLGET(m, M_WAITOK); - dp->m = m; - dp->data = vtophys(m->m_data); - dp->flags = 0x40000000; - dp->flags += 1600 << 16; - dp->next = vtophys(dp); - dp->vnext = NULL; - sc->ch[chan]->rl = dp; - - for (i = 0; i < (nts + 10); i++) { - dp2 = dp; - dp = mn_alloc_desc(); - m = NULL; - MGETHDR(m, M_WAITOK, MT_DATA); - MCLGET(m, M_WAITOK); - dp->m = m; - dp->data = vtophys(m->m_data); - dp->flags = 0x00000000; - dp->flags += 1600 << 16; - dp->next = vtophys(dp2); - dp->vnext = dp2; - } - sc->m32_mem.cs[chan].rdesc = vtophys(dp); - sc->ch[chan]->r1 = dp; - - /* Initialize this channel */ - sc->m32_mem.ccb = 0x00008000 + (chan << 8); - sc->m32x->cmd = 0x1; - DELAY(1000); - u = sc->m32x->stat; - if (!(u & 1)) - printf("%s: init chan %d stat %08x\n", sc->name, chan, u); - sc->m32x->stat = 1; - - return (0); -} - -/* - * CLOSE - */ -static int -ngmn_disconnect(hook_p hook) -{ - int chan, i; - struct mn_softc *sc; - struct schan *sch; - struct trxd *dp, *dp2; - u_int32_t u; - - sch = NG_HOOK_PRIVATE(hook); - chan = sch->chan; - sc = sch->sc; - - if (sch->state == DOWN) - return (0); - sch->state = DOWN; - - /* Set receiver & transmitter off */ - sc->m32_mem.cs[chan].flags = 0x80920006; - sc->m32_mem.cs[chan].itbs = 0; - - /* free the timeslots */ - for (i = 0; i < 32; i++) - if (sc->ch[chan]->ts & (1 << i)) - sc->m32_mem.ts[i] = 0x20002000; - - /* Initialize this channel */ - sc->m32_mem.ccb = 0x00008000 + (chan << 8); - sc->m32x->cmd = 0x1; - DELAY(30); - u = sc->m32x->stat; - if (!(u & 1)) - printf("%s: zap chan %d stat %08x\n", sc->name, chan, u); - sc->m32x->stat = 1; - - /* Free all receive descriptors and mbufs */ - for (dp = sc->ch[chan]->r1; dp ; dp = dp2) { - if (dp->m) - m_freem(dp->m); - sc->ch[chan]->r1 = dp2 = dp->vnext; - mn_free_desc(dp); - } - - /* Free all transmit descriptors and mbufs */ - for (dp = sc->ch[chan]->x1; dp ; dp = dp2) { - if (dp->m) { - sc->ch[chan]->tx_pending -= dp->m->m_pkthdr.len; - m_freem(dp->m); - } - sc->ch[chan]->x1 = dp2 = dp->vnext; - mn_free_desc(dp); - } - sc->nhooks--; - return(0); -} - -/* - * Create a new channel. - */ -static void -mn_create_channel(struct mn_softc *sc, int chan) -{ - struct schan *sch; - - sch = sc->ch[chan] = (struct schan *)malloc(sizeof *sc->ch[chan], - M_MN, M_WAITOK | M_ZERO); - sch->sc = sc; - sch->state = DOWN; - sch->chan = chan; - sprintf(sch->name, "%s%d", sc->name, chan); - return; -} - -#ifdef notyet -/* - * Dump Munich32x state - */ -static void -m32_dump(struct mn_softc *sc) *** 600 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Mon Mar 22 19:59:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EF6D5B9D65; Mon, 22 Mar 2021 19:59: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 4F451J3BkBz4hHj; Mon, 22 Mar 2021 19:59: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 6074813C27; Mon, 22 Mar 2021 19:59: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 12MJxGir021032; Mon, 22 Mar 2021 19:59:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MJxGIn021031; Mon, 22 Mar 2021 19:59:16 GMT (envelope-from git) Date: Mon, 22 Mar 2021 19:59:16 GMT Message-Id: <202103221959.12MJxGIn021031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: f91026bf462f - main - Improve example install scripts, making them simpler and more robust. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f91026bf462f9a636735cafafd29a1232b2a525b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 19:59:16 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=f91026bf462f9a636735cafafd29a1232b2a525b commit f91026bf462f9a636735cafafd29a1232b2a525b Author: Nathan Whitehorn AuthorDate: 2021-03-22 14:08:55 +0000 Commit: Nathan Whitehorn CommitDate: 2021-03-22 19:58:10 +0000 Improve example install scripts, making them simpler and more robust. In particular: - There is no need to do anything with gpart (the installer does that for you). - There is no need to specify the network interface, since we have an option for defaults. --- usr.sbin/bsdinstall/bsdinstall.8 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8 index ba261ce7301d..53bf25b3b070 100644 --- a/usr.sbin/bsdinstall/bsdinstall.8 +++ b/usr.sbin/bsdinstall/bsdinstall.8 @@ -458,8 +458,7 @@ PARTITIONS=ada0 DISTRIBUTIONS="kernel.txz base.txz" #!/bin/sh -gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0 -sysrc ifconfig_em0=DHCP +sysrc ifconfig_DEFAULT=DHCP sysrc sshd_enable=YES pkg install puppet .Ed @@ -472,7 +471,7 @@ export ZFSBOOT_DISKS=ada0 export nonInteractive="YES" #!/bin/sh -echo "ifconfig_em0=DHCP" >> /etc/rc.conf +echo "ifconfig_DEFAULT=DHCP" >> /etc/rc.conf echo "sshd_enable=YES" >> /etc/rc.conf pkg install puppet .Ed From owner-dev-commits-src-main@freebsd.org Mon Mar 22 19:59:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A82985B9E72; Mon, 22 Mar 2021 19:59: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 4F451K4QnDz4h6v; Mon, 22 Mar 2021 19:59: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 8B06313DB3; Mon, 22 Mar 2021 19:59: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 12MJxHih021053; Mon, 22 Mar 2021 19:59:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MJxHAV021052; Mon, 22 Mar 2021 19:59:17 GMT (envelope-from git) Date: Mon, 22 Mar 2021 19:59:17 GMT Message-Id: <202103221959.12MJxHAV021052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: c8923d191dd3 - main - Include examples of how to build script-install media. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8923d191dd3e56b8e1113b4a94da3193600c110 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 19:59:17 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=c8923d191dd3e56b8e1113b4a94da3193600c110 commit c8923d191dd3e56b8e1113b4a94da3193600c110 Author: Nathan Whitehorn AuthorDate: 2021-03-22 14:20:29 +0000 Commit: Nathan Whitehorn CommitDate: 2021-03-22 19:58:10 +0000 Include examples of how to build script-install media. --- usr.sbin/bsdinstall/bsdinstall.8 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8 index 53bf25b3b070..1362f30b0c4a 100644 --- a/usr.sbin/bsdinstall/bsdinstall.8 +++ b/usr.sbin/bsdinstall/bsdinstall.8 @@ -583,6 +583,20 @@ The first column if the dataset to be created on the top of the and the rest of the columns are the options to be set on each dataset. The options must be written on a coma or space separated list, or both. And everything behind a pound/hash character is ignored as a comment. +.Ss BUILDING AUTOMATIC INSTALL MEDIA +If building automatic install media, use tar to extract a release ISO: +.Dl mkdir release-media +.Dl tar xvf -C release-media FreeBSD-13.0-RELEASE-amd64-disc1.iso +.Pp +Then place a script as above in +.Pa etc/installerconfig +.Pp +This directory can then be used directly as an NFS root for +.Xr diskless 8 +installations or it can be rebuilt into an ISO image using the release scripts in +.Pa /usr/src/release . +For example, on amd64: +.Dl sh /usr/src/release/amd64/mkisoimages.sh -b '13_0_RELEASE_AMD64_CD' output.iso release-media .Sh HISTORY This version of .Nm From owner-dev-commits-src-main@freebsd.org Mon Mar 22 23:42:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F79F5BE3A5; Mon, 22 Mar 2021 23:42: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 4F49z46mgsz4vnS; Mon, 22 Mar 2021 23:42: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 DB2E916A41; Mon, 22 Mar 2021 23:42: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 12MNgei8041529; Mon, 22 Mar 2021 23:42:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MNgehR041528; Mon, 22 Mar 2021 23:42:40 GMT (envelope-from git) Date: Mon, 22 Mar 2021 23:42:40 GMT Message-Id: <202103222342.12MNgehR041528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: 9f88bee14659 - main - Bump documentation date after recent updates to bsdinstall.8. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f88bee14659c9e5920372c53106e666b502b3cd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 23:42:41 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=9f88bee14659c9e5920372c53106e666b502b3cd commit 9f88bee14659c9e5920372c53106e666b502b3cd Author: Nathan Whitehorn AuthorDate: 2021-03-22 23:41:49 +0000 Commit: Nathan Whitehorn CommitDate: 2021-03-22 23:41:49 +0000 Bump documentation date after recent updates to bsdinstall.8. --- usr.sbin/bsdinstall/bsdinstall.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8 index 1362f30b0c4a..c58f6636493a 100644 --- a/usr.sbin/bsdinstall/bsdinstall.8 +++ b/usr.sbin/bsdinstall/bsdinstall.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2020 +.Dd March 22, 2021 .Dt BSDINSTALL 8 .Os .Sh NAME From owner-dev-commits-src-main@freebsd.org Mon Mar 22 23:49:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2127F5BE1E8; Mon, 22 Mar 2021 23:49: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 4F4B7Q0Nchz3CDj; Mon, 22 Mar 2021 23:49: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 F00C9168C4; Mon, 22 Mar 2021 23:49: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 12MNnraD042750; Mon, 22 Mar 2021 23:49:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MNnr27042749; Mon, 22 Mar 2021 23:49:53 GMT (envelope-from git) Date: Mon, 22 Mar 2021 23:49:53 GMT Message-Id: <202103222349.12MNnr27042749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Watson Subject: git: 599fb1d198ec - main - Tune DTrace 'aframes' for the FBT and profile providers on arm64. In both cases, too few frames were trimmed, leading to exception handling or DTrace internals being exposed in stack traces exposed by D's stack() primitive. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rwatson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 599fb1d198ec6792ba062114d2589ca9f01a3568 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 23:49:54 -0000 The branch main has been updated by rwatson: URL: https://cgit.FreeBSD.org/src/commit/?id=599fb1d198ec6792ba062114d2589ca9f01a3568 commit 599fb1d198ec6792ba062114d2589ca9f01a3568 Author: Robert Watson AuthorDate: 2021-03-21 00:01:54 +0000 Commit: Robert Watson CommitDate: 2021-03-22 23:49:41 +0000 Tune DTrace 'aframes' for the FBT and profile providers on arm64. In both cases, too few frames were trimmed, leading to exception handling or DTrace internals being exposed in stack traces exposed by D's stack() primitive. MFC after: 3 days Reviewed by: emaste, andrew --- sys/cddl/dev/fbt/aarch64/fbt_isa.c | 5 +++-- sys/cddl/dev/profile/profile.c | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/cddl/dev/fbt/aarch64/fbt_isa.c b/sys/cddl/dev/fbt/aarch64/fbt_isa.c index 12be95ea2217..f9b99febe8d1 100644 --- a/sys/cddl/dev/fbt/aarch64/fbt_isa.c +++ b/sys/cddl/dev/fbt/aarch64/fbt_isa.c @@ -44,6 +44,7 @@ #define FBT_PATCHVAL (AARCH64_BRK | AARCH64_BRK_IMM16_VAL) #define FBT_ENTRY "entry" #define FBT_RETURN "return" +#define FBT_AFRAMES 4 int fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval) @@ -154,7 +155,7 @@ fbt_provide_module_function(linker_file_t lf, int symindx, fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); fbt->fbtp_name = name; fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, - name, FBT_ENTRY, 3, fbt); + name, FBT_ENTRY, FBT_AFRAMES, fbt); fbt->fbtp_patchpoint = instr; fbt->fbtp_ctl = lf; fbt->fbtp_loadcnt = lf->loadcnt; @@ -196,7 +197,7 @@ again: fbt->fbtp_name = name; if (retfbt == NULL) { fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, - name, FBT_RETURN, 3, fbt); + name, FBT_RETURN, FBT_AFRAMES, fbt); } else { retfbt->fbtp_probenext = fbt; fbt->fbtp_id = retfbt->fbtp_id; diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c index 6074354af18d..1e7a84c272cd 100644 --- a/sys/cddl/dev/profile/profile.c +++ b/sys/cddl/dev/profile/profile.c @@ -123,8 +123,7 @@ struct profile_probe_percpu; #endif #ifdef __aarch64__ -/* TODO: verify */ -#define PROF_ARTIFICIAL_FRAMES 10 +#define PROF_ARTIFICIAL_FRAMES 12 #endif #ifdef __riscv From owner-dev-commits-src-main@freebsd.org Mon Mar 22 23:58:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B96F75BE557; Mon, 22 Mar 2021 23:58: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 4F4BKJ4rLNz3CL7; Mon, 22 Mar 2021 23:58: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 94E8716E27; Mon, 22 Mar 2021 23:58: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 12MNwSoU057014; Mon, 22 Mar 2021 23:58:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MNwS8n057013; Mon, 22 Mar 2021 23:58:28 GMT (envelope-from git) Date: Mon, 22 Mar 2021 23:58:28 GMT Message-Id: <202103222358.12MNwS8n057013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Watson Subject: git: fb581531c1a0 - main - Teach DTrace that unaligned accesses are OK on aarch64, not just x86. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rwatson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb581531c1a0e6f1bf5392a2e97ed39d21d6e1fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 23:58:28 -0000 The branch main has been updated by rwatson: URL: https://cgit.FreeBSD.org/src/commit/?id=fb581531c1a0e6f1bf5392a2e97ed39d21d6e1fd commit fb581531c1a0e6f1bf5392a2e97ed39d21d6e1fd Author: Robert Watson AuthorDate: 2021-03-22 01:50:00 +0000 Commit: Robert Watson CommitDate: 2021-03-22 23:57:19 +0000 Teach DTrace that unaligned accesses are OK on aarch64, not just x86. MFC after: 3 days Reviewed: andrew Differential Revision: https://reviews.freebsd.org/D29369 --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index b212185a4578..ca6fa5481856 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -475,7 +475,7 @@ static kmutex_t dtrace_errlock; #define DTRACE_STORE(type, tomax, offset, what) \ *((type *)((uintptr_t)(tomax) + (uintptr_t)offset)) = (type)(what); -#ifndef __x86 +#if !defined(__x86) && !defined(__aarch64__) #define DTRACE_ALIGNCHECK(addr, size, flags) \ if (addr & (size - 1)) { \ *flags |= CPU_DTRACE_BADALIGN; \ From owner-dev-commits-src-main@freebsd.org Tue Mar 23 02:23:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54140572E6B; Tue, 23 Mar 2021 02:23:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F4FXJ1pJkz3PBj; Tue, 23 Mar 2021 02:23: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 307FF18E26; Tue, 23 Mar 2021 02:23: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 12N2NC0Y065830; Tue, 23 Mar 2021 02:23:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12N2NC0P065829; Tue, 23 Mar 2021 02:23:12 GMT (envelope-from git) Date: Tue, 23 Mar 2021 02:23:12 GMT Message-Id: <202103230223.12N2NC0P065829@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: 3ead60236fd2 - main - Generalize bus_space(9) and atomic(9) sanitizer interceptors 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: 3ead60236fd25ce64fece7ae4a453318ca18c119 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 02:23:12 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3ead60236fd25ce64fece7ae4a453318ca18c119 commit 3ead60236fd25ce64fece7ae4a453318ca18c119 Author: Mark Johnston AuthorDate: 2021-03-23 01:44:55 +0000 Commit: Mark Johnston CommitDate: 2021-03-23 02:21:53 +0000 Generalize bus_space(9) and atomic(9) sanitizer interceptors Make it easy to define interceptors for new sanitizer runtimes, rather than assuming KCSAN. Lay a bit of groundwork for KASAN and KMSAN. When a sanitizer is compiled in, atomic(9) and bus_space(9) definitions in atomic_san.h are used by default instead of the inline implementations in the platform's atomic.h. These definitions are implemented in the sanitizer runtime, which includes machine/{atomic,bus}.h with SAN_RUNTIME defined to pull in the actual implementations. No functional change intended. MFC after: 1 month Sponsored by: The FreeBSD Foundation --- sys/amd64/include/atomic.h | 12 +- sys/arm64/arm64/bus_machdep.c | 4 +- sys/arm64/include/bus.h | 10 +- sys/kern/kern_kcov.c | 4 +- sys/kern/subr_coverage.c | 4 +- sys/kern/subr_csan.c | 10 +- sys/sys/atomic_san.h | 630 ++++++++++++++++++++++-------------------- sys/sys/bus_san.h | 306 ++++++++++---------- sys/x86/include/bus.h | 18 +- sys/x86/x86/bus_machdep.c | 4 +- 10 files changed, 542 insertions(+), 460 deletions(-) diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index 61cb79645c10..c821e77e5b8b 100644 --- a/sys/amd64/include/atomic.h +++ b/sys/amd64/include/atomic.h @@ -68,7 +68,15 @@ #define OFFSETOF_MONITORBUF 0x100 #endif -#if defined(KCSAN) && !defined(KCSAN_RUNTIME) +#ifndef SAN_RUNTIME +#if defined(KASAN) +#define ATOMIC_SAN_PREFIX kasan +#elif defined(KCSAN) +#define ATOMIC_SAN_PREFIX kcsan +#endif +#endif + +#ifdef ATOMIC_SAN_PREFIX #include #else #include @@ -679,6 +687,6 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #endif /* !WANT_FUNCTIONS */ -#endif /* KCSAN && !KCSAN_RUNTIME */ +#endif /* !ATOMIC_SAN_PREFIX */ #endif /* !_MACHINE_ATOMIC_H_ */ diff --git a/sys/arm64/arm64/bus_machdep.c b/sys/arm64/arm64/bus_machdep.c index 7fc83e6924f2..69d7c5b591b2 100644 --- a/sys/arm64/arm64/bus_machdep.c +++ b/sys/arm64/arm64/bus_machdep.c @@ -25,7 +25,9 @@ * */ -#define KCSAN_RUNTIME +#if defined(KASAN) || defined(KCSAN) +#define SAN_RUNTIME +#endif #include "opt_platform.h" diff --git a/sys/arm64/include/bus.h b/sys/arm64/include/bus.h index 417b918f595f..e2862aa65fb0 100644 --- a/sys/arm64/include/bus.h +++ b/sys/arm64/include/bus.h @@ -91,7 +91,15 @@ #define BUS_SPACE_BARRIER_READ 0x01 #define BUS_SPACE_BARRIER_WRITE 0x02 -#if defined(KCSAN) && !defined(KCSAN_RUNTIME) +#ifndef SAN_RUNTIME +#if defined(KASAN) +#define BUS_SAN_PREFIX kasan +#elif defined(KCSAN) +#define BUS_SAN_PREFIX kcsan +#endif +#endif + +#ifdef BUS_SAN_PREFIX #include #else diff --git a/sys/kern/kern_kcov.c b/sys/kern/kern_kcov.c index cedfa2c081ba..23e0da4cdb79 100644 --- a/sys/kern/kern_kcov.c +++ b/sys/kern/kern_kcov.c @@ -35,7 +35,9 @@ * $FreeBSD$ */ -#define KCSAN_RUNTIME +#ifdef KCSAN +#define SAN_RUNTIME +#endif #include __FBSDID("$FreeBSD$"); diff --git a/sys/kern/subr_coverage.c b/sys/kern/subr_coverage.c index f3ab27c2ca3d..9a719bcaecad 100644 --- a/sys/kern/subr_coverage.c +++ b/sys/kern/subr_coverage.c @@ -35,7 +35,9 @@ * $FreeBSD$ */ -#define KCSAN_RUNTIME +#ifdef KCSAN +#define SAN_RUNTIME +#endif #include __FBSDID("$FreeBSD$"); diff --git a/sys/kern/subr_csan.c b/sys/kern/subr_csan.c index ec2fd23729b2..06b0b6ebb020 100644 --- a/sys/kern/subr_csan.c +++ b/sys/kern/subr_csan.c @@ -30,7 +30,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#define KCSAN_RUNTIME +#define SAN_RUNTIME #include "opt_ddb.h" @@ -380,6 +380,7 @@ kcsan_copyout(const void *kaddr, void *uaddr, size_t len) /* -------------------------------------------------------------------------- */ #include +#define ATOMIC_SAN_PREFIX kcsan #include #define _CSAN_ATOMIC_FUNC_ADD(name, type) \ @@ -684,10 +685,17 @@ CSAN_ATOMIC_FUNC_THREAD_FENCE(acq_rel) CSAN_ATOMIC_FUNC_THREAD_FENCE(rel) CSAN_ATOMIC_FUNC_THREAD_FENCE(seq_cst) +void +kcsan_atomic_interrupt_fence(void) +{ + atomic_interrupt_fence(); +} + /* -------------------------------------------------------------------------- */ #include #include +#define BUS_SAN_PREFIX kcsan #include int diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index c2b963ae8b92..5d10f58f7565 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -2,12 +2,16 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Andrew Turner + * Copyright (c) 2021 The FreeBSD Foundation * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory (Department of Computer Science and * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the * DARPA SSITH research programme. * + * Portions of this software were written by Mark Johnston under sponsorship + * by the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -39,342 +43,360 @@ #error do not include this header, use machine/atomic.h #endif -#define KCSAN_ATOMIC_FUNC_1(op, name, type) \ - void kcsan_atomic_##op##_##name(volatile type *, type); \ - void kcsan_atomic_##op##_acq_##name(volatile type *, type); \ - void kcsan_atomic_##op##_rel_##name(volatile type *, type) +#ifndef ATOMIC_SAN_PREFIX +#error No sanitizer prefix available +#endif + +#define ATOMIC_SAN_FUNC_1(sp, op, name, type) \ + void sp##_atomic_##op##_##name(volatile type *, type); \ + void sp##_atomic_##op##_acq_##name(volatile type *, type); \ + void sp##_atomic_##op##_rel_##name(volatile type *, type) -#define KCSAN_ATOMIC_CMPSET(name, type) \ - int kcsan_atomic_cmpset_##name(volatile type *, type, type); \ - int kcsan_atomic_cmpset_acq_##name(volatile type *, type, type); \ - int kcsan_atomic_cmpset_rel_##name(volatile type *, type, type) +#define ATOMIC_SAN_CMPSET(sp, name, type) \ + int sp##_atomic_cmpset_##name(volatile type *, type, type); \ + int sp##_atomic_cmpset_acq_##name(volatile type *, type, type); \ + int sp##_atomic_cmpset_rel_##name(volatile type *, type, type) -#define KCSAN_ATOMIC_FCMPSET(name, type) \ - int kcsan_atomic_fcmpset_##name(volatile type *, type *, type); \ - int kcsan_atomic_fcmpset_acq_##name(volatile type *, type *, type); \ - int kcsan_atomic_fcmpset_rel_##name(volatile type *, type *, type) +#define ATOMIC_SAN_FCMPSET(sp, name, type) \ + int sp##_atomic_fcmpset_##name(volatile type *, type *, type); \ + int sp##_atomic_fcmpset_acq_##name(volatile type *, type *, type); \ + int sp##_atomic_fcmpset_rel_##name(volatile type *, type *, type) -#define KCSAN_ATOMIC_READ(op, name, type) \ - type kcsan_atomic_##op##_##name(volatile type *, type) +#define ATOMIC_SAN_READ(sp, op, name, type) \ + type sp##_atomic_##op##_##name(volatile type *, type) -#define KCSAN_ATOMIC_READANDCLEAR(name, type) \ - type kcsan_atomic_readandclear_##name(volatile type *) +#define ATOMIC_SAN_READANDCLEAR(sp, name, type) \ + type sp##_atomic_readandclear_##name(volatile type *) -#define KCSAN_ATOMIC_LOAD(name, type) \ - type kcsan_atomic_load_##name(volatile type *); \ - type kcsan_atomic_load_acq_##name(volatile type *) +#define ATOMIC_SAN_LOAD(sp, name, type) \ + type sp##_atomic_load_##name(volatile type *); \ + type sp##_atomic_load_acq_##name(volatile type *) -#define KCSAN_ATOMIC_STORE(name, type) \ - void kcsan_atomic_store_##name(volatile type *, type); \ - void kcsan_atomic_store_rel_##name(volatile type *, type) +#define ATOMIC_SAN_STORE(sp, name, type) \ + void sp##_atomic_store_##name(volatile type *, type); \ + void sp##_atomic_store_rel_##name(volatile type *, type) -#define KCSAN_ATOMIC_TEST(op, name, type) \ - int kcsan_atomic_##op##_##name(volatile type *, u_int); \ - int kcsan_atomic_##op##_acq_##name(volatile type *, u_int) +#define ATOMIC_SAN_TEST(sp, op, name, type) \ + int sp##_atomic_##op##_##name(volatile type *, u_int); \ + int sp##_atomic_##op##_acq_##name(volatile type *, u_int) -#define KCSAN_ATOMIC_FUNCS(name, type) \ - KCSAN_ATOMIC_FUNC_1(add, name, type); \ - KCSAN_ATOMIC_FUNC_1(clear, name, type); \ - KCSAN_ATOMIC_CMPSET(name, type); \ - KCSAN_ATOMIC_FCMPSET(name, type); \ - KCSAN_ATOMIC_READ(fetchadd, name, type); \ - KCSAN_ATOMIC_LOAD(name, type); \ - KCSAN_ATOMIC_READANDCLEAR(name, type); \ - KCSAN_ATOMIC_FUNC_1(set, name, type); \ - KCSAN_ATOMIC_FUNC_1(subtract, name, type); \ - KCSAN_ATOMIC_STORE(name, type); \ - KCSAN_ATOMIC_READ(swap, name, type); \ - KCSAN_ATOMIC_TEST(testandclear, name, type); \ - KCSAN_ATOMIC_TEST(testandset, name, type) +#define ATOMIC_SAN_THREAD_FENCE(sp) \ + void sp##_atomic_thread_fence_acq(void); \ + void sp##_atomic_thread_fence_rel(void); \ + void sp##_atomic_thread_fence_acq_rel(void); \ + void sp##_atomic_thread_fence_seq_cst(void); \ + void sp##_atomic_interrupt_fence(void) -KCSAN_ATOMIC_FUNCS(char, uint8_t); -KCSAN_ATOMIC_FUNCS(short, uint16_t); -KCSAN_ATOMIC_FUNCS(int, u_int); -KCSAN_ATOMIC_FUNCS(long, u_long); -KCSAN_ATOMIC_FUNCS(ptr, uintptr_t); -KCSAN_ATOMIC_FUNCS(8, uint8_t); -KCSAN_ATOMIC_FUNCS(16, uint16_t); -KCSAN_ATOMIC_FUNCS(32, uint32_t); -KCSAN_ATOMIC_FUNCS(64, uint64_t); +#define _ATOMIC_SAN_FUNCS(sp, name, type) \ + ATOMIC_SAN_FUNC_1(sp, add, name, type); \ + ATOMIC_SAN_FUNC_1(sp, clear, name, type); \ + ATOMIC_SAN_CMPSET(sp, name, type); \ + ATOMIC_SAN_FCMPSET(sp, name, type); \ + ATOMIC_SAN_READ(sp, fetchadd, name, type); \ + ATOMIC_SAN_LOAD(sp, name, type); \ + ATOMIC_SAN_READANDCLEAR(sp, name, type); \ + ATOMIC_SAN_FUNC_1(sp, set, name, type); \ + ATOMIC_SAN_FUNC_1(sp, subtract, name, type); \ + ATOMIC_SAN_STORE(sp, name, type); \ + ATOMIC_SAN_READ(sp, swap, name, type); \ + ATOMIC_SAN_TEST(sp, testandclear, name, type); \ + ATOMIC_SAN_TEST(sp, testandset, name, type); \ + ATOMIC_SAN_THREAD_FENCE(sp); -void kcsan_atomic_thread_fence_acq(void); -void kcsan_atomic_thread_fence_acq_rel(void); -void kcsan_atomic_thread_fence_rel(void); -void kcsan_atomic_thread_fence_seq_cst(void); +#define ATOMIC_SAN_FUNCS(name, type) \ + _ATOMIC_SAN_FUNCS(ATOMIC_SAN_PREFIX, name, type) -#ifndef KCSAN_RUNTIME +ATOMIC_SAN_FUNCS(char, uint8_t); +ATOMIC_SAN_FUNCS(short, uint16_t); +ATOMIC_SAN_FUNCS(int, u_int); +ATOMIC_SAN_FUNCS(long, u_long); +ATOMIC_SAN_FUNCS(ptr, uintptr_t); +ATOMIC_SAN_FUNCS(8, uint8_t); +ATOMIC_SAN_FUNCS(16, uint16_t); +ATOMIC_SAN_FUNCS(32, uint32_t); +ATOMIC_SAN_FUNCS(64, uint64_t); + +#ifndef SAN_RUNTIME + +/* + * Redirect uses of an atomic(9) function to the sanitizer's interceptor. + * For instance, KASAN callers of atomic_add_char() will be redirected to + * kasan_atomic_add_char(). + */ +#define ATOMIC_SAN(func) \ + __CONCAT(ATOMIC_SAN_PREFIX, __CONCAT(_atomic_, func)) -#define atomic_add_char kcsan_atomic_add_char -#define atomic_add_acq_char kcsan_atomic_add_acq_char -#define atomic_add_rel_char kcsan_atomic_add_rel_char -#define atomic_clear_char kcsan_atomic_clear_char -#define atomic_clear_acq_char kcsan_atomic_clear_acq_char -#define atomic_clear_rel_char kcsan_atomic_clear_rel_char -#define atomic_cmpset_char kcsan_atomic_cmpset_char -#define atomic_cmpset_acq_char kcsan_atomic_cmpset_acq_char -#define atomic_cmpset_rel_char kcsan_atomic_cmpset_rel_char -#define atomic_fcmpset_char kcsan_atomic_fcmpset_char -#define atomic_fcmpset_acq_char kcsan_atomic_fcmpset_acq_char -#define atomic_fcmpset_rel_char kcsan_atomic_fcmpset_rel_char -#define atomic_fetchadd_char kcsan_atomic_fetchadd_char -#define atomic_load_char kcsan_atomic_load_char -#define atomic_load_acq_char kcsan_atomic_load_acq_char -#define atomic_readandclear_char kcsan_atomic_readandclear_char -#define atomic_set_char kcsan_atomic_set_char -#define atomic_set_acq_char kcsan_atomic_set_acq_char -#define atomic_set_rel_char kcsan_atomic_set_rel_char -#define atomic_subtract_char kcsan_atomic_subtract_char -#define atomic_subtract_acq_char kcsan_atomic_subtract_acq_char -#define atomic_subtract_rel_char kcsan_atomic_subtract_rel_char -#define atomic_store_char kcsan_atomic_store_char -#define atomic_store_rel_char kcsan_atomic_store_rel_char -#define atomic_swap_char kcsan_atomic_swap_char -#define atomic_testandclear_char kcsan_atomic_testandclear_char -#define atomic_testandset_char kcsan_atomic_testandset_char +#define atomic_add_char ATOMIC_SAN(add_char) +#define atomic_add_acq_char ATOMIC_SAN(add_acq_char) +#define atomic_add_rel_char ATOMIC_SAN(add_rel_char) +#define atomic_clear_char ATOMIC_SAN(clear_char) +#define atomic_clear_acq_char ATOMIC_SAN(clear_acq_char) +#define atomic_clear_rel_char ATOMIC_SAN(clear_rel_char) +#define atomic_cmpset_char ATOMIC_SAN(cmpset_char) +#define atomic_cmpset_acq_char ATOMIC_SAN(cmpset_acq_char) +#define atomic_cmpset_rel_char ATOMIC_SAN(cmpset_rel_char) +#define atomic_fcmpset_char ATOMIC_SAN(fcmpset_char) +#define atomic_fcmpset_acq_char ATOMIC_SAN(fcmpset_acq_char) +#define atomic_fcmpset_rel_char ATOMIC_SAN(fcmpset_rel_char) +#define atomic_fetchadd_char ATOMIC_SAN(fetchadd_char) +#define atomic_load_char ATOMIC_SAN(load_char) +#define atomic_load_acq_char ATOMIC_SAN(load_acq_char) +#define atomic_readandclear_char ATOMIC_SAN(readandclear_char) +#define atomic_set_char ATOMIC_SAN(set_char) +#define atomic_set_acq_char ATOMIC_SAN(set_acq_char) +#define atomic_set_rel_char ATOMIC_SAN(set_rel_char) +#define atomic_subtract_char ATOMIC_SAN(subtract_char) +#define atomic_subtract_acq_char ATOMIC_SAN(subtract_acq_char) +#define atomic_subtract_rel_char ATOMIC_SAN(subtract_rel_char) +#define atomic_store_char ATOMIC_SAN(store_char) +#define atomic_store_rel_char ATOMIC_SAN(store_rel_char) +#define atomic_swap_char ATOMIC_SAN(swap_char) +#define atomic_testandclear_char ATOMIC_SAN(testandclear_char) +#define atomic_testandset_char ATOMIC_SAN(testandset_char) -#define atomic_add_short kcsan_atomic_add_short -#define atomic_add_acq_short kcsan_atomic_add_acq_short -#define atomic_add_rel_short kcsan_atomic_add_rel_short -#define atomic_clear_short kcsan_atomic_clear_short -#define atomic_clear_acq_short kcsan_atomic_clear_acq_short -#define atomic_clear_rel_short kcsan_atomic_clear_rel_short -#define atomic_cmpset_short kcsan_atomic_cmpset_short -#define atomic_cmpset_acq_short kcsan_atomic_cmpset_acq_short -#define atomic_cmpset_rel_short kcsan_atomic_cmpset_rel_short -#define atomic_fcmpset_short kcsan_atomic_fcmpset_short -#define atomic_fcmpset_acq_short kcsan_atomic_fcmpset_acq_short -#define atomic_fcmpset_rel_short kcsan_atomic_fcmpset_rel_short -#define atomic_fetchadd_short kcsan_atomic_fetchadd_short -#define atomic_load_short kcsan_atomic_load_short -#define atomic_load_acq_short kcsan_atomic_load_acq_short -#define atomic_readandclear_short kcsan_atomic_readandclear_short -#define atomic_set_short kcsan_atomic_set_short -#define atomic_set_acq_short kcsan_atomic_set_acq_short -#define atomic_set_rel_short kcsan_atomic_set_rel_short -#define atomic_subtract_short kcsan_atomic_subtract_short -#define atomic_subtract_acq_short kcsan_atomic_subtract_acq_short -#define atomic_subtract_rel_short kcsan_atomic_subtract_rel_short -#define atomic_store_short kcsan_atomic_store_short -#define atomic_store_rel_short kcsan_atomic_store_rel_short -#define atomic_swap_short kcsan_atomic_swap_short -#define atomic_testandclear_short kcsan_atomic_testandclear_short -#define atomic_testandset_short kcsan_atomic_testandset_short +#define atomic_add_short ATOMIC_SAN(add_short) +#define atomic_add_acq_short ATOMIC_SAN(add_acq_short) +#define atomic_add_rel_short ATOMIC_SAN(add_rel_short) +#define atomic_clear_short ATOMIC_SAN(clear_short) +#define atomic_clear_acq_short ATOMIC_SAN(clear_acq_short) +#define atomic_clear_rel_short ATOMIC_SAN(clear_rel_short) +#define atomic_cmpset_short ATOMIC_SAN(cmpset_short) +#define atomic_cmpset_acq_short ATOMIC_SAN(cmpset_acq_short) +#define atomic_cmpset_rel_short ATOMIC_SAN(cmpset_rel_short) +#define atomic_fcmpset_short ATOMIC_SAN(fcmpset_short) +#define atomic_fcmpset_acq_short ATOMIC_SAN(fcmpset_acq_short) +#define atomic_fcmpset_rel_short ATOMIC_SAN(fcmpset_rel_short) +#define atomic_fetchadd_short ATOMIC_SAN(fetchadd_short) +#define atomic_load_short ATOMIC_SAN(load_short) +#define atomic_load_acq_short ATOMIC_SAN(load_acq_short) +#define atomic_readandclear_short ATOMIC_SAN(readandclear_short) +#define atomic_set_short ATOMIC_SAN(set_short) +#define atomic_set_acq_short ATOMIC_SAN(set_acq_short) +#define atomic_set_rel_short ATOMIC_SAN(set_rel_short) +#define atomic_subtract_short ATOMIC_SAN(subtract_short) +#define atomic_subtract_acq_short ATOMIC_SAN(subtract_acq_short) +#define atomic_subtract_rel_short ATOMIC_SAN(subtract_rel_short) +#define atomic_store_short ATOMIC_SAN(store_short) +#define atomic_store_rel_short ATOMIC_SAN(store_rel_short) +#define atomic_swap_short ATOMIC_SAN(swap_short) +#define atomic_testandclear_short ATOMIC_SAN(testandclear_short) +#define atomic_testandset_short ATOMIC_SAN(testandset_short) -#define atomic_add_int kcsan_atomic_add_int -#define atomic_add_acq_int kcsan_atomic_add_acq_int -#define atomic_add_rel_int kcsan_atomic_add_rel_int -#define atomic_clear_int kcsan_atomic_clear_int -#define atomic_clear_acq_int kcsan_atomic_clear_acq_int -#define atomic_clear_rel_int kcsan_atomic_clear_rel_int -#define atomic_cmpset_int kcsan_atomic_cmpset_int -#define atomic_cmpset_acq_int kcsan_atomic_cmpset_acq_int -#define atomic_cmpset_rel_int kcsan_atomic_cmpset_rel_int -#define atomic_fcmpset_int kcsan_atomic_fcmpset_int -#define atomic_fcmpset_acq_int kcsan_atomic_fcmpset_acq_int -#define atomic_fcmpset_rel_int kcsan_atomic_fcmpset_rel_int -#define atomic_fetchadd_int kcsan_atomic_fetchadd_int -#define atomic_load_int kcsan_atomic_load_int -#define atomic_load_acq_int kcsan_atomic_load_acq_int -#define atomic_readandclear_int kcsan_atomic_readandclear_int -#define atomic_set_int kcsan_atomic_set_int -#define atomic_set_acq_int kcsan_atomic_set_acq_int -#define atomic_set_rel_int kcsan_atomic_set_rel_int -#define atomic_subtract_int kcsan_atomic_subtract_int -#define atomic_subtract_acq_int kcsan_atomic_subtract_acq_int -#define atomic_subtract_rel_int kcsan_atomic_subtract_rel_int -#define atomic_store_int kcsan_atomic_store_int -#define atomic_store_rel_int kcsan_atomic_store_rel_int -#define atomic_swap_int kcsan_atomic_swap_int -#define atomic_testandclear_int kcsan_atomic_testandclear_int -#define atomic_testandset_int kcsan_atomic_testandset_int +#define atomic_add_int ATOMIC_SAN(add_int) +#define atomic_add_acq_int ATOMIC_SAN(add_acq_int) +#define atomic_add_rel_int ATOMIC_SAN(add_rel_int) +#define atomic_clear_int ATOMIC_SAN(clear_int) +#define atomic_clear_acq_int ATOMIC_SAN(clear_acq_int) +#define atomic_clear_rel_int ATOMIC_SAN(clear_rel_int) +#define atomic_cmpset_int ATOMIC_SAN(cmpset_int) +#define atomic_cmpset_acq_int ATOMIC_SAN(cmpset_acq_int) +#define atomic_cmpset_rel_int ATOMIC_SAN(cmpset_rel_int) +#define atomic_fcmpset_int ATOMIC_SAN(fcmpset_int) +#define atomic_fcmpset_acq_int ATOMIC_SAN(fcmpset_acq_int) +#define atomic_fcmpset_rel_int ATOMIC_SAN(fcmpset_rel_int) +#define atomic_fetchadd_int ATOMIC_SAN(fetchadd_int) +#define atomic_load_int ATOMIC_SAN(load_int) +#define atomic_load_acq_int ATOMIC_SAN(load_acq_int) +#define atomic_readandclear_int ATOMIC_SAN(readandclear_int) +#define atomic_set_int ATOMIC_SAN(set_int) +#define atomic_set_acq_int ATOMIC_SAN(set_acq_int) +#define atomic_set_rel_int ATOMIC_SAN(set_rel_int) +#define atomic_subtract_int ATOMIC_SAN(subtract_int) +#define atomic_subtract_acq_int ATOMIC_SAN(subtract_acq_int) +#define atomic_subtract_rel_int ATOMIC_SAN(subtract_rel_int) +#define atomic_store_int ATOMIC_SAN(store_int) +#define atomic_store_rel_int ATOMIC_SAN(store_rel_int) +#define atomic_swap_int ATOMIC_SAN(swap_int) +#define atomic_testandclear_int ATOMIC_SAN(testandclear_int) +#define atomic_testandset_int ATOMIC_SAN(testandset_int) -#define atomic_add_long kcsan_atomic_add_long -#define atomic_add_acq_long kcsan_atomic_add_acq_long -#define atomic_add_rel_long kcsan_atomic_add_rel_long -#define atomic_clear_long kcsan_atomic_clear_long -#define atomic_clear_acq_long kcsan_atomic_clear_acq_long -#define atomic_clear_rel_long kcsan_atomic_clear_rel_long -#define atomic_cmpset_long kcsan_atomic_cmpset_long -#define atomic_cmpset_acq_long kcsan_atomic_cmpset_acq_long -#define atomic_cmpset_rel_long kcsan_atomic_cmpset_rel_long -#define atomic_fcmpset_long kcsan_atomic_fcmpset_long -#define atomic_fcmpset_acq_long kcsan_atomic_fcmpset_acq_long -#define atomic_fcmpset_rel_long kcsan_atomic_fcmpset_rel_long -#define atomic_fetchadd_long kcsan_atomic_fetchadd_long -#define atomic_load_long kcsan_atomic_load_long -#define atomic_load_acq_long kcsan_atomic_load_acq_long -#define atomic_readandclear_long kcsan_atomic_readandclear_long -#define atomic_set_long kcsan_atomic_set_long -#define atomic_set_acq_long kcsan_atomic_set_acq_long -#define atomic_set_rel_long kcsan_atomic_set_rel_long -#define atomic_subtract_long kcsan_atomic_subtract_long -#define atomic_subtract_acq_long kcsan_atomic_subtract_acq_long -#define atomic_subtract_rel_long kcsan_atomic_subtract_rel_long -#define atomic_store_long kcsan_atomic_store_long -#define atomic_store_rel_long kcsan_atomic_store_rel_long -#define atomic_swap_long kcsan_atomic_swap_long -#define atomic_testandclear_long kcsan_atomic_testandclear_long -#define atomic_testandset_long kcsan_atomic_testandset_long -#define atomic_testandset_acq_long kcsan_atomic_testandset_acq_long +#define atomic_add_long ATOMIC_SAN(add_long) +#define atomic_add_acq_long ATOMIC_SAN(add_acq_long) +#define atomic_add_rel_long ATOMIC_SAN(add_rel_long) +#define atomic_clear_long ATOMIC_SAN(clear_long) +#define atomic_clear_acq_long ATOMIC_SAN(clear_acq_long) +#define atomic_clear_rel_long ATOMIC_SAN(clear_rel_long) +#define atomic_cmpset_long ATOMIC_SAN(cmpset_long) +#define atomic_cmpset_acq_long ATOMIC_SAN(cmpset_acq_long) +#define atomic_cmpset_rel_long ATOMIC_SAN(cmpset_rel_long) +#define atomic_fcmpset_long ATOMIC_SAN(fcmpset_long) +#define atomic_fcmpset_acq_long ATOMIC_SAN(fcmpset_acq_long) +#define atomic_fcmpset_rel_long ATOMIC_SAN(fcmpset_rel_long) +#define atomic_fetchadd_long ATOMIC_SAN(fetchadd_long) +#define atomic_load_long ATOMIC_SAN(load_long) +#define atomic_load_acq_long ATOMIC_SAN(load_acq_long) +#define atomic_readandclear_long ATOMIC_SAN(readandclear_long) +#define atomic_set_long ATOMIC_SAN(set_long) +#define atomic_set_acq_long ATOMIC_SAN(set_acq_long) +#define atomic_set_rel_long ATOMIC_SAN(set_rel_long) +#define atomic_subtract_long ATOMIC_SAN(subtract_long) +#define atomic_subtract_acq_long ATOMIC_SAN(subtract_acq_long) +#define atomic_subtract_rel_long ATOMIC_SAN(subtract_rel_long) +#define atomic_store_long ATOMIC_SAN(store_long) +#define atomic_store_rel_long ATOMIC_SAN(store_rel_long) +#define atomic_swap_long ATOMIC_SAN(swap_long) +#define atomic_testandclear_long ATOMIC_SAN(testandclear_long) +#define atomic_testandset_long ATOMIC_SAN(testandset_long) +#define atomic_testandset_acq_long ATOMIC_SAN(testandset_acq_long) -#define atomic_add_ptr kcsan_atomic_add_ptr -#define atomic_add_acq_ptr kcsan_atomic_add_acq_ptr -#define atomic_add_rel_ptr kcsan_atomic_add_rel_ptr -#define atomic_clear_ptr kcsan_atomic_clear_ptr -#define atomic_clear_acq_ptr kcsan_atomic_clear_acq_ptr -#define atomic_clear_rel_ptr kcsan_atomic_clear_rel_ptr -#define atomic_cmpset_ptr kcsan_atomic_cmpset_ptr -#define atomic_cmpset_acq_ptr kcsan_atomic_cmpset_acq_ptr -#define atomic_cmpset_rel_ptr kcsan_atomic_cmpset_rel_ptr -#define atomic_fcmpset_ptr kcsan_atomic_fcmpset_ptr -#define atomic_fcmpset_acq_ptr kcsan_atomic_fcmpset_acq_ptr -#define atomic_fcmpset_rel_ptr kcsan_atomic_fcmpset_rel_ptr -#define atomic_fetchadd_ptr kcsan_atomic_fetchadd_ptr +#define atomic_add_ptr ATOMIC_SAN(add_ptr) +#define atomic_add_acq_ptr ATOMIC_SAN(add_acq_ptr) +#define atomic_add_rel_ptr ATOMIC_SAN(add_rel_ptr) +#define atomic_clear_ptr ATOMIC_SAN(clear_ptr) +#define atomic_clear_acq_ptr ATOMIC_SAN(clear_acq_ptr) +#define atomic_clear_rel_ptr ATOMIC_SAN(clear_rel_ptr) +#define atomic_cmpset_ptr ATOMIC_SAN(cmpset_ptr) +#define atomic_cmpset_acq_ptr ATOMIC_SAN(cmpset_acq_ptr) +#define atomic_cmpset_rel_ptr ATOMIC_SAN(cmpset_rel_ptr) +#define atomic_fcmpset_ptr ATOMIC_SAN(fcmpset_ptr) +#define atomic_fcmpset_acq_ptr ATOMIC_SAN(fcmpset_acq_ptr) +#define atomic_fcmpset_rel_ptr ATOMIC_SAN(fcmpset_rel_ptr) +#define atomic_fetchadd_ptr ATOMIC_SAN(fetchadd_ptr) #define atomic_load_ptr(x) ({ \ __typeof(*x) __retptr; \ - __retptr = (void *)kcsan_atomic_load_ptr((volatile uintptr_t *)(x)); \ + __retptr = (void *)ATOMIC_SAN(load_ptr)((volatile uintptr_t *)(x)); \ __retptr; \ }) -#define atomic_load_acq_ptr kcsan_atomic_load_acq_ptr +#define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) #define atomic_load_consume_ptr(x) ({ \ __typeof(*x) __retptr; \ - __retptr = (void *)kcsan_atomic_load_acq_ptr((volatile uintptr_t *)(x));\ + __retptr = (void *)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 -#define atomic_set_rel_ptr kcsan_atomic_set_rel_ptr -#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_readandclear_ptr ATOMIC_SAN(readandclear_ptr) +#define atomic_set_ptr ATOMIC_SAN(set_ptr) +#define atomic_set_acq_ptr ATOMIC_SAN(set_acq_ptr) +#define atomic_set_rel_ptr ATOMIC_SAN(set_rel_ptr) +#define atomic_subtract_ptr ATOMIC_SAN(subtract_ptr) +#define atomic_subtract_acq_ptr ATOMIC_SAN(subtract_acq_ptr) +#define atomic_subtract_rel_ptr ATOMIC_SAN(subtract_rel_ptr) #define atomic_store_ptr(x, v) ({ \ __typeof(*x) __value = (v); \ - kcsan_atomic_store_ptr((volatile uintptr_t *)(x), (uintptr_t)(__value));\ + ATOMIC_SAN(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 -#define atomic_testandset_ptr kcsan_atomic_testandset_ptr +#define atomic_store_rel_ptr ATOMIC_SAN(store_rel_ptr) +#define atomic_swap_ptr ATOMIC_SAN(swap_ptr) +#define atomic_testandclear_ptr ATOMIC_SAN(testandclear_ptr) +#define atomic_testandset_ptr ATOMIC_SAN(testandset_ptr) -#define atomic_add_8 kcsan_atomic_add_8 -#define atomic_add_acq_8 kcsan_atomic_add_acq_8 -#define atomic_add_rel_8 kcsan_atomic_add_rel_8 -#define atomic_clear_8 kcsan_atomic_clear_8 -#define atomic_clear_acq_8 kcsan_atomic_clear_acq_8 -#define atomic_clear_rel_8 kcsan_atomic_clear_rel_8 -#define atomic_cmpset_8 kcsan_atomic_cmpset_8 -#define atomic_cmpset_acq_8 kcsan_atomic_cmpset_acq_8 -#define atomic_cmpset_rel_8 kcsan_atomic_cmpset_rel_8 -#define atomic_fcmpset_8 kcsan_atomic_fcmpset_8 -#define atomic_fcmpset_acq_8 kcsan_atomic_fcmpset_acq_8 -#define atomic_fcmpset_rel_8 kcsan_atomic_fcmpset_rel_8 -#define atomic_fetchadd_8 kcsan_atomic_fetchadd_8 -#define atomic_load_8 kcsan_atomic_load_8 -#define atomic_load_acq_8 kcsan_atomic_load_acq_8 -#define atomic_readandclear_8 kcsan_atomic_readandclear_8 -#define atomic_set_8 kcsan_atomic_set_8 -#define atomic_set_acq_8 kcsan_atomic_set_acq_8 -#define atomic_set_rel_8 kcsan_atomic_set_rel_8 -#define atomic_subtract_8 kcsan_atomic_subtract_8 -#define atomic_subtract_acq_8 kcsan_atomic_subtract_acq_8 -#define atomic_subtract_rel_8 kcsan_atomic_subtract_rel_8 -#define atomic_store_8 kcsan_atomic_store_8 -#define atomic_store_rel_8 kcsan_atomic_store_rel_8 -#define atomic_swap_8 kcsan_atomic_swap_8 -#define atomic_testandclear_8 kcsan_atomic_testandclear_8 -#define atomic_testandset_8 kcsan_atomic_testandset_8 +#define atomic_add_8 ATOMIC_SAN(add_8) +#define atomic_add_acq_8 ATOMIC_SAN(add_acq_8) +#define atomic_add_rel_8 ATOMIC_SAN(add_rel_8) +#define atomic_clear_8 ATOMIC_SAN(clear_8) +#define atomic_clear_acq_8 ATOMIC_SAN(clear_acq_8) +#define atomic_clear_rel_8 ATOMIC_SAN(clear_rel_8) +#define atomic_cmpset_8 ATOMIC_SAN(cmpset_8) +#define atomic_cmpset_acq_8 ATOMIC_SAN(cmpset_acq_8) +#define atomic_cmpset_rel_8 ATOMIC_SAN(cmpset_rel_8) +#define atomic_fcmpset_8 ATOMIC_SAN(fcmpset_8) +#define atomic_fcmpset_acq_8 ATOMIC_SAN(fcmpset_acq_8) +#define atomic_fcmpset_rel_8 ATOMIC_SAN(fcmpset_rel_8) +#define atomic_fetchadd_8 ATOMIC_SAN(fetchadd_8) +#define atomic_load_8 ATOMIC_SAN(load_8) +#define atomic_load_acq_8 ATOMIC_SAN(load_acq_8) +#define atomic_readandclear_8 ATOMIC_SAN(readandclear_8) +#define atomic_set_8 ATOMIC_SAN(set_8) +#define atomic_set_acq_8 ATOMIC_SAN(set_acq_8) +#define atomic_set_rel_8 ATOMIC_SAN(set_rel_8) +#define atomic_subtract_8 ATOMIC_SAN(subtract_8) +#define atomic_subtract_acq_8 ATOMIC_SAN(subtract_acq_8) +#define atomic_subtract_rel_8 ATOMIC_SAN(subtract_rel_8) +#define atomic_store_8 ATOMIC_SAN(store_8) +#define atomic_store_rel_8 ATOMIC_SAN(store_rel_8) +#define atomic_swap_8 ATOMIC_SAN(swap_8) +#define atomic_testandclear_8 ATOMIC_SAN(testandclear_8) +#define atomic_testandset_8 ATOMIC_SAN(testandset_8) -#define atomic_add_16 kcsan_atomic_add_16 -#define atomic_add_acq_16 kcsan_atomic_add_acq_16 -#define atomic_add_rel_16 kcsan_atomic_add_rel_16 -#define atomic_clear_16 kcsan_atomic_clear_16 -#define atomic_clear_acq_16 kcsan_atomic_clear_acq_16 -#define atomic_clear_rel_16 kcsan_atomic_clear_rel_16 -#define atomic_cmpset_16 kcsan_atomic_cmpset_16 -#define atomic_cmpset_acq_16 kcsan_atomic_cmpset_acq_16 -#define atomic_cmpset_rel_16 kcsan_atomic_cmpset_rel_16 -#define atomic_fcmpset_16 kcsan_atomic_fcmpset_16 -#define atomic_fcmpset_acq_16 kcsan_atomic_fcmpset_acq_16 -#define atomic_fcmpset_rel_16 kcsan_atomic_fcmpset_rel_16 -#define atomic_fetchadd_16 kcsan_atomic_fetchadd_16 -#define atomic_load_16 kcsan_atomic_load_16 -#define atomic_load_acq_16 kcsan_atomic_load_acq_16 -#define atomic_readandclear_16 kcsan_atomic_readandclear_16 -#define atomic_set_16 kcsan_atomic_set_16 -#define atomic_set_acq_16 kcsan_atomic_set_acq_16 -#define atomic_set_rel_16 kcsan_atomic_set_rel_16 -#define atomic_subtract_16 kcsan_atomic_subtract_16 -#define atomic_subtract_acq_16 kcsan_atomic_subtract_acq_16 -#define atomic_subtract_rel_16 kcsan_atomic_subtract_rel_16 -#define atomic_store_16 kcsan_atomic_store_16 -#define atomic_store_rel_16 kcsan_atomic_store_rel_16 -#define atomic_swap_16 kcsan_atomic_swap_16 -#define atomic_testandclear_16 kcsan_atomic_testandclear_16 -#define atomic_testandset_16 kcsan_atomic_testandset_16 +#define atomic_add_16 ATOMIC_SAN(add_16) +#define atomic_add_acq_16 ATOMIC_SAN(add_acq_16) +#define atomic_add_rel_16 ATOMIC_SAN(add_rel_16) +#define atomic_clear_16 ATOMIC_SAN(clear_16) +#define atomic_clear_acq_16 ATOMIC_SAN(clear_acq_16) +#define atomic_clear_rel_16 ATOMIC_SAN(clear_rel_16) +#define atomic_cmpset_16 ATOMIC_SAN(cmpset_16) +#define atomic_cmpset_acq_16 ATOMIC_SAN(cmpset_acq_16) +#define atomic_cmpset_rel_16 ATOMIC_SAN(cmpset_rel_16) +#define atomic_fcmpset_16 ATOMIC_SAN(fcmpset_16) +#define atomic_fcmpset_acq_16 ATOMIC_SAN(fcmpset_acq_16) +#define atomic_fcmpset_rel_16 ATOMIC_SAN(fcmpset_rel_16) +#define atomic_fetchadd_16 ATOMIC_SAN(fetchadd_16) +#define atomic_load_16 ATOMIC_SAN(load_16) +#define atomic_load_acq_16 ATOMIC_SAN(load_acq_16) +#define atomic_readandclear_16 ATOMIC_SAN(readandclear_16) +#define atomic_set_16 ATOMIC_SAN(set_16) +#define atomic_set_acq_16 ATOMIC_SAN(set_acq_16) +#define atomic_set_rel_16 ATOMIC_SAN(set_rel_16) +#define atomic_subtract_16 ATOMIC_SAN(subtract_16) +#define atomic_subtract_acq_16 ATOMIC_SAN(subtract_acq_16) +#define atomic_subtract_rel_16 ATOMIC_SAN(subtract_rel_16) +#define atomic_store_16 ATOMIC_SAN(store_16) +#define atomic_store_rel_16 ATOMIC_SAN(store_rel_16) +#define atomic_swap_16 ATOMIC_SAN(swap_16) +#define atomic_testandclear_16 ATOMIC_SAN(testandclear_16) +#define atomic_testandset_16 ATOMIC_SAN(testandset_16) -#define atomic_add_32 kcsan_atomic_add_32 -#define atomic_add_acq_32 kcsan_atomic_add_acq_32 -#define atomic_add_rel_32 kcsan_atomic_add_rel_32 -#define atomic_clear_32 kcsan_atomic_clear_32 -#define atomic_clear_acq_32 kcsan_atomic_clear_acq_32 -#define atomic_clear_rel_32 kcsan_atomic_clear_rel_32 -#define atomic_cmpset_32 kcsan_atomic_cmpset_32 -#define atomic_cmpset_acq_32 kcsan_atomic_cmpset_acq_32 -#define atomic_cmpset_rel_32 kcsan_atomic_cmpset_rel_32 -#define atomic_fcmpset_32 kcsan_atomic_fcmpset_32 -#define atomic_fcmpset_acq_32 kcsan_atomic_fcmpset_acq_32 -#define atomic_fcmpset_rel_32 kcsan_atomic_fcmpset_rel_32 -#define atomic_fetchadd_32 kcsan_atomic_fetchadd_32 -#define atomic_load_32 kcsan_atomic_load_32 -#define atomic_load_acq_32 kcsan_atomic_load_acq_32 -#define atomic_readandclear_32 kcsan_atomic_readandclear_32 -#define atomic_set_32 kcsan_atomic_set_32 -#define atomic_set_acq_32 kcsan_atomic_set_acq_32 -#define atomic_set_rel_32 kcsan_atomic_set_rel_32 -#define atomic_subtract_32 kcsan_atomic_subtract_32 -#define atomic_subtract_acq_32 kcsan_atomic_subtract_acq_32 -#define atomic_subtract_rel_32 kcsan_atomic_subtract_rel_32 -#define atomic_store_32 kcsan_atomic_store_32 -#define atomic_store_rel_32 kcsan_atomic_store_rel_32 -#define atomic_swap_32 kcsan_atomic_swap_32 -#define atomic_testandclear_32 kcsan_atomic_testandclear_32 -#define atomic_testandset_32 kcsan_atomic_testandset_32 +#define atomic_add_32 ATOMIC_SAN(add_32) +#define atomic_add_acq_32 ATOMIC_SAN(add_acq_32) +#define atomic_add_rel_32 ATOMIC_SAN(add_rel_32) +#define atomic_clear_32 ATOMIC_SAN(clear_32) +#define atomic_clear_acq_32 ATOMIC_SAN(clear_acq_32) +#define atomic_clear_rel_32 ATOMIC_SAN(clear_rel_32) +#define atomic_cmpset_32 ATOMIC_SAN(cmpset_32) +#define atomic_cmpset_acq_32 ATOMIC_SAN(cmpset_acq_32) +#define atomic_cmpset_rel_32 ATOMIC_SAN(cmpset_rel_32) +#define atomic_fcmpset_32 ATOMIC_SAN(fcmpset_32) +#define atomic_fcmpset_acq_32 ATOMIC_SAN(fcmpset_acq_32) +#define atomic_fcmpset_rel_32 ATOMIC_SAN(fcmpset_rel_32) +#define atomic_fetchadd_32 ATOMIC_SAN(fetchadd_32) +#define atomic_load_32 ATOMIC_SAN(load_32) +#define atomic_load_acq_32 ATOMIC_SAN(load_acq_32) +#define atomic_readandclear_32 ATOMIC_SAN(readandclear_32) +#define atomic_set_32 ATOMIC_SAN(set_32) +#define atomic_set_acq_32 ATOMIC_SAN(set_acq_32) +#define atomic_set_rel_32 ATOMIC_SAN(set_rel_32) +#define atomic_subtract_32 ATOMIC_SAN(subtract_32) +#define atomic_subtract_acq_32 ATOMIC_SAN(subtract_acq_32) +#define atomic_subtract_rel_32 ATOMIC_SAN(subtract_rel_32) +#define atomic_store_32 ATOMIC_SAN(store_32) +#define atomic_store_rel_32 ATOMIC_SAN(store_rel_32) +#define atomic_swap_32 ATOMIC_SAN(swap_32) +#define atomic_testandclear_32 ATOMIC_SAN(testandclear_32) +#define atomic_testandset_32 ATOMIC_SAN(testandset_32) -#define atomic_add_64 kcsan_atomic_add_64 -#define atomic_add_acq_64 kcsan_atomic_add_acq_64 -#define atomic_add_rel_64 kcsan_atomic_add_rel_64 -#define atomic_clear_64 kcsan_atomic_clear_64 -#define atomic_clear_acq_64 kcsan_atomic_clear_acq_64 -#define atomic_clear_rel_64 kcsan_atomic_clear_rel_64 -#define atomic_cmpset_64 kcsan_atomic_cmpset_64 -#define atomic_cmpset_acq_64 kcsan_atomic_cmpset_acq_64 -#define atomic_cmpset_rel_64 kcsan_atomic_cmpset_rel_64 -#define atomic_fcmpset_64 kcsan_atomic_fcmpset_64 -#define atomic_fcmpset_acq_64 kcsan_atomic_fcmpset_acq_64 -#define atomic_fcmpset_rel_64 kcsan_atomic_fcmpset_rel_64 -#define atomic_fetchadd_64 kcsan_atomic_fetchadd_64 -#define atomic_load_64 kcsan_atomic_load_64 -#define atomic_load_acq_64 kcsan_atomic_load_acq_64 -#define atomic_readandclear_64 kcsan_atomic_readandclear_64 -#define atomic_set_64 kcsan_atomic_set_64 -#define atomic_set_acq_64 kcsan_atomic_set_acq_64 -#define atomic_set_rel_64 kcsan_atomic_set_rel_64 -#define atomic_subtract_64 kcsan_atomic_subtract_64 -#define atomic_subtract_acq_64 kcsan_atomic_subtract_acq_64 -#define atomic_subtract_rel_64 kcsan_atomic_subtract_rel_64 -#define atomic_store_64 kcsan_atomic_store_64 -#define atomic_store_rel_64 kcsan_atomic_store_rel_64 -#define atomic_swap_64 kcsan_atomic_swap_64 -#define atomic_testandclear_64 kcsan_atomic_testandclear_64 -#define atomic_testandset_64 kcsan_atomic_testandset_64 +#define atomic_add_64 ATOMIC_SAN(add_64) +#define atomic_add_acq_64 ATOMIC_SAN(add_acq_64) +#define atomic_add_rel_64 ATOMIC_SAN(add_rel_64) +#define atomic_clear_64 ATOMIC_SAN(clear_64) +#define atomic_clear_acq_64 ATOMIC_SAN(clear_acq_64) +#define atomic_clear_rel_64 ATOMIC_SAN(clear_rel_64) +#define atomic_cmpset_64 ATOMIC_SAN(cmpset_64) +#define atomic_cmpset_acq_64 ATOMIC_SAN(cmpset_acq_64) +#define atomic_cmpset_rel_64 ATOMIC_SAN(cmpset_rel_64) +#define atomic_fcmpset_64 ATOMIC_SAN(fcmpset_64) +#define atomic_fcmpset_acq_64 ATOMIC_SAN(fcmpset_acq_64) +#define atomic_fcmpset_rel_64 ATOMIC_SAN(fcmpset_rel_64) +#define atomic_fetchadd_64 ATOMIC_SAN(fetchadd_64) +#define atomic_load_64 ATOMIC_SAN(load_64) +#define atomic_load_acq_64 ATOMIC_SAN(load_acq_64) +#define atomic_readandclear_64 ATOMIC_SAN(readandclear_64) +#define atomic_set_64 ATOMIC_SAN(set_64) +#define atomic_set_acq_64 ATOMIC_SAN(set_acq_64) +#define atomic_set_rel_64 ATOMIC_SAN(set_rel_64) +#define atomic_subtract_64 ATOMIC_SAN(subtract_64) +#define atomic_subtract_acq_64 ATOMIC_SAN(subtract_acq_64) +#define atomic_subtract_rel_64 ATOMIC_SAN(subtract_rel_64) +#define atomic_store_64 ATOMIC_SAN(store_64) +#define atomic_store_rel_64 ATOMIC_SAN(store_rel_64) +#define atomic_swap_64 ATOMIC_SAN(swap_64) +#define atomic_testandclear_64 ATOMIC_SAN(testandclear_64) +#define atomic_testandset_64 ATOMIC_SAN(testandset_64) -#define atomic_thread_fence_acq kcsan_atomic_thread_fence_acq -#define atomic_thread_fence_acq_rel kcsan_atomic_thread_fence_acq_rel -#define atomic_thread_fence_rel kcsan_atomic_thread_fence_rel -#define atomic_thread_fence_seq_cst kcsan_atomic_thread_fence_seq_cst -#define atomic_interrupt_fence __compiler_membar +#define atomic_thread_fence_acq ATOMIC_SAN(thread_fence_acq) +#define atomic_thread_fence_acq_rel ATOMIC_SAN(thread_fence_acq_rel) +#define atomic_thread_fence_rel ATOMIC_SAN(thread_fence_rel) +#define atomic_thread_fence_seq_cst ATOMIC_SAN(thread_fence_seq_cst) +#define atomic_interrupt_fence ATOMIC_SAN(interrupt_fence) -#endif /* !KCSAN_RUNTIME */ +#endif /* !SAN_RUNTIME */ #endif /* !_SYS_ATOMIC_SAN_H_ */ diff --git a/sys/sys/bus_san.h b/sys/sys/bus_san.h index 96b2441fbdbe..05d5ecd4b844 100644 --- a/sys/sys/bus_san.h +++ b/sys/sys/bus_san.h @@ -2,12 +2,16 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Andrew Turner + * Copyright (c) 2021 The FreeBSD Foundation * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory (Department of Computer Science and * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the * DARPA SSITH research programme. * + * Portions of this software were written by Mark Johnston under sponsorship by + * the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -35,174 +39,190 @@ #ifndef _SYS_BUS_SAN_H_ #define _SYS_BUS_SAN_H_ -#define KCSAN_BS_MULTI(rw, width, type) \ - void kcsan_bus_space_##rw##_multi_##width(bus_space_tag_t, \ +#ifndef _MACHINE_BUS_H_ +#error do not include this header, use machine/bus.h +#endif + +#ifndef BUS_SAN_PREFIX +#error No sanitizer prefix defined +#endif + +#define BUS_SAN_MULTI(sp, rw, width, type) \ + void sp##_bus_space_##rw##_multi_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type *, bus_size_t); \ - void kcsan_bus_space_##rw##_multi_stream_##width(bus_space_tag_t, \ + void sp##_bus_space_##rw##_multi_stream_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type *, bus_size_t); \ - void kcsan_bus_space_##rw##_region_##width(bus_space_tag_t, \ + void sp##_bus_space_##rw##_region_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type *, bus_size_t); \ - void kcsan_bus_space_##rw##_region_stream_##width(bus_space_tag_t, \ + void sp##_bus_space_##rw##_region_stream_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type *, bus_size_t) -#define KCSAN_BS_READ(width, type) \ - type kcsan_bus_space_read_##width(bus_space_tag_t, \ +#define BUS_SAN_READ(sp, width, type) \ + type sp##_bus_space_read_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t); \ - type kcsan_bus_space_read_stream_##width(bus_space_tag_t, \ + type sp##_bus_space_read_stream_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t); \ - KCSAN_BS_MULTI(read, width, type) + BUS_SAN_MULTI(sp, read, width, type) -#define KCSAN_BS_WRITE(width, type) \ - void kcsan_bus_space_write_##width(bus_space_tag_t, \ +#define BUS_SAN_WRITE(sp, width, type) \ + void sp##_bus_space_write_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type); \ - void kcsan_bus_space_write_stream_##width(bus_space_tag_t, \ + void sp##_bus_space_write_stream_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type); \ - KCSAN_BS_MULTI(write, width, const type) + BUS_SAN_MULTI(sp, write, width, const type) -#define KCSAN_BS_SET(width, type) \ - void kcsan_bus_space_set_multi_##width(bus_space_tag_t, \ +#define BUS_SAN_SET(sp, width, type) \ + void sp##_bus_space_set_multi_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type, bus_size_t); \ - void kcsan_bus_space_set_multi_stream_##width(bus_space_tag_t, \ + void sp##_bus_space_set_multi_stream_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type, bus_size_t); \ - void kcsan_bus_space_set_region_##width(bus_space_tag_t, \ + void sp##_bus_space_set_region_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type, bus_size_t); \ - void kcsan_bus_space_set_region_stream_##width(bus_space_tag_t, \ + void sp##_bus_space_set_region_stream_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type, bus_size_t) -#define KCSAN_BS_COPY(width, type) \ - void kcsan_bus_space_copy_region_##width(bus_space_tag_t, \ +#define BUS_SAN_COPY(sp, width, type) \ + void sp##_bus_space_copy_region_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, bus_space_handle_t, \ bus_size_t, bus_size_t); \ - void kcsan_bus_space_copy_region_stream_##width(bus_space_tag_t, \ + void sp##_bus_space_copy_region_stream_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, bus_space_handle_t, \ bus_size_t, bus_size_t); -#define KCSAN_BS_PEEK(width, type) \ - int kcsan_bus_space_peek_##width(bus_space_tag_t, \ +#define BUS_SAN_PEEK(sp, width, type) \ + int sp##_bus_space_peek_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type *); -#define KCSAN_BS_POKE(width, type) \ - int kcsan_bus_space_poke_##width(bus_space_tag_t, \ +#define BUS_SAN_POKE(sp, width, type) \ + int sp##_bus_space_poke_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type); -#define KCSAN_BS(width, type) \ - KCSAN_BS_READ(width, type); \ - KCSAN_BS_WRITE(width, type); \ - KCSAN_BS_SET(width, type); \ - KCSAN_BS_COPY(width, type) \ - KCSAN_BS_PEEK(width, type); \ - KCSAN_BS_POKE(width, type); - -KCSAN_BS(1, uint8_t); -KCSAN_BS(2, uint16_t); -KCSAN_BS(4, uint32_t); -KCSAN_BS(8, uint64_t); - -int kcsan_bus_space_map(bus_space_tag_t, bus_addr_t, bus_size_t, int, - bus_space_handle_t *); -void kcsan_bus_space_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t); -int kcsan_bus_space_subregion(bus_space_tag_t, bus_space_handle_t, bus_size_t, - bus_size_t, bus_space_handle_t *); -int kcsan_bus_space_alloc(bus_space_tag_t, bus_addr_t, bus_addr_t, - bus_size_t, bus_size_t, bus_size_t, int, bus_addr_t *, *** 283 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Tue Mar 23 07:33:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E38857C8D2; Tue, 23 Mar 2021 07:33: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 4F4NQK2gKcz4Rqw; Tue, 23 Mar 2021 07:33: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 4E6341D288; Tue, 23 Mar 2021 07:33: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 12N7XT9P099257; Tue, 23 Mar 2021 07:33:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12N7XTaO099256; Tue, 23 Mar 2021 07:33:29 GMT (envelope-from git) Date: Tue, 23 Mar 2021 07:33:29 GMT Message-Id: <202103230733.12N7XTaO099256@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: 62ffcaab8f3c - main - loader: insert spaces around menu title 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: 62ffcaab8f3ccba6053d4a5622c5ef2de9f636b5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 07:33:29 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=62ffcaab8f3ccba6053d4a5622c5ef2de9f636b5 commit 62ffcaab8f3ccba6053d4a5622c5ef2de9f636b5 Author: Toomas Soome AuthorDate: 2021-03-23 05:04:48 +0000 Commit: Toomas Soome CommitDate: 2021-03-23 07:31:36 +0000 loader: insert spaces around menu title Small visual nit, make menu title more clean MFC after: 3 days --- stand/forth/menu.4th | 3 ++- stand/lua/drawer.lua | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/stand/forth/menu.4th b/stand/forth/menu.4th index 6b0869cfe3b9..a336b9f9e7aa 100644 --- a/stand/forth/menu.4th +++ b/stand/forth/menu.4th @@ -489,7 +489,8 @@ also menu-infrastructure definitions if ( use default center alignement? ) menuX @ 19 + over 2 / - menuY @ 1- then - at-xy type + swap 1- swap + at-xy space type space \ If $menu_init is set, evaluate it (allowing for whole menus to be \ constructed dynamically -- as this function could conceivably set diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index eb9b18117cd3..523735a75d06 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -285,8 +285,8 @@ local function drawbox() if menu_header_x == nil then menu_header_x = x + (w // 2) - (#menu_header // 2) end - screen.setcursor(menu_header_x, y) - printc(menu_header) + screen.setcursor(menu_header_x - 1, y) + printc(" " .. menu_header .. " ") end local function drawbrand() From owner-dev-commits-src-main@freebsd.org Tue Mar 23 08:13:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB39657E151; Tue, 23 Mar 2021 08:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F4PHz5HkPz4V18; Tue, 23 Mar 2021 08:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A88961D897; Tue, 23 Mar 2021 08:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12N8D3oa055973; Tue, 23 Mar 2021 08:13:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12N8D3CW055972; Tue, 23 Mar 2021 08:13:03 GMT (envelope-from git) Date: Tue, 23 Mar 2021 08:13:03 GMT Message-Id: <202103230813.12N8D3CW055972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: be97fc8dced0 - main - bhyve amd: Small cleanups in amdvi_dump_cmds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be97fc8dced052f824387a1ae6a0063f9dcfdc89 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 08:13:03 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=be97fc8dced052f824387a1ae6a0063f9dcfdc89 commit be97fc8dced052f824387a1ae6a0063f9dcfdc89 Author: Ka Ho Ng AuthorDate: 2021-03-23 08:11:56 +0000 Commit: Ka Ho Ng CommitDate: 2021-03-23 08:12:41 +0000 bhyve amd: Small cleanups in amdvi_dump_cmds Bump offset with MOD_INC instead in amdvi_dump_cmds. Reviewed by: jhb Approved by: philip (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28862 --- sys/amd64/vmm/amd/amdvi_hw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/amd64/vmm/amd/amdvi_hw.c b/sys/amd64/vmm/amd/amdvi_hw.c index 3fe84cc1445a..3581b43ea4de 100644 --- a/sys/amd64/vmm/amd/amdvi_hw.c +++ b/sys/amd64/vmm/amd/amdvi_hw.c @@ -515,8 +515,7 @@ amdvi_dump_cmds(struct amdvi_softc *softc, int count) printf(" [CMD%d, off:0x%x] opcode= 0x%x 0x%x" " 0x%x 0x%lx\n", i, off, cmd->opcode, cmd->word0, cmd->word1, cmd->addr); - off = (off + sizeof(struct amdvi_cmd)) % - (softc->cmd_max * sizeof(struct amdvi_cmd)); + off = MOD_INC(off, sizeof(struct amdvi_cmd), softc->cmd_max); } } From owner-dev-commits-src-main@freebsd.org Tue Mar 23 10:07:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B78FA5A9247; Tue, 23 Mar 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 4F4RrT4plyz4cM6; Tue, 23 Mar 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 93FC61ED33; Tue, 23 Mar 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 12NA7r63011140; Tue, 23 Mar 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 12NA7rRe011139; Tue, 23 Mar 2021 10:07:53 GMT (envelope-from git) Date: Tue, 23 Mar 2021 10:07:53 GMT Message-Id: <202103231007.12NA7rRe011139@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: 4489124c0472 - main - xen/netback: do not attempt to connect in the Initialised state 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: 4489124c04727a4aad418eec3148e0c8de23ff4d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 10:07:53 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=4489124c04727a4aad418eec3148e0c8de23ff4d commit 4489124c04727a4aad418eec3148e0c8de23ff4d Author: Roger Pau Monné AuthorDate: 2021-03-16 11:43:49 +0000 Commit: Roger Pau Monné CommitDate: 2021-03-23 10:07:09 +0000 xen/netback: do not attempt to connect in the Initialised state Only attempt to fetch the configuration data and connect the shared ring once the frontend has switched to the 'Connected' state. This seems to be inline with what Linux netback does, and is required to make newer versions of NetBSD netfront work, since NetBSD only publishes the required configuration before switching to the Connected state. MFC after: 1 week Sponsored by: Citrix Systems R&D --- sys/dev/xen/netback/netback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/xen/netback/netback.c b/sys/dev/xen/netback/netback.c index 8710120ecef3..06d92093d903 100644 --- a/sys/dev/xen/netback/netback.c +++ b/sys/dev/xen/netback/netback.c @@ -1392,8 +1392,8 @@ xnb_frontend_changed(device_t dev, XenbusState frontend_state) switch (frontend_state) { case XenbusStateInitialising: - break; case XenbusStateInitialised: + break; case XenbusStateConnected: xnb_connect(xnb); break; From owner-dev-commits-src-main@freebsd.org Tue Mar 23 10:50:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C93B55A9FDC; Tue, 23 Mar 2021 10:50: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 4F4SnG4W1Tz4fs1; Tue, 23 Mar 2021 10:50: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 8E4AA1F976; Tue, 23 Mar 2021 10:50: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 12NAoA4R069943; Tue, 23 Mar 2021 10:50:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NAoAtF069940; Tue, 23 Mar 2021 10:50:10 GMT (envelope-from git) Date: Tue, 23 Mar 2021 10:50:10 GMT Message-Id: <202103231050.12NAoAtF069940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 3c6b59567f61 - main - gpioc_detach: fix freeing of wrong pointers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c6b59567f61277ed487320aa9ad130c6894ad7a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 10:50:10 -0000 The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=3c6b59567f61277ed487320aa9ad130c6894ad7a commit 3c6b59567f61277ed487320aa9ad130c6894ad7a Author: Andriy Gapon AuthorDate: 2021-03-23 10:45:18 +0000 Commit: Andriy Gapon CommitDate: 2021-03-23 10:45:18 +0000 gpioc_detach: fix freeing of wrong pointers MFC after: 1 week --- sys/dev/gpio/gpioc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 9e46b32ffcba..15d0848fc020 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -618,7 +618,7 @@ gpioc_detach(device_t dev) for (int i = 0; i < sc->sc_npins; i++) { mtx_destroy(&sc->sc_pin_intr[i].mtx); - free(&sc->sc_pin_intr[i].pin, M_GPIOC); + free(sc->sc_pin_intr[i].pin, M_GPIOC); } free(sc->sc_pin_intr, M_GPIOC); From owner-dev-commits-src-main@freebsd.org Tue Mar 23 13:30:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A53895AEC0F; Tue, 23 Mar 2021 13:30: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 4F4XKx4K2Zz4rP2; Tue, 23 Mar 2021 13:30: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 8743C218D2; Tue, 23 Mar 2021 13:30: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 12NDUDl9095861; Tue, 23 Mar 2021 13:30:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NDUD7t095851; Tue, 23 Mar 2021 13:30:13 GMT (envelope-from git) Date: Tue, 23 Mar 2021 13:30:13 GMT Message-Id: <202103231330.12NDUD7t095851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: c2f16c595eb5 - main - Fix scripted installs on EFI systems after default mounting of the ESP. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2f16c595eb51c6e0cb6ece3f6f078d738019059 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 13:30:13 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=c2f16c595eb51c6e0cb6ece3f6f078d738019059 commit c2f16c595eb51c6e0cb6ece3f6f078d738019059 Author: Nathan Whitehorn AuthorDate: 2021-03-23 13:19:42 +0000 Commit: Nathan Whitehorn CommitDate: 2021-03-23 13:29:54 +0000 Fix scripted installs on EFI systems after default mounting of the ESP. Because the ESP mount point (/boot/efi) is in mtree, tar will attempt to extract a directory at that point post-mount when the system is installed. Normally, this is fine, since tar can happily set whatever properties it wants. For FAT32 file systems, however, like the ESP, tar will attempt to set mtime on the root directory, which FAT does not support, and tar will interpret this as a fatal error, breaking the install (see https://github.com/libarchive/libarchive/issues/1516). This issue would also break scripted installs on bare-metal POWER8, POWER9, and PS3 systems, as well as some ARM systems. This patch solves the problem in two ways: - If stdout is a TTY, use the distextract stage instead of tar, as in interactive installs. distextract solves this problem internally and provides a nicer UI to boot, but requires a TTY. - If stdout is not a TTY, use tar but, as a stopgap for 13.0, exclude boot/efi from tarball extraction and then add it by hand. This is a hack, and better solutions (as in the libarchive ticket above) will obsolete it, but it solves the most common case, leaving only unattended TTY-less installs on a few tier-2 platforms broken. In addition, fix a bug with fstab generation uncovered once the tar issue is fixed that umount(8) can depend on the ordering of lines in fstab in a way that mount(8) does not. The partition editor now writes out fstab in mount order, making sure umount (run at the end of scripted, but not interactive, installs) succeeds. PR: 254395 Reviewed by: gjb, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29380 --- usr.sbin/bsdinstall/partedit/partedit.c | 39 +++++++++++++++++++++++++++++++++ usr.sbin/bsdinstall/scripts/script | 30 ++++++++++++++++++------- 2 files changed, 61 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bsdinstall/partedit/partedit.c b/usr.sbin/bsdinstall/partedit/partedit.c index c5fa28e73582..6d045428dd32 100644 --- a/usr.sbin/bsdinstall/partedit/partedit.c +++ b/usr.sbin/bsdinstall/partedit/partedit.c @@ -323,6 +323,22 @@ validate_setup(void) return (TRUE); } +static int +mountpoint_sorter(const void *xa, const void *xb) +{ + struct partition_metadata *a = *(struct partition_metadata **)xa; + struct partition_metadata *b = *(struct partition_metadata **)xb; + + if (a->fstab == NULL && b->fstab == NULL) + return 0; + if (a->fstab == NULL) + return 1; + if (b->fstab == NULL) + return -1; + + return strcmp(a->fstab->fs_file, b->fstab->fs_file); +} + static int apply_changes(struct gmesh *mesh) { @@ -386,6 +402,29 @@ apply_changes(struct gmesh *mesh) free(__DECONST(char *, items[i*2])); free(items); + /* Sort filesystems for fstab so that mountpoints are ordered */ + { + struct partition_metadata **tobesorted; + struct partition_metadata *tmp; + int nparts = 0; + TAILQ_FOREACH(md, &part_metadata, metadata) + nparts++; + tobesorted = malloc(sizeof(struct partition_metadata *)*nparts); + nparts = 0; + TAILQ_FOREACH_SAFE(md, &part_metadata, metadata, tmp) { + tobesorted[nparts++] = md; + TAILQ_REMOVE(&part_metadata, md, metadata); + } + qsort(tobesorted, nparts, sizeof(tobesorted[0]), + mountpoint_sorter); + + /* Now re-add everything */ + while (nparts-- > 0) + TAILQ_INSERT_HEAD(&part_metadata, + tobesorted[nparts], metadata); + free(tobesorted); + } + if (getenv("PATH_FSTAB") != NULL) fstab_path = getenv("PATH_FSTAB"); else diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script index 4d0a91833644..1d8e52a9d6d3 100755 --- a/usr.sbin/bsdinstall/scripts/script +++ b/usr.sbin/bsdinstall/scripts/script @@ -116,14 +116,28 @@ fi # Unpack distributions bsdinstall checksum -for set in $DISTRIBUTIONS; do - f_dprintf "Extracting $BSDINSTALL_DISTDIR/$set" - # XXX: this will fail if any mountpoints are FAT, due to inability to - # set ctime/mtime on the root of FAT partitions. tar has no option to - # ignore this. We probably need to switch back to distextract here - # to properly support EFI. - tar -xf "$BSDINSTALL_DISTDIR/$set" -C $BSDINSTALL_CHROOT -done +if [ -t 0 ]; then + # If install is a tty, use distextract as normal + bsdinstall distextract +else + # Otherwise, we need to use tar (see https://reviews.freebsd.org/D10736) + for set in $DISTRIBUTIONS; do + f_dprintf "Extracting $BSDINSTALL_DISTDIR/$set" + # XXX: The below fails if any mountpoints are FAT, due to + # inability to set ctime/mtime on the root of FAT partitions, + # which is needed to support e.g. EFI system partitions. tar has + # no option to ignore this (distextract ignores them internally + # through a hack), and returns 1 on any warning or error, + # effectively turning all warnings into fatal errors. + # + # Work around this in an extremely lame way for the specific + # case of EFI system partitions only. This *ONLY WORKS* if + # /boot/efi is empty and does not handle analagous problems on + # other systems (ARM, PPC64). + tar -xf "$BSDINSTALL_DISTDIR/$set" -C $BSDINSTALL_CHROOT --exclude boot/efi + mkdir -p $BSDINSTALL_CHROOT/boot/efi + done +fi # Configure bootloader if needed bsdinstall bootconfig From owner-dev-commits-src-main@freebsd.org Tue Mar 23 14:01:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 062295AFAB1; Tue, 23 Mar 2021 14:01: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 4F4Y1V6lmmz4tHv; Tue, 23 Mar 2021 14:01: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 DA72621EF0; Tue, 23 Mar 2021 14:01: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 12NE1242042344; Tue, 23 Mar 2021 14:01:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NE12k4042342; Tue, 23 Mar 2021 14:01:02 GMT (envelope-from git) Date: Tue, 23 Mar 2021 14:01:02 GMT Message-Id: <202103231401.12NE12k4042342@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: 6be3386466ab - main - Update DTS files from Linux v5.10 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: 6be3386466ab79a84b48429ae66244f21526d3df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 14:01:03 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=6be3386466ab79a84b48429ae66244f21526d3df commit 6be3386466ab79a84b48429ae66244f21526d3df Merge: c2f16c595eb5 e7ffa3b5ce04 Author: Emmanuel Vadot AuthorDate: 2021-03-23 14:00:35 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-23 14:00:35 +0000 Update DTS files from Linux v5.10 sys/contrib/device-tree/Bindings/.gitignore | 1 + sys/contrib/device-tree/Bindings/.yamllint | 39 + sys/contrib/device-tree/Bindings/Makefile | 52 +- sys/contrib/device-tree/Bindings/arm/actions.yaml | 15 + sys/contrib/device-tree/Bindings/arm/altera.yaml | 5 + .../device-tree/Bindings/arm/amazon,al.yaml | 2 + sys/contrib/device-tree/Bindings/arm/amlogic.yaml | 5 + .../device-tree/Bindings/arm/arm,integrator.yaml | 2 + .../device-tree/Bindings/arm/arm,realview.yaml | 2 + .../device-tree/Bindings/arm/arm,versatile.yaml | 2 + .../Bindings/arm/arm,vexpress-juno.yaml | 2 + .../device-tree/Bindings/arm/atmel-at91.yaml | 3 + sys/contrib/device-tree/Bindings/arm/axxia.yaml | 4 + .../device-tree/Bindings/arm/bcm/bcm2835.yaml | 2 + .../Bindings/arm/bcm/brcm,bcm11351.yaml | 2 + .../Bindings/arm/bcm/brcm,bcm21664.yaml | 2 + .../Bindings/arm/bcm/brcm,bcm23550.yaml | 2 + .../device-tree/Bindings/arm/bcm/brcm,bcm4708.yaml | 5 + .../device-tree/Bindings/arm/bcm/brcm,cygnus.yaml | 2 + .../device-tree/Bindings/arm/bcm/brcm,hr2.yaml | 2 + .../device-tree/Bindings/arm/bcm/brcm,ns2.yaml | 2 + .../device-tree/Bindings/arm/bcm/brcm,nsp.yaml | 2 + .../Bindings/arm/bcm/brcm,stingray.yaml | 2 + .../Bindings/arm/bcm/brcm,vulcan-soc.yaml | 2 + .../arm/bcm/raspberrypi,bcm2835-firmware.yaml | 23 + sys/contrib/device-tree/Bindings/arm/bitmain.yaml | 5 + sys/contrib/device-tree/Bindings/arm/calxeda.yaml | 2 + .../device-tree/Bindings/arm/coresight-cti.yaml | 2 + sys/contrib/device-tree/Bindings/arm/cpus.yaml | 2 + .../device-tree/Bindings/arm/digicolor.yaml | 4 + .../Bindings/arm/freescale/fsl,imx7ulp-pm.yaml | 42 + .../Bindings/arm/freescale/fsl,imx7ulp-sim.yaml | 38 + sys/contrib/device-tree/Bindings/arm/fsl.yaml | 97 + .../Bindings/arm/hisilicon/controller/cpuctrl.yaml | 54 + .../hisilicon/controller/hi3798cv200-perictrl.yaml | 64 + .../hisilicon/controller/hi6220-domain-ctrl.yaml | 68 + .../hisilicon/controller/hip04-bootwrapper.yaml | 34 + .../arm/hisilicon/controller/hip04-fabric.yaml | 27 + .../Bindings/arm/hisilicon/controller/pctrl.yaml | 34 + .../Bindings/arm/hisilicon/controller/sysctrl.yaml | 132 + .../Bindings/arm/hisilicon/hisilicon.yaml | 70 + .../Bindings/arm/hisilicon/low-pin-count.yaml | 61 + .../device-tree/Bindings/arm/intel,keembay.yaml | 3 + .../device-tree/Bindings/arm/intel-ixp4xx.yaml | 4 + .../Bindings/arm/keystone/ti,k3-sci-common.yaml | 2 + .../Bindings/arm/marvell/armada-7k-8k.yaml | 2 + sys/contrib/device-tree/Bindings/arm/mediatek.yaml | 3 + .../Bindings/arm/mediatek/mediatek,apmixedsys.txt | 1 + .../Bindings/arm/mediatek/mediatek,audsys.txt | 1 + .../Bindings/arm/mediatek/mediatek,imgsys.txt | 1 + .../Bindings/arm/mediatek/mediatek,infracfg.txt | 1 + .../Bindings/arm/mediatek/mediatek,mfgcfg.txt | 1 + .../Bindings/arm/mediatek/mediatek,pericfg.yaml | 2 + .../Bindings/arm/mediatek/mediatek,topckgen.txt | 1 + .../Bindings/arm/mediatek/mediatek,vdecsys.txt | 1 + .../device-tree/Bindings/arm/microchip,sparx5.yaml | 2 + sys/contrib/device-tree/Bindings/arm/moxart.yaml | 1 + .../device-tree/Bindings/arm/mrvl/mrvl.yaml | 3 + .../device-tree/Bindings/arm/mstar/mstar.yaml | 2 + .../Bindings/arm/nvidia,tegra194-ccplex.yaml | 2 + .../device-tree/Bindings/arm/nxp/lpc32xx.yaml | 2 + .../device-tree/Bindings/arm/omap/prm-inst.txt | 2 + sys/contrib/device-tree/Bindings/arm/pmu.yaml | 2 + .../device-tree/Bindings/arm/primecell.yaml | 3 + sys/contrib/device-tree/Bindings/arm/qcom.yaml | 15 + sys/contrib/device-tree/Bindings/arm/rda.yaml | 4 + sys/contrib/device-tree/Bindings/arm/realtek.yaml | 3 + sys/contrib/device-tree/Bindings/arm/renesas.yaml | 14 + sys/contrib/device-tree/Bindings/arm/rockchip.yaml | 19 +- .../device-tree/Bindings/arm/samsung/pmu.yaml | 27 +- .../Bindings/arm/samsung/samsung-boards.yaml | 2 + sys/contrib/device-tree/Bindings/arm/sirf.yaml | 3 + .../Bindings/arm/socionext/milbeaut.yaml | 3 + .../Bindings/arm/socionext/uniphier.yaml | 2 + sys/contrib/device-tree/Bindings/arm/spear.yaml | 3 + .../device-tree/Bindings/arm/sprd/sprd.yaml | 2 + sys/contrib/device-tree/Bindings/arm/sti.yaml | 3 + .../device-tree/Bindings/arm/stm32/st,mlahb.yaml | 2 + .../device-tree/Bindings/arm/stm32/stm32.yaml | 11 + sys/contrib/device-tree/Bindings/arm/sunxi.yaml | 12 + sys/contrib/device-tree/Bindings/arm/tegra.yaml | 8 + .../Bindings/arm/tegra/nvidia,tegra186-pmc.txt | 3 +- .../Bindings/arm/tegra/nvidia,tegra20-pmc.yaml | 2 + sys/contrib/device-tree/Bindings/arm/ti/k3.yaml | 38 + .../device-tree/Bindings/arm/ti/nspire.yaml | 3 + .../device-tree/Bindings/arm/ti/ti,davinci.yaml | 3 + sys/contrib/device-tree/Bindings/arm/toshiba.yaml | 25 + sys/contrib/device-tree/Bindings/arm/ux500.yaml | 2 + sys/contrib/device-tree/Bindings/arm/vt8500.yaml | 3 + sys/contrib/device-tree/Bindings/arm/xilinx.yaml | 2 + sys/contrib/device-tree/Bindings/arm/zte.yaml | 2 + .../device-tree/Bindings/ata/faraday,ftide010.yaml | 2 + sys/contrib/device-tree/Bindings/ata/imx-sata.yaml | 83 + .../device-tree/Bindings/ata/pata-common.yaml | 2 + .../device-tree/Bindings/ata/sata-common.yaml | 2 + .../device-tree/Bindings/bus/brcm,gisb-arb.txt | 3 +- .../device-tree/Bindings/bus/mti,mips-cdmm.yaml | 2 + .../device-tree/Bindings/bus/renesas,bsc.yaml | 2 + .../device-tree/Bindings/bus/simple-pm-bus.yaml | 2 + .../bus/socionext,uniphier-system-bus.yaml | 7 + .../Bindings/chrome/google,cros-ec-typec.yaml | 2 + .../Bindings/clock/allwinner,sun4i-a10-ccu.yaml | 7 +- .../Bindings/clock/arm,syscon-icst.yaml | 2 + .../Bindings/clock/baikal,bt1-ccu-div.yaml | 6 +- .../Bindings/clock/baikal,bt1-ccu-pll.yaml | 2 +- .../device-tree/Bindings/clock/hi6220-clock.txt | 2 +- .../Bindings/clock/idt,versaclock5.yaml | 20 +- .../device-tree/Bindings/clock/imx23-clock.yaml | 4 +- .../device-tree/Bindings/clock/imx28-clock.yaml | 6 +- .../device-tree/Bindings/clock/imx5-clock.yaml | 2 +- .../device-tree/Bindings/clock/imx6q-clock.yaml | 2 + .../device-tree/Bindings/clock/imx6sl-clock.yaml | 2 + .../device-tree/Bindings/clock/imx6sll-clock.yaml | 2 + .../device-tree/Bindings/clock/imx6sx-clock.yaml | 2 + .../device-tree/Bindings/clock/imx6ul-clock.yaml | 2 + .../device-tree/Bindings/clock/imx8m-clock.yaml | 125 + .../device-tree/Bindings/clock/imx8qxp-lpcg.yaml | 2 +- .../device-tree/Bindings/clock/intel,cgu-lgm.yaml | 2 + .../Bindings/clock/qcom,dispcc-sm8x50.yaml | 93 + .../Bindings/clock/qcom,gcc-sm8250.yaml | 2 + .../device-tree/Bindings/clock/qcom,videocc.yaml | 73 + .../Bindings/clock/renesas,cpg-mssr.yaml | 1 + .../Bindings/clock/sifive/fu540-prci.yaml | 60 + .../Bindings/clock/sprd,sc9863a-clk.yaml | 2 + .../Bindings/clock/ti,am654-ehrpwm-tbclk.yaml | 2 + .../Bindings/connector/usb-connector.yaml | 76 +- .../Bindings/cpufreq/cpufreq-qcom-hw.txt | 2 +- .../crypto/allwinner,sun4i-a10-crypto.yaml | 6 +- .../device-tree/Bindings/crypto/fsl-dcp.yaml | 51 + .../Bindings/crypto/fsl-imx-sahara.yaml | 37 + .../device-tree/Bindings/crypto/fsl-imx-scc.yaml | 54 + .../Bindings/crypto/samsung-slimsss.yaml | 2 +- .../display/allwinner,sun6i-a31-mipi-dsi.yaml | 11 +- .../Bindings/display/brcm,bcm2711-hdmi.yaml | 123 + .../Bindings/display/brcm,bcm2835-dsi0.yaml | 3 + .../Bindings/display/brcm,bcm2835-hvs.yaml | 18 +- .../Bindings/display/brcm,bcm2835-pixelvalve0.yaml | 5 + .../Bindings/display/brcm,bcm2835-vc4.yaml | 1 + .../Bindings/display/bridge/cdns,mhdp8546.yaml | 169 ++ .../Bindings/display/bridge/ite,it6505.yaml | 5 + .../Bindings/display/bridge/lontium,lt9611.yaml | 176 ++ .../Bindings/display/bridge/lvds-codec.yaml | 6 + .../Bindings/display/bridge/nwl-dsi.yaml | 15 +- .../Bindings/display/bridge/renesas,dw-hdmi.txt | 4 +- .../Bindings/display/bridge/renesas,lvds.yaml | 2 + .../Bindings/display/bridge/snps,dw-mipi-dsi.yaml | 2 + .../Bindings/display/bridge/toshiba,tc358762.yaml | 127 + .../Bindings/display/bridge/toshiba,tc358775.yaml | 217 ++ .../Bindings/display/dsi-controller.yaml | 2 + .../Bindings/display/imx/nxp,imx8mq-dcss.yaml | 108 + .../Bindings/display/mediatek/mediatek,disp.txt | 2 +- .../Bindings/display/mediatek/mediatek,dpi.txt | 2 +- .../Bindings/display/mediatek/mediatek,dsi.txt | 4 +- .../Bindings/display/mediatek/mediatek,hdmi.txt | 4 + .../device-tree/Bindings/display/msm/dsi.txt | 6 +- .../device-tree/Bindings/display/msm/gmu.yaml | 2 + .../Bindings/display/panel/ilitek,ili9881c.yaml | 1 + .../device-tree/Bindings/display/panel/lvds.yaml | 2 + .../display/panel/mantix,mlaf057we51-x.yaml | 74 + .../Bindings/display/panel/panel-common.yaml | 2 + .../Bindings/display/panel/panel-simple.yaml | 8 + .../display/panel/rocktech,jh057n00900.yaml | 40 +- .../display/panel/samsung,amoled-mipi-dsi.yaml | 12 +- .../Bindings/display/panel/tpo,tpg110.yaml | 2 + .../device-tree/Bindings/display/renesas,du.txt | 6 + .../device-tree/Bindings/display/ssd1307fb.txt | 1 + .../device-tree/Bindings/display/st,stm32-dsi.yaml | 23 +- .../display/tegra/nvidia,tegra20-host1x.txt | 92 +- .../device-tree/Bindings/display/tilcdc/tilcdc.txt | 2 +- .../Bindings/dma/allwinner,sun50i-a64-dma.yaml | 9 +- .../device-tree/Bindings/dma/dma-common.yaml | 2 + .../device-tree/Bindings/dma/dma-controller.yaml | 2 + .../device-tree/Bindings/dma/dma-router.yaml | 2 + .../device-tree/Bindings/dma/ingenic,dma.yaml | 2 + .../Bindings/dma/renesas,rcar-dmac.yaml | 1 + .../Bindings/dma/snps,dma-spear1340.yaml | 7 +- .../device-tree/Bindings/dma/st,stm32-dma.yaml | 2 + .../device-tree/Bindings/dma/st,stm32-dmamux.yaml | 2 + .../device-tree/Bindings/dma/st,stm32-mdma.yaml | 2 + .../device-tree/Bindings/dma/ti/k3-udma.yaml | 2 + .../Bindings/edac/amazon,al-mc-edac.yaml | 68 + sys/contrib/device-tree/Bindings/edac/dmc-520.yaml | 2 + sys/contrib/device-tree/Bindings/eeprom/at24.yaml | 3 + sys/contrib/device-tree/Bindings/eeprom/at25.yaml | 129 + .../device-tree/Bindings/example-schema.yaml | 33 +- .../Bindings/extcon/extcon-ptn5150.yaml | 60 + .../device-tree/Bindings/extcon/wlf,arizona.yaml | 2 + .../device-tree/Bindings/fsi/fsi-master-aspeed.txt | 12 + .../device-tree/Bindings/fsi/ibm,fsi2spi.yaml | 3 + .../Bindings/fuse/nvidia,tegra20-fuse.txt | 1 + .../device-tree/Bindings/gpio/fsl-imx-gpio.yaml | 55 +- .../device-tree/Bindings/gpio/gpio-pca95xx.yaml | 232 ++ .../device-tree/Bindings/gpio/gpio-vf610.yaml | 83 + .../Bindings/gpio/kontron,sl28cpld-gpio.yaml | 54 + .../device-tree/Bindings/gpio/pl061-gpio.yaml | 3 + .../Bindings/gpio/renesas,rcar-gpio.yaml | 1 + .../Bindings/gpio/snps,dw-apb-gpio.yaml | 6 + .../Bindings/gpio/socionext,uniphier-gpio.yaml | 2 + .../device-tree/Bindings/gpu/arm,mali-midgard.yaml | 1 + .../device-tree/Bindings/gpu/arm,mali-utgard.yaml | 6 +- .../device-tree/Bindings/gpu/samsung-rotator.yaml | 6 + .../device-tree/Bindings/gpu/vivante,gc.yaml | 9 +- .../Bindings/hwlock/ti,omap-hwspinlock.yaml | 76 + .../device-tree/Bindings/hwmon/adi,adm1266.yaml | 51 + .../Bindings/hwmon/adi,axi-fan-control.yaml | 2 + .../device-tree/Bindings/hwmon/adt7475.yaml | 2 + .../device-tree/Bindings/hwmon/baikal,bt1-pvt.yaml | 4 +- .../Bindings/hwmon/kontron,sl28cpld-hwmon.yaml | 27 + sys/contrib/device-tree/Bindings/hwmon/lm75.yaml | 66 + .../device-tree/Bindings/hwmon/maxim,max20730.yaml | 65 + .../Bindings/hwmon/moortec,mr75203.yaml | 71 + .../Bindings/hwmon/sensirion,shtc1.yaml | 61 + .../Bindings/i2c/amlogic,meson6-i2c.yaml | 2 + .../device-tree/Bindings/i2c/cdns,i2c-r1p10.yaml | 2 + .../Bindings/i2c/google,cros-ec-i2c-tunnel.yaml | 66 + sys/contrib/device-tree/Bindings/i2c/i2c-gpio.yaml | 2 + .../device-tree/Bindings/i2c/i2c-imx-lpi2c.yaml | 29 +- sys/contrib/device-tree/Bindings/i2c/i2c-imx.yaml | 8 +- sys/contrib/device-tree/Bindings/i2c/i2c-rk3x.yaml | 2 + sys/contrib/device-tree/Bindings/i2c/i2c.txt | 5 + .../device-tree/Bindings/i2c/ingenic,i2c.yaml | 12 +- .../Bindings/i2c/mellanox,i2c-mlxbf.txt | 42 + .../Bindings/i2c/socionext,uniphier-fi2c.yaml | 2 + .../Bindings/i2c/socionext,uniphier-i2c.yaml | 2 + .../device-tree/Bindings/i2c/st,stm32-i2c.yaml | 2 + .../Bindings/i2c/xlnx,xps-iic-2.00.a.yaml | 2 + .../Bindings/iio/accel/adi,adis16240.yaml | 4 + .../Bindings/iio/accel/adi,adxl345.yaml | 4 + .../Bindings/iio/accel/adi,adxl372.yaml | 4 + .../Bindings/iio/accel/kionix,kxsd9.yaml | 4 + .../device-tree/Bindings/iio/adc/adi,ad7124.yaml | 4 + .../device-tree/Bindings/iio/adc/adi,ad7192.yaml | 4 + .../device-tree/Bindings/iio/adc/adi,ad7291.yaml | 47 + .../device-tree/Bindings/iio/adc/adi,ad7292.yaml | 4 + .../device-tree/Bindings/iio/adc/adi,ad7606.yaml | 6 + .../device-tree/Bindings/iio/adc/adi,ad7768-1.yaml | 90 + .../device-tree/Bindings/iio/adc/adi,ad7923.yaml | 4 + .../device-tree/Bindings/iio/adc/adi,ad7949.yaml | 57 + .../device-tree/Bindings/iio/adc/adi,ad9467.yaml | 15 +- .../Bindings/iio/adc/amlogic,meson-saradc.yaml | 149 ++ .../Bindings/iio/adc/aspeed,ast2400-adc.yaml | 55 + .../Bindings/iio/adc/cosmic,10001-adc.yaml | 59 + .../Bindings/iio/adc/dlg,da9150-gpadc.yaml | 35 + .../Bindings/iio/adc/fsl,imx25-gcq.yaml | 131 + .../Bindings/iio/adc/fsl,imx7d-adc.yaml | 62 + .../Bindings/iio/adc/fsl,vf610-adc.yaml | 81 + .../device-tree/Bindings/iio/adc/holt,hi8435.yaml | 50 + .../device-tree/Bindings/iio/adc/lltc,ltc2497.yaml | 46 + .../Bindings/iio/adc/marvell,berlin2-adc.yaml | 50 + .../Bindings/iio/adc/maxim,max11100.yaml | 49 + .../Bindings/iio/adc/maxim,max1118.yaml | 62 + .../Bindings/iio/adc/maxim,max1238.yaml | 2 + .../Bindings/iio/adc/maxim,max1241.yaml | 4 + .../Bindings/iio/adc/maxim,max1363.yaml | 2 + .../Bindings/iio/adc/maxim,max9611.yaml | 51 + .../Bindings/iio/adc/microchip,mcp3201.yaml | 77 + .../Bindings/iio/adc/motorola,cpcap-adc.yaml | 53 + .../Bindings/iio/adc/nuvoton,nau7802.yaml | 50 + .../Bindings/iio/adc/nuvoton,npcm750-adc.yaml | 64 + .../Bindings/iio/adc/nxp,lpc1850-adc.yaml | 61 + .../Bindings/iio/adc/nxp,lpc3220-adc.yaml | 50 + .../Bindings/iio/adc/qcom,spmi-vadc.yaml | 4 + .../Bindings/iio/adc/samsung,exynos-adc.yaml | 20 +- .../Bindings/iio/adc/sprd,sc2720-adc.yaml | 72 + .../device-tree/Bindings/iio/adc/st,stmpe-adc.yaml | 45 + .../device-tree/Bindings/iio/adc/ti,adc0832.yaml | 56 + .../Bindings/iio/adc/ti,adc108s102.yaml | 47 + .../device-tree/Bindings/iio/adc/ti,adc12138.yaml | 86 + .../Bindings/iio/adc/ti,adc128s052.yaml | 59 + .../Bindings/iio/adc/ti,adc161s626.yaml | 51 + .../device-tree/Bindings/iio/adc/ti,ads1015.yaml | 112 + .../device-tree/Bindings/iio/adc/ti,ads7950.yaml | 65 + .../device-tree/Bindings/iio/adc/ti,ads8344.yaml | 51 + .../device-tree/Bindings/iio/adc/ti,ads8688.yaml | 4 + .../device-tree/Bindings/iio/adc/ti,tlc4541.yaml | 52 + .../Bindings/iio/adc/ti,twl4030-madc.yaml | 48 + .../Bindings/iio/amplifiers/adi,hmc425a.yaml | 2 + .../Bindings/iio/chemical/atlas,sensor.yaml | 4 + sys/contrib/device-tree/Bindings/iio/common.yaml | 2 + .../device-tree/Bindings/iio/dac/adi,ad5770r.yaml | 10 + .../device-tree/Bindings/iio/dac/lltc,ltc2632.yaml | 77 + .../Bindings/iio/frequency/adf4371.yaml | 4 + .../Bindings/iio/gyroscope/adi,adxrs290.yaml | 59 + .../Bindings/iio/humidity/ti,hdc2010.yaml | 47 + .../Bindings/iio/imu/adi,adis16460.yaml | 4 + .../Bindings/iio/imu/adi,adis16475.yaml | 2 + .../device-tree/Bindings/iio/imu/bosch,bmi160.yaml | 4 + .../Bindings/iio/imu/invensense,icm42600.yaml | 6 + .../device-tree/Bindings/iio/imu/nxp,fxos8700.yaml | 4 + .../Bindings/iio/light/ams,as73211.yaml | 54 + .../Bindings/iio/light/amstaos,tsl2563.yaml | 2 + .../Bindings/iio/light/dynaimage,al3010.yaml | 2 + .../Bindings/iio/light/dynaimage,al3320a.yaml | 2 + .../Bindings/iio/light/sharp,gp2ap002.yaml | 2 + .../Bindings/iio/light/vishay,vcnl4000.yaml | 4 + .../iio/magnetometer/asahi-kasei,ak8975.yaml | 2 + .../Bindings/iio/proximity/semtech,sx9310.yaml | 65 + .../Bindings/iio/proximity/vishay,vcnl3020.yaml | 2 + .../device-tree/Bindings/iio/proximity/vl53l0x.txt | 6 + .../device-tree/Bindings/input/adc-joystick.yaml | 121 + .../Bindings/input/fsl,mpr121-touchkey.yaml | 2 + .../Bindings/input/google,cros-ec-keyb.yaml | 92 + sys/contrib/device-tree/Bindings/input/input.yaml | 2 + .../device-tree/Bindings/input/matrix-keymap.yaml | 2 + .../Bindings/input/touchscreen/touchscreen.yaml | 2 + .../Bindings/input/touchscreen/zinitix.txt | 40 + .../Bindings/interconnect/interconnect.txt | 24 +- .../Bindings/interconnect/qcom,bcm-voter.yaml | 20 + .../Bindings/interconnect/qcom,osm-l3.yaml | 2 + .../Bindings/interconnect/qcom,rpmh.yaml | 110 + .../interrupt-controller/actions,owl-sirq.yaml | 65 + .../allwinner,sun7i-a20-sc-nmi.yaml | 5 +- .../interrupt-controller/fsl,irqsteer.yaml | 8 +- .../interrupt-controller/ingenic,intc.yaml | 2 + .../kontron,sl28cpld-intc.yaml | 54 + .../interrupt-controller/loongson,htpic.yaml | 2 + .../interrupt-controller/loongson,liointc.yaml | 2 + .../interrupt-controller/loongson,pch-msi.yaml | 2 + .../interrupt-controller/loongson,pch-pic.yaml | 2 + .../interrupt-controller/mstar,mst-intc.yaml | 64 + .../Bindings/interrupt-controller/mti,gic.yaml | 2 +- .../interrupt-controller/sifive,plic-1.0.0.yaml | 97 + .../interrupt-controller/snps,dw-apb-ictl.txt | 14 +- .../interrupt-controller/ti,pruss-intc.yaml | 158 ++ .../Bindings/interrupt-controller/ti,sci-inta.yaml | 12 + .../Bindings/interrupt-controller/ti,sci-intr.yaml | 2 + .../device-tree/Bindings/iommu/mediatek,iommu.txt | 2 + .../Bindings/iommu/renesas,ipmmu-vmsa.yaml | 3 +- .../device-tree/Bindings/ipmi/ipmi-smic.yaml | 2 + .../Bindings/leds/backlight/common.yaml | 36 + .../Bindings/leds/backlight/kinetic,ktd253.yaml | 46 + sys/contrib/device-tree/Bindings/leds/common.yaml | 4 +- .../Bindings/leds/leds-class-multicolor.yaml | 12 +- .../device-tree/Bindings/leds/leds-is31fl319x.txt | 2 + .../device-tree/Bindings/leds/leds-lp50xx.yaml | 138 ++ .../device-tree/Bindings/leds/leds-lp55xx.yaml | 10 +- .../device-tree/Bindings/leds/leds-pca955x.txt | 1 + .../device-tree/Bindings/leds/ti,tca6507.yaml | 134 + .../device-tree/Bindings/leds/trigger-source.yaml | 2 + .../device-tree/Bindings/mailbox/arm,mhu.yaml | 135 + .../device-tree/Bindings/mailbox/fsl,mu.yaml | 6 +- .../device-tree/Bindings/mailbox/mtk-gce.txt | 2 +- .../device-tree/Bindings/mailbox/omap-mailbox.txt | 2 +- .../Bindings/mailbox/qcom,apcs-kpss-global.yaml | 1 + .../Bindings/media/allwinner,sun4i-a10-ir.yaml | 5 +- .../Bindings/media/gpio-ir-receiver.txt | 3 + .../Bindings/media/i2c/chrontel,ch7322.yaml | 2 + .../Bindings/media/i2c/imi,rdacm2x-gmsl.yaml | 2 + .../device-tree/Bindings/media/i2c/ov5647.yaml | 88 + .../device-tree/Bindings/media/i2c/tvp5150.txt | 2 +- .../Bindings/media/mediatek-jpeg-encoder.txt | 35 + .../device-tree/Bindings/media/mediatek-vcodec.txt | 9 +- .../device-tree/Bindings/media/nxp,imx8mq-vpu.yaml | 2 + .../Bindings/media/qcom,msm8916-venus.yaml | 2 + .../Bindings/media/qcom,msm8996-venus.yaml | 2 + .../Bindings/media/qcom,sc7180-venus.yaml | 8 +- .../Bindings/media/qcom,sdm845-venus-v2.yaml | 8 +- .../Bindings/media/qcom,sdm845-venus.yaml | 2 + sys/contrib/device-tree/Bindings/media/rc.yaml | 2 + .../device-tree/Bindings/media/renesas,csi2.yaml | 1 + .../device-tree/Bindings/media/renesas,vin.yaml | 2 + .../device-tree/Bindings/media/samsung-fimc.txt | 6 +- .../Bindings/memory-controllers/fsl/mmdc.yaml | 2 + .../memory-controllers/mediatek,smi-common.txt | 3 +- .../memory-controllers/mediatek,smi-larb.txt | 3 +- .../memory-controllers/renesas,rpc-if.yaml | 2 + .../memory-controllers/st,stm32-fmc2-ebi.yaml | 2 + sys/contrib/device-tree/Bindings/mfd/ab8500.txt | 4 +- sys/contrib/device-tree/Bindings/mfd/act8945a.txt | 2 +- .../device-tree/Bindings/mfd/cirrus,lochnagar.yaml | 10 +- .../device-tree/Bindings/mfd/ene-kb3930.yaml | 55 + .../device-tree/Bindings/mfd/gateworks-gsc.yaml | 5 +- .../device-tree/Bindings/mfd/google,cros-ec.yaml | 64 + .../device-tree/Bindings/mfd/kontron,sl28cpld.yaml | 153 ++ .../device-tree/Bindings/mfd/qcom,spmi-pmic.txt | 2 +- .../device-tree/Bindings/mfd/rohm,bd70528-pmic.txt | 2 +- .../Bindings/mfd/rohm,bd71847-pmic.yaml | 9 +- sys/contrib/device-tree/Bindings/mfd/syscon.yaml | 10 +- .../Bindings/mfd/ti,j721e-system-controller.yaml | 9 +- .../device-tree/Bindings/mfd/ti,lp87524-q1.yaml | 112 + .../device-tree/Bindings/mfd/ti,lp87561-q1.yaml | 83 + .../device-tree/Bindings/mfd/ti,lp87565-q1.yaml | 101 + .../device-tree/Bindings/mfd/xylon,logicvc.yaml | 14 +- .../device-tree/Bindings/mips/ingenic/devices.yaml | 8 + .../Bindings/mips/ingenic/ingenic,cpu.yaml | 6 +- .../Bindings/mips/loongson/devices.yaml | 3 + .../Bindings/mips/loongson/rs780e-acpi.yaml | 2 + .../Bindings/misc/nvidia,tegra186-misc.txt | 8 +- .../Bindings/misc/nvidia,tegra20-apbmisc.txt | 13 +- .../device-tree/Bindings/misc/olpc,xo1.75-ec.yaml | 6 +- .../Bindings/mmc/amlogic,meson-mx-sdhc.yaml | 2 + .../device-tree/Bindings/mmc/arasan,sdhci.yaml | 8 +- .../device-tree/Bindings/mmc/cdns,sdhci.yaml | 2 + .../device-tree/Bindings/mmc/fsl-imx-esdhc.yaml | 37 +- .../device-tree/Bindings/mmc/ingenic,mmc.yaml | 2 + .../Bindings/mmc/microchip,dw-sparx5-sdhci.yaml | 67 + .../device-tree/Bindings/mmc/mmc-controller.yaml | 6 + .../device-tree/Bindings/mmc/mmc-pwrseq-emmc.yaml | 2 + .../Bindings/mmc/mmc-pwrseq-sd8787.yaml | 2 + .../Bindings/mmc/mmc-pwrseq-simple.yaml | 4 + sys/contrib/device-tree/Bindings/mmc/owl-mmc.yaml | 8 +- .../device-tree/Bindings/mmc/renesas,sdhi.yaml | 1 + .../device-tree/Bindings/mmc/rockchip-dw-mshc.yaml | 2 + .../device-tree/Bindings/mmc/sdhci-am654.yaml | 219 ++ .../device-tree/Bindings/mmc/sdhci-pxa.yaml | 2 + .../Bindings/mmc/socionext,uniphier-sd.yaml | 2 + .../Bindings/mmc/synopsys-dw-mshc-common.yaml | 2 + .../device-tree/Bindings/mmc/synopsys-dw-mshc.yaml | 2 + .../device-tree/Bindings/mtd/denali,nand.yaml | 2 + .../device-tree/Bindings/mtd/gpmi-nand.yaml | 18 +- .../device-tree/Bindings/mtd/ingenic,nand.yaml | 2 + .../device-tree/Bindings/mtd/nand-controller.yaml | 33 + .../Bindings/mtd/st,stm32-fmc2-nand.yaml | 2 + sys/contrib/device-tree/Bindings/net/adi,adin.yaml | 2 + .../Bindings/net/amlogic,meson-dwmac.yaml | 2 + .../Bindings/net/aspeed,ast2600-mdio.yaml | 2 + .../Bindings/net/brcm,bcm7445-switch-v4.0.txt | 7 + .../device-tree/Bindings/net/brcm,systemport.txt | 5 + .../Bindings/net/can/can-controller.yaml | 18 + .../Bindings/net/can/can-transceiver.yaml | 2 + .../device-tree/Bindings/net/can/fsl,flexcan.yaml | 139 ++ .../Bindings/net/can/microchip,mcp251x.txt | 7 +- .../Bindings/net/can/microchip,mcp251xfd.yaml | 79 + .../device-tree/Bindings/net/can/rcar_can.txt | 8 +- .../device-tree/Bindings/net/can/rcar_canfd.txt | 5 +- .../device-tree/Bindings/net/can/tcan4x5x.txt | 2 +- sys/contrib/device-tree/Bindings/net/dsa/b53.txt | 9 +- sys/contrib/device-tree/Bindings/net/dsa/dsa.yaml | 2 + .../device-tree/Bindings/net/dsa/mt7530.txt | 13 +- .../Bindings/net/ethernet-controller.yaml | 16 + .../device-tree/Bindings/net/ethernet-phy.yaml | 2 + .../device-tree/Bindings/net/intel,dwmac-plat.yaml | 132 + .../device-tree/Bindings/net/marvell,mvusb.yaml | 2 + .../device-tree/Bindings/net/marvell,prestera.txt | 34 + sys/contrib/device-tree/Bindings/net/mdio.yaml | 2 + .../Bindings/net/mediatek,star-emac.yaml | 2 + .../device-tree/Bindings/net/nfc/nxp-nci.txt | 2 +- sys/contrib/device-tree/Bindings/net/nfc/pn544.txt | 2 +- .../Bindings/net/nfc/samsung,s3fwrn5.yaml | 73 + .../device-tree/Bindings/net/nxp,tja11xx.yaml | 2 + .../device-tree/Bindings/net/qca,ar71xx.yaml | 2 + .../device-tree/Bindings/net/qca,ar803x.yaml | 2 + sys/contrib/device-tree/Bindings/net/qcom,ipa.yaml | 2 + .../Bindings/net/qcom,ipq4019-mdio.yaml | 2 + .../Bindings/net/qcom,ipq8064-mdio.yaml | 2 + .../Bindings/net/realtek-bluetooth.yaml | 4 +- .../device-tree/Bindings/net/renesas,etheravb.yaml | 262 ++ .../device-tree/Bindings/net/smsc-lan87xx.txt | 4 + .../device-tree/Bindings/net/snps,dwmac.yaml | 2 + .../device-tree/Bindings/net/socionext-netsec.txt | 4 +- .../device-tree/Bindings/net/stm32-dwmac.yaml | 2 + .../device-tree/Bindings/net/ti,davinci-mdio.yaml | 2 + .../device-tree/Bindings/net/ti,dp83822.yaml | 82 + .../device-tree/Bindings/net/ti,dp83867.yaml | 2 + .../device-tree/Bindings/net/ti,dp83869.yaml | 2 + .../Bindings/net/wireless/microchip,wilc1000.yaml | 4 + .../Bindings/net/wireless/qcom,ath10k.txt | 4 +- .../Bindings/net/wireless/qcom,ath11k.yaml | 4 +- .../device-tree/Bindings/nvmem/imx-ocotp.yaml | 40 +- .../device-tree/Bindings/nvmem/nvmem-consumer.yaml | 2 + sys/contrib/device-tree/Bindings/nvmem/nvmem.yaml | 2 + .../device-tree/Bindings/nvmem/qcom,qfprom.yaml | 2 + .../device-tree/Bindings/nvmem/qcom,spmi-sdam.yaml | 2 + .../device-tree/Bindings/nvmem/rockchip-efuse.yaml | 2 + .../device-tree/Bindings/nvmem/snvs-lpgpr.yaml | 33 + .../device-tree/Bindings/nvmem/st,stm32-romem.yaml | 2 + .../device-tree/Bindings/nvmem/vf610-ocotp.txt | 4 +- .../opp/allwinner,sun50i-h6-operating-points.yaml | 4 +- sys/contrib/device-tree/Bindings/opp/opp.txt | 53 +- .../device-tree/Bindings/pci/brcm,stb-pcie.yaml | 56 +- .../Bindings/pci/cdns,cdns-pcie-ep.yaml | 2 + .../Bindings/pci/cdns,cdns-pcie-host.yaml | 2 + .../device-tree/Bindings/pci/cdns-pcie-ep.yaml | 2 + .../device-tree/Bindings/pci/cdns-pcie-host.yaml | 2 + .../device-tree/Bindings/pci/cdns-pcie.yaml | 2 + .../device-tree/Bindings/pci/host-generic-pci.yaml | 2 + .../device-tree/Bindings/pci/layerscape-pci.txt | 2 + sys/contrib/device-tree/Bindings/pci/loongson.yaml | 2 + sys/contrib/device-tree/Bindings/pci/pci-ep.yaml | 2 + .../device-tree/Bindings/pci/rcar-pci-ep.yaml | 10 +- sys/contrib/device-tree/Bindings/pci/rcar-pci.txt | 3 +- .../Bindings/pci/socionext,uniphier-pcie-ep.yaml | 20 +- .../device-tree/Bindings/pci/ti,j721e-pci-ep.yaml | 2 + .../Bindings/pci/ti,j721e-pci-host.yaml | 2 + .../device-tree/Bindings/pci/uniphier-pcie.txt | 1 + .../device-tree/Bindings/pci/versatile.yaml | 2 + sys/contrib/device-tree/Bindings/perf/arm,cmn.yaml | 57 + .../device-tree/Bindings/perf/fsl-imx-ddr.yaml | 49 + .../Bindings/phy/amlogic,meson-g12a-usb2-phy.yaml | 2 + .../Bindings/phy/fsl,imx8mq-usb-phy.txt | 2 +- .../Bindings/phy/hisilicon,hi3660-usb3.yaml | 60 + .../Bindings/phy/intel,lgm-emmc-phy.yaml | 17 +- .../Bindings/phy/intel,lgm-usb-phy.yaml | 58 + .../Bindings/phy/phy-cadence-torrent.yaml | 96 +- .../Bindings/phy/qcom,ipq806x-usb-phy-hs.yaml | 2 + .../Bindings/phy/qcom,ipq806x-usb-phy-ss.yaml | 2 + .../Bindings/phy/qcom,qmp-usb3-dp-phy.yaml | 95 +- .../device-tree/Bindings/phy/qcom,qusb2-phy.yaml | 1 + .../Bindings/phy/qcom-usb-ipq4019-phy.yaml | 2 + .../Bindings/phy/socionext,uniphier-ahci-phy.yaml | 76 + .../device-tree/Bindings/phy/ti,omap-usb2.yaml | 76 + .../device-tree/Bindings/phy/ti,phy-j721e-wiz.yaml | 13 +- sys/contrib/device-tree/Bindings/phy/ti-phy.txt | 37 - .../Bindings/pinctrl/actions,s500-pinctrl.yaml | 240 ++ .../pinctrl/allwinner,sun4i-a10-pinctrl.yaml | 141 +- .../Bindings/pinctrl/atmel,at91-pio4-pinctrl.txt | 4 +- .../Bindings/pinctrl/cirrus,lochnagar.yaml | 2 + .../Bindings/pinctrl/cirrus,madera.yaml | 2 + .../device-tree/Bindings/pinctrl/pincfg-node.yaml | 2 + .../Bindings/pinctrl/pinctrl-atlas7.txt | 2 +- .../Bindings/pinctrl/pinctrl-mt65xx.txt | 1 + .../Bindings/pinctrl/pinctrl-mt8192.yaml | 155 ++ .../Bindings/pinctrl/pinctrl-single.txt | 21 +- .../device-tree/Bindings/pinctrl/pinmux-node.yaml | 2 + .../Bindings/pinctrl/qcom,ipq4019-pinctrl.txt | 2 +- .../Bindings/pinctrl/qcom,msm8226-pinctrl.yaml | 132 + .../device-tree/Bindings/pinctrl/renesas,pfc.yaml | 193 ++ .../Bindings/pinctrl/renesas,rza1-ports.yaml | 190 ++ .../Bindings/pinctrl/renesas,rza2-pinctrl.yaml | 2 +- .../Bindings/pinctrl/renesas,rzn1-pinctrl.yaml | 129 + .../Bindings/pinctrl/samsung-pinctrl.txt | 6 +- .../pinctrl/socionext,uniphier-pinctrl.yaml | 2 + .../Bindings/pinctrl/toshiba,visconti-pinctrl.yaml | 92 + .../Bindings/power/amlogic,meson-ee-pwrc.yaml | 23 +- .../Bindings/power/amlogic,meson-sec-pwrc.yaml | 2 + .../Bindings/power/brcm,bcm63xx-power.yaml | 44 + .../Bindings/power/domain-idle-state.yaml | 2 + .../device-tree/Bindings/power/fsl,imx-gpcv2.yaml | 4 + .../device-tree/Bindings/power/mti,mips-cpc.yaml | 2 + .../device-tree/Bindings/power/pd-samsung.yaml | 2 + .../device-tree/Bindings/power/power-domain.yaml | 2 + .../Bindings/power/renesas,rcar-sysc.yaml | 1 + .../Bindings/power/reset/ocelot-reset.txt | 7 +- .../Bindings/power/reset/reboot-mode.yaml | 49 + .../Bindings/power/supply/act8945a-charger.txt | 2 +- .../device-tree/Bindings/power/supply/battery.yaml | 24 + .../device-tree/Bindings/power/supply/bq25890.txt | 4 + .../device-tree/Bindings/power/supply/bq25980.yaml | 114 + .../device-tree/Bindings/power/supply/bq27xxx.yaml | 1 + .../Bindings/power/supply/charger-manager.txt | 30 +- .../Bindings/power/supply/cw2015_battery.yaml | 2 + .../Bindings/power/supply/gpio-charger.yaml | 31 + .../Bindings/power/supply/ingenic,battery.yaml | 61 + .../Bindings/power/supply/max17040_battery.txt | 21 +- .../Bindings/power/supply/power-supply.yaml | 2 + .../Bindings/power/supply/rohm,bd99954.yaml | 8 + .../power/supply/summit,smb347-charger.yaml | 152 ++ .../device-tree/Bindings/powerpc/sleep.yaml | 47 + sys/contrib/device-tree/Bindings/ptp/ptp-qoriq.txt | 2 + .../Bindings/pwm/google,cros-ec-pwm.yaml | 2 +- sys/contrib/device-tree/Bindings/pwm/imx-pwm.yaml | 25 +- .../Bindings/pwm/kontron,sl28cpld-pwm.yaml | 35 + .../device-tree/Bindings/pwm/pwm-sifive.yaml | 69 + sys/contrib/device-tree/Bindings/pwm/pwm.yaml | 2 + .../device-tree/Bindings/pwm/renesas,pwm-rcar.yaml | 2 + .../device-tree/Bindings/pwm/renesas,tpu-pwm.yaml | 1 + .../Bindings/regulator/fixed-regulator.yaml | 2 + .../regulator/google,cros-ec-regulator.yaml | 2 + .../Bindings/regulator/gpio-regulator.yaml | 2 + .../device-tree/Bindings/regulator/mps,mp886x.yaml | 63 + .../Bindings/regulator/mt6360-regulator.yaml | 113 + .../device-tree/Bindings/regulator/pfuze100.yaml | 188 ++ .../Bindings/regulator/qcom,smd-rpm-regulator.yaml | 12 + .../Bindings/regulator/qcom,spmi-regulator.txt | 31 + .../Bindings/regulator/qcom-labibb-regulator.yaml | 2 +- ...pberrypi,7inch-touchscreen-panel-regulator.yaml | 44 + .../device-tree/Bindings/regulator/regulator.yaml | 2 + .../regulator/richtek,rt4801-regulator.yaml | 79 + .../regulator/richtek,rtmv20-regulator.yaml | 159 ++ .../Bindings/regulator/rohm,bd71837-regulator.yaml | 11 + .../Bindings/regulator/rohm,bd71847-regulator.yaml | 11 + .../Bindings/regulator/rohm,bd9576-regulator.yaml | 34 + .../Bindings/regulator/silergy,sy8824x.yaml | 45 + .../Bindings/regulator/silergy,sy8827n.yaml | 2 + .../Bindings/regulator/st,stm32-booster.yaml | 2 + .../Bindings/regulator/st,stm32-vrefbuf.yaml | 2 + .../regulator/vqmmc-ipq4019-regulator.yaml | 2 + .../Bindings/regulator/wlf,arizona.yaml | 2 + .../Bindings/remoteproc/qcom,pil-info.yaml | 2 + .../Bindings/remoteproc/ti,k3-r5f-rproc.yaml | 281 +++ .../Bindings/reserved-memory/reserved-memory.txt | 3 + .../device-tree/Bindings/reset/fsl,imx7-src.yaml | 19 +- .../Bindings/reset/nuvoton,npcm-reset.txt | 2 +- .../device-tree/Bindings/reset/renesas,rst.yaml | 1 + .../Bindings/reset/xlnx,zynqmp-reset.txt | 11 +- sys/contrib/device-tree/Bindings/riscv/cpus.yaml | 2 + .../Bindings/riscv/sifive-l2-cache.yaml | 98 + sys/contrib/device-tree/Bindings/riscv/sifive.yaml | 3 + sys/contrib/device-tree/Bindings/rng/imx-rng.yaml | 52 + .../device-tree/Bindings/rng/ingenic,trng.yaml | 43 + .../Bindings/rng/xiphera,xip8001b-trng.yaml | 33 + .../device-tree/Bindings/rtc/ingenic,rtc.yaml | 2 + .../Bindings/rtc/microcrystal,rv3032.yaml | 64 + .../device-tree/Bindings/rtc/rtc-ds1307.txt | 9 +- sys/contrib/device-tree/Bindings/rtc/rtc.yaml | 18 + sys/contrib/device-tree/Bindings/rtc/s3c-rtc.yaml | 2 + .../device-tree/Bindings/serial/fsl-imx-uart.yaml | 100 + .../device-tree/Bindings/serial/fsl-lpuart.yaml | 82 + .../device-tree/Bindings/serial/fsl-mxs-auart.yaml | 91 + .../device-tree/Bindings/serial/ingenic,uart.yaml | 5 + .../device-tree/Bindings/serial/mtk-uart.txt | 1 + .../device-tree/Bindings/serial/renesas,hscif.yaml | 3 + .../device-tree/Bindings/serial/renesas,sci.yaml | 2 + .../device-tree/Bindings/serial/renesas,scif.yaml | 3 + .../device-tree/Bindings/serial/renesas,scifa.yaml | 2 + .../device-tree/Bindings/serial/renesas,scifb.yaml | 2 + sys/contrib/device-tree/Bindings/serial/rs485.yaml | 3 + .../device-tree/Bindings/serial/samsung_uart.yaml | 2 + .../device-tree/Bindings/serial/serial.yaml | 2 + .../Bindings/serial/snps-dw-apb-uart.yaml | 2 + .../Bindings/serial/socionext,uniphier-uart.yaml | 2 + .../device-tree/Bindings/serial/sprd-uart.yaml | 2 + .../device-tree/Bindings/soc/imx/fsl,aips-bus.yaml | 2 + .../Bindings/soc/qcom/qcom,geni-se.yaml | 1 + .../Bindings/soc/qcom/qcom,smd-rpm.yaml | 2 +- .../device-tree/Bindings/soc/ti/k3-ringacc.yaml | 6 - .../device-tree/Bindings/soc/ti/ti,pruss.yaml | 439 ++++ sys/contrib/device-tree/Bindings/sound/ak4458.txt | 5 + sys/contrib/device-tree/Bindings/sound/ak5558.txt | 2 + .../Bindings/sound/allwinner,sun8i-a33-codec.yaml | 6 +- .../device-tree/Bindings/sound/amlogic,aiu.yaml | 2 + .../Bindings/sound/amlogic,g12a-toacodec.yaml | 2 + .../Bindings/sound/amlogic,gx-sound-card.yaml | 2 + .../device-tree/Bindings/sound/amlogic,t9015.yaml | 2 + .../device-tree/Bindings/sound/cirrus,cs4234.yaml | 74 + .../device-tree/Bindings/sound/cirrus,cs42l51.yaml | 2 + .../device-tree/Bindings/sound/cirrus,madera.yaml | 2 + .../device-tree/Bindings/sound/fsl,easrc.yaml | 2 + .../device-tree/Bindings/sound/fsl,spdif.yaml | 110 + .../device-tree/Bindings/sound/fsl-asoc-card.txt | 2 + .../Bindings/sound/google,cros-ec-codec.yaml | 26 +- .../Bindings/sound/intel,keembay-i2s.yaml | 3 + .../device-tree/Bindings/sound/max98090.txt | 2 +- .../device-tree/Bindings/sound/mchp,spdifrx.yaml | 73 + .../device-tree/Bindings/sound/mchp,spdiftx.yaml | 75 + sys/contrib/device-tree/Bindings/sound/mt6359.yaml | 61 + .../Bindings/sound/mt8183-da7219-max98357.txt | 1 + .../Bindings/sound/nvidia,tegra186-dspk.yaml | 2 + .../Bindings/sound/nvidia,tegra210-admaif.yaml | 2 + .../Bindings/sound/nvidia,tegra210-ahub.yaml | 3 + .../Bindings/sound/nvidia,tegra210-dmic.yaml | 2 + .../Bindings/sound/nvidia,tegra210-i2s.yaml | 2 + .../Bindings/sound/qcom,apq8016-sbc.txt | 7 + .../device-tree/Bindings/sound/qcom,apq8096.txt | 8 + .../device-tree/Bindings/sound/qcom,lpass-cpu.yaml | 223 ++ .../device-tree/Bindings/sound/qcom,q6afe.txt | 23 + .../device-tree/Bindings/sound/qcom,sdm845.txt | 8 + .../Bindings/sound/realtek,rt1015p.yaml | 38 + .../Bindings/sound/rockchip,rk3328-codec.yaml | 2 + .../device-tree/Bindings/sound/rockchip-spdif.yaml | 1 + sys/contrib/device-tree/Bindings/sound/rt1015.txt | 6 + sys/contrib/device-tree/Bindings/sound/rt5640.txt | 2 +- sys/contrib/device-tree/Bindings/sound/rt5659.txt | 2 +- sys/contrib/device-tree/Bindings/sound/rt5665.txt | 2 +- sys/contrib/device-tree/Bindings/sound/rt5668.txt | 2 +- sys/contrib/device-tree/Bindings/sound/rt5677.txt | 2 +- sys/contrib/device-tree/Bindings/sound/rt5682.txt | 2 +- .../Bindings/sound/samsung,aries-wm8994.yaml | 11 +- .../Bindings/sound/samsung,midas-audio.yaml | 6 +- .../device-tree/Bindings/sound/samsung,odroid.yaml | 5 + .../device-tree/Bindings/sound/samsung-i2s.yaml | 15 + .../device-tree/Bindings/sound/sgtl5000.yaml | 4 + .../device-tree/Bindings/sound/tas2562.yaml | 8 + .../device-tree/Bindings/sound/tas2764.yaml | 76 + .../device-tree/Bindings/sound/tas2770.yaml | 11 +- .../Bindings/sound/ti,j721e-cpb-audio.yaml | 92 +- .../device-tree/Bindings/sound/tlv320adcx140.yaml | 52 + .../device-tree/Bindings/sound/wlf,arizona.yaml | 2 + .../device-tree/Bindings/soundwire/qcom,sdw.txt | 1 + .../Bindings/soundwire/soundwire-controller.yaml | 2 + .../Bindings/spi/amlogic,meson-gx-spicc.yaml | 2 + .../Bindings/spi/amlogic,meson6-spifc.yaml | 2 + .../device-tree/Bindings/spi/brcm,spi-bcm-qspi.txt | 2 + .../Bindings/spi/mediatek,spi-mtk-nor.yaml | 86 + .../Bindings/spi/mikrotik,rb4xx-spi.yaml | 2 + .../device-tree/Bindings/spi/qca,ar934x-spi.yaml | 2 + .../Bindings/spi/qcom,spi-qcom-qspi.yaml | 2 + .../device-tree/Bindings/spi/renesas,hspi.yaml | 2 + .../device-tree/Bindings/spi/renesas,rspi.yaml | 3 + .../device-tree/Bindings/spi/renesas,sh-msiof.yaml | 3 + .../device-tree/Bindings/spi/snps,dw-apb-ssi.yaml | 54 +- .../Bindings/spi/socionext,uniphier-spi.yaml | 2 + .../device-tree/Bindings/spi/spi-controller.yaml | 22 +- sys/contrib/device-tree/Bindings/spi/spi-gpio.yaml | 2 + sys/contrib/device-tree/Bindings/spi/spi-mux.yaml | 2 + .../device-tree/Bindings/spi/spi-pl022.yaml | 2 + .../device-tree/Bindings/spi/spi-rockchip.yaml | 2 + .../device-tree/Bindings/spi/spi-sifive.yaml | 2 + .../device-tree/Bindings/spi/st,stm32-qspi.yaml | 2 + .../device-tree/Bindings/spi/st,stm32-spi.yaml | 2 + .../Bindings/spmi/qcom,spmi-pmic-arb.txt | 4 +- sys/contrib/device-tree/Bindings/spmi/spmi.yaml | 77 + .../sram/allwinner,sun4i-a10-system-control.yaml | 9 + .../Bindings/thermal/allwinner,sun8i-a83t-ths.yaml | 6 +- .../Bindings/thermal/imx8mm-thermal.yaml | 10 +- .../Bindings/thermal/rcar-gen3-thermal.yaml | 1 + .../device-tree/Bindings/thermal/rcar-thermal.yaml | 5 + .../device-tree/Bindings/thermal/sprd-thermal.yaml | 4 + .../Bindings/thermal/thermal-cooling-devices.yaml | 2 + .../device-tree/Bindings/thermal/thermal-idle.yaml | 2 + .../Bindings/thermal/thermal-sensor.yaml | 2 + .../Bindings/thermal/thermal-zones.yaml | 2 + .../device-tree/Bindings/timer/arm,sp804.yaml | 97 + .../device-tree/Bindings/timer/cdns,ttc.yaml | 2 + .../Bindings/timer/mediatek,mtk-timer.txt | 1 + .../device-tree/Bindings/timer/renesas,cmt.yaml | 4 + .../Bindings/timer/samsung,exynos4210-mct.yaml | 25 + .../Bindings/timer/snps,dw-apb-timer.yaml | 2 +- .../device-tree/Bindings/trivial-devices.yaml | 28 +- .../device-tree/Bindings/ufs/ufs-mediatek.txt | 4 +- .../Bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml | 22 +- sys/contrib/device-tree/Bindings/usb/atmel-usb.txt | 1 + .../device-tree/Bindings/usb/cdns,usb3.yaml | 96 + .../device-tree/Bindings/usb/ci-hdrc-usb2.txt | 9 + sys/contrib/device-tree/Bindings/usb/dwc2.yaml | 5 + sys/contrib/device-tree/Bindings/usb/dwc3.txt | 3 + .../Bindings/usb/intel,keembay-dwc3.yaml | 77 + .../Bindings/usb/mediatek,mt6360-tcpc.yaml | 95 + .../Bindings/usb/nvidia,tegra-xudc.yaml | 2 + .../device-tree/Bindings/usb/qcom,dwc3.yaml | 2 + .../device-tree/Bindings/usb/renesas,usb-xhci.yaml | 1 + .../Bindings/usb/renesas,usb3-peri.yaml | 35 +- .../device-tree/Bindings/usb/renesas,usbhs.yaml | 1 + .../device-tree/Bindings/usb/ti,hd3ss3220.yaml | 82 + .../device-tree/Bindings/usb/ti,j721e-usb.yaml | 18 + .../device-tree/Bindings/usb/ti,tps6598x.yaml | 2 + sys/contrib/device-tree/Bindings/usb/usb-hcd.yaml | 2 + .../device-tree/Bindings/vendor-prefixes.yaml | 34 + .../device-tree/Bindings/w1/fsl-imx-owire.yaml | 44 + .../Bindings/watchdog/amlogic,meson-gxbb-wdt.yaml | 2 + .../device-tree/Bindings/watchdog/arm,sp805.yaml | 71 + .../device-tree/Bindings/watchdog/arm-smc-wdt.yaml | 2 + .../device-tree/Bindings/watchdog/aspeed-wdt.txt | 2 +- .../device-tree/Bindings/watchdog/fsl-imx-wdt.yaml | 11 +- .../Bindings/watchdog/kontron,sl28cpld-wdt.yaml | 35 + .../device-tree/Bindings/watchdog/qcom-wdt.yaml | 2 + .../device-tree/Bindings/watchdog/samsung-wdt.yaml | 2 + .../Bindings/watchdog/st,stm32-iwdg.yaml | 2 + .../device-tree/Bindings/watchdog/ti,rti-wdt.yaml | 2 + .../Bindings/watchdog/toshiba,visconti-wdt.yaml | 54 + .../device-tree/Bindings/watchdog/watchdog.yaml | 2 + .../device-tree/include/dt-bindings/clock/dra7.h | 1 + .../include/dt-bindings/clock/exynos5250.h | 4 +- .../include/dt-bindings/clock/exynos5420.h | 6 + .../include/dt-bindings/clock/imx8mp-clock.h | 2 +- .../include/dt-bindings/clock/mt8167-clk.h | 131 + .../include/dt-bindings/clock/qcom,dispcc-sm8150.h | 66 + .../include/dt-bindings/clock/qcom,dispcc-sm8250.h | 66 + .../include/dt-bindings/clock/qcom,gcc-msm8994.h | 36 + .../dt-bindings/clock/qcom,videocc-sm8150.h | 25 + .../dt-bindings/clock/qcom,videocc-sm8250.h | 34 + .../include/dt-bindings/clock/r8a779a0-cpg-mssr.h | 55 + .../include/dt-bindings/clock/sun50i-a100-ccu.h | 116 + .../include/dt-bindings/clock/sun50i-a100-r-ccu.h | 23 + .../include/dt-bindings/clock/tegra234-clock.h | 14 + .../include/dt-bindings/clock/vf610-clock.h | 3 +- .../include/dt-bindings/input/linux-event-codes.h | 4 + .../include/dt-bindings/interconnect/qcom,icc.h | 26 + .../include/dt-bindings/interconnect/qcom,osm-l3.h | 3 + .../include/dt-bindings/interconnect/qcom,sm8150.h | 162 ++ .../include/dt-bindings/interconnect/qcom,sm8250.h | 172 ++ .../include/dt-bindings/memory/mt8167-larb-port.h | 51 + .../include/dt-bindings/mux/ti-serdes.h | 93 + .../include/dt-bindings/phy/phy-cadence-torrent.h | 13 + .../device-tree/include/dt-bindings/phy/phy.h | 1 + .../include/dt-bindings/pinctrl/mt8192-pinfunc.h | 1344 ++++++++++ .../include/dt-bindings/power/meson-axg-power.h | 14 + .../include/dt-bindings/power/r8a779a0-sysc.h | 59 + .../dt-bindings/power/summit,smb347-charger.h | 19 + .../regulator/mediatek,mt6360-regulator.h | 16 + .../include/dt-bindings/reset/imx8mq-reset.h | 5 +- .../dt-bindings/reset/raspberrypi,firmware-reset.h | 13 + .../include/dt-bindings/reset/sun50i-a100-ccu.h | 68 + .../include/dt-bindings/reset/sun50i-a100-r-ccu.h | 18 + .../include/dt-bindings/reset/tegra234-reset.h | 10 + .../include/dt-bindings/reset/xlnx-versal-resets.h | 105 + .../include/dt-bindings/soc/bcm6318-pm.h | 17 + .../include/dt-bindings/soc/bcm63268-pm.h | 21 + .../include/dt-bindings/soc/bcm6328-pm.h | 17 + .../include/dt-bindings/soc/bcm6362-pm.h | 21 + .../include/dt-bindings/sound/qcom,q6afe.h | 96 +- .../include/dt-bindings/sound/sc7180-lpass.h | 11 + sys/contrib/device-tree/src/arc/axc001.dtsi | 2 +- sys/contrib/device-tree/src/arc/axc003.dtsi | 2 +- sys/contrib/device-tree/src/arc/axc003_idu.dtsi | 2 +- sys/contrib/device-tree/src/arc/vdk_axc003.dtsi | 2 +- .../device-tree/src/arc/vdk_axc003_idu.dtsi | 2 +- sys/contrib/device-tree/src/arm/alpine.dtsi | 2 +- sys/contrib/device-tree/src/arm/am335x-lxm.dts | 4 + .../src/arm/am335x-moxa-uc-8100-common.dtsi | 427 ++++ .../src/arm/am335x-moxa-uc-8100-me-t.dts | 404 +-- .../device-tree/src/arm/am335x-sbc-t335.dts | 4 +- sys/contrib/device-tree/src/arm/am33xx-l4.dtsi | 1 - sys/contrib/device-tree/src/arm/am33xx.dtsi | 4 +- sys/contrib/device-tree/src/arm/am3517-evm-ui.dtsi | 4 +- sys/contrib/device-tree/src/arm/am3517-evm.dts | 2 +- .../device-tree/src/arm/am3874-iceboard.dts | 8 +- sys/contrib/device-tree/src/arm/am4372.dtsi | 6 +- sys/contrib/device-tree/src/arm/am437x-cm-t43.dts | 14 +- sys/contrib/device-tree/src/arm/am437x-gp-evm.dts | 15 +- sys/contrib/device-tree/src/arm/am437x-idk-evm.dts | 13 +- sys/contrib/device-tree/src/arm/am437x-l4.dtsi | 80 +- sys/contrib/device-tree/src/arm/am437x-sbc-t43.dts | 2 +- sys/contrib/device-tree/src/arm/am437x-sk-evm.dts | 14 +- sys/contrib/device-tree/src/arm/am43x-epos-evm.dts | 19 +- sys/contrib/device-tree/src/arm/am571x-idk.dts | 27 - .../device-tree/src/arm/am5729-beagleboneai.dts | 14 +- sys/contrib/device-tree/src/arm/am572x-idk.dts | 5 - sys/contrib/device-tree/src/arm/am574x-idk.dts | 5 - .../src/arm/am57xx-beagle-x15-common.dtsi | 19 +- .../device-tree/src/arm/am57xx-cl-som-am57x.dts | 13 +- .../device-tree/src/arm/am57xx-idk-common.dtsi | 14 +- .../device-tree/src/arm/am57xx-sbc-am57x.dts | 4 +- sys/contrib/device-tree/src/arm/animeo_ip.dts | 3 +- .../device-tree/src/arm/arm-realview-eb.dtsi | 2 +- .../device-tree/src/arm/arm-realview-pb11mp.dts | 20 +- .../device-tree/src/arm/arm-realview-pbx.dtsi | 4 +- .../src/arm/aspeed-bmc-facebook-cmm.dts | 17 + .../src/arm/aspeed-bmc-facebook-minipack.dts | 47 +- .../src/arm/aspeed-bmc-facebook-wedge40.dts | 5 +- .../src/arm/aspeed-bmc-facebook-wedge400.dts | 420 ++++ .../src/arm/aspeed-bmc-facebook-yamp.dts | 17 + .../device-tree/src/arm/aspeed-bmc-ibm-rainier.dts | 23 +- .../device-tree/src/arm/aspeed-bmc-opp-mowgli.dts | 662 +++++ .../device-tree/src/arm/aspeed-bmc-opp-tacoma.dts | 7 + sys/contrib/device-tree/src/arm/aspeed-g5.dtsi | 1 - .../src/arm/ast2500-facebook-netbmc-common.dtsi | 13 - sys/contrib/device-tree/src/arm/at91-ariag25.dts | 3 +- .../device-tree/src/arm/at91-ariettag25.dts | 3 +- sys/contrib/device-tree/src/arm/at91-cosino.dtsi | 3 +- .../device-tree/src/arm/at91-cosino_mega2560.dts | 1 + sys/contrib/device-tree/src/arm/at91-foxg20.dts | 3 +- sys/contrib/device-tree/src/arm/at91-kizbox.dts | 2 +- .../device-tree/src/arm/at91-kizbox2-common.dtsi | 2 +- .../src/arm/at91-kizboxmini-common.dtsi | 2 +- sys/contrib/device-tree/src/arm/at91-linea.dtsi | 2 +- sys/contrib/device-tree/src/arm/at91-qil_a9260.dts | 3 +- .../device-tree/src/arm/at91-sam9_l9260.dts | 3 +- sys/contrib/device-tree/src/arm/at91-sam9x60ek.dts | 13 + .../device-tree/src/arm/at91-sama5d3_xplained.dts | 2 +- .../device-tree/src/arm/at91-sama5d4_ma5d4.dtsi | 2 +- .../device-tree/src/arm/at91-sama5d4_xplained.dts | 2 +- sys/contrib/device-tree/src/arm/at91-sama5d4ek.dts | 2 +- sys/contrib/device-tree/src/arm/at91-som60.dtsi | 2 +- sys/contrib/device-tree/src/arm/at91-vinco.dts | 2 +- sys/contrib/device-tree/src/arm/at91-wb45n.dtsi | 3 +- sys/contrib/device-tree/src/arm/at91-wb50n.dtsi | 2 +- sys/contrib/device-tree/src/arm/at91rm9200.dtsi | 11 +- sys/contrib/device-tree/src/arm/at91rm9200ek.dts | 2 +- sys/contrib/device-tree/src/arm/at91sam9260.dtsi | 11 +- sys/contrib/device-tree/src/arm/at91sam9260ek.dts | 3 +- sys/contrib/device-tree/src/arm/at91sam9261.dtsi | 10 +- sys/contrib/device-tree/src/arm/at91sam9261ek.dts | 2 +- sys/contrib/device-tree/src/arm/at91sam9263.dtsi | 15 +- sys/contrib/device-tree/src/arm/at91sam9263ek.dts | 3 +- sys/contrib/device-tree/src/arm/at91sam9g20.dtsi | 5 +- .../device-tree/src/arm/at91sam9g20ek_common.dtsi | 3 +- .../src/arm/at91sam9g25-gardena-smart-gateway.dts | 158 ++ sys/contrib/device-tree/src/arm/at91sam9g45.dtsi | 12 +- .../device-tree/src/arm/at91sam9m10g45ek.dts | 4 +- sys/contrib/device-tree/src/arm/at91sam9n12.dtsi | 10 +- sys/contrib/device-tree/src/arm/at91sam9n12ek.dts | 2 +- sys/contrib/device-tree/src/arm/at91sam9rl.dtsi | 10 +- sys/contrib/device-tree/src/arm/at91sam9rlek.dts | 2 +- sys/contrib/device-tree/src/arm/at91sam9x5.dtsi | 12 +- sys/contrib/device-tree/src/arm/at91sam9x5cm.dtsi | 2 +- sys/contrib/device-tree/src/arm/at91sam9x5ek.dtsi | 2 + sys/contrib/device-tree/src/arm/at91sam9xe.dtsi | 3 + sys/contrib/device-tree/src/arm/bcm-cygnus.dtsi | 4 +- sys/contrib/device-tree/src/arm/bcm-nsp.dtsi | 6 +- .../device-tree/src/arm/bcm2711-rpi-4-b.dts | 70 + sys/contrib/device-tree/src/arm/bcm2711.dtsi | 122 +- .../device-tree/src/arm/bcm53016-meraki-mr32.dts | 197 ++ sys/contrib/device-tree/src/arm/bcm5301x.dtsi | 25 +- sys/contrib/device-tree/src/arm/bcm958525xmc.dts | 2 +- sys/contrib/device-tree/src/arm/bcm958625k.dts | 2 +- .../device-tree/src/arm/cros-ec-keyboard.dtsi | 1 + sys/contrib/device-tree/src/arm/dra7-evm.dts | 15 +- sys/contrib/device-tree/src/arm/dra7-l4.dtsi | 55 - sys/contrib/device-tree/src/arm/dra7.dtsi | 4 +- sys/contrib/device-tree/src/arm/dra71-evm.dts | 14 +- .../device-tree/src/arm/dra72-evm-common.dtsi | 10 +- sys/contrib/device-tree/src/arm/dra72-evm-revc.dts | 14 +- sys/contrib/device-tree/src/arm/dra72-evm.dts | 13 +- sys/contrib/device-tree/src/arm/dra76-evm.dts | 18 +- sys/contrib/device-tree/src/arm/dra76x.dtsi | 4 +- sys/contrib/device-tree/src/arm/emev2.dtsi | 2 +- sys/contrib/device-tree/src/arm/ethernut5.dts | 2 +- .../device-tree/src/arm/exynos3250-artik5.dtsi | 4 + .../device-tree/src/arm/exynos3250-monk.dts | 6 +- .../device-tree/src/arm/exynos3250-rinato.dts | 6 +- sys/contrib/device-tree/src/arm/exynos3250.dtsi | 44 +- .../device-tree/src/arm/exynos4210-i9100.dts | 56 +- .../device-tree/src/arm/exynos4210-origen.dts | 27 + .../device-tree/src/arm/exynos4210-smdkv310.dts | 25 + .../device-tree/src/arm/exynos4210-trats.dts | 186 +- .../src/arm/exynos4210-universal_c210.dts | 36 +- sys/contrib/device-tree/src/arm/exynos4210.dtsi | 38 +- .../device-tree/src/arm/exynos4412-galaxy-s3.dtsi | 42 +- .../device-tree/src/arm/exynos4412-i9300.dts | 6 +- .../device-tree/src/arm/exynos4412-i9305.dts | 2 +- .../device-tree/src/arm/exynos4412-midas.dtsi | 116 +- .../device-tree/src/arm/exynos4412-n710x.dts | 39 +- .../src/arm/exynos4412-odroid-common.dtsi | 34 +- .../device-tree/src/arm/exynos4412-odroidu3.dts | 46 +- .../device-tree/src/arm/exynos4412-origen.dts | 25 + .../device-tree/src/arm/exynos4412-smdk4412.dts | 27 + .../device-tree/src/arm/exynos4412-tiny4412.dts | 24 + .../device-tree/src/arm/exynos4412-trats2.dts | 2 +- sys/contrib/device-tree/src/arm/exynos4412.dtsi | 18 +- sys/contrib/device-tree/src/arm/exynos5.dtsi | 10 +- .../device-tree/src/arm/exynos5250-arndale.dts | 20 +- .../device-tree/src/arm/exynos5250-smdk5250.dts | 16 +- .../device-tree/src/arm/exynos5250-spring.dts | 41 +- sys/contrib/device-tree/src/arm/exynos5250.dtsi | 54 +- sys/contrib/device-tree/src/arm/exynos5260.dtsi | 4 +- .../device-tree/src/arm/exynos5410-odroidxu.dts | 8 +- .../device-tree/src/arm/exynos5410-smdk5410.dts | 12 + sys/contrib/device-tree/src/arm/exynos5410.dtsi | 12 +- .../device-tree/src/arm/exynos5420-smdk5420.dts | 3 + sys/contrib/device-tree/src/arm/exynos5420.dtsi | 16 +- .../src/arm/exynos5422-odroid-core.dtsi | 4 +- .../src/arm/exynos5422-odroidxu3-audio.dtsi | 60 +- .../device-tree/src/arm/exynos5422-odroidxu4.dts | 60 +- sys/contrib/device-tree/src/arm/hi3620.dtsi | 32 +- sys/contrib/device-tree/src/arm/hip04.dtsi | 6 +- sys/contrib/device-tree/src/arm/hisi-x5hd2.dtsi | 5 +- sys/contrib/device-tree/src/arm/imx23-evk.dts | 2 +- sys/contrib/device-tree/src/arm/imx23.dtsi | 2 +- sys/contrib/device-tree/src/arm/imx25-pinfunc.h | 28 +- .../src/arm/imx27-phytec-phycard-s-som.dtsi | 4 +- .../src/arm/imx27-phytec-phycore-rdk.dts | 2 +- sys/contrib/device-tree/src/arm/imx27.dtsi | 2 +- sys/contrib/device-tree/src/arm/imx28-apf28.dts | 2 +- .../device-tree/src/arm/imx28-apx4devkit.dts | 2 +- sys/contrib/device-tree/src/arm/imx28-evk.dts | 2 +- sys/contrib/device-tree/src/arm/imx28-m28.dtsi | 2 +- sys/contrib/device-tree/src/arm/imx28-m28cu3.dts | 2 +- sys/contrib/device-tree/src/arm/imx28.dtsi | 2 +- sys/contrib/device-tree/src/arm/imx50-evk.dts | 4 +- sys/contrib/device-tree/src/arm/imx51-apf51dev.dts | 4 +- sys/contrib/device-tree/src/arm/imx53-m53menlo.dts | 2 +- sys/contrib/device-tree/src/arm/imx53-smd.dts | 2 +- sys/contrib/device-tree/src/arm/imx53-tqma53.dtsi | 8 +- .../device-tree/src/arm/imx53-voipac-dmm-668.dtsi | 3 +- .../src/arm/imx6-logicpd-baseboard.dtsi | 3 +- .../device-tree/src/arm/imx6dl-aristainetos_4.dts | 2 +- .../src/arm/imx6dl-eckelmann-ci4x10.dts | 4 +- sys/contrib/device-tree/src/arm/imx6dl-prtrvt.dts | 4 +- sys/contrib/device-tree/src/arm/imx6dl-prtvt7.dts | 2 +- sys/contrib/device-tree/src/arm/imx6dl-tqma6a.dtsi | 16 + sys/contrib/device-tree/src/arm/imx6dl-tqma6b.dtsi | 16 + .../device-tree/src/arm/imx6dl-yapp4-common.dtsi | 38 +- .../device-tree/src/arm/imx6dl-yapp4-hydra.dts | 6 +- .../device-tree/src/arm/imx6dl-yapp4-orion.dts | 54 + .../device-tree/src/arm/imx6dl-yapp4-ursa.dts | 4 + sys/contrib/device-tree/src/arm/imx6dl.dtsi | 8 +- sys/contrib/device-tree/src/arm/imx6q-b450v3.dts | 14 +- sys/contrib/device-tree/src/arm/imx6q-b650v3.dts | 12 +- sys/contrib/device-tree/src/arm/imx6q-b850v3.dts | 4 +- sys/contrib/device-tree/src/arm/imx6q-ba16.dtsi | 2 +- sys/contrib/device-tree/src/arm/imx6q-bx50v3.dtsi | 31 +- sys/contrib/device-tree/src/arm/imx6q-cm-fx6.dts | 2 +- .../device-tree/src/arm/imx6q-dhcom-som.dtsi | 2 +- .../device-tree/src/arm/imx6q-dmo-edmqmx6.dts | 2 +- sys/contrib/device-tree/src/arm/imx6q-dms-ba16.dts | 2 +- sys/contrib/device-tree/src/arm/imx6q-gw5400-a.dts | 2 +- .../device-tree/src/arm/imx6q-kontron-samx6i.dtsi | 7 +- sys/contrib/device-tree/src/arm/imx6q-logicpd.dts | 2 +- sys/contrib/device-tree/src/arm/imx6q-prti6q.dts | 10 +- sys/contrib/device-tree/src/arm/imx6q-tqma6a.dtsi | 16 + sys/contrib/device-tree/src/arm/imx6q-tqma6b.dtsi | 15 + .../src/arm/imx6q-var-dt6customboard.dts | 4 +- sys/contrib/device-tree/src/arm/imx6q.dtsi | 8 +- *** 4080 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Tue Mar 23 14:02:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 100725AFDA3; Tue, 23 Mar 2021 14: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 4F4Y3Q75DMz4tnv; Tue, 23 Mar 2021 14:02: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 E634A2250A; Tue, 23 Mar 2021 14: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 12NE2gEP046704; Tue, 23 Mar 2021 14: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 12NE2g3q046703; Tue, 23 Mar 2021 14:02:42 GMT (envelope-from git) Date: Tue, 23 Mar 2021 14:02:42 GMT Message-Id: <202103231402.12NE2g3q046703@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: 1240fba44d74 - main - dts: Bump the freebsd branding version to 5.10 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: 1240fba44d7429e688442ca606672fcfc2770db6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 14:02:43 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1240fba44d7429e688442ca606672fcfc2770db6 commit 1240fba44d7429e688442ca606672fcfc2770db6 Author: Emmanuel Vadot AuthorDate: 2021-03-23 14:02:21 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-23 14:02:21 +0000 dts: Bump the freebsd branding version to 5.10 --- sys/dts/freebsd-compatible.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dts/freebsd-compatible.dts b/sys/dts/freebsd-compatible.dts index 3621ac45901a..5b1f4f2462f2 100644 --- a/sys/dts/freebsd-compatible.dts +++ b/sys/dts/freebsd-compatible.dts @@ -1,3 +1,3 @@ / { - freebsd,dts-version = "5.9"; + freebsd,dts-version = "5.10"; }; From owner-dev-commits-src-main@freebsd.org Tue Mar 23 14:04:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62DAA5AFBD9; Tue, 23 Mar 2021 14:04: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 4F4Y5v2M87z4tWJ; Tue, 23 Mar 2021 14:04:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43D5B22490; Tue, 23 Mar 2021 14:04:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12NE4pRl047124; Tue, 23 Mar 2021 14:04:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NE4p4p047123; Tue, 23 Mar 2021 14:04:51 GMT (envelope-from git) Date: Tue, 23 Mar 2021 14:04:51 GMT Message-Id: <202103231404.12NE4p4p047123@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: b93a796b06ec - main - pf: Handle unmapped mbufs when computing checksums 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: b93a796b06ec013a75a08ac43d8acf6aa94aa970 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 14:04:51 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b93a796b06ec013a75a08ac43d8acf6aa94aa970 commit b93a796b06ec013a75a08ac43d8acf6aa94aa970 Author: Mark Johnston AuthorDate: 2021-03-23 13:38:59 +0000 Commit: Mark Johnston CommitDate: 2021-03-23 14:04:31 +0000 pf: Handle unmapped mbufs when computing checksums PR: 254419 Reviewed by: gallatin, kp Tested by: Igor A. Valkov MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29378 --- sys/netpfil/pf/pf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 752e8a7eef1a..71635a061225 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5571,11 +5571,17 @@ pf_route(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, /* Copied from FreeBSD 10.0-CURRENT ip_output. */ m0->m_pkthdr.csum_flags |= CSUM_IP; if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA & ~ifp->if_hwassist) { + m0 = mb_unmapped_to_ext(m0); + if (m0 == NULL) + goto done; in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #if defined(SCTP) || defined(SCTP_SUPPORT) if (m0->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { + m0 = mb_unmapped_to_ext(m0); + if (m0 == NULL) + goto done; sctp_delayed_cksum(m0, (uint32_t)(ip->ip_hl << 2)); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; } @@ -5752,6 +5758,9 @@ pf_route6(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6 & ~ifp->if_hwassist) { uint32_t plen = m0->m_pkthdr.len - sizeof(*ip6); + m0 = mb_unmapped_to_ext(m0); + if (m0 == NULL) + goto done; in6_delayed_cksum(m0, plen, sizeof(struct ip6_hdr)); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; } From owner-dev-commits-src-main@freebsd.org Tue Mar 23 14:25:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 046C95B03B2; Tue, 23 Mar 2021 14:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F4YY96jvdz3BmF; Tue, 23 Mar 2021 14:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D97192215C; Tue, 23 Mar 2021 14:25: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 12NEP1ki075248; Tue, 23 Mar 2021 14:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NEP14u075247; Tue, 23 Mar 2021 14:25:01 GMT (envelope-from git) Date: Tue, 23 Mar 2021 14:25:01 GMT Message-Id: <202103231425.12NEP14u075247@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: 63f344024a0d - main - arm64: Check dtb version against the one we're expecting to find 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: 63f344024a0d336b116f3563a1604fbd9b4253c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 14:25:02 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=63f344024a0d336b116f3563a1604fbd9b4253c7 commit 63f344024a0d336b116f3563a1604fbd9b4253c7 Author: Emmanuel Vadot AuthorDate: 2021-03-23 14:24:14 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-23 14:24:53 +0000 arm64: Check dtb version against the one we're expecting to find Do for arm64 what was done for armv7 in e63faa9ba832b6 --- sys/arm64/arm64/machdep.c | 16 ++++++++++++++++ sys/conf/Makefile.arm64 | 3 +++ 2 files changed, 19 insertions(+) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 8a1e7520aacb..308a870fe188 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -1241,6 +1241,8 @@ initarm(struct arm64_bootparams *abp) #ifdef FDT struct mem_region mem_regions[FDT_MEM_REGIONS]; int mem_regions_sz; + phandle_t root; + char dts_version[255]; #endif vm_offset_t lastaddr; caddr_t kmdp; @@ -1353,6 +1355,20 @@ initarm(struct arm64_bootparams *abp) if (env != NULL) strlcpy(kernelname, env, sizeof(kernelname)); +#ifdef FDT + root = OF_finddevice("/"); + if (OF_getprop(root, "freebsd,dts-version", dts_version, sizeof(dts_version)) > 0) { + if (strcmp(LINUX_DTS_VERSION, dts_version) != 0) + printf("WARNING: DTB version is %s while kernel expects %s, " + "please update the DTB in the ESP\n", + dts_version, + LINUX_DTS_VERSION); + } else { + printf("WARNING: Cannot find freebsd,dts-version property, " + "cannot check DTB compliance\n"); + } +#endif + if (boothowto & RB_VERBOSE) { if (efihdr != NULL) print_efi_map_entries(efihdr); diff --git a/sys/conf/Makefile.arm64 b/sys/conf/Makefile.arm64 index c7951872ca2d..2e404664708c 100644 --- a/sys/conf/Makefile.arm64 +++ b/sys/conf/Makefile.arm64 @@ -27,6 +27,9 @@ S= ../../.. INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include +LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts +CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" + # Use a custom SYSTEM_LD command to generate the elf kernel, so we can # set the text segment start address, and also strip the "arm mapping # symbols" which have names like $a.0 and $d.2; see the document From owner-dev-commits-src-main@freebsd.org Tue Mar 23 15:38:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 202885B2100; Tue, 23 Mar 2021 15:38: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 4F4bB30Sj4z3H6b; Tue, 23 Mar 2021 15:38: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 02BDA23541; Tue, 23 Mar 2021 15:38: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 12NFcYC9074767; Tue, 23 Mar 2021 15:38:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NFcYE8074766; Tue, 23 Mar 2021 15:38:34 GMT (envelope-from git) Date: Tue, 23 Mar 2021 15:38:34 GMT Message-Id: <202103231538.12NFcYE8074766@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: 6bcba8dac9a4 - main - arm64: Only check for freebsd, dts-version if we are booted in FDT mode. 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: 6bcba8dac9a4ddaeabf84ad8d31b1113a9dcf8c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 15:38:35 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=6bcba8dac9a4ddaeabf84ad8d31b1113a9dcf8c2 commit 6bcba8dac9a4ddaeabf84ad8d31b1113a9dcf8c2 Author: Emmanuel Vadot AuthorDate: 2021-03-23 15:37:25 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-23 15:37:25 +0000 arm64: Only check for freebsd,dts-version if we are booted in FDT mode. Reported by: andrew --- sys/arm64/arm64/machdep.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 308a870fe188..97fa374b1c75 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -1356,16 +1356,18 @@ initarm(struct arm64_bootparams *abp) strlcpy(kernelname, env, sizeof(kernelname)); #ifdef FDT - root = OF_finddevice("/"); - if (OF_getprop(root, "freebsd,dts-version", dts_version, sizeof(dts_version)) > 0) { - if (strcmp(LINUX_DTS_VERSION, dts_version) != 0) - printf("WARNING: DTB version is %s while kernel expects %s, " - "please update the DTB in the ESP\n", - dts_version, - LINUX_DTS_VERSION); - } else { - printf("WARNING: Cannot find freebsd,dts-version property, " - "cannot check DTB compliance\n"); + if (arm64_bus_method == ARM64_BUS_FDT) { + root = OF_finddevice("/"); + if (OF_getprop(root, "freebsd,dts-version", dts_version, sizeof(dts_version)) > 0) { + if (strcmp(LINUX_DTS_VERSION, dts_version) != 0) + printf("WARNING: DTB version is %s while kernel expects %s, " + "please update the DTB in the ESP\n", + dts_version, + LINUX_DTS_VERSION); + } else { + printf("WARNING: Cannot find freebsd,dts-version property, " + "cannot check DTB compliance\n"); + } } #endif From owner-dev-commits-src-main@freebsd.org Tue Mar 23 16:52:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 395915B44A3; Tue, 23 Mar 2021 16:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F4cpw707Nz3Mkr; Tue, 23 Mar 2021 16:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3069246A2; Tue, 23 Mar 2021 16:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12NGq8Mo085201; Tue, 23 Mar 2021 16:52:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NGq8K9085200; Tue, 23 Mar 2021 16:52:08 GMT (envelope-from git) Date: Tue, 23 Mar 2021 16:52:08 GMT Message-Id: <202103231652.12NGq8K9085200@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: 9bd734521220 - main - libc: Some enhancements to syslog(3) 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: 9bd7345212203924046009e29ce3f1515556f989 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 16:52:09 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9bd7345212203924046009e29ce3f1515556f989 commit 9bd7345212203924046009e29ce3f1515556f989 Author: Dmitry Wagin AuthorDate: 2021-03-23 16:01:15 +0000 Commit: Mark Johnston CommitDate: 2021-03-23 16:49:58 +0000 libc: Some enhancements to syslog(3) - Defined MAXLINE constant (8192 octets by default instead 2048) for centralized limit setting up. It sets maximum number of characters of the syslog message. RFC5424 doesn't limit maximum size of the message. Named after MAXLINE in syslogd(8). - Fixed size of fmt_cpy buffer up to MAXLINE for rendering formatted (%m) messages. - Introduced autoexpansion of sending socket buffer up to MAXLINE. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27205 --- lib/libc/gen/syslog.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index 19d44db0075a..797c7389d1a2 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -57,6 +57,9 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" +/* Maximum number of characters of syslog message */ +#define MAXLINE 8192 + static int LogFile = -1; /* fd for log */ static int status; /* connection status */ static int opened; /* have done openlog() */ @@ -141,7 +144,7 @@ vsyslog1(int pri, const char *fmt, va_list ap) char ch, *p; long tz_offset; int cnt, fd, saved_errno; - char hostname[MAXHOSTNAMELEN], *stdp, tbuf[2048], fmt_cpy[1024], + char hostname[MAXHOSTNAMELEN], *stdp, tbuf[MAXLINE], fmt_cpy[MAXLINE], errstr[64], tz_sign; FILE *fp, *fmt_fp; struct bufcookie tbuf_cookie; @@ -396,9 +399,19 @@ connectlog(void) struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */ if (LogFile == -1) { + socklen_t len; + if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0)) == -1) return; + if (_getsockopt(LogFile, SOL_SOCKET, SO_SNDBUF, &len, + &(socklen_t){sizeof(len)}) == 0) { + if (len < MAXLINE) { + len = MAXLINE; + (void)_setsockopt(LogFile, SOL_SOCKET, SO_SNDBUF, + &len, sizeof(len)); + } + } } if (LogFile != -1 && status == NOCONN) { SyslogAddr.sun_len = sizeof(SyslogAddr); From owner-dev-commits-src-main@freebsd.org Tue Mar 23 16:52:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FC8C5B4508; Tue, 23 Mar 2021 16:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F4cpy0wRCz3N1c; Tue, 23 Mar 2021 16:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12B8524669; Tue, 23 Mar 2021 16:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12NGq9AD085223; Tue, 23 Mar 2021 16:52:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NGq9Ff085222; Tue, 23 Mar 2021 16:52:09 GMT (envelope-from git) Date: Tue, 23 Mar 2021 16:52:09 GMT Message-Id: <202103231652.12NGq9Ff085222@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: 2d82b47a5b4e - main - syslogd: Increase message size limits 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: 2d82b47a5b4ef18550565dd55628d51f54d0af2e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 16:52:10 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2d82b47a5b4ef18550565dd55628d51f54d0af2e commit 2d82b47a5b4ef18550565dd55628d51f54d0af2e Author: Dmitry Wagin AuthorDate: 2021-03-23 16:15:28 +0000 Commit: Mark Johnston CommitDate: 2021-03-23 16:49:58 +0000 syslogd: Increase message size limits Add a -M option to control the maximum length of forwarded messages. syslogd(8) used to truncate forwarded messages to 1024 bytes, but after commit 1a874a126a54 ("Add RFC 5424 syslog message output to syslogd.") applies a more conservative limit of 480 bytes for IPv4 per RFC 5426 section 3.2. Restore the old default behaviour of truncating to 1024 bytes. RFC 5424 specifies no upper limit on the length of forwarded messages, while for RFC 3164 the limit is 1024 bytes. Increase MAXLINE to 8192 bytes to correspond to commit 672ef817a192. Replaced bootfile[] size for MAXPATHLEN used in getbootfile(3) as a returned value. Using (MAXLINE+1) as a size for bootfile[] is excessive. PR: 241937 MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27206 --- usr.sbin/syslogd/syslogd.8 | 6 ++++++ usr.sbin/syslogd/syslogd.c | 33 +++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.8 b/usr.sbin/syslogd/syslogd.8 index 0e1169771f0a..c908e130f114 100644 --- a/usr.sbin/syslogd/syslogd.8 +++ b/usr.sbin/syslogd/syslogd.8 @@ -41,6 +41,7 @@ .Op Fl b Ar bind_address .Op Fl f Ar config_file .Op Fl l Oo Ar mode Ns \&: Oc Ns Ar path +.Op Fl M Ar fwd_length .Op Fl m Ar mark_interval .Op Fl O Ar format .Op Fl P Ar pid_file @@ -243,6 +244,11 @@ Usually the .Dq kern facility is reserved for messages read directly from .Pa /dev/klog . +.It Fl M Ar fwd_length +Set the limit on the length of forwarded messages. +The minimum is 480 octets. +The maximum for RFC 3164 output format is 1024 octets. +The default is 1024 octets. .It Fl m Ar mark_interval Select the number of minutes between .Dq mark diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index acf9e193efd9..d8a2c0a5680e 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -97,8 +97,7 @@ __FBSDID("$FreeBSD$"); * Priority comparison code by Harlan Stenn. */ -/* Maximum number of characters in time of last occurrence */ -#define MAXLINE 2048 /* maximum line length */ +#define MAXLINE 8192 /* maximum line length */ #define MAXSVLINE MAXLINE /* maximum saved line length */ #define DEFUPRI (LOG_USER|LOG_NOTICE) #define DEFSPRI (LOG_KERN|LOG_CRIT) @@ -383,6 +382,7 @@ static int MarkInterval = 20 * 60; /* interval between marks in seconds */ static int MarkSeq; /* mark sequence number */ static int NoBind; /* don't bind() as suggested by RFC 3164 */ static int SecureMode; /* when true, receive only unix domain socks */ +static int MaxForwardLen = 1024; /* max length of forwared message */ #ifdef INET6 static int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */ #else @@ -394,7 +394,7 @@ static int use_bootfile; /* log entire bootfile for every kern msg */ static int no_compress; /* don't compress messages (1=pipes, 2=all) */ static int logflags = O_WRONLY|O_APPEND; /* flags used to open log files */ -static char bootfile[MAXLINE+1]; /* booted kernel file */ +static char bootfile[MAXPATHLEN]; /* booted kernel file */ static int RemoteAddDate; /* Always set the date on remote messages */ static int RemoteHostname; /* Log remote hostname from the message */ @@ -553,7 +553,7 @@ main(int argc, char *argv[]) if (madvise(NULL, 0, MADV_PROTECT) != 0) dprintf("madvise() failed: %s\n", strerror(errno)); - while ((ch = getopt(argc, argv, "468Aa:b:cCdf:FHkl:m:nNoO:p:P:sS:Tuv")) + while ((ch = getopt(argc, argv, "468Aa:b:cCdf:FHkl:M:m:nNoO:p:P:sS:Tuv")) != -1) switch (ch) { #ifdef INET @@ -666,6 +666,12 @@ main(int argc, char *argv[]) }); break; } + case 'M': /* max length of forwarded message */ + MaxForwardLen = atoi(optarg); + if (MaxForwardLen < 480) + errx(1, "minimum length limit of forwarded " + "messages is 480 bytes"); + break; case 'm': /* mark interval */ MarkInterval = atoi(optarg) * 60; break; @@ -710,6 +716,9 @@ main(int argc, char *argv[]) if ((argc -= optind) != 0) usage(); + if (RFC3164OutputFormat && MaxForwardLen > 1024) + errx(1, "RFC 3164 messages may not exceed 1024 bytes"); + /* Pipe to catch a signal during select(). */ s = pipe2(sigpipe, O_CLOEXEC); if (s < 0) { @@ -948,9 +957,9 @@ usage(void) fprintf(stderr, "usage: syslogd [-468ACcdFHknosTuv] [-a allowed_peer]\n" " [-b bind_address] [-f config_file]\n" - " [-l [mode:]path] [-m mark_interval]\n" - " [-O format] [-P pid_file] [-p log_socket]\n" - " [-S logpriv_socket]\n"); + " [-l [mode:]path] [-M fwd_length]\n" + " [-m mark_interval] [-O format] [-P pid_file]\n" + " [-p log_socket] [-S logpriv_socket]\n"); exit(1); } @@ -1840,27 +1849,27 @@ fprintlog_write(struct filed *f, struct iovlist *il, int flags) switch (f->f_type) { case F_FORW: - /* Truncate messages to RFC 5426 recommended size. */ dprintf(" %s", f->fu_forw_hname); switch (f->fu_forw_addr->ai_family) { #ifdef INET case AF_INET: dprintf(":%d\n", ntohs(satosin(f->fu_forw_addr->ai_addr)->sin_port)); - iovlist_truncate(il, 480); break; #endif #ifdef INET6 case AF_INET6: dprintf(":%d\n", ntohs(satosin6(f->fu_forw_addr->ai_addr)->sin6_port)); - iovlist_truncate(il, 1180); break; #endif default: dprintf("\n"); } + /* Truncate messages to maximum forward length. */ + iovlist_truncate(il, MaxForwardLen); + lsent = 0; for (r = f->fu_forw_addr; r; r = r->ai_next) { memset(&msghdr, 0, sizeof(msghdr)); @@ -2553,7 +2562,7 @@ init(int signo) char *p; char oldLocalHostName[MAXHOSTNAMELEN]; char hostMsg[2*MAXHOSTNAMELEN+40]; - char bootfileMsg[LINE_MAX]; + char bootfileMsg[MAXLINE + 1]; dprintf("init\n"); WantInitialize = 0; @@ -2900,7 +2909,7 @@ cfline(const char *line, const char *prog, const char *host, int error, i, pri, syncfile; const char *p, *q; char *bp, *pfilter_dup; - char buf[MAXLINE], ebuf[100]; + char buf[LINE_MAX], ebuf[100]; dprintf("cfline(\"%s\", f, \"%s\", \"%s\", \"%s\")\n", line, prog, host, pfilter); From owner-dev-commits-src-main@freebsd.org Tue Mar 23 17:38:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E94C5B62AE; Tue, 23 Mar 2021 17:38: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 4F4drz46Zvz3h5k; Tue, 23 Mar 2021 17:38: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 75AE425205; Tue, 23 Mar 2021 17:38: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 12NHcxex042513; Tue, 23 Mar 2021 17:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NHcxBd042512; Tue, 23 Mar 2021 17:38:59 GMT (envelope-from git) Date: Tue, 23 Mar 2021 17:38:59 GMT Message-Id: <202103231738.12NHcxBd042512@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: df7549775c4e - main - Replace the arm64 initial_fpcr with a macro 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: df7549775c4e36d8ac0ed6cce2525203beb2b32c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 17:38:59 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=df7549775c4e36d8ac0ed6cce2525203beb2b32c commit df7549775c4e36d8ac0ed6cce2525203beb2b32c Author: Andrew Turner AuthorDate: 2021-03-23 15:28:20 +0000 Commit: Andrew Turner CommitDate: 2021-03-23 17:12:43 +0000 Replace the arm64 initial_fpcr with a macro This value was never changed from its default value. Replace it with a macro. Sponsored by: Innovate UK --- sys/arm64/arm64/vfp.c | 4 ++-- sys/arm64/arm64/vm_machdep.c | 2 -- sys/arm64/include/md_var.h | 2 -- sys/arm64/include/vfp.h | 1 + 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index 5fa420e668c1..4935946d2430 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -212,7 +212,7 @@ vfp_reset_state(struct thread *td, struct pcb *pcb) bzero(&pcb->pcb_fpustate.vfp_regs, sizeof(pcb->pcb_fpustate.vfp_regs)); KASSERT(pcb->pcb_fpusaved == &pcb->pcb_fpustate, ("pcb_fpusaved should point to pcb_fpustate.")); - pcb->pcb_fpustate.vfp_fpcr = initial_fpcr; + pcb->pcb_fpustate.vfp_fpcr = VFPCR_INIT; pcb->pcb_fpustate.vfp_fpsr = 0; pcb->pcb_vfpcpu = UINT_MAX; pcb->pcb_fpflags = 0; @@ -262,7 +262,7 @@ vfp_init(void) vfp_disable(); if (PCPU_GET(cpuid) == 0) - thread0.td_pcb->pcb_fpusaved->vfp_fpcr = initial_fpcr; + thread0.td_pcb->pcb_fpusaved->vfp_fpcr = VFPCR_INIT; } 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 0193048e2697..c37f1d849359 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include #endif -uint32_t initial_fpcr = VFPCR_DN; - #include /* diff --git a/sys/arm64/include/md_var.h b/sys/arm64/include/md_var.h index 73cf642148b5..0132ab0dd8fd 100644 --- a/sys/arm64/include/md_var.h +++ b/sys/arm64/include/md_var.h @@ -54,6 +54,4 @@ 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 3632e5eaa396..6689be1b15d7 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -36,6 +36,7 @@ #define VFPCR_AHP (0x04000000) /* alt. half-precision: */ #define VFPCR_DN (0x02000000) /* default NaN enable */ #define VFPCR_FZ (0x01000000) /* flush to zero enabled */ +#define VFPCR_INIT VFPCR_DN /* Default fpcr after exec */ #define VFPCR_RMODE_OFF 22 /* rounding mode offset */ #define VFPCR_RMODE_MASK (0x00c00000) /* rounding mode mask */ From owner-dev-commits-src-main@freebsd.org Tue Mar 23 18:05:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E86025B6BDD; Tue, 23 Mar 2021 18:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F4fRL5F58z3jb5; Tue, 23 Mar 2021 18:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C7E02542E; Tue, 23 Mar 2021 18:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12NI5I1f084420; Tue, 23 Mar 2021 18:05:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NI5IUE084419; Tue, 23 Mar 2021 18:05:18 GMT (envelope-from git) Date: Tue, 23 Mar 2021 18:05:18 GMT Message-Id: <202103231805.12NI5IUE084419@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: cd5671efc019 - main - dummynet: Move packet counters into dn_cfg 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: cd5671efc0190ba0f9eb41bba42e703277af20c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 18:05:19 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cd5671efc0190ba0f9eb41bba42e703277af20c3 commit cd5671efc0190ba0f9eb41bba42e703277af20c3 Author: Kristof Provost AuthorDate: 2021-03-09 15:27:31 +0000 Commit: Kristof Provost CommitDate: 2021-03-23 17:01:58 +0000 dummynet: Move packet counters into dn_cfg Move the packets counters into the dn_cfg struct. This reduces the global name space use for dummynet and will make future work for things like vnet support and re-use in pf easier. Reviewed by: donner MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29245 --- sys/netpfil/ipfw/dn_aqm.h | 5 +---- sys/netpfil/ipfw/dn_sched_fq_codel.h | 2 +- sys/netpfil/ipfw/dn_sched_fq_pie.c | 2 +- sys/netpfil/ipfw/ip_dn_io.c | 24 ++++++++---------------- sys/netpfil/ipfw/ip_dn_private.h | 5 +++++ 5 files changed, 16 insertions(+), 22 deletions(-) diff --git a/sys/netpfil/ipfw/dn_aqm.h b/sys/netpfil/ipfw/dn_aqm.h index a8a362a4bde9..8bbe9fe69e86 100644 --- a/sys/netpfil/ipfw/dn_aqm.h +++ b/sys/netpfil/ipfw/dn_aqm.h @@ -53,9 +53,6 @@ typedef int32_t aqm_stime_t; /* Macro for variable bounding */ #define BOUND_VAR(x,l,h) ((x) > (h)? (h) : ((x) > (l)? (x) : (l))) -/* sysctl variable to count number of dropped packets */ -extern unsigned long io_pkt_drop; - /* * Structure for holding data and function pointers that together represent a * AQM algorithm. @@ -137,7 +134,7 @@ update_stats(struct dn_queue *q, int len, int drop) if (drop) { qni->drops++; sni->drops++; - io_pkt_drop++; + dn_cfg.io_pkt_drop++; } else { /*update queue stats */ qni->length += inc; diff --git a/sys/netpfil/ipfw/dn_sched_fq_codel.h b/sys/netpfil/ipfw/dn_sched_fq_codel.h index 725189483ba2..a8369ac83129 100644 --- a/sys/netpfil/ipfw/dn_sched_fq_codel.h +++ b/sys/netpfil/ipfw/dn_sched_fq_codel.h @@ -104,7 +104,7 @@ fq_update_stats(struct fq_codel_flow *q, struct fq_codel_si *si, int len, si->main_q.ni.drops ++; q->stats.drops ++; si->_si.ni.drops ++; - io_pkt_drop ++; + dn_cfg.io_pkt_drop ++; } if (!drop || (drop && len < 0)) { diff --git a/sys/netpfil/ipfw/dn_sched_fq_pie.c b/sys/netpfil/ipfw/dn_sched_fq_pie.c index 2f21ca77e33a..257dada44345 100644 --- a/sys/netpfil/ipfw/dn_sched_fq_pie.c +++ b/sys/netpfil/ipfw/dn_sched_fq_pie.c @@ -299,7 +299,7 @@ fq_update_stats(struct fq_pie_flow *q, struct fq_pie_si *si, int len, si->main_q.ni.drops ++; q->stats.drops ++; si->_si.ni.drops ++; - io_pkt_drop ++; + dn_cfg.io_pkt_drop ++; } if (!drop || (drop && len < 0)) { diff --git a/sys/netpfil/ipfw/ip_dn_io.c b/sys/netpfil/ipfw/ip_dn_io.c index 1b39fcb0359f..f71d07ae1140 100644 --- a/sys/netpfil/ipfw/ip_dn_io.c +++ b/sys/netpfil/ipfw/ip_dn_io.c @@ -88,14 +88,6 @@ static long tick_lost; /* Lost(coalesced) ticks number. */ /* Adjusted vs non-adjusted curr_time difference (ticks). */ static long tick_diff; -static unsigned long io_pkt; -static unsigned long io_pkt_fast; - -#ifdef NEW_AQM -unsigned long io_pkt_drop; -#else -static unsigned long io_pkt_drop; -#endif /* * We use a heap to store entities for which we have pending timer events. * The heap is checked at every tick and all entities with expired events @@ -228,13 +220,13 @@ SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, fsk_count, SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, queue_count, CTLFLAG_RD, DC(queue_count), 0, "Number of queues"); SYSCTL_ULONG(_net_inet_ip_dummynet, OID_AUTO, io_pkt, - CTLFLAG_RD, &io_pkt, 0, + CTLFLAG_RD, DC(io_pkt), 0, "Number of packets passed to dummynet."); SYSCTL_ULONG(_net_inet_ip_dummynet, OID_AUTO, io_pkt_fast, - CTLFLAG_RD, &io_pkt_fast, 0, + CTLFLAG_RD, DC(io_pkt_fast), 0, "Number of packets bypassed dummynet scheduler."); SYSCTL_ULONG(_net_inet_ip_dummynet, OID_AUTO, io_pkt_drop, - CTLFLAG_RD, &io_pkt_drop, 0, + CTLFLAG_RD, DC(io_pkt_drop), 0, "Number of packets dropped by dummynet."); #undef DC SYSEND @@ -540,7 +532,7 @@ dn_enqueue(struct dn_queue *q, struct mbuf* m, int drop) return (0); drop: - io_pkt_drop++; + dn_cfg.io_pkt_drop++; q->ni.drops++; ni->drops++; FREE_PKT(m); @@ -882,7 +874,7 @@ dummynet_io(struct mbuf **m0, struct ip_fw_args *fwa) else if (fwa->flags & IPFW_ARGS_IP6) dir |= PROTO_IPV6; DN_BH_WLOCK(); - io_pkt++; + dn_cfg.io_pkt++; /* we could actually tag outside the lock, but who cares... */ if (tag_mbuf(m, dir, fwa)) goto dropit; @@ -918,7 +910,7 @@ dummynet_io(struct mbuf **m0, struct ip_fw_args *fwa) m = *m0 = NULL; /* dn_enqueue already increases io_pkt_drop */ - io_pkt_drop--; + dn_cfg.io_pkt_drop--; goto dropit; } @@ -956,7 +948,7 @@ dummynet_io(struct mbuf **m0, struct ip_fw_args *fwa) tag->m_tag_cookie = MTAG_IPFW_RULE; tag->m_tag_id = 0; - io_pkt_fast++; + dn_cfg.io_pkt_fast++; if (m->m_nextpkt != NULL) { printf("dummynet: fast io: pkt chain detected!\n"); m->m_nextpkt = NULL; @@ -972,7 +964,7 @@ done: return 0; dropit: - io_pkt_drop++; + dn_cfg.io_pkt_drop++; DN_BH_WUNLOCK(); if (m) FREE_PKT(m); diff --git a/sys/netpfil/ipfw/ip_dn_private.h b/sys/netpfil/ipfw/ip_dn_private.h index 24765bc09b0e..38c6ff1201d5 100644 --- a/sys/netpfil/ipfw/ip_dn_private.h +++ b/sys/netpfil/ipfw/ip_dn_private.h @@ -131,6 +131,11 @@ struct dn_parms { int fsk_count; int queue_count; + /* packet counters */ + unsigned long io_pkt; + unsigned long io_pkt_fast; + unsigned long io_pkt_drop; + /* ticks and other stuff */ uint64_t curr_time; /* flowsets and schedulers are in hash tables, with 'hash_size' From owner-dev-commits-src-main@freebsd.org Tue Mar 23 18:05:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D152A5B6958; Tue, 23 Mar 2021 18:05: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 4F4fRM5YkDz3jK7; Tue, 23 Mar 2021 18:05: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 B19BC25833; Tue, 23 Mar 2021 18:05: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 12NI5J5H084439; Tue, 23 Mar 2021 18:05:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NI5J2e084438; Tue, 23 Mar 2021 18:05:19 GMT (envelope-from git) Date: Tue, 23 Mar 2021 18:05:19 GMT Message-Id: <202103231805.12NI5J2e084438@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: 320bed3c007b - main - dummynet: Move timekeeping information into dn_cfg 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: 320bed3c007be1c2ff1f4b0d00d64d541d807fed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 18:05:19 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=320bed3c007be1c2ff1f4b0d00d64d541d807fed commit 320bed3c007be1c2ff1f4b0d00d64d541d807fed Author: Kristof Provost AuthorDate: 2021-03-09 15:44:26 +0000 Commit: Kristof Provost CommitDate: 2021-03-23 17:01:58 +0000 dummynet: Move timekeeping information into dn_cfg Just like with the packet counters move the timekeeping information into dn_cfg. This reduces the global name space use for dummynet and will make subsequent work to add vnet support and re-use in pf easier. Reviewed by: donner MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Different Revision: https://reviews.freebsd.org/D29246 --- sys/netpfil/ipfw/ip_dn_io.c | 44 ++++++++++++++++------------------------ sys/netpfil/ipfw/ip_dn_private.h | 8 ++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sys/netpfil/ipfw/ip_dn_io.c b/sys/netpfil/ipfw/ip_dn_io.c index f71d07ae1140..b439d2679f3c 100644 --- a/sys/netpfil/ipfw/ip_dn_io.c +++ b/sys/netpfil/ipfw/ip_dn_io.c @@ -80,14 +80,6 @@ __FBSDID("$FreeBSD$"); struct dn_parms dn_cfg; //VNET_DEFINE(struct dn_parms, _base_dn_cfg); -static long tick_last; /* Last tick duration (usec). */ -static long tick_delta; /* Last vs standard tick diff (usec). */ -static long tick_delta_sum; /* Accumulated tick difference (usec).*/ -static long tick_adjustment; /* Tick adjustments done. */ -static long tick_lost; /* Lost(coalesced) ticks number. */ -/* Adjusted vs non-adjusted curr_time difference (ticks). */ -static long tick_diff; - /* * We use a heap to store entities for which we have pending timer events. * The heap is checked at every tick and all entities with expired events @@ -192,16 +184,16 @@ SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, red_max_pkt_size, /* time adjustment */ SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_delta, - CTLFLAG_RD, &tick_delta, 0, "Last vs standard tick difference (usec)."); + CTLFLAG_RD, DC(tick_delta), 0, "Last vs standard tick difference (usec)."); SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_delta_sum, - CTLFLAG_RD, &tick_delta_sum, 0, "Accumulated tick difference (usec)."); + CTLFLAG_RD, DC(tick_delta_sum), 0, "Accumulated tick difference (usec)."); SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_adjustment, - CTLFLAG_RD, &tick_adjustment, 0, "Tick adjustments done."); + CTLFLAG_RD, DC(tick_adjustment), 0, "Tick adjustments done."); SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_diff, - CTLFLAG_RD, &tick_diff, 0, + CTLFLAG_RD, DC(tick_diff), 0, "Adjusted vs non-adjusted curr_time difference (ticks)."); SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_lost, - CTLFLAG_RD, &tick_lost, 0, + CTLFLAG_RD, DC(tick_lost), 0, "Number of ticks coalesced by dummynet taskqueue."); /* Drain parameters */ @@ -665,16 +657,16 @@ dummynet_task(void *context, int pending) DN_BH_WLOCK(); /* Update number of lost(coalesced) ticks. */ - tick_lost += pending - 1; + dn_cfg.tick_lost += pending - 1; getmicrouptime(&t); /* Last tick duration (usec). */ - tick_last = (t.tv_sec - dn_cfg.prev_t.tv_sec) * 1000000 + + dn_cfg.tick_last = (t.tv_sec - dn_cfg.prev_t.tv_sec) * 1000000 + (t.tv_usec - dn_cfg.prev_t.tv_usec); /* Last tick vs standard tick difference (usec). */ - tick_delta = (tick_last * hz - 1000000) / hz; + dn_cfg.tick_delta = (dn_cfg.tick_last * hz - 1000000) / hz; /* Accumulated tick difference (usec). */ - tick_delta_sum += tick_delta; + dn_cfg.tick_delta_sum += dn_cfg.tick_delta; dn_cfg.prev_t = t; @@ -686,18 +678,18 @@ dummynet_task(void *context, int pending) * adjustment. */ dn_cfg.curr_time++; - if (tick_delta_sum - tick >= 0) { - int diff = tick_delta_sum / tick; + if (dn_cfg.tick_delta_sum - tick >= 0) { + int diff = dn_cfg.tick_delta_sum / tick; dn_cfg.curr_time += diff; - tick_diff += diff; - tick_delta_sum %= tick; - tick_adjustment++; - } else if (tick_delta_sum + tick <= 0) { + dn_cfg.tick_diff += diff; + dn_cfg.tick_delta_sum %= tick; + dn_cfg.tick_adjustment++; + } else if (dn_cfg.tick_delta_sum + tick <= 0) { dn_cfg.curr_time--; - tick_diff--; - tick_delta_sum += tick; - tick_adjustment++; + dn_cfg.tick_diff--; + dn_cfg.tick_delta_sum += tick; + dn_cfg.tick_adjustment++; } /* serve pending events, accumulate in q */ diff --git a/sys/netpfil/ipfw/ip_dn_private.h b/sys/netpfil/ipfw/ip_dn_private.h index 38c6ff1201d5..6e48bc5116a7 100644 --- a/sys/netpfil/ipfw/ip_dn_private.h +++ b/sys/netpfil/ipfw/ip_dn_private.h @@ -125,6 +125,14 @@ struct dn_parms { struct timeval prev_t; /* last time dummynet_tick ran */ struct dn_heap evheap; /* scheduled events */ + long tick_last; /* Last tick duration (usec). */ + long tick_delta; /* Last vs standard tick diff (usec). */ + long tick_delta_sum; /* Accumulated tick difference (usec).*/ + long tick_adjustment; /* Tick adjustments done. */ + long tick_lost; /* Lost(coalesced) ticks number. */ + /* Adjusted vs non-adjusted curr_time difference (ticks). */ + long tick_diff; + /* counters of objects -- used for reporting space */ int schk_count; int si_count; From owner-dev-commits-src-main@freebsd.org Tue Mar 23 18:38:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB1F85B7CFA; Tue, 23 Mar 2021 18:38: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 4F4g9v4xcPz3mHj; Tue, 23 Mar 2021 18:38: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 9CC7A25EC6; Tue, 23 Mar 2021 18:38: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 12NIchcc026766; Tue, 23 Mar 2021 18:38:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NIchWW026765; Tue, 23 Mar 2021 18:38:43 GMT (envelope-from git) Date: Tue, 23 Mar 2021 18:38:43 GMT Message-Id: <202103231838.12NIchWW026765@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: ed42b22abc48 - main - makefs: Ignore the "tags" keyword in mtree manifests 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: ed42b22abc48ba53aaa38e1e64438b6d71e7e944 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 18:38:43 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ed42b22abc48ba53aaa38e1e64438b6d71e7e944 commit ed42b22abc48ba53aaa38e1e64438b6d71e7e944 Author: Mark Johnston AuthorDate: 2021-03-23 18:38:28 +0000 Commit: Mark Johnston CommitDate: 2021-03-23 18:38:40 +0000 makefs: Ignore the "tags" keyword in mtree manifests An install using -DNO_ROOT emits mtree entries containing tags used by pkgbase. makefs(8) can safely ignore them, so do that rather than emitting a warning for each entry. Reviewed by: brooks, imp MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29384 --- usr.sbin/makefs/mtree.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c index 266315466900..4272299ce135 100644 --- a/usr.sbin/makefs/mtree.c +++ b/usr.sbin/makefs/mtree.c @@ -629,7 +629,13 @@ read_mtree_keywords(FILE *fp, fsnode *node) error = ENOSYS; break; case 't': - if (strcmp(keyword, "time") == 0) { + if (strcmp(keyword, "tags") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + /* Ignore. */ + } else if (strcmp(keyword, "time") == 0) { if (value == NULL) { error = ENOATTR; break; From owner-dev-commits-src-main@freebsd.org Tue Mar 23 21:06:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48C785BC1CF; Tue, 23 Mar 2021 21:06: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 4F4kS21dbPz4S6b; Tue, 23 Mar 2021 21:06: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 2AC0E27BD7; Tue, 23 Mar 2021 21:06: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 12NL6AXa036439; Tue, 23 Mar 2021 21:06:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NL6AuC036438; Tue, 23 Mar 2021 21:06:10 GMT (envelope-from git) Date: Tue, 23 Mar 2021 21:06:10 GMT Message-Id: <202103232106.12NL6AuC036438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 82ee386c2afb - main - nfsv4 client: fix forced dismount when sleeping in the renew thread MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82ee386c2afb42388804c1189751b83048953433 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 21:06:10 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=82ee386c2afb42388804c1189751b83048953433 commit 82ee386c2afb42388804c1189751b83048953433 Author: Rick Macklem AuthorDate: 2021-03-23 20:04:37 +0000 Commit: Rick Macklem CommitDate: 2021-03-23 20:04:37 +0000 nfsv4 client: fix forced dismount when sleeping in the renew thread During a recent NFSv4 testing event a test server caused a hang where "umount -N" failed. The renew thread was sleeping on "nfsv4lck" and the "umount" was sleeping, waiting for the renew thread to terminate. This is the second of two patches that is hoped to fix the renew thread so that it will terminate when "umount -N" is done on the mount. This patch adds a 5second timeout on the msleep()s and checks for the forced dismount flag so that the renew thread will wake up and see the forced dismount flag. Normally a wakeup() will occur in less than 5seconds, but if a premature return from msleep() does occur, it will simply loop around and msleep() again. The patch also adds the "mp" argument to nfsv4_lock() so that it will return when the forced dismount flag is set. While here, replace the nfsmsleep() wrapper that was used for portability with the actual msleep() call. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clstate.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 227d82a5f7f3..4e3abf82c96a 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -2550,10 +2550,12 @@ nfscl_renewthread(struct nfsclclient *clp, NFSPROC_T *p) struct nfsclrecalllayout *recallp; struct nfsclds *dsp; bool retok; + struct mount *mp; cred = newnfs_getcred(); NFSLOCKCLSTATE(); clp->nfsc_flags |= NFSCLFLAGS_HASTHREAD; + mp = clp->nfsc_nmp->nm_mountp; NFSUNLOCKCLSTATE(); for(;;) { newnfs_setroot(cred); @@ -2652,14 +2654,18 @@ tryagain: } dp->nfsdl_rwlock.nfslock_lock |= NFSV4LOCK_WANTED; - (void) nfsmsleep(&dp->nfsdl_rwlock, - NFSCLSTATEMUTEXPTR, PZERO, "nfscld", - NULL); + msleep(&dp->nfsdl_rwlock, + NFSCLSTATEMUTEXPTR, PVFS, "nfscld", + 5 * hz); + if (NFSCL_FORCEDISM(mp)) + goto terminate; goto tryagain; } while (!igotlock) { igotlock = nfsv4_lock(&clp->nfsc_lock, 1, - &islept, NFSCLSTATEMUTEXPTR, NULL); + &islept, NFSCLSTATEMUTEXPTR, mp); + if (igotlock == 0 && NFSCL_FORCEDISM(mp)) + goto terminate; if (islept) goto tryagain; } @@ -2739,9 +2745,11 @@ tryagain2: NFSV4LOCK_LOCK) != 0) { lyp->nfsly_lock.nfslock_lock |= NFSV4LOCK_WANTED; - nfsmsleep(&lyp->nfsly_lock.nfslock_lock, - NFSCLSTATEMUTEXPTR, PZERO, "nfslyp", - NULL); + msleep(&lyp->nfsly_lock.nfslock_lock, + NFSCLSTATEMUTEXPTR, PVFS, "nfslyp", + 5 * hz); + if (NFSCL_FORCEDISM(mp)) + goto terminate; goto tryagain2; } /* Move the layout to the recall list. */ @@ -2850,6 +2858,7 @@ tryagain2: if ((clp->nfsc_flags & NFSCLFLAGS_RECOVER) == 0) (void)mtx_sleep(clp, NFSCLSTATEMUTEXPTR, PWAIT, "nfscl", hz); +terminate: if (clp->nfsc_flags & NFSCLFLAGS_UMOUNT) { clp->nfsc_flags &= ~NFSCLFLAGS_HASTHREAD; NFSUNLOCKCLSTATE(); From owner-dev-commits-src-main@freebsd.org Tue Mar 23 22:12:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 963485BE359; Tue, 23 Mar 2021 22:12: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 4F4lwY3ty6z4Yx4; Tue, 23 Mar 2021 22:12: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 790339F1; Tue, 23 Mar 2021 22:12: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 12NMCTgn034284; Tue, 23 Mar 2021 22:12:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NMCTkv034283; Tue, 23 Mar 2021 22:12:29 GMT (envelope-from git) Date: Tue, 23 Mar 2021 22:12:29 GMT Message-Id: <202103232212.12NMCTkv034283@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: a0308e48ec12 - main - Fix panic when destroying interface with ECMP routes. 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: a0308e48ec12ae37f525aa3c6d3c1a236fb55dcd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 22:12:29 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a0308e48ec12ae37f525aa3c6d3c1a236fb55dcd commit a0308e48ec12ae37f525aa3c6d3c1a236fb55dcd Author: Alexander V. Chernikov AuthorDate: 2021-03-23 22:00:04 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-03-23 22:03:20 +0000 Fix panic when destroying interface with ECMP routes. Reported by: Zhenlei Huang PR: 254496 MFC after: immediately --- sys/net/route/route_ctl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index d9fd1aa18c92..d3a35018ae66 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -130,13 +130,22 @@ vnet_rtzone_destroy() static void destroy_rtentry(struct rtentry *rt) { + struct nhop_object *nh = rt->rt_nhop; /* * At this moment rnh, nh_control may be already freed. * nhop interface may have been migrated to a different vnet. * Use vnet stored in the nexthop to delete the entry. */ - CURVNET_SET(nhop_get_vnet(rt->rt_nhop)); +#ifdef ROUTE_MPATH + if (NH_IS_NHGRP(nh)) { + struct weightened_nhop *wn; + uint32_t num_nhops; + wn = nhgrp_get_nhops((struct nhgrp_object *)nh, &num_nhops); + nh = wn[0].nh; + } +#endif + CURVNET_SET(nhop_get_vnet(nh)); /* Unreference nexthop */ nhop_free_any(rt->rt_nhop); From owner-dev-commits-src-main@freebsd.org Tue Mar 23 23:36:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70DA55781DF; Tue, 23 Mar 2021 23:36: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 4F4nnc2TLTz4fHk; Tue, 23 Mar 2021 23:36: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 47FD41DA1; Tue, 23 Mar 2021 23:36: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 12NNaa00046429; Tue, 23 Mar 2021 23:36:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12NNaaU7046428; Tue, 23 Mar 2021 23:36:36 GMT (envelope-from git) Date: Tue, 23 Mar 2021 23:36:36 GMT Message-Id: <202103232336.12NNaaU7046428@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: c00e2f573b50 - main - Fix build for non-vnet non-multipath kernels broken by a0308e48ec12ae37f525aa3c6d3c1a236fb55dcd. 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: c00e2f573b50893e7428aee4b928c95ac27b7e5e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 23:36:36 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=c00e2f573b50893e7428aee4b928c95ac27b7e5e commit c00e2f573b50893e7428aee4b928c95ac27b7e5e Author: Alexander V. Chernikov AuthorDate: 2021-03-23 23:35:23 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-03-23 23:35:23 +0000 Fix build for non-vnet non-multipath kernels broken by a0308e48ec12ae37f525aa3c6d3c1a236fb55dcd. --- 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 d3a35018ae66..92c7db1d5e29 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -148,7 +148,7 @@ destroy_rtentry(struct rtentry *rt) CURVNET_SET(nhop_get_vnet(nh)); /* Unreference nexthop */ - nhop_free_any(rt->rt_nhop); + nhop_free_any(nh); uma_zfree(V_rtzone, rt); From owner-dev-commits-src-main@freebsd.org Wed Mar 24 00:47:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA21A57A90A; Wed, 24 Mar 2021 00:47: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 4F4qMT4S6lz4jyb; Wed, 24 Mar 2021 00:47: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 8B7EF2DA5; Wed, 24 Mar 2021 00:47:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12O0lXee044505; Wed, 24 Mar 2021 00:47:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12O0lXAU044504; Wed, 24 Mar 2021 00:47:33 GMT (envelope-from git) Date: Wed, 24 Mar 2021 00:47:33 GMT Message-Id: <202103240047.12O0lXAU044504@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: 50179c5ec7d0 - main - Makefile.inc1: unbreak bootstrap when kbdcontrol does not exist 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: 50179c5ec7d09d7b02497caf95dca5d33f93bcd9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 00:47:33 -0000 The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=50179c5ec7d09d7b02497caf95dca5d33f93bcd9 commit 50179c5ec7d09d7b02497caf95dca5d33f93bcd9 Author: Glen Barber AuthorDate: 2021-03-24 00:47:14 +0000 Commit: Glen Barber CommitDate: 2021-03-24 00:47:14 +0000 Makefile.inc1: unbreak bootstrap when kbdcontrol does not exist Reviewed by: arichardson MFC after: 12 hours MFC target: stable/13, releng/13.0 Differential Review: https://reviews.freebsd.org/D29200 Sponsored by: Rubicon Communications, LLC ("Netgate") --- Makefile.inc1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 005d9d25afb3..5ae1ec72c279 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2299,7 +2299,8 @@ _bootstrap_tools_links+=crunchgen # Note: kbdcontrol can not be bootstrapped on non-FreeBSD systems .if !defined(CROSSBUILD_HOST) .if (${BOOTSTRAPPING} < 1003501 || \ - (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103)) + (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) || \ + (!exists(/usr/sbin/kbdcontrol))) _kbdcontrol= usr.sbin/kbdcontrol .else _bootstrap_tools_links+=kbdcontrol From owner-dev-commits-src-main@freebsd.org Wed Mar 24 04:40:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B07115A8769; Wed, 24 Mar 2021 04: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 4F4wX04jS1z3FBb; Wed, 24 Mar 2021 04: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 911755B52; Wed, 24 Mar 2021 04: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 12O4eGm7074880; Wed, 24 Mar 2021 04: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 12O4eGoV074871; Wed, 24 Mar 2021 04:40:16 GMT (envelope-from git) Date: Wed, 24 Mar 2021 04:40:16 GMT Message-Id: <202103240440.12O4eGoV074871@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: 64c01719e476 - main - libevent1: fix layout of duplicated RB_ENTRY() definition 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: 64c01719e476923fe1b24e5a6c6012a677cd017f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 04:40:16 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=64c01719e476923fe1b24e5a6c6012a677cd017f commit 64c01719e476923fe1b24e5a6c6012a677cd017f Author: Kyle Evans AuthorDate: 2021-03-24 04:31:02 +0000 Commit: Kyle Evans CommitDate: 2021-03-24 04:39:43 +0000 libevent1: fix layout of duplicated RB_ENTRY() definition 3a509754ded1 removed the color field from our definition, but libevent1 has a copy of it off to the side to prevent event.h consumers from *needing* to pull in sys/queue.h and sys/tree.h. Update the event.h definition so that we don't accidentally end up with two different views of struct event. This appears to have no functional effect on anything in tree, but this came up in a local patch to port if_switch(4) and related components from OpenBSD. MFC after: 1 week --- contrib/pf/libevent/event.h | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/pf/libevent/event.h b/contrib/pf/libevent/event.h index 3f2032dd068e..0c19201611b5 100644 --- a/contrib/pf/libevent/event.h +++ b/contrib/pf/libevent/event.h @@ -73,7 +73,6 @@ struct { \ struct type *rbe_left; /* left element */ \ struct type *rbe_right; /* right element */ \ struct type *rbe_parent; /* parent element */ \ - int rbe_color; /* node color */ \ } #endif /* !RB_ENTRY */ From owner-dev-commits-src-main@freebsd.org Wed Mar 24 05:17:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0F875A980B; Wed, 24 Mar 2021 05:17: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 4F4xLP62qlz3GMJ; Wed, 24 Mar 2021 05:17: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 BDD4764ED; Wed, 24 Mar 2021 05:17: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 12O5H1JY026048; Wed, 24 Mar 2021 05:17:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12O5H1wD026047; Wed, 24 Mar 2021 05:17:01 GMT (envelope-from git) Date: Wed, 24 Mar 2021 05:17:01 GMT Message-Id: <202103240517.12O5H1wD026047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lawrence Stewart Subject: git: dbbf3e3f37d6 - main - random(9): Restore historical [0, 2^31-1] output range and related man documention. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lstewart X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbbf3e3f37d67d3eae0931855f8b62b9b299b80a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 05:17:01 -0000 The branch main has been updated by lstewart: URL: https://cgit.FreeBSD.org/src/commit/?id=dbbf3e3f37d67d3eae0931855f8b62b9b299b80a commit dbbf3e3f37d67d3eae0931855f8b62b9b299b80a Author: Lawrence Stewart AuthorDate: 2021-03-24 04:25:49 +0000 Commit: Lawrence Stewart CommitDate: 2021-03-24 05:14:58 +0000 random(9): Restore historical [0,2^31-1] output range and related man documention. Commit SVN r364219 / Git 8a0edc914ffd changed random(9) to be a shim around prng32(9) and inadvertently caused random(9) to begin returning numbers in the range [0,2^32-1] instead of [0,2^31-1], where the latter has been the documented range for decades. The increased output range has been identified as the source of numerous bugs in code written against the historical output range e.g. ipfw "prob" rules and stats(3) are known to be affected, and a non-exhaustive audit of the tree identified other random(9) consumers which are also likely affected. As random(9) is deprecated and slated for eventual removal in 14.0, consumers should gradually be audited and migrated to prng(9). Submitted by: Loic Prylli Obtained from: Netflix Reviewed by: cem, delphij, imp MFC after: 1 day MFC to: stable/13, releng/13.0 Differential Revision: https://reviews.freebsd.org/D29385 --- share/man/man9/random.9 | 25 ++++++++++++++----------- sys/libkern/random.c | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/share/man/man9/random.9 b/share/man/man9/random.9 index fb5f2156df16..1c5f962b1363 100644 --- a/share/man/man9/random.9 +++ b/share/man/man9/random.9 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" " -.Dd December 26, 2019 +.Dd March 22, 2021 .Dt RANDOM 9 .Os .Sh NAME @@ -132,17 +132,13 @@ If the function is interrupted before the random device is seeded, no data is returned. .Pp The deprecated -.Xr random 9 -function will produce a sequence of pseudorandom numbers using a similar weak -linear congruential generator as -.Xr rand 3 -(the 1988 Park-Miller LCG). +.Fn random +function will return a 31-bit value. It is obsolete and scheduled to be removed in -.Fx 13.0 . -It is strongly advised that the -.Xr random 9 -function not be used to generate random numbers. -See +.Fx 14.0 . +Consider +.Xr prng 9 +instead and see .Sx SECURITY CONSIDERATIONS . .Sh RETURN VALUES The @@ -167,6 +163,13 @@ the number of bytes placed in .Fn read_random_uio returns zero when successful, otherwise an error code is returned. +.Pp +.Fn random +returns numbers +in the range from 0 to +.if t 2\u\s731\s10\d\(mi1. +.if n (2**31)\(mi1. + .Sh ERRORS .Fn read_random_uio may fail if: diff --git a/sys/libkern/random.c b/sys/libkern/random.c index 23a8887fa49b..0bdfbc168409 100644 --- a/sys/libkern/random.c +++ b/sys/libkern/random.c @@ -45,5 +45,5 @@ __FBSDID("$FreeBSD$"); u_long random(void) { - return (prng32()); + return (prng32() & 0x7fffffff); } From owner-dev-commits-src-main@freebsd.org Wed Mar 24 07:52:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 692185AD592; Wed, 24 Mar 2021 07:52: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 4F50nj2Pz6z3Q0F; Wed, 24 Mar 2021 07:52: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 4598210C12; Wed, 24 Mar 2021 07:52: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 12O7qPD4048514; Wed, 24 Mar 2021 07:52:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12O7qPAv048513; Wed, 24 Mar 2021 07:52:25 GMT (envelope-from git) Date: Wed, 24 Mar 2021 07:52:25 GMT Message-Id: <202103240752.12O7qPAv048513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 9e5aeba51b43 - main - Fix warning about signed comparison and drop WARNS for ktrdump(8). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e5aeba51b431256adfd18b087ee61b09bfd6a79 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 07:52:25 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=9e5aeba51b431256adfd18b087ee61b09bfd6a79 commit 9e5aeba51b431256adfd18b087ee61b09bfd6a79 Author: Dmitry Chagin AuthorDate: 2021-03-24 07:51:25 +0000 Commit: Dmitry Chagin CommitDate: 2021-03-24 07:51:25 +0000 Fix warning about signed comparison and drop WARNS for ktrdump(8). Reviewed By: jhb, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29381 --- usr.bin/ktrdump/Makefile | 2 -- usr.bin/ktrdump/ktrdump.c | 14 +++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/usr.bin/ktrdump/Makefile b/usr.bin/ktrdump/Makefile index 63cd2cf2cea9..796569977f0f 100644 --- a/usr.bin/ktrdump/Makefile +++ b/usr.bin/ktrdump/Makefile @@ -4,6 +4,4 @@ PROG= ktrdump LIBADD= kvm MAN= ktrdump.8 -WARNS?= 2 - .include diff --git a/usr.bin/ktrdump/ktrdump.c b/usr.bin/ktrdump/ktrdump.c index 750f138f5485..bbe8fb19aae9 100644 --- a/usr.bin/ktrdump/ktrdump.c +++ b/usr.bin/ktrdump/ktrdump.c @@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$"); static void usage(void); static struct nlist nl[] = { - { "_ktr_version" }, - { "_ktr_entries" }, - { "_ktr_idx" }, - { "_ktr_buf" }, - { NULL } + { .n_name = "_ktr_version" }, + { .n_name = "_ktr_entries" }, + { .n_name = "_ktr_idx" }, + { .n_name = "_ktr_buf" }, + { .n_name = NULL } }; static int cflag; @@ -262,7 +262,7 @@ main(int ac, char **av) fprintf(out, "\n"); } - tlast = -1; + tlast = UINTPTR_MAX; /* * Now tear through the trace buffer. * @@ -327,7 +327,7 @@ next: if ((c = *p++) == '\0') if (tflag) { tnow = (uintmax_t)buf[i].ktr_timestamp; if (rflag) { - if (tlast == -1) + if (tlast == UINTPTR_MAX) tlast = tnow; fprintf(out, "%16ju ", !iflag ? tlast - tnow : tnow - tlast); From owner-dev-commits-src-main@freebsd.org Wed Mar 24 08:59:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CD195AFE58; Wed, 24 Mar 2021 08:59: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 4F52GX6GwDz3kvb; Wed, 24 Mar 2021 08:58: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 D33EE11739; Wed, 24 Mar 2021 08:58: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 12O8wvYB033552; Wed, 24 Mar 2021 08:58:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12O8wvuS033551; Wed, 24 Mar 2021 08:58:57 GMT (envelope-from git) Date: Wed, 24 Mar 2021 08:58:57 GMT Message-Id: <202103240858.12O8wvuS033551@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: 874b1a35486b - main - ipfilter: simplify ipf_proxy_check() return codes 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: 874b1a35486b570513680c3d456b062ba097e1d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 08:59:01 -0000 The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=874b1a35486b570513680c3d456b062ba097e1d9 commit 874b1a35486b570513680c3d456b062ba097e1d9 Author: Cy Schubert AuthorDate: 2021-03-23 03:11:58 +0000 Commit: Cy Schubert CommitDate: 2021-03-24 08:57:56 +0000 ipfilter: simplify ipf_proxy_check() return codes ipf_proxy_check() returns -1 for an error and 0 or 1 for success. ipf_proxy_check()'s callers check for error and if the return code is 0, they change it to 1 prior to returning to their callers. Simply by returning -1 or 1 we reduce complexity and cycles burned changing 0 to 1. MFC after: 1 week --- sys/contrib/ipfilter/netinet/ip_nat.c | 4 +--- sys/contrib/ipfilter/netinet/ip_nat6.c | 4 +--- sys/contrib/ipfilter/netinet/ip_proxy.c | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index 9ce6063eb7f3..41e51880b3dd 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -5318,9 +5318,7 @@ ipf_nat_out(fin, nat, natadd, nflags) /* ------------------------------------------------------------- */ if ((np != NULL) && (np->in_apr != NULL)) { i = ipf_proxy_check(fin, nat); - if (i == 0) { - i = 1; - } else if (i == -1) { + if (i == -1) { NBUMPSIDED(1, ns_ipf_proxy_fail); } } else { diff --git a/sys/contrib/ipfilter/netinet/ip_nat6.c b/sys/contrib/ipfilter/netinet/ip_nat6.c index 921eefc0ea3f..baa3c302504a 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat6.c +++ b/sys/contrib/ipfilter/netinet/ip_nat6.c @@ -2976,9 +2976,7 @@ ipf_nat6_out(fin, nat, natadd, nflags) /* ------------------------------------------------------------- */ if ((np != NULL) && (np->in_apr != NULL)) { i = ipf_proxy_check(fin, nat); - if (i == 0) { - i = 1; - } else if (i == -1) { + if (i == -1) { NBUMPSIDE6D(1, ns_ipf_proxy_fail); } } else { diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index b4773bb6f358..87051b6e6839 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -1048,9 +1048,8 @@ ipf_proxy_check(fin, nat) } aps->aps_bytes += fin->fin_plen; aps->aps_pkts++; - return 1; } - return 0; + return 1; } From owner-dev-commits-src-main@freebsd.org Wed Mar 24 13:57:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99AF45B684A; Wed, 24 Mar 2021 13:57: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 4F58v740YNz4WWX; Wed, 24 Mar 2021 13:57: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 7BEB115542; Wed, 24 Mar 2021 13:57: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 12ODvdKD053145; Wed, 24 Mar 2021 13:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ODvdIJ053144; Wed, 24 Mar 2021 13:57:39 GMT (envelope-from git) Date: Wed, 24 Mar 2021 13:57:39 GMT Message-Id: <202103241357.12ODvdIJ053144@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: 7ae2e703366e - main - amd64: Make KPDPphys local to pmap.c 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: 7ae2e703366e5ac56373509ececae53ecaa5bc59 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 13:57:39 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7ae2e703366e5ac56373509ececae53ecaa5bc59 commit 7ae2e703366e5ac56373509ececae53ecaa5bc59 Author: Mark Johnston AuthorDate: 2021-03-24 13:55:22 +0000 Commit: Mark Johnston CommitDate: 2021-03-24 13:57:31 +0000 amd64: Make KPDPphys local to pmap.c MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/amd64/amd64/pmap.c | 2 +- sys/amd64/include/pmap.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 57d7a42800a1..fc5f24d2c303 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -420,7 +420,7 @@ static int pat_index[PAT_INDEX_SIZE]; /* cache mode to PAT index conversion */ static u_int64_t KPTphys; /* phys addr of kernel level 1 */ static u_int64_t KPDphys; /* phys addr of kernel level 2 */ -u_int64_t KPDPphys; /* phys addr of kernel level 3 */ +static u_int64_t KPDPphys; /* phys addr of kernel level 3 */ u_int64_t KPML4phys; /* phys addr of kernel level 4 */ u_int64_t KPML5phys; /* phys addr of kernel level 5, if supported */ diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index ef69ba9b6f9f..8ba654cb2e7c 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -303,7 +303,6 @@ typedef u_int64_t pml5_entry_t; #define P5Dmap ((pd_entry_t *)(addr_P5Dmap)) extern int nkpt; /* Initial number of kernel page tables */ -extern u_int64_t KPDPphys; /* physical address of kernel level 3 */ extern u_int64_t KPML4phys; /* physical address of kernel level 4 */ extern u_int64_t KPML5phys; /* physical address of kernel level 5 */ From owner-dev-commits-src-main@freebsd.org Wed Mar 24 15:58:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CF765B9634; Wed, 24 Mar 2021 15:58: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 4F5Cb70sTsz4fgL; Wed, 24 Mar 2021 15:58: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 1107D16ECA; Wed, 24 Mar 2021 15:58: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 12OFwwAu020883; Wed, 24 Mar 2021 15:58:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OFwwbH020882; Wed, 24 Mar 2021 15:58:58 GMT (envelope-from git) Date: Wed, 24 Mar 2021 15:58:58 GMT Message-Id: <202103241558.12OFwwbH020882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 88588c4b7611 - main - Get rid of i386 ref here as linux64 is a 64-bit module. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88588c4b7611a39cdf965c3c07d8fcc13ed553b4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 15:58:59 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=88588c4b7611a39cdf965c3c07d8fcc13ed553b4 commit 88588c4b7611a39cdf965c3c07d8fcc13ed553b4 Author: Dmitry Chagin AuthorDate: 2021-03-24 15:56:46 +0000 Commit: Dmitry Chagin CommitDate: 2021-03-24 15:56:46 +0000 Get rid of i386 ref here as linux64 is a 64-bit module. Reviewed By: emaste, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29412 --- sys/modules/linux64/Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index ebc69168bd4a..c081151e3fc5 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/${MACHINE}/linux -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" .PATH: ${SRCTOP}/sys/x86/linux .endif @@ -16,16 +16,13 @@ SRCS= linux_fork.c linux_dummy_machdep.c linux_file.c linux_event.c \ opt_compat.h opt_inet6.h opt_posix.h opt_usb.h \ vnode_if.h device_if.h bus_if.h \ linux_support.s -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" SRCS+= linux_dummy_x86.c .endif DPSRCS= assym.inc linux_genassym.c # XXX: for assym.inc SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h -.if ${MACHINE_CPUARCH} == "i386" -SRCS+= opt_apic.h -.endif CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o \ genassym.o From owner-dev-commits-src-main@freebsd.org Wed Mar 24 16:38:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB0025BA642; Wed, 24 Mar 2021 16:38: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 4F5DSy5tNGz4jHY; Wed, 24 Mar 2021 16:38: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 BCC441789E; Wed, 24 Mar 2021 16:38: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 12OGcgjZ078118; Wed, 24 Mar 2021 16:38:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OGcgfC078117; Wed, 24 Mar 2021 16:38:42 GMT (envelope-from git) Date: Wed, 24 Mar 2021 16:38:42 GMT Message-Id: <202103241638.12OGcgfC078117@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: 9f40a3be3d5d - main - bhyve hostbridge: Rename "device" property to "devid". 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: 9f40a3be3d5dbddf782c3d1eeaadcd022a4dad01 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 16:38:42 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9f40a3be3d5dbddf782c3d1eeaadcd022a4dad01 commit 9f40a3be3d5dbddf782c3d1eeaadcd022a4dad01 Author: John Baldwin AuthorDate: 2021-03-24 16:29:15 +0000 Commit: John Baldwin CommitDate: 2021-03-24 16:29:15 +0000 bhyve hostbridge: Rename "device" property to "devid". "device" is already used as the generic PCI-level name of the device model to use (e.g. "hostbridge"). The result was that parsing "hostbridge" as an integer failed and the host bridge used a device ID of 0. The EFI ROM asserts that the device ID of the hostbridge is not 0, so booting with the current EFI ROM was failing during the ROM boot. Fixes: 621b5090487de9fed1b503769702a9a2a27cc7bb --- usr.sbin/bhyve/bhyve_config.5 | 4 ++-- usr.sbin/bhyve/pci_hostbridge.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index 4e200a779d50..d65040513cb0 100644 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 18, 2021 +.Dd March 24, 2021 .Dt BHYVE_CONFIG 5 .Os .Sh NAME @@ -335,7 +335,7 @@ process. .It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description .It Va vendor Ta integer Ta 0x1275 Ta PCI vendor ID. -.It Va device Ta integer Ta 0x1275 Ta +.It Va devid Ta integer Ta 0x1275 Ta PCI device ID. .El .Ss AHCI Controller Settings diff --git a/usr.sbin/bhyve/pci_hostbridge.c b/usr.sbin/bhyve/pci_hostbridge.c index 7099474eaf92..9fce225bb1d6 100644 --- a/usr.sbin/bhyve/pci_hostbridge.c +++ b/usr.sbin/bhyve/pci_hostbridge.c @@ -48,7 +48,7 @@ pci_hostbridge_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) value = get_config_value_node(nvl, "vendor"); if (value != NULL) vendor = strtol(value, NULL, 0); - value = get_config_value_node(nvl, "device"); + value = get_config_value_node(nvl, "devid"); if (value != NULL) device = strtol(value, NULL, 0); @@ -69,7 +69,7 @@ pci_amd_hostbridge_legacy_config(nvlist_t *nvl, const char *opts) { set_config_value_node(nvl, "vendor", "0x1022"); /* AMD */ - set_config_value_node(nvl, "device", "0x7432"); /* made up */ + set_config_value_node(nvl, "devid", "0x7432"); /* made up */ return (0); } From owner-dev-commits-src-main@freebsd.org Wed Mar 24 20:36:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46AD65BF20B; Wed, 24 Mar 2021 20:36: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 4F5Kky1Y8Zz3CdH; Wed, 24 Mar 2021 20:36: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 233491A751; Wed, 24 Mar 2021 20:36: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 12OKaAaW012804; Wed, 24 Mar 2021 20:36:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OKa9Ea012803; Wed, 24 Mar 2021 20:36:09 GMT (envelope-from git) Date: Wed, 24 Mar 2021 20:36:09 GMT Message-Id: <202103242036.12OKa9Ea012803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: efad9c8ba3ce - main - align nfsdumpstate column output MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: efad9c8ba3cec7f6e39b128b90afab70701fd8d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 20:36:10 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=efad9c8ba3cec7f6e39b128b90afab70701fd8d9 commit efad9c8ba3cec7f6e39b128b90afab70701fd8d9 Author: Caleb St. John AuthorDate: 2021-03-24 20:33:41 +0000 Commit: Ryan Moeller CommitDate: 2021-03-24 20:33:41 +0000 align nfsdumpstate column output There are scenarios where an NFS client will mount an NFSv4 export without specifying a callback address. When running nfsdumpstate under this circumstance, the column output is shifted incorrectly which places the "ClientID" value underneath the "Clientaddr" column. This diff is a small cosmetic change that prints a blank in the "Clientaddr" column and ensures the data for the columns are aligned appropriately. Submitted by: Caleb St. John Reviewed by: sef (previous version) MFC after: 3 days Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D18958 --- usr.sbin/nfsdumpstate/nfsdumpstate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/nfsdumpstate/nfsdumpstate.c b/usr.sbin/nfsdumpstate/nfsdumpstate.c index 4334a3ddf506..c7e086655f79 100644 --- a/usr.sbin/nfsdumpstate/nfsdumpstate.c +++ b/usr.sbin/nfsdumpstate/nfsdumpstate.c @@ -162,6 +162,9 @@ dump_openstate(void) printf("%-45s ", " "); break; #endif + default: + printf("%-45s ", " "); + break; } for (i = 0; i < dp[cnt].ndcl_clid.nclid_idlen; i++) printf("%02x", dp[cnt].ndcl_clid.nclid_id[i]); From owner-dev-commits-src-main@freebsd.org Wed Mar 24 22:27:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DF3357956E; Wed, 24 Mar 2021 22:27: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 4F5NCG0rRRz3Kp2; Wed, 24 Mar 2021 22:27: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 0B6551C119; Wed, 24 Mar 2021 22:27: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 12OMRLeT066630; Wed, 24 Mar 2021 22:27:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OMRL1X066629; Wed, 24 Mar 2021 22:27:21 GMT (envelope-from git) Date: Wed, 24 Mar 2021 22:27:21 GMT Message-Id: <202103242227.12OMRL1X066629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: af7d9f8e31c4 - main - net80211: prefix get_random_bytes() with net80211_ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af7d9f8e31c4c185f277b27059e470ec8a5627a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 22:27:22 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=af7d9f8e31c4c185f277b27059e470ec8a5627a7 commit af7d9f8e31c4c185f277b27059e470ec8a5627a7 Author: Bjoern A. Zeeb AuthorDate: 2021-03-18 22:15:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-24 22:16:09 +0000 net80211: prefix get_random_bytes() with net80211_ Both linux/random.h and net80211 have a function named get_random_bytes(). With overlapping files included these collide. Arguably the function could be renamed in linuxkpi but the generic name should also not be used in net80211 so rename it there. Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: philip, adrian Differential Revision: https://reviews.freebsd.org/D29335 --- sys/net80211/ieee80211_crypto_wep.c | 2 +- sys/net80211/ieee80211_dfs.c | 2 +- sys/net80211/ieee80211_freebsd.c | 2 +- sys/net80211/ieee80211_freebsd.h | 2 +- sys/net80211/ieee80211_hostap.c | 2 +- sys/net80211/ieee80211_mesh.c | 2 +- sys/net80211/ieee80211_node.c | 3 ++- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/net80211/ieee80211_crypto_wep.c b/sys/net80211/ieee80211_crypto_wep.c index bdaab1b29e14..797de006cdf2 100644 --- a/sys/net80211/ieee80211_crypto_wep.c +++ b/sys/net80211/ieee80211_crypto_wep.c @@ -100,7 +100,7 @@ wep_attach(struct ieee80211vap *vap, struct ieee80211_key *k) ctx->wc_vap = vap; ctx->wc_ic = vap->iv_ic; - get_random_bytes(&ctx->wc_iv, sizeof(ctx->wc_iv)); + net80211_get_random_bytes(&ctx->wc_iv, sizeof(ctx->wc_iv)); nrefs++; /* NB: we assume caller locking */ return ctx; } diff --git a/sys/net80211/ieee80211_dfs.c b/sys/net80211/ieee80211_dfs.c index abe67576d711..b3959220bfc9 100644 --- a/sys/net80211/ieee80211_dfs.c +++ b/sys/net80211/ieee80211_dfs.c @@ -421,7 +421,7 @@ ieee80211_dfs_pickchannel(struct ieee80211com *ic) * one at random (skipping channels where radar has * been detected). */ - get_random_bytes(&v, sizeof(v)); + net80211_get_random_bytes(&v, sizeof(v)); v %= ic->ic_nchans; for (i = v; i < ic->ic_nchans; i++) { c = &ic->ic_channels[i]; diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c index 850c93d1e5df..011ae7060a6c 100644 --- a/sys/net80211/ieee80211_freebsd.c +++ b/sys/net80211/ieee80211_freebsd.c @@ -749,7 +749,7 @@ ieee80211_vap_xmitpkt(struct ieee80211vap *vap, struct mbuf *m) #include void -get_random_bytes(void *p, size_t n) +net80211_get_random_bytes(void *p, size_t n) { uint8_t *dp = p; diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h index c3811cc32e84..9d7b9cbb7cce 100644 --- a/sys/net80211/ieee80211_freebsd.h +++ b/sys/net80211/ieee80211_freebsd.h @@ -359,7 +359,7 @@ struct ieee80211com; int ieee80211_parent_xmitpkt(struct ieee80211com *, struct mbuf *); int ieee80211_vap_xmitpkt(struct ieee80211vap *, struct mbuf *); -void get_random_bytes(void *, size_t); +void net80211_get_random_bytes(void *, size_t); void ieee80211_sysctl_attach(struct ieee80211com *); void ieee80211_sysctl_detach(struct ieee80211com *); diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 8402ade857ff..16a3d97ae7f2 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -1093,7 +1093,7 @@ hostap_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh, /* NB: don't return error so they rexmit */ return; } - get_random_bytes(ni->ni_challenge, + net80211_get_random_bytes(ni->ni_challenge, IEEE80211_CHALLENGE_LEN); IEEE80211_NOTE(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, ni, "shared key %sauth request", allocbs ? "" : "re"); diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index fdb84a2acb3d..48a3590d0cf3 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -962,7 +962,7 @@ mesh_generateid(struct ieee80211vap *vap) uint16_t r; do { - get_random_bytes(&r, 2); + net80211_get_random_bytes(&r, 2); ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, mesh_checkid, &r); maxiter--; } while (r == 0 && maxiter > 0); diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 64a0164aeb81..5a9677836dbd 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -363,7 +363,8 @@ ieee80211_create_ibss(struct ieee80211vap* vap, struct ieee80211_channel *chan) if (vap->iv_flags & IEEE80211_F_DESBSSID) IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_des_bssid); else { - get_random_bytes(ni->ni_bssid, IEEE80211_ADDR_LEN); + net80211_get_random_bytes(ni->ni_bssid, + IEEE80211_ADDR_LEN); /* clear group bit, add local bit */ ni->ni_bssid[0] = (ni->ni_bssid[0] &~ 0x01) | 0x02; } From owner-dev-commits-src-main@freebsd.org Wed Mar 24 22:30:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A0EF57965E; Wed, 24 Mar 2021 22:30: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 4F5NH1426Tz3KyK; Wed, 24 Mar 2021 22:30: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 792E01C281; Wed, 24 Mar 2021 22:30: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 12OMUbA8075374; Wed, 24 Mar 2021 22:30:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OMUbOC075373; Wed, 24 Mar 2021 22:30:37 GMT (envelope-from git) Date: Wed, 24 Mar 2021 22:30:37 GMT Message-Id: <202103242230.12OMUbOC075373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: de8a7cc703f1 - main - linuxkpi: add ieee80211_node.h to headers to include before LIST_HEAD MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de8a7cc703f1d3eab293d53fbc8269e1aca3a6ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 22:30:37 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=de8a7cc703f1d3eab293d53fbc8269e1aca3a6ab commit de8a7cc703f1d3eab293d53fbc8269e1aca3a6ab Author: Bjoern A. Zeeb AuthorDate: 2021-03-18 22:23:15 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-24 22:19:34 +0000 linuxkpi: add ieee80211_node.h to headers to include before LIST_HEAD ieee80211_node.h uses LIST_HEAD() which LinuxKPI redefines and this can lead to problems (see comment there). Make sure the net80211 header file is handled correctly by adding it to the list of files to include before re-defining the macro. Also add header files needed as dependencies. Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: philip, hselasky Differential Revision: https://reviews.freebsd.org/D29336 --- sys/compat/linuxkpi/common/include/linux/list.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/list.h b/sys/compat/linuxkpi/common/include/linux/list.h index 1f3db8e43a08..37b5b751d21b 100644 --- a/sys/compat/linuxkpi/common/include/linux/list.h +++ b/sys/compat/linuxkpi/common/include/linux/list.h @@ -53,6 +53,7 @@ #include #include +#include #include #include #include @@ -67,6 +68,10 @@ #include #include +#include +#include +#include + #include #include #include From owner-dev-commits-src-main@freebsd.org Wed Mar 24 22:34:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FD8B579C95; Wed, 24 Mar 2021 22:34: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 4F5NM80S2Rz3LCS; Wed, 24 Mar 2021 22:34: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 01DF31C421; Wed, 24 Mar 2021 22:34: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 12OMYBWR080638; Wed, 24 Mar 2021 22:34:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OMYBlv080637; Wed, 24 Mar 2021 22:34:11 GMT (envelope-from git) Date: Wed, 24 Mar 2021 22:34:11 GMT Message-Id: <202103242234.12OMYBlv080637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a29bbfe6c6e4 - main - ofed/linuxkpi: use proper accessor function MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a29bbfe6c6e41691bdd3bd0e5be89089523485d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 22:34:12 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a29bbfe6c6e41691bdd3bd0e5be89089523485d6 commit a29bbfe6c6e41691bdd3bd0e5be89089523485d6 Author: Bjoern A. Zeeb AuthorDate: 2021-03-21 21:07:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-24 22:23:34 +0000 ofed/linuxkpi: use proper accessor function In the notifier event callback function rather than casting directly to the expected type use the proper accessor function as the mlx drivers already do. This is preparational work to allow us to improve the struct net_device is struct ifnet compat code shortcut in the future. Obtained-from: bz_iwlwifi Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: hselasky Differential Revision: https://reviews.freebsd.org/D29364 --- sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c b/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c index 8f6156333f4a..02acf29159e3 100644 --- a/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c +++ b/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c @@ -380,7 +380,7 @@ roce_gid_delete_all_event(struct net_device *ndev) static int inetaddr_event(struct notifier_block *this, unsigned long event, void *ptr) { - struct net_device *ndev = ptr; + struct net_device *ndev = netdev_notifier_info_to_dev(ptr); switch (event) { case NETDEV_UNREGISTER: From owner-dev-commits-src-main@freebsd.org Wed Mar 24 22:37:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44455579EB7; Wed, 24 Mar 2021 22:37: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 4F5NQj1R6lz3Lb9; Wed, 24 Mar 2021 22:37: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 1FE2B1C393; Wed, 24 Mar 2021 22:37: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 12OMbGGq081210; Wed, 24 Mar 2021 22:37:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OMbGch081209; Wed, 24 Mar 2021 22:37:16 GMT (envelope-from git) Date: Wed, 24 Mar 2021 22:37:16 GMT Message-Id: <202103242237.12OMbGch081209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5ba4c8de1521 - main - ifconfig: 80211, add line break after key info MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ba4c8de15210bbc026c41b77b23d5af06613fe6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 22:37:17 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5ba4c8de15210bbc026c41b77b23d5af06613fe6 commit 5ba4c8de15210bbc026c41b77b23d5af06613fe6 Author: Bjoern A. Zeeb AuthorDate: 2021-03-23 15:08:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-24 22:26:39 +0000 ifconfig: 80211, add line break after key info Beauty correction for verbose mode or in case we print multiple key information to not continue with the next options directly after as we did so far, e.g.: AES-CCM 2:128-bit AES-CCM 3:128-bit powersavemode ... Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: adrian Differential Revision: https://reviews.freebsd.org/D29393 --- sbin/ifconfig/ifieee80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index cfaf163f5930..ee611a14b45e 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -5060,6 +5060,8 @@ ieee80211_status(int s) printkey(&ik); } } + if (i > 0 && verbose) + LINE_BREAK(); end: ; } From owner-dev-commits-src-main@freebsd.org Wed Mar 24 22:40:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9980357987F; Wed, 24 Mar 2021 22:40: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 4F5NVL3w6wz3LZ9; Wed, 24 Mar 2021 22:40: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 7544E1C21B; Wed, 24 Mar 2021 22:40: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 12OMeQJK089958; Wed, 24 Mar 2021 22:40:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OMeQGC089957; Wed, 24 Mar 2021 22:40:26 GMT (envelope-from git) Date: Wed, 24 Mar 2021 22:40:26 GMT Message-Id: <202103242240.12OMeQGC089957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 852a88a1d925 - main - rtld: style nits MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 852a88a1d92500028f1364a4afc58955190db7a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 22:40:26 -0000 The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=852a88a1d92500028f1364a4afc58955190db7a5 commit 852a88a1d92500028f1364a4afc58955190db7a5 Author: Mariusz Zaborski AuthorDate: 2021-03-24 21:05:39 +0000 Commit: Mariusz Zaborski CommitDate: 2021-03-24 22:40:48 +0000 rtld: style nits No functional change intended. Requested by: kib --- libexec/rtld-elf/rtld.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index b186bebbfefc..3ecf50b8cf5d 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -2470,30 +2470,31 @@ load_needed_objects(Obj_Entry *first, int flags) static int load_preload_objects(void) { - char *p = ld_preload; - Obj_Entry *obj; - static const char delim[] = " \t:;"; - - if (p == NULL) - return 0; + char *p = ld_preload; + Obj_Entry *obj; + static const char delim[] = " \t:;"; - p += strspn(p, delim); - while (*p != '\0') { - size_t len = strcspn(p, delim); - char savech; + if (p == NULL) + return (0); - savech = p[len]; - p[len] = '\0'; - obj = load_object(p, -1, NULL, 0); - if (obj == NULL) - return -1; /* XXX - cleanup */ - obj->z_interpose = true; - p[len] = savech; - p += len; p += strspn(p, delim); - } - LD_UTRACE(UTRACE_PRELOAD_FINISHED, NULL, NULL, 0, 0, NULL); - return 0; + while (*p != '\0') { + size_t len = strcspn(p, delim); + char savech; + + savech = p[len]; + p[len] = '\0'; + obj = load_object(p, -1, NULL, 0); + if (obj == NULL) + return (-1); /* XXX - cleanup */ + obj->z_interpose = true; + p[len] = savech; + p += len; + p += strspn(p, delim); + } + LD_UTRACE(UTRACE_PRELOAD_FINISHED, NULL, NULL, 0, 0, NULL); + + return (0); } static const char * From owner-dev-commits-src-main@freebsd.org Wed Mar 24 22:40:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93BCC579CE4; Wed, 24 Mar 2021 22:40: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 4F5NVM3nSvz3Ln1; Wed, 24 Mar 2021 22:40: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 74E541BF4A; Wed, 24 Mar 2021 22:40: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 12OMeRUU089981; Wed, 24 Mar 2021 22:40:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OMeRHq089980; Wed, 24 Mar 2021 22:40:27 GMT (envelope-from git) Date: Wed, 24 Mar 2021 22:40:27 GMT Message-Id: <202103242240.12OMeRHq089980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: f90218886fc8 - main - rtld: introduce PRELOAD_FDS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f90218886fc82e7b1fdb9e241adc5d713dadabe3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 22:40:27 -0000 The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=f90218886fc82e7b1fdb9e241adc5d713dadabe3 commit f90218886fc82e7b1fdb9e241adc5d713dadabe3 Author: Mariusz Zaborski AuthorDate: 2021-03-24 21:10:33 +0000 Commit: Mariusz Zaborski CommitDate: 2021-03-24 22:40:48 +0000 rtld: introduce PRELOAD_FDS The new PRELOAD_FDS variable accepts a list of file descriptors that should be loaded into the process. This may be used to optimize a loading process - in the case when we already have a file descriptor to the library; we don't have to look into multiple PATH to find it. It may also be used in capability mode to load a single additional library without the need to open a directory that contains it. The last use of this functionality t may be a race-free method of loading libraries. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D29334 --- libexec/rtld-elf/rtld.1 | 10 ++- libexec/rtld-elf/rtld.c | 33 +++++++-- libexec/rtld-elf/tests/Makefile | 7 ++ libexec/rtld-elf/tests/common.c | 81 +++++++++++++++++++++ libexec/rtld-elf/tests/common.h | 43 +++++++++++ libexec/rtld-elf/tests/ld_library_pathfds.c | 56 +-------------- libexec/rtld-elf/tests/ld_preload_fds.c | 108 ++++++++++++++++++++++++++++ 7 files changed, 277 insertions(+), 61 deletions(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 10dd7986903a..040ab496ceb3 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2020 +.Dd March 24, 2021 .Dt RTLD 1 .Os .Sh NAME @@ -189,6 +189,14 @@ to be linked in before any other shared libraries. If the directory is not specified then the directories specified by +.It Ev LD_PRELOAD_PATH_FDS +A colon separated list of file descriptor numbers for libraries. +This is intended for preloading libraries in which we already have a file +descriptor. +This may optimize the process of loading libraries because we do not have to +look for them in directories. +It may also be useful in a capability base system where we do not have access to +global namespaces such as the filesystem. .Ev LD_LIBRARY_PATH will be searched first followed by the set of built-in standard directories. diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 3ecf50b8cf5d..733c3c80b70f 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -119,7 +119,7 @@ static void linkmap_delete(Obj_Entry *); static void load_filtees(Obj_Entry *, int flags, RtldLockState *); static void unload_filtees(Obj_Entry *, RtldLockState *); static int load_needed_objects(Obj_Entry *, int); -static int load_preload_objects(void); +static int load_preload_objects(char *, bool); static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); static int obj_disable_relro(Obj_Entry *); @@ -210,6 +210,8 @@ static char *ld_library_path; /* Environment variable for search path */ static char *ld_library_dirs; /* Environment variable for library descriptors */ static char *ld_preload; /* Environment variable for libraries to load first */ +static char *ld_preload_fds; /* Environment variable for libraries represented by + descriptors */ static const char *ld_elf_hints_path; /* Environment variable for alternative hints path */ static const char *ld_tracing; /* Called from ldd to print libs */ static char *ld_utrace; /* Use utrace() to log events. */ @@ -564,7 +566,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) ld_bind_now = getenv(_LD("BIND_NOW")); - /* + /* * If the process is tainted, then we un-set the dangerous environment * variables. The process will be marked as tainted until setuid(2) * is called. If any child process calls setuid(2) we do not want any @@ -575,7 +577,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) unsetenv(_LD("LIBRARY_PATH")) || unsetenv(_LD("LIBRARY_PATH_FDS")) || unsetenv(_LD("LIBMAP_DISABLE")) || unsetenv(_LD("BIND_NOT")) || unsetenv(_LD("DEBUG")) || unsetenv(_LD("ELF_HINTS_PATH")) || - unsetenv(_LD("LOADFLTR")) || unsetenv(_LD("LIBRARY_PATH_RPATH"))) { + unsetenv(_LD("LOADFLTR")) || unsetenv(_LD("LIBRARY_PATH_RPATH")) || + unsetenv(_LD("PRELOAD_FDS"))) { _rtld_error("environment corrupt; aborting"); rtld_die(); } @@ -588,6 +591,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) ld_library_path = getenv(_LD("LIBRARY_PATH")); ld_library_dirs = getenv(_LD("LIBRARY_PATH_FDS")); ld_preload = getenv(_LD("PRELOAD")); + ld_preload_fds = getenv(_LD("PRELOAD_FDS")); ld_elf_hints_path = getenv(_LD("ELF_HINTS_PATH")); ld_loadfltr = getenv(_LD("LOADFLTR")) != NULL; library_path_rpath = getenv(_LD("LIBRARY_PATH_RPATH")); @@ -702,8 +706,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) if (!libmap_disable) libmap_disable = (bool)lm_init(libmap_override); + dbg("loading LD_PRELOAD_FDS libraries"); + if (load_preload_objects(ld_preload_fds, true) == -1) + rtld_die(); + dbg("loading LD_PRELOAD libraries"); - if (load_preload_objects() == -1) + if (load_preload_objects(ld_preload, false) == -1) rtld_die(); preload_tail = globallist_curr(TAILQ_LAST(&obj_list, obj_entry_q)); @@ -2468,9 +2476,8 @@ load_needed_objects(Obj_Entry *first, int flags) } static int -load_preload_objects(void) +load_preload_objects(char *p, bool isfd) { - char *p = ld_preload; Obj_Entry *obj; static const char delim[] = " \t:;"; @@ -2479,12 +2486,24 @@ load_preload_objects(void) p += strspn(p, delim); while (*p != '\0') { + const char *name; size_t len = strcspn(p, delim); char savech; + int fd; savech = p[len]; p[len] = '\0'; - obj = load_object(p, -1, NULL, 0); + if (isfd) { + name = NULL; + fd = parse_integer(p); + if (fd == -1) + return (-1); + } else { + name = p; + fd = -1; + } + + obj = load_object(name, fd, NULL, 0); if (obj == NULL) return (-1); /* XXX - cleanup */ obj->z_interpose = true; diff --git a/libexec/rtld-elf/tests/Makefile b/libexec/rtld-elf/tests/Makefile index 4ab69c1ab0ab..6b8b4e80333b 100644 --- a/libexec/rtld-elf/tests/Makefile +++ b/libexec/rtld-elf/tests/Makefile @@ -3,7 +3,14 @@ SUBDIR+= libpythagoras target SUBDIR_DEPEND_target= libpythagoras + ATF_TESTS_C= ld_library_pathfds +ATF_TESTS_C+= ld_preload_fds + +.for t in ${ATF_TESTS_C} +SRCS.$t= $t.c common.c +.endfor + WARNS?= 3 .include diff --git a/libexec/rtld-elf/tests/common.c b/libexec/rtld-elf/tests/common.c new file mode 100644 index 000000000000..6eb3edfbc14c --- /dev/null +++ b/libexec/rtld-elf/tests/common.c @@ -0,0 +1,81 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * Copyright 2014 Jonathan Anderson. + * Copyright 2021 Mariusz Zaborski + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include "common.h" + +void +expect_success(int binary, char *senv) +{ + char * const env[] = { senv, NULL }; + + try_to_run(binary, 0, env, "the hypotenuse of 3 and 4 is 5\n", ""); +} + +void +expect_missing_library(int binary, char *senv) +{ + char * const env[] = { senv, NULL }; + + try_to_run(binary, 1, env, "", + "ld-elf.so.1: Shared object \"libpythagoras.so.0\" not found," + " required by \"target\"\n"); +} + +void +try_to_run(int binary, int exit_status, char * const *env, + const char *expected_out, const char *expected_err) +{ + pid_t child = atf_utils_fork(); + + if (child == 0) { + char * const args[] = { "target", NULL }; + + fexecve(binary, args, env); + atf_tc_fail("fexecve() failed"); + } + + atf_utils_wait(child, exit_status, expected_out, expected_err); +} + +int +opendir(const char *name) +{ + + return open(name, O_RDONLY | O_DIRECTORY); +} + +int +opendirat(int parent, const char *name) +{ + + return openat(parent, name, O_RDONLY | O_DIRECTORY); +} diff --git a/libexec/rtld-elf/tests/common.h b/libexec/rtld-elf/tests/common.h new file mode 100644 index 000000000000..d5bf2050dcfd --- /dev/null +++ b/libexec/rtld-elf/tests/common.h @@ -0,0 +1,43 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * Copyright 2014 Jonathan Anderson. + * Copyright 2021 Mariusz Zaborski + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LD_COMMON_H_ +#define _LD_COMMON_H_ + +#define TARGET_ELF_NAME "target" +#define TARGET_LIBRARY "libpythagoras.so.0" + +void expect_success(int binary, char *senv); +void expect_missing_library(int binary, char *senv); + +void try_to_run(int binary, int expected_exit_status, char * const *env, + const char *expected_out, const char *expected_err); +int opendir(const char *name); +int opendirat(int parent, const char *name); + +#endif /* _LD_COMMON_H_ */ diff --git a/libexec/rtld-elf/tests/ld_library_pathfds.c b/libexec/rtld-elf/tests/ld_library_pathfds.c index 5c6c2dabbcdb..bc0627d4c3d5 100644 --- a/libexec/rtld-elf/tests/ld_library_pathfds.c +++ b/libexec/rtld-elf/tests/ld_library_pathfds.c @@ -29,6 +29,7 @@ #include #include +#include "common.h" struct descriptors { int binary; @@ -38,14 +39,8 @@ struct descriptors { int usr; }; -static void setup(struct descriptors *, const atf_tc_t *); -static void expect_success(int binary, char *pathfds); -static void expect_missing_library(int binary, char *pathfds); -static void try_to_run(int binary, int expected_exit_status, - char * const *env, const char *expected_out, const char *expected_err); -static int opendir(const char *name); -static int opendirat(int parent, const char *name); +static void setup(struct descriptors *, const atf_tc_t *); ATF_TC_WITHOUT_HEAD(missing_library); @@ -167,55 +162,10 @@ setup(struct descriptors *dp, const atf_tc_t *tc) dp->testdir = opendir(atf_tc_get_config_var(tc, "srcdir")); ATF_REQUIRE(dp->testdir >= 0); ATF_REQUIRE( - (dp->binary = openat(dp->testdir, "target", O_RDONLY)) >= 0); + (dp->binary = openat(dp->testdir, TARGET_ELF_NAME, O_RDONLY)) >= 0); ATF_REQUIRE((dp->root = opendir("/")) >= 0); ATF_REQUIRE((dp->etc = opendirat(dp->root, "etc")) >= 0); ATF_REQUIRE((dp->usr = opendirat(dp->root, "usr")) >= 0); } -static void -expect_success(int binary, char *pathfds) -{ - char * const env[] = { pathfds, NULL }; - try_to_run(binary, 0, env, "the hypotenuse of 3 and 4 is 5\n", ""); -} - -static void -expect_missing_library(int binary, char *pathfds) -{ - char * const env[] = { pathfds, NULL }; - try_to_run(binary, 1, env, "", - "ld-elf.so.1: Shared object \"libpythagoras.so.0\" not found," - " required by \"target\"\n"); -} - - -static void -try_to_run(int binary, int exit_status, char * const *env, - const char *expected_out, const char *expected_err) -{ - pid_t child = atf_utils_fork(); - - if (child == 0) { - char * const args[] = { "target", NULL }; - - fexecve(binary, args, env); - atf_tc_fail("fexecve() failed"); - } - - atf_utils_wait(child, exit_status, expected_out, expected_err); -} - - -static int -opendir(const char *name) -{ - return open(name, O_RDONLY | O_DIRECTORY); -} - -static int -opendirat(int parent, const char *name) -{ - return openat(parent, name, O_RDONLY | O_DIRECTORY); -} diff --git a/libexec/rtld-elf/tests/ld_preload_fds.c b/libexec/rtld-elf/tests/ld_preload_fds.c new file mode 100644 index 000000000000..3a220b009bb6 --- /dev/null +++ b/libexec/rtld-elf/tests/ld_preload_fds.c @@ -0,0 +1,108 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * Copyright 2021 Mariusz Zaborski + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include "common.h" + +int binaryfd; +int libraryfd; + +static void +setup(const atf_tc_t *tc) +{ + int testdir; + + testdir = opendir(atf_tc_get_config_var(tc, "srcdir")); + ATF_REQUIRE(testdir >= 0); + + binaryfd = openat(testdir, TARGET_ELF_NAME, O_RDONLY); + ATF_REQUIRE(binaryfd >= 0); + libraryfd = openat(testdir, TARGET_LIBRARY, O_RDONLY); + ATF_REQUIRE(libraryfd >= 0); + + close(testdir); +} + +ATF_TC_WITHOUT_HEAD(missing_library); +ATF_TC_BODY(missing_library, tc) +{ + + setup(tc); + expect_missing_library(binaryfd, NULL); +} + +ATF_TC_WITHOUT_HEAD(bad_librarys); +ATF_TC_BODY(bad_librarys, tc) +{ + char *senv; + + ATF_REQUIRE(asprintf(&senv, "LD_PRELOAD_FDS=::") > 0); + + setup(tc); + expect_missing_library(binaryfd, senv); +} + +ATF_TC_WITHOUT_HEAD(single_library); +ATF_TC_BODY(single_library, tc) +{ + char *senv; + + setup(tc); + + ATF_REQUIRE( + asprintf(&senv, "LD_PRELOAD_FDS=%d", libraryfd) > 0); + + expect_success(binaryfd, senv); +} + +ATF_TC_WITHOUT_HEAD(two_librarys); +ATF_TC_BODY(two_librarys, tc) +{ + char *senv; + + setup(tc); + + ATF_REQUIRE( + asprintf(&senv, "LD_PRELOAD_FDS=%d:%d", libraryfd, libraryfd) > 0); + + expect_success(binaryfd, senv); +} + +/* Register test cases with ATF. */ +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, missing_library); + ATF_TP_ADD_TC(tp, bad_librarys); + ATF_TP_ADD_TC(tp, single_library); + ATF_TP_ADD_TC(tp, two_librarys); + + return atf_no_error(); +} From owner-dev-commits-src-main@freebsd.org Wed Mar 24 22:41:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 499AE57A29D; Wed, 24 Mar 2021 22:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5NWZ1gLhz3M7f; Wed, 24 Mar 2021 22:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C5451C42F; Wed, 24 Mar 2021 22:41: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 12OMfURX091917; Wed, 24 Mar 2021 22:41:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OMfUIj091916; Wed, 24 Mar 2021 22:41:30 GMT (envelope-from git) Date: Wed, 24 Mar 2021 22:41:30 GMT Message-Id: <202103242241.12OMfUIj091916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4b0632cfc5c8 - main - LinuxKPI: add more linux-specific errno MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b0632cfc5c86587668b1d5d2ddc26d445072b03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 22:41:30 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4b0632cfc5c86587668b1d5d2ddc26d445072b03 commit 4b0632cfc5c86587668b1d5d2ddc26d445072b03 Author: Bjoern A. Zeeb AuthorDate: 2021-03-23 16:37:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-24 22:31:37 +0000 LinuxKPI: add more linux-specific errno Add ERFKILL and EBADE found in iwlwifi and brcmfmac wireless drivers. While here add a comment above the block of error numbers above 500 to document expectations. Obtained-from: bz_iwlwifi Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D29396 --- sys/compat/linuxkpi/common/include/linux/errno.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/errno.h b/sys/compat/linuxkpi/common/include/linux/errno.h index e824480ab640..efdde9a7a72a 100644 --- a/sys/compat/linuxkpi/common/include/linux/errno.h +++ b/sys/compat/linuxkpi/common/include/linux/errno.h @@ -45,6 +45,10 @@ #define ENOTSUPP EOPNOTSUPP #define ENONET EHOSTDOWN +/* + * The error numbers below are arbitrary and do not resemble the numbers + * used in Linux. They should not be returned to user space. + */ #define ERESTARTNOINTR 513 #define ERESTARTNOHAND 514 #define ERESTART_RESTARTBLOCK 516 @@ -58,5 +62,7 @@ #define EBADTYPE 527 #define EJUKEBOX 528 #define EIOCBQUEUED 529 +#define ERFKILL 530 +#define EBADE 531 #endif /* _LINUX_ERRNO_H_ */ From owner-dev-commits-src-main@freebsd.org Wed Mar 24 22:43:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F55C57A3B2; Wed, 24 Mar 2021 22:43:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5NZ50tbtz3M9S; Wed, 24 Mar 2021 22:43:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1127F1C593; Wed, 24 Mar 2021 22:43:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12OMheZJ094699; Wed, 24 Mar 2021 22:43:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OMheej094698; Wed, 24 Mar 2021 22:43:40 GMT (envelope-from git) Date: Wed, 24 Mar 2021 22:43:40 GMT Message-Id: <202103242243.12OMheej094698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3cce818c46f5 - main - LinuxKPI: if_ether additions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cce818c46f58c0089d34a00478c3b7fa3b57c09 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 22:43:41 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3cce818c46f58c0089d34a00478c3b7fa3b57c09 commit 3cce818c46f58c0089d34a00478c3b7fa3b57c09 Author: Bjoern A. Zeeb AuthorDate: 2021-03-23 16:44:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-24 22:33:03 +0000 LinuxKPI: if_ether additions Add various protocol IDs found in various wireless drivers. Also add ETH_FRAME_LEN and struct ethhdr. Obtained-from: bz_iwlwifi Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: hselasky Differential Revision: https://reviews.freebsd.org/D29397 --- sys/compat/linuxkpi/common/include/linux/if_ether.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/if_ether.h b/sys/compat/linuxkpi/common/include/linux/if_ether.h index 77e8f1192816..187446c4c591 100644 --- a/sys/compat/linuxkpi/common/include/linux/if_ether.h +++ b/sys/compat/linuxkpi/common/include/linux/if_ether.h @@ -39,17 +39,29 @@ #ifndef ETH_ALEN #define ETH_ALEN ETHER_ADDR_LEN #endif +#define ETH_FRAME_LEN (ETHER_MAX_LEN - ETHER_CRC_LEN) #define ETH_FCS_LEN 4 /* Octets in the FCS */ #define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) * that VLAN requires. */ /* * defined Ethernet Protocol ID's. */ +#define ETH_P_ARP ETHERTYPE_ARP #define ETH_P_IP ETHERTYPE_IP #define ETH_P_IPV6 ETHERTYPE_IPV6 #define ETH_P_MPLS_UC ETHERTYPE_MPLS #define ETH_P_MPLS_MC ETHERTYPE_MPLS_MCAST #define ETH_P_8021Q ETHERTYPE_VLAN #define ETH_P_8021AD ETHERTYPE_QINQ +#define ETH_P_PAE ETHERTYPE_PAE +#define ETH_P_802_2 ETHERTYPE_8023 +#define ETH_P_LINK_CTL 0x886C /* ITU-T G.989.2 */ +#define ETH_P_TDLS 0x890D /* 802.11z-2010, see wpa. */ + +struct ethhdr { + uint8_t h_dest[ETH_ALEN]; + uint8_t h_source[ETH_ALEN]; + uint16_t h_proto; +} __packed; #endif /* _LINUX_IF_ETHER_H_ */ From owner-dev-commits-src-main@freebsd.org Wed Mar 24 22:45:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD45457A2EC; Wed, 24 Mar 2021 22:45:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5NcW3RFVz3MgK; Wed, 24 Mar 2021 22:45:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 691961C3AD; Wed, 24 Mar 2021 22:45:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12OMjlfg095136; Wed, 24 Mar 2021 22:45:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12OMjluQ095135; Wed, 24 Mar 2021 22:45:47 GMT (envelope-from git) Date: Wed, 24 Mar 2021 22:45:47 GMT Message-Id: <202103242245.12OMjluQ095135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5a402a3ae397 - main - LinuxKPI: add pci_ids.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a402a3ae3975abb573ca9b53ff8cfe204c3771f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 22:45:47 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5a402a3ae3975abb573ca9b53ff8cfe204c3771f commit 5a402a3ae3975abb573ca9b53ff8cfe204c3771f Author: Bjoern A. Zeeb AuthorDate: 2021-03-23 17:13:15 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-24 22:35:18 +0000 LinuxKPI: add pci_ids.h brcm80211 include pci_ids.h directly while historically we were tracking IDs in pci.h. Move the current set of IDs from pci.h to pci_ids.h and while here add IDs for Realtek and Broadcom as well as a network class as needed by their wireless drivers. We still include pci_ids.h from pci.h so this should not change anything. MFC-after: 2 weeks Reviewed-by: hselasky Differential Revision: https://reviews.freebsd.org/D29400 --- sys/compat/linuxkpi/common/include/linux/pci.h | 29 +-------- sys/compat/linuxkpi/common/include/linux/pci_ids.h | 72 ++++++++++++++++++++++ 2 files changed, 73 insertions(+), 28 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index ddb3f0b222a5..7962da994854 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -54,6 +54,7 @@ #include #include #include +#include struct pci_device_id { uint32_t vendor; @@ -67,35 +68,7 @@ struct pci_device_id { #define MODULE_DEVICE_TABLE(bus, table) -#define PCI_BASE_CLASS_DISPLAY 0x03 -#define PCI_CLASS_DISPLAY_VGA 0x0300 -#define PCI_CLASS_DISPLAY_OTHER 0x0380 -#define PCI_BASE_CLASS_BRIDGE 0x06 -#define PCI_CLASS_BRIDGE_ISA 0x0601 - #define PCI_ANY_ID -1U -#define PCI_VENDOR_ID_APPLE 0x106b -#define PCI_VENDOR_ID_ASUSTEK 0x1043 -#define PCI_VENDOR_ID_ATI 0x1002 -#define PCI_VENDOR_ID_DELL 0x1028 -#define PCI_VENDOR_ID_HP 0x103c -#define PCI_VENDOR_ID_IBM 0x1014 -#define PCI_VENDOR_ID_INTEL 0x8086 -#define PCI_VENDOR_ID_MELLANOX 0x15b3 -#define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4 -#define PCI_VENDOR_ID_SERVERWORKS 0x1166 -#define PCI_VENDOR_ID_SONY 0x104d -#define PCI_VENDOR_ID_TOPSPIN 0x1867 -#define PCI_VENDOR_ID_VIA 0x1106 -#define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4 -#define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159 -#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 -#define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46 -#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 -#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 -#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c -#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 -#define PCI_SUBDEVICE_ID_QEMU 0x1100 #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) diff --git a/sys/compat/linuxkpi/common/include/linux/pci_ids.h b/sys/compat/linuxkpi/common/include/linux/pci_ids.h new file mode 100644 index 000000000000..519d1b6eb663 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/pci_ids.h @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_LINUX_PCI_IDS_H +#define _LINUXKPI_LINUX_PCI_IDS_H + +#define PCI_CLASS_NETWORK_OTHER 0x0280 + +#define PCI_BASE_CLASS_DISPLAY 0x03 +#define PCI_CLASS_DISPLAY_VGA 0x0300 +#define PCI_CLASS_DISPLAY_OTHER 0x0380 + +#define PCI_BASE_CLASS_BRIDGE 0x06 +#define PCI_CLASS_BRIDGE_ISA 0x0601 + + +/* XXX We should really generate these and use them throughout the tree. */ + +#define PCI_VENDOR_ID_APPLE 0x106b +#define PCI_VENDOR_ID_ASUSTEK 0x1043 +#define PCI_VENDOR_ID_ATI 0x1002 +#define PCI_VENDOR_ID_BROADCOM 0x14e4 +#define PCI_VENDOR_ID_DELL 0x1028 +#define PCI_VENDOR_ID_HP 0x103c +#define PCI_VENDOR_ID_IBM 0x1014 +#define PCI_VENDOR_ID_INTEL 0x8086 +#define PCI_VENDOR_ID_MELLANOX 0x15b3 +#define PCI_VENDOR_ID_REALTEK 0x10ec +#define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4 +#define PCI_VENDOR_ID_SERVERWORKS 0x1166 +#define PCI_VENDOR_ID_SONY 0x104d +#define PCI_VENDOR_ID_TOPSPIN 0x1867 +#define PCI_VENDOR_ID_VIA 0x1106 +#define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4 +#define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159 +#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 +#define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46 +#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 +#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 +#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c +#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 +#define PCI_SUBDEVICE_ID_QEMU 0x1100 + +#endif /* _LINUXKPI_LINUX_PCI_IDS_H */ From owner-dev-commits-src-main@freebsd.org Wed Mar 24 23:07:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1502057ACDA; Wed, 24 Mar 2021 23:07: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 4F5P5q6jSPz3Np8; Wed, 24 Mar 2021 23:07: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 D92DF1C662; Wed, 24 Mar 2021 23:07: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 12ON7h64023628; Wed, 24 Mar 2021 23:07:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ON7hUt023627; Wed, 24 Mar 2021 23:07:43 GMT (envelope-from git) Date: Wed, 24 Mar 2021 23:07:43 GMT Message-Id: <202103242307.12ON7hUt023627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f1069375d973 - main - LinuxKPI: add lockdep_map MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1069375d97384754a9e8ee8bc21a32d3ad10987 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 23:07:44 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f1069375d97384754a9e8ee8bc21a32d3ad10987 commit f1069375d97384754a9e8ee8bc21a32d3ad10987 Author: Bjoern A. Zeeb AuthorDate: 2021-03-23 16:51:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-24 22:50:55 +0000 LinuxKPI: add lockdep_map Add stubs for struct lockdep_map and three accessor functions used by iwlwifi. Obtained-from: bz_iwlwifi Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D29398 --- sys/compat/linuxkpi/common/include/linux/lockdep.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index a86157ba5924..de82d06a419e 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -36,6 +36,8 @@ struct lock_class_key { }; +struct lockdep_map { +}; #define lockdep_set_class(lock, key) #define lockdep_set_subclass(lock, sub) @@ -85,4 +87,8 @@ lockdep_is_held(void *__m) #define mutex_acquire(...) do { } while (0) #define mutex_release(...) do { } while (0) +#define lock_map_acquire(_map) do { } while (0) +#define lock_map_acquire_read(_map) do { } while (0) +#define lock_map_release(_map) do { } while (0) + #endif /* _LINUX_LOCKDEP_H_ */ From owner-dev-commits-src-main@freebsd.org Wed Mar 24 23:11:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 715EE57ACFD; Wed, 24 Mar 2021 23:11: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 4F5PBf2psHz3PGl; Wed, 24 Mar 2021 23:11: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 53F491C7D5; Wed, 24 Mar 2021 23:11: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 12ONBs0b037125; Wed, 24 Mar 2021 23:11:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ONBs86037124; Wed, 24 Mar 2021 23:11:54 GMT (envelope-from git) Date: Wed, 24 Mar 2021 23:11:54 GMT Message-Id: <202103242311.12ONBs86037124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3b1ecc9fa1b5 - main - LinuxKPI: remove < 5.0 version 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/main X-Git-Reftype: branch X-Git-Commit: 3b1ecc9fa1b57ca7a1c86661e9a323bc41c97ecc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 23:11:54 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3b1ecc9fa1b57ca7a1c86661e9a323bc41c97ecc commit 3b1ecc9fa1b57ca7a1c86661e9a323bc41c97ecc Author: Bjoern A. Zeeb AuthorDate: 2021-03-23 14:24:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-24 23:00:03 +0000 LinuxKPI: remove < 5.0 version support We are not aware of any out-of-tree consumers anymore which would need KPI support for before Linux version 5. Update the two in-tree consumers to use the new KPI. This allows us to remove the extra version check and will also give access to {lower,upper}_32_bits() unconditionally. Sponsored-by: The FreeBSD Foundation Reviewed-by: hselasky, rlibby, rstone MFC-after: 2 weeks X-MFC: to 13 only Differential Revision: https://reviews.freebsd.org/D29391 --- sys/compat/linuxkpi/common/include/asm/uaccess.h | 4 ---- sys/compat/linuxkpi/common/include/linux/compiler.h | 3 --- sys/compat/linuxkpi/common/include/linux/uaccess.h | 4 ---- sys/dev/pms/freebsd/driver/common/lxencrypt.c | 4 ++-- sys/ofed/drivers/infiniband/core/ib_uverbs_main.c | 3 +-- 5 files changed, 3 insertions(+), 15 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/asm/uaccess.h b/sys/compat/linuxkpi/common/include/asm/uaccess.h index 0ae20b09dc8c..102373634ba3 100644 --- a/sys/compat/linuxkpi/common/include/asm/uaccess.h +++ b/sys/compat/linuxkpi/common/include/asm/uaccess.h @@ -52,11 +52,7 @@ copy_from_user(void *to, const void *from, unsigned long n) #define __copy_from_user(...) copy_from_user(__VA_ARGS__) #define __copy_in_user(...) copy_from_user(__VA_ARGS__) -#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 #define user_access_begin(ptr, len) access_ok(ptr, len) -#else -#define user_access_begin() do { } while (0) -#endif #define user_access_end() do { } while (0) #define unsafe_get_user(x, ptr, err) do { \ diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index 1177674aa68f..d8aef4fa7988 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -81,11 +81,8 @@ #define barrier() __asm__ __volatile__("": : :"memory") -#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 -/* Moved from drm_os_freebsd.h */ #define lower_32_bits(n) ((u32)(n)) #define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) -#endif #define ___PASTE(a,b) a##b #define __PASTE(a,b) ___PASTE(a,b) diff --git a/sys/compat/linuxkpi/common/include/linux/uaccess.h b/sys/compat/linuxkpi/common/include/linux/uaccess.h index c09c363a98a7..10a06a220f86 100644 --- a/sys/compat/linuxkpi/common/include/linux/uaccess.h +++ b/sys/compat/linuxkpi/common/include/linux/uaccess.h @@ -61,11 +61,7 @@ #define put_user(_x, _p) __put_user(_x, _p) #define clear_user(...) linux_clear_user(__VA_ARGS__) -#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 #define access_ok(a,b) linux_access_ok(a,b) -#else -#define access_ok(a,b,c) linux_access_ok(b,c) -#endif extern int linux_copyin(const void *uaddr, void *kaddr, size_t len); extern int linux_copyout(const void *kaddr, void *uaddr, size_t len); diff --git a/sys/dev/pms/freebsd/driver/common/lxencrypt.c b/sys/dev/pms/freebsd/driver/common/lxencrypt.c index c53c52fb2378..0d469f9fdbf7 100644 --- a/sys/dev/pms/freebsd/driver/common/lxencrypt.c +++ b/sys/dev/pms/freebsd/driver/common/lxencrypt.c @@ -838,7 +838,7 @@ printf("%s: Minor %d\n", __FUNCTION__, pIoctlPayload->hdr.MinorFunction); printf("%s: Add kek at index 0x%x wrapper 0x%x format 0x%x\n", __FUNCTION__, kek_add->kekIndex, kek_add->wrapperKekIndex, kek_add->blobFormat); /* Copy kek_blob from user pointer to local buffer */ - if(access_ok(VERIFY_READ, kek_add->EncryptKekBlob, sizeof(kek_blob))) { + if(access_ok(kek_add->EncryptKekBlob, sizeof(kek_blob))) { printf("%s: Starting copy from user %p to kernel %p\n", __FUNCTION__, kek_add->EncryptKekBlob, &kek_blob); if((rv = copy_from_user(&kek_blob, kek_add->EncryptKekBlob, sizeof(kek_blob))) != 0) { printf("%s: Copy error, %d left\n", __FUNCTION__, rv); @@ -873,7 +873,7 @@ printf("%s: Minor %d\n", __FUNCTION__, pIoctlPayload->hdr.MinorFunction); printf("%s: Add dek at index 0x%x, table %x, kek index %x, blob format %x, entry size %x\n", __FUNCTION__, dek_index, dek_table, kek_index, blob_format, entry_sz); /* Copy dek_blob from user pointer to local buffer */ - if(access_ok(VERIFY_READ, dek_add->dekBlob, sizeof(dek_blob))) { + if(access_ok(dek_add->dekBlob, sizeof(dek_blob))) { printf("%s: Starting copy from user %p to kernel %p\n", __FUNCTION__, dek_add->dekBlob, &dek_blob); if((rv = copy_from_user(&dek_blob, dek_add->dekBlob, sizeof(dek_blob))) != 0) { printf("%s: Copy error, %d left\n", __FUNCTION__, rv); diff --git a/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c b/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c index 8aab2ac3ff8d..e1b560774fbc 100644 --- a/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c +++ b/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c @@ -856,8 +856,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, goto out; } - if (!access_ok(VERIFY_WRITE, - (void __user *) (unsigned long) ex_hdr.response, + if (!access_ok((void __user *) (unsigned long) ex_hdr.response, (hdr.out_words + ex_hdr.provider_out_words) * 8)) { ret = -EFAULT; goto out; From owner-dev-commits-src-main@freebsd.org Wed Mar 24 23:14:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A8B257AFAD; Wed, 24 Mar 2021 23:14: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 4F5PFh29r0z3PVv; Wed, 24 Mar 2021 23:14: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 3DC751CA3C; Wed, 24 Mar 2021 23:14: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 12ONEWVe037620; Wed, 24 Mar 2021 23:14:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ONEWG8037619; Wed, 24 Mar 2021 23:14:32 GMT (envelope-from git) Date: Wed, 24 Mar 2021 23:14:32 GMT Message-Id: <202103242314.12ONEWG8037619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5df6f7a84058 - main - qlnxr: remove duplicate defines MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5df6f7a8405899fac795f227de96ebadd10d60af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 23:14:32 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5df6f7a8405899fac795f227de96ebadd10d60af commit 5df6f7a8405899fac795f227de96ebadd10d60af Author: Bjoern A. Zeeb AuthorDate: 2021-03-23 14:31:37 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-24 23:03:30 +0000 qlnxr: remove duplicate defines upper_32_bits() and lower_32_bits() are defined twice in this file. With the extra conditinal removed on LinuxKPI in 3b1ecc9fa1b5 they are also included from there already. Use the LinuxKPI version and remove the two local ones. Sponsored-by: The FreeBSD Foundation Reviewed-by: hselasky MFC-after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29392 --- sys/dev/qlnx/qlnxr/qlnxr_verbs.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/dev/qlnx/qlnxr/qlnxr_verbs.c b/sys/dev/qlnx/qlnxr/qlnxr_verbs.c index 35b46e11a3b9..9c0087c1b76d 100644 --- a/sys/dev/qlnx/qlnxr/qlnxr_verbs.c +++ b/sys/dev/qlnx/qlnxr/qlnxr_verbs.c @@ -36,8 +36,6 @@ __FBSDID("$FreeBSD$"); #include "qlnxr_roce.h" #include "qlnxr_cm.h" -#define upper_32_bits(x) (uint32_t)(x >> 32) -#define lower_32_bits(x) (uint32_t)(x) #define HILO_U64(hi, lo) ((((u64)(hi)) << 32) + (lo)) #define TYPEPTR_ADDR_SET(type_ptr, field, vaddr) \ @@ -1365,9 +1363,6 @@ qlnxr_prepare_pbl_tbl(struct qlnxr_dev *dev, return 0; } -#define upper_32_bits(x) (uint32_t)(x >> 32) -#define lower_32_bits(x) (uint32_t)(x) - static void qlnxr_populate_pbls(struct qlnxr_dev *dev, struct ib_umem *umem, struct qlnxr_pbl *pbl, struct qlnxr_pbl_info *pbl_info) From owner-dev-commits-src-main@freebsd.org Wed Mar 24 23:47:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA21357BB96; Wed, 24 Mar 2021 23:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5PzB5shHz3Qtc; Wed, 24 Mar 2021 23:47: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 BC5441D284; Wed, 24 Mar 2021 23:47: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 12ONl2an079600; Wed, 24 Mar 2021 23:47:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ONl2WW079599; Wed, 24 Mar 2021 23:47:02 GMT (envelope-from git) Date: Wed, 24 Mar 2021 23:47:02 GMT Message-Id: <202103242347.12ONl2WW079599@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: ec8f1ea8d536 - main - Generalize sanitizer interceptors for memory and string routines 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: ec8f1ea8d536e91ad37e03e45a688c4e255b9cb0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 23:47:02 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ec8f1ea8d536e91ad37e03e45a688c4e255b9cb0 commit ec8f1ea8d536e91ad37e03e45a688c4e255b9cb0 Author: Mark Johnston AuthorDate: 2021-03-24 23:43:05 +0000 Commit: Mark Johnston CommitDate: 2021-03-24 23:46:22 +0000 Generalize sanitizer interceptors for memory and string routines Similar to commit 3ead60236f ("Generalize bus_space(9) and atomic(9) sanitizer interceptors"), use a more generic scheme for interposing sanitizer implementations of routines like memcpy(). No functional change intended. MFC after: 1 month Sponsored by: The FreeBSD Foundation --- sys/kern/subr_csan.c | 6 ------ sys/sys/libkern.h | 18 ++++++++++-------- sys/sys/systm.h | 54 ++++++++++++++++++++++++++++++++-------------------- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/sys/kern/subr_csan.c b/sys/kern/subr_csan.c index 06b0b6ebb020..56d2e59ff12c 100644 --- a/sys/kern/subr_csan.c +++ b/sys/kern/subr_csan.c @@ -350,12 +350,6 @@ kcsan_strlen(const char *str) return (s - str); } -#undef copyin -#undef copyin_nofault -#undef copyinstr -#undef copyout -#undef copyout_nofault - int kcsan_copyin(const void *uaddr, void *kaddr, size_t len) { diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index 3f8827de06c5..c5bd5a07a0b9 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -192,18 +192,20 @@ size_t strspn(const char *, const char *); char *strstr(const char *, const char *); int strvalid(const char *, size_t); -#ifdef KCSAN -char *kcsan_strcpy(char *, const char *); -int kcsan_strcmp(const char *, const char *); -size_t kcsan_strlen(const char *); -#define strcpy(d, s) kcsan_strcpy((d), (s)) -#define strcmp(s1, s2) kcsan_strcmp((s1), (s2)) -#define strlen(s) kcsan_strlen((s)) +#ifdef SAN_PREFIX +char *SAN_INTERCEPTOR(strcpy)(char *, const char *); +int SAN_INTERCEPTOR(strcmp)(const char *, const char *); +size_t SAN_INTERCEPTOR(strlen)(const char *); +#ifndef SAN_RUNTIME +#define strcpy(d, s) SAN_INTERCEPTOR(strcpy)((d), (s)) +#define strcmp(s1, s2) SAN_INTERCEPTOR(strcmp)((s1), (s2)) +#define strlen(s) SAN_INTERCEPTOR(strlen)(s) +#endif /* !SAN_RUNTIME */ #else #define strcpy(d, s) __builtin_strcpy((d), (s)) #define strcmp(s1, s2) __builtin_strcmp((s1), (s2)) #define strlen(s) __builtin_strlen((s)) -#endif +#endif /* SAN_PREFIX */ static __inline char * index(const char *p, int ch) diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 369b8bdedb51..8a5bb23a3e14 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -351,18 +351,28 @@ void *memcpy(void * _Nonnull to, const void * _Nonnull from, size_t len); void *memmove(void * _Nonnull dest, const void * _Nonnull src, size_t n); int memcmp(const void *b1, const void *b2, size_t len); -#ifdef KCSAN -void *kcsan_memset(void *, int, size_t); -void *kcsan_memcpy(void *, const void *, size_t); -void *kcsan_memmove(void *, const void *, size_t); -int kcsan_memcmp(const void *, const void *, size_t); -#define bcopy(from, to, len) kcsan_memmove((to), (from), (len)) -#define bzero(buf, len) kcsan_memset((buf), 0, (len)) -#define bcmp(b1, b2, len) kcsan_memcmp((b1), (b2), (len)) -#define memset(buf, c, len) kcsan_memset((buf), (c), (len)) -#define memcpy(to, from, len) kcsan_memcpy((to), (from), (len)) -#define memmove(dest, src, n) kcsan_memmove((dest), (src), (n)) -#define memcmp(b1, b2, len) kcsan_memcmp((b1), (b2), (len)) +#if defined(KASAN) +#define SAN_PREFIX kasan_ +#elif defined(KCSAN) +#define SAN_PREFIX kcsan_ +#endif + +#ifdef SAN_PREFIX +#define SAN_INTERCEPTOR(func) __CONCAT(SAN_PREFIX, func) + +void *SAN_INTERCEPTOR(memset)(void *, int, size_t); +void *SAN_INTERCEPTOR(memcpy)(void *, const void *, size_t); +void *SAN_INTERCEPTOR(memmove)(void *, const void *, size_t); +int SAN_INTERCEPTOR(memcmp)(const void *, const void *, size_t); +#ifndef SAN_RUNTIME +#define bcopy(from, to, len) SAN_INTERCEPTOR(memmove)((to), (from), (len)) +#define bzero(buf, len) SAN_INTERCEPTOR(memset)((buf), 0, (len)) +#define bcmp(b1, b2, len) SAN_INTERCEPTOR(memcmp)((b1), (b2), (len)) +#define memset(buf, c, len) SAN_INTERCEPTOR(memset)((buf), (c), (len)) +#define memcpy(to, from, len) SAN_INTERCEPTOR(memcpy)((to), (from), (len)) +#define memmove(dest, src, n) SAN_INTERCEPTOR(memmove)((dest), (src), (n)) +#define memcmp(b1, b2, len) SAN_INTERCEPTOR(memcmp)((b1), (b2), (len)) +#endif /* !SAN_RUNTIME */ #else #define bcopy(from, to, len) __builtin_memmove((to), (from), (len)) #define bzero(buf, len) __builtin_memset((buf), 0, (len)) @@ -371,7 +381,7 @@ int kcsan_memcmp(const void *, const void *, size_t); #define memcpy(to, from, len) __builtin_memcpy((to), (from), (len)) #define memmove(dest, src, n) __builtin_memmove((dest), (src), (n)) #define memcmp(b1, b2, len) __builtin_memcmp((b1), (b2), (len)) -#endif +#endif /* !SAN_PREFIX */ void *memset_early(void * _Nonnull buf, int c, size_t len); #define bzero_early(buf, len) memset_early((buf), 0, (len)) @@ -402,14 +412,16 @@ int copyout(const void * _Nonnull __restrict kaddr, int copyout_nofault(const void * _Nonnull __restrict kaddr, void * __restrict udaddr, size_t len); -#ifdef KCSAN -int kcsan_copyin(const void *, void *, size_t); -int kcsan_copyinstr(const void *, void *, size_t, size_t *); -int kcsan_copyout(const void *, void *, size_t); -#define copyin(u, k, l) kcsan_copyin((u), (k), (l)) -#define copyinstr(u, k, l, lc) kcsan_copyinstr((u), (k), (l), (lc)) -#define copyout(k, u, l) kcsan_copyout((k), (u), (l)) -#endif +#ifdef SAN_PREFIX +int SAN_INTERCEPTOR(copyin)(const void *, void *, size_t); +int SAN_INTERCEPTOR(copyinstr)(const void *, void *, size_t, size_t *); +int SAN_INTERCEPTOR(copyout)(const void *, void *, size_t); +#ifndef SAN_RUNTIME +#define copyin(u, k, l) SAN_INTERCEPTOR(copyin)((u), (k), (l)) +#define copyinstr(u, k, l, lc) SAN_INTERCEPTOR(copyinstr)((u), (k), (l), (lc)) +#define copyout(k, u, l) SAN_INTERCEPTOR(copyout)((k), (u), (l)) +#endif /* !SAN_RUNTIME */ +#endif /* SAN_PREFIX */ int fubyte(volatile const void *base); long fuword(volatile const void *base); From owner-dev-commits-src-main@freebsd.org Wed Mar 24 23:49:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA67757BC29; Wed, 24 Mar 2021 23:49: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 4F5Q264wTVz3gyP; Wed, 24 Mar 2021 23:49: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 978EC1D14B; Wed, 24 Mar 2021 23:49: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 12ONnY3T080078; Wed, 24 Mar 2021 23:49:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ONnYeD080077; Wed, 24 Mar 2021 23:49:34 GMT (envelope-from git) Date: Wed, 24 Mar 2021 23:49:34 GMT Message-Id: <202103242349.12ONnYeD080077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: bc444e2ec6e6 - main - Fix fsck_ffs Pass 1b error exit "bad inode number 2 to nextinode". MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc444e2ec6e6cc9d96d35ab7ce3c02c0da952fad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 23:49:34 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=bc444e2ec6e6cc9d96d35ab7ce3c02c0da952fad commit bc444e2ec6e6cc9d96d35ab7ce3c02c0da952fad Author: Kirk McKusick AuthorDate: 2021-03-24 23:50:24 +0000 Commit: Kirk McKusick CommitDate: 2021-03-24 23:53:28 +0000 Fix fsck_ffs Pass 1b error exit "bad inode number 2 to nextinode". Pass 1b of fsck_ffs runs only when Pass 1 has found duplicate blocks. When starting up, Pass 1b failed to properly skip over the two unused inodes at the beginning of the filesystem resulting in the above error message when it tried to read the filesystem root inode. Reported by: Chuck Silvers Tested by: Chuck Silvers MFC after: 3 days Sponsored by: Netflix --- sbin/fsck_ffs/pass1b.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/fsck_ffs/pass1b.c b/sbin/fsck_ffs/pass1b.c index 8c09ef36acad..b44e0107c982 100644 --- a/sbin/fsck_ffs/pass1b.c +++ b/sbin/fsck_ffs/pass1b.c @@ -78,8 +78,10 @@ pass1b(void) continue; setinodebuf(c, inosused); for (i = 0; i < inosused; i++, inumber++) { - if (inumber < UFS_ROOTINO) + if (inumber < UFS_ROOTINO) { + (void)getnextinode(inumber, 0); continue; + } dp = getnextinode(inumber, 0); idesc.id_number = inumber; idesc.id_type = inoinfo(inumber)->ino_idtype; From owner-dev-commits-src-main@freebsd.org Wed Mar 24 23:51:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4C3A57BE1E; Wed, 24 Mar 2021 23:51: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 4F5Q3q4mlHz3h0l; Wed, 24 Mar 2021 23:51: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 96B711C87A; Wed, 24 Mar 2021 23:51: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 12ONp344090935; Wed, 24 Mar 2021 23:51:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ONp38r090934; Wed, 24 Mar 2021 23:51:03 GMT (envelope-from git) Date: Wed, 24 Mar 2021 23:51:03 GMT Message-Id: <202103242351.12ONp38r090934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: e086aff91c24 - main - rtld: fix the man page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e086aff91c242a2decdf7dd1ceb5a0b3e723a53f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 23:51:03 -0000 The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=e086aff91c242a2decdf7dd1ceb5a0b3e723a53f commit e086aff91c242a2decdf7dd1ceb5a0b3e723a53f Author: Mariusz Zaborski AuthorDate: 2021-03-24 23:49:59 +0000 Commit: Mariusz Zaborski CommitDate: 2021-03-24 23:51:44 +0000 rtld: fix the man page In f90218886fc8 in man page I used LD_PRELOAD_PATH_FDS instead of LD_PRELOAD_FDS. Reported by: rpokala --- libexec/rtld-elf/rtld.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 040ab496ceb3..589b9a92aa77 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -189,7 +189,7 @@ to be linked in before any other shared libraries. If the directory is not specified then the directories specified by -.It Ev LD_PRELOAD_PATH_FDS +.It Ev LD_PRELOAD_FDS A colon separated list of file descriptor numbers for libraries. This is intended for preloading libraries in which we already have a file descriptor. From owner-dev-commits-src-main@freebsd.org Wed Mar 24 23:52:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 729F057BDBD; Wed, 24 Mar 2021 23:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5Q5V2rB1z3hZN; Wed, 24 Mar 2021 23:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 546D41D167; Wed, 24 Mar 2021 23:52: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 12ONqU1F092397; Wed, 24 Mar 2021 23:52:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12ONqUs1092381; Wed, 24 Mar 2021 23:52:30 GMT (envelope-from git) Date: Wed, 24 Mar 2021 23:52:30 GMT Message-Id: <202103242352.12ONqUs1092381@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: 66f138563bec - main - Plug nexthop group refcount leak. In case with batch route delete via rib_walk_del(), when some paths from the multipath route gets deleted, old multipath group were not freed. 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: 66f138563becf12d5c21924f816d2a45c3a1ed7a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 23:52:30 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=66f138563becf12d5c21924f816d2a45c3a1ed7a commit 66f138563becf12d5c21924f816d2a45c3a1ed7a Author: Alexander V. Chernikov AuthorDate: 2021-03-24 23:51:45 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-03-24 23:52:18 +0000 Plug nexthop group refcount leak. In case with batch route delete via rib_walk_del(), when some paths from the multipath route gets deleted, old multipath group were not freed. PR: 254496 Reported by: Zhenlei Huang MFC after: 1 day --- sys/net/route/route_ctl.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index 92c7db1d5e29..36f4afaae648 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -130,6 +130,7 @@ vnet_rtzone_destroy() static void destroy_rtentry(struct rtentry *rt) { +#ifdef VIMAGE struct nhop_object *nh = rt->rt_nhop; /* @@ -146,9 +147,10 @@ destroy_rtentry(struct rtentry *rt) } #endif CURVNET_SET(nhop_get_vnet(nh)); +#endif /* Unreference nexthop */ - nhop_free_any(nh); + nhop_free_any(rt->rt_nhop); uma_zfree(V_rtzone, rt); @@ -1239,7 +1241,6 @@ rt_checkdelroute(struct radix_node *rn, void *arg) struct rt_delinfo *di; struct rt_addrinfo *info; struct rtentry *rt; - int error; di = (struct rt_delinfo *)arg; rt = (struct rtentry *)rn; @@ -1248,7 +1249,8 @@ rt_checkdelroute(struct radix_node *rn, void *arg) info->rti_info[RTAX_DST] = rt_key(rt); info->rti_info[RTAX_NETMASK] = rt_mask(rt); - error = rt_unlinkrte(di->rnh, info, &di->rc); + if (rt_unlinkrte(di->rnh, info, &di->rc) != 0) + return (0); /* * Add deleted rtentries to the list to GC them @@ -1257,11 +1259,19 @@ rt_checkdelroute(struct radix_node *rn, void *arg) * XXX: Delayed notifications not implemented * for nexthop updates. */ - if ((error == 0) && (di->rc.rc_cmd == RTM_DELETE)) { + if (di->rc.rc_cmd == RTM_DELETE) { /* Add to the list and return */ rt->rt_chain = di->head; di->head = rt; +#ifdef ROUTE_MPATH + } else { + /* + * RTM_CHANGE to a diferent nexthop or nexthop group. + * Free old multipath group. + */ + nhop_free_any(di->rc.rc_nh_old); } +#endif return (0); } From owner-dev-commits-src-main@freebsd.org Thu Mar 25 00:21:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 536B457CB74; Thu, 25 Mar 2021 00:21:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5Qks1rLCz3js3; Thu, 25 Mar 2021 00:21:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 322A11D6CA; Thu, 25 Mar 2021 00:21:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12P0LPCi034264; Thu, 25 Mar 2021 00:21:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12P0LP9x034263; Thu, 25 Mar 2021 00:21:25 GMT (envelope-from git) Date: Thu, 25 Mar 2021 00:21:25 GMT Message-Id: <202103250021.12P0LP9x034263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 7848b25edd2a - main - Fix fsck_ffs -R finds unfixed duplicate block errors when rerunning. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7848b25edd2a513f115de6d91f0a5a8d8fa1aa58 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 00:21:25 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=7848b25edd2a513f115de6d91f0a5a8d8fa1aa58 commit 7848b25edd2a513f115de6d91f0a5a8d8fa1aa58 Author: Kirk McKusick AuthorDate: 2021-03-25 00:23:33 +0000 Commit: Kirk McKusick CommitDate: 2021-03-25 00:24:41 +0000 Fix fsck_ffs -R finds unfixed duplicate block errors when rerunning. This fixes a long-standing but very obscure bug in fsck_ffs when it is run with the -R (rerun after unexpected errors). It only occurs if fsck_ffs finds duplicate blocks and they are all contained in inodes that reside in the first block of inodes (typically among the first 128 inodes). Rather than use the usual ginode() interface to walk through the inodes in pass1, there is a special optimized `getnextinode()' routine for walking through all the inodes. It has its own private buffer for reading the inode blocks. If pass 1 finds duplicate blocks it runs pass 1b to find all the inodes that contain these duplicate blocks. Pass 1b also uses the `getnextinode()' to search for the inodes with duplicate blocks. Pass 1b stops when all the duplicate blocks have been found. If all the duplicate blocks are found in the first block of inodes, then the getnextinode cache holds this block of bad inodes. The subsequent cleanup of the inodes in passes 2-5 is done using ginode() which uses the regular fsck_ffs cache. When fsck_ffs restarts, pass1() calls setinodebuf() to point at the first block of inodes. When it calls getnextinode() to get inode 2, getnextino() sees that its private cache already has the first set of inodes loaded and starts using them. They are of course the trashed inodes left over from the previous run of pass1b(). The fix is to always invalidate the getnextinode cache when calling setinodebuf(). Reported by: Chuck Silvers Tested by: Chuck Silvers MFC after: 3 days Sponsored by: Netflix --- sbin/fsck_ffs/inode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 60019425c825..020a69dd72f8 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -600,6 +600,9 @@ setinodebuf(int cg, ino_t inosused) nextino = inum; lastinum = inum; readcount = 0; + /* Flush old contents in case they have been updated */ + flush(fswritefd, &inobuf); + inobuf.b_bno = 0; if (inobuf.b_un.b_buf == NULL) { inobufsize = blkroundup(&sblock, MAX(INOBUFSIZE, sblock.fs_bsize)); From owner-dev-commits-src-main@freebsd.org Thu Mar 25 00:31:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69DFC57D029; Thu, 25 Mar 2021 00:31: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 4F5Qyx2b4zz3kjj; Thu, 25 Mar 2021 00:31: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 4BCE81D460; Thu, 25 Mar 2021 00:31: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 12P0VrjK045628; Thu, 25 Mar 2021 00:31:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12P0Vr4n045627; Thu, 25 Mar 2021 00:31:53 GMT (envelope-from git) Date: Thu, 25 Mar 2021 00:31:53 GMT Message-Id: <202103250031.12P0Vr4n045627@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: 24cd2796cf10 - main - Fix !VNET build broken by 66f138563becf12d5c21924f816d2a45c3a1ed7a. 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: 24cd2796cf10211964be8a2cb3ea3e161adea746 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 00:31:53 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=24cd2796cf10211964be8a2cb3ea3e161adea746 commit 24cd2796cf10211964be8a2cb3ea3e161adea746 Author: Alexander V. Chernikov AuthorDate: 2021-03-25 00:30:41 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-03-25 00:31:08 +0000 Fix !VNET build broken by 66f138563becf12d5c21924f816d2a45c3a1ed7a. --- 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 36f4afaae648..fb3dfff87019 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -1270,8 +1270,8 @@ rt_checkdelroute(struct radix_node *rn, void *arg) * Free old multipath group. */ nhop_free_any(di->rc.rc_nh_old); - } #endif + } return (0); } From owner-dev-commits-src-main@freebsd.org Thu Mar 25 07:46:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CAFB5B2814; Thu, 25 Mar 2021 07:46: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 4F5ccG1xfWz4gcV; Thu, 25 Mar 2021 07:46: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 35B202345E; Thu, 25 Mar 2021 07:46: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 12P7kMdj052957; Thu, 25 Mar 2021 07:46:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12P7kMPP052956; Thu, 25 Mar 2021 07:46:22 GMT (envelope-from git) Date: Thu, 25 Mar 2021 07:46:22 GMT Message-Id: <202103250746.12P7kMPP052956@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: def657b82552 - main - build.7: Document SYSDIR variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: def657b825529feffc2f0acb75541a45e97d92b4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 07:46:22 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=def657b825529feffc2f0acb75541a45e97d92b4 commit def657b825529feffc2f0acb75541a45e97d92b4 Author: Warner Losh AuthorDate: 2021-03-25 07:45:21 +0000 Commit: Warner Losh CommitDate: 2021-03-25 07:45:21 +0000 build.7: Document SYSDIR variable Add a description of the SYSDIR variable. --- share/man/man7/build.7 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 72a1dc3078d1..4dbe5faf6e73 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2020 +.Dd March 25, 2020 .Dt BUILD 7 .Os .Sh NAME @@ -647,6 +647,14 @@ This variable can also be useful when debugging failed builds. .Bd -literal -offset indent make some-target SUBDIR_OVERRIDE=foo/bar .Ed +.It Va SYSDIR +Specify the location of the kernel source to override the default +.Pa /usr/src/sys . +The kernel source is located in the +.Pa sys +subdirectory of the source tree checked out from the +.Pa src.git +repository. .It Va TARGET The target hardware platform. This is analogous to the From owner-dev-commits-src-main@freebsd.org Thu Mar 25 07:48:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5374A5B289A; Thu, 25 Mar 2021 07:48:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5cfk1zGCz4gdC; Thu, 25 Mar 2021 07:48:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3730623881; Thu, 25 Mar 2021 07:48: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 12P7mUIs053477; Thu, 25 Mar 2021 07:48:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12P7mUb5053476; Thu, 25 Mar 2021 07:48:30 GMT (envelope-from git) Date: Thu, 25 Mar 2021 07:48:30 GMT Message-Id: <202103250748.12P7mUb5053476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 29dd5e7a87a4 - main - build.7: Use proper .Dd date from this year MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29dd5e7a87a43d2b26d0b654415177708352452a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 07:48:30 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=29dd5e7a87a43d2b26d0b654415177708352452a commit 29dd5e7a87a43d2b26d0b654415177708352452a Author: Warner Losh AuthorDate: 2021-03-25 07:48:12 +0000 Commit: Warner Losh CommitDate: 2021-03-25 07:48:12 +0000 build.7: Use proper .Dd date from this year --- share/man/man7/build.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 4dbe5faf6e73..14ea7df02a76 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2020 +.Dd March 25, 2021 .Dt BUILD 7 .Os .Sh NAME From owner-dev-commits-src-main@freebsd.org Thu Mar 25 12:07:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61A3D5BB177; Thu, 25 Mar 2021 12:07: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 4F5kPx2Cyxz3F3m; Thu, 25 Mar 2021 12:07: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 3F22F2647A; Thu, 25 Mar 2021 12:07: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 12PC7nqt018792; Thu, 25 Mar 2021 12:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PC7nDc018791; Thu, 25 Mar 2021 12:07:49 GMT (envelope-from git) Date: Thu, 25 Mar 2021 12:07:49 GMT Message-Id: <202103251207.12PC7nDc018791@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: 7daca4e2043f - main - truss: improved support for decoding compat32 arguments 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: 7daca4e2043fa8d88658eb8c2fc195128cb5c3da Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 12:07:49 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=7daca4e2043fa8d88658eb8c2fc195128cb5c3da commit 7daca4e2043fa8d88658eb8c2fc195128cb5c3da Author: Alex Richardson AuthorDate: 2021-03-25 11:12:17 +0000 Commit: Alex Richardson CommitDate: 2021-03-25 11:14:13 +0000 truss: improved support for decoding compat32 arguments Currently running `truss -a -e` does not decode any argument values for freebsd32_* syscalls (open/readlink/etc.) This change checks whether a syscall starts with freebsd{32,64}_ and if so strips that prefix when looking up the syscall information. To ensure that the truss logs include the real syscall name we create a copy of the syscall information struct with the updated. The other problem is that when reading string array values, truss naively iterates over an array of char* and fetches the pointer value. This will result in arguments not being loaded if the pointer is not aligned to sizeof(void*), which can happens in the compat32 case. If it happens to be aligned, we would end up printing every other value. To fix this problem, this changes adds a pointer_size member to the procabi struct and uses that to correctly read indirect arguments as 64/32 bit addresses in the the compat32 case (and also compat64 on CheriBSD). The motivating use-case for this change is using truss for 64-bit programs on a CHERI system, but most of the diff also applies to 32-bit compat on a 64-bit system, so I'm upstreaming this instead of keeping it as a local CheriBSD patch. Output of `truss -aef ldd32 /usr/bin/ldd32` before: 39113: freebsd32_mmap(0x0,0x1000,0x3,0x1002,0xffffffff,0x0,0x0) = 543440896 (0x20644000) 39113: freebsd32_ioctl(0x1,0x402c7413,0xffffd2a0) = 0 (0x0) /usr/bin/ldd32: 39113: write(1,"/usr/bin/ldd32:\n",16) = 16 (0x10) 39113: fork() = 39114 (0x98ca) 39114: 39114: freebsd32_execve(0xffffd97e,0xffffd680,0x20634000) EJUSTRETURN 39114: freebsd32_mmap(0x0,0x20000,0x3,0x1002,0xffffffff,0x0,0x0) = 541237248 (0x2042a000) 39114: freebsd32_mprotect(0x20427000,0x1000,0x1) = 0 (0x0) 39114: issetugid() = 0 (0x0) 39114: openat(AT_FDCWD,"/etc/libmap32.conf",O_RDONLY|O_CLOEXEC,00) ERR#2 'No such file or directory' 39114: openat(AT_FDCWD,"/var/run/ld-elf32.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3) 39114: read(3,"Ehnt\^A\0\0\0\M^@\0\0\0#\0\0\0\0"...,128) = 128 (0x80) 39114: freebsd32_fstat(0x3,0xffffbd98) = 0 (0x0) 39114: freebsd32_pread(0x3,0x2042f000,0x23,0x80,0x0) = 35 (0x23) 39114: close(3) = 0 (0x0) 39114: openat(AT_FDCWD,"/usr/lib32/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3) 39114: freebsd32_fstat(0x3,0xffffc7d0) = 0 (0x0) 39114: freebsd32_mmap(0x0,0x1000,0x1,0x40002,0x3,0x0,0x0) = 541368320 (0x2044a000) After: 783: freebsd32_mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0) = 543543296 (0x2065d000) 783: freebsd32_ioctl(1,TIOCGETA,0xffffd7b0) = 0 (0x0) /usr/bin/ldd32: 783: write(1,"/usr/bin/ldd32:\n",16) = 16 (0x10) 784: 783: fork() = 784 (0x310) 784: freebsd32_execve("/usr/bin/ldd32",[ "(null)" ],[ "LD_32_TRACE_LOADED_OBJECTS_PROGNAME=/usr/bin/ldd32", "LD_TRACE_LOADED_OBJECTS_PROGNAME=/usr/bin/ldd32", "LD_32_TRACE_LOADED_OBJECTS=yes", "LD_TRACE_LOADED_OBJECTS=yes", "USER=root", "LOGNAME=root", "HOME=/root", "SHELL=/bin/csh", "BLOCKSIZE=K", "MAIL=/var/mail/root", "MM_CHARSET=UTF-8", "LANG=C.UTF-8", "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin", "TERM=vt100", "HOSTTYPE=FreeBSD", "VENDOR=amd", "OSTYPE=FreeBSD", "MACHTYPE=x86_64", "SHLVL=1", "PWD=/root", "GROUP=wheel", "HOST=freebsd-amd64", "EDITOR=vi", "PAGER=less" ]) EJUSTRETURN 784: freebsd32_mmap(0x0,135168,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 541212672 (0x20424000) 784: freebsd32_mprotect(0x20421000,4096,PROT_READ) = 0 (0x0) 784: issetugid() = 0 (0x0) 784: sigfastblock(0x1,0x204234fc) = 0 (0x0) 784: open("/etc/libmap32.conf",O_RDONLY|O_CLOEXEC,00) ERR#2 'No such file or directory' 784: open("/var/run/ld-elf32.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3) 784: read(3,"Ehnt\^A\0\0\0\M^@\0\0\0\v\0\0\0"...,128) = 128 (0x80) 784: freebsd32_fstat(3,{ mode=-r--r--r-- ,inode=18680,size=32768,blksize=0 }) = 0 (0x0) 784: freebsd32_pread(3,"/usr/lib32\0",11,0x80) = 11 (0xb) Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D27625 --- usr.bin/truss/setup.c | 71 ++++++++++++++++++++++++++++-------------------- usr.bin/truss/syscalls.c | 59 +++++++++++++++++++++++++++++----------- usr.bin/truss/truss.h | 2 ++ 3 files changed, 87 insertions(+), 45 deletions(-) diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c index 2ea1bce8919b..31c20d656b6a 100644 --- a/usr.bin/truss/setup.c +++ b/usr.bin/truss/setup.c @@ -74,59 +74,72 @@ static void new_proc(struct trussinfo *, pid_t, lwpid_t); static struct procabi cloudabi32 = { - "CloudABI32", - SYSDECODE_ABI_CLOUDABI32, - STAILQ_HEAD_INITIALIZER(cloudabi32.extra_syscalls), - { NULL } + .type = "CloudABI32", + .abi = SYSDECODE_ABI_CLOUDABI32, + .pointer_size = sizeof(uint32_t), + .extra_syscalls = STAILQ_HEAD_INITIALIZER(cloudabi32.extra_syscalls), + .syscalls = { NULL } }; static struct procabi cloudabi64 = { - "CloudABI64", - SYSDECODE_ABI_CLOUDABI64, - STAILQ_HEAD_INITIALIZER(cloudabi64.extra_syscalls), - { NULL } + .type = "CloudABI64", + .abi = SYSDECODE_ABI_CLOUDABI64, + .pointer_size = sizeof(uint64_t), + .extra_syscalls = STAILQ_HEAD_INITIALIZER(cloudabi64.extra_syscalls), + .syscalls = { NULL } }; static struct procabi freebsd = { - "FreeBSD", - SYSDECODE_ABI_FREEBSD, - STAILQ_HEAD_INITIALIZER(freebsd.extra_syscalls), - { NULL } + .type = "FreeBSD", + .abi = SYSDECODE_ABI_FREEBSD, + .pointer_size = sizeof(void *), + .extra_syscalls = STAILQ_HEAD_INITIALIZER(freebsd.extra_syscalls), + .syscalls = { NULL } }; -#ifdef __LP64__ +#if !defined(__SIZEOF_POINTER__) +#error "Use a modern compiler." +#endif + +#if __SIZEOF_POINTER__ > 4 static struct procabi freebsd32 = { - "FreeBSD32", - SYSDECODE_ABI_FREEBSD32, - STAILQ_HEAD_INITIALIZER(freebsd32.extra_syscalls), - { NULL } + .type = "FreeBSD32", + .abi = SYSDECODE_ABI_FREEBSD32, + .pointer_size = sizeof(uint32_t), + .compat_prefix = "freebsd32", + .extra_syscalls = STAILQ_HEAD_INITIALIZER(freebsd32.extra_syscalls), + .syscalls = { NULL } }; #endif static struct procabi linux = { - "Linux", - SYSDECODE_ABI_LINUX, - STAILQ_HEAD_INITIALIZER(linux.extra_syscalls), - { NULL } + .type = "Linux", + .abi = SYSDECODE_ABI_LINUX, + .pointer_size = sizeof(void *), + .extra_syscalls = STAILQ_HEAD_INITIALIZER(linux.extra_syscalls), + .syscalls = { NULL } }; -#ifdef __LP64__ +#if __SIZEOF_POINTER__ > 4 static struct procabi linux32 = { - "Linux32", - SYSDECODE_ABI_LINUX32, - STAILQ_HEAD_INITIALIZER(linux32.extra_syscalls), - { NULL } + .type = "Linux32", + .abi = SYSDECODE_ABI_LINUX32, + .pointer_size = sizeof(uint32_t), + .extra_syscalls = STAILQ_HEAD_INITIALIZER(linux32.extra_syscalls), + .syscalls = { NULL } }; #endif static struct procabi_table abis[] = { { "CloudABI ELF32", &cloudabi32 }, { "CloudABI ELF64", &cloudabi64 }, -#ifdef __LP64__ +#if __SIZEOF_POINTER__ == 4 + { "FreeBSD ELF32", &freebsd }, +#elif __SIZEOF_POINTER__ == 8 { "FreeBSD ELF64", &freebsd }, { "FreeBSD ELF32", &freebsd32 }, #else - { "FreeBSD ELF32", &freebsd }, +#error "Unsupported pointer size" #endif #if defined(__powerpc64__) { "FreeBSD ELF64 V2", &freebsd }, @@ -137,7 +150,7 @@ static struct procabi_table abis[] = { #if defined(__i386__) { "FreeBSD a.out", &freebsd }, #endif -#ifdef __LP64__ +#if __SIZEOF_POINTER__ >= 8 { "Linux ELF64", &linux }, { "Linux ELF32", &linux32 }, #else diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 91ddc65e457f..eaea3ad96765 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -963,7 +963,6 @@ print_mask_arg32(bool (*decoder)(FILE *, uint32_t, uint32_t *), FILE *fp, fprintf(fp, "|0x%x", rem); } -#ifndef __LP64__ /* * Add argument padding to subsequent system calls after Quad * syscall arguments as needed. This used to be done by hand in the @@ -1008,7 +1007,6 @@ quad_fixup(struct syscall_decode *sc) } } } -#endif static struct syscall * find_syscall(struct procabi *abi, u_int number) @@ -1029,10 +1027,13 @@ add_syscall(struct procabi *abi, u_int number, struct syscall *sc) { struct extra_syscall *es; -#ifndef __LP64__ - /* FIXME: should be based on syscall ABI not truss ABI */ - quad_fixup(&sc->decode); -#endif + /* + * quad_fixup() is currently needed for all 32-bit ABIs. + * TODO: This should probably be a function pointer inside struct + * procabi instead. + */ + if (abi->pointer_size == 4) + quad_fixup(&sc->decode); if (number < nitems(abi->syscalls)) { assert(abi->syscalls[number] == NULL); @@ -1055,16 +1056,19 @@ struct syscall * get_syscall(struct threadinfo *t, u_int number, u_int nargs) { struct syscall *sc; + struct procabi *procabi; const char *sysdecode_name; + const char *lookup_name; const char *name; u_int i; - sc = find_syscall(t->proc->abi, number); + procabi = t->proc->abi; + sc = find_syscall(procabi, number); if (sc != NULL) return (sc); /* Memory is not explicitly deallocated, it's released on exit(). */ - sysdecode_name = sysdecode_syscallname(t->proc->abi->abi, number); + sysdecode_name = sysdecode_syscallname(procabi->abi, number); if (sysdecode_name == NULL) asprintf(__DECONST(char **, &name), "#%d", number); else @@ -1073,8 +1077,14 @@ get_syscall(struct threadinfo *t, u_int number, u_int nargs) sc = calloc(1, sizeof(*sc)); sc->name = name; + /* Also decode compat syscalls arguments by stripping the prefix. */ + lookup_name = name; + if (procabi->compat_prefix != NULL && strncmp(procabi->compat_prefix, + name, strlen(procabi->compat_prefix)) == 0) + lookup_name += strlen(procabi->compat_prefix); + for (i = 0; i < nitems(decoded_syscalls); i++) { - if (strcmp(name, decoded_syscalls[i].name) == 0) { + if (strcmp(lookup_name, decoded_syscalls[i].name) == 0) { sc->decode = decoded_syscalls[i]; add_syscall(t->proc->abi, number, sc); return (sc); @@ -1817,12 +1827,15 @@ print_arg(struct syscall_arg *sc, unsigned long *args, register_t *retval, case StringArray: { uintptr_t addr; union { - char *strarray[0]; + int32_t strarray32[PAGE_SIZE / sizeof(int32_t)]; + int64_t strarray64[PAGE_SIZE / sizeof(int64_t)]; char buf[PAGE_SIZE]; } u; char *string; size_t len; u_int first, i; + size_t pointer_size = + trussinfo->curthread->proc->abi->pointer_size; /* * Only parse argv[] and environment arrays from exec calls @@ -1842,7 +1855,7 @@ print_arg(struct syscall_arg *sc, unsigned long *args, register_t *retval, * a partial page. */ addr = args[sc->offset]; - if (addr % sizeof(char *) != 0) { + if (addr % pointer_size != 0) { print_pointer(fp, args[sc->offset]); break; } @@ -1852,22 +1865,36 @@ print_arg(struct syscall_arg *sc, unsigned long *args, register_t *retval, print_pointer(fp, args[sc->offset]); break; } + assert(len > 0); fputc('[', fp); first = 1; i = 0; - while (u.strarray[i] != NULL) { - string = get_string(pid, (uintptr_t)u.strarray[i], 0); + for (;;) { + uintptr_t straddr; + if (pointer_size == 4) { + if (u.strarray32[i] == 0) + break; + /* sign-extend 32-bit pointers */ + straddr = (intptr_t)u.strarray32[i]; + } else if (pointer_size == 8) { + if (u.strarray64[i] == 0) + break; + straddr = (intptr_t)u.strarray64[i]; + } else { + errx(1, "Unsupported pointer size: %zu", + pointer_size); + } + string = get_string(pid, straddr, 0); fprintf(fp, "%s \"%s\"", first ? "" : ",", string); free(string); first = 0; i++; - if (i == len / sizeof(char *)) { + if (i == len / pointer_size) { addr += len; len = PAGE_SIZE; - if (get_struct(pid, addr, u.buf, len) == - -1) { + if (get_struct(pid, addr, u.buf, len) == -1) { fprintf(fp, ", "); break; } diff --git a/usr.bin/truss/truss.h b/usr.bin/truss/truss.h index 5154515848bf..a3ce8f27d953 100644 --- a/usr.bin/truss/truss.h +++ b/usr.bin/truss/truss.h @@ -58,6 +58,8 @@ struct extra_syscall { struct procabi { const char *type; enum sysdecode_abi abi; + size_t pointer_size; + const char *compat_prefix; STAILQ_HEAD(, extra_syscall) extra_syscalls; struct syscall *syscalls[SYSCALL_NORMAL_COUNT]; }; From owner-dev-commits-src-main@freebsd.org Thu Mar 25 12:07:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 740F55BB64A; Thu, 25 Mar 2021 12:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5kPy2scQz3FGc; Thu, 25 Mar 2021 12:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 555AF264FB; Thu, 25 Mar 2021 12:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12PC7oLZ018810; Thu, 25 Mar 2021 12:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PC7oVV018809; Thu, 25 Mar 2021 12:07:50 GMT (envelope-from git) Date: Thu, 25 Mar 2021 12:07:50 GMT Message-Id: <202103251207.12PC7oVV018809@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: 6f30d1c85146 - main - ng_macfilter_test: Skip rather than fail if there is no network 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: 6f30d1c851467d1f504f469a1b3a75a043ff070f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 12:07:50 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=6f30d1c851467d1f504f469a1b3a75a043ff070f commit 6f30d1c851467d1f504f469a1b3a75a043ff070f Author: Alex Richardson AuthorDate: 2021-03-25 11:14:46 +0000 Commit: Alex Richardson CommitDate: 2021-03-25 11:16:12 +0000 ng_macfilter_test: Skip rather than fail if there is no network This should bring the number of Jenkins failures from 4 down to 3. Locally kyua now prints `skipped: could not find a valid interface [0.115s]` when I run it in QEMU without a network device. Reviewed By: lwhsu MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29414 --- tests/sys/netgraph/ng_macfilter_test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/sys/netgraph/ng_macfilter_test.sh b/tests/sys/netgraph/ng_macfilter_test.sh index 482f32e5d335..85940e473951 100755 --- a/tests/sys/netgraph/ng_macfilter_test.sh +++ b/tests/sys/netgraph/ng_macfilter_test.sh @@ -235,8 +235,7 @@ test_title "Setting up system..." load_modules netgraph ng_socket ng_ether ng_macfilter ng_one2many eth=$(find_iface) if [ -z "$eth" ]; then - echo "1..1" - echo "not ok 1 - Could not find a valid interface" + echo "1..0 # SKIP could not find a valid interface" echo "Available interfaces:" ifconfig exit 1 From owner-dev-commits-src-main@freebsd.org Thu Mar 25 12:07:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05AD25BB812; Thu, 25 Mar 2021 12:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5kPz58c5z3F8W; Thu, 25 Mar 2021 12:07: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 97B2B26CC5; Thu, 25 Mar 2021 12:07: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 12PC7p6m018833; Thu, 25 Mar 2021 12:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PC7pug018832; Thu, 25 Mar 2021 12:07:51 GMT (envelope-from git) Date: Thu, 25 Mar 2021 12:07:51 GMT Message-Id: <202103251207.12PC7pug018832@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: dd5ed53a2f93 - main - RISC-V: Fix feenableexcept return value 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: dd5ed53a2f93a5a54efe96bed6bbd0f18b6bdbe2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 12:07:52 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=dd5ed53a2f93a5a54efe96bed6bbd0f18b6bdbe2 commit dd5ed53a2f93a5a54efe96bed6bbd0f18b6bdbe2 Author: Alex Richardson AuthorDate: 2021-03-25 11:15:41 +0000 Commit: Alex Richardson CommitDate: 2021-03-25 11:16:20 +0000 RISC-V: Fix feenableexcept return value The man page says "The feenableexcept(), fedisableexcept(), and fegetexcept() functions return a bitmap of the exceptions that were unmasked prior to the call.", so we should return zero not -1. Reviewed By: mhorne MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29386 --- lib/msun/riscv/fenv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msun/riscv/fenv.h b/lib/msun/riscv/fenv.h index 6c8c2861bc97..f5c56f73b229 100644 --- a/lib/msun/riscv/fenv.h +++ b/lib/msun/riscv/fenv.h @@ -231,7 +231,7 @@ feenableexcept(int __mask __unused) /* No exception traps. */ - return (-1); + return (0); } static inline int From owner-dev-commits-src-main@freebsd.org Thu Mar 25 12:07:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E37B5BB17E; Thu, 25 Mar 2021 12:07: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 4F5kQ12Xfwz3F45; Thu, 25 Mar 2021 12:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A956726AC6; Thu, 25 Mar 2021 12:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12PC7qWf018855; Thu, 25 Mar 2021 12:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PC7q1O018854; Thu, 25 Mar 2021 12:07:52 GMT (envelope-from git) Date: Thu, 25 Mar 2021 12:07:52 GMT Message-Id: <202103251207.12PC7q1O018854@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: 4fd0c6ab1a9e - main - Fix most shellcheck warnings in git-arc.sh 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: 4fd0c6ab1a9e3bfd7e52f64b9c301dfc9caa0627 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 12:07:54 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=4fd0c6ab1a9e3bfd7e52f64b9c301dfc9caa0627 commit 4fd0c6ab1a9e3bfd7e52f64b9c301dfc9caa0627 Author: Alex Richardson AuthorDate: 2021-03-25 11:17:30 +0000 Commit: Alex Richardson CommitDate: 2021-03-25 11:17:32 +0000 Fix most shellcheck warnings in git-arc.sh Mostly adding quotes and replacing egrep/fgrep with grep -E/grep -F Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D29373 --- tools/tools/git/git-arc.sh | 149 +++++++++++++++++++++++---------------------- 1 file changed, 75 insertions(+), 74 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index c3541e438c9f..53bf462eff18 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -34,7 +34,7 @@ warn() { - echo "$(basename $0): $1" >&2 + echo "$(basename "$0"): $1" >&2 } err() @@ -151,7 +151,7 @@ diff2phid() err "invalid diff ID $diff" fi - echo '{"names":["'$diff'"]}' | + echo '{"names":["'"$diff"'"]}' | arc call-conduit -- phid.lookup | jq -r "select(.response != []) | .response.${diff}.phid" } @@ -166,11 +166,11 @@ diff2status() fi tmp=$(mktemp) - echo '{"names":["'$diff'"]}' | - arc call-conduit -- phid.lookup > $tmp - status=$(jq -r "select(.response != []) | .response.${diff}.status" < $tmp) + 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) + .response.${diff}.fullName" < "$tmp") printf "%-14s %s\n" "${status}" "${summary}" } @@ -178,10 +178,10 @@ log2diff() { local diff - diff=$(git show -s --format=%B $commit | + 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 + if [ -n "$diff" ] && [ "$(echo "$diff" | wc -l)" -eq 1 ]; then + echo "$diff" else echo fi @@ -195,23 +195,23 @@ commit2diff() # First, look for a valid differential reference in the commit # log. - diff=$(log2diff $commit) + diff=$(log2diff "$commit") if [ -n "$diff" ]; then - echo $diff + 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 ':') + title=$(git show -s --format=%s "$commit") + diff=$(arc list | grep -F "$title" | grep -E -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 + elif [ "$(echo "$diff" | wc -l)" -ne 1 ]; then err "found multiple reviews with the same title" fi - echo $diff + echo "$diff" } create_one_review() @@ -225,61 +225,61 @@ create_one_review() parent=$4 doprompt=$5 - if [ "$doprompt" ] && ! show_and_prompt $commit; then + if [ "$doprompt" ] && ! show_and_prompt "$commit"; then return 1 fi - git checkout -q $commit + git checkout -q "$commit" msg=$(mktemp) - 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 + git show -s --format='%B' "$commit" > "$msg" + printf "\nTest Plan:\n" >> "$msg" + printf "\nReviewers:\n" >> "$msg" + printf "%s\n" "${reviewers}" >> "$msg" + printf "\nSubscribers:\n" >> "$msg" + printf "%s\n" "${subscribers}" >> "$msg" yes | env EDITOR=true \ - arc diff --message-file $msg --never-apply-patches --create --allow-untracked $BROWSE HEAD~ + arc diff --message-file "$msg" --never-apply-patches --create --allow-untracked $BROWSE HEAD~ [ $? -eq 0 ] || err "could not create Phabricator diff" if [ -n "$parent" ]; then - diff=$(commit2diff $commit) + diff=$(commit2diff "$commit") [ -n "$diff" ] || err "failed to look up review ID for $commit" - childphid=$(diff2phid $diff) - parentphid=$(diff2phid $parent) + childphid=$(diff2phid "$diff") + parentphid=$(diff2phid "$parent") echo '{ - "objectIdentifier": "'${childphid}'", + "objectIdentifier": "'"${childphid}"'", "transactions": [ { "type": "parents.add", - "value": ["'${parentphid}'"] + "value": ["'"${parentphid}"'"] } ]}' | arc call-conduit -- differential.revision.edit >&3 fi - rm -f $msg + rm -f "$msg" return 0 } # Get a list of reviewers who accepted the specified diff. diff2reviewers() { - local diff phid reviewid userids + local diff reviewid userids diff=$1 - reviewid=$(diff2phid $diff) + reviewid=$(diff2phid "$diff") userids=$( \ echo '{ - "constraints": {"phids": ["'$reviewid'"]}, + "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:]' ',')']} + "constraints": {"phids": ['"$(echo -n "$userids" | tr '[:space:]' ',')"']} }' | arc call-conduit -- user.search | jq -r '.response.data[].fields.username' @@ -295,7 +295,7 @@ prompt() fi printf "\nDoes this look OK? [y/N] " - read resp + read -r resp case $resp in [Yy]) @@ -313,7 +313,7 @@ show_and_prompt() commit=$1 - git show $commit + git show "$commit" prompt } @@ -330,7 +330,7 @@ save_head() restore_head() { if [ -n "$SAVED_HEAD" ]; then - git checkout -q $SAVED_HEAD + git checkout -q "$SAVED_HEAD" SAVED_HEAD= fi } @@ -339,15 +339,15 @@ build_commit_list() { local chash _commits commits - for chash in $@; do + 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) + _commits=$(git rev-list "$_commits" | tail -r) fi [ -n "$_commits" ] || err "invalid commit ID ${chash}" commits="$commits $_commits" done - echo $commits + echo "$commits" } gitarc::create() @@ -355,7 +355,7 @@ gitarc::create() local commit commits doprompt list o prev reviewers subscribers list= - if eval $(git config --bool --default false --get arc.list); then + if [ "$(git config --bool --default false --get arc.list)" != "false" ]; then list=1 fi doprompt=1 @@ -377,11 +377,11 @@ gitarc::create() done shift $((OPTIND-1)) - commits=$(build_commit_list $@) + commits=$(build_commit_list "$@") if [ "$list" ]; then for commit in ${commits}; do - git --no-pager show --oneline --no-patch $commit + git --no-pager show --oneline --no-patch "$commit" done | git_pager if ! prompt; then return @@ -406,28 +406,28 @@ gitarc::list() { local chash commit commits diff title - commits=$(build_commit_list $@) + commits=$(build_commit_list "$@") for commit in $commits; do - chash=$(git show -s --format='%C(auto)%h' $commit) + chash=$(git show -s --format='%C(auto)%h' "$commit") echo -n "${chash} " - diff=$(log2diff $commit) + diff=$(log2diff "$commit") if [ -n "$diff" ]; then - diff2status $diff + 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) + title=$(git show -s --format=%s "$commit") + diff=$(arc list | grep -F "$title" | cat) if [ -z "$diff" ]; then echo "No Review : $title" - elif [ $(echo "$diff" | wc -l) -ne 1 ]; then + elif [ "$(echo "$diff" | wc -l)" -ne 1 ]; then echo -n "Ambiguous Reviews: " - echo "$diff" | egrep -o 'D[1-9][0-9]*:' | tr -d ':' \ + echo "$diff" | grep -E -o 'D[1-9][0-9]*:' | tr -d ':' \ | paste -sd ',' - | sed 's/,/, /g' else echo "$diff" | sed -e 's/^[^ ]* *//' @@ -443,8 +443,8 @@ gitarc::patch() err_usage fi - for rev in $@; do - arc patch --skip-dependencies --nocommit --nobranch --force $rev + for rev in "$@"; do + arc patch --skip-dependencies --nocommit --nobranch --force "$rev" echo "Applying ${rev}..." [ $? -eq 0 ] || break done @@ -467,34 +467,34 @@ gitarc::stage() done shift $((OPTIND-1)) - commits=$(build_commit_list $@) + commits=$(build_commit_list "$@") if [ "$branch" = "main" ]; then git checkout -q main else - git checkout -q -b ${branch} main + 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 ':') + git show -s --format=%B "$commit" > "$tmp" + diff=$(arc list | grep -F "$(git show -s --format=%s "$commit")" | + grep -E -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') + reviewers=$(diff2reviewers "$diff" | sed '/^$/d' | paste -sd ',' - | sed 's/,/, /g') if [ -n "$reviewers" ]; then - printf "Reviewed by:\t${reviewers}\n" >> $tmp + printf "Reviewed by:\t%s\n" "${reviewers}" >> "$tmp" fi - printf "Differential Revision:\thttps://reviews.freebsd.org/${diff}" >> $tmp + printf "Differential Revision:\thttps://reviews.freebsd.org/%s" "${diff}" >> "$tmp" fi - author=$(git show -s --format='%an <%ae>' ${commit}) - 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?" + author=$(git show -s --format='%an <%ae>' "${commit}") + 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 --author "${author}" + git commit --edit --file "$tmp" --author "${author}" done } @@ -502,21 +502,21 @@ gitarc::update() { local commit commits diff - commits=$(build_commit_list $@) + commits=$(build_commit_list "$@") save_head for commit in ${commits}; do - diff=$(commit2diff $commit) + diff=$(commit2diff "$commit") - if ! show_and_prompt $commit; then + if ! show_and_prompt "$commit"; then break fi - git checkout -q $commit + 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~ + arc diff --allow-untracked --never-apply-patches --update "$diff" HEAD~ done restore_head } @@ -524,7 +524,7 @@ gitarc::update() set -e ASSUME_YES= -if eval $(git config --bool --default false --get arc.assume-yes); then +if [ "$(git config --bool --default false --get arc.assume-yes)" != "false" ]; then ASSUME_YES=1 fi @@ -575,6 +575,7 @@ git_sh_setup=$(git --exec-path)/git-sh-setup [ -f "$git_sh_setup" ] || err "cannot find git-sh-setup" SUBDIRECTORY_OK=y USAGE= +# shellcheck disable=SC1090 . "$git_sh_setup" # Bail if the working tree is unclean, except for "list" and "patch" @@ -583,14 +584,14 @@ case $verb in list|patch) ;; *) - require_clean_work_tree $verb + require_clean_work_tree "$verb" ;; esac -if eval $(git config --bool --default false --get arc.browse); then +if [ "$(git config --bool --default false --get arc.browse)" != "false" ]; then BROWSE=--browse fi trap restore_head EXIT INT -gitarc::${verb} $@ +gitarc::"${verb}" "$@" From owner-dev-commits-src-main@freebsd.org Thu Mar 25 12:07:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6F255BB814; Thu, 25 Mar 2021 12:07: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 4F5kQ31j2Xz3F4J; Thu, 25 Mar 2021 12:07: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 CC8B826DC9; Thu, 25 Mar 2021 12: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 12PC7reT018873; Thu, 25 Mar 2021 12: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 12PC7rhi018872; Thu, 25 Mar 2021 12:07:53 GMT (envelope-from git) Date: Thu, 25 Mar 2021 12:07:53 GMT Message-Id: <202103251207.12PC7rhi018872@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: 142cb88bc68d - main - git-arc.sh: Make it compatible with Ubuntu 18.04 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: 142cb88bc68d59e1993dc3364a673ae01cf6899b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 12:07:56 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=142cb88bc68d59e1993dc3364a673ae01cf6899b commit 142cb88bc68d59e1993dc3364a673ae01cf6899b Author: Alex Richardson AuthorDate: 2021-03-25 11:17:56 +0000 Commit: Alex Richardson CommitDate: 2021-03-25 11:17:58 +0000 git-arc.sh: Make it compatible with Ubuntu 18.04 dash does not allow function names containing a ":", so replace it with a '_'. Additionally, Ubunutu 18.04 ships git 2.17 which does not support the `--default false` flag for git config. Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D29374 --- tools/tools/git/git-arc.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index 53bf462eff18..82a549e0868f 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -350,12 +350,12 @@ build_commit_list() echo "$commits" } -gitarc::create() +gitarc__create() { local commit commits doprompt list o prev reviewers subscribers list= - if [ "$(git config --bool --default false --get arc.list)" != "false" ]; then + if [ "$(git config --bool --get arc.list 2>/dev/null || echo false)" != "false" ]; then list=1 fi doprompt=1 @@ -402,7 +402,7 @@ gitarc::create() restore_head } -gitarc::list() +gitarc__list() { local chash commit commits diff title @@ -435,7 +435,7 @@ gitarc::list() done } -gitarc::patch() +gitarc__patch() { local rev @@ -450,7 +450,7 @@ gitarc::patch() done } -gitarc::stage() +gitarc__stage() { local author branch commit commits diff reviewers tmp @@ -498,7 +498,7 @@ gitarc::stage() done } -gitarc::update() +gitarc__update() { local commit commits diff @@ -524,7 +524,7 @@ gitarc::update() set -e ASSUME_YES= -if [ "$(git config --bool --default false --get arc.assume-yes)" != "false" ]; then +if [ "$(git config --bool --get arc.assume-yes 2>/dev/null || echo false)" != "false" ]; then ASSUME_YES=1 fi @@ -588,10 +588,10 @@ list|patch) ;; esac -if [ "$(git config --bool --default false --get arc.browse)" != "false" ]; then +if [ "$(git config --bool --get arc.browse 2>/dev/null || echo false)" != "false" ]; then BROWSE=--browse fi trap restore_head EXIT INT -gitarc::"${verb}" "$@" +gitarc__"${verb}" "$@" From owner-dev-commits-src-main@freebsd.org Thu Mar 25 12:07:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F94B5BB656; Thu, 25 Mar 2021 12:07: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 4F5kQ43tyBz3F6V; Thu, 25 Mar 2021 12:07: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 D6CF226DCA; Thu, 25 Mar 2021 12:07: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 12PC7shd018895; Thu, 25 Mar 2021 12:07:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PC7s7H018894; Thu, 25 Mar 2021 12:07:54 GMT (envelope-from git) Date: Thu, 25 Mar 2021 12:07:54 GMT Message-Id: <202103251207.12PC7s7H018894@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: 5245bf7b92b7 - main - lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotations 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: 5245bf7b92b74e556527b4916a8deba386fe5772 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 12:07:57 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=5245bf7b92b74e556527b4916a8deba386fe5772 commit 5245bf7b92b74e556527b4916a8deba386fe5772 Author: Alex Richardson AuthorDate: 2021-03-25 11:22:10 +0000 Commit: Alex Richardson CommitDate: 2021-03-25 11:22:10 +0000 lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotations The error cases (goto fin) of _nsdispatch were missing the unlock. This change also drops the checks for __isthreaded since the pthread stubs are already no-ops if threads are not being used. Dropping those conditionals allows clang's thread safety analysis to deal with the file and also makes the code a bit more readable. While touching the file also add a few more assertions in debug mode that the right locks are held. Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D29372 --- lib/libc/net/nsdispatch.c | 201 +++++++++++++++++++++++++++++----------------- 1 file changed, 129 insertions(+), 72 deletions(-) diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c index b0f80d079b0b..d504a86d524b 100644 --- a/lib/libc/net/nsdispatch.c +++ b/lib/libc/net/nsdispatch.c @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -76,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -97,7 +99,52 @@ enum _nss_constants { * Global NSS data structures are mostly read-only, but we update * them when we read or re-read the nsswitch.conf. */ -static pthread_rwlock_t nss_lock = PTHREAD_RWLOCK_INITIALIZER; +static pthread_rwlock_t nss_lock = PTHREAD_RWLOCK_INITIALIZER; +#ifndef NDEBUG +static void *nss_wlock_owner __guarded_by(nss_lock); +#endif + +static inline /* __lock_annotate(locks_excluded(nss_lock)) */ +__locks_exclusive(nss_lock) int +nss_wlock(void) +{ + int err; + + err = _pthread_rwlock_wrlock(&nss_lock); +#ifndef NDEBUG + assert(nss_wlock_owner == NULL); + nss_wlock_owner = _pthread_self(); +#endif + assert(err == 0 && "Locking should not have failed!"); + return (err); +} + +/* + * XXX: The manpage says already held lock may result in EDEADLK, but + * actually libthr returns always EBUSY, so we need the extra owner + * variable for assertions. + */ +#define ASSERT_NSS_WLOCK_HELD() \ + do { \ + if (__isthreaded) { \ + assert(_pthread_rwlock_trywrlock(&nss_lock) == EBUSY); \ + assert(nss_wlock_owner == _pthread_self()); \ + } \ + } while (0) + +static inline __requires_exclusive(nss_lock) __unlocks(nss_lock) int +nss_wunlock(void) +{ + int err; + + ASSERT_NSS_WLOCK_HELD(); +#ifndef NDEBUG + nss_wlock_owner = NULL; +#endif + err = _pthread_rwlock_unlock(&nss_lock); + assert(err == 0 && "Unlocking should not have failed!"); + return (err); +} /* * Runtime determination of whether we are dynamically linked or not. @@ -114,12 +161,12 @@ const ns_src __nsdefaultsrc[] = { }; /* Database, source mappings. */ -static unsigned int _nsmapsize; -static ns_dbt *_nsmap = NULL; +static unsigned int _nsmapsize __guarded_by(nss_lock); +static ns_dbt *_nsmap __guarded_by(nss_lock); /* NSS modules. */ -static unsigned int _nsmodsize; -static ns_mod *_nsmod; +static unsigned int _nsmodsize __guarded_by(nss_lock); +static ns_mod *_nsmod __guarded_by(nss_lock); /* Placeholder for builtin modules' dlopen `handle'. */ static int __nss_builtin_handle; @@ -166,8 +213,7 @@ typedef int (*vector_comparison)(const void *, const void *); typedef void (*vector_free_elem)(void *); static void vector_sort(void *, unsigned int, size_t, vector_comparison); -static void vector_free(void *, unsigned int *, size_t, - vector_free_elem); +static void _vector_free(void *, unsigned int, size_t, vector_free_elem); static void *vector_ref(unsigned int, void *, unsigned int, size_t); static void *vector_search(const void *, void *, unsigned int, size_t, vector_comparison); @@ -238,22 +284,24 @@ vector_ref(unsigned int i, void *vec, unsigned int count, size_t esize) } -#define VECTOR_FREE(v, c, s, f) \ - do { vector_free(v, c, s, f); v = NULL; } while (0) +#define VECTOR_FREE(vec, count, es, fe) do { \ + _vector_free(vec, count, es, fe); \ + vec = NULL; \ + count = 0; \ +} while (0) static void -vector_free(void *vec, unsigned int *count, size_t esize, +_vector_free(void *vec, unsigned int count, size_t esize, vector_free_elem free_elem) { unsigned int i; void *elem; - for (i = 0; i < *count; i++) { - elem = vector_ref(i, vec, *count, esize); + for (i = 0; i < count; i++) { + elem = vector_ref(i, vec, count, esize); if (elem != NULL) free_elem(elem); } free(vec); - *count = 0; } /* @@ -282,13 +330,14 @@ mtab_compare(const void *a, const void *b) /* * NSS nsmap management. */ -void +__requires_exclusive(nss_lock) void _nsdbtaddsrc(ns_dbt *dbt, const ns_src *src) { const ns_mod *modp; - dbt->srclist = vector_append(src, dbt->srclist, &dbt->srclistsize, - sizeof(*src)); + ASSERT_NSS_WLOCK_HELD(); + dbt->srclist = vector_append(src, dbt->srclist, + (unsigned int *)&dbt->srclistsize, sizeof(*src)); modp = vector_search(&src->name, _nsmod, _nsmodsize, sizeof(*_nsmod), string_compare); if (modp == NULL) @@ -325,26 +374,28 @@ _nsdbtdump(const ns_dbt *dbt) } #endif +#ifndef NS_REREAD_CONF +static int __guarded_by(nss_lock) already_initialized = 0; +#endif /* * The first time nsdispatch is called (during a process's lifetime, * or after nsswitch.conf has been updated), nss_configure will * prepare global data needed by NSS. */ -static int -nss_configure(void) +static __requires_shared(nss_lock) int +__lock_annotate(no_thread_safety_analysis) /* RWLock upgrade not supported. */ +do_nss_configure(void) { - static time_t confmod; - static int already_initialized = 0; + static time_t __guarded_by(nss_lock) confmod = 0; struct stat statbuf; - int result, isthreaded; + int result; const char *path; #ifdef NS_CACHING void *handle; #endif result = 0; - isthreaded = __isthreaded; #if defined(_NSS_DEBUG) && defined(_NSS_SHOOT_FOOT) /* NOTE WELL: THIS IS A SECURITY HOLE. This must only be built * for debugging purposes and MUST NEVER be used in production. @@ -353,36 +404,33 @@ nss_configure(void) if (path == NULL) #endif path = _PATH_NS_CONF; + + result = _pthread_rwlock_unlock(&nss_lock); + if (result != 0) + return (result); + result = nss_wlock(); + if (result != 0) + return (result); #ifndef NS_REREAD_CONF /* - * Define NS_REREAD_CONF to have nsswitch notice changes - * to nsswitch.conf(5) during runtime. This involves calling - * stat(2) every time, which can result in performance hit. + * Another thread could have already run the initialization + * logic while we were waiting for the write lock. Check + * already_initialized to avoid re-initializing. */ if (already_initialized) - return (0); - already_initialized = 1; + goto fin; #endif /* NS_REREAD_CONF */ + ASSERT_NSS_WLOCK_HELD(); if (stat(path, &statbuf) != 0) - return (0); + goto fin; if (statbuf.st_mtime <= confmod) - return (0); - if (isthreaded) { - (void)_pthread_rwlock_unlock(&nss_lock); - result = _pthread_rwlock_wrlock(&nss_lock); - if (result != 0) - return (result); - if (stat(path, &statbuf) != 0) - goto fin; - if (statbuf.st_mtime <= confmod) - goto fin; - } + goto fin; _nsyyin = fopen(path, "re"); if (_nsyyin == NULL) goto fin; - VECTOR_FREE(_nsmap, &_nsmapsize, sizeof(*_nsmap), + VECTOR_FREE(_nsmap, _nsmapsize, sizeof(*_nsmap), (vector_free_elem)ns_dbt_free); - VECTOR_FREE(_nsmod, &_nsmodsize, sizeof(*_nsmod), + VECTOR_FREE(_nsmod, _nsmodsize, sizeof(*_nsmod), (vector_free_elem)ns_mod_free); if (confmod == 0) (void)atexit(nss_atexit); @@ -400,22 +448,42 @@ nss_configure(void) dlclose(handle); } #endif +#ifndef NS_REREAD_CONF + already_initialized = 1; +#endif fin: - if (isthreaded) { - (void)_pthread_rwlock_unlock(&nss_lock); - if (result == 0) - result = _pthread_rwlock_rdlock(&nss_lock); - } + result = nss_wunlock(); + if (result == 0) + result = _pthread_rwlock_rdlock(&nss_lock); + return (result); +} + +static __requires_shared(nss_lock) int +nss_configure(void) +{ + int result; +#ifndef NS_REREAD_CONF + /* + * Define NS_REREAD_CONF to have nsswitch notice changes + * to nsswitch.conf(5) during runtime. This involves calling + * stat(2) every time, which can result in performance hit. + */ + if (already_initialized) + return (0); +#endif /* NS_REREAD_CONF */ + result = do_nss_configure(); return (result); } -void +__requires_exclusive(nss_lock) void _nsdbtput(const ns_dbt *dbt) { unsigned int i; ns_dbt *p; + ASSERT_NSS_WLOCK_HELD(); + for (i = 0; i < _nsmapsize; i++) { p = vector_ref(i, _nsmap, _nsmapsize, sizeof(*_nsmap)); if (string_compare(&dbt->name, &p->name) == 0) { @@ -478,13 +546,15 @@ nss_load_builtin_modules(void) * argument is non-NULL, assume a built-in module and use reg_fn to * register it. Otherwise, search for a dynamic NSS module. */ -static void +static __requires_exclusive(nss_lock) void nss_load_module(const char *source, nss_module_register_fn reg_fn) { char buf[PATH_MAX]; ns_mod mod; nss_module_register_fn fn; + ASSERT_NSS_WLOCK_HELD(); + memset(&mod, 0, sizeof(mod)); mod.name = strdup(source); if (mod.name == NULL) { @@ -548,9 +618,9 @@ fin: vector_sort(_nsmod, _nsmodsize, sizeof(*_nsmod), string_compare); } -static int exiting = 0; +static int exiting __guarded_by(nss_lock) = 0; -static void +static __requires_exclusive(nss_lock) void ns_mod_free(ns_mod *mod) { @@ -569,24 +639,19 @@ ns_mod_free(ns_mod *mod) static void nss_atexit(void) { - int isthreaded; - + (void)nss_wlock(); exiting = 1; - isthreaded = __isthreaded; - if (isthreaded) - (void)_pthread_rwlock_wrlock(&nss_lock); - VECTOR_FREE(_nsmap, &_nsmapsize, sizeof(*_nsmap), + VECTOR_FREE(_nsmap, _nsmapsize, sizeof(*_nsmap), (vector_free_elem)ns_dbt_free); - VECTOR_FREE(_nsmod, &_nsmodsize, sizeof(*_nsmod), + VECTOR_FREE(_nsmod, _nsmapsize, sizeof(*_nsmod), (vector_free_elem)ns_mod_free); - if (isthreaded) - (void)_pthread_rwlock_unlock(&nss_lock); + (void)nss_wunlock(); } /* * Finally, the actual implementation. */ -static nss_method +static __requires_shared(nss_lock) nss_method nss_method_lookup(const char *source, const char *database, const char *method, const ns_dtab disp_tab[], void **mdata) { @@ -625,7 +690,7 @@ fb_endstate(void *p) __weak_reference(_nsdispatch, nsdispatch); -int +__requires_unlocked(nss_lock) int _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, const char *method_name, const ns_src defaults[], ...) { @@ -634,7 +699,7 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, const ns_src *srclist; nss_method method, fb_method; void *mdata; - int isthreaded, serrno, i, result, srclistsize; + int serrno, i, result, srclistsize; struct fb_state *st; int saved_depth; @@ -647,15 +712,8 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, dbt = NULL; fb_method = NULL; - isthreaded = __isthreaded; serrno = errno; - if (isthreaded) { - result = _pthread_rwlock_rdlock(&nss_lock); - if (result != 0) { - result = NS_UNAVAIL; - goto fin; - } - } + (void)_pthread_rwlock_rdlock(&nss_lock); result = fb_getstate(&st); if (result != 0) { @@ -774,10 +832,9 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, } #endif /* NS_CACHING */ - if (isthreaded) - (void)_pthread_rwlock_unlock(&nss_lock); --st->dispatch_depth; fin: + (void)_pthread_rwlock_unlock(&nss_lock); errno = serrno; return (result); } From owner-dev-commits-src-main@freebsd.org Thu Mar 25 14:44:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC0435BF89F; Thu, 25 Mar 2021 14:44: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 4F5ntX519qz3Qxd; Thu, 25 Mar 2021 14:44: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 9EF4AF3E; Thu, 25 Mar 2021 14:44: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 12PEiKXI042772; Thu, 25 Mar 2021 14:44:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PEiK8x042771; Thu, 25 Mar 2021 14:44:20 GMT (envelope-from git) Date: Thu, 25 Mar 2021 14:44:20 GMT Message-Id: <202103251444.12PEiK8x042771@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: f073ab8712a0 - main - mpsutil.8: fix typos in the man page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f073ab8712a032faecf1fb94c4491fd555461ad8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 14:44:20 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f073ab8712a032faecf1fb94c4491fd555461ad8 commit f073ab8712a032faecf1fb94c4491fd555461ad8 Author: Alan Somers AuthorDate: 2021-03-25 14:43:40 +0000 Commit: Alan Somers CommitDate: 2021-03-25 14:43:40 +0000 mpsutil.8: fix typos in the man page MFC after: 2 weeks Sponsored by: Axcient --- usr.sbin/mpsutil/mpsutil.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/mpsutil/mpsutil.8 b/usr.sbin/mpsutil/mpsutil.8 index e4f966355fdd..1dd4f0509174 100644 --- a/usr.sbin/mpsutil/mpsutil.8 +++ b/usr.sbin/mpsutil/mpsutil.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2015 +.Dd March 25, 2021 .Dt MPSUTIL 8 .Os .Sh NAME @@ -45,7 +45,7 @@ .Cm show all .Nm .Op Fl u Ar unit -.Cm show cfgpages page +.Cm show cfgpage page .Op Ar num .Op Ar addr .Nm @@ -129,7 +129,7 @@ Displays all enclosures. .It Cm show iocfacts Displays IOC Facts messages. .It Cm show cfgpage page Oo Ar num Oc Op Ar addr -Show IOC Facts Message +Dump raw config page in hex. .El .Pp Controller management commands include: From owner-dev-commits-src-main@freebsd.org Thu Mar 25 15:47:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A3445C2310; Thu, 25 Mar 2021 15:47: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 4F5qHZ0gMLz3mgj; Thu, 25 Mar 2021 15:47: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 04ADB1A45; Thu, 25 Mar 2021 15:47: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 12PFlbcb026919; Thu, 25 Mar 2021 15:47:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PFlbeX026917; Thu, 25 Mar 2021 15:47:37 GMT (envelope-from git) Date: Thu, 25 Mar 2021 15:47:37 GMT Message-Id: <202103251547.12PFlbeX026917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: b6c1fdcdf503 - main - OpenSSL: Merge OpenSSL 1.1.1k MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6c1fdcdf5033d20c61cc77d66f58f31cc65e2ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 15:47:38 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=b6c1fdcdf5033d20c61cc77d66f58f31cc65e2ba commit b6c1fdcdf5033d20c61cc77d66f58f31cc65e2ba Merge: f073ab8712a0 94fa08a4bcdf Author: Jung-uk Kim AuthorDate: 2021-03-25 15:45:19 +0000 Commit: Jung-uk Kim CommitDate: 2021-03-25 15:45:19 +0000 OpenSSL: Merge OpenSSL 1.1.1k Merge commit '94fa08a4bcdfbb3434b025d67d014af3b18e5380' crypto/openssl/CHANGES | 44 ++++++++++++++++++++++++++++ crypto/openssl/NEWS | 8 +++++ crypto/openssl/README | 4 +-- crypto/openssl/apps/s_cb.c | 5 ++-- crypto/openssl/apps/s_time.c | 5 ++-- crypto/openssl/crypto/asn1/asn1_par.c | 3 +- crypto/openssl/crypto/asn1/bio_ndef.c | 4 ++- crypto/openssl/crypto/engine/eng_devcrypto.c | 17 +++++++++-- crypto/openssl/crypto/evp/evp_enc.c | 2 +- crypto/openssl/crypto/modes/cbc128.c | 8 +++-- crypto/openssl/crypto/modes/gcm128.c | 6 ++-- crypto/openssl/crypto/o_time.c | 6 ++-- crypto/openssl/crypto/rand/rand_lib.c | 8 +++-- crypto/openssl/crypto/rsa/rsa_ssl.c | 2 +- crypto/openssl/crypto/x509/x509_vfy.c | 12 +++++--- crypto/openssl/include/openssl/opensslv.h | 6 ++-- crypto/openssl/ssl/s3_lib.c | 7 +++-- crypto/openssl/ssl/ssl_lib.c | 16 +++++++--- crypto/openssl/ssl/statem/extensions.c | 4 +++ crypto/openssl/ssl/statem/extensions_clnt.c | 16 ++++++++-- crypto/openssl/ssl/statem/statem_clnt.c | 8 ++++- crypto/openssl/ssl/statem/statem_srvr.c | 19 +++++++++--- 22 files changed, 166 insertions(+), 44 deletions(-) diff --cc crypto/openssl/CHANGES index a4a63a9bea22,000000000000..7f8057bb6f0a mode 100644,000000..100644 --- a/crypto/openssl/CHANGES +++ b/crypto/openssl/CHANGES @@@ -1,13566 -1,0 +1,13610 @@@ + + OpenSSL CHANGES + _______________ + + This is a high-level summary of the most important changes. + For a full list of changes, see the git commit log; for example, + https://github.com/openssl/openssl/commits/ and pick the appropriate + release branch. + ++ Changes between 1.1.1j and 1.1.1k [25 Mar 2021] ++ ++ *) Fixed a problem with verifying a certificate chain when using the ++ X509_V_FLAG_X509_STRICT flag. This flag enables additional security checks ++ of the certificates present in a certificate chain. It is not set by ++ default. ++ ++ Starting from OpenSSL version 1.1.1h a check to disallow certificates in ++ the chain that have explicitly encoded elliptic curve parameters was added ++ as an additional strict check. ++ ++ An error in the implementation of this check meant that the result of a ++ previous check to confirm that certificates in the chain are valid CA ++ certificates was overwritten. This effectively bypasses the check ++ that non-CA certificates must not be able to issue other certificates. ++ ++ If a "purpose" has been configured then there is a subsequent opportunity ++ for checks that the certificate is a valid CA. All of the named "purpose" ++ values implemented in libcrypto perform this check. Therefore, where ++ a purpose is set the certificate chain will still be rejected even when the ++ strict flag has been used. A purpose is set by default in libssl client and ++ server certificate verification routines, but it can be overridden or ++ removed by an application. ++ ++ In order to be affected, an application must explicitly set the ++ X509_V_FLAG_X509_STRICT verification flag and either not set a purpose ++ for the certificate verification or, in the case of TLS client or server ++ applications, override the default purpose. ++ (CVE-2021-3450) ++ [Tomáš Mráz] ++ ++ *) Fixed an issue where an OpenSSL TLS server may crash if sent a maliciously ++ crafted renegotiation ClientHello message from a client. If a TLSv1.2 ++ renegotiation ClientHello omits the signature_algorithms extension (where ++ it was present in the initial ClientHello), but includes a ++ signature_algorithms_cert extension then a NULL pointer dereference will ++ result, leading to a crash and a denial of service attack. ++ ++ A server is only vulnerable if it has TLSv1.2 and renegotiation enabled ++ (which is the default configuration). OpenSSL TLS clients are not impacted ++ by this issue. ++ (CVE-2021-3449) ++ [Peter Kästle and Samuel Sapalski] ++ + Changes between 1.1.1i and 1.1.1j [16 Feb 2021] + + *) Fixed the X509_issuer_and_serial_hash() function. It attempts to + create a unique hash value based on the issuer and serial number data + contained within an X509 certificate. However it was failing to correctly + handle any errors that may occur while parsing the issuer field (which might + occur if the issuer field is maliciously constructed). This may subsequently + result in a NULL pointer deref and a crash leading to a potential denial of + service attack. + (CVE-2021-23841) + [Matt Caswell] + + *) Fixed the RSA_padding_check_SSLv23() function and the RSA_SSLV23_PADDING + padding mode to correctly check for rollback attacks. This is considered a + bug in OpenSSL 1.1.1 because it does not support SSLv2. In 1.0.2 this is + CVE-2021-23839. + [Matt Caswell] + + *) Fixed the EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate + functions. Previously they could overflow the output length argument in some + cases where the input length is close to the maximum permissable length for + an integer on the platform. In such cases the return value from the function + call would be 1 (indicating success), but the output length value would be + negative. This could cause applications to behave incorrectly or crash. + (CVE-2021-23840) + [Matt Caswell] + + *) Fixed SRP_Calc_client_key so that it runs in constant time. The previous + implementation called BN_mod_exp without setting BN_FLG_CONSTTIME. This + could be exploited in a side channel attack to recover the password. Since + the attack is local host only this is outside of the current OpenSSL + threat model and therefore no CVE is assigned. + + Thanks to Mohammed Sabt and Daniel De Almeida Braga for reporting this + issue. + [Matt Caswell] + + Changes between 1.1.1h and 1.1.1i [8 Dec 2020] + + *) Fixed NULL pointer deref in the GENERAL_NAME_cmp function + This function could crash if both GENERAL_NAMEs contain an EDIPARTYNAME. + If an attacker can control both items being compared then this could lead + to a possible denial of service attack. OpenSSL itself uses the + GENERAL_NAME_cmp function for two purposes: + 1) Comparing CRL distribution point names between an available CRL and a + CRL distribution point embedded in an X509 certificate + 2) When verifying that a timestamp response token signer matches the + timestamp authority name (exposed via the API functions + TS_RESP_verify_response and TS_RESP_verify_token) + (CVE-2020-1971) + [Matt Caswell] + + *) Add support for Apple Silicon M1 Macs with the darwin64-arm64-cc target. + [Stuart Carnie] + + *) The security callback, which can be customised by application code, supports + the security operation SSL_SECOP_TMP_DH. This is defined to take an EVP_PKEY + in the "other" parameter. In most places this is what is passed. All these + places occur server side. However there was one client side call of this + security operation and it passed a DH object instead. This is incorrect + according to the definition of SSL_SECOP_TMP_DH, and is inconsistent with all + of the other locations. Therefore this client side call has been changed to + pass an EVP_PKEY instead. + [Matt Caswell] + + *) In 1.1.1h, an expired trusted (root) certificate was not anymore rejected + when validating a certificate path. This check is restored in 1.1.1i. + [David von Oheimb] + + Changes between 1.1.1g and 1.1.1h [22 Sep 2020] + + *) Certificates with explicit curve parameters are now disallowed in + verification chains if the X509_V_FLAG_X509_STRICT flag is used. + [Tomas Mraz] + + *) The 'MinProtocol' and 'MaxProtocol' configuration commands now silently + ignore TLS protocol version bounds when configuring DTLS-based contexts, and + conversely, silently ignore DTLS protocol version bounds when configuring + TLS-based contexts. The commands can be repeated to set bounds of both + types. The same applies with the corresponding "min_protocol" and + "max_protocol" command-line switches, in case some application uses both TLS + and DTLS. + + SSL_CTX instances that are created for a fixed protocol version (e.g. + TLSv1_server_method()) also silently ignore version bounds. Previously + attempts to apply bounds to these protocol versions would result in an + error. Now only the "version-flexible" SSL_CTX instances are subject to + limits in configuration files in command-line options. + [Viktor Dukhovni] + + *) Handshake now fails if Extended Master Secret extension is dropped + on renegotiation. + [Tomas Mraz] + + *) Accidentally, an expired trusted (root) certificate is not anymore rejected + when validating a certificate path. + [David von Oheimb] + + *) The Oracle Developer Studio compiler will start reporting deprecated APIs + + Changes between 1.1.1f and 1.1.1g [21 Apr 2020] + + *) Fixed segmentation fault in SSL_check_chain() + Server or client applications that call the SSL_check_chain() function + during or after a TLS 1.3 handshake may crash due to a NULL pointer + dereference as a result of incorrect handling of the + "signature_algorithms_cert" TLS extension. The crash occurs if an invalid + or unrecognised signature algorithm is received from the peer. This could + be exploited by a malicious peer in a Denial of Service attack. + (CVE-2020-1967) + [Benjamin Kaduk] + + *) Added AES consttime code for no-asm configurations + an optional constant time support for AES was added + when building openssl for no-asm. + Enable with: ./config no-asm -DOPENSSL_AES_CONST_TIME + Disable with: ./config no-asm -DOPENSSL_NO_AES_CONST_TIME + At this time this feature is by default disabled. + It will be enabled by default in 3.0. + [Bernd Edlinger] + + Changes between 1.1.1e and 1.1.1f [31 Mar 2020] + + *) Revert the change of EOF detection while reading in libssl to avoid + regressions in applications depending on the current way of reporting + the EOF. As the existing method is not fully accurate the change to + reporting the EOF via SSL_ERROR_SSL is kept on the current development + branch and will be present in the 3.0 release. + [Tomas Mraz] + + *) Revised BN_generate_prime_ex to not avoid factors 3..17863 in p-1 + when primes for RSA keys are computed. + Since we previously always generated primes == 2 (mod 3) for RSA keys, + the 2-prime and 3-prime RSA modules were easy to distinguish, since + N = p*q = 1 (mod 3), but N = p*q*r = 2 (mod 3). Therefore fingerprinting + 2-prime vs. 3-prime RSA keys was possible by computing N mod 3. + This avoids possible fingerprinting of newly generated RSA modules. + [Bernd Edlinger] + + Changes between 1.1.1d and 1.1.1e [17 Mar 2020] + *) Properly detect EOF while reading in libssl. Previously if we hit an EOF + while reading in libssl then we would report an error back to the + application (SSL_ERROR_SYSCALL) but errno would be 0. We now add + an error to the stack (which means we instead return SSL_ERROR_SSL) and + therefore give a hint as to what went wrong. + [Matt Caswell] + + *) Check that ed25519 and ed448 are allowed by the security level. Previously + signature algorithms not using an MD were not being checked that they were + allowed by the security level. + [Kurt Roeckx] + + *) Fixed SSL_get_servername() behaviour. The behaviour of SSL_get_servername() + was not quite right. The behaviour was not consistent between resumption + and normal handshakes, and also not quite consistent with historical + behaviour. The behaviour in various scenarios has been clarified and + it has been updated to make it match historical behaviour as closely as + possible. + [Matt Caswell] + + *) [VMS only] The header files that the VMS compilers include automatically, + __DECC_INCLUDE_PROLOGUE.H and __DECC_INCLUDE_EPILOGUE.H, use pragmas that + the C++ compiler doesn't understand. This is a shortcoming in the + compiler, but can be worked around with __cplusplus guards. + + C++ applications that use OpenSSL libraries must be compiled using the + qualifier '/NAMES=(AS_IS,SHORTENED)' to be able to use all the OpenSSL + functions. Otherwise, only functions with symbols of less than 31 + characters can be used, as the linker will not be able to successfully + resolve symbols with longer names. + [Richard Levitte] + + *) Corrected the documentation of the return values from the EVP_DigestSign* + set of functions. The documentation mentioned negative values for some + errors, but this was never the case, so the mention of negative values + was removed. + + Code that followed the documentation and thereby check with something + like 'EVP_DigestSignInit(...) <= 0' will continue to work undisturbed. + [Richard Levitte] + + *) Fixed an an overflow bug in the x64_64 Montgomery squaring procedure + used in exponentiation with 512-bit moduli. No EC algorithms are + affected. Analysis suggests that attacks against 2-prime RSA1024, + 3-prime RSA1536, and DSA1024 as a result of this defect would be very + difficult to perform and are not believed likely. Attacks against DH512 + are considered just feasible. However, for an attack the target would + have to re-use the DH512 private key, which is not recommended anyway. + Also applications directly using the low level API BN_mod_exp may be + affected if they use BN_FLG_CONSTTIME. + (CVE-2019-1551) + [Andy Polyakov] + + *) Added a new method to gather entropy on VMS, based on SYS$GET_ENTROPY. + The presence of this system service is determined at run-time. + [Richard Levitte] + + *) Added newline escaping functionality to a filename when using openssl dgst. + This output format is to replicate the output format found in the '*sum' + checksum programs. This aims to preserve backward compatibility. + [Matt Eaton, Richard Levitte, and Paul Dale] + + *) Print all values for a PKCS#12 attribute with 'openssl pkcs12', not just + the first value. + [Jon Spillett] + + Changes between 1.1.1c and 1.1.1d [10 Sep 2019] + + *) Fixed a fork protection issue. OpenSSL 1.1.1 introduced a rewritten random + number generator (RNG). This was intended to include protection in the + event of a fork() system call in order to ensure that the parent and child + processes did not share the same RNG state. However this protection was not + being used in the default case. + + A partial mitigation for this issue is that the output from a high + precision timer is mixed into the RNG state so the likelihood of a parent + and child process sharing state is significantly reduced. + + If an application already calls OPENSSL_init_crypto() explicitly using + OPENSSL_INIT_ATFORK then this problem does not occur at all. + (CVE-2019-1549) + [Matthias St. Pierre] + + *) For built-in EC curves, ensure an EC_GROUP built from the curve name is + used even when parsing explicit parameters, when loading a serialized key + or calling `EC_GROUP_new_from_ecpkparameters()`/ + `EC_GROUP_new_from_ecparameters()`. + This prevents bypass of security hardening and performance gains, + especially for curves with specialized EC_METHODs. + By default, if a key encoded with explicit parameters is loaded and later + serialized, the output is still encoded with explicit parameters, even if + internally a "named" EC_GROUP is used for computation. + [Nicola Tuveri] + + *) Compute ECC cofactors if not provided during EC_GROUP construction. Before + this change, EC_GROUP_set_generator would accept order and/or cofactor as + NULL. After this change, only the cofactor parameter can be NULL. It also + does some minimal sanity checks on the passed order. + (CVE-2019-1547) + [Billy Bob Brumley] + + *) Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey. + An attack is simple, if the first CMS_recipientInfo is valid but the + second CMS_recipientInfo is chosen ciphertext. If the second + recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct + encryption key will be replaced by garbage, and the message cannot be + decoded, but if the RSA decryption fails, the correct encryption key is + used and the recipient will not notice the attack. + As a work around for this potential attack the length of the decrypted + key must be equal to the cipher default key length, in case the + certifiate is not given and all recipientInfo are tried out. + The old behaviour can be re-enabled in the CMS code by setting the + CMS_DEBUG_DECRYPT flag. + (CVE-2019-1563) + [Bernd Edlinger] + + *) Early start up entropy quality from the DEVRANDOM seed source has been + improved for older Linux systems. The RAND subsystem will wait for + /dev/random to be producing output before seeding from /dev/urandom. + The seeded state is stored for future library initialisations using + a system global shared memory segment. The shared memory identifier + can be configured by defining OPENSSL_RAND_SEED_DEVRANDOM_SHM_ID to + the desired value. The default identifier is 114. + [Paul Dale] + + *) Correct the extended master secret constant on EBCDIC systems. Without this + fix TLS connections between an EBCDIC system and a non-EBCDIC system that + negotiate EMS will fail. Unfortunately this also means that TLS connections + between EBCDIC systems with this fix, and EBCDIC systems without this + fix will fail if they negotiate EMS. + [Matt Caswell] + + *) Use Windows installation paths in the mingw builds + + Mingw isn't a POSIX environment per se, which means that Windows + paths should be used for installation. + (CVE-2019-1552) + [Richard Levitte] + + *) Changed DH_check to accept parameters with order q and 2q subgroups. + With order 2q subgroups the bit 0 of the private key is not secret + but DH_generate_key works around that by clearing bit 0 of the + private key for those. This avoids leaking bit 0 of the private key. + [Bernd Edlinger] + + *) Significantly reduce secure memory usage by the randomness pools. + [Paul Dale] + + *) Revert the DEVRANDOM_WAIT feature for Linux systems + + The DEVRANDOM_WAIT feature added a select() call to wait for the + /dev/random device to become readable before reading from the + /dev/urandom device. + + It turned out that this change had negative side effects on + performance which were not acceptable. After some discussion it + was decided to revert this feature and leave it up to the OS + resp. the platform maintainer to ensure a proper initialization + during early boot time. + [Matthias St. Pierre] + + Changes between 1.1.1b and 1.1.1c [28 May 2019] + + *) Add build tests for C++. These are generated files that only do one + thing, to include one public OpenSSL head file each. This tests that + the public header files can be usefully included in a C++ application. + + This test isn't enabled by default. It can be enabled with the option + 'enable-buildtest-c++'. + [Richard Levitte] + + *) Enable SHA3 pre-hashing for ECDSA and DSA. + [Patrick Steuer] + + *) Change the default RSA, DSA and DH size to 2048 bit instead of 1024. + This changes the size when using the genpkey app when no size is given. It + fixes an omission in earlier changes that changed all RSA, DSA and DH + generation apps to use 2048 bits by default. + [Kurt Roeckx] + + *) Reorganize the manual pages to consistently have RETURN VALUES, + EXAMPLES, SEE ALSO and HISTORY come in that order, and adjust + util/fix-doc-nits accordingly. + [Paul Yang, Joshua Lock] + + *) Add the missing accessor EVP_PKEY_get0_engine() + [Matt Caswell] + + *) Have apps like 's_client' and 's_server' output the signature scheme + along with other cipher suite parameters when debugging. + [Lorinczy Zsigmond] + + *) Make OPENSSL_config() error agnostic again. + [Richard Levitte] + + *) Do the error handling in RSA decryption constant time. + [Bernd Edlinger] + + *) Prevent over long nonces in ChaCha20-Poly1305. + + ChaCha20-Poly1305 is an AEAD cipher, and requires a unique nonce input + for every encryption operation. RFC 7539 specifies that the nonce value + (IV) should be 96 bits (12 bytes). OpenSSL allows a variable nonce length + and front pads the nonce with 0 bytes if it is less than 12 + bytes. However it also incorrectly allows a nonce to be set of up to 16 + bytes. In this case only the last 12 bytes are significant and any + additional leading bytes are ignored. + + It is a requirement of using this cipher that nonce values are + unique. Messages encrypted using a reused nonce value are susceptible to + serious confidentiality and integrity attacks. If an application changes + the default nonce length to be longer than 12 bytes and then makes a + change to the leading bytes of the nonce expecting the new value to be a + new unique nonce then such an application could inadvertently encrypt + messages with a reused nonce. + + Additionally the ignored bytes in a long nonce are not covered by the + integrity guarantee of this cipher. Any application that relies on the + integrity of these ignored leading bytes of a long nonce may be further + affected. Any OpenSSL internal use of this cipher, including in SSL/TLS, + is safe because no such use sets such a long nonce value. However user + applications that use this cipher directly and set a non-default nonce + length to be longer than 12 bytes may be vulnerable. + + This issue was reported to OpenSSL on 16th of March 2019 by Joran Dirk + Greef of Ronomon. + (CVE-2019-1543) + [Matt Caswell] + + *) Add DEVRANDOM_WAIT feature for Linux systems + + On older Linux systems where the getrandom() system call is not available, + OpenSSL normally uses the /dev/urandom device for seeding its CSPRNG. + Contrary to getrandom(), the /dev/urandom device will not block during + early boot when the kernel CSPRNG has not been seeded yet. + + To mitigate this known weakness, use select() to wait for /dev/random to + become readable before reading from /dev/urandom. + + *) Ensure that SM2 only uses SM3 as digest algorithm + [Paul Yang] + + Changes between 1.1.1a and 1.1.1b [26 Feb 2019] + + *) Added SCA hardening for modular field inversion in EC_GROUP through + a new dedicated field_inv() pointer in EC_METHOD. + This also addresses a leakage affecting conversions from projective + to affine coordinates. + [Billy Bob Brumley, Nicola Tuveri] + + *) Change the info callback signals for the start and end of a post-handshake + message exchange in TLSv1.3. In 1.1.1/1.1.1a we used SSL_CB_HANDSHAKE_START + and SSL_CB_HANDSHAKE_DONE. Experience has shown that many applications get + confused by this and assume that a TLSv1.2 renegotiation has started. This + can break KeyUpdate handling. Instead we no longer signal the start and end + of a post handshake message exchange (although the messages themselves are + still signalled). This could break some applications that were expecting + the old signals. However without this KeyUpdate is not usable for many + applications. + [Matt Caswell] + + *) Fix a bug in the computation of the endpoint-pair shared secret used + by DTLS over SCTP. This breaks interoperability with older versions + of OpenSSL like OpenSSL 1.1.0 and OpenSSL 1.0.2. There is a runtime + switch SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG (off by default) enabling + interoperability with such broken implementations. However, enabling + this switch breaks interoperability with correct implementations. + + *) Fix a use after free bug in d2i_X509_PUBKEY when overwriting a + re-used X509_PUBKEY object if the second PUBKEY is malformed. + [Bernd Edlinger] + + *) Move strictness check from EVP_PKEY_asn1_new() to EVP_PKEY_asn1_add0(). + [Richard Levitte] + + *) Remove the 'dist' target and add a tarball building script. The + 'dist' target has fallen out of use, and it shouldn't be + 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 + + The OpenSSL DSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 16th October 2018 by Samuel Weiser. + (CVE-2018-0734) + [Paul Dale] + + *) Timing vulnerability in ECDSA signature generation + + The OpenSSL ECDSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 25th October 2018 by Samuel Weiser. + (CVE-2018-0735) + [Paul Dale] + + *) Added EVP_PKEY_ECDH_KDF_X9_63 and ecdh_KDF_X9_63() as replacements for + the EVP_PKEY_ECDH_KDF_X9_62 KDF type and ECDH_KDF_X9_62(). The old names + are retained for backwards compatibility. + [Antoine Salon] + + *) Fixed the issue that RAND_add()/RAND_seed() silently discards random input + if its length exceeds 4096 bytes. The limit has been raised to a buffer size + of two gigabytes and the error handling improved. + + This issue was reported to OpenSSL by Dr. Falko Strenzke. It has been + categorized as a normal bug, not a security issue, because the DRBG reseeds + automatically and is fully functional even without additional randomness + provided by the application. + + Changes between 1.1.0i and 1.1.1 [11 Sep 2018] + + *) Add a new ClientHello callback. Provides a callback interface that gives + the application the ability to adjust the nascent SSL object at the + earliest stage of ClientHello processing, immediately after extensions have + been collected but before they have been processed. In particular, this + callback can adjust the supported TLS versions in response to the contents + of the ClientHello + [Benjamin Kaduk] + + *) Add SM2 base algorithm support. + [Jack Lloyd] + + *) s390x assembly pack: add (improved) hardware-support for the following + cryptographic primitives: sha3, shake, aes-gcm, aes-ccm, aes-ctr, aes-ofb, + aes-cfb/cfb8, aes-ecb. + [Patrick Steuer] + + *) Make EVP_PKEY_asn1_new() a bit stricter about its input. A NULL pem_str + parameter is no longer accepted, as it leads to a corrupt table. NULL + pem_str is reserved for alias entries only. + [Richard Levitte] + + *) Use the new ec_scalar_mul_ladder scaffold to implement a specialized ladder + step for prime curves. The new implementation is based on formulae from + differential addition-and-doubling in homogeneous projective coordinates + from Izu-Takagi "A fast parallel elliptic curve multiplication resistant + against side channel attacks" and Brier-Joye "Weierstrass Elliptic Curves + and Side-Channel Attacks" Eq. (8) for y-coordinate recovery, modified + to work in projective coordinates. + [Billy Bob Brumley, Nicola Tuveri] + + *) Change generating and checking of primes so that the error rate of not + being prime depends on the intended use based on the size of the input. + For larger primes this will result in more rounds of Miller-Rabin. + The maximal error rate for primes with more than 1080 bits is lowered + to 2^-128. + [Kurt Roeckx, Annie Yousar] + + *) Increase the number of Miller-Rabin rounds for DSA key generating to 64. + [Kurt Roeckx] + + *) The 'tsget' script is renamed to 'tsget.pl', to avoid confusion when + moving between systems, and to avoid confusion when a Windows build is + done with mingw vs with MSVC. For POSIX installs, there's still a + symlink or copy named 'tsget' to avoid that confusion as well. + [Richard Levitte] + + *) Revert blinding in ECDSA sign and instead make problematic addition + length-invariant. Switch even to fixed-length Montgomery multiplication. + [Andy Polyakov] + + *) Use the new ec_scalar_mul_ladder scaffold to implement a specialized ladder + step for binary curves. The new implementation is based on formulae from + differential addition-and-doubling in mixed Lopez-Dahab projective + coordinates, modified to independently blind the operands. + [Billy Bob Brumley, Sohaib ul Hassan, Nicola Tuveri] + + *) Add a scaffold to optionally enhance the Montgomery ladder implementation + for `ec_scalar_mul_ladder` (formerly `ec_mul_consttime`) allowing + EC_METHODs to implement their own specialized "ladder step", to take + advantage of more favorable coordinate systems or more efficient + differential addition-and-doubling algorithms. + [Billy Bob Brumley, Sohaib ul Hassan, Nicola Tuveri] + + *) Modified the random device based seed sources to keep the relevant + file descriptors open rather than reopening them on each access. + This allows such sources to operate in a chroot() jail without + the associated device nodes being available. This behaviour can be + controlled using RAND_keep_random_devices_open(). + [Paul Dale] + + *) Numerous side-channel attack mitigations have been applied. This may have + performance impacts for some algorithms for the benefit of improved + security. Specific changes are noted in this change log by their respective + authors. + [Matt Caswell] + + *) AIX shared library support overhaul. Switch to AIX "natural" way of + handling shared libraries, which means collecting shared objects of + different versions and bitnesses in one common archive. This allows to + mitigate conflict between 1.0 and 1.1 side-by-side installations. It + doesn't affect the way 3rd party applications are linked, only how + multi-version installation is managed. + [Andy Polyakov] + + *) Make ec_group_do_inverse_ord() more robust and available to other + EC cryptosystems, so that irrespective of BN_FLG_CONSTTIME, SCA + mitigations are applied to the fallback BN_mod_inverse(). + When using this function rather than BN_mod_inverse() directly, new + EC cryptosystem implementations are then safer-by-default. + [Billy Bob Brumley] + + *) Add coordinate blinding for EC_POINT and implement projective + coordinate blinding for generic prime curves as a countermeasure to + chosen point SCA attacks. + [Sohaib ul Hassan, Nicola Tuveri, Billy Bob Brumley] + + *) Add blinding to ECDSA and DSA signatures to protect against side channel + attacks discovered by Keegan Ryan (NCC Group). + [Matt Caswell] + + *) Enforce checking in the pkeyutl command line app to ensure that the input + length does not exceed the maximum supported digest length when performing + a sign, verify or verifyrecover operation. + [Matt Caswell] + + *) SSL_MODE_AUTO_RETRY is enabled by default. Applications that use blocking + I/O in combination with something like select() or poll() will hang. This + can be turned off again using SSL_CTX_clear_mode(). + Many applications do not properly handle non-application data records, and + TLS 1.3 sends more of such records. Setting SSL_MODE_AUTO_RETRY works + around the problems in those applications, but can also break some. + It's recommended to read the manpages about SSL_read(), SSL_write(), + SSL_get_error(), SSL_shutdown(), SSL_CTX_set_mode() and + SSL_CTX_set_read_ahead() again. + [Kurt Roeckx] + + *) When unlocking a pass phrase protected PEM file or PKCS#8 container, we + now allow empty (zero character) pass phrases. + [Richard Levitte] + + *) Apply blinding to binary field modular inversion and remove patent + pending (OPENSSL_SUN_GF2M_DIV) BN_GF2m_mod_div implementation. + [Billy Bob Brumley] + + *) Deprecate ec2_mult.c and unify scalar multiplication code paths for + binary and prime elliptic curves. + [Billy Bob Brumley] + + *) Remove ECDSA nonce padding: EC_POINT_mul is now responsible for + constant time fixed point multiplication. + [Billy Bob Brumley] + + *) Revise elliptic curve scalar multiplication with timing attack + defenses: ec_wNAF_mul redirects to a constant time implementation + when computing fixed point and variable point multiplication (which + in OpenSSL are mostly used with secret scalars in keygen, sign, + ECDH derive operations). + [Billy Bob Brumley, Nicola Tuveri, Cesar Pereida García, + Sohaib ul Hassan] + + *) Updated CONTRIBUTING + [Rich Salz] + + *) Updated DRBG / RAND to request nonce and additional low entropy + randomness from the system. + [Matthias St. Pierre] + + *) Updated 'openssl rehash' to use OpenSSL consistent default. + [Richard Levitte] + + *) Moved the load of the ssl_conf module to libcrypto, which helps + loading engines that libssl uses before libssl is initialised. + [Matt Caswell] + + *) Added EVP_PKEY_sign() and EVP_PKEY_verify() for EdDSA + [Matt Caswell] + + *) Fixed X509_NAME_ENTRY_set to get multi-valued RDNs right in all cases. + [Ingo Schwarze, Rich Salz] + + *) Added output of accepting IP address and port for 'openssl s_server' + [Richard Levitte] + + *) Added a new API for TLSv1.3 ciphersuites: + SSL_CTX_set_ciphersuites() + SSL_set_ciphersuites() + [Matt Caswell] + + *) Memory allocation failures consistently add an error to the error + stack. + [Rich Salz] + + *) Don't use OPENSSL_ENGINES and OPENSSL_CONF environment values + in libcrypto when run as setuid/setgid. + [Bernd Edlinger] + + *) Load any config file by default when libssl is used. + [Matt Caswell] + + *) Added new public header file and documentation + for the RAND_DRBG API. See manual page RAND_DRBG(7) for an overview. + [Matthias St. Pierre] + + *) QNX support removed (cannot find contributors to get their approval + for the license change). + [Rich Salz] + + *) TLSv1.3 replay protection for early data has been implemented. See the + SSL_read_early_data() man page for further details. + [Matt Caswell] + + *) Separated TLSv1.3 ciphersuite configuration out from TLSv1.2 ciphersuite + configuration. TLSv1.3 ciphersuites are not compatible with TLSv1.2 and + below. Similarly TLSv1.2 ciphersuites are not compatible with TLSv1.3. + In order to avoid issues where legacy TLSv1.2 ciphersuite configuration + would otherwise inadvertently disable all TLSv1.3 ciphersuites the + configuration has been separated out. See the ciphers man page or the + SSL_CTX_set_ciphersuites() man page for more information. + [Matt Caswell] + + *) On POSIX (BSD, Linux, ...) systems the ocsp(1) command running + in responder mode now supports the new "-multi" option, which + spawns the specified number of child processes to handle OCSP + requests. The "-timeout" option now also limits the OCSP + responder's patience to wait to receive the full client request + on a newly accepted connection. Child processes are respawned + as needed, and the CA index file is automatically reloaded + when changed. This makes it possible to run the "ocsp" responder + as a long-running service, making the OpenSSL CA somewhat more + feature-complete. In this mode, most diagnostic messages logged + after entering the event loop are logged via syslog(3) rather than + written to stderr. + [Viktor Dukhovni] + + *) Added support for X448 and Ed448. Heavily based on original work by + Mike Hamburg. + [Matt Caswell] + + *) Extend OSSL_STORE with capabilities to search and to narrow the set of + objects loaded. This adds the functions OSSL_STORE_expect() and + OSSL_STORE_find() as well as needed tools to construct searches and + get the search data out of them. + [Richard Levitte] + + *) Support for TLSv1.3 added. Note that users upgrading from an earlier + version of OpenSSL should review their configuration settings to ensure + that they are still appropriate for TLSv1.3. For further information see: + https://wiki.openssl.org/index.php/TLS1.3 + [Matt Caswell] + + *) Grand redesign of the OpenSSL random generator + + The default RAND method now utilizes an AES-CTR DRBG according to + NIST standard SP 800-90Ar1. The new random generator is essentially + a port of the default random generator from the OpenSSL FIPS 2.0 + object module. It is a hybrid deterministic random bit generator + using an AES-CTR bit stream and which seeds and reseeds itself + automatically using trusted system entropy sources. + + Some of its new features are: + o Support for multiple DRBG instances with seed chaining. + o The default RAND method makes use of a DRBG. + o There is a public and private DRBG instance. + o The DRBG instances are fork-safe. + o Keep all global DRBG instances on the secure heap if it is enabled. + o The public and private DRBG instance are per thread for lock free + operation + [Paul Dale, Benjamin Kaduk, Kurt Roeckx, Rich Salz, Matthias St. Pierre] + + *) Changed Configure so it only says what it does and doesn't dump + so much data. Instead, ./configdata.pm should be used as a script + to display all sorts of configuration data. + [Richard Levitte] + + *) Added processing of "make variables" to Configure. + [Richard Levitte] + + *) Added SHA512/224 and SHA512/256 algorithm support. + [Paul Dale] + + *) The last traces of Netware support, first removed in 1.1.0, have + now been removed. + [Rich Salz] + + *) Get rid of Makefile.shared, and in the process, make the processing + of certain files (rc.obj, or the .def/.map/.opt files produced from + the ordinal files) more visible and hopefully easier to trace and + debug (or make silent). + [Richard Levitte] + + *) Make it possible to have environment variable assignments as + arguments to config / Configure. + [Richard Levitte] + + *) Add multi-prime RSA (RFC 8017) support. + [Paul Yang] + + *) Add SM3 implemented according to GB/T 32905-2016 + [ Jack Lloyd , + Ronald Tse , + Erick Borsboom ] + + *) Add 'Maximum Fragment Length' TLS extension negotiation and support + as documented in RFC6066. + Based on a patch from Tomasz Moń + [Filipe Raimundo da Silva] + + *) Add SM4 implemented according to GB/T 32907-2016. + [ Jack Lloyd , + Ronald Tse , + Erick Borsboom ] + + *) Reimplement -newreq-nodes and ERR_error_string_n; the + original author does not agree with the license change. + [Rich Salz] + + *) Add ARIA AEAD TLS support. + [Jon Spillett] + + *) Some macro definitions to support VS6 have been removed. Visual + Studio 6 has not worked since 1.1.0 + [Rich Salz] + + *) Add ERR_clear_last_mark(), to allow callers to clear the last mark + without clearing the errors. + [Richard Levitte] + + *) Add "atfork" functions. If building on a system that without + pthreads, see doc/man3/OPENSSL_fork_prepare.pod for application + requirements. The RAND facility now uses/requires this. + [Rich Salz] + + *) Add SHA3. + [Andy Polyakov] + + *) The UI API becomes a permanent and integral part of libcrypto, i.e. + not possible to disable entirely. However, it's still possible to + disable the console reading UI method, UI_OpenSSL() (use UI_null() + as a fallback). + + To disable, configure with 'no-ui-console'. 'no-ui' is still + possible to use as an alias. Check at compile time with the + macro OPENSSL_NO_UI_CONSOLE. The macro OPENSSL_NO_UI is still + possible to check and is an alias for OPENSSL_NO_UI_CONSOLE. + [Richard Levitte] + + *) Add a STORE module, which implements a uniform and URI based reader of + stores that can contain keys, certificates, CRLs and numerous other + objects. The main API is loosely based on a few stdio functions, + and includes OSSL_STORE_open, OSSL_STORE_load, OSSL_STORE_eof, + OSSL_STORE_error and OSSL_STORE_close. + The implementation uses backends called "loaders" to implement arbitrary + URI schemes. There is one built in "loader" for the 'file' scheme. + [Richard Levitte] + + *) Add devcrypto engine. This has been implemented against cryptodev-linux, + then adjusted to work on FreeBSD 8.4 as well. + Enable by configuring with 'enable-devcryptoeng'. This is done by default + on BSD implementations, as cryptodev.h is assumed to exist on all of them. + [Richard Levitte] + + *) Module names can prefixed with OSSL_ or OPENSSL_. This affects + util/mkerr.pl, which is adapted to allow those prefixes, leading to + error code calls like this: + + OSSL_FOOerr(OSSL_FOO_F_SOMETHING, OSSL_FOO_R_WHATEVER); + + With this change, we claim the namespaces OSSL and OPENSSL in a manner + that can be encoded in C. For the foreseeable future, this will only + affect new modules. + [Richard Levitte and Tim Hudson] + + *) Removed BSD cryptodev engine. + [Rich Salz] + + *) Add a build target 'build_all_generated', to build all generated files + and only that. This can be used to prepare everything that requires + things like perl for a system that lacks perl and then move everything + to that system and do the rest of the build there. + [Richard Levitte] + + *) In the UI interface, make it possible to duplicate the user data. This + can be used by engines that need to retain the data for a longer time + than just the call where this user data is passed. + [Richard Levitte] + + *) Ignore the '-named_curve auto' value for compatibility of applications + with OpenSSL 1.0.2. + [Tomas Mraz ] + + *) Fragmented SSL/TLS alerts are no longer accepted. An alert message is 2 + bytes long. In theory it is permissible in SSLv3 - TLSv1.2 to fragment such + alerts across multiple records (some of which could be empty). In practice + it make no sense to send an empty alert record, or to fragment one. TLSv1.3 + prohibits this altogether and other libraries (BoringSSL, NSS) do not + support this at all. Supporting it adds significant complexity to the + record layer, and its removal is unlikely to cause interoperability + issues. + [Matt Caswell] + + *) Add the ASN.1 types INT32, UINT32, INT64, UINT64 and variants prefixed + with Z. These are meant to replace LONG and ZLONG and to be size safe. + The use of LONG and ZLONG is discouraged and scheduled for deprecation + in OpenSSL 1.2.0. + [Richard Levitte] + + *) Add the 'z' and 'j' modifiers to BIO_printf() et al formatting string, + 'z' is to be used for [s]size_t, and 'j' - with [u]int64_t. + [Richard Levitte, Andy Polyakov] + + *) Add EC_KEY_get0_engine(), which does for EC_KEY what RSA_get0_engine() + does for RSA, etc. + [Richard Levitte] + + *) Have 'config' recognise 64-bit mingw and choose 'mingw64' as the target + platform rather than 'mingw'. + [Richard Levitte] + + *) The functions X509_STORE_add_cert and X509_STORE_add_crl return + success if they are asked to add an object which already exists + in the store. This change cascades to other functions which load + certificates and CRLs. + [Paul Dale] + + *) x86_64 assembly pack: annotate code with DWARF CFI directives to + facilitate stack unwinding even from assembly subroutines. + [Andy Polyakov] + + *) Remove VAX C specific definitions of OPENSSL_EXPORT, OPENSSL_EXTERN. + Also remove OPENSSL_GLOBAL entirely, as it became a no-op. + [Richard Levitte] + + *) Remove the VMS-specific reimplementation of gmtime from crypto/o_times.c. + VMS C's RTL has a fully up to date gmtime() and gmtime_r() since V7.1, + which is the minimum version we support. + [Richard Levitte] + + *) Certificate time validation (X509_cmp_time) enforces stricter + compliance with RFC 5280. Fractional seconds and timezone offsets + are no longer allowed. + [Emilia Käsper] + + *) Add support for ARIA + [Paul Dale] + + *) s_client will now send the Server Name Indication (SNI) extension by *** 18530 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Mar 25 15:50:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA2DB5C214B; Thu, 25 Mar 2021 15:50: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 4F5qMN5P1kz3mg5; Thu, 25 Mar 2021 15:50: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 AC2DD2002; Thu, 25 Mar 2021 15:50: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 12PFouhA038887; Thu, 25 Mar 2021 15:50:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PFoueY038886; Thu, 25 Mar 2021 15:50:56 GMT (envelope-from git) Date: Thu, 25 Mar 2021 15:50:56 GMT Message-Id: <202103251550.12PFoueY038886@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: 31070b5bc77a - main - Set default alternate setting when USB audio devices are not in use, to activate power save features. 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: 31070b5bc77a499009a835650eb9d4bf2eceaa15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 15:50:56 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=31070b5bc77a499009a835650eb9d4bf2eceaa15 commit 31070b5bc77a499009a835650eb9d4bf2eceaa15 Author: Hans Petter Selasky AuthorDate: 2021-03-09 16:41:18 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-25 15:49:52 +0000 Set default alternate setting when USB audio devices are not in use, to activate power save features. Suggested by: Shichun_Ma@Dell.com MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/sound/usb/uaudio.c | 199 +++++++++++++++++++++++---------------------- 1 file changed, 104 insertions(+), 95 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 095078b47e65..538e4180f6de 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -945,6 +945,27 @@ uaudio_set_spdif_dummy(struct uaudio_softc *sc, int flags) return (0); } +static usb_error_t +uaudio_force_power_save(struct uaudio_softc *sc, uint8_t iface_index) +{ + struct usb_interface *iface; + usb_error_t err; + + iface = usbd_get_iface(sc->sc_udev, iface_index); + if (iface == NULL || iface->idesc == NULL) + return (USB_ERR_INVAL); + + /* check if correct alternate setting is already selected */ + if (iface->alt_index == 0) { + /* force power save mode by selecting default alternate setting */ + err = usbd_req_set_alt_interface_no(sc->sc_udev, NULL, iface_index, + iface->idesc->bAlternateSetting); + } else { + err = usbd_set_alt_interface_index(sc->sc_udev, iface_index, 0); + } + return (err); +} + static int uaudio_attach(device_t dev) { @@ -1019,16 +1040,16 @@ uaudio_attach(device_t dev) /* * Need to set a default alternate interface, else - * some USB audio devices might go into an infinte + * some USB audio devices might go into an infinite * re-enumeration loop: */ - err = usbd_set_alt_interface_index(sc->sc_udev, - sc->sc_play_chan[i].usb_alt[0].iface_index, - sc->sc_play_chan[i].usb_alt[0].iface_alt_index); + err = uaudio_force_power_save(sc, + sc->sc_play_chan[i].usb_alt[0].iface_index); if (err) { DPRINTF("setting of alternate index failed: %s!\n", usbd_errstr(err)); } + for (x = 0; x != sc->sc_play_chan[i].num_alt; x++) { device_printf(dev, "Play[%u]: %d Hz, %d ch, %s format, " "2x%dms buffer.\n", i, @@ -1049,16 +1070,16 @@ uaudio_attach(device_t dev) /* * Need to set a default alternate interface, else - * some USB audio devices might go into an infinte + * some USB audio devices might go into an infinite * re-enumeration loop: */ - err = usbd_set_alt_interface_index(sc->sc_udev, - sc->sc_rec_chan[i].usb_alt[0].iface_index, - sc->sc_rec_chan[i].usb_alt[0].iface_alt_index); + err = uaudio_force_power_save(sc, + sc->sc_rec_chan[i].usb_alt[0].iface_index); if (err) { DPRINTF("setting of alternate index failed: %s!\n", usbd_errstr(err)); } + for (x = 0; x != sc->sc_rec_chan[i].num_alt; x++) { device_printf(dev, "Record[%u]: %d Hz, %d ch, %s format, " "2x%dms buffer.\n", i, @@ -1307,7 +1328,7 @@ uaudio_configure_msg_sub(struct uaudio_softc *sc, uint32_t frames; uint32_t buf_size; uint16_t fps; - uint8_t set_alt; + uint8_t next_alt; uint8_t fps_shift; uint8_t operation; usb_error_t err; @@ -1319,22 +1340,51 @@ uaudio_configure_msg_sub(struct uaudio_softc *sc, usb_proc_explore_lock(sc->sc_udev); operation = chan->operation; - chan->operation = CHAN_OP_NONE; + switch (operation) { + case CHAN_OP_START: + case CHAN_OP_STOP: + chan->operation = CHAN_OP_NONE; + break; + default: + break; + } usb_proc_explore_unlock(sc->sc_udev); - mtx_lock(chan->pcm_mtx); - if (chan->cur_alt != chan->set_alt) - set_alt = chan->set_alt; - else - set_alt = CHAN_MAX_ALT; - mtx_unlock(chan->pcm_mtx); + switch (operation) { + case CHAN_OP_STOP: + /* Unsetup prior USB transfers, if any. */ + usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); - if (set_alt >= chan->num_alt) - goto done; + mtx_lock(chan->pcm_mtx); + chan->cur_alt = CHAN_MAX_ALT; + mtx_unlock(chan->pcm_mtx); - chan_alt = chan->usb_alt + set_alt; + /* + * The first alternate setting is typically used for + * power saving mode. Set this alternate setting as + * part of entering stop. + */ + err = usbd_set_alt_interface_index(sc->sc_udev, chan->iface_index, 0); + if (err) { + DPRINTF("setting of default alternate index failed: %s!\n", + usbd_errstr(err)); + } + return; - usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); + case CHAN_OP_START: + /* Unsetup prior USB transfers, if any. */ + usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); + break; + + default: + return; + } + + mtx_lock(chan->pcm_mtx); + next_alt = chan->set_alt; + mtx_unlock(chan->pcm_mtx); + + chan_alt = chan->usb_alt + next_alt; err = usbd_set_alt_interface_index(sc->sc_udev, chan_alt->iface_index, chan_alt->iface_alt_index); @@ -1438,32 +1488,16 @@ uaudio_configure_msg_sub(struct uaudio_softc *sc, goto error; } - mtx_lock(chan->pcm_mtx); - chan->cur_alt = set_alt; - mtx_unlock(chan->pcm_mtx); - -done: #if (UAUDIO_NCHANBUFS != 2) -#error "please update code" +#error "Please update code below!" #endif - switch (operation) { - case CHAN_OP_START: - mtx_lock(chan->pcm_mtx); - usbd_transfer_start(chan->xfer[0]); - usbd_transfer_start(chan->xfer[1]); - mtx_unlock(chan->pcm_mtx); - break; - case CHAN_OP_STOP: - mtx_lock(chan->pcm_mtx); - usbd_transfer_stop(chan->xfer[0]); - usbd_transfer_stop(chan->xfer[1]); - mtx_unlock(chan->pcm_mtx); - break; - default: - break; - } - return; + mtx_lock(chan->pcm_mtx); + chan->cur_alt = next_alt; + usbd_transfer_start(chan->xfer[0]); + usbd_transfer_start(chan->xfer[1]); + mtx_unlock(chan->pcm_mtx); + return; error: usbd_transfer_unsetup(chan->xfer, UAUDIO_NCHANBUFS + 1); @@ -2746,27 +2780,24 @@ uaudio_chan_set_param_format(struct uaudio_chan *ch, uint32_t format) } static void -uaudio_chan_start_sub(struct uaudio_chan *ch) +uaudio_chan_reconfigure(struct uaudio_chan *ch, uint8_t operation) { struct uaudio_softc *sc = ch->priv_sc; - int do_start = 0; - - if (ch->operation != CHAN_OP_DRAIN) { - if (ch->cur_alt == ch->set_alt && - ch->operation == CHAN_OP_NONE && - mtx_owned(ch->pcm_mtx) != 0) { - /* save doing the explore task */ - do_start = 1; - } else { - ch->operation = CHAN_OP_START; - (void)usb_proc_explore_msignal(sc->sc_udev, - &sc->sc_config_msg[0], &sc->sc_config_msg[1]); - } - } - if (do_start) { - usbd_transfer_start(ch->xfer[0]); - usbd_transfer_start(ch->xfer[1]); - } + + /* Check for shutdown. */ + if (ch->operation == CHAN_OP_DRAIN) + return; + + /* Set next operation. */ + ch->operation = operation; + + /* + * Because changing the alternate setting modifies the USB + * configuration, this part must be executed from the USB + * explore process. + */ + (void)usb_proc_explore_msignal(sc->sc_udev, + &sc->sc_config_msg[0], &sc->sc_config_msg[1]); } static int @@ -2819,10 +2850,10 @@ uaudio_chan_start(struct uaudio_chan *ch) * Start both endpoints because of need for * jitter information: */ - uaudio_chan_start_sub(&sc->sc_rec_chan[i]); - uaudio_chan_start_sub(&sc->sc_play_chan[i]); + uaudio_chan_reconfigure(&sc->sc_rec_chan[i], CHAN_OP_START); + uaudio_chan_reconfigure(&sc->sc_play_chan[i], CHAN_OP_START); } else { - uaudio_chan_start_sub(ch); + uaudio_chan_reconfigure(ch, CHAN_OP_START); } } @@ -2830,30 +2861,6 @@ uaudio_chan_start(struct uaudio_chan *ch) usb_proc_explore_unlock(sc->sc_udev); } -static void -uaudio_chan_stop_sub(struct uaudio_chan *ch) -{ - struct uaudio_softc *sc = ch->priv_sc; - int do_stop = 0; - - if (ch->operation != CHAN_OP_DRAIN) { - if (ch->cur_alt == ch->set_alt && - ch->operation == CHAN_OP_NONE && - mtx_owned(ch->pcm_mtx) != 0) { - /* save doing the explore task */ - do_stop = 1; - } else { - ch->operation = CHAN_OP_STOP; - (void)usb_proc_explore_msignal(sc->sc_udev, - &sc->sc_config_msg[0], &sc->sc_config_msg[1]); - } - } - if (do_stop) { - usbd_transfer_stop(ch->xfer[0]); - usbd_transfer_stop(ch->xfer[1]); - } -} - void uaudio_chan_stop(struct uaudio_chan *ch) { @@ -2882,10 +2889,10 @@ uaudio_chan_stop(struct uaudio_chan *ch) * Stop both endpoints in case the one was used for * jitter information: */ - uaudio_chan_stop_sub(&sc->sc_rec_chan[i]); - uaudio_chan_stop_sub(&sc->sc_play_chan[i]); + uaudio_chan_reconfigure(&sc->sc_rec_chan[i], CHAN_OP_STOP); + uaudio_chan_reconfigure(&sc->sc_play_chan[i], CHAN_OP_STOP); } else { - uaudio_chan_stop_sub(ch); + uaudio_chan_reconfigure(ch, CHAN_OP_STOP); } } @@ -5961,9 +5968,11 @@ umidi_probe(device_t dev) if (usb_test_quirk(uaa, UQ_SINGLE_CMD_MIDI)) chan->single_command = 1; - if (usbd_set_alt_interface_index(sc->sc_udev, chan->iface_index, - chan->iface_alt_index)) { - DPRINTF("setting of alternate index failed!\n"); + error = usbd_set_alt_interface_index(sc->sc_udev, + chan->iface_index, chan->iface_alt_index); + if (error) { + DPRINTF("setting of alternate index failed: %s\n", + usbd_errstr(error)); goto detach; } usbd_set_parent_iface(sc->sc_udev, chan->iface_index, From owner-dev-commits-src-main@freebsd.org Thu Mar 25 15:56:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0574B5C298D; Thu, 25 Mar 2021 15:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5qVB6mJ1z3nFy; Thu, 25 Mar 2021 15:56: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 DB12D1FCA; Thu, 25 Mar 2021 15:56: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 12PFuo88040581; Thu, 25 Mar 2021 15:56:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PFuoTA040580; Thu, 25 Mar 2021 15:56:50 GMT (envelope-from git) Date: Thu, 25 Mar 2021 15:56:50 GMT Message-Id: <202103251556.12PFuoTA040580@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: 4e38478c595a - main - ipoib: Fix incorrectly computed IPOIB_CM_RX_SG value. 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: 4e38478c595a9e6225b525890d7ee269a203c200 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 15:56:51 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=4e38478c595a9e6225b525890d7ee269a203c200 commit 4e38478c595a9e6225b525890d7ee269a203c200 Author: Hans Petter Selasky AuthorDate: 2021-03-25 15:55:02 +0000 Commit: Hans Petter Selasky CommitDate: 2021-03-25 15:55:37 +0000 ipoib: Fix incorrectly computed IPOIB_CM_RX_SG value. The computed IPOIB_CM_RX_SG is too small. It doesn't account for fallback to mbuf clusters when jumbo frames are not available and it also doesn't account for the packet header and trailer mbuf. This causes a memory overwrite situation when IPOIB_CM is configured. While at it add a kernel assert to ensure the mapping array is not overwritten. PR: 254474 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h | 7 +++---- sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 +- sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c | 7 ++++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h index 8a2b3333abb5..eb1cb87dc888 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h @@ -117,12 +117,11 @@ enum { IPOIB_ENCAP_LEN = 4, IPOIB_HEADER_LEN = IPOIB_ENCAP_LEN + INFINIBAND_ALEN, IPOIB_UD_MAX_MTU = 4 * 1024, -// IPOIB_UD_RX_SG = (IPOIB_UD_MAX_MTU / MJUMPAGESIZE), - IPOIB_UD_RX_SG = 2, + IPOIB_UD_RX_SG = 2, /* packet header and one cluster */ IPOIB_UD_TX_SG = (IPOIB_UD_MAX_MTU / MCLBYTES) + 2, IPOIB_CM_MAX_MTU = (64 * 1024), IPOIB_CM_TX_SG = (IPOIB_CM_MAX_MTU / MCLBYTES) + 2, - IPOIB_CM_RX_SG = (IPOIB_CM_MAX_MTU / MJUMPAGESIZE), + IPOIB_CM_RX_SG = (IPOIB_CM_MAX_MTU / MCLBYTES) + 2, IPOIB_RX_RING_SIZE = 256, IPOIB_TX_RING_SIZE = 128, IPOIB_MAX_RX_SG = MAX(IPOIB_CM_RX_SG, IPOIB_UD_RX_SG), @@ -529,7 +528,7 @@ int ipoib_poll_tx(struct ipoib_dev_priv *priv, bool do_start); void ipoib_dma_unmap_rx(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req); void ipoib_dma_mb(struct ipoib_dev_priv *priv, struct mbuf *mb, unsigned int length); -struct mbuf *ipoib_alloc_map_mb(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req, int align, int size); +struct mbuf *ipoib_alloc_map_mb(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req, int align, int size, int max_frags); void ipoib_set_ethtool_ops(struct ifnet *dev); diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 50c9a4f305e9..b61ebfd1495a 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -153,7 +153,7 @@ static struct mbuf * ipoib_cm_alloc_rx_mb(struct ipoib_dev_priv *priv, struct ipoib_cm_rx_buf *rx_req) { return ipoib_alloc_map_mb(priv, (struct ipoib_rx_buf *)rx_req, - sizeof(struct ipoib_pseudoheader), priv->cm.max_cm_mtu); + sizeof(struct ipoib_pseudoheader), priv->cm.max_cm_mtu, IPOIB_CM_RX_SG); } static void ipoib_cm_free_rx_ring(struct ipoib_dev_priv *priv, diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c index cb52e3db75a4..a5db9a256204 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -112,7 +112,7 @@ ipoib_dma_mb(struct ipoib_dev_priv *priv, struct mbuf *mb, unsigned int length) struct mbuf * ipoib_alloc_map_mb(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req, - int align, int size) + int align, int size, int max_frags) { struct mbuf *mb, *m; int i, j; @@ -122,6 +122,8 @@ ipoib_alloc_map_mb(struct ipoib_dev_priv *priv, struct ipoib_rx_buf *rx_req, if (mb == NULL) return (NULL); for (i = 0, m = mb; m != NULL; m = m->m_next, i++) { + MPASS(i < max_frags); + m->m_len = M_SIZE(m) - align; m->m_data += align; align = 0; @@ -174,9 +176,8 @@ static int ipoib_ib_post_receive(struct ipoib_dev_priv *priv, int id) static struct mbuf * ipoib_alloc_rx_mb(struct ipoib_dev_priv *priv, int id) { - return ipoib_alloc_map_mb(priv, &priv->rx_ring[id], - 0, priv->max_ib_mtu + IB_GRH_BYTES); + 0, priv->max_ib_mtu + IB_GRH_BYTES, IPOIB_UD_RX_SG); } static int ipoib_ib_post_receives(struct ipoib_dev_priv *priv) From owner-dev-commits-src-main@freebsd.org Thu Mar 25 16:11:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BD9B5C2F01; Thu, 25 Mar 2021 16:11: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 4F5qpz057Jz3pK2; Thu, 25 Mar 2021 16:11: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 E04271E5D; Thu, 25 Mar 2021 16:11: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 12PGBMhh064554; Thu, 25 Mar 2021 16:11:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PGBMeA064553; Thu, 25 Mar 2021 16:11:22 GMT (envelope-from git) Date: Thu, 25 Mar 2021 16:11:22 GMT Message-Id: <202103251611.12PGBMeA064553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: 2f561284033c - main - [PowerPC64] Enforce natural alignment in bcopy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f561284033c0f53d0911baf9056078e6026a278 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 16:11:23 -0000 The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=2f561284033c0f53d0911baf9056078e6026a278 commit 2f561284033c0f53d0911baf9056078e6026a278 Author: Leandro Lupori AuthorDate: 2021-03-25 14:54:06 +0000 Commit: Leandro Lupori CommitDate: 2021-03-25 16:07:01 +0000 [PowerPC64] Enforce natural alignment in bcopy POWER architecture CPUs (Book-S) require natural alignment for cache-inhibited storage accesses. Since we can't know the caching model for a page ahead of time, always enforce natural alignment in bcopy. This fixes a SIGBUS when calling the function with misaligned pointers on POWER7. Submitted by: Bruno Larsen Reviewed by: luporl, bdragon (IRC) MFC after: 1 week Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D28776 --- lib/libc/powerpc64/string/bcopy.S | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/lib/libc/powerpc64/string/bcopy.S b/lib/libc/powerpc64/string/bcopy.S index bb860c098feb..4dc80c264362 100644 --- a/lib/libc/powerpc64/string/bcopy.S +++ b/lib/libc/powerpc64/string/bcopy.S @@ -34,6 +34,11 @@ __FBSDID("$FreeBSD$"); #define BLOCK_SIZE (1 << BLOCK_SIZE_BITS) #define BLOCK_SIZE_MASK (BLOCK_SIZE - 1) +/* Minimum 8 byte alignment, to avoid cache-inhibited alignment faults.*/ +#ifndef ALIGN_MASK +#define ALIGN_MASK 0x7 +#endif + #define MULTI_PHASE_THRESHOLD 512 #ifndef FN_NAME @@ -66,9 +71,38 @@ ENTRY(FN_NAME) mr %r4, %r0 #endif + /* First check for relative alignment, if unaligned copy one byte at a time */ + andi. %r8, %r3, ALIGN_MASK + andi. %r7, %r4, ALIGN_MASK + cmpd %r7, %r8 + bne .Lunaligned + + cmpldi %r5, MULTI_PHASE_THRESHOLD bge .Lmulti_phase + b .Lfast_copy + +.Lunaligned: + /* forward or backward copy? */ + cmpd %r4, %r3 + blt .Lbackward_unaligned + + /* Just need to setup increment and jump to copy */ + li %r0, 1 + mtctr %r5 + b .Lsingle_1_loop + +.Lbackward_unaligned: + /* advance src and dst to last byte, set decrement and jump to copy */ + add %r3, %r3, %r5 + addi %r3, %r3, -1 + add %r4, %r4, %r5 + addi %r4, %r4, -1 + li %r0, -1 + mtctr %r5 + b .Lsingle_1_loop +.Lfast_copy: /* align src */ cmpd %r4, %r3 /* forward or backward copy? */ blt .Lbackward_align From owner-dev-commits-src-main@freebsd.org Thu Mar 25 16:18:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 049B85C30F0; Thu, 25 Mar 2021 16:18: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 4F5qyv6k6Vz3pxd; Thu, 25 Mar 2021 16:18: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 D92FC2227; Thu, 25 Mar 2021 16:18: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 12PGIFWW069673; Thu, 25 Mar 2021 16:18:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PGIF8e069672; Thu, 25 Mar 2021 16:18:15 GMT (envelope-from git) Date: Thu, 25 Mar 2021 16:18:15 GMT Message-Id: <202103251618.12PGIF8e069672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 7595394130a1 - main - OpenSSL: Regen manual pages for 1.1.1k MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7595394130a163b7ff53d9ef3f28fcb87f629d17 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 16:18:16 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=7595394130a163b7ff53d9ef3f28fcb87f629d17 commit 7595394130a163b7ff53d9ef3f28fcb87f629d17 Author: Jung-uk Kim AuthorDate: 2021-03-25 16:17:52 +0000 Commit: Jung-uk Kim CommitDate: 2021-03-25 16:17:52 +0000 OpenSSL: Regen manual pages for 1.1.1k --- secure/lib/libcrypto/Makefile.inc | 4 ++-- secure/lib/libcrypto/man/man3/ADMISSIONS.3 | 2 +- secure/lib/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 +- secure/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 +- secure/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 +- secure/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 | 2 +- secure/lib/libcrypto/man/man3/BIO_f_base64.3 | 2 +- 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 | 2 +- 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 +- secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 | 2 +- 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 | 2 +- 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 | 2 +- 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 | 2 +- secure/lib/libcrypto/man/man3/BN_mod_mul_montgomery.3 | 2 +- secure/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 | 2 +- secure/lib/libcrypto/man/man3/BN_set_bit.3 | 2 +- secure/lib/libcrypto/man/man3/BN_swap.3 | 2 +- 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 +- secure/lib/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 | 2 +- secure/lib/libcrypto/man/man3/CMS_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_final.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_RecipientInfos.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_SignerInfos.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get0_type.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_get1_ReceiptRequest.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_sign.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_sign_receipt.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_uncompress.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_verify.3 | 2 +- secure/lib/libcrypto/man/man3/CMS_verify_receipt.3 | 2 +- secure/lib/libcrypto/man/man3/CONF_modules_free.3 | 2 +- secure/lib/libcrypto/man/man3/CONF_modules_load_file.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_THREAD_run_once.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_get_ex_new_index.3 | 2 +- secure/lib/libcrypto/man/man3/CRYPTO_memcmp.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_STORE_get0_log_by_id.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_STORE_new.3 | 2 +- secure/lib/libcrypto/man/man3/CTLOG_new.3 | 2 +- secure/lib/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 +- secure/lib/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 | 2 +- secure/lib/libcrypto/man/man3/DSA_generate_key.3 | 2 +- secure/lib/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 | 2 +- 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 +- secure/lib/libcrypto/man/man3/ECPKParameters_print.3 | 2 +- secure/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 +- secure/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 | 2 +- secure/lib/libcrypto/man/man3/ERR_error_string.3 | 2 +- secure/lib/libcrypto/man/man3/ERR_get_error.3 | 2 +- secure/lib/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 | 2 +- secure/lib/libcrypto/man/man3/EVP_CIPHER_CTX_get_cipher_data.3 | 2 +- secure/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 +- secure/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 +- secure/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 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set1_pbe_pass.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_hkdf_md.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_scrypt_N.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3 | 2 +- secure/lib/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 +- secure/lib/libcrypto/man/man3/EVP_PKEY_get_default_digest_nid.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_PKEY_keygen.3 | 2 +- secure/lib/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 +- secure/lib/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 +- secure/lib/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 | 2 +- secure/lib/libcrypto/man/man3/EVP_idea_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md2.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md4.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_md5.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_mdc2.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc2_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc4.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_rc5_32_12_16_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_ripemd160.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_seed_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_sha1.3 | 2 +- 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 | 2 +- secure/lib/libcrypto/man/man3/EVP_sm4_cbc.3 | 2 +- secure/lib/libcrypto/man/man3/EVP_whirlpool.3 | 2 +- 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/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 +- secure/lib/libcrypto/man/man3/OCSP_request_add1_nonce.3 | 2 +- secure/lib/libcrypto/man/man3/OCSP_resp_find_status.3 | 2 +- secure/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 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_LH_COMPFUNC.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_LH_stats.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_VERSION_NUMBER.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_config.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_fork_prepare.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_ia32cap.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_init_crypto.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_init_ssl.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_instrument_bus.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_load_builtin_modules.3 | 2 +- secure/lib/libcrypto/man/man3/OPENSSL_malloc.3 | 2 +- secure/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 +- secure/lib/libcrypto/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 +- secure/lib/libcrypto/man/man3/PEM_read_bio_PrivateKey.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_read_bio_ex.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_write_bio_CMS_stream.3 | 2 +- secure/lib/libcrypto/man/man3/PEM_write_bio_PKCS7_stream.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS12_create.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS12_newpass.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS12_parse.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS5_PBKDF2_HMAC.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_decrypt.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_encrypt.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_sign.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_sign_add_signer.3 | 2 +- secure/lib/libcrypto/man/man3/PKCS7_verify.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_DRBG_generate.3 | 2 +- secure/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 +- secure/lib/libcrypto/man/man3/RAND_DRBG_set_callbacks.3 | 2 +- secure/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 | 2 +- secure/lib/libcrypto/man/man3/RAND_egd.3 | 2 +- secure/lib/libcrypto/man/man3/RAND_load_file.3 | 2 +- secure/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 +- secure/lib/libcrypto/man/man3/RSA_padding_add_PKCS1_type_1.3 | 2 +- secure/lib/libcrypto/man/man3/RSA_print.3 | 2 +- secure/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 +- secure/lib/libcrypto/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 | 2 +- secure/lib/libcrypto/man/man3/SMIME_read_PKCS7.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_write_CMS.3 | 2 +- secure/lib/libcrypto/man/man3/SMIME_write_PKCS7.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CIPHER_get_name.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_COMP_add_compression_method.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set1_prefix.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set_flags.3 | 2 +- secure/lib/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 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_add1_chain_cert.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_add_extra_chain_cert.3 | 2 +- secure/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 +- secure/lib/libcrypto/man/man3/SSL_CTX_dane_enable.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_flush_sessions.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_free.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_get0_param.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_get_verify_mode.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_has_client_custom_ext.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_load_verify_locations.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sess_number.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sess_set_cache_size.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sess_set_get_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_sessions.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set0_CA_list.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set1_curves.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set1_sigalgs.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set1_verify_cert_store.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_alpn_select_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_store.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_verify_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_cipher_list.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_client_cert_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_client_hello_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ct_validation_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ctlog_list_file.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_default_passwd_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_generate_session_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_info_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_keylog_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_max_cert_list.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_min_proto_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_mode.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_msg_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_num_tickets.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_options.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_psk_client_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_quiet_shutdown.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_read_ahead.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_record_padding_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_security_level.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_session_cache_mode.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_session_id_context.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_session_ticket_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_split_send_fragment.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_ssl_version.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_stateless_cookie_generate_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_timeout.3 | 2 +- .../lib/libcrypto/man/man3/SSL_CTX_set_tlsext_servername_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_status_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_ticket_key_cb.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_use_srtp.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_tmp_dh_callback.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_set_verify.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_use_certificate.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_use_psk_identity_hint.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_CTX_use_serverinfo.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_free.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_hostname.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_id_context.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get0_peer.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_compress_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_ex_data.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_protocol_version.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_get_time.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_has_ticket.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_is_resumable.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_print.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_SESSION_set1_id.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_accept.3 | 2 +- secure/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 | 2 +- secure/lib/libcrypto/man/man3/SSL_clear.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_connect.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_do_handshake.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_export_keying_material.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_extension_supported.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_free.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get0_peer_scts.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_SSL_CTX.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_all_async_fds.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_ciphers.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_client_random.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_current_cipher.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_default_timeout.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_extms_support.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_fd.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_cert_chain.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_certificate.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_signature_nid.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_peer_tmp_key.3 | 2 +- secure/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 +- secure/lib/libcrypto/man/man3/SSL_get_shared_sigalgs.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_get_verify_result.3 | 2 +- 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 +- secure/lib/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 +- secure/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 | 2 +- secure/lib/libcrypto/man/man3/SSL_set1_host.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_bio.3 | 2 +- secure/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 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_shutdown.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_set_verify_result.3 | 2 +- secure/lib/libcrypto/man/man3/SSL_shutdown.3 | 2 +- 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 | 2 +- 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 +- secure/lib/libcrypto/man/man3/X509_CRL_get0_by_serial.3 | 2 +- secure/lib/libcrypto/man/man3/X509_EXTENSION_set_object.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP_hash_dir.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP_meth_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_ENTRY_get_object.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_add_entry_by_txt.3 | 2 +- secure/lib/libcrypto/man/man3/X509_NAME_get0_der.3 | 2 +- secure/lib/libcrypto/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 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_get_error.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_CTX_set_verify_cb.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_add_cert.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_get0_param.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_new.3 | 2 +- secure/lib/libcrypto/man/man3/X509_STORE_set_verify_cb_func.3 | 2 +- secure/lib/libcrypto/man/man3/X509_VERIFY_PARAM_set_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_ca.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_host.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_issued.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_private_key.3 | 2 +- secure/lib/libcrypto/man/man3/X509_check_purpose.3 | 2 +- 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 +- secure/lib/libcrypto/man/man3/X509_get0_notBefore.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_signature.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get0_uids.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_extension_flags.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_pubkey.3 | 2 +- secure/lib/libcrypto/man/man3/X509_get_serialNumber.3 | 2 +- secure/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 | 2 +- secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3 | 2 +- secure/lib/libcrypto/man/man3/d2i_DHparams.3 | 2 +- secure/lib/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 | 2 +- secure/lib/libcrypto/man/man3/i2d_PKCS7_bio_stream.3 | 2 +- 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 | 2 +- secure/lib/libcrypto/man/man7/RAND_DRBG.7 | 2 +- secure/lib/libcrypto/man/man7/RSA-PSS.7 | 2 +- secure/lib/libcrypto/man/man7/SM2.7 | 2 +- secure/lib/libcrypto/man/man7/X25519.7 | 2 +- secure/lib/libcrypto/man/man7/bio.7 | 2 +- secure/lib/libcrypto/man/man7/ct.7 | 2 +- secure/lib/libcrypto/man/man7/des_modes.7 | 2 +- secure/lib/libcrypto/man/man7/evp.7 | 2 +- secure/lib/libcrypto/man/man7/ossl_store-file.7 | 2 +- secure/lib/libcrypto/man/man7/ossl_store.7 | 2 +- secure/lib/libcrypto/man/man7/passphrase-encoding.7 | 2 +- secure/lib/libcrypto/man/man7/proxy-certificates.7 | 2 +- secure/lib/libcrypto/man/man7/scrypt.7 | 2 +- secure/lib/libcrypto/man/man7/ssl.7 | 2 +- secure/lib/libcrypto/man/man7/x509.7 | 2 +- secure/usr.bin/openssl/man/CA.pl.1 | 2 +- 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 | 2 +- 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 +- 535 files changed, 536 insertions(+), 536 deletions(-) diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc index 9860eb2ca4e1..0edeb9098ecd 100644 --- a/secure/lib/libcrypto/Makefile.inc +++ b/secure/lib/libcrypto/Makefile.inc @@ -3,8 +3,8 @@ .include # OpenSSL version used for manual page generation -OPENSSL_VER= 1.1.1j -OPENSSL_DATE= 2021-02-16 +OPENSSL_VER= 1.1.1k +OPENSSL_DATE= 2021-03-25 LCRYPTO_SRC= ${SRCTOP}/crypto/openssl LCRYPTO_DOC= ${LCRYPTO_SRC}/doc diff --git a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 index 2720754cf9e8..ad086fb0e8e9 100644 --- a/secure/lib/libcrypto/man/man3/ADMISSIONS.3 +++ b/secure/lib/libcrypto/man/man3/ADMISSIONS.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ADMISSIONS 3" -.TH ADMISSIONS 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ADMISSIONS 3 "2021-03-25" "1.1.1k" "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/ASN1_INTEGER_get_int64.3 b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 index 2daf11f19a0d..3c70dcaa8c2d 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_INTEGER_GET_INT64 3" -.TH ASN1_INTEGER_GET_INT64 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASN1_INTEGER_GET_INT64 3 "2021-03-25" "1.1.1k" "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/ASN1_ITEM_lookup.3 b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 index f45f3fdc98ab..04ba1089d333 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_ITEM_LOOKUP 3" -.TH ASN1_ITEM_LOOKUP 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASN1_ITEM_LOOKUP 3 "2021-03-25" "1.1.1k" "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/ASN1_OBJECT_new.3 b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 index 69678622d9fa..54c7476b7c08 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_OBJECT_NEW 3" -.TH ASN1_OBJECT_NEW 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASN1_OBJECT_NEW 3 "2021-03-25" "1.1.1k" "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/ASN1_STRING_TABLE_add.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 index 9b9393cc5290..ad1b19c78546 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_TABLE_ADD 3" -.TH ASN1_STRING_TABLE_ADD 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASN1_STRING_TABLE_ADD 3 "2021-03-25" "1.1.1k" "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/ASN1_STRING_length.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 index ca15f898e6a8..75de680bb66a 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_LENGTH 3" -.TH ASN1_STRING_LENGTH 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASN1_STRING_LENGTH 3 "2021-03-25" "1.1.1k" "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/ASN1_STRING_new.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 index e4f6859c186d..76d17e1c6b23 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_NEW 3" -.TH ASN1_STRING_NEW 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASN1_STRING_NEW 3 "2021-03-25" "1.1.1k" "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/ASN1_STRING_print_ex.3 b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 index fbfcf517275f..d072930ec39d 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_PRINT_EX 3" -.TH ASN1_STRING_PRINT_EX 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASN1_STRING_PRINT_EX 3 "2021-03-25" "1.1.1k" "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/ASN1_TIME_set.3 b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 index 00b72c375820..0a3564196833 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_TIME_SET 3" -.TH ASN1_TIME_SET 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASN1_TIME_SET 3 "2021-03-25" "1.1.1k" "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/ASN1_TYPE_get.3 b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 index 4845c5280b6b..bf12e2b90dd2 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_TYPE_GET 3" -.TH ASN1_TYPE_GET 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASN1_TYPE_GET 3 "2021-03-25" "1.1.1k" "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/ASN1_generate_nconf.3 b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 index ce95ffd0fc29..207255106b3c 100644 --- a/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 +++ b/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_GENERATE_NCONF 3" -.TH ASN1_GENERATE_NCONF 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASN1_GENERATE_NCONF 3 "2021-03-25" "1.1.1k" "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/ASYNC_WAIT_CTX_new.3 b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 index b761db6b5b7a..d1e3abb572db 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASYNC_WAIT_CTX_NEW 3" -.TH ASYNC_WAIT_CTX_NEW 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASYNC_WAIT_CTX_NEW 3 "2021-03-25" "1.1.1k" "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/ASYNC_start_job.3 b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 index 03b06aff8fec..b5bb00413452 100644 --- a/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 +++ b/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "ASYNC_START_JOB 3" -.TH ASYNC_START_JOB 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH ASYNC_START_JOB 3 "2021-03-25" "1.1.1k" "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/BF_encrypt.3 b/secure/lib/libcrypto/man/man3/BF_encrypt.3 index 8916feee640f..58cdcb4fc89e 100644 --- a/secure/lib/libcrypto/man/man3/BF_encrypt.3 +++ b/secure/lib/libcrypto/man/man3/BF_encrypt.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BF_ENCRYPT 3" -.TH BF_ENCRYPT 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BF_ENCRYPT 3 "2021-03-25" "1.1.1k" "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_ADDR.3 b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 index 0dbedbf16b9d..fd492eee9531 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDR.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDR.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_ADDR 3" -.TH BIO_ADDR 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_ADDR 3 "2021-03-25" "1.1.1k" "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_ADDRINFO.3 b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 index fb1d199796cb..7d64b051241a 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_ADDRINFO 3" -.TH BIO_ADDRINFO 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_ADDRINFO 3 "2021-03-25" "1.1.1k" "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_connect.3 b/secure/lib/libcrypto/man/man3/BIO_connect.3 index 44b80366360d..507289d24595 100644 --- a/secure/lib/libcrypto/man/man3/BIO_connect.3 +++ b/secure/lib/libcrypto/man/man3/BIO_connect.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_CONNECT 3" -.TH BIO_CONNECT 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_CONNECT 3 "2021-03-25" "1.1.1k" "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_ctrl.3 b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 index 7d90a1a40792..c290cfceab59 100644 --- a/secure/lib/libcrypto/man/man3/BIO_ctrl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_ctrl.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_CTRL 3" -.TH BIO_CTRL 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_CTRL 3 "2021-03-25" "1.1.1k" "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_base64.3 b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 index 39b94d930d17..14db0fc366a1 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_base64.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_base64.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_BASE64 3" -.TH BIO_F_BASE64 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_F_BASE64 3 "2021-03-25" "1.1.1k" "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 61cfe1eec579..2cd165a9700d 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_BUFFER 3" -.TH BIO_F_BUFFER 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_F_BUFFER 3 "2021-03-25" "1.1.1k" "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_cipher.3 b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 index 33e6f6c95c6e..68b32c47dac7 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_CIPHER 3" -.TH BIO_F_CIPHER 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_F_CIPHER 3 "2021-03-25" "1.1.1k" "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_md.3 b/secure/lib/libcrypto/man/man3/BIO_f_md.3 index 04c3fdaecc20..2a3dec321113 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_md.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_md.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_MD 3" -.TH BIO_F_MD 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_F_MD 3 "2021-03-25" "1.1.1k" "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_null.3 b/secure/lib/libcrypto/man/man3/BIO_f_null.3 index 21225c1e17fe..6d868bd0a10b 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_null.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_null.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_NULL 3" -.TH BIO_F_NULL 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_F_NULL 3 "2021-03-25" "1.1.1k" "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 02b2bcd5e714..0ff1ecc99f79 100644 --- a/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 +++ b/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_F_SSL 3" -.TH BIO_F_SSL 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_F_SSL 3 "2021-03-25" "1.1.1k" "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_find_type.3 b/secure/lib/libcrypto/man/man3/BIO_find_type.3 index 579435574865..e4757943b8be 100644 --- a/secure/lib/libcrypto/man/man3/BIO_find_type.3 +++ b/secure/lib/libcrypto/man/man3/BIO_find_type.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_FIND_TYPE 3" -.TH BIO_FIND_TYPE 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_FIND_TYPE 3 "2021-03-25" "1.1.1k" "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_get_data.3 b/secure/lib/libcrypto/man/man3/BIO_get_data.3 index df2d8f5667dd..5297cc0f2214 100644 --- a/secure/lib/libcrypto/man/man3/BIO_get_data.3 +++ b/secure/lib/libcrypto/man/man3/BIO_get_data.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_GET_DATA 3" -.TH BIO_GET_DATA 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_GET_DATA 3 "2021-03-25" "1.1.1k" "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_get_ex_new_index.3 b/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 index 31914a912318..78d970c7267f 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 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_GET_EX_NEW_INDEX 3" -.TH BIO_GET_EX_NEW_INDEX 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_GET_EX_NEW_INDEX 3 "2021-03-25" "1.1.1k" "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_meth_new.3 b/secure/lib/libcrypto/man/man3/BIO_meth_new.3 index 5f77a8668b58..8953efaf4441 100644 --- a/secure/lib/libcrypto/man/man3/BIO_meth_new.3 +++ b/secure/lib/libcrypto/man/man3/BIO_meth_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_METH_NEW 3" -.TH BIO_METH_NEW 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_METH_NEW 3 "2021-03-25" "1.1.1k" "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_new.3 b/secure/lib/libcrypto/man/man3/BIO_new.3 index d37e03bbe65f..4d861bfdfa20 100644 --- a/secure/lib/libcrypto/man/man3/BIO_new.3 +++ b/secure/lib/libcrypto/man/man3/BIO_new.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_NEW 3" -.TH BIO_NEW 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_NEW 3 "2021-03-25" "1.1.1k" "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_new_CMS.3 b/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 index 4c5f7a282ced..0c662446b29a 100644 --- a/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 +++ b/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_NEW_CMS 3" -.TH BIO_NEW_CMS 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_NEW_CMS 3 "2021-03-25" "1.1.1k" "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_parse_hostserv.3 b/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 index 89758f5f6b2c..1ab7d109d1fc 100644 --- a/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 +++ b/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_PARSE_HOSTSERV 3" -.TH BIO_PARSE_HOSTSERV 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_PARSE_HOSTSERV 3 "2021-03-25" "1.1.1k" "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_printf.3 b/secure/lib/libcrypto/man/man3/BIO_printf.3 index f56b2c28937c..2c3bd3d70180 100644 --- a/secure/lib/libcrypto/man/man3/BIO_printf.3 +++ b/secure/lib/libcrypto/man/man3/BIO_printf.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "BIO_PRINTF 3" -.TH BIO_PRINTF 3 "2021-02-16" "1.1.1j" "OpenSSL" +.TH BIO_PRINTF 3 "2021-03-25" "1.1.1k" "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_push.3 b/secure/lib/libcrypto/man/man3/BIO_push.3 index 359dfe245ae7..1c5c39143c0b 100644 --- a/secure/lib/libcrypto/man/man3/BIO_push.3 +++ b/secure/lib/libcrypto/man/man3/BIO_push.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" *** 6519 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Mar 25 16:20:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 906B85C3485; Thu, 25 Mar 2021 16:20: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 4F5r1c3lXGz3qJ0; Thu, 25 Mar 2021 16:20: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 739FF240B; Thu, 25 Mar 2021 16:20: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 12PGKaoG078283; Thu, 25 Mar 2021 16:20:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PGKain078282; Thu, 25 Mar 2021 16:20:36 GMT (envelope-from git) Date: Thu, 25 Mar 2021 16:20:36 GMT Message-Id: <202103251620.12PGKain078282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: 9f50aa45be18 - main - [PowerPC64] Port optimized strcpy to PPC64LE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f50aa45be18b9b11b14345fe0a137d1ac51a391 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 16:20:36 -0000 The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=9f50aa45be18b9b11b14345fe0a137d1ac51a391 commit 9f50aa45be18b9b11b14345fe0a137d1ac51a391 Author: Leandro Lupori AuthorDate: 2021-03-25 16:14:00 +0000 Commit: Leandro Lupori CommitDate: 2021-03-25 16:20:12 +0000 [PowerPC64] Port optimized strcpy to PPC64LE Submitted by: Bruno Larsen Reviewed by: luporl, bdragon (IRC) MFC after: 1 week Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D29067 --- lib/libc/powerpc64/string/Makefile.inc | 7 +-- lib/libc/powerpc64/string/strcpy_arch_2_05.S | 66 ++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/lib/libc/powerpc64/string/Makefile.inc b/lib/libc/powerpc64/string/Makefile.inc index 14f0845595c9..486ca47a44be 100644 --- a/lib/libc/powerpc64/string/Makefile.inc +++ b/lib/libc/powerpc64/string/Makefile.inc @@ -12,12 +12,7 @@ MDSRCS+= \ memmove_resolver.c \ strncpy_arch_2_05.S \ strncpy.c \ - strncpy_resolver.c - -# XXX Port strcpy to LE. -.if ${MACHINE_ARCH} == "powerpc64" -MDSRCS+= \ + strncpy_resolver.c \ strcpy_arch_2_05.S \ strcpy.c \ strcpy_resolver.c -.endif diff --git a/lib/libc/powerpc64/string/strcpy_arch_2_05.S b/lib/libc/powerpc64/string/strcpy_arch_2_05.S index 23ffb5c2a75e..7f42fd813395 100644 --- a/lib/libc/powerpc64/string/strcpy_arch_2_05.S +++ b/lib/libc/powerpc64/string/strcpy_arch_2_05.S @@ -26,9 +26,6 @@ * SUCH DAMAGE. */ -#if !defined(__BIG_ENDIAN__) -#error "Optimized SRTCPY is only supported by big-endian architecture!" -#endif #include __FBSDID("$FreeBSD$"); @@ -71,6 +68,7 @@ ENTRY(__strcpy_arch_2_05) beq cr7,.Lcopy_dw_loop addi %r8,%r8,8 /* Forward r8 to use std instruction. */ +#if defined(__BIG_ENDIAN__) /* Find where the zero is located. */ .Lcheck_zero: rldicr. %r5,%r0,0,7 @@ -136,6 +134,68 @@ ENTRY(__strcpy_arch_2_05) .Lfound_on_byte_0: srdi %r6,%r0,56 stb %r6,0(%r8) +#elif defined(__LITTLE_ENDIAN__) +/* Find where the zero is located. */ +.Lcheck_zero: + andi. %r7,%r0,0xff + beq .Lfound_on_byte_0 + andi. %r7,%r0,0xff00 + beq .Lfound_on_byte_1 + andis. %r7,%r0,0xff + beq .Lfound_on_byte_2 + andis. %r7,%r0,0xff00 + beq .Lfound_on_byte_3 + rldicr. %r7,%r0,24,7 + beq .Lfound_on_byte_4 + rldicr. %r7,%r0,16,7 + beq .Lfound_on_byte_5 + rldicr. %r7,%r0,8,7 + beq .Lfound_on_byte_6 + +/* Copy the last string bytes according to the string end position. */ +.Lfound_on_byte_7: + std %r0,0(%r8) + b .Lexit + +.Lfound_on_byte_6: + stw %r0,0(%r8) + srdi %r6,%r0,32 + sth %r6,4(%r8) + srdi %r6,%r0,48 + stb %r6,6(%r8) + b .Lexit + +.Lfound_on_byte_5: + stw %r0,0(%r8) + srdi %r6,%r0,32 + sth %r6,4(%r8) + b .Lexit + +.Lfound_on_byte_4: + stw %r0,0(%r8) + srdi %r6,%r0,32 + stb %r6,4(%r8) + b .Lexit + +.Lfound_on_byte_3: + stw %r0,0(%r8) + b .Lexit + +.Lfound_on_byte_2: + sth %r0,0(%r8) + srdi %r6,%r0,16 + stb %r6,2(%r8) + b .Lexit + +.Lfound_on_byte_1: + sth %r0,0(%r8) + b .Lexit + +.Lfound_on_byte_0: + stb %r0,0(%r8) +#else +#error "Unable to determine Endianness" +#endif .Lexit: blr From owner-dev-commits-src-main@freebsd.org Thu Mar 25 17:05:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C26C05C499E; Thu, 25 Mar 2021 17:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5s1B5CNGz3tTR; Thu, 25 Mar 2021 17:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5C272DBB; Thu, 25 Mar 2021 17:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12PH5I90039442; Thu, 25 Mar 2021 17:05:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PH5Iis039441; Thu, 25 Mar 2021 17:05:18 GMT (envelope-from git) Date: Thu, 25 Mar 2021 17:05:18 GMT Message-Id: <202103251705.12PH5Iis039441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: 3d0399c718b2 - main - [PowerPC64] Clear low-order bits of ARPN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d0399c718b260da087d28825069f26d4f670065 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 17:05:18 -0000 The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=3d0399c718b260da087d28825069f26d4f670065 commit 3d0399c718b260da087d28825069f26d4f670065 Author: Leandro Lupori AuthorDate: 2021-03-25 16:30:56 +0000 Commit: Leandro Lupori CommitDate: 2021-03-25 17:01:57 +0000 [PowerPC64] Clear low-order bits of ARPN PowerISA 2.07B says that the low-order p-12 bits of the real page number contained in ARPN and LP fields of a PTE must be 0s and are ignored by the hardware (Book III-S, 5.7.7.1), where 2^p is the actual page size in bytes, but we were clearing only the LP field. This worked on bare metal and QEMU with KVM, that ignore these bits, but caused a kernel panic on QEMU with TCG, that expects them to be cleared. This fixes running FreeBSD with HPT superpages enabled on QEMU with TCG. MFC after: 2 weeks Sponsored by: Eldorado Research Institute (eldorado.org.br) --- sys/powerpc/aim/mmu_oea64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 14fea6f29a52..1aa05501bd1b 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -3717,7 +3717,7 @@ moea64_sp_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, pvo = pvos[i]; pvo->pvo_pte.prot = prot; - pvo->pvo_pte.pa = (pa & ~LPTE_LP_MASK) | LPTE_LP_4K_16M | + pvo->pvo_pte.pa = (pa & ~HPT_SP_MASK) | LPTE_LP_4K_16M | moea64_calc_wimg(pa, pmap_page_get_memattr(m)); if ((flags & PMAP_ENTER_WIRED) != 0) @@ -3874,7 +3874,7 @@ moea64_sp_promote(pmap_t pmap, vm_offset_t va, vm_page_t m) for (pvo = first, va_end = PVO_VADDR(pvo) + HPT_SP_SIZE; pvo != NULL && PVO_VADDR(pvo) < va_end; pvo = RB_NEXT(pvo_tree, &pmap->pmap_pvo, pvo)) { - pvo->pvo_pte.pa &= ~LPTE_LP_MASK; + pvo->pvo_pte.pa &= ADDR_POFF | ~HPT_SP_MASK; pvo->pvo_pte.pa |= LPTE_LP_4K_16M; pvo->pvo_vaddr |= PVO_LARGE; } From owner-dev-commits-src-main@freebsd.org Thu Mar 25 18:29:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E5BA5C72EB; Thu, 25 Mar 2021 18:29: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 4F5ttb1jv8z4Txb; Thu, 25 Mar 2021 18:29: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 2DB533970; Thu, 25 Mar 2021 18:29: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 12PIThxa052285; Thu, 25 Mar 2021 18:29:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PIThCA052284; Thu, 25 Mar 2021 18:29:43 GMT (envelope-from git) Date: Thu, 25 Mar 2021 18:29:43 GMT Message-Id: <202103251829.12PIThCA052284@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: f9839a42ee5d - main - ce: remove long-obsolete FreeBSD version compatibility 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: f9839a42ee5d67c885023ca74e797b5aec50bf59 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 18:29:43 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f9839a42ee5d67c885023ca74e797b5aec50bf59 commit f9839a42ee5d67c885023ca74e797b5aec50bf59 Author: Ed Maste AuthorDate: 2021-03-25 02:48:50 +0000 Commit: Ed Maste CommitDate: 2021-03-25 18:29:20 +0000 ce: remove long-obsolete FreeBSD version compatibility Mechanical change via unifdef. --- sys/dev/ce/if_ce.c | 514 ----------------------------------------------------- 1 file changed, 514 deletions(-) diff --git a/sys/dev/ce/if_ce.c b/sys/dev/ce/if_ce.c index ac1e6fe59af2..9b3cff9adfeb 100644 --- a/sys/dev/ce/if_ce.c +++ b/sys/dev/ce/if_ce.c @@ -20,11 +20,7 @@ __FBSDID("$FreeBSD$"); #include -#if __FreeBSD_version >= 500000 # define NPCI 1 -#else -# include "pci.h" -#endif #if NPCI > 0 @@ -39,22 +35,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if __FreeBSD_version >= 504000 #include -#endif #include #include #include #include #include #include -#if __FreeBSD_version > 501000 # include # include -#else -# include -# include -#endif #include #include #include "opt_ng_cronyx.h" @@ -148,10 +137,8 @@ typedef struct _ce_dma_mem_t { unsigned long phys; void *virt; size_t size; -#if __FreeBSD_version >= 500000 bus_dma_tag_t dmat; bus_dmamap_t mapp; -#endif } ce_dma_mem_t; typedef struct _drv_t { @@ -172,11 +159,7 @@ typedef struct _drv_t { #endif short timeout; struct callout timeout_handle; -#if __FreeBSD_version >= 500000 struct cdev *devt; -#else /* __FreeBSD_version < 500000 */ - dev_t devt; -#endif ce_dma_mem_t dmamem; } drv_t; @@ -187,9 +170,7 @@ typedef struct _bdrv_t { void *ce_intrhand; ce_dma_mem_t dmamem; drv_t channel [NCHAN]; -#if __FreeBSD_version >= 504000 struct mtx ce_mtx; -#endif } bdrv_t; static driver_t ce_driver = { @@ -225,72 +206,16 @@ static struct callout timeout_handle; static int ce_destroy = 0; -#if __FreeBSD_version < 500000 -static int ce_open (dev_t dev, int oflags, int devtype, struct proc *p); -static int ce_close (dev_t dev, int fflag, int devtype, struct proc *p); -static int ce_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p); -#else static int ce_open (struct cdev *dev, int oflags, int devtype, struct thread *td); static int ce_close (struct cdev *dev, int fflag, int devtype, struct thread *td); static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td); -#endif -#if __FreeBSD_version < 500000 -static struct cdevsw ce_cdevsw = { - ce_open, ce_close, noread, nowrite, - ce_ioctl, nopoll, nommap, nostrategy, - "ce", CDEV_MAJOR, nodump, nopsize, - D_NAGGED, -1 - }; -#elif __FreeBSD_version == 500000 -static struct cdevsw ce_cdevsw = { - ce_open, ce_close, noread, nowrite, - ce_ioctl, nopoll, nommap, nostrategy, - "ce", CDEV_MAJOR, nodump, nopsize, - D_NAGGED, - }; -#elif __FreeBSD_version <= 501000 -static struct cdevsw ce_cdevsw = { - .d_open = ce_open, - .d_close = ce_close, - .d_read = noread, - .d_write = nowrite, - .d_ioctl = ce_ioctl, - .d_poll = nopoll, - .d_mmap = nommap, - .d_strategy = nostrategy, - .d_name = "ce", - .d_maj = CDEV_MAJOR, - .d_dump = nodump, - .d_flags = D_NAGGED, -}; -#elif __FreeBSD_version < 502103 -static struct cdevsw ce_cdevsw = { - .d_open = ce_open, - .d_close = ce_close, - .d_ioctl = ce_ioctl, - .d_name = "ce", - .d_maj = CDEV_MAJOR, - .d_flags = D_NAGGED, -}; -#elif __FreeBSD_version < 600000 static struct cdevsw ce_cdevsw = { .d_version = D_VERSION, .d_open = ce_open, .d_close = ce_close, .d_ioctl = ce_ioctl, .d_name = "ce", - .d_maj = CDEV_MAJOR, - .d_flags = D_NEEDGIANT, }; -#else /* __FreeBSD_version >= 600000 */ -static struct cdevsw ce_cdevsw = { - .d_version = D_VERSION, - .d_open = ce_open, - .d_close = ce_close, - .d_ioctl = ce_ioctl, - .d_name = "ce", -}; -#endif /* * Make an mbuf from data. @@ -411,11 +336,7 @@ static void ce_intr (void *arg) continue; #ifdef NETGRAPH if (d->hook) { -#if __FreeBSD_version >= 500000 NG_SEND_DATA_ONLY (error, d->hook, m); -#else - ng_queue_data (d->hook, m, 0); -#endif } else { IF_DRAIN (&d->rqueue); } @@ -426,7 +347,6 @@ static void ce_intr (void *arg) } } -#if __FreeBSD_version >= 500000 static void ce_bus_dmamap_addr (void *arg, bus_dma_segment_t *segs, int nseg, int error) { @@ -452,9 +372,7 @@ ce_bus_dma_mem_alloc (int bnum, int cnum, ce_dma_mem_t *dmem) error = bus_dma_tag_create (NULL, 16, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, dmem->size, 1, dmem->size, 0, -#if __FreeBSD_version >= 502000 NULL, NULL, -#endif &dmem->dmat); if (error) { if (cnum >= 0) printf ("ce%d-%d: ", bnum, cnum); @@ -481,9 +399,7 @@ ce_bus_dma_mem_alloc (int bnum, int cnum, ce_dma_mem_t *dmem) bus_dma_tag_destroy (dmem->dmat); return 0; } -#if __FreeBSD_version >= 502000 bzero (dmem->virt, dmem->size); -#endif return 1; } @@ -494,29 +410,6 @@ ce_bus_dma_mem_free (ce_dma_mem_t *dmem) bus_dmamem_free (dmem->dmat, dmem->virt, dmem->mapp); bus_dma_tag_destroy (dmem->dmat); } -#else -static int -ce_bus_dma_mem_alloc (int bnum, int cnum, ce_dma_mem_t *dmem) -{ - dmem->virt = contigmalloc (dmem->size, M_DEVBUF, M_WAITOK, - 0x100000, 0xffffffff, 16, 0); - if (dmem->virt == NULL) { - if (cnum >= 0) printf ("ce%d-%d: ", bnum, cnum); - else printf ("ce%d: ", bnum); - printf ("couldn't allocate dma memory\n"); - return 0; - } - dmem->phys = vtophys (dmem->virt); - bzero (dmem->virt, dmem->size); - return 1; -} - -static void -ce_bus_dma_mem_free (ce_dma_mem_t *dmem) -{ - contigfree (dmem->virt, dmem->size, M_DEVBUF); -} -#endif /* * Called if the probe succeeded. @@ -525,9 +418,7 @@ static int ce_attach (device_t dev) { bdrv_t *bd = device_get_softc (dev); int unit = device_get_unit (dev); -#if __FreeBSD_version >= 504000 char *ce_ln = CE_LOCK_NAME; -#endif vm_offset_t vbase; int rid, error; ce_board_t *b; @@ -544,9 +435,7 @@ static int ce_attach (device_t dev) b->ddk.sys = &b; -#if __FreeBSD_version >= 440000 pci_enable_busmaster (dev); -#endif bd->dmamem.size = TAU32_ControllerObjectSize; if (! ce_bus_dma_mem_alloc (unit, -1, &bd->dmamem)) { @@ -603,17 +492,9 @@ static int ce_attach (device_t dev) splx (s); return (ENXIO); } -#if __FreeBSD_version >= 500000 callout_init (&led_timo[unit], 1); -#else - callout_init (&led_timo[unit]); -#endif error = bus_setup_intr (dev, bd->ce_irq, -#if __FreeBSD_version >= 500013 INTR_TYPE_NET|INTR_MPSAFE, -#else - INTR_TYPE_NET, -#endif NULL, ce_intr, bd, &bd->ce_intrhand); if (error) { printf ("ce%d: cannot set up irq\n", unit); @@ -663,58 +544,35 @@ static int ce_attach (device_t dev) d->node = NULL; continue; } -#if __FreeBSD_version >= 500000 NG_NODE_SET_PRIVATE (d->node, d); -#else - d->node->private = d; -#endif sprintf (d->nodename, "%s%d", NG_CE_NODE_TYPE, c->board->num * NCHAN + c->num); if (ng_name_node (d->node, d->nodename)) { printf ("%s: cannot name node\n", d->nodename); -#if __FreeBSD_version >= 500000 NG_NODE_UNREF (d->node); -#else - ng_rmnode (d->node); - ng_unref (d->node); -#endif continue; } d->queue.ifq_maxlen = ifqmaxlen; d->hi_queue.ifq_maxlen = ifqmaxlen; d->rqueue.ifq_maxlen = ifqmaxlen; -#if __FreeBSD_version >= 500000 mtx_init (&d->queue.ifq_mtx, "ce_queue", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "ce_queue_hi", NULL, MTX_DEF); mtx_init (&d->rqueue.ifq_mtx, "ce_rqueue", NULL, MTX_DEF); -#endif #else /*NETGRAPH*/ -#if __FreeBSD_version >= 600031 d->ifp = if_alloc(IFT_PPP); -#else - d->ifp = malloc (sizeof(struct sppp), M_DEVBUF, M_WAITOK); - bzero (d->ifp, sizeof(struct sppp)); -#endif if (!d->ifp) { printf ("%s: cannot if_alloc() interface\n", d->name); continue; } d->ifp->if_softc = d; -#if __FreeBSD_version > 501000 if_initname (d->ifp, "ce", b->num * NCHAN + c->num); -#else - d->ifp->if_unit = b->num * NCHAN + c->num; - d->ifp->if_name = "ce"; -#endif d->ifp->if_mtu = PP_MTU; d->ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; d->ifp->if_ioctl = ce_sioctl; d->ifp->if_start = ce_ifstart; d->ifp->if_init = ce_initialize; d->rqueue.ifq_maxlen = ifqmaxlen; -#if __FreeBSD_version >= 500000 mtx_init (&d->rqueue.ifq_mtx, "ce_rqueue", NULL, MTX_DEF); -#endif sppp_attach (d->ifp); if_attach (d->ifp); IFP2SP(d->ifp)->pp_tlf = ce_tlf; @@ -733,10 +591,8 @@ static int ce_attach (device_t dev) GID_WHEEL, 0600, "ce%d", b->num*NCHAN+c->num); } -#if __FreeBSD_version >= 504000 ce_ln[2] = '0' + unit; mtx_init (&bd->ce_mtx, ce_ln, MTX_NETWORK_LOCK, MTX_DEF|MTX_RECURSE); -#endif CE_LOCK (bd); TAU32_EnableInterrupts(b->ddk.pControllerObject); adapter[unit] = b; @@ -753,9 +609,7 @@ static int ce_detach (device_t dev) ce_chan_t *c; int s; -#if __FreeBSD_version >= 504000 KASSERT (mtx_initialized (&bd->ce_mtx), ("ce mutex not initialized")); -#endif s = splimp (); CE_LOCK (bd); /* Check if the device is busy (open). */ @@ -794,18 +648,11 @@ static int ce_detach (device_t dev) /* Detach from the system list of interfaces. */ if_detach (d->ifp); -#if __FreeBSD_version > 600031 if_free(d->ifp); -#else - free (d->ifp, M_DEVBUF); -#endif IF_DRAIN (&d->rqueue); -#if __FreeBSD_version >= 500000 mtx_destroy (&d->rqueue.ifq_mtx); -#endif #else -#if __FreeBSD_version >= 500000 if (d->node) { ng_rmnode_self (d->node); NG_NODE_UNREF (d->node); @@ -815,10 +662,6 @@ static int ce_detach (device_t dev) mtx_destroy (&d->queue.ifq_mtx); mtx_destroy (&d->hi_queue.ifq_mtx); mtx_destroy (&d->rqueue.ifq_mtx); -#else - ng_rmnode (d->node); - d->node = 0; -#endif #endif destroy_dev (d->devt); } @@ -847,9 +690,7 @@ static int ce_detach (device_t dev) adapter [b->num] = NULL; ce_bus_dma_mem_free (&bd->dmamem); free (b, M_DEVBUF); -#if __FreeBSD_version >= 504000 mtx_destroy (&bd->ce_mtx); -#endif return 0; } @@ -889,11 +730,7 @@ static int ce_sioctl (struct ifnet *ifp, u_long cmd, caddr_t data) bdrv_t *bd = d->board->sys; int error, s, was_up, should_be_up; -#if __FreeBSD_version >= 600034 was_up = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; -#else - was_up = (ifp->if_flags & IFF_RUNNING) != 0; -#endif error = sppp_ioctl (ifp, cmd, data); if (error) @@ -915,11 +752,7 @@ static int ce_sioctl (struct ifnet *ifp, u_long cmd, caddr_t data) /* We get here only in case of SIFFLAGS or SIFADDR. */ s = splimp (); CE_LOCK (bd); -#if __FreeBSD_version >= 600034 should_be_up = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; -#else - should_be_up = (ifp->if_flags & IFF_RUNNING) != 0; -#endif if (! was_up && should_be_up) { /* Interface goes up -- start it. */ ce_up (d); @@ -1001,18 +834,9 @@ static void ce_send (drv_t *d) if (! m) return; #ifndef NETGRAPH -#if __FreeBSD_version >= 500000 BPF_MTAP (d->ifp, m); -#else - if (d->ifp->if_bpf) - bpf_mtap (d->ifp, m); #endif -#endif -#if __FreeBSD_version >= 490000 len = m_length (m, NULL); -#else - len = m->m_pkthdr.len; -#endif if (len >= BUFSZ) printf ("%s: too long packet: %d bytes: ", d->name, len); @@ -1028,11 +852,7 @@ static void ce_send (drv_t *d) d->timeout = 10; } #ifndef NETGRAPH -#if __FreeBSD_version >= 600034 d->ifp->if_flags |= IFF_DRV_OACTIVE; -#else - d->ifp->if_flags |= IFF_OACTIVE; -#endif #endif } @@ -1092,11 +912,7 @@ static void ce_transmit (ce_chan_t *c, void *attachment, int len) d->timeout = 0; #ifndef NETGRAPH if_inc_counter(d->ifp, IFCOUNTER_OPACKETS, 1); -#if __FreeBSD_version >= 600034 d->ifp->if_flags &= ~IFF_DRV_OACTIVE; -#else - d->ifp->if_flags &= ~IFF_OACTIVE; -#endif #endif ce_start (d); } @@ -1167,11 +983,7 @@ static void ce_error (ce_chan_t *c, int data) d->timeout = 0; #ifndef NETGRAPH if_inc_counter(d->ifp, IFCOUNTER_OERRORS, 1); -#if __FreeBSD_version >= 600034 d->ifp->if_flags &= ~IFF_DRV_OACTIVE; -#else - d->ifp->if_flags &= ~IFF_OACTIVE; -#endif #endif ce_start (d); break; @@ -1185,11 +997,7 @@ static void ce_error (ce_chan_t *c, int data) * You also need read, write, open, close routines. * This should get you started */ -#if __FreeBSD_version < 500000 -static int ce_open (dev_t dev, int oflags, int devtype, struct proc *p) -#else static int ce_open (struct cdev *dev, int oflags, int devtype, struct thread *td) -#endif { int unit = dev2unit (dev); drv_t *d; @@ -1203,11 +1011,7 @@ static int ce_open (struct cdev *dev, int oflags, int devtype, struct thread *td /* * Only called on the LAST close. */ -#if __FreeBSD_version < 500000 -static int ce_close (dev_t dev, int fflag, int devtype, struct proc *p) -#else static int ce_close (struct cdev *dev, int fflag, int devtype, struct thread *td) -#endif { drv_t *d = channel [dev2unit (dev)]; @@ -1234,11 +1038,7 @@ static int ce_modem_status (ce_chan_t *c) return status; } -#if __FreeBSD_version < 500000 -static int ce_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) -#else static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) -#endif { drv_t *d = channel [dev2unit (dev)]; bdrv_t *bd = d->board->sys; @@ -1268,20 +1068,10 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETPROTO: CE_DEBUG2 (d, ("ioctl: setproto\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; -#if __FreeBSD_version >= 600034 if (d->ifp->if_flags & IFF_DRV_RUNNING) -#else - if (d->ifp->if_flags & IFF_RUNNING) -#endif return EBUSY; if (! strcmp ("cisco", (char*)data)) { IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); @@ -1311,13 +1101,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETKEEPALIVE: CE_DEBUG2 (d, ("ioctl: setkeepalive\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; if ((IFP2SP(d->ifp)->pp_flags & PP_FR) || @@ -1341,13 +1125,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETMODE: /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; if (*(int*)data != SERIAL_HDLC) @@ -1361,13 +1139,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETCFG: CE_DEBUG2 (d, ("ioctl: setcfg\n")); -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; if (*((char*)data) != 'c') @@ -1463,13 +1235,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_CLRSTAT: CE_DEBUG2 (d, ("ioctl: clrstat\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; c->rintr = 0; @@ -1499,13 +1265,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc if (c->type != T_E1) return EINVAL; /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; s = splimp (); @@ -1527,13 +1287,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc if (c->type != T_E1) return EINVAL; /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; s = splimp (); @@ -1551,13 +1305,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETDEBUG: CE_DEBUG2 (d, ("ioctl: setdebug\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; #ifndef NETGRAPH @@ -1584,13 +1332,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc if (c->type != T_E1 || !c->unfram) return EINVAL; /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; s = splimp (); @@ -1610,13 +1352,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETTIMESLOTS: CE_DEBUG2 (d, ("ioctl: settimeslots\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; if ((c->type != T_E1 || c->unfram) && c->type != T_DATA) @@ -1640,13 +1376,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc if (c->type != T_E1) return EINVAL; /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; s = splimp (); @@ -1664,13 +1394,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETPHONY: CE_DEBUG2 (d, ("ioctl: setphony\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; s = splimp (); @@ -1692,13 +1416,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc if (c->type != T_E1 || c->num != 0) return EINVAL; /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; s = splimp (); @@ -1718,13 +1436,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETSCRAMBLER: CE_DEBUG2 (d, ("ioctl: setscrambler\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; if (!c->unfram) @@ -1746,13 +1458,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETMONITOR: CE_DEBUG2 (d, ("ioctl: setmonitor\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; if (c->type != T_E1) @@ -1774,13 +1480,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETUSE16: CE_DEBUG2 (d, ("ioctl: setuse16\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; if (c->type != T_E1) @@ -1802,13 +1502,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETCRC4: CE_DEBUG2 (d, ("ioctl: setcrc4\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; if (c->type != T_E1 || c->unfram) @@ -1835,13 +1529,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETCLK: CE_DEBUG2 (d, ("ioctl: setclk\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; if (c->type != T_E1) @@ -1862,13 +1550,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_RESET: CE_DEBUG2 (d, ("ioctl: reset\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; s = splimp (); @@ -1881,13 +1563,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_HARDRESET: CE_DEBUG2 (d, ("ioctl: hardreset\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; s = splimp (); @@ -1919,13 +1595,7 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc case SERIAL_SETDIR: CE_DEBUG2 (d, ("ioctl: setdir\n")); /* Only for superuser! */ -#if __FreeBSD_version < 500000 - error = suser (p); -#elif __FreeBSD_version < 700000 - error = suser (td); -#else error = priv_check (td, PRIV_DRIVER); -#endif if (error) return error; s = splimp (); @@ -1986,15 +1656,9 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc } #ifdef NETGRAPH -#if __FreeBSD_version >= 500000 static int ng_ce_constructor (node_p node) { drv_t *d = NG_NODE_PRIVATE (node); -#else -static int ng_ce_constructor (node_p *node) -{ - drv_t *d = (*node)->private; -#endif CE_DEBUG (d, ("Constructor\n")); return EINVAL; } @@ -2002,21 +1666,13 @@ static int ng_ce_constructor (node_p *node) static int ng_ce_newhook (node_p node, hook_p hook, const char *name) { int s; -#if __FreeBSD_version >= 500000 drv_t *d = NG_NODE_PRIVATE (node); -#else - drv_t *d = node->private; -#endif bdrv_t *bd = d->board->sys; CE_DEBUG (d, ("Newhook\n")); /* Attach debug hook */ if (strcmp (name, NG_CE_HOOK_DEBUG) == 0) { -#if __FreeBSD_version >= 500000 NG_HOOK_SET_PRIVATE (hook, NULL); -#else - hook->private = 0; -#endif d->debug_hook = hook; return 0; } @@ -2025,11 +1681,7 @@ static int ng_ce_newhook (node_p node, hook_p hook, const char *name) if (strcmp (name, NG_CE_HOOK_RAW) != 0) return EINVAL; -#if __FreeBSD_version >= 500000 NG_HOOK_SET_PRIVATE (hook, d); -#else - hook->private = d; -#endif d->hook = hook; s = splimp (); CE_LOCK (bd); @@ -2259,24 +1911,15 @@ static int print_chan (char *s, ce_chan_t *c) return length; } -#if __FreeBSD_version >= 500000 static int ng_ce_rcvmsg (node_p node, item_p item, hook_p lasthook) { drv_t *d = NG_NODE_PRIVATE (node); struct ng_mesg *msg; -#else -static int ng_ce_rcvmsg (node_p node, struct ng_mesg *msg, - const char *retaddr, struct ng_mesg **rptr) -{ - drv_t *d = node->private; -#endif struct ng_mesg *resp = NULL; int error = 0; CE_DEBUG (d, ("Rcvmsg\n")); -#if __FreeBSD_version >= 500000 NGI_GET_MSG (item, msg); -#endif switch (msg->header.typecookie) { default: error = EINVAL; @@ -2298,20 +1941,11 @@ static int ng_ce_rcvmsg (node_p node, struct ng_mesg *msg, int l = 0; int dl = sizeof (struct ng_mesg) + 730; -#if __FreeBSD_version >= 500000 NG_MKRESPONSE (resp, msg, dl, M_NOWAIT); if (! resp) { error = ENOMEM; break; } -#else - resp = malloc (M_NETGRAPH, M_NOWAIT); - if (! resp) { - error = ENOMEM; - break; - } - bzero (resp, dl); -#endif s = (resp)->data; if (d) { l += print_chan (s + l, d->chan); @@ -2320,104 +1954,53 @@ static int ng_ce_rcvmsg (node_p node, struct ng_mesg *msg, l += print_e1_stats (s + l, d->chan); } else l += sprintf (s + l, "Error: node not connect to channel"); -#if __FreeBSD_version < 500000 - (resp)->header.version = NG_VERSION; - (resp)->header.arglen = strlen (s) + 1; - (resp)->header.token = msg->header.token; - (resp)->header.typecookie = NGM_CE_COOKIE; - (resp)->header.cmd = msg->header.cmd; -#endif strncpy ((resp)->header.cmdstr, "status", NG_CMDSTRSIZ); } break; } break; } -#if __FreeBSD_version >= 500000 NG_RESPOND_MSG (error, node, item, resp); NG_FREE_MSG (msg); -#else - *rptr = resp; - free (msg, M_NETGRAPH); -#endif return error; } -#if __FreeBSD_version >= 500000 static int ng_ce_rcvdata (hook_p hook, item_p item) { drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE(hook)); struct mbuf *m; -#if __FreeBSD_version < 502120 - meta_p meta; -#else struct ng_tag_prio *ptag; -#endif -#else -static int ng_ce_rcvdata (hook_p hook, struct mbuf *m, meta_p meta) -{ - drv_t *d = hook->node->private; -#endif bdrv_t *bd = d->board->sys; struct ifqueue *q; int s; CE_DEBUG2 (d, ("Rcvdata\n")); -#if __FreeBSD_version >= 500000 NGI_GET_M (item, m); -#if __FreeBSD_version < 502120 - NGI_GET_META (item, meta); -#endif NG_FREE_ITEM (item); if (! NG_HOOK_PRIVATE (hook) || ! d) { NG_FREE_M (m); -#if __FreeBSD_version < 502120 - NG_FREE_META (meta); -#endif -#else - if (! hook->private || ! d) { - NG_FREE_DATA (m,meta); -#endif return ENETDOWN; } -#if __FreeBSD_version >= 502120 /* Check for high priority data */ if ((ptag = (struct ng_tag_prio *)m_tag_locate(m, NGM_GENERIC_COOKIE, NG_TAG_PRIO, NULL)) != NULL && (ptag->priority > NG_PRIO_CUTOFF) ) q = &d->hi_queue; else q = &d->queue; -#else - q = (meta && meta->priority > 0) ? &d->hi_queue : &d->queue; -#endif s = splimp (); CE_LOCK (bd); -#if __FreeBSD_version >= 500000 IF_LOCK (q); if (_IF_QFULL (q)) { IF_UNLOCK (q); CE_UNLOCK (bd); splx (s); NG_FREE_M (m); *** 200 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Mar 25 18:31:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 296C55C7788; Thu, 25 Mar 2021 18:31: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 4F5twm0kVtz4V74; Thu, 25 Mar 2021 18:31: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 0BF8A4200; Thu, 25 Mar 2021 18:31: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 12PIVZvj061678; Thu, 25 Mar 2021 18:31:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PIVZqB061677; Thu, 25 Mar 2021 18:31:35 GMT (envelope-from git) Date: Thu, 25 Mar 2021 18:31:35 GMT Message-Id: <202103251831.12PIVZqB061677@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: 2f189a0688c9 - main - ndis: remove leftover sys/modules/ndis 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: 2f189a0688c9dce8b908cb3e541910c8acc7db36 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 18:31:36 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2f189a0688c9dce8b908cb3e541910c8acc7db36 commit 2f189a0688c9dce8b908cb3e541910c8acc7db36 Author: Ed Maste AuthorDate: 2021-03-25 18:30:11 +0000 Commit: Ed Maste CommitDate: 2021-03-25 18:31:00 +0000 ndis: remove leftover sys/modules/ndis Reported by: cognet Fixes: bfc99943b04b ("ndis(4): remove as previous announced") --- sys/modules/ndis/Makefile | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/sys/modules/ndis/Makefile b/sys/modules/ndis/Makefile deleted file mode 100644 index 24a887eec949..000000000000 --- a/sys/modules/ndis/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# $FreeBSD$ - -.PATH: ${SRCTOP}/sys/compat/ndis - -KMOD= ndis -SRCS= subr_pe.c subr_ndis.c subr_hal.c subr_ntoskrnl.c kern_ndis.c -SRCS+= kern_windrv.c subr_usbd.c -SRCS+= device_if.h bus_if.h pci_if.h vnode_if.h -SRCS+= opt_bus.h opt_usb.h usb_if.h usbdevs.h - -.if ${MACHINE_CPUARCH} == "amd64" -SRCS+= winx64_wrap.S -.endif - -.if ${MACHINE_CPUARCH} == "i386" -SRCS+= winx32_wrap.S -.endif - -.include From owner-dev-commits-src-main@freebsd.org Thu Mar 25 18:45:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 718FF5C7B60; Thu, 25 Mar 2021 18:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5vDF2n46z4W0x; Thu, 25 Mar 2021 18:45: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 521C9459D; Thu, 25 Mar 2021 18:45: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 12PIj1Cj079221; Thu, 25 Mar 2021 18:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PIj17v079220; Thu, 25 Mar 2021 18:45:01 GMT (envelope-from git) Date: Thu, 25 Mar 2021 18:45:01 GMT Message-Id: <202103251845.12PIj17v079220@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: 92d1463e02b1 - main - pf: remove obsolete reference to ndis(4) in a comment 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: 92d1463e02b1d0c8abf26f430a8a52dec468863c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 18:45:01 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=92d1463e02b1d0c8abf26f430a8a52dec468863c commit 92d1463e02b1d0c8abf26f430a8a52dec468863c Author: Ed Maste AuthorDate: 2021-03-25 18:43:55 +0000 Commit: Ed Maste CommitDate: 2021-03-25 18:44:30 +0000 pf: remove obsolete reference to ndis(4) in a comment --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 71635a061225..50bf4b3871c5 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5797,7 +5797,7 @@ bad: /* * FreeBSD supports cksum offloads for the following drivers. - * em(4), fxp(4), lge(4), ndis(4), nge(4), re(4), ti(4), txp(4), xl(4) + * em(4), fxp(4), lge(4), nge(4), re(4), ti(4), txp(4), xl(4) * * CSUM_DATA_VALID | CSUM_PSEUDO_HDR : * network driver performed cksum including pseudo header, need to verify From owner-dev-commits-src-main@freebsd.org Thu Mar 25 20:46:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A43A357B3A7; Thu, 25 Mar 2021 20:46: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 4F5xwz4DZRz4dmF; Thu, 25 Mar 2021 20:46: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 840C15CB7; Thu, 25 Mar 2021 20:46: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 12PKkxRa048456; Thu, 25 Mar 2021 20:46:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PKkxJb048455; Thu, 25 Mar 2021 20:46:59 GMT (envelope-from git) Date: Thu, 25 Mar 2021 20:46:59 GMT Message-Id: <202103252046.12PKkxJb048455@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: 15f335556783 - main - cxgbe(4): Allow a T6 adapter to switch between TOE and NIC TLS mode. 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: 15f33555678300953858f6ed98dfc72c399a9139 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 20:46:59 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=15f33555678300953858f6ed98dfc72c399a9139 commit 15f33555678300953858f6ed98dfc72c399a9139 Author: Navdeep Parhar AuthorDate: 2021-03-24 01:01:01 +0000 Commit: Navdeep Parhar CommitDate: 2021-03-25 19:39:41 +0000 cxgbe(4): Allow a T6 adapter to switch between TOE and NIC TLS mode. The hw.cxgbe.kern_tls tunable was used for this in the past and if it was set then all T6 adapters would be configured for NIC TLS operation and could not be reconfigured for TOE without a reload. With this change ifconfig can be used to manipulate toe and txtls caps like any other caps. hw.cxgbe.kern_tls continues to work as usual but its effects are not permanent any more. * Enable nic_ktls_ofld in the default configuration file and use the firmware instead of direct register manipulation to apply/rollback NIC TLS configuration. This allows the driver to switch the hardware between TOE and NIC TLS mode in a safe manner. Note that the configuration is adapter-wide and not per-port. * Remove the kern_tls config file as it works with 100G T6 cards only and leads to firmware crashes with 25G cards. The configurations included with the driver (with the exception of the FPGA configs) are supposed to work with all adapters. Reported by: Veeresh U.K. at Chelsio MFC after: 2 weeks Sponsored by: Chelsio Communications Reviewed by: jhb@ Differential Revision: https://reviews.freebsd.org/D29291 --- sys/dev/cxgbe/adapter.h | 2 +- sys/dev/cxgbe/common/common.h | 5 + sys/dev/cxgbe/firmware/t6fw_cfg.txt | 4 +- sys/dev/cxgbe/firmware/t6fw_cfg_kern_tls.txt | 278 --------------------------- sys/dev/cxgbe/t4_clip.c | 2 +- sys/dev/cxgbe/t4_main.c | 171 ++++++++++------ sys/dev/cxgbe/t4_sge.c | 2 +- sys/dev/cxgbe/tom/t4_connect.c | 2 +- sys/dev/cxgbe/tom/t4_listen.c | 2 +- 9 files changed, 129 insertions(+), 339 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 82adfac63c91..1a90560a55d8 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -163,7 +163,7 @@ enum { ADAP_ERR = (1 << 5), BUF_PACKING_OK = (1 << 6), IS_VF = (1 << 7), - KERN_TLS_OK = (1 << 8), + KERN_TLS_ON = (1 << 8), /* HW is configured for KERN_TLS */ CXGBE_BUSY = (1 << 9), /* port flags */ diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index e04101c9adc5..6264a7d6ec07 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -499,6 +499,11 @@ static inline int is_hashfilter(const struct adapter *adap) return adap->params.hash_filter; } +static inline int is_ktls(const struct adapter *adap) +{ + return adap->cryptocaps & FW_CAPS_CONFIG_TLS_HW; +} + static inline int chip_id(struct adapter *adap) { return adap->params.chipid; diff --git a/sys/dev/cxgbe/firmware/t6fw_cfg.txt b/sys/dev/cxgbe/firmware/t6fw_cfg.txt index 6e5649642b29..1ad84f63b25f 100644 --- a/sys/dev/cxgbe/firmware/t6fw_cfg.txt +++ b/sys/dev/cxgbe/firmware/t6fw_cfg.txt @@ -161,7 +161,7 @@ nserver = 512 nhpfilter = 0 nhash = 16384 - protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif, tlskeys, crypto_lookaside + protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif, tlskeys, crypto_lookaside, nic_ktls_ofld tp_l2t = 4096 tp_ddp = 2 tp_ddp_iscsi = 2 @@ -273,7 +273,7 @@ [fini] version = 0x1 - checksum = 0xa92352a8 + checksum = 0x5fbc0a4a # # $FreeBSD$ # diff --git a/sys/dev/cxgbe/firmware/t6fw_cfg_kern_tls.txt b/sys/dev/cxgbe/firmware/t6fw_cfg_kern_tls.txt deleted file mode 100644 index 911ebd9cff65..000000000000 --- a/sys/dev/cxgbe/firmware/t6fw_cfg_kern_tls.txt +++ /dev/null @@ -1,278 +0,0 @@ -# Firmware configuration file. -# -# Global limits (some are hardware limits, others are due to the firmware). -# nvi = 128 virtual interfaces -# niqflint = 1023 ingress queues with freelists and/or interrupts -# nethctrl = 64K Ethernet or ctrl egress queues -# neq = 64K egress queues of all kinds, including freelists -# nexactf = 512 MPS TCAM entries, can oversubscribe. - -[global] - rss_glb_config_mode = basicvirtual - rss_glb_config_options = tnlmapen,hashtoeplitz,tnlalllkp - - # PL_TIMEOUT register - pl_timeout_value = 200 # the timeout value in units of us - - sge_timer_value = 1, 5, 10, 50, 100, 200 # SGE_TIMER_VALUE* in usecs - - reg[0x10c4] = 0x20000000/0x20000000 # GK_CONTROL, enable 5th thread - - reg[0x7dc0] = 0x0e2f8849 # TP_SHIFT_CNT - - #Tick granularities in kbps - tsch_ticks = 100000, 10000, 1000, 10 - - filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe - filterMask = protocol - - tp_pmrx = 10, 512 - tp_pmrx_pagesize = 64K - - # TP number of RX channels (0 = auto) - tp_nrxch = 0 - - tp_pmtx = 10, 512 - tp_pmtx_pagesize = 64K - - # TP number of TX channels (0 = auto) - tp_ntxch = 0 - - # TP OFLD MTUs - tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 - - # enable TP_OUT_CONFIG.IPIDSPLITMODE and CRXPKTENC - reg[0x7d04] = 0x00010008/0x00010008 - - # TP_GLOBAL_CONFIG - reg[0x7d08] = 0x00000800/0x00000800 # set IssFromCplEnable - - # TP_PC_CONFIG - reg[0x7d48] = 0x00000000/0x00000400 # clear EnableFLMError - - # TP_PARA_REG0 - reg[0x7d60] = 0x06000000/0x07000000 # set InitCWND to 6 - - # cluster, lan, or wan. - tp_tcptuning = lan - - # LE_DB_CONFIG - reg[0x19c04] = 0x00000000/0x00440000 # LE Server SRAM disabled - # LE IPv4 compression disabled - # LE_DB_HASH_CONFIG - reg[0x19c28] = 0x00800000/0x01f00000 # LE Hash bucket size 8, - - # ULP_TX_CONFIG - reg[0x8dc0] = 0x00000104/0x00000104 # Enable ITT on PI err - # Enable more error msg for ... - # TPT error. - - # ULP_RX_MISC_FEATURE_ENABLE - #reg[0x1925c] = 0x01003400/0x01003400 # iscsi tag pi bit - # Enable offset decrement after ... - # PI extraction and before DDP - # ulp insert pi source info in DIF - # iscsi_eff_offset_en - - #Enable iscsi completion moderation feature - reg[0x1925c] = 0x000041c0/0x000031c0 # Enable offset decrement after - # PI extraction and before DDP. - # ulp insert pi source info in - # DIF. - # Enable iscsi hdr cmd mode. - # iscsi force cmd mode. - # Enable iscsi cmp mode. - # MC configuration - #mc_mode_brc[0] = 1 # mc0 - 1: enable BRC, 0: enable RBC - -# PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by -# these 4 PFs only. -[function "0"] - wx_caps = all - r_caps = all - nvi = 1 - rssnvi = 0 - niqflint = 2 - nethctrl = 2 - neq = 4 - nexactf = 2 - cmask = all - pmask = 0x1 - -[function "1"] - wx_caps = all - r_caps = all - nvi = 1 - rssnvi = 0 - niqflint = 2 - nethctrl = 2 - neq = 4 - nexactf = 2 - cmask = all - pmask = 0x2 - -[function "2"] - wx_caps = all - r_caps = all - nvi = 1 - rssnvi = 0 - niqflint = 2 - nethctrl = 2 - neq = 4 - nexactf = 2 - cmask = all - pmask = 0x4 - -[function "3"] - wx_caps = all - r_caps = all - nvi = 1 - rssnvi = 0 - niqflint = 2 - nethctrl = 2 - neq = 4 - nexactf = 2 - cmask = all - pmask = 0x8 - -# PF4 is the resource-rich PF that the bus/nexus driver attaches to. -# It gets 32 MSI/128 MSI-X vectors. -[function "4"] - wx_caps = all - r_caps = all - nvi = 32 - rssnvi = 32 - niqflint = 512 - nethctrl = 1024 - neq = 2048 - nqpcq = 8192 - nexactf = 456 - cmask = all - pmask = all - ncrypto_lookaside = 16 - nclip = 320 - nethofld = 8192 - - # TCAM has 6K cells; each region must start at a multiple of 128 cell. - # Each entry in these categories takes 2 cells each. nhash will use the - # TCAM iff there is room left (that is, the rest don't add up to 3072). - nfilter = 48 - nserver = 64 - nhpfilter = 0 - nhash = 524288 - protocol = ofld, tlskeys, crypto_lookaside - tp_l2t = 4096 - tp_ddp = 2 - tp_ddp_iscsi = 2 - tp_tls_key = 3 - tp_tls_mxrxsize = 17408 # 16384 + 1024, governs max rx data, pm max xfer len, rx coalesce sizes - tp_stag = 2 - tp_pbl = 5 - tp_rq = 7 - tp_srq = 128 - -# PF5 is the SCSI Controller PF. It gets 32 MSI/40 MSI-X vectors. -# Not used right now. -[function "5"] - nvi = 1 - rssnvi = 0 - -# PF6 is the FCoE Controller PF. It gets 32 MSI/40 MSI-X vectors. -# Not used right now. -[function "6"] - nvi = 1 - rssnvi = 0 - -# The following function, 1023, is not an actual PCIE function but is used to -# configure and reserve firmware internal resources that come from the global -# resource pool. -# -[function "1023"] - wx_caps = all - r_caps = all - nvi = 4 - rssnvi = 0 - cmask = all - pmask = all - nexactf = 8 - nfilter = 16 - - -# For Virtual functions, we only allow NIC functionality and we only allow -# access to one port (1 << PF). Note that because of limitations in the -# Scatter Gather Engine (SGE) hardware which checks writes to VF KDOORBELL -# and GTS registers, the number of Ingress and Egress Queues must be a power -# of 2. -# -[function "0/*"] - wx_caps = 0x82 - r_caps = 0x86 - nvi = 1 - rssnvi = 0 - niqflint = 2 - nethctrl = 2 - neq = 4 - nexactf = 2 - cmask = all - pmask = 0x1 - -[function "1/*"] - wx_caps = 0x82 - r_caps = 0x86 - nvi = 1 - rssnvi = 0 - niqflint = 2 - nethctrl = 2 - neq = 4 - nexactf = 2 - cmask = all - pmask = 0x2 - -[function "2/*"] - wx_caps = 0x82 - r_caps = 0x86 - nvi = 1 - rssnvi = 0 - niqflint = 2 - nethctrl = 2 - neq = 4 - nexactf = 2 - cmask = all - pmask = 0x1 - -[function "3/*"] - wx_caps = 0x82 - r_caps = 0x86 - nvi = 1 - rssnvi = 0 - niqflint = 2 - nethctrl = 2 - neq = 4 - nexactf = 2 - cmask = all - pmask = 0x2 - -# MPS has 192K buffer space for ingress packets from the wire as well as -# loopback path of the L2 switch. -[port "0"] - dcb = none - #bg_mem = 25 - #lpbk_mem = 25 - hwm = 60 - lwm = 15 - dwm = 30 - -[port "1"] - dcb = none - #bg_mem = 25 - #lpbk_mem = 25 - hwm = 60 - lwm = 15 - dwm = 30 - -[fini] - version = 0x1 - checksum = 0xa737b06f -# -# $FreeBSD$ -# diff --git a/sys/dev/cxgbe/t4_clip.c b/sys/dev/cxgbe/t4_clip.c index ff34e811b82f..cc4a9b517a49 100644 --- a/sys/dev/cxgbe/t4_clip.c +++ b/sys/dev/cxgbe/t4_clip.c @@ -273,7 +273,7 @@ update_clip_table(struct adapter *sc) inet_ntop(AF_INET6, &ce->lip, &ip[0], sizeof(ip)); - if (sc->flags & KERN_TLS_OK || + if (sc->flags & KERN_TLS_ON || sc->active_ulds != 0) { log(LOG_ERR, "%s: could not add %s (%d)\n", diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 12efa8042b64..cdfceb5573fd 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -812,9 +812,12 @@ static int read_card_mem(struct adapter *, int, struct t4_mem_range *); static int read_i2c(struct adapter *, struct t4_i2c_data *); static int clear_stats(struct adapter *, u_int); #ifdef TCP_OFFLOAD -static int toe_capability(struct vi_info *, int); +static int toe_capability(struct vi_info *, bool); static void t4_async_event(void *, int); #endif +#ifdef KERN_TLS +static int ktls_capability(struct adapter *, bool); +#endif static int mod_event(module_t, int, void *); static int notify_siblings(device_t, int); @@ -1838,7 +1841,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) } #ifdef TCP_OFFLOAD - if (vi->nofldrxq != 0 && (sc->flags & KERN_TLS_OK) == 0) + if (vi->nofldrxq != 0) ifp->if_capabilities |= IFCAP_TOE; #endif #ifdef RATELIMIT @@ -1859,9 +1862,10 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) #endif ifp->if_hw_tsomaxsegsize = 65536; #ifdef KERN_TLS - if (sc->flags & KERN_TLS_OK) { + if (is_ktls(sc)) { ifp->if_capabilities |= IFCAP_TXTLS; - ifp->if_capenable |= IFCAP_TXTLS; + if (sc->flags & KERN_TLS_ON) + ifp->if_capenable |= IFCAP_TXTLS; } #endif @@ -2186,8 +2190,15 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) ifp->if_capenable ^= IFCAP_MEXTPG; #ifdef KERN_TLS - if (mask & IFCAP_TXTLS) + if (mask & IFCAP_TXTLS) { + int enable = (ifp->if_capenable ^ mask) & IFCAP_TXTLS; + + rc = ktls_capability(sc, enable); + if (rc != 0) + goto fail; + ifp->if_capenable ^= (mask & IFCAP_TXTLS); + } #endif if (mask & IFCAP_VXLAN_HWCSUM) { ifp->if_capenable ^= IFCAP_VXLAN_HWCSUM; @@ -4782,47 +4793,36 @@ ktls_tick(void *arg) uint32_t tstamp; sc = arg; - - tstamp = tcp_ts_getticks(); - t4_write_reg(sc, A_TP_SYNC_TIME_HI, tstamp >> 1); - t4_write_reg(sc, A_TP_SYNC_TIME_LO, tstamp << 31); - + if (sc->flags & KERN_TLS_ON) { + tstamp = tcp_ts_getticks(); + t4_write_reg(sc, A_TP_SYNC_TIME_HI, tstamp >> 1); + t4_write_reg(sc, A_TP_SYNC_TIME_LO, tstamp << 31); + } callout_schedule_sbt(&sc->ktls_tick, SBT_1MS, 0, C_HARDCLOCK); } -static void -t4_enable_kern_tls(struct adapter *sc) +static int +t4_config_kern_tls(struct adapter *sc, bool enable) { - uint32_t m, v; - - m = F_ENABLECBYP; - v = F_ENABLECBYP; - t4_set_reg_field(sc, A_TP_PARA_REG6, m, v); - - m = F_CPL_FLAGS_UPDATE_EN | F_SEQ_UPDATE_EN; - v = F_CPL_FLAGS_UPDATE_EN | F_SEQ_UPDATE_EN; - t4_set_reg_field(sc, A_ULP_TX_CONFIG, m, v); - - m = F_NICMODE; - v = F_NICMODE; - t4_set_reg_field(sc, A_TP_IN_CONFIG, m, v); - - m = F_LOOKUPEVERYPKT; - v = 0; - t4_set_reg_field(sc, A_TP_INGRESS_CONFIG, m, v); - - m = F_TXDEFERENABLE | F_DISABLEWINDOWPSH | F_DISABLESEPPSHFLAG; - v = F_DISABLEWINDOWPSH; - t4_set_reg_field(sc, A_TP_PC_CONFIG, m, v); + int rc; + uint32_t param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_KTLS_HW) | + V_FW_PARAMS_PARAM_Y(enable ? 1 : 0) | + V_FW_PARAMS_PARAM_Z(FW_PARAMS_PARAM_DEV_KTLS_HW_USER_ENABLE); - m = V_TIMESTAMPRESOLUTION(M_TIMESTAMPRESOLUTION); - v = V_TIMESTAMPRESOLUTION(0x1f); - t4_set_reg_field(sc, A_TP_TIMER_RESOLUTION, m, v); + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, ¶m); + if (rc != 0) { + CH_ERR(sc, "failed to %s NIC TLS: %d\n", + enable ? "enable" : "disable", rc); + return (rc); + } - sc->flags |= KERN_TLS_OK; + if (enable) + sc->flags |= KERN_TLS_ON; + else + sc->flags &= ~KERN_TLS_ON; - sc->tlst.inline_keys = t4_tls_inline_keys; - sc->tlst.combo_wrs = t4_tls_combo_wrs; + return (rc); } #endif @@ -4936,18 +4936,19 @@ set_params__post_init(struct adapter *sc) #ifdef KERN_TLS if (sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS && sc->toecaps & FW_CAPS_CONFIG_TOE) { - if (t4_kern_tls != 0) - t4_enable_kern_tls(sc); - else { - /* - * Limit TOE connections to 2 reassembly - * "islands". This is required for TOE TLS - * connections to downgrade to plain TOE - * connections if an unsupported TLS version - * or ciphersuite is used. - */ - t4_tp_wr_bits_indirect(sc, A_TP_FRAG_CONFIG, - V_PASSMODE(M_PASSMODE), V_PASSMODE(2)); + /* + * Limit TOE connections to 2 reassembly "islands". This is + * required for TOE TLS connections to downgrade to plain TOE + * connections if an unsupported TLS version or ciphersuite is + * used. + */ + t4_tp_wr_bits_indirect(sc, A_TP_FRAG_CONFIG, + V_PASSMODE(M_PASSMODE), V_PASSMODE(2)); + if (is_ktls(sc)) { + sc->tlst.inline_keys = t4_tls_inline_keys; + sc->tlst.combo_wrs = t4_tls_combo_wrs; + if (t4_kern_tls != 0) + t4_config_kern_tls(sc, true); } } #endif @@ -5863,7 +5864,7 @@ adapter_full_init(struct adapter *sc) t4_intr_enable(sc); } #ifdef KERN_TLS - if (sc->flags & KERN_TLS_OK) + if (is_ktls(sc)) callout_reset_sbt(&sc->ktls_tick, SBT_1MS, 0, ktls_tick, sc, C_HARDCLOCK); #endif @@ -6753,7 +6754,7 @@ t4_sysctls(struct adapter *sc) } #ifdef KERN_TLS - if (sc->flags & KERN_TLS_OK) { + if (is_ktls(sc)) { /* * dev.t4nex.0.tls. */ @@ -11047,7 +11048,7 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, #ifdef TCP_OFFLOAD static int -toe_capability(struct vi_info *vi, int enable) +toe_capability(struct vi_info *vi, bool enable) { int rc; struct port_info *pi = vi->pi; @@ -11059,6 +11060,39 @@ toe_capability(struct vi_info *vi, int enable) return (ENODEV); if (enable) { +#ifdef KERN_TLS + if (sc->flags & KERN_TLS_ON) { + int i, j, n; + struct port_info *p; + struct vi_info *v; + + /* + * Reconfigure hardware for TOE if TXTLS is not enabled + * on any ifnet. + */ + n = 0; + for_each_port(sc, i) { + p = sc->port[i]; + for_each_vi(p, j, v) { + if (v->ifp->if_capenable & IFCAP_TXTLS) { + CH_WARN(sc, + "%s has NIC TLS enabled.\n", + device_get_nameunit(v->dev)); + n++; + } + } + } + if (n > 0) { + CH_WARN(sc, "Disable NIC TLS on all interfaces " + "associated with this adapter before " + "trying to enable TOE.\n"); + return (EAGAIN); + } + rc = t4_config_kern_tls(sc, false); + if (rc) + return (rc); + } +#endif if ((vi->ifp->if_capenable & IFCAP_TOE) != 0) { /* TOE is already enabled. */ return (0); @@ -11267,6 +11301,35 @@ uld_active(struct adapter *sc, int uld_id) } #endif +#ifdef KERN_TLS +static int +ktls_capability(struct adapter *sc, bool enable) +{ + ASSERT_SYNCHRONIZED_OP(sc); + + if (!is_ktls(sc)) + return (ENODEV); + + if (enable) { + if (sc->flags & KERN_TLS_ON) + return (0); /* already on */ + if (sc->offload_map != 0) { + CH_WARN(sc, + "Disable TOE on all interfaces associated with " + "this adapter before trying to enable NIC TLS.\n"); + return (EAGAIN); + } + return (t4_config_kern_tls(sc, true)); + } else { + /* + * Nothing to do for disable. If TOE is enabled sometime later + * then toe_capability will reconfigure the hardware. + */ + return (0); + } +} +#endif + /* * t = ptr to tunable. * nc = number of CPUs. diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 1818673b5612..b0f5b272410a 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4419,7 +4419,7 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx, "# of times hardware assisted with inner checksums (VXLAN)"); #ifdef KERN_TLS - if (sc->flags & KERN_TLS_OK) { + if (is_ktls(sc)) { SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "kern_tls_records", CTLFLAG_RD, &txq->kern_tls_records, "# of NIC TLS records transmitted"); diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c index c285b6fc41fa..c71b9694bd3b 100644 --- a/sys/dev/cxgbe/tom/t4_connect.c +++ b/sys/dev/cxgbe/tom/t4_connect.c @@ -256,7 +256,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct nhop_object *nh, DONT_OFFLOAD_ACTIVE_OPEN(ENOSYS); /* XXX: implement lagg+TOE */ else DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); - if (sc->flags & KERN_TLS_OK) + if (sc->flags & KERN_TLS_ON) DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); rw_rlock(&sc->policy_lock); diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index ba30f2a60120..51de83643253 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -538,7 +538,7 @@ t4_listen_start(struct toedev *tod, struct tcpcb *tp) if (!(inp->inp_vflag & INP_IPV6) && IN_LOOPBACK(ntohl(inp->inp_laddr.s_addr))) return (0); - if (sc->flags & KERN_TLS_OK) + if (sc->flags & KERN_TLS_ON) return (0); #if 0 ADAPTER_LOCK(sc); From owner-dev-commits-src-main@freebsd.org Thu Mar 25 21:56:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C30CF57C9B2; Thu, 25 Mar 2021 21:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5zT85FSZz4jq5; Thu, 25 Mar 2021 21:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A729A6B5A; Thu, 25 Mar 2021 21:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12PLuSOb046890; Thu, 25 Mar 2021 21:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PLuSbO046889; Thu, 25 Mar 2021 21:56:28 GMT (envelope-from git) Date: Thu, 25 Mar 2021 21:56:28 GMT Message-Id: <202103252156.12PLuSbO046889@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: 653a437c0444 - main - accept_filter: Fix filter parameter handling 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: 653a437c04440495cd8e7712c7cf39444f26f1ee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 21:56:28 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=653a437c04440495cd8e7712c7cf39444f26f1ee commit 653a437c04440495cd8e7712c7cf39444f26f1ee Author: Mark Johnston AuthorDate: 2021-03-25 21:55:20 +0000 Commit: Mark Johnston CommitDate: 2021-03-25 21:55:46 +0000 accept_filter: Fix filter parameter handling For filters which implement accf_create, the setsockopt(2) handler caches the filter name in the socket, but it also incorrectly frees the buffer containing the copy, leaving a dangling pointer. Note that no accept filters provided in the base system are susceptible to this, as they don't implement accf_create. Reported by: Alexey Kulaev Discussed with: emaste Security: kernel use-after-free MFC after: 3 days Sponsored by: The FreeBSD Foundation --- sys/kern/uipc_accf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/uipc_accf.c b/sys/kern/uipc_accf.c index debf4b2deeb1..3ca64dd21e25 100644 --- a/sys/kern/uipc_accf.c +++ b/sys/kern/uipc_accf.c @@ -299,6 +299,7 @@ accept_filt_setopt(struct socket *so, struct sockopt *sopt) so->sol_accept_filter = afp; so->sol_accept_filter_arg = accept_filter_arg; so->sol_accept_filter_str = accept_filter_str; + accept_filter_str = NULL; so->so_options |= SO_ACCEPTFILTER; out: SOCK_UNLOCK(so); From owner-dev-commits-src-main@freebsd.org Thu Mar 25 22:57:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE43B57ED9C; Thu, 25 Mar 2021 22:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F60q45w8Fz4nGh; Thu, 25 Mar 2021 22:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B35FA7835; Thu, 25 Mar 2021 22:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12PMv4p3031708; Thu, 25 Mar 2021 22:57:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PMv4VL031707; Thu, 25 Mar 2021 22:57:04 GMT (envelope-from git) Date: Thu, 25 Mar 2021 22:57:04 GMT Message-Id: <202103252257.12PMv4VL031707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 0533fab89e37 - main - tcp: Perform simple fast retransmit when SACK Blocks are missing on SACK session MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0533fab89e37caab886568df88d9f939e85eeb6c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 22:57:04 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=0533fab89e37caab886568df88d9f939e85eeb6c commit 0533fab89e37caab886568df88d9f939e85eeb6c Author: Richard Scheffenegger AuthorDate: 2021-03-25 22:18:06 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-25 22:23:48 +0000 tcp: Perform simple fast retransmit when SACK Blocks are missing on SACK session MFC after: 2 weeks Reviewed By: #transport, rrs Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28634 --- sys/netinet/tcp_input.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index bdc0e872c36e..685a5e020c3b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2564,6 +2564,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, */ if (th->th_ack != tp->snd_una || ((tp->t_flags & TF_SACK_PERMIT) && + (to.to_flags & TOF_SACK) && !sack_changed)) break; else if (!tcp_timer_active(tp, TT_REXMT)) @@ -2617,6 +2618,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); } else if ((tp->t_flags & TF_SACK_PERMIT) && + (to.to_flags & TOF_SACK) && IN_FASTRECOVERY(tp->t_flags)) { int awnd; @@ -2694,7 +2696,8 @@ enter_recovery: tp->sackhint.recover_fs = max(1, tp->snd_nxt - tp->snd_una); } - if (tp->t_flags & TF_SACK_PERMIT) { + if ((tp->t_flags & TF_SACK_PERMIT) && + (to.to_flags & TOF_SACK)) { TCPSTAT_INC( tcps_sack_recovery_episode); tp->snd_recover = tp->snd_nxt; From owner-dev-commits-src-main@freebsd.org Thu Mar 25 23:35:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C22757FBFE; Thu, 25 Mar 2021 23:35: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 4F61gL2cfYz4qbK; Thu, 25 Mar 2021 23:35: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 4CBA37E67; Thu, 25 Mar 2021 23:35: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 12PNZQc5087553; Thu, 25 Mar 2021 23:35:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PNZQqB087552; Thu, 25 Mar 2021 23:35:26 GMT (envelope-from git) Date: Thu, 25 Mar 2021 23:35:26 GMT Message-Id: <202103252335.12PNZQqB087552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: eb3a59a83112 - main - tcp: Refactor PRR code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb3a59a83112f5fcd60aab44ac0ac68331b6aedf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 23:35:26 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=eb3a59a83112f5fcd60aab44ac0ac68331b6aedf commit eb3a59a83112f5fcd60aab44ac0ac68331b6aedf Author: Richard Scheffenegger AuthorDate: 2021-03-25 22:58:46 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-25 23:01:34 +0000 tcp: Refactor PRR code No functional change intended. MFC after: 2 weeks Reviewed By: #transport, rrs Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29411 --- sys/netinet/tcp_input.c | 58 ++++++++----------------------------------------- sys/netinet/tcp_var.h | 2 +- 2 files changed, 10 insertions(+), 50 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 685a5e020c3b..7c291eaec633 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2576,47 +2576,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (V_tcp_do_prr && IN_FASTRECOVERY(tp->t_flags) && (tp->t_flags & TF_SACK_PERMIT)) { - int snd_cnt = 0, limit = 0; - int del_data = 0, pipe = 0; - /* - * In a duplicate ACK del_data is only the - * diff_in_sack. If no SACK is used del_data - * will be 0. Pipe is the amount of data we - * estimate to be in the network. - */ - del_data = tp->sackhint.delivered_data; - if (V_tcp_do_rfc6675_pipe) - pipe = tcp_compute_pipe(tp); - else - pipe = (tp->snd_nxt - tp->snd_fack) + - tp->sackhint.sack_bytes_rexmit; - tp->sackhint.prr_delivered += del_data; - if (pipe >= tp->snd_ssthresh) { - if (tp->sackhint.recover_fs == 0) - tp->sackhint.recover_fs = - imax(1, tp->snd_nxt - tp->snd_una); - snd_cnt = howmany((long)tp->sackhint.prr_delivered * - tp->snd_ssthresh, tp->sackhint.recover_fs) - - tp->sackhint.prr_out; - } else { - if (V_tcp_do_prr_conservative) - limit = tp->sackhint.prr_delivered - - tp->sackhint.prr_out; - else - limit = imax(tp->sackhint.prr_delivered - - tp->sackhint.prr_out, - del_data) + maxseg; - snd_cnt = imin(tp->snd_ssthresh - pipe, limit); - } - snd_cnt = imax(snd_cnt, 0) / maxseg; - /* - * Send snd_cnt new data into the network in - * response to this ACK. If there is a going - * to be a SACK retransmission, adjust snd_cwnd - * accordingly. - */ - tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); + tcp_do_prr_ack(tp, th); } else if ((tp->t_flags & TF_SACK_PERMIT) && (to.to_flags & TOF_SACK) && IN_FASTRECOVERY(tp->t_flags)) { @@ -2814,9 +2774,13 @@ resume_partialack: if (IN_FASTRECOVERY(tp->t_flags)) { if (SEQ_LT(th->th_ack, tp->snd_recover)) { if (tp->t_flags & TF_SACK_PERMIT) - if (V_tcp_do_prr && to.to_flags & TOF_SACK) - tcp_prr_partialack(tp, th); - else + if (V_tcp_do_prr && to.to_flags & TOF_SACK) { + tcp_timer_activate(tp, TT_REXMT, 0); + tp->t_rtttime = 0; + tcp_do_prr_ack(tp, th); + tp->t_flags |= TF_ACKNOW; + (void) tcp_output(tp); + } else tcp_sack_partialack(tp, th); else tcp_newreno_partial_ack(tp, th); @@ -3946,15 +3910,13 @@ tcp_mssopt(struct in_conninfo *inc) } void -tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) +tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th) { int snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; int maxseg = tcp_maxseg(tp); INP_WLOCK_ASSERT(tp->t_inpcb); - tcp_timer_activate(tp, TT_REXMT, 0); - tp->t_rtttime = 0; /* * Compute the amount of data that this ACK is indicating * (del_data) and an estimate of how many bytes are in the @@ -3994,8 +3956,6 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) */ tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); - tp->t_flags |= TF_ACKNOW; - (void) tcp_output(tp); } /* diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 8cd0c828ad66..aefec69063e6 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1063,7 +1063,7 @@ void tcp_clean_dsack_blocks(struct tcpcb *tp); void tcp_clean_sackreport(struct tcpcb *tp); void tcp_sack_adjust(struct tcpcb *tp); struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt); -void tcp_prr_partialack(struct tcpcb *, struct tcphdr *); +void tcp_do_prr_ack(struct tcpcb *, struct tcphdr *); void tcp_sack_partialack(struct tcpcb *, struct tcphdr *); void tcp_free_sackholes(struct tcpcb *tp); int tcp_newreno(struct tcpcb *, struct tcphdr *); From owner-dev-commits-src-main@freebsd.org Fri Mar 26 01:10:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CD505AEB32; Fri, 26 Mar 2021 01:10: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 4F63mm2dNDz3Flh; Fri, 26 Mar 2021 01:10: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 4CBF210FF0; Fri, 26 Mar 2021 01:10: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 12Q1AGmF021251; Fri, 26 Mar 2021 01:10:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12Q1AGY2021244; Fri, 26 Mar 2021 01:10:16 GMT (envelope-from git) Date: Fri, 26 Mar 2021 01:10:16 GMT Message-Id: <202103260110.12Q1AGY2021244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: b9f803b7d4b7 - main - tcp: Use PRR for ECN congestion recovery MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9f803b7d4b7ee3799ab94f66c02c3b6e58c153a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 01:10:16 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=b9f803b7d4b7ee3799ab94f66c02c3b6e58c153a commit b9f803b7d4b7ee3799ab94f66c02c3b6e58c153a Author: Richard Scheffenegger AuthorDate: 2021-03-26 01:05:22 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-26 01:06:15 +0000 tcp: Use PRR for ECN congestion recovery MFC after: 2 weeks Reviewed By: #transport, rrs Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28972 --- sys/netinet/tcp_input.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7c291eaec633..57779de1759a 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2786,6 +2786,16 @@ resume_partialack: tcp_newreno_partial_ack(tp, th); } else cc_post_recovery(tp, th); + } else if (IN_CONGRECOVERY(tp->t_flags)) { + if (SEQ_LT(th->th_ack, tp->snd_recover)) { + if (V_tcp_do_prr) { + tp->sackhint.delivered_data = BYTES_THIS_ACK(tp, th); + tp->snd_fack = th->th_ack; + tcp_do_prr_ack(tp, th); + (void) tcp_output(tp); + } + } else + cc_post_recovery(tp, th); } /* * If we reach this point, ACK is not a duplicate, @@ -3954,8 +3964,12 @@ tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th) * If there is going to be a SACK retransmission, adjust snd_cwnd * accordingly. */ - tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); + if (IN_FASTRECOVERY(tp->t_flags)) { + tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); + } else if (IN_CONGRECOVERY(tp->t_flags)) + tp->snd_cwnd = imax(maxseg, pipe - del_data + + (snd_cnt * maxseg)); } /* From owner-dev-commits-src-main@freebsd.org Fri Mar 26 01:26:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B6995AF322; Fri, 26 Mar 2021 01:26:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F647V42yRz3HXL; Fri, 26 Mar 2021 01:26:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D9011185C; Fri, 26 Mar 2021 01:26: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 12Q1QU0x042508; Fri, 26 Mar 2021 01:26:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12Q1QUWP042507; Fri, 26 Mar 2021 01:26:30 GMT (envelope-from git) Date: Fri, 26 Mar 2021 01:26:30 GMT Message-Id: <202103260126.12Q1QUWP042507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: b6fd00791f2b - main - [iwn] Flip over to use VAP flags rather than ic flags for things MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6fd00791f2b9690b0a5d8670fc03f74eda96da2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 01:26:30 -0000 The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=b6fd00791f2b9690b0a5d8670fc03f74eda96da2 commit b6fd00791f2b9690b0a5d8670fc03f74eda96da2 Author: Adrian Chadd AuthorDate: 2021-03-22 16:47:43 +0000 Commit: Adrian Chadd CommitDate: 2021-03-26 01:26:09 +0000 [iwn] Flip over to use VAP flags rather than ic flags for things net80211 changed a while back to support per-VAP config for things rather than it being global. This is to support firmware NICs that support per-VAP flags and configuration where the firmware will figure out how to combine them. However, it introduced a fun timing issue - those changes used to happen to the shared ic state before newstate() was called, but now they're also tasks and they can happen /after/. This isn't a problem for ath(4), but it exposed some interesting timing and config bugs here. Notably, I saw short slot NOT being configured in 5GHz mode during some associations, so 5GHz stuff would hang or behave poorly. Other times the follow-up auth has the right config, so it didn't hang. So for now, just flip this over to using the per-VAP flags which are correct when newstate() is called. net80211 should also have those flags synch'ed to the global ic state before newstate() runs and that can come in a subsequent commit. Whilst here also fix plcp to be consistently logged as a hex value. Tested: * iwn(4) Intel 6205, STA mode, both 2GHz and 5GHz Differential Revision: https://reviews.freebsd.org/D29379 Reviewed by: bz --- sys/dev/iwn/if_iwn.c | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 2121a15bad6e..b07b52cbea7c 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -4450,7 +4450,7 @@ iwn_check_rate_needs_protection(struct iwn_softc *sc, /* * 11bg protection not enabled? Then don't use it. */ - if ((ic->ic_flags & IEEE80211_F_USEPROT) == 0) + if ((vap->iv_flags & IEEE80211_F_USEPROT) == 0) return (0); /* @@ -4936,7 +4936,7 @@ iwn_tx_cmd(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni, data->ni = ni; DPRINTF(sc, IWN_DEBUG_XMIT, "%s: qid %d idx %d len %d nsegs %d " - "plcp %d\n", + "plcp 0x%x\n", __func__, ring->qid, ring->cur, totlen, nsegs, tx->rate); /* Fill TX descriptor. */ @@ -6654,18 +6654,18 @@ iwn5000_runtime_calib(struct iwn_softc *sc) } static uint32_t -iwn_get_rxon_ht_flags(struct iwn_softc *sc, struct ieee80211_channel *c) +iwn_get_rxon_ht_flags(struct iwn_softc *sc, struct ieee80211vap *vap, + struct ieee80211_channel *c) { - struct ieee80211com *ic = &sc->sc_ic; uint32_t htflags = 0; if (! IEEE80211_IS_CHAN_HT(c)) return (0); - htflags |= IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode); + htflags |= IWN_RXON_HT_PROTMODE(vap->iv_curhtprotmode); if (IEEE80211_IS_CHAN_HT40(c)) { - switch (ic->ic_curhtprotmode) { + switch (vap->iv_curhtprotmode) { case IEEE80211_HTINFO_OPMODE_HT20PR: htflags |= IWN_RXON_HT_MODEPURE40; break; @@ -6912,7 +6912,7 @@ iwn_config(struct iwn_softc *sc) sc->rxchainmask, sc->nrxchains); - sc->rxon->flags |= htole32(iwn_get_rxon_ht_flags(sc, ic->ic_curchan)); + sc->rxon->flags |= htole32(iwn_get_rxon_ht_flags(sc, vap, ic->ic_curchan)); DPRINTF(sc, IWN_DEBUG_RESET, "%s: setting configuration; flags=0x%08x\n", @@ -7285,9 +7285,17 @@ iwn_auth(struct iwn_softc *sc, struct ieee80211vap *vap) sc->rxon->flags = htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF); if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) sc->rxon->flags |= htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ); - if (ic->ic_flags & IEEE80211_F_SHSLOT) + + /* + * We always set short slot on 5GHz channels. + * We optionally set it for 2.4GHz channels. + */ + if (IEEE80211_IS_CHAN_5GHZ(ni->ni_chan)) + sc->rxon->flags |= htole32(IWN_RXON_SHSLOT); + else if (vap->iv_flags & IEEE80211_F_SHSLOT) sc->rxon->flags |= htole32(IWN_RXON_SHSLOT); - if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) + + if (vap->iv_flags & IEEE80211_F_SHPREAMBLE) sc->rxon->flags |= htole32(IWN_RXON_SHPREAMBLE); if (IEEE80211_IS_CHAN_A(ni->ni_chan)) { sc->rxon->cck_mask = 0; @@ -7302,7 +7310,7 @@ iwn_auth(struct iwn_softc *sc, struct ieee80211vap *vap) } /* try HT */ - sc->rxon->flags |= htole32(iwn_get_rxon_ht_flags(sc, ic->ic_curchan)); + sc->rxon->flags |= htole32(iwn_get_rxon_ht_flags(sc, vap, ic->ic_curchan)); DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x cck %x ofdm %x\n", sc->rxon->chan, sc->rxon->flags, sc->rxon->cck_mask, @@ -7349,9 +7357,14 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) sc->rxon->flags = htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF); if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) sc->rxon->flags |= htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ); - if (ic->ic_flags & IEEE80211_F_SHSLOT) + + /* As previously - short slot only on 5GHz */ + if (IEEE80211_IS_CHAN_5GHZ(ni->ni_chan)) sc->rxon->flags |= htole32(IWN_RXON_SHSLOT); - if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) + else if (vap->iv_flags & IEEE80211_F_SHSLOT) + sc->rxon->flags |= htole32(IWN_RXON_SHSLOT); + + if (vap->iv_flags & IEEE80211_F_SHPREAMBLE) sc->rxon->flags |= htole32(IWN_RXON_SHPREAMBLE); if (IEEE80211_IS_CHAN_A(ni->ni_chan)) { sc->rxon->cck_mask = 0; @@ -7365,10 +7378,10 @@ iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) sc->rxon->ofdm_mask = 0x15; } /* try HT */ - sc->rxon->flags |= htole32(iwn_get_rxon_ht_flags(sc, ni->ni_chan)); + sc->rxon->flags |= htole32(iwn_get_rxon_ht_flags(sc, vap, ni->ni_chan)); sc->rxon->filter |= htole32(IWN_FILTER_BSS); DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x, curhtprotmode=%d\n", - sc->rxon->chan, le32toh(sc->rxon->flags), ic->ic_curhtprotmode); + sc->rxon->chan, le32toh(sc->rxon->flags), vap->iv_curhtprotmode); if ((error = iwn_send_rxon(sc, 0, 1)) != 0) { device_printf(sc->sc_dev, "%s: could not send RXON\n", From owner-dev-commits-src-main@freebsd.org Fri Mar 26 12:14:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE7745BD90C; Fri, 26 Mar 2021 12:14: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 4F6LWG4cgqz4bgf; Fri, 26 Mar 2021 12:14: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 8C05A19975; Fri, 26 Mar 2021 12:14: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 12QCEYif055465; Fri, 26 Mar 2021 12:14:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QCEYCk055464; Fri, 26 Mar 2021 12:14:34 GMT (envelope-from git) Date: Fri, 26 Mar 2021 12:14:34 GMT Message-Id: <202103261214.12QCEYCk055464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a9f0367b04b3 - main - pci: enhance printf for leaked MSI[-X] vectors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9f0367b04b385e7bed47914662badf5ab18bc88 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 12:14:34 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a9f0367b04b385e7bed47914662badf5ab18bc88 commit a9f0367b04b385e7bed47914662badf5ab18bc88 Author: Bjoern A. Zeeb AuthorDate: 2021-03-23 15:47:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-26 12:00:13 +0000 pci: enhance printf for leaked MSI[-X] vectors When debugging leaked MSI/MSI-X vectors through LinuxKPI I found the informational printf unhelpful. Rather than just stating we leaked also tell how many MSI or MSI-X vectors we leak. Sponsored-by: The FreeBSD Foundation Reviewed-by: jhb MFC-after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29394 --- sys/dev/pci/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index d85ce5baa7bc..ab19d13fc13a 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -5004,7 +5004,12 @@ pci_child_detached(device_t dev, device_t child) if (resource_list_release_active(rl, dev, child, SYS_RES_IRQ) != 0) pci_printf(&dinfo->cfg, "Device leaked IRQ resources\n"); if (dinfo->cfg.msi.msi_alloc != 0 || dinfo->cfg.msix.msix_alloc != 0) { - pci_printf(&dinfo->cfg, "Device leaked MSI vectors\n"); + if (dinfo->cfg.msi.msi_alloc != 0) + pci_printf(&dinfo->cfg, "Device leaked %d MSI " + "vectors\n", dinfo->cfg.msi.msi_alloc); + else + pci_printf(&dinfo->cfg, "Device leaked %d MSI-X " + "vectors\n", dinfo->cfg.msix.msix_alloc); (void)pci_release_msi(child); } if (resource_list_release_active(rl, dev, child, SYS_RES_MEMORY) != 0) From owner-dev-commits-src-main@freebsd.org Fri Mar 26 12:16:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 675575BDA19; Fri, 26 Mar 2021 12:16: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 4F6LYl2VS5z4bfK; Fri, 26 Mar 2021 12:16: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 48923199E9; Fri, 26 Mar 2021 12:16: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 12QCGhG4055890; Fri, 26 Mar 2021 12:16:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QCGhVL055889; Fri, 26 Mar 2021 12:16:43 GMT (envelope-from git) Date: Fri, 26 Mar 2021 12:16:43 GMT Message-Id: <202103261216.12QCGhVL055889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bc042266b2bf - main - LinuxKPI: add net_ratelimit() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc042266b2bfc3f52f685df7ccdd6e857b4b9da9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 12:16:43 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bc042266b2bfc3f52f685df7ccdd6e857b4b9da9 commit bc042266b2bfc3f52f685df7ccdd6e857b4b9da9 Author: Bjoern A. Zeeb AuthorDate: 2021-03-23 17:00:22 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-26 12:05:48 +0000 LinuxKPI: add net_ratelimit() Add a net_ratelimit() compat implementation based on ppsratecheck(). Add a sysctl to allow tuning of the number of messages. Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: hselasky Differential Revision: https://reviews.freebsd.org/D29399 --- sys/compat/linuxkpi/common/include/linux/net.h | 10 ++++++++++ sys/compat/linuxkpi/common/src/linux_compat.c | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/net.h b/sys/compat/linuxkpi/common/include/linux/net.h index 282a45d2db32..5365cd0e9552 100644 --- a/sys/compat/linuxkpi/common/include/linux/net.h +++ b/sys/compat/linuxkpi/common/include/linux/net.h @@ -76,4 +76,14 @@ sock_release(struct socket *so) soclose(so); } + +int linuxkpi_net_ratelimit(void); + +static inline int +net_ratelimit(void) +{ + + return (linuxkpi_net_ratelimit()); +} + #endif /* _LINUX_NET_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 5f7e2664bee1..60745fbf92da 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -99,6 +100,12 @@ int linuxkpi_debug; SYSCTL_INT(_compat_linuxkpi, OID_AUTO, debug, CTLFLAG_RWTUN, &linuxkpi_debug, 0, "Set to enable pr_debug() prints. Clear to disable."); +static struct timeval lkpi_net_lastlog; +static int lkpi_net_curpps; +static int lkpi_net_maxpps = 99; +SYSCTL_INT(_compat_linuxkpi, OID_AUTO, net_ratelimit, CTLFLAG_RWTUN, + &lkpi_net_maxpps, 0, "Limit number of LinuxKPI net messages per second."); + MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); #include @@ -2511,6 +2518,14 @@ linux_dump_stack(void) #endif } +int +linuxkpi_net_ratelimit(void) +{ + + return (ppsratecheck(&lkpi_net_lastlog, &lkpi_net_curpps, + lkpi_net_maxpps)); +} + #if defined(__i386__) || defined(__amd64__) bool linux_cpu_has_clflush; #endif From owner-dev-commits-src-main@freebsd.org Fri Mar 26 13:11:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CDF75BEE7B; Fri, 26 Mar 2021 13: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 4F6MnL0lvBz4fwc; Fri, 26 Mar 2021 13: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 0CB4A1A953; Fri, 26 Mar 2021 13: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 12QDBnZx037650; Fri, 26 Mar 2021 13:11:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QDBnwA037649; Fri, 26 Mar 2021 13:11:49 GMT (envelope-from git) Date: Fri, 26 Mar 2021 13:11:49 GMT Message-Id: <202103261311.12QDBnwA037649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: fdcfe8a298e2 - main - LinuxKPI: netdevice notifier callback argument MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fdcfe8a298e23bef9588cafad2672e0c5f48a327 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 13:11:50 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=fdcfe8a298e23bef9588cafad2672e0c5f48a327 commit fdcfe8a298e23bef9588cafad2672e0c5f48a327 Author: Bjoern A. Zeeb AuthorDate: 2021-03-21 21:18:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-26 13:00:23 +0000 LinuxKPI: netdevice notifier callback argument Introduce struct netdev_notifier_info as a container to pass net_device to the callback functions. Adjust netdev_notifier_info_to_dev() to return the net_device field. Add explicit casts from ifp to ni->dev even though currently struct net_device is defined to struct ifnet. This is needed in preparation for untangling this and improving the net_device compat code. Obtained-from: bz_iwlwifi Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: hselasky Differential Revision: https://reviews.freebsd.org/D29365 --- .../linuxkpi/common/include/linux/netdevice.h | 27 +++++++++++++--------- sys/compat/linuxkpi/common/src/linux_compat.c | 22 +++++++++++++----- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/netdevice.h b/sys/compat/linuxkpi/common/include/linux/netdevice.h index 336215b9f7c5..9ec76d9b90ef 100644 --- a/sys/compat/linuxkpi/common/include/linux/netdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/netdevice.h @@ -88,17 +88,6 @@ netdev_priv(const struct net_device *dev) return (dev->if_softc); } -static inline struct net_device * -netdev_notifier_info_to_dev(void *ifp) -{ - return (ifp); -} - -int register_netdevice_notifier(struct notifier_block *); -int register_inetaddr_notifier(struct notifier_block *); -int unregister_netdevice_notifier(struct notifier_block *); -int unregister_inetaddr_notifier(struct notifier_block *); - #define rtnl_lock() #define rtnl_unlock() @@ -140,4 +129,20 @@ dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly) return -if_addmulti(dev, (struct sockaddr *)&sdl, NULL); } +/* According to linux::ipoib_main.c. */ +struct netdev_notifier_info { + struct net_device *dev; +}; + +static inline struct net_device * +netdev_notifier_info_to_dev(struct netdev_notifier_info *ni) +{ + return (ni->dev); +} + +int register_netdevice_notifier(struct notifier_block *); +int register_inetaddr_notifier(struct notifier_block *); +int unregister_netdevice_notifier(struct notifier_block *); +int unregister_inetaddr_notifier(struct notifier_block *); + #endif /* _LINUX_NETDEVICE_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 60745fbf92da..42f47b6e510a 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2256,48 +2256,58 @@ static void linux_handle_ifnet_link_event(void *arg, struct ifnet *ifp, int linkstate) { struct notifier_block *nb; + struct netdev_notifier_info ni; nb = arg; + ni.dev = (struct net_device *)ifp; if (linkstate == LINK_STATE_UP) - nb->notifier_call(nb, NETDEV_UP, ifp); + nb->notifier_call(nb, NETDEV_UP, &ni); else - nb->notifier_call(nb, NETDEV_DOWN, ifp); + nb->notifier_call(nb, NETDEV_DOWN, &ni); } static void linux_handle_ifnet_arrival_event(void *arg, struct ifnet *ifp) { struct notifier_block *nb; + struct netdev_notifier_info ni; nb = arg; - nb->notifier_call(nb, NETDEV_REGISTER, ifp); + ni.dev = (struct net_device *)ifp; + nb->notifier_call(nb, NETDEV_REGISTER, &ni); } static void linux_handle_ifnet_departure_event(void *arg, struct ifnet *ifp) { struct notifier_block *nb; + struct netdev_notifier_info ni; nb = arg; - nb->notifier_call(nb, NETDEV_UNREGISTER, ifp); + ni.dev = (struct net_device *)ifp; + nb->notifier_call(nb, NETDEV_UNREGISTER, &ni); } static void linux_handle_iflladdr_event(void *arg, struct ifnet *ifp) { struct notifier_block *nb; + struct netdev_notifier_info ni; nb = arg; - nb->notifier_call(nb, NETDEV_CHANGEADDR, ifp); + ni.dev = (struct net_device *)ifp; + nb->notifier_call(nb, NETDEV_CHANGEADDR, &ni); } static void linux_handle_ifaddr_event(void *arg, struct ifnet *ifp) { struct notifier_block *nb; + struct netdev_notifier_info ni; nb = arg; - nb->notifier_call(nb, NETDEV_CHANGEIFADDR, ifp); + ni.dev = (struct net_device *)ifp; + nb->notifier_call(nb, NETDEV_CHANGEIFADDR, &ni); } int From owner-dev-commits-src-main@freebsd.org Fri Mar 26 15:01:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E43A5798A6; Fri, 26 Mar 2021 15:01: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 4F6QD939M6z4nJQ; Fri, 26 Mar 2021 15:01: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 5F9DC1C2A1; Fri, 26 Mar 2021 15:01: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 12QF1jvo092400; Fri, 26 Mar 2021 15:01:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QF1jak092399; Fri, 26 Mar 2021 15:01:45 GMT (envelope-from git) Date: Fri, 26 Mar 2021 15:01:45 GMT Message-Id: <202103261501.12QF1jak092399@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: f48c35fa1ea8 - main - ce: unifdef NPCI also 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: f48c35fa1ea8e37812b315bd0dee17c88155de26 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 15:01:45 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f48c35fa1ea8e37812b315bd0dee17c88155de26 commit f48c35fa1ea8e37812b315bd0dee17c88155de26 Author: Ed Maste AuthorDate: 2021-03-25 23:39:49 +0000 Commit: Ed Maste CommitDate: 2021-03-26 14:59:11 +0000 ce: unifdef NPCI also After f9839a42ee5d NPCI is always 1. Reported by: imp --- sys/dev/ce/if_ce.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/dev/ce/if_ce.c b/sys/dev/ce/if_ce.c index 9b3cff9adfeb..486397d2a2a9 100644 --- a/sys/dev/ce/if_ce.c +++ b/sys/dev/ce/if_ce.c @@ -20,10 +20,6 @@ __FBSDID("$FreeBSD$"); #include -# define NPCI 1 - -#if NPCI > 0 - #include #include #include @@ -2126,4 +2122,3 @@ DRIVER_MODULE (cemod, pci, ce_driver, ce_devclass, ce_modevent, NULL); #else DRIVER_MODULE (ce, pci, ce_driver, ce_devclass, ce_modevent, NULL); #endif -#endif /* NPCI */ From owner-dev-commits-src-main@freebsd.org Fri Mar 26 15:44:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 640DF57A89A; Fri, 26 Mar 2021 15:44: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 4F6R9D2RcZz4q49; Fri, 26 Mar 2021 15:44: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 423521C5CA; Fri, 26 Mar 2021 15:44: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 12QFiGkP048833; Fri, 26 Mar 2021 15:44:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QFiGY1048832; Fri, 26 Mar 2021 15:44:16 GMT (envelope-from git) Date: Fri, 26 Mar 2021 15:44:16 GMT Message-Id: <202103261544.12QFiGY1048832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Nathan Whitehorn Subject: git: 5140034cc077 - main - Add a new mode to the scripted partition editor for variant disk names. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: nwhitehorn X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5140034cc077c416690b4fdb79a96744fe0af0e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 15:44:16 -0000 The branch main has been updated by nwhitehorn: URL: https://cgit.FreeBSD.org/src/commit/?id=5140034cc077c416690b4fdb79a96744fe0af0e6 commit 5140034cc077c416690b4fdb79a96744fe0af0e6 Author: Nathan Whitehorn AuthorDate: 2021-03-26 15:39:12 +0000 Commit: Nathan Whitehorn CommitDate: 2021-03-26 15:43:47 +0000 Add a new mode to the scripted partition editor for variant disk names. If the disk parameter "DEFAULT" is set in place of an actual device name, or no disk is specified for the PARTITIONS parameter, the installer will follow the logic used in the automatic-partitioning mode, in which it will either provide a selection dialog for one of several disks if several are present or automatically select it if there is only one. This simplifies the creation of fully-automatic installation media for hardware or VMs with varying disk names. Suggested by: Egoitz Aurrekoetxea MFC after: 3 weeks Relnotes: yes --- usr.sbin/bsdinstall/bsdinstall.8 | 20 ++++++++++++++++---- usr.sbin/bsdinstall/partedit/part_wizard.c | 7 +++---- usr.sbin/bsdinstall/partedit/partedit.h | 1 + usr.sbin/bsdinstall/partedit/scripted.c | 10 +++++++--- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8 index c58f6636493a..e9f7dd808f73 100644 --- a/usr.sbin/bsdinstall/bsdinstall.8 +++ b/usr.sbin/bsdinstall/bsdinstall.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2021 +.Dd March 26, 2021 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -158,7 +158,13 @@ Multiple disk setups are separated by semicolons. The .Ar disk argument specifies the disk on which to operate (which will be erased), -while the +or the special value +.Em DEFAULT , +which will result in either a selection window (as in +.Cm autopart ) +for the destination disk or, if there is only one possible disk, will +automatically select it. +The .Ar scheme argument specifies the .Xr gpart 8 @@ -208,6 +214,10 @@ A shorter invocation to use the default partitioning (as would have used) on the same disk: .Pp bsdinstall scriptedpart ada0 +.Pp +or, even shorter: +.Pp +bsdinstall scriptedpart DEFAULT .It Cm mount Mounts the file systems previously configured by .Cm autopart , @@ -279,7 +289,9 @@ See of the .Sx TARGETS -section for format details. +section for format details. If this variable is unset, the installer will +use the default partitioning as in +.Cm autopart . Default: unset .It Ev BSDINSTALL_DISTDIR The directory in which the distribution files can be found (or to which they @@ -454,7 +466,7 @@ the interpreter for the setup script. .Pp A typical bsdinstall script looks like this: .Bd -literal -offset indent -PARTITIONS=ada0 +PARTITIONS=DEFAULT DISTRIBUTIONS="kernel.txz base.txz" #!/bin/sh diff --git a/usr.sbin/bsdinstall/partedit/part_wizard.c b/usr.sbin/bsdinstall/partedit/part_wizard.c index 3160e1f049ea..9f7158a4801e 100644 --- a/usr.sbin/bsdinstall/partedit/part_wizard.c +++ b/usr.sbin/bsdinstall/partedit/part_wizard.c @@ -44,7 +44,6 @@ #define MIN_FREE_SPACE (1024*1024*1024) /* 1 GB */ #define SWAP_SIZE(available) MIN(available/20, 4*1024*1024*1024LL) -static char *boot_disk(struct gmesh *mesh); static char *wizard_partition(struct gmesh *mesh, const char *disk); int @@ -65,7 +64,7 @@ startwizard: dlg_put_backtitle(); error = geom_gettree(&mesh); - disk = boot_disk(&mesh); + disk = boot_disk_select(&mesh); if (disk == NULL) return (1); @@ -91,8 +90,8 @@ startwizard: return (0); } -static char * -boot_disk(struct gmesh *mesh) +char * +boot_disk_select(struct gmesh *mesh) { struct gclass *classp; struct gconfig *gc; diff --git a/usr.sbin/bsdinstall/partedit/partedit.h b/usr.sbin/bsdinstall/partedit/partedit.h index e989decc2359..20d2047c1408 100644 --- a/usr.sbin/bsdinstall/partedit/partedit.h +++ b/usr.sbin/bsdinstall/partedit/partedit.h @@ -60,6 +60,7 @@ void delete_part_metadata(const char *name); int part_wizard(const char *fstype); int scripted_editor(int argc, const char **argv); +char *boot_disk_select(struct gmesh *mesh); int wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, int interactive); diff --git a/usr.sbin/bsdinstall/partedit/scripted.c b/usr.sbin/bsdinstall/partedit/scripted.c index 57dcbca816a3..37ac6de131b5 100644 --- a/usr.sbin/bsdinstall/partedit/scripted.c +++ b/usr.sbin/bsdinstall/partedit/scripted.c @@ -183,10 +183,14 @@ int parse_disk_config(char *input) } } while (input != NULL && *input != 0); - if (disk != NULL) - return (part_config(disk, scheme, partconfig)); + if (disk == NULL || strcmp(disk, "DEFAULT") == 0) { + struct gmesh mesh; + geom_gettree(&mesh); + disk = boot_disk_select(&mesh); + geom_deletetree(&mesh); + } - return (0); + return (part_config(disk, scheme, partconfig)); } int From owner-dev-commits-src-main@freebsd.org Fri Mar 26 16:05:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98A6557B5D1; Fri, 26 Mar 2021 16:05: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 4F6RfB40BMz4rqh; Fri, 26 Mar 2021 16:05: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 7A2BE1D107; Fri, 26 Mar 2021 16:05: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 12QG5sg0077203; Fri, 26 Mar 2021 16:05:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QG5s6v077202; Fri, 26 Mar 2021 16:05:54 GMT (envelope-from git) Date: Fri, 26 Mar 2021 16:05:54 GMT Message-Id: <202103261605.12QG5s6v077202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5a461a86cf5b - main - mlx4: remove no longer needed header MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a461a86cf5bb0ac4ffde3caf03df0386ddad6cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 16:05:54 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5a461a86cf5bb0ac4ffde3caf03df0386ddad6cc commit 5a461a86cf5bb0ac4ffde3caf03df0386ddad6cc Author: Bjoern A. Zeeb AuthorDate: 2021-03-26 15:28:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-26 15:56:02 +0000 mlx4: remove no longer needed header Remove linux/inetdevice.h as neither of the two inline functions there are used here. Sposored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: hselasky X-D-R: D29366 (extracted as further cleanup) Differential Revision: https://reviews.freebsd.org/D29428 --- sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c index 2d628c7868cb..b31744e73be6 100644 --- a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c +++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include From owner-dev-commits-src-main@freebsd.org Fri Mar 26 16:58:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBD8057CB6D; Fri, 26 Mar 2021 16:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6SqL5v6fz3CbJ; Fri, 26 Mar 2021 16:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD55A1DB85; Fri, 26 Mar 2021 16:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12QGwsJ4047485; Fri, 26 Mar 2021 16:58:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QGwsvI047484; Fri, 26 Mar 2021 16:58:54 GMT (envelope-from git) Date: Fri, 26 Mar 2021 16:58:54 GMT Message-Id: <202103261658.12QGwsvI047484@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: d83ffa44777e - main - obsoletefiles: also remove the terminfo directory along with the db 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: d83ffa44777e14c94f5de73d1e0f5af774c8d6be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 16:58:54 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d83ffa44777e14c94f5de73d1e0f5af774c8d6be commit d83ffa44777e14c94f5de73d1e0f5af774c8d6be Author: Baptiste Daroussin AuthorDate: 2021-03-26 16:58:06 +0000 Commit: Baptiste Daroussin CommitDate: 2021-03-26 16:58:39 +0000 obsoletefiles: also remove the terminfo directory along with the db --- ObsoleteFiles.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index f4c6909cc10a..3c71693b793a 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -2863,6 +2863,7 @@ OLD_FILES+=usr/share/terminfo/z/ztx OLD_FILES+=usr/share/terminfo/z/ztx-1-a OLD_FILES+=usr/share/terminfo/z/ztx11 OLD_DIRS+=usr/share/terminfo/z/ +OLD_DIRS+=usr/share/terminfo/ # 20210316: remove obsolete NFS headers OLD_FILES+=usr/include/nfs/nfs_common.h From owner-dev-commits-src-main@freebsd.org Fri Mar 26 17:28:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8227557E0D4; Fri, 26 Mar 2021 17:28:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6TV03Htlz3F7b; Fri, 26 Mar 2021 17:28: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 63F381DF44; Fri, 26 Mar 2021 17:28: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 12QHSu7s089849; Fri, 26 Mar 2021 17:28:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QHSuhF089848; Fri, 26 Mar 2021 17:28:56 GMT (envelope-from git) Date: Fri, 26 Mar 2021 17:28:56 GMT Message-Id: <202103261728.12QHSuhF089848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6c8dd7c863f1 - main - qlnxr: remove netdevice.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c8dd7c863f111a22c8548ebf5d7e889117a964d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 17:28:56 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6c8dd7c863f111a22c8548ebf5d7e889117a964d commit 6c8dd7c863f111a22c8548ebf5d7e889117a964d Author: Bjoern A. Zeeb AuthorDate: 2021-03-26 17:17:10 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-26 17:17:10 +0000 qlnxr: remove netdevice.h Remove unused #includes of a LinuxKPI header noticed while trying to solve LinuxKPI struct net_device and related functions. This takes qlnxr out of the picture of D29366. Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks X-D-R: D29366 (extracted as further cleanup) --- sys/dev/qlnx/qlnxr/qlnxr_def.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/qlnx/qlnxr/qlnxr_def.h b/sys/dev/qlnx/qlnxr/qlnxr_def.h index b08eab8a6c46..04f911e792a8 100644 --- a/sys/dev/qlnx/qlnxr/qlnxr_def.h +++ b/sys/dev/qlnx/qlnxr/qlnxr_def.h @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include From owner-dev-commits-src-main@freebsd.org Fri Mar 26 17:55:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92FE857E74C; Fri, 26 Mar 2021 17:55: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 4F6V4c3q26z3Gcq; Fri, 26 Mar 2021 17:55: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 75D4A1E808; Fri, 26 Mar 2021 17:55: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 12QHtSBj030517; Fri, 26 Mar 2021 17:55:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QHtSH4030516; Fri, 26 Mar 2021 17:55:28 GMT (envelope-from git) Date: Fri, 26 Mar 2021 17:55:28 GMT Message-Id: <202103261755.12QHtSH4030516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0a7b99553f5c - main - cxgbe: remove unused linux headers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a7b99553f5c1e68868e3cbaccb3160eb1a7d1d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 17:55:28 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0a7b99553f5c1e68868e3cbaccb3160eb1a7d1d6 commit 0a7b99553f5c1e68868e3cbaccb3160eb1a7d1d6 Author: Bjoern A. Zeeb AuthorDate: 2021-03-26 16:10:25 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-03-26 17:44:38 +0000 cxgbe: remove unused linux headers Remove unused #includes of LinuxKPI headers noticed while trying to solve LinuxKPI struct net_device and related functions. Neither netdevice.h nor inetdevice.h nor notifier.h seem to be needed. This takes cxgbe(4) out of the picture of D29366. Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: np X-D-R: D29366 (extracted as further cleanup) Differential Revision: https://reviews.freebsd.org/D29432 --- sys/dev/cxgbe/iw_cxgbe/cm.c | 2 -- sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h | 1 - 2 files changed, 3 deletions(-) diff --git a/sys/dev/cxgbe/iw_cxgbe/cm.c b/sys/dev/cxgbe/iw_cxgbe/cm.c index 9f6f5411733c..b83622cc3c65 100644 --- a/sys/dev/cxgbe/iw_cxgbe/cm.c +++ b/sys/dev/cxgbe/iw_cxgbe/cm.c @@ -73,8 +73,6 @@ struct cpl_set_tcb_rpl; #include "iw_cxgbe.h" #include #include -#include -#include #include #include #include diff --git a/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h b/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h index 5f26eccc1d1b..aa94a40add1e 100644 --- a/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h +++ b/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include From owner-dev-commits-src-main@freebsd.org Fri Mar 26 18:05:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FD4E57F21F; Fri, 26 Mar 2021 18:05:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6VJX2Wvkz3H7q; Fri, 26 Mar 2021 18:05:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4509B1E64A; Fri, 26 Mar 2021 18:05:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12QI5m9F045685; Fri, 26 Mar 2021 18:05:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QI5mpq045684; Fri, 26 Mar 2021 18:05:48 GMT (envelope-from git) Date: Fri, 26 Mar 2021 18:05:48 GMT Message-Id: <202103261805.12QI5mpq045684@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: badcfbacf384 - main - rpc.lockd: Unconditionally close fds as daemon MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: badcfbacf3840a4097bb79192054481c7674e7d2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 18:05:48 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=badcfbacf3840a4097bb79192054481c7674e7d2 commit badcfbacf3840a4097bb79192054481c7674e7d2 Author: Caleb St. John AuthorDate: 2021-03-26 18:00:14 +0000 Commit: Ryan Moeller CommitDate: 2021-03-26 18:05:33 +0000 rpc.lockd: Unconditionally close fds as daemon When lockd is configured with a debug level of > 0 and foreground == 0, the process is daemonized with a truth noclose argument to daemon(). This doesn't seem to be the desired behavior because that prevents stdout and stderr from being closed, however, stdout and stderr aren't used anywhere else. Furthermore, the man pages state that with a higher debug level it will use the syslog facilities to do so. Submitted by: Caleb St. John Discussed with: rmacklem MFC after: 3 days Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D29415 --- usr.sbin/rpc.lockd/lockd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c index 9aac9273b3fd..e25cef9993bb 100644 --- a/usr.sbin/rpc.lockd/lockd.c +++ b/usr.sbin/rpc.lockd/lockd.c @@ -426,7 +426,7 @@ main(int argc, char **argv) * Note that it is NOT sensible to run this program from inetd - the * protocol assumes that it will run immediately at boot time. */ - if ((foreground == 0) && daemon(0, debug_level > 0)) { + if ((foreground == 0) && daemon(0, 0)) { err(1, "cannot fork"); /* NOTREACHED */ } From owner-dev-commits-src-main@freebsd.org Fri Mar 26 18:13:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B256757F179; Fri, 26 Mar 2021 18:13:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6VTt4gbhz3HjV; Fri, 26 Mar 2021 18:13: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 933211EC1F; Fri, 26 Mar 2021 18:13: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 12QIDsPN059283; Fri, 26 Mar 2021 18:13:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QIDsDI059282; Fri, 26 Mar 2021 18:13:54 GMT (envelope-from git) Date: Fri, 26 Mar 2021 18:13:54 GMT Message-Id: <202103261813.12QIDsDI059282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: b07b7aec6534 - main - bsdinstall: Drop vestigial bsdinstall-esps cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b07b7aec6534052d60cffe010c0426a7ab986d85 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 18:13:54 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=b07b7aec6534052d60cffe010c0426a7ab986d85 commit b07b7aec6534052d60cffe010c0426a7ab986d85 Author: Ryan Moeller AuthorDate: 2021-03-26 18:12:18 +0000 Commit: Ryan Moeller CommitDate: 2021-03-26 18:12:18 +0000 bsdinstall: Drop vestigial bsdinstall-esps cleanup This is not needed after 0b7472b3d8d2f1e90fade5236b44fd98d8e396c2. MFC after: 3 days Sponsored by: iXsystems, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29325 --- usr.sbin/bsdinstall/partedit/partedit.c | 14 +------------- usr.sbin/bsdinstall/partedit/partedit.h | 2 -- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/usr.sbin/bsdinstall/partedit/partedit.c b/usr.sbin/bsdinstall/partedit/partedit.c index 6d045428dd32..84f7ef032ba9 100644 --- a/usr.sbin/bsdinstall/partedit/partedit.c +++ b/usr.sbin/bsdinstall/partedit/partedit.c @@ -45,7 +45,6 @@ #include "partedit.h" struct pmetadata_head part_metadata; -int tmpdfd; static int sade_mode = 0; static int apply_changes(struct gmesh *mesh); @@ -69,8 +68,6 @@ sigint_handler(int sig) end_dialog(); - close(tmpdfd); - exit(1); } @@ -78,7 +75,7 @@ int main(int argc, const char **argv) { struct partition_metadata *md; - const char *progname, *prompt, *tmpdir; + const char *progname, *prompt; struct partedit_item *items = NULL; struct gmesh mesh; int i, op, nitems, nscroll; @@ -90,14 +87,6 @@ main(int argc, const char **argv) TAILQ_INIT(&part_metadata); - tmpdir = getenv("TMPDIR"); - if (tmpdir == NULL) - tmpdir = "/tmp"; - tmpdfd = open(tmpdir, O_DIRECTORY); - if (tmpdfd < 0) - err(EX_OSERR, "%s", tmpdir); - unlinkat(tmpdfd, "bsdinstall-esps", 0); - init_fstab_metadata(); init_dialog(stdin, stdout); @@ -233,7 +222,6 @@ main(int argc, const char **argv) geom_deletetree(&mesh); free(items); end_dialog(); - close(tmpdfd); return (error); } diff --git a/usr.sbin/bsdinstall/partedit/partedit.h b/usr.sbin/bsdinstall/partedit/partedit.h index 20d2047c1408..5c0405922d21 100644 --- a/usr.sbin/bsdinstall/partedit/partedit.h +++ b/usr.sbin/bsdinstall/partedit/partedit.h @@ -39,8 +39,6 @@ struct gprovider; struct gmesh; struct ggeom; -extern int tmpdfd; - TAILQ_HEAD(pmetadata_head, partition_metadata); extern struct pmetadata_head part_metadata; From owner-dev-commits-src-main@freebsd.org Fri Mar 26 21:23:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18C635ACF56; Fri, 26 Mar 2021 21:23: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 4F6Zhn6s3Vz3lcL; Fri, 26 Mar 2021 21:23: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 DE3B52132A; Fri, 26 Mar 2021 21:23: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 12QLNb3f024938; Fri, 26 Mar 2021 21:23:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QLNbMh024937; Fri, 26 Mar 2021 21:23:37 GMT (envelope-from git) Date: Fri, 26 Mar 2021 21:23:37 GMT Message-Id: <202103262123.12QLNbMh024937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: dacfb3a1c427 - main - Remove more terminfo entries after 16d3faad099a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dacfb3a1c427d8779bcad6f9984fa0a068ef81d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 21:23:38 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=dacfb3a1c427d8779bcad6f9984fa0a068ef81d8 commit dacfb3a1c427d8779bcad6f9984fa0a068ef81d8 Author: Dimitry Andric AuthorDate: 2021-03-20 22:07:23 +0000 Commit: Dimitry Andric CommitDate: 2021-03-26 21:21:49 +0000 Remove more terminfo entries after 16d3faad099a Otherwise, several directories under /usr/share/terminfo will not be cleaned up. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D29355 --- ObsoleteFiles.inc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 3c71693b793a..94abddf5ac14 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -175,6 +175,7 @@ OLD_FILES+=usr/share/terminfo/a/abm85 OLD_FILES+=usr/share/terminfo/a/abm85e OLD_FILES+=usr/share/terminfo/a/abm85h OLD_FILES+=usr/share/terminfo/a/abm85h-old +OLD_FILES+=usr/share/terminfo/a/absolute OLD_FILES+=usr/share/terminfo/a/act4 OLD_FILES+=usr/share/terminfo/a/act5 OLD_FILES+=usr/share/terminfo/a/addrinfo @@ -409,6 +410,8 @@ OLD_FILES+=usr/share/terminfo/a/att605 OLD_FILES+=usr/share/terminfo/a/att605-pc OLD_FILES+=usr/share/terminfo/a/att605-w OLD_FILES+=usr/share/terminfo/a/att610 +OLD_FILES+=usr/share/terminfo/a/att610+cvis +OLD_FILES+=usr/share/terminfo/a/att610+cvis0 OLD_FILES+=usr/share/terminfo/a/att610-103k OLD_FILES+=usr/share/terminfo/a/att610-103k-w OLD_FILES+=usr/share/terminfo/a/att610-w @@ -1313,6 +1316,8 @@ OLD_FILES+=usr/share/terminfo/l/layer OLD_FILES+=usr/share/terminfo/l/lft OLD_FILES+=usr/share/terminfo/l/lft-pc850 OLD_FILES+=usr/share/terminfo/l/linux +OLD_FILES+=usr/share/terminfo/l/linux+decid +OLD_FILES+=usr/share/terminfo/l/linux+sfkeys OLD_FILES+=usr/share/terminfo/l/linux-16color OLD_FILES+=usr/share/terminfo/l/linux-basic OLD_FILES+=usr/share/terminfo/l/linux-c @@ -1325,6 +1330,7 @@ OLD_FILES+=usr/share/terminfo/l/linux-m1 OLD_FILES+=usr/share/terminfo/l/linux-m1b OLD_FILES+=usr/share/terminfo/l/linux-m2 OLD_FILES+=usr/share/terminfo/l/linux-nic +OLD_FILES+=usr/share/terminfo/l/linux-s OLD_FILES+=usr/share/terminfo/l/linux-vt OLD_FILES+=usr/share/terminfo/l/linux2.2 OLD_FILES+=usr/share/terminfo/l/linux2.6 @@ -1814,12 +1820,15 @@ OLD_FILES+=usr/share/terminfo/p/putty+fnkeys+sco OLD_FILES+=usr/share/terminfo/p/putty+fnkeys+vt100 OLD_FILES+=usr/share/terminfo/p/putty+fnkeys+vt400 OLD_FILES+=usr/share/terminfo/p/putty+fnkeys+xterm +OLD_FILES+=usr/share/terminfo/p/putty+keypad +OLD_FILES+=usr/share/terminfo/p/putty+screen OLD_FILES+=usr/share/terminfo/p/putty-256color OLD_FILES+=usr/share/terminfo/p/putty-m1 OLD_FILES+=usr/share/terminfo/p/putty-m1b OLD_FILES+=usr/share/terminfo/p/putty-m2 OLD_FILES+=usr/share/terminfo/p/putty-noapp OLD_FILES+=usr/share/terminfo/p/putty-sco +OLD_FILES+=usr/share/terminfo/p/putty-screen OLD_FILES+=usr/share/terminfo/p/putty-vt100 OLD_DIRS+=usr/share/terminfo/p/ OLD_FILES+=usr/share/terminfo/q/qansi @@ -1934,6 +1943,7 @@ OLD_FILES+=usr/share/terminfo/s/screen.linux OLD_FILES+=usr/share/terminfo/s/screen.linux-m1 OLD_FILES+=usr/share/terminfo/s/screen.linux-m1b OLD_FILES+=usr/share/terminfo/s/screen.linux-m2 +OLD_FILES+=usr/share/terminfo/s/screen.linux-s OLD_FILES+=usr/share/terminfo/s/screen.minitel1 OLD_FILES+=usr/share/terminfo/s/screen.minitel1-nb OLD_FILES+=usr/share/terminfo/s/screen.minitel12-80 @@ -1963,6 +1973,8 @@ OLD_FILES+=usr/share/terminfo/s/screen4 OLD_FILES+=usr/share/terminfo/s/screen5 OLD_FILES+=usr/share/terminfo/s/screwpoint OLD_FILES+=usr/share/terminfo/s/scrhp +OLD_FILES+=usr/share/terminfo/s/scrt +OLD_FILES+=usr/share/terminfo/s/securecrt OLD_FILES+=usr/share/terminfo/s/sibo OLD_FILES+=usr/share/terminfo/s/simpleterm OLD_FILES+=usr/share/terminfo/s/simterm @@ -2019,6 +2031,7 @@ OLD_FILES+=usr/share/terminfo/s/synertek OLD_FILES+=usr/share/terminfo/s/synertek380 OLD_FILES+=usr/share/terminfo/s/system1 OLD_DIRS+=usr/share/terminfo/s/ + OLD_FILES+=usr/share/terminfo/t/t10 OLD_FILES+=usr/share/terminfo/t/t1061 OLD_FILES+=usr/share/terminfo/t/t1061f @@ -2088,6 +2101,7 @@ OLD_FILES+=usr/share/terminfo/t/terminet300 OLD_FILES+=usr/share/terminfo/t/terminology OLD_FILES+=usr/share/terminfo/t/terminology-0.6.1 OLD_FILES+=usr/share/terminfo/t/terminology-1.0.0 +OLD_FILES+=usr/share/terminfo/t/terminology-1.8.1 OLD_FILES+=usr/share/terminfo/t/termite OLD_FILES+=usr/share/terminfo/t/tgtelnet OLD_FILES+=usr/share/terminfo/t/ti700 @@ -2118,6 +2132,7 @@ OLD_FILES+=usr/share/terminfo/t/ti_ansi OLD_FILES+=usr/share/terminfo/t/tkterm OLD_FILES+=usr/share/terminfo/t/tmux OLD_FILES+=usr/share/terminfo/t/tmux-256color +OLD_FILES+=usr/share/terminfo/t/tmux-direct OLD_FILES+=usr/share/terminfo/t/tn1200 OLD_FILES+=usr/share/terminfo/t/tn300 OLD_FILES+=usr/share/terminfo/t/trs16 @@ -2387,9 +2402,14 @@ OLD_FILES+=usr/share/terminfo/v/vt200-js OLD_FILES+=usr/share/terminfo/v/vt200-old OLD_FILES+=usr/share/terminfo/v/vt200-w OLD_FILES+=usr/share/terminfo/v/vt220 +OLD_FILES+=usr/share/terminfo/v/vt220+cvis +OLD_FILES+=usr/share/terminfo/v/vt220+cvis8 OLD_FILES+=usr/share/terminfo/v/vt220+keypad +OLD_FILES+=usr/share/terminfo/v/vt220+pcedit +OLD_FILES+=usr/share/terminfo/v/vt220+vtedit OLD_FILES+=usr/share/terminfo/v/vt220-8 OLD_FILES+=usr/share/terminfo/v/vt220-8bit +OLD_FILES+=usr/share/terminfo/v/vt220-base OLD_FILES+=usr/share/terminfo/v/vt220-js OLD_FILES+=usr/share/terminfo/v/vt220-nam OLD_FILES+=usr/share/terminfo/v/vt220-old @@ -2421,6 +2441,8 @@ OLD_FILES+=usr/share/terminfo/v/vt510 OLD_FILES+=usr/share/terminfo/v/vt510pc OLD_FILES+=usr/share/terminfo/v/vt510pcdos OLD_FILES+=usr/share/terminfo/v/vt52 +OLD_FILES+=usr/share/terminfo/v/vt52+keypad +OLD_FILES+=usr/share/terminfo/v/vt52-basic OLD_FILES+=usr/share/terminfo/v/vt520 OLD_FILES+=usr/share/terminfo/v/vt520ansi OLD_FILES+=usr/share/terminfo/v/vt525 @@ -2747,19 +2769,25 @@ OLD_FILES+=usr/share/terminfo/x/xnuppc-m-f2 OLD_FILES+=usr/share/terminfo/x/xtalk OLD_FILES+=usr/share/terminfo/x/xterm OLD_FILES+=usr/share/terminfo/x/xterm+256color +OLD_FILES+=usr/share/terminfo/x/xterm+256color2 OLD_FILES+=usr/share/terminfo/x/xterm+256setaf OLD_FILES+=usr/share/terminfo/x/xterm+88color +OLD_FILES+=usr/share/terminfo/x/xterm+88color2 OLD_FILES+=usr/share/terminfo/x/xterm+alt+title OLD_FILES+=usr/share/terminfo/x/xterm+alt1049 OLD_FILES+=usr/share/terminfo/x/xterm+app OLD_FILES+=usr/share/terminfo/x/xterm+direct +OLD_FILES+=usr/share/terminfo/x/xterm+direct16 OLD_FILES+=usr/share/terminfo/x/xterm+direct2 +OLD_FILES+=usr/share/terminfo/x/xterm+direct256 OLD_FILES+=usr/share/terminfo/x/xterm+edit OLD_FILES+=usr/share/terminfo/x/xterm+indirect OLD_FILES+=usr/share/terminfo/x/xterm+kbs OLD_FILES+=usr/share/terminfo/x/xterm+keypad +OLD_FILES+=usr/share/terminfo/x/xterm+meta OLD_FILES+=usr/share/terminfo/x/xterm+noalt OLD_FILES+=usr/share/terminfo/x/xterm+noapp +OLD_FILES+=usr/share/terminfo/x/xterm+nofkeys OLD_FILES+=usr/share/terminfo/x/xterm+osc104 OLD_FILES+=usr/share/terminfo/x/xterm+pc+edit OLD_FILES+=usr/share/terminfo/x/xterm+pcc0 @@ -2796,7 +2824,9 @@ OLD_FILES+=usr/share/terminfo/x/xterm-basic OLD_FILES+=usr/share/terminfo/x/xterm-bold OLD_FILES+=usr/share/terminfo/x/xterm-color OLD_FILES+=usr/share/terminfo/x/xterm-direct +OLD_FILES+=usr/share/terminfo/x/xterm-direct16 OLD_FILES+=usr/share/terminfo/x/xterm-direct2 +OLD_FILES+=usr/share/terminfo/x/xterm-direct256 OLD_FILES+=usr/share/terminfo/x/xterm-hp OLD_FILES+=usr/share/terminfo/x/xterm-mono OLD_FILES+=usr/share/terminfo/x/xterm-new From owner-dev-commits-src-main@freebsd.org Fri Mar 26 21:29:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C97EB5AD0C1; Fri, 26 Mar 2021 21:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6ZqZ5L9Sz3ls6; Fri, 26 Mar 2021 21:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5DD9212B7; Fri, 26 Mar 2021 21:29: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 12QLTUAB025956; Fri, 26 Mar 2021 21:29:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QLTUJD025955; Fri, 26 Mar 2021 21:29:30 GMT (envelope-from git) Date: Fri, 26 Mar 2021 21:29:30 GMT Message-Id: <202103262129.12QLTUJD025955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 4233882f4ed3 - main - security.7: fix typo in sysctl name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4233882f4ed36bde0ad03918d3f9a54a0cd7697a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 21:29:30 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=4233882f4ed36bde0ad03918d3f9a54a0cd7697a commit 4233882f4ed36bde0ad03918d3f9a54a0cd7697a Author: Piotr Pawel Stefaniak AuthorDate: 2021-03-26 21:24:06 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-03-26 21:24:31 +0000 security.7: fix typo in sysctl name It is machdep.syscall_ret_flush_l1d. --- share/man/man7/security.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/security.7 b/share/man/man7/security.7 index b4aeb5728313..bb7e120a1d46 100644 --- a/share/man/man7/security.7 +++ b/share/man/man7/security.7 @@ -1011,7 +1011,7 @@ Controls Speculative Store Bypass hardware information leak mitigation. amd64 and i386. Controls Indirect Branch Restricted Speculation hardware information leak mitigation. -.It Dv machdep.syscall_ret_l1d_flush +.It Dv machdep.syscall_ret_flush_l1d amd64. Controls force-flush of L1D cache on return from syscalls which report errors other than From owner-dev-commits-src-main@freebsd.org Fri Mar 26 22:02:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5868B5AE9A7; Fri, 26 Mar 2021 22: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 4F6bY8257Dz3pbX; Fri, 26 Mar 2021 22: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 3AB9321A4D; Fri, 26 Mar 2021 22: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 12QM24GS080969; Fri, 26 Mar 2021 22: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 12QM24jH080968; Fri, 26 Mar 2021 22:02:04 GMT (envelope-from git) Date: Fri, 26 Mar 2021 22:02:04 GMT Message-Id: <202103262202.12QM24jH080968@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: 720dc6bcb5a8 - main - Consolidate machine/endian.h definitions 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: 720dc6bcb5a8c4283802576e2ef54f42b33fa8d4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 22:02:04 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=720dc6bcb5a8c4283802576e2ef54f42b33fa8d4 commit 720dc6bcb5a8c4283802576e2ef54f42b33fa8d4 Author: Mitchell Horne AuthorDate: 2021-03-01 15:07:54 +0000 Commit: Mitchell Horne CommitDate: 2021-03-26 22:00:22 +0000 Consolidate machine/endian.h definitions This change serves two purposes. First, we take advantage of the compiler provided endian definitions to eliminate some long-standing duplication between the different versions of this header. __BYTE_ORDER__ has been defined since GCC 4.6, so there is no need to rely on platform defaults or e.g. __MIPSEB__ to determine endianness. A new common sub-header is added, but there should be no changes to the visibility of these definitions. Second, this eliminates the hand-rolled __bswapNN() routines, again in favor of the compiler builtins. This was done already for x86 in e6ff6154d203. The benefit here is that we no longer have to maintain our own implementations on each arch, and can instead rely on the compiler to emit appropriate instructions or libcalls, as available. This should result in equivalent or better code generation. Notably 32-bit arm will start using the `rev` instruction for these routines, which is available on armv6+. PR: 236920 Reviewed by: arichardson, imp Tested by: bdragon (BE powerpc) MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D29012 --- sys/arm/include/endian.h | 109 ++----------------------------------------- sys/arm64/include/endian.h | 85 +-------------------------------- sys/mips/include/endian.h | 106 +---------------------------------------- sys/powerpc/include/endian.h | 102 +--------------------------------------- sys/riscv/include/endian.h | 87 +--------------------------------- sys/sys/_endian.h | 92 ++++++++++++++++++++++++++++++++++++ sys/x86/include/endian.h | 38 +-------------- 7 files changed, 101 insertions(+), 518 deletions(-) diff --git a/sys/arm/include/endian.h b/sys/arm/include/endian.h index 5fb94db3b9b8..eb3f0d142322 100644 --- a/sys/arm/include/endian.h +++ b/sys/arm/include/endian.h @@ -32,111 +32,10 @@ * $FreeBSD$ */ -#ifndef _ENDIAN_H_ -#define _ENDIAN_H_ +#ifndef _MACHINE_ENDIAN_H_ +#define _MACHINE_ENDIAN_H_ #include +#include -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#ifdef __ARMEB__ -#define _BYTE_ORDER _BIG_ENDIAN -#else -#define _BYTE_ORDER _LITTLE_ENDIAN -#endif /* __ARMEB__ */ - -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#ifdef __ARMEB__ -#define _QUAD_HIGHWORD 0 -#define _QUAD_LOWWORD 1 -#define __ntohl(x) ((__uint32_t)(x)) -#define __ntohs(x) ((__uint16_t)(x)) -#define __htonl(x) ((__uint32_t)(x)) -#define __htons(x) ((__uint16_t)(x)) -#else -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 -#define __ntohl(x) (__bswap32(x)) -#define __ntohs(x) (__bswap16(x)) -#define __htonl(x) (__bswap32(x)) -#define __htons(x) (__bswap16(x)) -#endif /* __ARMEB__ */ - -static __inline __uint64_t -__bswap64(__uint64_t _x) -{ - - return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | - ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | - ((_x << 24) & ((__uint64_t)0xff << 40)) | - ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t v) -{ - __uint32_t t1; - - __asm __volatile("eor %1, %0, %0, ror #16\n" - "bic %1, %1, #0x00ff0000\n" - "mov %0, %0, ror #8\n" - "eor %0, %0, %1, lsr #8\n" - : "+r" (v), "=r" (t1)); - - return (v); -} - -static __inline __uint16_t -__bswap16_var(__uint16_t v) -{ - __uint32_t ret = v & 0xffff; - - __asm __volatile( - "mov %0, %0, ror #8\n" - "orr %0, %0, %0, lsr #16\n" - "bic %0, %0, %0, lsl #16" - : "+r" (ret)); - - return ((__uint16_t)ret); -} - -#ifdef __OPTIMIZE__ - -#define __bswap32_constant(x) \ - ((((x) & 0xff000000U) >> 24) | \ - (((x) & 0x00ff0000U) >> 8) | \ - (((x) & 0x0000ff00U) << 8) | \ - (((x) & 0x000000ffU) << 24)) - -#define __bswap16_constant(x) \ - ((((x) & 0xff00) >> 8) | \ - (((x) & 0x00ff) << 8)) - -#define __bswap16(x) \ - ((__uint16_t)(__builtin_constant_p(x) ? \ - __bswap16_constant(x) : \ - __bswap16_var(x))) - -#define __bswap32(x) \ - ((__uint32_t)(__builtin_constant_p(x) ? \ - __bswap32_constant(x) : \ - __bswap32_var(x))) - -#else -#define __bswap16(x) __bswap16_var(x) -#define __bswap32(x) __bswap32_var(x) - -#endif /* __OPTIMIZE__ */ -#endif /* !_ENDIAN_H_ */ +#endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/sys/arm64/include/endian.h b/sys/arm64/include/endian.h index 8cb5c6976b37..0f06010b7e4b 100644 --- a/sys/arm64/include/endian.h +++ b/sys/arm64/include/endian.h @@ -34,89 +34,6 @@ #define _MACHINE_ENDIAN_H_ #include +#include -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#define _BYTE_ORDER _LITTLE_ENDIAN - -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 -#define __ntohl(x) (__bswap32(x)) -#define __ntohs(x) (__bswap16(x)) -#define __htonl(x) (__bswap32(x)) -#define __htons(x) (__bswap16(x)) - -static __inline __uint64_t -__bswap64(__uint64_t x) -{ - __uint64_t ret; - - __asm __volatile("rev %0, %1\n" - : "=&r" (ret), "+r" (x)); - - return (ret); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t v) -{ - __uint32_t ret; - - __asm __volatile("rev32 %x0, %x1\n" - : "=&r" (ret), "+r" (v)); - - return (ret); -} - -static __inline __uint16_t -__bswap16_var(__uint16_t v) -{ - __uint32_t ret; - - __asm __volatile("rev16 %w0, %w1\n" - : "=&r" (ret), "+r" (v)); - - return ((__uint16_t)ret); -} - -#ifdef __OPTIMIZE__ - -#define __bswap32_constant(x) \ - ((((x) & 0xff000000U) >> 24) | \ - (((x) & 0x00ff0000U) >> 8) | \ - (((x) & 0x0000ff00U) << 8) | \ - (((x) & 0x000000ffU) << 24)) - -#define __bswap16_constant(x) \ - ((((x) & 0xff00) >> 8) | \ - (((x) & 0x00ff) << 8)) - -#define __bswap16(x) \ - ((__uint16_t)(__builtin_constant_p(x) ? \ - __bswap16_constant((__uint16_t)(x)) : \ - __bswap16_var(x))) - -#define __bswap32(x) \ - ((__uint32_t)(__builtin_constant_p(x) ? \ - __bswap32_constant((__uint32_t)(x)) : \ - __bswap32_var(x))) - -#else -#define __bswap16(x) __bswap16_var(x) -#define __bswap32(x) __bswap32_var(x) - -#endif /* __OPTIMIZE__ */ #endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/sys/mips/include/endian.h b/sys/mips/include/endian.h index 9faf60e9667f..57f76445a9cd 100644 --- a/sys/mips/include/endian.h +++ b/sys/mips/include/endian.h @@ -39,110 +39,6 @@ #ifndef __ASSEMBLER__ #include #endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#ifdef __MIPSEB__ -#define _BYTE_ORDER _BIG_ENDIAN -#else -#define _BYTE_ORDER _LITTLE_ENDIAN -#endif /* __MIBSEB__ */ - -/* - * Deprecated variants that don't have enough underscores to be useful in more - * strict namespaces. - */ -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#ifndef __ASSEMBLER__ -#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) && defined(__OPTIMIZE__) -#define __is_constant(x) __builtin_constant_p(x) -#else -#define __is_constant(x) 0 -#endif - -#define __bswap16_const(x) (((x) >> 8) | (((x) << 8) & 0xff00)) -#define __bswap32_const(x) (((x) >> 24) | (((x) >> 8) & 0xff00) | \ - (((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000)) -#define __bswap64_const(x) (((x) >> 56) | (((x) >> 40) & 0xff00) | \ - (((x) >> 24) & 0xff0000) | (((x) >> 8) & 0xff000000) | \ - (((x) << 8) & ((__uint64_t)0xff << 32)) | \ - (((x) << 24) & ((__uint64_t)0xff << 40)) | \ - (((x) << 40) & ((__uint64_t)0xff << 48)) | (((x) << 56))) - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - - return ((_x >> 8) | ((_x << 8) & 0xff00)); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - - return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) | - ((_x << 24) & 0xff000000)); -} - -static __inline __uint64_t -__bswap64_var(__uint64_t _x) -{ - - return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | - ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | - ((_x << 24) & ((__uint64_t)0xff << 40)) | - ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); -} - -#define __bswap16(x) ((__uint16_t)(__is_constant((x)) ? \ - __bswap16_const((__uint16_t)(x)) : __bswap16_var((__uint16_t)(x)))) -#define __bswap32(x) ((__uint32_t)(__is_constant((x)) ? \ - __bswap32_const((__uint32_t)(x)) : __bswap32_var((__uint32_t)(x)))) -#define __bswap64(x) ((__uint64_t)(__is_constant((x)) ? \ - __bswap64_const((__uint64_t)(x)) : __bswap64_var((__uint64_t)(x)))) - -#ifdef __MIPSEB__ -#define __htonl(x) ((__uint32_t)(x)) -#define __htons(x) ((__uint16_t)(x)) -#define __ntohl(x) ((__uint32_t)(x)) -#define __ntohs(x) ((__uint16_t)(x)) -/* - * Define the order of 32-bit words in 64-bit words. - */ -/* - * XXXMIPS: Additional parentheses to make gcc more happy. - */ -#define _QUAD_HIGHWORD 0 -#define _QUAD_LOWWORD 1 -#else -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 -#define __ntohl(x) (__bswap32((x))) -#define __ntohs(x) (__bswap16((x))) -#define __htonl(x) (__bswap32((x))) -#define __htons(x) (__bswap16((x))) -#endif /* _MIPSEB */ - -#endif /* _ASSEMBLER_ */ - -#ifdef __cplusplus -} -#endif +#include #endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/sys/powerpc/include/endian.h b/sys/powerpc/include/endian.h index 8cbd7e024eb9..9e28237bfd24 100644 --- a/sys/powerpc/include/endian.h +++ b/sys/powerpc/include/endian.h @@ -35,20 +35,8 @@ #ifndef _MACHINE_ENDIAN_H_ #define _MACHINE_ENDIAN_H_ -#include #include -/* - * Define the order of 32-bit words in 64-bit words. - */ -#ifdef __LITTLE_ENDIAN__ -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 -#else -#define _QUAD_HIGHWORD 0 -#define _QUAD_LOWWORD 1 -#endif - /* * GCC defines _BIG_ENDIAN and _LITTLE_ENDIAN equal to __BIG_ENDIAN__ * and __LITTLE_ENDIAN__ (resp). @@ -60,94 +48,6 @@ #undef _LITTLE_ENDIAN #endif -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#ifdef __LITTLE_ENDIAN__ -#define _BYTE_ORDER _LITTLE_ENDIAN -#else -#define _BYTE_ORDER _BIG_ENDIAN -#endif - -/* - * Deprecated variants that don't have enough underscores to be useful in more - * strict namespaces. - */ -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) -#define __is_constant(x) __builtin_constant_p(x) -#else -#define __is_constant(x) 0 -#endif - -#define __bswap16_const(x) ((((__uint16_t)(x) >> 8) & 0xff) | \ - (((__uint16_t)(x) << 8) & 0xff00)) -#define __bswap32_const(x) ((((__uint32_t)(x) >> 24) & 0xff) | \ - (((__uint32_t)(x) >> 8) & 0xff00) | \ - (((__uint32_t)(x)<< 8) & 0xff0000) | \ - (((__uint32_t)(x) << 24) & 0xff000000)) -#define __bswap64_const(x) ((((__uint64_t)(x) >> 56) & 0xff) | \ - (((__uint64_t)(x) >> 40) & 0xff00) | \ - (((__uint64_t)(x) >> 24) & 0xff0000) | \ - (((__uint64_t)(x) >> 8) & 0xff000000) | \ - (((__uint64_t)(x) << 8) & ((__uint64_t)0xff << 32)) | \ - (((__uint64_t)(x) << 24) & ((__uint64_t)0xff << 40)) | \ - (((__uint64_t)(x) << 40) & ((__uint64_t)0xff << 48)) | \ - (((__uint64_t)(x) << 56) & ((__uint64_t)0xff << 56))) - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - - return ((_x >> 8) | ((_x << 8) & 0xff00)); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - - return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) | - ((_x << 24) & 0xff000000)); -} - -static __inline __uint64_t -__bswap64_var(__uint64_t _x) -{ - - return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | - ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | - ((_x << 24) & ((__uint64_t)0xff << 40)) | - ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); -} - -#define __bswap16(x) ((__uint16_t)(__is_constant(x) ? __bswap16_const(x) : \ - __bswap16_var(x))) -#define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \ - __bswap32_var(x)) -#define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \ - __bswap64_var(x)) - -#ifdef __LITTLE_ENDIAN__ -#define __htonl(x) (__bswap32((__uint32_t)(x))) -#define __htons(x) (__bswap16((__uint16_t)(x))) -#define __ntohl(x) (__bswap32((__uint32_t)(x))) -#define __ntohs(x) (__bswap16((__uint16_t)(x))) -#else -#define __htonl(x) ((__uint32_t)(x)) -#define __htons(x) ((__uint16_t)(x)) -#define __ntohl(x) ((__uint32_t)(x)) -#define __ntohs(x) ((__uint16_t)(x)) -#endif +#include #endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/sys/riscv/include/endian.h b/sys/riscv/include/endian.h index 25516fa01366..0f06010b7e4b 100644 --- a/sys/riscv/include/endian.h +++ b/sys/riscv/include/endian.h @@ -34,91 +34,6 @@ #define _MACHINE_ENDIAN_H_ #include +#include -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#define _BYTE_ORDER _LITTLE_ENDIAN - -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 -#define __ntohl(x) (__bswap32(x)) -#define __ntohs(x) (__bswap16(x)) -#define __htonl(x) (__bswap32(x)) -#define __htons(x) (__bswap16(x)) - -static __inline __uint64_t -__bswap64(__uint64_t _x) -{ - __uint64_t ret; - - ret = (_x >> 56); - ret |= ((_x >> 40) & 0xff00); - ret |= ((_x >> 24) & 0xff0000); - ret |= ((_x >> 8) & 0xff000000); - ret |= ((_x << 8) & ((__uint64_t)0xff << 32)); - ret |= ((_x << 24) & ((__uint64_t)0xff << 40)); - ret |= ((_x << 40) & ((__uint64_t)0xff << 48)); - ret |= (_x << 56); - - return (ret); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - - return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) | - ((_x << 24) & 0xff000000)); -} - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - __uint32_t ret; - - ret = ((_x >> 8) | ((_x << 8) & 0xff00)); - - return ((__uint16_t)ret); -} - -#ifdef __OPTIMIZE__ - -#define __bswap32_constant(x) \ - ((((x) & 0xff000000U) >> 24) | \ - (((x) & 0x00ff0000U) >> 8) | \ - (((x) & 0x0000ff00U) << 8) | \ - (((x) & 0x000000ffU) << 24)) - -#define __bswap16_constant(x) \ - ((((x) & 0xff00) >> 8) | \ - (((x) & 0x00ff) << 8)) - -#define __bswap16(x) \ - ((__uint16_t)(__builtin_constant_p(x) ? \ - __bswap16_constant(x) : \ - __bswap16_var(x))) - -#define __bswap32(x) \ - ((__uint32_t)(__builtin_constant_p(x) ? \ - __bswap32_constant(x) : \ - __bswap32_var(x))) - -#else -#define __bswap16(x) __bswap16_var(x) -#define __bswap32(x) __bswap32_var(x) - -#endif /* __OPTIMIZE__ */ #endif /* !_MACHINE_ENDIAN_H_ */ diff --git a/sys/sys/_endian.h b/sys/sys/_endian.h new file mode 100644 index 000000000000..936962cc729f --- /dev/null +++ b/sys/sys/_endian.h @@ -0,0 +1,92 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1987, 1991 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS__ENDIAN_H_ +#define _SYS__ENDIAN_H_ + +#ifndef _MACHINE_ENDIAN_H_ +#error "sys/_endian.h should not be included directly" +#endif + +/* BSD Compatiblity */ +#define _BYTE_ORDER __BYTE_ORDER__ + +/* + * Definitions for byte order, according to byte significance from low + * address to high. + */ +#define _LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ /* LSB first: 1234 */ +#define _BIG_ENDIAN __ORDER_BIG_ENDIAN__ /* MSB first: 4321 */ +#define _PDP_ENDIAN __ORDER_PDP_ENDIAN__ /* LSB first in word, + * MSW first in long: 3412 */ + +/* + * Define the order of 32-bit words in 64-bit words. + */ +#if _BYTE_ORDER == _LITTLE_ENDIAN +#define _QUAD_HIGHWORD 1 +#define _QUAD_LOWWORD 0 +#elif _BYTE_ORDER == _BIG_ENDIAN +#define _QUAD_HIGHWORD 0 +#define _QUAD_LOWWORD 1 +#else +#error "Unsupported endian" +#endif + +/* + * Deprecated variants that don't have enough underscores to be useful in more + * strict namespaces. + */ +#if __BSD_VISIBLE +#define LITTLE_ENDIAN _LITTLE_ENDIAN +#define BIG_ENDIAN _BIG_ENDIAN +#define PDP_ENDIAN _PDP_ENDIAN +#define BYTE_ORDER _BYTE_ORDER +#endif + +/* bswap primitives, based on compiler builtins */ +#define __bswap16(x) __builtin_bswap16(x) +#define __bswap32(x) __builtin_bswap32(x) +#define __bswap64(x) __builtin_bswap64(x) + +#if _BYTE_ORDER == _LITTLE_ENDIAN +#define __ntohl(x) (__bswap32(x)) +#define __ntohs(x) (__bswap16(x)) +#define __htonl(x) (__bswap32(x)) +#define __htons(x) (__bswap16(x)) +#elif _BYTE_ORDER == _BIG_ENDIAN +#define __htonl(x) ((__uint32_t)(x)) +#define __htons(x) ((__uint16_t)(x)) +#define __ntohl(x) ((__uint32_t)(x)) +#define __ntohs(x) ((__uint16_t)(x)) +#endif + +#endif /* _SYS__ENDIAN_H_ */ diff --git a/sys/x86/include/endian.h b/sys/x86/include/endian.h index 18d52fb8a6fa..8fb24881145b 100644 --- a/sys/x86/include/endian.h +++ b/sys/x86/include/endian.h @@ -35,43 +35,7 @@ #ifndef _MACHINE_ENDIAN_H_ #define _MACHINE_ENDIAN_H_ -#include #include - -/* - * Define the order of 32-bit words in 64-bit words. - */ -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 - -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#define _BYTE_ORDER _LITTLE_ENDIAN - -/* - * Deprecated variants that don't have enough underscores to be useful in more - * strict namespaces. - */ -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#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) -#define __ntohl(x) __bswap32(x) -#define __ntohs(x) __bswap16(x) +#include #endif /* !_MACHINE_ENDIAN_H_ */ From owner-dev-commits-src-main@freebsd.org Fri Mar 26 22:20:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21F8B5AEE70; Fri, 26 Mar 2021 22: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 4F6byS0P6vz3q2p; Fri, 26 Mar 2021 22: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 002D121D41; Fri, 26 Mar 2021 22:20: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 12QMKVwf004298; Fri, 26 Mar 2021 22: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 12QMKV8K004297; Fri, 26 Mar 2021 22:20:31 GMT (envelope-from git) Date: Fri, 26 Mar 2021 22:20:31 GMT Message-Id: <202103262220.12QMKV8K004297@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: 077ba6a845fa - main - cxgbe: Add a struct sge_ofld_txq type. 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: 077ba6a845fab8f1d3bd83e07f61730f202a46fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 22:20:32 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=077ba6a845fab8f1d3bd83e07f61730f202a46fc commit 077ba6a845fab8f1d3bd83e07f61730f202a46fc Author: John Baldwin AuthorDate: 2021-03-26 22:05:31 +0000 Commit: John Baldwin CommitDate: 2021-03-26 22:19:58 +0000 cxgbe: Add a struct sge_ofld_txq type. This type mirrors struct sge_ofld_rxq and holds state for TCP offload transmit queues. Currently it only holds a work queue but will include additional state in future changes. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29382 --- sys/dev/cxgbe/adapter.h | 11 ++++-- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 10 +++--- sys/dev/cxgbe/iw_cxgbe/qp.c | 6 ++-- sys/dev/cxgbe/offload.h | 2 +- sys/dev/cxgbe/t4_main.c | 15 ++++---- sys/dev/cxgbe/t4_sge.c | 75 ++++++++++++++++++++++++++++----------- sys/dev/cxgbe/tom/t4_cpl_io.c | 25 +++++++------ sys/dev/cxgbe/tom/t4_listen.c | 9 ++--- sys/dev/cxgbe/tom/t4_tls.c | 8 ++--- sys/dev/cxgbe/tom/t4_tom.h | 6 ++-- 10 files changed, 107 insertions(+), 60 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 1a90560a55d8..ed36c1e546d3 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -677,8 +677,8 @@ struct wrq_cookie { }; /* - * wrq: SGE egress queue that is given prebuilt work requests. Both the control - * and offload tx queues are of this type. + * wrq: SGE egress queue that is given prebuilt work requests. Control queues + * are of this type. */ struct sge_wrq { struct sge_eq eq; /* MUST be first */ @@ -712,6 +712,11 @@ struct sge_wrq { } __aligned(CACHE_LINE_SIZE); +/* ofld_txq: SGE egress queue + miscellaneous items */ +struct sge_ofld_txq { + struct sge_wrq wrq; +} __aligned(CACHE_LINE_SIZE); + #define INVALID_NM_RXQ_CNTXT_ID ((uint16_t)(-1)) struct sge_nm_rxq { /* Items used by the driver rx ithread are in this cacheline. */ @@ -792,7 +797,7 @@ struct sge { struct sge_wrq *ctrlq; /* Control queues */ struct sge_txq *txq; /* NIC tx queues */ struct sge_rxq *rxq; /* NIC rx queues */ - struct sge_wrq *ofld_txq; /* TOE tx queues */ + struct sge_ofld_txq *ofld_txq; /* TOE tx queues */ struct sge_ofld_rxq *ofld_rxq; /* TOE rx queues */ struct sge_nm_txq *nm_txq; /* netmap tx queues */ struct sge_nm_rxq *nm_rxq; /* netmap rx queues */ diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 6292dfc8dc75..94963f13b601 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -551,7 +551,7 @@ send_iscsi_flowc_wr(struct adapter *sc, struct toepcb *toep, int maxlen) flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); - wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(flowclen, 16), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -843,8 +843,8 @@ no_ddp: goto no_ddp; } - rc = t4_write_page_pods_for_buf(sc, toep->ofld_txq, toep->tid, prsv, - (vm_offset_t)csio->data_ptr, csio->dxfer_len); + rc = t4_write_page_pods_for_buf(sc, &toep->ofld_txq->wrq, toep->tid, + prsv, (vm_offset_t)csio->data_ptr, csio->dxfer_len); if (rc != 0) { t4_free_page_pods(prsv); uma_zfree(prsv_zone, prsv); @@ -957,8 +957,8 @@ no_ddp: goto no_ddp; } - rc = t4_write_page_pods_for_buf(sc, toep->ofld_txq, toep->tid, - prsv, buf, xferlen); + rc = t4_write_page_pods_for_buf(sc, &toep->ofld_txq->wrq, + toep->tid, prsv, buf, xferlen); if (rc != 0) { t4_free_page_pods(prsv); uma_zfree(prsv_zone, prsv); diff --git a/sys/dev/cxgbe/iw_cxgbe/qp.c b/sys/dev/cxgbe/iw_cxgbe/qp.c index 43acb246e7bc..f999254a748c 100644 --- a/sys/dev/cxgbe/iw_cxgbe/qp.c +++ b/sys/dev/cxgbe/iw_cxgbe/qp.c @@ -1127,7 +1127,7 @@ static void post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe, CTR4(KTR_IW_CXGBE, "%s qhp %p qid 0x%x tid %u", __func__, qhp, qhp->wq.sq.qid, qhp->ep->hwtid); - wr = alloc_wrqe(sizeof(*wqe), toep->ofld_txq); + wr = alloc_wrqe(sizeof(*wqe), &toep->ofld_txq->wrq); if (wr == NULL) return; wqe = wrtod(wr); @@ -1259,7 +1259,7 @@ rdma_fini(struct c4iw_dev *rhp, struct c4iw_qp *qhp, struct c4iw_ep *ep) CTR5(KTR_IW_CXGBE, "%s qhp %p qid 0x%x ep %p tid %u", __func__, qhp, qhp->wq.sq.qid, ep, ep->hwtid); - wr = alloc_wrqe(sizeof(*wqe), toep->ofld_txq); + wr = alloc_wrqe(sizeof(*wqe), &toep->ofld_txq->wrq); if (wr == NULL) return (0); wqe = wrtod(wr); @@ -1353,7 +1353,7 @@ static int rdma_init(struct c4iw_dev *rhp, struct c4iw_qp *qhp) CTR5(KTR_IW_CXGBE, "%s qhp %p qid 0x%x ep %p tid %u", __func__, qhp, qhp->wq.sq.qid, ep, ep->hwtid); - wr = alloc_wrqe(sizeof(*wqe), toep->ofld_txq); + wr = alloc_wrqe(sizeof(*wqe), &toep->ofld_txq->wrq); if (wr == NULL) return (0); wqe = wrtod(wr); diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h index 968902cb10da..e264882fb5b4 100644 --- a/sys/dev/cxgbe/offload.h +++ b/sys/dev/cxgbe/offload.h @@ -96,7 +96,7 @@ struct cxgbe_rate_tag { int etid; struct mbufq pending_tx, pending_fwack; int plen; - struct sge_wrq *eo_txq; + struct sge_ofld_txq *eo_txq; uint32_t ctrl0; uint16_t iqid; int8_t schedcl; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index cdfceb5573fd..5d06d4b55d8a 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1334,7 +1334,7 @@ t4_attach(device_t dev) s->nofldtxq += nports * (num_vis - 1) * iaq.nofldtxq_vi; s->neq += s->nofldtxq; - s->ofld_txq = malloc(s->nofldtxq * sizeof(struct sge_wrq), + s->ofld_txq = malloc(s->nofldtxq * sizeof(struct sge_ofld_txq), M_CXGBE, M_ZERO | M_WAITOK); } #endif @@ -6103,7 +6103,7 @@ vi_full_uninit(struct vi_info *vi) struct sge_ofld_rxq *ofld_rxq; #endif #if defined(TCP_OFFLOAD) || defined(RATELIMIT) - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; #endif if (vi->flags & VI_INIT_DONE) { @@ -6120,7 +6120,7 @@ vi_full_uninit(struct vi_info *vi) #if defined(TCP_OFFLOAD) || defined(RATELIMIT) for_each_ofld_txq(vi, i, ofld_txq) { - quiesce_wrq(sc, ofld_txq); + quiesce_wrq(sc, &ofld_txq->wrq); } #endif @@ -10672,6 +10672,9 @@ clear_stats(struct adapter *sc, u_int port_id) struct sge_rxq *rxq; struct sge_txq *txq; struct sge_wrq *wrq; +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + struct sge_ofld_txq *ofld_txq; +#endif #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; #endif @@ -10759,9 +10762,9 @@ clear_stats(struct adapter *sc, u_int port_id) } #if defined(TCP_OFFLOAD) || defined(RATELIMIT) - for_each_ofld_txq(vi, i, wrq) { - wrq->tx_wrs_direct = 0; - wrq->tx_wrs_copied = 0; + for_each_ofld_txq(vi, i, ofld_txq) { + ofld_txq->wrq.tx_wrs_direct = 0; + ofld_txq->wrq.tx_wrs_copied = 0; } #endif #ifdef TCP_OFFLOAD diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index b0f5b272410a..1f2abcb81078 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -270,6 +270,11 @@ static int free_wrq(struct adapter *, struct sge_wrq *); static int alloc_txq(struct vi_info *, struct sge_txq *, int, struct sysctl_oid *); static int free_txq(struct vi_info *, struct sge_txq *); +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) +static int alloc_ofld_txq(struct vi_info *, struct sge_ofld_txq *, int, + struct sysctl_oid *); +static int free_ofld_txq(struct vi_info *, struct sge_ofld_txq *); +#endif static void oneseg_dma_callback(void *, bus_dma_segment_t *, int, int); static inline void ring_fl_db(struct adapter *, struct sge_fl *); static int refill_fl(struct adapter *, struct sge_fl *, int); @@ -1109,7 +1114,7 @@ t4_setup_vi_queues(struct vi_info *vi) struct sge_ofld_rxq *ofld_rxq; #endif #if defined(TCP_OFFLOAD) || defined(RATELIMIT) - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; #endif #ifdef DEV_NETMAP int saved_idx; @@ -1228,26 +1233,20 @@ t4_setup_vi_queues(struct vi_info *vi) oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_txq", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "tx queues for TOE/ETHOFLD"); for_each_ofld_txq(vi, i, ofld_txq) { - struct sysctl_oid *oid2; - snprintf(name, sizeof(name), "%s ofld_txq%d", device_get_nameunit(vi->dev), i); if (vi->nofldrxq > 0) { iqidx = vi->first_ofld_rxq + (i % vi->nofldrxq); - init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq, + init_eq(sc, &ofld_txq->wrq.eq, EQ_OFLD, vi->qsize_txq, pi->tx_chan, sc->sge.ofld_rxq[iqidx].iq.cntxt_id, name); } else { iqidx = vi->first_rxq + (i % vi->nrxq); - init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq, + init_eq(sc, &ofld_txq->wrq.eq, EQ_OFLD, vi->qsize_txq, pi->tx_chan, sc->sge.rxq[iqidx].iq.cntxt_id, name); } - snprintf(name, sizeof(name), "%d", i); - oid2 = SYSCTL_ADD_NODE(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload tx queue"); - - rc = alloc_wrq(sc, vi, ofld_txq, oid2); + rc = alloc_ofld_txq(vi, ofld_txq, i, oid); if (rc != 0) goto done; } @@ -1269,9 +1268,7 @@ t4_teardown_vi_queues(struct vi_info *vi) struct sge_rxq *rxq; struct sge_txq *txq; #if defined(TCP_OFFLOAD) || defined(RATELIMIT) - struct port_info *pi = vi->pi; - struct adapter *sc = pi->adapter; - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; #endif #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; @@ -1309,7 +1306,7 @@ t4_teardown_vi_queues(struct vi_info *vi) } #if defined(TCP_OFFLOAD) || defined(RATELIMIT) for_each_ofld_txq(vi, i, ofld_txq) { - free_wrq(sc, ofld_txq); + free_ofld_txq(vi, ofld_txq); } #endif @@ -4482,6 +4479,44 @@ free_txq(struct vi_info *vi, struct sge_txq *txq) return (0); } +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) +static int +alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx, + struct sysctl_oid *oid) +{ + struct adapter *sc = vi->adapter; + struct sysctl_oid_list *children; + char name[16]; + int rc; + + children = SYSCTL_CHILDREN(oid); + + snprintf(name, sizeof(name), "%d", idx); + oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload tx queue"); + + rc = alloc_wrq(sc, vi, &ofld_txq->wrq, oid); + if (rc != 0) + return (rc); + + return (rc); +} + +static int +free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) +{ + struct adapter *sc = vi->adapter; + int rc; + + rc = free_wrq(sc, &ofld_txq->wrq); + if (rc != 0) + return (rc); + + bzero(ofld_txq, sizeof(*ofld_txq)); + return (0); +} +#endif + static void oneseg_dma_callback(void *arg, bus_dma_segment_t *segs, int nseg, int error) { @@ -6108,7 +6143,7 @@ send_etid_flowc_wr(struct cxgbe_rate_tag *cst, struct port_info *pi, MPASS((cst->flags & (EO_FLOWC_PENDING | EO_FLOWC_RPL_PENDING)) == EO_FLOWC_PENDING); - flowc = start_wrq_wr(cst->eo_txq, ETID_FLOWC_LEN16, &cookie); + flowc = start_wrq_wr(&cst->eo_txq->wrq, ETID_FLOWC_LEN16, &cookie); if (__predict_false(flowc == NULL)) return (ENOMEM); @@ -6130,7 +6165,7 @@ send_etid_flowc_wr(struct cxgbe_rate_tag *cst, struct port_info *pi, flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_SCHEDCLASS; flowc->mnemval[5].val = htobe32(cst->schedcl); - commit_wrq_wr(cst->eo_txq, flowc, &cookie); + commit_wrq_wr(&cst->eo_txq->wrq, flowc, &cookie); cst->flags &= ~EO_FLOWC_PENDING; cst->flags |= EO_FLOWC_RPL_PENDING; @@ -6150,7 +6185,7 @@ send_etid_flush_wr(struct cxgbe_rate_tag *cst) mtx_assert(&cst->lock, MA_OWNED); - flowc = start_wrq_wr(cst->eo_txq, ETID_FLUSH_LEN16, &cookie); + flowc = start_wrq_wr(&cst->eo_txq->wrq, ETID_FLUSH_LEN16, &cookie); if (__predict_false(flowc == NULL)) CXGBE_UNIMPLEMENTED(__func__); @@ -6160,7 +6195,7 @@ send_etid_flush_wr(struct cxgbe_rate_tag *cst) flowc->flowid_len16 = htobe32(V_FW_WR_LEN16(ETID_FLUSH_LEN16) | V_FW_WR_FLOWID(cst->etid)); - commit_wrq_wr(cst->eo_txq, flowc, &cookie); + commit_wrq_wr(&cst->eo_txq->wrq, flowc, &cookie); cst->flags |= EO_FLUSH_RPL_PENDING; MPASS(cst->tx_credits >= ETID_FLUSH_LEN16); @@ -6345,7 +6380,7 @@ ethofld_tx(struct cxgbe_rate_tag *cst) MPASS(cst->ncompl > 0); return; } - wr = start_wrq_wr(cst->eo_txq, next_credits, &cookie); + wr = start_wrq_wr(&cst->eo_txq->wrq, next_credits, &cookie); if (__predict_false(wr == NULL)) { /* XXX: wishful thinking, not a real assertion. */ MPASS(cst->ncompl > 0); @@ -6356,7 +6391,7 @@ ethofld_tx(struct cxgbe_rate_tag *cst) compl = cst->ncompl == 0 || cst->tx_nocompl >= cst->tx_total / 2; ETHER_BPF_MTAP(cst->com.ifp, m); write_ethofld_wr(cst, wr, m, compl); - commit_wrq_wr(cst->eo_txq, wr, &cookie); + commit_wrq_wr(&cst->eo_txq->wrq, wr, &cookie); if (compl) { cst->ncompl++; cst->tx_nocompl = 0; diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index f1d4ce6825cc..14a8181b57ef 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -108,7 +108,7 @@ send_flowc_wr(struct toepcb *toep, struct tcpcb *tp) flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); - wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(flowclen, 16), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -202,7 +202,8 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb *toep, u_int Bps) fw_flowc_mnemval); flowclen16 = howmany(flowclen, 16); if (toep->tx_credits < flowclen16 || toep->txsd_avail == 0 || - (wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq)) == NULL) { + (wr = alloc_wrqe(roundup2(flowclen, 16), + &toep->ofld_txq->wrq)) == NULL) { if (tc_idx >= 0) t4_release_cl_rl(sc, port_id, tc_idx); return (ENOMEM); @@ -266,7 +267,7 @@ send_reset(struct adapter *sc, struct toepcb *toep, uint32_t snd_nxt) KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %d.", __func__, tid)); - wr = alloc_wrqe(sizeof(*req), toep->ofld_txq); + wr = alloc_wrqe(sizeof(*req), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -491,7 +492,7 @@ t4_close_conn(struct adapter *sc, struct toepcb *toep) KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, tid)); - wr = alloc_wrqe(sizeof(*req), toep->ofld_txq); + wr = alloc_wrqe(sizeof(*req), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -823,7 +824,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) /* Immediate data tx */ wr = alloc_wrqe(roundup2(sizeof(*txwr) + plen, 16), - toep->ofld_txq); + &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -841,7 +842,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) wr_len = sizeof(*txwr) + sizeof(struct ulptx_sgl) + ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; - wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(wr_len, 16), + &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -1018,7 +1020,7 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop) /* Immediate data tx */ wr = alloc_wrqe(roundup2(sizeof(*txwr) + plen, 16), - toep->ofld_txq); + &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -1036,7 +1038,8 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop) /* DSGL tx */ wr_len = sizeof(*txwr) + sizeof(struct ulptx_sgl) + ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; - wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(wr_len, 16), + &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -1351,13 +1354,13 @@ done: } void -send_abort_rpl(struct adapter *sc, struct sge_wrq *ofld_txq, int tid, +send_abort_rpl(struct adapter *sc, struct sge_ofld_txq *ofld_txq, int tid, int rst_status) { struct wrqe *wr; struct cpl_abort_rpl *cpl; - wr = alloc_wrqe(sizeof(*cpl), ofld_txq); + wr = alloc_wrqe(sizeof(*cpl), &ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -1397,7 +1400,7 @@ do_abort_req(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) const struct cpl_abort_req_rss *cpl = (const void *)(rss + 1); unsigned int tid = GET_TID(cpl); struct toepcb *toep = lookup_tid(sc, tid); - struct sge_wrq *ofld_txq = toep->ofld_txq; + struct sge_ofld_txq *ofld_txq = toep->ofld_txq; struct inpcb *inp; struct tcpcb *tp; struct epoch_tracker et; diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index 51de83643253..9cf527925fcc 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -350,7 +350,7 @@ send_flowc_wr_synqe(struct adapter *sc, struct synq_entry *synqe) struct port_info *pi = vi->pi; struct wrqe *wr; struct fw_flowc_wr *flowc; - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; const int nparams = 6; const int flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); @@ -362,7 +362,7 @@ send_flowc_wr_synqe(struct adapter *sc, struct synq_entry *synqe) ofld_txq = &sc->sge.ofld_txq[synqe->params.txq_idx]; ofld_rxq = &sc->sge.ofld_rxq[synqe->params.rxq_idx]; - wr = alloc_wrqe(roundup2(flowclen, 16), ofld_txq); + wr = alloc_wrqe(roundup2(flowclen, 16), &ofld_txq->wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -411,7 +411,8 @@ send_abort_rpl_synqe(struct toedev *tod, struct synq_entry *synqe, if (!(synqe->flags & TPF_FLOWC_WR_SENT)) send_flowc_wr_synqe(sc, synqe); - wr = alloc_wrqe(sizeof(*req), &sc->sge.ofld_txq[synqe->params.txq_idx]); + wr = alloc_wrqe(sizeof(*req), + &sc->sge.ofld_txq[synqe->params.txq_idx].wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); @@ -885,7 +886,7 @@ do_abort_req_synqe(struct sge_iq *iq, const struct rss_header *rss, struct synq_entry *synqe = lookup_tid(sc, tid); struct listen_ctx *lctx = synqe->lctx; struct inpcb *inp = lctx->inp; - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index 4016a4f1995a..fff42386fab7 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -70,7 +70,7 @@ t4_set_tls_tcb_field(struct toepcb *toep, uint16_t word, uint64_t mask, { struct adapter *sc = td_adapter(toep->td); - t4_set_tcb_field(sc, toep->ofld_txq, toep, word, mask, val, 0, 0); + t4_set_tcb_field(sc, &toep->ofld_txq->wrq, toep, word, mask, val, 0, 0); } /* TLS and DTLS common routines */ @@ -518,7 +518,7 @@ tls_program_key_id(struct toepcb *toep, struct tls_key_context *k_ctx) keyid = get_keyid(tls_ofld, k_ctx->l_p_key); } - wr = alloc_wrqe(len, toep->ofld_txq); + wr = alloc_wrqe(len, &toep->ofld_txq->wrq); if (wr == NULL) { free_keyid(toep, keyid); return (ENOMEM); @@ -1596,7 +1596,7 @@ t4_push_tls_records(struct adapter *sc, struct toepcb *toep, int drop) ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; } - wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(wr_len, 16), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -1907,7 +1907,7 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) if (__predict_false(toep->flags & TPF_FIN_SENT)) panic("%s: excess tx.", __func__); - wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(wr_len, 16), &toep->ofld_txq->wrq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 41187aa27e2d..628857cfae17 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -185,7 +185,7 @@ struct toepcb { int refcount; struct vnet *vnet; struct vi_info *vi; /* virtual interface */ - struct sge_wrq *ofld_txq; + struct sge_ofld_txq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; struct sge_wrq *ctrlq; struct l2t_entry *l2te; /* L2 table entry used by this connection */ @@ -396,7 +396,7 @@ void aiotx_init_toep(struct toepcb *); int t4_aio_queue_aiotx(struct socket *, struct kaiocb *); void t4_init_cpl_io_handlers(void); void t4_uninit_cpl_io_handlers(void); -void send_abort_rpl(struct adapter *, struct sge_wrq *, int , int); +void send_abort_rpl(struct adapter *, struct sge_ofld_txq *, int , int); void send_flowc_wr(struct toepcb *, struct tcpcb *); void send_reset(struct adapter *, struct toepcb *, uint32_t); int send_rx_credits(struct adapter *, struct toepcb *, int); @@ -422,7 +422,7 @@ int t4_alloc_page_pods_for_buf(struct ppod_region *, vm_offset_t, int, struct ppod_reservation *); int t4_write_page_pods_for_ps(struct adapter *, struct sge_wrq *, int, struct pageset *); -int t4_write_page_pods_for_buf(struct adapter *, struct sge_wrq *, int tid, +int t4_write_page_pods_for_buf(struct adapter *, struct sge_wrq *, int, struct ppod_reservation *, vm_offset_t, int); void t4_free_page_pods(struct ppod_reservation *); int t4_soreceive_ddp(struct socket *, struct sockaddr **, struct uio *, From owner-dev-commits-src-main@freebsd.org Fri Mar 26 22:20:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38F595AF0B0; Fri, 26 Mar 2021 22:20: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 4F6byT1CGbz3qNj; Fri, 26 Mar 2021 22:20: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 1BCB521A72; Fri, 26 Mar 2021 22:20: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 12QMKXua004317; Fri, 26 Mar 2021 22:20:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12QMKXJX004316; Fri, 26 Mar 2021 22:20:33 GMT (envelope-from git) Date: Fri, 26 Mar 2021 22:20:33 GMT Message-Id: <202103262220.12QMKXJX004316@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: fe496dc02a9a - main - cxgbe: Make the TOE TLS stats per-queue instead of per-port. 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: fe496dc02a9a276d940e72bbd155dc256a34076f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 22:20:33 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fe496dc02a9a276d940e72bbd155dc256a34076f commit fe496dc02a9a276d940e72bbd155dc256a34076f Author: John Baldwin AuthorDate: 2021-03-26 22:05:44 +0000 Commit: John Baldwin CommitDate: 2021-03-26 22:19:58 +0000 cxgbe: Make the TOE TLS stats per-queue instead of per-port. This avoids some atomics by using counter_u64 for TX and relying on existing single-threading (single ithread per rxq) for RX. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29383 --- sys/dev/cxgbe/adapter.h | 8 ++++---- sys/dev/cxgbe/t4_main.c | 17 ++++------------- sys/dev/cxgbe/t4_sge.c | 20 ++++++++++++++++++++ sys/dev/cxgbe/tom/t4_tls.c | 12 ++++++------ 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index ed36c1e546d3..88dbbf5d06ac 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -316,10 +316,6 @@ struct port_info { u_int tx_parse_error; int fcs_reg; uint64_t fcs_base; - u_long tx_toe_tls_records; - u_long tx_toe_tls_octets; - u_long rx_toe_tls_records; - u_long rx_toe_tls_octets; struct callout tick; }; @@ -654,6 +650,8 @@ iq_to_rxq(struct sge_iq *iq) struct sge_ofld_rxq { struct sge_iq iq; /* MUST be first */ struct sge_fl fl; /* MUST follow iq */ + u_long rx_toe_tls_records; + u_long rx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); static inline struct sge_ofld_rxq * @@ -715,6 +713,8 @@ struct sge_wrq { /* ofld_txq: SGE egress queue + miscellaneous items */ struct sge_ofld_txq { struct sge_wrq wrq; + counter_u64_t tx_toe_tls_records; + counter_u64_t tx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); #define INVALID_NM_RXQ_CNTXT_ID ((uint16_t)(-1)) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 5d06d4b55d8a..ad622e9999de 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -7218,19 +7218,6 @@ cxgbe_sysctls(struct port_info *pi) #undef T4_REGSTAT #undef T4_PORTSTAT - - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_toe_tls_records", - CTLFLAG_RD, &pi->tx_toe_tls_records, - "# of TOE TLS records transmitted"); - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_toe_tls_octets", - CTLFLAG_RD, &pi->tx_toe_tls_octets, - "# of payload octets in transmitted TOE TLS records"); - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_toe_tls_records", - CTLFLAG_RD, &pi->rx_toe_tls_records, - "# of TOE TLS records received"); - SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "rx_toe_tls_octets", - CTLFLAG_RD, &pi->rx_toe_tls_octets, - "# of payload octets in received TOE TLS records"); } static int @@ -10765,6 +10752,8 @@ clear_stats(struct adapter *sc, u_int port_id) for_each_ofld_txq(vi, i, ofld_txq) { ofld_txq->wrq.tx_wrs_direct = 0; ofld_txq->wrq.tx_wrs_copied = 0; + counter_u64_zero(ofld_txq->tx_toe_tls_records); + counter_u64_zero(ofld_txq->tx_toe_tls_octets); } #endif #ifdef TCP_OFFLOAD @@ -10772,6 +10761,8 @@ clear_stats(struct adapter *sc, u_int port_id) ofld_rxq->fl.cl_allocated = 0; ofld_rxq->fl.cl_recycled = 0; ofld_rxq->fl.cl_fast_recycled = 0; + ofld_rxq->rx_toe_tls_records = 0; + ofld_rxq->rx_toe_tls_octets = 0; } #endif diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 1f2abcb81078..002b4892e110 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -3958,6 +3958,13 @@ alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq, add_iq_sysctls(&vi->ctx, oid, &ofld_rxq->iq); add_fl_sysctls(pi->adapter, &vi->ctx, oid, &ofld_rxq->fl); + SYSCTL_ADD_ULONG(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_toe_tls_records", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_records, + "# of TOE TLS records received"); + SYSCTL_ADD_ULONG(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "rx_toe_tls_octets", CTLFLAG_RD, &ofld_rxq->rx_toe_tls_octets, + "# of payload octets in received TOE TLS records"); + return (rc); } @@ -4494,11 +4501,21 @@ alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx, snprintf(name, sizeof(name), "%d", idx); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload tx queue"); + children = SYSCTL_CHILDREN(oid); rc = alloc_wrq(sc, vi, &ofld_txq->wrq, oid); if (rc != 0) return (rc); + ofld_txq->tx_toe_tls_records = counter_u64_alloc(M_WAITOK); + ofld_txq->tx_toe_tls_octets = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, + "tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records, + "# of TOE TLS records transmitted"); + SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, + "tx_toe_tls_octets", CTLFLAG_RD, &ofld_txq->tx_toe_tls_octets, + "# of payload octets in transmitted TOE TLS records"); + return (rc); } @@ -4512,6 +4529,9 @@ free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) if (rc != 0) return (rc); + counter_u64_free(ofld_txq->tx_toe_tls_records); + counter_u64_free(ofld_txq->tx_toe_tls_octets); + bzero(ofld_txq, sizeof(*ofld_txq)); return (0); } diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index fff42386fab7..bbd905d8acc3 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -1664,8 +1664,8 @@ t4_push_tls_records(struct adapter *sc, struct toepcb *toep, int drop) } toep->txsd_avail--; - atomic_add_long(&toep->vi->pi->tx_toe_tls_records, 1); - atomic_add_long(&toep->vi->pi->tx_toe_tls_octets, plen); + counter_u64_add(toep->ofld_txq->tx_toe_tls_records, 1); + counter_u64_add(toep->ofld_txq->tx_toe_tls_octets, plen); t4_l2t_send(sc, wr, toep->l2te); } @@ -1966,8 +1966,8 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) } toep->txsd_avail--; - atomic_add_long(&toep->vi->pi->tx_toe_tls_records, 1); - atomic_add_long(&toep->vi->pi->tx_toe_tls_octets, m->m_len); + counter_u64_add(toep->ofld_txq->tx_toe_tls_records, 1); + counter_u64_add(toep->ofld_txq->tx_toe_tls_octets, m->m_len); t4_l2t_send(sc, wr, toep->l2te); } @@ -2003,7 +2003,7 @@ do_tls_data(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) m_adj(m, sizeof(*cpl)); len = m->m_pkthdr.len; - atomic_add_long(&toep->vi->pi->rx_toe_tls_octets, len); + toep->ofld_rxq->rx_toe_tls_octets += len; KASSERT(len == G_CPL_TLS_DATA_LENGTH(be32toh(cpl->length_pkd)), ("%s: payload length mismatch", __func__)); @@ -2070,7 +2070,7 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) m_adj(m, sizeof(*cpl)); len = m->m_pkthdr.len; - atomic_add_long(&toep->vi->pi->rx_toe_tls_records, 1); + toep->ofld_rxq->rx_toe_tls_records++; KASSERT(len == G_CPL_RX_TLS_CMP_LENGTH(be32toh(cpl->pdulength_length)), ("%s: payload length mismatch", __func__)); From owner-dev-commits-src-main@freebsd.org Sat Mar 27 02:24:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 867EF5B5391; Sat, 27 Mar 2021 02:24: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 4F6jMn3536z4YPy; Sat, 27 Mar 2021 02:24: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 5D39324EDF; Sat, 27 Mar 2021 02:24: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 12R2OLDa044127; Sat, 27 Mar 2021 02:24:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12R2OLo8044126; Sat, 27 Mar 2021 02:24:21 GMT (envelope-from git) Date: Sat, 27 Mar 2021 02:24:21 GMT Message-Id: <202103270224.12R2OLo8044126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 3a314eb5bb44 - main - zfs: Cherry-pick upstream commit ef977fce6636 to fix macOS/arm64 bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a314eb5bb444ec019457e5aefaabb656fcb3d54 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 02:24:21 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=3a314eb5bb444ec019457e5aefaabb656fcb3d54 commit 3a314eb5bb444ec019457e5aefaabb656fcb3d54 Author: Jessica Clarke AuthorDate: 2021-03-27 02:23:59 +0000 Commit: Jessica Clarke CommitDate: 2021-03-27 02:23:59 +0000 zfs: Cherry-pick upstream commit ef977fce6636 to fix macOS/arm64 bootstrap Upstream commit message: Support running FreeBSD buildworld on Arm-based macOS hosts Arm-based Macs are like FreeBSD and provide a full 64-bit stat from the start, so have no stat64 variants. Thus, define stat64 and fstat64 as aliases for the normal versions. Reviewed-by: Ryan Moeller Signed-off-by: Jessica Clarke Closes #11771 MFC after: 1 week --- sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/stat.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/stat.h b/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/stat.h index 07f9762f09ee..38c684d62a1b 100644 --- a/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/stat.h +++ b/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/stat.h @@ -29,6 +29,7 @@ #include_next /* Note: this file can be used on linux/macOS when bootstrapping tools. */ + #if defined(__FreeBSD__) #include /* for BLKGETSIZE64 */ @@ -71,4 +72,14 @@ fstat64_blk(int fd, struct stat64 *st) return (0); } #endif /* defined(__FreeBSD__) */ + +/* + * Only Intel-based Macs have a separate stat64; Arm-based Macs are like + * FreeBSD and have a full 64-bit stat from the start. + */ +#if defined(__APPLE__) && !(defined(__i386__) || defined(__x86_64__)) +#define stat64 stat +#define fstat64 fstat +#endif + #endif /* _LIBSPL_SYS_STAT_H */ From owner-dev-commits-src-main@freebsd.org Sat Mar 27 09:17:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC0C75BE407; Sat, 27 Mar 2021 09:17: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 4F6tXX5RQpz3ChR; Sat, 27 Mar 2021 09:17: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 A9601255B; Sat, 27 Mar 2021 09:17: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 12R9HWWV019692; Sat, 27 Mar 2021 09:17:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12R9HWc6019691; Sat, 27 Mar 2021 09:17:32 GMT (envelope-from git) Date: Sat, 27 Mar 2021 09:17:32 GMT Message-Id: <202103270917.12R9HWc6019691@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: 6f43c72b472e - main - Zero `struct weightened_nhop` fields in nhgrp_get_addition_group(). 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: 6f43c72b472ee78e04f1ebd347ca0ae7787ee876 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 09:17:32 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6f43c72b472ee78e04f1ebd347ca0ae7787ee876 commit 6f43c72b472ee78e04f1ebd347ca0ae7787ee876 Author: Alexander V. Chernikov AuthorDate: 2021-03-20 08:26:03 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-03-20 08:26:03 +0000 Zero `struct weightened_nhop` fields in nhgrp_get_addition_group(). `struct weightened_nhop` has spare 32bit between the fields due to the alignment (on amd64). Not zeroing these spare bits results in duplicating nhop groups in the kernel due to the way how comparison works. MFC after: 1 day --- sys/net/route/nhgrp_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c index b329b907144f..b228c3bcee37 100644 --- a/sys/net/route/nhgrp_ctl.c +++ b/sys/net/route/nhgrp_ctl.c @@ -646,7 +646,7 @@ nhgrp_get_addition_group(struct rib_head *rh, struct route_nhop_data *rnd_orig, { struct nh_control *ctl = rh->nh_control; struct nhgrp_priv *nhg_priv; - struct weightened_nhop wn[2]; + struct weightened_nhop wn[2] = {}; int error; if (rnd_orig->rnd_nhop == NULL) { From owner-dev-commits-src-main@freebsd.org Sat Mar 27 11:08:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 476425C0795; Sat, 27 Mar 2021 11:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6x151Wc8z3Jtc; Sat, 27 Mar 2021 11:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 273583B69; Sat, 27 Mar 2021 11:08: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 12RB8vRY074665; Sat, 27 Mar 2021 11:08:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12RB8vdT074664; Sat, 27 Mar 2021 11:08:57 GMT (envelope-from git) Date: Sat, 27 Mar 2021 11:08:57 GMT Message-Id: <202103271108.12RB8vdT074664@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: 90d2f7c413f9 - main - release: amd64: Fix ISO/USB hybrid image MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 11:08:57 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 commit 90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 Author: Emmanuel Vadot AuthorDate: 2021-03-27 11:04:51 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-27 11:04:51 +0000 release: amd64: Fix ISO/USB hybrid image Recent mkimg changes forces to have partitions given in explicit order. This is so we can have the first partition starting at a specific offset and the next ones starting after without having to specify an offset. Switch the partition in the mkisoimage.sh script so the first one created is the isoboot one. PR: 254490 Reported by: Michael Dexter MFC after: Right now --- release/amd64/mkisoimages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh index 1a1440fa1983..a9e8a2c04392 100644 --- a/release/amd64/mkisoimages.sh +++ b/release/amd64/mkisoimages.sh @@ -89,8 +89,8 @@ if [ "$bootable" != "" ]; then $MKIMG -s gpt \ --capacity $imgsize \ -b "$BASEBITSDIR/boot/pmbr" \ - $espparam \ -p freebsd-boot:="$BASEBITSDIR/boot/isoboot" \ + $espparam \ -o hybrid.img # Drop the PMBR, GPT, and boot code into the System Area of the ISO. From owner-dev-commits-src-main@freebsd.org Sat Mar 27 15:40:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCCDC5C7EAE; Sat, 27 Mar 2021 15:40:17 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F73293KGnz3sKX; Sat, 27 Mar 2021 15:40:16 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 12RFeEgi058279; Sat, 27 Mar 2021 08:40:14 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 12RFeEm2058278; Sat, 27 Mar 2021 08:40:14 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202103271540.12RFeEm2058278@gndrsh.dnsmgr.net> Subject: Re: git: 90d2f7c413f9 - main - release: amd64: Fix ISO/USB hybrid image In-Reply-To: <202103271108.12RB8vdT074664@gitrepo.freebsd.org> To: Emmanuel Vadot Date: Sat, 27 Mar 2021 08:40:14 -0700 (PDT) CC: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4F73293KGnz3sKX 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-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 15:40:17 -0000 > The branch main has been updated by manu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 > > commit 90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 > Author: Emmanuel Vadot > AuthorDate: 2021-03-27 11:04:51 +0000 > Commit: Emmanuel Vadot > CommitDate: 2021-03-27 11:04:51 +0000 > > release: amd64: Fix ISO/USB hybrid image > > Recent mkimg changes forces to have partitions given in explicit order. > This is so we can have the first partition starting at a specific offset > and the next ones starting after without having to specify an offset. > Switch the partition in the mkisoimage.sh script so the first one created > is the isoboot one. > > PR: 254490 > Reported by: Michael Dexter Tested by: Vincent Milum Jr > MFC after: Right now Thanks to all involved for tracking this down and fixing it! > --- > release/amd64/mkisoimages.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh > index 1a1440fa1983..a9e8a2c04392 100644 > --- a/release/amd64/mkisoimages.sh > +++ b/release/amd64/mkisoimages.sh > @@ -89,8 +89,8 @@ if [ "$bootable" != "" ]; then > $MKIMG -s gpt \ > --capacity $imgsize \ > -b "$BASEBITSDIR/boot/pmbr" \ > - $espparam \ > -p freebsd-boot:="$BASEBITSDIR/boot/isoboot" \ > + $espparam \ > -o hybrid.img > > # Drop the PMBR, GPT, and boot code into the System Area of the ISO. > -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-main@freebsd.org Sat Mar 27 17:45:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 876DB57B2D3; Sat, 27 Mar 2021 17:45: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 4F75pb3SDzz4Vfj; Sat, 27 Mar 2021 17:45: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 6981711770; Sat, 27 Mar 2021 17: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 12RHjRxM033206; Sat, 27 Mar 2021 17: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 12RHjRNA033205; Sat, 27 Mar 2021 17:45:27 GMT (envelope-from git) Date: Sat, 27 Mar 2021 17:45:27 GMT Message-Id: <202103271745.12RHjRNA033205@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: 71c160a8f614 - main - vfs: Add an assertion around name length limits 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: 71c160a8f614fa4812838002ba9d266af3cf988c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 17:45:27 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=71c160a8f614fa4812838002ba9d266af3cf988c commit 71c160a8f614fa4812838002ba9d266af3cf988c Author: Mark Johnston AuthorDate: 2021-03-27 17:42:48 +0000 Commit: Mark Johnston CommitDate: 2021-03-27 17:45:19 +0000 vfs: Add an assertion around name length limits Some filesystems assume that they can copy a name component, with length bounded by NAME_MAX, into a dirent buffer of size MAXNAMLEN. These constants have the same value; add a compile-time assertion to that effect. Reported by: Alexey Kulaev Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29431 --- sys/kern/vfs_lookup.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index e881e8f909a4..07c89e634de4 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -747,6 +748,14 @@ needs_exclusive_leaf(struct mount *mp, int flags) return (0); } +/* + * Various filesystems expect to be able to copy a name component with length + * bounded by NAME_MAX into a directory entry buffer of size MAXNAMLEN. Make + * sure that these are the same size. + */ +_Static_assert(MAXNAMLEN == NAME_MAX, + "MAXNAMLEN and NAME_MAX have different values"); + /* * Search a pathname. * This is a very central and rather complicated routine. From owner-dev-commits-src-main@freebsd.org Sat Mar 27 18:06:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EB3357B96D; Sat, 27 Mar 2021 18:06: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 4F76GR2gTCz4Wpx; Sat, 27 Mar 2021 18:06: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 4A0FC11C0A; Sat, 27 Mar 2021 18:06: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 12RI67vm061469; Sat, 27 Mar 2021 18:06:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12RI67Bp061468; Sat, 27 Mar 2021 18:06:07 GMT (envelope-from git) Date: Sat, 27 Mar 2021 18:06:07 GMT Message-Id: <202103271806.12RI67Bp061468@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: 410556f1f10f - main - libctf: Fix an out-of-bounds read in ctf_lookup_by_name() 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: 410556f1f10fd35b350102725fd8504c3cb0afc8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 18:06:07 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=410556f1f10fd35b350102725fd8504c3cb0afc8 commit 410556f1f10fd35b350102725fd8504c3cb0afc8 Author: Domagoj Stolfa AuthorDate: 2021-03-27 18:04:12 +0000 Commit: Mark Johnston CommitDate: 2021-03-27 18:04:12 +0000 libctf: Fix an out-of-bounds read in ctf_lookup_by_name() When prefixes such as struct, union, etc. are compared with the current type (e.g. struct foo), a comparison is made with the prefix. The code currently assumes that every type is a valid C type with a prefix, however at times, garbage ends up in this function causing an unpredictable crash with DTrace due to the isspace(*p) call or subsequent calls. An example that I've seen of this is the letter 's' being passed in, comparing true with struct as the comparison size was (q - p) == 1, but then we increment p with the length of "struct", resulting in an out of bounds read. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29435 --- cddl/contrib/opensolaris/common/ctf/ctf_lookup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c b/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c index aa58663309b6..5912cc1a36e8 100644 --- a/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c +++ b/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c @@ -132,8 +132,9 @@ ctf_lookup_by_name(ctf_file_t *fp, const char *name) continue; /* skip qualifier keyword */ for (lp = fp->ctf_lookups; lp->ctl_prefix != NULL; lp++) { - if (lp->ctl_prefix[0] == '\0' || - strncmp(p, lp->ctl_prefix, (size_t)(q - p)) == 0) { + if ((size_t)(q - p) >= lp->ctl_len && + (lp->ctl_prefix[0] == '\0' || + strncmp(p, lp->ctl_prefix, (size_t)(q - p)) == 0)) { for (p += lp->ctl_len; isspace(*p); p++) continue; /* skip prefix and next ws */ From owner-dev-commits-src-main@freebsd.org Sat Mar 27 18:16:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5692A57C1E4 for ; Sat, 27 Mar 2021 18:16:47 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.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 4F76Vl1sxgz4XFQ for ; Sat, 27 Mar 2021 18:16:46 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f48.google.com with SMTP id w203-20020a1c49d40000b029010c706d0642so7135591wma.0 for ; Sat, 27 Mar 2021 11:16:46 -0700 (PDT) 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=l8GR87JrOaADdeQTEhBDuzoQ3zhiOD23ORjjpJTexy8=; b=HlXYmy1qKErxTljQGI3m1C3RKZjVnrYOFVtZgMeBpOjCQBUZYQRvNfC5EVH2+NpE+0 ABI5vr5JuZ3hbQDmoHTlNwTLca4RIueFPaamZQ2cvt/2a++8Tm+ejtJqKvcktHGB4l1u rAm2MFNsEbeAK2hNO9Xygy41Y5qM8tMeuW3SD9P+E1nRgqAFba5N9mmbEzSS4/A8jV9V H3MICZWDzHQxM04IcNQCeid86J61jHPxjA1kxQpp1xcjduz4Lxm+Lr/nxvjaEcitbiiM QzQhiL76BkyUTzYLBGy6VYbM/SFLpuoCfYM15tsqe2MFp3AblAU9FgYp8KdsCI5QlJWr kOOQ== X-Gm-Message-State: AOAM5310TFnjyUrR64yKZ78e9J5b9n4awNY9h408nLVbXmOGbBRBDwxz j2PEVTXI1LH7MKk+Z3Ljz8i/FQ== X-Google-Smtp-Source: ABdhPJxRaanRyqsX92CTicPDsrazICpTsb9czY555A/0MOCYSxYa7aaJ54zsiTnpJm5Pt2YQmjYUmw== X-Received: by 2002:a05:600c:2197:: with SMTP id e23mr17858383wme.39.1616869005683; Sat, 27 Mar 2021 11:16:45 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id a67sm7502184wme.33.2021.03.27.11.16.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Mar 2021 11:16:45 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 410556f1f10f - main - libctf: Fix an out-of-bounds read in ctf_lookup_by_name() From: Jessica Clarke In-Reply-To: <202103271806.12RI67Bp061468@gitrepo.freebsd.org> Date: Sat, 27 Mar 2021 18:16:44 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202103271806.12RI67Bp061468@gitrepo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4F76Vl1sxgz4XFQ 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-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 18:16:47 -0000 On 27 Mar 2021, at 18:06, Mark Johnston wrote: >=20 > The branch main has been updated by markj: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D410556f1f10fd35b350102725fd8504c= 3cb0afc8 >=20 > commit 410556f1f10fd35b350102725fd8504c3cb0afc8 > Author: Domagoj Stolfa > AuthorDate: 2021-03-27 18:04:12 +0000 > Commit: Mark Johnston > CommitDate: 2021-03-27 18:04:12 +0000 >=20 > libctf: Fix an out-of-bounds read in ctf_lookup_by_name() >=20 > When prefixes such as struct, union, etc. are compared with the = current > type (e.g. struct foo), a comparison is made with the prefix. The = code > currently assumes that every type is a valid C type with a prefix, > however at times, garbage ends up in this function causing an > unpredictable crash with DTrace due to the isspace(*p) call or > subsequent calls. An example that I've seen of this is the letter = 's' > being passed in, comparing true with struct as the comparison size = was > (q - p) =3D=3D 1, but then we increment p with the length of = "struct", > resulting in an out of bounds read. >=20 > Reviewed by: markj > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D29435 > --- > cddl/contrib/opensolaris/common/ctf/ctf_lookup.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c b/q > index aa58663309b6..5912cc1a36e8 100644 > --- a/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c > +++ b/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c > @@ -132,8 +132,9 @@ ctf_lookup_by_name(ctf_file_t *fp, const char = *name) > continue; /* skip qualifier keyword */ >=20 > for (lp =3D fp->ctf_lookups; lp->ctl_prefix !=3D NULL; = lp++) { > - if (lp->ctl_prefix[0] =3D=3D '\0' || > - strncmp(p, lp->ctl_prefix, (size_t)(q - p)) = =3D=3D 0) { > + if ((size_t)(q - p) >=3D lp->ctl_len && > + (lp->ctl_prefix[0] =3D=3D '\0' || > + strncmp(p, lp->ctl_prefix, (size_t)(q - p)) = =3D=3D 0)) { > for (p +=3D lp->ctl_len; isspace(*p); = p++) > continue; /* skip prefix and = next ws */ We had a student porting DTrace to CheriBSD as a Master's project notice = this and get this fixed =E2=80=9Cupstream=E2=80=9D in Illumos[1], but = neglected to do so in FreeBSD (and it seems CheriBSD has an earlier version of the patch that I = requested be changed in the upstream review...); you might wish to pull that in = instead? It=E2=80=99s equivalent, just differently formatted, so adds noise to = the diff. Jess [1] = https://github.com/illumos/illumos-gate/commit/d15d17d4231f87f1571fa6d5853= 77206f360f667 From owner-dev-commits-src-main@freebsd.org Sat Mar 27 18:44:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28A1757CD29; Sat, 27 Mar 2021 18:44:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F77730Kfhz4YhG; Sat, 27 Mar 2021 18:44:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf29.google.com with SMTP id q9so4608903qvm.6; Sat, 27 Mar 2021 11:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=ogDpbsCuoPMsgTyQfpDR3D5K4Q8C4zauPcwiE6RPXAQ=; b=Hjb3S+ld1rghDNJdzuEZPVx5eyaJABu6jg6dnsp/WnphFnlMLSBfwpO0DYywZ7S0SS ojp7kN3QgY3Su8idQQz5SfwW04imp2RxnnPgjJ2lwmrpvPO8M2qXrILXGRW306Svqckz enod6myWoxtlQJgsiM/lJXhynT0W5+P01WkXw0TabLdRzhc9FEXJUJSx2jLmSTcT0M5M DE09jaKc2snaS9vG9Mv0YuqBDdM/O2sTUcn+NzbxqTmm3SrRaJCQjvG3rUHj7WFDEheW f8qg8WMogEXSpS0w2I07XvUvjG1Y3N/w9MhmHMAhDH+jaOrh5Auhb75FFZLOnEyYCxPW /1ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=ogDpbsCuoPMsgTyQfpDR3D5K4Q8C4zauPcwiE6RPXAQ=; b=VJoFJoyBxYaMc01Q7QEcxYm9XvJnXqV+1N89qugQCS92yahYCEOz1CXUAk5DQKTXPS 88aCIPZbgGmrBcSC9RXygmE30vF6QyK2C0lkclKrKC6aZLy6a8UrJpp1agKVzXobGxUM Aearqt6+qbYkjRz+kNAskq12ZQEAwLBpFkpBx18EvjpQ18t22WXyuq08KBhGvBQIzvEY DxTuOwEuxxEfw8c+E6KpNQ4SSp6TSZzmPPztgQ+0jZdsCatmvmIkP1fhHC7EOyzZJhL1 tNTN6Xf2t5OUffbbxdW9Bu6vvRwUdLjT3NhhUEP4GkU8/EOPesRcQ4sdO6UYdadEqza1 8PaA== X-Gm-Message-State: AOAM530XKC12ROnP1a2urJ0SlresQvfPv6/Yz03rlCAT9JIBaxlHCAzI +OS3l78myI0xKpLVs2xFrws+2efWj4B3Ww== X-Google-Smtp-Source: ABdhPJz7DWkQajekHwKjxSNP7Yb+KK2XvVzFnMRkcGnvsEYQMhIpWBRRd6GIxKqvMnnB3r6cwOabag== X-Received: by 2002:a05:6214:10c7:: with SMTP id r7mr18918723qvs.3.1616870685578; Sat, 27 Mar 2021 11:44:45 -0700 (PDT) Received: from nuc ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id f136sm9525363qke.24.2021.03.27.11.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Mar 2021 11:44:45 -0700 (PDT) Sender: Mark Johnston Date: Sat, 27 Mar 2021 14:44:46 -0400 From: Mark Johnston To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 410556f1f10f - main - libctf: Fix an out-of-bounds read in ctf_lookup_by_name() Message-ID: References: <202103271806.12RI67Bp061468@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 4F77730Kfhz4YhG 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-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 18:44:47 -0000 On Sat, Mar 27, 2021 at 06:16:44PM +0000, Jessica Clarke wrote: > On 27 Mar 2021, at 18:06, Mark Johnston wrote: > > > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=410556f1f10fd35b350102725fd8504c3cb0afc8 > > > > commit 410556f1f10fd35b350102725fd8504c3cb0afc8 > > Author: Domagoj Stolfa > > AuthorDate: 2021-03-27 18:04:12 +0000 > > Commit: Mark Johnston > > CommitDate: 2021-03-27 18:04:12 +0000 > > > > libctf: Fix an out-of-bounds read in ctf_lookup_by_name() > > > > When prefixes such as struct, union, etc. are compared with the current > > type (e.g. struct foo), a comparison is made with the prefix. The code > > currently assumes that every type is a valid C type with a prefix, > > however at times, garbage ends up in this function causing an > > unpredictable crash with DTrace due to the isspace(*p) call or > > subsequent calls. An example that I've seen of this is the letter 's' > > being passed in, comparing true with struct as the comparison size was > > (q - p) == 1, but then we increment p with the length of "struct", > > resulting in an out of bounds read. > > > > Reviewed by: markj > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D29435 > > --- > > cddl/contrib/opensolaris/common/ctf/ctf_lookup.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c b/q > > index aa58663309b6..5912cc1a36e8 100644 > > --- a/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c > > +++ b/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c > > @@ -132,8 +132,9 @@ ctf_lookup_by_name(ctf_file_t *fp, const char *name) > > continue; /* skip qualifier keyword */ > > > > for (lp = fp->ctf_lookups; lp->ctl_prefix != NULL; lp++) { > > - if (lp->ctl_prefix[0] == '\0' || > > - strncmp(p, lp->ctl_prefix, (size_t)(q - p)) == 0) { > > + if ((size_t)(q - p) >= lp->ctl_len && > > + (lp->ctl_prefix[0] == '\0' || > > + strncmp(p, lp->ctl_prefix, (size_t)(q - p)) == 0)) { > > for (p += lp->ctl_len; isspace(*p); p++) > > continue; /* skip prefix and next ws */ > > We had a student porting DTrace to CheriBSD as a Master's project notice this > and get this fixed “upstream” in Illumos[1], but neglected to do so in FreeBSD > (and it seems CheriBSD has an earlier version of the patch that I requested be > changed in the upstream review...); you might wish to pull that in instead? > It’s equivalent, just differently formatted, so adds noise to the diff. Ah, I had pondered suggesting the exact same change. I think we can just apply this adjustment as a separate diff. I posted the diff while I rerun the test suite: https://reviews.freebsd.org/D29448 > > Jess > > [1] https://github.com/illumos/illumos-gate/commit/d15d17d4231f87f1571fa6d585377206f360f667 > From owner-dev-commits-src-main@freebsd.org Sat Mar 27 18:47:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B13E957CF85; Sat, 27 Mar 2021 18:47:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F779m4dBcz4YxQ; Sat, 27 Mar 2021 18:47: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 91BAB11CFB; Sat, 27 Mar 2021 18:47: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 12RIl8ZB017840; Sat, 27 Mar 2021 18:47:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12RIl8RY017839; Sat, 27 Mar 2021 18:47:08 GMT (envelope-from git) Date: Sat, 27 Mar 2021 18:47:08 GMT Message-Id: <202103271847.12RIl8RY017839@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: c7b913aa47ba - main - vm_fault: handle KERN_PROTECTION_FAILURE 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: c7b913aa47bac8b35b6a0679497ad28e561318c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 18:47:08 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c7b913aa47bac8b35b6a0679497ad28e561318c2 commit c7b913aa47bac8b35b6a0679497ad28e561318c2 Author: Konstantin Belousov AuthorDate: 2021-03-27 11:08:52 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-27 18:16:27 +0000 vm_fault: handle KERN_PROTECTION_FAILURE pmap_enter(PMAP_ENTER_LARGEPAGE) may return KERN_PROTECTION_FAILURE due to PKRU inconsistency. Handle it in the call place from vm_fault_populate(), and in places which decode errors from vm_fault_populate()/ vm_fault_allocate(). Reviewed by: jah, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29442 --- sys/vm/vm_fault.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index da7b1f1d2d8e..585e1544415d 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -506,6 +506,8 @@ vm_fault_populate(struct faultstate *fs) PMAP_ENTER_LARGEPAGE, bdry_idx); VM_OBJECT_WLOCK(fs->first_object); vm_page_xunbusy(m); + if (rv != KERN_SUCCESS) + goto out; if ((fs->fault_flags & VM_FAULT_WIRE) != 0) { for (i = 0; i < atop(pagesizes[bdry_idx]); i++) vm_page_wire(m + i); @@ -586,7 +588,7 @@ vm_fault_populate(struct faultstate *fs) } out: curthread->td_ru.ru_majflt++; - return (KERN_SUCCESS); + return (rv); } static int prot_fault_translation; @@ -1073,6 +1075,7 @@ vm_fault_allocate(struct faultstate *fs) switch (rv) { case KERN_SUCCESS: case KERN_FAILURE: + case KERN_PROTECTION_FAILURE: case KERN_RESTART: return (rv); case KERN_NOT_RECEIVER: @@ -1343,6 +1346,7 @@ RetryFault: goto RetryFault; case KERN_SUCCESS: case KERN_FAILURE: + case KERN_PROTECTION_FAILURE: case KERN_OUT_OF_BOUNDS: unlock_and_deallocate(&fs); return (rv); @@ -1410,6 +1414,7 @@ RetryFault: goto RetryFault; case KERN_SUCCESS: case KERN_FAILURE: + case KERN_PROTECTION_FAILURE: case KERN_OUT_OF_BOUNDS: unlock_and_deallocate(&fs); return (rv); From owner-dev-commits-src-main@freebsd.org Sat Mar 27 21:10:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39C385A884F; Sat, 27 Mar 2021 21:10:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7BMh17KTz4jQQ; Sat, 27 Mar 2021 21:10: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 19DB714211; Sat, 27 Mar 2021 21:10: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 12RLAu2C024133; Sat, 27 Mar 2021 21:10:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12RLAt1E024132; Sat, 27 Mar 2021 21:10:55 GMT (envelope-from git) Date: Sat, 27 Mar 2021 21:10:55 GMT Message-Id: <202103272110.12RLAt1E024132@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: a94d15af26b5 - main - ichsmb: Add PCI IDs for Intel Comet Lake and Tiger Lake 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: a94d15af26b51cea480030b26c751c3550b1b4bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2021 21:10:56 -0000 The branch main has been updated by nc (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a94d15af26b51cea480030b26c751c3550b1b4bb commit a94d15af26b51cea480030b26c751c3550b1b4bb Author: Neel Chauhan AuthorDate: 2021-03-27 21:08:34 +0000 Commit: Neel Chauhan CommitDate: 2021-03-27 21:08:34 +0000 ichsmb: Add PCI IDs for Intel Comet Lake and Tiger Lake Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D27859 MFC after: 2 weeks --- sys/dev/ichsmb/ichsmb_pci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/ichsmb/ichsmb_pci.c b/sys/dev/ichsmb/ichsmb_pci.c index e0aa3bfdb383..ff4b287dd020 100644 --- a/sys/dev/ichsmb/ichsmb_pci.c +++ b/sys/dev/ichsmb/ichsmb_pci.c @@ -105,6 +105,10 @@ __FBSDID("$FreeBSD$"); #define ID_LEWISBURG2 0xa223 #define ID_KABYLAKE 0xa2a3 #define ID_CANNONLAKE 0xa323 +#define ID_COMETLAKE 0x02a3 +#define ID_COMETLAKE2 0x06a3 +#define ID_TIGERLAKE 0xa0a3 +#define ID_TIGERLAKE2 0x43a3 static const struct pci_device_table ichsmb_devices[] = { { PCI_DEV(PCI_VENDOR_INTEL, ID_82801AA), @@ -187,6 +191,14 @@ static const struct pci_device_table ichsmb_devices[] = { PCI_DESCR("Intel Kaby Lake SMBus controller") }, { PCI_DEV(PCI_VENDOR_INTEL, ID_CANNONLAKE), PCI_DESCR("Intel Cannon Lake SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_COMETLAKE), + PCI_DESCR("Intel Comet Lake SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_COMETLAKE2), + PCI_DESCR("Intel Comet Lake SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_TIGERLAKE), + PCI_DESCR("Intel Tiger Lake SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_TIGERLAKE2), + PCI_DESCR("Intel Tiger Lake SMBus controller") }, }; /* Internal functions */ From owner-dev-commits-src-main@freebsd.org Sun Mar 28 00:25:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 807DF5ADF5E; Sun, 28 Mar 2021 00: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 4F7Ggv3FLtz4tkB; Sun, 28 Mar 2021 00: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 626041695D; Sun, 28 Mar 2021 00: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 12S0PFIj093162; Sun, 28 Mar 2021 00: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 12S0PFBs093161; Sun, 28 Mar 2021 00:25:15 GMT (envelope-from git) Date: Sun, 28 Mar 2021 00:25:15 GMT Message-Id: <202103280025.12S0PFBs093161@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 6a762cfae145 - main - powerpc: Fix powerpcspe WRT FPSCR MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a762cfae145625e491528531709145c76228870 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 00:25:15 -0000 The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=6a762cfae145625e491528531709145c76228870 commit 6a762cfae145625e491528531709145c76228870 Author: Justin Hibbits AuthorDate: 2021-03-28 00:24:59 +0000 Commit: Justin Hibbits CommitDate: 2021-03-28 00:24:59 +0000 powerpc: Fix powerpcspe WRT FPSCR Summary: Since powerpcspe doesn't have a traditional FPU, there's no FPSCR, and no FPRs. Attempting to use them triggers an illegal instruction trap. Fix this unconditional cleanup of FPSCR by conditionalizing it on the FPU being used in the outgoing thread. Reviewed By: bdragon Differential Revision: https://reviews.freebsd.org/D29452 --- sys/powerpc/powerpc/exec_machdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index 91cc9a98f7a7..97e4caba956a 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -566,7 +566,8 @@ cleanup_power_extras(struct thread *td) if (pcb_flags & PCB_CDSCR) mtspr(SPR_DSCRP, 0); - cleanup_fpscr(); + if (pcb_flags & PCB_FPU) + cleanup_fpscr(); } /* From owner-dev-commits-src-main@freebsd.org Sun Mar 28 00:37:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C0305AE72D; Sun, 28 Mar 2021 00:37: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 4F7Gxn1B5bz4vlK; Sun, 28 Mar 2021 00:37: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 16ED816D23; Sun, 28 Mar 2021 00:37: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 12S0bGlb008141; Sun, 28 Mar 2021 00:37:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12S0bGqL008140; Sun, 28 Mar 2021 00:37:16 GMT (envelope-from git) Date: Sun, 28 Mar 2021 00:37:16 GMT Message-Id: <202103280037.12S0bGqL008140@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: 3c065eeaa7a5 - main - libctf: Adjust logic to match upstream after 410556f1f 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: 3c065eeaa7a5ebb56991f5c8123e343a83bf0f0d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 00:37:17 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3c065eeaa7a5ebb56991f5c8123e343a83bf0f0d commit 3c065eeaa7a5ebb56991f5c8123e343a83bf0f0d Author: Mark Johnston AuthorDate: 2021-03-28 00:36:44 +0000 Commit: Mark Johnston CommitDate: 2021-03-28 00:37:12 +0000 libctf: Adjust logic to match upstream after 410556f1f No functional change intended. Suggested by: jrtc27 MFC after: 1 week --- cddl/contrib/opensolaris/common/ctf/ctf_lookup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c b/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c index 5912cc1a36e8..cd9c71436938 100644 --- a/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c +++ b/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c @@ -132,9 +132,9 @@ ctf_lookup_by_name(ctf_file_t *fp, const char *name) continue; /* skip qualifier keyword */ for (lp = fp->ctf_lookups; lp->ctl_prefix != NULL; lp++) { - if ((size_t)(q - p) >= lp->ctl_len && - (lp->ctl_prefix[0] == '\0' || - strncmp(p, lp->ctl_prefix, (size_t)(q - p)) == 0)) { + if (lp->ctl_prefix[0] == '\0' || + ((size_t)(q - p) >= lp->ctl_len && strncmp(p, + lp->ctl_prefix, (size_t)(q - p)) == 0)) { for (p += lp->ctl_len; isspace(*p); p++) continue; /* skip prefix and next ws */ From owner-dev-commits-src-main@freebsd.org Sun Mar 28 01:21:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29F6C5B0087; Sun, 28 Mar 2021 01:21:45 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7Hx50nVzz3DTJ; Sun, 28 Mar 2021 01:21:45 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:54f3:469b:d2db:e3b5]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D215E83C5; Sun, 28 Mar 2021 01:21:44 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 90d2f7c413f9 - main - release: amd64: Fix ISO/USB hybrid image To: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202103271108.12RB8vdT074664@gitrepo.freebsd.org> From: Nathan Whitehorn Message-ID: Date: Sat, 27 Mar 2021 21:21:43 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <202103271108.12RB8vdT074664@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 01:21:45 -0000 Is there a reason this can't use makefs's boot-image support directly in future, like hybrid systems on other architectures? It already supports all the complex interleaving of partition tables with ISO9660 for other schemes (e.g. MBR and APM) and could probably be extended without much trouble for this. (I realize this isn't useful for 13.0) -Nathan On 3/27/21 7:08 AM, Emmanuel Vadot wrote: > The branch main has been updated by manu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 > > commit 90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 > Author: Emmanuel Vadot > AuthorDate: 2021-03-27 11:04:51 +0000 > Commit: Emmanuel Vadot > CommitDate: 2021-03-27 11:04:51 +0000 > > release: amd64: Fix ISO/USB hybrid image > > Recent mkimg changes forces to have partitions given in explicit order. > This is so we can have the first partition starting at a specific offset > and the next ones starting after without having to specify an offset. > Switch the partition in the mkisoimage.sh script so the first one created > is the isoboot one. > > PR: 254490 > Reported by: Michael Dexter Tested by: Vincent Milum Jr > MFC after: Right now > --- > release/amd64/mkisoimages.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh > index 1a1440fa1983..a9e8a2c04392 100644 > --- a/release/amd64/mkisoimages.sh > +++ b/release/amd64/mkisoimages.sh > @@ -89,8 +89,8 @@ if [ "$bootable" != "" ]; then > $MKIMG -s gpt \ > --capacity $imgsize \ > -b "$BASEBITSDIR/boot/pmbr" \ > - $espparam \ > -p freebsd-boot:="$BASEBITSDIR/boot/isoboot" \ > + $espparam \ > -o hybrid.img > > # Drop the PMBR, GPT, and boot code into the System Area of the ISO. > From owner-dev-commits-src-main@freebsd.org Sun Mar 28 01:43:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 252755B07AD; Sun, 28 Mar 2021 01:43: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 4F7JQc0ZYDz3FqQ; Sun, 28 Mar 2021 01:43: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 06A9417C07; Sun, 28 Mar 2021 01:43: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 12S1hp8N005563; Sun, 28 Mar 2021 01:43:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12S1hptT005562; Sun, 28 Mar 2021 01:43:51 GMT (envelope-from git) Date: Sun, 28 Mar 2021 01:43:51 GMT Message-Id: <202103280143.12S1hptT005562@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: bd94c8ab29c3 - main - [PowerPC] Fix NUMA checking for powernv 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: bd94c8ab29c3162bbb43973ee77ce245fe157fef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 01:43:52 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=bd94c8ab29c3162bbb43973ee77ce245fe157fef commit bd94c8ab29c3162bbb43973ee77ce245fe157fef Author: Brandon Bergren AuthorDate: 2021-03-28 01:41:45 +0000 Commit: Brandon Bergren CommitDate: 2021-03-28 01:42:49 +0000 [PowerPC] Fix NUMA checking for powernv At this point in startup, vm_ndomains has not been initialized. Switch to checking kenv instead. Fixes incorrect NUMA information being set on multi-domain systems like Talos II. Submitted by: jhibbits MFC after: 2 weeks --- sys/powerpc/powernv/platform_powernv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/powernv/platform_powernv.c b/sys/powerpc/powernv/platform_powernv.c index 434b642a66a8..d7acc544c2ed 100644 --- a/sys/powerpc/powernv/platform_powernv.c +++ b/sys/powerpc/powernv/platform_powernv.c @@ -532,7 +532,9 @@ powernv_node_numa_domain(platform_t platform, phandle_t node) #ifndef NUMA return (0); #endif - if (vm_ndomains == 1) + i = 0; + TUNABLE_INT_FETCH("vm.numa.disabled", &i); + if (i) return (0); res = OF_getencprop(node, "ibm,associativity", From owner-dev-commits-src-main@freebsd.org Sun Mar 28 10:18:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AE255BC5BD; Sun, 28 Mar 2021 10:18: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 4F7WrL1qsNz4Rwt; Sun, 28 Mar 2021 10:18: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 31BE41E616; Sun, 28 Mar 2021 10:18: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 12SAIQQl019786; Sun, 28 Mar 2021 10:18:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12SAIQwD019785; Sun, 28 Mar 2021 10:18:26 GMT (envelope-from git) Date: Sun, 28 Mar 2021 10:18:26 GMT Message-Id: <202103281018.12SAIQwD019785@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: 1c1ff7979571 - main - pkgbase: make only vital packages vital, not their sub-packages 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: 1c1ff7979571bf07c05a48e857b7b285b037410f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 10:18:26 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1c1ff7979571bf07c05a48e857b7b285b037410f commit 1c1ff7979571bf07c05a48e857b7b285b037410f Author: Mina Igalic AuthorDate: 2021-03-28 10:16:45 +0000 Commit: Emmanuel Vadot CommitDate: 2021-03-28 10:18:09 +0000 pkgbase: make only vital packages vital, not their sub-packages make "vital" a replaceable, which defaults to "false" and only set it for the main clib, utilities and runtime packages, not their sub-packages PR: 254174 Differential Revision: https://reviews.freebsd.org/D29224 --- release/packages/generate-ucl.sh | 10 +++++++++- release/packages/jail.ucl | 2 +- release/packages/runtime.ucl | 2 +- release/packages/template.ucl | 1 + release/packages/utilities.ucl | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh index 67c10e485eb7..10d9d3162f9c 100755 --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -32,19 +32,25 @@ main() { shift $(( ${OPTIND} - 1 )) outname="$(echo ${outname} | tr '-' '_')" + vital="false" case "${outname}" in clibs) + vital="true" # clibs should not have any dependencies or anything # else imposed on it. ;; caroot) pkgdeps="utilities" ;; + utilities) + uclfile="${uclfile}" + vital="true" + ;; runtime) outname="runtime" - uclfile="${uclfile}" _descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)" + vital="true" ;; *_lib32_dev) outname="${outname%%_lib32_dev}" @@ -108,6 +114,7 @@ main() { echo "uclfile=${uclfile}" echo "desc=${desc}" echo "comment=${comment}" + echo "vital=${vital}" echo "cp ${uclsource} -> ${uclfile}" echo "===============================================================" echo "" @@ -135,6 +142,7 @@ EOF -e "s/%PKGNAME%/${origname}/" \ -e "s/%COMMENT%/${comment}/" \ -e "s/%DESC%/${desc}/" \ + -e "s/%VITAL%/${vital}/" \ -e "s/%CAP_MKDB_ENDIAN%/${cap_arg}/g" \ -e "s/%PKG_NAME_PREFIX%/${PKG_NAME_PREFIX}/" \ -e "s|%PKG_WWW%|${PKG_WWW}|" \ diff --git a/release/packages/jail.ucl b/release/packages/jail.ucl index 8448a15ebf7b..cc22cf042a76 100644 --- a/release/packages/jail.ucl +++ b/release/packages/jail.ucl @@ -10,7 +10,7 @@ categories = [ base ] maintainer = "%PKG_MAINTAINER%" www = "%PKG_WWW%" prefix = "/" -vital = true +vital = %VITAL% licenselogic = "single" licenses = [ BSD2CLAUSE ] desc = < Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EC6D5BC65D; Sun, 28 Mar 2021 10:20:37 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7Wtr4HJsz4S3g; Sun, 28 Mar 2021 10:20:36 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1616926833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gW8T0ZkBVqmN5NUJfMZ3CeLnWlx2DqnLXSrs0WV4BYA=; b=YhGaRD66EjxeqrwxCEf0QUEp6uM3opUnRn2owOqOsRHPnbcZd9ZpVvlLZ+f3i798yfhw3M bl+zfEcY7v0nFJzs8RIKB5J0HcVX9RAEZmqt1MJFGb1x86eNywH7gmvYSMDI64qwWMGEZn rSvM/BGgxkEbIp7FyFpe8p1VRRtc3O8= Received: from amy (lfbn-idf2-1-644-4.w86-247.abo.wanadoo.fr [86.247.100.4]) by mx.blih.net (OpenSMTPD) with ESMTPSA id cab9e2ee (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 28 Mar 2021 10:20:33 +0000 (UTC) Date: Sun, 28 Mar 2021 12:20:33 +0200 From: Emmanuel Vadot To: Nathan Whitehorn Cc: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 90d2f7c413f9 - main - release: amd64: Fix ISO/USB hybrid image Message-Id: <20210328122033.82df8633d58488186f706c05@bidouilliste.com> In-Reply-To: References: <202103271108.12RB8vdT074664@gitrepo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4F7Wtr4HJsz4S3g 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-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 10:20:37 -0000 On Sat, 27 Mar 2021 21:21:43 -0400 Nathan Whitehorn wrote: > Is there a reason this can't use makefs's boot-image support directly in > future, like hybrid systems on other architectures? It already supports > all the complex interleaving of partition tables with ISO9660 for other > schemes (e.g. MBR and APM) and could probably be extended without much > trouble for this. > > (I realize this isn't useful for 13.0) > -Nathan I have no idea what the bootimage thing in makefs can do, can it create a gpt disk ? > On 3/27/21 7:08 AM, Emmanuel Vadot wrote: > > The branch main has been updated by manu: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 > > > > commit 90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 > > Author: Emmanuel Vadot > > AuthorDate: 2021-03-27 11:04:51 +0000 > > Commit: Emmanuel Vadot > > CommitDate: 2021-03-27 11:04:51 +0000 > > > > release: amd64: Fix ISO/USB hybrid image > > > > Recent mkimg changes forces to have partitions given in explicit order. > > This is so we can have the first partition starting at a specific offset > > and the next ones starting after without having to specify an offset. > > Switch the partition in the mkisoimage.sh script so the first one created > > is the isoboot one. > > > > PR: 254490 > > Reported by: Michael Dexter > Tested by: Vincent Milum Jr > > MFC after: Right now > > --- > > release/amd64/mkisoimages.sh | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh > > index 1a1440fa1983..a9e8a2c04392 100644 > > --- a/release/amd64/mkisoimages.sh > > +++ b/release/amd64/mkisoimages.sh > > @@ -89,8 +89,8 @@ if [ "$bootable" != "" ]; then > > $MKIMG -s gpt \ > > --capacity $imgsize \ > > -b "$BASEBITSDIR/boot/pmbr" \ > > - $espparam \ > > -p freebsd-boot:="$BASEBITSDIR/boot/isoboot" \ > > + $espparam \ > > -o hybrid.img > > > > # Drop the PMBR, GPT, and boot code into the System Area of the ISO. > > > -- Emmanuel Vadot From owner-dev-commits-src-main@freebsd.org Sun Mar 28 15:09:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B2F157C82D; Sun, 28 Mar 2021 15:09: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 4F7fHr0Fjgz4kVL; Sun, 28 Mar 2021 15:09: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 EFDC821FFD; Sun, 28 Mar 2021 15:09: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 12SF9BNb025853; Sun, 28 Mar 2021 15:09:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12SF9B6r025852; Sun, 28 Mar 2021 15:09:11 GMT (envelope-from git) Date: Sun, 28 Mar 2021 15:09:11 GMT Message-Id: <202103281509.12SF9B6r025852@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: 3428b6c050d1 - main - Fix several dev_clone callbacks to avoid out-of-bounds reads 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: 3428b6c050d102ba7f95514b29f4f5685d76b645 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 15:09:12 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3428b6c050d102ba7f95514b29f4f5685d76b645 commit 3428b6c050d102ba7f95514b29f4f5685d76b645 Author: Mark Johnston AuthorDate: 2021-03-28 15:08:36 +0000 Commit: Mark Johnston CommitDate: 2021-03-28 15:08:36 +0000 Fix several dev_clone callbacks to avoid out-of-bounds reads Use strncmp() instead of bcmp(), so that we don't have to find the minimum of the string lengths before comparing. Reviewed by: kib Reported by: KASAN MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29463 --- sys/dev/sound/pcm/dsp.c | 3 +-- sys/kern/kern_conf.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 0593a585b0fd..cce05f4ecf37 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2294,8 +2294,7 @@ dsp_stdclone(char *name, char *namep, char *sep, int use_sep, int *u, int *c) size_t len; len = strlen(namep); - - if (bcmp(name, namep, len) != 0) + if (strncmp(name, namep, len) != 0) return (ENODEV); name += len; diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 29103f83c049..3a07c95e74d0 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -1255,7 +1255,7 @@ dev_stdclone(char *name, char **namep, const char *stem, int *unit) int u, i; i = strlen(stem); - if (bcmp(stem, name, i) != 0) + if (strncmp(stem, name, i) != 0) return (0); if (!isdigit(name[i])) return (0); From owner-dev-commits-src-main@freebsd.org Sun Mar 28 17:58:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D17C5A8CEB; Sun, 28 Mar 2021 17:58:41 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7k3N70fYz4tqf; Sun, 28 Mar 2021 17:58:40 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:d44e:ca04:1a4a:e1a3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id AC11E207D9; Sun, 28 Mar 2021 17:58:40 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: 90d2f7c413f9 - main - release: amd64: Fix ISO/USB hybrid image To: Emmanuel Vadot Cc: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202103271108.12RB8vdT074664@gitrepo.freebsd.org> <20210328122033.82df8633d58488186f706c05@bidouilliste.com> From: Nathan Whitehorn Message-ID: Date: Sun, 28 Mar 2021 13:58:39 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210328122033.82df8633d58488186f706c05@bidouilliste.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 17:58:41 -0000 On 3/28/21 6:20 AM, Emmanuel Vadot wrote: > On Sat, 27 Mar 2021 21:21:43 -0400 > Nathan Whitehorn wrote: > >> Is there a reason this can't use makefs's boot-image support directly in >> future, like hybrid systems on other architectures? It already supports >> all the complex interleaving of partition tables with ISO9660 for other >> schemes (e.g. MBR and APM) and could probably be extended without much >> trouble for this. >> >> (I realize this isn't useful for 13.0) >> -Nathan > I have no idea what the bootimage thing in makefs can do, can it > create a gpt disk ? I can't right now, only MBR and APM. But it doesn't look like it would require a ton of work to teach it GPT, and it might be more reliable in the long term. -Nathan > >> On 3/27/21 7:08 AM, Emmanuel Vadot wrote: >>> The branch main has been updated by manu: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 >>> >>> commit 90d2f7c413f9fc4ac479fa5e91ba1de6d4ea8d45 >>> Author: Emmanuel Vadot >>> AuthorDate: 2021-03-27 11:04:51 +0000 >>> Commit: Emmanuel Vadot >>> CommitDate: 2021-03-27 11:04:51 +0000 >>> >>> release: amd64: Fix ISO/USB hybrid image >>> >>> Recent mkimg changes forces to have partitions given in explicit order. >>> This is so we can have the first partition starting at a specific offset >>> and the next ones starting after without having to specify an offset. >>> Switch the partition in the mkisoimage.sh script so the first one created >>> is the isoboot one. >>> >>> PR: 254490 >>> Reported by: Michael Dexter >> Tested by: Vincent Milum Jr >>> MFC after: Right now >>> --- >>> release/amd64/mkisoimages.sh | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh >>> index 1a1440fa1983..a9e8a2c04392 100644 >>> --- a/release/amd64/mkisoimages.sh >>> +++ b/release/amd64/mkisoimages.sh >>> @@ -89,8 +89,8 @@ if [ "$bootable" != "" ]; then >>> $MKIMG -s gpt \ >>> --capacity $imgsize \ >>> -b "$BASEBITSDIR/boot/pmbr" \ >>> - $espparam \ >>> -p freebsd-boot:="$BASEBITSDIR/boot/isoboot" \ >>> + $espparam \ >>> -o hybrid.img >>> >>> # Drop the PMBR, GPT, and boot code into the System Area of the ISO. >>> > From owner-dev-commits-src-main@freebsd.org Sun Mar 28 18:53:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E47725AA04B; Sun, 28 Mar 2021 18:53: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 4F7lGd67YBz3DX5; Sun, 28 Mar 2021 18:53: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 C52C124CF5; Sun, 28 Mar 2021 18:53: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 12SIrT6J047797; Sun, 28 Mar 2021 18:53:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12SIrTqV047796; Sun, 28 Mar 2021 18:53:29 GMT (envelope-from git) Date: Sun, 28 Mar 2021 18:53:29 GMT Message-Id: <202103281853.12SIrTqV047796@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: b218441ac074 - main - gvinum: add deprecation notice 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: b218441ac074d9cb9417e284980bf87f79a89585 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 18:53:30 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b218441ac074d9cb9417e284980bf87f79a89585 commit b218441ac074d9cb9417e284980bf87f79a89585 Author: Ed Maste AuthorDate: 2021-03-26 15:26:22 +0000 Commit: Ed Maste CommitDate: 2021-03-28 18:45:05 +0000 gvinum: add deprecation notice Vinum is a Logical Volume Manager that was introduced in FreeBSD 3.0, and for FreeBSD 5 was ported to geom(4) as gvinum. gvinum has had no specific development at least as far back as 2010, and has a number of known bugs which are unlikely to be resolved. Add a deprecation notice to raise awareness but state that vinum "may not be" available in FreeBSD 14. Either it will be removed and the notice will be updated to "is not" available, or someone will step up to fix issues and maintain it and we will remove the notice. Reviewed by: imp (earlier version) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29424 --- sbin/gvinum/gvinum.8 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8 index 950a0188946f..a8135e9bf4a2 100644 --- a/sbin/gvinum/gvinum.8 +++ b/sbin/gvinum/gvinum.8 @@ -28,12 +28,28 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2014 +.Dd March 28, 2021 .Dt GVINUM 8 .Os .Sh NAME .Nm gvinum .Nd Logical Volume Manager control program +.Sh DEPRECATION NOTICE +.Nm +and associated +.Xr geom 4 +kernel support is deprecated, and may not be available in +.Fx 14.0 +and later. +Users are advised to migrate to +.Xr gconcat 8 , +.Xr gmirror 8 , +.Xr gstripe 8 , +.Xr graid 8 , +or +.Xr ZFS 8 . +More information is available at +.Pa https://wiki.freebsd.org/DeprecationPlan/gvinum . .Sh SYNOPSIS .Nm .Op Ar command From owner-dev-commits-src-main@freebsd.org Sun Mar 28 19:04:14 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FD635AAA51; Sun, 28 Mar 2021 19:04: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 4F7lW16XRsz3FWP; Sun, 28 Mar 2021 19:04: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 D32AD25465; Sun, 28 Mar 2021 19:04: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 12SJ4D88062519; Sun, 28 Mar 2021 19:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12SJ4D4x062518; Sun, 28 Mar 2021 19:04:13 GMT (envelope-from git) Date: Sun, 28 Mar 2021 19:04:13 GMT Message-Id: <202103281904.12SJ4D4x062518@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: 98727c6cd11e - main - Fix panic when using BOOTP to resolve root path. 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: 98727c6cd11edb10617be0f421e485e0223185a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 19:04:14 -0000 The branch main has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=98727c6cd11edb10617be0f421e485e0223185a5 commit 98727c6cd11edb10617be0f421e485e0223185a5 Author: Brandon Bergren AuthorDate: 2021-03-28 00:18:51 +0000 Commit: Brandon Bergren CommitDate: 2021-03-28 19:02:40 +0000 Fix panic when using BOOTP to resolve root path. When loading a direct-boot kernel, a temporary route is being installed, the NFS handle is acquired, and the temporary route is removed again. This was being done inside a net epoch, but since the krpc code is written using blocking APIs, we can't actually do that, because sleeping is not allowed during a net epoch. Exit and reenter the epoch so we are only in the epoch when doing the routing table manipulation. Fixes panic when booting my RB800 over NFS (where the kernel is loaded using RouterBOOT directly.) Reviewed by: melifaro Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D29464 --- sys/nfs/bootp_subr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c index fd0e0653a02c..2386a23084da 100644 --- a/sys/nfs/bootp_subr.c +++ b/sys/nfs/bootp_subr.c @@ -1682,9 +1682,11 @@ retry: NET_EPOCH_ENTER(et); bootpc_add_default_route(ifctx); + NET_EPOCH_EXIT(et); error = md_mount(&nd->root_saddr, nd->root_hostnam, nd->root_fh, &nd->root_fhsize, &nd->root_args, td); + NET_EPOCH_ENTER(et); bootpc_remove_default_route(ifctx); NET_EPOCH_EXIT(et); if (error != 0) { From owner-dev-commits-src-main@freebsd.org Sun Mar 28 21:53:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DFE25B0E5D; Sun, 28 Mar 2021 21:53: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 4F7qFw70vPz3ht4; Sun, 28 Mar 2021 21:53: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 E339327857; Sun, 28 Mar 2021 21:53: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 12SLr8fA000590; Sun, 28 Mar 2021 21:53:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12SLr8St000589; Sun, 28 Mar 2021 21:53:08 GMT (envelope-from git) Date: Sun, 28 Mar 2021 21:53:08 GMT Message-Id: <202103282153.12SLr8St000589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: cb0dd7e122b8 - main - tcp: reduce memory footprint when listing tcp hostcache MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb0dd7e122b8936ad61a141e65ef8ef874bfebe5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 21:53:09 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=cb0dd7e122b8936ad61a141e65ef8ef874bfebe5 commit cb0dd7e122b8936ad61a141e65ef8ef874bfebe5 Author: Richard Scheffenegger AuthorDate: 2021-03-28 21:12:03 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-28 21:50:23 +0000 tcp: reduce memory footprint when listing tcp hostcache In tcp_hostcache_list, the sbuf used would need a large (~2MB) blocking allocation of memory (M_WAITOK), when listing a full hostcache. This may stall the requestor for an indeterminate time. A further optimization is to return the expected userspace buffersize right away, rather than preparing the output of each current entry of the hostcase, provided by: @tuexen. This makes use of the ready-made functions of sbuf to work with sysctl, and repeatedly drain the much smaller buffer. PR: 254333 MFC after: 2 weeks Reviewed By: #transport, tuexen Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29471 --- sys/netinet/tcp_hostcache.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c index de999bcfda22..5fe905d9abf5 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -628,7 +628,7 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) { const int linesize = 128; struct sbuf sb; - int i, error; + int i, error, len; struct hc_metrics *hc_entry; char ip4buf[INET_ADDRSTRLEN]; #ifdef INET6 @@ -638,11 +638,22 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) if (jailed_without_vnet(curthread->td_ucred) != 0) return (EPERM); - sbuf_new(&sb, NULL, linesize * (V_tcp_hostcache.cache_count + 1), - SBUF_INCLUDENUL); + /* Optimize Buffer length query by sbin/sysctl */ + if (req->oldptr == NULL) { + len = (V_tcp_hostcache.cache_count + 1) * linesize; + return (SYSCTL_OUT(req, NULL, len)); + } + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) { + return(error); + } + + /* Use a buffer for 16 lines */ + sbuf_new_for_sysctl(&sb, NULL, 16 * linesize, req); sbuf_printf(&sb, - "\nIP address MTU SSTRESH RTT RTTVAR " + "\nIP address MTU SSTRESH RTT RTTVAR " " CWND SENDPIPE RECVPIPE HITS UPD EXP\n"); #define msec(u) (((u) + 500) / 1000) @@ -677,8 +688,6 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) } #undef msec error = sbuf_finish(&sb); - if (error == 0) - error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); sbuf_delete(&sb); return(error); }