From owner-svn-src-head@freebsd.org Sun Nov 18 00:52:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2DB0110E042; Sun, 18 Nov 2018 00:52:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AF148A0DB; Sun, 18 Nov 2018 00:52:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C0B04096; Sun, 18 Nov 2018 00:52:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0qSNm003601; Sun, 18 Nov 2018 00:52:28 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0qRUA003598; Sun, 18 Nov 2018 00:52:27 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811180052.wAI0qRUA003598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 18 Nov 2018 00:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340543 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 340543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AF148A0DB X-Spamd-Result: default: False [-0.14 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.14)[-0.141,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:52:29 -0000 Author: marius Date: Sun Nov 18 00:52:27 2018 New Revision: 340543 URL: https://svnweb.freebsd.org/changeset/base/340543 Log: Add a quirk handling for AMDI0040 controllers allowing them to do HS400. Submitted by: Shreyank Amartya (original version) Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_acpi.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Nov 18 00:35:36 2018 (r340542) +++ head/sys/dev/sdhci/sdhci.c Sun Nov 18 00:52:27 2018 (r340543) @@ -898,6 +898,9 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, if (slot->quirks & SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 && caps2 & SDHCI_CAN_MMC_HS400) host_caps |= MMC_CAP_MMC_HS400; + if (slot->quirks & SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 && + caps2 & SDHCI_CAN_SDR104) + host_caps |= MMC_CAP_MMC_HS400; /* * Disable UHS-I and eMMC modes if the set_uhs_timing method is the Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sun Nov 18 00:35:36 2018 (r340542) +++ head/sys/dev/sdhci/sdhci.h Sun Nov 18 00:52:27 2018 (r340543) @@ -93,6 +93,8 @@ #define SDHCI_QUIRK_PRESET_VALUE_BROKEN (1 << 27) /* Controller does not support or the support for ACMD12 is broken. */ #define SDHCI_QUIRK_BROKEN_AUTO_STOP (1 << 28) +/* Controller supports eMMC HS400 mode if SDHCI_CAN_SDR104 is set. */ +#define SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 (1 << 29) /* * Controller registers Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Sun Nov 18 00:35:36 2018 (r340542) +++ head/sys/dev/sdhci/sdhci_acpi.c Sun Nov 18 00:52:27 2018 (r340543) @@ -45,12 +45,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "mmcbr_if.h" #include "sdhci_if.h" +#define SDHCI_AMD_RESET_DLL_REG 0x908 + static const struct sdhci_acpi_device { const char* hid; int uid; @@ -80,7 +83,8 @@ static const struct sdhci_acpi_device { SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { "AMDI0040", 0, "AMD eMMC 5.0 Controller", - SDHCI_QUIRK_32BIT_DMA_SIZE }, + SDHCI_QUIRK_32BIT_DMA_SIZE | + SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 }, { NULL, 0, NULL, 0} }; @@ -94,12 +98,11 @@ static char *sdhci_ids[] = { }; struct sdhci_acpi_softc { - u_int quirks; /* Chip specific quirks */ - struct resource *irq_res; /* IRQ resource */ - void *intrhand; /* Interrupt handle */ - struct sdhci_slot slot; struct resource *mem_res; /* Memory resource */ + struct resource *irq_res; /* IRQ resource */ + void *intrhand; /* Interrupt handle */ + const struct sdhci_acpi_device *acpi_dev; }; static void sdhci_acpi_intr(void *arg); @@ -189,6 +192,52 @@ sdhci_acpi_write_multi_4(device_t dev, struct sdhci_sl bus_write_multi_stream_4(sc->mem_res, off, data, count); } +static void +sdhci_acpi_set_uhs_timing(device_t dev, struct sdhci_slot *slot) +{ + const struct sdhci_acpi_softc *sc; + const struct sdhci_acpi_device *acpi_dev; + const struct mmc_ios *ios; + device_t bus; + uint16_t old_timing; + enum mmc_bus_timing timing; + + bus = slot->bus; + old_timing = sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2); + old_timing &= SDHCI_CTRL2_UHS_MASK; + sdhci_generic_set_uhs_timing(dev, slot); + + sc = device_get_softc(dev); + acpi_dev = sc->acpi_dev; + /* + * AMDI0040 controllers require SDHCI_CTRL2_SAMPLING_CLOCK to be + * disabled when switching from HS200 to high speed and to always + * be turned on again when tuning for HS400. In the later case, + * an AMD-specific DLL reset additionally is needed. + */ + if (strcmp(acpi_dev->hid, "AMDI0040") == 0 && acpi_dev->uid == 0) { + ios = &slot->host.ios; + timing = ios->timing; + if (old_timing == SDHCI_CTRL2_UHS_SDR104 && + timing == bus_timing_hs) + sdhci_acpi_write_2(bus, slot, SDHCI_HOST_CONTROL2, + sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2) & + ~SDHCI_CTRL2_SAMPLING_CLOCK); + if (ios->clock > SD_SDR50_MAX && + old_timing != SDHCI_CTRL2_MMC_HS400 && + timing == bus_timing_mmc_hs400) { + sdhci_acpi_write_2(bus, slot, SDHCI_HOST_CONTROL2, + sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2) | + SDHCI_CTRL2_SAMPLING_CLOCK); + sdhci_acpi_write_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40003210); + DELAY(20); + sdhci_acpi_write_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40033210); + } + } +} + static const struct sdhci_acpi_device * sdhci_acpi_find_device(device_t dev) { @@ -198,7 +247,7 @@ sdhci_acpi_find_device(device_t dev) ACPI_STATUS status; int rv; - rv = ACPI_ID_PROBE(device_get_parent(dev), dev, sdhci_ids, &hid); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, sdhci_ids, &hid); if (rv > 0) return (NULL); @@ -238,13 +287,15 @@ sdhci_acpi_attach(device_t dev) { struct sdhci_acpi_softc *sc = device_get_softc(dev); int rid, err; + u_int quirks; const struct sdhci_acpi_device *acpi_dev; acpi_dev = sdhci_acpi_find_device(dev); if (acpi_dev == NULL) return (ENXIO); - sc->quirks = acpi_dev->quirks; + sc->acpi_dev = acpi_dev; + quirks = acpi_dev->quirks; /* Allocate IRQ. */ rid = 0; @@ -272,11 +323,10 @@ sdhci_acpi_attach(device_t dev) if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES) == 0x446cc8b2 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES2) == 0x00000807) - sc->quirks |= SDHCI_QUIRK_MMC_DDR52 | - SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; - sc->quirks &= ~sdhci_quirk_clear; - sc->quirks |= sdhci_quirk_set; - sc->slot.quirks = sc->quirks; + quirks |= SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; + quirks &= ~sdhci_quirk_clear; + quirks |= sdhci_quirk_set; + sc->slot.quirks = quirks; err = sdhci_init_slot(dev, &sc->slot, 0); if (err) { @@ -393,7 +443,7 @@ static device_method_t sdhci_methods[] = { DEVMETHOD(sdhci_write_2, sdhci_acpi_write_2), DEVMETHOD(sdhci_write_4, sdhci_acpi_write_4), DEVMETHOD(sdhci_write_multi_4, sdhci_acpi_write_multi_4), - DEVMETHOD(sdhci_set_uhs_timing, sdhci_generic_set_uhs_timing), + DEVMETHOD(sdhci_set_uhs_timing, sdhci_acpi_set_uhs_timing), DEVMETHOD_END }; From owner-svn-src-head@freebsd.org Sun Nov 18 01:27:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43F07110F2F2; Sun, 18 Nov 2018 01:27:18 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE2E18B3C4; Sun, 18 Nov 2018 01:27:17 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCF3E45C6; Sun, 18 Nov 2018 01:27:17 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI1RH6S019325; Sun, 18 Nov 2018 01:27:17 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI1RHUv019324; Sun, 18 Nov 2018 01:27:17 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201811180127.wAI1RHUv019324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 18 Nov 2018 01:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340546 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 340546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE2E18B3C4 X-Spamd-Result: default: False [-0.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.14)[-0.141,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 01:27:18 -0000 Author: alc Date: Sun Nov 18 01:27:17 2018 New Revision: 340546 URL: https://svnweb.freebsd.org/changeset/base/340546 Log: Tidy up vm_map_simplify_entry() and its recently introduced helper functions. Notably, reflow the text of some comments so that they occupy fewer lines, and introduce an assertion in one of the new helper functions so that it is not misused by a future caller. In collaboration with: Doug Moore MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17635 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Nov 18 01:07:36 2018 (r340545) +++ head/sys/vm/vm_map.c Sun Nov 18 01:27:17 2018 (r340546) @@ -1644,16 +1644,25 @@ vm_map_find_min(vm_map_t map, vm_object_t object, vm_o } } +/* + * A map entry with any of the following flags set must not be merged with + * another entry. + */ +#define MAP_ENTRY_NOMERGE_MASK (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP | \ + MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP) + static bool vm_map_mergeable_neighbors(vm_map_entry_t prev, vm_map_entry_t entry) { - vm_size_t prevsize; - prevsize = prev->end - prev->start; + KASSERT((prev->eflags & MAP_ENTRY_NOMERGE_MASK) == 0 || + (entry->eflags & MAP_ENTRY_NOMERGE_MASK) == 0, + ("vm_map_mergeable_neighbors: neither %p nor %p are mergeable", + prev, entry)); return (prev->end == entry->start && prev->object.vm_object == entry->object.vm_object && (prev->object.vm_object == NULL || - prev->offset + prevsize == entry->offset) && + prev->offset + (prev->end - prev->start) == entry->offset) && prev->eflags == entry->eflags && prev->protection == entry->protection && prev->max_protection == entry->max_protection && @@ -1667,18 +1676,14 @@ vm_map_merged_neighbor_dispose(vm_map_t map, vm_map_en { /* - * If the backing object is a vnode object, - * vm_object_deallocate() calls vrele(). - * However, vrele() does not lock the vnode - * because the vnode has additional - * references. Thus, the map lock can be kept - * without causing a lock-order reversal with - * the vnode lock. + * If the backing object is a vnode object, vm_object_deallocate() + * calls vrele(). However, vrele() does not lock the vnode because + * the vnode has additional references. Thus, the map lock can be + * kept without causing a lock-order reversal with the vnode lock. * - * Since we count the number of virtual page - * mappings in object->un_pager.vnp.writemappings, - * the writemappings value should not be adjusted - * when the entry is disposed of. + * Since we count the number of virtual page mappings in + * object->un_pager.vnp.writemappings, the writemappings value + * should not be adjusted when the entry is disposed of. */ if (entry->object.vm_object != NULL) vm_object_deallocate(entry->object.vm_object); @@ -1704,10 +1709,8 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent { vm_map_entry_t next, prev; - if ((entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP | - MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) != 0) + if ((entry->eflags & MAP_ENTRY_NOMERGE_MASK) != 0) return; - prev = entry->prev; if (vm_map_mergeable_neighbors(prev, entry)) { vm_map_entry_unlink(map, prev); @@ -1717,7 +1720,6 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent vm_map_entry_resize_free(map, entry->prev); vm_map_merged_neighbor_dispose(map, prev); } - next = entry->next; if (vm_map_mergeable_neighbors(entry, next)) { vm_map_entry_unlink(map, next); @@ -1726,6 +1728,7 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent vm_map_merged_neighbor_dispose(map, next); } } + /* * vm_map_clip_start: [ internal use only ] * From owner-svn-src-head@freebsd.org Sun Nov 18 01:58:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A52EC1121753; Sun, 18 Nov 2018 01:58:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41C028C390; Sun, 18 Nov 2018 01:58:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 207774B10; Sun, 18 Nov 2018 01:58:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI1wntS034732; Sun, 18 Nov 2018 01:58:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI1wmfM034730; Sun, 18 Nov 2018 01:58:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811180158.wAI1wmfM034730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 18 Nov 2018 01:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340547 - head/sbin/dumpon X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/dumpon X-SVN-Commit-Revision: 340547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 41C028C390 X-Spamd-Result: default: False [-0.14 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.14)[-0.141,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 01:58:49 -0000 Author: markj Date: Sun Nov 18 01:58:48 2018 New Revision: 340547 URL: https://svnweb.freebsd.org/changeset/base/340547 Log: Change dumpon(8)'s handling of -g. Rather than using a special value to denote "use the default router", treat the absence of the -g option to mean the same thing. The in-kernel netdump client will always attempt to reach the server directly before falling back to the configured gateway anyway. This change makes it cleaner to support a hostname value for -g. Reviewed by: cem MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18025 Modified: head/sbin/dumpon/dumpon.8 head/sbin/dumpon/dumpon.c Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Sun Nov 18 01:27:17 2018 (r340546) +++ head/sbin/dumpon/dumpon.8 Sun Nov 18 01:58:48 2018 (r340547) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 26, 2018 +.Dd November 17, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -46,7 +46,7 @@ .Op Fl k Ar pubkey .Op Fl Z .Op Fl z -.Op Fl g Ar gateway | Li default +.Op Fl g Ar gateway .Fl s Ar server .Fl c Ar client .Ar iface @@ -140,21 +140,22 @@ The local IP address of the .Xr netdump 4 client. .It Fl g Ar gateway -Optional. -If not specified, it is assumed that the -.Ar server -is on the same link as the -.Ar client . -.Pp -If specified, -.Ar gateway -is the address of the first-hop router between the +The first-hop router between .Ar client -and the +and .Ar server . -The special value -.Dv Dq default -indicates that the currently configured system default route should be used. +If the +.Fl g +option is not specified and the system has a default route, the default +router is used as the +.Xr netdump 4 +gateway. +If the +.Fl g +option is not specified and the system does not have a default route, +.Ar server +is assumed to be on the same link as +.Ar client . .It Fl s Ar server The IP address of the .Xr netdumpd 8 Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Sun Nov 18 01:27:17 2018 (r340546) +++ head/sbin/dumpon/dumpon.c Sun Nov 18 01:58:48 2018 (r340547) @@ -88,7 +88,7 @@ usage(void) fprintf(stderr, "usage: dumpon [-v] [-k ] [-Zz] \n" " dumpon [-v] [-k ] [-Zz]\n" - " [-g |default] -s -c \n" + " [-g ] -s -c \n" " dumpon [-v] off\n" " dumpon [-v] -l\n"); exit(EX_USAGE); @@ -109,8 +109,6 @@ find_gateway(const char *ifname) size_t sz; int error, i, ifindex, mib[7]; - ret = NULL; - /* First look up the interface index. */ if (getifaddrs(&ifap) != 0) err(EX_OSERR, "getifaddrs"); @@ -148,6 +146,7 @@ find_gateway(const char *ifname) free(buf); } + ret = NULL; for (next = buf; next < buf + sz; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; if (rtm->rtm_version != RTM_VERSION) @@ -476,12 +475,13 @@ main(int argc, char *argv[]) if (inet_aton(client, &ndconf.ndc_client) == 0) errx(EX_USAGE, "invalid client address '%s'", client); - if (gateway == NULL) + gateway = find_gateway(argv[0]); + if (gateway == NULL) { + if (verbose) + printf("failed to look up gateway for %s\n", + server); gateway = server; - else if (strcmp(gateway, "default") == 0 && - (gateway = find_gateway(argv[0])) == NULL) - errx(EX_NOHOST, - "failed to look up next-hop router for %s", server); + } if (inet_aton(gateway, &ndconf.ndc_gateway) == 0) errx(EX_USAGE, "invalid gateway address '%s'", gateway); From owner-svn-src-head@freebsd.org Sun Nov 18 10:46:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E19971134D0C; Sun, 18 Nov 2018 10:46:55 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay101.isp.belgacom.be (mailrelay101.isp.belgacom.be [195.238.20.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A49876970; Sun, 18 Nov 2018 10:46:54 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AbPxHsBBI4rlaOW9lqMT+UyQJP3N1i/DPJgcQr6?= =?us-ascii?q?AfoPdwSPT6pMbcNUDSrc9gkEXOFd2Cra4c26yO6+jJYi8p2d65qncMcZhBBV?= =?us-ascii?q?cuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx?= =?us-ascii?q?7xKRR6JvjvGo7Vks+7y/2+94fcbglUhzexe69+IAmrpgjNq8cahpdvJLwswR?= =?us-ascii?q?XTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3?= =?us-ascii?q?sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Qi?= =?us-ascii?q?qp4bt1RxD0iScHLz85/3/Risxsl6JQvRatqwViz4LIfI2ZMfxzdb7fc9wHX2?= =?us-ascii?q?pMRshfWSxfDI2hbIUADeQBMulEoIfyvFYOsQK+CRWwCO/z1jNFhHn71rA63e?= =?us-ascii?q?Q7FgHG2RQtEcwLsnTQsd74KqASUeeuzKbWyDXMdfVW2Szg44XPbhAhoPOMXb?= =?us-ascii?q?ZrfMTR00kgCR3Kg0iNp4LrJT+V0f4Ns2eC4udmSOmhhWknqwRrrTiuwMchko?= =?us-ascii?q?bJhoMJylDE6CV225w5KsG/SE5+edKkH51QtzyAO4txWMMiTGdlszs5xL0eoZ?= =?us-ascii?q?O2fyoHxI4myhPQcfCLboyF7x35WOqPPDt1i3Roc6+liRmo60iv0Oj8W9Gx0F?= =?us-ascii?q?ZNsyVKjMHBtmsI1xzP8siHTeZ9/lu51TaPyQ/T7uZELFg3laXBL54hw7swmY?= =?us-ascii?q?QJsUTEBCP2hET2jK2Sdkk+5ueo7OPnYq74qZ+ZLYB0jBr+Pr4pmsylDuQ0Kg?= =?us-ascii?q?kOX26F9uSgzLDu/k/0TK9Lg/A5iKXVrZTXKMsBqqKnHgNY3Z4v6xOlADen1N?= =?us-ascii?q?QYk2MHLFVAeB+fk4jpOlPOIPTjAPexmVSjjilkyOvdPrL8GJnNKWLDkLj5cb?= =?us-ascii?q?Zn90Fc0BYzzcxY559MD7EOOu7zVlX0tNPCEhA4Mxe5w+niCNpn14MeXXiDDb?= =?us-ascii?q?OeMKPX4he04bcKKvWQZIIK8BP0IOlts/vnkTk8kFQMVaas1JoTLnu/G6I1DV?= =?us-ascii?q?+eZC/QZdNJOmANpQc7RerxwAmeUDxXT1ioUq8W3R19D5ipW9SQDruxiaCMiX?= =?us-ascii?q?/oVqZdYXpLXxXVSS/l?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AgAACEQfFb/9bCQFdiGwEBAQEDAQE?= =?us-ascii?q?BBwMBAQGBUQYBAQELAQGBVC5mcBIng3iIGF+LGgEBggw1AYhRdo05gXowhEk?= =?us-ascii?q?Cg1MjNAkNAQMBAQIBAQIBbBwMQgEBAQMJAoFjJAGCYQEBAQMBIzMjBQsLDgo?= =?us-ascii?q?CAgUhAgIPEhgeBhODIoFpAw0MC6cTgS+ELQGDQw2BC4EJBYELixGBf4QjglY?= =?us-ascii?q?sGQIBgWCDBIJXAp9BLgmGeocCgyAjkH2NOYEIixs4gVVNMAiDJ4YIhRSFPz4?= =?us-ascii?q?DMAGDaoFoiFoBAQ?= X-IPAS-Result: =?us-ascii?q?A2AgAACEQfFb/9bCQFdiGwEBAQEDAQEBBwMBAQGBUQYBA?= =?us-ascii?q?QELAQGBVC5mcBIng3iIGF+LGgEBggw1AYhRdo05gXowhEkCg1MjNAkNAQMBA?= =?us-ascii?q?QIBAQIBbBwMQgEBAQMJAoFjJAGCYQEBAQMBIzMjBQsLDgoCAgUhAgIPEhgeB?= =?us-ascii?q?hODIoFpAw0MC6cTgS+ELQGDQw2BC4EJBYELixGBf4QjglYsGQIBgWCDBIJXA?= =?us-ascii?q?p9BLgmGeocCgyAjkH2NOYEIixs4gVVNMAiDJ4YIhRSFPz4DMAGDaoFoiFoBA?= =?us-ascii?q?Q?= Received: from 214.194-64-87.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([87.64.194.214]) by relay.skynet.be with ESMTP; 18 Nov 2018 11:45:44 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id wAIAjedB001654; Sun, 18 Nov 2018 11:45:43 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sun, 18 Nov 2018 11:45:38 +0100 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Matthew Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <20181118114538.546a4fab@kalimero.tijl.coosemans.org> In-Reply-To: References: <201810222055.w9MKtZPt013627@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0A49876970 X-Spamd-Result: default: False [-0.03 / 15.00]; local_wl_from(0.00)[freebsd.org]; TAGGED_RCPT(0.00)[]; NEURAL_HAM_SHORT(-0.03)[-0.034,0]; ASN(0.00)[asn:5432, ipnet:195.238.0.0/19, country:BE] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:46:56 -0000 On Sat, 17 Nov 2018 14:55:05 -0800 Matthew Macy wrote: > When looking at powerpc io.h raw and relaxed are not aliases, but it > appears that on x86, they are: > https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/io.h >=20 > Sorry for the noise. But let's starting moving the x86 specific > atomic.h and io.h under asm/x86. Yes, I agree that the file should be moved to an arch specific location. And the functions should probably be implemented using inline asm like they are on Linux in case there are differences in the way compilers treat the C code versus the asm code. > On Sat, Nov 17, 2018 at 2:01 PM Matthew Macy wrote: >> You should probably revert this. The implied understanding of the >> _relaxed version is incorrect. compiler_membar is there to prevent >> instruction reordering which is possible on FreeBSD because the accesses >> are done in C. The relaxed variants still do not permit instruction >> reordering. On Linux __compiler_member (referred to as barrier there) >> isn=E2=80=99t necessary in the mmio accessors because they always use vo= latile >> asm which can=E2=80=99t be reordered. The distinction between the relaxe= d and >> non relaxed variants is that the relaxed variant lacks memory barriers >> (sync / lwsync / eieio on ppc, membar on sparc, etc). Quoting https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html: "Note that the compiler can move even volatile asm instructions relative to other code, including across jump instructions." So I think the Linux implementation of the relaxed variant lacks both CPU and compiler barriers. >> Most of the time we don=E2=80=99t run in to problems on x86 because with= TSO >> the only reordering possible is writes that happen before reads can >> become visible in memory after they occur in the instruction stream. Note that these functions are normally used on uncacheable memory which is strongly ordered on x86. There should be no reordering at all. On PowerPC barrier instructions are needed to prevent reordering. From owner-svn-src-head@freebsd.org Sun Nov 18 12:23:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C13821138501; Sun, 18 Nov 2018 12:23:04 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6311C7AE83; Sun, 18 Nov 2018 12:23:04 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F23413503; Sun, 18 Nov 2018 12:23:04 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAICN47c058519; Sun, 18 Nov 2018 12:23:04 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAICN3co058518; Sun, 18 Nov 2018 12:23:03 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811181223.wAICN3co058518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 18 Nov 2018 12:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340572 - head/usr.bin/brandelf X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/brandelf X-SVN-Commit-Revision: 340572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6311C7AE83 X-Spamd-Result: default: False [0.03 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.03)[0.033,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:23:05 -0000 Author: oshogbo Date: Sun Nov 18 12:23:03 2018 New Revision: 340572 URL: https://svnweb.freebsd.org/changeset/base/340572 Log: brandelf: capsicumize it Modified: head/usr.bin/brandelf/Makefile head/usr.bin/brandelf/brandelf.c Modified: head/usr.bin/brandelf/Makefile ============================================================================== --- head/usr.bin/brandelf/Makefile Sun Nov 18 12:09:27 2018 (r340571) +++ head/usr.bin/brandelf/Makefile Sun Nov 18 12:23:03 2018 (r340572) @@ -1,5 +1,13 @@ # $FreeBSD$ +.include + PROG= brandelf + +.if ${MK_CASPER} != "no" +LIBADD+= casper +LIBADD+= cap_fileargs +CFLAGS+= -DWITH_CASPER +.endif .include Modified: head/usr.bin/brandelf/brandelf.c ============================================================================== --- head/usr.bin/brandelf/brandelf.c Sun Nov 18 12:09:27 2018 (r340571) +++ head/usr.bin/brandelf/brandelf.c Sun Nov 18 12:23:03 2018 (r340572) @@ -33,9 +33,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include #include #include @@ -44,6 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + static int elftype(const char *); static const char *iselftype(int); static void printelftypes(void); @@ -66,8 +71,10 @@ main(int argc, char **argv) { const char *strtype = "FreeBSD"; - int ch, retval, type; + int ch, flags, retval, type; bool change, force, listed; + fileargs_t *fa; + cap_rights_t rights; type = ELFOSABI_FREEBSD; retval = 0; @@ -121,11 +128,24 @@ main(int argc, char **argv) usage(); } + flags = change || force ? O_RDWR : O_RDONLY; + cap_rights_init(&rights, CAP_READ, CAP_SEEK); + if (flags == O_RDWR) + cap_rights_set(&rights, CAP_WRITE); + + fa = fileargs_init(argc, argv, flags, 0, &rights); + if (fa == NULL) + errx(1, "unable to init casper"); + + caph_cache_catpages(); + if (caph_limit_stdio() < 0 || caph_enter_casper() < 0) + err(1, "unable to enter capability mode"); + while (argc != 0) { int fd; char buffer[EI_NIDENT]; - if ((fd = open(argv[0], change || force ? O_RDWR : O_RDONLY, 0)) < 0) { + if ((fd = fileargs_open(fa, argv[0])) < 0) { warn("error opening file %s", argv[0]); retval = 1; goto fail; @@ -167,6 +187,7 @@ fail: argv++; } + fileargs_free(fa); return (retval); } From owner-svn-src-head@freebsd.org Sun Nov 18 11:11:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 434C9113579A; Sun, 18 Nov 2018 11:11:28 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDDAC779C4; Sun, 18 Nov 2018 11:11:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0113127EB; Sun, 18 Nov 2018 11:11:27 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIBBROg020696; Sun, 18 Nov 2018 11:11:27 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIBBRaJ020695; Sun, 18 Nov 2018 11:11:27 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811181111.wAIBBRaJ020695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 18 Nov 2018 11:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340564 - head/lib/libcasper/services/cap_dns X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_dns X-SVN-Commit-Revision: 340564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DDDAC779C4 X-Spamd-Result: default: False [0.03 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.03)[0.033,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 11:11:28 -0000 Author: oshogbo Date: Sun Nov 18 11:11:27 2018 New Revision: 340564 URL: https://svnweb.freebsd.org/changeset/base/340564 Log: Update the names in the LIMITS and EXAMPLES sections after r340363. Reported by: markj Modified: head/lib/libcasper/services/cap_dns/cap_dns.3 Modified: head/lib/libcasper/services/cap_dns/cap_dns.3 ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.3 Sun Nov 18 10:57:39 2018 (r340563) +++ head/lib/libcasper/services/cap_dns/cap_dns.3 Sun Nov 18 11:11:27 2018 (r340564) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2018 +.Dd November 18, 2018 .Dt CAP_DNS 3 .Os .Sh NAME @@ -133,7 +133,7 @@ can have two values: or .Dv NAME2ADDR . The -.Dv ADDR +.Dv ADDR2NAME means that reverse DNS lookups are allowed with .Fn cap_getnameinfo and @@ -142,7 +142,7 @@ functions. In case when .Va type is set to -.Dv NAME +.Dv NAME2ADDR the name resolution is allowed with .Fn cap_getaddrinfo , .Fn cap_gethostbyname , @@ -164,7 +164,7 @@ casper service and uses it to resolve an IP address. cap_channel_t *capcas, *capdns; int familylimit, error; const char *ipstr = "127.0.0.1"; -const char *typelimit = "ADDR"; +const char *typelimit = "ADDR2NAME"; char hname[NI_MAXHOST]; struct addrinfo hints, *res; From owner-svn-src-head@freebsd.org Sun Nov 18 12:03:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53FAD11379E4; Sun, 18 Nov 2018 12:03:13 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBE8F79E6E; Sun, 18 Nov 2018 12:03:12 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC4311319C; Sun, 18 Nov 2018 12:03:12 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIC3CFx048012; Sun, 18 Nov 2018 12:03:12 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIC3Cre048011; Sun, 18 Nov 2018 12:03:12 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811181203.wAIC3Cre048011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 18 Nov 2018 12:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340567 - head/usr.bin/brandelf X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.bin/brandelf X-SVN-Commit-Revision: 340567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBE8F79E6E X-Spamd-Result: default: False [0.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.04)[0.039,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:03:13 -0000 Author: oshogbo Date: Sun Nov 18 12:03:12 2018 New Revision: 340567 URL: https://svnweb.freebsd.org/changeset/base/340567 Log: brandelf: fix style nits No functional change intended. Reviewed by: emaste, markj Differential Revision: https://reviews.freebsd.org/D17966 Modified: head/usr.bin/brandelf/brandelf.c Modified: head/usr.bin/brandelf/brandelf.c ============================================================================== --- head/usr.bin/brandelf/brandelf.c Sun Nov 18 11:55:58 2018 (r340566) +++ head/usr.bin/brandelf/brandelf.c Sun Nov 18 12:03:12 2018 (r340567) @@ -32,11 +32,13 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include + #include #include +#include #include #include #include @@ -64,16 +66,21 @@ main(int argc, char **argv) { const char *strtype = "FreeBSD"; - int type = ELFOSABI_FREEBSD; - int retval = 0; - int ch, change = 0, force = 0, listed = 0; + int ch, retval, type; + bool change, force, listed; + type = ELFOSABI_FREEBSD; + retval = 0; + change = false; + force = false; + listed = false; + while ((ch = getopt(argc, argv, "f:lt:v")) != -1) switch (ch) { case 'f': if (change) errx(1, "f option incompatible with t option"); - force = 1; + force = true; type = atoi(optarg); if (errno == ERANGE || type < 0 || type > 255) { warnx("invalid argument to option f: %s", @@ -83,7 +90,7 @@ main(int argc, char **argv) break; case 'l': printelftypes(); - listed = 1; + listed = true; break; case 'v': /* does nothing */ @@ -91,7 +98,7 @@ main(int argc, char **argv) case 't': if (force) errx(1, "t option incompatible with f option"); - change = 1; + change = true; strtype = optarg; break; default: @@ -99,7 +106,7 @@ main(int argc, char **argv) } argc -= optind; argv += optind; - if (!argc) { + if (argc == 0) { if (listed) exit(0); else { @@ -114,7 +121,7 @@ main(int argc, char **argv) usage(); } - while (argc) { + while (argc != 0) { int fd; char buffer[EI_NIDENT]; @@ -160,7 +167,7 @@ fail: argv++; } - return retval; + return (retval); } static void @@ -176,12 +183,10 @@ iselftype(int etype) { size_t elfwalk; - for (elfwalk = 0; - elfwalk < sizeof(elftypes)/sizeof(elftypes[0]); - elfwalk++) + for (elfwalk = 0; elfwalk < nitems(elftypes); elfwalk++) if (etype == elftypes[elfwalk].value) - return elftypes[elfwalk].str; - return 0; + return (elftypes[elfwalk].str); + return (0); } static int @@ -189,12 +194,10 @@ elftype(const char *elfstrtype) { size_t elfwalk; - for (elfwalk = 0; - elfwalk < sizeof(elftypes)/sizeof(elftypes[0]); - elfwalk++) + for (elfwalk = 0; elfwalk < nitems(elftypes); elfwalk++) if (strcasecmp(elfstrtype, elftypes[elfwalk].str) == 0) - return elftypes[elfwalk].value; - return -1; + return (elftypes[elfwalk].value); + return (-1); } static void @@ -203,10 +206,8 @@ printelftypes(void) size_t elfwalk; fprintf(stderr, "known ELF types are: "); - for (elfwalk = 0; - elfwalk < sizeof(elftypes)/sizeof(elftypes[0]); - elfwalk++) - fprintf(stderr, "%s(%u) ", elftypes[elfwalk].str, - elftypes[elfwalk].value); + for (elfwalk = 0; elfwalk < nitems(elftypes); elfwalk++) + fprintf(stderr, "%s(%u) ", elftypes[elfwalk].str, + elftypes[elfwalk].value); fprintf(stderr, "\n"); } From owner-svn-src-head@freebsd.org Sun Nov 18 12:25:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCC501138651; Sun, 18 Nov 2018 12:25:13 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1902F7B04F; Sun, 18 Nov 2018 12:25:13 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-pl1-f181.google.com with SMTP id t13so10286093ply.13; Sun, 18 Nov 2018 04:25:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=zm67hAfiltA3xmqiIx+t0QwQPvS4140QtBBlrORR9Ls=; b=amJKMjNHRibX+YgJB0ufatGZsr57HaAEr4chHWmG2Clgx2jt3+Swi9y4Vcxvu8sPLx Np25/cZTqtFW3eN2hmR2Whi8Z8uFt7KSd5n3MWjk2Apl6Cb62dSEVkQSrFXdGQjNm9A4 HKTiEUbwKmhDfadrG6iH2oq0YxGjmyIHqtdgMf7NfGHzqnkOzPbkseDwFRSqiv5g5siM 0Qyy4eq1GqYbA/YN+ReG2nDWVwnQPlqoULb+2fnqoniAJhKSx7gkkUaJBeD2k0c89/Uf 0bjkQx3QlP0hGOKrgOEUjWMZ4xO5CEuccnI1WGdDtXqK2CIADeNPVjRwFBt+QlpIdZ1s cbIQ== X-Gm-Message-State: AGRZ1gJRrelojc0smz2QZg0RAEBvws5qJSgHtBK15rSv5VV7TeJE8kMW u57L35avgsBRY+Aq6NlJ0QlJr4fsjC5CvMDKE0ga6X9Y X-Google-Smtp-Source: AJdET5cEQcg7+deqHqfSyjJZE8t+5aOP1KlvqEQvBxCNtqAdkRRhnQEr/p+YBNpDiMUJnKxaBB/J37nZ76r8eeJtmZM= X-Received: by 2002:a17:902:bb0a:: with SMTP id l10-v6mr18631463pls.230.1542543905845; Sun, 18 Nov 2018 04:25:05 -0800 (PST) MIME-Version: 1.0 References: <201811181223.wAICN3co058518@repo.freebsd.org> In-Reply-To: <201811181223.wAICN3co058518@repo.freebsd.org> From: Mariusz Zaborski Date: Sun, 18 Nov 2018 13:25:02 +0100 Message-ID: Subject: Re: svn commit: r340572 - head/usr.bin/brandelf To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1902F7B04F X-Spamd-Result: default: False [-1.91 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[181.214.85.209.rep.mailspike.net : 127.0.0.18]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.84)[-0.836,0]; RCVD_IN_DNSWL_NONE(0.00)[181.214.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.06)[ipnet: 209.85.128.0/17(-3.47), asn: 15169(-1.74), country: US(-0.09)]; FORGED_SENDER(0.30)[oshogbo@freebsd.org,oshogbovx@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[oshogbo@freebsd.org,oshogbovx@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:25:14 -0000 Reviewed by: emaste, markj, allanjude Differential Revision: https://reviews.freebsd.org/D17967 On Sun, 18 Nov 2018 at 13:23, Mariusz Zaborski wrote: > > Author: oshogbo > Date: Sun Nov 18 12:23:03 2018 > New Revision: 340572 > URL: https://svnweb.freebsd.org/changeset/base/340572 > > Log: > brandelf: capsicumize it > > Modified: > head/usr.bin/brandelf/Makefile > head/usr.bin/brandelf/brandelf.c > > Modified: head/usr.bin/brandelf/Makefile > ============================================================================== > --- head/usr.bin/brandelf/Makefile Sun Nov 18 12:09:27 2018 (r340571) > +++ head/usr.bin/brandelf/Makefile Sun Nov 18 12:23:03 2018 (r340572) > @@ -1,5 +1,13 @@ > # $FreeBSD$ > > +.include > + > PROG= brandelf > + > +.if ${MK_CASPER} != "no" > +LIBADD+= casper > +LIBADD+= cap_fileargs > +CFLAGS+= -DWITH_CASPER > +.endif > > .include > > Modified: head/usr.bin/brandelf/brandelf.c > ============================================================================== > --- head/usr.bin/brandelf/brandelf.c Sun Nov 18 12:09:27 2018 (r340571) > +++ head/usr.bin/brandelf/brandelf.c Sun Nov 18 12:23:03 2018 (r340572) > @@ -33,9 +33,11 @@ > __FBSDID("$FreeBSD$"); > > #include > +#include > #include > #include > > +#include > #include > #include > #include > @@ -44,6 +46,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > +#include > + > static int elftype(const char *); > static const char *iselftype(int); > static void printelftypes(void); > @@ -66,8 +71,10 @@ main(int argc, char **argv) > { > > const char *strtype = "FreeBSD"; > - int ch, retval, type; > + int ch, flags, retval, type; > bool change, force, listed; > + fileargs_t *fa; > + cap_rights_t rights; > > type = ELFOSABI_FREEBSD; > retval = 0; > @@ -121,11 +128,24 @@ main(int argc, char **argv) > usage(); > } > > + flags = change || force ? O_RDWR : O_RDONLY; > + cap_rights_init(&rights, CAP_READ, CAP_SEEK); > + if (flags == O_RDWR) > + cap_rights_set(&rights, CAP_WRITE); > + > + fa = fileargs_init(argc, argv, flags, 0, &rights); > + if (fa == NULL) > + errx(1, "unable to init casper"); > + > + caph_cache_catpages(); > + if (caph_limit_stdio() < 0 || caph_enter_casper() < 0) > + err(1, "unable to enter capability mode"); > + > while (argc != 0) { > int fd; > char buffer[EI_NIDENT]; > > - if ((fd = open(argv[0], change || force ? O_RDWR : O_RDONLY, 0)) < 0) { > + if ((fd = fileargs_open(fa, argv[0])) < 0) { > warn("error opening file %s", argv[0]); > retval = 1; > goto fail; > @@ -167,6 +187,7 @@ fail: > argv++; > } > > + fileargs_free(fa); > return (retval); > } > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sun Nov 18 19:55:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17F5D110D534; Sun, 18 Nov 2018 19:55:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF7106D166; Sun, 18 Nov 2018 19:55:03 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E15017E23; Sun, 18 Nov 2018 19:55:03 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIJt3Sh091774; Sun, 18 Nov 2018 19:55:03 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIJt3ib091773; Sun, 18 Nov 2018 19:55:03 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201811181955.wAIJt3ib091773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Sun, 18 Nov 2018 19:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340587 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 340587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF7106D166 X-Spamd-Result: default: False [0.19 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.05)[0.047,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 19:55:04 -0000 Author: arichardson Date: Sun Nov 18 19:55:03 2018 New Revision: 340587 URL: https://svnweb.freebsd.org/changeset/base/340587 Log: Fix -DNO_CLEAN amd64 build after r340463 Without this change I got the following error: clang-7: error: no such file or directory: '..../lib/libc/amd64/string/bzero.S' Reviewed By: mjg Differential Revision: https://reviews.freebsd.org/D18031 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Nov 18 14:58:01 2018 (r340586) +++ head/Makefile.inc1 Sun Nov 18 19:55:03 2018 (r340587) @@ -962,6 +962,13 @@ _cleanobj_fast_depend_hack: .PHONY ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ fi .endfor +# 20181115 r340463 bzero reimplemented as .c + @if [ -e "${OBJTOP}/lib/libc/.depend.bzero.o" ] && \ + egrep -qw 'bzero\.[sS]' ${OBJTOP}/lib/libc/.depend.bzero.o; then \ + echo "Removing stale dependencies for bzero"; \ + rm -f ${OBJTOP}/lib/libc/.depend.bzero.* \ + ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.bzero.*}; \ + fi # 20181009 track migration from ntp's embedded libevent to updated one @if [ -e "${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.bufferevent_openssl.o" ] && \ egrep -q 'contrib/ntp/sntp/libevent/bufferevent_openssl.c' \ From owner-svn-src-head@freebsd.org Sun Nov 18 19:56:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 686F8110D954; Sun, 18 Nov 2018 19:56:26 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE2556D411; Sun, 18 Nov 2018 19:56:25 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id B640E1DCC9; Sun, 18 Nov 2018 19:56:19 +0000 (UTC) To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811151602.wAFG2E4w040161@repo.freebsd.org> From: Allan Jude Openpgp: preference=signencrypt Autocrypt: addr=allanjude@freebsd.org; prefer-encrypt=mutual; keydata= xsFNBFVwZcYBEADwrZDH0xe0ZVjc9ORCc6PcBLwS/RTXA6NkvpD6ea02pZ8lPOVgteuuugFc D34LdDbiWr+479vfrKBh+Y38GL0oZ0/13j10tIlDMHSa5BU0y6ACtnhupFvVlQ57+XaJAb/q 7qkfSiuxVwQ3FY3PL3cl1RrIP5eGHLA9hu4eVbu+FOX/q/XVKz49HaeIaxzo2Q54572VzIo6 C28McX9m65UL5fXMUGJDDLCItLmehZlHsQQ+uBxvODLFpVV2lUgDR/0rDa0B9zHZX8jY8qQ7 ZdCSy7CwClXI054CkXZCaBzgxYh/CotdI8ezmaw7NLs5vWNTxaDEFXaFMQtMVhvqQBpHkfOD 7rjjOmFw00nJL4FuPE5Yut0CPyx8vLjVmNJSt/Y8WxxmhutsqJYFgYfWl/vaWkrFLur/Zcmz IklwLw35HLsCZytCN5A3rGKdRbQjD6QPXOTJu0JPrJF6t2xFkWAT7oxnSV0ELhl2g+JfMMz2 Z1PDmS3NRnyEdqEm7NoRGXJJ7bgxDbN+9SXTyOletqGNXj/bSrBvhvZ0RQrzdHAPwQUfVSU2 qBhQEi2apSZstgVNMan0GUPqCdbE2zpysg+zT7Yhvf9EUQbzPL4LpdK1llT9fZbrdMzEXvEF oSvwJFdV3sqKmZc7b+E3PuxK6GTsKqaukd/3Cj8aLHG1T1im1QARAQABzSJBbGxhbiBKdWRl IDxhbGxhbmp1ZGVAZnJlZWJzZC5vcmc+wsF/BBMBAgApBQJVcGXGAhsjBQkSzAMABwsJCAcD AgEGFQgCCQoLBBYCAwECHgECF4AACgkQGZU1PhKYC34Muw/+JOKpSfhhysWFYiRXynGRDe07 Z6pVsn7DzrPUMRNZfHu8Uujmmy3p2nx9FelIY9yjd2UKHhug+whM54MiIFs90eCRVa4XEsPR 4FFAm0DAWrrb7qhZFcE/GhHdRWpZ341WAElWf6Puj2devtRjfYbikvj5+1V1QmDbju7cEw5D mEET44pTuD2VMRJpu2yZZzkM0i+wKFuPxlhqreufA1VNkZXI/rIfkYWK+nkXd9Efw3YdCyCQ zUgTUCb88ttSqcyhik/li1CDbXBpkzDCKI6I/8fAb7jjOC9LAtrZJrdgONywcVFoyK9ZN7EN AVA+xvYCmuYhR/3zHWH1g4hAm1v1+gIsufhajhfo8/wY1SetlzPaYkSkVQLqD8T6zZyhf+AN bC7ci44UsiKGAplB3phAXrtSPUEqM86kbnHg3fSx37kWKUiYNOnx4AC2VXvEiKsOBlpyt3dw WQbOtOYM+vkfbBwDtoGOOPYAKxc4LOIt9r+J8aD+gTooi9Eo5tvphATf9WkCpl9+aaGbSixB tUpvQMRnSMqTqq4Z7DeiG6VMRQIjsXDSLJEUqcfhnLFo0Ko/RiaHd5xyAQ4DhQ9QpkyQjjNf /3f/dYG7JAtoD30txaQ5V8uHrz210/77DRRX+HJjEj6xCxWUGvQgvEZf5XXyxeePvqZ+zQyT DX61bYw6w6bOwU0EVXBlxgEQAMy7YVnCCLN4oAOBVLZ5nUbVPvpUhsdA94/0/P+uqCIh28Cz ar56OCX0X19N/nAWecxL4H32zFbIRyDB2V/MEh4p9Qvyu/j4i1r3Ex5GhOT2hnit43Ng46z5 29Es4TijrHJP4/l/rB2VOqMKBS7Cq8zk1cWqaI9XZ59imxDNjtLLPPM+zQ1yE3OAMb475QwN UgWxTMw8rkA7CEaqeIn4sqpTSD5C7kT1Bh26+rbgJDZ77D6Uv1LaCZZOaW52okW3bFbdozV8 yM2u+xz2Qs8bHz67p+s+BlygryiOyYytpkiK6Iy4N7FTolyj5EIwCuqzfk0SaRHeOKX2ZRjC qatkgoD/t13PNT38V9tw3qZVOJDS0W6WM8VSg+F+bkM9LgJ8CmKV+Hj0k3pfGfYPOZJ/v18i +SmZmL/Uw2RghnwDWGAsPCKu4uZR777iw7n9Io6Vfxndw2dcS0e9klvFYoaGS6H2F13Asygr WBzFNGFQscN4mUW+ZYBzpTOcHkdT7w8WS55BmXYLna+dYer9/HaAuUrONjujukN4SPS1fMJ2 /CS/idAUKyyVVX5vozoNK2JVC1h1zUAVsdnmhEzNPsvBoqcVNfyqBFROEVLIPwq+lQMGNVjH ekLTKRWf59MEhUC2ztjSKkGmwdg73d6xSXMuq45EgIJV2wPvOgWQonoHH/kxABEBAAHCwWUE GAECAA8FAlVwZcYCGwwFCRLMAwAACgkQGZU1PhKYC34w5A//YViBtZyDV5O+SJT9FFO3lb9x Zdxf0trA3ooCt7gdBkdnBM6T5EmjgVZ3KYYyFfwXZVkteuCCycMF/zVw5eE9FL1+zz9gg663 nY9q2F77TZTKXVWOLlOV2bY+xaK94U4ytogOGhh9b4UnQ/Ct3+6aviCF78Go608BXbmF/GVT 7uhddemk7ItxM1gE5Hscx3saxGKlayaOsdPKeGTVJCDEtHDuOc7/+jGh5Zxpk/Hpi+DUt1ot 8e6hPYLIQa4uVx4f1xxxV858PQ7QysSLr9pTV7FAQ18JclCaMc7JWIa3homZQL/MNKOfST0S 2e+msuRwQo7AnnfFKBUtb02KwpA4GhWryhkjUh/kbVc1wmGxaU3DgXYQ5GV5+Zf4kk/wqr/7 KG0dkTz6NLCVLyDlmAzuFhf66DJ3zzz4yIo3pbDYi3HB/BwJXVSKB3Ko0oUo+6/qMrOIS02L s++QE/z7K12CCcs7WwOjfCYHK7VtE0Sr/PfybBdTbuDncOuAyAIeIKxdI2nmQHzl035hhvQX s4CSghsP319jAOQiIolCeSbTMD4QWMK8RL/Pe1FI1jC3Nw9s+jq8Dudtbcj2UwAP/STUEbJ9 5rznzuuhPjE0e++EU/RpWmcaIMK/z1zZDMN+ce2v1qzgV936ZhJ3iaVzyqbEE81gDxg3P+IM kiYh4ZtPB4Q= Subject: Re: svn commit: r340450 - head/sys/sys Message-ID: <595ff2c5-64ea-509d-481e-635499ab173d@freebsd.org> Date: Sun, 18 Nov 2018 14:56:13 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <201811151602.wAFG2E4w040161@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9ArUz8p4sPUVZlrBUe4qfoizrtxJ54BmJ" X-Rspamd-Queue-Id: CE2556D411 X-Spamd-Result: default: False [-0.13 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.23)[-0.233,0]; NEURAL_SPAM_SHORT(0.11)[0.107,0]; ASN(0.00)[asn:6939, ipnet:209.51.160.0/19, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 19:56:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9ArUz8p4sPUVZlrBUe4qfoizrtxJ54BmJ Content-Type: multipart/mixed; boundary="hFooTVtU2E9Nogpig7yGvGeTI8dkfAzAG"; protected-headers="v1" From: Allan Jude To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <595ff2c5-64ea-509d-481e-635499ab173d@freebsd.org> Subject: Re: svn commit: r340450 - head/sys/sys References: <201811151602.wAFG2E4w040161@repo.freebsd.org> In-Reply-To: <201811151602.wAFG2E4w040161@repo.freebsd.org> --hFooTVtU2E9Nogpig7yGvGeTI8dkfAzAG Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-11-15 11:02, Warner Losh wrote: > Author: imp > Date: Thu Nov 15 16:02:13 2018 > New Revision: 340450 > URL: https://svnweb.freebsd.org/changeset/base/340450 >=20 > Log: > When converting ns,us,ms to sbt, return the ceil() of the result > rather than the floor(). Returning the floor means that > sbttoX(Xtosbt(y)) !=3D y for almost all values of y. In practice, th= is > results in a difference of at most 1 in the lsb of the sbintime_t. > This difference is meaningless for all current users of these > functions, but is important for the newly introduced sysctl conversio= n > routines which implicitly rely on the transformation being idempotent= =2E > =20 > Sponsored by: Netflix, Inc >=20 This seems to break attaching for my mlxen(4), with or without r340451 I don't understand why at this point. Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core0: mem 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 numa-domain 1 on pci11 Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: command 0x4 timed out (go bit not cleared) Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device is going to be rese= t Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device was reset successfu= lly Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: QUERY_FW command failed, aborting Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: Failed to init fw, abortin= g. Nov 18 19:29:13 CA-HML3-09 kernel: device_attach: mlx4_core0 attach returned 5 It works fine under r340449: Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: mem 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 numa-domain 1 on pci11 Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Mellanox ConnectX core driver v3.4.1 (October 2017) Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: Unable to determine PCI device chain minimum BW Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en mlx4_core0: Activating port:1 Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: Ethernet address: 00:02:c9:4d:6a:e8 Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 32 TX rings Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to DOWN Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 16 RX rings Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 32 TX rings Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 16 RX rings Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Initializing port Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Link Down Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to UP > Modified: > head/sys/sys/time.h >=20 > Modified: head/sys/sys/time.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/time.h Thu Nov 15 08:43:17 2018 (r340449) > +++ head/sys/sys/time.h Thu Nov 15 16:02:13 2018 (r340450) > @@ -161,6 +161,10 @@ sbttobt(sbintime_t _sbt) > * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS resu= lts in > * large roundoff errors which sbttons() and nstosbt() avoid. Millise= cond and > * microsecond functions are also provided for completeness. > + * > + * These functions return the smallest sbt larger or equal to the numb= er of > + * seconds requested so that sbttoX(Xtosbt(y)) =3D=3D y. The 1 << 32 -= 1 term added > + * transforms the >> 32 from floor() to ceil(). > */ > static __inline int64_t > sbttons(sbintime_t _sbt) > @@ -173,7 +177,7 @@ static __inline sbintime_t > nstosbt(int64_t _ns) > { > =20 > - return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); > + return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - 1) = >> 32); > } > =20 > static __inline int64_t > @@ -187,7 +191,7 @@ static __inline sbintime_t > ustosbt(int64_t _us) > { > =20 > - return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); > + return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) >> = 32); > } > =20 > static __inline int64_t > @@ -201,7 +205,7 @@ static __inline sbintime_t > mstosbt(int64_t _ms) > { > =20 > - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); > + return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> 32)= ; > } > =20 > /*- >=20 --=20 Allan Jude --hFooTVtU2E9Nogpig7yGvGeTI8dkfAzAG-- --9ArUz8p4sPUVZlrBUe4qfoizrtxJ54BmJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJb8cPiAAoJEBmVNT4SmAt+q7MQAIXh2bOocq8BWdYJHzRpPTwq gnhVO2nznkZecoq5BDDMDqkRPsH8X+AiCGvU79aX7TzwjwmTWpgJosP7fgH+gSaK X3S2BfFjjvqT5wpE1bS4QfV4pvyWU2xVZKMwodYdXorxKpDTN/JNtVXMxwVSus0J 2fTVzOAy1o25cxu7v9WOuydZ9hQ79LkkGKMLmSrCSQlNKgKvrxoi/+UmrTv6COBr xrkb8S3Q/yLSTVwdhFJVDq62yHb/N5bTaZ0PrHhLJHuiRXGEfVjS+NbXTO4XEGuu yUQrOmbf/OBcXVUSRe10KjgAwzDHNwrPThwX+JPRxwloCQelf2hhuuCRSJtDexZN rjbSMkCtbVa0FFLRfwmlHgmeXrTXusalXDI+ZxW+PrsB6MajJgYRkW+pEtbFqhR6 yjSmVFHDrcqRMg1RhL6v1KTTyF5fQy3RKl0Kx5QszfQShe4QvesAlmNAYcN7+TOp 2A7Y3HM4h2HKh6cNATtWFnnBfgahBb9wywg/Jc+uva1uERM+TB76gK+vuM297qPn w3N8Layfy9G4vnLK8Q6tNV2gyqzXxCmx5VlGAmQ39H0L++z1IdJptXf7j4GV1GFh /6+6/w8y4lPdb0ekR3buQGAy8LHqR/xst3km+oD4ejbKeXjH9YO8AHXBDbpDWxk5 U8oGL7G83dzV4kovhTXF =NYD6 -----END PGP SIGNATURE----- --9ArUz8p4sPUVZlrBUe4qfoizrtxJ54BmJ-- From owner-svn-src-head@freebsd.org Sun Nov 18 20:10:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 306A2110F060; Sun, 18 Nov 2018 20:10:39 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BF466DE9C; Sun, 18 Nov 2018 20:10:38 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-io1-xd35.google.com with SMTP id m19so15117130ioh.3; Sun, 18 Nov 2018 12:10:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p/r+aLHpMxaDAX9cDT4ecBZX66MXZFcRNCPWuTKPtTs=; b=Tvmp64NcMBzJPJIgu1U+CE/6bvvrc4+bEwY5rqky0hFfpVbqY8AFi+/R4qtu6kICsp IPF2pFWCq3gXQpCGm9CXol7+ltzdWOc2qAfilc+KLbPzgg9rgKfTuP9/x5UY0iEjueT4 bOyLyr/sEIEY0cZjFvSgenwTqewFfNc9Vx/dIGKi91kXFXe7uNUb0yBUMbKePdfGunt7 pbGtYbaNYouyjIvqQRe40Ic7Z7xgTPB4llZCgTLU9aAaZ+pEl7ATLkE0sd/Z3/9nY6bt FhKP5/fJibV5zTUcpQ5SCZOwPIFA1QNf2iLAMUWG2+QPhxJKy2mfmi75B70MTTBFfmV8 ZMqA== 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=p/r+aLHpMxaDAX9cDT4ecBZX66MXZFcRNCPWuTKPtTs=; b=W9glt2Szb+otueKrO+zcUoXUwztieqhNbrCqN3bZmXUbFCW/xjTYViGfsQge89fdQk XJ/K4Jeoeebl+TrL8qO2ofkdVFpCIVTm4GMkEBp6d72sbJBdcFgSgwnCM1/+P5FyzXZd QoF6oaYwg63zex4cKWACHRRY6aAFgaS+e58JRzEgrT1HqnLr/Zk2a1erGeAeoPrmLcUO 1jEwPaShIMz5btYvVd7jb+1GiJqcLD/QRuPrEtvRUyHjp7f4EBRmz0R0Z2dzZ22dCkgh hUYGeJHHP7SK/jce+pc1ETKnqZPOSLCe2+0G3rpcsNe+Z68JWiKOLGPIm9BoMVFRGl5U DbdA== X-Gm-Message-State: AGRZ1gJ25WbQBjz2h5UmMKClOazWK3yaoxRMBzDOV2GuGhCILi9amdQD 0Nb9nNnE6eQienoQeETEpd1beSmnBCAvUA6M2G2+BMEu X-Google-Smtp-Source: AJdET5e/tZHEetNKIoi220ndM8vE+gsfbnqiwPRbYmrFGQd5D7pe1z//Rbs2bEoEoTTL7lCnE4u50wvfUxQgO2IO8xg= X-Received: by 2002:a6b:8f8d:: with SMTP id r135mr15645182iod.5.1542571836984; Sun, 18 Nov 2018 12:10:36 -0800 (PST) MIME-Version: 1.0 References: <201810222055.w9MKtZPt013627@repo.freebsd.org> <20181118114538.546a4fab@kalimero.tijl.coosemans.org> In-Reply-To: <20181118114538.546a4fab@kalimero.tijl.coosemans.org> From: Matthew Macy Date: Sun, 18 Nov 2018 12:10:25 -0800 Message-ID: Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux To: Tijl Coosemans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 5BF466DE9C X-Spamd-Result: default: False [-3.85 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.88)[ipnet: 2607:f8b0::/32(-2.56), asn: 15169(-1.73), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[5.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 20:10:39 -0000 > Note that these functions are normally used on uncacheable memory which > is strongly ordered on x86. There should be no reordering at all. On > PowerPC barrier instructions are needed to prevent reordering. Correct. The current lkpi implementation also assumes that device endian == host endian. The Linux generic accessors will do use endian macros to byte swap where necessary. The following change fixes radeon attach issues: https://github.com/POWER9BSD/freebsd/commit/be6c98f5c2e2ed9a4935ac5b67c468b75f3b4457 From owner-svn-src-head@freebsd.org Sun Nov 18 21:09:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCA9B1122B05; Sun, 18 Nov 2018 21:09:55 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay115.isp.belgacom.be (mailrelay115.isp.belgacom.be [195.238.20.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA5B71087; Sun, 18 Nov 2018 21:09:54 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AkAG+MBWcc3B02DK0w7Ecx/1I4KfV8LGtZVwlr6?= =?us-ascii?q?E/grcLSJyIuqrYYx2At8tkgFKBZ4jH8fUM07OQ7/iwHzRYqb+681k6OKRWUB?= =?us-ascii?q?EEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAA?= =?us-ascii?q?jwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba9xIRmssQndqtQdjJd/JKo21h?= =?us-ascii?q?bHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2?= =?us-ascii?q?Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VD?= =?us-ascii?q?K/5KpwVhTmlDkIOCI48GHPi8x/kqRboA66pxdix4LYeZyZOOZicq/Ye94RWG?= =?us-ascii?q?hPUdtLVyFZDI2yb5UBAfcCM+laoYnyqEcBoxSlCAmwBu7j1iNEimPq0aEk1e?= =?us-ascii?q?kqDAHI3BYnH9ILqHnastD3NKMPWu2ry6nIyi7DYO1T2Tjn7ojIaQ0qrPaQXb?= =?us-ascii?q?Jxc8rRzVIiGQPfjlqOt4PoIi6b2OoXv2ic9epgWvuihmg6oA9/pTivw90jio?= =?us-ascii?q?jPho8NxVDE9Dl5wIYoJdKjUkJ0fdmkEJ5WuiqHNIV2WtsvTmJqtSogy7ALto?= =?us-ascii?q?S3cDUOxZko3RLTdeGLfoeO7xn+TuieOy14i2hgeL+nghay9lWvxfPkW8mv1V?= =?us-ascii?q?ZKsjJFkt7RtnARzxDT6taISv96/kq52jaAzQTT6uBBIU8qj6rbLIQtwqIxlp?= =?us-ascii?q?oRtUTPBDP5mELxjK+NaEok//Kn6+L8Yrn8oZ+cLYB0hhn/MqQohMO/Hfw1Pw?= =?us-ascii?q?sMUmSB+Omx26fv8VD9TbhFlPE6jLTVvZ/CKcQevKG5AgtV0og56xa4CjeryM?= =?us-ascii?q?gYnXgFLFJBYx+HgZLpNE/QL//jFvewnk6gkDBxx/DJJrHhGInCLmDfkLf9er?= =?us-ascii?q?Zw80tcxxAvzdxF4pJbEK0OIfLoV0/+sdzXFB45Mwiuz+n7D9V909BWZWXaJ6?= =?us-ascii?q?aFLKPfrhet7+k+a72JbZNTvT/2OtAq4vfviTkynlpLLoez2p5CVJe8Vt9hJF?= =?us-ascii?q?6UZHPqmZ9VDWYIuiIQVuHnomauFzlJaCDhDOoH+jgnBdf+Xs/4TYe3jenEhX?= =?us-ascii?q?/jEw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AMAAD20/Fb/9bCQFdiGQEBAQEBAQE?= =?us-ascii?q?BAQEBAQcBAQEBAQGBUwIBAQEBAQsBAYICZoECJ4xvixsBAYIMNQGIUXaNOYF?= =?us-ascii?q?6MoQBRgKDUyM2Bw0BAwEBAgEBAgFsHAxCAQ4BgWQkAYJhAQEBAQIBOhwjBQs?= =?us-ascii?q?LDgoJJQ8SGB4GE4MigWkDDQwLp2SELQGDRQ2BC4EJBYwcgX+EI4JWRQKHPAK?= =?us-ascii?q?PUo9vLgmGeocCgyAjgViIK4Z6jTmBCIsiCyaBVU0wCIMngicXg0qKUz4DMAq?= =?us-ascii?q?DRYocAQE?= X-IPAS-Result: =?us-ascii?q?A2AMAAD20/Fb/9bCQFdiGQEBAQEBAQEBAQEBAQcBAQEBA?= =?us-ascii?q?QGBUwIBAQEBAQsBAYICZoECJ4xvixsBAYIMNQGIUXaNOYF6MoQBRgKDUyM2B?= =?us-ascii?q?w0BAwEBAgEBAgFsHAxCAQ4BgWQkAYJhAQEBAQIBOhwjBQsLDgoJJQ8SGB4GE?= =?us-ascii?q?4MigWkDDQwLp2SELQGDRQ2BC4EJBYwcgX+EI4JWRQKHPAKPUo9vLgmGeocCg?= =?us-ascii?q?yAjgViIK4Z6jTmBCIsiCyaBVU0wCIMngicXg0qKUz4DMAqDRYocAQE?= Received: from 214.194-64-87.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([87.64.194.214]) by relay.skynet.be with ESMTP; 18 Nov 2018 22:08:44 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id wAIL8hgV002342; Sun, 18 Nov 2018 22:08:43 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sun, 18 Nov 2018 22:08:42 +0100 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Matthew Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <20181118220842.4c995b5a@kalimero.tijl.coosemans.org> In-Reply-To: References: <201810222055.w9MKtZPt013627@repo.freebsd.org> <20181118114538.546a4fab@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0DA5B71087 X-Spamd-Result: default: False [-0.24 / 15.00]; TAGGED_RCPT(0.00)[]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_SHORT(-0.21)[-0.205,0]; NEURAL_HAM_MEDIUM(-0.03)[-0.033,0]; ASN(0.00)[asn:5432, ipnet:195.238.0.0/19, country:BE] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 21:09:56 -0000 On Sun, 18 Nov 2018 12:10:25 -0800 Matthew Macy wrote: >> Note that these functions are normally used on uncacheable memory which >> is strongly ordered on x86. There should be no reordering at all. On >> PowerPC barrier instructions are needed to prevent reordering. > > Correct. The current lkpi implementation also assumes that device > endian == host endian. The Linux generic accessors will do use endian > macros to byte swap where necessary. Yes, these functions are used to access little-endian registers so byte swapping is needed on big-endian machines. For PowerPC Linux also defines functions to access big-endian registers, but we probably don't need those. > The following change fixes radeon attach issues: > https://github.com/POWER9BSD/freebsd/commit/be6c98f5c2e2ed9a4935ac5b67c468b75f3b4457 +/* prevent prefetching of coherent DMA data ahead of a dma-complete */ +#ifndef __io_ar +#ifdef rmb +#define __io_ar() rmb() +#else +#define __io_ar() __compiler_membar(); +#endif +#endif + +/* flush writes to coherent DMA data before possibly triggering a DMA read */ +#ifndef __io_bw +#ifdef wmb +#define __io_bw() wmb() +#else +#define __io_bw() __compiler_membar(); +#endif +#endif ... static inline uint16_t readw(const volatile void *addr) { uint16_t v; - __compiler_membar(); - v = *(const volatile uint16_t *)addr; - __compiler_membar(); + __io_br(); + v = le16toh(__raw_readw(addr)); + __io_ar(); return (v); } For x86 rmb and wmb are defined as lfence and sfence instructions which shouldn't be necessary here. From owner-svn-src-head@freebsd.org Sun Nov 18 22:16:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66C251126243; Sun, 18 Nov 2018 22:16:08 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-it1-x144.google.com (mail-it1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACD1F73C59; Sun, 18 Nov 2018 22:16:07 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-it1-x144.google.com with SMTP id x124so5832233itd.1; Sun, 18 Nov 2018 14:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QoAKkEiCKm0EyvXUUGf9QoED9EeLIeyx9izfQ6rDkAE=; b=OHxU2odQaKive24Eb2B5jq7tSyEHyERgX6+JioQMGTPjyiHPYwSe46Yi29SdFgV4z8 WTvCYpMW4jnB1X3wScmHrQtYU6U8Wvmy3GOTjWuqFzb0xoFhYYCYeqwd4hJTXnx77u6v 17IqT5/+lcBV6ciZe9gKUycBYsqdNRbtgWpvZwYQMkzbrvFBLuYpr0K5ITTVzEkWwPRm mGAH5BHfynDMwrmB0cF7o9Q1PFD19z/8XQLEJO1QoF8ijXtNDkGhaQUpzYHV1iPEKyL1 amwT/NergljX3yrf4vdYG6MTJlZDTqWQBW3aTryuKYQ8QIWZV85d059eqaNucqFX2a2z IhhA== 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=QoAKkEiCKm0EyvXUUGf9QoED9EeLIeyx9izfQ6rDkAE=; b=VXAzZ/5fyRoEKhVVNvGZmN211vxv9QU+Qhtpi5ujEJ3seZsfS2/lBiEYa/gjoIBjlt TwHkn8h5aE6/FdW/lpUsMGgb+p876pVm9oDIzLGa+She45ctLZi1zKiNI7NFVrWjhkWW GuoxtilqUGXWBDwtgBmT7Yl2h5J7JQHo4NadPdZYQXjvUC1nCKP42r5G3ABUkVP9V8sN swzHZpypxS8QMNSxr7od72fV2qNCuv9dOr9X/C2M9kAIp9ojCQNc0Sp1n1Ec2YrrAnwM vGl7aHNzAaloj+MDfHbZLGEqvHJ+xTcT1UiPXw3KY0/Lhta54kdBn5FFm9Lu32Erlkxs OVzQ== X-Gm-Message-State: AA+aEWbO2+gijXa3H3D0YHVoN/BF/8KtWH/x6dFVMXC/f27jeH8hvFEs MFmlNJxuX7TOeILBaUA0XLSzcBlRXTWef7PSWvoh1w== X-Google-Smtp-Source: AFSGD/VxyclcOWFmDpcokJioL5Afk8oPpug37yWSHdyK71iwUHtf38+WzpLKd4ON7dNmMqLKCH+oLALRVwSmfihzDOo= X-Received: by 2002:a24:9005:: with SMTP id x5mr5949774itd.102.1542579366919; Sun, 18 Nov 2018 14:16:06 -0800 (PST) MIME-Version: 1.0 References: <201810222055.w9MKtZPt013627@repo.freebsd.org> <20181118114538.546a4fab@kalimero.tijl.coosemans.org> <20181118220842.4c995b5a@kalimero.tijl.coosemans.org> In-Reply-To: <20181118220842.4c995b5a@kalimero.tijl.coosemans.org> From: Matthew Macy Date: Sun, 18 Nov 2018 14:15:56 -0800 Message-ID: Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux To: =?UTF-8?Q?T=C4=B3l_Coosemans?= Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: ACD1F73C59 X-Spamd-Result: default: False [-3.26 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.980,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.47)[ip: (2.05), ipnet: 2607:f8b0::/32(-2.56), asn: 15169(-1.73), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.81)[-0.806,0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 22:16:08 -0000 Correct. This is just the generic case. We just need to define the __io macros as __compiler_membar in x86/io.h Cheers. -M On Sun, Nov 18, 2018 at 13:08 T=C4=B3l Coosemans wrote: > On Sun, 18 Nov 2018 12:10:25 -0800 Matthew Macy > wrote: > >> Note that these functions are normally used on uncacheable memory whic= h > >> is strongly ordered on x86. There should be no reordering at all. On > >> PowerPC barrier instructions are needed to prevent reordering. > > > > Correct. The current lkpi implementation also assumes that device > > endian =3D=3D host endian. The Linux generic accessors will do use endi= an > > macros to byte swap where necessary. > > Yes, these functions are used to access little-endian registers so byte > swapping is needed on big-endian machines. For PowerPC Linux also define= s > functions to access big-endian registers, but we probably don't need thos= e. > > > The following change fixes radeon attach issues: > > > https://github.com/POWER9BSD/freebsd/commit/be6c98f5c2e2ed9a4935ac5b67c46= 8b75f3b4457 > > +/* prevent prefetching of coherent DMA data ahead of a dma-complete */ > +#ifndef __io_ar > +#ifdef rmb > +#define __io_ar() rmb() > +#else > +#define __io_ar() __compiler_membar(); > +#endif > +#endif > + > +/* flush writes to coherent DMA data before possibly triggering a DMA > read */ > +#ifndef __io_bw > +#ifdef wmb > +#define __io_bw() wmb() > +#else > +#define __io_bw() __compiler_membar(); > +#endif > +#endif > > ... > > static inline uint16_t > readw(const volatile void *addr) > { > uint16_t v; > > - __compiler_membar(); > - v =3D *(const volatile uint16_t *)addr; > - __compiler_membar(); > + __io_br(); > + v =3D le16toh(__raw_readw(addr)); > + __io_ar(); > return (v); > } > > For x86 rmb and wmb are defined as lfence and sfence instructions which > shouldn't be necessary here. > From owner-svn-src-head@freebsd.org Sun Nov 18 22:17:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EC6E1126472; Sun, 18 Nov 2018 22:17:49 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57EC173EF1; Sun, 18 Nov 2018 22:17:48 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-io1-xd35.google.com with SMTP id f12-v6so20924780iog.0; Sun, 18 Nov 2018 14:17:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k/EyIZwcc1HVGNDnFOFIrm52qmKvs/wwaZZPH4TmwIg=; b=Y8ML4B+H7Z+y6ZXNXKx9MoYhzM0JeCICPNnuaKRtB5TxYqtI9eL53QO99ngTPawtYg j3KvYnvB+Rntt5yvjh7aUFvzMS1eYdMEsIIphExy8ZqI6or+4VndZL1A4ldEg/a8i4D8 4IKYR2mS0TMClfg6gdj7TPTay0LvA9oqKAsGu3h4LWbyH9Whox639elDpxVxP7PPNK2w bkIxrEkb8uuLfHcUI+3KOmjit05Vm2AXNd+/cINidKZ4VP+djMxBHIljLfbLuGfn2luK fMHpdAZ91nRicpjBuwhEFXcX+N3IBn6u/qJO8zg7z9OLkvDYrUZMNTLvFVCoRRGRpF3U 1x3w== 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=k/EyIZwcc1HVGNDnFOFIrm52qmKvs/wwaZZPH4TmwIg=; b=QBTptKeTA2vZfop3Niy9R5AV6zBVFdBSijIflcYtDsTn4sDBccKvWqp1eaw9TqLYn3 pfdWNf/KnJxZooIbtG4MFdthbBL0NUIglzrC0XuCl2iJP12Fb/biwzS3IaN0d4qqG+3+ fyaYzHmqvydBYmeyqCPsfe2Uy36/iyhYE+LEXzqxtWgXKqETw7d4aw2W+xn1TT0ao4Od c7BJCHDSk8x4a7l11246x4l9sJEkBFbkQKRsCuzMKWTUfW+uE/wJRJAq1IoccySiX8Lh sHhFwwR6NjSoB+CuwSKMdQ3odYTe3/UWb1gbTsHIt4fUKnwv6MOTesPhSiG7h/AGS2AE b7KA== X-Gm-Message-State: AGRZ1gL8wRcHRO5+FGlmlLy3JWXtBpvTZmntNGmHJGFfYcrFE2X/IJbD quOamI/YRey+3uVvxMCa00sko/Hjb79lSVtUzijbvA== X-Google-Smtp-Source: AJdET5eh49wfEq65xBpkCEWlox+retlnoPQGsOLfCeGpPBoyLiZJ0SBTfxsGBaLLAiEmCA4YDlij36gVO9qvtLozZDw= X-Received: by 2002:a5e:dc0b:: with SMTP id b11mr14968087iok.237.1542579467309; Sun, 18 Nov 2018 14:17:47 -0800 (PST) MIME-Version: 1.0 References: <201810222055.w9MKtZPt013627@repo.freebsd.org> <20181118114538.546a4fab@kalimero.tijl.coosemans.org> <20181118220842.4c995b5a@kalimero.tijl.coosemans.org> In-Reply-To: <20181118220842.4c995b5a@kalimero.tijl.coosemans.org> From: Matthew Macy Date: Sun, 18 Nov 2018 14:17:36 -0800 Message-ID: Subject: Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux To: =?UTF-8?Q?T=C4=B3l_Coosemans?= Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 57EC173EF1 X-Spamd-Result: default: False [-3.83 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.88)[ipnet: 2607:f8b0::/32(-2.57), asn: 15169(-1.73), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[5.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 22:17:49 -0000 > > > > PowerPC barrier instructions are needed to prevent reordering. > > > > Correct. The current lkpi implementation also assumes that device > > endian =3D=3D host endian. The Linux generic accessors will do use endi= an > > macros to byte swap where necessary. > > Yes, these functions are used to access little-endian registers so byte > swapping is needed on big-endian machines. For PowerPC Linux also define= s > functions to access big-endian registers, but we probably don't need thos= e. > None of our currently supported drivers use those macros (most devices are LE) so I=E2=80=99ve omitted them. -M > > The following change fixes radeon attach issues: > > > https://github.com/POWER9BSD/freebsd/commit/be6c98f5c2e2ed9a4935ac5b67c46= 8b75f3b4457 > > +/* prevent prefetching of coherent DMA data ahead of a dma-complete */ > +#ifndef __io_ar > +#ifdef rmb > +#define __io_ar() rmb() > +#else > +#define __io_ar() __compiler_membar(); > +#endif > +#endif > + > +/* flush writes to coherent DMA data before possibly triggering a DMA > read */ > +#ifndef __io_bw > +#ifdef wmb > +#define __io_bw() wmb() > +#else > +#define __io_bw() __compiler_membar(); > +#endif > +#endif > > ... > > static inline uint16_t > readw(const volatile void *addr) > { > uint16_t v; > > - __compiler_membar(); > - v =3D *(const volatile uint16_t *)addr; > - __compiler_membar(); > + __io_br(); > + v =3D le16toh(__raw_readw(addr)); > + __io_ar(); > return (v); > } > > For x86 rmb and wmb are defined as lfence and sfence instructions which > shouldn't be necessary here. > From owner-svn-src-head@freebsd.org Mon Nov 19 00:17:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78A83112C1FA for ; Mon, 19 Nov 2018 00:17:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x132.google.com (mail-it1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DFA377A61 for ; Mon, 19 Nov 2018 00:17:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x132.google.com with SMTP id h193so4586238ita.5 for ; Sun, 18 Nov 2018 16:17:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lqyV1C+HVhjkZ1x5bKP3XBTA6rGWzb+UFHR7ckaAO/c=; b=0+sXn07VsjNdLNTgT2ECmOc5zf6pj91dcQ3DoqxDfp+dYYfQmo28A6S9qJ5Fb+YFjR G/iucMOgGQ28DTNnhxGK/MlZkDb11XU3TkIJG8TExijxnwpzRersCrkM25BePjnV2stM qpSAaBTKKMMB1GM6C939gmfBH+5gMSlc5uHAvHM49fkP67JDpX9hVnLlE1vrl+RC0EBJ unAQXM53Oghk/MV08JQHjRcKAqbCzvkekY5uyJBSq5wf8mmuUNa+EEu1Epqa4w6ARYTe qNEFfOLLn5PfzMRopXtEgJ9G7/2B/LWNrYpE+/X9YQpZ+TycKGLT88ek8LZ/j/f2487w O8vg== 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=lqyV1C+HVhjkZ1x5bKP3XBTA6rGWzb+UFHR7ckaAO/c=; b=cGxDsK6L3RcaeR0MmjXQUghX2kT70wcuqS4mIfChOGS/Ap7IslkZoe59XYiF9fQjcW sLXwtSRuP8TSZkMC0nIpp8cvruVqwErlhnaL/HKmACkANr72dVQjVnTdz505eqVol70/ RLFh6AbqM8YRKycAPIBkslxdkpLHG5cJKnfhUZNHvUkM8BCilr0tVgPq++87Xag2Vzrg WsXRRAwa70wR4GlF3yVZ8yTpyV87j2r9N2lBgz+L9j1RNaeGX9tGkTEyY0ZqVKdpS+a+ +5GGrUz3C3fEa/n7tRJ1iIB3xJfRoeCz47RPPKfTuFw28vSkv6b4UPKpwMzsL54nO1Zx 1KIQ== X-Gm-Message-State: AA+aEWYl/yvRb8grQzOZ6MvqEblOMiVDc1KH7aOMCHXAdbOndiF3EFUf IAyPeP4dUOsr1MUi6gKZyND0+RFBdp5JF9KoqFF4eQ== X-Google-Smtp-Source: AJdET5c/GAlpZasFVc6U+VBTUE5gRlUDpFWiHUIULUDEN2aOFGOlrReL5ValK/JM4IXxDeTHr52ElraMhkgvrvHXACc= X-Received: by 2002:a24:5f94:: with SMTP id r142-v6mr6704199itb.171.1542586624557; Sun, 18 Nov 2018 16:17:04 -0800 (PST) MIME-Version: 1.0 References: <201811151602.wAFG2E4w040161@repo.freebsd.org> <595ff2c5-64ea-509d-481e-635499ab173d@freebsd.org> In-Reply-To: <595ff2c5-64ea-509d-481e-635499ab173d@freebsd.org> From: Warner Losh Date: Sun, 18 Nov 2018 17:16:53 -0700 Message-ID: Subject: Re: svn commit: r340450 - head/sys/sys To: Allan Jude Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 8DFA377A61 X-Spamd-Result: default: False [-4.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.02)[ip: (-5.74), ipnet: 2607:f8b0::/32(-2.56), asn: 15169(-1.72), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 00:17:06 -0000 I don't see how this could possibly have changed things. The changes will change the least significant bit by one for fractional results. I've looked at all the functions that use it and get called by the mlx driver and have trouble seeing where it could be relevant... Can you do an experiment to let me know which of the three functions I changed breaks things? Warner On Sun, Nov 18, 2018 at 12:56 PM Allan Jude wrote: > On 2018-11-15 11:02, Warner Losh wrote: > > Author: imp > > Date: Thu Nov 15 16:02:13 2018 > > New Revision: 340450 > > URL: https://svnweb.freebsd.org/changeset/base/340450 > > > > Log: > > When converting ns,us,ms to sbt, return the ceil() of the result > > rather than the floor(). Returning the floor means that > > sbttoX(Xtosbt(y)) != y for almost all values of y. In practice, this > > results in a difference of at most 1 in the lsb of the sbintime_t. > > This difference is meaningless for all current users of these > > functions, but is important for the newly introduced sysctl conversion > > routines which implicitly rely on the transformation being idempotent. > > > > Sponsored by: Netflix, Inc > > > > This seems to break attaching for my mlxen(4), with or without r340451 > > I don't understand why at this point. > > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core0: mem > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > numa-domain 1 on pci11 > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: command 0x4 timed out (go > bit not cleared) > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device is going to be reset > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device was reset > successfully > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: QUERY_FW command failed, > aborting > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: Failed to init fw, aborting. > Nov 18 19:29:13 CA-HML3-09 kernel: device_attach: mlx4_core0 attach > returned 5 > > It works fine under r340449: > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: mem > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > numa-domain 1 on pci11 > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Mellanox ConnectX core > driver v3.4.1 (October 2017) > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: Unable to determine PCI > device chain minimum BW > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en mlx4_core0: Activating port:1 > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: Ethernet address: > 00:02:c9:4d:6a:e8 > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 32 > TX rings > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to DOWN > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 16 > RX rings > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 32 TX rings > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 16 RX rings > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Initializing port > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Link Down > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to UP > > > > > Modified: > > head/sys/sys/time.h > > > > Modified: head/sys/sys/time.h > > > ============================================================================== > > --- head/sys/sys/time.h Thu Nov 15 08:43:17 2018 (r340449) > > +++ head/sys/sys/time.h Thu Nov 15 16:02:13 2018 (r340450) > > @@ -161,6 +161,10 @@ sbttobt(sbintime_t _sbt) > > * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS > results in > > * large roundoff errors which sbttons() and nstosbt() avoid. > Millisecond and > > * microsecond functions are also provided for completeness. > > + * > > + * These functions return the smallest sbt larger or equal to the > number of > > + * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 > term added > > + * transforms the >> 32 from floor() to ceil(). > > */ > > static __inline int64_t > > sbttons(sbintime_t _sbt) > > @@ -173,7 +177,7 @@ static __inline sbintime_t > > nstosbt(int64_t _ns) > > { > > > > - return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); > > + return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - > 1) >> 32); > > } > > > > static __inline int64_t > > @@ -187,7 +191,7 @@ static __inline sbintime_t > > ustosbt(int64_t _us) > > { > > > > - return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); > > + return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) > >> 32); > > } > > > > static __inline int64_t > > @@ -201,7 +205,7 @@ static __inline sbintime_t > > mstosbt(int64_t _ms) > > { > > > > - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); > > + return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> > 32); > > } > > > > /*- > > > > > -- > Allan Jude > > From owner-svn-src-head@freebsd.org Mon Nov 19 00:54:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 088BE112D78E; Mon, 19 Nov 2018 00:54:33 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 995837928C; Mon, 19 Nov 2018 00:54:32 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B5561AF54; Mon, 19 Nov 2018 00:54:32 +0000 (UTC) (envelope-from kbowling@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ0sWe7049979; Mon, 19 Nov 2018 00:54:32 GMT (envelope-from kbowling@FreeBSD.org) Received: (from kbowling@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ0sW80049978; Mon, 19 Nov 2018 00:54:32 GMT (envelope-from kbowling@FreeBSD.org) Message-Id: <201811190054.wAJ0sW80049978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kbowling set sender to kbowling@FreeBSD.org using -f From: Kevin Bowling Date: Mon, 19 Nov 2018 00:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340591 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kbowling X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 995837928C X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.260,0]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 00:54:33 -0000 Author: kbowling (ports committer) Date: Mon Nov 19 00:54:31 2018 New Revision: 340591 URL: https://svnweb.freebsd.org/changeset/base/340591 Log: Retire sbsndptr() KPI As of r340465 all consumers use sbsndptr_adv and sbsndptr_noadv Reviewed by: gallatin Approved by: krion (mentor) Differential Revision: https://reviews.freebsd.org/D17998 Modified: head/sys/kern/uipc_sockbuf.c head/sys/sys/sockbuf.h Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Mon Nov 19 00:49:08 2018 (r340590) +++ head/sys/kern/uipc_sockbuf.c Mon Nov 19 00:54:31 2018 (r340591) @@ -1224,53 +1224,6 @@ sbdrop(struct sockbuf *sb, int len) m_freem(mfree); } -/* - * Maintain a pointer and offset pair into the socket buffer mbuf chain to - * avoid traversal of the entire socket buffer for larger offsets. - */ -struct mbuf * -sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff) -{ - struct mbuf *m, *ret; - - KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); - KASSERT(off + len <= sb->sb_acc, ("%s: beyond sb", __func__)); - KASSERT(sb->sb_sndptroff <= sb->sb_acc, ("%s: sndptroff broken", __func__)); - - /* - * Is off below stored offset? Happens on retransmits. - * Just return, we can't help here. - */ - if (sb->sb_sndptroff > off) { - *moff = off; - return (sb->sb_mb); - } - - /* Return closest mbuf in chain for current offset. */ - *moff = off - sb->sb_sndptroff; - m = ret = sb->sb_sndptr ? sb->sb_sndptr : sb->sb_mb; - if (*moff == m->m_len) { - *moff = 0; - sb->sb_sndptroff += m->m_len; - m = ret = m->m_next; - KASSERT(ret->m_len > 0, - ("mbuf %p in sockbuf %p chain has no valid data", ret, sb)); - } - - /* Advance by len to be as close as possible for the next transmit. */ - for (off = off - sb->sb_sndptroff + len - 1; - off > 0 && m != NULL && off >= m->m_len; - m = m->m_next) { - sb->sb_sndptroff += m->m_len; - off -= m->m_len; - } - if (off > 0 && m == NULL) - panic("%s: sockbuf %p and mbuf %p clashing", __func__, sb, ret); - sb->sb_sndptr = m; - - return (ret); -} - struct mbuf * sbsndptr_noadv(struct sockbuf *sb, uint32_t off, uint32_t *moff) { Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Mon Nov 19 00:49:08 2018 (r340590) +++ head/sys/sys/sockbuf.h Mon Nov 19 00:54:31 2018 (r340591) @@ -163,8 +163,6 @@ void sbrelease_locked(struct sockbuf *sb, struct socke int sbsetopt(struct socket *so, int cmd, u_long cc); int sbreserve_locked(struct sockbuf *sb, u_long cc, struct socket *so, struct thread *td); -struct mbuf * - sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff); void sbsndptr_adv(struct sockbuf *sb, struct mbuf *mb, u_int len); struct mbuf * sbsndptr_noadv(struct sockbuf *sb, u_int off, u_int *moff); From owner-svn-src-head@freebsd.org Mon Nov 19 01:04:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D89F1112DDC8; Mon, 19 Nov 2018 01:04:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 0C7CB7992F; Mon, 19 Nov 2018 01:04:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAJ14C0K059063; Sun, 18 Nov 2018 17:04:12 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAJ14CaE059062; Sun, 18 Nov 2018 17:04:12 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340450 - head/sys/sys In-Reply-To: To: Warner Losh Date: Sun, 18 Nov 2018 17:04:12 -0800 (PST) CC: Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@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: 0C7CB7992F X-Spamd-Result: default: False [1.50 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.45)[0.446,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_MEDIUM(0.18)[0.179,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 01:04:16 -0000 [ Charset UTF-8 unsupported, converting... ] > I don't see how this could possibly have changed things. The changes will > change the least significant bit by one for fractional results. I've looked > at all the functions that use it and get called by the mlx driver and have > trouble seeing where it could be relevant... > > Can you do an experiment to let me know which of the three functions I > changed breaks things? Alan well have to answer on that. I keep stairing at this code change and I wonder.. has clang done something odd with the - 1? What I read you trying to do is to remove a LSB from a left shifted by 32 value, but what has clang decided to do? Has it somehow gotten this wrong? Is there some promottion of the type of the bare 1 causing an issue? Could you look at the assmbler output for your expression and see that it does infact do what you expected it to do? Thanks, Rod Scratching my head as much as anyone on this. > > Warner > > On Sun, Nov 18, 2018 at 12:56 PM Allan Jude wrote: > > > On 2018-11-15 11:02, Warner Losh wrote: > > > Author: imp > > > Date: Thu Nov 15 16:02:13 2018 > > > New Revision: 340450 > > > URL: https://svnweb.freebsd.org/changeset/base/340450 > > > > > > Log: > > > When converting ns,us,ms to sbt, return the ceil() of the result > > > rather than the floor(). Returning the floor means that > > > sbttoX(Xtosbt(y)) != y for almost all values of y. In practice, this > > > results in a difference of at most 1 in the lsb of the sbintime_t. > > > This difference is meaningless for all current users of these > > > functions, but is important for the newly introduced sysctl conversion > > > routines which implicitly rely on the transformation being idempotent. > > > > > > Sponsored by: Netflix, Inc > > > > > > > This seems to break attaching for my mlxen(4), with or without r340451 > > > > I don't understand why at this point. > > > > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core0: mem > > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > > numa-domain 1 on pci11 > > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: command 0x4 timed out (go > > bit not cleared) > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device is going to be reset > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device was reset > > successfully > > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: QUERY_FW command failed, > > aborting > > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: Failed to init fw, aborting. > > Nov 18 19:29:13 CA-HML3-09 kernel: device_attach: mlx4_core0 attach > > returned 5 > > > > It works fine under r340449: > > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: mem > > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > > numa-domain 1 on pci11 > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Mellanox ConnectX core > > driver v3.4.1 (October 2017) > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: Unable to determine PCI > > device chain minimum BW > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en mlx4_core0: Activating port:1 > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: Ethernet address: > > 00:02:c9:4d:6a:e8 > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 32 > > TX rings > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to DOWN > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using 16 > > RX rings > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 32 TX rings > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 16 RX rings > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Initializing port > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Link Down > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to UP > > > > > > > > > Modified: > > > head/sys/sys/time.h > > > > > > Modified: head/sys/sys/time.h > > > > > ============================================================================== > > > --- head/sys/sys/time.h Thu Nov 15 08:43:17 2018 (r340449) > > > +++ head/sys/sys/time.h Thu Nov 15 16:02:13 2018 (r340450) > > > @@ -161,6 +161,10 @@ sbttobt(sbintime_t _sbt) > > > * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS > > results in > > > * large roundoff errors which sbttons() and nstosbt() avoid. > > Millisecond and > > > * microsecond functions are also provided for completeness. > > > + * > > > + * These functions return the smallest sbt larger or equal to the > > number of > > > + * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 > > term added > > > + * transforms the >> 32 from floor() to ceil(). > > > */ > > > static __inline int64_t > > > sbttons(sbintime_t _sbt) > > > @@ -173,7 +177,7 @@ static __inline sbintime_t > > > nstosbt(int64_t _ns) > > > { > > > > > > - return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); > > > + return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - > > 1) >> 32); > > > } > > > > > > static __inline int64_t > > > @@ -187,7 +191,7 @@ static __inline sbintime_t > > > ustosbt(int64_t _us) > > > { > > > > > > - return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); > > > + return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) > > >> 32); > > > } > > > > > > static __inline int64_t > > > @@ -201,7 +205,7 @@ static __inline sbintime_t > > > mstosbt(int64_t _ms) > > > { > > > > > > - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); > > > + return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> > > 32); > > > } > > > > > > /*- > > > > > > > > > -- > > Allan Jude > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Nov 19 01:39:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6289112EE1D for ; Mon, 19 Nov 2018 01:39:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x132.google.com (mail-it1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 258AD7A9FF for ; Mon, 19 Nov 2018 01:39:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x132.google.com with SMTP id m15so5277772itl.4 for ; Sun, 18 Nov 2018 17:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HBcHhq/KmKRdZD8yY5f1Kjh8ICRJfUrUIYZizap95Y4=; b=m/PmqiSzBEHGv91yc5mwd40Hj6NY7r3eGHzE9snrjh+GPYCjA5PX2pjGv/gN2scVW9 1V+dMYzyIYRO4RYm3hSg4lS2oZTBe7wNeijHL2x0i2q3Cr0gUSvfvfW0hHil4XhTof2v 0MN20p79yJi3PG9+WCtEcShzIyQ2oKLAk5dZFfuo2Rue0tapF/GFwTNyC+Jf5FabykVj c9mxKHyP+QZeSvudAU9uFJDdkZC0YJx1NOSA9A79Grxmkk05ULO+y1aQjSM0kZoJKwW7 qzgESzeg8+eGFSg7K0IRqqu5lCOyjDQXZgVijUqefeOHCPQz2VzFnIsonVPT73F14bFh JiNw== 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=HBcHhq/KmKRdZD8yY5f1Kjh8ICRJfUrUIYZizap95Y4=; b=dKweRpt5ZBYApkN1C5o29j51FjIjMmNiOIne5i4pmkuzLag9rI9fl7BwfyHQVpFOgM 2zvCQ0N7MdkLfhj4D93nwRfGkwuf5IrwXYKOFY00owDLaee+MaKwj6JSrmcmVaH65FBa DGjB+qlIJl4NcVmxi2VDmG1KRMbGWNbFg8Yqqp5vLKKsrr6v5FuIvbwKZ8v4K9uF/JwM 82MpRrO03F9vcL+g7ZRwsJhsscm84ZFt06iwA2xO+KZiGOpNphUblCcPVoeDPjLA7SR2 vLd7ZUNrhkiegO3DiNRW2wLkLfDIthoobNQZiw5icGygdrpYq/xttCQowrb+QQD8WFn1 6F7w== X-Gm-Message-State: AA+aEWY2Nek05q9TbDPdNp+AFN8SqQ/2ixNLy0ptoVBA+wlkN5+K/Mmy 3uV6730tbivJYB79ly8n5+owut3Vk4EW+Ub97raXdQ== X-Google-Smtp-Source: AFSGD/VdHFYgypdktNmadSKZfLqb06i96m4hJQ4Fq/322DOP6BYBuLJGxL2Hylts8XQb0qDgpfjAIGFzN7l3T4yjZgE= X-Received: by 2002:a24:3796:: with SMTP id r144-v6mr6544701itr.79.1542591540291; Sun, 18 Nov 2018 17:39:00 -0800 (PST) MIME-Version: 1.0 References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 18 Nov 2018 18:38:49 -0700 Message-ID: Subject: Re: svn commit: r340450 - head/sys/sys To: "Rodney W. Grimes" Cc: Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 258AD7A9FF X-Spamd-Result: default: False [-3.94 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.97)[ip: (-5.51), ipnet: 2607:f8b0::/32(-2.55), asn: 15169(-1.71), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 01:39:02 -0000 On Sun, Nov 18, 2018 at 6:04 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > I don't see how this could possibly have changed things. The changes will > > change the least significant bit by one for fractional results. I've > looked > > at all the functions that use it and get called by the mlx driver and > have > > trouble seeing where it could be relevant... > > > > Can you do an experiment to let me know which of the three functions I > > changed breaks things? > > Alan well have to answer on that. I keep stairing at this > code change and I wonder.. has clang done something odd > with the - 1? What I read you trying to do is to remove > a LSB from a left shifted by 32 value, but what has clang > decided to do? Has it somehow gotten this wrong? Is there > some promottion of the type of the bare 1 causing an issue? > I'll talk to Allan to see if he can test that. the bare 1 should be handled properly because of C's promotion rules. 1ull << 32 is an unsigned long long. What I really wanted was "~(uint32_t)0" but that construct has bit me in the past. > Could you look at the assmbler output for your expression > and see that it does infact do what you expected it to do? > I haven't, but that's kinda hard since these are inline functions... I have some of this hardware at work, but don't think I have any machines with it assigned to me. If I can't work it out by the end of Tuesday, I'll back it out until I can get to the bottom of it (since I'll be out most of Wed->Sun). Warner > Thanks, > Rod > Scratching my head as much as anyone on this. > > > > > Warner > > > > On Sun, Nov 18, 2018 at 12:56 PM Allan Jude > wrote: > > > > > On 2018-11-15 11:02, Warner Losh wrote: > > > > Author: imp > > > > Date: Thu Nov 15 16:02:13 2018 > > > > New Revision: 340450 > > > > URL: https://svnweb.freebsd.org/changeset/base/340450 > > > > > > > > Log: > > > > When converting ns,us,ms to sbt, return the ceil() of the result > > > > rather than the floor(). Returning the floor means that > > > > sbttoX(Xtosbt(y)) != y for almost all values of y. In practice, > this > > > > results in a difference of at most 1 in the lsb of the sbintime_t. > > > > This difference is meaningless for all current users of these > > > > functions, but is important for the newly introduced sysctl > conversion > > > > routines which implicitly rely on the transformation being > idempotent. > > > > > > > > Sponsored by: Netflix, Inc > > > > > > > > > > This seems to break attaching for my mlxen(4), with or without r340451 > > > > > > I don't understand why at this point. > > > > > > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core0: mem > > > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > > > numa-domain 1 on pci11 > > > Nov 18 19:28:12 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: command 0x4 timed out > (go > > > bit not cleared) > > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device is going to be > reset > > > Nov 18 19:29:12 CA-HML3-09 kernel: mlx4_core0: device was reset > > > successfully > > > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: QUERY_FW command failed, > > > aborting > > > Nov 18 19:29:13 CA-HML3-09 kernel: mlx4_core0: Failed to init fw, > aborting. > > > Nov 18 19:29:13 CA-HML3-09 kernel: device_attach: mlx4_core0 attach > > > returned 5 > > > > > > It works fine under r340449: > > > > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: mem > > > 0xfbe00000-0xfbefffff,0xfa800000-0xfaffffff irq 48 at device 0.0 > > > numa-domain 1 on pci11 > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Mellanox ConnectX core > > > driver v3.4.1 (October 2017) > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core: Initializing mlx4_core > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_core0: Unable to determine PCI > > > device chain minimum BW > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en mlx4_core0: Activating > port:1 > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: Ethernet address: > > > 00:02:c9:4d:6a:e8 > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using > 32 > > > TX rings > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to DOWN > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlx4_core0: Port 1: Using > 16 > > > RX rings > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 32 TX rings > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Using 16 RX rings > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Initializing port > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlx4_en: mlxen0: Link Down > > > Nov 18 19:46:07 CA-HML3-09 kernel: mlxen0: link state changed to UP > > > > > > > > > > > > > Modified: > > > > head/sys/sys/time.h > > > > > > > > Modified: head/sys/sys/time.h > > > > > > > > ============================================================================== > > > > --- head/sys/sys/time.h Thu Nov 15 08:43:17 2018 > (r340449) > > > > +++ head/sys/sys/time.h Thu Nov 15 16:02:13 2018 > (r340450) > > > > @@ -161,6 +161,10 @@ sbttobt(sbintime_t _sbt) > > > > * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS > > > results in > > > > * large roundoff errors which sbttons() and nstosbt() avoid. > > > Millisecond and > > > > * microsecond functions are also provided for completeness. > > > > + * > > > > + * These functions return the smallest sbt larger or equal to the > > > number of > > > > + * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 > > > term added > > > > + * transforms the >> 32 from floor() to ceil(). > > > > */ > > > > static __inline int64_t > > > > sbttons(sbintime_t _sbt) > > > > @@ -173,7 +177,7 @@ static __inline sbintime_t > > > > nstosbt(int64_t _ns) > > > > { > > > > > > > > - return ((_ns * (((uint64_t)1 << 63) / 500000000)) >> 32); > > > > + return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << > 32) - > > > 1) >> 32); > > > > } > > > > > > > > static __inline int64_t > > > > @@ -187,7 +191,7 @@ static __inline sbintime_t > > > > ustosbt(int64_t _us) > > > > { > > > > > > > > - return ((_us * (((uint64_t)1 << 63) / 500000)) >> 32); > > > > + return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - > 1) > > > >> 32); > > > > } > > > > > > > > static __inline int64_t > > > > @@ -201,7 +205,7 @@ static __inline sbintime_t > > > > mstosbt(int64_t _ms) > > > > { > > > > > > > > - return ((_ms * (((uint64_t)1 << 63) / 500)) >> 32); > > > > + return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) > >> > > > 32); > > > > } > > > > > > > > /*- > > > > > > > > > > > > > -- > > > Allan Jude > > > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Mon Nov 19 02:12:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 416381130081; Mon, 19 Nov 2018 02:12:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA60B7BE61; Mon, 19 Nov 2018 02:12:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB7EE1BC66; Mon, 19 Nov 2018 02:12:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2C9gH090076; Mon, 19 Nov 2018 02:12:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2C8NI090071; Mon, 19 Nov 2018 02:12:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811190212.wAJ2C8NI090071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 02:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340592 - in head: lib/libbe sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libbe sbin/bectl X-SVN-Commit-Revision: 340592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA60B7BE61 X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.25)[0.245,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:12:10 -0000 Author: kevans Date: Mon Nov 19 02:12:08 2018 New Revision: 340592 URL: https://svnweb.freebsd.org/changeset/base/340592 Log: bectl(3)/libbe(3): Allow BE root to be specified Add an undocumented -r option preceding the bectl subcommand to specify a BE root to operate out of. This will remain undocumented for now, as some caveats apply: - BEs cannot be activated in the pool that doesn't contain the rootfs - bectl create cannot work out of the box without the -e option right now, since it defaults to the rootfs and cross-pool cloning doesn't work like that (IIRC) Plumb the BE root through to libbe(3) so that some things -can- be done to it, e.g. bectl -r tank/ROOT create -e default upgrade bectl -r tank/ROOT mount upgrade /mnt this aides in some upgrade setups where rootfs is not necessarily ZFS, and also makes it easier/possible to regression-test bectl when combined with a file-backed zpool. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18029 Modified: head/lib/libbe/be.c head/lib/libbe/be.h head/lib/libbe/be_info.c head/lib/libbe/libbe.3 head/sbin/bectl/bectl.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Mon Nov 19 00:54:31 2018 (r340591) +++ head/lib/libbe/be.c Mon Nov 19 02:12:08 2018 (r340592) @@ -74,7 +74,7 @@ be_locate_rootfs(libbe_handle_t *lbh) * dataset, for example, zroot/ROOT. */ libbe_handle_t * -libbe_init(void) +libbe_init(const char *root) { libbe_handle_t *lbh; char *poolname, *pos; @@ -89,16 +89,21 @@ libbe_init(void) if ((lbh->lzh = libzfs_init()) == NULL) goto err; - /* Grab rootfs, we'll work backwards from there */ + /* + * Grab rootfs, we'll work backwards from there if an optional BE root + * has not been passed in. + */ if (be_locate_rootfs(lbh) != 0) goto err; - - /* Strip off the final slash from the rootfs to get the be root */ - strlcpy(lbh->root, lbh->rootfs, sizeof(lbh->root)); - pos = strrchr(lbh->root, '/'); - if (pos == NULL) - goto err; - *pos = '\0'; + if (root == NULL) { + /* Strip off the final slash from rootfs to get the be root */ + strlcpy(lbh->root, lbh->rootfs, sizeof(lbh->root)); + pos = strrchr(lbh->root, '/'); + if (pos == NULL) + goto err; + *pos = '\0'; + } else + strlcpy(lbh->root, root, sizeof(lbh->root)); if ((pos = strchr(lbh->root, '/')) == NULL) goto err; Modified: head/lib/libbe/be.h ============================================================================== --- head/lib/libbe/be.h Mon Nov 19 00:54:31 2018 (r340591) +++ head/lib/libbe/be.h Mon Nov 19 02:12:08 2018 (r340592) @@ -63,7 +63,7 @@ typedef enum be_error { /* Library handling functions: be.c */ -libbe_handle_t *libbe_init(void); +libbe_handle_t *libbe_init(const char *root); void libbe_close(libbe_handle_t *); /* Bootenv information functions: be_info.c */ Modified: head/lib/libbe/be_info.c ============================================================================== --- head/lib/libbe/be_info.c Mon Nov 19 00:54:31 2018 (r340591) +++ head/lib/libbe/be_info.c Mon Nov 19 02:12:08 2018 (r340592) @@ -42,7 +42,10 @@ const char * be_active_name(libbe_handle_t *lbh) { - return (strrchr(lbh->rootfs, '/') + sizeof(char)); + if (*lbh->rootfs != '\0') + return (strrchr(lbh->rootfs, '/') + sizeof(char)); + else + return (lbh->rootfs); } @@ -63,7 +66,10 @@ const char * be_nextboot_name(libbe_handle_t *lbh) { - return (strrchr(lbh->bootfs, '/') + sizeof(char)); + if (*lbh->bootfs != '\0') + return (strrchr(lbh->bootfs, '/') + sizeof(char)); + else + return (lbh->bootfs); } Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Mon Nov 19 00:54:31 2018 (r340591) +++ head/lib/libbe/libbe.3 Mon Nov 19 02:12:08 2018 (r340592) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 31, 2018 +.Dd November 17, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -39,7 +39,7 @@ .Sh SYNOPSIS .In be.h .Ft "libbe_handle_t *hdl" Ns -.Fn libbe_init void +.Fn libbe_init "const char *be_root" .Pp .Ft void .Fn libbe_close "libbe_handle_t *hdl" @@ -157,13 +157,16 @@ errno otherwise as described in .Pp The .Fn libbe_init -function initializes +function takes an optional BE root and initializes .Nm , returning a .Vt "libbe_handle_t *" on success, or .Dv NULL on error. +If a BE root is supplied, +.Nm +will only operate out of that pool and BE root. An error may occur if: .Bl -column .It /boot and / are not on the same filesystem and device, @@ -184,11 +187,15 @@ invalidating the handle in the process. .Pp The .Fn be_active_name -function returns the name of the currently booted boot environment, +function returns the name of the currently booted boot environment. +This boot environment may not belong to the same BE root as the root libbe +is operating on! .Pp The .Fn be_active_path function returns the full path of the currently booted boot environment. +This boot environment may not belong to the same BE root as the root libbe +is operating on! .Pp The .Fn be_nextboot_name Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Mon Nov 19 00:54:31 2018 (r340591) +++ head/sbin/bectl/bectl.c Mon Nov 19 02:12:08 2018 (r340592) @@ -489,12 +489,25 @@ int main(int argc, char *argv[]) { const char *command; + char *root; int command_index, rc; + root = NULL; if (argc < 2) return (usage(false)); - command = argv[1]; + if (strcmp(argv[1], "-r") == 0) { + if (argc < 4) + return (usage(false)); + root = strdup(argv[2]); + command = argv[3]; + argc -= 3; + argv += 3; + } else { + command = argv[1]; + argc -= 1; + argv += 1; + } /* Handle command aliases */ if (strcmp(command, "umount") == 0) @@ -512,13 +525,12 @@ main(int argc, char *argv[]) } - if ((be = libbe_init()) == NULL) + if ((be = libbe_init(root)) == NULL) return (-1); libbe_print_on_error(be, true); - /* XXX TODO: can be simplified if offset by 2 instead of one */ - rc = command_map[command_index].fn(argc-1, argv+1); + rc = command_map[command_index].fn(argc, argv); libbe_close(be); return (rc); From owner-svn-src-head@freebsd.org Mon Nov 19 02:16:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA96E1130276; Mon, 19 Nov 2018 02:16:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471897C127; Mon, 19 Nov 2018 02:16:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 267A91BC9D; Mon, 19 Nov 2018 02:16:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2GLD2092153; Mon, 19 Nov 2018 02:16:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2GKpS092150; Mon, 19 Nov 2018 02:16:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811190216.wAJ2GKpS092150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 02:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340593 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 340593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 471897C127 X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.24)[0.244,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:16:21 -0000 Author: kevans Date: Mon Nov 19 02:16:20 2018 New Revision: 340593 URL: https://svnweb.freebsd.org/changeset/base/340593 Log: libbe(3): Properly account for altroot when creating new BEs Previously we would blindly copy the 'mountpoint' property, which includes the altroot. The altroot needs to be snipped off prior to setting it on the new BE, though, or you'll end up with a new BE and a mountpoint of /mnt with altroot=/mnt MFC after: 3 days Modified: head/lib/libbe/be.c head/lib/libbe/be_impl.h Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Mon Nov 19 02:12:08 2018 (r340592) +++ head/lib/libbe/be.c Mon Nov 19 02:16:20 2018 (r340593) @@ -305,6 +305,7 @@ be_deep_clone_prop(int prop, void *cb) zprop_source_t src; char pval[BE_MAXPATHLEN]; char source[BE_MAXPATHLEN]; + char *val; dccb = cb; /* Skip some properties we don't want to touch */ @@ -324,7 +325,15 @@ be_deep_clone_prop(int prop, void *cb) if (src != ZPROP_SRC_LOCAL) return (ZPROP_CONT); - nvlist_add_string(dccb->props, zfs_prop_to_name(prop), (char *)pval); + /* Augment mountpoint with altroot, if needed */ + val = pval; + if (prop == ZFS_PROP_MOUNTPOINT && *dccb->altroot != '\0') { + if (pval[strlen(dccb->altroot)] == '\0') + strlcpy(pval, "/", sizeof(pval)); + else + val = pval + strlen(dccb->altroot); + } + nvlist_add_string(dccb->props, zfs_prop_to_name(prop), val); return (ZPROP_CONT); } @@ -367,6 +376,10 @@ be_deep_clone(zfs_handle_t *ds, void *data) dccb.zhp = ds; dccb.props = props; + if (zpool_get_prop(isdc->lbh->active_phandle, ZPOOL_PROP_ALTROOT, + dccb.altroot, sizeof(dccb.altroot), NULL, true) != 0 || + strcmp(dccb.altroot, "-") == 0) + *dccb.altroot = '\0'; if (zprop_iter(be_deep_clone_prop, &dccb, B_FALSE, B_FALSE, ZFS_TYPE_FILESYSTEM) == ZPROP_INVAL) return (-1); Modified: head/lib/libbe/be_impl.h ============================================================================== --- head/lib/libbe/be_impl.h Mon Nov 19 02:12:08 2018 (r340592) +++ head/lib/libbe/be_impl.h Mon Nov 19 02:16:20 2018 (r340593) @@ -55,6 +55,7 @@ struct libbe_deep_clone { struct libbe_dccb { zfs_handle_t *zhp; nvlist_t *props; + char altroot[MAXPATHLEN]; }; typedef struct prop_data { From owner-svn-src-head@freebsd.org Mon Nov 19 02:30:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE8AB11307DD; Mon, 19 Nov 2018 02:30:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 570A67C6ED; Mon, 19 Nov 2018 02:30:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 337991BE51; Mon, 19 Nov 2018 02:30:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2UDHO097433; Mon, 19 Nov 2018 02:30:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2UCjA097429; Mon, 19 Nov 2018 02:30:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811190230.wAJ2UCjA097429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 02:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340594 - in head: etc/mtree sbin/bectl sbin/bectl/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: etc/mtree sbin/bectl sbin/bectl/tests X-SVN-Commit-Revision: 340594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 570A67C6ED X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.252,0]; NEURAL_SPAM_MEDIUM(0.15)[0.154,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:30:14 -0000 Author: kevans Date: Mon Nov 19 02:30:12 2018 New Revision: 340594 URL: https://svnweb.freebsd.org/changeset/base/340594 Log: bectl(8): Add some regression tests These tests operate on a file-backed zpool that gets created in the kyua temp dir. root and ZFS support are both required for these tests. Current tests cover create, destroy, export/import, jail, list (kind of), mount, rename, and jail. List tests should later be extended to cover formatting and the different list flags, but for now only covers basic "are create/destroy actually reflected properly" MFC after: 3 days Added: head/sbin/bectl/tests/ head/sbin/bectl/tests/Makefile (contents, props changed) head/sbin/bectl/tests/bectl_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/sbin/bectl/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Nov 19 02:16:20 2018 (r340593) +++ head/etc/mtree/BSD.tests.dist Mon Nov 19 02:30:12 2018 (r340594) @@ -398,6 +398,8 @@ .. .. sbin + bectl + .. dhclient .. devd Modified: head/sbin/bectl/Makefile ============================================================================== --- head/sbin/bectl/Makefile Mon Nov 19 02:16:20 2018 (r340593) +++ head/sbin/bectl/Makefile Mon Nov 19 02:30:12 2018 (r340594) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= bectl MAN= bectl.8 @@ -15,5 +17,8 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +HAS_TESTS= yes +SUBDIR.${MK_TESTS}+= tests .include Added: head/sbin/bectl/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/bectl/tests/Makefile Mon Nov 19 02:30:12 2018 (r340594) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH+= bectl_test + +.include Added: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/bectl/tests/bectl_test.sh Mon Nov 19 02:30:12 2018 (r340594) @@ -0,0 +1,299 @@ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 Kyle Evans +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# Establishes a bectl_create zpool that can be used for some light testing; contains +# a 'default' BE and not much else. +bectl_create_setup() +{ + zpool=$1 + disk=$2 + mnt=$3 + + kldstat -qm zfs || atf_skip "ZFS module not loaded on the current system" + atf_check mkdir -p ${mnt} + atf_check truncate -s 1G ${disk} + atf_check zpool create -o altroot=${mnt} ${zpool} ${disk} + atf_check zfs create -o mountpoint=none ${zpool}/ROOT + atf_check zfs create -o mountpoint=/ -o canmount=noauto \ + ${zpool}/ROOT/default +} + +bectl_cleanup() +{ + zpool=$1 + + if zpool get health ${zpool} >/dev/null 2>&1; then + zpool destroy ${zpool} + fi +} + +atf_test_case bectl_create cleanup +bectl_create_head() +{ + + atf_set "descr" "Check the various forms of bectl create" + atf_set "require.user" root +} +bectl_create_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + + bectl_create_setup ${zpool} ${disk} ${mount} + # Test standard creation, creation of a snapshot, and creation from a + # snapshot. + atf_check bectl -r ${zpool}/ROOT create -e default default2 + atf_check bectl -r ${zpool}/ROOT create default2@test_snap + atf_check bectl -r ${zpool}/ROOT create -e default2@test_snap default3 +} +bectl_create_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_destroy cleanup +bectl_destroy_head() +{ + + atf_set "descr" "Check bectl destroy" + atf_set "require.user" root +} +bectl_destroy_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + + bectl_create_setup ${zpool} ${disk} ${mount} + atf_check bectl -r ${zpool}/ROOT create -e default default2 + atf_check -o not-empty zfs get mountpoint ${zpool}/ROOT/default2 + atf_check bectl -r ${zpool}/ROOT destroy default2 + atf_check -e not-empty -s not-exit:0 zfs get mountpoint ${zpool}/ROOT/default2 +} +bectl_destroy_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_export_import cleanup +bectl_export_import_head() +{ + + atf_set "descr" "Check bectl export and import" + atf_set "require.user" root +} +bectl_export_import_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + + bectl_create_setup ${zpool} ${disk} ${mount} + atf_check -o save:exported bectl -r ${zpool}/ROOT export default + atf_check -x "bectl -r ${zpool}/ROOT import default2 < exported" + atf_check -o not-empty zfs get mountpoint ${zpool}/ROOT/default2 + atf_check bectl -r ${zpool}/ROOT destroy default2 + atf_check -e not-empty -s not-exit:0 zfs get mountpoint \ + ${zpool}/ROOT/default2 +} +bectl_export_import_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_list cleanup +bectl_list_head() +{ + + atf_set "descr" "Check bectl list" + atf_set "require.user" root +} +bectl_list_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + + bectl_create_setup ${zpool} ${disk} ${mount} + # Test the list functionality, including that BEs come and go away + # as they're created and destroyed. Creation and destruction tests + # use the 'zfs' utility to verify that they're actually created, so + # these are just light tests that 'list' is picking them up. + atf_check -o save:list.out bectl -r ${zpool}/ROOT list + atf_check -o not-empty grep 'default' list.out + atf_check bectl -r ${zpool}/ROOT create -e default default2 + atf_check -o save:list.out bectl -r ${zpool}/ROOT list + atf_check -o not-empty grep 'default2' list.out + atf_check bectl -r ${zpool}/ROOT destroy default2 + atf_check -o save:list.out bectl -r ${zpool}/ROOT list + atf_check -s not-exit:0 grep 'default2' list.out + # XXX TODO: Formatting checks +} +bectl_list_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_mount cleanup +bectl_mount_head() +{ + + atf_set "descr" "Check bectl mount/unmount" + atf_set "require.user" root +} +bectl_mount_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + root=${mount}/root + + bectl_create_setup ${zpool} ${disk} ${mount} + atf_check mkdir -p ${root} + # Test unmount first... + atf_check -o not-empty bectl -r ${zpool}/ROOT mount default ${root} + atf_check -o not-empty -x "mount | grep '^${zpool}/ROOT/default'" + atf_check bectl -r ${zpool}/ROOT unmount default + atf_check -s not-exit:0 -x "mount | grep '^${zpool}/ROOT/default'" + # Then umount! + atf_check -o not-empty bectl -r ${zpool}/ROOT mount default ${root} + atf_check -o not-empty -x "mount | grep '^${zpool}/ROOT/default'" + atf_check bectl -r ${zpool}/ROOT umount default + atf_check -s not-exit:0 -x "mount | grep '^${zpool}/ROOT/default'" +} +bectl_mount_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_rename cleanup +bectl_rename_head() +{ + + atf_set "descr" "Check bectl rename" + atf_set "require.user" root +} +bectl_rename_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + + bectl_create_setup ${zpool} ${disk} ${mount} + atf_check bectl -r ${zpool}/ROOT rename default default2 + atf_check -o not-empty zfs get mountpoint ${zpool}/ROOT/default2 + atf_check -e not-empty -s not-exit:0 zfs get mountpoint \ + ${zpool}/ROOT/default +} +bectl_rename_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_test_case bectl_jail cleanup +bectl_jail_head() +{ + + atf_set "descr" "Check bectl rename" + atf_set "require.user" root +} +bectl_jail_body() +{ + cwd=$(realpath .) + zpool=bectl_test + disk=${cwd}/disk.img + mount=${cwd}/mnt + root=${mount}/root + + if [ ! -f /rescue/rescue ]; then + atf_skip "This test requires a rescue binary" + fi + bectl_create_setup ${zpool} ${disk} ${mount} + # Prepare our minimal BE... plop a rescue binary into it + atf_check mkdir -p ${root} + atf_check -o ignore bectl -r ${zpool}/ROOT mount default ${root} + atf_check mkdir -p ${root}/rescue + atf_check cp /rescue/rescue ${root}/rescue/rescue + atf_check bectl -r ${zpool}/ROOT umount default + + # Basic command-mode tests, with and without jail cleanup + atf_check -o inline:"rescue\n" bectl -r ${zpool}/ROOT \ + jail default /rescue/rescue ls -1 + atf_check -o inline:"rescue\n" bectl -r ${zpool}/ROOT \ + jail -Uo path=${root} default /rescue/rescue ls -1 + atf_check [ -f ${root}/rescue/rescue ] + atf_check bectl -r ${zpool}/ROOT ujail default + + # Batch mode tests + atf_check bectl -r ${zpool}/ROOT jail -bo path=${root} default + atf_check -o not-empty -x "jls | grep -F \"${root}\"" + atf_check bectl -r ${zpool}/ROOT ujail default + atf_check -s not-exit:0 -x "jls | grep -F \"${root}\"" + # 'unjail' naming + atf_check bectl -r ${zpool}/ROOT jail -b default + atf_check bectl -r ${zpool}/ROOT unjail default + atf_check -s not-exit:0 -x "jls | grep -F \"${root}\"" + # cannot unjail an unjailed BE (by either command name) + atf_check -e ignore -s not-exit:0 bectl -r ${zpool}/ROOT ujail default + atf_check -e ignore -s not-exit:0 bectl -r ${zpool}/ROOT unjail default + + # set+unset + atf_check bectl -r ${zpool}/ROOT jail -b -o path=${root} -u path default + # Ensure that it didn't mount at ${root} + atf_check -s not-exit:0 -x "mount | grep -F '${root}'" + atf_check bectl -r ${zpool}/ROOT ujail default +} +bectl_jail_cleanup() +{ + + bectl_cleanup bectl_test +} + +atf_init_test_cases() +{ + atf_add_test_case bectl_create + atf_add_test_case bectl_destroy + atf_add_test_case bectl_export_import + atf_add_test_case bectl_list + atf_add_test_case bectl_mount + atf_add_test_case bectl_rename + atf_add_test_case bectl_jail +} From owner-svn-src-head@freebsd.org Mon Nov 19 02:38:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFCA31130D2F; Mon, 19 Nov 2018 02:38:03 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BFBD7CBED; Mon, 19 Nov 2018 02:38:03 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CF401BFE5; Mon, 19 Nov 2018 02:38:03 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2c2x6002324; Mon, 19 Nov 2018 02:38:02 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2c2ad002323; Mon, 19 Nov 2018 02:38:02 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190238.wAJ2c2ad002323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 02:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340595 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 340595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BFBD7CBED X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.248,0]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:38:04 -0000 Author: jchandra Date: Mon Nov 19 02:38:02 2018 New Revision: 340595 URL: https://svnweb.freebsd.org/changeset/base/340595 Log: pci_host_generic: remove unneeded ThunderX2 quirk The current quirk implementation writes a fixed address to the PCI BAR to fix a firmware bug. The PCI BARs are allocated by firmware and will change depending on PCI devices present. So using a fixed address here is not correct. This quirk worked around a firmware bug that programmed the MSI-X bar of the SATA controller incorrectly. The newer firmware does not have this issue, so it is better to drop this quirk altogether. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17655 Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:30:12 2018 (r340594) +++ head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:38:02 2018 (r340595) @@ -69,25 +69,6 @@ __FBSDID("$FreeBSD$"); (((func) & PCIE_FUNC_MASK) << PCIE_FUNC_SHIFT) | \ ((reg) & PCIE_REG_MASK)) -typedef void (*pci_host_generic_quirk_function)(device_t); - -struct pci_host_generic_quirk_entry { - int impl; - int part; - int var; - int rev; - pci_host_generic_quirk_function func; -}; - -struct pci_host_generic_block_entry { - int impl; - int part; - int var; - int rev; - int bus; - int slot; -}; - /* Forward prototypes */ static uint32_t generic_pcie_read_config(device_t dev, u_int bus, u_int slot, @@ -100,24 +81,6 @@ static int generic_pcie_read_ivar(device_t dev, device static int generic_pcie_write_ivar(device_t dev, device_t child, int index, uintptr_t value); -#if defined(__aarch64__) -static void pci_host_generic_apply_quirks(device_t); -static void thunderx2_ahci_bar_quirk(device_t); - -struct pci_host_generic_quirk_entry pci_host_generic_quirks[] = -{ - {CPU_IMPL_CAVIUM, CPU_PART_THUNDERX2, 0, 0, thunderx2_ahci_bar_quirk}, - {0, 0, 0, 0, NULL} -}; - -struct pci_host_generic_block_entry pci_host_generic_blocked[] = -{ - /* ThunderX2 AHCI on second socket */ - {CPU_IMPL_CAVIUM, CPU_PART_THUNDERX2, 0, 0, 0x80, 0x10}, - {0, 0, 0, 0, 0, 0} -}; -#endif - int pci_host_generic_core_attach(device_t dev) { @@ -171,34 +134,9 @@ pci_host_generic_core_attach(device_t dev) return (error); } -#if defined(__aarch64__) - pci_host_generic_apply_quirks(dev); -#endif - return (0); } -#if defined(__aarch64__) -static void -pci_host_generic_apply_quirks(device_t dev) -{ - struct pci_host_generic_quirk_entry *quirk; - - quirk = pci_host_generic_quirks; - while (1) { - if (quirk->impl == 0) - break; - - if (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, - quirk->impl, quirk->part, quirk->var, quirk->rev) && - quirk->func != NULL) - quirk->func(dev); - - quirk++; - } -} -#endif - static uint32_t generic_pcie_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, int bytes) @@ -208,29 +146,11 @@ generic_pcie_read_config(device_t dev, u_int bus, u_in bus_space_tag_t t; uint64_t offset; uint32_t data; -#if defined(__aarch64__) - struct pci_host_generic_block_entry *block; -#endif if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) return (~0U); -#if defined(__aarch64__) - block = pci_host_generic_blocked; - while (1) { - if (block->impl == 0) - break; - - if (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, - block->impl, block->part, block->var, block->rev) && - block->bus == bus && block->slot == slot) - return (~0); - - block++; - } -#endif - sc = device_get_softc(dev); offset = PCIE_ADDR_OFFSET(bus, slot, func, reg); @@ -472,22 +392,3 @@ static device_method_t generic_pcie_methods[] = { DEFINE_CLASS_0(pcib, generic_pcie_core_driver, generic_pcie_methods, sizeof(struct generic_pcie_core_softc)); - -#if defined(__aarch64__) -static void thunderx2_ahci_bar_quirk(device_t dev) -{ - - /* - * XXX: - * On ThunderX2, AHCI BAR2 address is wrong. It needs to precisely - * match the one described in datasheet. Fixup it unconditionally. - */ - if (device_get_unit(dev) == 0) { - device_printf(dev, "running AHCI BAR fixup\n"); - PCIB_WRITE_CONFIG(dev, 0, 16, 0, 0x18, 0x01440000, 4); - PCIB_WRITE_CONFIG(dev, 0, 16, 0, 0x1c, 0x40, 4); - PCIB_WRITE_CONFIG(dev, 0, 16, 1, 0x18, 0x01450000, 4); - PCIB_WRITE_CONFIG(dev, 0, 16, 1, 0x1c, 0x40, 4); - } -} -#endif From owner-svn-src-head@freebsd.org Mon Nov 19 02:43:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80BBD1131162; Mon, 19 Nov 2018 02:43:35 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F3837D106; Mon, 19 Nov 2018 02:43:35 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEDF11C17F; Mon, 19 Nov 2018 02:43:34 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2hYvw007233; Mon, 19 Nov 2018 02:43:34 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2hYio007230; Mon, 19 Nov 2018 02:43:34 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190243.wAJ2hYio007230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 02:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340596 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 340596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F3837D106 X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.24)[0.244,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:43:35 -0000 Author: jchandra Date: Mon Nov 19 02:43:34 2018 New Revision: 340596 URL: https://svnweb.freebsd.org/changeset/base/340596 Log: pci_host_generic: allocate resources against devices Fix up pci_host_generic.c and pci_host_generic_fdt.c to allocate resources against devices that requested them. Currently the allocation happens against the pcib, which is incorrect. This is needed for the upcoming changes for fixing up pci_host_generic_acpi.c Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17656 Modified: head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic_fdt.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:38:02 2018 (r340595) +++ head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:43:34 2018 (r340596) @@ -310,7 +310,7 @@ pci_host_generic_core_alloc_resource(device_t dev, dev rm = generic_pcie_rman(sc, type); if (rm == NULL) - return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, + return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, start, end, count, flags)); if (bootverbose) { Modified: head/sys/dev/pci/pci_host_generic_fdt.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 02:38:02 2018 (r340595) +++ head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 02:43:34 2018 (r340596) @@ -423,6 +423,7 @@ generic_pcie_fdt_activate_resource(device_t dev, devic } break; case SYS_RES_MEMORY: + case SYS_RES_IRQ: res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r); break; @@ -445,6 +446,7 @@ generic_pcie_fdt_deactivate_resource(device_t dev, dev switch(type) { case SYS_RES_IOPORT: case SYS_RES_MEMORY: + case SYS_RES_IRQ: res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r); break; From owner-svn-src-head@freebsd.org Mon Nov 19 02:55:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 679201131470; Mon, 19 Nov 2018 02:55:20 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 098307D58D; Mon, 19 Nov 2018 02:55:20 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA8D21C31C; Mon, 19 Nov 2018 02:55:19 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ2tJVa012671; Mon, 19 Nov 2018 02:55:19 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ2tJ4O012668; Mon, 19 Nov 2018 02:55:19 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190255.wAJ2tJ4O012668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 02:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340597 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 340597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 098307D58D X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.248,0]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 02:55:20 -0000 Author: jchandra Date: Mon Nov 19 02:55:18 2018 New Revision: 340597 URL: https://svnweb.freebsd.org/changeset/base/340597 Log: pci_host_generic*: basic implementation of bus range Both ACPI and FDT support bus ranges for pci host bridges. Update pci_host_generic*.[ch] with a default implementation to support this. This will be used in the next set of changes for ACPI based host bridge. No functional changes in this commit. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17657 Modified: head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic.h head/sys/dev/pci/pci_host_generic_acpi.c head/sys/dev/pci/pci_host_generic_fdt.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:43:34 2018 (r340596) +++ head/sys/dev/pci/pci_host_generic.c Mon Nov 19 02:55:18 2018 (r340597) @@ -147,13 +147,14 @@ generic_pcie_read_config(device_t dev, u_int bus, u_in uint64_t offset; uint32_t data; - if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || - (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) + sc = device_get_softc(dev); + if ((bus < sc->bus_start) || (bus > sc->bus_end)) return (~0U); + if ((slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || + (reg > PCIE_REGMAX)) + return (~0U); - sc = device_get_softc(dev); - - offset = PCIE_ADDR_OFFSET(bus, slot, func, reg); + offset = PCIE_ADDR_OFFSET(bus - sc->bus_start, slot, func, reg); t = sc->bst; h = sc->bsh; @@ -183,14 +184,15 @@ generic_pcie_write_config(device_t dev, u_int bus, u_i bus_space_tag_t t; uint64_t offset; - if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) || - (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) + sc = device_get_softc(dev); + if ((bus < sc->bus_start) || (bus > sc->bus_end)) return; + if ((slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || + (reg > PCIE_REGMAX)) + return; - sc = device_get_softc(dev); + offset = PCIE_ADDR_OFFSET(bus - sc->bus_start, slot, func, reg); - offset = PCIE_ADDR_OFFSET(bus, slot, func, reg); - t = sc->bst; h = sc->bsh; @@ -221,14 +223,11 @@ generic_pcie_read_ivar(device_t dev, device_t child, i uintptr_t *result) { struct generic_pcie_core_softc *sc; - int secondary_bus; sc = device_get_softc(dev); if (index == PCIB_IVAR_BUS) { - /* this pcib adds only pci bus 0 as child */ - secondary_bus = 0; - *result = secondary_bus; + *result = sc->bus_start; return (0); } Modified: head/sys/dev/pci/pci_host_generic.h ============================================================================== --- head/sys/dev/pci/pci_host_generic.h Mon Nov 19 02:43:34 2018 (r340596) +++ head/sys/dev/pci/pci_host_generic.h Mon Nov 19 02:55:18 2018 (r340597) @@ -56,6 +56,8 @@ struct generic_pcie_core_softc { struct rman io_rman; struct resource *res; struct resource *res1; + int bus_start; + int bus_end; int ecam; bus_space_tag_t bst; bus_space_handle_t bsh; Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 02:43:34 2018 (r340596) +++ head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 02:55:18 2018 (r340597) @@ -125,7 +125,7 @@ pci_host_generic_acpi_attach(device_t dev) struct generic_pcie_acpi_softc *sc; ACPI_HANDLE handle; ACPI_STATUS status; - int error; + int error, bus_start; sc = device_get_softc(dev); @@ -136,10 +136,14 @@ pci_host_generic_acpi_attach(device_t dev) device_printf(dev, "Bus is%s cache-coherent\n", sc->base.coherent ? "" : " not"); - if (!ACPI_FAILURE(acpi_GetInteger(handle, "_BBN", &sc->base.ecam))) - sc->base.ecam >>= 7; - else + if (!ACPI_FAILURE(acpi_GetInteger(handle, "_BBN", &bus_start))) { + sc->base.ecam = bus_start >> 7; + sc->base.bus_start = bus_start & 0x7F; + } else { sc->base.ecam = 0; + sc->base.bus_start = 0; + } + sc->base.bus_end = 0xFF; acpi_pcib_fetch_prt(dev, &sc->ap_prt); @@ -194,17 +198,12 @@ static int generic_pcie_acpi_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) { - ACPI_HANDLE handle; struct generic_pcie_acpi_softc *sc; - int secondary_bus; sc = device_get_softc(dev); if (index == PCIB_IVAR_BUS) { - handle = acpi_get_handle(dev); - if (ACPI_FAILURE(acpi_GetInteger(handle, "_BBN", &secondary_bus))) - secondary_bus = sc->base.ecam * 0x80; - *result = secondary_bus; + *result = sc->base.ecam * 0x80 + sc->base.bus_start; return (0); } Modified: head/sys/dev/pci/pci_host_generic_fdt.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 02:43:34 2018 (r340596) +++ head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 02:55:18 2018 (r340597) @@ -152,6 +152,9 @@ pci_host_generic_attach(device_t dev) device_printf(dev, "Bus is%s cache-coherent\n", sc->base.coherent ? "" : " not"); + /* TODO parse FDT bus ranges */ + sc->base.bus_start = 0; + sc->base.bus_end = 0xFF; error = pci_host_generic_core_attach(dev); if (error != 0) return (error); From owner-svn-src-head@freebsd.org Mon Nov 19 03:02:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D373E1131C64; Mon, 19 Nov 2018 03:02:51 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73B597DF34; Mon, 19 Nov 2018 03:02:49 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EE6A1C543; Mon, 19 Nov 2018 03:02:49 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ32nBi018554; Mon, 19 Nov 2018 03:02:49 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ32mfk018549; Mon, 19 Nov 2018 03:02:48 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190302.wAJ32mfk018549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 03:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340598 - in head/sys: arm/arm dev/acpica X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: in head/sys: arm/arm dev/acpica X-SVN-Commit-Revision: 340598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73B597DF34 X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.252,0]; NEURAL_SPAM_MEDIUM(0.15)[0.154,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 03:02:52 -0000 Author: jchandra Date: Mon Nov 19 03:02:47 2018 New Revision: 340598 URL: https://svnweb.freebsd.org/changeset/base/340598 Log: acpica: rework INTRNG interrupts On arm64 (where INTRNG is enabled), the interrupts have to be mapped with ACPI_BUS_MAP_INTR() before adding them as resources to devices. The earlier code did the mapping before calling acpi_set_resource(), which bypassed code that checked for PCI link interrupts. To fix this, move the call to map interrupts into acpi_set_resource() and that requires additional work to lookup interrupt properties. The changes here are to: * extend acpi_lookup_irq_handler() to lookup an irq in the ACPI resources * create a helper function acpi_map_intr() which uses the updated acpi_lookup_irq_handler() to look up an irq, and then map it with ACPI_BUS_MAP_INTR() * use acpi_map_intr() in acpi_pcib_route_interrupt() to map pci link interrupts. With these changes, we can drop the ifdefs in acpi_resource.c, and we can also drop the call for mapping interrupts in generic_timer.c Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17790 Modified: head/sys/arm/arm/generic_timer.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_pcib.c head/sys/dev/acpica/acpi_resource.c head/sys/dev/acpica/acpivar.h Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Mon Nov 19 02:55:18 2018 (r340597) +++ head/sys/arm/arm/generic_timer.c Mon Nov 19 03:02:47 2018 (r340598) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #ifdef DEV_ACPI #include #include -#include "acpi_bus_if.h" #endif #define GT_CTRL_ENABLE (1 << 0) @@ -340,8 +339,6 @@ static void arm_tmr_acpi_add_irq(device_t parent, device_t dev, int rid, u_int irq) { - irq = ACPI_BUS_MAP_INTR(parent, dev, irq, - INTR_TRIGGER_LEVEL, INTR_POLARITY_HIGH); BUS_SET_RESOURCE(parent, dev, SYS_RES_IRQ, rid, irq, 1); } Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Nov 19 02:55:18 2018 (r340597) +++ head/sys/dev/acpica/acpi.c Mon Nov 19 03:02:47 2018 (r340598) @@ -1319,6 +1319,13 @@ acpi_set_resource(device_t dev, device_t child, int ty } #endif +#ifdef INTRNG + /* map with default for now */ + if (type == SYS_RES_IRQ) + start = (rman_res_t)acpi_map_intr(child, (u_int)start, + acpi_get_handle(child)); +#endif + /* If the resource is already allocated, fail. */ if (resource_list_busy(rl, type, rid)) return (EBUSY); Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Mon Nov 19 02:55:18 2018 (r340597) +++ head/sys/dev/acpica/acpi_pcib.c Mon Nov 19 03:02:47 2018 (r340598) @@ -188,6 +188,7 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + lnkdev = NULL; interrupt = PCI_INVALID_IRQ; /* ACPI numbers pins 0-3, not 1-4 like the BIOS. */ @@ -252,7 +253,12 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, out: ACPI_SERIAL_END(pcib); - +#ifdef INTRNG + if (PCI_INTERRUPT_VALID(interrupt)) { + interrupt = acpi_map_intr(dev, interrupt, lnkdev); + KASSERT(PCI_INTERRUPT_VALID(interrupt), ("mapping fail")); + } +#endif return_VALUE(interrupt); } Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Mon Nov 19 02:55:18 2018 (r340597) +++ head/sys/dev/acpica/acpi_resource.c Mon Nov 19 03:02:47 2018 (r340598) @@ -55,10 +55,13 @@ ACPI_MODULE_NAME("RESOURCE") struct lookup_irq_request { ACPI_RESOURCE *acpi_res; - struct resource *res; + u_int irq; int counter; int rid; int found; + int checkrid; + int trig; + int pol; }; static ACPI_STATUS @@ -66,18 +69,22 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *cont { struct lookup_irq_request *req; size_t len; - u_int irqnum, irq; + u_int irqnum, irq, trig, pol; switch (res->Type) { case ACPI_RESOURCE_TYPE_IRQ: irqnum = res->Data.Irq.InterruptCount; irq = res->Data.Irq.Interrupts[0]; len = ACPI_RS_SIZE(ACPI_RESOURCE_IRQ); + trig = res->Data.Irq.Triggering; + pol = res->Data.Irq.Polarity; break; case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: irqnum = res->Data.ExtendedIrq.InterruptCount; irq = res->Data.ExtendedIrq.Interrupts[0]; len = ACPI_RS_SIZE(ACPI_RESOURCE_EXTENDED_IRQ); + trig = res->Data.ExtendedIrq.Triggering; + pol = res->Data.ExtendedIrq.Polarity; break; default: return (AE_OK); @@ -85,14 +92,21 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *cont if (irqnum != 1) return (AE_OK); req = (struct lookup_irq_request *)context; - if (req->counter != req->rid) { - req->counter++; - return (AE_OK); + if (req->checkrid) { + if (req->counter != req->rid) { + req->counter++; + return (AE_OK); + } + KASSERT(irq == req->irq, ("IRQ resources do not match")); + } else { + if (req->irq != irq) + return (AE_OK); } req->found = 1; - KASSERT(irq == rman_get_start(req->res), - ("IRQ resources do not match")); - bcopy(res, req->acpi_res, len); + req->pol = pol; + req->trig = trig; + if (req->acpi_res != NULL) + bcopy(res, req->acpi_res, len); return (AE_CTRL_TERMINATE); } @@ -104,10 +118,11 @@ acpi_lookup_irq_resource(device_t dev, int rid, struct ACPI_STATUS status; req.acpi_res = acpi_res; - req.res = res; + req.irq = rman_get_start(res); req.counter = 0; req.rid = rid; req.found = 0; + req.checkrid = 1; status = AcpiWalkResources(acpi_get_handle(dev), "_CRS", acpi_lookup_irq_handler, &req); if (ACPI_SUCCESS(status) && req.found == 0) @@ -155,6 +170,34 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res) INTR_POLARITY_HIGH : INTR_POLARITY_LOW); } +#ifdef INTRNG +int +acpi_map_intr(device_t dev, u_int irq, ACPI_HANDLE handle) +{ + struct lookup_irq_request req; + int trig, pol; + + trig = ACPI_LEVEL_SENSITIVE; + pol = ACPI_ACTIVE_HIGH; + if (handle != NULL) { + req.found = 0; + req.acpi_res = NULL; + req.irq = irq; + req.counter = 0; + req.rid = 0; + req.checkrid = 0; + AcpiWalkResources(handle, "_CRS", acpi_lookup_irq_handler, &req); + if (req.found != 0) { + trig = req.trig; + pol = req.pol; + } + } + return ACPI_BUS_MAP_INTR(device_get_parent(dev), dev, irq, + (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, + (pol == ACPI_ACTIVE_HIGH) ? INTR_POLARITY_HIGH : INTR_POLARITY_LOW); +} +#endif + struct acpi_resource_context { struct acpi_parse_resource_set *set; device_t dev; @@ -591,13 +634,7 @@ acpi_res_set_irq(device_t dev, void *context, uint8_t if (count != 1) return; -#ifdef INTRNG - intr = ACPI_BUS_MAP_INTR(device_get_parent(dev), dev, *irq, - (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, - (pol == ACPI_ACTIVE_HIGH) ? INTR_POLARITY_HIGH : INTR_POLARITY_LOW); -#else intr = *irq; -#endif bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, intr, 1); } @@ -615,13 +652,7 @@ acpi_res_set_ext_irq(device_t dev, void *context, uint if (count != 1) return; -#ifdef INTRNG - intr = ACPI_BUS_MAP_INTR(device_get_parent(dev), dev, *irq, - (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, - (pol == ACPI_ACTIVE_HIGH) ? INTR_POLARITY_HIGH : INTR_POLARITY_LOW); -#else intr = *irq; -#endif bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, intr, 1); } Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Mon Nov 19 02:55:18 2018 (r340597) +++ head/sys/dev/acpica/acpivar.h Mon Nov 19 03:02:47 2018 (r340598) @@ -403,6 +403,9 @@ extern struct acpi_parse_resource_set acpi_res_parse_s int acpi_identify(void); void acpi_config_intr(device_t dev, ACPI_RESOURCE *res); +#ifdef INTRNG +int acpi_map_intr(device_t dev, u_int irq, ACPI_HANDLE handle); +#endif ACPI_STATUS acpi_lookup_irq_resource(device_t dev, int rid, struct resource *res, ACPI_RESOURCE *acpi_res); ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle, From owner-svn-src-head@freebsd.org Mon Nov 19 03:16:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A107A11320BC; Mon, 19 Nov 2018 03:16:17 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42AA57E664; Mon, 19 Nov 2018 03:16:17 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15EA31C6EC; Mon, 19 Nov 2018 03:16:17 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ3GGwo023823; Mon, 19 Nov 2018 03:16:16 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ3GG7s023821; Mon, 19 Nov 2018 03:16:16 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190316.wAJ3GG7s023821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 03:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340599 - in head/sys/dev: acpica pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: in head/sys/dev: acpica pci X-SVN-Commit-Revision: 340599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42AA57E664 X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.256,0]; NEURAL_SPAM_MEDIUM(0.16)[0.162,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 03:16:17 -0000 Author: jchandra Date: Mon Nov 19 03:16:16 2018 New Revision: 340599 URL: https://svnweb.freebsd.org/changeset/base/340599 Log: acpica, pci_host_generic_acpi: redo pci_host_generic_acpi.c This is a major update for pci_host_generic_acpi.c, the current implementation has some gaps that are better fixed up in one go. The changes are to: * Follow x86 method of not adding PCI resources to PCI host bridge in ACPI code. This has been moved to pci_host_generic_acpi.c, where we walk thru its resources of the host bridge and add them. * Fixup code in pci_host_generic_acpi.c to read all decoded ranges and update the 'ranges' property. This allows us to share most of the code with generic implementation (and the FDT one). * Parse and setup IO ranges and bus ranges when walking the resources above. Drop most of the changes related to this from acpica code. * Add the ECAM memory area as mem resource 0. Implement the logic to get the ECAM area from MCFG (using bus range which we now decode), or from _CBA (using _BBN/bus range). Drop aarch64 ifdefs from acpica code which did part of this. * Switch resource activation to similar code as FDT implementation, this can be moved into generic implementation in a later pass. * Drop the mechanism of using the 7th bit of bus number as the domain, this is not correct and will work only in very specific cases. Use _SEG as PCI domain and use the bus ranges of the host bridge to provide start bus number. This commit should not make any functional change to dev/acpica/acpi.c for other architectures, almost all the changes there are to revert earlier additions in this file done for aarch64. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17791 Modified: head/sys/dev/acpica/acpi.c head/sys/dev/pci/pci_host_generic_acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Nov 19 03:02:47 2018 (r340598) +++ head/sys/dev/acpica/acpi.c Mon Nov 19 03:16:16 2018 (r340599) @@ -179,9 +179,7 @@ static int acpi_child_location_str_method(device_t acd char *buf, size_t buflen); static int acpi_child_pnpinfo_str_method(device_t acdev, device_t child, char *buf, size_t buflen); -#if defined(__i386__) || defined(__amd64__) static void acpi_enable_pcie(void); -#endif static void acpi_hint_device_unit(device_t acdev, device_t child, const char *name, int *unitp); static void acpi_reset_interfaces(device_t dev); @@ -502,10 +500,8 @@ acpi_attach(device_t dev) goto out; } -#if defined(__i386__) || defined(__amd64__) /* Handle MCFG table if present. */ acpi_enable_pcie(); -#endif /* * Note that some systems (specifically, those with namespace evaluation @@ -1286,11 +1282,10 @@ acpi_set_resource(device_t dev, device_t child, int ty struct acpi_softc *sc = device_get_softc(dev); struct acpi_device *ad = device_get_ivars(child); struct resource_list *rl = &ad->ad_rl; -#if defined(__i386__) || defined(__amd64__) ACPI_DEVICE_INFO *devinfo; -#endif rman_res_t end; - + int allow; + /* Ignore IRQ resources for PCI link devices. */ if (type == SYS_RES_IRQ && ACPI_ID_PROBE(dev, child, pcilink_ids, NULL) <= 0) @@ -1305,11 +1300,15 @@ acpi_set_resource(device_t dev, device_t child, int ty * x86 of a PCI bridge claiming the I/O ports used for PCI config * access. */ -#if defined(__i386__) || defined(__amd64__) if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) { if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { - if (!(type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT)) { +#if defined(__i386__) || defined(__amd64__) + allow = (type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT); +#else + allow = 0; +#endif + if (!allow) { AcpiOsFree(devinfo); return (0); } @@ -1317,7 +1316,6 @@ acpi_set_resource(device_t dev, device_t child, int ty AcpiOsFree(devinfo); } } -#endif #ifdef INTRNG /* map with default for now */ @@ -1874,15 +1872,18 @@ acpi_isa_pnp_probe(device_t bus, device_t child, struc return_VALUE (result); } -#if defined(__i386__) || defined(__amd64__) /* * Look for a MCFG table. If it is present, use the settings for * domain (segment) 0 to setup PCI config space access via the memory * map. + * + * On non-x86 architectures (arm64 for now), this will be done from the + * PCI host bridge driver. */ static void acpi_enable_pcie(void) { +#if defined(__i386__) || defined(__amd64__) ACPI_TABLE_HEADER *hdr; ACPI_MCFG_ALLOCATION *alloc, *end; ACPI_STATUS status; @@ -1901,32 +1902,9 @@ acpi_enable_pcie(void) } alloc++; } +#endif } -#elif defined(__aarch64__) -static void -acpi_enable_pcie(device_t child, int segment) -{ - ACPI_TABLE_HEADER *hdr; - ACPI_MCFG_ALLOCATION *alloc, *end; - ACPI_STATUS status; - status = AcpiGetTable(ACPI_SIG_MCFG, 1, &hdr); - if (ACPI_FAILURE(status)) - return; - - end = (ACPI_MCFG_ALLOCATION *)((char *)hdr + hdr->Length); - alloc = (ACPI_MCFG_ALLOCATION *)((ACPI_TABLE_MCFG *)hdr + 1); - while (alloc < end) { - if (alloc->PciSegment == segment) { - bus_set_resource(child, SYS_RES_MEMORY, 0, - alloc->Address, 0x10000000); - return; - } - alloc++; - } -} -#endif - /* * Scan all of the ACPI namespace and attach child devices. * @@ -2016,9 +1994,6 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi { ACPI_DEVICE_INFO *devinfo; struct acpi_device *ad; -#ifdef __aarch64__ - int segment; -#endif struct acpi_prw_data prw; ACPI_OBJECT_TYPE type; ACPI_HANDLE h; @@ -2121,13 +2096,6 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi ad->ad_cls_class = strtoul(devinfo->ClassCode.String, NULL, 16); } -#ifdef __aarch64__ - if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { - if (ACPI_SUCCESS(acpi_GetInteger(handle, "_SEG", &segment))) { - acpi_enable_pcie(child, segment); - } - } -#endif AcpiOsFree(devinfo); } break; Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 03:02:47 2018 (r340598) +++ head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 03:16:16 2018 (r340599) @@ -63,9 +63,8 @@ __FBSDID("$FreeBSD$"); #include #include "pcib_if.h" +#include "acpi_bus_if.h" -int pci_host_generic_acpi_attach(device_t); - /* Assembling ECAM Configuration Address */ #define PCIE_BUS_SHIFT 20 #define PCIE_SLOT_SHIFT 15 @@ -100,6 +99,9 @@ static int generic_pcie_acpi_probe(device_t dev); static ACPI_STATUS pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *, void *); static int generic_pcie_acpi_read_ivar(device_t, device_t, int, uintptr_t *); +/* + * generic_pcie_acpi_probe - look for root bridge flag + */ static int generic_pcie_acpi_probe(device_t dev) { @@ -119,81 +121,201 @@ generic_pcie_acpi_probe(device_t dev) return (BUS_PROBE_GENERIC); } -int -pci_host_generic_acpi_attach(device_t dev) +/* + * pci_host_generic_acpi_parse_resource - parse PCI memory, IO and bus spaces + * 'produced' by this bridge + */ +static ACPI_STATUS +pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *res, void *arg) { + device_t dev = (device_t)arg; struct generic_pcie_acpi_softc *sc; + struct rman *rm; + rman_res_t min, max, off; + int r; + + rm = NULL; + sc = device_get_softc(dev); + r = sc->base.nranges; + switch (res->Type) { + case ACPI_RESOURCE_TYPE_ADDRESS16: + min = res->Data.Address16.Address.Minimum; + max = res->Data.Address16.Address.Maximum; + break; + case ACPI_RESOURCE_TYPE_ADDRESS32: + min = res->Data.Address32.Address.Minimum; + max = res->Data.Address32.Address.Maximum; + off = res->Data.Address32.Address.TranslationOffset; + break; + case ACPI_RESOURCE_TYPE_ADDRESS64: + if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE) + break; + min = res->Data.Address64.Address.Minimum; + max = res->Data.Address64.Address.Maximum; + off = res->Data.Address64.Address.TranslationOffset; + break; + default: + return (AE_OK); + } + + /* Save detected ranges */ + if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE || + res->Data.Address.ResourceType == ACPI_IO_RANGE) { + sc->base.ranges[r].pci_base = min; + sc->base.ranges[r].phys_base = min + off; + sc->base.ranges[r].size = max - min + 1; + if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) + sc->base.ranges[r].flags |= FLAG_MEM; + else if (res->Data.Address.ResourceType == ACPI_IO_RANGE) + sc->base.ranges[r].flags |= FLAG_IO; + sc->base.nranges++; + } else if (res->Data.Address.ResourceType == ACPI_BUS_NUMBER_RANGE) { + sc->base.bus_start = min; + sc->base.bus_end = max; + } + return (AE_OK); +} + +static int +pci_host_acpi_get_ecam_resource(device_t dev) +{ + struct generic_pcie_acpi_softc *sc; + struct acpi_device *ad; + struct resource_list *rl; + ACPI_TABLE_HEADER *hdr; + ACPI_MCFG_ALLOCATION *mcfg_entry, *mcfg_end; ACPI_HANDLE handle; ACPI_STATUS status; - int error, bus_start; + rman_res_t base, start, end; + int found, val; sc = device_get_softc(dev); + handle = acpi_get_handle(dev); + /* Try MCFG first */ + status = AcpiGetTable(ACPI_SIG_MCFG, 1, &hdr); + if (ACPI_SUCCESS(status)) { + found = FALSE; + mcfg_end = (ACPI_MCFG_ALLOCATION *)((char *)hdr + hdr->Length); + mcfg_entry = (ACPI_MCFG_ALLOCATION *)((ACPI_TABLE_MCFG *)hdr + 1); + while (mcfg_entry < mcfg_end && !found) { + if (mcfg_entry->PciSegment == sc->base.ecam && + mcfg_entry->StartBusNumber <= sc->base.bus_start && + mcfg_entry->EndBusNumber >= sc->base.bus_start) + found = TRUE; + else + mcfg_entry++; + } + if (found) { + if (mcfg_entry->EndBusNumber < sc->base.bus_end) { + device_printf(dev, "bus end mismatch! expected %d found %d.\n", + sc->base.bus_end, (int)mcfg_entry->EndBusNumber); + sc->base.bus_end = mcfg_entry->EndBusNumber; + } + base = mcfg_entry->Address; + } else { + device_printf(dev, "MCFG exists, but does not have bus %d-%d\n", + sc->base.bus_start, sc->base.bus_end); + return (ENXIO); + } + } else { + status = acpi_GetInteger(handle, "_CBA", &val); + if (ACPI_SUCCESS(status)) + base = val; + else + return (ENXIO); + } + + /* add as MEM rid 0 */ + ad = device_get_ivars(dev); + rl = &ad->ad_rl; + start = base + (sc->base.bus_start << PCIE_BUS_SHIFT); + end = base + ((sc->base.bus_end + 1) << PCIE_BUS_SHIFT) - 1; + resource_list_add(rl, SYS_RES_MEMORY, 0, start, end, end - start + 1); + if (bootverbose) + device_printf(dev, "ECAM for bus %d-%d at mem %jx-%jx\n", + sc->base.bus_start, sc->base.bus_end, start, end); + return (0); +} + +static int +pci_host_generic_acpi_attach(device_t dev) +{ + struct generic_pcie_acpi_softc *sc; + ACPI_HANDLE handle; + uint64_t phys_base; + uint64_t pci_base; + uint64_t size; + ACPI_STATUS status; + int error; + int tuple; + + sc = device_get_softc(dev); handle = acpi_get_handle(dev); + + /* Get Start bus number for the PCI host bus is from _BBN method */ + status = acpi_GetInteger(handle, "_BBN", &sc->base.bus_start); + if (ACPI_FAILURE(status)) { + device_printf(dev, "No _BBN, using start bus 0\n"); + sc->base.bus_start = 0; + } + sc->base.bus_end = 255; + + /* Get PCI Segment (domain) needed for MCFG lookup */ + status = acpi_GetInteger(handle, "_SEG", &sc->base.ecam); + if (ACPI_FAILURE(status)) { + device_printf(dev, "No _SEG for PCI Bus, using segment 0\n"); + sc->base.ecam = 0; + } + + /* Bus decode ranges */ + status = AcpiWalkResources(handle, "_CRS", + pci_host_generic_acpi_parse_resource, (void *)dev); + if (ACPI_FAILURE(status)) + return (ENXIO); + + /* Coherency attribute */ if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", &sc->base.coherent))) sc->base.coherent = 0; if (bootverbose) device_printf(dev, "Bus is%s cache-coherent\n", sc->base.coherent ? "" : " not"); - if (!ACPI_FAILURE(acpi_GetInteger(handle, "_BBN", &bus_start))) { - sc->base.ecam = bus_start >> 7; - sc->base.bus_start = bus_start & 0x7F; - } else { - sc->base.ecam = 0; - sc->base.bus_start = 0; - } - sc->base.bus_end = 0xFF; - + /* add config space resource */ + pci_host_acpi_get_ecam_resource(dev); acpi_pcib_fetch_prt(dev, &sc->ap_prt); error = pci_host_generic_core_attach(dev); if (error != 0) return (error); - status = AcpiWalkResources(handle, "_CRS", - pci_host_generic_acpi_parse_resource, (void *)dev); + for (tuple = 0; tuple < MAX_RANGES_TUPLES; tuple++) { + phys_base = sc->base.ranges[tuple].phys_base; + pci_base = sc->base.ranges[tuple].pci_base; + size = sc->base.ranges[tuple].size; + if (phys_base == 0 || size == 0) + continue; /* empty range element */ + if (sc->base.ranges[tuple].flags & FLAG_MEM) { + error = rman_manage_region(&sc->base.mem_rman, + phys_base, phys_base + size - 1); + } else if (sc->base.ranges[tuple].flags & FLAG_IO) { + error = rman_manage_region(&sc->base.io_rman, + pci_base + PCI_IO_WINDOW_OFFSET, + pci_base + PCI_IO_WINDOW_OFFSET + size - 1); + } else + continue; + if (error) { + device_printf(dev, "rman_manage_region() failed." + "error = %d\n", error); + rman_fini(&sc->base.mem_rman); + return (error); + } + } - if (ACPI_FAILURE(status)) - return (ENXIO); - device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); } -static ACPI_STATUS -pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *res, void *arg) -{ - device_t dev = (device_t)arg; - struct generic_pcie_acpi_softc *sc; - rman_res_t min, max; - int error; - - switch (res->Type) { - case ACPI_RESOURCE_TYPE_ADDRESS32: - min = (rman_res_t)res->Data.Address32.Address.Minimum; - max = (rman_res_t)res->Data.Address32.Address.Maximum; - break; - case ACPI_RESOURCE_TYPE_ADDRESS64: - min = (rman_res_t)res->Data.Address64.Address.Minimum; - max = (rman_res_t)res->Data.Address64.Address.Maximum; - break; - default: - return (AE_OK); - } - - sc = device_get_softc(dev); - - error = rman_manage_region(&sc->base.mem_rman, min, max); - if (error) { - device_printf(dev, "unable to allocate %lx-%lx range\n", min, max); - return (AE_NOT_FOUND); - } - device_printf(dev, "allocating %lx-%lx range\n", min, max); - - return (AE_OK); -} - static int generic_pcie_acpi_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) @@ -203,7 +325,7 @@ generic_pcie_acpi_read_ivar(device_t dev, device_t chi sc = device_get_softc(dev); if (index == PCIB_IVAR_BUS) { - *result = sc->base.ecam * 0x80 + sc->base.bus_start; + *result = sc->base.bus_start; return (0); } @@ -223,50 +345,62 @@ generic_pcie_acpi_route_interrupt(device_t bus, device struct generic_pcie_acpi_softc *sc; sc = device_get_softc(bus); - return (acpi_pcib_route_interrupt(bus, dev, pin, &sc->ap_prt)); } -static struct resource * -pci_host_generic_acpi_alloc_resource(device_t dev, device_t child, int type, - int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct resource *res = NULL; - -#if defined(NEW_PCIB) && defined(PCI_RES_BUS) - struct generic_pcie_acpi_softc *sc; - - if (type == PCI_RES_BUS) { - sc = device_get_softc(dev); - return (pci_domain_alloc_bus(sc->base.ecam, child, rid, start, - end, count, flags)); - } -#endif - - if (type == SYS_RES_MEMORY) - res = pci_host_generic_core_alloc_resource(dev, child, type, - rid, start, end, count, flags); - - if (res == NULL) - res = bus_generic_alloc_resource(dev, child, type, rid, start, end, - count, flags); - - return (res); -} - +/* + * Follow logic of FDT activate + */ static int generic_pcie_acpi_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { struct generic_pcie_acpi_softc *sc; + uint64_t phys_base; + uint64_t pci_base; + uint64_t size; + int found; int res; + int i; sc = device_get_softc(dev); if ((res = rman_activate_resource(r)) != 0) return (res); - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid,r); + switch (type) { + case SYS_RES_IOPORT: + found = 0; + for (i = 0; i < MAX_RANGES_TUPLES; i++) { + pci_base = sc->base.ranges[i].pci_base; + phys_base = sc->base.ranges[i].phys_base; + size = sc->base.ranges[i].size; + + if ((rid > pci_base) && (rid < (pci_base + size))) { + found = 1; + break; + } + } + if (found) { + rman_set_start(r, rman_get_start(r) + phys_base); + rman_set_end(r, rman_get_end(r) + phys_base); + res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), + child, type, rid, r); + } else { + device_printf(dev, + "Failed to activate IOPORT resource\n"); + res = 0; + } + break; + case SYS_RES_MEMORY: + case SYS_RES_IRQ: + res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, + type, rid, r); + break; + default: + break; + } + return (res); } @@ -279,8 +413,17 @@ generic_pcie_acpi_deactivate_resource(device_t dev, de if ((res = rman_deactivate_resource(r)) != 0) return (res); - res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, type, - rid, r); + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + case SYS_RES_IRQ: + res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, + type, rid, r); + break; + default: + break; + } + return (res); } @@ -347,30 +490,25 @@ static int generic_pcie_acpi_get_id(device_t pci, device_t child, enum pci_id_type type, uintptr_t *id) { - struct generic_pcie_acpi_softc *sc; - int err; - /* Use the PCI RID to find the MSI ID */ - if (type == PCI_ID_MSI) { - sc = device_get_softc(pci); - type = PCI_ID_RID; - err = pcib_get_id(pci, child, type, id); - if (err != 0) - return (err); - *id |= sc->base.ecam << 16; - return (0); - } - - return (pcib_get_id(pci, child, type, id)); + /* + * Use the PCI RID to find the MSI ID for now, we support only 1:1 + * mapping + * + * On aarch64, more complex mapping would come from IORT table + */ + if (type == PCI_ID_MSI) + return (pcib_get_id(pci, child, PCI_ID_RID, id)); + else + return (pcib_get_id(pci, child, type, id)); } static device_method_t generic_pcie_acpi_methods[] = { DEVMETHOD(device_probe, generic_pcie_acpi_probe), DEVMETHOD(device_attach, pci_host_generic_acpi_attach), - DEVMETHOD(bus_alloc_resource, pci_host_generic_acpi_alloc_resource), - DEVMETHOD(bus_activate_resource, generic_pcie_acpi_activate_resource), - DEVMETHOD(bus_deactivate_resource, generic_pcie_acpi_deactivate_resource), DEVMETHOD(bus_read_ivar, generic_pcie_acpi_read_ivar), + DEVMETHOD(bus_activate_resource, generic_pcie_acpi_activate_resource), + DEVMETHOD(bus_deactivate_resource,generic_pcie_acpi_deactivate_resource), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, generic_pcie_acpi_route_interrupt), From owner-svn-src-head@freebsd.org Mon Nov 19 03:34:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3882E11325B5; Mon, 19 Nov 2018 03:34:16 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC4E37F32E; Mon, 19 Nov 2018 03:34:15 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD6DA1CA2D; Mon, 19 Nov 2018 03:34:15 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ3YFRc033921; Mon, 19 Nov 2018 03:34:15 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ3YFMY033919; Mon, 19 Nov 2018 03:34:15 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190334.wAJ3YFMY033919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 03:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340600 - in head/sys/dev: acpica pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: in head/sys/dev: acpica pci X-SVN-Commit-Revision: 340600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC4E37F32E X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.24)[0.244,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 03:34:16 -0000 Author: jchandra Date: Mon Nov 19 03:34:15 2018 New Revision: 340600 URL: https://svnweb.freebsd.org/changeset/base/340600 Log: pci_host_generic, acpi_resource: drop unneeded code Now that we are handling PCI resources in pci_host_generic_acpi.c, we don't need these change (made by r336129) Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17792 Modified: head/sys/dev/acpica/acpi_resource.c head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Mon Nov 19 03:16:16 2018 (r340599) +++ head/sys/dev/acpica/acpi_resource.c Mon Nov 19 03:34:15 2018 (r340600) @@ -602,10 +602,6 @@ acpi_res_set_memory(device_t dev, void *context, uint6 if (cp == NULL) return; - - while (bus_get_resource_start(dev, SYS_RES_MEMORY, cp->ar_nmem)) - cp->ar_nmem++; - bus_set_resource(dev, SYS_RES_MEMORY, cp->ar_nmem++, base, length); } Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Nov 19 03:16:16 2018 (r340599) +++ head/sys/dev/pci/pci_host_generic.c Mon Nov 19 03:34:15 2018 (r340600) @@ -107,7 +107,7 @@ pci_host_generic_core_attach(device_t dev) return (error); rid = 0; - sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE | RF_SHAREABLE); + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->res == NULL) { device_printf(dev, "could not map memory.\n"); return (ENXIO); From owner-svn-src-head@freebsd.org Mon Nov 19 03:43:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DAA111328EA; Mon, 19 Nov 2018 03:43:12 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3EEC7F883; Mon, 19 Nov 2018 03:43:11 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 652FA1CBE6; Mon, 19 Nov 2018 03:43:11 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ3hBaX039230; Mon, 19 Nov 2018 03:43:11 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ3hAdN039226; Mon, 19 Nov 2018 03:43:10 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190343.wAJ3hAdN039226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 03:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340601 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 340601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A3EEC7F883 X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.252,0]; NEURAL_SPAM_MEDIUM(0.15)[0.154,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 03:43:12 -0000 Author: jchandra Date: Mon Nov 19 03:43:10 2018 New Revision: 340601 URL: https://svnweb.freebsd.org/changeset/base/340601 Log: pci_host_generic : move activate/release to generic code Now that the ACPI and FDT implementations for activating and deactivating resources are the same, we can move it to pci_host_generic.c. No functional changes. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17793 Modified: head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic_acpi.c head/sys/dev/pci/pci_host_generic_fdt.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Mon Nov 19 03:34:15 2018 (r340600) +++ head/sys/dev/pci/pci_host_generic.c Mon Nov 19 03:43:10 2018 (r340601) @@ -341,6 +341,82 @@ fail: } static int +generic_pcie_activate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r) +{ + struct generic_pcie_core_softc *sc; + uint64_t phys_base; + uint64_t pci_base; + uint64_t size; + int found; + int res; + int i; + + sc = device_get_softc(dev); + + if ((res = rman_activate_resource(r)) != 0) + return (res); + + switch (type) { + case SYS_RES_IOPORT: + found = 0; + for (i = 0; i < MAX_RANGES_TUPLES; i++) { + pci_base = sc->ranges[i].pci_base; + phys_base = sc->ranges[i].phys_base; + size = sc->ranges[i].size; + + if ((rid > pci_base) && (rid < (pci_base + size))) { + found = 1; + break; + } + } + if (found) { + rman_set_start(r, rman_get_start(r) + phys_base); + rman_set_end(r, rman_get_end(r) + phys_base); + res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), + child, type, rid, r); + } else { + device_printf(dev, + "Failed to activate IOPORT resource\n"); + res = 0; + } + break; + case SYS_RES_MEMORY: + case SYS_RES_IRQ: + res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, + type, rid, r); + break; + default: + break; + } + + return (res); +} + +static int +generic_pcie_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r) +{ + int res; + + if ((res = rman_deactivate_resource(r)) != 0) + return (res); + + switch (type) { + case SYS_RES_IOPORT: + case SYS_RES_MEMORY: + case SYS_RES_IRQ: + res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, + type, rid, r); + break; + default: + break; + } + + return (res); +} + +static int generic_pcie_adjust_resource(device_t dev, device_t child, int type, struct resource *res, rman_res_t start, rman_res_t end) { @@ -375,6 +451,8 @@ static device_method_t generic_pcie_methods[] = { DEVMETHOD(bus_write_ivar, generic_pcie_write_ivar), DEVMETHOD(bus_alloc_resource, pci_host_generic_core_alloc_resource), DEVMETHOD(bus_adjust_resource, generic_pcie_adjust_resource), + DEVMETHOD(bus_activate_resource, generic_pcie_activate_resource), + DEVMETHOD(bus_deactivate_resource, generic_pcie_deactivate_resource), DEVMETHOD(bus_release_resource, pci_host_generic_core_release_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 03:34:15 2018 (r340600) +++ head/sys/dev/pci/pci_host_generic_acpi.c Mon Nov 19 03:43:10 2018 (r340601) @@ -348,86 +348,7 @@ generic_pcie_acpi_route_interrupt(device_t bus, device return (acpi_pcib_route_interrupt(bus, dev, pin, &sc->ap_prt)); } -/* - * Follow logic of FDT activate - */ static int -generic_pcie_acpi_activate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r) -{ - struct generic_pcie_acpi_softc *sc; - uint64_t phys_base; - uint64_t pci_base; - uint64_t size; - int found; - int res; - int i; - - sc = device_get_softc(dev); - - if ((res = rman_activate_resource(r)) != 0) - return (res); - - switch (type) { - case SYS_RES_IOPORT: - found = 0; - for (i = 0; i < MAX_RANGES_TUPLES; i++) { - pci_base = sc->base.ranges[i].pci_base; - phys_base = sc->base.ranges[i].phys_base; - size = sc->base.ranges[i].size; - - if ((rid > pci_base) && (rid < (pci_base + size))) { - found = 1; - break; - } - } - if (found) { - rman_set_start(r, rman_get_start(r) + phys_base); - rman_set_end(r, rman_get_end(r) + phys_base); - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), - child, type, rid, r); - } else { - device_printf(dev, - "Failed to activate IOPORT resource\n"); - res = 0; - } - break; - case SYS_RES_MEMORY: - case SYS_RES_IRQ: - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; - default: - break; - } - - return (res); -} - -static int -generic_pcie_acpi_deactivate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r) -{ - int res; - - if ((res = rman_deactivate_resource(r)) != 0) - return (res); - - switch (type) { - case SYS_RES_IOPORT: - case SYS_RES_MEMORY: - case SYS_RES_IRQ: - res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; - default: - break; - } - - return (res); -} - -static int generic_pcie_acpi_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) { @@ -507,8 +428,6 @@ static device_method_t generic_pcie_acpi_methods[] = { DEVMETHOD(device_probe, generic_pcie_acpi_probe), DEVMETHOD(device_attach, pci_host_generic_acpi_attach), DEVMETHOD(bus_read_ivar, generic_pcie_acpi_read_ivar), - DEVMETHOD(bus_activate_resource, generic_pcie_acpi_activate_resource), - DEVMETHOD(bus_deactivate_resource,generic_pcie_acpi_deactivate_resource), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, generic_pcie_acpi_route_interrupt), Modified: head/sys/dev/pci/pci_host_generic_fdt.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 03:34:15 2018 (r340600) +++ head/sys/dev/pci/pci_host_generic_fdt.c Mon Nov 19 03:43:10 2018 (r340601) @@ -385,82 +385,6 @@ pci_host_generic_alloc_resource(device_t dev, device_t } static int -generic_pcie_fdt_activate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r) -{ - struct generic_pcie_fdt_softc *sc; - uint64_t phys_base; - uint64_t pci_base; - uint64_t size; - int found; - int res; - int i; - - sc = device_get_softc(dev); - - if ((res = rman_activate_resource(r)) != 0) - return (res); - - switch(type) { - case SYS_RES_IOPORT: - found = 0; - for (i = 0; i < MAX_RANGES_TUPLES; i++) { - pci_base = sc->base.ranges[i].pci_base; - phys_base = sc->base.ranges[i].phys_base; - size = sc->base.ranges[i].size; - - if ((rid > pci_base) && (rid < (pci_base + size))) { - found = 1; - break; - } - } - if (found) { - rman_set_start(r, rman_get_start(r) + phys_base); - rman_set_end(r, rman_get_end(r) + phys_base); - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), - child, type, rid, r); - } else { - device_printf(dev, - "Failed to activate IOPORT resource\n"); - res = 0; - } - break; - case SYS_RES_MEMORY: - case SYS_RES_IRQ: - res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; - default: - break; - } - - return (res); -} - -static int -generic_pcie_fdt_deactivate_resource(device_t dev, device_t child, int type, - int rid, struct resource *r) -{ - int res; - - if ((res = rman_deactivate_resource(r)) != 0) - return (res); - - switch(type) { - case SYS_RES_IOPORT: - case SYS_RES_MEMORY: - case SYS_RES_IRQ: - res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, - type, rid, r); - break; - default: - break; - } - - return (res); -} - -static int generic_pcie_fdt_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) { @@ -630,8 +554,6 @@ static device_method_t generic_pcie_fdt_methods[] = { DEVMETHOD(device_attach, pci_host_generic_attach), DEVMETHOD(bus_alloc_resource, pci_host_generic_alloc_resource), DEVMETHOD(bus_release_resource, generic_pcie_fdt_release_resource), - DEVMETHOD(bus_activate_resource, generic_pcie_fdt_activate_resource), - DEVMETHOD(bus_deactivate_resource,generic_pcie_fdt_deactivate_resource), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, generic_pcie_fdt_route_interrupt), From owner-svn-src-head@freebsd.org Mon Nov 19 03:52:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE5531132B78; Mon, 19 Nov 2018 03:52:57 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7721B7FD0F; Mon, 19 Nov 2018 03:52:57 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52DBA1CD89; Mon, 19 Nov 2018 03:52:57 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ3qveK044097; Mon, 19 Nov 2018 03:52:57 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ3qvwv044096; Mon, 19 Nov 2018 03:52:57 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201811190352.wAJ3qvwv044096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Mon, 19 Nov 2018 03:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340602 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 340602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7721B7FD0F X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.15)[0.147,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.25)[0.248,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 03:52:58 -0000 Author: jchandra Date: Mon Nov 19 03:52:56 2018 New Revision: 340602 URL: https://svnweb.freebsd.org/changeset/base/340602 Log: gitv3_its: fixes for multiple GIC ITS blocks First pass of support for multiple GIC ITS blocks with ACPI. Changes are to: * register the correct subset of interrupts with pic_register in case of ACPI. * initialize just the cpu interface for the first ITS, when domain information is not avialable. This has to be done until we split the per-CPU init to do LPI setup just once. * remove duplicate check for the GIC ITS domain, the sc_cpus are setup from domain, so the check again in per-CPU init seems unnecessary. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17841 Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Mon Nov 19 03:43:10 2018 (r340601) +++ head/sys/arm64/arm64/gicv3_its.c Mon Nov 19 03:52:56 2018 (r340602) @@ -580,18 +580,11 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc) uint64_t xbaser, tmp; uint32_t ctlr; u_int cpuid; - int domain; - if (!CPU_ISSET(PCPU_GET(cpuid), &sc->sc_cpus)) - return (0); - - if (bus_get_domain(dev, &domain) == 0) { - if (PCPU_GET(domain) != domain) - return (0); - } - gicv3 = device_get_parent(dev); cpuid = PCPU_GET(cpuid); + if (!CPU_ISSET(cpuid, &sc->sc_cpus)) + return (0); /* Check if the ITS is enabled on this CPU */ if ((gic_r_read_4(gicv3, GICR_TYPER) & GICR_TYPER_PLPIS) == 0) { @@ -729,12 +722,14 @@ gicv3_its_attach(device_t dev) /* Protects access to the ITS command circular buffer. */ mtx_init(&sc->sc_its_cmd_lock, "ITS cmd lock", NULL, MTX_SPIN); + CPU_ZERO(&sc->sc_cpus); if (bus_get_domain(dev, &domain) == 0) { - CPU_ZERO(&sc->sc_cpus); if (domain < MAXMEMDOM) CPU_COPY(&cpuset_domain[domain], &sc->sc_cpus); } else { - CPU_COPY(&all_cpus, &sc->sc_cpus); + /* XXX : cannot handle more than one ITS per cpu */ + if (device_get_unit(dev) == 0) + CPU_COPY(&all_cpus, &sc->sc_cpus); } /* Allocate the command circular buffer */ @@ -1737,7 +1732,7 @@ gicv3_its_acpi_attach(device_t dev) sc->sc_pic = intr_pic_register(dev, device_get_unit(dev) + ACPI_MSI_XREF); intr_pic_add_handler(device_get_parent(dev), sc->sc_pic, - gicv3_its_intr, sc, GIC_FIRST_LPI, LPI_NIRQS); + gicv3_its_intr, sc, sc->sc_irq_base, sc->sc_irq_length); /* Register this device to handle MSI interrupts */ intr_msi_register(dev, device_get_unit(dev) + ACPI_MSI_XREF); From owner-svn-src-head@freebsd.org Mon Nov 19 06:48:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 633CD11366E1; Mon, 19 Nov 2018 06:48:49 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F212685B54; Mon, 19 Nov 2018 06:48:48 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD7C01E8F7; Mon, 19 Nov 2018 06:48:48 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ6mmv9031961; Mon, 19 Nov 2018 06:48:48 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ6mmxN031960; Mon, 19 Nov 2018 06:48:48 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201811190648.wAJ6mmxN031960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Mon, 19 Nov 2018 06:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340613 - head/sys/mips/mediatek X-SVN-Group: head X-SVN-Commit-Author: sgalabov X-SVN-Commit-Paths: head/sys/mips/mediatek X-SVN-Commit-Revision: 340613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F212685B54 X-Spamd-Result: default: False [0.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.59)[0.588,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:48:49 -0000 Author: sgalabov Date: Mon Nov 19 06:48:48 2018 New Revision: 340613 URL: https://svnweb.freebsd.org/changeset/base/340613 Log: Fix access to cpu_model[] in mtk_soc_set_cpu_model() There may be cases where cpu_model[] may not be 32bit aligned, so it is better to not try to access it as such in order to avoid unaligned access. Sponsored by: Smartcom - Bulgaria AD Modified: head/sys/mips/mediatek/mtk_soc.c Modified: head/sys/mips/mediatek/mtk_soc.c ============================================================================== --- head/sys/mips/mediatek/mtk_soc.c Mon Nov 19 06:39:00 2018 (r340612) +++ head/sys/mips/mediatek/mtk_soc.c Mon Nov 19 06:48:48 2018 (r340613) @@ -401,7 +401,9 @@ extern char cpu_model[]; void mtk_soc_set_cpu_model(void) { - uint32_t *p_model = (uint32_t *)cpu_model; + int idx, offset = sizeof(mtk_soc_chipid0_3); + char *chipid0_3 = (char *)(&mtk_soc_chipid0_3); + char *chipid4_7 = (char *)(&mtk_soc_chipid4_7); /* * CHIPID is always 2x32 bit registers, containing the ASCII @@ -411,11 +413,13 @@ mtk_soc_set_cpu_model(void) * it is left at its default value of "unknown " if it could not be * obtained for some reason. */ - p_model[0] = mtk_soc_chipid0_3; - p_model[1] = mtk_soc_chipid4_7; + for (idx = 0; idx < offset; idx++) { + cpu_model[idx] = chipid0_3[idx]; + cpu_model[idx + offset] = chipid4_7[idx]; + } /* Null-terminate the string */ - cpu_model[8] = 0; + cpu_model[2 * offset] = 0; } uint32_t From owner-svn-src-head@freebsd.org Mon Nov 19 07:27:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0032611372D3; Mon, 19 Nov 2018 07:27:51 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96CEC86E2E; Mon, 19 Nov 2018 07:27:51 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 756251EF6D; Mon, 19 Nov 2018 07:27:51 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ7Rpgf052166; Mon, 19 Nov 2018 07:27:51 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ7RpDN052165; Mon, 19 Nov 2018 07:27:51 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811190727.wAJ7RpDN052165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 19 Nov 2018 07:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340617 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 340617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96CEC86E2E X-Spamd-Result: default: False [0.47 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.329,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 07:27:52 -0000 Author: eugen Date: Mon Nov 19 07:27:50 2018 New Revision: 340617 URL: https://svnweb.freebsd.org/changeset/base/340617 Log: Unbreak ng_source(4) for 64-bit platforms including amd64. Modified: head/sys/netgraph/ng_source.c Modified: head/sys/netgraph/ng_source.c ============================================================================== --- head/sys/netgraph/ng_source.c Mon Nov 19 06:52:20 2018 (r340616) +++ head/sys/netgraph/ng_source.c Mon Nov 19 07:27:50 2018 (r340617) @@ -125,8 +125,13 @@ static int ng_source_dup_mod(sc_p, struct mbuf *, /* Parse type for timeval */ static const struct ng_parse_struct_field ng_source_timeval_type_fields[] = { +#ifdef __LP64__ + { "tv_sec", &ng_parse_int64_type }, + { "tv_usec", &ng_parse_int64_type }, +#else { "tv_sec", &ng_parse_int32_type }, { "tv_usec", &ng_parse_int32_type }, +#endif { NULL } }; const struct ng_parse_type ng_source_timeval_type = { From owner-svn-src-head@freebsd.org Mon Nov 19 07:31:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC4F911373DE; Mon, 19 Nov 2018 07:31:45 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13F408718D; Mon, 19 Nov 2018 07:31:45 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-ed1-f41.google.com with SMTP id j6so19454047edp.9; Sun, 18 Nov 2018 23:31:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=MLv6W6Vq/EoR4anNW4+uR9siFfvN8Ds5v2tYxi2PyYE=; b=lk72UjbTNzAaGPYAzMcr7VseJigc3kU8ATF8XYR4VqB55AadCBnpgqzw3F4zVzBHkO f3riv+pR92jisqrpPx8OQ2lpdZlbx7edxpB2bAsDETG4CZbR2X15KzJvu2wX790dV3Cu cBCzn2IpFXZ8jAIrm4aiQzhzYHF0uWWBwbKBRVmNVhwI6eIuooIR1Job3xKz2qB4yM+V 9CyJ97Dsyw5JeeJq4GFWxS6OIAcmeUYb87rw9sutxqKN0G/RZgha385UXRndYU4ZbpKU RCCYUiyHCMdjbrWXfKjvvHugwk97ZIVdUj+pXYuKnOB7bpsIzS5hegphQcZou+mXU02d 3Qjw== X-Gm-Message-State: AGRZ1gKwDkYEntLHo+NYuOD8zRvV/G3HAjYIUNJ3wBMCqo/1irsTQIzd sly/X7ZPdiy5YsbSWr4qIZ+B0x01 X-Google-Smtp-Source: AJdET5eRQNgTbCUnGN1B6gfNYwe9UYKmoB7VHVLw4rL4ryxVjaU8obfno5QIHQlEla+HqhCz6OBsKA== X-Received: by 2002:a17:906:81cc:: with SMTP id e12-v6mr16254367ejx.138.1542612697903; Sun, 18 Nov 2018 23:31:37 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id e26-v6sm3103655ejb.29.2018.11.18.23.31.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Nov 2018 23:31:37 -0800 (PST) Subject: Re: svn commit: r340450 - head/sys/sys To: Warner Losh , "Rodney W. Grimes" Cc: Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> Date: Mon, 19 Nov 2018 09:31:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 13F408718D X-Spamd-Result: default: False [-3.04 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; RCVD_IN_DNSWL_NONE(0.00)[41.208.85.209.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(-1.06)[ipnet: 209.85.128.0/17(-3.51), asn: 15169(-1.71), country: US(-0.09)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[41.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 07:31:46 -0000 On 19/11/2018 03:38, Warner Losh wrote: > I'll talk to Allan to see if he can test that. the bare 1 should be handled > properly because of C's promotion rules. 1ull << 32 is an unsigned long long. > What I really wanted was "~(uint32_t)0" but that construct has bit me in the past. I think that you could just do (unsigned int)-1 or UINT_MAX. As a side note, I wonder if those functions are ever used on negative values, given the type of the argument, and if anyone checked their correctness in that case. -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Nov 19 07:53:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 210EE1137DFB for ; Mon, 19 Nov 2018 07:53:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x12d.google.com (mail-it1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28F0B6A080 for ; Mon, 19 Nov 2018 07:53:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x12d.google.com with SMTP id x124so6702954itd.1 for ; Sun, 18 Nov 2018 23:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SRcFAQiEIPYSgeWigGLjI07QJmtsb6Cx4hSzo8mHQqs=; b=bdTTfiOtJLLfR80cqGx2Cq1t0gTdSW7VWzW1nHzP6JGuCgkhzvrs8Kl3xxlqx9+ZFA 3I8UeqkKBE5BOE2QEyQXSCu3OMQ2RVvVZKypR8p8GEKfPPl5tuMcvkf85l/kei+jO1/j PELcsx5UOfRuxS5jtjPrWznKekl14fYYELr64SWsw6V5YO7vN5LerLiUBswaVKjt2x00 HKaS9Z1oriEaUYwnfSgQl86XKj2X/voBzB5TtUshEhVGKZkzKMfYh+ZKRYXl+aDx4zxq pLTFF0eju1SqIlo2OWubKePzELvB8R0FjzFw7/A8W609OZnE2m4BO/oNrPUHxqtwmZ+G NYCg== 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=SRcFAQiEIPYSgeWigGLjI07QJmtsb6Cx4hSzo8mHQqs=; b=ZEkfsFsfUMcpm8vtzjvP3xyk63EQW75RXSEPAHhfAW09NhvSpx2rgN+JM/LrmI+Tei I75o416gSVSV68NAUAA4f4DCraDkByh6hAMKCMYgj+VKzRH6QIK1Qb7uG/nJpOpp7Ksr ileiHqWwTxECF6rZVrDk3Nt3CadDyuKOk8eP+DlFYTCMiViDsobsbp1Ui0UE/4fGI6xo xtuk1ZuYI1bfobUFNbPudQ3WOfQs2lfBKQH2g0HqkTRJ2hqhQhzK/9JyT8R+JwDz36hJ JPicKfaX3lhJ7rLukGq1GjdzTnXGkQJvgwvpeIGSGvEdnWdLW9Z+QS7H5Yv+Ro6kgOA2 ceVw== X-Gm-Message-State: AGRZ1gLxcoSnoOUDddGJ0KkgjRImo0Qk6zAFTp7lVFWzoBryrXqGs+uI MmfcfEgGqQgT8+iWFq2Wg8kWIp5h+Pxzp/DxmYsIXw== X-Google-Smtp-Source: AJdET5deYEpRCnoH7aU/8qRDsAVwKdmx0mfeQ2NvrqU1QI6uheg3oMq3ARwIJ6gF/rSXjlQz6RJa+1uMNu+4l0NT2lY= X-Received: by 2002:a24:4fcb:: with SMTP id c194mr7234019itb.47.1542614018232; Sun, 18 Nov 2018 23:53:38 -0800 (PST) MIME-Version: 1.0 References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> In-Reply-To: <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> From: Warner Losh Date: Mon, 19 Nov 2018 00:53:27 -0700 Message-ID: Subject: Re: svn commit: r340450 - head/sys/sys To: Andriy Gapon Cc: "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 28F0B6A080 X-Spamd-Result: default: False [-4.46 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[d.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.46)[ip: (-7.99), ipnet: 2607:f8b0::/32(-2.53), asn: 15169(-1.71), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 07:53:40 -0000 On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > On 19/11/2018 03:38, Warner Losh wrote: > > I'll talk to Allan to see if he can test that. the bare 1 should be > handled > > properly because of C's promotion rules. 1ull << 32 is an unsigned long > long. > > What I really wanted was "~(uint32_t)0" but that construct has bit me in > the past. > > I think that you could just do (unsigned int)-1 or UINT_MAX. > Perhaps. > As a side note, I wonder if those functions are ever used on negative > values, > given the type of the argument, and if anyone checked their correctness in > that > case. > I don't think so, but an assert would be good to make sure. But I think I understand the problem now. mstosbt(1000) is overflowing with my change, but not without because we're adding 2^32 to a number that's ~900 away from overflowing changing a very large sleep of 1 second to a tiny sleep of 0 (which is 1ms at the default Hz). I think we get this in the mlx code because there's a msleep(1000) in at least one place. msleep(1001) would have failed before my change. Now I think msleep(999) works, but msleep(1000) fails. Since the code is waiting a second for hardware to initialize, a 1ms instead is likely to catch the hardware before it's finished. I think this will cause problems no matter cold or not, since it's all pause_sbt() under the covers and a delay of 0 is still 0 either way. The fix I think is something like: diff --git a/sys/sys/time.h b/sys/sys/time.h index 2207767813f2..00c6bb4a20fb 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -204,8 +204,12 @@ sbttoms(sbintime_t _sbt) static __inline sbintime_t mstosbt(int64_t _ms) { + sbintime_t sb; - return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> 32); + sb = (_ms / 1000) * SBT_1S; + _ms = _ms % 1000; + sb += (_ms * (((uint64_t)1 << 42) / 1000) + 1023) >> 10; + return (sb); } /*- so we add the whole number of seconds first, then with the remainder we do the math so we have enough precision to represent 1000 correctly. This lets us then do the math with plenty of bits to spare. I need to reevaluate this in the morning when I'm not so tired. It might be safe to not do the whole seconds first, and I might need 11 bits instead of 10 to be safe, so I'll hold off committing until I can probe the edge cases more thoroughly. I thought long and hard about the tiny part of the edge case and never stopped to think about what 1000ms would do... Warner From owner-svn-src-head@freebsd.org Mon Nov 19 09:35:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72966113A357; Mon, 19 Nov 2018 09:35:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1D26D56B; Mon, 19 Nov 2018 09:35:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC0E920478; Mon, 19 Nov 2018 09:35:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ9ZGSg018218; Mon, 19 Nov 2018 09:35:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ9ZGTx018217; Mon, 19 Nov 2018 09:35:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811190935.wAJ9ZGTx018217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Nov 2018 09:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340621 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F1D26D56B X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.44)[0.439,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 09:35:17 -0000 Author: hselasky Date: Mon Nov 19 09:35:16 2018 New Revision: 340621 URL: https://svnweb.freebsd.org/changeset/base/340621 Log: Be more verbose when a sysctl fails to unregister. Print name of sysctl in question. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Nov 19 08:56:34 2018 (r340620) +++ head/sys/kern/kern_sysctl.c Mon Nov 19 09:35:16 2018 (r340621) @@ -565,8 +565,10 @@ sysctl_unregister_oid(struct sysctl_oid *oidp) * being unloaded afterwards. It should not be a panic() * for normal use. */ - if (error) - printf("%s: failed to unregister sysctl\n", __func__); + if (error) { + printf("%s: failed(%d) to unregister sysctl(%s)\n", + __func__, error, oidp->oid_name); + } } /* Initialize a new context to keep track of dynamically added sysctls. */ From owner-svn-src-head@freebsd.org Mon Nov 19 09:36:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92292113A3B0; Mon, 19 Nov 2018 09:36:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 345296D6D4; Mon, 19 Nov 2018 09:36:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1599C2047D; Mon, 19 Nov 2018 09:36:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ9a916018296; Mon, 19 Nov 2018 09:36:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ9a9N0018295; Mon, 19 Nov 2018 09:36:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811190936.wAJ9a9N0018295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Nov 2018 09:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340622 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 345296D6D4 X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.14)[0.139,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 09:36:10 -0000 Author: hselasky Date: Mon Nov 19 09:36:09 2018 New Revision: 340622 URL: https://svnweb.freebsd.org/changeset/base/340622 Log: Minor code factoring. No functional change. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Nov 19 09:35:16 2018 (r340621) +++ head/sys/kern/kern_sysctl.c Mon Nov 19 09:36:09 2018 (r340622) @@ -546,10 +546,10 @@ sysctl_unregister_oid(struct sysctl_oid *oidp) int error; SYSCTL_ASSERT_WLOCKED(); - error = ENOENT; if (oidp->oid_number == OID_AUTO) { error = EINVAL; } else { + error = ENOENT; SLIST_FOREACH(p, oidp->oid_parent, oid_link) { if (p == oidp) { SLIST_REMOVE(oidp->oid_parent, oidp, From owner-svn-src-head@freebsd.org Mon Nov 19 14:40:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 165F111054D8; Mon, 19 Nov 2018 14:40:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4ED8477A3A; Mon, 19 Nov 2018 14:40:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id C8B193D6534; Tue, 20 Nov 2018 01:40:00 +1100 (AEDT) Date: Tue, 20 Nov 2018 01:39:59 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Andriy Gapon , "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340450 - head/sys/sys In-Reply-To: Message-ID: <20181120005944.B1050@besplex.bde.org> References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=LIQbiBchzmXMh4q9X1oA:9 a=Qyu579rOfU3iaBEE:21 a=csjIOMLcv_6KWWZE:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 4ED8477A3A X-Spamd-Result: default: False [-0.86 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.83)[-0.827,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; NEURAL_SPAM_SHORT(0.28)[0.285,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[extmail.optusnet.com.au]; RCPT_COUNT_SEVEN(0.00)[8]; IP_SCORE(-0.01)[country: AU(-0.04)]; RCVD_NO_TLS_LAST(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[42.132.29.211.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 14:40:18 -0000 On Mon, 19 Nov 2018, Warner Losh wrote: > On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > >> On 19/11/2018 03:38, Warner Losh wrote: >>> I'll talk to Allan to see if he can test that. the bare 1 should be >> handled >>> properly because of C's promotion rules. 1ull << 32 is an unsigned long >> long. >>> What I really wanted was "~(uint32_t)0" but that construct has bit me in >> the past. Using the long long abomination is only one of the bugs. Not a critical one. The critical one in this constant is that it is garbage. The correct constant is 2**64 divided by a power of 10. For nanoseconds, the power of 10 os 10**9, and 2**64/10**9 resembles the garbage constant. It is 4.29 times larger. This 4.29 rounded down is SBT_1NS, and it also works to add SBT_1NS outside of the shift... >> I think that you could just do (unsigned int)-1 or UINT_MAX. > > Perhaps. This avoids using the abomination, but still uses a garbage constant and the garbage constant is off by 1 relative to the intended garbage constant. >> As a side note, I wonder if those functions are ever used on negative >> values, >> given the type of the argument, and if anyone checked their correctness in >> that >> case. > > I don't think so, but an assert would be good to make sure. I checked them on all valid values. They obviously can't work, since the constant is garbage. Unfortunately, I lost the test program. IIRC, it finds about 80 million out of 1 billion wrong results for nsec precision, 32 out of 1 million wrong for usec precision, and 0 out of 1000 wrong for msec precision. > > But I think I understand the problem now. > > mstosbt(1000) is overflowing with my change, but not without because we're > adding 2^32 to a number that's ~900 away from overflowing changing a very This value is just invalid. Negative values are obviously invalid. Positive values of more than 1 second are invalid. In the old version, values of precisely 1 second don't overflow since the scale factor is rounded down; the result is just 1 unit lower than 1 second. Overflow (actually truncation) occurs at 1 unit above 1 second. E.g., sbttoms(mstosbt(1000)) was 999 and sbttoms(mstosbt(1001)) was 0. Now in my fixed version, sbttoms(mstosbt(1000)) is truncated to 0 and sbttoms(mstosbt(1001)) is truncated to 1. The test program also showed that in the old version, all valid args except 0 are reduced by precisely 1 by conversion to sbt and back. > large sleep of 1 second to a tiny sleep of 0 (which is 1ms at the default > Hz). I think we get this in the mlx code because there's a msleep(1000) in > at least one place. msleep(1001) would have failed before my change. Now I > think msleep(999) works, but msleep(1000) fails. Since the code is waiting > a second for hardware to initialize, a 1ms instead is likely to catch the > hardware before it's finished. I think this will cause problems no matter > cold or not, since it's all pause_sbt() under the covers and a delay of 0 > is still 0 either way. Bug in the mlx code. The seconds part must be converted separately, as in tstosbt(). > The fix I think is something like: > > diff --git a/sys/sys/time.h b/sys/sys/time.h > index 2207767813f2..00c6bb4a20fb 100644 > --- a/sys/sys/time.h > +++ b/sys/sys/time.h > @@ -204,8 +204,12 @@ sbttoms(sbintime_t _sbt) > static __inline sbintime_t > mstosbt(int64_t _ms) > { > + sbintime_t sb; > > - return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> > 32); > + sb = (_ms / 1000) * SBT_1S; > + _ms = _ms % 1000; > + sb += (_ms * (((uint64_t)1 << 42) / 1000) + 1023) >> 10; > + return (sb); > } sbt never supported this. This pessimizes correct code and bloats the functions with divisions. I know too much about this because I wrote similar code for {ts,tv}<->bt conversions but phk disapproved of it and only committed a comment in sys/time.h saying not to do it. The comment forbids doing it for sbt too. However, the comment allows truncation to correct values. The sbt values are truncated to far below the floor of the infinite-precision values, because the scaling is sloppy. The scaling is much sloppier for sbt than for bt since the scale factor is in fixed point with 64 bits for bt but only 32 bits for sbt. 32 bits is barely enough for the error to be only 1 after converting back. This is because SBT_1NS is 4, so nanonseconds can be represented to an accuracy of about 1/4 using sbt; rounding down loses at most 1/4 on the nsec scale so converting back loses at most 1 provided scaling and other rounding steps don't lose several quarters. Here is a working version with too many comments. XX Index: time.h XX =================================================================== XX --- time.h (revision 340473) XX +++ time.h (working copy) XX @@ -97,11 +97,11 @@ XX { XX uint64_t _p1, _p2; XX XX - _p1 = (_bt->frac & 0xffffffffull) * _x; XX + _p1 = (_bt->frac & 0xffffffff) * _x; XX _p2 = (_bt->frac >> 32) * _x + (_p1 >> 32); XX _bt->sec *= _x; XX _bt->sec += (_p2 >> 32); XX - _bt->frac = (_p2 << 32) | (_p1 & 0xffffffffull); XX + _bt->frac = (_p2 << 32) | (_p1 & 0xffffffff); XX } XX XX static __inline void Fix other instances of the long long abomination. These were especially gratuitous, since the natural constants are 32 bits. The natural promotions of these are also correct. Using the abomination doesn't simplify analysis of conversions. long long may be larger than 64 bits. Then you have to analyze demotions instead of promotions. On LP64 systems, long long has higher rank than uint64_t, so you still must analyze demotions. XX @@ -162,9 +162,56 @@ XX * large roundoff errors which sbttons() and nstosbt() avoid. Millisecond and XX * microsecond functions are also provided for completeness. XX * XX - * These functions return the smallest sbt larger or equal to the number of XX - * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 term added XX - * transforms the >> 32 from floor() to ceil(). XX + * Violate the comment about "Background information": XX + * XX + * All these functions do sloppy scaling and/or rounding, but it is arranged XX + * that the errors compensate for each other so that sbttoX(Xtosbt(x)) == x XX + * for all valid args. XX + * XX + * Sloppy scaling in the decimal->sbt functions tends to give a result that XX + * is significantly far below the floor of the correctly rounded result (call XX + * this the "true floor"). Similary sloppy scaling in the sbt->decimal XX + * functions reduces further below the true floor. The result was that XX + * sbttoX(Xtosbt(x)) was 1 too small for all cases except x = 0. XX + * XX + * Doing correct even scaling and rounding up to the true ceiling in the XX + * decimal->sbt functions alone is useless for fixing this, since, the XX + * sbt->decimal functions reduc even true ceilings to below true floors. XX + * XX + * Instead of correcting all the functions, return a fake ceiling in the XX + * decimal->sbt functions. This ceiling is approx. 1 decimal unit above the XX + * sloppily scaled value. It is thus above the true ceiling but not 1 XX + * decimal unit or more above. It is unobvious that the sbt->decimal XX + * functions don't reduce even this fake ceiling to below the true floor. XX + * Exhaustive testing shows that they don't. The fake ceiling must be XX + * significantly more than 1 sbt unit above the true ceiling for the XX + * reduction to be not too large. Fortunately, there are no numerical XX + * accidents that give a too-low fake ceiling. XX + * XX + * The previous version claimed to calculate true ceilings. These never XX + * work. But it actually calculated fake ceilings of 2**32-1 sbt units XX + * above the sloppily scaled value. This value is nonsense, but worked XX + * accidentally in some cases. The decimal unit of 1 nsec is XX + * 2**64/10**9 ~= 18e9 sbt units. 2**32-1 is thus about 4.29 times too XX + * small to work non-accidentally. In practice, it worked accidentally in XX + * about 92% of cases. For conversions of microseconds, the value used was XX + * about 4.29e3 times too small, but worked accidentally in all except 32 XX + * cases. For conversions of milliseconds, the value used was about 4.29e6 XX + * times too small, but worked accidentally in all cases. XX + * XX + * Note that the range of valid args is significantly limited, since the XX + * efficient sloppy scaling and rounding methods used here only work up to 1 XX + * second. E.g., _ms must be between 0 and 999 inclusive, since XX + * ustosbt(1000) = 0 due to overflow of of the multiplication to almost XX + * exactly 0. This allows exhaustive testing that the sloppy methods work XX + * It is unclear if similar sloppy scaling would work above 1 second, but XX + * non-sloppy scaling is very easy for whole seconds (see tstosbt()). XX + * XX + * Uncommitted code for ts/tv<->bt was more careful, but was disapproved and XX + * the comment about "Background information" was added to inhibit commits XX + * in this area. It does non-sloppy scaling of fractional parts, then rounds XX + * to nearest. I don't remember doing exhaustive testing of it, and now don't XX + * see why rounding to nearest is enough. XX */ XX static __inline int64_t XX sbttons(sbintime_t _sbt) XX @@ -177,7 +224,79 @@ XX nstosbt(int64_t _ns) XX { XX XX - return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - 1) >> 32); XX + /* XX + * The adjustment is essentially to add SBT_1NS to the result of XX + * sloppy scaling and rounding down. That happens to work too, but XX + * use the slightly less sloppy method of combining shifts and XX + * subtracting 1. The result in most cses is much higher than the XX + * true ceiling, but sloppy rounding for the reverse conversion XX + * discards the extras. XX + * XX + * E.g., 2**64/10**9 has a fractional part of ~0.71. Multiplying XX + * this by the maximum valid _ns of 10**9-1 gives ~0.71e9, so XX + * rounding down after scaling gives a raw sbt that is ~0.71e9 below XX + * the true floor (only ~0.17 below the true floor in seconds). XX + * Replacing _ns by (_ns + 1) gives a raw sbt that is ~0.29e9 above XX + * the true ceiling (only ~0.068 above the true ceiling in seconds). XX + * Subtracting 1 from this makes no significant difference. Sloppy XX + * scaling and rounding in the reverse conversion recovers the XX + * original value: the sloppy scaling reduces the value from above the XX + * true ceiling to below the true ceiling (but not below the true XX + * floor); then rounding down recovers the true floor. XX + * XX + * Similarly for _all_ valid args and for the us and ms conversions. XX + * It is fairly obvious that the result of conversion back to ns is XX + * never 1 too low (since we add 1), but not obvious that the result XX + * is never 1 too high (since adding 1 risks this). XX + * XX + * Conversion from sbt to decimal and back has no chance of always XX + * restoring the original values since the decimal formats have less XX + * precision. Adding 1 is too sloppy to do anything good for this XX + * direction. The uncommitted ts/tv<->bt conversions are supposed to XX + * work as well as possible in both directions. Rounding to nearest XX + * works better and non-sloppy scaling is obviously needed to work in XX + * both directions. However, non-sloppy scaling doesn't work with XX + * mixed or sloppy rounding. In the above example with _ns = 10**9-1, XX + * it gives a raw sbt that is just 1 below the true floor. Adding 1 XX + * to this gives the true ceiling in the sbt, but unless the reverse XX + * conversion is changed similarly, it reduces from the true ceiling XX + * to below the true floor, so the result of converting back has much XX + * the same off-by-1 errors as simpler method (always 1 too low except XX + * for an arg of 0). XX + * XX + * Further examples: XX + * - when _ns = 0, sbt is SBT_1NS, but converting this back to ns XX + * gives 0. If we start with this sbt, oue conversion functions XX + * are still unusable for printing it in nsec. XX + * - when _ns = 10**9-1, we are close to overflow. Adding 1 to it XX + * doesn't quite reach the overflow threshold. XX + * - in previous versions, when _ns = 10**9, overflow was not quite XX + * reached, and the result of a double conversion had the usual XX + * off-by-1 error. XX + * - when _ns = 10**9, overflow now occurs and the result of a double XX + * conversion is 0 XX + * - when _ns = 10**9+1, overflow occurs in previous versions and the XX + * result of a double conversion is 0 (overflow gives an off-by-10**9 XX + * error and then the usual off-by-1-error occurs. XX + */ XX +#if 1 XX + /* XX + * This version does non-sloppy scaling which after rounding down is XX + * close to or equal 1 below the true ceiling for all nonzero args. XX + * Then adding 1 gives an adequate true or fake ceiling. Some of the XX + * above comments are wrong about the true ceiling not working. XX + * Unfortunately, this is about 30% slower (a whole cycle extra in XX + * the test). The unnecessary subtraction of 1 in the main version XX + * costs about 1/2 of a cycle in the test. XX + */ XX + uint64_t factor, frac; XX + XX + factor = ((uint64_t)1 << 63) / 500000000; XX + frac = ((0 - factor * 1000000000) << 32) / 1000000000; XX + return (((_ns * factor + ((_ns * frac) >> 32)) >> 32) + 1); XX +#else XX + return (((_ns + 1) * (((uint64_t)1 << 63) / 500000000) - 1) >> 32); XX +#endif XX } XX XX static __inline int64_t XX @@ -191,7 +310,7 @@ XX ustosbt(int64_t _us) XX { XX XX - return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) >> 32); XX + return (((_us + 1) * (((uint64_t)1 << 63) / 500000) - 1) >> 32); XX } XX XX static __inline int64_t XX @@ -205,7 +324,7 @@ XX mstosbt(int64_t _ms) XX { XX XX - return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> 32); XX + return (((_ms + 1) * (((uint64_t)1 << 63) / 500) - 1) >> 32); XX } XX XX /*- Here is my old code for the corresponding disapproved scaling for bt. This uses rounding to nearest in all functions, and does less sloppy scaling, but has wrong constants. It seemed to work, but I don't remember do exhaustive testing of it. The rounding to nearest probably compensates for errors in the constants. YY Index: time.h YY =================================================================== YY RCS file: /home/ncvs/src/sys/sys/time.h,v YY retrieving revision 1.50 YY diff -u -2 -r1.50 time.h YY --- time.h 8 Feb 2002 03:55:37 -0000 1.50 YY +++ time.h 7 Mar 2002 10:04:34 -0000 YY @@ -127,5 +125,6 @@ YY YY ts->tv_sec = bt->sec; YY - ts->tv_nsec = (1000000000ULL * (u_int32_t)(bt->frac >> 32)) >> 32; YY + ts->tv_nsec = ((uint64_t)1000000000 * (uint32_t)(bt->frac >> 32) + YY + 0x80000000) >> 32; YY } YY The power-of-2 constant is correct in this direction. YY @@ -133,7 +132,17 @@ YY timespec2bintime(struct timespec *ts, struct bintime *bt) YY { YY + uint64_t factor, frac; YY YY bt->sec = ts->tv_sec; YY - bt->frac = ts->tv_nsec * 18446744073ULL; /* int(2^64 / 1000000000) */ YY + YY + /* YY + * Even the imperfect rounding here is much more expensive than the YY + * perfect rounding in bintime2timespec(), but this is not a problem YY + * because this function is rarely used. In fact, it is not used at YY + * all (yet?) (only timeval2bintime() is used). YY + */ YY + factor = (uint64_t)(-1) / 1000000000; YY + frac = (((uint64_t)(-1) - factor * 100000000 + 1) << 32) / 1000000000; YY + bt->frac = ts->tv_nsec * factor + ((ts->tv_nsec * frac) >> 32); YY } YY This shows how to do the scaling accurately to within 1 bt unit, except the constant is wrong in the new code (for frac) -- one of the powers of 10 is missing an 0 digit :-(. As the comment says, this doesn't bother to round bt->frac specially, so does rounding down. bt has so much more precision than ts (about 2**34 times more) that the rounding doesn't matter, provided you round to nearest in the reverse direction. Perfect rounding down in both directions of course gives a reduction by 1 unit for the double conversion for all args except 0. Unlike for sbt, the bt conversion functions support args larger than 1 second, so there are too many args for exhaustive testing, but the conversions don't lose precision for whole seconds so there is no need to test args larger than 1 second. YY @@ -143,5 +152,6 @@ YY YY tv->tv_sec = bt->sec; YY - tv->tv_usec = (1000000ULL * (u_int32_t)(bt->frac >> 32)) >> 32; YY + tv->tv_usec = ((uint64_t)1000000 * (uint32_t)(bt->frac >> 32) + YY + 0x80000000) >> 32; YY } YY YY @@ -149,10 +159,13 @@ YY timeval2bintime(struct timeval *tv, struct bintime *bt) YY { YY + uint64_t factor, frac; YY YY bt->sec = tv->tv_sec; YY - bt->frac = tv->tv_usec * 18446744073709ULL; /* int(2^64 / 1000000) */ YY -} YY YY -/* end of struct bintime stuff */ YY + /* See above rounding. */ YY + factor = (uint64_t)(-1) / 1000000; YY + frac = (((uint64_t)(-1) - factor * 100000 + 1) << 32) / 1000000; This is also missing an 0 digit. YY + bt->frac = tv->tv_usec * factor + ((tv->tv_usec * frac) >> 32); YY +} YY YY #ifdef _KERNEL sys/time.h still uses the long long abominations and the obfuscated constant 1844... in the code. Only verbose comments which spell this constant constant correctly (in pseudo-code) were committed. These bugs are missing for the corresponding constants in sbt conversions. Bruce From owner-svn-src-head@freebsd.org Mon Nov 19 15:20:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 147DF110655B; Mon, 19 Nov 2018 15:20:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id AA7A179738; Mon, 19 Nov 2018 15:20:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id E7E2810562FF; Tue, 20 Nov 2018 02:19:57 +1100 (AEDT) Date: Tue, 20 Nov 2018 02:19:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Warner Losh , Andriy Gapon , "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340450 - head/sys/sys In-Reply-To: <20181120005944.B1050@besplex.bde.org> Message-ID: <20181120014951.J1250@besplex.bde.org> References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> <20181120005944.B1050@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=04AClt5CvOlRR2CIbe8A:9 a=ODUrRZQBT3x5M27z:21 a=yO6B2NnfoD2nWY7K:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: AA7A179738 X-Spamd-Result: default: False [-0.86 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.83)[-0.829,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[optusnet.com.au]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; NEURAL_SPAM_SHORT(0.28)[0.284,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: extmail.optusnet.com.au]; RCPT_COUNT_SEVEN(0.00)[9]; IP_SCORE(-0.01)[country: AU(-0.04)]; FREEMAIL_TO(0.00)[optusnet.com.au]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RCVD_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:20:08 -0000 On Tue, 20 Nov 2018, Bruce Evans wrote: > On Mon, 19 Nov 2018, Warner Losh wrote: > >> On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > >>> As a side note, I wonder if those functions are ever used on negative >>> values, >>> given the type of the argument, and if anyone checked their correctness in >>> that >>> case. >> >> I don't think so, but an assert would be good to make sure. > > I checked them on all valid values. They obviously can't work, since the > constant is garbage. Unfortunately, I lost the test program. IIRC, it > finds about 80 million out of 1 billion wrong results for nsec precision, > 32 out of 1 million wrong for usec precision, and 0 out of 1000 wrong for > msec precision. I found my test program. >> But I think I understand the problem now. >> >> mstosbt(1000) is overflowing with my change, but not without because we're >> adding 2^32 to a number that's ~900 away from overflowing changing a very > > This value is just invalid. Negative values are obviously invalid. Positive > values of more than 1 second are invalid. In the old version, values of > precisely 1 second don't overflow since the scale factor is rounded down; > the result is just 1 unit lower than 1 second. Overflow (actually > truncation) > occurs at 1 unit above 1 second. E.g., sbttoms(mstosbt(1000)) was 999 and > sbttoms(mstosbt(1001)) was 0. Now in my fixed version, > sbttoms(mstosbt(1000)) > is truncated to 0 and sbttoms(mstosbt(1001)) is truncated to 1. > > The test program also showed that in the old version, all valid args except > 0 are reduced by precisely 1 by conversion to sbt and back. > >> large sleep of 1 second to a tiny sleep of 0 (which is 1ms at the default >> Hz). I think we get this in the mlx code because there's a msleep(1000) in >> at least one place. msleep(1001) would have failed before my change. Now I >> think msleep(999) works, but msleep(1000) fails. Since the code is waiting >> a second for hardware to initialize, a 1ms instead is likely to catch the >> hardware before it's finished. I think this will cause problems no matter >> cold or not, since it's all pause_sbt() under the covers and a delay of 0 >> is still 0 either way. > > Bug in the mlx code. The seconds part must be converted separately, as in > tstosbt(). mlx doesn't seem to use sbt directly, or even msleep(), so the bug does seem to be central. mlx actually uses mtx_sleep() with timo = hz(). mtx_sleep() is actually an obfuscated macro wrapping _sleep(). The conversion to sbt is done by the macro and is sloppy. It multiplies timo by tick_sbt. tick_sbt is SBT_1S / hz, so the sbt is SBT_1S / hz * hz which is SBT_1S reduced a little. This is not affected by the new code, and it still isn't converted back to 1 second in ms, us or ns. Even if it is converted back and then forth to sbt using the new code, it remains less than 1 second as an sbt so shouldn't cause any new problems. Here is the test program: XX /* Test decimal<->sbt conversions. */ XX XX #include XX XX #include XX XX int XX main(int argc, char **argcv) XX { XX uint64_t sbt; XX int i, j, wrong; XX XX wrong = 0; XX for (i = 0; i < 1000; i++) { XX sbt = mstosbt(i); XX j = sbttoms(sbt); XX if (i != j) { XX wrong++; XX if (argc > 1) XX printf("%d -> %#jx -> %d\n", XX i, (uintmax_t)sbt, j); XX } XX } XX printf("%d wrong values for ms\n", wrong); XX XX wrong = 0; XX for (i = 0; i < 1000000; i++) { XX sbt = ustosbt(i); XX j = sbttous(sbt); XX if (i != j) { XX wrong++; XX if (argc > 1) XX printf("%d -> %#jx -> %d\n", XX i, (uintmax_t)sbt, j); XX } XX } XX printf("%d wrong values for us\n", wrong); XX XX wrong = 0; XX for (i = 0; i < 1000000000; i++) { XX sbt = nstosbt(i); XX j = sbttons(sbt); XX if (i != j) { XX wrong++; XX if (argc > 1) XX printf("%d -> %#jx -> %d\n", XX i, (uintmax_t)sbt, j); XX } XX } XX printf("%d wrong values for ns\n", wrong); XX } Output: 0 wrong values for ms 32 wrong values for us 82602428 wrong values for ns Bruce From owner-svn-src-head@freebsd.org Mon Nov 19 15:31:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DA861106B44; Mon, 19 Nov 2018 15:31:55 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24CE57A606; Mon, 19 Nov 2018 15:31:55 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05F9923F1C; Mon, 19 Nov 2018 15:31:55 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJFVsV3002782; Mon, 19 Nov 2018 15:31:54 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJFVsb2002781; Mon, 19 Nov 2018 15:31:54 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811191531.wAJFVsb2002781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Mon, 19 Nov 2018 15:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340631 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 340631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 24CE57A606 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.47)[0.467,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:31:55 -0000 Author: tijl Date: Mon Nov 19 15:31:54 2018 New Revision: 340631 URL: https://svnweb.freebsd.org/changeset/base/340631 Log: Do proper copyin of control message data in the Linux sendmsg syscall. Instead of calling m_append with a user address, allocate an mbuf cluster and copy data into it using copyin. For the SCM_CREDS case, instead of zeroing a stack variable and appending that to the mbuf, zero part of the mbuf cluster directly. One mbuf cluster is also the size limit used by the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()). PR: 217901 Reviewed by: kib MFC after: 3 days Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Nov 19 15:29:40 2018 (r340630) +++ head/sys/compat/linux/linux_socket.c Mon Nov 19 15:31:54 2018 (r340631) @@ -1085,7 +1085,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc l_uint flags) { struct cmsghdr *cmsg; - struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1096,6 +1095,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct sockaddr *sa; sa_family_t sa_family; void *data; + l_size_t len; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1126,7 +1126,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc return (error); control = NULL; - cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { error = kern_getsockname(td, s, &sa, &datalen); @@ -1136,8 +1135,10 @@ linux_sendmsg_common(struct thread *td, l_int s, struc free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); + MCLGET(control, M_WAITOK); + data = mtod(control, void *); + datalen = 0; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1149,10 +1150,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) goto bad; + if (datalen + CMSG_HDRSZ > MCLBYTES) + goto bad; + /* * Now we support only SCM_RIGHTS and SCM_CRED, * so return EINVAL in any other cmsg_type */ + cmsg = data; cmsg->cmsg_type = linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = @@ -1170,35 +1175,34 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (sa_family != AF_UNIX) continue; - data = LINUX_CMSG_DATA(ptr_cmsg); - datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (cmsg->cmsg_type == SCM_CREDS) { + len = sizeof(struct cmsgcred); + if (datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; - switch (cmsg->cmsg_type) - { - case SCM_RIGHTS: - break; - - case SCM_CREDS: - data = &cmcred; - datalen = sizeof(cmcred); - /* * The lower levels will fill in the structure */ - bzero(data, datalen); - break; + memset(CMSG_DATA(data), 0, len); + } else { + len = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (datalen + CMSG_SPACE(len) < datalen || + datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; + + error = copyin(LINUX_CMSG_DATA(ptr_cmsg), + CMSG_DATA(data), len); + if (error != 0) + goto bad; } - cmsg->cmsg_len = CMSG_LEN(datalen); - - error = ENOBUFS; - if (!m_append(control, CMSG_HDRSZ, (c_caddr_t)cmsg)) - goto bad; - if (!m_append(control, datalen, (c_caddr_t)data)) - goto bad; + cmsg->cmsg_len = CMSG_LEN(len); + data = (char *)data + CMSG_SPACE(len); + datalen += CMSG_SPACE(len); } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); - if (m_length(control, NULL) == 0) { + control->m_len = datalen; + if (datalen == 0) { m_freem(control); control = NULL; } @@ -1212,8 +1216,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc bad: m_freem(control); free(iov, M_IOV); - if (cmsg) - free(cmsg, M_LINUX); return (error); } From owner-svn-src-head@freebsd.org Mon Nov 19 15:36:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18DF91106F2D; Mon, 19 Nov 2018 15:36:59 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1AFE7AD94; Mon, 19 Nov 2018 15:36:58 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9281923F53; Mon, 19 Nov 2018 15:36:58 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJFawJI003819; Mon, 19 Nov 2018 15:36:58 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJFawVk003818; Mon, 19 Nov 2018 15:36:58 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201811191536.wAJFawVk003818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Mon, 19 Nov 2018 15:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340632 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 340632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1AFE7AD94 X-Spamd-Result: default: False [0.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.54)[0.542,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:36:59 -0000 Author: zeising (doc,ports committer) Date: Mon Nov 19 15:36:58 2018 New Revision: 340632 URL: https://svnweb.freebsd.org/changeset/base/340632 Log: Enable evdev on ppc64 Enable evdev on ppc64 as well, similar to what was done for amd64 and i386 in r340387. Evdev can be used by X and is used by wayland to handle input devices. Approved by: mmacy MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18026 Modified: head/sys/powerpc/conf/GENERIC64 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Mon Nov 19 15:31:54 2018 (r340631) +++ head/sys/powerpc/conf/GENERIC64 Mon Nov 19 15:36:58 2018 (r340632) @@ -246,3 +246,8 @@ device snd_uaudio # USB Audio # Netmap provides direct access to TX/RX rings on supported NICs device netmap # netmap(4) support + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev From owner-svn-src-head@freebsd.org Mon Nov 19 15:42:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ED651107300; Mon, 19 Nov 2018 15:42:36 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-it1-x130.google.com (mail-it1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 747EA7B323; Mon, 19 Nov 2018 15:42:35 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-it1-x130.google.com with SMTP id a205-v6so8884594itd.4; Mon, 19 Nov 2018 07:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HbIwgcHuXX//9R6rTqoQYOso6gar08aGpe1OBN8vahA=; b=iTHrSyWui22whsyiPw1i/i+WsPfEyEJfnXpzFL3T9fDINKRUooVeLrBZtSfqGPjLAA 360bgaWTCVWY4Z5ovGhE1lThKbpFxDpo+qaPUqlNPi2RGlISFJLCJ0FoPRTtMaYaS44V BHJZeH8AZuFztNo/qXSUi9xhLeLzZ975pHhcJRbKQcxt+3dksa4jPb79mGjxs/jacy4k UbGffUOPNLL89U+P0HLu5lUhVueezsZXa9wkQtq7O/y+JnS8SlzY0dgAeHp+ksGfytvl jaPtqMtLWcrm+f9tPaS7SJSW3T5JaHbVE6KS/1fnwLzqAyCLD0qhH1JuN9tCFnUhquYK iMow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HbIwgcHuXX//9R6rTqoQYOso6gar08aGpe1OBN8vahA=; b=j6PUO0Rhg4auhrnlc5o8NyPY0yV/eKjfUG4KBIdGv4+/wTAiagMZyCdjI7uonnhnst +/4Rc5HAT16iQJ/ttENBplDZvAS4F+anwMajI1Ry7X+U76r68DYLdR0lNmXMUKQ7+3fi h5x9GrBVEIV6TXutxfXDd8P1MUmVnfAlB4HBmQLs+yZa3tliNaTpwV0jO/MeyZn8OFZU Iwo12FdswOH4bn9xkcT/zVWIDCF9A6FeFowvIk9HFaa5TA6x2ersIFpFir19PUNdhnIx PmKbXmD4oehywT8ZWL4YigpjQUowO36BjN5zu34us3B7s0LX0HvHp3i7T/Y5WAQPUwDw c/JA== X-Gm-Message-State: AGRZ1gJnp8z2BR0BO9nVy/8W4jYt1i34P8Afv+jgSaXLoj0WmMtQIHR3 ay3V09xaOXVymv29fnXes0OR3BgZ X-Google-Smtp-Source: AJdET5d/YLK/xaAQkaRfJSup8CmDuaPcwsshHgEdL7mAW78kF7chEywOGQZNCOVLET7GM4+7WekE+g== X-Received: by 2002:a24:4a10:: with SMTP id k16-v6mr8776928itb.170.1542642154513; Mon, 19 Nov 2018 07:42:34 -0800 (PST) Received: from ralga.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id p74sm7656851iod.14.2018.11.19.07.42.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 07:42:34 -0800 (PST) Date: Mon, 19 Nov 2018 09:42:31 -0600 From: Justin Hibbits To: Niclas Zeising Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340632 - head/sys/powerpc/conf Message-ID: <20181119094231.2802ec8c@ralga.knownspace> In-Reply-To: <201811191536.wAJFawVk003818@repo.freebsd.org> References: <201811191536.wAJFawVk003818@repo.freebsd.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; powerpc64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 747EA7B323 X-Spamd-Result: default: False [-5.09 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[0.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-2.09)[ip: (-6.24), ipnet: 2607:f8b0::/32(-2.43), asn: 15169(-1.67), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:42:36 -0000 On Mon, 19 Nov 2018 15:36:58 +0000 (UTC) Niclas Zeising wrote: > Author: zeising (doc,ports committer) > Date: Mon Nov 19 15:36:58 2018 > New Revision: 340632 > URL: https://svnweb.freebsd.org/changeset/base/340632 > > Log: > Enable evdev on ppc64 > > Enable evdev on ppc64 as well, similar to what was done for amd64 > and i386 in r340387. > > Evdev can be used by X and is used by wayland to handle input > devices. > Approved by: mmacy > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D18026 > > Modified: > head/sys/powerpc/conf/GENERIC64 > > Modified: head/sys/powerpc/conf/GENERIC64 > ============================================================================== > --- head/sys/powerpc/conf/GENERIC64 Mon Nov 19 15:31:54 > 2018 (r340631) +++ head/sys/powerpc/conf/GENERIC64 Mon > Nov 19 15:36:58 2018 (r340632) @@ -246,3 +246,8 @@ > device snd_uaudio # USB Audio > # Netmap provides direct access to TX/RX rings on supported NICs > device netmap # netmap(4) support > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in > legacy drivers +device evdev # > input event device support +device > uinput # install /dev/uinput cdev > Is there a reason this is only in GENERIC64, not GENERIC as well? Does it not compile for 32-bit powerpc? - Justin From owner-svn-src-head@freebsd.org Mon Nov 19 15:58:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F6541107D44; Mon, 19 Nov 2018 15:58:35 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06EEE7BE5D; Mon, 19 Nov 2018 15:58:35 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 42zD5j23cqzDj6N; Mon, 19 Nov 2018 15:58:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id 0JnOSS2JoyNK; Mon, 19 Nov 2018 15:58:32 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-227-159.mobileonline.telia.com [95.192.227.159]) by mail.daemonic.se (Postfix) with ESMTPSA id 42zD5h4ySczDhFd; Mon, 19 Nov 2018 15:58:32 +0000 (UTC) Subject: Re: svn commit: r339476 - head/sys/i386/conf To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201810201916.w9KJGh0H066643@repo.freebsd.org> From: Niclas Zeising Message-ID: <2afa1dbf-10f9-8e38-36b6-e40fb0020d87@freebsd.org> Date: Mon, 19 Nov 2018 16:58:31 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201810201916.w9KJGh0H066643@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 06EEE7BE5D X-Spamd-Result: default: False [-0.07 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.68)[-0.675,0]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US]; NEURAL_SPAM_SHORT(0.61)[0.609,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:58:35 -0000 On 10/20/18 9:16 PM, Conrad Meyer wrote: > Author: cem > Date: Sat Oct 20 19:16:43 2018 > New Revision: 339476 > URL: https://svnweb.freebsd.org/changeset/base/339476 > > Log: > Add a MINIMAL config for i386, based on amd64 > Any plans to MFC this? Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Mon Nov 19 16:05:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCD21110804C; Mon, 19 Nov 2018 16:05:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 445B57C598; Mon, 19 Nov 2018 16:05:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 439063D7C56; Tue, 20 Nov 2018 03:05:38 +1100 (AEDT) Date: Tue, 20 Nov 2018 03:05:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Warner Losh , Andriy Gapon , "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340450 - head/sys/sys In-Reply-To: <20181120014951.J1250@besplex.bde.org> Message-ID: <20181120023823.M1428@besplex.bde.org> References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> <20181120005944.B1050@besplex.bde.org> <20181120014951.J1250@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=4dtU_Np7U4CNcjolt7IA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 445B57C598 X-Spamd-Result: default: False [-1.64 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.83)[-0.828,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[optusnet.com.au]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: extmail.optusnet.com.au]; NEURAL_HAM_SHORT(-0.50)[-0.499,0]; RCPT_COUNT_SEVEN(0.00)[9]; IP_SCORE(-0.01)[country: AU(-0.04)]; FREEMAIL_TO(0.00)[optusnet.com.au]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; RCVD_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_LOW(-0.10)[42.132.29.211.list.dnswl.org : 127.0.5.1] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 16:05:43 -0000 On Tue, 20 Nov 2018, Bruce Evans wrote: > On Tue, 20 Nov 2018, Bruce Evans wrote: > >> On Mon, 19 Nov 2018, Warner Losh wrote: >> >>> On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > ... > I found my test program. > >>> But I think I understand the problem now. >>> >>> mstosbt(1000) is overflowing with my change, but not without because we're >>> adding 2^32 to a number that's ~900 away from overflowing changing a very >> >> This value is just invalid. Negative values are obviously invalid. >> Positive >> values of more than 1 second are invalid. In the old version, values of >> precisely 1 second don't overflow since the scale factor is rounded down; >> the result is just 1 unit lower than 1 second. Overflow (actually >> truncation) >> occurs at 1 unit above 1 second. E.g., sbttoms(mstosbt(1000)) was 999 and >> sbttoms(mstosbt(1001)) was 0. Now in my fixed version, >> sbttoms(mstosbt(1000)) >> is truncated to 0 and sbttoms(mstosbt(1001)) is truncated to 1. >> >> The test program also showed that in the old version, all valid args except >> 0 are reduced by precisely 1 by conversion to sbt and back. >> >>> large sleep of 1 second to a tiny sleep of 0 (which is 1ms at the default >>> Hz). I think we get this in the mlx code because there's a msleep(1000) in >>> at least one place. msleep(1001) would have failed before my change. Now I >>> think msleep(999) works, but msleep(1000) fails. Since the code is waiting >>> a second for hardware to initialize, a 1ms instead is likely to catch the >>> hardware before it's finished. I think this will cause problems no matter >>> cold or not, since it's all pause_sbt() under the covers and a delay of 0 >>> is still 0 either way. >> >> Bug in the mlx code. The seconds part must be converted separately, as in >> tstosbt(). > > mlx doesn't seem to use sbt directly, or even msleep(), so the bug does > seem to be central. > > mlx actually uses mtx_sleep() with timo = hz(). mtx_sleep() is actually > an obfuscated macro wrapping _sleep(). The conversion to sbt is done by > the macro and is sloppy. It multiplies timo by tick_sbt. > > tick_sbt is SBT_1S / hz, so the sbt is SBT_1S / hz * hz which is SBT_1S > reduced a little. This is not affected by the new code, and it still isn't > converted back to 1 second in ms, us or ns. Even if it is converted back > and then forth to sbt using the new code, it remains less than 1 second as > an sbt so shouldn't cause any new problems. Here are all uses of these functions in kern outside of sys/time.h: XX arm/arm/mpcore_timer.c: sc->et.et_min_period = nstosbt(20); OK since 20 ns is less than 1 second. XX cddl/compat/opensolaris/sys/kcondvar.h: return (cv_timedwait_sbt(cvp, mp, nstosbt(tim), nstosbt(res), 0)); XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: pause_sbt("dmu_tx_delay", nstosbt(wakeup), XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: nstosbt(zfs_delay_resolution_ns), C_ABSOLUTE); XX cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c: sbintime_t sleep = nstosbt((zilog->zl_last_lwb_latency * pct) / 100); XX compat/linuxkpi/common/include/linux/delay.h: pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK); XX compat/linuxkpi/common/src/linux_hrtimer.c: nstosbt(hrtimer->expires), nstosbt(hrtimer->precision), 0); XX compat/linuxkpi/common/src/linux_hrtimer.c: callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(time)), XX compat/linuxkpi/common/src/linux_hrtimer.c: nstosbt(nsec), hrtimer_call_handler, hrtimer, 0); XX compat/linuxkpi/common/src/linux_hrtimer.c: callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(interval)), XX compat/linuxkpi/common/src/linux_hrtimer.c: nstosbt(hrtimer->precision), hrtimer_call_handler, hrtimer, 0); XX compat/linuxkpi/common/src/linux_schedule.c: ret = -pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK | C_CATCH); All of the above might are broken unless their timeout arg is restricted to less than 1 second. Also, at least the sleep and pause calls in the above probably have a style bug in knowing about sbt's at all. More important functions like msleep() hide the use of sbt's and use fuzzier scale factors like tick_sbt. XX dev/iicbus/nxprtc.c: pause_sbt("nxpotp", mstosbt(100), mstosbt(10), 0); XX dev/iicbus/nxprtc.c: pause_sbt("nxpbat", mstosbt(100), 0, 0); OK since 100 ms is less than 1 second. XX kern/kern_sysctl.c: sb = ustosbt(tt); XX kern/kern_sysctl.c: sb = mstosbt(tt); Recently added bugs. The args is supplied by applications so can be far above 1 second. Also, these functions have a bogus API that takes uint64_t args. sbt's can't represent that high, and the API doesn't support failure, so callers have the burden of passing valid values. It is easiest to only support args up to 1 second and require the caller to handle seconds. Lots of itimer and select() code handle the corresponding problem for timevals and timespecs almost correctly. Timevals and timespecs already have the seconds part separate and itimer and select() syscalls do validity checking on the fractional seconds, so there is no problem converting the fractional sections to an sbt. Howver, the seconds part has type time_t and this can be int64_t, which sbt's cannot represent. Also, POSIX doesn't permit failure for seconds values that are representable by time_t. The almost correct handling is to split up large seconds values in some cases and break POSIX conformance by silently reducing the seconds value in other cases. The reduction is usually to INT32_MAX / 2. This allows adding 2 limited values but it is not obvious that this is enough since rounding up twice or just adding 2 more would give overflow. XX kern/subr_rtc.c: sbt = nstosbt(waitns); This is correct, since waitns is the nanoseconds part of a timespec. Bruce From owner-svn-src-head@freebsd.org Mon Nov 19 16:07:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16EED1108237; Mon, 19 Nov 2018 16:07:43 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A97C17C7F6; Mon, 19 Nov 2018 16:07:42 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 42zDJF647szDj6N; Mon, 19 Nov 2018 16:07:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id zXFiegDcBMMf; Mon, 19 Nov 2018 16:07:41 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-227-159.mobileonline.telia.com [95.192.227.159]) by mail.daemonic.se (Postfix) with ESMTPSA id 42zDJF0snbzDj6l; Mon, 19 Nov 2018 16:07:41 +0000 (UTC) Subject: Re: svn commit: r340632 - head/sys/powerpc/conf To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811191536.wAJFawVk003818@repo.freebsd.org> <20181119094231.2802ec8c@ralga.knownspace> From: Niclas Zeising Message-ID: Date: Mon, 19 Nov 2018 17:07:40 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <20181119094231.2802ec8c@ralga.knownspace> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: A97C17C7F6 X-Spamd-Result: default: False [0.33 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.25)[-0.249,0]; NEURAL_SPAM_SHORT(0.58)[0.580,0]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 16:07:43 -0000 On 11/19/18 4:42 PM, Justin Hibbits wrote: > On Mon, 19 Nov 2018 15:36:58 +0000 (UTC) > Niclas Zeising wrote: > >> Author: zeising (doc,ports committer) >> Date: Mon Nov 19 15:36:58 2018 >> New Revision: 340632 >> URL: https://svnweb.freebsd.org/changeset/base/340632 >> >> Log: >> Enable evdev on ppc64 >> >> Enable evdev on ppc64 as well, similar to what was done for amd64 >> and i386 in r340387. >> >> Evdev can be used by X and is used by wayland to handle input >> devices. >> Approved by: mmacy >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D18026 >> >> Modified: >> head/sys/powerpc/conf/GENERIC64 >> >> Modified: head/sys/powerpc/conf/GENERIC64 >> ============================================================================== >> --- head/sys/powerpc/conf/GENERIC64 Mon Nov 19 15:31:54 >> 2018 (r340631) +++ head/sys/powerpc/conf/GENERIC64 Mon >> Nov 19 15:36:58 2018 (r340632) @@ -246,3 +246,8 @@ >> device snd_uaudio # USB Audio >> # Netmap provides direct access to TX/RX rings on supported NICs >> device netmap # netmap(4) support >> + >> +# evdev interface >> +options EVDEV_SUPPORT # evdev support in >> legacy drivers +device evdev # >> input event device support +device >> uinput # install /dev/uinput cdev >> > > Is there a reason this is only in GENERIC64, not GENERIC as well? Does > it not compile for 32-bit powerpc? > > - Justin > Hi! mmacy only asked about ppc64, and as far as I know it's only tested there. I can create a patch for ppc32 as well, but I can't test myself. Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Mon Nov 19 16:45:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 055EE110951A; Mon, 19 Nov 2018 16:45:00 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-oi1-f196.google.com (mail-oi1-f196.google.com [209.85.167.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 673197E4C3; Mon, 19 Nov 2018 16:44:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-oi1-f196.google.com with SMTP id p82-v6so25761147oih.11; Mon, 19 Nov 2018 08:44:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XyOR6qBYKiI96Z5p/zrOomwx7VCMAnsz+pVScw7eySQ=; b=bLrGymn5HOtgyzNYEXCaLyDCMtFHtOWi5IIuMbvmKPv1814knN6CAkl8j+VUrOdhla 32FyGeHxhbPMhfTVRZIDkDi62jlXOKzSgWXWMytKq0PI7EW/v63P7Xj+xJOEmdhPr1GX frHHOAjoTKFz4hBso4fHICU9ZKNmFKZs9ClH5Og852UnBK3uOFNKhHDaQWciaQYxIZfX 55hhH9H93k8bpiy05njSr6I3f/f+qrfahM/c6G97gvjmV5pqeKv94EGAoGVr9D1uO0bO N2SrK9Mfz41MOdt3XsZsEdGHXhwwJreEUBmdzIEEBy3tzAEeW+wwfrF0gPLQ1RPJo1NR A7Sw== X-Gm-Message-State: AGRZ1gL0ZGdDkZp+JwhUTX5fL+Fm+Jz4pKB/CmJ7OlWf7uzOL6WtHBJ+ hDNOTWrmG3aHHgVz6oB0F+wHuj1n9d1mayFGaMFeQtLH X-Google-Smtp-Source: AJdET5fPISuTnolB1mdGleB/kpa8hJbZiuTBT/FQrWteMD2OZbNM/XkE4gSGtCaBvI2NaC785wmrHIHOaBPyAdLs3Fc= X-Received: by 2002:aca:cc0d:: with SMTP id c13mr1354004oig.150.1542645411766; Mon, 19 Nov 2018 08:36:51 -0800 (PST) MIME-Version: 1.0 References: <201811121552.wACFqjLr002955@repo.freebsd.org> In-Reply-To: <201811121552.wACFqjLr002955@repo.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2018 11:36:38 -0500 Message-ID: Subject: Re: svn commit: r340363 - in head: . contrib/tcpdump contrib/traceroute lib/libcasper/services/cap_dns lib/libcasper/services/cap_dns/tests sbin/ping To: Mariusz Zaborski , Pawel Jakub Dawidek Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 673197E4C3 X-Spamd-Result: default: False [-3.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE(-1.05)[ipnet: 209.85.128.0/17(-3.47), asn: 15169(-1.67), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; RCVD_IN_DNSWL_NONE(0.00)[196.167.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[196.167.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 16:45:00 -0000 On Mon, 12 Nov 2018 at 10:53, Mariusz Zaborski wrote: > > Author: oshogbo > Date: Mon Nov 12 15:52:45 2018 > New Revision: 340363 > URL: https://svnweb.freebsd.org/changeset/base/340363 > > Log: > libcasper: [ch]ange the name of limits in cap_dns so the intentions are obvious. Mariusz and I discussed this on IRC but for the sake of the archives this breaks applications with existing calls to cap_dns_type_limit using the old names - e.g., upstream tcpdump. As tcpdump is the only out-of-tree consumer of cap_dns_type_limit that I'm aware of we could probably fix this by submitting a patch to tcpdump to add a configure test or a __FreeBSD_version conditional. However, it seems easiest to just allow either string in cap_dns. From owner-svn-src-head@freebsd.org Mon Nov 19 16:47:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 150EA11095DB; Mon, 19 Nov 2018 16:47:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE38A7E732; Mon, 19 Nov 2018 16:47:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B48924AE7; Mon, 19 Nov 2018 16:47:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJGlLoq040877; Mon, 19 Nov 2018 16:47:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJGlLfm040876; Mon, 19 Nov 2018 16:47:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811191647.wAJGlLfm040876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 16:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340635 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 340635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE38A7E732 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.48)[0.476,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 16:47:22 -0000 Author: kevans Date: Mon Nov 19 16:47:21 2018 New Revision: 340635 URL: https://svnweb.freebsd.org/changeset/base/340635 Log: libbe(3): Handle non-ZFS rootfs better If rootfs isn't ZFS, current version will emit an error claiming so and fail to initialize libbe. As a consumer, bectl -r (undocumented) can be specified to operate on a BE independently of whether on a UFS or ZFS root. Unbreak this for the UFS case by only erroring out the init if we can't determine a ZFS dataset for rootfs and no BE root was specified. Consumers of libbe should take care to ensure that rootfs is non-empty if they're trying to use it, because this could certainly be the case. Some check is needed before zfs_path_to_zhandle because it will unconditionally emit to stderr if the path isn't a ZFS filesystem, which is unhelpful for our purposes. This should also unbreak the bectl(8) tests on a UFS root, as is the case in Jenkins' -test runs. MFC after: 3 days Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Mon Nov 19 16:40:19 2018 (r340634) +++ head/lib/libbe/be.c Mon Nov 19 16:47:21 2018 (r340635) @@ -58,8 +58,22 @@ static int be_create_child_cloned(libbe_handle_t *lbh, static int be_locate_rootfs(libbe_handle_t *lbh) { + struct statfs sfs; + struct extmnttab entry; zfs_handle_t *zfs; + /* + * Check first if root is ZFS; if not, we'll bail on rootfs capture. + * Unfortunately needed because zfs_path_to_zhandle will emit to + * stderr if / isn't actually a ZFS filesystem, which we'd like + * to avoid. + */ + if (statfs("/", &sfs) == 0) { + statfs2mnttab(&sfs, &entry); + if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0) + return (1); + } else + return (1); zfs = zfs_path_to_zhandle(lbh->lzh, "/", ZFS_TYPE_FILESYSTEM); if (zfs == NULL) return (1); @@ -93,8 +107,11 @@ libbe_init(const char *root) * Grab rootfs, we'll work backwards from there if an optional BE root * has not been passed in. */ - if (be_locate_rootfs(lbh) != 0) - goto err; + if (be_locate_rootfs(lbh) != 0) { + if (root == NULL) + goto err; + *lbh->rootfs = '\0'; + } if (root == NULL) { /* Strip off the final slash from rootfs to get the be root */ strlcpy(lbh->root, lbh->rootfs, sizeof(lbh->root)); From owner-svn-src-head@freebsd.org Mon Nov 19 17:09:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95B2A1109FCD; Mon, 19 Nov 2018 17:09:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C0347FC36; Mon, 19 Nov 2018 17:09:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D79F24E18; Mon, 19 Nov 2018 17:09:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJH9vhr050948; Mon, 19 Nov 2018 17:09:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJH9vHK050947; Mon, 19 Nov 2018 17:09:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811191709.wAJH9vHK050947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 17:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340636 - head/sbin/bectl/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl/tests X-SVN-Commit-Revision: 340636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C0347FC36 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.476,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 17:09:58 -0000 Author: kevans Date: Mon Nov 19 17:09:57 2018 New Revision: 340636 URL: https://svnweb.freebsd.org/changeset/base/340636 Log: bectl(8) tests: attempt to load the ZFS module Observed in a CI test image, bectl_create test will run and be marked as skipped because the module is not loaded. The first zpool invocation will automagically load the module, but bectl_create is still skipped. Subsequent tests all pass as expected because the module is now loaded and everything is OK. MFC after: 3 days Modified: head/sbin/bectl/tests/bectl_test.sh Modified: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Mon Nov 19 16:47:21 2018 (r340635) +++ head/sbin/bectl/tests/bectl_test.sh Mon Nov 19 17:09:57 2018 (r340636) @@ -34,7 +34,7 @@ bectl_create_setup() disk=$2 mnt=$3 - kldstat -qm zfs || atf_skip "ZFS module not loaded on the current system" + kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" atf_check mkdir -p ${mnt} atf_check truncate -s 1G ${disk} atf_check zpool create -o altroot=${mnt} ${zpool} ${disk} From owner-svn-src-head@freebsd.org Mon Nov 19 17:17:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38C98110D4A6; Mon, 19 Nov 2018 17:17:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C06DE80296; Mon, 19 Nov 2018 17:17:23 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92B7524FAF; Mon, 19 Nov 2018 17:17:23 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJHHNPH056278; Mon, 19 Nov 2018 17:17:23 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJHHNIS056277; Mon, 19 Nov 2018 17:17:23 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201811191717.wAJHHNIS056277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 19 Nov 2018 17:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340637 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 340637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C06DE80296 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.476,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 17:17:24 -0000 Author: alc Date: Mon Nov 19 17:17:23 2018 New Revision: 340637 URL: https://svnweb.freebsd.org/changeset/base/340637 Log: Use swp_pager_isondev() throughout. Submitted by: ota@j.email.ne.jp Change swp_pager_isondev()'s return type to bool. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D16712 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Nov 19 17:09:57 2018 (r340636) +++ head/sys/vm/swap_pager.c Mon Nov 19 17:17:23 2018 (r340637) @@ -756,7 +756,7 @@ done: return (blk); } -static int +static bool swp_pager_isondev(daddr_t blk, struct swdevt *sp) { @@ -770,7 +770,7 @@ swp_pager_strategy(struct buf *bp) mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) { - if (bp->b_blkno >= sp->sw_first && bp->b_blkno < sp->sw_end) { + if (swp_pager_isondev(bp->b_blkno, sp)) { mtx_unlock(&sw_dev_mtx); if ((sp->sw_flags & SW_UNMAPPED) != 0 && unmapped_buf_allowed) { @@ -804,7 +804,7 @@ swp_pager_freeswapspace(daddr_t blk, daddr_t npages) return; mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) { - if (blk >= sp->sw_first && blk < sp->sw_end) { + if (swp_pager_isondev(blk, sp)) { sp->sw_used -= npages; /* * If we are attempting to stop swapping on From owner-svn-src-head@freebsd.org Mon Nov 19 17:22:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E48F1110D929; Mon, 19 Nov 2018 17:22:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 832F880A66; Mon, 19 Nov 2018 17:22:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A4E62515F; Mon, 19 Nov 2018 17:22:53 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJHMroK061231; Mon, 19 Nov 2018 17:22:53 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJHMrb2061230; Mon, 19 Nov 2018 17:22:53 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811191722.wAJHMrb2061230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 19 Nov 2018 17:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340638 - head/lib/libcasper/services/cap_dns X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_dns X-SVN-Commit-Revision: 340638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 832F880A66 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.476,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 17:22:54 -0000 Author: oshogbo Date: Mon Nov 19 17:22:52 2018 New Revision: 340638 URL: https://svnweb.freebsd.org/changeset/base/340638 Log: libcasper: provide compatibility with the old version of service Some external tools like tcpdump(1) have upstream the changes with old limits name. Because of that provide compatibility with the old names. Reported by: emaste Modified: head/lib/libcasper/services/cap_dns/cap_dns.c Modified: head/lib/libcasper/services/cap_dns/cap_dns.c ============================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.c Mon Nov 19 17:17:23 2018 (r340637) +++ head/lib/libcasper/services/cap_dns/cap_dns.c Mon Nov 19 17:22:52 2018 (r340638) @@ -474,7 +474,8 @@ dns_gethostbyname(const nvlist_t *limits, const nvlist struct hostent *hp; int family; - if (!dns_allowed_type(limits, "NAME2ADDR")) + if (!dns_allowed_type(limits, "NAME2ADDR") && + !dns_allowed_type(limits, "NAME")) return (NO_RECOVERY); family = (int)nvlist_get_number(nvlin, "family"); @@ -498,7 +499,8 @@ dns_gethostbyaddr(const nvlist_t *limits, const nvlist size_t addrsize; int family; - if (!dns_allowed_type(limits, "ADDR2NAME")) + if (!dns_allowed_type(limits, "ADDR2NAME") && + !dns_allowed_type(limits, "ADDR")) return (NO_RECOVERY); family = (int)nvlist_get_number(nvlin, "family"); @@ -524,7 +526,8 @@ dns_getnameinfo(const nvlist_t *limits, const nvlist_t socklen_t salen; int error, flags; - if (!dns_allowed_type(limits, "ADDR2NAME")) + if (!dns_allowed_type(limits, "ADDR2NAME") && + !dns_allowed_type(limits, "ADDR")) return (NO_RECOVERY); error = 0; @@ -617,7 +620,8 @@ dns_getaddrinfo(const nvlist_t *limits, const nvlist_t unsigned int ii; int error, family, n; - if (!dns_allowed_type(limits, "NAME2ADDR")) + if (!dns_allowed_type(limits, "NAME2ADDR") && + !dns_allowed_type(limits, "NAME")) return (NO_RECOVERY); hostname = dnvlist_get_string(nvlin, "hostname", NULL); @@ -703,7 +707,9 @@ dns_limit(const nvlist_t *oldlimits, const nvlist_t *n return (EINVAL); type = nvlist_get_string(newlimits, name); if (strcmp(type, "ADDR2NAME") != 0 && - strcmp(type, "NAME2ADDR") != 0) { + strcmp(type, "NAME2ADDR") != 0 && + strcmp(type, "ADDR") != 0 && + strcmp(type, "NAME") != 0) { return (EINVAL); } if (!dns_allowed_type(oldlimits, type)) From owner-svn-src-head@freebsd.org Mon Nov 19 17:26:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 154A3110DAE6; Mon, 19 Nov 2018 17:26:33 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BCFD80C61; Mon, 19 Nov 2018 17:26:32 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f169.google.com with SMTP id n18-v6so5877772lji.7; Mon, 19 Nov 2018 09:26:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OMUIucwwhZ4mInbMD/qmxtUPg0i6uh6NMlUgnwL4jKM=; b=uRPRtoip694t/+c3TBqP515dwplXxwd+73m4kacPJVWdXq2T6dxNlbKtgF8dD2EbrV vcmkDpYlsMP5ch3CVbQ6NweueF4drg9bw+2z3Qw0VvcjAZTMAutsESFUo/7UwJs32fdE fKb9BSikzKcwUoEiQQjTqV7O+eL4dK5UaRZxf5ttphaBaPjZAsLb2F0LDCBxH48+lJY1 E/syBswgY4CE0KVoLSp5htlmuby9XRJEcZPjX51HFPCAfFbXIP77uNAx5j8D8Ub2e1R1 ea9nomUlEvbfPiZks4l+mcVzPYINCr2Ur3DKZ0SM3Kei2m1CtrketGkfwuatX170Pk0t 7b/Q== X-Gm-Message-State: AGRZ1gJ2FnsVQ+rKKwUg76h/9kiabFZKiPXeqdcAgAE6ql3ZVb2sCECG bGppXZPdzLARNYCqHKeAKCQM/OtiXclGZpYjXh1VPYPO X-Google-Smtp-Source: AJdET5f5pBpq6otbScOkhqkVLwYUYE58pRaUqU5Urk49Zx/Qy2+wQMXPgIwvT+oju9Fpfyk45GcKdNWhdgvINGoy8wQ= X-Received: by 2002:a2e:5418:: with SMTP id i24-v6mr13233068ljb.51.1542648384803; Mon, 19 Nov 2018 09:26:24 -0800 (PST) MIME-Version: 1.0 References: <201805042054.w44KsRtc038808@repo.freebsd.org> In-Reply-To: From: Alan Somers Date: Mon, 19 Nov 2018 10:26:13 -0700 Message-ID: Subject: Re: svn commit: r333263 - in head: lib/libjail sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs sys/compat/linsysfs sys/fs/devfs sys/fs/fdescfs sys/fs/nullfs sys/fs/procfs sys/fs/pse... To: jamie@freebsd.org Cc: src-committers , svn-src-all , svn-src-head , Ross Williams X-Rspamd-Queue-Id: 3BCFD80C61 X-Spamd-Result: default: False [-3.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; RCVD_IN_DNSWL_NONE(0.00)[169.208.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.05)[ipnet: 209.85.128.0/17(-3.47), asn: 15169(-1.67), country: US(-0.09)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[169.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 17:26:33 -0000 On Fri, Nov 16, 2018 at 7:16 PM James Gritton wrote: > On 2018-11-16 16:30, Alan Somers wrote: > > On Fri, Nov 16, 2018 at 2:28 PM James Gritton wrote: > >> On 2018-11-16 10:34, Alan Somers wrote: >> >> On Fri, May 4, 2018 at 2:54 PM Jamie Gritton wrote: >> >>> Author: jamie >>> Date: Fri May 4 20:54:27 2018 >>> New Revision: 333263 >>> URL: https://svnweb.freebsd.org/changeset/base/333263 >>> >>> Log: >>> Make it easier for filesystems to count themselves as jail-enabled, >>> by doing most of the work in a new function prison_add_vfs in >>> kern_jail.c >>> Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, and >>> the rest is taken care of. This includes adding a jail parameter like >>> allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allowed. >>> Both of these used to be a static list of known filesystems, with >>> predefined permission bits. >>> >>> Reviewed by: kib >>> Differential Revision: D14681 >>> >>> Modified: >>> head/lib/libjail/jail.c >>> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >>> head/sys/compat/linprocfs/linprocfs.c >>> head/sys/compat/linsysfs/linsysfs.c >>> head/sys/fs/devfs/devfs_vfsops.c >>> head/sys/fs/fdescfs/fdesc_vfsops.c >>> head/sys/fs/nullfs/null_vfsops.c >>> head/sys/fs/procfs/procfs.c >>> head/sys/fs/pseudofs/pseudofs.h >>> head/sys/fs/tmpfs/tmpfs_vfsops.c >>> head/sys/kern/kern_jail.c >>> head/sys/kern/vfs_init.c >>> head/sys/kern/vfs_mount.c >>> head/sys/kern/vfs_subr.c >>> head/sys/sys/jail.h >>> head/sys/sys/mount.h >>> head/usr.sbin/jail/jail.8 >>> >>> Modified: head/lib/libjail/jail.c >>> >>> ============================================================================== >>> --- head/lib/libjail/jail.c Fri May 4 20:38:26 2018 (r333262) >>> +++ head/lib/libjail/jail.c Fri May 4 20:54:27 2018 (r333263) >>> @@ -1048,7 +1048,13 @@ kldload_param(const char *name) >>> else if (strcmp(name, "sysvmsg") == 0 || strcmp(name, "sysvsem") >>> == 0 || >>> strcmp(name, "sysvshm") == 0) >>> kl = kldload(name); >>> - else { >>> + else if (strncmp(name, "allow.mount.", 12) == 0) { >>> + /* Load the matching filesystem */ >>> + kl = kldload(name + 12); >>> + if (kl < 0 && errno == ENOENT && >>> + strncmp(name + 12, "no", 2) == 0) >>> + kl = kldload(name + 14); >>> + } else { >>> errno = ENOENT; >>> return (-1); >>> } >>> >> I'm curious about this part of the change. Why is it necessary to load >> the module in the "allow.mount.noXXXfs" case, when the jail is forbidden to >> mount the filesystem? It seems like that would just load modules that >> aren't going to be used. >> Additional discussion at https://github.com/iocage/iocage/issues/689 . >> -Alan >> >> Presumably such a parameter would be included in some jails in >> conjunction with the positive being included in others (perhaps as a >> default). The truth is I never really considered whether the "no" option >> would be used, I just always treat these option as pairs. >> It may be reasonable (at least in the allow.mount.* case) to silently >> disregard a "no" option that doesn't exist, but I don't know how many >> places would need to be modified for that to go smoothly. Though I don't >> expect that there would be too many people who bother to include a jail >> parameter about a filesystem which they're not planning to use. >> - Jamie >> > > Well, many people use the "no" option because one of the most popular jail > managers, iocage, uses it under the hood. But since "no" is the default, > its presence on the command line is a noop. Are there any situations in > which the "no" option has an effect? The only two possibilities I could > think of were: > > 1) Somebody puts both the positive and negative options on the same > command line. From experiment, it seems like the last option takes > effect. In this case, the presence of the positive option would cause the > kld to be loaded, regardless of the presence of the negative option. > 2) When using hierarchical jails, it might make sense to use the positive > option for the outer jail and the negative option for the inner jail. But > this would only be important if the inner jail inherited the outer jail's > parameters, which doesn't seem to be the case. > > So I can't think of any reason to continue to mount the kld for "no" > options. Can you? > > > 3) There's allow.mount.foofs as a global parameter, with some jails > overriding that with a jail-specific allow.mount.nofoofs. In that case, > KLD loading shouldn't be a problem as global parameters typically come > first. > > It makes sense not to load a KLD for a "no" option, as long as that option > is then silently ignored. I wouldn't want it to error out with "unknown > parameter". > See also https://github.com/iocage/iocage/issues/689 From owner-svn-src-head@freebsd.org Mon Nov 19 17:33:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B276A110DE61; Mon, 19 Nov 2018 17:33:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 557EC8129C; Mon, 19 Nov 2018 17:33:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36A742530A; Mon, 19 Nov 2018 17:33:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJHXjCf066527; Mon, 19 Nov 2018 17:33:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJHXiUr066525; Mon, 19 Nov 2018 17:33:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811191733.wAJHXiUr066525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 19 Nov 2018 17:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340639 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 340639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 557EC8129C X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.48)[0.476,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 17:33:45 -0000 Author: markj Date: Mon Nov 19 17:33:44 2018 New Revision: 340639 URL: https://svnweb.freebsd.org/changeset/base/340639 Log: Remove comments made obsolete by the ino64 work. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/fuse/fuse_internal.c head/sys/fs/fuse/fuse_internal.h Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Mon Nov 19 17:22:52 2018 (r340638) +++ head/sys/fs/fuse/fuse_internal.c Mon Nov 19 17:33:44 2018 (r340639) @@ -350,7 +350,7 @@ fuse_internal_readdir_processdata(struct uio *uio, fiov_adjust(cookediov, bytesavail); de = (struct dirent *)cookediov->base; - de->d_fileno = fudge->ino; /* XXX: truncation */ + de->d_fileno = fudge->ino; de->d_reclen = bytesavail; de->d_type = fudge->type; de->d_namlen = fudge->namelen; Modified: head/sys/fs/fuse/fuse_internal.h ============================================================================== --- head/sys/fs/fuse/fuse_internal.h Mon Nov 19 17:22:52 2018 (r340638) +++ head/sys/fs/fuse/fuse_internal.h Mon Nov 19 17:33:44 2018 (r340639) @@ -212,7 +212,7 @@ fuse_internal_attr_fat2vat(struct mount *mp, vattr_null(vap); vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; - vap->va_fileid = fat->ino; /* XXX cast from 64 bits to 32 */ + vap->va_fileid = fat->ino; vap->va_mode = fat->mode & ~S_IFMT; vap->va_nlink = fat->nlink; vap->va_uid = fat->uid; From owner-svn-src-head@freebsd.org Mon Nov 19 18:12:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37AD11121CEB; Mon, 19 Nov 2018 18:12:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9B9483D87; Mon, 19 Nov 2018 18:12:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAC982597D; Mon, 19 Nov 2018 18:12:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJICdtW087393; Mon, 19 Nov 2018 18:12:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJICdFf087392; Mon, 19 Nov 2018 18:12:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811191812.wAJICdFf087392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 19 Nov 2018 18:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340640 - head/lib/libc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc X-SVN-Commit-Revision: 340640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C9B9483D87 X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.297,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:12:40 -0000 Author: emaste Date: Mon Nov 19 18:12:39 2018 New Revision: 340640 URL: https://svnweb.freebsd.org/changeset/base/340640 Log: libc: forcibly disable BIND_NOW Building libc WITH_BIND_NOW results in segfault at process start. For now force BIND_NOW off until the root cause can be identified and fixed. PR: 233333 Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Mon Nov 19 17:33:44 2018 (r340639) +++ head/lib/libc/Makefile Mon Nov 19 18:12:39 2018 (r340640) @@ -6,6 +6,8 @@ SHLIBDIR?= /lib .include +# BIND_NOW in libc results in segfault at startup (PR 233333) +MK_BIND_NOW= no # Force building of libc_pic.a MK_TOOLCHAIN= yes From owner-svn-src-head@freebsd.org Mon Nov 19 18:23:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB5A311227BB; Mon, 19 Nov 2018 18:23:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82F0485025; Mon, 19 Nov 2018 18:23:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 645A625B26; Mon, 19 Nov 2018 18:23:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJINIFp093946; Mon, 19 Nov 2018 18:23:18 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJINIfp093945; Mon, 19 Nov 2018 18:23:18 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811191823.wAJINIfp093945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 19 Nov 2018 18:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340641 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 340641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 82F0485025 X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.297,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:23:20 -0000 Author: trasz Date: Mon Nov 19 18:23:17 2018 New Revision: 340641 URL: https://svnweb.freebsd.org/changeset/base/340641 Log: Make sysconf(_SC_PAGESIZE) return the value from getpagesize(3). That avoids a syscall - getpagesize(3) gets the value from the ELF aux strings. Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17989 Modified: head/lib/libc/gen/sysconf.c Modified: head/lib/libc/gen/sysconf.c ============================================================================== --- head/lib/libc/gen/sysconf.c Mon Nov 19 18:12:39 2018 (r340640) +++ head/lib/libc/gen/sysconf.c Mon Nov 19 18:23:17 2018 (r340641) @@ -291,10 +291,7 @@ do_NAME_MAX: mib[1] = CTL_P1003_1B_MQ_OPEN_MAX; goto yesno; case _SC_PAGESIZE: - defaultresult = getpagesize(); - mib[0] = CTL_P1003_1B; - mib[1] = CTL_P1003_1B_PAGESIZE; - goto yesno; + return (getpagesize()); case _SC_RTSIG_MAX: mib[0] = CTL_P1003_1B; mib[1] = CTL_P1003_1B_RTSIG_MAX; From owner-svn-src-head@freebsd.org Mon Nov 19 18:24:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1AA41122896; Mon, 19 Nov 2018 18:24:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C1EE852CC; Mon, 19 Nov 2018 18:24:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D5BF25B2C; Mon, 19 Nov 2018 18:24:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJIO9Gk094172; Mon, 19 Nov 2018 18:24:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJIO9LP094171; Mon, 19 Nov 2018 18:24:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201811191824.wAJIO9LP094171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 19 Nov 2018 18:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340642 - head/lib/libthr/thread X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libthr/thread X-SVN-Commit-Revision: 340642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C1EE852CC X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.30)[0.297,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:24:09 -0000 Author: trasz Date: Mon Nov 19 18:24:08 2018 New Revision: 340642 URL: https://svnweb.freebsd.org/changeset/base/340642 Log: Make libthr(3) use sysconf(_SC_NPROCESSORS_CONF); this shaves off two calls to sysctl(2) from the binary startup. Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18046 Modified: head/lib/libthr/thread/thr_init.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Mon Nov 19 18:23:17 2018 (r340641) +++ head/lib/libthr/thread/thr_init.c Mon Nov 19 18:24:08 2018 (r340642) @@ -474,8 +474,9 @@ init_private(void) PANIC("Cannot get stack rlimit"); _thr_stack_initial = rlim.rlim_cur; } - len = sizeof(_thr_is_smp); - sysctlbyname("kern.smp.cpus", &_thr_is_smp, &len, NULL, 0); + _thr_is_smp = sysconf(_SC_NPROCESSORS_CONF); + if (_thr_is_smp == -1) + PANIC("Cannot get _SC_NPROCESSORS_CONF"); _thr_is_smp = (_thr_is_smp > 1); _thr_page_size = getpagesize(); _thr_guard_default = _thr_page_size; From owner-svn-src-head@freebsd.org Mon Nov 19 18:29:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C94A1122AB6; Mon, 19 Nov 2018 18:29:04 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0000A8589A; Mon, 19 Nov 2018 18:29:03 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D494525B35; Mon, 19 Nov 2018 18:29:03 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJIT3ax094602; Mon, 19 Nov 2018 18:29:03 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJIT3WS094599; Mon, 19 Nov 2018 18:29:03 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811191829.wAJIT3WS094599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Mon, 19 Nov 2018 18:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340644 - in head/sys: dev/acpica kern sys X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: in head/sys: dev/acpica kern sys X-SVN-Commit-Revision: 340644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0000A8589A X-Spamd-Result: default: False [0.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.31)[0.308,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:29:04 -0000 Author: bwidawsk Date: Mon Nov 19 18:29:03 2018 New Revision: 340644 URL: https://svnweb.freebsd.org/changeset/base/340644 Log: acpi: fix acpi_ec_probe to only check EC devices This patch utilizes the fixed_devclass attribute in order to make sure other acpi devices with params don't get confused for an EC device. The existing code assumes that acpi_ec_probe is only ever called with a dereferencable acpi param. Aside from being incorrect because other devices of ACPI_TYPE_DEVICE may be probed here which aren't ec devices, (and they may have set acpi private data), it is even more nefarious if another ACPI driver uses private data which is not dereferancable. This will result in a pointer deref during boot and therefore boot failure. On X86, as it stands today, no other devices actually do this (acpi_cpu checks for PROCESSOR type devices) and so there is no issue. I ran into this because I am adding such a device which gets probed before acpi_ec_probe and sets private data. If ARM ever has an EC, I think they'd run into this issue as well. There have been several iterations of this patch. Earlier iterations had ECDT enumerated ECs not call into the probe/attach functions of this driver. This change was Suggested by: jhb@. Reviewed by: jhb Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D16635 Modified: head/sys/dev/acpica/acpi_ec.c head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Mon Nov 19 18:26:11 2018 (r340643) +++ head/sys/dev/acpica/acpi_ec.c Mon Nov 19 18:29:03 2018 (r340644) @@ -345,92 +345,95 @@ acpi_ec_probe(device_t dev) struct acpi_ec_params *params; static char *ec_ids[] = { "PNP0C09", NULL }; + ret = ENXIO; + /* Check that this is a device and that EC is not disabled. */ if (acpi_get_type(dev) != ACPI_TYPE_DEVICE || acpi_disabled("ec")) - return (ENXIO); + return (ret); - /* - * If probed via ECDT, set description and continue. Otherwise, - * we can access the namespace and make sure this is not a - * duplicate probe. - */ - ret = ENXIO; - ecdt = 0; + if (device_is_devclass_fixed(dev)) { + /* + * If probed via ECDT, set description and continue. Otherwise, we can + * access the namespace and make sure this is not a duplicate probe. + */ + ecdt = 1; + params = acpi_get_private(dev); + if (params != NULL) + ret = 0; + + goto out; + } + + ret = ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids, NULL); + if (ret > 0) + return (ret); + + params = malloc(sizeof(struct acpi_ec_params), M_TEMP, M_WAITOK | M_ZERO); + buf.Pointer = NULL; buf.Length = ACPI_ALLOCATE_BUFFER; - params = acpi_get_private(dev); - if (params != NULL) { - ecdt = 1; - ret = 0; - } else { - ret = ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids, NULL); - if (ret > 0) - goto out; - params = malloc(sizeof(struct acpi_ec_params), M_TEMP, - M_WAITOK | M_ZERO); - h = acpi_get_handle(dev); + h = acpi_get_handle(dev); - /* - * Read the unit ID to check for duplicate attach and the - * global lock value to see if we should acquire it when - * accessing the EC. - */ - status = acpi_GetInteger(h, "_UID", ¶ms->uid); - if (ACPI_FAILURE(status)) - params->uid = 0; - status = acpi_GetInteger(h, "_GLK", ¶ms->glk); - if (ACPI_FAILURE(status)) - params->glk = 0; + /* + * Read the unit ID to check for duplicate attach and the global lock value + * to see if we should acquire it when accessing the EC. + */ + status = acpi_GetInteger(h, "_UID", ¶ms->uid); + if (ACPI_FAILURE(status)) + params->uid = 0; - /* - * Evaluate the _GPE method to find the GPE bit used by the EC to - * signal status (SCI). If it's a package, it contains a reference - * and GPE bit, similar to _PRW. - */ - status = AcpiEvaluateObject(h, "_GPE", NULL, &buf); - if (ACPI_FAILURE(status)) { - device_printf(dev, "can't evaluate _GPE - %s\n", - AcpiFormatException(status)); - goto out; - } - obj = (ACPI_OBJECT *)buf.Pointer; - if (obj == NULL) - goto out; + status = acpi_GetInteger(h, "_GLK", ¶ms->glk); + if (ACPI_FAILURE(status)) + params->glk = 0; - switch (obj->Type) { - case ACPI_TYPE_INTEGER: - params->gpe_handle = NULL; - params->gpe_bit = obj->Integer.Value; - break; - case ACPI_TYPE_PACKAGE: - if (!ACPI_PKG_VALID(obj, 2)) - goto out; - params->gpe_handle = - acpi_GetReference(NULL, &obj->Package.Elements[0]); - if (params->gpe_handle == NULL || - acpi_PkgInt32(obj, 1, ¶ms->gpe_bit) != 0) - goto out; - break; - default: - device_printf(dev, "_GPE has invalid type %d\n", obj->Type); - goto out; - } + /* + * Evaluate the _GPE method to find the GPE bit used by the EC to signal + * status (SCI). If it's a package, it contains a reference and GPE bit, + * similar to _PRW. + */ + status = AcpiEvaluateObject(h, "_GPE", NULL, &buf); + if (ACPI_FAILURE(status)) { + device_printf(dev, "can't evaluate _GPE - %s\n", AcpiFormatException(status)); + goto out; + } - /* Store the values we got from the namespace for attach. */ - acpi_set_private(dev, params); + obj = (ACPI_OBJECT *)buf.Pointer; + if (obj == NULL) + goto out; - /* - * Check for a duplicate probe. This can happen when a probe - * via ECDT succeeded already. If this is a duplicate, disable - * this device. - */ - peer = devclass_get_device(acpi_ec_devclass, params->uid); - if (peer != NULL && device_is_alive(peer)){ - ret = ENXIO; - device_disable(dev); - } + switch (obj->Type) { + case ACPI_TYPE_INTEGER: + params->gpe_handle = NULL; + params->gpe_bit = obj->Integer.Value; + break; + case ACPI_TYPE_PACKAGE: + if (!ACPI_PKG_VALID(obj, 2)) + goto out; + params->gpe_handle = acpi_GetReference(NULL, &obj->Package.Elements[0]); + if (params->gpe_handle == NULL || + acpi_PkgInt32(obj, 1, ¶ms->gpe_bit) != 0) + goto out; + break; + default: + device_printf(dev, "_GPE has invalid type %d\n", obj->Type); + goto out; } + /* Store the values we got from the namespace for attach. */ + acpi_set_private(dev, params); + + /* + * Check for a duplicate probe. This can happen when a probe via ECDT + * succeeded already. If this is a duplicate, disable this device. + */ + peer = devclass_get_device(acpi_ec_devclass, params->uid); + if (peer == NULL || !device_is_alive(peer)) + ret = 0; + else + device_disable(dev); + + if (buf.Pointer) + AcpiOsFree(buf.Pointer); out: if (ret <= 0) { snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s", @@ -439,8 +442,7 @@ out: device_set_desc_copy(dev, desc); } else free(params, M_TEMP); - if (buf.Pointer) - AcpiOsFree(buf.Pointer); + return (ret); } Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Nov 19 18:26:11 2018 (r340643) +++ head/sys/kern/subr_bus.c Mon Nov 19 18:29:03 2018 (r340644) @@ -2780,6 +2780,16 @@ device_set_devclass_fixed(device_t dev, const char *cl } /** + * @brief Query the device to determine if it's of a fixed devclass + * @see device_set_devclass_fixed() + */ +bool +device_is_devclass_fixed(device_t dev) +{ + return ((dev->flags & DF_FIXEDCLASS) != 0); +} + +/** * @brief Set the driver of a device * * @retval 0 success Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Mon Nov 19 18:26:11 2018 (r340643) +++ head/sys/sys/bus.h Mon Nov 19 18:29:03 2018 (r340644) @@ -612,6 +612,7 @@ void device_set_desc(device_t dev, const char* desc); void device_set_desc_copy(device_t dev, const char* desc); int device_set_devclass(device_t dev, const char *classname); int device_set_devclass_fixed(device_t dev, const char *classname); +bool device_is_devclass_fixed(device_t dev); int device_set_driver(device_t dev, driver_t *driver); void device_set_flags(device_t dev, u_int32_t flags); void device_set_softc(device_t dev, void *softc); From owner-svn-src-head@freebsd.org Mon Nov 19 18:32:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07C311122E70; Mon, 19 Nov 2018 18:32:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64CDF85F63; Mon, 19 Nov 2018 18:32:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f45.google.com with SMTP id f12-v6so22994830iog.0; Mon, 19 Nov 2018 10:32:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=le6WfTs6iFcNUnPnulDIUNjiE3ug48b6qAGcAb+qODY=; b=aJpHYxQMWXtVzIx6z4X2366Uzj1tdzAiAY501MGa/SAwFNoBnDTwqJhpNgDwlljbPb IR2DdmgHgsRFuJSRa+YuHD+iTXeeitIV+sUGy5aTpqmIHHurc7kyryqvO7W0grQOvv/r TJARx8DpRIwOFKa4GxPYDelxh/Rq6rzkSrnAk8DPqC2pxj8NRB46BnKc3Q1eGINt6hMR OKAyoBornP+nPJdmgozrrxChiIjQkB5Klzt8Sd86hbMn6YzD2E1oR7AIQU5kq8sHUhhk nouUPBYuVjJSCKWe8jn4lr2MkQsdjTndW2D8KjBloxpV85LNG9OwwEPkAJMv9UdX7twd UJvw== X-Gm-Message-State: AGRZ1gKvlAG38Ra7x0W+4a+/8MTzlQsIZCT80uvwdkL1cLf8UOkUup9r +64BOkJojNL5pfzTXj+g1N6LfAQ+ X-Google-Smtp-Source: AFSGD/VYee6QUsstEsEbfGYfSwh/lSubUhhwJI5H+GQLRF/Tmb3fkUHfnBSMygsTuhgE+m93z9L7Sg== X-Received: by 2002:a6b:b642:: with SMTP id g63-v6mr18907815iof.34.1542652361235; Mon, 19 Nov 2018 10:32:41 -0800 (PST) Received: from mail-it1-f174.google.com (mail-it1-f174.google.com. [209.85.166.174]) by smtp.gmail.com with ESMTPSA id g4sm2975216iop.49.2018.11.19.10.32.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 10:32:41 -0800 (PST) Received: by mail-it1-f174.google.com with SMTP id h193so8427827ita.5; Mon, 19 Nov 2018 10:32:41 -0800 (PST) X-Received: by 2002:a24:7296:: with SMTP id x144-v6mr8663209itc.166.1542652360635; Mon, 19 Nov 2018 10:32:40 -0800 (PST) MIME-Version: 1.0 References: <201810201916.w9KJGh0H066643@repo.freebsd.org> <2afa1dbf-10f9-8e38-36b6-e40fb0020d87@freebsd.org> In-Reply-To: <2afa1dbf-10f9-8e38-36b6-e40fb0020d87@freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 19 Nov 2018 10:32:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339476 - head/sys/i386/conf To: Niclas Zeising Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 64CDF85F63 X-Spamd-Result: default: False [-2.97 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-1.04)[ipnet: 209.85.128.0/17(-3.46), asn: 15169(-1.66), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.92)[-0.922,0]; RCVD_IN_DNSWL_NONE(0.00)[45.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:32:48 -0000 No. On Mon, Nov 19, 2018 at 7:58 AM Niclas Zeising wrote: > > On 10/20/18 9:16 PM, Conrad Meyer wrote: > > Author: cem > > Date: Sat Oct 20 19:16:43 2018 > > New Revision: 339476 > > URL: https://svnweb.freebsd.org/changeset/base/339476 > > > > Log: > > Add a MINIMAL config for i386, based on amd64 > > > > Any plans to MFC this? > Regards > -- > Niclas Zeising From owner-svn-src-head@freebsd.org Mon Nov 19 18:58:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A05AF1123A4E; Mon, 19 Nov 2018 18:58:35 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46CDD87036; Mon, 19 Nov 2018 18:58:35 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23EFA26024; Mon, 19 Nov 2018 18:58:35 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJIwYxY010003; Mon, 19 Nov 2018 18:58:34 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJIwY0S010002; Mon, 19 Nov 2018 18:58:34 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201811191858.wAJIwY0S010002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 19 Nov 2018 18:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340645 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 340645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46CDD87036 X-Spamd-Result: default: False [0.46 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.44)[0.438,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:58:35 -0000 Author: arichardson Date: Mon Nov 19 18:58:34 2018 New Revision: 340645 URL: https://svnweb.freebsd.org/changeset/base/340645 Log: Add capsicum_helpers.h to -legacy if needed This fixes bootstrap of capsicumized strings on FreeBSD 11. Reviewed By: oshogbo, bdrewery Differential Revision: https://reviews.freebsd.org/D17971 Modified: head/tools/build/Makefile Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Mon Nov 19 18:29:03 2018 (r340644) +++ head/tools/build/Makefile Mon Nov 19 18:58:34 2018 (r340645) @@ -48,6 +48,16 @@ INCS+= strings.h SRCS+= explicit_bzero.c .endif +.if exists(/usr/include/capsicum_helpers.h) +_WITH_CAPH_ENTER!= grep -c caph_enter /usr/include/capsicum_helpers.h || true +.endif +.if !defined(_WITH_CAPH_ENTER) || ${_WITH_CAPH_ENTER} == 0 +.PATH: ${SRCTOP}/lib/libcapsicum +INCS+= capsicum_helpers.h +.PATH: ${SRCTOP}/lib/libcasper/libcasper +INCS+= libcasper.h +.endif + .if empty(SRCS) SRCS= dummy.c .endif From owner-svn-src-head@freebsd.org Mon Nov 19 19:38:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9100F112505C for ; Mon, 19 Nov 2018 19:38:55 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 553168932F for ; Mon, 19 Nov 2018 19:38:54 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm1-x32a.google.com with SMTP id p2-v6so6417225wmc.2 for ; Mon, 19 Nov 2018 11:38:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pjEpAGVkN73gdX1dj0hFF9z0laXMUCvB1KSDr3bOKTk=; b=O1O+nJ6ifz50SNpAINjLeYmpf1CVFp4z4euj3uiWluutRZbUe/RaxaQLo7CVL7PJWn 850TJ7l43hFAwDVH4cuLbR/KTNO6rYWzioEu2SJFahkdYrbd9grmKBMA+cCVGh6H2KRu v/50axRX4Hj20Olp14+izgcHDlnLZAo4EBygCbBlMC32F63kAk4FpgZnI/E40Sq/IhCj dFKMf8p1pHGxtVTV8yTff3+jIS72aidmcqJ5awlclCazSCXRbyQIgTfXoC7sowgVHmiM QTeD02nEjGOlgSxchwci6QwR5/XLbNrRvoDm07YOXuJrcB3+BfxyzPgm7LiESYNsfRQV Q7fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pjEpAGVkN73gdX1dj0hFF9z0laXMUCvB1KSDr3bOKTk=; b=UCYffO9Uzq6fjMMrmBaw3zpmz+N/U21ey4I1liGsBpoOVPxMW//JFtaMiMPHwcjYLY Lxi2s7Ist0RCvl2gFfn6eMngeAlzCAXLv0y19Qc2oQrjoIefAqsOqECS+3bNuK84754u 9pkuR3b030JShRMBwJObbfFffHyw5EpQtiwg1PS+agnmcQiry3/7lGokNtQHIPQbquwR gPn+e8uShzAK713+Ers+wtspRUA4Z7rswQkVp0i3vT3Xh9I2Lcz43SR7uu5OUwPuIBb/ u6gyxmXB6XNP+ADmvtpt9aT8VrDRMgV3J3XIyVVliqmJlyWlR4uSpnh0/nKZpwctXnl5 0yrQ== X-Gm-Message-State: AGRZ1gK1Ej3SOb8wDB1WSzBf7us+OHkA7lCsPDVg0j53OAVTxuyUMvM6 RZtdD7g/Lr27jtCSPq6b3HP9u2eC6yP3tQ== X-Google-Smtp-Source: AJdET5dcu0GWTf0Rdd62DnNPp8TELhYyZKXbfQp8rtGLwZm88BvJWpJrsBAeLsomyJqYfOFvcieQlA== X-Received: by 2002:a1c:2104:: with SMTP id h4-v6mr7730847wmh.130.1542656332794; Mon, 19 Nov 2018 11:38:52 -0800 (PST) Received: from mutt-hbsd ([195.135.194.134]) by smtp.gmail.com with ESMTPSA id q2sm20294930wru.56.2018.11.19.11.38.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 11:38:51 -0800 (PST) Date: Mon, 19 Nov 2018 14:38:10 -0500 From: Shawn Webb To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340640 - head/lib/libc Message-ID: <20181119193810.b4mexvznrqyb7j7v@mutt-hbsd> References: <201811191812.wAJICdFf087392@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bpbhymxallxpmppd" Content-Disposition: inline In-Reply-To: <201811191812.wAJICdFf087392@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT FreeBSD 13.0-CURRENT HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 X-Rspamd-Queue-Id: 553168932F X-Spamd-Result: default: False [-1.12 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(0.00)[hardenedbsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(0.00)[+ip6:2a00:1450:4000::/36]; RECEIVED_SPAMHAUS_XBL(3.00)[134.194.135.195.zen.spamhaus.org : 127.0.0.4]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; BAD_REP_POLICIES(0.10)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx2.googlemail.com,alt2.aspmx.l.google.com,aspmx3.googlemail.com]; RCVD_IN_DNSWL_NONE(0.00)[a.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.82)[-0.823,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; IP_SCORE(-0.69)[ipnet: 2a00:1450::/32(-1.70), asn: 15169(-1.66), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 19:38:55 -0000 --bpbhymxallxpmppd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 19, 2018 at 06:12:39PM +0000, Ed Maste wrote: > Author: emaste > Date: Mon Nov 19 18:12:39 2018 > New Revision: 340640 > URL: https://svnweb.freebsd.org/changeset/base/340640 >=20 > Log: > libc: forcibly disable BIND_NOW > =20 > Building libc WITH_BIND_NOW results in segfault at process start. For > now force BIND_NOW off until the root cause can be identified and fixed. > =20 > PR: 233333 > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/lib/libc/Makefile >=20 > Modified: head/lib/libc/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/Makefile Mon Nov 19 17:33:44 2018 (r340639) > +++ head/lib/libc/Makefile Mon Nov 19 18:12:39 2018 (r340640) > @@ -6,6 +6,8 @@ SHLIBDIR?=3D /lib > =20 > .include > =20 > +# BIND_NOW in libc results in segfault at startup (PR 233333) > +MK_BIND_NOW=3D no Since the use of ifunc in libc is only applicable to amd64, I wonder if it would be best to disable BIND_NOW in lib/libc/amd64/Makefile.inc. I don't believe there's any need to disable BIND_NOW for libc on other architectures. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --bpbhymxallxpmppd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlvzER0ACgkQaoRlj1JF bu5JzhAAnElmh4OS0FrWWzC19j53e+iI/9g4+Em80H/X2TrTmV0h9ADeebdyJIdI zy849RR+V6oRRxpzYWlT59Jn+Pvh/ARlWIKosId9f14NRnMdKEhP8G/jRmixkUF2 ZDGEad0cb+d0tGGf3m1EhagJ8bSr2aJ6yiygFnVO81/fdOKSAIjhqVdS4q0Oi5HH 1BJWzyFtCEipr3gK5i7Tnq5q7f5CSIi2sbL/EAfafl3gSopBUZuscQlqJal9LUQ1 ytFSiXNg6VD7rbekAV54cgpsw+cvPsIkV7AmB+W4yuUvendFnKbd2vOR4HvsOiGC IKiP1uBsCLJzyJ6EIptTemjDVJaurOpCsrhriesOFDiMMZEqiB3FEoe7s0oMWQf3 N6Uv7+JAhf9HUP/nCfC8MjIUaYzha42nbOv9/QZGUmLIha2vvdtVF73f8+P+xGtq hirJC8ZfII7rair3hjo0YR02W+ii0iiZV24XUl9GaSkswkXbxDP19BlCuRWdjdAh 6fwS+Oj2lKnCPl/jbvdtk0wOHnHuvISeFYYO5+GB04eTGxXdAU05g53Gqho84Z5h nqgT6SlvEOpaesMa76zT2wlvOhgnJleBBoXS9WEiYnaX1E7PVztbh5VHFArN6O6T Br+q2Q98wMuD1E5lY7V8dJIJDwwMqYSw3SPU0ZtF0DoSt3W/EBw= =2tib -----END PGP SIGNATURE----- --bpbhymxallxpmppd-- From owner-svn-src-head@freebsd.org Mon Nov 19 20:34:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14C941126959; Mon, 19 Nov 2018 20:34:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 771E98B3D4; Mon, 19 Nov 2018 20:34:38 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f195.google.com with SMTP id a205-v6so59906itd.4; Mon, 19 Nov 2018 12:34:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wZ7L94FHOEIJ4Wx4YtBOB4LT6WsDwMOVb5+V34YDHIw=; b=dlnN89acPAGaRWYAcsl7033UgRXerqfQ7juZLQsBCXLTSPPmZFLmjS7ZSprae0npjJ a5c8HYwR6Q6hl/OXwoHqfnq+pcxNFHg/8CzJVoxNwynhTCmZosRFaH3SHbxbzQqnbDkD UaR1TQsNzQX832lgjBPkUE/rkMk3MylRkeIpmCrGHGdsacwjkoLr2WIhbcny35g5vywF XTv+eZMhEmJ02UXqYoWFolXPa728rpOlgh3tR7bQLRhskIYMNBZBxwRPYDAUYg1PjF7H 65SgSyFe1VsfmrVY/a/TzJemaceWK8Z+5m4Cwr7CCVj6GsXZlZmUXBgVcLKWLpWnWJ0u u22g== X-Gm-Message-State: AA+aEWYVFz4u+4lq5Ag7MQ7yTt4vTt03B3omlHhRTKIfrj0KET/iWEjB HUYtJSaAtaElWJFkbtbWvRGo4d9+01l5j0N/uCFC+w== X-Google-Smtp-Source: AJdET5fmXJgbpuSqvRY1OBJ3ti39oMLrfpzxeMTH7ycMDBd5gUU7Dgl8pm/MFqFpWG6mywWOOWIzy2L40tJOBiy1W6w= X-Received: by 2002:a24:f5c1:: with SMTP id k184mr9386609ith.87.1542659671950; Mon, 19 Nov 2018 12:34:31 -0800 (PST) MIME-Version: 1.0 References: <201811191812.wAJICdFf087392@repo.freebsd.org> <20181119193810.b4mexvznrqyb7j7v@mutt-hbsd> In-Reply-To: <20181119193810.b4mexvznrqyb7j7v@mutt-hbsd> From: Ed Maste Date: Mon, 19 Nov 2018 15:34:16 -0500 Message-ID: Subject: Re: svn commit: r340640 - head/lib/libc To: Shawn Webb Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 771E98B3D4 X-Spamd-Result: default: False [-2.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; RCVD_IN_DNSWL_NONE(0.00)[195.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.04)[ipnet: 209.85.128.0/17(-3.43), asn: 15169(-1.67), country: US(-0.09)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[195.166.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 20:34:39 -0000 On Mon, 19 Nov 2018 at 14:38, Shawn Webb wrote: > > Since the use of ifunc in libc is only applicable to amd64, I wonder > if it would be best to disable BIND_NOW in > lib/libc/amd64/Makefile.inc. I don't believe there's any need to > disable BIND_NOW for libc on other architectures. At least arm64 and i386 will probably start making use of ifuncs in the not-too-distant future. After some more investigation and if we're sure that it's only ifuncs that are affected this might be made machine-dependent. From owner-svn-src-head@freebsd.org Mon Nov 19 20:45:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B94181126E25; Mon, 19 Nov 2018 20:45:50 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C5588BAA0; Mon, 19 Nov 2018 20:45:50 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BE86271F5; Mon, 19 Nov 2018 20:45:50 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJKjoTe067903; Mon, 19 Nov 2018 20:45:50 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJKjolj067902; Mon, 19 Nov 2018 20:45:50 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201811192045.wAJKjolj067902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Mon, 19 Nov 2018 20:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340649 - head/usr.bin/fortune/datfiles X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/usr.bin/fortune/datfiles X-SVN-Commit-Revision: 340649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C5588BAA0 X-Spamd-Result: default: False [0.47 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.45)[0.453,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 20:45:50 -0000 Author: bcr (doc committer) Date: Mon Nov 19 20:45:49 2018 New Revision: 340649 URL: https://svnweb.freebsd.org/changeset/base/340649 Log: Add a fortune describing how to upload a machine's dmesg information to the NYCBUG database. We want to encourage our users to upload their dmesgs so that the project can get a better insight into what kind of hardware is run on. This helps in making data-driven decisions about i.e., platform and driver support. Note that dmesgs may contain sensitive information like hardware serial numbers, hence uploading them without review is discouraged. Reviewed by: brooks, imp, allanjude Approved by: allanjude MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D17705 Modified: head/usr.bin/fortune/datfiles/freebsd-tips Modified: head/usr.bin/fortune/datfiles/freebsd-tips ============================================================================== --- head/usr.bin/fortune/datfiles/freebsd-tips Mon Nov 19 19:05:07 2018 (r340648) +++ head/usr.bin/fortune/datfiles/freebsd-tips Mon Nov 19 20:45:49 2018 (r340649) @@ -554,3 +554,9 @@ Use "sysrc name=value" to add an entry and "sysrc -x n -- Lars Engels % +You can upload the dmesg of your system to help developers get an overview of commonly used hardware and peripherals for FreeBSD. +Use the curl package to upload it in one command: +curl -v -d "nickname=$USER" -d "description=FreeBSD/$(uname -m) on \ +$(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=addd" \ +--data-urlencode 'dmesg@/var/run/dmesg.boot' http://dmesgd.nycbug.org/index.cgi +% From owner-svn-src-head@freebsd.org Mon Nov 19 20:48:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E7E1126F04; Mon, 19 Nov 2018 20:48:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFE8C8BC5D; Mon, 19 Nov 2018 20:48:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C915E271FC; Mon, 19 Nov 2018 20:48:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJKmlk4068085; Mon, 19 Nov 2018 20:48:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJKmltP068084; Mon, 19 Nov 2018 20:48:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811192048.wAJKmltP068084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 19 Nov 2018 20:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340650 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 340650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EFE8C8BC5D X-Spamd-Result: default: False [0.47 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.45)[0.453,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 20:48:48 -0000 Author: emaste Date: Mon Nov 19 20:48:47 2018 New Revision: 340650 URL: https://svnweb.freebsd.org/changeset/base/340650 Log: Avoid retpolineplt with static linking Statically linked binaries linked with -zretpolineplt crash at startup as lld produces a broken PLT. PR: 233336 Sponsored by: The FreeBSD Foundation Modified: head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Mon Nov 19 20:45:49 2018 (r340649) +++ head/share/mk/bsd.prog.mk Mon Nov 19 20:48:47 2018 (r340650) @@ -41,7 +41,10 @@ LDFLAGS+= -Wl,-znow .if ${MK_RETPOLINE} != "no" CFLAGS+= -mretpoline CXXFLAGS+= -mretpoline +# retpolineplt is broken with static linking (PR 233336) +.if !defined(NO_SHARED) || ${NO_SHARED} == "no" || ${NO_SHARED} == "NO" LDFLAGS+= -Wl,-zretpolineplt +.endif .endif .if defined(CRUNCH_CFLAGS) From owner-svn-src-head@freebsd.org Mon Nov 19 20:57:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5BBF11272CF for ; Mon, 19 Nov 2018 20:57:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x135.google.com (mail-it1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB6538C1C8 for ; Mon, 19 Nov 2018 20:57:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x135.google.com with SMTP id p11-v6so8326340itf.0 for ; Mon, 19 Nov 2018 12:57:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V9keR/S2XANhR74kkQO4MluzrMO8+5jqKQvG0LkGQqw=; b=H/hT19hS8h/zoljwRQHRKDISXei8iZzRQrjBZ8ROu+ADmjtVHv41ZovCxFAKXKnlYl 5y5xq/Mvn+3vD69jVKVqEzyMsWKP3E9eeqXXhEdFqoOcwtBgLjs04xDgRL4FRwT655iP 9Zp5fIKL0lMsfGA9jOn1A5/l7xQgBMoYQrRiGxVc77zk9jcQM8GEhw9PFbI8RwY95jZW PVfWOnBiUEm/yLTvYqQAghcsnvBrZKSGWviklgn8uQGaFd8m0HtzKeQOsUyg6EWtOhka knEn/K/b2aArfP1KgkfVs1how/ateaJq/5caEdWx+4YnQF6D2owPACon0NPWZh9yRWD+ opjQ== 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=V9keR/S2XANhR74kkQO4MluzrMO8+5jqKQvG0LkGQqw=; b=PbNLHy5LCflwn71Uz0wTiOD27IAanpAG+wvKSd12iaaJrBoQfUpQ54OyW0ss4UA6Hn 2jDVjmE7WxWMlrpgPNTIjlfoYnL+weuiF1P2Sp4ZXADVQd44Iy456ih1aOHhYcnquz8f 1MEIiJw1JGJNYL5CXudrzGX6iAwBiHWjCtQEn9v2mZ1TP9VJ9yUTqyvyFqFxwEsA+OUd lpf4nl/FM2XLIC6goOkUZhWRJpRRObGFj0QX68TccuWetFWuO3mwAhZ0BtV7JM9eL7bk NtoE0A2j3HKYCwpW88RpelnSC3yciZuzTrLkbtIaPrfZZDAhzhjCwzUUJsPzLH6+FKEC 33kA== X-Gm-Message-State: AA+aEWZ/qcicFOVe8RE3X47jYgJ2MjIm9xJLMmFPTW4Icb15UDHV5ZOE 2S2UPklvwTeyo/2BPFmLH6oAHzRP1diU/g+3+JU+yQ== X-Google-Smtp-Source: AJdET5fijaFkrDI9Eau8iZHa8cn/VTduwL2zrrEPt3cvZRuRFYyZnvEG5WL6R3hmbvG5ySTyX1o5+8iPeRThg8yPGa4= X-Received: by 2002:a24:5f94:: with SMTP id r142-v6mr10140749itb.171.1542661039677; Mon, 19 Nov 2018 12:57:19 -0800 (PST) MIME-Version: 1.0 References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> <20181120005944.B1050@besplex.bde.org> <20181120014951.J1250@besplex.bde.org> <20181120023823.M1428@besplex.bde.org> In-Reply-To: <20181120023823.M1428@besplex.bde.org> From: Warner Losh Date: Mon, 19 Nov 2018 13:57:08 -0700 Message-ID: Subject: Re: svn commit: r340450 - head/sys/sys To: Bruce Evans Cc: Andriy Gapon , "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: AB6538C1C8 X-Spamd-Result: default: False [-4.20 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_IN_DNSWL_NONE(0.00)[5.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.22)[ip: (-6.89), ipnet: 2607:f8b0::/32(-2.45), asn: 15169(-1.67), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 20:57:22 -0000 On Mon, Nov 19, 2018 at 9:05 AM Bruce Evans wrote: > On Tue, 20 Nov 2018, Bruce Evans wrote: > > > On Tue, 20 Nov 2018, Bruce Evans wrote: > > > >> On Mon, 19 Nov 2018, Warner Losh wrote: > >> > >>> On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > > ... > > I found my test program. > > > >>> But I think I understand the problem now. > >>> > >>> mstosbt(1000) is overflowing with my change, but not without because > we're > >>> adding 2^32 to a number that's ~900 away from overflowing changing a > very > >> > >> This value is just invalid. Negative values are obviously invalid. > >> Positive > >> values of more than 1 second are invalid. In the old version, values of > >> precisely 1 second don't overflow since the scale factor is rounded > down; > >> the result is just 1 unit lower than 1 second. Overflow (actually > >> truncation) > >> occurs at 1 unit above 1 second. E.g., sbttoms(mstosbt(1000)) was 999 > and > >> sbttoms(mstosbt(1001)) was 0. Now in my fixed version, > >> sbttoms(mstosbt(1000)) > >> is truncated to 0 and sbttoms(mstosbt(1001)) is truncated to 1. > >> > >> The test program also showed that in the old version, all valid args > except > >> 0 are reduced by precisely 1 by conversion to sbt and back. > >> > >>> large sleep of 1 second to a tiny sleep of 0 (which is 1ms at the > default > >>> Hz). I think we get this in the mlx code because there's a > msleep(1000) in > >>> at least one place. msleep(1001) would have failed before my change. > Now I > >>> think msleep(999) works, but msleep(1000) fails. Since the code is > waiting > >>> a second for hardware to initialize, a 1ms instead is likely to catch > the > >>> hardware before it's finished. I think this will cause problems no > matter > >>> cold or not, since it's all pause_sbt() under the covers and a delay > of 0 > >>> is still 0 either way. > >> > >> Bug in the mlx code. The seconds part must be converted separately, as > in > >> tstosbt(). > > > > mlx doesn't seem to use sbt directly, or even msleep(), so the bug does > > seem to be central. > > > > mlx actually uses mtx_sleep() with timo = hz(). mtx_sleep() is actually > > an obfuscated macro wrapping _sleep(). The conversion to sbt is done by > > the macro and is sloppy. It multiplies timo by tick_sbt. > > > > tick_sbt is SBT_1S / hz, so the sbt is SBT_1S / hz * hz which is SBT_1S > > reduced a little. This is not affected by the new code, and it still > isn't > > converted back to 1 second in ms, us or ns. Even if it is converted back > > and then forth to sbt using the new code, it remains less than 1 second > as > > an sbt so shouldn't cause any new problems. > > Here are all uses of these functions in kern outside of sys/time.h: > > XX arm/arm/mpcore_timer.c: sc->et.et_min_period = nstosbt(20); > > OK since 20 ns is less than 1 second. > > XX cddl/compat/opensolaris/sys/kcondvar.h: return > (cv_timedwait_sbt(cvp, mp, nstosbt(tim), nstosbt(res), 0)); > XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: > pause_sbt("dmu_tx_delay", nstosbt(wakeup), > XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: > nstosbt(zfs_delay_resolution_ns), C_ABSOLUTE); > XX cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c: sbintime_t sleep = > nstosbt((zilog->zl_last_lwb_latency * pct) / 100); > XX compat/linuxkpi/common/include/linux/delay.h: > pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK); > XX compat/linuxkpi/common/src/linux_hrtimer.c: > nstosbt(hrtimer->expires), nstosbt(hrtimer->precision), 0); > XX compat/linuxkpi/common/src/linux_hrtimer.c: > callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(time)), > XX compat/linuxkpi/common/src/linux_hrtimer.c: nstosbt(nsec), > hrtimer_call_handler, hrtimer, 0); > XX compat/linuxkpi/common/src/linux_hrtimer.c: > callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(interval)), > XX compat/linuxkpi/common/src/linux_hrtimer.c: > nstosbt(hrtimer->precision), hrtimer_call_handler, hrtimer, 0); > XX compat/linuxkpi/common/src/linux_schedule.c: ret = > -pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK | C_CATCH); > > All of the above might are broken unless their timeout arg is restricted to > less than 1 second. > > Also, at least the sleep and pause calls in the above probably have a > style bug in knowing about sbt's at all. More important functions > like msleep() hide the use of sbt's and use fuzzier scale factors like > tick_sbt. > Yes. It's for these users I'm fixing the >= 1s cases. > XX dev/iicbus/nxprtc.c: pause_sbt("nxpotp", mstosbt(100), > mstosbt(10), 0); > XX dev/iicbus/nxprtc.c: pause_sbt("nxpbat", mstosbt(100), 0, 0); > > OK since 100 ms is less than 1 second. > > XX kern/kern_sysctl.c: sb = ustosbt(tt); > XX kern/kern_sysctl.c: sb = mstosbt(tt); > > Recently added bugs. The args is supplied by applications so can be far > above > 1 second. > > Also, these functions have a bogus API that takes uint64_t args. sbt's > can't represent that high, and the API doesn't support failure, so callers > have the burden of passing valid values. It is easiest to only support > args > up to 1 second and require the caller to handle seconds. > It's just as easy to cope. > Lots of itimer and select() code handle the corresponding problem for > timevals and timespecs almost correctly. Timevals and timespecs already > have the seconds part separate and itimer and select() syscalls do validity > checking on the fractional seconds, so there is no problem converting the > fractional sections to an sbt. Howver, the seconds part has type time_t > and this can be int64_t, which sbt's cannot represent. Also, POSIX doesn't > permit failure for seconds values that are representable by time_t. The > almost correct handling is to split up large seconds values in some cases > and break POSIX conformance by silently reducing the seconds value in > other cases. The reduction is usually to INT32_MAX / 2. This allows > adding 2 limited values but it is not obvious that this is enough since > rounding up twice or just adding 2 more would give overflow. > Right, that's beyond the scope of what I'm fixing. > XX kern/subr_rtc.c: sbt = nstosbt(waitns); > > This is correct, since waitns is the nanoseconds part of a timespec. > Yup. https://reviews.freebsd.org/D18051 Contains the changes. They address all the actual problems you've raised, but I'm going to disagree that 'ull' is bogus. For FreeBSD, it's fine and it's a lot more readable than the alternatives. Warner From owner-svn-src-head@freebsd.org Mon Nov 19 21:59:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCD0F1128E0E; Mon, 19 Nov 2018 21:59:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BC9F8E264; Mon, 19 Nov 2018 21:59:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AA1927D48; Mon, 19 Nov 2018 21:59:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJLx8Rt004123; Mon, 19 Nov 2018 21:59:08 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJLx713004119; Mon, 19 Nov 2018 21:59:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201811192159.wAJLx713004119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 19 Nov 2018 21:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340651 - in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Commit-Revision: 340651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6BC9F8E264 X-Spamd-Result: default: False [0.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.05)[0.055,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.224,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 21:59:09 -0000 Author: np Date: Mon Nov 19 21:59:07 2018 New Revision: 340651 URL: https://svnweb.freebsd.org/changeset/base/340651 Log: cxgbe(4): Update T4/5/6 firmwares to 1.22.0.3. Obtained from: Chelsio Communications MFC after: 2 months Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t4fw-1.22.0.3.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.22.0.3.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw-1.22.0.3.bin.uu (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu head/sys/dev/cxgbe/firmware/t5fw-1.19.1.0.bin.uu head/sys/dev/cxgbe/firmware/t6fw-1.19.1.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/modules/cxgbe/t4_firmware/Makefile head/sys/modules/cxgbe/t5_firmware/Makefile head/sys/modules/cxgbe/t6_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 19 20:48:47 2018 (r340650) +++ head/sys/conf/files Mon Nov 19 21:59:07 2018 (r340651) @@ -1451,7 +1451,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.22.0.3.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1485,7 +1485,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.19.1.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.22.0.3.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1519,7 +1519,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.19.1.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.22.0.3.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t6fw.fw" Added: head/sys/dev/cxgbe/firmware/t4fw-1.22.0.3.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t4fw-1.22.0.3.bin.uu Mon Nov 19 21:59:07 2018 (r340651) @@ -0,0 +1,9881 @@ +/*- + * Copyright (c) 2018 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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. + */ +begin-base64 644 t4fw +AAAESQEWAAMAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAABCwEOwRDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFR1ZSBOb3YgIDYgMDU6 +NDI6NTUgUFNUIDIwMTggb24gdm5jNC5hc2ljZGVzaWduZXJzLmNvbTovaG9tZS9maXJtd2FyZS9j +dnMvZnctcmVsZWFzZS9iYWNrdXBzLzE4MTAyNi1UNC0xLjIyLjAuMC1pYm1zdG9yZXdpAEok3blg +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//yQ4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//jhAAAAAA +H/+OFAAAAAAf/44YAAAAAB//jhwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn +NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m +lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+FsOMACfgf/4WwH/+FsOMAD6gf +/4WwH/+FsOMAD6gf/4WwH/+HQOMAD6gf/4dAH/+OCOMAETgf/44QH/+yYOMAGAgf/7JgH/+yYOMA +PFgf/8AAH//90+MAPFggAAAAIAABauMAeiwgAAF4IAABfOMAe5ggAAF8IAABheMAe5wgAAGYIAAB +nOMAe6ggAAGcIAABpeMAe6wgAAG4IAABvOMAe7ggAAG8IAABxeMAe7wgAAHYIAAB2OMAe8ggAAHc +IAAB4uMAe8ggAAH4IAAB+OMAe9AgAAH8IAAB/OMAe9AgAAIYIAACGOMAe9AgAAIcIAACHOMAe9Ag +AAI4IAACOOMAe9AgAAI8IAACPOMAe9AgAAJYIAACWOMAe9AgAAJcIAACYuMAe9AgAAJ4IAACeOMA +e9ggAAJ8IAACguMAe9ggAAKYIAISTeMAe+AgAwAAIAMXgOMCi5ggAxeAIAMXgOMCoxggAxeAIAcf +hOMCoxggBx+QIAcjAOMGqyggCAAAIAgS8OMGrpggCBLwIAkvZuMGwYggCS9wIAkwPOMH3gggCwAA +IAsAAOMH3tQgCwAAIAsAAOMH3tQgCwAAIAt4KOMH3tQAAAAAAAAAAAAAAAAgABQWIAAUCCAAF/Ig +ABQIIAAXbSAAFAggABS6IAAXBSAAFoogABQIIAAWOSAAFfIgABWFIAAT9SAAFS8gABQIIAAUCCAA +FAggABTaAAAAAP///////w/8///w////APz///////8P/P//8P///wD8IADKHiAAy6QgAMvUIADL +miAAy0UgAMs7IADLCiAAywAgAMr2IADKoiAAy9IgAMqYIADKbCAAy9QgAMpiIADKUAEQGAEABAAA +AAAAIAAAAEAAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYpKSwsLy8yMjU1ODg7OwAAAAAAAAAg +BSQkIAHGVCAAPOAgAZHYIAHBOCABu2AgAXe4IARIeB//6TQgALKoIADMsB//3CAgAHWAIABnYAAA +AAAAAAAAIAGTkCAAnWggAJVQAAAAAB//1KQf/8YoH//CWB//wDAgAFq4IABOFCAAS0AgAL5AH//i +6CAG9UAAAAAAAAAAACAAUcggAF30AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIADGsCABquggANcw +IADWLB//8BAf/89MH//MeCAAksggBaqgIAFC+CABK4AgARAYIAEHcCAA/JQgAO8MIADaKCAFKBgg +AyjYIAE4dCADVwAgAfgkIAB1QAAAAAAgANeYIAYgdCAAyZAgAZ2EIAACmCAAuAAAAAAAAAAAAB// +8zggANdMIAMriAAAAAAAAAAAIAOviCAAKjQgA63QIAAotAAAAAAgADToIAAzHCAAMWQAAAAAIAA8 +hCABPDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgBBTYIAUjxAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAA5/CADuFggADeYAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAACAAPOAgAK9wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsA +AAAgAxTUCAAAACADFOAIAAAAIAMU7AoAAAAgAxT4DAAAACADFQQSAAAAIAMVFA0AAAAgAxUoDgAA +ACADFTgTAAAAIAMVSAoAAAAgAxVcDgAAACADFWgYAAAAIAMVeA0AAAAgAxWUDgAAACADFaQQAAAA +IAMVtBIAAAAgAxXIDgAAACADFdwQAAAAIAMV7BEAAAAgAxYACgAAACADFhQLAAAAIAMWIA0AAAAg +AxYsFAAAACADFjwKAAAAIAMWVA8AAAAgAxZgBgAAACADFnAGAAAAIAMWeAYAAAAgAxaABgAAACAD +FogGAAAAIAMWkAkAAAAgAxaYBgAAACADFqQEAAAAIAMWrAYAAAAgAxa0CwAAACADFrwLAAAAIAMW +yAQAAAAgAxasBAAAACADFtQJAAAAIAMW3AkAAAAgAxboAAAAAAAAAAANAAAAIAMW9AoAAAAgAxcE +BgAAACADFxACAAAAIAMXGAMAAAAgAxCsAQAAACADFxwAAAAAAAAAANdqpHjox7dWJCBw28G9zu71 +fA+vR4fGKqgwRhP9RpUBaYCY2ItE96///1uxiVzXvmuQESL9mHGTpnlDjkm0CCH2HiViwECzQCZe +WlHptseq1i8QXQJEFFPYoeaB59P7yCHhzebDNwfW9NUNh0VaFO2p4+kF/O+j+GdvAtmNKkyK//o5 +Qodx9oFtnWEi/eU4DKS+6kRL3s+p9rtLYL6/vHAom37G6qEn+tTvMIUEiB0F2dTQOebbmeUfonz4 +xKxWZfQpIkRDKv+Xq5Qjp/yToDllW1nDjwzMkv/v9H2FhF3Rb6h+T/4s5uCjAUMUTggRofdTfoK9 +OvI1KtfSu+uG05EHDBEWBwwRFgcMERYHDBEWBQkOFAUJDhQFCQ4UBQkOFAQLEBcECxAXBAsQFwQL +EBcGCg8VBgoPFQYKDxUGCg8VH//AAAAEACAgByMAIAcocB/83gAf/6gEIAcjMB//qSQf/6ygA4AA +AIEAAAAA//gAH/+naAEAAAAAEAAAgQQBAIEEAAABBAAAAQQBAIAAAAAABf//H/+mrAYAAAAEAQAI +H/+AwAIAAACAEAAAQUAAAEFAAQCDAAAB//+//7////8f/5RYBAAACCADDqiBgAAADAAAAB//jqD/ +/wAA//8A/wABAAAAAP//H/+vkB//pFwP///////QdB//Yhwf/ODoIAcgvP//vwwf/2KcH/+p6B// +mmQf/OIAAAAIyOD//gDhAZIAH/+UxAD///8f/5kMH/+qAARBAAilAAAAwAAAAMAEAAAwAAAAH/+q +kAAAHdAAAP+AIAcfkCALRZDhAC4AH/+qhB//pjwf/6swH/+moB//qoDgAACg4QAwuOAAAAAAAIAA +4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQCB/84UDhAHtwH/+x8B//segf/OAIH/+x7B//shgf +/7IQH/+yFB//skAf/7I4H/+yPB//qAQf/6+QIAcjMB/83gAf/6kkH/+ooB//qcAf/5kcH/+vDB// +pcggCwBgH/+rXAAA/4AAAB6wH/+OoB//q2gf/6tkH/+ryB//rJAqAAAAIAsEYCALBJAEAAAIBQAA +AIP/AACBAAAAABAAACALBNAgCwQwIAAJ+CADDbgf/4TwH/+AwB//rKBnRSMB782riZi63P4QMlR2 +H/+AAAAAPyggAxCsz////yALBfAQAAAAP////wIAAABAAAAAGgAAAB/84HQgoAAAH/+nvCAAHeAg +AB98gAAAAAAAgAD//v//AAAQAABAAAAgAc1YIAAjCCAAAAAgACNwIAsIwP//f///+///D/aAACAL +CPAgCwkgAAEAAAAEAAAf/6gsIAtRsCALCbAgADToIAA2OCAAMxwgCwtQIAsKECALCqAgADFkIAsK +8FMAAAAA////UgAAAFEAAAAgAgF4H/+p2CAAOWAgBBDAH/+p0CALC3Af/5kUH/+pqCALDZAUAAAA +gAAAAnxQAACAAAAQgAAABoAAsAAAAAoAAP80kv//8A+AALEA4QGaAAACAAAgCw0gH/+WjAAAfkAg +Cw1gH/+p4AD/wAABAAAAKAAAAOAAAAAmAAAAAAD//x//j3AGAAAABYAAAB//pYgrAAAAIABVMCAL +VJAf/6dUA4AAAAf///8EAQAINQAAAAMAAAAAP///gEAAAAgP//8f////QUAAAEFAAQAABf//AQQB +AAEEAAAAAMAAH/+pxD0AAAAf/5UABwAAAIEEAQCBBAAAH/+pkAAAOpjDAAAAAAAP/wBDAAAf/6cc +AAAIAAQAAAAf/5hMIAtU8B//sWQf/6+wH/+UWAAGAADhAHoAH/+UwB//maAf/6oAH/+ZJB//mRAg +C1UgAAMHgCALVZAIAAAAH/+W8AAgAAAAAAkAAAAwAv/8+H/AAAAAo/+7AKP/ugANAAAA4AMAAIP/ +tgAP////D//4AP8AAAAgC1XQIAsO0CALDwAgC1ZgAA8AAAAKAAD//wAPH/+pzAP/wACD/8AAIAtW +4CALV1Af/6pIH/+wIP9g8AAEgAAIH/+OIB//gFAARAAAAYDCAAAAgQAf/45gH/+AYP8f//8AwAAA +8AAAAIGAAAD/f///H/+kXP+//////wAAAIAAAAAAht0f/5pcH/ziAB//j2DuAAAAAAAJzB/84gwP +AAAAIAsPQB//qkwAAAjMH/+rVB//mmQgCxEwIAMIIOD//gAgC0sgH/+a4B//lhwf/4BwIAchMAAA +MAAAACcQH//bkCALZKAgC2RwH/+qtB//lPQAAP/+H/+ZBN6tvu80AAAAPwAAAAAAiQYAmQAAH/+v +KBAABwIBwIAAH/+vBJkAAAAf/6/kAIgACIKAAAEf/694///wAAMVAAADEQAAAA8D/x//qaQgAQPM +IAEHuCkAAAAAAIkUIAEMjCADC3QAAEAAIAMOoAwAAAAgAReIH/+wQAAAIaAgAwuEH/+qIB//rkj/ +AP8A8PDw8KqqqqrMzMzMAAP//wAAJ/8gAwvIIAtk8CABJ+AAD0JAIANeIB//qngACQAAAABIAIIA +AAAgATxAH/+qLDsAAAgOAAAA0AAAAB//gLAAACKKAAAIUAAAH0Af/6noIAsjcCALI5AgCyOw/9// +/wAJAAgf/690MAAAAH8AAAAf/6gUIAsm0AAAD/4gCyYAIAsmYCALJqAAAOAA///3/yALJ2AgA2VY +AACD/yAHJxgVoAAAIAcoEB//rzgAAAgGAACIzB//lqAABAP/CgAAACAHI6ggByVIIAcj8IP/twCD +/7YgIAsnkOEAAAAzAAAAH/+vQB//sDQD/+AAf///AAA/9pAAACKYA//wACALSHAgC0gwIAtIkB// +sUAf/688AA///x//qeQgC2dQH/+ZRCAAeaggByC4IAAFiB//pKAf/5SMH/+pFCALKBDABAAAH/+n +1B//p8gf/6fgH/+t8B//rWQgA+moIAsoUCADD3Af/6XgIAB6iOABAAAf/5pgIAtoECALKJAf/5pY +IADDGCAAwBgf/5CoIAtnkCALZ+Af/5bAIAsqoB//jzQf/5DsH/+p1CALP1AgCz+ASAAAACAB0zAf +/6doIAHVNB//lUgf/6Y8H/+lJB//pOwAABhQAAAWTB//ltwf/6g4IAcjJB//pXwf/5TE4QAuAB// +qEThAF4A4QIOAP//v//hAA4A4QGOAP//vv8f/6YQIAHaWCAB5pTgBQAAA/8AAB//pUQgAw6oH/y/ +/zwAAAAf/4C4gwAAAB//pSwPPAAAIAtH8IKAAAAgAghsIAILIB//qsQgAg7YAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAACBgAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAgYAAAAAAAAD/////////////////////H//7aB//+2gf//swH//7 +MB//+zAf//swH//0sB//9+Af//Y4H//2OB//9jggBvcwAAAAAAAAAAAAAAAAAAAAACAG+nggBvp4 +AAAAAAAAAAAAAAAAAAAAACAG9zAgBvcwH//43B//+Nwf//jcH//43B//+Nwf//jcAAAAACAB23AA +AAAAAAAAAAAAAAAAAAAAAgEAAAAAAAAAAAAAAAAAAAEDEREICBAJAwEAAAAAAAAEAAAAAAAAAIGA +AAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAAAAAAABgFAAAAgAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +ACAKABHxaxPxa9MPA+YxAQIAFvFpF/Fqd2sGkGC0Zndj+FQO61XXqg8UAGP/+QAAAGwQCCggBZQV +JCAH9mCkFaAZRQD5AA2NYUQBAIgiGvFdF/Fc7fFdHAsOAAAMSRGnmSuSnsDp/2AM+6AMpQApkp0K +SworssMLmQHpFgQkjJmAAInY9yAM+JIAnQAvcq5k8UEf8U4qcq0v8n/vqwEEw/0AAP9ACX5iAJ0A +mNj/QAmGYgCdAIoVKSAUqpkJCUcpJBT1IAu10gCdABvxQS8iFy0hK4kUGPFAr92YkPpD6BWgDiUA +7pYCLu/CgAD9IGYV4AxlAO3xOR1WAoAADKoCjBSakesAFQTIQQAA+IJoHeBKBQCdxurGByZIgQAA +6+MFDNAEgAAKAmEKAmEKAmEKAmHApOpqNgHAQQAAbakFCACGCQJhKCErH/El+EVEFeAMFQD5ACAV +oA0FAPogiBXviAEACYgu+kPoFa+IAQD4RWQdoAYFAPYgBhWgHuUA5hYCLEVCgADoFgEl2YEAAFiK +uP6AABc3xQEA98AAR3ANlQDt5p0oBAqAAPmABMFSAJ0AwCDRDwAAAAAA6iQACdgEgADsEgUq6ASA +AFiMg9Kg0Q8AAAAAwLAMnzTv1ggt9sYAAPpAaB2gG8UA/AACHaANFQBYkvJj/8EAAOokAArYBIAA +WI4w0qDRDwD/+bQNoAkFAOokAAJYYQAA/AACHaANlQBYkuZj/5HAoFnR/B3w54nY+T/yuJAMpQBj +/6TaIFgLVGP+hYonjRXAwOqsIC7YBIAAWIYR0qDRD2wQCC8iEJQUhiknIRr+QPAVoBuFAPQgZhXg +HMUA73gRDigEgAD9AfINoe4BAAYJQsiUBwhCZIJHKSAFjSL+vgAN8BpFAPsgE70iAJ0A7/DHHo6W +AAAU8MYW8MTn5AAPTwKAAPXADpoQC6UAppkokp6eEA/qCvcAGHtSAJ0AKqLDKZKdCpkB6RYBJJIx +gACKSPdAEqCSAJ0ALmKu7fC7Fw+pgAAuYq0v0u4P6AHoFgIlS/0AAP/ADwZiAJ0AmUj/wA82YgCd +AIspiioMBD4Lqgz1QAnjogCdACohKC0hJo8U+6AQxCIAnQAuIBSv7g4ORy4kFPXAEM3SAJ0Asago +JSgqMAHzQBEOkA0VAC4hCSsgBy8hJPhgJBWgCVUA+UAEBPCrEQDgmRENUoKAAAqZAhrwlwmIAikh +Bxvwlgr/AvsGAAw6mQEA6iEiLMsCgAAJ7gKJEQuqAhvwj5iQiCCek5+UmpL9AAAUMAplAAqIApiR +LyIQn5UuIDjo8Ige0ASAAP0hJhXgTxUA9SEGFeDuGQAO+jn/bQAMMA4FAJ6XCogCmJYrIhnq8HQV ++AUAAC8mGZ6bm5rr8HMU+QEAAOoAFQTQwQAACgCKnJ8uPBD7IcYV4AplAA4ghg8CYw4Ahg8CYQx8 +EabM6sadIgCpgACOKS0gOKTuninzoAwfkgCdAI8TDw9H+eALCVIAnQDAINEPAOokAApYBIAAWI78 +/0uQDeAcxQDsEgQpUASAAO0SAynYBIAAWIvT0qDRD4pI90AKgJIAnQAMeRGmmSiSnvcAC0NSAJ0A +LZKdD3gKKILDCN0BnRKNEunUAAaK0YAAsK+fSOkWASzw1gAA/iAGFaABUgDz/+2gUgCdAAl1DPS9 +ABXv9qYAAMCQmRKNEguuNA8CAO5GCC7xFgAA+kBoHaAbxQD8ACIdoA0VAFiSKmP/ZAAA6xIDKVAE +gABYjWjSoNEPAIsQ+kBoHaAMFQD7YwAV4A1lAFiSIGP/OsCgWdE2ikjBzPlf7RiQC6UAY/+rjCLA +1A3MAvxARhWv/HIAAAAAAADrEgIpUASAAFgKhyohKP/3ZA2gHMUAAAAa8BgrIhmJJyqhIImeC6oB +ClgUCYgK/wCIFeSqAQDuIT0tAQqAAADZGgn/Au+GBCdwBQAALiU9+mAwFa/2ogAAiieNFMDA6qwg +LtgEgABYhTLSoNEP2iBYi0Zj/ngAAAD/8+gNoAkFAP4gBhWgCgUAWdEKikiOEP/f5gXgHMUA+V/0 +yJALpQD/+vQNoAkFAADA0PwgRhXv+pIAC680/oEGFe/6ngAAAABsEA6VGygiEI4pJyE3KSAHkx2K +Mv5giBXgDRUA/GBoHae1AQDjIRol2/kAAAvbOfohhhXhmQEA5/82CbfCgAD+wlIN46oBAA4OQvHA +cA3i0wEAZNQaJiAFwej5/gAPMBdFAPbAIdViAJ0AhyKLHfThbA3gDoUAK7ABnxHzYB7fEgCdAJkQ +mRmaExjvw+3vxBIoDQAA5RYKLK8CgADoVQgM34KAAK276xYIInAFAACJGZ4XjRr1IAaqEgCdACtS +noYY/WAKG+IAnQAvUp0mYsMG/wFk8/AZ77KJmPcgCZiSAJ0AKoKuZKFQGu+vI4KtKqJ/He+rCjsB +6xYEJNv9AAD6YAnWIgCdAJvY+mAdHiIAnQCHKYYqDAM+B2YM8sAJm+IAnQApGgDzIjIN4Pr1ACsg +FpwS+2AJ3SIAnQCLEYbDKiA49+DmFaAGBQD34SYVoEcFAPvhBhXgqhkACnY5F++clhUtIhgW75md ++i0iHJ37icQKdjmWFvlgD8LiAJ0AixyeHuwWAiWNUYAAYAEbGe+EiZhqkS6LGipSno8Ye6NLLVKd +L/LDD90BnRSGFOvvfRTT/QAA72QAAwHpgACauGX/E2ADAZ4e/CBGFaAKBQBZ0IkZ73OJmBjvcIwS +7hIOJI7bAAD//1wNoA8FAMCg+iCGFa/+5gAd72rAugubNPuhBhXv/vYAAAAA//sYDaAPBQAAnh6f +H/wgRhWgCgUAWdB1Ge9gjBKPH4mYjh4Y71v5P/WAkgCdAGACdsCgmhSLFBbvWMDaDZ007WYILfY2 +AABgAl2eHp8fnBLqJAAJ2ASAAFiN9owSjx/uEg4ldcGAAGACFSogB54enx/6IAAFMAwFAFiNzmSj +biogBysgFvxgaB2hqgEAWI2fjBKPH/4hyBWv+m4AAAAAAACLEogTjBGGFY4WrN0IZgL3xgAPP4gF +ACgkOwyWDJa0LSYc7SIQKVAEgABYjHSOHowSGO8vKladiikpIDijquomCST5loAAJiE3j8QrIRop +IhDm/zYN78KAAH/bCgoKQsikCw1CZNBT/iAmFeAdhQD5/gAO8AoVAPohhhWgBjUA9iFmFa/2CgCK +J58fix3qrCAqYASAAFiI+I8fmhItIhz5QIgV7/12ANogWIpdGO8QjBKOHvpBKBWv/j4AcZ6oCr8M +//0AFe/+igCLE4oVLSIQGe8WC6oCG+8WCmgChhwa7w0JiALp7wwbCn4AACMWECUWESYgB4XAIyEH +9kEkFeBmEQDrVQELMoKAAPamAAq6MwEA5iEiKZsCgAADdwIKVQIjISQJZgKV8IUgl/OW8v3gphXj +mAEA6PYGLMoCgAAJOQLjEhAiU/kAAOn2BCquAoAA5eUCBkCBAADl9gEnyMEAAOUSESIUNQAAbakF +CACGCQJhJiAUpGYGBkcmJBT0wAd10gCdAIkXKVadKCIYsYjoJhghgKmAAIspKiA4o7ubKfNAB5+S +AJ0AjBxlwM/AINEPLSEoZNwiDngC+EBGFaAAhgAAAAAAAPMf3whSAJ0ADj8M//0AFe/vWgAAAAAA +AOsSDSlQBIAA7RILKmAEgABYikXSoNEPAOsSCylQBIAAWIv80qDRDwD6QGgdoBvFAPwAIh2gDRUA +WJC0Y//BixD6QGgdoAwVAO0SCiXYYQAAWJCuY/+pAAAmIDtkYGHqJAAOWASAAPwgKBWviQUA6SQ7 +LHAEgABYi+n6IOYVoAsFACsmHPpHZh3v/C4AAAAAAOsSBClQBIAAWAkRY/8HiifrRAAKaASAAPtE +ABWgDAUAWIPN0qDRDwDaIFiJ4WP/CCMWEIfAIyAHJiEi+uAEA/AzEQDjIQcp2oKAAAt3Agp3Aosn +KiEJ+MYAC3ozAQDpsRUpmwKAAAOqAiMhJJfwhyCa85j27fYFJdiBAAD34EYVr80FAP1gBAXzaAEA +650ICzICgAAGMwLj9gQrvgKAAAfnAuf2ASZggQAA4xIQJukBAADty0J+QASAACxM/gzGEaaG5tM6 +d8jBAAD0n/GpEgCdAG3JBQgAhgkCYWP+JIsQ+kBoHaAMFQD7YkAV4A0FAFiQYmP+eQAA+Y8ADH/+ ++gAI3AwMTRRt2QUIIIYJAmPvyQgFwQEAAO1MDATIwQAA9Z/vARIAnQAqzP5tqQUIQIYJAmVj/cwA +AGwQBiggBSYgB/xASBWgGUUA+QATXW/7NQD0IEYVoAeFAP1gEligCVUAhCce7kcsITz0gcgVoAsV +AP5gyBXhZgEA/iAmFeXcHQDk3QoLVwKAAP2giBXkzAEA7qoIDgEKgADuIT0toAqAAATdAQ29OeSi +ni7ABIAA/W0ADHAMNQD5LQAOMAsFAAh7Oay7+oAQA+IAnQAc7i4qop0MbAoswsMMqgHqFgMlDcmA +AIknJCE8iZ4EWBQJiAr3AIgV5MQBAPuABADQCRUAAJka9yAEB/AMFQAPzzn/zwAPf/z1AAyZAx/u +Ki4lPQl3AZeEL/F+mxDn7hsSIAUAAAT/AS8lPOTuFhaDCYAA+kAIFeAMFQBYI/6LEI4RLyEJLSAH +KCEiKSEk/dw2BaDdEQDniAIO6oKAAA2ZAgyZApmgjCCepf9AZhXgDSUA6KYCLmYCgAANzALspgEl +aGEAAOQAFQVQgQAADQCKKCAHGe4LCChACogQCYgCmKCOIPdARhXgH4UAn6P9wAAXMA81AO/uAgVg +QQAA7qYBIcghAAAJQIgMCIoJIIgMBIoJAIjsgx4FSKEAAAQAiQkAihrt5AxpEaqZK5adBQtH+WAG +gVAKBQAsISiLIrDM/ETEFe/MAQDsJSgl8BiAAMjEfbdpfctmiifHwwy7AesmAiVQwQAAWI8m4+3m +FQERgAAooAADiAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ8qVKpkUyqqKmcmsKKAAA4gKiIzs +oActWASAAPpAaB2gDTUAC4AAZa/hwCDRD9Kg0Q8AAP//SA2gCgUAiSL6IAYV7/o1AHqQOmS/UAUL +R2iySsAg0Q8AAAAAAADqJAAK2ASAAFiK8NKg0Q8A//g8DaAKBQCKJ+qsMCnYBIAAWI7bY/8j6iQA +A1hhAAD8IAgV4AwVAFiPoosQY/+sAIon2zDsEgIlUMEAAFiHZMAg0Q9sEAgsIg8vIAcoITaHN/5D +RBWn1QEA+b/AFeALFQDpuTkJsASAAOsiCSpQBIAA+CCGFeAEFQDodzYPT8KAAPciUg3h/wEACwlC +8SBwDeKOAQBkgm/BtOx7Hw6UdAAALCEp6SEnJmAFAAAMDE8sJSn9IBULogCdACwgBfuAE2ViAJ0A +jSL6IAYVr/s1AP1gDkDiAJ0AKCIajjL5wBT9IgCdACkyCBjteBztdOSSKW/fgoAAmhCYEay76O1v +FUgNAACZE+sWAi+nAoAAqET14A0CEgCdAIsTKkKe+0AbO+IAnQCKEilCnSqiwwqZAe6UAASSoYAA +jCmLKgwFPgy7DPVgCdviAJ0ALRoA9aHyDeD49QArIBb5YBmlIgCdACwhIhntaighByohJCshCfxA +8BXqiAEA6aoCDEMCgAAIuwIZ7WMY7VUNLUDpzAIO6oKAAAjdAp3giSCc4prk+8BmFeAKVQDr7Vsc +zgKAAAqZApnhiC+Y5SwgOPfBBhXgDQUA/cDmFeAKJQD92qYF4EklAPjAiBWgzBkADJo5mOkM2zmN +ZZ3qHe1N/MDIFaAJBQDs5gsjh+GAAAqcEA3MApzsjBGJaJfvme6IaSjmEI1qLeYR7AAVB0khAAAJ +AIqIZ/jgC+OiAJ0AH+0zCr0CD90CnebAxfyTphWhCQUA9SHyDeD49QArIBb5YBPFIgCdACwiGoop +KyEpKSA45aoIBmAFAADsJhol2/0AACslKZop8yAPx5IAnQCLFGWx9sAg0Q+fFZ8WnhfqJAAK2ASA +AFiLs44X7xIFJXWRgACMFGXP24on2zDsEgAlUMEAAFiGyMAg0Q8a7QOKqPdAEMCSAJ0AjBMrQp79 +YBF7ogCdAIsSKUKdK7LDHez6C5kB5JIbZWP9AACc2O6UAAzydgAAYACWKCA58R/4DhIAnQD/++QN +oAkVAAAAAADzn+xgUgCdAAnnDPb9gBXv9gYAiTdkndXwANgNoAoVAAAAAAAAAMGze8kULCA6mhD+ +IMYV4A31AP2AEL1iAJ0A6iQACtgEgABYihrSoNEPAMGtjDcrIQmNOI4y668RDd0CgAAPuwLkuwIJ +UASAAFiKAMAg0Q8AAAD//1gNoBqFAOokAAfYYQAA/CBoFeAMFQBYjsZj/v0AAAq4ApjmwNX8k6YV +4QwFAHXLDSsgFikK//lgDjViAJ0AihRkoV2LaoxnimmrewfMDJxn92DSDeAOBQCxqoxlm2qLZppp +rOqre3e7AbGqjimbZpplLSA4pe6eKfOgCjeSAJ0AiScomRTKgYuZyb0Z7L4osACfFZ8WCYgKiIws +sAf6QGgdoA01AAuAAI8ViyLHo/tf8kjiAJ0AKCE2h2cuIRqKL4sp6Hc2D2fCgAB3ywoLCULIlA4L +QmSwtcHU+v4ADrAMFQD8IIYVr/KiANogWIfeY/4DiifqrDArWASAAFiNwNKg0Q8AAAD/8pANoAkF +AJ8VKiAHnxaeF/ogAAUwDAUAWIsOjhfvEgUtZbYAAOokAAfYSQAA/AAiHaANBQBYjn1j/dcqIAf8 +oGgdoaoBAFiK2WP9ep8V/iDGFeAKBQBZzY0a7HeKqI8V+V/uoJIAnQD/98QNoAkFAMCQHOxxwLoL +qzT7gQYV7/d+AAAAAAAA81/6MFIAnQAJ5wz2/YAV7/zuAIonnxXvFgYp2ASAAOwSACVQwQAAWIYm +1qD+IKgV7/oWAJ8V7xYGKVAEgABYh6b+IKgV7/q2AAAAwVP6QGgdoAsFAPwAAh2gDTUAWIAvKyAF +jxaKEPV/2l1iAJ0AY/0ZKiAHnxWfFvygaB2hqgEAWIqo/iCoFe/4ogBsEA6ILycgBS4hNikgB5Uc +8iFmFeAGFQDygGgd50UBAO0SCyJ7+QAAD285nx0vIRqM1JwT7dABLqgEgAD/gQAOMZkBAO4iCS+3 +woAA/MJSDaCtMQAODkLxwHAN4m8BAGRkacH0CM+N/uAlzWIAnQCOIg8CAPXGzA3gD4UALBYB86Ah +lxIAnQCZEJkZmhLm7CQRwA0AAJga6OwhHP+CgACm/+8WCCznAoAAqMzsFg4h6AUAAIYZnReKHvTA +BiISAJ0Aixoqop6GGC8SDvtACWviAJ0AJmLDL/KdBv8BZPRqGewRiZj3IAjgkgCdACqCruTsDhUJ +sYAALoKtJEJ/F+wJBOsB6xYEJLP9AAD1wAj2IgCdAJZ49cAg3iIAnQCKKYkqDAQ+CpkM9SAIu6IA +nQArGgD1YfINoPz1ACsgFv1gCQUiAJ0AjhEqIDj8CAIdoAcFAPfg5hXhCQUA9qCIFaCqGQDqlzkL +2ASAAArLOZsVlxb3wBISogCdAIsdZLHZYAEBGevoiZhqkTKKHosajBgqop4swsN7o0aLHiuynQy7 +AZsUjhTq6+AUs/0AAO/kAAcByYAAlqhl/yVgA438IeYV4AoFAFnM7Bnr14mYGOvU7RIPJI7bAAD/ +/2wNoA8FAMCg+iCGFa/+9gAc687AugubNPuBBhXv/wYAAAAA//twDaAPBQCdH/4iBhXgCgUAWcza +GevELxIQiZiNHxjrwPk/9lCSAJ0AYAMKwKCaFIsUHuu9wMoMnDTs5ggt9xYAAGAC8Z0fLxYQ6iQA +ClgEgABYilwvEhDtEg8ldrGAAGACfgAqIAedHy8WEPogAAUwDAUAWIozLxIQ7RIPLXZWAABgBAwA +nR/8ICgVr4kFAOkkOyK4QQAA5wMeB7CBAAAGAmGOV5z4hlSJVq7ODGYMllR86wftFg8kyAUAAJ5X +hhaOFZlWBu4CFuusjBHtIg8pUASAAObuAgrYBIAAWIjTjR8Y64+JHvszphWhBwUAdHsNKyAWKgr/ ++2AELSIAnQCKKSsgOKSq6iYJKAQKgADzYAQ/kgCdAC8hNoxULiEaiS/vzDYPX8KAAHy7CgoKQsik +DgZCZGB0/CAmFaAfRQD5ngAP8AsVAPohphXgCjUA+iGGFa/1jgAAAAAAnR+KJy8WEIsb6qwgKeAE +gABYhU7vEhAtKASAAPwh6BXv/C4AAAAqIAf8gGgdoaoBAFiJwxjrZPwh6BXv/aoA2iBYhqwY62CN +H/pBKBWv/b4AcZ6HCuwM/Z2AFa/+BgAc62MY62eLEo4V+gAiHaAJBQALqTgH7gIa61z31tIF4AYF +AAmGOQbuAoYdG+te6fwgIsBBAADn7gILC54AACYgB4VQBiZA61UBCzKCgAAGVQIKVQIqIQcrISIn +IQn2QegVqqoBAOy7Ag1TAoAACncCKiEklfCFIJfzm/L34KYVo74BAO72Bi3aAoAAC6oC6vYEKq4C +gADl1QIB0/0AAOX2ASGMNQAAbakFCACGCQJhiB4nEgf3E6YV4QYFAPTB8g2g+fUAKyAW+WAKpWIA +nQAqIBSjqgoKRyokFPVACH3SAJ0AyE+MKSsgOKTMnCnzYAknkgCdAI0dZdEAwCDRDyYhKGRryw/o +AvhARhWgAIoAAAAAAAAA8x/ckFIAnQAO/Az9nYAVr+4eAIQcBARHaEIVhhOIVMCRBpY5CGYo9qCG +FaACBQDRD4onixvqrCAp4ASAAFiE5osTjKTA0QvbOQy7KPtAhhXgAgUA0Q8AAOsSDClQBIAAWIg8 +0qDRDwD6QGgdoBvFAPwAIh2gDRUAWIz0Y/+UixD6QGgdoAwVAO0SCiXYYQAAWIzuY/98AAAmIDsP +AgAPAgBkYHj8ICgVr4oFACokOwgghgkCY+z2CCrYBIAA7SIPKVAEgABYiCX6IOYVoAsFAPpHZh3v ++xoA6xIEKVAEgABYBU9j/uaKJ+s0AAnoBIAA+0QAFaAMBQBYgAvSoNEPANogWIYfY/7XAAAqIAf8 +gGgdoaoBAFiJLWP+ngAAIxYSJyEHg1AlIAf2QSQVqncBAOszAQu7AoAA+kDoFeBVEQDnZgIKqoKA +AAUzAgozAiohIocvJbEVDKoCLCEkk/CDIJryl/WW8+72BimeAoAA86YACfPeAQDj9gEu6gKAAO3M +AgXYgQAA/eCGFa/MBQAMuwGrXeMSEibpAQAA7YtBfGAEgACwOAyGEabGdtM69H/vSJIAnQBtiQUM +QIYJAmVj/dgAAIsQ+kBoHaAMFQD7YkAV4A0FAFiMnWP+NwAAAAAA9Q8ADn/+/gAM3QwNSBRtiQUM +YIYJAmfv3ggFyQEAAOg8DAdAgQAA9Z/seJIAnQCwz235BQmAhggCaWP9fAAAAGwQBiggBSMgByQK +A/0PQERRMwEAKCAiZIBvAioCWH3Q/UzAgNANFQAsICEY6oEPAgDsMxEGfVaAAKgzKTKeDwIAbpNF +KzKdZLA/+kAIFaD+5QAOzgH9xgAO8A8FAPxEJh3gCQUA+CAGFeAMBQD4ICYV4A6VAPggRhXgDQUA +WIQY9HOmFaACBQDRD8Ag0Q8AAGwQCiogBfhA8BXgDBUA+GBoHae1AQDoFgAl2/kAAOvLOQoYBIAA +6xYFLCAEgAD9QcAEUZkBAMHD/UAfZSIAnQCNIu/qWB6bdgAA6+pVEbARAADmFgQs94KAAK/u7hYD +LNcCgACrquoWByzABIAAhxf1AAQiEgCdAIoUJ3KehhOPF/rgB1uiAJ0AJmLDL/KdBv8B7xYGJ5lR +gAAlIRuKQocphioFpTb1TwAOcQsFAHyzAdWgmBoHZgz0wAXj4gCdACoaAPVCMg3g/PUAKyAWmBr9 +YAX1IgCdAIpC+qAOUqIAnQAb6kmHQwt3AYsV6BYKJYkJgABgALgAGuosiqjoFgolDN+AAIsXjBSG +Eyuyno8XJmLDfLNDL/KdHOojBv8B5PA5ZVv9AACbyO8WBi/7bgAAYAKLAAAAAPghZhXgCgUAWcsu +GuoZiqiJG+gSCiUO3wAA//9MDaAPBQDA8BzqE8C6C6s0+4EGFe//BgAAAAAA//x4DaAPBQCZG+ok +AArYBIAAWIiwiRvoEgoleamAAGACISogB5kb+iAABTAMBQBYiImJG+gSCi15hgAAYAMAAPDgBEBS +AJ0ALSEajCmXGPghRhWi7QEA6RYLLwPOAACXGPghRhWi7AEA6RYLJwM5gACYGukWCy7/woAAdftV +DtUM+dQMBaC36QDmQgMt3IKAAAt5ApkYCGYB9oBmFaAA3gCKJ5kbixDqrCAp4ASAAFiDwokb+CFI +FaALJQDrpAItIASAAOqiAiOGAoAAjCmXGJgamRuOGI8W5a0MClgEgADlzAgJUASAAO1GAiroBIAA +7CYJKeAEgABYg96IGokbjxf786YVoQ4FAHXrCCsgFiYK/3a5CsCh+iCmFa/3jgAAKiAH/KBoHaGq +AQBYiCCJG/ghSBWv/4YAjykY6dmJFqX/nymMQ4tAjRXnxAAEyIEAAPwOAAU36wEA7hYBLohOAAAn +IAcHB0EIdwoncqHurRANU8KAAO2qAgJAQQAA6ncBAdP9AADnxwIBjD0AAG2pBQgAhgkCYYtAwICY +EhnpxRrpwy8hGoYWHunAJCEHGOm9/CAoFaHXMQD/oABGukQBAO3QgConAoAA7MwPJnBBAAD4hgAK +NMwdAORmACZgBQAADDwMFOmZDV0MiCCfZpdnnmOdZQykOQmJAulmBCxGAoAA5GYCIdAFAAAIqAKY +YSYgFONmCA0gBIAA5iQUJan6gACIF/UTphWhBwUA9OHyDeD59QArIBb5YATFYgCdAIgS0oDRD4oV +ZKCcwCDRDwAAAOokAATYYQAA/CCIFeAMFQBYi3Jj/92KJ/whJhWn20EA6qwgKAQKgAD1oARh0gCd +AIwWKwoB7MwgKegEgABYfp6aEvqACBXv/BoAAIsW7E0RCVAEgAD9YABF8AwVAFh8evSAYBWv/bYA +ZbwU+V/giNIAnQAvICDx/+A3kgCdAGP/dwAqIAf8oGgdoaoBAFiHs4gS0oDRD4on3DDrEgAlUIEA +AFiDMcCy+0BGHeACBQDRDwAAAAAAAADrNAAOOASAAPxgaB3gDAUAWH5720DsNAAK6ASAAOoWAivw +BIAA7xIGKVAEgABYg0/6gAgV7/tKAOokAATYSQAA/AAiHaANBQBYizZj/u0AAGwQCJIUkxUZ6UiI +QPggRhWvywUA6yoBAnAhAAD6IGYVp4hBAOSBwGJQEQAAjxMtIQWpjCzAAK/fBMwL7/xALlgEgAD/ +gA2K4gCdAPogJhWgaAEA/gAiHeANBQAG/TgL3wvr3QoH2CEAAIIVnhD5AABFcAwlAPJBABXgDwUA +8kCAFaACDgCNFA5VDP/gIBWgAwUA7+QABEAFAADxDmAN4H4BAIYTIqAALdEFBCIL5tYICVgEgADi +FgYjMQEAAPZABnqiAJ0ACAZA8gAiHaANBQAGLTgL0gvr3QoBWCEAAPcgEBWgAhUAByM4hxUHZgsX +6RunNydwoAYyCgYzC+x8CAGYIQAAjtALAIkF7jYuJgADAIsi0gDqrAEkyAUAAPRf+yPiAJ0ABSkM +DioM+6AGFaAHFQD1YCgV4AYFAAl2OAhoCCKyAAXlCCW2AX5bAiIsAeK2ACZ9EoAAFukCixIe6QHm +tgEHkAUAAAYiAoYV7rsBDG4CgAANuwKSYPqABhXhLB0A0Q+LEPwgKBXv/VIAAAD8TwAN//zGAIUV +GejTBcUL+AAKFeACBQCxIuWDHgkP6AAAHejrhhIa6OvtbQEH2AUAAA27Ao0V6mYBDE4CgAAJZgLr +1gAmEAUAAPaABhWhIh0A0Q8AAAAA6hYBLWgEgAD7wGgd7/nWAP2PAA3/+T4AbBAM+EBIFaAKBQDr +IAcpyASAAPKAaB3nxQEA/Z/AFaAEFQDsTDkMuASAAPwhJhWhuwEA8xtcDeAMBQCaFpwVmRObFJsb +GOimHuilFejHlRjl6KId74KAAA7dCC0WCi4gFu3owh2nAoAA9IAAQnD/9QB/4RMCKgJYMr4Y6Jkd +6LvqFgglKhGAAGAAFwAAZmPL+MAfKJD69QApIBb7IBlNIgCdAImI9yAGEJIAnQArUq4c6I1ksNEs +wn8rUq0MuwFksMewmZmIHOiqZLNLLMCALMw3/iFoFaTMHQCsPOsWAiZgHQAA9cAFghIAnQAuQp79 +wAgrogCdAIwaK0KdLMLDDLsB6xYAJZlRgAAqcQyJd5kR/UAOrGIAnQAscBDrcgMmCUGAAPmf+yjS +AJ0ALnIDZODQjxZl8bCGEY8YjRTuEgApUASAAOb/NgvYBIAA7xYBKeAEgABYMHAY6GId6ITnry5t +MASAAGAC8gAAwKBZyXEY6FyJiB3offk/+YiSAJ0A//0IDaALBQDAsMCqCpk0+QEGFe/8zgAAapEk +K0KefLNBjBorQp0swsMMuwHksDVk8/0AAP8BBhWv/SoAAAAAAPwhphWgCgUAWclaGOhFiYgd6Gfs +Eg0kjxMAAP/8jA2gCwUAwLDA+g+fNP8BBhXv/FIAAAAAAAAA//wYDaALBQAAAACKGMCxmxb5X/kq +4gCdAMDgnhb5X/jK4gCdAOt0AAlQBIAA7RIJKeAEgABYMKz+ACId4AcVAOcWCS04BIAA/0BmFe/7 +ugBksEmPFf4AIh2gDAUAD+w4ZMCMiBGGGOokAAvYBIAA7RIEKeAEgADoZjYI8ASAAOYWASD4EQAA +WDE86OgXHTAEgAD90HAF7/f+AAAAAIsYDwIADwIA+WE2DeAMBQB5owHAwfgAIh3gDgUADJ447BYF +J3yRgADrdAAJUASAAO0SCSngBIAAWDHa90BoHeALFQD6ISYV4AoVAPrgZhWv/Z4AixAV6BoqIQeJ +cBzoFv/P/AXqqgEA/0AAFTiZAQDsqgIEwD0AAPwhKBWkiB0A6rYAJEAJAAAIOAyOIJmz6F85AbP9 +AADvtgIvdgKAAO5uAgWoQQAA7rYBLg7mAACIE+iMICGUVQAA6jz+KsgEgABtqQUIAIYJAmErPP4M +uxGrW5sQKCAULCAEo4j1gAiZEgCdAAgJRykkFPUgCi5SAJ0AiHIoJhyJcegWBy2oBIAA8yAKMFIA +nQDxNfgN4AcFAKdmJkadKiAWKwr/e6EK6xIBKVAEgABYNZqMGWXA48Ag0Q/rEgEpUASAAFg1lS4g +Fhjnwv3PyAXg//UA/9/lHGIAnQBj/IeIGWWP0ipwENtw/GBoHaAJFQD7X+AVoA0FAOqdOAlQBIAA +WC+JwCDRDwAAAPpAaB2gG8UA/AAiHaANFQBYiapj/70AAB3n0C3QgOsSBCbo3QAA+kBoHaTdHQD8 +YABG8AwVAO3cByXYYQAAWImfY/+PLiAWLwr//9/69GIAnQDrEgEpUASAAFg1bcAg0Q+LEAxsEay7 ++iAGFe/7lgAoJBSNcPG/+LqSAJ0A+kBoHaAMBQBYeqj2wGAVr/wSAIon6zQACegEgAD7RAAVoAwF +AFh8vdKg0Q8AAAAAAAAA6xICKVAEgABYAfX6IAgV7/rCAAAAAAAA6iQADGAEgABYA3CIF4lxmhzn +pAANXwKAAOtVCAT1TYAA61QACVAEgAD9AGgd4AwFAFgDNfdAAEP/+joAiif8oGgdoAslAOqsICno +BIAAWDGxK3AQ+X/xONIAnQApcBUJCEVkjhkrcQkc54kqcQwvcBGOJwyqDKv/D4gJ/cKkFa/NBQDu +7CAkeIkAAO3uAQRASQAACvg5qH2uzu7sQCbogQAA7ttaftAEgAAO6jAb53ktoQH9QAQVofkxAAv/ +CisiF+/yoS5kAoAADN0CC+4MD+4srt2oXv3AJB3v3YEA/cAEHe/2dgCLFPpAaB2gDBUA+2JAFeAN +BQBYiT5j/g0AAP2vAA0//poAbBAEIyAAJArtdDEGIiEDvCLRD4QhhiDyQGgVoAglAPdkAAKwlHEA ++Q8ADHM2AQD0YABB82aBAOXnVhwBCoAAAGYa9mABAb1EAQDlIgEBqDkAAOUiDAGYaQAABCQsBDMo +oyLRD2wQCIoiJyAHiTCVFfhC0BWhdwEA8V1MDeiZAQD4ICYV4Pz1AHyBHQULR/t/wBXgCRUA65s5 +CVAEgABYNRPzUzAN4Pz1ABrnE4ioFucQ9wANmJIAnQAuYq4Z5xBk4dspkn8lYq0JVQFkUdEojP8o +pgjpVAACjYGAABvnKyWwgO3nBBKo3QAA+CAGFeRVHQDlRQgLzwKAAOaZCAKoDQAA9OAIkhIAnQAo +kp71ABM74gCdACWSnQ14CiiCwwhVAWRRiCkgFv0jJg2g69UAKjAQ+0ASVGIAnQArMQu8u9ogWDS/ +KCAULCAEpIj1gAxBF5gBACkkFPUgDi5SAJ0AihUe5wKNESghBxzm5xnm/v+h4BXqiAEA/wAAFDT/ +HQDpiAIH+AUAAA9PDJhQiyAP7Dn8oGYV56oBAOxWAi3eAoAA60sCAshBAADrVgEhwEEAAPlACXFS +AJ0A6EENYlP9AABtqQUIAIYJAmHAgJgU6SAEIlv9AAAMuxGrW/UgCQkSAJ0AiDIoJhzpMgEl2EEA +AJsTKBYC8yAJuFAFBQBmkVClTIgUDH0Rpt3s1p0sEASAANEPAAAAAAD3AA6QkgCdAAx5EaaZLpKe +9cAO++IAnQAlkp0NeworssMLVQFkUc2wjZ2oZV7dYABjAAAAAAAAAOokAAnYBIAA7RIFKmAEgABY +ginSoNEPAMCgWce4GuaiiKj5H/IYkPz1AP/5WA2gBQUAAAAAAAAA+kBoHaAbxQD8ACIdoA0VAFiI +lGP/scBQwOoOiDT5QQYVr/iuAB3mti3QgC3cN/rjABXk3R0A7U0ICVAEgAD9oGAV4AwVAFiIh2P/ +ewAAAAD4QoYdr/oOAAAAAIon/SBoHaALFQDqrCAqaASAAFh7tPoghhWv+0oAizDzYAiikgCdAOIS +BCvnAoAApswkxp3RDwAAAAAAAADrEgApUASAAFgA5WP+MAAA6iQADGAEgABYAmKJMYsTiBLsrBEN +KASAAOy7CAT1nYAA2iD9AGgd4AwFAFgCKYgUpaWlTAx9Eabd7NadLBAEgADRDwAAAAAA//aUDaAF +BQCNNYw0HuaD+mDoFeAJJQD8cAAHsK1xAPsvAAy7jCEA+yAEANPMAQDozAgP+AqAAP+AAQZ93QEA +7rsBBnA5AADuuwwGYGkAAA29LA3MKP1gAEW/9boAAAAA6iQAA9hJAAD8ACIdoA0FAFiIQGP+YcCg +WcdWGuZBiKgd5j/5H/EIkPz1AP/48A2gBQUAwFDAuguLNPtBBhXv+LYAsEsMuxHrWwgJUASAAPti +ABXgDAUAWHlKs0ziEgQr7wKAAKbdLNad0Q8AbBAEiTcX5lIrMBb5zJIFoyoFAAoqKAu2CeioCAs3 +AoAAqGbnZwgJAQqAAPT4aBWgDBUA4M0aAzNTAADucsQjMgEAAOZBFnTAIQAAizKY4J6TlpINuwIo +dsSbMtEPH+Y9r68p8sEAsQTt8sUucAqAAA6ZAvn4JhXv/vUADt0DDZkBHuY15XLEKW8CgACu3ZnQ +jzKYUOaGACkBCoAA5YYBLiAKgAAE/wIodsSfMtEPAABsEAoZ5ioJKQookn/iFggpUASAAPsABADQ +BhUA5hYKKygKgAD4IIYV4FVNAOLmIRFjuQAAG+YT+cviBaMtBQDtqigNPwKAACmSf5wVHOYaqHfo +crkky/0AAP1AAEIzmQEAmRnkQqEmYhEAAKysnBerqvogxhWgYwUA+IAEAjAAagCKGsCw/f/iHaBj +BQDsVQMFAwmAAJsaLXK4BF4BDt0BnRABAIcDNmBoPtWKGIsXjRX4IMgVr//1AOM5CQHygQAA7hYJ +LM8CgADpiAgPAQqAAOKICARjCwAA6IKhK0gKgAAPmQPpRAEGYgEAAAuAAGP/pIoZixSxqgoKQyq2 +f9EPbBAEG+XtKiIADwIAK7J/HuXr+08ADXMvBQAPrygO/ggp4sMo4sL9y8wF7/v1AAuZA+mLAQ1n +AoAA/YAARn/09QD9gAgVoAMVAPkO4B3gDQUAGeXcGOXL+QAARn8sAQDs/AgF/USAAMspCOowKcLD +L+LECYgM6PsTfoEKgAAv4sIAOBoEiAMI/wEv5sL9oCAV4bsdAOSwLGZgwQAAf7cUY//EAAAJ6jD5 +mGYV7/+GAAAAAAAA/aAgFeG7HQDlv9xmYMEAAFg1bMAg0Q8AbBAEJiEJ+EKQFe/4BQAnIBXomAEL +NgKAAOiZDAu5AoAAB2YC+EKGHeAHBQAnNAD4YGYdoAQVAARmApYxFeV9JFat0Q8AAAAAbBAEFuWs +FeWH0w+mIgU1AiUmgCQigGdAC20IBSgigGeAAmP/89EPAGwQBBPloyI2imP//AAAAABsEAQoIAUl +IAeKNfX/oh2gAyUA/QFgEdFVAQDAINEPAAAAiCkZ5ZiaK/sAB9wiAJ0ACVkJKZ0CK5EIKZEEGuVr ++yAEY+IAnQCLIg8CAHuof9ogWHiQiyIPAgADugFkr7qKJwS7AesmAiVQwQAAWIaj4+VkFQERgAAo +oAADiAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ2SffyqZFMqmiplkr3UooAADiAqIjOygBy1Y +BIAA+kBoHaANNQALgABlr+Fj/1QAAP//WA2gCgUA2iBYeIMrICLquwwJUASAAFh5zdpQ+gAiHeAM +BQBYe36LIgO6AfN/+yZiAJ0ALSAHBLwBnCLzn/iQEb0BAOu8HylQBIAA/AAiHaANBQBYhyPAINEP +AAAAAOsgIilQBIAAWHm5KiAFweN+oQxoqCmLIvNgBAV//GYALyA6wI94+er6QGgdoAsFAPwAAh2g +DSUAWHjwY//XAAD6QGgdoAsFAPwAAh2gDSUAWHhpY/+/AABsEAqIKx3lMi4gIYs3/GDIFaD/5QAP +7gEuJCENzAEMuwzriQh4yASAAMAg0Q8DAIYJAmGbFSggBSUgB8dN+CEGFeADJQD9HABB0VUBAIop +myv7QAfcYgCdABvlKgtbCSu9AiyxCCuxBBrlAf1gBEuiAJ0AjCJ8qH/aIFh4JosiDwIAA7oBZK+g +iicEuwHrJgIlUMEAAFiGOePk+hUBEYAAKKAAA4gKiIzsoActWASAAPpAaB2gDUUAC4AAZa/hiSdk +n2UqmRTKpoqZZK9bKKAAA4gKiIzsoActWASAAPpAaB2gDTUAC4AAZa/hY/86AAD//1gNoAoFANog +WHgZKyAi6rsMCVAEgABYeWPaUPoAIh3gDAUAWHsUiyIDugHzf/smYgCdAC0gBwS8AZwi85/3wBG9 +AQDrvB8pUASAAPwAIh2gDQUAWIa5wCDRDwAAAADrICIpUASAAFh5TyogBcHjfqEMaKgpiyLzYAQF +f/xmAC8gOsCPePnq+kBoHaALBQD8AAIdoA0lAFh4hmP/1wAA+kBoHaALBQD8AAIdoA0lAFh3/2P/ +vwAAbBAEHOTXKzIEKTAW/WAEBbWZHQD1IAgAkgCdAOrk0hSIgYAA/8miBa/95QDk5KsUpLUAACyh +fmmVHXyzCirMBPtgCKOiAJ0AKyAGsLsLC0frJAYlgsGAAMAg0Q8ALKF+7LMMdngRAAD/YAfj4gCd +ACggBrCICAhH6CQGLH7mAACJJ4siKpkUDbsBmyKLmWSgtiiwAASICoiM2iD9YPAVoA01AAuAAMAg +0Q8AAIsiiicNuwHrJgIlUMEAAFiFxsmsKKAABIgKiIzsoActWASAAPpAaB2gDUUAC4AAZa/hiSfT +D2SfciqZFGSgZIqZZK9nKKAABIgKiIzsoActWASAAPpAaB2gDTUAC4AAZa/hY/9GAAAAAAAAAOok +AAnYBIAA7EQACugEgABYh3PAINEPAOokAAnYBIAA7EQACugEgABb/0XAINEPAP/9FA2gCwUA//5k +DaAKBQCINyLifwmIEfhAAEE/+5IAiDci4n8JiBH4QABBP/vyAGwQBBrkZCii32SACwnqMCui4AuZ +DGeQAdEPWHst0Q8AbBAEHeR0JyAHHORM/kEEFeDnEQAO3DmcMIgg+8h2BeAKJQD6YEYV4BkFAOk2 +AyxGAoAACokC+GAmFeF3AQDmIHkrvAKAAPfmAA9wDQUA/AQCHaALNQDp5GATAjmAAJ01nDMLigIW +5F2aMRrkXQbuAiYhCZ40mjYEZgIiIAedOZU7+MYAC3EiAQDmNgopFAKAAAL/Agn/Au82CC2QBIAA +0Q8sIQgrIQmdNZU3B8wCBLsCCbsCCcwCnDTrNgYtEASAANEPAGwQBBjkMB7kQiwgBx3kGxnkRPpB +BBXg/BEA/80ADvHMAQDtNgAuZAKAAAy7Agm7AuOAgCmwBIAAHeQD/EAIFaAOBQCeZe1mAiG43QAA ++sCGFeR3HQDqfP8uZgKAAOx8Ag1XAoAA7GYBJVPhAACaYwIEiZlmk2cGIIvlIQkkQ/cAAPTBZhWk +Mx0A5WYKK5AEgADoAAUDKMEAAG05AgUCYdEPAAAAbBAGHeQfCysRrbMqMn8Z5B0X4/6IoMBA+OAA +RPAGFQDpuQgEAamAACwyeC8ye/mABZxiAJ0AZfEYLDZ8KzJ5KzZ73UAN5BYBAgCUoA3kFsDJ/EAF +/CIAnQAvMnvBwO3kCheDsYAAIjJ8KiEEjiDz4f4NproBACQ2fPRvZhWgAB4ALjZ87a8BBcP9AAAI +/wLvJQQljGEAACIyfLDM7zJ7IQEBgADJyGP/vwAA2iBYe0tloMQqIQT/QSAMFpoBAMiZ0Q8A2iBY +ez7RDwDaIFh7ANEPAAAAAAAA+kBoHaALBQBYe8/RDy4s+OrSiC8BCoAA/MABBd/89QAMuwMLqgEq +1ohZyhAkNnwkNnv6b+gVr/zSAAAAFeOfL1BYZPBqWcARWHqyKHLf0w/IgVh6hylQWGSfJVh6gciu +FePVLFJrsMzsVmsmAsmAAFh6CmP/CgAAAAAc48/+b4gVoApVAPxvSBXgC0UA7RYAIWvlAABZxyX6 +b+gVr/siAC4ye+I2fC96DgAAIjZ70Q8f48Mv8q5x9ov2qwYdr/4iAAAAAABZv9j6rWYVr/6SAGwQ +BBTjuxnjtejjlhlewoAApLQjQn+piOi4CAGCIYAAKjIAeKkCKkJ7HOOtKzEEKkZ/DLoB6jUEKdAE +gABYev3OqSkxBP8hAAwW2QEAyNfRD9owWHrx0Q/aMFh6s9EPAPpAaB2gCwUAWHuD0Q8jRn/RDwAA +bBAE8GDwDe/59QCIIgk5AwmIASgmAoonDwIADwIAKqwwWISl4+NmFQERgAAooAADiAqIjOygBy1Y +BIAA+kBoHaANRQALgABlr+GJJ9MPy5IqmRTKpYqZyawooAADiAqIjOygBy1YBIAA+kBoHaANNQAL +gABlr+HRDwAAAP//XA2gCgUA0Q8AAGwQCB3jWRvjfRbje/XGbAWgGMUA4yzoJdOBAAD4QA3MJzMB +AAw1EaRV6FKeKWbCgACmxClAf/kAEFPiAJ0AKFKdZIH/mxHqCx4NSASAAJkQCiCGCwJlCwJjDQCH +CQJhCQJh7ccICQEKgAD/xsoF4A4VAOPjMB9wCoAAnhOvz/4ghhXv//UA/9cAD3AGRQD+IEYVoADC +AAAAAACKmcmsKKAAA4gKiIzsoActWASAAPpAaB2gDTUAC4AAZa/hKUIgZJDvLUB8LEB9HuNPDdsJ +B7sK7t4IBdhjAACKsi7ggGShOP3H/g2gCBUALwoADY84D/8JB/8KL/0YL/ycL/IbLAoBDNwD8eEg +DefMAQAMywkHuwrsRHwl2GMAAMDQ/I+mHeAMBQCNsO9Snibz/wAALuD//+AEe6IAnQAvUp323+AV +oPj1APHnwA3nZgEAeGF06hIEJkAFAADoRH0m4+EAAFh6gIkT0qDrEgIkgGmAACqiAguqASomAoon +KqwwWIQsyawooAADiAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ2SfFyqZFGWu7//7uA2gCgUA +jBGLEAyAhgxghgsCaQsCZ9EPjxGNEC5Efw/Ahg+ghg0CbQ0Ca9EPmxHqBx4NQASAAJgQCgCGCwJj +CwJhDeCHCAJv6OwACdAEgABZvzlkr6/t4tkZrwKAAORVCAlmwoAA94AAQj/5MgDAsfu3AA3wDAUA +/I+mHae7AQArRHwLuwn3YAEF8AwFAPtjACXv+5oAAAALYIYLQIYKAmcKAmXRDwAAbBAEGOKjAgNH +DDMRqDMrMoQZ4rMosACKsQmICgohjAIKPoiMAwI+/EBoHaANJQALgAAiNoTRDwBsEAQU4pUCA0cM +MxGkMyQyhIpBJkAAKEAI+phoHaCpJQACBT4DAj55gSUY4p8IaAqIjOpUAApYBIAA/EBoHaANJQAL +gAAiNoTRDwAAAAAAAOskAApQBIAAWHpH80BoHa//LgAAAAAAAGwQBFnCtxLiehPimgwCACkiggka +jgOoCoiEC4AAY//rbBAEE+KqIzF+ojLRDwAAABLiuQPoMATuMAWxMJMglCGVIhLitRPieYQgBDMC +kyAS4rPAOoQgBDMCkyAS4rHAMCg3QCg3RCg3SCg3TCM9AXIz7RLirMAwkyDHLxPiqwMjAxLiqoQg +BDQBlCAS4qmEIAQ0AZQgEuKnhCAENAGUIBLipoQgBDQBlCDHL8AxAyMDEuKjhCAENAGUIGP//AAA +ABLioIMgAxMUDzMRkyAS4p3AMCMmAFf/1hDinJEAkgGTApQDBAIwlAQEADCUBQQBMJQGEeKWghAB +6jCiEQHwMcBABOQWAAIAEeKSghAjGgADIgKSEBHikMAhkhAE5DGEBgQBMYQFBAAxhAQEAjGEA4MC +ggGBAADSMAEjAAAQ4oeRAJIBkwKUAwQCMJQEBAAwlAUEATCUBhHigYIQAeowohEB8THAQATkFgAC +ABHieYIQIyoAAyICkhAR4nrAIZIQBOQxhAYEATGEBQQAMYQEBAIxhAODAoIBgQAA0zABMwAAEOJx +kQCSAZMClAMEAjCUBAQAMJQFBAEwlAYR4muCEAHqMKIRAfIxwEAE5BYAAgAR4mCCECNKAAMiApIQ +EeJkwCGSEATkMYQGBAExhAUEADGEBAQCMYQDgwKCAYEAANQwAUMAAABclAFdlAJelANflABDAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXJABXZACXpAD +X5AAUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyU +AB2QAZ2UAp6UA5+UBAiUBQmUBgqUBwuUAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAACckAGdkAKekAcdkAOfkAR4kAV5kAZ6kAd7kABTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAA3JQAHZAB3ZQC3pQD35QEBJQFBZQGBpQHB5QICJQJCZQKCpQLC5QAQwAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAANyQAd2QAt6QCx2QA9+QBLSQBbWQBraQB7eQCLiQCbmQCrqQC7uQ +AFMAAAAf//yoANIxEP/+CgAAAAAAH//9DADTMRD//goAAAAAAB///XAA1DEQ//4KAAAAAAAA9DAK +AAAAAAD0MAoAAAAAAPQwCgAAAABsEAgnIAeIIhbhK/vCTgXhdwEA5YDxa9cCgAAY4SQugIDmqggH +cN0AAP1TyBWk7h0Ark7t4R8XcAkAAP+ACEugCaUAKqKdC3wKLMLDDKoB6hYCJQf5gACI2PcACPCS +AJ0AL2Ku7OEVF4XBgAAqYq0swn/sqwEEc/0AAP1ABSYiAJ0Antj9QAUuIgCdAC8gFKT/Dw9HLyQU +9eAHrlIAnQD4IEgV54UBAPkAB3FSAJ0A6DwQIgw9AACwSm2pBQgAhgkCYcBQiBKNMu0mHCJL/QAA +6zIBLM8CgACpiJgT82AKQFAKBQDqFgAti0oAAIsQ60sIC+cCgADmzAgF2/0AAOvGnSqQBIAA0Q/q +JAAJ2ASAAOxEAAroBIAAWHwJ0qDRDwDAsAmMNOzWCC37HgAAjSJl39X6QGgdoBvFAPwAIh2gDRUA +WIJ4Y/+///wMDaAKBQAAAI4iZe+wLYCALdw3+uMAFeTdHQDtTQgJUASAAP2gQBXgDBUAWIJrY/+M +wKBZwYEd4MyI2Pkf9sCQCaUAY/+c2iBb+tlj/wYAjieeEYjp+8KkFe/JBQDl6RQnYIEAAAnJAem9 +CApXAoAA6lUMBEBBAACY6QhVMuXlFCbpAQAA/QAIOuIAnQBoqz2oqyu88PugBNPiAJ0A7xICIgx1 +AACwTm3pBQgAhg8CYSvCAQurCOXJBCXbwQAA/WAGzGIAnQDrxgEtwASAAGRQqfUAaB3v+pYAAAAA +AADqJAAO4ASAAOwWBCxYBIAAW/wwizGIE40U6hYALWcCgADsiAgF9P2AANog+wBoHeAMBQBb+/eN +EO2tCAqQBIAA7U0IC/cCgADm7ggG6/0AAC3mndEPCN0M+iBIFeT9HQDTD235BQgghgsCYysSAu9P +DATBAQAA7bsIB4xBAAAu/P9t6QUIQIYLAmUvyQQNqAyomCiMMOjGAS/61gAAKpxAmsH7gAYVoAgF +APmAhB2v/RYAC4gM+cEmFa/72gAonED5gCYVr/yyAGwQBB3gchrgcxzgcS3SuCqhfyzCj6Pd6joM +Du5CgAD9gABGcAsFACvEBCvEBVkWjPpAaB2gCwUAW/yk0Q8AAABsEAQY4GUpgn8qMActkQIukQT9 +IKQVoA8FAOuSACaJEYAA7uz/JpP9AADilQIvdwKAAO67CA5nAoAA/W8ADbAAxgArkQUtkQSxu/+/ +4BWvuwEA65UFL3cCgAD9YAa8YgCdAIyQ7swIDd8CgAALywwLAIcP32DrAAcG8yeAAB7gRymRBSvi +fwmZEanZ7eJ9JYYRgACM0YvQm8CL0Jyxn9Cf0Svif7C7K+Z/9aAGHB+5AQCM2fmjABWvyQUA+QAE +BH8SBQCi0ismOv+iBB3lSQUA6dURJCEBAADk1gctLwKAAOTWBipYBIAA9YAE5CIAnQAl1RDoWAgE +eBsAAOyMQCf6AQAA/eAEY6IAnQDJMulEAAUAgYAAbakFAwCGCQJhKyJCq1j/AAWMYgCdAOgmQiaT +4QAA0Q8vlQX//JgNoAsFAMCl/cAuBaA7JQBZw0rAINEPLeKAjNGL0JvAi9CcsZ/Qn9Er4oKwu/vQ +RhXv/PoAAMDA+w/oFaANFQBYdFrAINEPAAAAAAAAAO/WCSaT4QAA0Q8AyzD6YGgd4FzFAOysNgpw +BIAAbckFCyCGDgJj+GAARfBeRQB+oQ0vrKzTD235BQtAhgQCZSmN++kmQiaT4QAA0Q8AAAAA5CZC +JpPhAADRDwAAbBAEgiMCAkHRDwAAbBAEhSODIBTf6/hAhBWhVQEA6t/pGq7CgADkVAgBgLmAAPsA +BAQ2mDkACYgCKCUEIkJ/0Q8d3+AT3+Ef3+EmQn4rIQQuQn+SYJYho//9YAQF9ss5AAy7Aq9f7yYA +JygFAAAlRn8iRn7rJQQqkASAANEPAABsEASKIGWgUB3f0uoiAyn2woAArt39r+gV4AwVAPyAQAYx +qgEABqoCDcgsCN0oJyUF7cwMBFgFAAD9bQAMP/vFAOuqAQxOQoAACVkCA6oCmiMJiAIoJQTRD48j +G9++Dw9BC/4Rq+stsn8Z37gssn5y2RnZwPMj3g2gDAUAwMAstn8stn76QAgVoABGANjA8wxGDaAM +BQBy0RyNIZrQjiApsn2d4Zwg7CYBJMv9AAD5b6YV7/1aABnfpBjfpKmIqOh4oSDqtn8vgS4AAM2t +KrJ9aqIYLbJ7/W/mFeAASgAAAAAAAADstn8n/ymAAPpACBWv/qYAHN+ViCGsmanp+Q8ADPAMBQAJ +yDj5b8YVr/4qAGwQBPW/IgXgBhUA9EBoHaACNQD2gEADMAAeAACwIihSf+hj93KrgQAA0Q8AbBAE +9EOoFaMjAQDyWgAJOFMdAAQiCoQmgiEFRCgKRBGkItEPbBAEiCcb3331AoIV78cFAOKCCSkwBIAA +6YEVJCCBAADnRAECqQEAAOWFFCETAQAA4oYJIiEBAAD0QVINoApFAAKSCCKGCQsAh+3fbRkoBIAA +baoCBQJhnSCMYMDU4yYCLmYCgAANzAKcIdEPbBAKLiICKiIYDwIA8d2MDec1AQAc32EuIgD9QAgV +4DsFAP9AsBXgClUAWcKGKiISJCAH+j4ABDAHNQD1AAxYkUQBAArIUfUADHCSAJ0AHN9T/k0wFaAL +FQD4f8AV4WpBAPzAaB3gClUA6bk5D0cCgAD4xgALMDsFAOkWACt4BIAAWcJwHN8x6t8zGkgEgAD0 +gAdqEgCdAAxLEaq7LbKe96AL6dIAnQArsp0MTQot0sMNuwHpFgglikmAACwhBx3fOAwMSu/fOB5n +AoAADcwCnLAc3zX+QAgVoz0FAP1g5hXgCQUAmbjptgYrVwKAAJq5/WCmFaAahQCasxnfLO/uAg9G +AoAAnrQptgIHiAIotgEoEggZ3xDv3yYcRwKAAAmICCeGnS4iEioiEA/uAu4mEilYBIAAWOVm9GAE +URIAnQCKJw8CAA8CAI2s+0YAFaALBQDq3gwG6yEAAA7bOVh/zP2+KgWgOwUA7SQADRgEgAD+YGgd +oApVAFnCMtIw0Q8AHt70jejkFggoBAqAAPegBLiSAJ0ADJsRqrsvsp734AVJ0gCdACuynQyfCi/y +ww+7AeSwl2bD/QAAmOjpFggt9+YAAGAAOcAg0Q8pGgAJqgL6QkYVr/m+ACsqAAuqAvpCRhWv+bIA +AAD6AKIdoDsFAOze8hloBIAAWcISYAAUAADqJAACWGEAAPwAAh2gDTUAWIBsaDJCwCDRDwAAAAAA +AP/6PA2gCwUAwKBZv34e3sga3smN6BzexIkY+b/6uJIAnQD//dQNoAsFAMCwwMoM3DT9wQYVr/2a +AB/ezp8UjiDaIP29rAXgDBUA7RYGL3YCgADs7gIA2EEAAO4WBSroBIAAWH9mwCDRDwAAAGwQGJIQ +jiAV3suJI4shiiIqFiIrFiT4JGYV4AQVAPQg5hWgCAUA+CCmFaAMRQD8IUYVoA01AJ0Z9CDGFeAP +JQCfGPW9egXgD6UA/iIGFeANtQD8IiYV4AzFAPwiRhWgCIUA+CHGFaAElQD0IeYVoAl1APghphXg +C1UA+iFmFeAKZQD6IYYVoAvVAPoiZhXgCuUAKhYU9b1SBaAJ9QD4IqYV4AhFAJgUhhYrEiSJFSdh +fiwSIiJhfweZKC9QgKkp+J2IFaOZAQADmQrukgAvUASAACZiPi0SI6juC2AAjhcsEiQtEiIH7igv +UIGuLvidqBWj7gEAA+4KjuAqFhbqEiMtWASAAKjuC2AAjhgsEhYtEiQH7igvUIKuLvidyBWj7gEA +A+4KjuAqFhfqEiItWASAAAjuCAtgAI4ZLBIXLRIWB+4oL1CDri74negVo+4BAAPuCo7gKhYY6hIk +LVgEgACo7gtgAI4aLBIYLRIXB+4oL1CEri74nggVo+4BAAPuCo7gKhYZ6hIWLVgEgACo7gtgAI4b +LBIZLRIYB+4oL1CFri74nigVo+4BAAPuCo7gKhYa6hIXLVgEgAAI7ggLYACOHCwSGi0SGQfuKC9Q +hq4u+J5IFaPuAQAD7gqO4CoWG+oSGC1YBIAAqO4LYACOHSwSGy0SGgfuKC9Qh64u+J5oFaPuAQAD +7gqO4CoWHOoSGS1YBIAAqO4LYACOHiwSHC0SGwfuKC9QiK4u+J6IFaPuAQAD7gou4gAqFh3qEhot +WASAAKjuC2AAjh8sEh0tEhwH7igvUImuLvieqBWj7gEAA+4KLuIAKhYe6hIbLVgEgACo7gtgAC4S +ECwSHi0SHQfuKC9Qiq4u+J7IFaPuAQAD7gou4gAqFh/qEhwtWASAAAjuCAtgAC4SESwSHy0SHgfu +KC9Qi64u+J7oFaPuAQAD7gou4gAqFiDqEh0tWASAAAjuCAtgAC4SEiwSIC0SHwfuKC9QjK4u+J8I +FaPuAQAD7gqO4CoWIeoSHi1YBIAAqO4LYAAsEiEuEhMtEiAvUI0H7igoQvmuLvogZhWj7gEAA+4K +juDqEh8tWASAAJsRqO4LYACMES4SFC0SIS9QjgfuKChC+q4u+iBGFaPuAQAD7gqO4OoSIC1YBIAA +KxYjqO4LYAAuEhUsEiONEwfuKC9Qj64u+J9oFaPuAQAD7gqO4OoSIS04BIAAJxYi6O4IC9gEgAAL +YACOESoWJCkSEi0SFY8VKxITLBIU6BIRJ/hBAADvFgUl2EEAAOsWEyZgQQAA7BYUJEBBAADoFhEm +6EEAAO0WFSTIQQAAKRYSjR+JHIgbjB6LHe8SECRAQQAA6BYLJmBBAADsFg4l2EEAAOsWDSf4QQAA +7xYQJMhBAADpFgwm6EEAAJ0fiRaNGY8a6xIHIiEBAADsEggm6EEAAO0WCSf4QQAA7xYKIqhBAADv +EgQmYEEAAOwWCCXYQQAA6xYHJMghAADpFgYn+/0AAO8WBC/iJgAAiRCPE4sSjpCIk4ySjZGriKfM +qt2v7p6QnZGckpiT0Q8AbBAEKSIV+KAABPA4dQDpjAwBIEEAAPMgAEU/iwUA66QQJVBFAAD5AAXT +YgCdACsKAFm7OywiFSsiFO3NEQlABIAA/EJGFe6APQD9awANsAk1APpCZhXgCiUAbaoMjoQODo7u +hgQkQBEAAA8CANMP0w9tmiHpggQkQEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD60QACVAE +gABb/raKIIgiiSGPIwgIjgkJjg8PjgoKjpognyMpJgHoJgIpQASAABndfQIAhgMCYfgAChXgCbUA +bZoCCACK0Q8AAAAAAAAA/YEAFaALBQBZuwz4QGgdoAlFANMPbZoh6YIEJEBBAACKgYuCjIMJCY4K +Co4LC44MDI6ZgJqBm4Kcg+okAApYBIAAW/6U2kD/+/wNoDyFAABsEAYpIhX4QogVoEYFANMP+IAA +RXWZAQAJZgx0qwGxiComFQYqDOgmFCVRQQAA9oAHs6IAnQDrNAALYASAAFm64PhAaB2gCUUA0w/T +D22aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIMlLBDqJAAK2ASAAFv+cQZHDPbg +BY7SAJ0A5jQICtAEgAD24GgdoAMFAOQWACpABIAA+MhoHaAJRQAKAmcIQIYKAmUIIIYKAmMIAIbq +DAAJQASAAG2aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIPqJAAK2ASAAFv+VOpU +AAGYBQAA5mzAIiEBAADvbZpqQASAAIsQCjwRC8sI7HwMCtAEgABZuqjRDwAAAAAAAOs0AApgBIAA +Wbqj0Q8AAAD2YABGMAMFAPwgBhWv/yYAbBAEGN0RGd0PGt0NE90QkyOYIpkh+kAGFaALBQArJhUr +JhTRDwAAAGwQBt4g5OIQKmAEgADnQgcr0ASAAPu5/AXgGDUA40IVKZAEgADncg4i++kAAHj7Jxjc +/gj4CoiAmhOcEu4WASwAIoAAAJMQKrKd7FQACVgEgABZvHlkpcfygqYV4AIFANEPAAAAACviEgub +Uu4WASX/QYAAGtzn4xYAKVgEgADqor8q4ASAAFm8bGSlehrc4Nsg6qLBKuAEgABZvGcjfQXkps9h +mgEAABrc2tsg6qLDKuAEgABZvGD3R+AN44YFABrc1Nsg6qLFKuAEgABZvFpkpsQa3M/bIOqixyrg +BIAAWbxV+0BCiBIAnQArMOXBWPVgK+BiAJ0AabchJTTlixD6gqYV4AIFANEPkxAqspXsVAAJWASA +AFm8SGSnAosQ+oKmFeACBQDRDwCTECqyo+xUAAlYBIAAWbxAZa8a+iBoHaALtQBY4eD6ACId4AMF +AOqzOAUA4YAA6hICK1gEgABZuqzIqRzcsY0RDKw2LNYXZTMljRD8gqYV4AIFANEPLkBuZO7SkxAq +srnsVAAJWASAAFm8KWWuv/ogaB2gG2UAWOHJ+gAiHeACBQDqsjgFAKmAAOoSAitYBIAAWbqWLH0D +KsUoZSLRjRD8gqYV4AIFANEPAACTECqyq+xUAAlYBIAAWbwVZKK3GtyK2yDTD+qilyrgBIAAWbwQ +Za5a+iBoHaALVQBY4bD6ACId4AIFAOqyOAUn6YAA6hICK1gEgABZunwsQG/xgCc+0gCdAGSk34oT ++gCiHeAM1QBY4Y3SoNEPkxAqsrHsVAAJWASAAFm7+mWux/ogaB2gGyUAWOGaZKI1K0BuZLdv6hIC +K1gEgABZumgsQhYKzDYsRhaLEPqCphXgAgUA0Q+TECqyr+xUAAlYBIAAWbvoZKIzGtxd2yDqoqkq +4ASAAFm742WubfogaB2gC+UAWOGEZKHb6hICK1gEgABZulMrfQIqtRSLEPqCphXgAgUA0Q+TECqy +oexUAAlYBIAAWbvUZKIqGtxI2yDqoq0q4ASAAFm7z2SjhxrcRNsg0w/qopsq4ASAAFm7ymWuB/og +aB2gC3UAWOFqZKF1K0BuZLbjGtw5ixLqoucrYASAAFm7wGWmRitAb8DIDLsCK0RvixD6gqYV4AIF +ANEPAACTECqyt+xUAAlYBIAAWbu1ZKHvGtwq2yDTD+qimSrgBIAAWbuwZa2f+iBoHaALZQBY4VBk +oQ0rQG5ktmoa3B+LEuqi5ytgBIAAWbumZKZ5K0BvLAr9DLsBK0RvixD6gqYV4AIFANEPAJMQKrKf +7FQACVgEgABZu5tkobca3BDbINMP6qKTKuAEgABZu5Zkotoa3ArbIOqisyrgBIAAWbuRZKxfGtwG +2yDqorsq4ASAAFm7jGWsTBrcAYsS6qLVK2AEgABZu4dlpFKLESuyEguZUsiZaJIH+SAPYdIAnQCM +ESvGEvKCphXgAgUA0Q+TECqyj+xUAAlYBIAAWbt6ZKF6Gtvu2yDqopEq4ASAAFm7dWWstPogaB2g +CyUAWOEVyqIa2+aLEuqi5ytgBIAAWbttZayUihP6AEId4AzVAFjg99Kg0Q/AINEPAAAA+iBoHaAL +9QBY4Qdkr+rqEgIrWASAAFm51+sSACPgCwAAKsUV+oKmFeACBQDRDwAA+iBoHaAbFQBY4Ptkr7ot +QG5k1QYpQG/xP+GXkgCdAPE/4VfSAJ0A6hICK1gEgABZucUuQhcK7jYuRheLEPqCphXgAgUA0Q8A ++iBoHaALpQBY4Olkr3IvQG7TD2T0duoSAitYBIAAWbm3KEE0+wAPAqIAnQCKE/oBQh3gDNUAWODI +0qDRDwAAAPogaB2gG1UAWODZZK8y6hIBKlgEgADsEgIraASAAFjgOIsQ+oKmFeACBQDRDwAAAPog +aB2gC5UAWODNZK8CKUBuZJQZGtudixLqoucrYASAAFm7I2WiXCtAb40Q/IKmFeAMFQAMuwL6jeYd +4AIFANEPAAAAAAAAAPogaB2gCxUAWOC7ZK66GtuMixLTD+qi5ytgBIAAWbsSZaspihP6ACId4AzV +AFjgnNKg0Q8AAAAA6hICK1gEgABZuYD1QBXykgCdAMcv0Q8A+iBoHaALhQBY4Kf6ACId4AIFAOqy +OAUBSYAALEBuDwIAZMODGtt76xICK2AEgABZuvplom4tQG/A6A7dAi1Eb2UuNY8Q/oKmFeACBQDR +DwDqEgEqWASAAFjgnWWvnCsw5WP6cwAAAAD6IGgdoBsFAFjgjWSuAihAbtMPZIL16hICK1gEgABZ +uVspQhiLECtGFQqZNviDBhXgAgUA0Q8AAPogaB2gCzUAWOB/ZK3KGttQixLTD+qizStgBIAAWbrW +49tVHQcuAACLESuyEgvJUciZaJIH+T/5EdIAnQCOEYwQA70BLeYS/IKmFaACBQDRD2UthI8Q/oKm +FeACBQDRD+oSAitYBIAAWbk6KkU0ghDygqYVoAIFANEPJX0E9LAAFeALBQD6oGgdoIwFAFm4y+oS +AirYBIAAWOCbKzDlwMQMuwL6fCYdp7sBAPp8ph3v5f4ALTDl+iBIFaAOJQAO3QLtNOUrWASAAFm5 +Iisw5fp8hh2v5W4AAIoSWawRLzDif6kUihJZrA7coOoSAiPYEwAAWbqhZKG3wKL9tj4FoDsFAFm+ +Mscv0Q8a2xGLEuqizytgBIAAWbqYZa4+ixErshILyVFokQpokgf5P/Fp0gCdAB7bEgO9AQ7dAo4R +jBAt5hL8gqYVoAIFANEPihP6ASId4AzVAFjgFtKg0Q8AAAD6IGgdoAtFAFjgJ2Ssahra+IsS0w/q +os0rYASAAFm6fuPbAB0FZgAAixErshIL6VHImWiSB/k/7hHSAJ0AjhGMEAO9AS3mEvyCphWgAgUA +0Q8a2ueLEuqi1ytgBIAAWbpuZa2WixErshILmVJokQpokgf5P+wp0gCdAB/a6oIR778CA+gXAADv +JhIm6gEAACzQ5cDhDswCLNTl8oKmFeACBQDRD4oT+gECHeAM1QBY3+jSoNEPI30FIzyAKzDlwMEM +uwILC0f6fKYd7+ASAAAAGtrIixLqos8rYASAAFm6TmWtF4sRK7ISC+lRaJEKaJIH+T/oMdIAnQAd +2ssDvAENzAKNESzWEosQ+oKmFeACBQDRDwAAAAAA9uAAQzALBQD6wGgdoIwFAFm4TMFQ6hICK1gE +gABY4BwrMOUFuwL6fCYdp7sBAPp8ph3v3hIAAAArMOXAyAy7AgsLR/p8ph3v3b4AihP6AOId4AzV +AFjfuNKg0Q+KE/oCAh3gDMUAWN+00qDRD4oT+gFCHeAMxQBY37DSoNEPihP6ASId4AzFAFjfq9Kg +0Q8AihP6AQId4AzFAFjfp9Kg0Q+KE/oCQh3gDMUAWN+j0qDRDwCKE/oCIh3gDMUAWN+e0qDRD4oT ++gDCHeAMxQBY35rSoNEPihP6AOId4AzFAFjfltKg0Q+KE/oAwh3gDNUAWN+R0qDRDwBsEAgjIAfa +IPIgAAHwC4UA7RQACeAEgABYfJ7t2oAVBsmAAIwgDcwCnKAb2n2KJ+gSACnPAoAAC5kI6JYAJQCR +gAAuogwvrDD/wATlYgCdAPFFwA3gAwUAI6UU+0QAFe/MBQAMuwHoogwl2QEAAJup66YIJUjBAAB5 +iV8c2kL9tNIF7/71AJ6gkyfq03p1WCEAAC3CfRnaZJvRmaMown0opgIvwn/rxn0n+AUAAC/GfyMk +BCMkBZMiIyQgIyQhIyQiIyQjkymTKpMrkywjJRryQ2Qd4AIFANEPAADaIFj0CfpA6BWv/l4A2iBY +9AbaIFjz+oonY/9YAI4iZOBTBQ9HaPJowCDRDwAuwoDr5gEmaAsAAJ2jKcKAmaIowoLrxoAkQAUA +ACjGgiMkBCMkBZMiIyQgIyQhIyQiIyQjkymTKpMrkywjJRryQ2Qd4AIFANEPKyAH2iD6IAAF8AwF +APtjABXgDQUAWHudY/+QH9oQnxSOINog/bRaBeAMFQDtFgYvdgKAAOzuAgDYQQAA7hYFKugEgABY +eqfAINEPbBAEiCJlgJ8mIAcX2fEGBkHqMgUrRwKAAKeIK4KeJKwf+bPQBeREHQB0s38ogp0Jawor +ssMLiAHthAAEA8GAABzZ8wwAh21JAggCYYg0HtnzntApIgAc2fTq1gMm2EEAAOzWAizOAoAA6UkC +AeCBAADp1gEpUASAAAuAAAxoEfcAAER39QEA5IadJ5R1AACKJ/oBQh3gDAUA+0QAFaANpQBYbp7S +oNEPwCDRD//+IA2gCAUA6iQACmgEgAD6wwAV4AwFAFh7XsAg0Q8AbBAEhycqeRQf2c744qQV780F +AOhyCCVQBwAA7HILJVKBAADqk3dz2IEAAA27AauZ6MF0dMkBAAAujQHqdRQnUoEAAOqTcXwwBIAA +eaF9mnjvAAULOASAAAcCYQcCYQcCYQcCYQcCYQcCYQcCYQcCYQcCYQcCYRfZs5dghSCTZZRk87Oi +BaAHpQDiZgIqrgKAAAdVAuVmASsQBIAA0Q/AINEPAAAAAAAA94BoHaAIBQD44WYVr/5yAAiaDAq6 +DCqtASqs4PrhBhWv/iIALLxA/OEGFa/99gAAbBAEx48IWAMIOAIISAOoaOgiCAuBCoAAAiIYojLR +DwBsEAQEOAMIWAOoaOgiCAuBCoAAAiIYojLRDwAAbBAEBDgDCFgBCEgDqGjoIggLgQqAAAIiGKIy +0Q8AAABsEAQFSAMIOAEIWAOoaOgiCAuBCoAAAiIYojLRDwAAAGwQBBPZnQMiAtEPAGwQDiMiECgw +BSkKknmJGykiEv8ioAMQhgUA5dmVFOA2gABwlwoqMG5ooRnAINEPAOvZkRS92IAAC5sB+kJGFeAC +BQDRDyMiGB7ZjI06jCIkCgH/pgAOsL1RAO02CiYG0YAAAioCWPM1GNmFLzIRCP8CLzYRiSJkkMkY +2VqYFI4g2iDv2X8Q2EEAAO8WBi92AoAA9cYADzAMFQD+IKYVoA0lAFh58sAg0Q8Ajj6ENxvZb+RC +DidwBQAA6+sCAODBAAD+YcYVr/31APwhphXomx0A6cQCKVAEgAD7gGYd6JkdAPmAJh3omR0A6cQA +INiBAABY8aMoIhIPAgAFiALmiAIJ0ASAAOgmEiJYCwAAWP0z/CQAFaANNQD+AAIdoA8FAOnZWR1Y +BIAA6RYAKVAEgABZvSbAINEPANogWNxGZa8zY/7nKyAH2iD6IAAF8AwFAPtjABXgDQUAWHquY/8a +AABsEAQlMQ3TD9MPDFUR6iQACtgEgABYPGzrpAAFAjmAABjZGCoxDQgAh+i0AAUAaYAAbakCCAJh +KjENbakFBACGCwJh2iD8oGgdoAsFAFg8IikiEir6fwqZAfhCRhXgAgUA0Q/HL9EPAGwQCCMiGBnZ +LigyEQmIAug2ESlQBIAAWPMfJCAH2iD0IAACMAuFAO0UAApgBIAAWHs17KQABQoRgAAZ2RSIIOmI +AgnQBIAA+YAGFaAbpQBZvYEd2Q+MPuoSACpfAoAArbvqtgAmAHmAAOsyEClQBIAAC8AAiifkoA5l +eMEAAI6s/8AHLWIAnQDxRmAN4AQFACSlFPtEABXvzAUADLsB6KIMJdkBAACbqeumCCVIwQAA+QAF +RWIAnQAc2M/9sewF7/71AJ6g5CYHJVghAAD7oAYjogCdAC3CfRnY8JvRmaMown2Yoi/Cf+vGfSf4 +BQAAL8Z/lC6ULyQmECQmESQmEiQmEyQmFCQmFSQmFiQmFyQmGCQmGSQmGiQmHCQmHSQmHiQmHyQk +BCQkBZQiJCQgJCQhJCQiJCQjlCmUKpQrlCwkJRokJRv6YGgdoAsFAPwAAh2gDSUAWPZVwCDRD9og +WPKF+kDoFa/9TgDaIFjygtogWPJ1iidj/w8Y2MsvMhGOIgj/Au82EScBmYAABQlHaJJDwCDRDyjC +gOuGASZ4CwAAn6MuwoCeoi3CguvGgCboBQAA/ZBGFe/88gArIAfaIPogAAXwDAUA+2MAFeANBQBY +eh9j/7Uf2JGfFI4g2iD9sXIF4AwVAO0WBi92AoAA7O4CANhBAADuFgUq6ASAAFh5KcAg0Q8AAABs +EAYZ2ISZEIgg/IBoHeAMFQDjFgIsRgKAAOyIAglQBIAA6BYBKNgEgABYeRzRDwBsEAwrIhgrsgcr +sg4qIhAosCItsCEssCAusBwjsB3vsB4uZgKAAO3MAg92AoAAA+4CLbAA47AfL3YCgAAP7gLvsCMu +ZgKAAOjMAg92AoAA4+4CDmYCgAAPzAL/jwAMNd0BAP0EQCBQM/UAL6ISfvEID+gMZoACLqYSLqIT +fOEIDskMZpACLKYT/azABlAqNQD7oAysICxFAP2gDgQgLmUA/6APbCA/JQD/oBFsYgCdAHPREMCi +/bDsBaA7BQBZu3XHL9EPKLAYKbAZ6rAaLEYCgAAJiALpsBssRgKAAAqIAgiIEQmIArGI+ELGFaAC +BQDRDyMiEGQwcSmwECqwES2wGuywEizOAoAACpkC6rATLM4CgAAMmQLssBkszgKAAAqZAuqwGCSF +KQAACKoRDKoC7LAbLVYCgAANqgIIqhEMqgKxquomFiSEpQAAKSIS69hRFMAogAALmwErJhIsMAUt +CpX9gAsUYgCdAMAg0Q8AACywFC2wFe6wFi5mAoAADcwC7bAXLmYCgAAOzAIIzBENzAL9lqAAUIUF +AC0iEoQ35EIOJuMegAD8JIAV6OwdAP+gRh2v//UA7xYIKVAEgAD9oGYdqM4dAP2gJh2ozB0A7NQA +JcghAADpBgAAwGEAAOiDHgDYQQAAWPBmKCIS5YgCAlgLAADoJhIpUASAAFj79/wiABWgDTUA/gAC +HaAPBQDp2B0dWASAAOkWAClQBIAAWbvqY/81AAAAKrAYLLAZ7bAaLVYCgAAMqgLssBstVgKAAA2q +AgiqEQyqArGq6iYWKVAEgABY4JjAINEPLLAYLbAZ7rAaLmYCgAANzALtsBsuZgKAAA7MAgjMEQ3M +ArHM7CYWKVAEgABY4CnAINEPAAAtsBgusBnvsBou7gKAAA7dAu6wGy7uAoAAD90CCN0RDt0Csd3t +JhYpUASAAFjgT8Ag0Q8AAAAA+mBoHaALZQBY++3AINEPAAAusBgvsBnosBovdgKAAA/uAu+wGy92 +AoAACO4CCO4RD+4Cse7uJhYpUASAAFjfxsAg0Q9sEAgoIAQkIhj3r7AFoBmFAHmBA8Ag0Q+KSv9e +wAzQi+UAL0B4e/HrLCAFGNfY7tfYFn8RgAAlIhIpIhMrMQsIVQElJhKNOauZfeg3LiIRKSYT8qAF +3lIAnQBk4OaK7HynsYjr+8BoHaALBQD8AAIdoA0lAAuAAMCQ6SYRLJAEgADRDwD9r4gFoAolAP5A +CBWgOwUAWbq8KSIQKZAFKgqV+z/7hCIAnQCKSvNf+zTSAJ0AIyIYjTqMIsBB96YADrC9UQDtNgom +BImAANogWPFYH9eoLjIRD+4CLjYRiCJkgIId132dFIkg2iDs16IQ2EEAAOwWBizOAoAA9SYADLAN +JQD4IKYV4AwVAFh4FcAg0Q8c16GN4P/AsBWgClUA9CAGFeA7BQBZupguIhLAkPhCJhXvv/UAD+4B +7iYSLJAEgADRDwDaIFv+62WvSsCQ6SYRLJAEgADRD9ogWNp7Za97Y/6wACsgB9og+iAABfAMBQD7 +YwAV4A0FAFh442P/YQBsEAooIAQqIhgpChjpgQh9OASAAMAg0Q+Lqv9+wAzQjeUALKB4fcHrLSAF +Htd879d8Fv8RgAArIhKaGA67AismEvNgJqNSAJ0AjiyINiUwIPphRBWv9MUA/wALDSVlAQAKCk4q +rNv1QAQFMIS1APWAFFQiAJ0AD7sC+8AARLA8FQD4QYYV4CQlAPpCRhXgKhUA+sJGDaAvVQB/YQp8 +YQf0wCsNIgCdAC4wMCgwMSkgaOowMi92AoAACO4C6DAzL3YCgAAK7gLo7hEEyBkAAOjuAgyCCoAA +9EZEFaGenQD1ICNXUAwFAP0wABQ1rgEACKoCGddMnRmbFomTG9dK5RYHKm5CgAAEmSzost0kg3GA +AJcVJbL8K7L0qojlUhQsRkKAAPlgAEWwDxUAbZlMKVEEh1D/IAAUtYodAOl3CAxHgoAACHcMJ33/ +9ufoFeSaAQAAkQQA+BrodwEMggqAAP2AIBWhd50A6koIA4BxgACIunKJBIm+fpF7q9v9rlYFoAol +APxACBXgOwUAWbofKiAFKyIYmxWaGRzXJY8ViBmJII7w7/B4K2gEgAD4IAYV4AolAPggJhWgOwUA +WboTKCIQKIAFKQqV+R/yVGIAnQCJGIma8z/x9NIAnQD6QGgdoAsFAPwAAh2gDSUAWGhOwCDRDwAA +AO8SCCX8+YAAL/B4LbAF+kImFeCKtQD74BpFIJilAPmgGgQgmbUA+aAZxGIAnQAqCpb7oBlsIgCd +ACwKmf2gIJUiAJ0AwtH8wAgEYA6FAML1/sAHtGIAnQAoMEEsMEAtMDwpMD3vMD4uZgKAAOjMAg7u +AoAACd0CKDA/6TBCLu4CgAAP3QLvMEMuZgKAAOnMAg7uAoAA6N0CDmYCgAAPzAINyAzqIhAkBIuA +AC+iEn3xCA/YDGaAAi2mEi2iE3zRCA3JDGaQAiymE4y8DswC/WGGFaAqVQD6wAR0IgCdAMPR/MAJ +9GIAnQDC4f7AEBQiAJ0AwvL+wB1EYgCdACgQEGSNHWADFQAAAPgAYh3jy+EA/T/rdiIAnQApMCQs +MCXoMCYszgKAAAyZAuwwJyzOAoAACJkCCJkR7JkCBUARAAD5DQANf/T+AAAAAC0wI8DxDf05LbRB +LLBB/CIGHaAqVQD63/elIgCdACgwIfEf+3/SAJ0AKDBBLDBALTA8KTA97zA+LmYCgADozAIO7gKA +AAndAigwP+kwQi7uAoAAD90C7zBDLmYCgADpzAIO7gKAAOjdAg5mAoAAD8wCDckM6iIQJISLgAAv +ohJ98QgP2AxmgAItphItohN80QgNyQxmkAIsphMtMDgvMDmMvOgwOi7uAoAAD90C7zA7Lu4CgAAI +3QLq1o4e7gKAAA/dAu7MAgboBQAALSYWnLz7YWYVr/t6AC4wJC8wJSwwIegwJi92AoAAD+4C7zAn +L3YCgAAI7gII7hEP7gLxgBVGEgCdAC8wTCgwTekwTi/+AoAACP8C6DBPL/4CgAAJ/wII/xHo/wIP +Ex4AACoiEOqiGCeS8YAA/0ASs+IAnQAvthItMEgoMEnpMEou7gKAAAjdAugwSy7uAoAACd0C7tZm +Hu4CgAAI3QItthQoMDYsMDQqMDX8ZvAV4AkFAOm2FS5mAoAACswC6bYTLmYCgAAIzALutgsuZgKA +AA3MAv1hphWv+EIALzA4KDA56TA6L/4CgAAI/wLoMDsv/gKAAAn/Agj/EQj/Au7WTBf4BQAALyYW +/2FmFa/3bgAqIhHTD2ShRYqnK6EeKAqQ+WAH6qIAnQAtCmD/egAVoAolAP2sgAWgOwUAWbkwY/xy +AAD/7oQNr/r1AAAAHNY66RIGLvAEgAD9YAgV4ApVAPggBhXgOwUAWbklLSIS+kIIFaBOBQAO3QIt +JhIuMEErMEAsMDwvMD3tMD4t3gKAAO67Ag5mAoAAD8wCLjA/7zBCLmYCgAANzALtMEMt3gKAAO+7 +Ag5mAoAA7swCDd4CgAANuwIMvQz3v9IAEgCdAC2iEnzRCA3PDGbwAiymEiyiE/uf0TRiAJ0ADLgM +Zoob+0JmFeACBQDRDwAA+iEIFeAJBQApJhEqsgcpPCD7QcgVoAw1AG3KBQkAhgoCYcAg0Q+JrtMP ++SYAFeAMZQAqPCBtyQUKIIYJAmPAINEPHNX/6BIHL3gEgAD/YAgVoAolAPggBhWgOwUAWbjpY/tV +ihgsMQuKp7/M+0PEFevMIQAMzREp3DD5f/WT4gCdAImu5c+qZMjBAABj+YAALDA4LTA57jA6LmYC +gAANzALtMDsuZgKAAA7MAgjMEQ3MAurV5BZgBQAALCYW+2FmFa/9KgAqIhAqohjDsPogBhWn3B0A +/au4BaAKJQBZuMlj+tUvMEwoME0qIhDpME4v/gKAAAj/AugwTy/+AoAACf8C6qIYL/4CgAD55gAP +v/72AAAAbBAEiScrmRTqkgklgEmAAMihWPgu0Q8AbBAEiCIjIAfxAKAN4TMBAMAg0Q8AAIknKJkU +9yHIFaelAQDkkgkkCemAABfVbBXVbvlACdFSAJ0A9GAGOhIAnQAMORGlmSuSngc8CizCw/dgCYpS +AJ0AK5KdDLsBZLDWKSBA9SAIKJCKJQD1IARpEgCdAPWgBCqQCgUA3UD+gQQV4AwVAPpAaB2n6gEA +WHbRJPqXJvpo7iISKZ8CgAD0YABB8A9FAO82nSEZIQAA88dGDeAFBQAqIhKmqyyyJyS0fS6yJp7A +LbImnNEltiblticlU4EAAFm5rSkiEsCB8y8ADPAPBQAJjzhk/8nkJAUpUASAAFm5pcAg0Q8A+sBQ +Fa/97gAc1TiKyGqhfww5EaWZK5KeBz0K7dLDKAQKgAD3YAQaUgCdACuSnQ27AWSwd7CunshlvyiI +QOs8GClQBIAA/6ruBeeIwQD4SAYdoAwVAP6ABhXgDUUAWHa/wCDRDwAAAAD/+wwNoAQFAGP/Cykg +QAiZEPiABhXv+wIAAAAAAAAAAP/7VA2gCwUAwKBZtcoc1RSKyPlf+5CSAJ0A//5IDaALBQDAsMDa +Da00/YEGFe/+DgAAAABsEAaIIiwgB/EAgA3hzAEAwCDRD4knLZkUBQ5H5pIJJoShgAD5wAZpUgCd +AC8gQRvU/eTU/x4YBIAA8exsDeAFRQD2AAId4A0FAOzKEQYluQAApKooop4Lzgou4sP1AAlb4gCd +ACqinQ6qAdug7BYAJQaBgAAvIEFl8PIHDkfvYQgraASAAPpAaB2gDBUAWHZjDDkRpJn1M6YV75h1 +AOgkBSlQBIAAWblLwCDRDwAAAAAAAAD//bANoAYFAB/U3I7498AGeJIAnQAMOhGkqiiinvUAB0Pi +AJ0AKqKdCzgKKILDCKoB5KDWZ0v9AAD54QYV7/3qACogQAiqEPrABhWv/LYAAI+eLfAEJ/AFHtUY +5fAGLu4CgAAH3QLv8Acu7gKAAAXdAgjdEQ/dAg7dASXcZ/SOAArwh5UA9KCAFe/8NgCNYIsQ7NUK +GVAEgAD7YwAV593BAO0kQCroBIAA/MAGFaAMFQBYdk7AINEPAAAs3Ejr3GcpcASAAP7AaB3kux0A +WbhE+0BoHe/7zgD/+2wNoAoFAJ0R/CAGFaAKBQBZtVgf1KKMEI74jREb1J753/jAkgCdAP/6yA2g +CgUAwKDAigjoNPnhBhWv+o4AbBAEiCIjIAfxAIAN4TMBAMAg0Q+JJyiZFOaSCSQHGYAA9akaBeeV +AQD5IAbZUgCdAOTUjBGlmQAADDkRpJkqkp4FPAoswsP3QAaqUgCdACuSnQy7AWSwfS0gQfGrnA3g +CgUA3WD+wQQV5+oBAPpAaB2gDBUAWHX2DDgR9QAARDAPRQD/E6YV7551AO4kBSlQBIAAWbjdwCDR +DwAX1HGKePdABCCSAJ0ADDkRpJkrkp4FPArswsMoBAqAAPdgBApSAJ0AK5KdDLsB5LB1ZWv9AACd +eGW/gY9g6zwYKVAEgAD/qWQFp//BAP5IBh3gDBUA/sAGFaANRQBYdfbAINEPAP/8dA2gBgUAKCBA +CIgQ+MAGFa/8fgAAAPoRIh2v/R4A//zEDaALBQDAoFm1Aop4+V/7qJIAnQD//mANoAsFAADAsMCa +Cak0+OEGFe/+IgAAbBAEiiooohgogAUpCnN5gSaJJyuZFOySCSWAsYAA2yD+AEIdoI3lAFh0p8Ag +0Q8A//+oDaAMBQCIrxvUiOsmCyF4gQAA/wAGFeAMBQDoJgklSOEAAPhBBhXgDSUA/0HmFe+ehQDu +JAUpWASAAFhytMAg0Q9sEASIIsiHwCDRDwAAAAAAiTckIAcqmRT1qEQF4UQBAO2SCSUFQYAA6tQb +Gk8CgAClmSuSngpMCuzCwygECoAA92AEglIAnQArkp0MuwFksIL6QGgdoAxVAP5hBBXgjuUAWHWK ++GEIFeAPBQDoMgkqdwKAAPXAAEdwDUUA7eadJICBgACfO5mAijiYoZ84nzmLPCQwRf9lYAffnLUA +LDQFjS4uLDj/v/r1IgCdAPif+rDSAJ0A+kIIFaALNQBY+DHAINEP2jBZuF9j/9P//WANoA0FAOtM +GClQBIAA/AAiHaANRQBYdYrAINEPAGwQBCkwE/EhIA3g9YUA9SAGeJIAnQDAINEPAACEJ4gwKjAR +hE7iPBgkLXyAAPoAAh3gTAUA6kQEIigPAADoMBIiqLEAAOhEBSrQBIAAWbGRJE0D9I2AFaALBQD6 +gGgdoQwFAFmxjNpQ7DARKVgEgABY99PaQOwwEiHZYQAAWPfQwCDRDwAAAAD8HAIdoAsFAOpEAiIw +CwAA6DASIzMxAADoRAMrUASAAFmxeiRNA/SVgBWgCwUA+oBoHaCMBQBZsXXaYOwwESlYBIAAWPe9 +pTvsMBIqUASAAFj3ucAg0Q8AAIQnhE7AsOowESJIFwAA+yxGHaDsBQDoMBIiOBMAAOiUYyvQBIAA +WbFjJk0F9twAFaALBQD6wGgdoIwFAFmxXdpw7DARIdhhAABY96WlO+wwEitQBIAAWPei6iQAClgE +gABY+RDAINEPAAAAbBAEF9ObFtPrJ3LDJmKJpHcJdxGnZoRt8kBgJaiDHQDwgoAN58TBACwkUott +CwtfKyRTim0KihQqJFSJbSkkVSgkViMkV9EPAAAAAPJK5h3ogx0A+ErGHaBFBQD0SkYd4A8FAP5K +Zh3gLoUA/kqGHa/9hQAtJFXRDwAAAGwQBogi8QFwDec1AQDaIFjtXYkiy5VoMk7AINEPAAAA6iIQ +KVgEgABY1vFoMmmKJ4ys+0YAFaALBQDqzQwGYyEAAA3LOVh0ONKg0Q8AKyAH2iD6IAAF8AwFAPtj +ABXgDQUAWHT+aTKwH9NxnxCOINog/adkBeAMFQDtFgIvdgKAAOzuAgjYBIAA7hYBKugEgABYdAjA +INEPwCDRD2wQNok1hTD3p04FoAQFAPenTAXgCIUA+QiyDeJVCQDbMPomABWhXAUAWbD2+iYAFeAY +ZQDotBEqUASAAFj3UpYQ/CYAFaANJQD7QGgd4A4FAPpAaB2gDxUAWbdHwCDRDykwEGiRT/UgBhES +AJ0AaJQGwCDRDwAAAIg2JHKLCYgRqEQkFmCESoRJ61QAClAEgABY+ifpEmAtfD4AACmQBSoKlXqZ +y/osCBWgCyUAWPdhwCDRDwAAKjITWPoj5KQACtgEgABY+hplr1TaMFj5hWSvnouni74sso782QAH +MA11AP+gBw4iAJ0A/ABiHejsuQD/oAaOIgCdABjTF/1gQCWgDgUALsQRKIK/K3KL+KAARDANJQDm +FgAsRkKAAPlgAEWwDwUAWbcUwCDRDxTTX4c2JEKLCXcRp0QkFmCESodIhEnrVAAKUASAAFj5+WWu +zioSYIqniq4pooDHuAuZASmmgIswCxtCD7sRC5kCKaaAKDIAEtMH/wIAB9ADFQArEmArsAUsCpJ8 +sUOMcmTApNpwWOzVjXJk0KqSGI5w2nDv00AQ2IEAAO8WCi92AoAA88YAD3AMFQD+ISYVoA0lAFhz +lsAg0Q9Y+FbAINEPAGR+nyRyGBrTFIlKiHL7JgAMsLlRAOlGCiQDwYAA2nBY7L4c0w4rQhEMuwIr +RhGNcmTQapIUjnDacO/TCRDYQQAA7xYGL3YCgADzxgAPcAwVAP4gphWgDSUAWHN8wCDRDwAAAAAA +AOpyECvYBIAAWNZFwCDRDwArcAfacPogAAXwDAUA+2MAFeANBQBYdFlj/znacFjV52WvlGP+BgAA +K3AH2nD6IAAF8AwFAPtjABXgDQUAWHRPY/95AGwQBIguIyw4c4EtKSISep8yiy6Is+okAApgBIAA +67zgKugEgAALgACMIu0gBS4AXgAAyNOOLnPp18Ag0Q8AAAAAAAAA/EAIFeAKVQD9pewFoDsFAFm1 +2MAg0Q8AbBAYJRYZlB4rIAcjFh6HNegyBCn4BIAA/+HkFeADFQDyIgYV4bsBAPojBhXgyFEALBYa +/CPIFaDYWQD8I6YV4L95ACsWFSrAAP+DsBWj9vUA/YekFeB3+QD8ImYV7DgdAP4gBh2ge3UA7MIf +JFRCgAAPCEn4IeYVoAAeAACWHxnS0ygSGfwiJhWgDwUA+S/kFeAEBQD7QBG8Z4gBAC8WFAk5DPgi +5hWvmQEAKRYW9QBIMRIAnQCKIvtAVGCSAJ0A8OcQDeAOBQDuFhIjgFGAAAM6AlkCbsBQ8oVADeAG +BQAtEh4t0IMNXUIvEh0rEhr+AGIdoAwlAO/sOQvQBIAAWQJNpqbwgQAN4Ar1ACkSHimSKihsMAmG +OXagbPQhphWkth0A4xYMJdgFAAD6I2YV4AGaAAAALBIT0w8PAgD7gEYYEgCdAC0SHg8CAI3V8b/7 +u1IAnQDrEhMp0ASAAPwiKBWgDhUA7hYSKOgEgABZAnn7QE3gUgCdAP4AYh3gBQUACvU6ZFGhw2CU +HfIhhhXkhh0AKBYbKRIYHtIyHNIz49IzHKAEgAD1IAniEgCdAOsSGyy3AoAAo2YqYp77QFJL4gCd +ACZinQ6YCiiCwwhmAQZrAu/CCC2wBIAA+2BOYBIAnQArFgX34E7QkgCdACkyrhrSePsgTEgSAJ0A +LjKtLaJe7esBB9P9AAD9wEuuYgCdAJrI/cBL1mIAnQCNHiwgFK3MDAxHLCQU9YBNZlIAnQAuEh3I +6ykSFsCD+QBOqOIAnQBkUPIqEhoPAgDIoWRQY+tkAAlQBIAA/ABiHaAdhQBZAmruEg8teASAAOYS +DCK52YAAHNJYLRIV+aQgBeAKBQCa8przmvSa9elpAg9EAoAA6fYALuiCgADo3QIK9sKAAP+mAA6w +G8UA/eAmFeAKVQBZtSorEhf5YEkpUgCdAMAg7BIbKm8CgACj3SzWndEPLhIeLuCD/kUABzAEFQD+ +IoYVr/b6AI/I9+BKIJIAnQDpEhsqNwKAAKNmKGKe+QBKe+IAnQArYp0OTQot0sMNuwHWsPtgSggS +AJ0AsP6eyPrAaB3v+r4AAPybTA3gNgUA//bUDaANBQAvEhJk8HbrEgUpUASAAPwAYh2gHYUAWQIv +GdIhFtIfjhwoEAAmYqAJ7gIZ0fQIHxTmhgsP+wKAAOn/AgR8nIAALBIR7RITI1v/AAAosj8rsX2e +oJ+hnaKco5uk+UCmFaAAbgAsEhEtEhMrYQWIY56gn6GbopijnaScpSasGC0SFYwfAt0Q7RYILmQC +gADsFgkrsD4AAC4SHRjRu/4hiBXgCgUA6hYGL3GCgACeFwj/Av4hRhXgDyUAnxvrZAAJUASAAPwA +Yh2gHYUAWQICix0vEh6JFuYSHiWRQYAAJmCD7/IFJJF5gACIHQZOQOSCGG9zAoAAKBIeKICCCAZA +CmYQjBcG7QL9hgAOcN+hAPOoABawj5EA/YYADnDfiQDjiBAO6IKAAPmmAA6wj5kABIgQCMwCKBIe +ixoNzAKIhPtABhXj/fUAnaKcpRzR1/1AZhWpiAEAmKQY0dOYoS4SC+mcASUwYQAA6RYGJ3P9AADu +FgsvekYAAC8SFPXgLPiSAJ0A9eAtsRIAnQD14C5xkgCdAPXgLzISAJ0A9eAv8pIAnQD14DCzEgCd +APXgMXOSAJ0Ajh3TD2TgTy8SHi/yKmTwRutkAAlQBIAA/ABiHaAdhQBZAcAoEh4b0bWMGvkFSBWj +/fUAnaL9QAYVrAkFAJmj+0AmFemYsQDppgQsRYKAAOimBSUwYQAA62QACVAEgAD8AGIdoB2FAFkB +rh3RpY8YjBn2IUgVoAkFAJkRmRKZE5kUmaT5QKYV7/v1AJuim6OWoO/MAgr2woAADswC7hIeJTBh +AADtzAIA2CEAAOymASDoQQAA6hwEIOAxAABY/8j5QGgd4AgVAOqJOQ0oBIAA6RYhJSM5gAAkFiL6 +ACId4AoFAAm6OOUWIyVjmYAAE9GFjRmEHBjRVR/RhOUSHSongoAA+IYACjYMBQD4IQgVoAoVAOWl +OQrwwoAABfw5+cYADzAJNQD9xgAO8AglAAWYOSgWIA7OAi4WHP2GAA5wBQUA/CPmFaAEfgAAAAAA +AAD/92wNoAYFAMDg//fIDaAGBQCIHfwjyBXkDAUA9mAABzK2KQDxCwAN4AYFAC3SKu3GOQ3bgoAA +LBAA/2AABHDfyQDr3RAOYgKAAOzuAgxFAoAA+cYADzDPwQD1kAAWMI95AP2GAA5w36kA/0CmFaDv +sQDg7hEO68KAAP+mAA6w74EA7IgRD3ZCgAD/BgAMMe9pAATuEf8GAAww77kA7YgCD3JCgAAOvgIM +iAKNGp2gHNETnKEI7gL+xgAPMAglAAjuAp6kGNE+mKIe0T3/QGYVr/YuAAAAAAD6AAId4AYFAP/9 +TA2gDgUAAAAAAAAAmaGUoJ6inqOepJ6lnaadp52onakvEiDlXAElMKEAAP6gEZxiAJ0A62QACVAE +gAD8AIIdoC2FAFkBK+RQUWrOwoAA9KAKYJIAnQArEh/H7/smAAzwDQUA45kCC/0uAACNEywSHo4S +jxGLzCzCEJmhm6n1QAYVoAgFAJiimKafo56knaecpYwU/UEGFa/+JgAtEh0sEhwb0RAMmQLrmQIG +hBmAAPDiQA3v/vUAmaGUoJ6inqOepP9AphWgDQUAnaadp52o/UEmFe/9NgAvEh4iFiUr8hYm8Tgi +8Tos8hXo8TkrNAKAAAYiAibxOy3yG+7yGixEAoAACGYCKPIXL/IZn6Keo52knKabp5iolqWZoZSg +kqnyJKgVr/v2AAAAAAAAAADw4kAN7/v1AJmhlKCbopujm6T7QKYV4AgFAJimmKeYqPlBJhWv+zoA +LBIejRIvwTsmwTkowTguwTrrwhgrNAKAAOb/AgxEAoAACO4CJsIUiMwswhCbpJinlqiZoZ2ilKCc +o5+lnqmMFP1AxhWv+hoAKxId7BIcJYNRgAAb0M7H7/0mAAywDQUA65kCA4DxgACZoZSgnqKeo56k +nqWdpp2nnaj9QSYV7/kyAC4SHiIWJS3iEiziEyviGIjthu4v4hSC7y7iEZ6inaOcpJulmKaWp5+p +maGUoJKo8iSoFa/4VgArEh/H3/smAAzwDAUA45kCA4DxgACZoZSgnaKdo52knaWcppynnKj9QSYV +r/eaAJmhlKCOE/4gKBXgCAUAmKKYo5ikmKaYp5ion6X/QSYVr/cKACoSHhnQoIqlE9A6JRIj5BIi +JUwwgADj0DYTg+GAABzQmoscDLsC+z9GFe/ifgAlEhDA0vetAAr/4wIAAMCl/aEmBaAbxQDuPhEJ +6ASAAFmzZGP25foiyBWgDgUAnhGeEp4TnhRY/rQkFiLlFiMlX2GAAPoiyBWgCwUAWP6nJBYi9CRm +Fe/vWgAvEhH7/7nQkgCdAGP2tRrQV4gcCogC+T9GFa/gngAAwKBZdkbIpxvQeCuwfWSxLCoSFlj+ +n+kSIS1cHgAA+iLIFaALFQBY/pL4JCgV7+3CANxg6hIMKVgEgAD8I8gV4A4VAFj/RPdAaB2v6fIA +AADcYOoSDClYBIAA/CPIFeAONQBY/zz3QGgdr+l2AAAAANxg6hIMKVgEgAD8I8gV4A51AFj/NPdA +aB2v6PYAAAAA3GDqEgwpWASAAPwjyBXgDrUAWP8s90BoHa/odgAAAADcYOoSDClYBIAA/CPIFeAO +xQBY/yT3QGgdr+f2AAAAANxg6hIMKVgEgAD8I8gV4A7VAFj/HPdAaB2v53YAAAAA3GDqEgwpWASA +APwjyBXgDvUAWP8U90BoHa/m9gDrEhMp0ASAAOwSESjoBIAAWP/iY/YxAAArEh6MHu0SGSlQBIAA +WGro0qDRDwAAAAD7oFgFoUsVAFmdeSwaAAysAvugTgWhSxUAWZ15Y/6zAMCwwNoN/TSdyPt/tHCS +AJ0A+kBoHaAbxQD8AAIdoA0VAFhxTmP/oAAAACsSGPpAaB2gDAUA7RIbJdhhAABYcUdj/4TAoFmw +XRzPqI/I+f+w4JIAnQBj/7jaIFvptWP2T4onjR7AwOqsIC7YBIAAWGRy0qDrEhsqZwKAAKPMK8ad +0Q8AAAAAAAD/1wwNoAYFAAAAAN2Q/Z/+BaAKRQD6AwId4A5FAFmyzf/YZA2gBUUAwKBZsEIcz4yP +yB7Pifn/tXiSAJ0A/9tYDaAGBQAAAAD/2vQNoAsFAMDaDf00/YEGFe/a+gAAAABsEAQUz+uCICRC +fxPP6gQiDAMiAtEPAABsEA4kIhTbIOwUAApQBIAAWQ9R1aD1QAgUIgCdABjPgugABQDIQQAACQJh +CQJhCQJhCQJhH8/cHs/cHc/ZjCCdFv4hRhWgCEUA7xYELmYCgAAIyAKYFS9QBy0RAPufqAWh/wEA +48wCD/wCgAAP3QIO3QKdGCkgPfwh5hWgCyUAmx0KmQLpFgwoBAqAAPRgBVGSAJ0AiUcomRTkgJNk +8IEAAIuZjOD/+AId4CSFAO/vAQWCOYAAbQgue8E8KLAALbAHdIEzKuEF76kIDu8CgADtuwgEyQEA +AOm7FX3oBIAA69QABoCpgABj/8oAAAAAAAD7bwAOv/+uAPuPAAxwCQUACJs4ZbBE6xwQKtAEgAD8 +AIIdoA0lAFgfDtEPGs+lKUEp+z/3xSIAnQBj/+wAAAAA//28DaALBQAAACocSvpHwBXgDGUAWazW +Y/9IwnaKuAqNV3fRYirhBa+m5rp6dekBAADr1AAGgZGAAHvBKiiwANMP0w90gSAtsAcPAgAM3RHt +uwgDSQEAAOm7JH3oBIAA69QADv62AAD7jwAM8AgFAAmLOGS/X2P/owAAAAAAAAD7bwAOv/9yAC0g +PQoIQ3jZkymwL2iTjYogCKoRCjoCmrvRDwAAAAAA+68ADr/+GgBsEAYoIAUsIAfBlA8CAPkAEHVh +zAEAKSICZZHDLTABG8745s76HjgEgAD/oUAG0A+lAC4hKGXiV+7O9B5PAoAA9YAK8hIAnQCmmSiS +npwQC8sK9wARlNIAnQArssMqkp0LqwHrFgEljkmAAIro90AOuJIAnQAoYq7tzuYUC/mAACxirS3S +f+3LAQVD/QAA/YALXmIAnQCY6P2AC2ZiAJ0AKSAUpJkJCUcpJBT1IA110gCdAB7O6hvO4Iwg+CAo +FeAKBQAqtjbuzAIObgKAACy2PP2egAWgDkUADt0C7bY1LOgEgADsDx4OUASAAA0CZwxAhg0CZQwg +hg0CYwwAhu0MAAThAQAACuCGHs8zDAJvCsCGDAJtCqCGDAJrCoCGDAJpKiAHKDABLCEJLSEk+CAA +BDCqEQDqqhAMRAKAAAqIAioxAQjdAg7dAhjPJC4hIi2WII0gLJYjKpYkCO4CLpYi/aAAFrAOJQAO +3QItliHsMgMl0HsAAOyWJSTIBwAA6gAVBMphAAAJAIoMfBGmzP+TphXntQEA+WAGiVIAnQDAINEP +iuj3QAfAkgCdAAx5EaaZLZKeC3sKK7LD96AIRNIAnQAtkp0L2wFksPywrZ3o6xYBLfTGAAD8IAYV +oAFWAADqJAAJ2ASAAOxEAAroBIAAWGmp0qDRDwAAAADAsA+pNOnmCC305gAA+kBoHaAbxQD8ACId +oA0VAFhwGGP/wQAA6iQACtgEgABYa1bSoNEPAIsQ+kBoHaAMFQD7YwAV4A2lAFhwDmP/l8CgWa8k +Hs5uiuj5X/D4kA+lAGP/qtogW+h8//k0DaAPpQAAiifrRAAKaASAAPtEABWgDAUAWGM20qDRDwAA +AAD/91wNoAsFAMC4C5sC+kBGFe/9HgAAAAD8IAYVoAoFAFmvDB7OV4rojBAbzlP5X/eYkA+lAP/8 +OA2gCwUAAMCwD600/cEGFe/8AgAAbBAGKCAFJiAH5zQACtgEgAD4AoId4AU1APkAD51hZgEACwhH +aIIUiiIYzkAXzkPkZAAFA8mAAMAg0Q8AKyE9ZbHhiCeDiPsCpBXvzAUA6YILJHCBAAAM7AHsuwgK +fwKAAOwWACXZAQAA8yAN/GIAnQAtiRSj+q/dLYUU+2AN66IAnQDJdclD2TBtSQUHAIYJAmGK4A8C +AA8CAK+q+0AQrGIAnQD7wAYVr/3+AOxqEQMk8QAAB6oIK6KeDwIA92AK2dIAnQAqop0IaworssML +qgFloE/rbBgpUASAAPwAIh2gDTUAWG+wwCDRDwAbzhKJuPcgDKCSAJ0ADEoRB6oILKKe94ANAdIA +nQAqop0ITAoswsMMqgHkoY5k6/0AAC22CGSvrxnOL5mgiCD/nPAF4AsVAOumAixGAoAABYgCmKGI +My/yf/+cNAWoiB0AqP+fo+4AFQVIQQAA/5waBeAIBQCxiOmDHgwP6AAAn6YZzmj5QQYV4BgFAJin +jiAI7hEF7gKeqQxNEafdJdadjiIsIAaJJwvuAuvOXxZgBQAA7CQGJMiBAACIkf0gghXvzAUADJwB +7iYCJENBAADolgEm6MEAAO2VBCZhAQAAfIsiKpEFHc3pqKiYkZ2AjCDrhgIuZgKAAAXMAv0AJhWg +AgUA0Q8dzeGdgIwgG85H64YCLmYCgAAFzAL9ACYVoAIFANEP2iBYaqfSoNEPAAAA//rEDaAKBQBY +ACdj/hcAAPMgaB3gDgUA/wFmFa/3vgDjugwDgbmAAApLFOy8CCvABIAA7Ew2CcgEgADTD23JBQgA +hgkCYYkQqnjrTQwEyQEAAG3ZBQgghgkCY4sQCvwMrLsrvED7wAYV7/aKAMCgWa5fG82pibgYzab5 +P/L4kgCdAP/5/A2gCgUAwKDA2g2dNP1hBhXv+cIAjxAv/ED/wAYV7/WmAAAAbBAGEs2cF84T9ZtK +BaATlQD4UMgVoKYlACoign+nICsign+3GCoihCygCCWgB3bBN4hEwKALgAAFMwxlP9rRDy0ihCki +hyoih/lgAAT7qoEAepkwCuowK0JFw8IMuyirqvqcBhWv/uoALqELLuz4Dg5D7uz8Iuv9AAD/ogAK +v/7OAAAAAAwCAC8ign//xSXQB25bv9xw+gCiHaALBQD+oAAXMP8FAFmwryVc8cpbKApxmBHAoVmm +VfogKBXgCfUACVk2mRAJuwz6ICYV4AoFAFmIhooQClUMZV/XwKFZpkv6DiId4AoFAFmIgGP/ZQAA +bBAGKCAFLyAHwZT5ABTNYf8BAPQgJhWnhQEAmBL1AA+5EgCdAIkiG81U7c1VH6AEgADmzVQckZYA +APXgD0IQB7UA7xYAL9cCgACmqiyingv7Ciuyw/eAFbviAJ0ALKKdC8sB57QABZKJgACO2PfAEviS +AJ0ALGKu6s28FhApgAAvYq0rovPr/AEHQ/0AAPvgD45iAJ0AmNj74A+mYgCdACsgFCkwB6uZCQlH +KSQU9SARtdIAnQAfza2fcIkg/ACCHeAFFQDldgIszgKAAA2ZAplxiDYZzaeMrv+akAWiiB0ACYgB +qMz84GYVoCsFAO4AFQPIQQAACQCKm3cZzTjpdgYh4MEAAOwHHgPAgQAACAJj7uMFA+DBAAAMAmEv +dhCIIOV2EixGAoAADYgCKHYRjDOKrAyMFKyq6nYTI/mBAADuABUD0UEAAAoAiil2Fut2FyHQQQAA +CmCGDwJnCkCGDwJlLTABjzMYzYPxoAUX0ByFAC0gBxXNgPpEhBWg3REA4zEBLuqCgAAI3QItdiCL +ICl2Iix2I/1gABWwDDUADLsC63YhI8gHAADu4wUEykEAAAkCYQkCYS4gByghCfLlJhXgGaUA/uUG +FeALBQDrdiUsRQKAAPkGAAxx7gEA6HYmL3QCgAAOrgIF7gL+5IYVoAm1AOwSAipvAoAApt0p1p35 +gAe5UgCdAMAg0Q8AAAAA//98DaAJhQAuIT1k7gb+IAYV4APuAI7Y98AH4JIAnQAMShGmqiiinvcA +CKPiAJ0ALKKdC0gKKILDCMwB68QABghBgACw6ZnY57QADfB+AAD+IAYV4AFSAOokAAnYBIAA7BIB +KugEgABYZ+XSoNEPAADAwMC6C+s069YILnCmAAD6QGgdoBvFAPwAIh2gDRUAWG5UY//BAADqJAAK +2ASAAFhpktKg0Q8AixD6QGgdoAwVAPtjABXgDbUAWG5KY/+XwKBZrWAdzKqO2Pnf7LiSAJ0AY/+q +AAAA68QACVAEgABb5rX7mjoFr/b+AIonjRHAwOqsIC7YBIAAWGFx0qDRD//1PA2gCwUAAAAAAABb +/vz+IAgV7/QGAP4gBhXgCgUAWa1IHcyTjtiPEBvMj/nf93iSAJ0A//w8DaALBQAAAAD/++ANoAwF +AMDKDOw0/aEGFa/73gAAAABsEArkIgcqUASAAIgi/kDwFa/PBQDlQRUtZwKAAOw8CAIggQAAD0QB +pFTkTEAuWASAAPWAJdKh7gEALbAH7Nz+LbAEgADkgAhm6A0AAMAg0Q8fzHHtFgAlwIEAAJgTHcxs +9QAkmqIAnQDlzGwfIASAAPXAH2ISAJ0ADOsRpbspsp7uFgEmQCEAAPkgJZuiAJ0AK7KdDegKKILD +CLsB57QABaAZgACN+JoU0w/3oCLIkgCdAClSruvM0hSgQYAALlKtL7LzG8xVD+gB6BYCJsv9AAD/ +wB+GYgCdAJm4/8AfxmIAnQAuIBQtYAeu3foghhWn3QEALSQU9aAhbdIAnQAZzMMfzMOOIIg07cxa +Gl8CgADluwgPdgKAAPEABPpQBTUAg2MqISQF7AIoIAcuYQH84EYV4BSFAJRz/OAmFaCIEQDszEUc +QoKAAPkGAAxwBAUA+OAGFaAIJQDsAAUD4EEAAG2KAgwCYS0hCSwgB5R1/uEmFaA4pQDjdggu7QKA +APmmAA6xzAEA7XYGLmQCgAAMqgIPqgKadCkhCQIqAv7AJBWgDAUA5badLN0CgAD5ZgANsA0FAFho +5sAg0Q+IE4iA9YAgFaCJFQD1xgAKN4jBAHmJGZRx78yLFkv9AAD+4AYV4ZkdAPjgRhXgAFIAlHGI +ExnMiJlwiIEIWBSYco82GcyAKCIHFMyAKZIO9QKkFeL/HQAE/wElFgYPmQjvggkkQIEAAPjgZhXv +yQUA6YgBBSAJAADoFgUqJwKAAAT/CAhVCOypCAKpAQAA5fMKdMgJAAAoEgYI/wzqFgQszwKAAASZ +DOSQRG4nAoAA70gIA8hBAACZF/igDsqiAJ0AD1UMBU4U0w9t6QUPAIYJAmGJFQ7PDKdY7IwQJMkB +AABt+QUJIIYMAmOOIAjuERjMVvTgAESwDxUA/yDGFeAMRQAM7AKYlBjMT5yVjGOIjBXMVP+X4gXo +zB0ArIiYlxjMT+8AFQTwgQAA/5icBeAMBQCxzO6DHg4P6AAA/SFGFeAsBQCcm4djhDSMNQhEAe/M +AQvCQoAACEQCBUQClJwoYAkuYAskYAolYAjvzD8fcQKAAOZEEAxDAoAA/QYADDDFMQDuRAIOYcKA *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Nov 19 22:17:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BFF8112C3B0; Mon, 19 Nov 2018 22:17:14 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F8578EC2F; Mon, 19 Nov 2018 22:17:13 +0000 (UTC) (envelope-from ml@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id 01d133f3; Mon, 19 Nov 2018 17:16:08 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=vishwin.info; h=subject :to:cc:references:from:message-id:date:mime-version:in-reply-to :content-type; s=fuccboi12; bh=lywiKk95sysz63rbTeJK1A223VQ7OIVq+ xAg1eDXnHc=; b=R8+HUde7Z4RVUhfZLSLjnwxn6NKUTLSlNY24EIVG87DsDzX7Z HosWUd5KxvjveBqyvYUhum97Pjd3hldGz9dBUMtYbf6j1y59fT2I6MaTKCZXi4+p a6wJGMZHvgPZd9TiVHLf495iZBuJ4gD4bhtyr7qS+4gXeCw7k2SmNn0Gci8D/HiI dzuEmrZ0nmCFrKEii4JJepTX8+rg4YIRhXfSM938NCR3130UINg6L8jflG2gnKpv V6UHq4iYAaFJEIptrKIrJMtVCS9IDvbxvyVOMl97F8kFyTsMn4gL0jXNXMVI0adr enumeNSP5LXmyoqwDXxcxSugg2XafkOnGqHQQ== Received: from [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d] (2001:470:8:6ca:cad7:19ff:fec0:a06d [IPv6:2001:470:8:6ca:cad7:19ff:fec0:a06d]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id 63ac4108 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Mon, 19 Nov 2018 17:16:08 -0500 (EST) Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys To: Konstantin Belousov Cc: Brooks Davis , svn-src-head@freebsd.org, toolchain@freebsd.org, current@freebsd.org References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> <20181103152936.GQ5335@kib.kiev.ua> <20181103234551.GX5335@kib.kiev.ua> <4907b3f9-d1c6-4368-5597-ce3d6be19461@vishwin.info> <20181106025159.GU5335@kib.kiev.ua> From: Charlie Li Openpgp: preference=signencrypt Autocrypt: addr=ml@vishwin.info; prefer-encrypt=mutual; keydata= xsFNBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABzSFDaGFybGllIExp IDx2aXNod2luQHZpc2h3aW4uaW5mbz7CwZEEEwEIADsCGyMFCwkIBwIGFQoJCAsCBBYCAwEC HgECF4AWIQT/f8Kqvlr7jU9sRv6OcHje8gOrbAUCW3uI+wIZAQAKCRCOcHje8gOrbNX8EACT HGo3AsShFj+AaUgD9V6wTMaR2w7ubIqbkn2ZqZZ1xWj3gM6VYRKHflj9LiYqFRO4wBteAq30 Snz6F93IG+u5B1uwlC58HDwCQaROaU5cHQ8UvGPSEv0XXCcYTaC3d5NMoIh/LdutVZz56LTx hWs5NHUCaG6FfGV9QplECRteQr2rMxHZxZ3ppSY9oev/wY3U3VRUGnhM2ZwGrpmjksC1HTBH Fw2XbYdVNCOYjQrTIulaYb3y0ssgsOhvSk9bPHSTsWSCQGJk0uFNXTvIq68GhkhOwAet6//w R2y1whg47r554pBManttODaQnmWmIWBM0bZMJrlNT8T/oXlG9nA0jrjA8LvTThrCAvMSMB0F 2FhStd/I2/Fs7T6Uk1BUpgCvFiDtE8Jt1W2yq2GLtPysGrJXyDaat8IuVUthnNVhoyZb9tZu sI/FFhfh9MkPmZDwCoTUJN2yU8QhxS1iJXfMZ1f06r1TYY9rwb8E/WCBJFbMzJs3VLj/TnHL N09J2zNZgTs7gewLn/2lEV1kOL/FxIDgN7ailcf3kcNdVUxr/pLbx3NZcDkXniPO0dzQpuRw q841wBT3uqdPFJwIl4pf1EYhLj89r2vOGnM2RChl1/t+wSqHhBji3R3uylzE0qbr8O/cgx/5 wlvZJiUhyu0hJ/JoJkF8WEFkesJrTZORGc7BTQRbe4h1ARAA12Xtgcbwk7IdsRi/7sTFKs73 qoFFq+DUWwMbSuIOaWw5J9nZ+ovr9gkXlax+xf335hJ0iItB8LhA7D9wD4wjrmmBjhwK7jYv tghb8BH6MHWEWD5D9xt47CO4o8Vi1m/F4OlKxoDqIhH6n63gNeSNaXzqDpZoUsL62KX+sKKU Udj/X/oz3XwXWCb/rEIgAMMW7QFcuQBJzkHgu69oUSIki4j1mhAMiBbGexfS1dcTfpLAr9eu jDNHOw5r7aI4cA8q7us8YfDLby87hPlSrtTKcxkbawrdFNs6KNrEvggkXhYxGqm4Z0FInixa avloimBf1q7kvVM0AAgsmkdeeS/6Tzbn71WBuEW0VgEcSSBS1dv7DfgmeQeiSmv0Dvx2lZv5 P6M4Q/plSAz7hVXL6EIKltwJUjY8Re7zDbPf7jJlbEgWbLxRhlGh5MwrNXbMt6KygDRcDyOP njxg0+ICXbQyPKiq7jZY2/Q/x8P08xNx8sUKPY+XE6G5QVohQfe3LT9s15KM+1Ur4v3Hhbft HtTW1iT60HkyU9qRCJJC11OgH7wrfiucG3/eQKgBgvsfKDD36rJmsQpkO0/kkp6R+CzLby3X PrrFYJTCr08e5QWKKPdyNvAhuyQj27Lb7EhNxe3hmpV+llx0aaN9t1M+QZ88famMOgIlp7Nh 1uFr/c5WGZUAEQEAAcLBdgQYAQgAIBYhBP9/wqq+WvuNT2xG/o5weN7yA6tsBQJbe4h1AhsM AAoJEI5weN7yA6tsTGcP/2rBIvgeKismZQQn7kJOHwgmqXg/N5ArwPH3eCJmzmNZWUIlOZyl A2KtYhkzZ5G3rsL/BMmMuYRUbPJJUukaJSqFep1E6AWYPC8Seakhu1ZbK8ayBI4KZmP+3PQY S0tKyMlxX+Qt9+S/tcQqS31mMgmcVhVhKi8MrWjY+g7pF+LkBYccHuNiGNIcm8mMPHTIKU72 ARiG3DtHrRg4sf5wqgOi72277jBHdDBGw0Y7rCvMsaGm3G4GsMwj4e47H6PAFOWK7O69muvL o50oMN2rkPi+9AKPi8WcrinstleEGyEIyguRagDQjZP5gX9Xk5vkS6+xMgKt7+k7+D3jWKlW R6G9U0CyKmVJoeNqwHUdLoFD3lywjwT9vo+cqb4gQKnZsA1ss/WOvEp4EaNSR7JHFOY5X8AN QgiPxLhrbI7FPGXKw3Y7nCpcIlzFph6UL9jhNRwvoQ3GfZ0sF0JgpASdrS4N3Fmnt9L6lc3q rIrxDPpDjYwcDEUBl0sp/prjh3gdC3qs9xZ0RNWWdUqcmvRv2SDkrVDw3iQ9WhMZWuQYBmGa MViypa6WrjjlVTjqZftZyqytnHwuo1PA/qLcF/vUUn0QHFPIDx8/yTSqiw/xTwPuOFxznHjJ VbxEEG0H5rmreh1Z0WeMwsSbjC3EEf+ZI39QpFwVIG8pDwXFOClfhjFz Message-ID: Date: Mon, 19 Nov 2018 17:16:02 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181106025159.GU5335@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vmtMwlwk4THG95CLQnsHrbiS5LTit1amN" X-Rspamd-Queue-Id: 4F8578EC2F X-Spamd-Result: default: False [-0.99 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[vishwin.info]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_SPAM_SHORT(0.87)[0.870,0]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; DMARC_NA(0.00)[vishwin.info]; NEURAL_SPAM_MEDIUM(0.04)[0.043,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[vishwin.info:+]; MX_GOOD(-0.01)[gehlot.vishwin.info,varun.vishwin.info]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(0.71)[asn: 14061(3.63), country: US(-0.09)]; ASN(0.00)[asn:14061, ipnet:46.101.80.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 22:17:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vmtMwlwk4THG95CLQnsHrbiS5LTit1amN Content-Type: multipart/mixed; boundary="AAW9oK58HlpIlkasd4eHWPNWUYR3GUWsQ"; protected-headers="v1" From: Charlie Li To: Konstantin Belousov Cc: Brooks Davis , svn-src-head@freebsd.org, toolchain@freebsd.org, current@freebsd.org Message-ID: Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181101160406.GA60233__23941.7825396687$1541088368$gmane$org@spindle.one-eyed-alien.net> <20181103152936.GQ5335@kib.kiev.ua> <20181103234551.GX5335@kib.kiev.ua> <4907b3f9-d1c6-4368-5597-ce3d6be19461@vishwin.info> <20181106025159.GU5335@kib.kiev.ua> In-Reply-To: <20181106025159.GU5335@kib.kiev.ua> --AAW9oK58HlpIlkasd4eHWPNWUYR3GUWsQ Content-Type: text/plain; charset=utf-8 Content-Language: en-GB-large Content-Transfer-Encoding: quoted-printable On 05/11/2018 21:51, Konstantin Belousov wrote: > For you, but not for me. >=20 Turns out I omitted the fact that I have WITH_RETPOLINE enabled, which caused all this. emaste@ reported in PR 233336 and committed r340650. --=20 Charlie Li Can't think of a witty .sigline today=E2=80=A6 (This email address is for mailing list use only; replace local-part with vishwin for off-list communication) --AAW9oK58HlpIlkasd4eHWPNWUYR3GUWsQ-- --vmtMwlwk4THG95CLQnsHrbiS5LTit1amN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAlvzNiYACgkQjnB43vID q2yGeA/+NP7n1qvXgFuxkau76kRubIXLxifPiKzkWeAGhaCBLjnWynp54MeKDUao eocpvlfMGjzZhXko2IbxP15J8cojLPyfK6zAr2wp1xEXgbC7aAt/nib5uRAG3w9y ovbHwtIy+c8jY326USUafVZsdmL3eysMP6OL4EemE1NH+DfC10c5pC/xy7dmFjXX PbjaHwPebON6F6XRSMxfPei2Lcf4hyr2gL1FnoZxUegO2kn4CBYSjveyBQcZOKuM 1iPuYHxvSNA3P5OR8gddVuu8emxHQ6Pns7R025yvUb7wOrqQPRWbL4M+Xr4gOy6c yAsstfqePlFxgzkZ0I1hN+OXMRm4K1kaA6uY1574HhAqMSEGrVsDe0ANP2X8SLjp qbfvMy/9t9KoUtuiIXmZ3LasU/MvWKWGudNp5ZhsMEkZdQZcllibFliJdRsLQT4+ y6glYekSrPj++RlOn2AQBhckfEZRJUufDx1cmqVRu36upg0ppwTk7jXGuEPGA2Q0 oG1EhJENZzvUArbuVhI0PYPeWKQzbX6zKNPBc5gH13/de0avAsVo3E0mDVk8ymzs qQbXMPYj3O22bMc+TaIkwiMnIk7ZzykNYgqTDO3zK7O1neXqeBVzG3RXrpuo7JHh l+yvyI6W3ZzhsNKNpE+KwyJdROr674tAM9/p3s3GiW0jddqsovU= =NVGx -----END PGP SIGNATURE----- --vmtMwlwk4THG95CLQnsHrbiS5LTit1amN-- From owner-svn-src-head@freebsd.org Mon Nov 19 22:18:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E265112C482; Mon, 19 Nov 2018 22:18:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6DA08ED4C; Mon, 19 Nov 2018 22:18:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C82268E; Mon, 19 Nov 2018 22:18:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJMIIu4014398; Mon, 19 Nov 2018 22:18:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJMIIib014397; Mon, 19 Nov 2018 22:18:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811192218.wAJMIIib014397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 19 Nov 2018 22:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340652 - head/rescue/rescue X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/rescue/rescue X-SVN-Commit-Revision: 340652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E6DA08ED4C X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.24)[0.239,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 22:18:19 -0000 Author: emaste Date: Mon Nov 19 22:18:18 2018 New Revision: 340652 URL: https://svnweb.freebsd.org/changeset/base/340652 Log: rescue: set NO_SHARED in Makefile The rescue binary is built statically via the Makefile generated by crunchgen, but that does not trigger other shared/static logic in bsd.prog.mk - in particular disabling retpolineplt with static linking. PR: 233336 Reported by: Charlie Li Sponsored by: The FreeBSD Foundation Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Mon Nov 19 21:59:07 2018 (r340651) +++ head/rescue/rescue/Makefile Mon Nov 19 22:18:18 2018 (r340652) @@ -6,6 +6,7 @@ PACKAGE=rescue MAN= MK_SSP= no +NO_SHARED= yes PROG= rescue BINDIR?=/rescue From owner-svn-src-head@freebsd.org Mon Nov 19 23:54:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA796112F5D4; Mon, 19 Nov 2018 23:54:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E3FC6B1FF; Mon, 19 Nov 2018 23:54:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 362C01108; Mon, 19 Nov 2018 23:54:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJNso8k065342; Mon, 19 Nov 2018 23:54:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJNsnUu065339; Mon, 19 Nov 2018 23:54:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811192354.wAJNsnUu065339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 19 Nov 2018 23:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340653 - in head/sys/powerpc: fpu include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: fpu include powerpc X-SVN-Commit-Revision: 340653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E3FC6B1FF X-Spamd-Result: default: False [0.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.326,0]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 23:54:51 -0000 Author: jhibbits Date: Mon Nov 19 23:54:49 2018 New Revision: 340653 URL: https://svnweb.freebsd.org/changeset/base/340653 Log: powerpc: Sync icache on SIGILL, in case of cache issues The update of jemalloc to 5.1.0 exposed a cache syncing issue on a Freescale e500 base system. There was already code in the FPU emulator to address this, but it was limited to a single static variable, and did not attempt to sync the cache. This pulls that out to the higher level program exception handler, and syncs the cache. If a SIGILL is hit a second time at the same address, it will be treated as a real illegal instruction, and handled accordingly. Modified: head/sys/powerpc/fpu/fpu_emu.c head/sys/powerpc/include/pcb.h head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/fpu/fpu_emu.c ============================================================================== --- head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 22:18:18 2018 (r340652) +++ head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 23:54:49 2018 (r340653) @@ -189,7 +189,6 @@ fpu_emulate(struct trapframe *frame, struct fpu *fpf) { union instr insn; struct fpemu fe; - static int lastill = 0; int sig; /* initialize insn.is_datasize to tell it is *not* initialized */ @@ -243,17 +242,11 @@ fpu_emulate(struct trapframe *frame, struct fpu *fpf) opc_disasm(frame->srr0, insn.i_int); } #endif - /* - * XXXX retry an illegal insn once due to cache issues. - */ - if (lastill == frame->srr0) { - sig = SIGILL; + sig = SIGILL; #ifdef DEBUG - if (fpe_debug & FPE_EX) - kdb_enter(KDB_WHY_UNSET, "illegal instruction"); + if (fpe_debug & FPE_EX) + kdb_enter(KDB_WHY_UNSET, "illegal instruction"); #endif - } - lastill = frame->srr0; break; } Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Mon Nov 19 22:18:18 2018 (r340652) +++ head/sys/powerpc/include/pcb.h Mon Nov 19 23:54:49 2018 (r340653) @@ -89,6 +89,7 @@ struct pcb { register_t dbcr0; } booke; } pcb_cpu; + vm_offset_t pcb_lastill; /* Last illegal instruction */ }; #endif Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 22:18:18 2018 (r340652) +++ head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 23:54:49 2018 (r340653) @@ -94,6 +94,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #ifdef FPU_EMU #include #endif @@ -1099,6 +1101,14 @@ ppc_instr_emulate(struct trapframe *frame, struct pcb } sig = fpu_emulate(frame, &pcb->pcb_fpu); #endif + if (sig == SIGILL) { + if (pcb->pcb_lastill != frame->srr0) { + /* Allow a second chance, in case of cache sync issues. */ + sig = 0; + pmap_sync_icache(PCPU_GET(curpmap), frame->srr0, 4); + pcb->pcb_lastill = frame->srr0; + } + } return (sig); } From owner-svn-src-head@freebsd.org Mon Nov 19 23:56:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D541112F665; Mon, 19 Nov 2018 23:56:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F1A66B371; Mon, 19 Nov 2018 23:56:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB56110E; Mon, 19 Nov 2018 23:56:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJNuXoL065479; Mon, 19 Nov 2018 23:56:33 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJNuXPn065478; Mon, 19 Nov 2018 23:56:33 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811192356.wAJNuXPn065478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 19 Nov 2018 23:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340654 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 340654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F1A66B371 X-Spamd-Result: default: False [0.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 23:56:34 -0000 Author: marius Date: Mon Nov 19 23:56:33 2018 New Revision: 340654 URL: https://svnweb.freebsd.org/changeset/base/340654 Log: For consistency within the front-end, prefer SDHCI_{READ,WRITE}_{2,4}() to sdhci_acpi_{read,write}_{2,4}() in the sdhci_acpi_set_uhs_timing() added in r340543. Modified: head/sys/dev/sdhci/sdhci_acpi.c Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Mon Nov 19 23:54:49 2018 (r340653) +++ head/sys/dev/sdhci/sdhci_acpi.c Mon Nov 19 23:56:33 2018 (r340654) @@ -203,7 +203,7 @@ sdhci_acpi_set_uhs_timing(device_t dev, struct sdhci_s enum mmc_bus_timing timing; bus = slot->bus; - old_timing = sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2); + old_timing = SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2); old_timing &= SDHCI_CTRL2_UHS_MASK; sdhci_generic_set_uhs_timing(dev, slot); @@ -220,19 +220,19 @@ sdhci_acpi_set_uhs_timing(device_t dev, struct sdhci_s timing = ios->timing; if (old_timing == SDHCI_CTRL2_UHS_SDR104 && timing == bus_timing_hs) - sdhci_acpi_write_2(bus, slot, SDHCI_HOST_CONTROL2, - sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2) & + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) & ~SDHCI_CTRL2_SAMPLING_CLOCK); if (ios->clock > SD_SDR50_MAX && old_timing != SDHCI_CTRL2_MMC_HS400 && timing == bus_timing_mmc_hs400) { - sdhci_acpi_write_2(bus, slot, SDHCI_HOST_CONTROL2, - sdhci_acpi_read_2(bus, slot, SDHCI_HOST_CONTROL2) | + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) | SDHCI_CTRL2_SAMPLING_CLOCK); - sdhci_acpi_write_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, 0x40003210); DELAY(20); - sdhci_acpi_write_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, 0x40033210); } } From owner-svn-src-head@freebsd.org Tue Nov 20 00:06:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 853BC112FF8B; Tue, 20 Nov 2018 00:06:54 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 121B76B96A; Tue, 20 Nov 2018 00:06:54 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCF0112BD; Tue, 20 Nov 2018 00:06:53 +0000 (UTC) (envelope-from tmunro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK06rui070630; Tue, 20 Nov 2018 00:06:53 GMT (envelope-from tmunro@FreeBSD.org) Received: (from tmunro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK06rcl070629; Tue, 20 Nov 2018 00:06:53 GMT (envelope-from tmunro@FreeBSD.org) Message-Id: <201811200006.wAK06rcl070629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tmunro set sender to tmunro@FreeBSD.org using -f From: Thomas Munro Date: Tue, 20 Nov 2018 00:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340655 - head/usr.bin/pom X-SVN-Group: head X-SVN-Commit-Author: tmunro X-SVN-Commit-Paths: head/usr.bin/pom X-SVN-Commit-Revision: 340655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 121B76B96A X-Spamd-Result: default: False [0.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:06:54 -0000 Author: tmunro Date: Tue Nov 20 00:06:53 2018 New Revision: 340655 URL: https://svnweb.freebsd.org/changeset/base/340655 Log: pom: Fix fencepost bugs. Under some conditions pom would report "waning" and then "full", show higher percentages than it should, and get confused by DST. Fix. Before: 2018.01.30: The Moon is Waxing Gibbous (97% of Full) 2018.01.31: The Moon is Waning Gibbous (100% of Full) 2018.02.01: The Moon is Full 2018.02.02: The Moon is Waning Gibbous (98% of Full) After: 2018.01.30: The Moon is Waxing Gibbous (96% of Full) 2018.01.31: The Moon is Waxing Gibbous (99% of Full) 2018.02.01: The Moon is Full 2018.02.02: The Moon is Waning Gibbous (97% of Full) PR: 231705 Submitted by: Andrew Gierth Approved by: allanjude (mentor) MFC after: 2 weeks Differential Revision: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231705 Modified: head/usr.bin/pom/pom.c Modified: head/usr.bin/pom/pom.c ============================================================================== --- head/usr.bin/pom/pom.c Mon Nov 19 23:56:33 2018 (r340654) +++ head/usr.bin/pom/pom.c Tue Nov 20 00:06:53 2018 (r340655) @@ -135,11 +135,13 @@ main(int argc, char **argv) tmd.tm_hour = 0; tmd.tm_min = 0; tmd.tm_sec = 0; + tmd.tm_isdst = -1; } if (otime != NULL) { tmd.tm_hour = strtol(otime, NULL, 10); tmd.tm_min = strtol(otime + 3, NULL, 10); tmd.tm_sec = strtol(otime + 6, NULL, 10); + tmd.tm_isdst = -1; } tt = mktime(&tmd); } @@ -149,19 +151,19 @@ main(int argc, char **argv) (GMT.tm_min / 60.0) + (GMT.tm_sec / 3600.0)) / 24.0); for (cnt = EPOCH; cnt < GMT.tm_year; ++cnt) days += isleap(1900 + cnt) ? 366 : 365; - today = potm(days) + .5; + today = potm(days); if (pflag) { (void)printf("%1.0f\n", today); return (0); } (void)printf("The Moon is "); - if ((int)today == 100) + if (today >= 99.5) (void)printf("Full\n"); - else if (!(int)today) + else if (today < 0.5) (void)printf("New\n"); else { tomorrow = potm(days + 1); - if ((int)today == 50) + if (today >= 49.5 && today < 50.5) (void)printf("%s\n", tomorrow > today ? "at the First Quarter" : "at the Last Quarter"); else { From owner-svn-src-head@freebsd.org Tue Nov 20 00:08:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A3BE11300A9; Tue, 20 Nov 2018 00:08:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1B666BB4B; Tue, 20 Nov 2018 00:08:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78B3B12C1; Tue, 20 Nov 2018 00:08:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK08Xbm070756; Tue, 20 Nov 2018 00:08:33 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK08XsX070755; Tue, 20 Nov 2018 00:08:33 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811200008.wAK08XsX070755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 20 Nov 2018 00:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340656 - head/sys/sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/sparc64/sparc64 X-SVN-Commit-Revision: 340656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1B666BB4B X-Spamd-Result: default: False [0.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.326,0]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:08:34 -0000 Author: marius Date: Tue Nov 20 00:08:33 2018 New Revision: 340656 URL: https://svnweb.freebsd.org/changeset/base/340656 Log: Given that the idea of D15374 was to "make memmove a first class citizen", provide a _MEMMOVE extension of _MEMCPY that deals with overlap based on the previous bcopy(9) implementation and use the former for bcopy(9) and memmove(9). This addresses my D15374 review comment, avoiding extra MOVs in case of memmove(9) and trashing the stack pointer. Modified: head/sys/sparc64/sparc64/support.S Modified: head/sys/sparc64/sparc64/support.S ============================================================================== --- head/sys/sparc64/sparc64/support.S Tue Nov 20 00:06:53 2018 (r340655) +++ head/sys/sparc64/sparc64/support.S Tue Nov 20 00:08:33 2018 (r340656) @@ -207,6 +207,30 @@ __FBSDID("$FreeBSD$"); 6: /* + * Extension of _MEMCPY dealing with overlap, but unaware of ASIs. + * Used for bcopy() and memmove(). + */ +#define _MEMMOVE(dst, src, len) \ + /* Check for overlap, and copy backwards if so. */ \ + sub dst, src, %g1 ; \ + cmp %g1, len ; \ + bgeu,a,pt %xcc, 2f ; \ + nop ; \ + /* Copy backwards. */ \ + add src, len, src ; \ + add dst, len, dst ; \ +1: deccc 1, len ; \ + bl,pn %xcc, 3f ; \ + dec 1, src ; \ + ldub [src], %g1 ; \ + dec 1, dst ; \ + ba %xcc, 1b ; \ + stb %g1, [dst] ; \ +2: /* Do the fast version. */ \ + _MEMCPY(dst, src, len, EMPTY, EMPTY, EMPTY, EMPTY) ; \ +3: + +/* * void ascopy(u_long asi, vm_offset_t src, vm_offset_t dst, size_t len) */ ENTRY(ascopy) @@ -265,49 +289,14 @@ ENTRY(bcmp) END(bcmp) /* - * void *memmove(void *dst, const void *src, size_t len) * void bcopy(const void *src, void *dst, size_t len) */ -ENTRY(memmove) - /* - * Swap src/dst for memmove/bcopy differences - */ - mov %o0, %o6 - mov %o1, %o0 - mov %o6, %o1 -ALTENTRY(bcopy) - /* - * Check for overlap, and copy backwards if so. - */ - sub %o1, %o0, %g1 - cmp %g1, %o2 - bgeu,a,pt %xcc, 3f +ENTRY(bcopy) + _MEMMOVE(%o1, %o0, %o2) + retl nop +END(bcopy) - /* - * Copy backwards. - */ - add %o0, %o2, %o0 - add %o1, %o2, %o1 -1: deccc 1, %o2 - bl,a,pn %xcc, 2f - nop - dec 1, %o0 - ldub [%o0], %g1 - dec 1, %o1 - ba %xcc, 1b - stb %g1, [%o1] -2: retl - mov %o6, %o0 - - /* - * Do the fast version. - */ -3: _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, EMPTY, EMPTY) - retl - mov %o6, %o0 -END(memmove) - /* * void bzero(void *b, size_t len) */ @@ -335,6 +324,16 @@ ENTRY(memcpy) retl nop END(memcpy) + +/* + * void *memmove(void *dst, const void *src, size_t len) + */ +ENTRY(memmove) + mov %o0, %o3 + _MEMMOVE(%o3, %o1, %o2) + retl + nop +END(memmove) /* * void *memset(void *b, int c, size_t len) From owner-svn-src-head@freebsd.org Tue Nov 20 00:14:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06C81113041C; Tue, 20 Nov 2018 00:14:49 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48E2B6BFE1; Tue, 20 Nov 2018 00:14:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from helicon.physics.ucla.edu (helicon.physics.ucla.edu [169.232.156.253]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id wAK03eMY030679 (version=TLSv1.2 cipher=AES128-SHA bits=128 verify=NOT); Mon, 19 Nov 2018 16:03:41 -0800 Subject: Re: svn commit: r340653 - in head/sys/powerpc: fpu include powerpc To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811192354.wAJNsnUu065339@repo.freebsd.org> From: Nathan Whitehorn Openpgp: preference=signencrypt Autocrypt: addr=nwhitehorn@freebsd.org; keydata= xsFNBFuARN8BEADLKYsG3l1aq/M21R59I/5EsEfvtvd15ZJ9lDHcWPuxzIfGnu2LMpe5PrFP e/Y4bcsPrlB4S3I3ooIUDvoEEsDeqgqlZod3QevOK/RjLqiqx1i/4mKnobJ++3ppyVVIccgN sUrj786OYCFCI/W+uWw7cbKewNeaL//Z/TDKlHLkssiy6qmZbNQ0ZjcMLJKUesk4eVg2TtTD HNe42ZuxbUC9iLYieO4c7kQB4qiFhagDRiObXrLzvm2MQYeAaNVRqID+mfI75TWrQ+t98iVu mHvFu461eeteq59jg6H/IL07ACxL+HzEVM+D6tPtPrz7ppr3wiZL5Cu17yu0nAx0nhJTV8ZB qza1rOVun0x65S14L41XD2HkmBDxTaRlTg8ypnkLFo8kh+MEq4k67apL/DUGcaUjKy2TVUC7 3igLO/DwQHrkWx2RrOmS3xS0TgGXVmB47nq2Zveo3fcjporQK63n2sbLkS70cfAJAJ9KHEIx u9am44iW5Ku3+mVLgQYybtcUxlk/Jw/BA5V6KUcDQMd5kTm0MyagziqMaT+57ceYxwRBK4HC DCLRpSOHV81/YzyL5vnwfHsxADm3091rd0uwr8uRCQn7wLvlcFyp/JKSFkVnE1oo7UE4QQJZ GbSJyvj7GdXu0LdghALcMj/thdb+js4D3UuCaAMecgVSscxEIQARAQABzS5OYXRoYW4gV2hp dGVob3JuIDxud2hpdGVob3JuQGljZWN1YmUud2lzYy5lZHU+wsGOBBMBCAA4FiEEPWQg+qgh ST6Avw1hOLZNlGaE6HcFAluAUl4CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQOLZN lGaE6HeHFw//fN2CzkiW1yedjLGEQ3uXRMgu6geRgWdtkgg/pOhn5OLSQI4R59kjvHNHHqln 1QYdxe63lsbe+7CRsTKuke3/mgsQ1h6n7cCzsoXVP3eLtWjshAz7spwUcdRRFTSbwkMzKcRn plpr+ByZDw98vnpQo10J5xYmf6if6wcEpVlazwnC5G1gHktM4X0jrlAUKSgVx7MG8o4G6af9 7MQJINAG6g6+BlBH3u5fmPunKi9qgHsZxKnTZneD2mO5u2x6p1qmqybvfvWI5UEvktPeEext JBeXXqdex+HWmAbLYznLUoBloBl+fW5Lo9VapkcGubvGC0WLr/gYuamAApwoFpa4/SBqgmHr JSsPqoDtheWt9oYzuYkYW5+tpJQoDVdG3KCOQJSYZIbNT8HyviFY32ZSn6gIn2qP/5E+rA8J +6/57XCZXPazE4FiPNbwY/OwZoi7w0yRKcdmJoSoC/GdjtQbjyeARbAaHIcudeU/bB3paGS2 rHkoW4iR5TnK/V/QJvNT4KC6Dw3m6pfBIzsF+smcyjz+MzBFQNvSOtG4kJQooKcMsThas8oX VTx+WsqNAVOeQKTOU74jlUYKm5+w5aIOJbc8jg1LlTWJus1SxYtxT9lgNwOCUhE/j6Ueq9jG V9POWg31C44akWmnK8rS4PImUBsPKwtxUNM6BhfZRbtIjQ7OwU0EW4BFQQEQAOLKFtg6us0A LA7LtvjxIskIgqFJjHw2ka/UtdJ432P9kvmBq7z4v0+m/gkxCOOG0yDi2Cv/ALJobsyb56tb U6MU0SRjTio35S2jit369B1BDC2TLNF337sUquUx0l4wkEXEBefvLRYouF8BRbkgjveg7sA4 NjsiduQx92vPJnBoaH2OWxqDbr5X6kF5cx9jPrKUJ4ZqH/raE/SSDhtow4aKO0nWbteVGck1 5W1X/S8KziPXKazxCQ8qprQRTAehsdG/bSbWD95hp3TAlEbl4N4UqqS7n4jCZunCeii2TDZH Vvx/lpFAT2ezx646p2PUmH5hpiVMgbY5uHcyahwNf+eNOO7gotnNYoieoLw4fUeTYOq+s3IN isCB4iovQcZOCYSzmwRolQRggX0tBSenR6Pgp38YjVIkWvMHhxbVifAusjvVbm/GQeA2MaCt kog53Iyfo7ri9DeNpVuRc/47BxHi8JtdyyGgLO13Ajcwc6V7KLeDmw/SXJAMssuWQlXzs8Og spNvtymBh5rq4TlxAY65L3Yv/yh0izEztOJO3Ob9y3gLrp7TeDI0EO9SyGuFXbgWY/NXlDwW HWguMgO7DWM/KxeaMYyHfnffIeQ6uhM21y42I7NV11mWwycv/XJkID3fd7GWBecakdYnYI/7 FYMDHmsUQPmSMkbqCqYcZe47ABEBAAHCwXYEGAEIACAWIQQ9ZCD6qCFJPoC/DWE4tk2UZoTo dwUCW4BFQQIbDAAKCRA4tk2UZoTod2RbEACbQ2bwJ3++bvqclErbekf7BXYja37/HxGE67q3 9xf28hen8vWGtXwq4bWmZT5H8bBqXigA4bUU4nN4X3xEDfTyqkQMuDTnnwT7Y61B4QEqhi4a q4adf/KP0l1UCg4CJ0KS931Han+VbiuUcbadu1ZX37Ef6g/hG+mt59FeXDMU0rers2Bpr8zB 8ywojAsVC92kvOHLsCQtdCsPzC+R6B1bY6/Re9slM1NBd+2k4BUVhYu8Fb8Ir37OmN0aGQzY uRczfrmR/OV5/1+g5XeYSFbq/0Q3KkFWLHfimff8lb9GRWrdvOUpYyGluv49b/G5o9lSxPwX yBfaoVi/WDDfJ/XJw9H90XK68TYxPfEQkeuLEEzg+Bz3Zeduyo2Zx4S5apLqAbv0RzduXgIG YZVPu8R4ya8nQWHeUpot17lt8SL7yFkMJaAXk27QqUAaxjqnGBLn70YMWXFGySfvjgaR1Ftu /S/HSKqH7m8aFYZftqs7ZojXNdqGHZKRrIx6hRUYuZQM8uxHDweF4jF+QIwYIUmtry5h8iti Sjt9KHjpkH3Wz5o1mk6cbFNN+wgpHplDl/iZMZjFskTAJfEsYHVSSm21zcYvvogrbqYvciMT ty65+0A8Gz9tMbcNx9ePaGoM+9jeFehrzTjdaiTiC+umSd/Y29DCW4OBMr1VfufVVKbfAQ== Message-ID: <5bb6d4a3-57e0-6008-3e6a-4bad77fd3108@freebsd.org> Date: Mon, 19 Nov 2018 16:03:40 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <201811192354.wAJNsnUu065339@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbaCRoI4LQ5ztd+H4sMh+2u2Wi1nDMrETb2PyVsBCE6jnFvxLZL5lP4o7q/lFjA9lEoKX17fwPHFOJ47n2ia3rzfKfQbLYBbU4= X-Sonic-ID: C;WEimvFfs6BGe5P+mSH5B5g== M;NFzevFfs6BGe5P+mSH5B5g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-Rspamd-Queue-Id: 48E2B6BFE1 X-Spamd-Result: default: False [0.09 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.39)[-0.392,0]; NEURAL_SPAM_SHORT(0.48)[0.481,0]; ASN(0.00)[asn:7065, ipnet:64.142.96.0/19, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:14:49 -0000 Is this reasonable? What if the junk in the cache happened to be a *valid* instruction? Won't this approach result in silent corruption and later failure? -Nathan On 11/19/18 3:54 PM, Justin Hibbits wrote: > Author: jhibbits > Date: Mon Nov 19 23:54:49 2018 > New Revision: 340653 > URL: https://svnweb.freebsd.org/changeset/base/340653 > > Log: > powerpc: Sync icache on SIGILL, in case of cache issues > > The update of jemalloc to 5.1.0 exposed a cache syncing issue on a Freescale > e500 base system. There was already code in the FPU emulator to address > this, but it was limited to a single static variable, and did not attempt to > sync the cache. This pulls that out to the higher level program exception > handler, and syncs the cache. > > If a SIGILL is hit a second time at the same address, it will be treated as > a real illegal instruction, and handled accordingly. > > Modified: > head/sys/powerpc/fpu/fpu_emu.c > head/sys/powerpc/include/pcb.h > head/sys/powerpc/powerpc/exec_machdep.c > > Modified: head/sys/powerpc/fpu/fpu_emu.c > ============================================================================== > --- head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 22:18:18 2018 (r340652) > +++ head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 23:54:49 2018 (r340653) > @@ -189,7 +189,6 @@ fpu_emulate(struct trapframe *frame, struct fpu *fpf) > { > union instr insn; > struct fpemu fe; > - static int lastill = 0; > int sig; > > /* initialize insn.is_datasize to tell it is *not* initialized */ > @@ -243,17 +242,11 @@ fpu_emulate(struct trapframe *frame, struct fpu *fpf) > opc_disasm(frame->srr0, insn.i_int); > } > #endif > - /* > - * XXXX retry an illegal insn once due to cache issues. > - */ > - if (lastill == frame->srr0) { > - sig = SIGILL; > + sig = SIGILL; > #ifdef DEBUG > - if (fpe_debug & FPE_EX) > - kdb_enter(KDB_WHY_UNSET, "illegal instruction"); > + if (fpe_debug & FPE_EX) > + kdb_enter(KDB_WHY_UNSET, "illegal instruction"); > #endif > - } > - lastill = frame->srr0; > break; > } > > > Modified: head/sys/powerpc/include/pcb.h > ============================================================================== > --- head/sys/powerpc/include/pcb.h Mon Nov 19 22:18:18 2018 (r340652) > +++ head/sys/powerpc/include/pcb.h Mon Nov 19 23:54:49 2018 (r340653) > @@ -89,6 +89,7 @@ struct pcb { > register_t dbcr0; > } booke; > } pcb_cpu; > + vm_offset_t pcb_lastill; /* Last illegal instruction */ > }; > #endif > > > Modified: head/sys/powerpc/powerpc/exec_machdep.c > ============================================================================== > --- head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 22:18:18 2018 (r340652) > +++ head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 23:54:49 2018 (r340653) > @@ -94,6 +94,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > + > #ifdef FPU_EMU > #include > #endif > @@ -1099,6 +1101,14 @@ ppc_instr_emulate(struct trapframe *frame, struct pcb > } > sig = fpu_emulate(frame, &pcb->pcb_fpu); > #endif > + if (sig == SIGILL) { > + if (pcb->pcb_lastill != frame->srr0) { > + /* Allow a second chance, in case of cache sync issues. */ > + sig = 0; > + pmap_sync_icache(PCPU_GET(curpmap), frame->srr0, 4); > + pcb->pcb_lastill = frame->srr0; > + } > + } > > return (sig); > } > From owner-svn-src-head@freebsd.org Tue Nov 20 00:57:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E93A11314E4; Tue, 20 Nov 2018 00:57:26 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 741986D977; Tue, 20 Nov 2018 00:57:25 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf1-f43.google.com with SMTP id a16so140709lfg.3; Mon, 19 Nov 2018 16:57:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RH4N6AxcRodRpzAn/ivc5wqk6Qye9auOzX/L5QAEhxo=; b=d/4+qjGt7B7cLXlVCe/HLSs+EE/yACQpUr8OToa9FdEasWHt5WqyKoGk9fMgp3zZMs phXlKXuplFizx2gyQFJfW++mwNPajVu+KizUAFUCYTwdOb6elNxfBKXKIY9qgFUtBRMY QXVDlCq9Aa3WZ6FxfXB2iUICbawQB1RSKThERwzuW7Wk7vIl7i/hjXqjBL0wbL2J7XcF IvWeyfvR4/bEZYWSEU2ARdfDqm441rN1aBG3Cigs2ZBvFsZMDRQo+iF2tlohWH46sEhE tBRUSkokR9zAtdeAjFoAUs2eK32DwuR1FtKasklj8aXaWRTpfOvkwHWW22cn9tIJKxWY BO4w== X-Gm-Message-State: AGRZ1gJZNfUTDrSrj2VsCrg13m9viCfqQCSS2JE6NrZC/kCAAFLciYto AtKpAlp1YLpciHr5fQpguQI0TJZ8luTKdjMgd+DzwDg7 X-Google-Smtp-Source: AJdET5eq5isxxSVvyJ4XntNzFr7KI6yoveYxtmNWClLb24ySDjGRurd1LzytIz4HrWD9ODzoSM8RA1fgZcblrETdu48= X-Received: by 2002:a19:9904:: with SMTP id b4mr11365582lfe.95.1542675126913; Mon, 19 Nov 2018 16:52:06 -0800 (PST) MIME-Version: 1.0 References: <201811192354.wAJNsnUu065339@repo.freebsd.org> <5bb6d4a3-57e0-6008-3e6a-4bad77fd3108@freebsd.org> In-Reply-To: <5bb6d4a3-57e0-6008-3e6a-4bad77fd3108@freebsd.org> From: Justin Hibbits Date: Mon, 19 Nov 2018 18:51:55 -0600 Message-ID: Subject: Re: svn commit: r340653 - in head/sys/powerpc: fpu include powerpc To: Nathan Whitehorn Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 741986D977 X-Spamd-Result: default: False [-3.02 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.990,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; IP_SCORE(-1.03)[ipnet: 209.85.128.0/17(-3.41), asn: 15169(-1.65), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; RCVD_IN_DNSWL_NONE(0.00)[43.167.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:57:26 -0000 Well, this is to allow a retry in case the cache wasn't properly flushed already. This came about because the blrl instruction in the GOT was seen as an illegal instruction, and it didn't seem to matter if I synced in pmap_enter(), it would still SIGILL probabilistically. Since this block was already present for a reason it made sense to make it actually functional, since it does solve that problem. I don't know if there's yet another hardware errata on the e500, regarding caching, because I would expect a page load like this to get synced no matter the load address. - Justin On Mon, Nov 19, 2018, 18:14 Nathan Whitehorn Is this reasonable? What if the junk in the cache happened to be a > *valid* instruction? Won't this approach result in silent corruption and > later failure? > -Nathan > > On 11/19/18 3:54 PM, Justin Hibbits wrote: > > Author: jhibbits > > Date: Mon Nov 19 23:54:49 2018 > > New Revision: 340653 > > URL: https://svnweb.freebsd.org/changeset/base/340653 > > > > Log: > > powerpc: Sync icache on SIGILL, in case of cache issues > > > > The update of jemalloc to 5.1.0 exposed a cache syncing issue on a > Freescale > > e500 base system. There was already code in the FPU emulator to > address > > this, but it was limited to a single static variable, and did not > attempt to > > sync the cache. This pulls that out to the higher level program > exception > > handler, and syncs the cache. > > > > If a SIGILL is hit a second time at the same address, it will be > treated as > > a real illegal instruction, and handled accordingly. > > > > Modified: > > head/sys/powerpc/fpu/fpu_emu.c > > head/sys/powerpc/include/pcb.h > > head/sys/powerpc/powerpc/exec_machdep.c > > > > Modified: head/sys/powerpc/fpu/fpu_emu.c > > > ============================================================================== > > --- head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 22:18:18 2018 > (r340652) > > +++ head/sys/powerpc/fpu/fpu_emu.c Mon Nov 19 23:54:49 2018 > (r340653) > > @@ -189,7 +189,6 @@ fpu_emulate(struct trapframe *frame, struct fpu *fpf) > > { > > union instr insn; > > struct fpemu fe; > > - static int lastill = 0; > > int sig; > > > > /* initialize insn.is_datasize to tell it is *not* initialized */ > > @@ -243,17 +242,11 @@ fpu_emulate(struct trapframe *frame, struct fpu > *fpf) > > opc_disasm(frame->srr0, insn.i_int); > > } > > #endif > > - /* > > - * XXXX retry an illegal insn once due to cache issues. > > - */ > > - if (lastill == frame->srr0) { > > - sig = SIGILL; > > + sig = SIGILL; > > #ifdef DEBUG > > - if (fpe_debug & FPE_EX) > > - kdb_enter(KDB_WHY_UNSET, "illegal > instruction"); > > + if (fpe_debug & FPE_EX) > > + kdb_enter(KDB_WHY_UNSET, "illegal instruction"); > > #endif > > - } > > - lastill = frame->srr0; > > break; > > } > > > > > > Modified: head/sys/powerpc/include/pcb.h > > > ============================================================================== > > --- head/sys/powerpc/include/pcb.h Mon Nov 19 22:18:18 2018 > (r340652) > > +++ head/sys/powerpc/include/pcb.h Mon Nov 19 23:54:49 2018 > (r340653) > > @@ -89,6 +89,7 @@ struct pcb { > > register_t dbcr0; > > } booke; > > } pcb_cpu; > > + vm_offset_t pcb_lastill; /* Last illegal instruction */ > > }; > > #endif > > > > > > Modified: head/sys/powerpc/powerpc/exec_machdep.c > > > ============================================================================== > > --- head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 22:18:18 2018 > (r340652) > > +++ head/sys/powerpc/powerpc/exec_machdep.c Mon Nov 19 23:54:49 2018 > (r340653) > > @@ -94,6 +94,8 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > > > +#include > > + > > #ifdef FPU_EMU > > #include > > #endif > > @@ -1099,6 +1101,14 @@ ppc_instr_emulate(struct trapframe *frame, struct > pcb > > } > > sig = fpu_emulate(frame, &pcb->pcb_fpu); > > #endif > > + if (sig == SIGILL) { > > + if (pcb->pcb_lastill != frame->srr0) { > > + /* Allow a second chance, in case of cache sync > issues. */ > > + sig = 0; > > + pmap_sync_icache(PCPU_GET(curpmap), frame->srr0, > 4); > > + pcb->pcb_lastill = frame->srr0; > > + } > > + } > > > > return (sig); > > } > > > > From owner-svn-src-head@freebsd.org Tue Nov 20 01:52:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D62EF1135FA9; Tue, 20 Nov 2018 01:52:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CC1070BE9; Tue, 20 Nov 2018 01:52:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D63D26C7; Tue, 20 Nov 2018 01:52:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK1qkf0027879; Tue, 20 Nov 2018 01:52:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK1qk4k027878; Tue, 20 Nov 2018 01:52:46 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811200152.wAK1qk4k027878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 20 Nov 2018 01:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340661 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 340661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CC1070BE9 X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.41)[0.405,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 01:52:47 -0000 Author: rmacklem Date: Tue Nov 20 01:52:45 2018 New Revision: 340661 URL: https://svnweb.freebsd.org/changeset/base/340661 Log: r304026 added code that started statistics gathering for an operation before the operation number (the variable called "op") was sanity checked. This patch moves the code down to below the range sanity check for "op". Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Nov 20 01:12:21 2018 (r340660) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Nov 20 01:52:45 2018 (r340661) @@ -766,11 +766,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram *repp = *tl; op = fxdr_unsigned(int, *tl); NFSD_DEBUG(4, "op=%d\n", op); - - binuptime(&start_time); - nfsrvd_statstart(op, &start_time); - statsinprog = 1; - if (op < NFSV4OP_ACCESS || (op >= NFSV4OP_NOPS && (nd->nd_flag & ND_NFSV41) == 0) || (op >= NFSV41_NOPS && (nd->nd_flag & ND_NFSV41) != 0)) { @@ -782,6 +777,11 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram } else { repp++; } + + binuptime(&start_time); + nfsrvd_statstart(op, &start_time); + statsinprog = 1; + if (i == 0) op0 = op; if (i == numops - 1) From owner-svn-src-head@freebsd.org Tue Nov 20 01:56:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C5FA113667F; Tue, 20 Nov 2018 01:56:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7AA87109E; Tue, 20 Nov 2018 01:56:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7DBB26DD; Tue, 20 Nov 2018 01:56:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK1uYpW028224; Tue, 20 Nov 2018 01:56:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK1uY8S028223; Tue, 20 Nov 2018 01:56:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811200156.wAK1uY8S028223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 20 Nov 2018 01:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340662 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 340662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E7AA87109E X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.41)[0.405,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 01:56:35 -0000 Author: rmacklem Date: Tue Nov 20 01:56:34 2018 New Revision: 340662 URL: https://svnweb.freebsd.org/changeset/base/340662 Log: nfsm_advance() would panic() when the offs argument was negative. The code assumed that this would indicate a corrupted mbuf chain, but it could simply be caused by bogus RPC message data. This patch replaces the panic() with a printf() plus error return. MFC after: 1 week Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Tue Nov 20 01:52:45 2018 (r340661) +++ head/sys/fs/nfs/nfs_commonsubs.c Tue Nov 20 01:56:34 2018 (r340662) @@ -725,10 +725,14 @@ nfsm_advance(struct nfsrv_descript *nd, int offs, int if (offs == 0) goto out; /* - * A negative offs should be considered a serious problem. + * A negative offs might indicate a corrupted mbuf chain and, + * as such, a printf is logged. */ - if (offs < 0) - panic("nfsrv_advance"); + if (offs < 0) { + printf("nfsrv_advance: negative offs\n"); + error = EBADRPC; + goto out; + } /* * If left == -1, calculate it here. From owner-svn-src-head@freebsd.org Tue Nov 20 01:59:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C9F41136D11; Tue, 20 Nov 2018 01:59:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CAE47159B; Tue, 20 Nov 2018 01:59:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6D302709; Tue, 20 Nov 2018 01:59:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK1xvHD028409; Tue, 20 Nov 2018 01:59:57 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK1xvjj028408; Tue, 20 Nov 2018 01:59:57 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811200159.wAK1xvjj028408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 20 Nov 2018 01:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340663 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 340663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CAE47159B X-Spamd-Result: default: False [0.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.51)[0.507,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 01:59:58 -0000 Author: rmacklem Date: Tue Nov 20 01:59:57 2018 New Revision: 340663 URL: https://svnweb.freebsd.org/changeset/base/340663 Log: Improve sanity checking for the dircount hint argument to NFSv3's ReaddirPlus and NFSv4's Readdir operations. The code checked for a zero argument, but did not check for a very large value. This patch clips dircount at the server's maximum data size. MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Tue Nov 20 01:56:34 2018 (r340662) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Tue Nov 20 01:59:57 2018 (r340663) @@ -2107,9 +2107,15 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg * cookie) should be in the reply. At least one client "hints" 0, * so I set it to cnt for that case. I also round it up to the * next multiple of DIRBLKSIZ. + * Since the size of a Readdirplus directory entry reply will always + * be greater than a directory entry returned by VOP_READDIR(), it + * does not make sense to read more than NFS_SRVMAXDATA() via + * VOP_READDIR(). */ if (siz <= 0) siz = cnt; + else if (siz > NFS_SRVMAXDATA(nd)) + siz = NFS_SRVMAXDATA(nd); siz = ((siz + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1)); if (nd->nd_flag & ND_NFSV4) { From owner-svn-src-head@freebsd.org Tue Nov 20 02:08:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FED211378DE; Tue, 20 Nov 2018 02:08:35 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660047.outbound.protection.outlook.com [40.107.66.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1168E71E7E; Tue, 20 Nov 2018 02:08:33 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM (52.132.50.155) by YTOPR0101MB2187.CANPRD01.PROD.OUTLOOK.COM (52.132.48.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Tue, 20 Nov 2018 02:08:26 +0000 Received: from YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM ([fe80::9c71:6eb6:1bff:727b]) by YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM ([fe80::9c71:6eb6:1bff:727b%5]) with mapi id 15.20.1294.045; Tue, 20 Nov 2018 02:08:26 +0000 From: Rick Macklem To: Rick Macklem , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r340661 - head/sys/fs/nfsserver Thread-Topic: svn commit: r340661 - head/sys/fs/nfsserver Thread-Index: AQHUgHPGJVIWZzJhUUyXdP8brmipMaVX6et5 Date: Tue, 20 Nov 2018 02:08:26 +0000 Message-ID: References: <201811200152.wAK1qk4k027878@repo.freebsd.org> In-Reply-To: <201811200152.wAK1qk4k027878@repo.freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB2187; 6:9zs71kiXKrvrSQYKoJ+NlzWXsg3n3uJtvEa5wdr3POJXOcQLpjV8/AReYLertKp0WBpU6YLgJjWFPTlIAdXUJMca7VRz0tPP0U01WAg7n50V2UnYB6DaNp5b2LPtbqcb6wWAjnsPhdbtrBD8Qn7WSv+e/m/XMRkPUBpaihuD69EdPKo2GH7bGqhnSC+jAddhYZUu85n9MUvuM/LhkPxuNOMyFPtMXd6vpS9tBjb8ML9OENvR3OKWHf6eBseXrLAY9g03RppJZralVj+ohWCGHgAL3logX3w8O+tOfu6Ueyj+B+ROauBVGtWB4iEvn5XXhWuKgaPU7rIvhF6ZKBrYM1JPEvlqto0o4i3x9zpDrgRR80XNNaLmVZnJIX7Ranfb4RiBqrbMuWjsDpLxAQCDOh+P/7kIyS9ZkBweASJ1bIy+YELiGERb9U305wg8MDaWt+qmyQctmDx+QBeRn2cZMQ==; 5:d6ZjsLDn4pAMJI/XJpMDLwyd2PODg/jjFbpyaEgVT9A3ax8kG0Ss/LCTPdKvGsUMW2ztiIr8s1niqUWIY1x7+xpe9TUM3s05rjCy0InOFh3gspYXzUxakUunuvR+pvjM0l8N7JJ0f/1LqioXSJuvDbbgD5gcqzc2ABf900o6keI=; 7:TKMbggDkZ7A5x0oQPSFjFvDuR9L6iUo2R8iWK2vveQszjq+pAWYBH6/+q8szuhUioGJLBImprpFrG5M9IItmqf4YPFLEwEnqrVxWIuXfIsJvYarGTJXXysVe/ivqp9fNOj2G11IcGrX3JlddIEzEVg== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: c02de492-e4ef-4657-1160-08d64e8d0ee1 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB2187; x-ms-traffictypediagnostic: YTOPR0101MB2187: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(56005881305849); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231442)(944501410)(52105112)(10201501046)(3002001)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:YTOPR0101MB2187; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB2187; x-forefront-prvs: 08626BE3A5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(136003)(366004)(376002)(189003)(199004)(6506007)(14454004)(7696005)(2900100001)(74316002)(76176011)(102836004)(256004)(71200400001)(966005)(71190400001)(5660300001)(68736007)(2906002)(110136005)(86362001)(2201001)(33656002)(74482002)(316002)(786003)(106356001)(478600001)(46003)(9686003)(53936002)(476003)(6306002)(6436002)(105586002)(55016002)(11346002)(446003)(6246003)(8936002)(8676002)(2501003)(81156014)(81166006)(25786009)(97736004)(186003)(450100002)(229853002)(486006)(305945005)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB2187; H:YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: zsMGht5C9ZpCkDkUsF922tNKyXSdTINxoj+W6dNezn01CX2RxXPKFH0PIvoG3r6ETTgZylpWLhoGUK/or/2WC+7d6CgyCBmNZJXdM9CaLE9LRZ94GWUq3SVnaRt+b3PbM+pin422I9DTS44d9rTMVqFR+FjnoeaiYmnJ23Uu78kPkAzhOmOjgvGeGkotO15AuR1HBdWLul9JpykwWVpgTjOFYtTM4Fnq9BnWb3L4bnTuibSU2dZhtJ/T+ztCqeSXVuylq2uicKURO5p63OnpPCg+RTs5zRn3X2epRZdLGUxQiXyYqwuhdUnQhz+ZWb/jKh7DNEXRz0IR9tqv+NnJ1lyZUjEux+TFWHbSx5l/oS8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: c02de492-e4ef-4657-1160-08d64e8d0ee1 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Nov 2018 02:08:26.4999 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB2187 X-Rspamd-Queue-Id: 1168E71E7E X-Spamd-Result: default: False [-3.86 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.978,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[uoguelph.ca]; NEURAL_HAM_LONG(-0.96)[-0.962,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com]; NEURAL_HAM_SHORT(-0.91)[-0.912,0]; RCVD_IN_DNSWL_NONE(0.00)[47.66.107.40.list.dnswl.org : 127.0.3.0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:40.64.0.0/10, country:US]; IP_SCORE(-0.70)[ipnet: 40.64.0.0/10(-1.60), asn: 8075(-1.80), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 02:08:35 -0000 >Author: rmacklem >Date: Tue Nov 20 01:52:45 2018 >New Revision: 340661 >URL: https://svnweb.freebsd.org/changeset/base/340661 > >Log: > r304026 added code that started statistics gathering for an operation > before the operation number (the variable called "op") was sanity checke= d. > This patch moves the code down to below the range sanity check for "op". I missed... MFC: 1 week Discussed with: emaste (the Discussed with should also have been on r340662 and r340663) rick [commit stuff snipped] From owner-svn-src-head@freebsd.org Tue Nov 20 07:11:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A89581102E41; Tue, 20 Nov 2018 07:11:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50E087D617; Tue, 20 Nov 2018 07:11:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30C3F6116; Tue, 20 Nov 2018 07:11:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK7BOGr092248; Tue, 20 Nov 2018 07:11:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK7BOcX092247; Tue, 20 Nov 2018 07:11:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201811200711.wAK7BOcX092247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 20 Nov 2018 07:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340664 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 340664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50E087D617 X-Spamd-Result: default: False [0.50 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.03)[0.027,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.48)[0.475,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 07:11:24 -0000 Author: imp Date: Tue Nov 20 07:11:23 2018 New Revision: 340664 URL: https://svnweb.freebsd.org/changeset/base/340664 Log: Ensure that all values of ns, us and ms work for {n,u,m}stosbt Integer overflows and wrong constants limited the accuracy of these functions and created situatiosn where sbttoXs(Xstosbt(Y)) != Y. This was especailly true in the ns case where we had millions of values that were wrong. Instead, used fixed constants because there's no way to say ceil(X) for integer math. Document what these crazy constants are. Also, use a shift one fewer left to avoid integer overflow causing incorrect results, and adjust the equasion accordingly. Document this. Allow times >= 1s to be well defined for these conversion functions (at least the Xstosbt). There's too many users in the tree that they work for >= 1s. This fixes a failure on boot to program firmware on the mlx4 NIC. There was a msleep(1000) in the code. Prior to my recent rounding changes, msleep(1000) worked, but msleep(1001) did not because the old code rounded to just below 2^64 and the new code rounds to just above it (overflowing, causing the msleep(1000) to really sleep 1ms). A test program to test all cases will be committed shortly. The test exaustively tries every value (thanks to bde for the test). Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D18051 Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Tue Nov 20 01:59:57 2018 (r340663) +++ head/sys/sys/time.h Tue Nov 20 07:11:23 2018 (r340664) @@ -162,9 +162,24 @@ sbttobt(sbintime_t _sbt) * large roundoff errors which sbttons() and nstosbt() avoid. Millisecond and * microsecond functions are also provided for completeness. * - * These functions return the smallest sbt larger or equal to the number of - * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 term added - * transforms the >> 32 from floor() to ceil(). + * These functions return the smallest sbt larger or equal to the + * number of seconds requested so that sbttoX(Xtosbt(y)) == y. Unlike + * top of second computations below, which require that we tick at the + * top of second, these need to be rounded up so we do whatever for at + * least as long as requested. + * + * The naive computation we'd do is this + * ((unit * 2^64 / SIFACTOR) + 2^32-1) >> 32 + * However, that overflows. Instead, we compute + * ((unit * 2^63 / SIFACTOR) + 2^31-1) >> 32 + * and use pre-computed constants that are the ceil of the 2^63 / SIFACTOR + * term to ensure we are using exactly the right constant. We use the lesser + * evil of ull rather than a uint64_t cast to ensure we have well defined + * right shift semantics. With these changes, we get all the ns, us and ms + * conversions back and forth right. + * Note: This file is used for both kernel and userland includes, so we can't + * rely on KASSERT being defined, nor can we pollute the namespace by including + * assert.h. */ static __inline int64_t sbttons(sbintime_t _sbt) @@ -176,8 +191,18 @@ sbttons(sbintime_t _sbt) static __inline sbintime_t nstosbt(int64_t _ns) { + sbintime_t sb = 0; - return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - 1) >> 32); +#ifdef KASSERT + KASSERT(_ns >= 0, ("Negative values illegal for nstosbt: %jd", _ns)); +#endif + if (_ns >= SBT_1S) { + sb = (_ns / 1000000000) * SBT_1S; + _ns = _ns % 1000000000; + } + /* 9223372037 = ceil(2^63 / 1000000000) */ + sb += ((_ns * 9223372037ull) + 0x7fffffff) >> 31; + return (sb); } static __inline int64_t @@ -190,8 +215,18 @@ sbttous(sbintime_t _sbt) static __inline sbintime_t ustosbt(int64_t _us) { + sbintime_t sb = 0; - return ((_us * (((uint64_t)1 << 63) / 500000) + (1ull << 32) - 1) >> 32); +#ifdef KASSERT + KASSERT(_us >= 0, ("Negative values illegal for ustosbt: %jd", _us)); +#endif + if (_us >= SBT_1S) { + sb = (_us / 1000000) * SBT_1S; + _us = _us % 1000000; + } + /* 9223372036855 = ceil(2^63 / 1000000) */ + sb += ((_us * 9223372036855ull) + 0x7fffffff) >> 31; + return (sb); } static __inline int64_t @@ -204,8 +239,18 @@ sbttoms(sbintime_t _sbt) static __inline sbintime_t mstosbt(int64_t _ms) { + sbintime_t sb = 0; - return ((_ms * (((uint64_t)1 << 63) / 500) + (1ull << 32) - 1) >> 32); +#ifdef KASSERT + KASSERT(_ms >= 0, ("Negative values illegal for mstosbt: %jd", _ms)); +#endif + if (_ms >= SBT_1S) { + sb = (_ms / 1000) * SBT_1S; + _ms = _ms % 1000; + } + /* 9223372036854776 = ceil(2^63 / 1000) */ + sb += ((_ms * 9223372036854776ull) + 0x7fffffff) >> 31; + return (sb); } /*- From owner-svn-src-head@freebsd.org Tue Nov 20 10:01:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2DD71108B66; Tue, 20 Nov 2018 10:01:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CE6183E08; Tue, 20 Nov 2018 10:01:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DF4F7C20; Tue, 20 Nov 2018 10:01:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKA1vKf080538; Tue, 20 Nov 2018 10:01:57 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKA1uxh080537; Tue, 20 Nov 2018 10:01:56 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811201001.wAKA1uxh080537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 20 Nov 2018 10:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340668 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 340668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3CE6183E08 X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.65)[0.648,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.02)[0.018,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 10:01:57 -0000 Author: 0mp (ports committer) Date: Tue Nov 20 10:01:56 2018 New Revision: 340668 URL: https://svnweb.freebsd.org/changeset/base/340668 Log: ports(7): Do not mention deprecated WITH_OPENSSL_PORT. Reviewed by: eadler Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18045 Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Tue Nov 20 09:35:37 2018 (r340667) +++ head/share/man/man7/ports.7 Tue Nov 20 10:01:56 2018 (r340668) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2018 +.Dd November 20, 2018 .Dt PORTS 7 .Os .Sh NAME @@ -506,12 +506,6 @@ and the .Fx Porter's Handbook. .Bl -tag -width ".Va WITH_GHOSTSCRIPT_VER" -.It Va WITH_OPENSSL_PORT -.Pq Vt bool -If set, causes ports that make use of OpenSSL to use the OpenSSL from -ports -.Pq if available -instead of the OpenSSL from the base system. .It Va WITH_DEBUG .Pq Vt bool If set, debugging symbols are installed for ports binaries. From owner-svn-src-head@freebsd.org Tue Nov 20 14:18:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8EA1130E3C; Tue, 20 Nov 2018 14:18:58 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E46216F31A; Tue, 20 Nov 2018 14:18:57 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5776126FB; Tue, 20 Nov 2018 14:18:57 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKEIvKk012784; Tue, 20 Nov 2018 14:18:57 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKEIvui012783; Tue, 20 Nov 2018 14:18:57 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811201418.wAKEIvui012783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Tue, 20 Nov 2018 14:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340674 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 340674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E46216F31A X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.30)[0.304,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 14:18:58 -0000 Author: tijl Date: Tue Nov 20 14:18:57 2018 New Revision: 340674 URL: https://svnweb.freebsd.org/changeset/base/340674 Log: Fix another user address dereference in linux_sendmsg syscall. This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its second argument. Stop using the macro as well as LINUX_CMSG_FIRSTHDR. Use the size field of the kernel copy of the control message header to obtain the next control message. PR: 217901 MFC after: 2 days X-MFC-With: r340631 Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue Nov 20 11:23:33 2018 (r340673) +++ head/sys/compat/linux/linux_socket.c Tue Nov 20 14:18:57 2018 (r340674) @@ -1096,6 +1096,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc sa_family_t sa_family; void *data; l_size_t len; + l_size_t clen; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1127,7 +1128,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = kern_getsockname(td, s, &sa, &datalen); if (error != 0) goto bad; @@ -1140,6 +1141,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc data = mtod(control, void *); datalen = 0; + ptr_cmsg = PTRIN(linux_msg.msg_control); + clen = linux_msg.msg_controllen; do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); @@ -1147,7 +1150,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc goto bad; error = EINVAL; - if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > clen) goto bad; if (datalen + CMSG_HDRSZ > MCLBYTES) @@ -1199,7 +1203,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_len = CMSG_LEN(len); data = (char *)data + CMSG_SPACE(len); datalen += CMSG_SPACE(len); - } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); + + if (clen <= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)) + break; + + clen -= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len); + ptr_cmsg = (struct l_cmsghdr *)((char *)ptr_cmsg + + LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)); + } while(clen >= sizeof(struct l_cmsghdr)); control->m_len = datalen; if (datalen == 0) { From owner-svn-src-head@freebsd.org Tue Nov 20 14:52:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D49161131FB3; Tue, 20 Nov 2018 14:52:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79C55707ED; Tue, 20 Nov 2018 14:52:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AAF212D61; Tue, 20 Nov 2018 14:52:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKEqiaD032835; Tue, 20 Nov 2018 14:52:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKEqib1032834; Tue, 20 Nov 2018 14:52:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811201452.wAKEqib1032834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 20 Nov 2018 14:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340675 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 340675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79C55707ED X-Spamd-Result: default: False [0.54 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.41)[0.414,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 14:52:45 -0000 Author: kib Date: Tue Nov 20 14:52:43 2018 New Revision: 340675 URL: https://svnweb.freebsd.org/changeset/base/340675 Log: rtld: when immediate bind mode is requested, process irelocs in PLT immediately after other PLT relocs. Otherwise, if the object has relro page, we write to readonly page, and we would need to use mprotect(2) two more times to fix it. Note that resolve_object_ifunc() does nothing when called second time, so there is no need to avoid existing call. Reported and tested by: emaste PR: 233333 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Nov 20 14:18:57 2018 (r340674) +++ head/libexec/rtld-elf/rtld.c Tue Nov 20 14:52:43 2018 (r340675) @@ -142,6 +142,7 @@ static int relocate_object(Obj_Entry *obj, bool bind_n int flags, RtldLockState *lockstate); static int relocate_objects(Obj_Entry *, bool, Obj_Entry *, int, RtldLockState *); +static int resolve_object_ifunc(Obj_Entry *, bool, int, RtldLockState *); static int resolve_objects_ifunc(Obj_Entry *first, bool bind_now, int flags, RtldLockState *lockstate); static int rtld_dirname(const char *, char *); @@ -2885,9 +2886,11 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent if (reloc_plt(obj) == -1) return (-1); /* Relocate the jump slots if we are doing immediate binding. */ - if (obj->bind_now || bind_now) - if (reloc_jmpslots(obj, flags, lockstate) == -1) + if (obj->bind_now || bind_now) { + if (reloc_jmpslots(obj, flags, lockstate) == -1 || + resolve_object_ifunc(obj, true, flags, lockstate) == -1) return (-1); + } /* * Process the non-PLT IFUNC relocations. The relocations are From owner-svn-src-head@freebsd.org Tue Nov 20 14:58:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BBD51132177; Tue, 20 Nov 2018 14:58:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6C8370A63; Tue, 20 Nov 2018 14:58:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4C0912D69; Tue, 20 Nov 2018 14:58:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKEwfPZ033154; Tue, 20 Nov 2018 14:58:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKEwftP033152; Tue, 20 Nov 2018 14:58:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201458.wAKEwftP033152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 14:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340676 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6C8370A63 X-Spamd-Result: default: False [0.54 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.41)[0.414,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 14:58:42 -0000 Author: mjg Date: Tue Nov 20 14:58:41 2018 New Revision: 340676 URL: https://svnweb.freebsd.org/changeset/base/340676 Log: Implement unr64 Important users of unr like tmpfs or pipes can get away with just ever-increasing counters, making the overhead of managing the state for 32 bit counters a pessimization. Change it to an atomic variable. This can be further sped up by making the counts variable "allocate" ranges and store them per-cpu. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18054 Modified: head/sys/kern/subr_unit.c head/sys/sys/systm.h Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Tue Nov 20 14:52:43 2018 (r340675) +++ head/sys/kern/subr_unit.c Tue Nov 20 14:58:41 2018 (r340676) @@ -98,6 +98,19 @@ static struct mtx unitmtx; MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF); +#ifdef UNR64_LOCKED +uint64_t +alloc_unr64(struct unrhdr64 *unr64) +{ + uint64_t item; + + mtx_lock(&unitmtx); + item = unr64->counter++; + mtx_unlock(&unitmtx); + return (item); +} +#endif + #else /* ...USERLAND */ #include Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue Nov 20 14:52:43 2018 (r340675) +++ head/sys/sys/systm.h Tue Nov 20 14:58:41 2018 (r340676) @@ -523,6 +523,32 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); +#if defined(__mips__) || defined(__powerpc__) +#define UNR64_LOCKED +#endif + +struct unrhdr64 { + uint64_t counter; +}; + +static __inline void +new_unrhdr64(struct unrhdr64 *unr64, uint64_t low) +{ + + unr64->counter = low; +} + +#ifdef UNR64_LOCKED +uint64_t alloc_unr64(struct unrhdr64 *); +#else +static __inline uint64_t +alloc_unr64(struct unrhdr64 *unr64) +{ + + return (atomic_fetchadd_64(&unr64->counter, 1)); +} +#endif + void intr_prof_stack_use(struct thread *td, struct trapframe *frame); void counted_warning(unsigned *counter, const char *msg); From owner-svn-src-head@freebsd.org Tue Nov 20 14:59:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2711D11321FF; Tue, 20 Nov 2018 14:59:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C15A170BD4; Tue, 20 Nov 2018 14:59:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8857F12D6C; Tue, 20 Nov 2018 14:59:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKExR6L033229; Tue, 20 Nov 2018 14:59:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKExRob033228; Tue, 20 Nov 2018 14:59:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201459.wAKExRob033228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 14:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340677 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C15A170BD4 X-Spamd-Result: default: False [0.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_SHORT(0.43)[0.425,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 14:59:28 -0000 Author: mjg Date: Tue Nov 20 14:59:27 2018 New Revision: 340677 URL: https://svnweb.freebsd.org/changeset/base/340677 Log: pipe: use unr64 Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18054 Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Tue Nov 20 14:58:41 2018 (r340676) +++ head/sys/kern/sys_pipe.c Tue Nov 20 14:59:27 2018 (r340677) @@ -244,7 +244,7 @@ static int pipe_zone_init(void *mem, int size, int fla static void pipe_zone_fini(void *mem, int size); static uma_zone_t pipe_zone; -static struct unrhdr *pipeino_unr; +static struct unrhdr64 pipeino_unr; static dev_t pipedev_ino; SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, pipeinit, NULL); @@ -257,8 +257,7 @@ pipeinit(void *dummy __unused) pipe_zone_ctor, NULL, pipe_zone_init, pipe_zone_fini, UMA_ALIGN_PTR, 0); KASSERT(pipe_zone != NULL, ("pipe_zone not initialized")); - pipeino_unr = new_unrhdr(1, INT32_MAX, NULL); - KASSERT(pipeino_unr != NULL, ("pipe fake inodes not initialized")); + new_unrhdr64(&pipeino_unr, 1); pipedev_ino = devfs_alloc_cdp_inode(); KASSERT(pipedev_ino > 0, ("pipe dev inode not initialized")); } @@ -390,8 +389,6 @@ pipe_dtor(struct pipe *dpipe) funsetown(&peer->pipe_sigio); pipeclose(peer); } - if (ino != 0 && ino != (ino_t)-1) - free_unr(pipeino_unr, ino); } /* @@ -639,7 +636,7 @@ pipe_create(struct pipe *pipe, int backing) (void)pipespace_new(pipe, PIPE_SIZE); } - pipe->pipe_ino = -1; + pipe->pipe_ino = alloc_unr64(&pipeino_unr); } /* ARGSUSED */ @@ -1461,7 +1458,6 @@ pipe_stat(struct file *fp, struct stat *ub, struct ucr struct thread *td) { struct pipe *pipe; - int new_unr; #ifdef MAC int error; #endif @@ -1482,23 +1478,6 @@ pipe_stat(struct file *fp, struct stat *ub, struct ucr return (vnops.fo_stat(fp, ub, active_cred, td)); } - /* - * Lazily allocate an inode number for the pipe. Most pipe - * users do not call fstat(2) on the pipe, which means that - * postponing the inode allocation until it is must be - * returned to userland is useful. If alloc_unr failed, - * assign st_ino zero instead of returning an error. - * Special pipe_ino values: - * -1 - not yet initialized; - * 0 - alloc_unr failed, return 0 as st_ino forever. - */ - if (pipe->pipe_ino == (ino_t)-1) { - new_unr = alloc_unr(pipeino_unr); - if (new_unr != -1) - pipe->pipe_ino = new_unr; - else - pipe->pipe_ino = 0; - } PIPE_UNLOCK(pipe); bzero(ub, sizeof(*ub)); From owner-svn-src-head@freebsd.org Tue Nov 20 15:08:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03B43113269C; Tue, 20 Nov 2018 15:08:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42E51711AD; Tue, 20 Nov 2018 15:08:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wAKF7uWY065222 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 20 Nov 2018 17:07:59 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wAKF7uWY065222 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wAKF7uFC065221; Tue, 20 Nov 2018 17:07:56 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Nov 2018 17:07:56 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340676 - in head/sys: kern sys Message-ID: <20181120150756.GD2378@kib.kiev.ua> References: <201811201458.wAKEwftP033152@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811201458.wAKEwftP033152@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 42E51711AD X-Spamd-Result: default: False [-5.21 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; IP_SCORE(-2.22)[ip: (-2.87), ipnet: 2001:470::/32(-4.57), asn: 6939(-3.58), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:08:08 -0000 On Tue, Nov 20, 2018 at 02:58:41PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Tue Nov 20 14:58:41 2018 > New Revision: 340676 > URL: https://svnweb.freebsd.org/changeset/base/340676 > > Log: > Implement unr64 > > Important users of unr like tmpfs or pipes can get away with just > ever-increasing counters, making the overhead of managing the state > for 32 bit counters a pessimization. > > Change it to an atomic variable. This can be further sped up by making > the counts variable "allocate" ranges and store them per-cpu. > > Reviewed by: kib > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D18054 > > Modified: > head/sys/kern/subr_unit.c > head/sys/sys/systm.h > > Modified: head/sys/kern/subr_unit.c > ============================================================================== > --- head/sys/kern/subr_unit.c Tue Nov 20 14:52:43 2018 (r340675) > +++ head/sys/kern/subr_unit.c Tue Nov 20 14:58:41 2018 (r340676) > @@ -98,6 +98,19 @@ static struct mtx unitmtx; > > MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF); > > +#ifdef UNR64_LOCKED > +uint64_t > +alloc_unr64(struct unrhdr64 *unr64) > +{ > + uint64_t item; > + > + mtx_lock(&unitmtx); > + item = unr64->counter++; > + mtx_unlock(&unitmtx); > + return (item); > +} > +#endif > + > #else /* ...USERLAND */ > > #include > > Modified: head/sys/sys/systm.h > ============================================================================== > --- head/sys/sys/systm.h Tue Nov 20 14:52:43 2018 (r340675) > +++ head/sys/sys/systm.h Tue Nov 20 14:58:41 2018 (r340676) > @@ -523,6 +523,32 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); > int alloc_unrl(struct unrhdr *uh); > void free_unr(struct unrhdr *uh, u_int item); > > +#if defined(__mips__) || defined(__powerpc__) Please note what I asked about this #ifdefs in the review. mips and powerpc machine/atomic.h should define some symbol like __ATOMIC_NO_64_OPS and this case should be handled in less arch-explicit manner. > +#define UNR64_LOCKED > +#endif > + > +struct unrhdr64 { > + uint64_t counter; > +}; > + > +static __inline void > +new_unrhdr64(struct unrhdr64 *unr64, uint64_t low) > +{ > + > + unr64->counter = low; > +} > + > +#ifdef UNR64_LOCKED > +uint64_t alloc_unr64(struct unrhdr64 *); > +#else > +static __inline uint64_t > +alloc_unr64(struct unrhdr64 *unr64) > +{ > + > + return (atomic_fetchadd_64(&unr64->counter, 1)); > +} > +#endif > + > void intr_prof_stack_use(struct thread *td, struct trapframe *frame); > > void counted_warning(unsigned *counter, const char *msg); From owner-svn-src-head@freebsd.org Tue Nov 20 15:12:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FBF11132947; Tue, 20 Nov 2018 15:12:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D79D9715F6; Tue, 20 Nov 2018 15:12:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F2AC1308E; Tue, 20 Nov 2018 15:12:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKFCb73042990; Tue, 20 Nov 2018 15:12:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKFCbv4042989; Tue, 20 Nov 2018 15:12:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811201512.wAKFCbv4042989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 15:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340678 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 340678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D79D9715F6 X-Spamd-Result: default: False [0.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.425,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:12:38 -0000 Author: markj Date: Tue Nov 20 15:12:37 2018 New Revision: 340678 URL: https://svnweb.freebsd.org/changeset/base/340678 Log: Handle kernel superpage mappings in pmap_remove_l2(). PR: 233088 Reviewed by: alc, andrew, kib Tested by: sbruno MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17981 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Nov 20 14:59:27 2018 (r340677) +++ head/sys/arm64/arm64/pmap.c Tue Nov 20 15:12:37 2018 (r340678) @@ -2382,8 +2382,40 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entr return (true); } +static void +pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) +{ + pt_entry_t newl2, oldl2; + vm_page_t ml3; + vm_paddr_t ml3pa; + + KASSERT(!VIRT_IN_DMAP(va), ("removing direct mapping of %#lx", va)); + KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + ml3 = pmap_remove_pt_page(pmap, va); + if (ml3 == NULL) + panic("pmap_remove_kernel_l2: Missing pt page"); + + ml3pa = VM_PAGE_TO_PHYS(ml3); + newl2 = ml3pa | L2_TABLE; + + /* + * Initialize the page table page. + */ + pagezero((void *)PHYS_TO_DMAP(ml3pa)); + + /* + * Demote the mapping. The caller must have already invalidated the + * mapping (i.e., the "break" in break-before-make). + */ + oldl2 = pmap_load_store(l2, newl2); + KASSERT(oldl2 == 0, ("%s: found existing mapping at %p: %#lx", + __func__, l2, oldl2)); +} + /* - * pmap_remove_l2: do the things to unmap a level 2 superpage in a process + * pmap_remove_l2: Do the things to unmap a level 2 superpage. */ static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, @@ -2419,16 +2451,18 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ vm_page_aflag_clear(m, PGA_WRITEABLE); } } - KASSERT(pmap != kernel_pmap, - ("Attempting to remove an l2 kernel page")); - ml3 = pmap_remove_pt_page(pmap, sva); - if (ml3 != NULL) { - pmap_resident_count_dec(pmap, 1); - KASSERT(ml3->wire_count == NL3PG, - ("pmap_remove_l2: l3 page wire count error")); - ml3->wire_count = 1; - vm_page_unwire_noq(ml3); - pmap_add_delayed_free_list(ml3, free, FALSE); + if (pmap == kernel_pmap) { + pmap_remove_kernel_l2(pmap, l2, sva); + } else { + ml3 = pmap_remove_pt_page(pmap, sva); + if (ml3 != NULL) { + pmap_resident_count_dec(pmap, 1); + KASSERT(ml3->wire_count == NL3PG, + ("pmap_remove_l2: l3 page wire count error")); + ml3->wire_count = 1; + vm_page_unwire_noq(ml3); + pmap_add_delayed_free_list(ml3, free, FALSE); + } } return (pmap_unuse_pt(pmap, sva, l1e, free)); } From owner-svn-src-head@freebsd.org Tue Nov 20 15:14:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F9881132A0B; Tue, 20 Nov 2018 15:14:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32E81717BF; Tue, 20 Nov 2018 15:14:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA40D13096; Tue, 20 Nov 2018 15:14:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKFEVJL043125; Tue, 20 Nov 2018 15:14:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKFEVqP043123; Tue, 20 Nov 2018 15:14:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201514.wAKFEVqP043123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 15:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340679 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 340679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32E81717BF X-Spamd-Result: default: False [0.57 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.425,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:14:32 -0000 Author: mjg Date: Tue Nov 20 15:14:30 2018 New Revision: 340679 URL: https://svnweb.freebsd.org/changeset/base/340679 Log: tmpfs: use unr64 for inode numbers Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Tue Nov 20 15:12:37 2018 (r340678) +++ head/sys/fs/tmpfs/tmpfs.h Tue Nov 20 15:14:30 2018 (r340679) @@ -353,7 +353,7 @@ struct tmpfs_mount { ino_t tm_nodes_max; /* unrhdr used to allocate inode numbers */ - struct unrhdr * tm_ino_unr; + struct unrhdr64 tm_ino_unr; /* Number of nodes currently that are in use. */ ino_t tm_nodes_inuse; Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Tue Nov 20 15:12:37 2018 (r340678) +++ head/sys/fs/tmpfs/tmpfs_subr.c Tue Nov 20 15:14:30 2018 (r340679) @@ -230,7 +230,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount nnode->tn_uid = uid; nnode->tn_gid = gid; nnode->tn_mode = mode; - nnode->tn_id = alloc_unr(tmp->tm_ino_unr); + nnode->tn_id = alloc_unr64(&tmp->tm_ino_unr); nnode->tn_refcount = 1; /* Type-specific initialization. */ @@ -368,13 +368,6 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type); } - /* - * If we are unmounting there is no need for going through the overhead - * of freeing the inodes from the unr individually, so free them all in - * one go later. - */ - if (!detach) - free_unr(tmp->tm_ino_unr, node->tn_id); uma_zfree(tmp->tm_node_pool, node); TMPFS_LOCK(tmp); tmpfs_free_tmp(tmp); Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Nov 20 15:12:37 2018 (r340678) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Nov 20 15:14:30 2018 (r340679) @@ -231,7 +231,7 @@ tmpfs_mount(struct mount *mp) tmp->tm_pages_max = pages; tmp->tm_pages_used = 0; - tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->tm_allnode_lock); + new_unrhdr64(&tmp->tm_ino_unr, 2); tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent", sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); @@ -248,7 +248,6 @@ tmpfs_mount(struct mount *mp) if (error != 0 || root == NULL) { uma_zdestroy(tmp->tm_node_pool); uma_zdestroy(tmp->tm_dirent_pool); - delete_unrhdr(tmp->tm_ino_unr); free(tmp, M_TMPFSMNT); return (error); } @@ -343,8 +342,6 @@ tmpfs_free_tmp(struct tmpfs_mount *tmp) uma_zdestroy(tmp->tm_dirent_pool); uma_zdestroy(tmp->tm_node_pool); - clear_unrhdr(tmp->tm_ino_unr); - delete_unrhdr(tmp->tm_ino_unr); mtx_destroy(&tmp->tm_allnode_lock); MPASS(tmp->tm_pages_used == 0); From owner-svn-src-head@freebsd.org Tue Nov 20 15:28:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 153AB1132E7F; Tue, 20 Nov 2018 15:28:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 600B471E33; Tue, 20 Nov 2018 15:28:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt1-x841.google.com with SMTP id k12so389149qtf.7; Tue, 20 Nov 2018 07:28:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=B4HBmYYkinLMOkjvB2w+eLrncZ9/NG2Z9ajE346LV2g=; b=l7V1921QXaBPBHG8szjTbTQT7fD4iiKkE23go6HkNzVUUCD158jJPoQHqmzPucts2H PsDUMkeUK8HltuLtNqgsFzDzralwwNba25CSU5oKtAhFj5jzIA25bajtAY52QkUF256l I+Lh3/J5pnF/xVjuft570ngjiV6qHiCfrE51QWRf2ZlT6mXjjKt9w49kEUuWDb8moARS uVozVq2uaqibrCCs5NjgCsrqIXFYk4q6jwMVT3kSO7B1H1S+wu+odk2xt0+avxfuIk/+ a6izqaKVe1/JEFkhAHjZx6KOBPvyZDzoOIKF7OyxqQoyZ+uQ8NLR57Fqj/EjtxvA7V/7 YYCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=B4HBmYYkinLMOkjvB2w+eLrncZ9/NG2Z9ajE346LV2g=; b=pwk8qp2wZpVmdebjT2GZ9TjHG3PfK3vOx6LB0BH0etm17kPXqO4WKeIvuv+QGBvDuP 8mUEOS+PcdlwaK6HQlVNczsFlsqugHmmPi4cmNe5AJ7co9WgMGaa2HSfux0zZRcrmmHe fvHeQG7kM7L09UwvjS4SKTyR8M9hAWuZF/llnpOQ5IXfQxqMm15vbnHK/f9rU39gMlPe NSb3hAi0kdDbyI+rxKarsZCCJyzsQkFmqiDinChr1xQlLQrxlu3AxM0sMea3SGWNUW8P cZ0VqDJ1AkoI5WdGWYOGD77pexDCW8q1reLbu9HAGNcVQ9gO8wqRqgLHJ02DtosWtlKu eZNg== X-Gm-Message-State: AGRZ1gIQXPaAQSIQclKPY4O9FDdsLIwEGW84kJbF0EPJDCvuHy+2mxdM jmgOxhgF0IAjojL8TQtilgz1GdGpdQI8WVbZBzQ= X-Google-Smtp-Source: AJdET5fzi10XqtW2k4I61qgwwFGIZkZ30PFPGwRZ16glh2wZT6SCxt91qaTE4xGe454+w4oIMeC30PnbgwazWOiIzmc= X-Received: by 2002:ac8:46c6:: with SMTP id h6mr2289981qto.315.1542727725829; Tue, 20 Nov 2018 07:28:45 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac8:784:0:0:0:0:0 with HTTP; Tue, 20 Nov 2018 07:28:45 -0800 (PST) In-Reply-To: <20181120150756.GD2378@kib.kiev.ua> References: <201811201458.wAKEwftP033152@repo.freebsd.org> <20181120150756.GD2378@kib.kiev.ua> From: Mateusz Guzik Date: Tue, 20 Nov 2018 16:28:45 +0100 Message-ID: Subject: Re: svn commit: r340676 - in head/sys: kern sys To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 600B471E33 X-Spamd-Result: default: False [-3.62 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.964,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-0.89)[-0.894,0]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.60)[-0.598,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[1.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-0.16)[ip: (3.29), ipnet: 2607:f8b0::/32(-2.37), asn: 15169(-1.61), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:28:47 -0000 On 11/20/18, Konstantin Belousov wrote: > On Tue, Nov 20, 2018 at 02:58:41PM +0000, Mateusz Guzik wrote: >> Author: mjg >> Date: Tue Nov 20 14:58:41 2018 >> New Revision: 340676 >> URL: https://svnweb.freebsd.org/changeset/base/340676 >> >> Log: >> Implement unr64 >> >> Important users of unr like tmpfs or pipes can get away with just >> ever-increasing counters, making the overhead of managing the state >> for 32 bit counters a pessimization. >> >> Change it to an atomic variable. This can be further sped up by making >> the counts variable "allocate" ranges and store them per-cpu. >> >> Reviewed by: kib >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D18054 >> >> Modified: >> head/sys/kern/subr_unit.c >> head/sys/sys/systm.h >> >> Modified: head/sys/kern/subr_unit.c >> ============================================================================== >> --- head/sys/kern/subr_unit.c Tue Nov 20 14:52:43 2018 (r340675) >> +++ head/sys/kern/subr_unit.c Tue Nov 20 14:58:41 2018 (r340676) >> @@ -98,6 +98,19 @@ static struct mtx unitmtx; >> >> MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF); >> >> +#ifdef UNR64_LOCKED >> +uint64_t >> +alloc_unr64(struct unrhdr64 *unr64) >> +{ >> + uint64_t item; >> + >> + mtx_lock(&unitmtx); >> + item = unr64->counter++; >> + mtx_unlock(&unitmtx); >> + return (item); >> +} >> +#endif >> + >> #else /* ...USERLAND */ >> >> #include >> >> Modified: head/sys/sys/systm.h >> ============================================================================== >> --- head/sys/sys/systm.h Tue Nov 20 14:52:43 2018 (r340675) >> +++ head/sys/sys/systm.h Tue Nov 20 14:58:41 2018 (r340676) >> @@ -523,6 +523,32 @@ int alloc_unr_specific(struct unrhdr *uh, u_int >> item); >> int alloc_unrl(struct unrhdr *uh); >> void free_unr(struct unrhdr *uh, u_int item); >> >> +#if defined(__mips__) || defined(__powerpc__) > Please note what I asked about this #ifdefs in the review. mips > and powerpc machine/atomic.h should define some symbol like > __ATOMIC_NO_64_OPS and this case should be handled in less arch-explicit > manner. > Right, should have mentioned that in the commit message. Anyhow, mips has some degree of 64 bit ops even for 32 bits so this becomes more iffy. In particular it does have atomic_add_64. I don't have a good way to test mips atomics and since non-atomic version for powerpc was needed anyway I decided not to try to add one. With this in place a global macro would have to explicitly indicate lack of fetchadd, not 64 ops. So I think the current state is good enough for now. Imo in the long run 64 bit ops should just get emulated with a lock protected code in general manner. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Nov 20 15:35:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF448113333F; Tue, 20 Nov 2018 15:35:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 2AB3A72541; Tue, 20 Nov 2018 15:35:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 5644B10588AE; Wed, 21 Nov 2018 02:35:32 +1100 (AEDT) Date: Wed, 21 Nov 2018 02:35:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Bruce Evans , Andriy Gapon , "Rodney W. Grimes" , Allan Jude , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340450 - head/sys/sys In-Reply-To: Message-ID: <20181120225901.H1386@besplex.bde.org> References: <201811190104.wAJ14CaE059062@pdx.rh.CN85.dnsmgr.net> <5e227743-6463-d395-f2ba-da8d4ba248ca@FreeBSD.org> <20181120005944.B1050@besplex.bde.org> <20181120014951.J1250@besplex.bde.org> <20181120023823.M1428@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=6I5d2MoRAAAA:8 a=fsi5WZZrgbGlQf9aq78A:9 a=5ABlwM8w8ixAeB2D:21 a=wwMOKTSRVD5hy9iK:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 2AB3A72541 X-Spamd-Result: default: False [-0.43 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.09)[-0.085,0]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; FREEMAIL_FROM(0.00)[optusnet.com.au]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[optusnet.com.au]; NEURAL_HAM_LONG(-0.39)[-0.392,0]; NEURAL_SPAM_SHORT(0.37)[0.368,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[extmail.optusnet.com.au]; RCPT_COUNT_SEVEN(0.00)[9]; IP_SCORE(-0.01)[country: AU(-0.05)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; FREEMAIL_CC(0.00)[optusnet.com.au]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:35:47 -0000 On Mon, 19 Nov 2018, Warner Losh wrote: > On Mon, Nov 19, 2018 at 9:05 AM Bruce Evans wrote: > >> On Tue, 20 Nov 2018, Bruce Evans wrote: >> >>> On Tue, 20 Nov 2018, Bruce Evans wrote: >>> >>>> On Mon, 19 Nov 2018, Warner Losh wrote: >>> ... >>> I found my test program. >>> >>>>> But I think I understand the problem now. >>>>> >>>>> mstosbt(1000) is overflowing with my change, but not without because >> we're >>>>> adding 2^32 to a number that's ~900 away from overflowing changing a >> very >>>> >>>> This value is just invalid. Negative values are obviously invalid. >>>> Positive >>>> values of more than 1 second are invalid. In the old version, values of >>>> precisely 1 second don't overflow since the scale factor is rounded >> down; >>>> the result is just 1 unit lower than 1 second. Overflow (actually >>>> truncation) >>>> occurs at 1 unit above 1 second. E.g., sbttoms(mstosbt(1000)) was 999 >> and >>>> sbttoms(mstosbt(1001)) was 0. Now in my fixed version, >>>> sbttoms(mstosbt(1000)) >>>> is truncated to 0 and sbttoms(mstosbt(1001)) is truncated to 1. This remains very broken. I just noticed that the inverse functions don't support sbt's much larger than 1 second either. E.g., sbttons multiplies by 1 billion, so it overflows for sbt's larger than 4.29 seconds. It is better to not support times larger than 1 second in these functions than to pessimize them all. You only pessimized some of them. The inverse functions still overflow at small values; the direct functions still overflow at large values. >> Here are all uses of these functions in kern outside of sys/time.h: >> >> XX arm/arm/mpcore_timer.c: sc->et.et_min_period = nstosbt(20); >> >> OK since 20 ns is less than 1 second. >> >> XX cddl/compat/opensolaris/sys/kcondvar.h: return >> (cv_timedwait_sbt(cvp, mp, nstosbt(tim), nstosbt(res), 0)); >> XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: >> pause_sbt("dmu_tx_delay", nstosbt(wakeup), >> XX cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c: >> nstosbt(zfs_delay_resolution_ns), C_ABSOLUTE); >> XX cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c: sbintime_t sleep = >> nstosbt((zilog->zl_last_lwb_latency * pct) / 100); >> XX compat/linuxkpi/common/include/linux/delay.h: >> pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK); >> XX compat/linuxkpi/common/src/linux_hrtimer.c: >> nstosbt(hrtimer->expires), nstosbt(hrtimer->precision), 0); >> XX compat/linuxkpi/common/src/linux_hrtimer.c: >> callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(time)), >> XX compat/linuxkpi/common/src/linux_hrtimer.c: nstosbt(nsec), >> hrtimer_call_handler, hrtimer, 0); >> XX compat/linuxkpi/common/src/linux_hrtimer.c: >> callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(interval)), >> XX compat/linuxkpi/common/src/linux_hrtimer.c: >> nstosbt(hrtimer->precision), hrtimer_call_handler, hrtimer, 0); >> XX compat/linuxkpi/common/src/linux_schedule.c: ret = >> -pause_sbt("lnxsleep", mstosbt(ms), 0, C_HARDCLOCK | C_CATCH); >> >> All of the above might are broken unless their timeout arg is restricted to >> less than 1 second. >> >> Also, at least the sleep and pause calls in the above probably have a >> style bug in knowing about sbt's at all. More important functions >> like msleep() hide the use of sbt's and use fuzzier scale factors like >> tick_sbt. > > Yes. It's for these users I'm fixing the >= 1s cases. These functions are broken in FreeBSD-11 and FreeBSD-12 too. They were last correct in FreeBSD-10, where there weren't so many linuxkpi functions, but where the zfs code is similar except it is missing the overflow bugs. E.g., where the above does nstosbt(wakeup), FreeBSD-10 does wakeup * SBT_1NS. SBT_1NS is 4, but the infinite-precision scale factor is 4.294967296. The sloppy scale factor is gives large absolute errors for large args, but at least it doesn't overflow for merely large args; it does overflow for huge args. Maybe zfs's wakeup arg is always less that 1 second, so it wasn't broken by blind conversion to use nstosbt(), but that is unclear. Conversions in the other direction are very rare, at least using the conversion functions instead of divisions by SBT_*. sbttous() is used once in dev/ow and once in kern_sysctl.c; sbttoms() is used once in kern_sysctl.c; sbttons() is never used. Thus the overflow in sbttons() doesn't matter, and overflow in kern_sysctl.c's misuse of sbttous() only occurs at 4294+ seconds. > >> XX dev/iicbus/nxprtc.c: pause_sbt("nxpotp", mstosbt(100), >> mstosbt(10), 0); >> XX dev/iicbus/nxprtc.c: pause_sbt("nxpbat", mstosbt(100), 0, 0); >> >> OK since 100 ms is less than 1 second. >> >> XX kern/kern_sysctl.c: sb = ustosbt(tt); >> XX kern/kern_sysctl.c: sb = mstosbt(tt); >> >> Recently added bugs. The args is supplied by applications so can be far >> above >> 1 second. >> >> Also, these functions have a bogus API that takes uint64_t args. sbt's >> can't represent that high, and the API doesn't support failure, so callers >> have the burden of passing valid values. It is easiest to only support >> args >> up to 1 second and require the caller to handle seconds. > > It's just as easy to cope. No, it is not. In your next committed versions, all functions still overflow, just at larger values. >> Lots of itimer and select() code handle the corresponding problem for >> timevals and timespecs almost correctly. Timevals and timespecs already >> have the seconds part separate and itimer and select() syscalls do validity >> checking on the fractional seconds, so there is no problem converting the >> fractional sections to an sbt. Howver, the seconds part has type time_t >> and this can be int64_t, which sbt's cannot represent. Also, POSIX doesn't >> permit failure for seconds values that are representable by time_t. The >> almost correct handling is to split up large seconds values in some cases >> and break POSIX conformance by silently reducing the seconds value in >> other cases. The reduction is usually to INT32_MAX / 2. This allows >> adding 2 limited values but it is not obvious that this is enough since >> rounding up twice or just adding 2 more would give overflow. > > Right, that's beyond the scope of what I'm fixing. Better fix the overflows in FreeBSD-11 and FreeBSD-12 (or get their author to fix them) before adding complications. > https://reviews.freebsd.org/D18051 > > Contains the changes. They address all the actual problems you've raised, > but I'm going to disagree that 'ull' is bogus. For FreeBSD, it's fine and > it's a lot more readable than the alternatives. I can't quote it in mail from there, but saw a committed version which I don't like, though it passes my tests. I said that long long is an abomination. 'ull' doesn't even have any effect in this case. It was last needed for gcc -std=before-c99 on i386, since C before C99 doesn't have the abomination and gcc warns about constants that are so large that there type is [unsigned] long long. There are no such constants on 64-bit arches, but there are some on 32-bit arches. clang is too broken to warn about this. Now kern.pre.mk enforces std=c99 although this is wrong (gnu99 is needed, as in userland), so the warning never occurs even for gcc. If you don't use explicitly typed constants, then constants automatically have the correct type. This is long long or unsigned long long for large constants on i386 -- there is no way to avoid the abomination then. But on amd64, the correct type for large constants is long or unsigned long. You might need ull constants to get unsigned arithmetic instead of signed arithmetic, where the natural type of the large constants is only long or long long. Your comments allude to this. But the conversions are too simple or bogusly typed to need this here -- almost all variable types are uint64_t although things overflow at about UINT32_MAX, so the natural arithmetic is uint64_t except on exotic unsupported/unsupportable arches where uint64_t has lower rank than int (then uint64_t promotes to only int, so there may be sign extension bugs, but using explicit unsigned long long constants gives some further promotions to unsigned long long). Using 'ull' is also a lexical style bug. Old code consistently uses LL. This was needed for the obfuscation given by using large decimal constants 10-15 years ago before -std was c99. This gives signed constants, and old code also consistently bogusly casts these constants to uint64_t to ensure unsigned arithmetic (except on the exotic arches). Bugs in the committed version: XX Log: XX Ensure that all values of ns, us and ms work for {n,u,m}stosbt All values don't work. E.g., since nstosbt multiplies a 64-bit unsigned value by approx. 4 and the result is a signed 64-bit value, values larger than about 1/8 of the maximum in ns overflow to a garbage negative sbt value. XX Also, use a shift one fewer left to avoid integer overflow causing XX incorrect results, and adjust the equasion accordingly. Document this. I'm not sure how this helps. When I tried it with my most accurate version, it reduced the accuracy of sbt values from +-1 in sbt units to +-2, for the obvious reason than the sloppy shift loses 1 bit. XX A test program to test all cases will be committed shortly. The test XX exaustively tries every value (thanks to bde for the test). Testing all 2**64 cases given by pretending to support times above 1 second makes exhaustive testing impossible. XX Modified: head/sys/sys/time.h XX ============================================================================== XX --- head/sys/sys/time.h Tue Nov 20 01:59:57 2018 (r340663) XX +++ head/sys/sys/time.h Tue Nov 20 07:11:23 2018 (r340664) XX @@ -162,9 +162,24 @@ sbttobt(sbintime_t _sbt) XX * large roundoff errors which sbttons() and nstosbt() avoid. Millisecond and XX * microsecond functions are also provided for completeness. XX * XX - * These functions return the smallest sbt larger or equal to the number of XX - * seconds requested so that sbttoX(Xtosbt(y)) == y. The 1 << 32 - 1 term added XX - * transforms the >> 32 from floor() to ceil(). XX + * These functions return the smallest sbt larger or equal to the XX + * number of seconds requested so that sbttoX(Xtosbt(y)) == y. Unlike No, these functions return an sbt that is much larger than the perfectly rounded one. See my old mail for the details, and for a variant that does perfect rounding. XX + * The naive computation we'd do is this XX + * ((unit * 2^64 / SIFACTOR) + 2^32-1) >> 32 XX + * However, that overflows. Instead, we compute XX + * ((unit * 2^63 / SIFACTOR) + 2^31-1) >> 32 XX + * and use pre-computed constants that are the ceil of the 2^63 / SIFACTOR XX + * term to ensure we are using exactly the right constant. We use the lesser XX + * evil of ull rather than a uint64_t cast to ensure we have well defined XX + * right shift semantics. With these changes, we get all the ns, us and ms XX + * conversions back and forth right. XX + * Note: This file is used for both kernel and userland includes, so we can't XX + * rely on KASSERT being defined, nor can we pollute the namespace by including XX + * assert.h. Many style bugs: - this comment has fancy formatting, but it is not protected by '/*-'. - this comment misformats sentence breaks as 1 spaces. Old comments in this file were carefully formatted to use 2 spaces. There is no need to calculate these constants manually. ISTR spending many mails instructing ian@ about their previous correct caclulation. The KASSERTs are never defined in the kernel either. See below. XX */ XX static __inline int64_t XX sbttons(sbintime_t _sbt) XX @@ -176,8 +191,18 @@ sbttons(sbintime_t _sbt) XX static __inline sbintime_t XX nstosbt(int64_t _ns) XX { XX + sbintime_t sb = 0; Style bug: initialization in declaration. XX XX - return ((_ns * (((uint64_t)1 << 63) / 500000000) + (1ull << 32) - 1) >> 32); XX +#ifdef KASSERT XX + KASSERT(_ns >= 0, ("Negative values illegal for nstosbt: %jd", _ns)); XX +#endif KASSERT is never defined here in correct kernel code, due to standard namespace pollution. Correct kernel code includes first, and in the kernel includes this file. KASSERT is not defined then. Correct kernel code includes second. It takes chumminess with the misimplementation to get KASSERT defined here. has grown much more massive and disgusting pollution than , but not enough for it to be self-sufficient. First you have to provide a replacement for that includes almost everything in it except . Include that and then . defines KASSERT early. It includes in is grosser pollution section later. This includes , and KASSERT is defined before it is used in this case. XX + if (_ns >= SBT_1S) { XX + sb = (_ns / 1000000000) * SBT_1S; XX + _ns = _ns % 1000000000; XX + } Not too pessimal since this case is rarely reached. XX + /* 9223372037 = ceil(2^63 / 1000000000) */ XX + sb += ((_ns * 9223372037ull) + 0x7fffffff) >> 31; This is harder to understand than my versions. First I fix the obfuscations and other style bugs in it: - contrary to what I said above, everything isn't uint64_t, so there is a sign extension bug in practice which the explicit unsigned long long constant fixes in an ugly way. _ns is only int64_t, and the natural constant is not unsigned, so the multiplication by the natural constant overflows to a negative value at about 0.5 seconds and then the shift is signed and messes up the negative value some more - however, there is no need to reduce the powers of 2 by 1. Cleaned up version with manually calculated multiplicative constant: /* 18446744973 = ceil(2**64 / 10**9) */ sb += (_ns * (uint64_t)18446744973 + 0xffffffff) >> 32; (Also remove comments about reducing the powers by 1.) Cleaned up version with the compiler calculating the multiplicative constant: sb += (_ns * (((uint64_t)1 << 63) / 500000000 + 1) + 0xffffffff) >> 32; The additive constant is harder to understand. Rounding up the multiplicative constant gives an increment that is higher than the infinite-precision value before the addition and the shift, but the shift often loses the extras. The additive constant keeps enough extras. The resulting sbt is often too high, but the important case when _ns = 0 is not converted to a nonzero sbt like some of my versions do. Since rounding up to the ceiling increases the multiplier by ~0.3 in units of 2**32, when _ns = 10**9-1, the increase from the scaling is ~300e8 and the increase from the additive constant is ~2**32 for a total increase of not much more than 1.1*2**32 in units of 2**32 or 1.1 in sbt units. This means that the sbt value is often 1 higher than the correctly rounded ceiling. The versions that round down the multiplier reduce it by ~0.7 in units of 2**32 and need an additive correction of about 4 sbt units to compensate. Most or all of my versions added this even when _ns = 0 when it is too much. It is not obvious that converting sbt values that are 1.1 units too high back to nanoseconds restores the original value (by rounding down). Increasing the multiplier by 1 more gives sbt values that are only 0.2 units higher than 1.1 when _ns = 10**9-1, but breaks the conversion back in 85% of cases (not just for large _ns). XX + return (sb); XX } XX XX static __inline int64_t XX ... Similarly. Bruce From owner-svn-src-head@freebsd.org Tue Nov 20 15:53:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DEC01133B58 for ; Tue, 20 Nov 2018 15:53:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x132.google.com (mail-it1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32C5173147 for ; Tue, 20 Nov 2018 15:53:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x132.google.com with SMTP id m15so4214773itl.4 for ; Tue, 20 Nov 2018 07:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w4vuG4uBzBVv621d+yxonx8CORiDGFCyoV+I547NDdI=; b=tI4XN7630T2j26bhXzmF3fPRBwInLyp/ODWkZUnk4AgbC3M+ZhWDKuuiWN463WqfOo ZGeLgUrAFBO6ig6wXCS5kQ6BpRCuJszKhrVXKfl8vUnca4b3l5Tft3qdkLFnInfAL7Sc M85rHqrx8pl0siBW9OsLtUrqItEZ3OP9ltoUwaxc/JxceXOwJzPu7vCDoOOoXBsUazVr 9N61IryixxqSvxzSYYD2EWzHlMbZDAx/WZXsPvYRYc2DZdKbwIXHu3+yuMzEy9QbuNzS Q2YSmss13ZcmRT4OwzhazqxcRT3LXYBNONUTVkJLUVoNRjR6UPt9jzcSOvU8BBMhM44h /JEw== 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=w4vuG4uBzBVv621d+yxonx8CORiDGFCyoV+I547NDdI=; b=UjfTfQ5vIPUEnoPMyB0E+/epV+7Q17Q/PA6xxMlR1IeiAkTc4pnKDVYSHDbAz4/hT8 PEHS9iUr+FIipjmGK4r4kmN1bvi/0ZSy5XZVFN06OcuEpFVsycEOoXs+lBedJEJVzMqL Oya7d7pQFeWN8cq/xybQNxIhMC4Kix/YPFi5Ri7qic7//NOxnOQ5ZXWG7DdYm2WqWp+u gF8FzdqFW6Q5lPOk8H09AVlX9icgMc+LHf45GMEbAvl6SmN2ei/qq6Nvv/EiSH7P2pm3 luJccViXnc/XYRz8LPXvGBQzG0JM6clYscwYsCSbuaGWTOdGKHH2yu3dSAzCuOvDECOy My2Q== X-Gm-Message-State: AA+aEWZ1c+BeWGcUdBoMQuLHQvTW8E6I4bf2CHp4i5TQh052u6u8eKsU qzunTZ7pNJNuoDIFrg2/Igezxn6J8R3W/EZZ1b3QkQ== X-Google-Smtp-Source: AFSGD/UsxcdAgKPjBYpZPTGmDaJ0YlAK5+K8sIleh10qQTrDbOSpxq1cF3g/9mlDG2oamLBNWrn5kTqjundk+HiyjzY= X-Received: by 2002:a02:3da:: with SMTP id e87mr1935345jae.78.1542729202152; Tue, 20 Nov 2018 07:53:22 -0800 (PST) MIME-Version: 1.0 References: <201811201458.wAKEwftP033152@repo.freebsd.org> <20181120150756.GD2378@kib.kiev.ua> In-Reply-To: From: Warner Losh Date: Tue, 20 Nov 2018 08:53:11 -0700 Message-ID: Subject: Re: svn commit: r340676 - in head/sys: kern sys To: Mateusz Guzik Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 32C5173147 X-Spamd-Result: default: False [-4.83 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.83)[ip: (-5.09), ipnet: 2607:f8b0::/32(-2.36), asn: 15169(-1.61), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_CC(0.00)[gmail.com] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 15:53:24 -0000 On Tue, Nov 20, 2018 at 8:28 AM Mateusz Guzik wrote: > On 11/20/18, Konstantin Belousov wrote: > > On Tue, Nov 20, 2018 at 02:58:41PM +0000, Mateusz Guzik wrote: > >> Author: mjg > >> Date: Tue Nov 20 14:58:41 2018 > >> New Revision: 340676 > >> URL: https://svnweb.freebsd.org/changeset/base/340676 > >> > >> Log: > >> Implement unr64 > >> > >> Important users of unr like tmpfs or pipes can get away with just > >> ever-increasing counters, making the overhead of managing the state > >> for 32 bit counters a pessimization. > >> > >> Change it to an atomic variable. This can be further sped up by making > >> the counts variable "allocate" ranges and store them per-cpu. > >> > >> Reviewed by: kib > >> Sponsored by: The FreeBSD Foundation > >> Differential Revision: https://reviews.freebsd.org/D18054 > >> > >> Modified: > >> head/sys/kern/subr_unit.c > >> head/sys/sys/systm.h > >> > >> Modified: head/sys/kern/subr_unit.c > >> > ============================================================================== > >> --- head/sys/kern/subr_unit.c Tue Nov 20 14:52:43 2018 > (r340675) > >> +++ head/sys/kern/subr_unit.c Tue Nov 20 14:58:41 2018 > (r340676) > >> @@ -98,6 +98,19 @@ static struct mtx unitmtx; > >> > >> MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF); > >> > >> +#ifdef UNR64_LOCKED > >> +uint64_t > >> +alloc_unr64(struct unrhdr64 *unr64) > >> +{ > >> + uint64_t item; > >> + > >> + mtx_lock(&unitmtx); > >> + item = unr64->counter++; > >> + mtx_unlock(&unitmtx); > >> + return (item); > >> +} > >> +#endif > >> + > >> #else /* ...USERLAND */ > >> > >> #include > >> > >> Modified: head/sys/sys/systm.h > >> > ============================================================================== > >> --- head/sys/sys/systm.h Tue Nov 20 14:52:43 2018 (r340675) > >> +++ head/sys/sys/systm.h Tue Nov 20 14:58:41 2018 (r340676) > >> @@ -523,6 +523,32 @@ int alloc_unr_specific(struct unrhdr *uh, u_int > >> item); > >> int alloc_unrl(struct unrhdr *uh); > >> void free_unr(struct unrhdr *uh, u_int item); > >> > >> +#if defined(__mips__) || defined(__powerpc__) > > Please note what I asked about this #ifdefs in the review. mips > > and powerpc machine/atomic.h should define some symbol like > > __ATOMIC_NO_64_OPS and this case should be handled in less arch-explicit > > manner. > > > > Right, should have mentioned that in the commit message. > > Anyhow, mips has some degree of 64 bit ops even for 32 bits so > this becomes more iffy. In particular it does have atomic_add_64. > I don't have a good way to test mips atomics and since non-atomic > version for powerpc was needed anyway I decided not to try to > add one. > I thought the 64-bit stuff was not present in true 32-bit mips at all. You need the lld/scd instructions to do 64-bit atomics which are only available in a 64-bit environment (eg n32 or n64 execution). They throw a fatal machine error if you execute them in o32 land. And I think the proper ifdef for this is defined(mips) && !defined(__mips_n64) && !defined(__mips_n32) or something horrible like that to not pessimize 64-bit executions. > With this in place a global macro would have to explicitly indicate > lack of fetchadd, not 64 ops. So I think the current state is good > enough for now. Imo in the long run 64 bit ops should just get > emulated with a lock protected code in general manner. > We already do this for ARM. On armv4/5, there are no atomic instructions at all, so we emulate them by doing the normal operation with interrupts disabled. Since there's no MP designs from that era we support, this works out well. For most MIPS designs, this would work well too since the 32-bit mips designs we support are mostly UP (though to be fair, one can build 32-bit kernels for our 64-bit stuff, but they could cope with the lock). Warner From owner-svn-src-head@freebsd.org Tue Nov 20 16:06:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7199C11342A6; Tue, 20 Nov 2018 16:06:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 CF51E739B2; Tue, 20 Nov 2018 16:06:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAKG6gnL067433; Tue, 20 Nov 2018 08:06:42 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAKG6gu5067432; Tue, 20 Nov 2018 08:06:42 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811201606.wAKG6gu5067432@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340678 - head/sys/arm64/arm64 In-Reply-To: <201811201512.wAKFCbv4042989@repo.freebsd.org> To: Mark Johnston Date: Tue, 20 Nov 2018 08:06:42 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@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: CF51E739B2 X-Spamd-Result: default: False [1.23 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.57)[0.570,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.55)[0.553,0]; NEURAL_HAM_SHORT(-0.76)[-0.760,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 16:06:44 -0000 > Author: markj > Date: Tue Nov 20 15:12:37 2018 > New Revision: 340678 > URL: https://svnweb.freebsd.org/changeset/base/340678 > > Log: > Handle kernel superpage mappings in pmap_remove_l2(). > > PR: 233088 > Reviewed by: alc, andrew, kib > Tested by: sbruno > MFC after: 3 days > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17981 Mark, If this is the fix for the aarch64/arm64 build cluster failure could you *please* make sure it gets MFC and MFS to releng/12 before this thursdays builds of RC2? Ie, about the next 24 hours? Consider this an RE approval for immediate MFC to stable/12 so that you can send an MFS RFA to merge it to releng/12 which well take another re to approve. Thanks, Rod Modified: > head/sys/arm64/arm64/pmap.c > > Modified: head/sys/arm64/arm64/pmap.c > ============================================================================== > --- head/sys/arm64/arm64/pmap.c Tue Nov 20 14:59:27 2018 (r340677) > +++ head/sys/arm64/arm64/pmap.c Tue Nov 20 15:12:37 2018 (r340678) > @@ -2382,8 +2382,40 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entr > return (true); > } > > +static void > +pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) > +{ > + pt_entry_t newl2, oldl2; > + vm_page_t ml3; > + vm_paddr_t ml3pa; > + > + KASSERT(!VIRT_IN_DMAP(va), ("removing direct mapping of %#lx", va)); > + KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); > + PMAP_LOCK_ASSERT(pmap, MA_OWNED); > + > + ml3 = pmap_remove_pt_page(pmap, va); > + if (ml3 == NULL) > + panic("pmap_remove_kernel_l2: Missing pt page"); > + > + ml3pa = VM_PAGE_TO_PHYS(ml3); > + newl2 = ml3pa | L2_TABLE; > + > + /* > + * Initialize the page table page. > + */ > + pagezero((void *)PHYS_TO_DMAP(ml3pa)); > + > + /* > + * Demote the mapping. The caller must have already invalidated the > + * mapping (i.e., the "break" in break-before-make). > + */ > + oldl2 = pmap_load_store(l2, newl2); > + KASSERT(oldl2 == 0, ("%s: found existing mapping at %p: %#lx", > + __func__, l2, oldl2)); > +} > + > /* > - * pmap_remove_l2: do the things to unmap a level 2 superpage in a process > + * pmap_remove_l2: Do the things to unmap a level 2 superpage. > */ > static int > pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, > @@ -2419,16 +2451,18 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ > vm_page_aflag_clear(m, PGA_WRITEABLE); > } > } > - KASSERT(pmap != kernel_pmap, > - ("Attempting to remove an l2 kernel page")); > - ml3 = pmap_remove_pt_page(pmap, sva); > - if (ml3 != NULL) { > - pmap_resident_count_dec(pmap, 1); > - KASSERT(ml3->wire_count == NL3PG, > - ("pmap_remove_l2: l3 page wire count error")); > - ml3->wire_count = 1; > - vm_page_unwire_noq(ml3); > - pmap_add_delayed_free_list(ml3, free, FALSE); > + if (pmap == kernel_pmap) { > + pmap_remove_kernel_l2(pmap, l2, sva); > + } else { > + ml3 = pmap_remove_pt_page(pmap, sva); > + if (ml3 != NULL) { > + pmap_resident_count_dec(pmap, 1); > + KASSERT(ml3->wire_count == NL3PG, > + ("pmap_remove_l2: l3 page wire count error")); > + ml3->wire_count = 1; > + vm_page_unwire_noq(ml3); > + pmap_add_delayed_free_list(ml3, free, FALSE); > + } > } > return (pmap_unuse_pt(pmap, sva, l1e, free)); > } > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Nov 20 16:54:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28C3C1136003; Tue, 20 Nov 2018 16:54:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C32CC75D4D; Tue, 20 Nov 2018 16:54:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A11F714102; Tue, 20 Nov 2018 16:54:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKGshxY094439; Tue, 20 Nov 2018 16:54:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKGshll094437; Tue, 20 Nov 2018 16:54:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811201654.wAKGshll094437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 16:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340681 - in head/stand/i386: btx/btx btx/btxldr gptboot X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/stand/i386: btx/btx btx/btxldr gptboot X-SVN-Commit-Revision: 340681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C32CC75D4D X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.19)[0.186,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 16:54:44 -0000 Author: emaste Date: Tue Nov 20 16:54:42 2018 New Revision: 340681 URL: https://svnweb.freebsd.org/changeset/base/340681 Log: stand: remove CLANG_NO_IAS from btx and gptboot Many components under stand/ had CLANG_NO_IAS added when Clang's Integrated Assembler (IAS) did not handle .codeNN directives. Clang gained support quite some time ago, and we can now build stand/ with IAS. Note that in some cases there are small differences in the generated output, so CLANG_NO_IAS should be removed only after testing (or after finding no differences in the output). PR: 205250, 233094 Sponsored by: The FreeBSD Foundation Modified: head/stand/i386/btx/btx/Makefile head/stand/i386/btx/btxldr/Makefile head/stand/i386/gptboot/Makefile Modified: head/stand/i386/btx/btx/Makefile ============================================================================== --- head/stand/i386/btx/btx/Makefile Tue Nov 20 16:35:53 2018 (r340680) +++ head/stand/i386/btx/btx/Makefile Tue Nov 20 16:54:42 2018 (r340681) @@ -29,6 +29,3 @@ ORG= 0x9000 LDFLAGS+=${LDFLAGS_BIN} .include - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.btx.S= ${CLANG_NO_IAS} Modified: head/stand/i386/btx/btxldr/Makefile ============================================================================== --- head/stand/i386/btx/btxldr/Makefile Tue Nov 20 16:35:53 2018 (r340680) +++ head/stand/i386/btx/btxldr/Makefile Tue Nov 20 16:54:42 2018 (r340681) @@ -17,6 +17,3 @@ ORG=${LOADER_ADDRESS} LDFLAGS+=${LDFLAGS_BIN} .include - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.btxldr.S= ${CLANG_NO_IAS} Modified: head/stand/i386/gptboot/Makefile ============================================================================== --- head/stand/i386/gptboot/Makefile Tue Nov 20 16:35:53 2018 (r340680) +++ head/stand/i386/gptboot/Makefile Tue Nov 20 16:54:42 2018 (r340681) @@ -63,6 +63,3 @@ gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o c ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} .include - -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS.gptldr.S= ${CLANG_NO_IAS} From owner-svn-src-head@freebsd.org Tue Nov 20 18:10:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 477A61138945; Tue, 20 Nov 2018 18:10:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5FF479ECC; Tue, 20 Nov 2018 18:10:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E1F914CF3; Tue, 20 Nov 2018 18:10:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKIAuSI033569; Tue, 20 Nov 2018 18:10:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKIAuc3033568; Tue, 20 Nov 2018 18:10:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811201810.wAKIAuc3033568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 18:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340686 - head/sbin/dumpon X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/dumpon X-SVN-Commit-Revision: 340686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B5FF479ECC X-Spamd-Result: default: False [0.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.40)[0.398,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:10:57 -0000 Author: markj Date: Tue Nov 20 18:10:56 2018 New Revision: 340686 URL: https://svnweb.freebsd.org/changeset/base/340686 Log: Avoid clobbering a user-specified -g value after r340547. CID: 1396919 MFC with: r340547 Modified: head/sbin/dumpon/dumpon.c Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Tue Nov 20 17:43:24 2018 (r340685) +++ head/sbin/dumpon/dumpon.c Tue Nov 20 18:10:56 2018 (r340686) @@ -475,12 +475,15 @@ main(int argc, char *argv[]) if (inet_aton(client, &ndconf.ndc_client) == 0) errx(EX_USAGE, "invalid client address '%s'", client); - gateway = find_gateway(argv[0]); if (gateway == NULL) { - if (verbose) - printf("failed to look up gateway for %s\n", - server); - gateway = server; + gateway = find_gateway(argv[0]); + if (gateway == NULL) { + if (verbose) + printf( + "failed to look up gateway for %s\n", + server); + gateway = server; + } } if (inet_aton(gateway, &ndconf.ndc_gateway) == 0) errx(EX_USAGE, "invalid gateway address '%s'", gateway); From owner-svn-src-head@freebsd.org Tue Nov 20 18:13:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162471138BB6; Tue, 20 Nov 2018 18:13:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A62C47A29B; Tue, 20 Nov 2018 18:13:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86AD814E5E; Tue, 20 Nov 2018 18:13:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKIDI7G038474; Tue, 20 Nov 2018 18:13:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKIDIH1038473; Tue, 20 Nov 2018 18:13:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811201813.wAKIDIH1038473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 18:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340687 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 340687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A62C47A29B X-Spamd-Result: default: False [0.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.40)[0.398,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:13:19 -0000 Author: markj Date: Tue Nov 20 18:13:18 2018 New Revision: 340687 URL: https://svnweb.freebsd.org/changeset/base/340687 Log: Plug a trivial memory leak. CID: 1396911 MFC with: r340485 Modified: head/tests/sys/netinet/ip_reass_test.c Modified: head/tests/sys/netinet/ip_reass_test.c ============================================================================== --- head/tests/sys/netinet/ip_reass_test.c Tue Nov 20 18:10:56 2018 (r340686) +++ head/tests/sys/netinet/ip_reass_test.c Tue Nov 20 18:13:18 2018 (r340687) @@ -264,6 +264,8 @@ ATF_TC_BODY(ip_reass__multiple_last_fragments, tc) ATF_REQUIRE(error == 0); free_lopacket(packet1); free_lopacket(packet2); + free_lopacket(packet3); + free_lopacket(packet4); } /* From owner-svn-src-head@freebsd.org Tue Nov 20 18:14:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 320311138C70; Tue, 20 Nov 2018 18:14:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f173.google.com (mail-it1-f173.google.com [209.85.166.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9722F7A412; Tue, 20 Nov 2018 18:14:22 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f173.google.com with SMTP id b5so4994644iti.2; Tue, 20 Nov 2018 10:14:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=49PuKrxNKVPxlxODeco04r+haK/WDb0DmdjzQmpMfgs=; b=swaadKdCQzAIDOpx2TyuuiM/KoS/H6CzNdtE8qj7rLSvrKKAJ1XevWu6cLfB5ekevc UmyO972pe0d79CgXQBGf6idtAG+xRes4KV1b5Eh/JkUpyN5fBg0mGuvrGwFmpqUJcIDM VP9TgIC/AEUrYTbqJEbZgUM1P1c4bjf4/L/618cCUktBvLAZewagJegn+UAvA30C0WQH qIOtTRDVqzPHU79DaAnpSSNCIhivxS6dTStIv9j0uSbAknokfRTJxEtwN/UG14ZCjnPP rhYUT9hfF98mJc/PMf4gJtKQkhTe7QAt+wEy6gFl6LzETjWAA+B2F6b8hHNJcvO+Qeb2 IL9g== X-Gm-Message-State: AGRZ1gJ3AA89V1rsloUUZwGaRaatmCl5AOvImXN/6f/Zljv/zpVovGXz jMEvTr/nwX8ZbPrWixorjG7GM2M4 X-Google-Smtp-Source: AFSGD/UmXfnnMRF2A2muvXiYBy/nBmBEVX2X8IHhG0PxXiGfKbmPj3DIkdm/Q0IOAd8xOcyX/L6FxA== X-Received: by 2002:a24:1947:: with SMTP id b68mr3105037itb.70.1542737655856; Tue, 20 Nov 2018 10:14:15 -0800 (PST) Received: from mail-it1-f178.google.com (mail-it1-f178.google.com. [209.85.166.178]) by smtp.gmail.com with ESMTPSA id y9sm8892887ioj.63.2018.11.20.10.14.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 10:14:15 -0800 (PST) Received: by mail-it1-f178.google.com with SMTP id x19so4793284itl.1; Tue, 20 Nov 2018 10:14:15 -0800 (PST) X-Received: by 2002:a24:7296:: with SMTP id x144-v6mr2843898itc.166.1542737655262; Tue, 20 Nov 2018 10:14:15 -0800 (PST) MIME-Version: 1.0 References: <201811121120.wACBKxMt061432@repo.freebsd.org> In-Reply-To: <201811121120.wACBKxMt061432@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 20 Nov 2018 10:14:04 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340360 - in head: sbin/ipfw sys/netinet6 sys/netpfil/ipfw/nptv6 To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9722F7A412 X-Spamd-Result: default: False [-3.99 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.992,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-1.03)[ipnet: 209.85.128.0/17(-3.46), asn: 15169(-1.61), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; RCVD_IN_DNSWL_NONE(0.00)[173.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-0.98)[-0.981,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:14:23 -0000 Hi Andrey, On Mon, Nov 12, 2018 at 3:21 AM Andrey V. Elsukov wrote: > > Author: ae > Date: Mon Nov 12 11:20:59 2018 > New Revision: 340360 > URL: https://svnweb.freebsd.org/changeset/base/340360 > > Log: > Add ability to use dynamic external prefix in ipfw_nptv6 module. > > ... > Modified: head/sbin/ipfw/nptv6.c > ============================================================================== > --- head/sbin/ipfw/nptv6.c Mon Nov 12 07:14:34 2018 (r340359) > +++ head/sbin/ipfw/nptv6.c Mon Nov 12 11:20:59 2018 (r340360) > ... > @@ -245,13 +261,14 @@ check_prefix: > if ((flags & NPTV6_HAS_INTPREFIX) != NPTV6_HAS_INTPREFIX) > errx(EX_USAGE, "int_prefix required"); > if ((flags & NPTV6_HAS_EXTPREFIX) != NPTV6_HAS_EXTPREFIX) > - errx(EX_USAGE, "ext_prefix required"); > + errx(EX_USAGE, "ext_prefix or ext_if required"); > if ((flags & NPTV6_HAS_PREFIXLEN) != NPTV6_HAS_PREFIXLEN) > errx(EX_USAGE, "prefixlen required"); > > n2mask(&mask, cfg->plen); > APPLY_MASK(&cfg->internal, &mask); > - APPLY_MASK(&cfg->external, &mask); > + if ((cfg->flags & NPTV6_DYNAMIC_PREFIX) == 0) > + APPLY_MASK(&cfg->external, &mask); Coverity points out that APPLY_MASK() is a macro composed of multiple statements, and only the first statement will be conditional on the if () expression. This means that effectively, the final three words of mask will be applied to cfg->external unconditionally. CID is 1396914. I would suggest using the do { } while (0) construct in the APPLY_MASK macro to fix the issue. Best, Conrad From owner-svn-src-head@freebsd.org Tue Nov 20 18:38:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8C461139391; Tue, 20 Nov 2018 18:38:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 786BF7B04C; Tue, 20 Nov 2018 18:38:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59831151AA; Tue, 20 Nov 2018 18:38:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKIcTs3049096; Tue, 20 Nov 2018 18:38:29 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKIcTEs049094; Tue, 20 Nov 2018 18:38:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811201838.wAKIcTEs049094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 20 Nov 2018 18:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340689 - in head: sbin/ipfw sys/netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: sbin/ipfw sys/netinet X-SVN-Commit-Revision: 340689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 786BF7B04C X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.31)[0.310,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:38:30 -0000 Author: ae Date: Tue Nov 20 18:38:28 2018 New Revision: 340689 URL: https://svnweb.freebsd.org/changeset/base/340689 Log: Make multiline APPLY_MASK() macro to be function-like. Reported by: cem MFC after: 1 week Modified: head/sbin/ipfw/ipv6.c head/sys/netinet/ip_fw.h Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Tue Nov 20 18:14:30 2018 (r340688) +++ head/sbin/ipfw/ipv6.c Tue Nov 20 18:38:28 2018 (r340689) @@ -401,7 +401,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, stru n2mask(&d[1], masklen); } - APPLY_MASK(d, &d[1]) /* mask base address with mask */ + APPLY_MASK(d, &d[1]); /* mask base address with mask */ av = q; Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Tue Nov 20 18:14:30 2018 (r340688) +++ head/sys/netinet/ip_fw.h Tue Nov 20 18:38:28 2018 (r340689) @@ -551,11 +551,12 @@ typedef struct _ipfw_insn_nat { } ipfw_insn_nat; /* Apply ipv6 mask on ipv6 addr */ -#define APPLY_MASK(addr,mask) \ +#define APPLY_MASK(addr,mask) do { \ (addr)->__u6_addr.__u6_addr32[0] &= (mask)->__u6_addr.__u6_addr32[0]; \ (addr)->__u6_addr.__u6_addr32[1] &= (mask)->__u6_addr.__u6_addr32[1]; \ (addr)->__u6_addr.__u6_addr32[2] &= (mask)->__u6_addr.__u6_addr32[2]; \ - (addr)->__u6_addr.__u6_addr32[3] &= (mask)->__u6_addr.__u6_addr32[3]; + (addr)->__u6_addr.__u6_addr32[3] &= (mask)->__u6_addr.__u6_addr32[3]; \ +} while (0) /* Structure for ipv6 */ typedef struct _ipfw_insn_ip6 { From owner-svn-src-head@freebsd.org Tue Nov 20 18:47:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5246E1139887 for ; Tue, 20 Nov 2018 18:47:08 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-14.consmr.mail.bf2.yahoo.com (sonic313-14.consmr.mail.bf2.yahoo.com [74.6.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FCC57B735 for ; Tue, 20 Nov 2018 18:47:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 3JAxrTsVM1ldkeaRZcYc0OWHP7aSfilMDD_rGsCwZQx8T_mbB5h7WUpmf0AWQFf ORgHCPEfqlX8Bd2uKum__Skm4xKabqV9ZwMzaFZydi75ZfqY1aeEPhAg1ikbXegnNiiFy1G.K0IB LoZGQXuDviDjNbAl7JOjxmgUxeCqThRbqzpQGlCNCNo8QpA8ANA5Uhv3sKq2_7_VDDAp7iFiKUx8 QlPSx_koKrUGVMIGaNX92HBxpKwweW2R26OScLuUAmCG5wT3mIXVdypX6m9ihln8mkoHC3Vpqths X5SvGvTogjkGAnLBrPQnGf.Tm6w7QLdeC6E7yIWbQ7DlvOFnGNIE3wOZoJq36dCRL4scCn2Z7vwT e18l.XKYUTCjmvRB6wDkxV737PdpaBxxrwt_o2LhHSl5Bxl5WMyKBDoWuMSVHgBaMOZR0o8FMPOs WfM7SfahAiUNkkPvOEIQUesWnvaLLC88mm8v4CpqEga9yF0Hu9JgO69U0qdvnbdMLZLEOCwYBeUA A9vQ18Gn78hmHiPNASkDTar_8QxBo1yXlU2e2e.CApXut35QSvn7N6YMT.pv1QP4fghG.3.j.4vr dt5.toyUx839IRJfzFY11Vju7mQu3TaZuM5VRsgn2H_M0ME9eV5kkxSdYb7cVqlapisAPi4wLRPK GW38qqEb4Rf1XdptjbpsN6_B7ey.kBX1RzWTJ9kJgb3LmXYuWsXmG0F81ogLiiCeZbAZryK0K4D7 BGMRO5SFkkWIAxvfPBquS4a1MP5rpyc4FeeAo9518kkNwH4aPqc5iBjrDE4VAIzGQwe0c8zoJN_O I.Ifd0nBhdSBsNk3hq1UcUZ9ZexYhM31cCi.UTxZmkqJmPzSiH38TSvlbvEpN_CwyF2LDSWbO0QG 4HSyCb6CVnOK5lewLH4KpaSMrcaKUOL9XmD8whg_BOottET1KjfktRFoh0mccj1oroXEYWVVd8R2 mlDnj2dCoXZBmaV_YFM24rhvJQvkRzVrpxjSOylDfolgnCepfqYNzvXsModrDudomrv2G9hsmcqz SD5d1nJyaYHLpHBEPBRrSS6RKWmx.O1MsieUQaWesO77uNm7dHJAKUGXZUw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.bf2.yahoo.com with HTTP; Tue, 20 Nov 2018 18:47:01 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp410.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 1801122ffd2d0d79f3df17c9967df761; Tue, 20 Nov 2018 18:46:58 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: svn commit: r340664 - head/sys/sys Message-Id: Date: Tue, 20 Nov 2018 10:46:55 -0800 To: Warner Losh , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.101.1) X-Rspamd-Queue-Id: 8FCC57B735 X-Spamd-Result: default: False [4.72 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(1.75)[ip: (5.15), ipnet: 74.6.128.0/21(2.06), asn: 26101(1.65), country: US(-0.09)]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FAKE_REPLY(1.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.97)[0.971,0]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(0.62)[0.622,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.88)[0.884,0]; RCVD_IN_DNSWL_NONE(0.00)[124.133.6.74.list.dnswl.org : 127.0.5.0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 18:47:08 -0000 Warner Losh imp at FreeBSD.org wrote on Tue Nov 20 07:11:24 UTC 2018 : > Instead, used fixed constants because there's no way to say ceil(X) > for integer math. . . . For a ratio of unsigned integers, with 0 // ceil_x_div_y(x,y), given 0 Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07B57113B32D; Tue, 20 Nov 2018 19:31:04 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D89D7E501; Tue, 20 Nov 2018 19:31:03 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7927D15A19; Tue, 20 Nov 2018 19:31:03 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKJV35A080796; Tue, 20 Nov 2018 19:31:03 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKJV3KT080795; Tue, 20 Nov 2018 19:31:03 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201811201931.wAKJV3KT080795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Tue, 20 Nov 2018 19:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340694 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 340694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D89D7E501 X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.31)[0.310,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:31:04 -0000 Author: zeising (doc,ports committer) Date: Tue Nov 20 19:31:02 2018 New Revision: 340694 URL: https://svnweb.freebsd.org/changeset/base/340694 Log: Enable evdev on ppc32 Enable evdev on ppc32 as well, similar to what was done i386 and amd64 in r340387 and ppc64 in r340632. Evdev can be used by X and is used by wayland to handle input devices. Approved by: jhibbits MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18049 Modified: head/sys/powerpc/conf/GENERIC Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Tue Nov 20 19:02:10 2018 (r340693) +++ head/sys/powerpc/conf/GENERIC Tue Nov 20 19:31:02 2018 (r340694) @@ -228,3 +228,8 @@ device sound # Generic sound driver (required) device snd_ai2s # Apple I2S audio device snd_davbus # Apple DAVBUS audio device snd_uaudio # USB Audio + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev From owner-svn-src-head@freebsd.org Tue Nov 20 19:52:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 654B3113BFDF for ; Tue, 20 Nov 2018 19:52:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic316-20.consmr.mail.ne1.yahoo.com (sonic316-20.consmr.mail.ne1.yahoo.com [66.163.187.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7B307FF00 for ; Tue, 20 Nov 2018 19:52:23 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: LZaqsNgVM1kJr7oJ.nX12nLs0dXseWnI7nWXDNs8_fmCvjFuolTJWxj2WN2olfW adwZu_HUwSnHCvpRUMf7S8G.QPFoxP9xibZtGO1r9cJGGunkDk4NMADGfxOSlasQrG_nqO9e_SaZ eoJsjLRuGRN.ELJspCnSg7aJvJ.CA5NxhX_oo5H4xCqJUhQXHKQReKW_I5_K41PMiCuwhm6jW4L9 tg4tTi9hKwz2_vGhZIh76R7ZM7iB_21G27UHY6ntSQOosn.cTtNKKM5mvsnjdNatBrZ1fngicDaj NTmLet_OI.ijyeOwKhev.jgFrZmECpDLP420JENQ6Ll1sD095fQT5PRkhk5nwIwK0O_8qPn1SLo3 ZtGNXJtcMeoFHSyqzczzRot7dlfDI9H58bsW5PLiabazcDuxVOdUMEf_UUfU_EiPECuEk2AOQmk4 shAlB2C6_H6YCtUWL2.xPfuhq05IvA5LydRywDk4bHzSFByN5AjfmQ.Mzkw7iY6rbSj4y7kF80Pj 7eU9w.Y7EI9bvZqC5iYNQVFDI1pdCzNleGflAHN9ovS4rEHfNaUHWZL9oV9UR0iIYIi4YcpDUncg yYfBRQFB1Pg0ZWeox3FUqGZxMmgZQD6kOhYkf_stlxuP9EuBrSXsf2zfFeHI_WevEcZ2WHuG_.X. E849fSgjP8xNP2s99heftqy4vi02Q9YSIMR41EJXybCF56GtjkMuuLO689AQcDqeguj2maFXibTV ExPCM7G8rmkdef326QL10qsbwiCmOlWS0KB_Ps0YZeGs4Xxp2lCu7_pquzoLGjnXNsXb7oYum6Mg uigxe3xvlyQA2pk79znIQ7TBerySSinEE8ukHjMefEX2Mbq.KyHRPnhg7gx0h6mJEayHCcqzTwyw wrxSpGQ5BzdNelZ4a7ZBqmLkCpyqn0DWkkQ1a9Se5K9lD.GmB1vn4N8ASNiXkPfLssXowtT8yqmL 1.FF5CDIMGMQP6UcDKPwYbZNNXz8JQJA.LzadPKfFQyrgegR5jDGEfxz8IOc70JLd_92JIvGSmct Vx7ec3wwJEAuGgztF3RH0F6GQzJBTbO4UiVSXONCku29sES4dVIM6nA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Tue, 20 Nov 2018 19:52:16 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.25]) ([76.115.7.162]) by smtp425.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 0e5bd4161bc36d2cd63e4ce52d60dd22; Tue, 20 Nov 2018 19:52:08 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: svn commit: r340676 - in head/sys: kern sys Message-Id: Date: Tue, 20 Nov 2018 11:52:06 -0800 To: mjg@FreeBSD.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.101.1) X-Rspamd-Queue-Id: A7B307FF00 X-Spamd-Result: default: False [4.68 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(1.66)[ip: (5.23), ipnet: 66.163.184.0/21(1.77), asn: 36646(1.41), country: US(-0.09)]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FAKE_REPLY(1.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.91)[0.906,0]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(0.72)[0.719,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.91)[0.905,0]; RCVD_IN_DNSWL_NONE(0.00)[146.187.163.66.list.dnswl.org : 127.0.5.0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:52:24 -0000 Mateusz Guzik mjg at FreeBSD.org wrote on Tue Nov 20 14:58:42 UTC 2018 : > +#if defined(__mips__) || defined(__powerpc__) > +#define UNR64_LOCKED > +#endif But on powerpc64 ( system clang from head -r339076 ): # clang -dM -E -x c /dev/null | grep -i __power #define __POWERPC__ 1 #define __powerpc64__ 1 #define __powerpc__ 1 and (I only have the one gcc* vintage around): # gcc8 -dM -E -x c /dev/null | grep -i __power #define __powerpc64__ 1 #define __powerpc__ 1 so the following are used on powerpc64: +#ifdef UNR64_LOCKED +uint64_t alloc_unr64(struct unrhdr64 *); +#else . . . and: +#ifdef UNR64_LOCKED +uint64_t +alloc_unr64(struct unrhdr64 *unr64) +{ + uint64_t item; + + mtx_lock(&unitmtx); + item =3D unr64->counter++; + mtx_unlock(&unitmtx); + return (item); +} +#endif Was that the intent for powerpc64? Notes about the powerpc64 context used: # uname -apKU FreeBSD FBSDG5L 12.0-ALPHA8 FreeBSD 12.0-ALPHA8 #4 r339076M: Mon Oct 15 = 13:19:35 PDT 2018 = markmi@FBSDG5L:/usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr= /src/powerpc.powerpc64/sys/GENERIC64vtsc-NODBG powerpc powerpc64 = 1200084 1200084 buildworld buildkernel was via devel/powerpc64-xtoolchain-gcc . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Tue Nov 20 20:32:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CFB4113D0A3; Tue, 20 Nov 2018 20:32:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12E288247D; Tue, 20 Nov 2018 20:32:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8ECF16544; Tue, 20 Nov 2018 20:32:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKKWALX014480; Tue, 20 Nov 2018 20:32:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKKWADR014479; Tue, 20 Nov 2018 20:32:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811202032.wAKKWADR014479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 20:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340699 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 12E288247D X-Spamd-Result: default: False [0.70 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.57)[0.574,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:32:11 -0000 Author: markj Date: Tue Nov 20 20:32:10 2018 New Revision: 340699 URL: https://svnweb.freebsd.org/changeset/base/340699 Log: Clear pad bytes in the struct exported by kern.ntp_pll.gettime. Reported by: Thomas Barabosch, Fraunhofer FKIE MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_ntptime.c Modified: head/sys/kern/kern_ntptime.c ============================================================================== --- head/sys/kern/kern_ntptime.c Tue Nov 20 20:31:23 2018 (r340698) +++ head/sys/kern/kern_ntptime.c Tue Nov 20 20:32:10 2018 (r340699) @@ -300,6 +300,8 @@ ntp_sysctl(SYSCTL_HANDLER_ARGS) { struct ntptimeval ntv; /* temporary structure */ + memset(&ntv, 0, sizeof(ntv)); + NTP_LOCK(); ntp_gettime1(&ntv); NTP_UNLOCK(); From owner-svn-src-head@freebsd.org Tue Nov 20 20:59:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 993B3113DBD5; Tue, 20 Nov 2018 20:59:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D95583578; Tue, 20 Nov 2018 20:59:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17CFE168E4; Tue, 20 Nov 2018 20:59:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKKxnuI025465; Tue, 20 Nov 2018 20:59:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKKxnWT025464; Tue, 20 Nov 2018 20:59:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811202059.wAKKxnWT025464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 20:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340701 - head/lib/csu/common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/csu/common X-SVN-Commit-Revision: 340701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D95583578 X-Spamd-Result: default: False [0.76 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.63)[0.633,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:59:50 -0000 Author: emaste Date: Tue Nov 20 20:59:49 2018 New Revision: 340701 URL: https://svnweb.freebsd.org/changeset/base/340701 Log: Add NT_FREEBSD_FEATURE_CTL ELF note to csu This note will be used to allow binaries to opt out of, or in to, upcoming vulnerability mitigation and other features. It is not yet connected but being added now to facilitate testing and ensure compatibility with existing kernels and tools. Reviewed by: brooks, jhb, kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17438 Modified: head/lib/csu/common/crtbrand.c Modified: head/lib/csu/common/crtbrand.c ============================================================================== --- head/lib/csu/common/crtbrand.c Tue Nov 20 20:40:10 2018 (r340700) +++ head/lib/csu/common/crtbrand.c Tue Nov 20 20:59:49 2018 (r340701) @@ -67,3 +67,18 @@ static const struct { .name = NOTE_FREEBSD_VENDOR, .desc = __FreeBSD_version }; + +static const struct { + int32_t namesz; + int32_t descsz; + int32_t type; + char name[sizeof(NOTE_FREEBSD_VENDOR)]; + uint32_t desc[1]; +} crt_feature_ctl __attribute__ ((section (NOTE_SECTION), + aligned(4))) __used = { + .namesz = sizeof(NOTE_FREEBSD_VENDOR), + .descsz = sizeof(uint32_t), + .type = NT_FREEBSD_FEATURE_CTL, + .name = NOTE_FREEBSD_VENDOR, + .desc = { 0 } +}; From owner-svn-src-head@freebsd.org Tue Nov 20 21:04:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BED42113DEC5; Tue, 20 Nov 2018 21:04:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 648A683A21; Tue, 20 Nov 2018 21:04:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FD2A16A84; Tue, 20 Nov 2018 21:04:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKL4LfH030132; Tue, 20 Nov 2018 21:04:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKL4KZl030127; Tue, 20 Nov 2018 21:04:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811202104.wAKL4KZl030127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 21:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340702 - in head/lib/csu: amd64 common i386 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/lib/csu: amd64 common i386 X-SVN-Commit-Revision: 340702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 648A683A21 X-Spamd-Result: default: False [0.78 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.63)[0.634,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; NEURAL_SPAM_LONG(0.00)[0.001,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 21:04:22 -0000 Author: emaste Date: Tue Nov 20 21:04:20 2018 New Revision: 340702 URL: https://svnweb.freebsd.org/changeset/base/340702 Log: csu: use BSD-1-clause license on csu files Copyright on these files is held by kib@ and/or the Foundation, and both agree to this change. Approved by: kib Modified: head/lib/csu/amd64/reloc.c head/lib/csu/common/ignore_init.c head/lib/csu/common/notes.h head/lib/csu/i386/crt1_s.S head/lib/csu/i386/reloc.c Modified: head/lib/csu/amd64/reloc.c ============================================================================== --- head/lib/csu/amd64/reloc.c Tue Nov 20 20:59:49 2018 (r340701) +++ head/lib/csu/amd64/reloc.c Tue Nov 20 21:04:20 2018 (r340702) @@ -9,9 +9,6 @@ * 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 Modified: head/lib/csu/common/ignore_init.c ============================================================================== --- head/lib/csu/common/ignore_init.c Tue Nov 20 20:59:49 2018 (r340701) +++ head/lib/csu/common/ignore_init.c Tue Nov 20 21:04:20 2018 (r340702) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-1-Clause * * Copyright 2012 Konstantin Belousov * Copyright (c) 2018 The FreeBSD Foundation @@ -12,9 +12,6 @@ * 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 Modified: head/lib/csu/common/notes.h ============================================================================== --- head/lib/csu/common/notes.h Tue Nov 20 20:59:49 2018 (r340701) +++ head/lib/csu/common/notes.h Tue Nov 20 21:04:20 2018 (r340702) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-1-Clause * * Copyright 2012 Konstantin Belousov * All rights reserved. @@ -9,9 +9,6 @@ * 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 Modified: head/lib/csu/i386/crt1_s.S ============================================================================== --- head/lib/csu/i386/crt1_s.S Tue Nov 20 20:59:49 2018 (r340701) +++ head/lib/csu/i386/crt1_s.S Tue Nov 20 21:04:20 2018 (r340702) @@ -7,9 +7,6 @@ * 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 Modified: head/lib/csu/i386/reloc.c ============================================================================== --- head/lib/csu/i386/reloc.c Tue Nov 20 20:59:49 2018 (r340701) +++ head/lib/csu/i386/reloc.c Tue Nov 20 21:04:20 2018 (r340702) @@ -9,9 +9,6 @@ * 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 From owner-svn-src-head@freebsd.org Tue Nov 20 21:10:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF358113E0B2; Tue, 20 Nov 2018 21:10:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D62F83F9E; Tue, 20 Nov 2018 21:10:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DE6516AA6; Tue, 20 Nov 2018 21:10:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKLADMb030780; Tue, 20 Nov 2018 21:10:13 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKLA4i5030740; Tue, 20 Nov 2018 21:10:04 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811202110.wAKLA4i5030740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 21:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340703 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/async/arch crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/async/arch crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm crypto/openssl/crypto... X-SVN-Commit-Revision: 340703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D62F83F9E X-Spamd-Result: default: False [0.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.012,0]; NEURAL_SPAM_MEDIUM(0.19)[0.194,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.63)[0.634,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 21:10:14 -0000 Author: jkim Date: Tue Nov 20 21:10:04 2018 New Revision: 340703 URL: https://svnweb.freebsd.org/changeset/base/340703 Log: Merge OpenSSL 1.1.1a. Added: head/crypto/openssl/crypto/getenv.c - copied unchanged from r340690, vendor-crypto/openssl/dist/crypto/getenv.c head/crypto/openssl/doc/man3/SSL_get_peer_tmp_key.pod - copied unchanged from r340690, vendor-crypto/openssl/dist/doc/man3/SSL_get_peer_tmp_key.pod head/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 (contents, props changed) Deleted: head/crypto/openssl/doc/man3/SSL_CTX_set_client_CA_list.pod head/crypto/openssl/doc/man3/SSL_get_client_CA_list.pod head/crypto/openssl/doc/man3/SSL_get_server_tmp_key.pod head/secure/lib/libcrypto/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libcrypto/man/SSL_get_client_CA_list.3 head/secure/lib/libcrypto/man/SSL_get_server_tmp_key.3 Modified: head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/INSTALL head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/app_rand.c head/crypto/openssl/apps/apps.c head/crypto/openssl/apps/apps.h head/crypto/openssl/apps/ca.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/openssl.cnf head/crypto/openssl/apps/opt.c head/crypto/openssl/apps/rehash.c head/crypto/openssl/apps/rsa.c head/crypto/openssl/apps/s_cb.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/apps/speed.c head/crypto/openssl/apps/x509.c head/crypto/openssl/crypto/LPdir_unix.c head/crypto/openssl/crypto/async/arch/async_posix.h head/crypto/openssl/crypto/bio/b_sock2.c head/crypto/openssl/crypto/bio/bio_lib.c head/crypto/openssl/crypto/bio/bss_log.c head/crypto/openssl/crypto/bn/asm/x86_64-gcc.c head/crypto/openssl/crypto/bn/bn_exp.c head/crypto/openssl/crypto/bn/bn_lib.c head/crypto/openssl/crypto/build.info head/crypto/openssl/crypto/conf/conf_api.c head/crypto/openssl/crypto/conf/conf_mod.c head/crypto/openssl/crypto/cryptlib.c head/crypto/openssl/crypto/ct/ct_log.c head/crypto/openssl/crypto/dsa/dsa_gen.c head/crypto/openssl/crypto/dsa/dsa_ossl.c head/crypto/openssl/crypto/ec/ec_ameth.c head/crypto/openssl/crypto/ec/ec_mult.c head/crypto/openssl/crypto/ec/ec_pmeth.c head/crypto/openssl/crypto/ec/ecdh_kdf.c head/crypto/openssl/crypto/engine/eng_devcrypto.c head/crypto/openssl/crypto/engine/eng_list.c head/crypto/openssl/crypto/err/openssl.txt head/crypto/openssl/crypto/evp/e_aes.c head/crypto/openssl/crypto/evp/e_rc2.c head/crypto/openssl/crypto/evp/pmeth_lib.c head/crypto/openssl/crypto/include/internal/ec_int.h head/crypto/openssl/crypto/include/internal/rand_int.h head/crypto/openssl/crypto/kdf/hkdf.c head/crypto/openssl/crypto/mem_sec.c head/crypto/openssl/crypto/o_fopen.c head/crypto/openssl/crypto/pkcs12/p12_mutl.c head/crypto/openssl/crypto/poly1305/poly1305_ieee754.c head/crypto/openssl/crypto/rand/drbg_ctr.c head/crypto/openssl/crypto/rand/drbg_lib.c head/crypto/openssl/crypto/rand/rand_err.c head/crypto/openssl/crypto/rand/rand_lcl.h head/crypto/openssl/crypto/rand/rand_lib.c head/crypto/openssl/crypto/rand/rand_unix.c head/crypto/openssl/crypto/rand/randfile.c head/crypto/openssl/crypto/rsa/rsa_lib.c head/crypto/openssl/crypto/rsa/rsa_meth.c head/crypto/openssl/crypto/rsa/rsa_ossl.c head/crypto/openssl/crypto/sha/asm/keccak1600-s390x.pl head/crypto/openssl/crypto/sha/asm/sha512p8-ppc.pl head/crypto/openssl/crypto/siphash/siphash.c head/crypto/openssl/crypto/sm2/sm2_crypt.c head/crypto/openssl/crypto/sm2/sm2_sign.c head/crypto/openssl/crypto/ui/ui_openssl.c head/crypto/openssl/crypto/x509/by_dir.c head/crypto/openssl/crypto/x509/by_file.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/doc/man1/ca.pod head/crypto/openssl/doc/man1/enc.pod head/crypto/openssl/doc/man1/openssl.pod head/crypto/openssl/doc/man1/req.pod head/crypto/openssl/doc/man1/rsa.pod head/crypto/openssl/doc/man1/s_server.pod head/crypto/openssl/doc/man1/storeutl.pod head/crypto/openssl/doc/man1/x509.pod head/crypto/openssl/doc/man3/DES_random_key.pod head/crypto/openssl/doc/man3/EVP_DigestInit.pod head/crypto/openssl/doc/man3/EVP_PKEY_CTX_ctrl.pod head/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_hkdf_md.pod head/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.pod head/crypto/openssl/doc/man3/EVP_PKEY_set1_RSA.pod head/crypto/openssl/doc/man3/EVP_aes.pod head/crypto/openssl/doc/man3/EVP_aria.pod head/crypto/openssl/doc/man3/EVP_bf_cbc.pod head/crypto/openssl/doc/man3/EVP_camellia.pod head/crypto/openssl/doc/man3/EVP_cast5_cbc.pod head/crypto/openssl/doc/man3/EVP_des.pod head/crypto/openssl/doc/man3/EVP_idea_cbc.pod head/crypto/openssl/doc/man3/EVP_md5.pod head/crypto/openssl/doc/man3/EVP_rc2_cbc.pod head/crypto/openssl/doc/man3/EVP_rc5_32_12_16_cbc.pod head/crypto/openssl/doc/man3/EVP_seed_cbc.pod head/crypto/openssl/doc/man3/EVP_sm4_cbc.pod head/crypto/openssl/doc/man3/OPENSSL_VERSION_NUMBER.pod head/crypto/openssl/doc/man3/RSA_meth_new.pod head/crypto/openssl/doc/man3/SSL_CTX_set0_CA_list.pod head/crypto/openssl/doc/man3/SSL_CTX_set1_curves.pod head/crypto/openssl/doc/man3/SSL_CTX_set_quiet_shutdown.pod head/crypto/openssl/doc/man3/SSL_get_error.pod head/crypto/openssl/doc/man3/SSL_get_peer_signature_nid.pod head/crypto/openssl/doc/man3/SSL_set_bio.pod head/crypto/openssl/doc/man3/SSL_set_shutdown.pod head/crypto/openssl/doc/man3/SSL_shutdown.pod head/crypto/openssl/doc/man7/RAND_DRBG.pod head/crypto/openssl/e_os.h head/crypto/openssl/include/internal/cryptlib.h head/crypto/openssl/include/internal/tsan_assist.h head/crypto/openssl/include/openssl/cryptoerr.h head/crypto/openssl/include/openssl/ec.h head/crypto/openssl/include/openssl/ocsp.h head/crypto/openssl/include/openssl/opensslv.h head/crypto/openssl/include/openssl/rand_drbg.h head/crypto/openssl/include/openssl/randerr.h head/crypto/openssl/include/openssl/rsa.h head/crypto/openssl/include/openssl/ssl.h head/crypto/openssl/include/openssl/symhacks.h head/crypto/openssl/include/openssl/tls1.h head/crypto/openssl/ssl/d1_lib.c head/crypto/openssl/ssl/record/rec_layer_d1.c head/crypto/openssl/ssl/record/record.h head/crypto/openssl/ssl/record/record_locl.h head/crypto/openssl/ssl/record/ssl3_record.c head/crypto/openssl/ssl/s3_cbc.c head/crypto/openssl/ssl/s3_enc.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/ssl_cert.c head/crypto/openssl/ssl/ssl_ciph.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/statem/extensions.c head/crypto/openssl/ssl/statem/extensions_clnt.c head/crypto/openssl/ssl/statem/statem.c head/crypto/openssl/ssl/statem/statem_clnt.c head/crypto/openssl/ssl/statem/statem_lib.c head/crypto/openssl/ssl/statem/statem_locl.h head/crypto/openssl/ssl/statem/statem_srvr.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/ssl/tls13_enc.c head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/Makefile.man head/secure/lib/libcrypto/man/ADMISSIONS.3 head/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 head/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_TIME_set.3 head/secure/lib/libcrypto/man/ASN1_TYPE_get.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 head/secure/lib/libcrypto/man/ASYNC_start_job.3 head/secure/lib/libcrypto/man/BF_encrypt.3 head/secure/lib/libcrypto/man/BIO_ADDR.3 head/secure/lib/libcrypto/man/BIO_ADDRINFO.3 head/secure/lib/libcrypto/man/BIO_connect.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_get_data.3 head/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 head/secure/lib/libcrypto/man/BIO_meth_new.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_parse_hostserv.3 head/secure/lib/libcrypto/man/BIO_printf.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_security_bits.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/BUF_MEM_new.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 head/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 head/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 head/secure/lib/libcrypto/man/CTLOG_STORE_new.3 head/secure/lib/libcrypto/man/CTLOG_new.3 head/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 head/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 head/secure/lib/libcrypto/man/DES_random_key.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get0_pqg.3 head/secure/lib/libcrypto/man/DH_get_1024_160.3 head/secure/lib/libcrypto/man/DH_meth_new.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_new_by_nid.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get0_pqg.3 head/secure/lib/libcrypto/man/DSA_meth_new.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 head/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 head/secure/lib/libcrypto/man/DTLSv1_listen.3 head/secure/lib/libcrypto/man/ECDSA_SIG_new.3 head/secure/lib/libcrypto/man/ECPKParameters_print.3 head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 head/secure/lib/libcrypto/man/EC_GROUP_copy.3 head/secure/lib/libcrypto/man/EC_GROUP_new.3 head/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 head/secure/lib/libcrypto/man/EC_KEY_new.3 head/secure/lib/libcrypto/man/EC_POINT_add.3 head/secure/lib/libcrypto/man/EC_POINT_new.3 head/secure/lib/libcrypto/man/ENGINE_add.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 head/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncodeInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_MD_meth_new.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/EVP_aes.3 head/secure/lib/libcrypto/man/EVP_aria.3 head/secure/lib/libcrypto/man/EVP_bf_cbc.3 head/secure/lib/libcrypto/man/EVP_blake2b512.3 head/secure/lib/libcrypto/man/EVP_camellia.3 head/secure/lib/libcrypto/man/EVP_cast5_cbc.3 head/secure/lib/libcrypto/man/EVP_chacha20.3 head/secure/lib/libcrypto/man/EVP_des.3 head/secure/lib/libcrypto/man/EVP_desx_cbc.3 head/secure/lib/libcrypto/man/EVP_idea_cbc.3 head/secure/lib/libcrypto/man/EVP_md2.3 head/secure/lib/libcrypto/man/EVP_md4.3 head/secure/lib/libcrypto/man/EVP_md5.3 head/secure/lib/libcrypto/man/EVP_mdc2.3 head/secure/lib/libcrypto/man/EVP_rc2_cbc.3 head/secure/lib/libcrypto/man/EVP_rc4.3 head/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 head/secure/lib/libcrypto/man/EVP_ripemd160.3 head/secure/lib/libcrypto/man/EVP_seed_cbc.3 head/secure/lib/libcrypto/man/EVP_sha1.3 head/secure/lib/libcrypto/man/EVP_sha224.3 head/secure/lib/libcrypto/man/EVP_sha3_224.3 head/secure/lib/libcrypto/man/EVP_sm3.3 head/secure/lib/libcrypto/man/EVP_sm4_cbc.3 head/secure/lib/libcrypto/man/EVP_whirlpool.3 head/secure/lib/libcrypto/man/HMAC.3 head/secure/lib/libcrypto/man/MD5.3 head/secure/lib/libcrypto/man/MDC2_Init.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 head/secure/lib/libcrypto/man/OCSP_cert_to_id.3 head/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 head/secure/lib/libcrypto/man/OCSP_resp_find_status.3 head/secure/lib/libcrypto/man/OCSP_response_status.3 head/secure/lib/libcrypto/man/OCSP_sendreq_new.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 head/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 head/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OPENSSL_malloc.3 head/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 head/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 head/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 head/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 head/secure/lib/libcrypto/man/OSSL_STORE_expect.3 head/secure/lib/libcrypto/man/OSSL_STORE_open.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 head/secure/lib/libcrypto/man/PEM_read.3 head/secure/lib/libcrypto/man/PEM_read_CMS.3 head/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 head/secure/lib/libcrypto/man/PEM_read_bio_ex.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_newpass.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_DRBG_generate.3 head/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 head/secure/lib/libcrypto/man/RAND_DRBG_new.3 head/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RC4_set_key.3 head/secure/lib/libcrypto/man/RIPEMD160_Init.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get0_key.3 head/secure/lib/libcrypto/man/RSA_meth_new.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SCT_new.3 head/secure/lib/libcrypto/man/SCT_print.3 head/secure/lib/libcrypto/man/SCT_validate.3 head/secure/lib/libcrypto/man/SHA256_Init.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 head/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 head/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_session.3 head/secure/lib/libcrypto/man/SSL_CTX_config.3 head/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 head/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 head/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_free.3 head/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 head/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 head/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libcrypto/man/SSL_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 head/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 head/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 head/secure/lib/libcrypto/man/SSL_CTX_set_options.3 head/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 head/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 head/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 head/secure/lib/libcrypto/man/SSL_SESSION_free.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 head/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 head/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 head/secure/lib/libcrypto/man/SSL_SESSION_print.3 head/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 head/secure/lib/libcrypto/man/SSL_accept.3 head/secure/lib/libcrypto/man/SSL_alert_type_string.3 head/secure/lib/libcrypto/man/SSL_alloc_buffers.3 head/secure/lib/libcrypto/man/SSL_check_chain.3 head/secure/lib/libcrypto/man/SSL_clear.3 head/secure/lib/libcrypto/man/SSL_connect.3 head/secure/lib/libcrypto/man/SSL_do_handshake.3 head/secure/lib/libcrypto/man/SSL_export_keying_material.3 head/secure/lib/libcrypto/man/SSL_extension_supported.3 head/secure/lib/libcrypto/man/SSL_free.3 head/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 head/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 head/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 head/secure/lib/libcrypto/man/SSL_get_ciphers.3 head/secure/lib/libcrypto/man/SSL_get_client_random.3 head/secure/lib/libcrypto/man/SSL_get_current_cipher.3 head/secure/lib/libcrypto/man/SSL_get_default_timeout.3 head/secure/lib/libcrypto/man/SSL_get_error.3 head/secure/lib/libcrypto/man/SSL_get_extms_support.3 head/secure/lib/libcrypto/man/SSL_get_fd.3 head/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 head/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 head/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 head/secure/lib/libcrypto/man/SSL_get_psk_identity.3 head/secure/lib/libcrypto/man/SSL_get_rbio.3 head/secure/lib/libcrypto/man/SSL_get_session.3 head/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 head/secure/lib/libcrypto/man/SSL_get_verify_result.3 head/secure/lib/libcrypto/man/SSL_get_version.3 head/secure/lib/libcrypto/man/SSL_in_init.3 head/secure/lib/libcrypto/man/SSL_key_update.3 head/secure/lib/libcrypto/man/SSL_library_init.3 head/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 head/secure/lib/libcrypto/man/SSL_new.3 head/secure/lib/libcrypto/man/SSL_pending.3 head/secure/lib/libcrypto/man/SSL_read.3 head/secure/lib/libcrypto/man/SSL_read_early_data.3 head/secure/lib/libcrypto/man/SSL_rstate_string.3 head/secure/lib/libcrypto/man/SSL_session_reused.3 head/secure/lib/libcrypto/man/SSL_set1_host.3 head/secure/lib/libcrypto/man/SSL_set_bio.3 head/secure/lib/libcrypto/man/SSL_set_connect_state.3 head/secure/lib/libcrypto/man/SSL_set_fd.3 head/secure/lib/libcrypto/man/SSL_set_session.3 head/secure/lib/libcrypto/man/SSL_set_shutdown.3 head/secure/lib/libcrypto/man/SSL_set_verify_result.3 head/secure/lib/libcrypto/man/SSL_shutdown.3 head/secure/lib/libcrypto/man/SSL_state_string.3 head/secure/lib/libcrypto/man/SSL_want.3 head/secure/lib/libcrypto/man/SSL_write.3 head/secure/lib/libcrypto/man/UI_STRING.3 head/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 head/secure/lib/libcrypto/man/UI_create_method.3 head/secure/lib/libcrypto/man/UI_new.3 head/secure/lib/libcrypto/man/X509V3_get_d2i.3 head/secure/lib/libcrypto/man/X509_ALGOR_dup.3 head/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 head/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 head/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 head/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get0_der.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_PUBKEY_new.3 head/secure/lib/libcrypto/man/X509_SIG_get0.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_add_cert.3 head/secure/lib/libcrypto/man/X509_STORE_get0_param.3 head/secure/lib/libcrypto/man/X509_STORE_new.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_check_ca.3 head/secure/lib/libcrypto/man/X509_check_host.3 head/secure/lib/libcrypto/man/X509_check_issued.3 head/secure/lib/libcrypto/man/X509_check_private_key.3 head/secure/lib/libcrypto/man/X509_cmp_time.3 head/secure/lib/libcrypto/man/X509_digest.3 head/secure/lib/libcrypto/man/X509_dup.3 head/secure/lib/libcrypto/man/X509_get0_notBefore.3 head/secure/lib/libcrypto/man/X509_get0_signature.3 head/secure/lib/libcrypto/man/X509_get0_uids.3 head/secure/lib/libcrypto/man/X509_get_extension_flags.3 head/secure/lib/libcrypto/man/X509_get_pubkey.3 head/secure/lib/libcrypto/man/X509_get_serialNumber.3 head/secure/lib/libcrypto/man/X509_get_subject_name.3 head/secure/lib/libcrypto/man/X509_get_version.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_sign.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 head/secure/lib/libcrypto/man/d2i_PrivateKey.3 head/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 head/secure/lib/libcrypto/man/o2i_SCT_LIST.3 head/secure/lib/libssl/Version.map (contents, props changed) head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/engine.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/list.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/prime.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/srp.1 head/secure/usr.bin/openssl/man/storeutl.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 Directory Properties: head/crypto/openssl/ (props changed) head/secure/lib/libcrypto/Version.map (props changed) Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/CHANGES Tue Nov 20 21:10:04 2018 (r340703) @@ -7,6 +7,42 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + 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 @@ -13103,4 +13139,3 @@ des-cbc 3624.96k 5258.21k 5530.91k *) A minor bug in ssl/s3_clnt.c where there would always be 4 0 bytes sent in the client random. [Edward Bishop ] - Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/Configure Tue Nov 20 21:10:04 2018 (r340703) @@ -1013,13 +1013,18 @@ if (scalar(@seed_sources) == 0) { if (scalar(grep { $_ eq 'none' } @seed_sources) > 0) { die "Cannot seed with none and anything else" if scalar(@seed_sources) > 1; warn <<_____ if scalar(@seed_sources) == 1; -You have selected the --with-rand-seed=none option, which effectively disables -automatic reseeding of the OpenSSL random generator. All operations depending -on the random generator such as creating keys will not work unless the random -generator is seeded manually by the application. -Please read the 'Note on random number generation' section in the INSTALL -instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== +You have selected the --with-rand-seed=none option, which effectively +disables automatic reseeding of the OpenSSL random generator. +All operations depending on the random generator such as creating keys +will not work unless the random generator is seeded manually by the +application. + +Please read the 'Note on random number generation' section in the +INSTALL instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== + _____ } push @{$config{openssl_other_defines}}, @@ -2174,6 +2179,16 @@ EOF # Massage the result + # If the user configured no-shared, we allow no shared sources + if ($disabled{shared}) { + foreach (keys %{$unified_info{shared_sources}}) { + foreach (keys %{$unified_info{shared_sources}->{$_}}) { + delete $unified_info{sources}->{$_}; + } + } + $unified_info{shared_sources} = {}; + } + # If we depend on a header file or a perl module, add an inclusion of # its directory to allow smoothe inclusion foreach my $dest (keys %{$unified_info{depends}}) { @@ -2198,8 +2213,8 @@ EOF next unless defined($unified_info{includes}->{$dest}->{$k}); my @incs = reverse @{$unified_info{includes}->{$dest}->{$k}}; foreach my $obj (grep /\.o$/, - (keys %{$unified_info{sources}->{$dest}}, - keys %{$unified_info{shared_sources}->{$dest}})) { + (keys %{$unified_info{sources}->{$dest} // {}}, + keys %{$unified_info{shared_sources}->{$dest} // {}})) { foreach my $inc (@incs) { unshift @{$unified_info{includes}->{$obj}->{$k}}, $inc unless grep { $_ eq $inc } @{$unified_info{includes}->{$obj}->{$k}}; @@ -2238,6 +2253,42 @@ EOF [ @{$unified_info{includes}->{$dest}->{source}} ]; } } + + # For convenience collect information regarding directories where + # files are generated, those generated files and the end product + # they end up in where applicable. Then, add build rules for those + # directories + my %loopinfo = ( "lib" => [ @{$unified_info{libraries}} ], + "dso" => [ @{$unified_info{engines}} ], + "bin" => [ @{$unified_info{programs}} ], + "script" => [ @{$unified_info{scripts}} ] ); + foreach my $type (keys %loopinfo) { + foreach my $product (@{$loopinfo{$type}}) { + my %dirs = (); + my $pd = dirname($product); + + foreach (@{$unified_info{sources}->{$product} // []}, + @{$unified_info{shared_sources}->{$product} // []}) { + my $d = dirname($_); + + # We don't want to create targets for source directories + # when building out of source + next if ($config{sourcedir} ne $config{builddir} + && $d =~ m|^\Q$config{sourcedir}\E|); + # We already have a "test" target, and the current directory + # is just silly to make a target for + next if $d eq "test" || $d eq "."; + + $dirs{$d} = 1; + push @{$unified_info{dirinfo}->{$d}->{deps}}, $_ + if $d ne $pd; + } + foreach (keys %dirs) { + push @{$unified_info{dirinfo}->{$_}->{products}->{$type}}, + $product; + } + } + } } # For the schemes that need it, we provide the old *_obj configs @@ -2712,10 +2763,16 @@ print <<"EOF"; ********************************************************************** *** *** -*** If you want to report a building issue, please include the *** -*** output from this command: *** +*** OpenSSL has been successfully configured *** *** *** -*** perl configdata.pm --dump *** +*** If you encounter a problem while building, please open an *** +*** issue on GitHub *** +*** and include the output from the following command: *** +*** *** +*** perl configdata.pm --dump *** +*** *** +*** (If you are new to OpenSSL, you might want to consult the *** +*** 'Troubleshooting' section in the INSTALL file first) *** *** *** ********************************************************************** EOF Modified: head/crypto/openssl/INSTALL ============================================================================== --- head/crypto/openssl/INSTALL Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/INSTALL Tue Nov 20 21:10:04 2018 (r340703) @@ -614,8 +614,8 @@ Windows, and as a comma separated list of libraries on VMS. RANLIB The library archive indexer. - RC The Windows resources manipulator. - RCFLAGS Flags for the Windows reources manipulator. + RC The Windows resource compiler. + RCFLAGS Flags for the Windows resource compiler. RM The command to remove files and directories. These cannot be mixed with compiling / linking flags given @@ -969,7 +969,7 @@ BUILDFILE Use a different build file name than the platform default - ("Makefile" on Unixly platforms, "makefile" on native Windows, + ("Makefile" on Unix-like platforms, "makefile" on native Windows, "descrip.mms" on OpenVMS). This requires that there is a corresponding build file template. See Configurations/README for further information. @@ -1171,7 +1171,7 @@ part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of the name. - On most POSIXly platforms, shared libraries are named libcrypto.so.1.1 + On most POSIX platforms, shared libraries are named libcrypto.so.1.1 and libssl.so.1.1. on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll @@ -1202,7 +1202,7 @@ The seeding method can be configured using the --with-rand-seed option, which can be used to specify a comma separated list of seed methods. However in most cases OpenSSL will choose a suitable default method, - so it is not necessary to explicitely provide this option. Note also + so it is not necessary to explicitly provide this option. Note also that not all methods are available on all platforms. I) On operating systems which provide a suitable randomness source (in Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/NEWS Tue Nov 20 21:10:04 2018 (r340703) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1 and OpenSSL 1.1.1a [20 Nov 2018] + + o Timing vulnerability in DSA signature generation (CVE-2018-0734) + o Timing vulnerability in ECDSA signature generation (CVE-2018-0735) + Major changes between OpenSSL 1.1.0i and OpenSSL 1.1.1 [11 Sep 2018] o Support for TLSv1.3 added (see https://wiki.openssl.org/index.php/TLS1.3 Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/README Tue Nov 20 21:10:04 2018 (r340703) @@ -1,5 +1,5 @@ - OpenSSL 1.1.1 11 Sep 2018 + OpenSSL 1.1.1a 20 Nov 2018 Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: head/crypto/openssl/apps/app_rand.c ============================================================================== --- head/crypto/openssl/apps/app_rand.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/app_rand.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,6 @@ void app_RAND_load_conf(CONF *c, const char *section) if (RAND_load_file(randfile, -1) < 0) { BIO_printf(bio_err, "Can't load %s into RNG\n", randfile); ERR_print_errors(bio_err); - return; } if (save_rand_file == NULL) save_rand_file = OPENSSL_strdup(randfile); Modified: head/crypto/openssl/apps/apps.c ============================================================================== --- head/crypto/openssl/apps/apps.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/apps.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1831,6 +1831,12 @@ X509_NAME *parse_name(const char *cp, long chtype, int opt_getprog(), typestr); continue; } + if (*valstr == '\0') { + BIO_printf(bio_err, + "%s: No value provided for Subject Attribute %s, skipped\n", + opt_getprog(), typestr); + continue; + } if (!X509_NAME_add_entry_by_NID(n, nid, chtype, valstr, strlen((char *)valstr), -1, ismulti ? -1 : 0)) Modified: head/crypto/openssl/apps/apps.h ============================================================================== --- head/crypto/openssl/apps/apps.h Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/apps.h Tue Nov 20 21:10:04 2018 (r340703) @@ -369,7 +369,7 @@ typedef struct string_int_pair_st { # define OPT_FMT_SMIME (1L << 3) # define OPT_FMT_ENGINE (1L << 4) # define OPT_FMT_MSBLOB (1L << 5) -# define OPT_FMT_NETSCAPE (1L << 6) +/* (1L << 6) was OPT_FMT_NETSCAPE, but wasn't used */ # define OPT_FMT_NSS (1L << 7) # define OPT_FMT_TEXT (1L << 8) # define OPT_FMT_HTTP (1L << 9) @@ -378,8 +378,8 @@ typedef struct string_int_pair_st { # define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME) # define OPT_FMT_ANY ( \ OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \ - OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NETSCAPE | \ - OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) + OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \ + OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) char *opt_progname(const char *argv0); char *opt_getprog(void); Modified: head/crypto/openssl/apps/ca.c ============================================================================== --- head/crypto/openssl/apps/ca.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/ca.c Tue Nov 20 21:10:04 2018 (r340703) @@ -605,7 +605,7 @@ end_of_options: /* * outdir is a directory spec, but access() for VMS demands a * filename. We could use the DEC C routine to convert the - * directory syntax to Unixly, and give that to app_isdir, + * directory syntax to Unix, and give that to app_isdir, * but for now the fopen will catch the error if it's not a * directory */ @@ -976,7 +976,7 @@ end_of_options: BIO_printf(bio_err, "Write out database with %d new entries\n", sk_X509_num(cert_sk)); - if (!rand_ser + if (serialfile != NULL && !save_serial(serialfile, "new", serial, NULL)) goto end; @@ -1044,7 +1044,8 @@ end_of_options: if (sk_X509_num(cert_sk)) { /* Rename the database and the serial file */ - if (!rotate_serial(serialfile, "new", "old")) + if (serialfile != NULL + && !rotate_serial(serialfile, "new", "old")) goto end; if (!rotate_index(dbfile, "new", "old")) @@ -1177,10 +1178,9 @@ end_of_options: } /* we have a CRL number that need updating */ - if (crlnumberfile != NULL) - if (!rand_ser - && !save_serial(crlnumberfile, "new", crlnumber, NULL)) - goto end; + if (crlnumberfile != NULL + && !save_serial(crlnumberfile, "new", crlnumber, NULL)) + goto end; BN_free(crlnumber); crlnumber = NULL; @@ -1195,9 +1195,10 @@ end_of_options: PEM_write_bio_X509_CRL(Sout, crl); - if (crlnumberfile != NULL) /* Rename the crlnumber file */ - if (!rotate_serial(crlnumberfile, "new", "old")) - goto end; + /* Rename the crlnumber file */ + if (crlnumberfile != NULL + && !rotate_serial(crlnumberfile, "new", "old")) + goto end; } /*****************************************************************/ Modified: head/crypto/openssl/apps/ocsp.c ============================================================================== --- head/crypto/openssl/apps/ocsp.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/ocsp.c Tue Nov 20 21:10:04 2018 (r340703) @@ -950,6 +950,7 @@ static void spawn_loop(void) sleep(30); break; case 0: /* child */ + OPENSSL_free(kidpids); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); if (termsig) @@ -976,6 +977,7 @@ static void spawn_loop(void) } /* The loop above can only break on termsig */ + OPENSSL_free(kidpids); syslog(LOG_INFO, "terminating on signal: %d", termsig); killall(0, kidpids); } Modified: head/crypto/openssl/apps/openssl.cnf ============================================================================== --- head/crypto/openssl/apps/openssl.cnf Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/openssl.cnf Tue Nov 20 21:10:04 2018 (r340703) @@ -11,7 +11,6 @@ # This definition stops the following lines choking if HOME isn't # defined. HOME = . -RANDFILE = $ENV::HOME/.rnd # Extra OBJECT IDENTIFIER info: #oid_file = $ENV::HOME/.oid @@ -58,7 +57,6 @@ crlnumber = $dir/crlnumber # the current crl number # must be commented out to leave a V1 CRL crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key -RANDFILE = $dir/private/.rand # private random number file x509_extensions = usr_cert # The extensions to add to the cert Modified: head/crypto/openssl/apps/opt.c ============================================================================== --- head/crypto/openssl/apps/opt.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/opt.c Tue Nov 20 21:10:04 2018 (r340703) @@ -168,7 +168,6 @@ static OPT_PAIR formats[] = { {"smime", OPT_FMT_SMIME}, {"engine", OPT_FMT_ENGINE}, {"msblob", OPT_FMT_MSBLOB}, - {"netscape", OPT_FMT_NETSCAPE}, {"nss", OPT_FMT_NSS}, {"text", OPT_FMT_TEXT}, {"http", OPT_FMT_HTTP}, Modified: head/crypto/openssl/apps/rehash.c ============================================================================== --- head/crypto/openssl/apps/rehash.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/rehash.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1,6 +1,6 @@ /* * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2013-2014 Timo Teräs + * Copyright (c) 2013-2014 Timo Teräs * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy Modified: head/crypto/openssl/apps/rsa.c ============================================================================== --- head/crypto/openssl/apps/rsa.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/rsa.c Tue Nov 20 21:10:04 2018 (r340703) @@ -38,8 +38,8 @@ typedef enum OPTION_choice { const OPTIONS rsa_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, - {"inform", OPT_INFORM, 'f', "Input format, one of DER NET PEM"}, - {"outform", OPT_OUTFORM, 'f', "Output format, one of DER NET PEM PVK"}, + {"inform", OPT_INFORM, 'f', "Input format, one of DER PEM"}, + {"outform", OPT_OUTFORM, 'f', "Output format, one of DER PEM PVK"}, {"in", OPT_IN, 's', "Input file"}, {"out", OPT_OUT, '>', "Output file"}, {"pubin", OPT_PUBIN, '-', "Expect a public key in input file"}, @@ -269,6 +269,9 @@ int rsa_main(int argc, char **argv) } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); + if (pk == NULL) + goto end; + EVP_PKEY_set1_RSA(pk, rsa); if (outformat == FORMAT_PVK) { if (pubin) { Modified: head/crypto/openssl/apps/s_cb.c ============================================================================== --- head/crypto/openssl/apps/s_cb.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/s_cb.c Tue Nov 20 21:10:04 2018 (r340703) @@ -394,7 +394,8 @@ int ssl_print_groups(BIO *out, SSL *s, int noshared) int ssl_print_tmp_key(BIO *out, SSL *s) { EVP_PKEY *key; - if (!SSL_get_server_tmp_key(s, &key)) + + if (!SSL_get_peer_tmp_key(s, &key)) return 1; BIO_puts(out, "Server Temp Key: "); switch (EVP_PKEY_id(key)) { Modified: head/crypto/openssl/apps/s_server.c ============================================================================== --- head/crypto/openssl/apps/s_server.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/s_server.c Tue Nov 20 21:10:04 2018 (r340703) @@ -193,9 +193,8 @@ static int psk_find_session_cb(SSL *ssl, const unsigne if (strlen(psk_identity) != identity_len || memcmp(psk_identity, identity, identity_len) != 0) { - BIO_printf(bio_s_out, - "PSK warning: client identity not what we expected" - " (got '%s' expected '%s')\n", identity, psk_identity); + *sess = NULL; + return 1; } if (psksess != NULL) { @@ -1622,6 +1621,11 @@ int s_server_main(int argc, char *argv[]) goto end; } #endif + if (early_data && (www > 0 || rev)) { + BIO_printf(bio_err, + "Can't use -early_data in combination with -www, -WWW, -HTTP, or -rev\n"); + goto end; + } #ifndef OPENSSL_NO_SCTP if (protocol == IPPROTO_SCTP) { Modified: head/crypto/openssl/apps/speed.c ============================================================================== --- head/crypto/openssl/apps/speed.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/speed.c Tue Nov 20 21:10:04 2018 (r340703) @@ -2896,7 +2896,7 @@ int speed_main(int argc, char **argv) if (rsa_count <= 1) { /* if longer than 10s, don't do any more */ - for (testnum++; testnum < EC_NUM; testnum++) + for (testnum++; testnum < ECDSA_NUM; testnum++) ecdsa_doit[testnum] = 0; } } Modified: head/crypto/openssl/apps/x509.c ============================================================================== --- head/crypto/openssl/apps/x509.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/apps/x509.c Tue Nov 20 21:10:04 2018 (r340703) @@ -67,10 +67,10 @@ typedef enum OPTION_choice { const OPTIONS x509_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, {"inform", OPT_INFORM, 'f', - "Input format - default PEM (one of DER, NET or PEM)"}, + "Input format - default PEM (one of DER or PEM)"}, {"in", OPT_IN, '<', "Input file - default stdin"}, {"outform", OPT_OUTFORM, 'f', - "Output format - default PEM (one of DER, NET or PEM)"}, + "Output format - default PEM (one of DER or PEM)"}, {"out", OPT_OUT, '>', "Output file - default stdout"}, {"keyform", OPT_KEYFORM, 'F', "Private key format - default PEM"}, {"passin", OPT_PASSIN, 's', "Private key password/pass-phrase source"}, Modified: head/crypto/openssl/crypto/LPdir_unix.c ============================================================================== --- head/crypto/openssl/crypto/LPdir_unix.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/LPdir_unix.c Tue Nov 20 21:10:04 2018 (r340703) @@ -51,7 +51,7 @@ #endif /* - * The POSIXly macro for the maximum number of characters in a file path is + * The POSIX macro for the maximum number of characters in a file path is * NAME_MAX. However, some operating systems use PATH_MAX instead. * Therefore, it seems natural to first check for PATH_MAX and use that, and * if it doesn't exist, use NAME_MAX. Modified: head/crypto/openssl/crypto/async/arch/async_posix.h ============================================================================== --- head/crypto/openssl/crypto/async/arch/async_posix.h Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/async/arch/async_posix.h Tue Nov 20 21:10:04 2018 (r340703) @@ -17,7 +17,8 @@ # include -# if _POSIX_VERSION >= 200112L +# if _POSIX_VERSION >= 200112L \ + && (_POSIX_VERSION < 200809L || defined(__GLIBC__)) # include Modified: head/crypto/openssl/crypto/bio/b_sock2.c ============================================================================== --- head/crypto/openssl/crypto/bio/b_sock2.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bio/b_sock2.c Tue Nov 20 21:10:04 2018 (r340703) @@ -133,7 +133,9 @@ int BIO_connect(int sock, const BIO_ADDR *addr, int op */ int BIO_bind(int sock, const BIO_ADDR *addr, int options) { +# ifndef OPENSSL_SYS_WINDOWS int on = 1; +# endif if (sock == -1) { BIOerr(BIO_F_BIO_BIND, BIO_R_INVALID_SOCKET); Modified: head/crypto/openssl/crypto/bio/bio_lib.c ============================================================================== --- head/crypto/openssl/crypto/bio/bio_lib.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bio/bio_lib.c Tue Nov 20 21:10:04 2018 (r340703) @@ -52,7 +52,7 @@ static long bio_call_callback(BIO *b, int oper, const argi = (int)len; } - if (inret && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (inret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { if (*processed > INT_MAX) return -1; inret = *processed; @@ -60,7 +60,7 @@ static long bio_call_callback(BIO *b, int oper, const ret = b->callback(b, oper, argp, argi, argl, inret); - if (ret >= 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (ret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { *processed = (size_t)ret; ret = 1; } Modified: head/crypto/openssl/crypto/bio/bss_log.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_log.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bio/bss_log.c Tue Nov 20 21:10:04 2018 (r340703) @@ -408,4 +408,9 @@ static void xcloselog(BIO *bp) # endif /* Unix */ +#else /* NO_SYSLOG */ +const BIO_METHOD *BIO_s_log(void) +{ + return NULL; +} #endif /* NO_SYSLOG */ Modified: head/crypto/openssl/crypto/bn/asm/x86_64-gcc.c ============================================================================== --- head/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -63,12 +63,6 @@ * very much like 64-bit code compiled with no-asm on the same * machine. */ - -# if defined(_WIN64) || !defined(__LP64__) -# define BN_ULONG unsigned long long -# else -# define BN_ULONG unsigned long -# endif # undef mul # undef mul_add Modified: head/crypto/openssl/crypto/bn/bn_exp.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_exp.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bn/bn_exp.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1077,7 +1077,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM * is not only slower but also makes each bit vulnerable to * EM (and likely other) side-channel attacks like One&Done * (for details see "One&Done: A Single-Decryption EM-Based - * Attack on OpenSSL’s Constant-Time Blinded RSA" by M. Alam, + * Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam, * H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and * M. Prvulovic, in USENIX Security'18) */ Modified: head/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 21:10:04 2018 (r340703) @@ -767,26 +767,30 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, b->neg ^= t; /*- - * Idea behind BN_FLG_STATIC_DATA is actually to - * indicate that data may not be written to. - * Intention is actually to treat it as it's - * read-only data, and some (if not most) of it does - * reside in read-only segment. In other words - * observation of BN_FLG_STATIC_DATA in - * BN_consttime_swap should be treated as fatal - * condition. It would either cause SEGV or - * effectively cause data corruption. - * BN_FLG_MALLOCED refers to BN structure itself, - * and hence must be preserved. Remaining flags are - * BN_FLG_CONSTIME and BN_FLG_SECURE. Latter must be - * preserved, because it determines how x->d was - * allocated and hence how to free it. This leaves - * BN_FLG_CONSTTIME that one can do something about. - * To summarize it's sufficient to mask and swap - * BN_FLG_CONSTTIME alone. BN_FLG_STATIC_DATA should - * be treated as fatal. + * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention + * is actually to treat it as it's read-only data, and some (if not most) + * of it does reside in read-only segment. In other words observation of + * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal + * condition. It would either cause SEGV or effectively cause data + * corruption. + * + * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be + * preserved. + * + * BN_FLG_SECURE: must be preserved, because it determines how x->d was + * allocated and hence how to free it. + * + * BN_FLG_CONSTTIME: sufficient to mask and swap + * + * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on + * the data, so the d array may be padded with additional 0 values (i.e. + * top could be greater than the minimal value that it could be). We should + * be swapping it */ - t = ((a->flags ^ b->flags) & BN_FLG_CONSTTIME) & condition; + +#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP) + + t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition; a->flags ^= t; b->flags ^= t; Modified: head/crypto/openssl/crypto/build.info ============================================================================== --- head/crypto/openssl/crypto/build.info Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/build.info Tue Nov 20 21:10:04 2018 (r340703) @@ -2,7 +2,7 @@ LIBS=../libcrypto SOURCE[../libcrypto]=\ cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fopen.c ctype.c \ - threads_pthread.c threads_win.c threads_none.c \ + threads_pthread.c threads_win.c threads_none.c getenv.c \ o_init.c o_fips.c mem_sec.c init.c {- $target{cpuid_asm_src} -} \ {- $target{uplink_aux_src} -} EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \ Modified: head/crypto/openssl/crypto/conf/conf_api.c ============================================================================== --- head/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 21:10:04 2018 (r340703) @@ -10,6 +10,7 @@ /* Part of the code in here was originally in conf.c, which is now removed */ #include "e_os.h" +#include "internal/cryptlib.h" #include #include #include @@ -82,7 +83,7 @@ char *_CONF_get_string(const CONF *conf, const char *s if (v != NULL) return v->value; if (strcmp(section, "ENV") == 0) { - p = getenv(name); + p = ossl_safe_getenv(name); if (p != NULL) return p; } @@ -95,7 +96,7 @@ char *_CONF_get_string(const CONF *conf, const char *s else return NULL; } else - return getenv(name); + return ossl_safe_getenv(name); } static unsigned long conf_value_hash(const CONF_VALUE *v) Modified: head/crypto/openssl/crypto/conf/conf_mod.c ============================================================================== --- head/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 21:10:04 2018 (r340703) @@ -480,11 +480,8 @@ char *CONF_get1_default_config_file(void) char *file, *sep = ""; int len; - if (!OPENSSL_issetugid()) { - file = getenv("OPENSSL_CONF"); - if (file) - return OPENSSL_strdup(file); - } + if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL) + return OPENSSL_strdup(file); len = strlen(X509_get_default_cert_area()); #ifndef OPENSSL_SYS_VMS Modified: head/crypto/openssl/crypto/cryptlib.c ============================================================================== --- head/crypto/openssl/crypto/cryptlib.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/cryptlib.c Tue Nov 20 21:10:04 2018 (r340703) @@ -204,7 +204,7 @@ int OPENSSL_isservice(void) if (_OPENSSL_isservice.p == NULL) { HANDLE mod = GetModuleHandle(NULL); - FARPROC f; + FARPROC f = NULL; if (mod != NULL) f = GetProcAddress(mod, "_OPENSSL_isservice"); Modified: head/crypto/openssl/crypto/ct/ct_log.c ============================================================================== --- head/crypto/openssl/crypto/ct/ct_log.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/ct/ct_log.c Tue Nov 20 21:10:04 2018 (r340703) @@ -137,7 +137,7 @@ static int ctlog_new_from_conf(CTLOG **ct_log, const C int CTLOG_STORE_load_default_file(CTLOG_STORE *store) { - const char *fpath = getenv(CTLOG_FILE_EVP); + const char *fpath = ossl_safe_getenv(CTLOG_FILE_EVP); if (fpath == NULL) fpath = CTLOG_FILE; Modified: head/crypto/openssl/crypto/dsa/dsa_gen.c ============================================================================== --- head/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 21:10:04 2018 (r340703) @@ -327,6 +327,12 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N if (mctx == NULL) goto err; + /* make sure L > N, otherwise we'll get trapped in an infinite loop */ + if (L <= N) { + DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS); + goto err; + } + if (evpmd == NULL) { if (N == 160) evpmd = EVP_sha1(); Modified: head/crypto/openssl/crypto/dsa/dsa_ossl.c ============================================================================== --- head/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 21:10:04 2018 (r340703) @@ -9,6 +9,7 @@ #include #include "internal/cryptlib.h" +#include "internal/bn_int.h" #include #include #include "dsa_locl.h" @@ -23,6 +24,8 @@ static int dsa_do_verify(const unsigned char *dgst, in DSA_SIG *sig, DSA *dsa); static int dsa_init(DSA *dsa); static int dsa_finish(DSA *dsa); +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx); static DSA_METHOD openssl_dsa_meth = { "OpenSSL DSA method", @@ -178,9 +181,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, { BN_CTX *ctx = NULL; BIGNUM *k, *kinv = NULL, *r = *rp; - BIGNUM *l, *m; + BIGNUM *l; int ret = 0; - int q_bits; + int q_bits, q_words; if (!dsa->p || !dsa->q || !dsa->g) { DSAerr(DSA_F_DSA_SIGN_SETUP, DSA_R_MISSING_PARAMETERS); @@ -189,8 +192,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, k = BN_new(); l = BN_new(); - m = BN_new(); - if (k == NULL || l == NULL || m == NULL) + if (k == NULL || l == NULL) goto err; if (ctx_in == NULL) { @@ -201,9 +203,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, /* Preallocate space */ q_bits = BN_num_bits(dsa->q); - if (!BN_set_bit(k, q_bits) - || !BN_set_bit(l, q_bits) - || !BN_set_bit(m, q_bits)) + q_words = bn_get_top(dsa->q); + if (!bn_wexpand(k, q_words + 2) + || !bn_wexpand(l, q_words + 2)) goto err; /* Get random k */ @@ -221,6 +223,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, } while (BN_is_zero(k)); BN_set_flags(k, BN_FLG_CONSTTIME); + BN_set_flags(l, BN_FLG_CONSTTIME); if (dsa->flags & DSA_FLAG_CACHE_MONT_P) { if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, @@ -238,14 +241,17 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, * small timing information leakage. We then choose the sum that is * one bit longer than the modulus. * - * TODO: revisit the BN_copy aiming for a memory access agnostic - * conditional copy. + * There are some concerns about the efficacy of doing this. More + * specificly refer to the discussion starting with: + * https://github.com/openssl/openssl/pull/7486#discussion_r228323705 + * The fix is to rework BN so these gymnastics aren't required. */ if (!BN_add(l, k, dsa->q) - || !BN_add(m, l, dsa->q) - || !BN_copy(k, BN_num_bits(l) > q_bits ? l : m)) + || !BN_add(k, l, dsa->q)) goto err; + BN_consttime_swap(BN_is_bit_set(l, q_bits), k, l, q_words + 2); + if ((dsa)->meth->bn_mod_exp != NULL) { if (!dsa->meth->bn_mod_exp(dsa, r, dsa->g, k, dsa->p, ctx, dsa->method_mont_p)) @@ -258,8 +264,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, if (!BN_mod(r, r, dsa->q, ctx)) goto err; - /* Compute part of 's = inv(k) (m + xr) mod q' */ - if ((kinv = BN_mod_inverse(NULL, k, dsa->q, ctx)) == NULL) + /* Compute part of 's = inv(k) (m + xr) mod q' */ + if ((kinv = dsa_mod_inverse_fermat(k, dsa->q, ctx)) == NULL) goto err; BN_clear_free(*kinvp); @@ -273,7 +279,6 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BN_CTX_free(ctx); BN_clear_free(k); BN_clear_free(l); - BN_clear_free(m); return ret; } @@ -392,4 +397,32 @@ static int dsa_finish(DSA *dsa) { BN_MONT_CTX_free(dsa->method_mont_p); return 1; +} + +/* + * Compute the inverse of k modulo q. + * Since q is prime, Fermat's Little Theorem applies, which reduces this to + * mod-exp operation. Both the exponent and modulus are public information + * so a mod-exp that doesn't leak the base is sufficient. A newly allocated + * BIGNUM is returned which the caller must free. + */ +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx) +{ + BIGNUM *res = NULL; + BIGNUM *r, *e; + + if ((r = BN_new()) == NULL) + return NULL; + + BN_CTX_start(ctx); + if ((e = BN_CTX_get(ctx)) != NULL + && BN_set_word(r, 2) + && BN_sub(e, q, r) + && BN_mod_exp_mont(r, k, e, q, ctx, NULL)) + res = r; + else + BN_free(r); + BN_CTX_end(ctx); + return res; } Modified: head/crypto/openssl/crypto/ec/ec_ameth.c ============================================================================== --- head/crypto/openssl/crypto/ec/ec_ameth.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/ec/ec_ameth.c Tue Nov 20 21:10:04 2018 (r340703) @@ -699,7 +699,7 @@ static int ecdh_cms_set_kdf_param(EVP_PKEY_CTX *pctx, if (EVP_PKEY_CTX_set_ecdh_cofactor_mode(pctx, cofactor) <= 0) return 0; - if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_62) <= 0) + if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_63) <= 0) return 0; kdf_md = EVP_get_digestbynid(kdfmd_nid); @@ -864,7 +864,7 @@ static int ecdh_cms_encrypt(CMS_RecipientInfo *ri) ecdh_nid = NID_dh_cofactor_kdf; if (kdf_type == EVP_PKEY_ECDH_KDF_NONE) { - kdf_type = EVP_PKEY_ECDH_KDF_X9_62; + kdf_type = EVP_PKEY_ECDH_KDF_X9_63; if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, kdf_type) <= 0) goto err; } else Modified: head/crypto/openssl/crypto/ec/ec_mult.c ============================================================================== --- head/crypto/openssl/crypto/ec/ec_mult.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/ec/ec_mult.c Tue Nov 20 21:10:04 2018 (r340703) @@ -206,8 +206,8 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI */ cardinality_bits = BN_num_bits(cardinality); group_top = bn_get_top(cardinality); - if ((bn_wexpand(k, group_top + 1) == NULL) - || (bn_wexpand(lambda, group_top + 1) == NULL)) { + if ((bn_wexpand(k, group_top + 2) == NULL) + || (bn_wexpand(lambda, group_top + 2) == NULL)) { ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB); goto err; } @@ -244,7 +244,7 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI * k := scalar + 2*cardinality */ kbit = BN_is_bit_set(lambda, cardinality_bits); - BN_consttime_swap(kbit, k, lambda, group_top + 1); + BN_consttime_swap(kbit, k, lambda, group_top + 2); group_top = bn_get_top(group->field); if ((bn_wexpand(s->X, group_top) == NULL) Modified: head/crypto/openssl/crypto/ec/ec_pmeth.c ============================================================================== --- head/crypto/openssl/crypto/ec/ec_pmeth.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/ec/ec_pmeth.c Tue Nov 20 21:10:04 2018 (r340703) @@ -209,7 +209,7 @@ static int pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx, if (!pkey_ec_derive(ctx, ktmp, &ktmplen)) goto err; /* Do KDF stuff */ - if (!ECDH_KDF_X9_62(key, *keylen, ktmp, ktmplen, + if (!ecdh_KDF_X9_63(key, *keylen, ktmp, ktmplen, dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md)) goto err; rv = 1; @@ -281,7 +281,7 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, i case EVP_PKEY_CTRL_EC_KDF_TYPE: if (p1 == -2) return dctx->kdf_type; - if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_62) + if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_63) return -2; dctx->kdf_type = p1; return 1; Modified: head/crypto/openssl/crypto/ec/ecdh_kdf.c ============================================================================== --- head/crypto/openssl/crypto/ec/ecdh_kdf.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/ec/ecdh_kdf.c Tue Nov 20 21:10:04 2018 (r340703) @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,12 +10,13 @@ #include #include #include +#include "ec_lcl.h" -/* Key derivation function from X9.62/SECG */ +/* Key derivation function from X9.63/SECG */ /* Way more than we will ever need */ #define ECDH_KDF_MAX (1 << 30) -int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, +int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *Z, size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md) @@ -65,4 +66,16 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, err: EVP_MD_CTX_free(mctx); return rv; +} + +/*- + * The old name for ecdh_KDF_X9_63 + * Retained for ABI compatibility + */ +int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, + const unsigned char *Z, size_t Zlen, + const unsigned char *sinfo, size_t sinfolen, + const EVP_MD *md) +{ + return ecdh_KDF_X9_63(out, outlen, Z, Zlen, sinfo, sinfolen, md); } Modified: head/crypto/openssl/crypto/engine/eng_devcrypto.c ============================================================================== --- head/crypto/openssl/crypto/engine/eng_devcrypto.c Tue Nov 20 21:04:20 2018 (r340702) +++ head/crypto/openssl/crypto/engine/eng_devcrypto.c Tue Nov 20 21:10:04 2018 (r340703) @@ -28,6 +28,13 @@ # define CHECK_BSD_STYLE_MACROS #endif +/* + * ONE global file descriptor for all sessions. This allows operations + * such as digest session data copying (see digest_copy()), but is also + * saner... why re-open /dev/crypto for every session? + */ +static int cfd; + /****************************************************************************** * * Ciphers @@ -39,7 +46,6 @@ *****/ struct cipher_ctx { - int cfd; struct session_op sess; /* to pass from init to do_cipher */ @@ -69,7 +75,7 @@ static const struct cipher_data_st { { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC }, { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC }, #ifndef OPENSSL_NO_RC4 - { NID_rc4, 1, 16, 0, CRYPTO_ARC4 }, + { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Nov 20 22:12:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D61CB113FFE8; Tue, 20 Nov 2018 22:12:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C8428685F; Tue, 20 Nov 2018 22:12:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F20C17654; Tue, 20 Nov 2018 22:12:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKMCBnk064133; Tue, 20 Nov 2018 22:12:11 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKMCBCW064132; Tue, 20 Nov 2018 22:12:11 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811202212.wAKMCBCW064132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 22:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340706 - head X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 340706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C8428685F X-Spamd-Result: default: False [0.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.386,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 22:12:12 -0000 Author: jkim Date: Tue Nov 20 22:12:10 2018 New Revision: 340706 URL: https://svnweb.freebsd.org/changeset/base/340706 Log: Remove stale manual pages after OpenSSL 1.1.1a merge. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Nov 20 21:35:20 2018 (r340705) +++ head/ObsoleteFiles.inc Tue Nov 20 22:12:10 2018 (r340706) @@ -38,6 +38,14 @@ # xargs -n1 | sort | uniq -d; # done +# 20181120: OpenSSL 1.1.1a +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_add_client_CA.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_get_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_set_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_add_client_CA.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_get_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_get_server_tmp_key.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_set_client_CA_list.3.gz # 20181116: Rename test file. OLD_FILES+=usr/tests/sys/netinet/reuseport_lb # 20181112: Cleanup old libcap_dns. From owner-svn-src-head@freebsd.org Tue Nov 20 22:21:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D2DE1140519; Tue, 20 Nov 2018 22:21:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF76586EAB; Tue, 20 Nov 2018 22:21:19 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0A4B176B7; Tue, 20 Nov 2018 22:21:19 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKMLJDM068168; Tue, 20 Nov 2018 22:21:19 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKMLJ3W068166; Tue, 20 Nov 2018 22:21:19 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201811202221.wAKMLJ3W068166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 20 Nov 2018 22:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340707 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 340707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF76586EAB X-Spamd-Result: default: False [0.53 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.391,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 22:21:20 -0000 Author: araujo Date: Tue Nov 20 22:21:19 2018 New Revision: 340707 URL: https://svnweb.freebsd.org/changeset/base/340707 Log: Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES to avoid buffer accessed out of bounds, also switch to snprintf(3). PR: 200859 Submitted by: Caglar Obtained from: https://github.com/mist64/xhyve/pull/24 MFC after: 4 weeks Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_ahci.c head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:12:10 2018 (r340706) +++ head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:21:19 2018 (r340707) @@ -105,7 +105,7 @@ enum sata_fis_type { * ATA commands */ #define ATA_SF_ENAB_SATA_SF 0x10 -#define ATA_SATA_SF_AN 0x05 +#define ATA_SATA_SF_AN 0x05 #define ATA_SF_DIS_SATA_SF 0x90 /* @@ -119,6 +119,8 @@ static FILE *dbg; #endif #define WPRINTF(format, arg...) printf(format, ##arg) +#define AHCI_PORT_IDENT 20 + 1 + struct ahci_ioreq { struct blockif_req io_req; struct ahci_port *io_pr; @@ -136,7 +138,7 @@ struct ahci_port { struct pci_ahci_softc *pr_sc; uint8_t *cmd_lst; uint8_t *rfis; - char ident[20 + 1]; + char ident[AHCI_PORT_IDENT]; int port; int atapi; int reset; @@ -2374,7 +2376,8 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst *p MD5Init(&mdctx); MD5Update(&mdctx, opts, strlen(opts)); MD5Final(digest, &mdctx); - sprintf(sc->port[p].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + snprintf(sc->port[p].ident, AHCI_PORT_IDENT, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:12:10 2018 (r340706) +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:21:19 2018 (r340707) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 -#define VTBLK_BLK_ID_BYTES 20 +#define VTBLK_BLK_ID_BYTES 20 + 1 /* Capability bits */ #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ @@ -344,7 +344,8 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * MD5Init(&mdctx); MD5Update(&mdctx, opts, strlen(opts)); MD5Final(digest, &mdctx); - sprintf(sc->vbsc_ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); /* setup virtio block config space */ From owner-svn-src-head@freebsd.org Tue Nov 20 22:49:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 940401140E84; Tue, 20 Nov 2018 22:49:20 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3368888720; Tue, 20 Nov 2018 22:49:20 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F5D817B8B; Tue, 20 Nov 2018 22:49:20 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKMnJ8U082472; Tue, 20 Nov 2018 22:49:19 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKMnJxH082469; Tue, 20 Nov 2018 22:49:19 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811202249.wAKMnJxH082469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Tue, 20 Nov 2018 22:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux vm X-SVN-Commit-Revision: 340709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3368888720 X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; NEURAL_HAM_SHORT(-0.09)[-0.086,0]; NEURAL_SPAM_LONG(0.00)[0.001,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 22:49:20 -0000 Author: bwidawsk Date: Tue Nov 20 22:49:19 2018 New Revision: 340709 URL: https://svnweb.freebsd.org/changeset/base/340709 Log: linuxkpi: Add some basic swap functions These are used by kms-drm to determine various heuristics relate memory conditions. The number of free swap pages is just a variable, and it can be much cheaper by either adding a new getter, or simply extern'ing swap_total. However, this patch opts to use the more expensive, existing interface - since this isn't an operation in a high per path. This allows us to remove some more gpl linuxkpi and do the follo kms-drm: git rm linuxkpi/gplv2/include/linux/swap.h Reviewed by: mmacy, Johannes Lundberg Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D18052 Added: head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) Modified: head/sys/vm/vm_pageout.h head/sys/vm/vm_swapout.c Added: head/sys/compat/linuxkpi/common/include/linux/swap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/swap.h Tue Nov 20 22:49:19 2018 (r340709) @@ -0,0 +1,102 @@ +/*- + * Copyright (c) 2018 Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_SWAP_H_ +#define _LINUX_SWAP_H_ + +#include +#include + +static inline long +get_nr_swap_pages(void) +{ + int i, j; + + /* NB: This could be done cheaply by obtaining swap_total directly */ + swap_pager_status(&i, &j); + return i - j; +} + +static inline int +current_is_kswapd(void) +{ + return vm_curproc_is_vmproc(); +} + +#endif +/*- + * Copyright (c) 2018 Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_SWAP_H_ +#define _LINUX_SWAP_H_ + +#include +#include + +static inline long +get_nr_swap_pages(void) +{ + int i, j; + + /* NB: This could be done cheaply by obtaining swap_total directly */ + swap_pager_status(&i, &j); + return i - j; +} + +static inline int +current_is_kswapd(void) +{ + return vm_curproc_is_vmproc(); +} + +#endif Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Tue Nov 20 22:24:18 2018 (r340708) +++ head/sys/vm/vm_pageout.h Tue Nov 20 22:49:19 2018 (r340709) @@ -106,5 +106,8 @@ void vm_pageout_oom(int shortage); void vm_swapout_run(void); void vm_swapout_run_idle(void); + +bool vm_curproc_is_vmproc(void); + #endif /* _KERNEL */ #endif /* _VM_VM_PAGEOUT_H_ */ Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) @@ -961,3 +961,10 @@ swapout(struct proc *p) p->p_swtick = ticks; return (0); } + +/* Used to determine if the current process is itself the reaper. */ +bool +vm_curproc_is_vmproc(void) +{ + return curproc == vmproc; +} From owner-svn-src-head@freebsd.org Tue Nov 20 23:05:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFE701141618; Tue, 20 Nov 2018 23:05:10 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B9448914C; Tue, 20 Nov 2018 23:05:10 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C7BA17EF4; Tue, 20 Nov 2018 23:05:10 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKN5AVH092627; Tue, 20 Nov 2018 23:05:10 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKN5AIA092626; Tue, 20 Nov 2018 23:05:10 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811202305.wAKN5AIA092626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Tue, 20 Nov 2018 23:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340710 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 340710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B9448914C X-Spamd-Result: default: False [0.03 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; NEURAL_HAM_SHORT(-0.09)[-0.089,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 23:05:11 -0000 Author: bwidawsk Date: Tue Nov 20 23:05:09 2018 New Revision: 340710 URL: https://svnweb.freebsd.org/changeset/base/340710 Log: linuxkpi: Remove duplicated text Somehow this got botched while moving from git -> svn Modified: head/sys/compat/linuxkpi/common/include/linux/swap.h Modified: head/sys/compat/linuxkpi/common/include/linux/swap.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/swap.h Tue Nov 20 22:49:19 2018 (r340709) +++ head/sys/compat/linuxkpi/common/include/linux/swap.h Tue Nov 20 23:05:09 2018 (r340710) @@ -49,54 +49,3 @@ current_is_kswapd(void) } #endif -/*- - * Copyright (c) 2018 Intel Corporation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _LINUX_SWAP_H_ -#define _LINUX_SWAP_H_ - -#include -#include - -static inline long -get_nr_swap_pages(void) -{ - int i, j; - - /* NB: This could be done cheaply by obtaining swap_total directly */ - swap_pager_status(&i, &j); - return i - j; -} - -static inline int -current_is_kswapd(void) -{ - return vm_curproc_is_vmproc(); -} - -#endif From owner-svn-src-head@freebsd.org Tue Nov 20 23:27:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86EA01141F54; Tue, 20 Nov 2018 23:27:16 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2854C89E4D; Tue, 20 Nov 2018 23:27:16 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0920A1824A; Tue, 20 Nov 2018 23:27:16 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKNRFmS003013; Tue, 20 Nov 2018 23:27:15 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKNRFKr003012; Tue, 20 Nov 2018 23:27:15 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811202327.wAKNRFKr003012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Tue, 20 Nov 2018 23:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340712 - head/tools/tools/git X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/tools/tools/git X-SVN-Commit-Revision: 340712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2854C89E4D X-Spamd-Result: default: False [0.03 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.09)[-0.089,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 23:27:16 -0000 Author: bwidawsk Date: Tue Nov 20 23:27:15 2018 New Revision: 340712 URL: https://svnweb.freebsd.org/changeset/base/340712 Log: git-svn-init: Add docs to the choice of repos Modified: head/tools/tools/git/git-svn-init Modified: head/tools/tools/git/git-svn-init ============================================================================== --- head/tools/tools/git/git-svn-init Tue Nov 20 23:07:45 2018 (r340711) +++ head/tools/tools/git/git-svn-init Tue Nov 20 23:27:15 2018 (r340712) @@ -35,6 +35,10 @@ GIT_IN_PATH=$(which git) GIT=${GIT-${GIT_IN_PATH}} +GIT_DOCS_REPO=${GIT_DOCS_REPO-git://github.com/freebsd/freebsd-doc.git} +GIT_SVN_DOCS_ROOT_URI=${GIT_SVN_DOCS_ROOT_URI-svn.freebsd.org/doc} +GIT_SVN_DOCS_URI=${GIV_SVN_DOCS_URI-repo.freebsd.org/doc} + GIT_PORTS_REPO=${GIT_PORTS_REPO-git://github.com/freebsd/freebsd-ports.git} GIT_SVN_PORTS_ROOT_URI=${GIT_SVN_PORTS_ROOT_URI-svn.freebsd.org/ports} GIT_SVN_PORTS_URI=${GIT_SVN_PORTS_URI-repo.freebsd.org/ports} @@ -43,6 +47,7 @@ GIT_SRC_REPO=${GIT_SRC_REPO-git://github.com/freebsd/f GIT_SVN_SRC_ROOT_URI=${GIT_SVN_SRC_ROOT_URI-svn.freebsd.org/base} GIT_SVN_SRC_URI=${GIT_SVN_SRC_URI-repo.freebsd.org/base} +GIT_SVN_DOCS_PUSH_URI=$GIT_SVN_DOCS_URI GIT_SVN_PORTS_PUSH_URI=$GIT_SVN_PORTS_URI GIT_SVN_SRC_PUSH_URI=$GIT_SVN_SRC_URI @@ -58,6 +63,7 @@ both ports and src under freebsd in the current workin -n Dry run -p Exclude ports -s Exclude src +-d Exclude docs EOF } @@ -138,7 +144,11 @@ doit() local svn_root_uri=$GIT_SVN_SRC_ROOT_URI local svn_uri=$GIT_SVN_SRC_URI local svn_push_uri=$GIT_SVN_SRC_PUSH_URI - else + elif [ "$3" = "docs" ] ; then + local svn_root_uri=$GIT_SVN_DOCS_ROOT_URI + local svn_uri=$GIT_SVN_DOCS_URI + local svn_push_uri=$GIT_SVN_DOCS_PUSH_URI + elif [ "$3" = "ports" ] ; then local svn_root_uri=$GIT_SVN_PORTS_ROOT_URI local svn_uri=$GIT_SVN_PORTS_URI local svn_push_uri=$GIT_SVN_PORTS_PUSH_URI @@ -160,7 +170,8 @@ doit() ports=1 source=1 -while getopts "hb:nr:sp" opt; do +docs=1 +while getopts "hb:nr:sdp" opt; do case "$opt" in b) base_path="$OPTARG" @@ -174,6 +185,9 @@ while getopts "hb:nr:sp" opt; do s) source=0 ;; + d) + docs=0 + ;; h|*) usage exit 0 @@ -190,4 +204,8 @@ fi if [ "$ports" -eq 1 ]; then doit ${GIT_PORTS_REPO} ${base_path:-freebsd} "ports" +fi + +if [ "$docs" -eq 1 ]; then + doit ${GIT_DOCS_REPO} ${base_path:-freebsd} "docs" fi From owner-svn-src-head@freebsd.org Wed Nov 21 00:00:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 671271142B19; Wed, 21 Nov 2018 00:00:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CEB28AC3F; Wed, 21 Nov 2018 00:00:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2BC71872A; Wed, 21 Nov 2018 00:00:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL000K7018457; Wed, 21 Nov 2018 00:00:00 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL0001L018456; Wed, 21 Nov 2018 00:00:00 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811210000.wAL0001L018456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 21 Nov 2018 00:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340713 - head X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 340713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CEB28AC3F X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.27)[0.271,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:00:01 -0000 Author: jkim Date: Wed Nov 21 00:00:00 2018 New Revision: 340713 URL: https://svnweb.freebsd.org/changeset/base/340713 Log: Revert r340706. Some files became symlinks and vice versa. Pointy hat to: jkim Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Nov 20 23:27:15 2018 (r340712) +++ head/ObsoleteFiles.inc Wed Nov 21 00:00:00 2018 (r340713) @@ -38,14 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20181120: OpenSSL 1.1.1a -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_add_client_CA.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_get_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_set_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_add_client_CA.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_get_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_get_server_tmp_key.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_set_client_CA_list.3.gz # 20181116: Rename test file. OLD_FILES+=usr/tests/sys/netinet/reuseport_lb # 20181112: Cleanup old libcap_dns. From owner-svn-src-head@freebsd.org Wed Nov 21 00:21:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 416B011437F6; Wed, 21 Nov 2018 00:21:59 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC0178BD4B; Wed, 21 Nov 2018 00:21:58 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A41EF18BEA; Wed, 21 Nov 2018 00:21:58 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL0LwHt030665; Wed, 21 Nov 2018 00:21:58 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL0Lw2q030664; Wed, 21 Nov 2018 00:21:58 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811210021.wAL0Lw2q030664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Wed, 21 Nov 2018 00:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340716 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 340716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC0178BD4B X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_SHORT(0.27)[0.273,0]; NEURAL_SPAM_MEDIUM(0.14)[0.143,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:21:59 -0000 Author: bwidawsk Date: Wed Nov 21 00:21:58 2018 New Revision: 340716 URL: https://svnweb.freebsd.org/changeset/base/340716 Log: Add definitions for Intel Speed Shift These definitions will be used by a driver to implement Hardware P-States (autonomous control of HWP, via Intel Speed Shift technology). Reviewed by: kib Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D18050 Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Wed Nov 21 00:16:43 2018 (r340715) +++ head/sys/x86/include/specialreg.h Wed Nov 21 00:21:58 2018 (r340716) @@ -189,6 +189,12 @@ #define CPUTPM1_SENSOR 0x00000001 #define CPUTPM1_TURBO 0x00000002 #define CPUTPM1_ARAT 0x00000004 +#define CPUTPM1_HWP 0x00000080 +#define CPUTPM1_HWP_NOTIFICATION 0x00000100 +#define CPUTPM1_HWP_ACTIVITY_WINDOW 0x00000200 +#define CPUTPM1_HWP_PERF_PREF 0x00000400 +#define CPUTPM1_HWP_PKG 0x00000800 +#define CPUTPM1_HWP_FLEXIBLE 0x00020000 #define CPUTPM2_EFFREQ 0x00000001 /* Intel Processor Trace CPUID. */ @@ -541,7 +547,14 @@ #define MSR_DRAM_ENERGY_STATUS 0x619 #define MSR_PP0_ENERGY_STATUS 0x639 #define MSR_PP1_ENERGY_STATUS 0x641 +#define MSR_PPERF 0x64e #define MSR_TSC_DEADLINE 0x6e0 /* Writes are not serializing */ +#define MSR_IA32_PM_ENABLE 0x770 +#define MSR_IA32_HWP_CAPABILITIES 0x771 +#define MSR_IA32_HWP_REQUEST_PKG 0x772 +#define MSR_IA32_HWP_INTERRUPT 0x773 +#define MSR_IA32_HWP_REQUEST 0x774 +#define MSR_IA32_HWP_STATUS 0x777 /* * VMX MSRs @@ -717,6 +730,25 @@ /* MSR IA32_FLUSH_CMD */ #define IA32_FLUSH_CMD_L1D 0x00000001 + +/* MSR IA32_HWP_CAPABILITIES */ +#define IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(x) (((x) >> 0) & 0xff) +#define IA32_HWP_CAPABILITIES_GUARANTEED_PERFORMANCE(x) (((x) >> 8) & 0xff) +#define IA32_HWP_CAPABILITIES_EFFICIENT_PERFORMANCE(x) (((x) >> 16) & 0xff) +#define IA32_HWP_CAPABILITIES_LOWEST_PERFORMANCE(x) (((x) >> 24) & 0xff) + +/* MSR IA32_HWP_REQUEST */ +#define IA32_HWP_REQUEST_MINIMUM_VALID (1ULL << 63) +#define IA32_HWP_REQUEST_MAXIMUM_VALID (1ULL << 62) +#define IA32_HWP_REQUEST_DESIRED_VALID (1ULL << 61) +#define IA32_HWP_REQUEST_EPP_VALID (1ULL << 60) +#define IA32_HWP_REQUEST_ACTIVITY_WINDOW_VALID (1ULL << 59) +#define IA32_HWP_REQUEST_PACKAGE_CONTROL (1ULL << 42) +#define IA32_HWP_ACTIVITY_WINDOW (0x3ffULL << 32) +#define IA32_HWP_REQUEST_ENERGY_PERFORMANCE_PREFERENCE (0xffULL << 24) +#define IA32_HWP_DESIRED_PERFORMANCE (0xffULL << 16) +#define IA32_HWP_REQUEST_MAXIMUM_PERFORMANCE (0xffULL << 8) +#define IA32_HWP_MINIMUM_PERFORMANCE (0xffULL << 0) /* * PAT modes. From owner-svn-src-head@freebsd.org Wed Nov 21 00:22:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CEB0114395A; Wed, 21 Nov 2018 00:22:32 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F412C8BEFD; Wed, 21 Nov 2018 00:22:31 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D65EA18C19; Wed, 21 Nov 2018 00:22:31 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL0MVqH033661; Wed, 21 Nov 2018 00:22:31 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL0MVIt033660; Wed, 21 Nov 2018 00:22:31 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201811210022.wAL0MVIt033660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Wed, 21 Nov 2018 00:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340717 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 340717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F412C8BEFD X-Spamd-Result: default: False [0.39 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.27)[0.271,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:22:32 -0000 Author: ygy (doc committer) Date: Wed Nov 21 00:22:31 2018 New Revision: 340717 URL: https://svnweb.freebsd.org/changeset/base/340717 Log: Fix incorrect DSCP value range from 0..64 to 0..63. PR: 232786 Submitted by: Sergey Akhmatov Reviewed by: AllanJude MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Nov 21 00:21:58 2018 (r340716) +++ head/sbin/ipfw/ipfw.8 Wed Nov 21 00:22:31 2018 (r340717) @@ -1159,11 +1159,11 @@ Supported values are: .Pq Dv 101110 , .Cm be .Pq Dv 000000 . -Additionally, DSCP value can be specified by number (0..64). +Additionally, DSCP value can be specified by number (0..63). It is also possible to use the .Cm tablearg keyword with setdscp. -If the tablearg value is not within the 0..64 range, lower 6 bits of supplied +If the tablearg value is not within the 0..63 range, lower 6 bits of supplied value are used. .It Cm tcp-setmss Ar mss Set the Maximum Segment Size (MSS) in the TCP segment to value From owner-svn-src-head@freebsd.org Wed Nov 21 00:23:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB5651143A39 for ; Wed, 21 Nov 2018 00:23:34 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40BC18C0A8 for ; Wed, 21 Nov 2018 00:23:33 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wr1-x42e.google.com with SMTP id p4so3823605wrt.7 for ; Tue, 20 Nov 2018 16:23:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MnMjrYYU1ZNkJ/O+MfB9+TbwnvfAVAzgS/G7QcwJvpk=; b=OrmO9GGwX38UVIEky+IPaWX3mB6qzTOtXSnvd53GrQdTL3mWino5aXfuR3HMPtW7Q0 i2HTijeUFtrvkLaE3iu3yfqbMK9wdXl0hQEENhU3JEfpyuBiEJ7EOEypywpwmXQ3MH1N NB/hj4Xy6gT54ZCaTAip5LTVjCj0Og2rRa/gHJmxRxswsfyMjx13FGfsKFNNxF6b5XBq ENHu8ylSwWZOpy5J8QBgqxe53Mol+4sHYhY5gV84aKMlqh6clyjNFKPre49GOKmpuMG2 XVI/jiPJAOGMI2QervcREzp3nt2XtJ59ErSPc5AAAiYexBUXjQ+tosOfFBfxP4SzOh2j UKhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MnMjrYYU1ZNkJ/O+MfB9+TbwnvfAVAzgS/G7QcwJvpk=; b=U0TgmIOO+d6Jb7BfZdjjvnMFJe2YgLH+u/9JpDfjFylxbRL9ofbjj/21jbB8OKq42H Nlo99AH4oUIU+m42iCD/HzVvhnbGTXelYknXKSzSP9i/pX9FFCDJngGHg/ckdqPDXtyL EQGSxK3A1mqMduYPqhasrDi2BITnY5AXYIOcnEfUVi3glUvke2o1YnmErJ7kkDTRE80D xhlozDq4J52xOeghRHLdEQDjs60lfh5fzGbE1nIEB9g8PT/xI+Wkkxrnvrh4uNFvbZlq 0/IFY/6sMXQorJblf7sKi0YmIsyaK+FgAEIoLagOKPsX0r63MwfXTgYMtgrQ7EhL3NQp yf8w== X-Gm-Message-State: AA+aEWYdve0UVBB+jS2TMkxYS/V0KbFbSk43Jlvzd+n27bzFEUthG+zp cuxHXDV04pdAiU90KESTeur6Mg== X-Google-Smtp-Source: AFSGD/ViQ5ScBlalMBwNMcMFNtEGSRbVruYuCwbcyHCE2a9KKV7tmNYCpWT2QODtX+JfOCOoJydcPg== X-Received: by 2002:a5d:4ec4:: with SMTP id s4mr3920249wrv.187.1542759811603; Tue, 20 Nov 2018 16:23:31 -0800 (PST) Received: from mutt-hbsd (lumumba.torservers.net. [77.247.181.163]) by smtp.gmail.com with ESMTPSA id g5-v6sm58049097wrw.97.2018.11.20.16.23.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 16:23:30 -0800 (PST) Date: Tue, 20 Nov 2018 19:22:54 -0500 From: Shawn Webb To: Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340707 - head/usr.sbin/bhyve Message-ID: <20181121002254.efitgf45bzajh5sj@mutt-hbsd> References: <201811202221.wAKMLJ3W068166@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qf5lp2runf5q3qgd" Content-Disposition: inline In-Reply-To: <201811202221.wAKMLJ3W068166@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT FreeBSD 13.0-CURRENT HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 X-Rspamd-Queue-Id: 40BC18C0A8 X-Spamd-Result: default: False [-5.64 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx2.googlemail.com,alt2.aspmx.l.google.com,aspmx3.googlemail.com]; RCVD_IN_DNSWL_NONE(0.00)[e.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.88)[-0.877,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; IP_SCORE(-0.65)[ipnet: 2a00:1450::/32(-1.58), asn: 15169(-1.58), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:23:35 -0000 --qf5lp2runf5q3qgd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 20, 2018 at 10:21:19PM +0000, Marcelo Araujo wrote: > Author: araujo > Date: Tue Nov 20 22:21:19 2018 > New Revision: 340707 > URL: https://svnweb.freebsd.org/changeset/base/340707 >=20 > Log: > Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES > to avoid buffer accessed out of bounds, also switch to snprintf(3). > =20 > PR: 200859 > Submitted by: Caglar > Obtained from: https://github.com/mist64/xhyve/pull/24 > MFC after: 4 weeks > Sponsored by: iXsystems Inc. >=20 > Modified: > head/usr.sbin/bhyve/pci_ahci.c > head/usr.sbin/bhyve/pci_virtio_block.c >=20 > Modified: head/usr.sbin/bhyve/pci_ahci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:12:10 2018 (r340706) > +++ head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:21:19 2018 (r340707) > @@ -105,7 +105,7 @@ enum sata_fis_type { > * ATA commands > */ > #define ATA_SF_ENAB_SATA_SF 0x10 > -#define ATA_SATA_SF_AN 0x05 > +#define ATA_SATA_SF_AN 0x05 > #define ATA_SF_DIS_SATA_SF 0x90 > =20 > /* > @@ -119,6 +119,8 @@ static FILE *dbg; > #endif > #define WPRINTF(format, arg...) printf(format, ##arg) > =20 > +#define AHCI_PORT_IDENT 20 + 1 > + > struct ahci_ioreq { > struct blockif_req io_req; > struct ahci_port *io_pr; > @@ -136,7 +138,7 @@ struct ahci_port { > struct pci_ahci_softc *pr_sc; > uint8_t *cmd_lst; > uint8_t *rfis; > - char ident[20 + 1]; > + char ident[AHCI_PORT_IDENT]; > int port; > int atapi; > int reset; > @@ -2374,7 +2376,8 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst= *p > MD5Init(&mdctx); > MD5Update(&mdctx, opts, strlen(opts)); > MD5Final(digest, &mdctx); > - sprintf(sc->port[p].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", > + snprintf(sc->port[p].ident, AHCI_PORT_IDENT, > + "BHYVE-%02X%02X-%02X%02X-%02X%02X", > digest[0], digest[1], digest[2], digest[3], digest[4], > digest[5]); > =20 >=20 > Modified: head/usr.sbin/bhyve/pci_virtio_block.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:12:10 2018 (r340= 706) > +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:21:19 2018 (r340= 707) > @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); > #define VTBLK_S_IOERR 1 > #define VTBLK_S_UNSUPP 2 > =20 > -#define VTBLK_BLK_ID_BYTES 20 > +#define VTBLK_BLK_ID_BYTES 20 + 1 > =20 > /* Capability bits */ > #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ > @@ -344,7 +344,8 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * > MD5Init(&mdctx); > MD5Update(&mdctx, opts, strlen(opts)); > MD5Final(digest, &mdctx); > - sprintf(sc->vbsc_ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", > + snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, > + "BHYVE-%02X%02X-%02X%02X-%02X%02X", > digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); > =20 > /* setup virtio block config space */ Hey Marcelo, Thanks for committing this. Could VTBLK_BLK_ID_BYTES and AHCI_PORT_IDENT be merged into the same macro, defined in usr.sbin/bhyve/pci_emul.h? Especially since both equate to the same value. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --qf5lp2runf5q3qgd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlv0pV0ACgkQaoRlj1JF bu7sEQ//RqaPN3xVSxteX4+el9RGjOEHxqV2/yaSJZbgOvmM9cbByivnEL59v4q/ 8t9O8KbrPrnBmLPqtNpwQCnEHxafBRhboSmzSiIrrsR2tfPkZ6h13l/0jChQMxXV AyutHMbyROJ6/d4vjGQEy1oiswBjcKWQGy+9qt5bjOmMgjDDZvvfHdsEQlJ5ZXEe 0umTnhX6wR/mt6JKlvOnF110ceZn6O5Y/TiTn8s22L6PjNOZmOfVsDHhQZ5Dmc2A TWzNIY7KiHQF+K42jLlQF0QUNAczeuLnjAopWsVF5uganBw/g7qmlFAo5Dru/HFz wGLY0wjsfbOMq6VnFq97UuPUakYxIaNXbOd1UX6SpHm0wGT8MTifBQG5BoKL5JNI pAOHOj38yMCrRt2TcmMGia3++OpSU6nTiEgNjdazHfdj4zceLCuYYZUZX9gYLFeK Gn747fbRUKeRvZ43DK0TlOV5lmuiafLO4B9aGbMFqYB6Ty33IbzhiFr1yj8XBKL7 oj/V8gBEajTSux+/2X0rXaKsCIbMPwOV23ZYqO/2iLldssompbZGzn6aFSvctSMP SzlcJ7jXfvSCbZ1+AC0DSH96ADkRLTp+IziRTg88LwZZt4Uu9r4ljTwgM5yNt5z2 oT5ij4B8t/kyTqeWhBuZQXbodJq4m+OFKG7Tp9UHDcsmCCCAHEc= =mQ8k -----END PGP SIGNATURE----- --qf5lp2runf5q3qgd-- From owner-svn-src-head@freebsd.org Wed Nov 21 00:35:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A2371143ED5; Wed, 21 Nov 2018 00:35:22 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x129.google.com (mail-it1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB7DD8C69F; Wed, 21 Nov 2018 00:35:20 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x129.google.com with SMTP id h65so6502079ith.3; Tue, 20 Nov 2018 16:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SwU8ZFIqrqpzkdMIS8M38DCiXnwEXDXiYKgO+9KHI50=; b=XHqZ+J86sQx8EPPZmM459+XHoqpv/pqzAPnc+DST7cv4D6W/96uJVIXhX1pSlJ3Fzb bkUMXdGimet6oUy1xXLiOVWj4EM3CYdyX0VInTWxJ8s4bIxs0Lwm0MMvkkH9RrnTbhVp 9kH5uO+jzEOb8RC/N1dsUTbROrLSawyBcyCTcZN5+7hhcFkO6s/I6E/KzKRwG2Ccnw42 qnWp7tjn9OK5v3UCMdj7DWlXzhc2ZNBl2Nyuic7y5dVkABjTvv8LpbuxLy1O/C8xPJum wKm74Bm+mRpVGZXmNbX5jrCZvVkGFwpgAbulCKlvUyAImN/392hnaZzsjoq68jwTWqBH PvWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=SwU8ZFIqrqpzkdMIS8M38DCiXnwEXDXiYKgO+9KHI50=; b=blAEtpARzN7eoPMdVTmaqQwNGcZfKb2srougWCZeSw6QLagDrUgYBTpx+CiQRomB7I 7XmEKuR4Jt6/ppbqFcwjLx4X9TdeWurFyHXiL08JKHoMy/ooQrKy2PbkC/5UJFxfQZ51 fqq2HditirG0fHjf3490MS0Om6WeRotF6pP4la/NLXO5olqu3vO8hswe8rINSk2LHDHb xg2x9QClukCor3AnMEDhwV0C3Z6kO3BZ++W+ZaBS74RSCjLxQVb7ikDjdUGK4JQO57nV C8nSmuhtG6SuCjil7WNUo9g8pCgeySH5nY5BZsCVRL+HbE649JiEXsAQ1rNRnMwG8PVv fH8A== X-Gm-Message-State: AA+aEWZn2Cx5BqwTWvuRwgUdZMvw63UJmYrhc2EmnP2hykufhWVmsDFz y2Dob+M1UzQJpiopFHM92mrbGLjeTQk= X-Google-Smtp-Source: AJdET5dx1yUzdGFLqsmjFux50ddJc2N9LEIXOJ4qV+gepQ+4Doi77FNfqooxjOidq7Zfh/1AXrwV+w== X-Received: by 2002:a24:4052:: with SMTP id n79-v6mr3598292ita.99.1542760518232; Tue, 20 Nov 2018 16:35:18 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id d128sm11777070iof.37.2018.11.20.16.35.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Nov 2018 16:35:17 -0800 (PST) Sender: Mark Johnston Date: Tue, 20 Nov 2018 19:35:15 -0500 From: Mark Johnston To: Ben Widawsky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121003515.GE2630@raichu> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811202249.wAKMnJxH082469@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: EB7DD8C69F X-Spamd-Result: default: False [-4.84 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.15)[ip: (-6.70), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-1.58), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[9.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:35:22 -0000 On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > Author: bwidawsk > Date: Tue Nov 20 22:49:19 2018 > New Revision: 340709 > URL: https://svnweb.freebsd.org/changeset/base/340709 > > Log: > linuxkpi: Add some basic swap functions > > These are used by kms-drm to determine various heuristics relate > memory conditions. > > The number of free swap pages is just a variable, and it can be > much cheaper by either adding a new getter, or simply extern'ing > swap_total. However, this patch opts to use the more expensive, > existing interface - since this isn't an operation in a high per > path. > > This allows us to remove some more gpl linuxkpi and do the follo > kms-drm: > git rm linuxkpi/gplv2/include/linux/swap.h > > Reviewed by: mmacy, Johannes Lundberg > Approved by: emaste (mentor) > Differential Revision: https://reviews.freebsd.org/D18052 > > Added: > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > Modified: > head/sys/vm/vm_pageout.h > head/sys/vm/vm_swapout.c > > [...] > Modified: head/sys/vm/vm_swapout.c > ============================================================================== > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > @@ -961,3 +961,10 @@ swapout(struct proc *p) > p->p_swtick = ticks; > return (0); > } > + > +/* Used to determine if the current process is itself the reaper. */ > +bool > +vm_curproc_is_vmproc(void) > +{ > + return curproc == vmproc; > +} >From a look at how this is used, it should probably be pageproc rather than vmproc. There are various code paths that just check curproc == pageproc inline. From owner-svn-src-head@freebsd.org Wed Nov 21 00:42:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A44F01144171; Wed, 21 Nov 2018 00:42:42 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4949E8CB29; Wed, 21 Nov 2018 00:42:42 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (c-73-25-164-31.hsd1.or.comcast.net [73.25.164.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bwidawsk) by smtp.freebsd.org (Postfix) with ESMTPSA id 8F9AE1E070; Wed, 21 Nov 2018 00:42:41 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Date: Tue, 20 Nov 2018 16:42:39 -0800 From: Ben Widawsky To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> Mail-Followup-To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121003515.GE2630@raichu> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 4949E8CB29 X-Spamd-Result: default: False [0.45 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.47)[0.469,0]; NEURAL_HAM_LONG(-0.18)[-0.183,0]; NEURAL_SPAM_MEDIUM(0.17)[0.166,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:42:42 -0000 On 18-11-20 19:35:15, Mark Johnston wrote: > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > Author: bwidawsk > > Date: Tue Nov 20 22:49:19 2018 > > New Revision: 340709 > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > Log: > > linuxkpi: Add some basic swap functions > > > > These are used by kms-drm to determine various heuristics relate > > memory conditions. > > > > The number of free swap pages is just a variable, and it can be > > much cheaper by either adding a new getter, or simply extern'ing > > swap_total. However, this patch opts to use the more expensive, > > existing interface - since this isn't an operation in a high per > > path. > > > > This allows us to remove some more gpl linuxkpi and do the follo > > kms-drm: > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > Reviewed by: mmacy, Johannes Lundberg > > Approved by: emaste (mentor) > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > Added: > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > Modified: > > head/sys/vm/vm_pageout.h > > head/sys/vm/vm_swapout.c > > > > [...] > > Modified: head/sys/vm/vm_swapout.c > > ============================================================================== > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > p->p_swtick = ticks; > > return (0); > > } > > + > > +/* Used to determine if the current process is itself the reaper. */ > > +bool > > +vm_curproc_is_vmproc(void) > > +{ > > + return curproc == vmproc; > > +} > > From a look at how this is used, it should probably be pageproc rather > than vmproc. There are various code paths that just check > curproc == pageproc inline. > Could I trouble you for a quick explanation of the difference between the two? From owner-svn-src-head@freebsd.org Wed Nov 21 00:51:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 474CB11444D3; Wed, 21 Nov 2018 00:51:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7539B8D23E; Wed, 21 Nov 2018 00:51:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd42.google.com with SMTP id f6so2845345iob.1; Tue, 20 Nov 2018 16:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KNCYtomE2T37Gc9EUOx7eVuL0VE+93XAoOzyFEf1vcI=; b=DOKSpZD3j6NmNcE/HupWqcsuPUKxoyPBzemDaGVYHcuN2pD057BVOPj0BV2GjbfDJg 0yzJY9loz96kYfgiklb/x+8/ct8X8Kg6RC479LzrcR2XgiBlqB8Ko/9az3qYkOBmJSWj 9TZt2WGZYw99HmzaaYIxdm2KI0uznpWxCs1ldTe9JtKt/4yY7F69hRuRUu0GgZgxpUMZ eJwl/49HzkUMD5HjvX8SK6qOOyox7AoqUpthhTrCqFXgKGTXniSlbXxVkaEEjm6hiETj bTDHuSJL43b18g5nldWJqLM4uG15F5B4WHxeMgpGxz0i1CjK09nlSULLUd1CMEFm+2s/ SP0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=KNCYtomE2T37Gc9EUOx7eVuL0VE+93XAoOzyFEf1vcI=; b=ahXPEf3nm2ZT4xM2UPlQ2b05+TqNQVmLYJ6xmx/Alx1o3juMdPcbmmeErYSIx7d3pJ MUy5vHmkHILB4R7Rip8jdEhUpHf7/uLr8FJgjoEUq1tLmvihOS6d7XZvg/lNj6KUgsEK suXO3noVh/dLSUR8jmyFWrAYVogwk5xnw4NV/DIITw8oAcz6LXm6TLO35td6t5giQlJx Ebw3/B73Uj+Cjg8fgsD13zrOozneVdl0FlMgc4QUXYfe6ak4HmVB8rsmAo1SJDzgujdy M1PUE/3wFdglrn6y3Lqo1xR3g7opRNRvli0XOatEwljM/8+BwYBau3uU5EsfFdHSu43d bXQw== X-Gm-Message-State: AA+aEWYZvLhglQiOEVIYV9lqZs6Y7J4ipA26jtPqZbMlIN4lg2gsakN0 Kdn+woTwkc3IjLXXzocfuhzwSG9E4Ak= X-Google-Smtp-Source: AFSGD/UNaFJRbl7SwsSatKnqiuHu4U93VpiNhBBnQ5yimiISNFwuduANmETYvScJHpX98T5dbfegrg== X-Received: by 2002:a6b:4f14:: with SMTP id d20-v6mr3469983iob.68.1542761511494; Tue, 20 Nov 2018 16:51:51 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id b192sm1083077itb.12.2018.11.20.16.51.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Nov 2018 16:51:50 -0800 (PST) Sender: Mark Johnston Date: Tue, 20 Nov 2018 19:51:48 -0500 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121005148.GF2630@raichu> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 7539B8D23E X-Spamd-Result: default: False [-2.76 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-0.93)[-0.926,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.92)[-0.923,0]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.91)[-0.915,0]; IP_SCORE(-0.28)[ip: (2.63), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-1.58), country: US(-0.09)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:51:53 -0000 On Tue, Nov 20, 2018 at 04:42:39PM -0800, Ben Widawsky wrote: > On 18-11-20 19:35:15, Mark Johnston wrote: > > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > > Author: bwidawsk > > > Date: Tue Nov 20 22:49:19 2018 > > > New Revision: 340709 > > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > > > Log: > > > linuxkpi: Add some basic swap functions > > > > > > These are used by kms-drm to determine various heuristics relate > > > memory conditions. > > > > > > The number of free swap pages is just a variable, and it can be > > > much cheaper by either adding a new getter, or simply extern'ing > > > swap_total. However, this patch opts to use the more expensive, > > > existing interface - since this isn't an operation in a high per > > > path. > > > > > > This allows us to remove some more gpl linuxkpi and do the follo > > > kms-drm: > > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > > > Reviewed by: mmacy, Johannes Lundberg > > > Approved by: emaste (mentor) > > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > > > Added: > > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > > Modified: > > > head/sys/vm/vm_pageout.h > > > head/sys/vm/vm_swapout.c > > > > > > [...] > > > Modified: head/sys/vm/vm_swapout.c > > > ============================================================================== > > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > > p->p_swtick = ticks; > > > return (0); > > > } > > > + > > > +/* Used to determine if the current process is itself the reaper. */ > > > +bool > > > +vm_curproc_is_vmproc(void) > > > +{ > > > + return curproc == vmproc; > > > +} > > > > From a look at how this is used, it should probably be pageproc rather > > than vmproc. There are various code paths that just check > > curproc == pageproc inline. > > > > Could I trouble you for a quick explanation of the difference between the two? pageproc contains the page daemon and laundry threads, which are responsible for managing the LRU page queues and writing back dirty pages. vmproc's main task is to swap out kernel stacks when the system is under memory pressure, and swap them back in when necessary. It's a somewhat legacy component of the system and isn't required. You can build a kernel without it by specifying "options NO_SWAPPING" (which is a somewhat misleading name), in which vm_swapout_dummy.c is compiled instead of vm_swapout.c. From owner-svn-src-head@freebsd.org Wed Nov 21 00:58:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C85B411446ED; Wed, 21 Nov 2018 00:58:41 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C69B8D6C6; Wed, 21 Nov 2018 00:58:40 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (c-73-25-164-31.hsd1.or.comcast.net [73.25.164.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bwidawsk) by smtp.freebsd.org (Postfix) with ESMTPSA id 089061E16D; Wed, 21 Nov 2018 00:58:35 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Date: Tue, 20 Nov 2018 16:58:32 -0800 From: Ben Widawsky To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121005832.ongabjesxlsd7cqu@smtp.freebsd.org> Mail-Followup-To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> <20181121005148.GF2630@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121005148.GF2630@raichu> User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 1C69B8D6C6 X-Spamd-Result: default: False [0.76 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_MEDIUM(0.18)[0.180,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.76)[0.760,0]; NEURAL_HAM_LONG(-0.18)[-0.182,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:58:42 -0000 On 18-11-20 19:51:48, Mark Johnston wrote: > On Tue, Nov 20, 2018 at 04:42:39PM -0800, Ben Widawsky wrote: > > On 18-11-20 19:35:15, Mark Johnston wrote: > > > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > > > Author: bwidawsk > > > > Date: Tue Nov 20 22:49:19 2018 > > > > New Revision: 340709 > > > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > > > > > Log: > > > > linuxkpi: Add some basic swap functions > > > > > > > > These are used by kms-drm to determine various heuristics relate > > > > memory conditions. > > > > > > > > The number of free swap pages is just a variable, and it can be > > > > much cheaper by either adding a new getter, or simply extern'ing > > > > swap_total. However, this patch opts to use the more expensive, > > > > existing interface - since this isn't an operation in a high per > > > > path. > > > > > > > > This allows us to remove some more gpl linuxkpi and do the follo > > > > kms-drm: > > > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > > > > > Reviewed by: mmacy, Johannes Lundberg > > > > Approved by: emaste (mentor) > > > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > > > > > Added: > > > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > > > Modified: > > > > head/sys/vm/vm_pageout.h > > > > head/sys/vm/vm_swapout.c > > > > > > > > [...] > > > > Modified: head/sys/vm/vm_swapout.c > > > > ============================================================================== > > > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > > > p->p_swtick = ticks; > > > > return (0); > > > > } > > > > + > > > > +/* Used to determine if the current process is itself the reaper. */ > > > > +bool > > > > +vm_curproc_is_vmproc(void) > > > > +{ > > > > + return curproc == vmproc; > > > > +} > > > > > > From a look at how this is used, it should probably be pageproc rather > > > than vmproc. There are various code paths that just check > > > curproc == pageproc inline. > > > > > > > Could I trouble you for a quick explanation of the difference between the two? > > pageproc contains the page daemon and laundry threads, which are > responsible for managing the LRU page queues and writing back dirty > pages. vmproc's main task is to swap out kernel stacks when the system > is under memory pressure, and swap them back in when necessary. It's a > somewhat legacy component of the system and isn't required. You can > build a kernel without it by specifying "options NO_SWAPPING" (which is > a somewhat misleading name), in which vm_swapout_dummy.c is compiled > instead of vm_swapout.c. > Thanks for the explanation. I indeed want the page daemon. I will put up a patch to do that the correct way. Thanks. From owner-svn-src-head@freebsd.org Wed Nov 21 01:01:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3F8E11447B9 for ; Wed, 21 Nov 2018 01:00:59 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc35.google.com (mail-yw1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCB3B8D8DA for ; Wed, 21 Nov 2018 01:00:58 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc35.google.com with SMTP id h193so353928ywc.4 for ; Tue, 20 Nov 2018 17:00:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BCQFzJqNVMace6HaNdkKixqTVhX4x6ag78Dr6xZP0hk=; b=OHvcz3G1HLuHX6cwQYQOEaCp4R2Ft0RIruug0QZIpQv7ZWkbYrwvuNrh74lyFkjsmL GCRb/Q/tFv0JrC4NU72XvVGshLvh2YJNZflL6cRTdylAdX1+LQDbFgSuP6un1QiFSeAI XLP/TYYhlreALaxVRrPEuFvC7dvhh+GpmIKIznJe1rRlpkmeJwweMNdhr+qyho7mbZH8 HL2QHj8gYPoEF54efRYh7sPeAvZNfYr8tCSm0pi3naa4U7sq5AStWsCXPSsvg7e++ZTf gdBPkdvjv8/6BMTB0Nxn6Kg8ZbnS1nLN2CZpAjGlo2zT/httRbklh+rQNCVWDTUMYpe5 y/YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BCQFzJqNVMace6HaNdkKixqTVhX4x6ag78Dr6xZP0hk=; b=r1+LDLI9UxXETRDDmXIJY2nskMAklMmWFyADuc2iIyM3UsMhx+eOfcSGy+Il/AG6eg IuAuJFhQnbcodO8KzaWFpPypp4+N9NJNWuhMva9gqumI/G3IGDE2oJJ4vRmM9fVMCBjF XEYQXOJxvB4gHwcQTqGgK8a6ogAzXynNUQHfKQAxF1WnIGgIWdNU85fD7cNPvp6b5EoD 7l3JVLUenYvoXR8k1MB5mpkPSrB2J4NvC48I6O40Io+golPfusBtjn6Zdn2jReTWmLKb orKyL8pdv/iNko1mPiicrGAkM9pTeIlC3ugF3sDBY6M+5C6/gMoGSSF2KyKa5M3It/td 4EEQ== X-Gm-Message-State: AGRZ1gL+lF2tPmQFwKIjg0afabgOe9txGV5aXUsv+hzYLx2lBlyBsqbj bLePVWUcy1g9F4nGMvtxOnmN0oh1wp/wyHfg9gBKBg== X-Google-Smtp-Source: AJdET5f6ymbEW1OywA8q7TFnyA0IV4IkQ6c8RKeHBu1HJzd3gOZ1Y++ylWHnGHk3b9Pk/OSaKaSZuKOIqWF2kZVRE6o= X-Received: by 2002:a0d:e081:: with SMTP id j123-v6mr4467025ywe.267.1542762058257; Tue, 20 Nov 2018 17:00:58 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:84d2:0:0:0:0:0 with HTTP; Tue, 20 Nov 2018 17:00:57 -0800 (PST) In-Reply-To: <201811202249.wAKMnJxH082469@repo.freebsd.org> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> From: Oliver Pinter Date: Wed, 21 Nov 2018 02:00:57 +0100 Message-ID: Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm To: Ben Widawsky Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: DCB3B8D8DA X-Spamd-Result: default: False [-4.29 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-0.99)[-0.991,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[5.3.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.81)[ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-1.58), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 01:01:00 -0000 On Tuesday, November 20, 2018, Ben Widawsky wrote: > Author: bwidawsk > Date: Tue Nov 20 22:49:19 2018 > New Revision: 340709 > URL: https://svnweb.freebsd.org/changeset/base/340709 > > Log: > linuxkpi: Add some basic swap functions > > These are used by kms-drm to determine various heuristics relate > memory conditions. > > The number of free swap pages is just a variable, and it can be > much cheaper by either adding a new getter, or simply extern'ing > swap_total. However, this patch opts to use the more expensive, > existing interface - since this isn't an operation in a high per > path. > > This allows us to remove some more gpl linuxkpi and do the follo > kms-drm: > git rm linuxkpi/gplv2/include/linux/swap.h > > Reviewed by: mmacy, Johannes Lundberg > Approved by: emaste (mentor) > Differential Revision: https://reviews.freebsd.org/D18052 > > Added: > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props > changed) > Modified: > head/sys/vm/vm_pageout.h > head/sys/vm/vm_swapout.c > > Added: head/sys/compat/linuxkpi/common/include/linux/swap.h > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/compat/linuxkpi/common/include/linux/swap.h Tue Nov > 20 22:49:19 2018 (r340709) > @@ -0,0 +1,102 @@ > +/*- > + * Copyright (c) 2018 Intel Corporation > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > + * met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _LINUX_SWAP_H_ > +#define _LINUX_SWAP_H_ > + > +#include > +#include > + > +static inline long > +get_nr_swap_pages(void) > +{ > + int i, j; > + > + /* NB: This could be done cheaply by obtaining swap_total directly > */ > + swap_pager_status(&i, &j); > + return i - j; > +} > + > +static inline int > +current_is_kswapd(void) > +{ > + return vm_curproc_is_vmproc(); > +} > + > +#endif Probably I'm wrong, but this file contains twice the same intended content. > +/*- > + * Copyright (c) 2018 Intel Corporation > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > + * met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _LINUX_SWAP_H_ > +#define _LINUX_SWAP_H_ > + > +#include > +#include > + > +static inline long > +get_nr_swap_pages(void) > +{ > + int i, j; > + > + /* NB: This could be done cheaply by obtaining swap_total directly > */ > + swap_pager_status(&i, &j); > + return i - j; > +} > + > +static inline int > +current_is_kswapd(void) > +{ > + return vm_curproc_is_vmproc(); > +} > + > +#endif > > Modified: head/sys/vm/vm_pageout.h > ============================================================ > ================== > --- head/sys/vm/vm_pageout.h Tue Nov 20 22:24:18 2018 (r340708) > +++ head/sys/vm/vm_pageout.h Tue Nov 20 22:49:19 2018 (r340709) > @@ -106,5 +106,8 @@ void vm_pageout_oom(int shortage); > > void vm_swapout_run(void); > void vm_swapout_run_idle(void); > + > +bool vm_curproc_is_vmproc(void); > + > #endif /* _KERNEL */ > #endif /* _VM_VM_PAGEOUT_H_ */ > > Modified: head/sys/vm/vm_swapout.c > ============================================================ > ================== > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > @@ -961,3 +961,10 @@ swapout(struct proc *p) > p->p_swtick = ticks; > return (0); > } > + > +/* Used to determine if the current process is itself the reaper. */ > +bool > +vm_curproc_is_vmproc(void) > +{ > + return curproc == vmproc; > +} > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Wed Nov 21 01:09:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51FEC1144B35; Wed, 21 Nov 2018 01:09:34 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC03E8DD67; Wed, 21 Nov 2018 01:09:33 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (c-73-25-164-31.hsd1.or.comcast.net [73.25.164.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bwidawsk) by smtp.freebsd.org (Postfix) with ESMTPSA id CA3B21E26A; Wed, 21 Nov 2018 01:09:32 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Date: Tue, 20 Nov 2018 17:09:30 -0800 From: Ben Widawsky To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121010930.vjeuugd72lzun3tn@smtp.freebsd.org> Mail-Followup-To: Oliver Pinter , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201811202249.wAKMnJxH082469@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: EC03E8DD67 X-Spamd-Result: default: False [0.76 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.76)[0.760,0]; NEURAL_HAM_LONG(-0.18)[-0.182,0]; NEURAL_SPAM_MEDIUM(0.18)[0.180,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 01:09:34 -0000 On 18-11-21 02:00:57, Oliver Pinter wrote: > > > On Tuesday, November 20, 2018, Ben Widawsky wrote: > > Author: bwidawsk > Date: Tue Nov 20 22:49:19 2018 > New Revision: 340709 > URL: https://svnweb.freebsd.org/changeset/base/340709 > > Log: >   linuxkpi: Add some basic swap functions > >   These are used by kms-drm to determine various heuristics relate >   memory conditions. > >   The number of free swap pages is just a variable, and it can be >   much cheaper by either adding a new getter, or simply extern'ing >   swap_total. However, this patch opts to use the more expensive, >   existing interface - since this isn't an operation in a high per >   path. > >   This allows us to remove some more gpl linuxkpi and do the follo >   kms-drm: >   git rm linuxkpi/gplv2/include/linux/swap.h > >   Reviewed by:    mmacy, Johannes Lundberg >   Approved by:    emaste (mentor) >   Differential Revision:  https://reviews.freebsd.org/D18052 > > Added: >   head/sys/compat/linuxkpi/common/include/linux/swap.h   (contents, props > changed) > Modified: >   head/sys/vm/vm_pageout.h >   head/sys/vm/vm_swapout.c > > Added: head/sys/compat/linuxkpi/common/include/linux/swap.h > =========================================================================== > === > --- /dev/null   00:00:00 1970   (empty, because file is newly added) > +++ head/sys/compat/linuxkpi/common/include/linux/swap.h        Tue Nov 20 > 22:49:19 2018        (r340709) > @@ -0,0 +1,102 @@ > +/*- > + * Copyright (c) 2018 Intel Corporation > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > + * met: > + * 1. Redistributions of source code must retain the above copyright > + *    notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + *    notice, this list of conditions and the following disclaimer in > + *    the documentation and/or other materials provided with the > + *    distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef        _LINUX_SWAP_H_ > +#define        _LINUX_SWAP_H_ > + > +#include > +#include > + > +static inline long > +get_nr_swap_pages(void) > +{ > +       int i, j; > + > +       /* NB: This could be done cheaply by obtaining swap_total directly > */ > +       swap_pager_status(&i, &j); > +       return i - j; > +} > + > +static inline int > +current_is_kswapd(void) > +{ > +       return vm_curproc_is_vmproc(); > +} > + > +#endif > > > Probably I'm wrong, but this file contains twice the same intended content.  >   You are correct, but I have already fixed it. I have some problems with my workflow still, apparently. :( > > +/*- > + * Copyright (c) 2018 Intel Corporation > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions are > + * met: > + * 1. Redistributions of source code must retain the above copyright > + *    notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + *    notice, this list of conditions and the following disclaimer in > + *    the documentation and/or other materials provided with the > + *    distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef        _LINUX_SWAP_H_ > +#define        _LINUX_SWAP_H_ > + > +#include > +#include > + > +static inline long > +get_nr_swap_pages(void) > +{ > +       int i, j; > + > +       /* NB: This could be done cheaply by obtaining swap_total directly > */ > +       swap_pager_status(&i, &j); > +       return i - j; > +} > + > +static inline int > +current_is_kswapd(void) > +{ > +       return vm_curproc_is_vmproc(); > +} > + > +#endif > > Modified: head/sys/vm/vm_pageout.h > =========================================================================== > === > --- head/sys/vm/vm_pageout.h    Tue Nov 20 22:24:18 2018        (r340708) > +++ head/sys/vm/vm_pageout.h    Tue Nov 20 22:49:19 2018        (r340709) > @@ -106,5 +106,8 @@ void vm_pageout_oom(int shortage); > >  void vm_swapout_run(void); >  void vm_swapout_run_idle(void); > + > +bool vm_curproc_is_vmproc(void); > + >  #endif /* _KERNEL */ >  #endif /* _VM_VM_PAGEOUT_H_ */ > > Modified: head/sys/vm/vm_swapout.c > =========================================================================== > === > --- head/sys/vm/vm_swapout.c    Tue Nov 20 22:24:18 2018        (r340708) > +++ head/sys/vm/vm_swapout.c    Tue Nov 20 22:49:19 2018        (r340709) > @@ -961,3 +961,10 @@ swapout(struct proc *p) >         p->p_swtick = ticks; >         return (0); >  } > + > +/* Used to determine if the current process is itself the reaper. */ > +bool > +vm_curproc_is_vmproc(void) > +{ > +       return curproc == vmproc; > +} > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Wed Nov 21 01:32:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87A3311455AF; Wed, 21 Nov 2018 01:32:29 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF8A28EAEB; Wed, 21 Nov 2018 01:32:28 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lj1-x230.google.com with SMTP id g11-v6so3375235ljk.3; Tue, 20 Nov 2018 17:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=HHh1xudadHax7t48qsANHkBnb/KZepv3jiYEmofvgHw=; b=gwMHu1EzlosZHLoLaReYEP4OEXoM501vcQr9Vy5t4Y2kP21ITeoLIqPvRX2cP6E3Gm qqE3638oY38Bx4AJt8d3xfU0xSStDJd19/eGW1QKqQPiYlHOhb7B8mkhaso8iINT88jL hoEgqRHlvM0Dx+Lfacmp7gFjKSNvqmSW0hhOTr7hEqPdT2HVPcOYdJVPEz3PH8xQI+Eq er3VGwXM+VOlprQi1S5bnQlISGTeqaU6lyM4whSgXDzJlrze5MWgDaMRNxVz3cSoIAQW 59MqsihaiMW4IzeUVtiZSf6nlV8asBgmH3Oyqov4u2tIaozihPnJ8V9vfYy0pATEm25b gv1Q== 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:reply-to :from:date:message-id:subject:to:cc; bh=HHh1xudadHax7t48qsANHkBnb/KZepv3jiYEmofvgHw=; b=hHwUSks6AryYYPK8F2RJej0SjicuBnEwSCBgORqOztRxn4wIYxDHwR5hMD/0DvbirQ pH28147+BLQsAcuJHllAivhG1BSbURDb8lUpnrLp5FgseDYIxZ0UCJcCPdrnYz46snzZ y8TqXNIbS9COkPiMzyFYDqESF3nNwFYLPO5NuCJsfG6H/Jky253kxvV5hWZOwmf+qE0Z EYifHGNGQv9gJ46pXDYduoqzAsT+7Ob1iPJJ4EcXCU1jPV1QGxUAQYW5ZtZxxwbv0MMd KjYuQBUhk28uN8dAtwk7noiLZ4Rs0k3sT8ut5ECP+PtqmOm3Nj7Vc5YlNOCJCn8h4TtG leMg== X-Gm-Message-State: AA+aEWbjVzVeB3e3mp3dIz9ZA8lA1Iw8JMKSdB2Ik6+8nS1i2U57y8iV 5VjsLkzhs6w+i6jjx3h7oqAs6oTUSVS5fMn1sgg= X-Google-Smtp-Source: AFSGD/Wpk1ypK/7xLfA2SgStGQsaryB+Z6tihLB9j9gBf/0N79C7I+JLuMXeCi0+5dgiTCQSsrtY2hEiBvhpNCPsM+M= X-Received: by 2002:a2e:5418:: with SMTP id i24-v6mr2823184ljb.51.1542763946834; Tue, 20 Nov 2018 17:32:26 -0800 (PST) MIME-Version: 1.0 References: <201811202221.wAKMLJ3W068166@repo.freebsd.org> <20181121002254.efitgf45bzajh5sj@mutt-hbsd> In-Reply-To: <20181121002254.efitgf45bzajh5sj@mutt-hbsd> Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Wed, 21 Nov 2018 09:32:14 +0800 Message-ID: Subject: Re: svn commit: r340707 - head/usr.sbin/bhyve To: Shawn Webb Cc: Marcelo Araujo , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: AF8A28EAEB X-Spamd-Result: default: False [-3.63 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[araujo@freebsd.org]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.993,0]; URI_COUNT_ODD(1.00)[7]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[0.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.65)[ipnet: 2a00:1450::/32(-1.58), asn: 15169(-1.58), country: US(-0.09)]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 01:32:29 -0000 Em qua, 21 de nov de 2018 =C3=A0s 08:23, Shawn Webb escreveu: > On Tue, Nov 20, 2018 at 10:21:19PM +0000, Marcelo Araujo wrote: > > Author: araujo > > Date: Tue Nov 20 22:21:19 2018 > > New Revision: 340707 > > URL: https://svnweb.freebsd.org/changeset/base/340707 > > > > Log: > > Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES > > to avoid buffer accessed out of bounds, also switch to snprintf(3). > > > > PR: 200859 > > Submitted by: Caglar > > Obtained from: https://github.com/mist64/xhyve/pull/24 > > MFC after: 4 weeks > > Sponsored by: iXsystems Inc. > > > > Modified: > > head/usr.sbin/bhyve/pci_ahci.c > > head/usr.sbin/bhyve/pci_virtio_block.c > > > > Modified: head/usr.sbin/bhyve/pci_ahci.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:12:10 2018 > (r340706) > > +++ head/usr.sbin/bhyve/pci_ahci.c Tue Nov 20 22:21:19 2018 > (r340707) > > @@ -105,7 +105,7 @@ enum sata_fis_type { > > * ATA commands > > */ > > #define ATA_SF_ENAB_SATA_SF 0x10 > > -#define ATA_SATA_SF_AN 0x05 > > +#define ATA_SATA_SF_AN 0x05 > > #define ATA_SF_DIS_SATA_SF 0x90 > > > > /* > > @@ -119,6 +119,8 @@ static FILE *dbg; > > #endif > > #define WPRINTF(format, arg...) printf(format, ##arg) > > > > +#define AHCI_PORT_IDENT 20 + 1 > > + > > struct ahci_ioreq { > > struct blockif_req io_req; > > struct ahci_port *io_pr; > > @@ -136,7 +138,7 @@ struct ahci_port { > > struct pci_ahci_softc *pr_sc; > > uint8_t *cmd_lst; > > uint8_t *rfis; > > - char ident[20 + 1]; > > + char ident[AHCI_PORT_IDENT]; > > int port; > > int atapi; > > int reset; > > @@ -2374,7 +2376,8 @@ pci_ahci_init(struct vmctx *ctx, struct > pci_devinst *p > > MD5Init(&mdctx); > > MD5Update(&mdctx, opts, strlen(opts)); > > MD5Final(digest, &mdctx); > > - sprintf(sc->port[p].ident, > "BHYVE-%02X%02X-%02X%02X-%02X%02X", > > + snprintf(sc->port[p].ident, AHCI_PORT_IDENT, > > + "BHYVE-%02X%02X-%02X%02X-%02X%02X", > > digest[0], digest[1], digest[2], digest[3], digest[4]= , > > digest[5]); > > > > > > Modified: head/usr.sbin/bhyve/pci_virtio_block.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:12:10 2018 > (r340706) > > +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Nov 20 22:21:19 2018 > (r340707) > > @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); > > #define VTBLK_S_IOERR 1 > > #define VTBLK_S_UNSUPP 2 > > > > -#define VTBLK_BLK_ID_BYTES 20 > > +#define VTBLK_BLK_ID_BYTES 20 + 1 > > > > /* Capability bits */ > > #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum reques= t > segments */ > > @@ -344,7 +344,8 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devins= t > * > > MD5Init(&mdctx); > > MD5Update(&mdctx, opts, strlen(opts)); > > MD5Final(digest, &mdctx); > > - sprintf(sc->vbsc_ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", > > + snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, > > + "BHYVE-%02X%02X-%02X%02X-%02X%02X", > > digest[0], digest[1], digest[2], digest[3], digest[4], > digest[5]); > > > > /* setup virtio block config space */ > > Hey Marcelo, > > Thanks for committing this. Could VTBLK_BLK_ID_BYTES and > AHCI_PORT_IDENT be merged into the same macro, defined in > usr.sbin/bhyve/pci_emul.h? Especially since both equate to the same > value. > The macro could be merged, but it is safer to have it in this way, in case something changes specifically for one of the drivers. I don't think pci_emul.h would be the right place for that, this file is in charge of PCI emulation functions and it is pretty much generic among the other drivers. Best. > > Thanks, > > -- > Shawn Webb > Cofounder and Security Engineer > HardenedBSD > > Tor-ified Signal: +1 443-546-8752 > Tor+XMPP+OTR: lattera@is.a.hacker.sx > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE > --=20 --=20 Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Wed Nov 21 02:20:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34D091146558 for ; Wed, 21 Nov 2018 02:20:27 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FF978FD48 for ; Wed, 21 Nov 2018 02:20:26 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm1-x333.google.com with SMTP id y139so3923791wmc.5 for ; Tue, 20 Nov 2018 18:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=19QkhDYDGJ4nqMZ9CrYjqKCJJmb/l6762AFXa3fJH9E=; b=ISt0CFTj8WTBFP9+QW4R/iUkbXtOpVcY2WVJETHLre7FS7Khf1HtJxpimPVyFJ+YvU FCvNlcgY6ZGVod/X1Odapc/Ki+XVO229Ypzsw8NbMs6og6ehfdd2z7xO6LvNhSy2xD0I V8jozqovSLdpAUiK16m7gtGfS/ds3HkdENzEL1s+r3YBY4n9I5SbWvoN5TG+LWynKrZt XWntnq/M1KAyvk+N89ApcFaUhTZIyZrAyHwysnNT4UkNmLCmWsJmzJaZtT0zrld9ZkpT yOp5CiPrEnlATSTKbmt1EeCxBxvhmYsB9QtJ5E8xMkTqh2ActSPsiRg36/RPKJDYk1IK rJYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=19QkhDYDGJ4nqMZ9CrYjqKCJJmb/l6762AFXa3fJH9E=; b=ioEqrEs846XDm7E9yaAII2+50auqD6ZuLJ12vPVk7BEQH3OAAqZn2vsU63+hzVNfjz sFBS1hiaCnJgtNDUYFXQDQGnuA2mXe2yu5HS0heFjf7NWEpSlMH+a2NhqbpIsmAysGuz 0i1nSt20JKiF7wJCfy6YGOz7wyiwP2uMHJJympRBEnOuApUWXhwbMub1GSOXW5DDTDVA mH5e3R74WMf+hQjNjP+iiRVGJhMfO2zRtwwvKpVp4+3BlCAZhlcuCnDANvwte5cCVO7e 7JKdb6t4fGIOk95rygZ0z99ykahuv2ZdkG8yFuR7Kv3Te+FuoaGzWZVU6gIVKrbLl7c9 GW2w== X-Gm-Message-State: AGRZ1gLg19ht7U34Nqk79dc8LLp3BNxIOmmShVXT/FTy8Nz5ujz6cO5O OPpFXzG8IICQtAXIIbRxfadkvw== X-Google-Smtp-Source: AJdET5fYNDOANIhUOXMKs6EgA7Dk+OBwDBcqRhdvpI91DFD3jEu3HiE83Kp/O8pkFiBdrlsz+ysOTQ== X-Received: by 2002:a1c:248b:: with SMTP id k133-v6mr3872465wmk.148.1542766825084; Tue, 20 Nov 2018 18:20:25 -0800 (PST) Received: from mutt-hbsd ([185.24.218.172]) by smtp.gmail.com with ESMTPSA id q20-v6sm25263237wmc.33.2018.11.20.18.20.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 18:20:24 -0800 (PST) Date: Tue, 20 Nov 2018 21:19:49 -0500 From: Shawn Webb To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys Message-ID: <20181121021949.vk7u5mji375fsy7h@mutt-hbsd> References: <201810300011.w9U0BUui038857@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="v5kqyhyamip2vsp4" Content-Disposition: inline In-Reply-To: <201810300011.w9U0BUui038857@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT FreeBSD 13.0-CURRENT HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180622 X-Rspamd-Queue-Id: 8FF978FD48 X-Spamd-Result: default: False [-2.09 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[cached: alt1.aspmx.l.google.com]; NEURAL_HAM_SHORT(-0.85)[-0.846,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.65)[ipnet: 2a00:1450::/32(-1.58), asn: 15169(-1.58), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987,0]; R_DKIM_ALLOW(0.00)[hardenedbsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RECEIVED_SPAMHAUS_XBL(3.00)[172.218.24.185.zen.spamhaus.org : 127.0.0.4]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; BAD_REP_POLICIES(0.10)[]; NEURAL_HAM_LONG(-0.99)[-0.993,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.3.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MID_RHS_NOT_FQDN(0.50)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 02:20:27 -0000 --v5kqyhyamip2vsp4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 30, 2018 at 12:11:30AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Oct 30 00:11:30 2018 > New Revision: 339898 > URL: https://svnweb.freebsd.org/changeset/base/339898 >=20 > Log: > Convert amd64_get/set_fs/gsbase to ifunc. > =20 > Note that this is the first use of ifuncs in our userspace. Hey Kostik, It appears this commit broke building/linking libc with LTO. I'm running into this assertion from clang/lld 7.0.0 (from the projects/clang700-import feature branch): https://github.com/HardenedBSD/hardenedBSD-playground/blob/hardened/current= /cross-dso-cfi/contrib/llvm/include/llvm/Support/Casting.h#L255 I'm likely going to file a bug report upstream in llvm. I'm wondering if lld doesn't support mixing ifuncs and LTO. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --v5kqyhyamip2vsp4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlv0wL8ACgkQaoRlj1JF bu5AqBAAtZ0R+MwC6p5ufuDk+gUGjYxTQkHqnf4wTWZ4Vu+AfxOqNe5MS+mNbMhQ xJqJ4TM8+lKXwx85WcS1+l4tlGUxDGiNPRDZKEl6QHJDElgBeFUR0YUZuzsePitD dkUeb4GOVp7cn6TYiwn4rduvWBzis+IBDHOe2M+TcIlE//Jy+B+3N9PbUh/pASp3 KiTjnvH5fpXsJ+QYGug2L1Cw45gONpmWvZutEYpPWD5bp/GwLaKSDnJvnsbBs8HA djcQuKiVVSLSeg6q0tNBUrR4hHGG9GQ0cs/T/F7tNBqjIprF0U+8lLCsmvEHuD7C Af4RPX2tS5WZ7pYr0DcDkBRRINsNY6k3O8uWz/vpal2NufkqHKvwfuggj/PVEysz WQ77LS8p1dEt8qVhD0ek1joD28e0fvuUvEhWjOxZxj0VN9I3cTHPfsuitli8oxMY sL6e5BvgWRnW5VWortLC8jLTuRLORydEiwtzaZj9IdEEgjQAy7ANthfAk+HQe9/A ACAgtiObkFXbLcoz+E+YxfWa66tZxVNfLnwWyFov5DLyz71uNdzVPUhZTVdzmYjw OJnHyLBUtfjF6fcELHjr5IgUi8H6WfN9rBxc6SHxt1+6rWv8zPrL03HpBKgC3NaZ J3if1t4Pn6hpDlC1FjrkPLqu2z5zbJnZfUCHNHz5Nf9tVF8efK0= =njfv -----END PGP SIGNATURE----- --v5kqyhyamip2vsp4-- From owner-svn-src-head@freebsd.org Wed Nov 21 04:34:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D7881103C4B; Wed, 21 Nov 2018 04:34:19 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 053F06DDA0; Wed, 21 Nov 2018 04:34:19 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA9F21B5A4; Wed, 21 Nov 2018 04:34:18 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL4YIsb062182; Wed, 21 Nov 2018 04:34:18 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL4YIfW062180; Wed, 21 Nov 2018 04:34:18 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201811210434.wAL4YIfW062180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Wed, 21 Nov 2018 04:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340720 - in head/sys: compat/linuxkpi/common/include/linux vm X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux vm X-SVN-Commit-Revision: 340720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 053F06DDA0 X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.13)[0.126,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.13)[0.132,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 04:34:19 -0000 Author: bwidawsk Date: Wed Nov 21 04:34:18 2018 New Revision: 340720 URL: https://svnweb.freebsd.org/changeset/base/340720 Log: linuxkpi: Use pageproc instead of vmproc According to markj@: pageproc contains the page daemon and laundry threads, which are responsible for managing the LRU page queues and writing back dirty pages. vmproc's main task is to swap out kernel stacks when the system is under memory pressure, and swap them back in when necessary. It's a somewhat legacy component of the system and isn't required. You can build a kernel without it by specifying "options NO_SWAPPING" (which is a somewhat misleading name), in which vm_swapout_dummy.c is compiled instead of vm_swapout.c. Based on this, we want pageproc to emulate kswapd, not vmproc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D18061 Modified: head/sys/compat/linuxkpi/common/include/linux/swap.h head/sys/vm/vm_pageout.h head/sys/vm/vm_swapout.c Modified: head/sys/compat/linuxkpi/common/include/linux/swap.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/swap.h Wed Nov 21 03:22:37 2018 (r340719) +++ head/sys/compat/linuxkpi/common/include/linux/swap.h Wed Nov 21 04:34:18 2018 (r340720) @@ -45,7 +45,8 @@ get_nr_swap_pages(void) static inline int current_is_kswapd(void) { - return vm_curproc_is_vmproc(); + + return (curproc == pageproc); } #endif Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Wed Nov 21 03:22:37 2018 (r340719) +++ head/sys/vm/vm_pageout.h Wed Nov 21 04:34:18 2018 (r340720) @@ -107,7 +107,5 @@ void vm_pageout_oom(int shortage); void vm_swapout_run(void); void vm_swapout_run_idle(void); -bool vm_curproc_is_vmproc(void); - #endif /* _KERNEL */ #endif /* _VM_VM_PAGEOUT_H_ */ Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Wed Nov 21 03:22:37 2018 (r340719) +++ head/sys/vm/vm_swapout.c Wed Nov 21 04:34:18 2018 (r340720) @@ -961,10 +961,3 @@ swapout(struct proc *p) p->p_swtick = ticks; return (0); } - -/* Used to determine if the current process is itself the reaper. */ -bool -vm_curproc_is_vmproc(void) -{ - return curproc == vmproc; -} From owner-svn-src-head@freebsd.org Wed Nov 21 06:07:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3944D1106E5F; Wed, 21 Nov 2018 06:07:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6297570ACF; Wed, 21 Nov 2018 06:07:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wAL67GJB073613 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Nov 2018 08:07:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wAL67GJB073613 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wAL67GkI073612; Wed, 21 Nov 2018 08:07:16 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 21 Nov 2018 08:07:16 +0200 From: Konstantin Belousov To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121060716.GE2378@kib.kiev.ua> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> <20181121005148.GF2630@raichu> <20181121005832.ongabjesxlsd7cqu@smtp.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121005832.ongabjesxlsd7cqu@smtp.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 6297570ACF X-Spamd-Result: default: False [-5.18 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; IP_SCORE(-2.20)[ip: (-2.84), ipnet: 2001:470::/32(-4.55), asn: 6939(-3.53), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 06:07:28 -0000 On Tue, Nov 20, 2018 at 04:58:32PM -0800, Ben Widawsky wrote: > On 18-11-20 19:51:48, Mark Johnston wrote: > > On Tue, Nov 20, 2018 at 04:42:39PM -0800, Ben Widawsky wrote: > > > On 18-11-20 19:35:15, Mark Johnston wrote: > > > > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > > > > Author: bwidawsk > > > > > Date: Tue Nov 20 22:49:19 2018 > > > > > New Revision: 340709 > > > > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > > > > > > > Log: > > > > > linuxkpi: Add some basic swap functions > > > > > > > > > > These are used by kms-drm to determine various heuristics relate > > > > > memory conditions. > > > > > > > > > > The number of free swap pages is just a variable, and it can be > > > > > much cheaper by either adding a new getter, or simply extern'ing > > > > > swap_total. However, this patch opts to use the more expensive, > > > > > existing interface - since this isn't an operation in a high per > > > > > path. > > > > > > > > > > This allows us to remove some more gpl linuxkpi and do the follo > > > > > kms-drm: > > > > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > > > > > > > Reviewed by: mmacy, Johannes Lundberg > > > > > Approved by: emaste (mentor) > > > > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > > > > > > > Added: > > > > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > > > > Modified: > > > > > head/sys/vm/vm_pageout.h > > > > > head/sys/vm/vm_swapout.c > > > > > > > > > > [...] > > > > > Modified: head/sys/vm/vm_swapout.c > > > > > ============================================================================== > > > > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > > > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > > > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > > > > p->p_swtick = ticks; > > > > > return (0); > > > > > } > > > > > + > > > > > +/* Used to determine if the current process is itself the reaper. */ > > > > > +bool > > > > > +vm_curproc_is_vmproc(void) > > > > > +{ > > > > > + return curproc == vmproc; > > > > > +} > > > > > > > > From a look at how this is used, it should probably be pageproc rather > > > > than vmproc. There are various code paths that just check > > > > curproc == pageproc inline. > > > > > > > > > > Could I trouble you for a quick explanation of the difference between the two? > > > > pageproc contains the page daemon and laundry threads, which are > > responsible for managing the LRU page queues and writing back dirty > > pages. vmproc's main task is to swap out kernel stacks when the system > > is under memory pressure, and swap them back in when necessary. It's a > > somewhat legacy component of the system and isn't required. You can > > build a kernel without it by specifying "options NO_SWAPPING" (which is > > a somewhat misleading name), in which vm_swapout_dummy.c is compiled > > instead of vm_swapout.c. > > > > Thanks for the explanation. I indeed want the page daemon. I will put up a patch > to do that the correct way. Thanks. What is the intent ? If the goal is to avoid wait for memory in deadlock- prone contexts, then you perhaps want to return true for both pagedaemon and vm daemon, and might be even the buf daemon threads as well. From owner-svn-src-head@freebsd.org Wed Nov 21 11:22:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A12F1134C2F; Wed, 21 Nov 2018 11:22:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE9097B117; Wed, 21 Nov 2018 11:22:44 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFACC1F9DA; Wed, 21 Nov 2018 11:22:44 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALBMifI071059; Wed, 21 Nov 2018 11:22:44 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALBMiCt071058; Wed, 21 Nov 2018 11:22:44 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811211122.wALBMiCt071058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 21 Nov 2018 11:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340722 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 340722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CE9097B117 X-Spamd-Result: default: False [0.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.21)[0.214,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 11:22:45 -0000 Author: 0mp (ports committer) Date: Wed Nov 21 11:22:44 2018 New Revision: 340722 URL: https://svnweb.freebsd.org/changeset/base/340722 Log: libbe(3): Put each error value in separate line. As requested by a TODO in the source code. Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18063 Modified: head/lib/libbe/libbe.3 Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Wed Nov 21 06:36:15 2018 (r340721) +++ head/lib/libbe/libbe.3 Wed Nov 21 11:22:44 2018 (r340722) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2018 +.Dd November 21, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -440,30 +440,49 @@ The .Fn be_prop_list_free function will free the property list. .Sh DIAGNOSTICS -Upon error, one of the following values will be returned. -.\" TODO: make each entry on its own line. -.Bd -ragged -offset indent -BE_ERR_SUCCESS, -BE_ERR_INVALIDNAME, -BE_ERR_EXISTS, -BE_ERR_NOENT, -BE_ERR_PERMS, -BE_ERR_DESTROYACT, -BE_ERR_DESTROYMNT, -BE_ERR_BADPATH, -BE_ERR_PATHBUSY, -BE_ERR_PATHLEN, -BE_ERR_BADMOUNT, -BE_ERR_NOORIGIN, -BE_ERR_MOUNTED, -BE_ERR_NOMOUNT, -BE_ERR_ZFSOPEN, -BE_ERR_ZFSCLONE, -BE_ERR_IO, -BE_ERR_NOPOOL, -BE_ERR_NOMEM, +Upon error, one of the following values will be returned: +.Bl -dash -offset indent -compact +.It +BE_ERR_SUCCESS +.It +BE_ERR_INVALIDNAME +.It +BE_ERR_EXISTS +.It +BE_ERR_NOENT +.It +BE_ERR_PERMS +.It +BE_ERR_DESTROYACT +.It +BE_ERR_DESTROYMNT +.It +BE_ERR_BADPATH +.It +BE_ERR_PATHBUSY +.It +BE_ERR_PATHLEN +.It +BE_ERR_BADMOUNT +.It +BE_ERR_NOORIGIN +.It +BE_ERR_MOUNTED +.It +BE_ERR_NOMOUNT +.It +BE_ERR_ZFSOPEN +.It +BE_ERR_ZFSCLONE +.It +BE_ERR_IO +.It +BE_ERR_NOPOOL +.It +BE_ERR_NOMEM +.It BE_ERR_UNKNOWN -.Ed +.El .Sh SEE ALSO .Xr be 1 .Sh HISTORY From owner-svn-src-head@freebsd.org Wed Nov 21 12:46:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7DD61137D94; Wed, 21 Nov 2018 12:46:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6543A7E195; Wed, 21 Nov 2018 12:46:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 440B02097E; Wed, 21 Nov 2018 12:46:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALCkTf2016219; Wed, 21 Nov 2018 12:46:29 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALCkSB6016217; Wed, 21 Nov 2018 12:46:28 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201811211246.wALCkSB6016217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 21 Nov 2018 12:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340723 - in head: lib/libbe sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in head: lib/libbe sbin/bectl X-SVN-Commit-Revision: 340723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6543A7E195 X-Spamd-Result: default: False [0.83 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.60)[0.602,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 12:46:30 -0000 Author: 0mp (ports committer) Date: Wed Nov 21 12:46:28 2018 New Revision: 340723 URL: https://svnweb.freebsd.org/changeset/base/340723 Log: Cross-reference libbe(3) and bectl(8). Those two manual pages are already referencing each other in the HISTORY sections, which people might skip. Mention those manual pages explicitly in the SEE ALSO sections. Also, remove a reference to be(1) from libbe(3). Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18136 Modified: head/lib/libbe/libbe.3 head/sbin/bectl/bectl.8 Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Wed Nov 21 11:22:44 2018 (r340722) +++ head/lib/libbe/libbe.3 Wed Nov 21 12:46:28 2018 (r340723) @@ -484,7 +484,7 @@ BE_ERR_NOMEM BE_ERR_UNKNOWN .El .Sh SEE ALSO -.Xr be 1 +.Xr bectl 8 .Sh HISTORY .Nm and its corresponding command, Modified: head/sbin/bectl/bectl.8 ============================================================================== --- head/sbin/bectl/bectl.8 Wed Nov 21 11:22:44 2018 (r340722) +++ head/sbin/bectl/bectl.8 Wed Nov 21 12:46:28 2018 (r340723) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2018 +.Dd November 21, 2018 .Dt BECTL 8 .Os .Sh NAME @@ -263,6 +263,7 @@ will force the unmount if busy. To fill in with jail upgrade example when behavior is firm. .El .Sh SEE ALSO +.Xr libbe 3 , .Xr jail 8 , .Xr zfs 8 , .Xr zpool 8 From owner-svn-src-head@freebsd.org Wed Nov 21 13:34:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD8AB1139378; Wed, 21 Nov 2018 13:34:22 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 835C8803F3; Wed, 21 Nov 2018 13:34:22 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65779211AF; Wed, 21 Nov 2018 13:34:22 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALDYMN7041239; Wed, 21 Nov 2018 13:34:22 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALDYMIB041238; Wed, 21 Nov 2018 13:34:22 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201811211334.wALDYMIB041238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Wed, 21 Nov 2018 13:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340724 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: oleg X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 340724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 835C8803F3 X-Spamd-Result: default: False [0.25 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.02)[0.020,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 13:34:23 -0000 Author: oleg Date: Wed Nov 21 13:34:21 2018 New Revision: 340724 URL: https://svnweb.freebsd.org/changeset/base/340724 Log: Unbreak kernel build with VLAN_ARRAY defined. MFC after: 1 week Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Wed Nov 21 12:46:28 2018 (r340723) +++ head/sys/net/if_vlan.c Wed Nov 21 13:34:21 2018 (r340724) @@ -314,15 +314,15 @@ VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner); #define V_vlan_cloner VNET(vlan_cloner) #endif -#ifndef VLAN_ARRAY -#define HASH(n, m) ((((n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) - static void vlan_mc_free(struct epoch_context *ctx) { struct vlan_mc_entry *mc = __containerof(ctx, struct vlan_mc_entry, mc_epoch_ctx); free(mc, M_VLAN); } + +#ifndef VLAN_ARRAY +#define HASH(n, m) ((((n) >> 8) ^ ((n) >> 4) ^ (n)) & (m)) static void vlan_inithash(struct ifvlantrunk *trunk) From owner-svn-src-head@freebsd.org Wed Nov 21 14:50:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA246113B2E7; Wed, 21 Nov 2018 14:50:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E31C8378F; Wed, 21 Nov 2018 14:50:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3805521D07; Wed, 21 Nov 2018 14:50:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALEolAe077512; Wed, 21 Nov 2018 14:50:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALEoj3K077506; Wed, 21 Nov 2018 14:50:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811211450.wALEoj3K077506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 21 Nov 2018 14:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340725 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 340725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E31C8378F X-Spamd-Result: default: False [0.38 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_SHORT(0.13)[0.128,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 14:50:48 -0000 Author: emaste Date: Wed Nov 21 14:50:45 2018 New Revision: 340725 URL: https://svnweb.freebsd.org/changeset/base/340725 Log: Add some non-default src.conf(5) knob descriptions Some WITH_/WITHOUT_ defaults will likey change in the future (e.g. as we migrate to copyfree base system components). Add non-default descriptions for the benefit of WIP branches. Added: head/tools/build/options/WITHOUT_BSD_GREP (contents, props changed) head/tools/build/options/WITH_GCOV (contents, props changed) head/tools/build/options/WITH_GNU_DIFF (contents, props changed) head/tools/build/options/WITH_GNU_GREP (contents, props changed) head/tools/build/options/WITH_SENDMAIL (contents, props changed) head/tools/build/options/WITH_TCP_WRAPPERS (contents, props changed) Added: head/tools/build/options/WITHOUT_BSD_GREP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_BSD_GREP Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Install GNU grep as '[ef]grep' instead of BSD grep. Added: head/tools/build/options/WITH_GCOV ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GCOV Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Build and install the GNU +.Xr gcov 1 +tool. Added: head/tools/build/options/WITH_GNU_DIFF ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GNU_DIFF Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Build and install GNU +.Xr diff 1 +and +.Xr diff3 1 . Added: head/tools/build/options/WITH_GNU_GREP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GNU_GREP Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Build and install GNU +.Xr grep 1 . Added: head/tools/build/options/WITH_SENDMAIL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_SENDMAIL Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Build and install +.Xr sendmail 8 +and related programs. Added: head/tools/build/options/WITH_TCP_WRAPPERS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_TCP_WRAPPERS Wed Nov 21 14:50:45 2018 (r340725) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Build and install +.Xr tcpd 8 , +and related utilities. From owner-svn-src-head@freebsd.org Wed Nov 21 15:42:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E85113C529; Wed, 21 Nov 2018 15:42:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f171.google.com (mail-it1-f171.google.com [209.85.166.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97F1185119; Wed, 21 Nov 2018 15:42:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f171.google.com with SMTP id i7so9481388iti.2; Wed, 21 Nov 2018 07:42:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J9SnJll+ySPs5ZZb20WOq5j5kusQhiPc19l0t3zOnjI=; b=iowzZZMDPM+9sZr+MIQCSjTyVQBhE+dL0BHnjzfw8XbEbBIff3E61EpTOIsNsgcYZ8 UiBMeAeLoX0PRM9oD/Ftsf3AFffy8Z30uhSPgXy8YJ1shzkw27xkfaY5fB2SSj+5jLQm sKk77SHViWMmd2CnoX01pkYCDiERcpoy5EA5YQWelPHzoSDo63QklkAIruNicgLPdLK6 UMVRK/8eo/fvKxnl2DMd9yJemds7oNEkR5MLr1TF72EE5wmbJ3EqV9nvnEyiAJAI+77D A8U07eNvR+KYObr1OJYobzip7usKYbAikix/negAPJT9/3pQnqodIN9CUNgoNq0t11vR 2RDA== X-Gm-Message-State: AGRZ1gJ8f6rBXHDoxK/rfYOTJ3nvFfwr8cm02tvdBHCCaGEH83vC7YcQ xe8MEeJqTwJZ9DfwzffosecefOGDnpwn8DbjFHk= X-Google-Smtp-Source: AJdET5eVMcfzpJqlGXs51ALrD4h8NtaalKsUyHB9s91A7GGH2XLdwjrHa/BqGYEupFwX8Aa1M7XvOENTI2AgbOP9vgs= X-Received: by 2002:a24:6bce:: with SMTP id v197-v6mr6040245itc.33.1542814922871; Wed, 21 Nov 2018 07:42:02 -0800 (PST) MIME-Version: 1.0 References: <201810300011.w9U0BUui038857@repo.freebsd.org> <20181121021949.vk7u5mji375fsy7h@mutt-hbsd> In-Reply-To: <20181121021949.vk7u5mji375fsy7h@mutt-hbsd> From: Ed Maste Date: Wed, 21 Nov 2018 10:41:49 -0500 Message-ID: Subject: Re: svn commit: r339898 - head/lib/libc/amd64/sys To: Shawn Webb Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 97F1185119 X-Spamd-Result: default: False [-5.71 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; RCVD_IN_DNSWL_NONE(0.00)[171.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.73)[ip: (-8.52), ipnet: 209.85.128.0/17(-3.48), asn: 15169(-1.56), country: US(-0.09)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 15:42:10 -0000 On Tue, 20 Nov 2018 at 21:21, Shawn Webb wrote: > > Hey Kostik, > > It appears this commit broke building/linking libc with LTO. I'm > running into this assertion from clang/lld 7.0.0 (from the > projects/clang700-import feature branch): Yes, if you can reproduce with upstream clang/llvm/lld head then an llvm bug is the best way to track this. From owner-svn-src-head@freebsd.org Wed Nov 21 16:18:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E67EC113D3F9; Wed, 21 Nov 2018 16:18:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 382A1867FD; Wed, 21 Nov 2018 16:18:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wALGItOd072614; Wed, 21 Nov 2018 08:18:55 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wALGIt0N072613; Wed, 21 Nov 2018 08:18:55 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340722 - head/lib/libbe In-Reply-To: <201811211122.wALBMiCt071058@repo.freebsd.org> To: Mateusz Piotrowski <0mp@freebsd.org> Date: Wed, 21 Nov 2018 08:18:55 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@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: 382A1867FD X-Spamd-Result: default: False [1.39 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.24)[0.245,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.55)[0.547,0]; NEURAL_HAM_SHORT(-0.27)[-0.275,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:18:58 -0000 > Author: 0mp (ports committer) > Date: Wed Nov 21 11:22:44 2018 > New Revision: 340722 > URL: https://svnweb.freebsd.org/changeset/base/340722 > > Log: > libbe(3): Put each error value in separate line. > > As requested by a TODO in the source code. > > Reviewed by: bcr > Approved by: krion (mentor, implicit), mat (mentor, implicit) > Differential Revision: https://reviews.freebsd.org/D18063 Who with a src bit approved the commit to src? > Modified: > head/lib/libbe/libbe.3 > > Modified: head/lib/libbe/libbe.3 > ============================================================================== > --- head/lib/libbe/libbe.3 Wed Nov 21 06:36:15 2018 (r340721) > +++ head/lib/libbe/libbe.3 Wed Nov 21 11:22:44 2018 (r340722) > @@ -28,7 +28,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd November 17, 2018 > +.Dd November 21, 2018 > .Dt LIBBE 3 > .Os > .Sh NAME > @@ -440,30 +440,49 @@ The > .Fn be_prop_list_free > function will free the property list. > .Sh DIAGNOSTICS > -Upon error, one of the following values will be returned. > -.\" TODO: make each entry on its own line. > -.Bd -ragged -offset indent > -BE_ERR_SUCCESS, > -BE_ERR_INVALIDNAME, > -BE_ERR_EXISTS, > -BE_ERR_NOENT, > -BE_ERR_PERMS, > -BE_ERR_DESTROYACT, > -BE_ERR_DESTROYMNT, > -BE_ERR_BADPATH, > -BE_ERR_PATHBUSY, > -BE_ERR_PATHLEN, > -BE_ERR_BADMOUNT, > -BE_ERR_NOORIGIN, > -BE_ERR_MOUNTED, > -BE_ERR_NOMOUNT, > -BE_ERR_ZFSOPEN, > -BE_ERR_ZFSCLONE, > -BE_ERR_IO, > -BE_ERR_NOPOOL, > -BE_ERR_NOMEM, > +Upon error, one of the following values will be returned: > +.Bl -dash -offset indent -compact > +.It > +BE_ERR_SUCCESS > +.It > +BE_ERR_INVALIDNAME > +.It > +BE_ERR_EXISTS > +.It > +BE_ERR_NOENT > +.It > +BE_ERR_PERMS > +.It > +BE_ERR_DESTROYACT > +.It > +BE_ERR_DESTROYMNT > +.It > +BE_ERR_BADPATH > +.It > +BE_ERR_PATHBUSY > +.It > +BE_ERR_PATHLEN > +.It > +BE_ERR_BADMOUNT > +.It > +BE_ERR_NOORIGIN > +.It > +BE_ERR_MOUNTED > +.It > +BE_ERR_NOMOUNT > +.It > +BE_ERR_ZFSOPEN > +.It > +BE_ERR_ZFSCLONE > +.It > +BE_ERR_IO > +.It > +BE_ERR_NOPOOL > +.It > +BE_ERR_NOMEM > +.It > BE_ERR_UNKNOWN > -.Ed > +.El > .Sh SEE ALSO > .Xr be 1 > .Sh HISTORY > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Nov 21 16:26:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51762113D85A; Wed, 21 Nov 2018 16:26:54 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87EB286E6A; Wed, 21 Nov 2018 16:26:53 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-lf1-x130.google.com with SMTP id v5so4417515lfe.7; Wed, 21 Nov 2018 08:26:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=DLa7BnGZO3h+QvJEXeTLjJlLzV8JRl9fZPS6tr77c64=; b=kcTZRHFdxm/9v077XLQzcupWni9t/HSBdw2bsyHL4YpqS5YAONQ08YoiAYNzcDf/9S UgwwVNWC9/4GSIarjX/7hwUl+CeAag4jrAUS3vemHALEly/PtH6JlBIvj0oCe6RcyY1W EMSNARL50WZ/vR3RPSiHMld8veTzNFqzNa4vZ8k34p0wKDJ8RanJ28J7hzBcgvO4MmYC lUwTtcdY4gm26dOg+8TtZWSufjMTgQ/bZqW46d33pLh2XT3oJV3hTTC/LOC+Tt7smmIN 7Zwx6/dAbKhY6ivwXQNzyh9MQBb2ZAkhyNm/QCUS/Vx0IbRapDHQZasNIINYlomO1DtV VZpA== 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:reply-to :from:date:message-id:subject:to:cc; bh=DLa7BnGZO3h+QvJEXeTLjJlLzV8JRl9fZPS6tr77c64=; b=QgDhpy8FViVzSCIFqfwDpDgGoDctU8giZusUPy/ytJzACZMp5rCdWOcYBjhKhdf2P5 Pp8yQV/tzVASbDPw/PfQnmYhPWMQVy+EQd0Q+B2VhDXhHd8KPSf9/29wfEXppQIzCSPj Awb0TWjYAEErzPnvoSMhEKkHD58gIUDw+xWXjUUfsrKgfZXheyhpw5S066FXXAfXyRwh Kw/Hf5D92g6kHtwU9UYUbptNDisz53rBFHlT8hdKxY8EU1LF02LU9qQj7Oc93AfnLMdq gKzl0gXNDU0+8PQQVuKclfIPABCK7VlDdShS7tvpAuIvDBo6EmZF6n1Hz7axQL6N/BgX iqKA== X-Gm-Message-State: AGRZ1gKbWs9l6/OIAVt3zdJFegwF4kX2bBhSRLdj4lOu20xjXatDmqAx z3fqUzsYtuuqLo0/Jfb4fgjSe39NQLyDnhwC1EKeYg== X-Google-Smtp-Source: AJdET5efj3zLSI4/9cgddKmiPOtCyTovV1bvAfR9+F6lpRHBcKpPCmSeMMXdNr5BaWqVdESWHNRmUbIGs+3gFHl7II4= X-Received: by 2002:a19:1d0d:: with SMTP id d13mr4074846lfd.74.1542817611629; Wed, 21 Nov 2018 08:26:51 -0800 (PST) MIME-Version: 1.0 References: <201811211122.wALBMiCt071058@repo.freebsd.org> <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> Reply-To: araujo@freebsd.org From: Marcelo Araujo Date: Thu, 22 Nov 2018 00:26:38 +0800 Message-ID: Subject: Re: svn commit: r340722 - head/lib/libbe To: "Rodney W. Grimes" Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 87EB286E6A X-Spamd-Result: default: False [-4.63 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[araujo@freebsd.org]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.99)[-0.994,0]; IP_SCORE(-0.64)[ipnet: 2a00:1450::/32(-1.55), asn: 15169(-1.56), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[0.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:26:54 -0000 On Thu, Nov 22, 2018, 12:19 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > Author: 0mp (ports committer) > > Date: Wed Nov 21 11:22:44 2018 > > New Revision: 340722 > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > Log: > > libbe(3): Put each error value in separate line. > > > > As requested by a TODO in the source code. > > > > Reviewed by: bcr > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > Differential Revision: https://reviews.freebsd.org/D18063 > > Who with a src bit approved the commit to src? > I was asking myself the same question!! > > Modified: > > head/lib/libbe/libbe.3 > > > > Modified: head/lib/libbe/libbe.3 > > > ============================================================================== > > --- head/lib/libbe/libbe.3 Wed Nov 21 06:36:15 2018 (r340721) > > +++ head/lib/libbe/libbe.3 Wed Nov 21 11:22:44 2018 (r340722) > > @@ -28,7 +28,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd November 17, 2018 > > +.Dd November 21, 2018 > > .Dt LIBBE 3 > > .Os > > .Sh NAME > > @@ -440,30 +440,49 @@ The > > .Fn be_prop_list_free > > function will free the property list. > > .Sh DIAGNOSTICS > > -Upon error, one of the following values will be returned. > > -.\" TODO: make each entry on its own line. > > -.Bd -ragged -offset indent > > -BE_ERR_SUCCESS, > > -BE_ERR_INVALIDNAME, > > -BE_ERR_EXISTS, > > -BE_ERR_NOENT, > > -BE_ERR_PERMS, > > -BE_ERR_DESTROYACT, > > -BE_ERR_DESTROYMNT, > > -BE_ERR_BADPATH, > > -BE_ERR_PATHBUSY, > > -BE_ERR_PATHLEN, > > -BE_ERR_BADMOUNT, > > -BE_ERR_NOORIGIN, > > -BE_ERR_MOUNTED, > > -BE_ERR_NOMOUNT, > > -BE_ERR_ZFSOPEN, > > -BE_ERR_ZFSCLONE, > > -BE_ERR_IO, > > -BE_ERR_NOPOOL, > > -BE_ERR_NOMEM, > > +Upon error, one of the following values will be returned: > > +.Bl -dash -offset indent -compact > > +.It > > +BE_ERR_SUCCESS > > +.It > > +BE_ERR_INVALIDNAME > > +.It > > +BE_ERR_EXISTS > > +.It > > +BE_ERR_NOENT > > +.It > > +BE_ERR_PERMS > > +.It > > +BE_ERR_DESTROYACT > > +.It > > +BE_ERR_DESTROYMNT > > +.It > > +BE_ERR_BADPATH > > +.It > > +BE_ERR_PATHBUSY > > +.It > > +BE_ERR_PATHLEN > > +.It > > +BE_ERR_BADMOUNT > > +.It > > +BE_ERR_NOORIGIN > > +.It > > +BE_ERR_MOUNTED > > +.It > > +BE_ERR_NOMOUNT > > +.It > > +BE_ERR_ZFSOPEN > > +.It > > +BE_ERR_ZFSCLONE > > +.It > > +BE_ERR_IO > > +.It > > +BE_ERR_NOPOOL > > +.It > > +BE_ERR_NOMEM > > +.It > > BE_ERR_UNKNOWN > > -.Ed > > +.El > > .Sh SEE ALSO > > .Xr be 1 > > .Sh HISTORY > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Wed Nov 21 16:41:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60AE0113DEB0; Wed, 21 Nov 2018 16:41:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02CEB69908; Wed, 21 Nov 2018 16:41:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 9A48B24193; Wed, 21 Nov 2018 16:41:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f182.google.com with SMTP id v1-v6so5437702ljd.0; Wed, 21 Nov 2018 08:41:51 -0800 (PST) X-Gm-Message-State: AGRZ1gJsQLMymM6YogvMRrysUhNoQO0Pmco0WooJK/SPM15BOl0czNmS gMCDPFP4h0Ebc0T6JKG26dmnj5nECzpnyCHNKDI= X-Google-Smtp-Source: AFSGD/W6BbHwcNm7GWx8lWrKeZRp8K79E7y+A3YhBkkaZkDZR+uqLjUf2yhcfoHuSkKnVGQDxtr52qoo0L884Dud7Ig= X-Received: by 2002:a2e:a202:: with SMTP id h2-v6mr4505953ljm.72.1542818510077; Wed, 21 Nov 2018 08:41:50 -0800 (PST) MIME-Version: 1.0 References: <201811211122.wALBMiCt071058@repo.freebsd.org> <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Wed, 21 Nov 2018 10:41:37 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340722 - head/lib/libbe To: "Rodney W. Grimes" Cc: 0mp@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 02CEB69908 X-Spamd-Result: default: False [0.37 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_MEDIUM(0.34)[0.342,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.06)[0.064,0]; NEURAL_HAM_LONG(-0.04)[-0.041,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:41:52 -0000 On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes wrote: > > > Author: 0mp (ports committer) > > Date: Wed Nov 21 11:22:44 2018 > > New Revision: 340722 > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > Log: > > libbe(3): Put each error value in separate line. > > > > As requested by a TODO in the source code. > > > > Reviewed by: bcr > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > Differential Revision: https://reviews.freebsd.org/D18063 > > Who with a src bit approved the commit to src? > I do want to clarify- bcr approved it in the review (explicitly with "... hereby approved!") -- are you mainly pointing out that he failed to annotate this properly in the commit, or is doc bit approval for a commit to a manpage in src insufficient? As an aside, happy to approve any changes to these manpages as the current bectl/libbe maintainer for anyone that wants to improve them. =) Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Wed Nov 21 16:46:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C28A113DFA3; Wed, 21 Nov 2018 16:46:07 +0000 (UTC) (envelope-from srs0=vwox=oa=vega.codepro.be=kp@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11C5469D29; Wed, 21 Nov 2018 16:46:05 +0000 (UTC) (envelope-from srs0=vwox=oa=vega.codepro.be=kp@codepro.be) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id D13548958; Wed, 21 Nov 2018 17:42:01 +0100 (CET) Received: by vega.codepro.be (Postfix, from userid 1001) id CD20139AC; Wed, 21 Nov 2018 17:42:01 +0100 (CET) Date: Wed, 21 Nov 2018 17:42:01 +0100 From: Kristof Provost To: rgrimes@freebsd.org Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340722 - head/lib/libbe Message-ID: <20181121164201.GA23255@vega.codepro.be> References: <201811211122.wALBMiCt071058@repo.freebsd.org> <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201811211618.wALGIt0N072613@pdx.rh.CN85.dnsmgr.net> X-Checked-By-NSA: Probably User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 11C5469D29 X-Spamd-Result: default: False [-4.43 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:162:1127::2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.99)[-0.991,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.25)[ipnet: 2a01:4f8::/29(-3.36), asn: 24940(-2.89), country: DE(-0.01)]; RCVD_IN_DNSWL_MED(-0.20)[2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.7.2.1.1.2.6.1.0.8.f.4.0.1.0.a.2.list.dnswl.org : 127.0.9.2]; MX_GOOD(-0.01)[mx2.codepro.be,mx1.codepro.be]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; FORGED_SENDER(0.30)[kp@freebsd.org,srs0=vwox=oa=vega.codepro.be=kp@codepro.be]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; FROM_NEQ_ENVFROM(0.00)[kp@freebsd.org, srs0=vwox=oa=vega.codepro.be=kp@codepro.be] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:46:07 -0000 On 2018-11-21 08:18:55 (-0800), Rodney W. Grimes wrote: > > Author: 0mp (ports committer) > > Date: Wed Nov 21 11:22:44 2018 > > New Revision: 340722 > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > Log: > > libbe(3): Put each error value in separate line. > > > > As requested by a TODO in the source code. > > > > Reviewed by: bcr > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > Differential Revision: https://reviews.freebsd.org/D18063 > > Who with a src bit approved the commit to src? > My understanding is that doc bits allow people to commit to src documentation, including man pages. (https://www.freebsd.org/doc/en/articles/committers-guide/committer.types.html) Best regards, Kristof From owner-svn-src-head@freebsd.org Wed Nov 21 16:47:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DF5D113E039; Wed, 21 Nov 2018 16:47:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE7E069EEA; Wed, 21 Nov 2018 16:47:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF5E72305C; Wed, 21 Nov 2018 16:47:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALGlBoS039309; Wed, 21 Nov 2018 16:47:11 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALGlBBn039307; Wed, 21 Nov 2018 16:47:11 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201811211647.wALGlBBn039307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 21 Nov 2018 16:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340726 - in head/sys/cddl: contrib/opensolaris/uts/common/sys dev/fbt/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/cddl: contrib/opensolaris/uts/common/sys dev/fbt/powerpc X-SVN-Commit-Revision: 340726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE7E069EEA X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.199,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:47:12 -0000 Author: jhibbits Date: Wed Nov 21 16:47:11 2018 New Revision: 340726 URL: https://svnweb.freebsd.org/changeset/base/340726 Log: DTrace/powerpc: Fix FBT return probes The FBT fuction boundary prober was setting one return probe marker value, but the dtrace handler was expecting another. This causes a hang when tracing return probes. Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Wed Nov 21 14:50:45 2018 (r340725) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Wed Nov 21 16:47:11 2018 (r340726) @@ -2435,12 +2435,11 @@ extern void dtrace_helpers_destroy(proc_t *); #elif defined(__powerpc__) -#define DTRACE_INVOP_RET 1 -#define DTRACE_INVOP_BCTR 2 -#define DTRACE_INVOP_BLR 3 -#define DTRACE_INVOP_JUMP 4 -#define DTRACE_INVOP_MFLR_R0 5 -#define DTRACE_INVOP_NOP 6 +#define DTRACE_INVOP_BCTR 1 +#define DTRACE_INVOP_BLR 2 +#define DTRACE_INVOP_JUMP 3 +#define DTRACE_INVOP_MFLR_R0 4 +#define DTRACE_INVOP_NOP 5 #elif defined(__arm__) Modified: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Wed Nov 21 14:50:45 2018 (r340725) +++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Wed Nov 21 16:47:11 2018 (r340726) @@ -221,7 +221,7 @@ again: if (*instr == FBT_BCTR) fbt->fbtp_rval = DTRACE_INVOP_BCTR; else if (*instr == FBT_BLR) - fbt->fbtp_rval = DTRACE_INVOP_RET; + fbt->fbtp_rval = DTRACE_INVOP_BLR; else fbt->fbtp_rval = DTRACE_INVOP_JUMP; From owner-svn-src-head@freebsd.org Wed Nov 21 16:54:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 940B3113E344; Wed, 21 Nov 2018 16:54:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 AEEEF6A492; Wed, 21 Nov 2018 16:54:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wALGsAU6072770; Wed, 21 Nov 2018 08:54:10 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wALGsAPT072769; Wed, 21 Nov 2018 08:54:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340722 - head/lib/libbe In-Reply-To: To: Kyle Evans Date: Wed, 21 Nov 2018 08:54:10 -0800 (PST) CC: "Rodney W. Grimes" , 0mp@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers 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: AEEEF6A492 X-Spamd-Result: default: False [1.28 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.57)[0.571,0]; NEURAL_HAM_SHORT(-0.43)[-0.433,0]; NEURAL_SPAM_MEDIUM(0.27)[0.267,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:54:13 -0000 > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > wrote: > > > > > Author: 0mp (ports committer) > > > Date: Wed Nov 21 11:22:44 2018 > > > New Revision: 340722 > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > Log: > > > libbe(3): Put each error value in separate line. > > > > > > As requested by a TODO in the source code. > > > > > > Reviewed by: bcr > > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > Who with a src bit approved the commit to src? > > > > I do want to clarify- bcr approved it in the review (explicitly with > "... hereby approved!") -- are you mainly pointing out that he failed > to annotate this properly in the commit, or is doc bit approval for a > commit to a manpage in src insufficient? That is defanitly a bit of a grey area, from reading and re-reading the commit bit page it is clear that a doc committer can commit to src documentation, it is not clear if they can approve a commit by someone else to the src tree, it does say ""Approved by" from a non-mentored committer with the appropriate bit" It probably would be fine to have said Approved by: bcr. I still question what a out of scope commit that is approved by: (mentor, implicit). I am not even sure what that means in this context. Have his mentors said he can commit anything anyplace without them seeing it? If so then release the mentor/mentee bit would be more appropriate? > > As an aside, happy to approve any changes to these manpages as the > current bectl/libbe maintainer for anyone that wants to improve them. > =) That defanitly would of been a cleaner path. > > Thanks, > > Kyle Evans > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Nov 21 16:58:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D33D113E42D; Wed, 21 Nov 2018 16:58:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11F166A641; Wed, 21 Nov 2018 16:58:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id A65C124290; Wed, 21 Nov 2018 16:58:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f169.google.com with SMTP id e5-v6so5467273lja.4; Wed, 21 Nov 2018 08:58:20 -0800 (PST) X-Gm-Message-State: AA+aEWZP0K8O929WQ48IItOSmdwtjRvPPBCwSv6OyiTTfLg7i14C8QYP iX2ji4CspK5Pf+tZWBzqFCOgtN3qGtG855/nnuU= X-Google-Smtp-Source: AFSGD/XfnfsocKSirr/yXuPP7BqXYoIJnZVTEqs7JOpGVyKbQHuCOvWyu1lpfOFins/tCO+KL9Ak96qVrmDpCAG+pSQ= X-Received: by 2002:a2e:2019:: with SMTP id g25-v6mr4403380ljg.20.1542819499129; Wed, 21 Nov 2018 08:58:19 -0800 (PST) MIME-Version: 1.0 References: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Wed, 21 Nov 2018 10:58:06 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340722 - head/lib/libbe To: "Rodney W. Grimes" Cc: 0mp@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 11F166A641 X-Spamd-Result: default: False [0.37 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_MEDIUM(0.34)[0.342,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_SPAM_SHORT(0.06)[0.064,0]; NEURAL_HAM_LONG(-0.04)[-0.041,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:58:21 -0000 On Wed, Nov 21, 2018 at 10:54 AM Rodney W. Grimes wrote: > > > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > > wrote: > > > > > > > Author: 0mp (ports committer) > > > > Date: Wed Nov 21 11:22:44 2018 > > > > New Revision: 340722 > > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > > > Log: > > > > libbe(3): Put each error value in separate line. > > > > > > > > As requested by a TODO in the source code. > > > > > > > > Reviewed by: bcr > > > > Approved by: krion (mentor, implicit), mat (mentor, implicit) > > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > > > Who with a src bit approved the commit to src? > > > > > > > I do want to clarify- bcr approved it in the review (explicitly with > > "... hereby approved!") -- are you mainly pointing out that he failed > > to annotate this properly in the commit, or is doc bit approval for a > > commit to a manpage in src insufficient? > > That is defanitly a bit of a grey area, from reading and re-reading > the commit bit page it is clear that a doc committer can commit > to src documentation, it is not clear if they can approve a commit > by someone else to the src tree, it does say > ""Approved by" from a non-mentored committer > with the appropriate bit" > > It probably would be fine to have said Approved by: bcr. > Agreed- I think this is fine given that it's within the scope of bcr's doc bit. > I still question what a out of scope commit that is > approved by: (mentor, implicit). I am not even sure > what that means in this context. Have his mentors > said he can commit anything anyplace without them > seeing it? If so then release the mentor/mentee bit > would be more appropriate? > I suspect it's that they're not interested in any doc changes he has, because they're not doc people. Well, mat@ is, but mat isn't mentoring him for docs, he's mentoring him for ports. Such approvals would just be rubber stamps anyways, because they as mentors might not necessarily be up-to-date on doc protocols. From owner-svn-src-head@freebsd.org Wed Nov 21 17:18:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E602113F13D; Wed, 21 Nov 2018 17:18:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 401D06BB83; Wed, 21 Nov 2018 17:18:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 224AC23543; Wed, 21 Nov 2018 17:18:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALHISj1055339; Wed, 21 Nov 2018 17:18:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHIRE4055336; Wed, 21 Nov 2018 17:18:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211718.wALHIRE4055336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340730 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 340730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 401D06BB83 X-Spamd-Result: default: False [0.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.198,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:18:28 -0000 Author: markj Date: Wed Nov 21 17:18:27 2018 New Revision: 340730 URL: https://svnweb.freebsd.org/changeset/base/340730 Log: Add a taskqueue_quiesce(9) KPI. This is similar to taskqueue_drain_all(9) but will wait for the queue to become idle before returning instead of only waiting for already-enqueued tasks to finish. This will be used in the opensolaris compat layer. PR: 227784 Reviewed by: cem MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17975 Modified: head/share/man/man9/Makefile head/share/man/man9/taskqueue.9 head/sys/kern/subr_taskqueue.c head/sys/sys/taskqueue.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Nov 21 17:14:57 2018 (r340729) +++ head/share/man/man9/Makefile Wed Nov 21 17:18:27 2018 (r340730) @@ -2056,6 +2056,7 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ + taskqueue.9 taskqueue_quiesce.9 \ taskqueue.9 taskqueue_run.9 \ taskqueue.9 taskqueue_set_callback.9 \ taskqueue.9 taskqueue_start_threads.9 \ Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Wed Nov 21 17:14:57 2018 (r340729) +++ head/share/man/man9/taskqueue.9 Wed Nov 21 17:18:27 2018 (r340730) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2017 +.Dd November 21, 2018 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -94,6 +94,8 @@ struct timeout_task; .Ft void .Fn taskqueue_drain_all "struct taskqueue *queue" .Ft void +.Fn taskqueue_quiesce "struct taskqueue *queue" +.Ft void .Fn taskqueue_block "struct taskqueue *queue" .Ft void .Fn taskqueue_unblock "struct taskqueue *queue" @@ -298,6 +300,12 @@ do not extend the wait time of and may complete after .Fn taskqueue_drain_all returns. +The +.Fn taskqueue_quiesce +function is used to wait for the queue to become empty and for all +running tasks to finish. +To avoid blocking indefinitely, the caller must ensure by some mechanism +that tasks will eventually stop being posted to the queue. .Pp The .Fn taskqueue_block Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Wed Nov 21 17:14:57 2018 (r340729) +++ head/sys/kern/subr_taskqueue.c Wed Nov 21 17:18:27 2018 (r340730) @@ -346,13 +346,13 @@ taskqueue_task_nop_fn(void *context, int pending) * have begun execution. Tasks queued during execution of * this function are ignored. */ -static void +static int taskqueue_drain_tq_queue(struct taskqueue *queue) { struct task t_barrier; if (STAILQ_EMPTY(&queue->tq_queue)) - return; + return (0); /* * Enqueue our barrier after all current tasks, but with @@ -372,6 +372,7 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) */ while (t_barrier.ta_pending != 0) TQ_SLEEP(queue, &t_barrier, &queue->tq_mutex, PWAIT, "-", 0); + return (1); } /* @@ -379,13 +380,13 @@ taskqueue_drain_tq_queue(struct taskqueue *queue) * complete. Tasks that begin execution during the execution * of this function are ignored. */ -static void +static int taskqueue_drain_tq_active(struct taskqueue *queue) { struct taskqueue_busy tb_marker, *tb_first; if (TAILQ_EMPTY(&queue->tq_active)) - return; + return (0); /* Block taskq_terminate().*/ queue->tq_callouts++; @@ -412,6 +413,7 @@ taskqueue_drain_tq_active(struct taskqueue *queue) queue->tq_callouts--; if ((queue->tq_flags & TQ_FLAGS_ACTIVE) == 0) wakeup_one(queue->tq_threads); + return (1); } void @@ -582,8 +584,8 @@ taskqueue_drain_all(struct taskqueue *queue) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); TQ_LOCK(queue); - taskqueue_drain_tq_queue(queue); - taskqueue_drain_tq_active(queue); + (void)taskqueue_drain_tq_queue(queue); + (void)taskqueue_drain_tq_active(queue); TQ_UNLOCK(queue); } @@ -609,6 +611,20 @@ taskqueue_drain_timeout(struct taskqueue *queue, */ TQ_LOCK(queue); timeout_task->f &= ~DT_DRAIN_IN_PROGRESS; + TQ_UNLOCK(queue); +} + +void +taskqueue_quiesce(struct taskqueue *queue) +{ + int ret; + + TQ_LOCK(queue); + do { + ret = taskqueue_drain_tq_queue(queue); + if (ret == 0) + ret = taskqueue_drain_tq_active(queue); + } while (ret != 0); TQ_UNLOCK(queue); } Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Wed Nov 21 17:14:57 2018 (r340729) +++ head/sys/sys/taskqueue.h Wed Nov 21 17:18:27 2018 (r340730) @@ -93,6 +93,7 @@ void taskqueue_drain(struct taskqueue *queue, struct t void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task); void taskqueue_drain_all(struct taskqueue *queue); +void taskqueue_quiesce(struct taskqueue *queue); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-head@freebsd.org Wed Nov 21 17:19:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AD8F113F1A0; Wed, 21 Nov 2018 17:19:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D9C76BD1A; Wed, 21 Nov 2018 17:19:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EA4B23558; Wed, 21 Nov 2018 17:19:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALHJ85k055430; Wed, 21 Nov 2018 17:19:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHJ8bG055429; Wed, 21 Nov 2018 17:19:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211719.wALHJ8bG055429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340731 - head/sys/cddl/compat/opensolaris/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/compat/opensolaris/kern X-SVN-Commit-Revision: 340731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D9C76BD1A X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.199,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:19:09 -0000 Author: markj Date: Wed Nov 21 17:19:08 2018 New Revision: 340731 URL: https://svnweb.freebsd.org/changeset/base/340731 Log: Use taskqueue_quiesce(9) to implement taskq_wait(). PR: 227784 Reviewed by: cem MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17975 Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Nov 21 17:18:27 2018 (r340730) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Nov 21 17:19:08 2018 (r340731) @@ -171,11 +171,11 @@ taskq_dispatch_ent(taskq_t *tq, task_func_t func, void void taskq_wait(taskq_t *tq) { - taskqueue_drain_all(tq->tq_queue); + taskqueue_quiesce(tq->tq_queue); } void taskq_wait_id(taskq_t *tq, taskqid_t id) { - taskq_wait(tq); + taskqueue_drain_all(tq->tq_queue); } From owner-svn-src-head@freebsd.org Wed Nov 21 17:20:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8413113F254; Wed, 21 Nov 2018 17:20:15 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A7CB6BEBA; Wed, 21 Nov 2018 17:20:15 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd31.google.com with SMTP id w7so4594946iom.12; Wed, 21 Nov 2018 09:20:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eGQ/TPnIFSLSll9Y7FmkGDdAACqOsC0gaUU6GMT+4Jc=; b=Dg3zvMmU7KV5aGPy/gXdQIhJAOipELmz4Zlq7nPRC5s9hbeT1+FThrytN0pW0fz1Uj lDTBqI9QYGzkxwQWnR8c6P+IqYeJMU1fCF5xb0KqK4UeY4PUhow98y+XnkseTkLkZjhr cMdnOozxM/Fis+09CjdKB/BAG0z2HHXlb65Yt9r8Vq2sAdqFeAmYU/4M/Yt1pa7tLmUY ts8o9R9uaLY+zxA6gwrCBuarkHdtve8eGqEc6+eHpzAbcFHq+/sIUWbu3cATBJ0/Hee0 1WmmL8FEfSVLzsX3NaDGvvdlw2wR2/CL6qqTAEqdhSKqpjMGPyyrmJCs9x28LolCVqkH J3GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=eGQ/TPnIFSLSll9Y7FmkGDdAACqOsC0gaUU6GMT+4Jc=; b=XUxuSUg7ojDVrguvKlBA+m4qQotv5sLwQcExqLkiYy2rxKkFOIetBidHF7g9GBINy0 oTrKavlaasTUfbh8NCFTUxdVzOEr39EUrABYGIGnFbh4ybTvkLALtAIgbswoHaW4TTAi i5WSs/Ji8/xzL6RDpl3+BvMV3U5hodM9m6fp1elogN8E36uqS7t9n5kn+7H16PT6AUAp jNOwPDwQ68DLkMiI9SsloYeV0umNbIpBPhKCb5Y/T4xUcGFTrhbaIrUftU5yS0trFzIi mPut+LOXghZOXsd/UXX60AnaSATdqoTYzIzEmshbQGjC9nEhaxS/sTXAL5DEcFkJYi+c /jWg== X-Gm-Message-State: AA+aEWZesoyJKY7RSBAY4UyKU4jCpystyBhh7frU4FJ+0gTRg40qe3Ii eFq8vfuCtwjyAgb1WyxzSjUDhzeJ9bg= X-Google-Smtp-Source: AFSGD/Xt7vWdlzuwgKvqNP56oxtER0tqCSZxyh6N9cR90NnGZQ8MzeqSP2VeQA7hcwPlQpZuOfByjA== X-Received: by 2002:a6b:7a46:: with SMTP id k6mr5783352iop.60.1542820814289; Wed, 21 Nov 2018 09:20:14 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id y5sm943872itb.42.2018.11.21.09.20.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 09:20:13 -0800 (PST) Sender: Mark Johnston Date: Wed, 21 Nov 2018 12:20:11 -0500 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340731 - head/sys/cddl/compat/opensolaris/kern Message-ID: <20181121172011.GB67072@raichu> References: <201811211719.wALHJ8bG055429@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811211719.wALHJ8bG055429@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 2A7CB6BEBA X-Spamd-Result: default: False [-5.23 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[1.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; IP_SCORE(-2.53)[ip: (-8.64), ipnet: 2607:f8b0::/32(-2.34), asn: 15169(-1.56), country: US(-0.09)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:20:16 -0000 On Wed, Nov 21, 2018 at 05:19:08PM +0000, Mark Johnston wrote: > Author: markj > Date: Wed Nov 21 17:19:08 2018 > New Revision: 340731 > URL: https://svnweb.freebsd.org/changeset/base/340731 > > Log: > Use taskqueue_quiesce(9) to implement taskq_wait(). > > PR: 227784 > Reviewed by: cem > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17975 Sorry, I forgot: Tested by: wulf From owner-svn-src-head@freebsd.org Wed Nov 21 17:28:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 450B4113F6F0; Wed, 21 Nov 2018 17:28:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCDC36C79A; Wed, 21 Nov 2018 17:28:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDEB1236F3; Wed, 21 Nov 2018 17:28:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALHSAAF060890; Wed, 21 Nov 2018 17:28:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHSA7P060888; Wed, 21 Nov 2018 17:28:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211728.wALHSA7P060888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340733 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DCDC36C79A X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.199,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:28:11 -0000 Author: markj Date: Wed Nov 21 17:28:10 2018 New Revision: 340733 URL: https://svnweb.freebsd.org/changeset/base/340733 Log: Remove KN_HASKQLOCK. It is a write-only flag whose last use was removed in r302235. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18059 Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Wed Nov 21 17:22:31 2018 (r340732) +++ head/sys/kern/kern_event.c Wed Nov 21 17:28:10 2018 (r340733) @@ -549,10 +549,8 @@ knote_fork(struct knlist *list, int pid) * The same as knote(), activate the event. */ if ((kn->kn_sfflags & NOTE_TRACK) == 0) { - kn->kn_status |= KN_HASKQLOCK; if (kn->kn_fop->f_event(kn, NOTE_FORK)) KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_HASKQLOCK; KQ_UNLOCK(kq); continue; } @@ -2272,10 +2270,8 @@ knote(struct knlist *list, long hint, int lockflags) KNOTE_ACTIVATE(kn, 1); KQ_UNLOCK_FLUX(kq); } else { - kn->kn_status |= KN_HASKQLOCK; if (kn->kn_fop->f_event(kn, hint)) KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_HASKQLOCK; KQ_UNLOCK(kq); } } Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Wed Nov 21 17:22:31 2018 (r340732) +++ head/sys/sys/event.h Wed Nov 21 17:28:10 2018 (r340733) @@ -294,7 +294,6 @@ struct knote { #define KN_DETACHED 0x08 /* knote is detached */ #define KN_MARKER 0x20 /* ignore this knote */ #define KN_KQUEUE 0x40 /* this knote belongs to a kq */ -#define KN_HASKQLOCK 0x80 /* for _inevent */ #define KN_SCAN 0x100 /* flux set in kqueue_scan() */ int kn_influx; int kn_sfflags; /* saved filter flags */ From owner-svn-src-head@freebsd.org Wed Nov 21 17:32:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08173113F917; Wed, 21 Nov 2018 17:32:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2BF76CB63; Wed, 21 Nov 2018 17:32:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AE0E2386B; Wed, 21 Nov 2018 17:32:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALHWAea065546; Wed, 21 Nov 2018 17:32:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHWAaP065545; Wed, 21 Nov 2018 17:32:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211732.wALHWAaP065545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340734 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2BF76CB63 X-Spamd-Result: default: False [0.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.198,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:32:11 -0000 Author: markj Date: Wed Nov 21 17:32:09 2018 New Revision: 340734 URL: https://svnweb.freebsd.org/changeset/base/340734 Log: Avoid unsynchronized updates to kn_status. kn_status is protected by the kqueue's lock, but we were updating it without the kqueue lock held. For EVFILT_TIMER knotes, there is no knlist lock, so the knote activation could occur during the kn_status update and result in KN_QUEUED being lost, in which case we'd enqueue an already-enqueued knote, corrupting the queue. Fix the problem by setting or clearing KN_DISABLED before dropping the kqueue lock to call into the filter. KN_DISABLED is used only by the core kevent code, so there is no side effect from setting it earlier. Reported and tested by: Sylvain GALLIANO Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18060 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Wed Nov 21 17:28:10 2018 (r340733) +++ head/sys/kern/kern_event.c Wed Nov 21 17:32:09 2018 (r340734) @@ -1533,6 +1533,8 @@ findkn: kn->kn_kevent.flags &= ~(EV_ADD | EV_DELETE | EV_ENABLE | EV_DISABLE | EV_FORCEONESHOT); kn->kn_status = KN_DETACHED; + if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; kn_enter_flux(kn); error = knote_attach(kn, kq); @@ -1568,6 +1570,11 @@ findkn: KNOTE_ACTIVATE(kn, 1); } + if ((kev->flags & EV_ENABLE) != 0) + kn->kn_status &= ~KN_DISABLED; + else if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; + /* * The user may change some filter values after the initial EV_ADD, * but doing so will not reset any filter which has already been @@ -1585,19 +1592,17 @@ findkn: kn->kn_sdata = kev->data; } +done_ev_add: /* * We can get here with kn->kn_knlist == NULL. This can happen when * the initial attach event decides that the event is "completed" - * already. i.e. filt_procattach is called on a zombie process. It - * will call filt_proc which will remove it from the list, and NULL + * already, e.g., filt_procattach() is called on a zombie process. It + * will call filt_proc() which will remove it from the list, and NULL * kn_knlist. + * + * KN_DISABLED will be stable while the knote is in flux, so the + * unlocked read will not race with an update. */ -done_ev_add: - if ((kev->flags & EV_ENABLE) != 0) - kn->kn_status &= ~KN_DISABLED; - else if ((kev->flags & EV_DISABLE) != 0) - kn->kn_status |= KN_DISABLED; - if ((kn->kn_status & KN_DISABLED) == 0) event = kn->kn_fop->f_event(kn, 0); else From owner-svn-src-head@freebsd.org Wed Nov 21 18:01:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2071411407AC; Wed, 21 Nov 2018 18:01:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29E8A6E204; Wed, 21 Nov 2018 18:01:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd42.google.com with SMTP id l14so4563942ioj.5; Wed, 21 Nov 2018 10:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PjFa47lw4/av+KRz46OGp32X+oV8TdQzseRpOqBMSfQ=; b=VmWqz+wAzVJvR5WzvXzwLN5Hys3Bifw9lyLKj33QgAREWvWd8yiFTz5uxQL0/4kfPz kfbEgtOjM9UsTWfSeJf5jwVpre21zJAB88Uil3xcvQV8jprJAjkTbYj62CN61HjEyyzJ znwH9Y0ihCUu2ucjNJK4qwk/CTknYTbAWdiUGuMOYNcyuST/2TjfyoZJnIfWtr1iwIgj ldJsb7GzcFo/m4HVh6Bra/svWtXJr+lcsr4lrQRdCh3/hIb53BAMikhiPnfQ2EtmB95p yDSRk9WN2JJ31uH+EfwwIMiUivwlw2LJ+vQgleSZVIzAAbXbyH9opZf2dNKBawgQPyuL Oklw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=PjFa47lw4/av+KRz46OGp32X+oV8TdQzseRpOqBMSfQ=; b=aKH2ryiNkpoz4P6rXgsVi9d+5yvwdx9JPzLIZWj6TnNif6q0ImSWSirseQuJDT6GjN in3vDEL1oqrdpVzVzI8ipUVK4w6H/zLZM+Ksb+8W/U8vcw5RvD/xa3efwq41btpzMy9y 8aRy2whkY49GwP+lVgiXT1XlmrCtUN7Nh6zywIw9aLH+pJvjLReACCPh+BJxC6JdITKo 5L6Z1plFEcomExIw9T3WBmMU5tjUSsvwm0ct7OfXMCrXig9kvBTVtRYz2CuGMiqTlNi6 rSxDnkBHj6Vpd8gefT1nP+J2v4T3ux/JnAtY3NruI/4diP64JIqn64+lIFHSDyFUNtA9 JxhA== X-Gm-Message-State: AA+aEWbVsUNIvK6IvNkX28f1EkxskrBqyisKW7w55ydpwxXPrUcJZ9ZX Q9WWiJ6mKP84cCaiRYa5iwY= X-Google-Smtp-Source: AFSGD/WhlBaGffyfBbLGr5m0eb/84zdOjyAdv5ofUwJInCsmVyU+6MV65FGZi2wx4ayOYEdHr9QdDA== X-Received: by 2002:a5d:9046:: with SMTP id v6mr5299339ioq.49.1542823305425; Wed, 21 Nov 2018 10:01:45 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id q23sm6517252ioi.66.2018.11.21.10.01.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 10:01:44 -0800 (PST) Sender: Mark Johnston Date: Wed, 21 Nov 2018 13:01:42 -0500 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340709 - in head/sys: compat/linuxkpi/common/include/linux vm Message-ID: <20181121180142.GF67072@raichu> References: <201811202249.wAKMnJxH082469@repo.freebsd.org> <20181121003515.GE2630@raichu> <20181121004239.spk72g2pikvse4y7@smtp.freebsd.org> <20181121005148.GF2630@raichu> <20181121005832.ongabjesxlsd7cqu@smtp.freebsd.org> <20181121060716.GE2378@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121060716.GE2378@kib.kiev.ua> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 29E8A6E204 X-Spamd-Result: default: False [-2.50 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-0.96)[-0.961,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-0.93)[-0.926,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.63)[-0.627,0]; IP_SCORE(-0.28)[ip: (2.60), ipnet: 2607:f8b0::/32(-2.34), asn: 15169(-1.56), country: US(-0.09)]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:01:47 -0000 On Wed, Nov 21, 2018 at 08:07:16AM +0200, Konstantin Belousov wrote: > On Tue, Nov 20, 2018 at 04:58:32PM -0800, Ben Widawsky wrote: > > On 18-11-20 19:51:48, Mark Johnston wrote: > > > On Tue, Nov 20, 2018 at 04:42:39PM -0800, Ben Widawsky wrote: > > > > On 18-11-20 19:35:15, Mark Johnston wrote: > > > > > On Tue, Nov 20, 2018 at 10:49:19PM +0000, Ben Widawsky wrote: > > > > > > Author: bwidawsk > > > > > > Date: Tue Nov 20 22:49:19 2018 > > > > > > New Revision: 340709 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/340709 > > > > > > > > > > > > Log: > > > > > > linuxkpi: Add some basic swap functions > > > > > > > > > > > > These are used by kms-drm to determine various heuristics relate > > > > > > memory conditions. > > > > > > > > > > > > The number of free swap pages is just a variable, and it can be > > > > > > much cheaper by either adding a new getter, or simply extern'ing > > > > > > swap_total. However, this patch opts to use the more expensive, > > > > > > existing interface - since this isn't an operation in a high per > > > > > > path. > > > > > > > > > > > > This allows us to remove some more gpl linuxkpi and do the follo > > > > > > kms-drm: > > > > > > git rm linuxkpi/gplv2/include/linux/swap.h > > > > > > > > > > > > Reviewed by: mmacy, Johannes Lundberg > > > > > > Approved by: emaste (mentor) > > > > > > Differential Revision: https://reviews.freebsd.org/D18052 > > > > > > > > > > > > Added: > > > > > > head/sys/compat/linuxkpi/common/include/linux/swap.h (contents, props changed) > > > > > > Modified: > > > > > > head/sys/vm/vm_pageout.h > > > > > > head/sys/vm/vm_swapout.c > > > > > > > > > > > > [...] > > > > > > Modified: head/sys/vm/vm_swapout.c > > > > > > ============================================================================== > > > > > > --- head/sys/vm/vm_swapout.c Tue Nov 20 22:24:18 2018 (r340708) > > > > > > +++ head/sys/vm/vm_swapout.c Tue Nov 20 22:49:19 2018 (r340709) > > > > > > @@ -961,3 +961,10 @@ swapout(struct proc *p) > > > > > > p->p_swtick = ticks; > > > > > > return (0); > > > > > > } > > > > > > + > > > > > > +/* Used to determine if the current process is itself the reaper. */ > > > > > > +bool > > > > > > +vm_curproc_is_vmproc(void) > > > > > > +{ > > > > > > + return curproc == vmproc; > > > > > > +} > > > > > > > > > > From a look at how this is used, it should probably be pageproc rather > > > > > than vmproc. There are various code paths that just check > > > > > curproc == pageproc inline. > > > > > > > > > > > > > Could I trouble you for a quick explanation of the difference between the two? > > > > > > pageproc contains the page daemon and laundry threads, which are > > > responsible for managing the LRU page queues and writing back dirty > > > pages. vmproc's main task is to swap out kernel stacks when the system > > > is under memory pressure, and swap them back in when necessary. It's a > > > somewhat legacy component of the system and isn't required. You can > > > build a kernel without it by specifying "options NO_SWAPPING" (which is > > > a somewhat misleading name), in which vm_swapout_dummy.c is compiled > > > instead of vm_swapout.c. > > > > > > > Thanks for the explanation. I indeed want the page daemon. I will put up a patch > > to do that the correct way. Thanks. > > What is the intent ? If the goal is to avoid wait for memory in > deadlock- prone contexts, then you perhaps want to return true for both > pagedaemon and vm daemon, and might be even the buf daemon threads as > well. In this case it's used to enable more aggressive shrinking of GEM objects. The function in question is invoked via a lowmem eventhandler, so the page daemon may indeed be the caller. From owner-svn-src-head@freebsd.org Wed Nov 21 18:18:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C9191140DA5; Wed, 21 Nov 2018 18:18:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE9E76EA4B; Wed, 21 Nov 2018 18:18:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F88723F6A; Wed, 21 Nov 2018 18:18:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALIIvjG086487; Wed, 21 Nov 2018 18:18:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALIIvtQ086486; Wed, 21 Nov 2018 18:18:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201811211818.wALIIvtQ086486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 21 Nov 2018 18:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340737 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 340737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE9E76EA4B X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_SHORT(0.33)[0.327,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:18:58 -0000 Author: mav Date: Wed Nov 21 18:18:57 2018 New Revision: 340737 URL: https://svnweb.freebsd.org/changeset/base/340737 Log: Revert r340096: 9952 Block size change during zfs receive drops spill block It was reported, and I easily reproduced it, that this change triggers panic when receiving replication stream with enabled embedded blocks, when short file compressing into one embedded block changes its block size. I am not sure that the problem is in this particuler patch, not just triggered by it, but since investigation and fix will take some time, I've decided to revert this for now. PR: 198457, 233277 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Nov 21 17:47:40 2018 (r340736) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Nov 21 18:18:57 2018 (r340737) @@ -2143,7 +2143,6 @@ receive_object(struct receive_writer_arg *rwa, struct { dmu_object_info_t doi; dmu_tx_t *tx; - dmu_buf_t *db; uint64_t object; int err; @@ -2191,14 +2190,12 @@ receive_object(struct receive_writer_arg *rwa, struct tx = dmu_tx_create(rwa->os); dmu_tx_hold_bonus(tx, object); - dmu_tx_hold_write(tx, object, 0, 0); err = dmu_tx_assign(tx, TXG_WAIT); if (err != 0) { dmu_tx_abort(tx); return (err); } - db = NULL; if (object == DMU_NEW_OBJECT) { /* currently free, want to be allocated */ err = dmu_object_claim_dnsize(rwa->os, drro->drr_object, @@ -2206,33 +2203,15 @@ receive_object(struct receive_writer_arg *rwa, struct drro->drr_bonustype, drro->drr_bonuslen, drro->drr_dn_slots << DNODE_SHIFT, tx); } else if (drro->drr_type != doi.doi_type || - (drro->drr_blksz != doi.doi_data_block_size && - doi.doi_max_offset > doi.doi_data_block_size)) { + drro->drr_blksz != doi.doi_data_block_size || + drro->drr_bonustype != doi.doi_bonus_type || + drro->drr_bonuslen != doi.doi_bonus_size) { /* currently allocated, but with different properties */ err = dmu_object_reclaim(rwa->os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen, tx); - } else { - /* - * Currently allocated, but with slightly different properties, - * that may change live, like block size or bonus buffer. - * Change those specifically to not loose the spill block, etc. - */ - if (drro->drr_bonustype != doi.doi_bonus_type || - drro->drr_bonuslen != doi.doi_bonus_size) - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, - &db)); - if (drro->drr_bonustype != doi.doi_bonus_type) - VERIFY0(dmu_set_bonustype(db, drro->drr_bonustype, tx)); - if (drro->drr_bonuslen != doi.doi_bonus_size) - VERIFY0(dmu_set_bonus(db, drro->drr_bonuslen, tx)); - if (drro->drr_blksz != doi.doi_data_block_size) - err = dmu_object_set_blocksize(rwa->os, drro->drr_object, - drro->drr_blksz, 0, tx); } if (err != 0) { - if (db != NULL) - dmu_buf_rele(db, FTAG); dmu_tx_commit(tx); return (SET_ERROR(EINVAL)); } @@ -2243,9 +2222,9 @@ receive_object(struct receive_writer_arg *rwa, struct drro->drr_compress, tx); if (data != NULL) { - if (db == NULL) - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, - &db)); + dmu_buf_t *db; + + VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, &db)); dmu_buf_will_dirty(db, tx); ASSERT3U(db->db_size, >=, drro->drr_bonuslen); @@ -2256,9 +2235,8 @@ receive_object(struct receive_writer_arg *rwa, struct dmu_ot_byteswap[byteswap].ob_func(db->db_data, drro->drr_bonuslen); } - } - if (db != NULL) dmu_buf_rele(db, FTAG); + } dmu_tx_commit(tx); return (0); From owner-svn-src-head@freebsd.org Wed Nov 21 18:19:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8E851140DD3; Wed, 21 Nov 2018 18:19:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 420986EB79; Wed, 21 Nov 2018 18:19:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A00823F6D; Wed, 21 Nov 2018 18:19:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALIJF2H086573; Wed, 21 Nov 2018 18:19:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALIJFGF086572; Wed, 21 Nov 2018 18:19:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811211819.wALIJFGF086572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 21 Nov 2018 18:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340738 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 340738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 420986EB79 X-Spamd-Result: default: False [0.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.33)[0.327,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:19:17 -0000 Author: tuexen Date: Wed Nov 21 18:19:15 2018 New Revision: 340738 URL: https://svnweb.freebsd.org/changeset/base/340738 Log: Improve two KASSERTs in the TCP RACK stack. There are two locations where an always true comparison was made in a KASSERT. Replace this by an appropriate check and use a consistent panic message. Also use this code when checking a similar condition. PR: 229664 Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18021 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Nov 21 18:18:57 2018 (r340737) +++ head/sys/netinet/tcp_stacks/rack.c Wed Nov 21 18:19:15 2018 (r340738) @@ -7053,12 +7053,10 @@ again: tlen = rsm->r_end - rsm->r_start; if (tlen > tp->t_maxseg) tlen = tp->t_maxseg; -#ifdef INVARIANTS - if (SEQ_GT(tp->snd_una, rsm->r_start)) { - panic("tp:%p rack:%p snd_una:%u rsm:%p r_start:%u", - tp, rack, tp->snd_una, rsm, rsm->r_start); - } -#endif + KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start), + ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p", + __func__, __LINE__, + rsm->r_start, tp->snd_una, tp, rack, rsm)); sb_offset = rsm->r_start - tp->snd_una; cwin = min(tp->snd_wnd, tlen); len = cwin; @@ -7069,12 +7067,14 @@ again: len = rsm->r_end - rsm->r_start; sack_rxmit = 1; sendalot = 0; + KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start), + ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p", + __func__, __LINE__, + rsm->r_start, tp->snd_una, tp, rack, rsm)); sb_offset = rsm->r_start - tp->snd_una; if (len >= tp->t_maxseg) { len = tp->t_maxseg; } - KASSERT(sb_offset >= 0, ("%s: sack block to the left of una : %d", - __func__, sb_offset)); } else if ((rack->rc_in_persist == 0) && ((rsm = tcp_rack_output(tp, rack, cts)) != NULL)) { long tlen; @@ -7099,6 +7099,10 @@ again: } #endif tlen = rsm->r_end - rsm->r_start; + KASSERT(SEQ_LEQ(tp->snd_una, rsm->r_start), + ("%s:%d: r.start:%u < SND.UNA:%u; tp:%p, rack:%p, rsm:%p", + __func__, __LINE__, + rsm->r_start, tp->snd_una, tp, rack, rsm)); sb_offset = rsm->r_start - tp->snd_una; if (tlen > rack->r_ctl.rc_prr_sndcnt) { len = rack->r_ctl.rc_prr_sndcnt; @@ -7120,8 +7124,6 @@ again: goto just_return_nolock; } } - KASSERT(sb_offset >= 0, ("%s: sack block to the left of una : %d", - __func__, sb_offset)); if (len > 0) { sub_from_prr = 1; sack_rxmit = 1; From owner-svn-src-head@freebsd.org Wed Nov 21 18:56:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C858A1141FE7; Wed, 21 Nov 2018 18:56:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7154A705B1; Wed, 21 Nov 2018 18:56:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53D0E24618; Wed, 21 Nov 2018 18:56:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALIuGmT006946; Wed, 21 Nov 2018 18:56:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALIuFvk006942; Wed, 21 Nov 2018 18:56:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811211856.wALIuFvk006942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 18:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340742 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7154A705B1 X-Spamd-Result: default: False [0.79 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.516,0]; NEURAL_SPAM_MEDIUM(0.27)[0.274,0]; NEURAL_SPAM_LONG(0.00)[0.004,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:56:17 -0000 Author: mjg Date: Wed Nov 21 18:56:15 2018 New Revision: 340742 URL: https://svnweb.freebsd.org/changeset/base/340742 Log: proc: implement pid hash locks and an iterator forks, exits and waits are frequently stalled during poudriere -j 128 runs due to killpg and process list exports performed for each package. Both uses take the allproc lock. The latter case can be modified to iterate over the hash with finer grained locking instead. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17817 Modified: head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Nov 21 18:54:38 2018 (r340741) +++ head/sys/kern/kern_exit.c Wed Nov 21 18:56:15 2018 (r340742) @@ -435,7 +435,6 @@ exit1(struct thread *td, int rval, int signo) sx_xlock(&allproc_lock); LIST_REMOVE(p, p_list); LIST_INSERT_HEAD(&zombproc, p, p_list); - LIST_REMOVE(p, p_hash); sx_xunlock(&allproc_lock); /* @@ -876,6 +875,9 @@ proc_reap(struct thread *td, struct proc *p, int *stat sx_xlock(&allproc_lock); LIST_REMOVE(p, p_list); /* off zombproc */ sx_xunlock(&allproc_lock); + sx_xlock(PIDHASHLOCK(p->p_pid)); + LIST_REMOVE(p, p_hash); + sx_xunlock(PIDHASHLOCK(p->p_pid)); LIST_REMOVE(p, p_sibling); reaper_abandon_children(p, true); LIST_REMOVE(p, p_reapsibling); Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Nov 21 18:54:38 2018 (r340741) +++ head/sys/kern/kern_fork.c Wed Nov 21 18:56:15 2018 (r340742) @@ -406,7 +406,9 @@ do_fork(struct thread *td, struct fork_req *fr, struct AUDIT_ARG_PID(p2->p_pid); LIST_INSERT_HEAD(&allproc, p2, p_list); allproc_gen++; + sx_xlock(PIDHASHLOCK(p2->p_pid)); LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); + sx_xunlock(PIDHASHLOCK(p2->p_pid)); PROC_LOCK(p2); PROC_LOCK(p1); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Nov 21 18:54:38 2018 (r340741) +++ head/sys/kern/kern_proc.c Wed Nov 21 18:56:15 2018 (r340742) @@ -118,7 +118,9 @@ static struct proc *zpfind_locked(pid_t pid); * Other process lists */ struct pidhashhead *pidhashtbl; +struct sx *pidhashtbl_lock; u_long pidhash; +u_long pidhashlock; struct pgrphashhead *pgrphashtbl; u_long pgrphash; struct proclist allproc; @@ -173,6 +175,7 @@ CTASSERT(sizeof(struct kinfo_proc32) == KINFO_PROC32_S void procinit(void) { + u_long i; sx_init(&allproc_lock, "allproc"); sx_init(&proctree_lock, "proctree"); @@ -180,6 +183,13 @@ procinit(void) LIST_INIT(&allproc); LIST_INIT(&zombproc); pidhashtbl = hashinit(maxproc / 4, M_PROC, &pidhash); + pidhashlock = (pidhash + 1) / 64; + if (pidhashlock > 0) + pidhashlock--; + pidhashtbl_lock = malloc(sizeof(*pidhashtbl_lock) * (pidhashlock + 1), + M_PROC, M_WAITOK | M_ZERO); + for (i = 0; i < pidhashlock + 1; i++) + sx_init(&pidhashtbl_lock[i], "pidhash"); pgrphashtbl = hashinit(maxproc / 4, M_PROC, &pgrphash); proc_zone = uma_zcreate("PROC", sched_sizeof_proc(), proc_ctor, proc_dtor, proc_init, proc_fini, @@ -306,7 +316,7 @@ pfind_locked(pid_t pid) LIST_FOREACH(p, PIDHASH(pid), p_hash) { if (p->p_pid == pid) { PROC_LOCK(p); - if (p->p_state == PRS_NEW) { + if (p->p_state == PRS_NEW || p->p_state == PRS_ZOMBIE) { PROC_UNLOCK(p); p = NULL; } @@ -1421,13 +1431,134 @@ sysctl_out_proc(struct proc *p, struct sysctl_req *req return (0); } +int +proc_iterate(int (*cb)(struct proc *, void *), void *cbarg) +{ + struct proc *p; + int error, i, j; + + for (i = 0; i < pidhashlock + 1; i++) { + sx_slock(&pidhashtbl_lock[i]); + for (j = i; j <= pidhash; j += pidhashlock + 1) { + LIST_FOREACH(p, &pidhashtbl[j], p_hash) { + if (p->p_state == PRS_NEW) + continue; + error = cb(p, cbarg); + PROC_LOCK_ASSERT(p, MA_NOTOWNED); + if (error != 0) { + sx_sunlock(&pidhashtbl_lock[i]); + return (error); + } + } + } + sx_sunlock(&pidhashtbl_lock[i]); + } + return (0); +} + +struct kern_proc_out_args { + struct sysctl_req *req; + int flags; + int oid_number; + int *name; +}; + static int +sysctl_kern_proc_iterate(struct proc *p, void *origarg) +{ + struct kern_proc_out_args *arg = origarg; + int *name = arg->name; + int oid_number = arg->oid_number; + int flags = arg->flags; + struct sysctl_req *req = arg->req; + int error = 0; + + PROC_LOCK(p); + + KASSERT(p->p_ucred != NULL, + ("process credential is NULL for non-NEW proc")); + /* + * Show a user only appropriate processes. + */ + if (p_cansee(curthread, p)) + goto skip; + /* + * TODO - make more efficient (see notes below). + * do by session. + */ + switch (oid_number) { + + case KERN_PROC_GID: + if (p->p_ucred->cr_gid != (gid_t)name[0]) + goto skip; + break; + + case KERN_PROC_PGRP: + /* could do this by traversing pgrp */ + if (p->p_pgrp == NULL || + p->p_pgrp->pg_id != (pid_t)name[0]) + goto skip; + break; + + case KERN_PROC_RGID: + if (p->p_ucred->cr_rgid != (gid_t)name[0]) + goto skip; + break; + + case KERN_PROC_SESSION: + if (p->p_session == NULL || + p->p_session->s_sid != (pid_t)name[0]) + goto skip; + break; + + case KERN_PROC_TTY: + if ((p->p_flag & P_CONTROLT) == 0 || + p->p_session == NULL) + goto skip; + /* XXX proctree_lock */ + SESS_LOCK(p->p_session); + if (p->p_session->s_ttyp == NULL || + tty_udev(p->p_session->s_ttyp) != + (dev_t)name[0]) { + SESS_UNLOCK(p->p_session); + goto skip; + } + SESS_UNLOCK(p->p_session); + break; + + case KERN_PROC_UID: + if (p->p_ucred->cr_uid != (uid_t)name[0]) + goto skip; + break; + + case KERN_PROC_RUID: + if (p->p_ucred->cr_ruid != (uid_t)name[0]) + goto skip; + break; + + case KERN_PROC_PROC: + break; + + default: + break; + + } + error = sysctl_out_proc(p, req, flags); + PROC_LOCK_ASSERT(p, MA_NOTOWNED); + return (error); +skip: + PROC_UNLOCK(p); + return (0); +} + +static int sysctl_kern_proc(SYSCTL_HANDLER_ARGS) { + struct kern_proc_out_args iterarg; int *name = (int *)arg1; u_int namelen = arg2; struct proc *p; - int flags, doingzomb, oid_number; + int flags, oid_number; int error = 0; oid_number = oidp->oid_number; @@ -1479,112 +1610,11 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); } - sx_slock(&allproc_lock); - for (doingzomb=0 ; doingzomb < 2 ; doingzomb++) { - if (!doingzomb) - p = LIST_FIRST(&allproc); - else - p = LIST_FIRST(&zombproc); - for (; p != NULL; p = LIST_NEXT(p, p_list)) { - /* - * Skip embryonic processes. - */ - if (p->p_state == PRS_NEW) - continue; - PROC_LOCK(p); - KASSERT(p->p_ucred != NULL, - ("process credential is NULL for non-NEW proc")); - /* - * Show a user only appropriate processes. - */ - if (p_cansee(curthread, p)) { - PROC_UNLOCK(p); - continue; - } - /* - * TODO - make more efficient (see notes below). - * do by session. - */ - switch (oid_number) { - - case KERN_PROC_GID: - if (p->p_ucred->cr_gid != (gid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_PGRP: - /* could do this by traversing pgrp */ - if (p->p_pgrp == NULL || - p->p_pgrp->pg_id != (pid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_RGID: - if (p->p_ucred->cr_rgid != (gid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_SESSION: - if (p->p_session == NULL || - p->p_session->s_sid != (pid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_TTY: - if ((p->p_flag & P_CONTROLT) == 0 || - p->p_session == NULL) { - PROC_UNLOCK(p); - continue; - } - /* XXX proctree_lock */ - SESS_LOCK(p->p_session); - if (p->p_session->s_ttyp == NULL || - tty_udev(p->p_session->s_ttyp) != - (dev_t)name[0]) { - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); - continue; - } - SESS_UNLOCK(p->p_session); - break; - - case KERN_PROC_UID: - if (p->p_ucred->cr_uid != (uid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_RUID: - if (p->p_ucred->cr_ruid != (uid_t)name[0]) { - PROC_UNLOCK(p); - continue; - } - break; - - case KERN_PROC_PROC: - break; - - default: - break; - - } - - error = sysctl_out_proc(p, req, flags); - if (error) - goto out; - } - } -out: - sx_sunlock(&allproc_lock); + iterarg.flags = flags; + iterarg.oid_number = oid_number; + iterarg.req = req; + iterarg.name = name; + error = proc_iterate(sysctl_kern_proc_iterate, &iterarg); return (error); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Nov 21 18:54:38 2018 (r340741) +++ head/sys/sys/proc.h Wed Nov 21 18:56:15 2018 (r340742) @@ -942,8 +942,11 @@ extern pid_t pid_max; #define THREAD_CAN_SLEEP() ((curthread)->td_no_sleeping == 0) #define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash]) +#define PIDHASHLOCK(pid) (&pidhashtbl_lock[((pid) & pidhashlock)]) extern LIST_HEAD(pidhashhead, proc) *pidhashtbl; +extern struct sx *pidhashtbl_lock; extern u_long pidhash; +extern u_long pidhashlock; #define TIDHASH(tid) (&tidhashtbl[(tid) & tidhash]) extern LIST_HEAD(tidhashhead, thread) *tidhashtbl; extern u_long tidhash; @@ -1046,6 +1049,7 @@ int proc_getargv(struct thread *td, struct proc *p, st int proc_getauxv(struct thread *td, struct proc *p, struct sbuf *sb); int proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb); void procinit(void); +int proc_iterate(int (*cb)(struct proc *, void *), void *cbarg); void proc_linkup0(struct proc *p, struct thread *td); void proc_linkup(struct proc *p, struct thread *td); struct proc *proc_realparent(struct proc *child); From owner-svn-src-head@freebsd.org Wed Nov 21 19:01:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CAE5114235E; Wed, 21 Nov 2018 19:01:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.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 8A13070AAE; Wed, 21 Nov 2018 19:01:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wALJ1koe073354; Wed, 21 Nov 2018 11:01:46 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wALJ1k9U073353; Wed, 21 Nov 2018 11:01:46 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811211901.wALJ1k9U073353@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340737 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <201811211818.wALIIvtQ086486@repo.freebsd.org> To: Alexander Motin Date: Wed, 21 Nov 2018 11:01:46 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@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: 8A13070AAE X-Spamd-Result: default: False [2.28 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.50)[0.497,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(0.30)[0.301,0]; AUTH_NA(1.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.61)[0.610,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 19:01:48 -0000 > Author: mav > Date: Wed Nov 21 18:18:57 2018 > New Revision: 340737 > URL: https://svnweb.freebsd.org/changeset/base/340737 > > Log: > Revert r340096: 9952 Block size change during zfs receive drops spill block > > It was reported, and I easily reproduced it, that this change triggers panic > when receiving replication stream with enabled embedded blocks, when short > file compressing into one embedded block changes its block size. I am not > sure that the problem is in this particuler patch, not just triggered by it, > but since investigation and fix will take some time, I've decided to revert > this for now. > > PR: 198457, 233277 Is there any impact to stable/12, and more specifically, releng/12? Thanks, Rod > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Nov 21 17:47:40 2018 (r340736) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Nov 21 18:18:57 2018 (r340737) > @@ -2143,7 +2143,6 @@ receive_object(struct receive_writer_arg *rwa, struct > { > dmu_object_info_t doi; > dmu_tx_t *tx; > - dmu_buf_t *db; > uint64_t object; > int err; > > @@ -2191,14 +2190,12 @@ receive_object(struct receive_writer_arg *rwa, struct > > tx = dmu_tx_create(rwa->os); > dmu_tx_hold_bonus(tx, object); > - dmu_tx_hold_write(tx, object, 0, 0); > err = dmu_tx_assign(tx, TXG_WAIT); > if (err != 0) { > dmu_tx_abort(tx); > return (err); > } > > - db = NULL; > if (object == DMU_NEW_OBJECT) { > /* currently free, want to be allocated */ > err = dmu_object_claim_dnsize(rwa->os, drro->drr_object, > @@ -2206,33 +2203,15 @@ receive_object(struct receive_writer_arg *rwa, struct > drro->drr_bonustype, drro->drr_bonuslen, > drro->drr_dn_slots << DNODE_SHIFT, tx); > } else if (drro->drr_type != doi.doi_type || > - (drro->drr_blksz != doi.doi_data_block_size && > - doi.doi_max_offset > doi.doi_data_block_size)) { > + drro->drr_blksz != doi.doi_data_block_size || > + drro->drr_bonustype != doi.doi_bonus_type || > + drro->drr_bonuslen != doi.doi_bonus_size) { > /* currently allocated, but with different properties */ > err = dmu_object_reclaim(rwa->os, drro->drr_object, > drro->drr_type, drro->drr_blksz, > drro->drr_bonustype, drro->drr_bonuslen, tx); > - } else { > - /* > - * Currently allocated, but with slightly different properties, > - * that may change live, like block size or bonus buffer. > - * Change those specifically to not loose the spill block, etc. > - */ > - if (drro->drr_bonustype != doi.doi_bonus_type || > - drro->drr_bonuslen != doi.doi_bonus_size) > - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, > - &db)); > - if (drro->drr_bonustype != doi.doi_bonus_type) > - VERIFY0(dmu_set_bonustype(db, drro->drr_bonustype, tx)); > - if (drro->drr_bonuslen != doi.doi_bonus_size) > - VERIFY0(dmu_set_bonus(db, drro->drr_bonuslen, tx)); > - if (drro->drr_blksz != doi.doi_data_block_size) > - err = dmu_object_set_blocksize(rwa->os, drro->drr_object, > - drro->drr_blksz, 0, tx); > } > if (err != 0) { > - if (db != NULL) > - dmu_buf_rele(db, FTAG); > dmu_tx_commit(tx); > return (SET_ERROR(EINVAL)); > } > @@ -2243,9 +2222,9 @@ receive_object(struct receive_writer_arg *rwa, struct > drro->drr_compress, tx); > > if (data != NULL) { > - if (db == NULL) > - VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, > - &db)); > + dmu_buf_t *db; > + > + VERIFY0(dmu_bonus_hold(rwa->os, drro->drr_object, FTAG, &db)); > dmu_buf_will_dirty(db, tx); > > ASSERT3U(db->db_size, >=, drro->drr_bonuslen); > @@ -2256,9 +2235,8 @@ receive_object(struct receive_writer_arg *rwa, struct > dmu_ot_byteswap[byteswap].ob_func(db->db_data, > drro->drr_bonuslen); > } > - } > - if (db != NULL) > dmu_buf_rele(db, FTAG); > + } > dmu_tx_commit(tx); > > return (0); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Nov 21 19:05:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8707311424BE; Wed, 21 Nov 2018 19:05:25 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw1-xc32.google.com (mail-yw1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB4C670D89; Wed, 21 Nov 2018 19:05:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yw1-xc32.google.com with SMTP id d190so2667757ywd.12; Wed, 21 Nov 2018 11:05:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=64NlGH0Ok5DqNM9COGRGpuSwHcge1VpBQUJPzQ5TQ1U=; b=Zk0F3uS0fAN7Kknf0cqTcATNsbdKwMzeVu1snxP6Dbg3BoJwg5hQ0xlYOw9it3oDRn aCxlvYLJ/MWL2uMg9WtKkQAW7dHxN0QkklL0ocNLnAMyCkfMDfMs6Y2RIHCyRPwYP7SM dR2GRPJwH62bvtaHZv5dITKWKlIdo+BxWDpWnXJ640xvYqTfqD5gMB8zLCAMPCalfGSQ JKJblt/XHm6FU78D4TLiuH+lnvy2IehcuY56loCUDJZU5jOfnEObJv68zM2TnWFaQ309 t5yH0ngWBvipToP01na8Me07ZAb4RT6OpxBJcW3m25AS7CG8fjU0bJGWPXIgEHXb+7RZ Borg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=64NlGH0Ok5DqNM9COGRGpuSwHcge1VpBQUJPzQ5TQ1U=; b=H6x30gm/tmMkgP1EYX0zRUk62UoP4aj8FJ82NWyrlP+3RzKK5fbyN0ryMGQDvkjpSE vKgJ3R3XJ+bLckhzxd8eH9cYbuEqbcsXus9LOwLohYmgKG+5d+ckaEs/g9ztr72Nf+nC JSDBKAVjQ+MvLx9sjMOiOPiIlmHSfUoNsq4s9iKq7pjfkezEpTT53t/nDbuy5CwRNIG0 p2KUkTo4n8CE4y0MPCoG7+VWtfdUFmUKNE1Mtoz0/IeVmlWxFFLwtMCedUxRRT8uWZdC vMTMM2vrReKcPhc5oYuiqrxIkdH+bo2+zT9RHw85PGjuFRcU8+Sj5YgmQzbcWjK6Oq3V iCkQ== X-Gm-Message-State: AGRZ1gJ4YEE3AXg/3knHVvZxuzQZRod0o7ZDUYIWoA41ZCQOGBlm0NlJ eJxuvpxsYTRZzbui7B7reOYmL3HO5bo= X-Google-Smtp-Source: AJdET5eC58b+VXsPGypXFFcOmzoWNZ2oySMKAF3cbQnf40jY5k00nva4OBf/XI1Lv7ScAx6ieIkojQ== X-Received: by 2002:a81:29d5:: with SMTP id p204mr7776359ywp.285.1542827123657; Wed, 21 Nov 2018 11:05:23 -0800 (PST) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id 207-v6sm12087561ywi.0.2018.11.21.11.05.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 11:05:23 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r340737 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201811211901.wALJ1k9U073353@pdx.rh.CN85.dnsmgr.net> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <9f086b68-35b0-a34d-74b9-adf3f9af4765@FreeBSD.org> Date: Wed, 21 Nov 2018 14:05:22 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201811211901.wALJ1k9U073353@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DB4C670D89 X-Spamd-Result: default: False [-3.91 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.80)[ipnet: 2607:f8b0::/32(-2.34), asn: 15169(-1.56), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.3.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.91)[-0.910,0]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 19:05:25 -0000 On 21.11.2018 14:01, Rodney W. Grimes wrote: >> Author: mav >> Date: Wed Nov 21 18:18:57 2018 >> New Revision: 340737 >> URL: https://svnweb.freebsd.org/changeset/base/340737 >> >> Log: >> Revert r340096: 9952 Block size change during zfs receive drops spill block >> >> It was reported, and I easily reproduced it, that this change triggers panic >> when receiving replication stream with enabled embedded blocks, when short >> file compressing into one embedded block changes its block size. I am not >> sure that the problem is in this particuler patch, not just triggered by it, >> but since investigation and fix will take some time, I've decided to revert >> this for now. >> >> PR: 198457, 233277 > > Is there any impact to stable/12, and more specifically, releng/12? No. This code was committed to head after the stable/12 branched, and I was just going to merge it when the new problem was reported. -- Alexander Motin From owner-svn-src-head@freebsd.org Wed Nov 21 20:15:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 236D211449B8; Wed, 21 Nov 2018 20:15:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA7EA73CEB; Wed, 21 Nov 2018 20:15:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9999B253BC; Wed, 21 Nov 2018 20:15:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALKFvjL048406; Wed, 21 Nov 2018 20:15:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALKFuns048402; Wed, 21 Nov 2018 20:15:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811212015.wALKFuns048402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 20:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340744 - in head/sys: fs/nfsclient fs/pseudofs kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/nfsclient fs/pseudofs kern sys X-SVN-Commit-Revision: 340744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA7EA73CEB X-Spamd-Result: default: False [0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.004,0]; NEURAL_SPAM_SHORT(0.52)[0.525,0]; NEURAL_SPAM_MEDIUM(0.27)[0.274,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 20:15:58 -0000 Author: mjg Date: Wed Nov 21 20:15:56 2018 New Revision: 340744 URL: https://svnweb.freebsd.org/changeset/base/340744 Log: proc: convert pfind & friends to use pidhash locks and other cleanup pfind_locked is retired as it relied on allproc which unnecessarily restricts locking of the hash. Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Wed Nov 21 19:49:21 2018 (r340743) +++ head/sys/fs/nfsclient/nfs_clport.c Wed Nov 21 20:15:56 2018 (r340744) @@ -1157,7 +1157,7 @@ nfscl_procdoesntexist(u_int8_t *own) tl.cval[2] = *own++; tl.cval[3] = *own++; pid = tl.lval; - p = pfind_locked(pid); + p = pfind(pid); if (p == NULL) return (1); if (p->p_stats == NULL) { Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 21 19:49:21 2018 (r340743) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 21 20:15:56 2018 (r340744) @@ -107,7 +107,7 @@ pfs_visible_proc(struct thread *td, struct pfs_node *p static int pfs_visible(struct thread *td, struct pfs_node *pn, pid_t pid, - bool allproc_locked, struct proc **p) + struct proc **p) { struct proc *proc; @@ -118,7 +118,7 @@ pfs_visible(struct thread *td, struct pfs_node *pn, pi *p = NULL; if (pid == NO_PID) PFS_RETURN (1); - proc = allproc_locked ? pfind_locked(pid) : pfind(pid); + proc = pfind(pid); if (proc == NULL) PFS_RETURN (0); if (pfs_visible_proc(td, pn, proc)) { @@ -206,7 +206,7 @@ pfs_getattr(struct vop_getattr_args *va) PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, &proc)) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) PFS_RETURN (ENOENT); vap->va_type = vn->v_type; @@ -297,7 +297,7 @@ pfs_ioctl(struct vop_ioctl_args *va) * This is necessary because process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, &proc)) { + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) { VOP_UNLOCK(vn, 0); PFS_RETURN (EIO); } @@ -330,7 +330,7 @@ pfs_getextattr(struct vop_getextattr_args *va) * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, &proc)) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) PFS_RETURN (EIO); if (pn->pn_getextattr == NULL) @@ -466,7 +466,7 @@ pfs_lookup(struct vop_cachedlookup_args *va) PFS_RETURN (ENOENT); /* check that parent directory is visible... */ - if (!pfs_visible(curthread, pd, pvd->pvd_pid, false, NULL)) + if (!pfs_visible(curthread, pd, pvd->pvd_pid, NULL)) PFS_RETURN (ENOENT); /* self */ @@ -550,7 +550,7 @@ pfs_lookup(struct vop_cachedlookup_args *va) got_pnode: pfs_assert_not_owned(pd); pfs_assert_not_owned(pn); - visible = pfs_visible(curthread, pn, pid, false, NULL); + visible = pfs_visible(curthread, pn, pid, NULL); if (!visible) { error = ENOENT; goto failed; @@ -639,7 +639,7 @@ pfs_read(struct vop_read_args *va) * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, &proc)) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) PFS_RETURN (EIO); if (proc != NULL) { _PHOLD(proc); @@ -795,7 +795,7 @@ pfs_readdir(struct vop_readdir_args *va) pfs_lock(pd); /* check if the directory is visible to the caller */ - if (!pfs_visible(curthread, pd, pid, true, &proc)) { + if (!pfs_visible(curthread, pd, pid, &proc)) { sx_sunlock(&allproc_lock); pfs_unlock(pd); PFS_RETURN (ENOENT); @@ -1001,7 +1001,7 @@ pfs_write(struct vop_write_args *va) * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, false, &proc)) + if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) PFS_RETURN (EIO); if (proc != NULL) { _PHOLD(proc); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Nov 21 19:49:21 2018 (r340743) +++ head/sys/kern/kern_proc.c Wed Nov 21 20:15:56 2018 (r340744) @@ -112,7 +112,6 @@ static void proc_dtor(void *mem, int size, void *arg); static int proc_init(void *mem, int size, int flags); static void proc_fini(void *mem, int size); static void pargs_free(struct pargs *pa); -static struct proc *zpfind_locked(pid_t pid); /* * Other process lists @@ -307,45 +306,43 @@ inferior(struct proc *p) return (1); } -struct proc * -pfind_locked(pid_t pid) +/* + * Locate a process by number. + * + * By not returning processes in the PRS_NEW state, we allow callers to avoid + * testing for that condition to avoid dereferencing p_ucred, et al. + */ +static __always_inline struct proc * +_pfind(pid_t pid, bool zombie) { struct proc *p; - sx_assert(&allproc_lock, SX_LOCKED); + p = curproc; + if (p->p_pid == pid) { + PROC_LOCK(p); + return (p); + } + sx_slock(PIDHASHLOCK(pid)); LIST_FOREACH(p, PIDHASH(pid), p_hash) { if (p->p_pid == pid) { PROC_LOCK(p); - if (p->p_state == PRS_NEW || p->p_state == PRS_ZOMBIE) { + if (p->p_state == PRS_NEW || + (zombie && p->p_state == PRS_ZOMBIE)) { PROC_UNLOCK(p); p = NULL; } break; } } + sx_sunlock(PIDHASHLOCK(pid)); return (p); } -/* - * Locate a process by number; return only "live" processes -- i.e., neither - * zombies nor newly born but incompletely initialized processes. By not - * returning processes in the PRS_NEW state, we allow callers to avoid - * testing for that condition to avoid dereferencing p_ucred, et al. - */ struct proc * pfind(pid_t pid) { - struct proc *p; - p = curproc; - if (p->p_pid == pid) { - PROC_LOCK(p); - return (p); - } - sx_slock(&allproc_lock); - p = pfind_locked(pid); - sx_sunlock(&allproc_lock); - return (p); + return (_pfind(pid, false)); } /* @@ -354,24 +351,17 @@ pfind(pid_t pid) struct proc * pfind_any(pid_t pid) { - struct proc *p; - sx_slock(&allproc_lock); - p = pfind_locked(pid); - if (p == NULL) - p = zpfind_locked(pid); - sx_sunlock(&allproc_lock); - - return (p); + return (_pfind(pid, true)); } static struct proc * -pfind_tid_locked(pid_t tid) +pfind_tid(pid_t tid) { struct proc *p; struct thread *td; - sx_assert(&allproc_lock, SX_LOCKED); + sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); if (p->p_state == PRS_NEW) { @@ -385,6 +375,7 @@ pfind_tid_locked(pid_t tid) PROC_UNLOCK(p); } found: + sx_sunlock(&allproc_lock); return (p); } @@ -421,17 +412,15 @@ pget(pid_t pid, int flags, struct proc **pp) if (p->p_pid == pid) { PROC_LOCK(p); } else { - sx_slock(&allproc_lock); + p = NULL; if (pid <= PID_MAX) { - p = pfind_locked(pid); - if (p == NULL && (flags & PGET_NOTWEXIT) == 0) - p = zpfind_locked(pid); + if ((flags & PGET_NOTWEXIT) == 0) + p = pfind_any(pid); + else + p = pfind(pid); } else if ((flags & PGET_NOTID) == 0) { - p = pfind_tid_locked(pid); - } else { - p = NULL; + p = pfind_tid(pid); } - sx_sunlock(&allproc_lock); if (p == NULL) return (ESRCH); if ((flags & PGET_CANSEE) != 0) { @@ -1197,21 +1186,6 @@ pstats_free(struct pstats *ps) free(ps, M_SUBPROC); } -static struct proc * -zpfind_locked(pid_t pid) -{ - struct proc *p; - - sx_assert(&allproc_lock, SX_LOCKED); - LIST_FOREACH(p, &zombproc, p_list) { - if (p->p_pid == pid) { - PROC_LOCK(p); - break; - } - } - return (p); -} - /* * Locate a zombie process by number */ @@ -1221,7 +1195,12 @@ zpfind(pid_t pid) struct proc *p; sx_slock(&allproc_lock); - p = zpfind_locked(pid); + LIST_FOREACH(p, &zombproc, p_list) { + if (p->p_pid == pid) { + PROC_LOCK(p); + break; + } + } sx_sunlock(&allproc_lock); return (p); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Nov 21 19:49:21 2018 (r340743) +++ head/sys/sys/proc.h Wed Nov 21 20:15:56 2018 (r340744) @@ -981,7 +981,6 @@ extern struct uma_zone *proc_zone; struct proc *pfind(pid_t); /* Find process by id. */ struct proc *pfind_any(pid_t); /* Find (zombie) process by id. */ -struct proc *pfind_locked(pid_t pid); struct pgrp *pgfind(pid_t); /* Find process group by id. */ struct proc *zpfind(pid_t); /* Find zombie process by id. */ From owner-svn-src-head@freebsd.org Wed Nov 21 21:36:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FCE3114735A; Wed, 21 Nov 2018 21:36:34 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6103F77DC2; Wed, 21 Nov 2018 21:36:33 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-lj1-x236.google.com with SMTP id e5-v6so6143019lja.4; Wed, 21 Nov 2018 13:36:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PUlzcvY2b/Yl0PhH2juxGSjJII7zuqAuGxN+rtA98Ak=; b=AjfgXIx7dalOHWpeX7iCOr6PYM+S+mtL4HeaxEuIG/rv4mLptAeOX+VvBGGgOwlGM6 raAwQmen1apb/QFP0CuLH7ew/z2GXkG4xmomPDGlLarvAn2KuxcHC5aMSmjKTq+mKYNf nsdCox6ANuwReHbGpa3/kyGoGtOqTQavmYN739arHx/M4tP+mVwfpd6gGCTsqq0frnZF 7vgVCGp48tVNAYXLK3rcTQj8IpQmpwPeL60HvIG0LgjflWArM/Amv8V3HYMpd3fGbVtl S2RPQoE+5V19BWJvKrf1qnR07p4RgX0hXWSRl5SIoG1llO2Ej7Y3Admzo8cHbnGmGCNM NLAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=PUlzcvY2b/Yl0PhH2juxGSjJII7zuqAuGxN+rtA98Ak=; b=WHQ1uk3ldCgIPWRsD/SgVc99iesH9vgqd08XewUUCv6I8zPHqezbYWobDs4169mOeK JQ+FrwiAbxM9oiWyXn2I0jBF/WeHFcxd9lyMvrtuToOLjGZdUfuMb4TvoHsZPJdTPPEa UYfhHIyDmrwnUf0Klw3Zsn8McFub0G3azcQ9S6knQeU9ojmIkOQ3bvPO9YQE/FmhRr+j 3SES+dt7lx/xcGxKaWT/UeqOGqMsZwvx4P9/C40UcntV54wtULL+UqunBp/3c5Mt8Tv0 8u5Z0n9OWJtOnTqywoF17LkHHYc67M2uarQI0Nq13pPaWxYhefVCLc+0vIji6BYhe/FH rn7A== X-Gm-Message-State: AA+aEWby11g/44GSFT/4vJKBK73ik7IEFS/hdbgJ/1nEOQcKOWsv8CEi VIOBO4Hrrpype/9R2Kxz+dMPvcyF X-Google-Smtp-Source: AFSGD/Wt0rHU8E8jzbYDobDjvth9uimmbapGpakNwmuExtgy9kyp6rQq7m2EMDsMicZfgB/ijAVeYQ== X-Received: by 2002:a2e:83d7:: with SMTP id s23-v6mr5613247ljh.139.1542836191526; Wed, 21 Nov 2018 13:36:31 -0800 (PST) Received: from x-wing (87-206-170-77.dynamic.chello.pl. [87.206.170.77]) by smtp.gmail.com with ESMTPSA id h21sm6939194lfk.41.2018.11.21.13.36.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 13:36:30 -0800 (PST) Sender: Mariusz Zaborski Date: Wed, 21 Nov 2018 22:36:41 +0100 From: Mariusz Zaborski To: rgrimes@freebsd.org Cc: Kyle Evans , 0mp@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r340722 - head/lib/libbe Message-ID: <20181121213641.GA54339@x-wing> References: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 6103F77DC2 X-Spamd-Result: default: False [-5.44 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[oshogbo@freebsd.org,oshogbovx@gmail.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.65)[ipnet: 2a00:1450::/32(-1.58), asn: 15169(-1.57), country: US(-0.09)]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[oshogbo@freebsd.org,oshogbovx@gmail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[6.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MID_RHS_NOT_FQDN(0.50)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 21:36:34 -0000 --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 21, 2018 at 08:54:10AM -0800, Rodney W. Grimes wrote: > > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > > wrote: > > > > > > > Author: 0mp (ports committer) > > > > Date: Wed Nov 21 11:22:44 2018 > > > > New Revision: 340722 > > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > > > Log: > > > > libbe(3): Put each error value in separate line. > > > > > > > > As requested by a TODO in the source code. > > > > > > > > Reviewed by: bcr > > > > Approved by: krion (mentor, implicit), mat (mentor, implic= it) > > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > > > Who with a src bit approved the commit to src? > > > > >=20 > > I do want to clarify- bcr approved it in the review (explicitly with > > "... hereby approved!") -- are you mainly pointing out that he failed > > to annotate this properly in the commit, or is doc bit approval for a > > commit to a manpage in src insufficient? >=20 > That is defanitly a bit of a grey area, from reading and re-reading > the commit bit page it is clear that a doc committer can commit > to src documentation, it is not clear if they can approve a commit > by someone else to the src tree, it does say > ""Approved by" from a non-mentored committer > with the appropriate bit" >=20 > It probably would be fine to have said Approved by: bcr. >=20 > I still question what a out of scope commit that is > approved by: (mentor, implicit). I am not even sure > what that means in this context. Have his mentors > said he can commit anything anyplace without them > seeing it? If so then release the mentor/mentee bit > would be more appropriate? >=20 > >=20 > > As an aside, happy to approve any changes to these manpages as the > > current bectl/libbe maintainer for anyone that wants to improve them. > > =3D) >=20 > That defanitly would of been a cleaner path. C'mon guys. Mateusz is doing a great job with documentation - THANK YOU! I would be more outraged that we still didn't appreciate him. Thanks, --=20 Mariusz Zaborski oshogbo//vx | http://oshogbo.vexillium.org FreeBSD committer | https://freebsd.org Software developer | http://wheelsystems.com If it's not broken, let's fix it till it is!!1 --tThc/1wpZn/ma/RB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkD1x0xkJXVVY1Gwf38KEGuLGxWQFAlv1z+QACgkQ38KEGuLG xWQu6RAAlN0swKr+z/eS9xag31ZYazLY/jOtG0Ucdea5ZQ7LsAbd2csTZXf0daJh zaMl8+hlo5jHiDYI9+2VvOuZ0tjmS8QopkJ/BTm+SWi5/ELDVnOsfGkElnwsA6I8 L0+emkpVaCfZVHlYxuhWbb1FvvVztDk31OdmN0gqArUZ5znswJqIOdOEEph6qPnv 2E9RT/mkMKJKDi55b0lwkZ8RbpFmXo5bFUXtq2EwoWaZllXvtlYoxtxHlDHITauh 5E6yhnCk4DhEYfMGCKuF3cHqc1Z8qzPT7NxRaJoXbncVrgKWdfb/ubL2nigkLKyb CLRxqF7VaCnRaAn46J2EsKsoZWjPIijcImIckz/r7s0xy9Jtc52is5TTr5MzGnwR xB9b+iwp6nabjzpiYtHgScME5WDmLH4av0jOTnARic0Mi7eFQ66KYcScgWeSnlh0 4TkGN4yN2Fl8cenMzVaa82sGci5AAxEnffIc6SWTP3U+Nw8W492TNv+txvWkjsL4 L+mUqzIjxYjLtkucR/r3/3o1j5RYcmlT3cAM+Qu75nLviMxcwEg4yQCP8fhsNjji yuMHkx2oDow0yhVDPpeLCazEXzta8LgPer3pqZcXg38LWuaYvyh2OQh8AO5YwQCF gnF9qzG76BgKOmFpj6w0HSk/GdE5Kp2B1BJNXDfwS1NEDP9mDxk= =4BEr -----END PGP SIGNATURE----- --tThc/1wpZn/ma/RB-- From owner-svn-src-head@freebsd.org Wed Nov 21 21:46:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C8D61147890; Wed, 21 Nov 2018 21:46:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3ADF784E0; Wed, 21 Nov 2018 21:46:06 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4D3C2629D; Wed, 21 Nov 2018 21:46:06 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALLk6GQ097256; Wed, 21 Nov 2018 21:46:06 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALLk6WS097255; Wed, 21 Nov 2018 21:46:06 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201811212146.wALLk6WS097255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Wed, 21 Nov 2018 21:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340745 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 340745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C3ADF784E0 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.264,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 21:46:07 -0000 Author: sobomax Date: Wed Nov 21 21:46:06 2018 New Revision: 340745 URL: https://svnweb.freebsd.org/changeset/base/340745 Log: Fix CU: output of the --debug-dump=decodedline, the problem there is that both file name and current directory is recorded, however file name sometimes already contains absolute path. In which case prefixing it with directory name results in an invalid pathname. Only append directory name if the file name does not start with '/'. This seems to DTRT. Approved by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18290 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Nov 21 20:15:56 2018 (r340744) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Nov 21 21:46:06 2018 (r340745) @@ -4720,7 +4720,7 @@ dump_dwarf_line_decoded(struct readelf *re) DW_DLV_OK) dir = NULL; printf("CU: "); - if (dir && file) + if (dir && file && file[0] != '/') printf("%s/", dir); if (file) printf("%s", file); From owner-svn-src-head@freebsd.org Wed Nov 21 21:48:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CE5D1147A05; Wed, 21 Nov 2018 21:48:03 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7DDF786B0; Wed, 21 Nov 2018 21:48:02 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98BF8262A4; Wed, 21 Nov 2018 21:48:02 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALLm2N7097376; Wed, 21 Nov 2018 21:48:02 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALLm2PP097375; Wed, 21 Nov 2018 21:48:02 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201811212148.wALLm2PP097375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 21 Nov 2018 21:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340746 - head/contrib/elftoolchain/strings X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/contrib/elftoolchain/strings X-SVN-Commit-Revision: 340746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7DDF786B0 X-Spamd-Result: default: False [0.53 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.00)[0.001,0]; NEURAL_SPAM_MEDIUM(0.25)[0.253,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.28)[0.280,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 21:48:03 -0000 Author: oshogbo Date: Wed Nov 21 21:48:02 2018 New Revision: 340746 URL: https://svnweb.freebsd.org/changeset/base/340746 Log: strings: fix style nits Reviewed by: cem, emaste, Joseph Koshy Differential Revision: https://reviews.freebsd.org/D18036 Modified: head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Wed Nov 21 21:46:06 2018 (r340745) +++ head/contrib/elftoolchain/strings/strings.c Wed Nov 21 21:48:02 2018 (r340746) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#include #include +#include #include #include @@ -64,7 +64,7 @@ enum encoding_style { }; #define PRINTABLE(c) \ - ((c) >= 0 && (c) <= 255 && \ + ((c) >= 0 && (c) <= 255 && \ ((c) == '\t' || isprint((c)) || \ (encoding == ENCODING_8BIT && (c) > 127))) @@ -109,8 +109,8 @@ main(int argc, char **argv) elf_errmsg(-1)); while ((ch = getopt_long(argc, argv, "1234567890ae:fhn:ot:Vv", - strings_longopts, NULL)) != -1) - switch((char)ch) { + strings_longopts, NULL)) != -1) { + switch ((char)ch) { case 'a': entire_file = 1; break; @@ -183,14 +183,15 @@ main(int argc, char **argv) usage(); /* NOTREACHED */ } + } argc -= optind; argv += optind; - if (!min_len) + if (min_len == 0) min_len = 4; - if (!*argv) + if (*argv == NULL) rc = find_strings("{standard input}", 0, 0); - else while (*argv) { + else while (*argv != NULL) { if (handle_file(*argv) != 0) rc = 1; argv++; @@ -226,10 +227,10 @@ handle_binary(const char *name, int fd) { struct stat buf; - memset(&buf, 0, sizeof(struct stat)); - (void) lseek(fd, (off_t)0, SEEK_SET); + memset(&buf, 0, sizeof(buf)); + (void)lseek(fd, 0, SEEK_SET); if (!fstat(fd, &buf)) - return (find_strings(name, (off_t)0, buf.st_size)); + return (find_strings(name, 0, buf.st_size)); return (1); } @@ -253,21 +254,21 @@ handle_elf(const char *name, int fd) if (entire_file) return (handle_binary(name, fd)); - (void) lseek(fd, (off_t)0, SEEK_SET); + (void)lseek(fd, 0, SEEK_SET); elf = elf_begin(fd, ELF_C_READ, NULL); if (elf_kind(elf) != ELF_K_ELF) { - (void) elf_end(elf); + (void)elf_end(elf); return (handle_binary(name, fd)); } if (gelf_getehdr(elf, &elfhdr) == NULL) { - (void) elf_end(elf); + (void)elf_end(elf); warnx("%s: ELF file could not be processed", name); return (1); } if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) { - (void) elf_end(elf); + (void)elf_end(elf); return (handle_binary(name, fd)); } else { scn = NULL; @@ -281,7 +282,7 @@ handle_elf(const char *name, int fd) } } } - (void) elf_end(elf); + (void)elf_end(elf); return (rc); } @@ -304,7 +305,7 @@ getcharacter(void) buf[i] = c; } - switch(encoding) { + switch (encoding) { case ENCODING_7BIT: case ENCODING_8BIT: rt = buf[0]; @@ -317,12 +318,12 @@ getcharacter(void) break; case ENCODING_32BIT_BIG: rt = ((long) buf[0] << 24) | ((long) buf[1] << 16) | - ((long) buf[2] << 8) | buf[3]; - break; + ((long) buf[2] << 8) | buf[3]; + break; case ENCODING_32BIT_LITTLE: rt = buf[0] | ((long) buf[1] << 8) | ((long) buf[2] << 16) | - ((long) buf[3] << 24); - break; + ((long) buf[3] << 24); + break; } return (rt); } @@ -341,63 +342,60 @@ find_strings(const char *name, off_t offset, off_t siz int i; if ((obuf = (char*)calloc(1, min_len + 1)) == NULL) { - (void) fprintf(stderr, "Unable to allocate memory: %s\n", - strerror(errno)); + fprintf(stderr, "Unable to allocate memory: %s\n", + strerror(errno)); return (1); } - (void) fseeko(stdin, offset, SEEK_SET); + (void)fseeko(stdin, offset, SEEK_SET); cur_off = offset; start_off = 0; - while(1) { + while (true) { if ((offset + size) && (cur_off >= offset + size)) break; start_off = cur_off; - memset(obuf, 0, min_len+1); + memset(obuf, 0, min_len + 1); for(i = 0; i < min_len; i++) { c = getcharacter(); if (c == EOF && feof(stdin)) goto _exit1; - if (PRINTABLE(c)) { - obuf[i] = c; - obuf[i+1] = 0; - cur_off += encoding_size; - } else { + if (PRINTABLE(c)) { + obuf[i] = c; + obuf[i + 1] = 0; + cur_off += encoding_size; + } else { if (encoding == ENCODING_8BIT && (uint8_t)c > 127) { - obuf[i] = c; - obuf[i+1] = 0; - cur_off += encoding_size; - continue; - } - cur_off += encoding_size; - break; - } + obuf[i] = c; + obuf[i + 1] = 0; + cur_off += encoding_size; + continue; + } + cur_off += encoding_size; + break; + } } if (i >= min_len && ((cur_off <= offset + size) || !(offset + size))) { if (show_filename) - printf ("%s: ", name); + printf("%s: ", name); if (show_loc) { - switch(radix) { + switch (radix) { case RADIX_DECIMAL: - (void) printf("%7ju ", - (uintmax_t)start_off); + printf("%7ju ", (uintmax_t)start_off); break; case RADIX_HEX: - (void) printf("%7jx ", - (uintmax_t)start_off); + printf("%7jx ", (uintmax_t)start_off); break; case RADIX_OCTAL: - (void) printf("%7jo ", - (uintmax_t)start_off); + printf("%7jo ", (uintmax_t)start_off); break; } } printf("%s", obuf); - while(1) { + while (true) { if ((offset + size) && (cur_off >= offset + size)) break; @@ -405,9 +403,9 @@ find_strings(const char *name, off_t offset, off_t siz cur_off += encoding_size; if (encoding == ENCODING_8BIT && (uint8_t)c > 127) { - putchar(c); - continue; - } + putchar(c); + continue; + } if (!PRINTABLE(c) || c == EOF) break; putchar(c); @@ -436,13 +434,15 @@ Usage: %s [options] [file...]\n\ void usage(void) { - (void) fprintf(stderr, USAGE_MESSAGE, ELFTC_GETPROGNAME()); + + fprintf(stderr, USAGE_MESSAGE, ELFTC_GETPROGNAME()); exit(EXIT_FAILURE); } void show_version(void) { - (void) printf("%s (%s)\n", ELFTC_GETPROGNAME(), elftc_version()); + + printf("%s (%s)\n", ELFTC_GETPROGNAME(), elftc_version()); exit(EXIT_SUCCESS); } From owner-svn-src-head@freebsd.org Wed Nov 21 22:01:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05C591147F81; Wed, 21 Nov 2018 22:01:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A23AA79568; Wed, 21 Nov 2018 22:01:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84AF32649D; Wed, 21 Nov 2018 22:01:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALM16Uf003647; Wed, 21 Nov 2018 22:01:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALM16QT003646; Wed, 21 Nov 2018 22:01:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811212201.wALM16QT003646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 22:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340747 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A23AA79568 X-Spamd-Result: default: False [0.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.26)[0.264,0]; NEURAL_HAM_LONG(-0.00)[-0.003,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 22:01:07 -0000 Author: mjg Date: Wed Nov 21 22:01:06 2018 New Revision: 340747 URL: https://svnweb.freebsd.org/changeset/base/340747 Log: uipc_shm: use unr64 for inode numbers Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Nov 21 21:48:02 2018 (r340746) +++ head/sys/kern/uipc_shm.c Wed Nov 21 22:01:06 2018 (r340747) @@ -113,7 +113,7 @@ static LIST_HEAD(, shm_mapping) *shm_dictionary; static struct sx shm_dict_lock; static struct mtx shm_timestamp_lock; static u_long shm_hash; -static struct unrhdr *shm_ino_unr; +static struct unrhdr64 shm_ino_unr; static dev_t shm_dev_ino; #define SHM_HASH(fnv) (&shm_dictionary[(fnv) & shm_hash]) @@ -531,7 +531,6 @@ struct shmfd * shm_alloc(struct ucred *ucred, mode_t mode) { struct shmfd *shmfd; - int ino; shmfd = malloc(sizeof(*shmfd), M_SHMFD, M_WAITOK | M_ZERO); shmfd->shm_size = 0; @@ -549,11 +548,7 @@ shm_alloc(struct ucred *ucred, mode_t mode) vfs_timestamp(&shmfd->shm_birthtime); shmfd->shm_atime = shmfd->shm_mtime = shmfd->shm_ctime = shmfd->shm_birthtime; - ino = alloc_unr(shm_ino_unr); - if (ino == -1) - shmfd->shm_ino = 0; - else - shmfd->shm_ino = ino; + shmfd->shm_ino = alloc_unr64(&shm_ino_unr); refcount_init(&shmfd->shm_refs, 1); mtx_init(&shmfd->shm_mtx, "shmrl", NULL, MTX_DEF); rangelock_init(&shmfd->shm_rl); @@ -584,8 +579,6 @@ shm_drop(struct shmfd *shmfd) rangelock_destroy(&shmfd->shm_rl); mtx_destroy(&shmfd->shm_mtx); vm_object_deallocate(shmfd->shm_object); - if (shmfd->shm_ino != 0) - free_unr(shm_ino_unr, shmfd->shm_ino); free(shmfd, M_SHMFD); } } @@ -624,8 +617,7 @@ shm_init(void *arg) mtx_init(&shm_timestamp_lock, "shm timestamps", NULL, MTX_DEF); sx_init(&shm_dict_lock, "shm dictionary"); shm_dictionary = hashinit(1024, M_SHMFD, &shm_hash); - shm_ino_unr = new_unrhdr(1, INT32_MAX, NULL); - KASSERT(shm_ino_unr != NULL, ("shm fake inodes not initialized")); + new_unrhdr64(&shm_ino_unr, 1); shm_dev_ino = devfs_alloc_cdp_inode(); KASSERT(shm_dev_ino > 0, ("shm dev inode not initialized")); } From owner-svn-src-head@freebsd.org Wed Nov 21 22:16:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 915F311485C8; Wed, 21 Nov 2018 22:16:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37C167A00C; Wed, 21 Nov 2018 22:16:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18D04267B0; Wed, 21 Nov 2018 22:16:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALMGAoU013357; Wed, 21 Nov 2018 22:16:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALMGAuq013356; Wed, 21 Nov 2018 22:16:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811212216.wALMGAuq013356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 22:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340748 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37C167A00C X-Spamd-Result: default: False [0.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.264,0]; NEURAL_SPAM_MEDIUM(0.23)[0.231,0]; NEURAL_SPAM_LONG(0.40)[0.400,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 22:16:11 -0000 Author: mjg Date: Wed Nov 21 22:16:10 2018 New Revision: 340748 URL: https://svnweb.freebsd.org/changeset/base/340748 Log: proc: update list manipulation comment on process exit Processes stay in the hash until they get reaped. This code does not unlink the child from the parent, so remove the claim that it does. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Nov 21 22:01:06 2018 (r340747) +++ head/sys/kern/kern_exit.c Wed Nov 21 22:16:10 2018 (r340748) @@ -429,8 +429,7 @@ exit1(struct thread *td, int rval, int signo) sx_xlock(&proctree_lock); /* - * Remove proc from allproc queue and pidhash chain. - * Place onto zombproc. Unlink from parent's child list. + * Move proc from allproc queue to zombproc. */ sx_xlock(&allproc_lock); LIST_REMOVE(p, p_list); From owner-svn-src-head@freebsd.org Wed Nov 21 22:24:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E37A011488E6; Wed, 21 Nov 2018 22:24:29 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 510067A5E1; Wed, 21 Nov 2018 22:24:29 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-qt1-f177.google.com with SMTP id n21so5575439qtl.6; Wed, 21 Nov 2018 14:24:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vKpVHfi7WyOZMzZZC+hD9zpLkeJqGsX9AWp9YLc0kms=; b=FUUaMZEx4HogfErfIyie+V4HmO6D3KNw4p8vkLzMIgSABFFUQ3CtyLoA/bRrdVC8Io UH/UTQbeT+XPYN5iOPkPdgauz/xq1wfcsGAQvszJs/8rMtjj8+TEyXWa2EDDtMvLLtlF i1KFXhUqkO3FhFri4zLDVAV0SZS4Ao7tbrIO52xse2eryYZPNlNIrx9z30s0Wobbr4Cr lMnebj3C+BCLdYQZ439kV56fGU1XiFdlQR0f0uRC8x0RGOHeD5a20cRf6LSGTU0HFIdc j4jmcSeb9Hnfg14J3K8svWHPCWNTYn+vE6DKDUYSa4y5wJoeU195hBdO0R3yhr5VWL6M QZTw== X-Gm-Message-State: AGRZ1gLXC8NF8G8Ief7W5zLQ1yMql3PEAB6GHm+uXVPqaAUfgAIlaxkX maXhJOHly3XCFM72bL334Jtj0H1QcgBuQA== X-Google-Smtp-Source: AFSGD/WuPPIgfaqDYa1dO9KUSD9+4UdObrMgGxhEelPFliQovNqKYIQwqV1KW/0V7AIGaDiHi2MFCw== X-Received: by 2002:ac8:1d12:: with SMTP id d18mr7427987qtl.343.1542835526791; Wed, 21 Nov 2018 13:25:26 -0800 (PST) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com. [209.85.160.178]) by smtp.gmail.com with ESMTPSA id v32sm24332683qta.37.2018.11.21.13.25.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 13:25:26 -0800 (PST) Received: by mail-qt1-f178.google.com with SMTP id v11so5444921qtc.2; Wed, 21 Nov 2018 13:25:26 -0800 (PST) X-Received: by 2002:ac8:43d0:: with SMTP id w16mr7614286qtn.78.1542835526092; Wed, 21 Nov 2018 13:25:26 -0800 (PST) MIME-Version: 1.0 References: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811211654.wALGsAPT072769@pdx.rh.CN85.dnsmgr.net> From: Mateusz Piotrowski <0mp@freebsd.org> Date: Wed, 21 Nov 2018 22:25:13 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r340722 - head/lib/libbe To: rgrimes@freebsd.org Cc: kevans@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-Rspamd-Queue-Id: 510067A5E1 X-Spamd-Result: default: False [-3.98 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; RCVD_IN_DNSWL_NONE(0.00)[177.160.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.01)[ipnet: 209.85.128.0/17(-3.40), asn: 15169(-1.56), country: US(-0.09)]; FORGED_SENDER(0.30)[0mp@freebsd.org,mpp302@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[0mp@freebsd.org,mpp302@gmail.com] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 22:24:30 -0000 Hello, On Wed, 21 Nov 2018 at 17:54, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Wed, Nov 21, 2018 at 10:19 AM Rodney W. Grimes > > wrote: > > > > > > > Author: 0mp (ports committer) > > > > Date: Wed Nov 21 11:22:44 2018 > > > > New Revision: 340722 > > > > URL: https://svnweb.freebsd.org/changeset/base/340722 > > > > > > > > Log: > > > > libbe(3): Put each error value in separate line. > > > > > > > > As requested by a TODO in the source code. > > > > > > > > Reviewed by: bcr > > > > Approved by: krion (mentor, implicit), mat (mentor, > implicit) > > > > Differential Revision: https://reviews.freebsd.org/D18063 > > > > > > Who with a src bit approved the commit to src? > > > > > > > I do want to clarify- bcr approved it in the review (explicitly with > > "... hereby approved!") -- are you mainly pointing out that he failed > > to annotate this properly in the commit, or is doc bit approval for a > > commit to a manpage in src insufficient? > > That is defanitly a bit of a grey area, from reading and re-reading > the commit bit page it is clear that a doc committer can commit > to src documentation, it is not clear if they can approve a commit > by someone else to the src tree, it does say > ""Approved by" from a non-mentored committer > with the appropriate bit" > > It probably would be fine to have said Approved by: bcr. > True. Perhaps as a ports committer I should even write "Approved by: bcr (doc)" to make it clear that I collected appropriate approvals before committing. I've been committing small patches to the src tree for a couple of months now and I've heard that "Reviewed by: bcr" is sufficient. I guess that now I understand that "Reviewed by" is for listing people and teams who reviewed the code and "Approved by" is for listing all the necessary approvals one has to collect in order to commit. I still question what a out of scope commit that is > approved by: (mentor, implicit). I am not even sure > what that means in this context. Have his mentors > said he can commit anything anyplace without them > seeing it? If so then release the mentor/mentee bit > would be more appropriate? > mat@ and krion@ told me that I don't have to ask them about explicit approval before committing to doc or src. If I gather all the necessary approvals from doc and src committers then I am able to commit with an implicit approval from my mentors. > > As an aside, happy to approve any changes to these manpages as the > > current bectl/libbe maintainer for anyone that wants to improve them. > > =) > I'm really sorry, this is my fault. Usually, I request people, who recently contributed to a certain part of a tree or who are listed in the MAINTAINERS file, to review my changes. This time it was only meant to be a small improvement to our documentation without any actual content changes to the manual page itself so I only notified bcr. Regards, Mateusz From owner-svn-src-head@freebsd.org Wed Nov 21 22:25:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 864361148922; Wed, 21 Nov 2018 22:25:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 234567A70A; Wed, 21 Nov 2018 22:25:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 043102694B; Wed, 21 Nov 2018 22:25:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALMP52a018192; Wed, 21 Nov 2018 22:25:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALMP5uh018191; Wed, 21 Nov 2018 22:25:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811212225.wALMP5uh018191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 22:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340749 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 234567A70A X-Spamd-Result: default: False [1.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.45)[0.446,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 22:25:06 -0000 Author: mjg Date: Wed Nov 21 22:25:05 2018 New Revision: 340749 URL: https://svnweb.freebsd.org/changeset/base/340749 Log: uipc_usrreq: fix inode number assignment The code was incrementing a global variable in an unsafe manner. Two different threads stating two different sockets could have resulted in the same inode numbers assigned to both. Creation is protected with a global lock, move the assigment there. Since inode numbers are 64-bit now drop the check for overflows. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Nov 21 22:16:10 2018 (r340748) +++ head/sys/kern/uipc_usrreq.c Wed Nov 21 22:25:05 2018 (r340749) @@ -530,6 +530,7 @@ uipc_attach(struct socket *so, int proto, struct threa UNP_LINK_WLOCK(); unp->unp_gencnt = ++unp_gencnt; + unp->unp_ino = ++unp_ino; unp_count++; switch (so->so_type) { case SOCK_STREAM: @@ -1302,12 +1303,8 @@ uipc_sense(struct socket *so, struct stat *sb) KASSERT(unp != NULL, ("uipc_sense: unp == NULL")); sb->st_blksize = so->so_snd.sb_hiwat; - UNP_PCB_LOCK(unp); sb->st_dev = NODEV; - if (unp->unp_ino == 0) - unp->unp_ino = (++unp_ino == 0) ? ++unp_ino : unp_ino; sb->st_ino = unp->unp_ino; - UNP_PCB_UNLOCK(unp); return (0); } From owner-svn-src-head@freebsd.org Wed Nov 21 22:37:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 416271148D82; Wed, 21 Nov 2018 22:37:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D77587AEA7; Wed, 21 Nov 2018 22:37:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4AA226B0B; Wed, 21 Nov 2018 22:37:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALMbnZ0023623; Wed, 21 Nov 2018 22:37:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALMbnLI023622; Wed, 21 Nov 2018 22:37:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811212237.wALMbnLI023622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 21 Nov 2018 22:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340750 - head/contrib/elftoolchain/strings X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/contrib/elftoolchain/strings X-SVN-Commit-Revision: 340750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D77587AEA7 X-Spamd-Result: default: False [1.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.45)[0.446,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 22:37:50 -0000 Author: mjg Date: Wed Nov 21 22:37:49 2018 New Revision: 340750 URL: https://svnweb.freebsd.org/changeset/base/340750 Log: strings: unbreak the build after r340746 Discussed with: oshogbo Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Wed Nov 21 22:25:05 2018 (r340749) +++ head/contrib/elftoolchain/strings/strings.c Wed Nov 21 22:37:49 2018 (r340750) @@ -350,7 +350,7 @@ find_strings(const char *name, off_t offset, off_t siz (void)fseeko(stdin, offset, SEEK_SET); cur_off = offset; start_off = 0; - while (true) { + for (;;) { if ((offset + size) && (cur_off >= offset + size)) break; start_off = cur_off; @@ -395,7 +395,7 @@ find_strings(const char *name, off_t offset, off_t siz } printf("%s", obuf); - while (true) { + for (;;) { if ((offset + size) && (cur_off >= offset + size)) break; From owner-svn-src-head@freebsd.org Thu Nov 22 03:42:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33A451133F9F; Thu, 22 Nov 2018 03:42:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C96EF87207; Thu, 22 Nov 2018 03:42:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 6B12B850D; Thu, 22 Nov 2018 03:42:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f41.google.com with SMTP id e26so5522552lfc.2; Wed, 21 Nov 2018 19:42:34 -0800 (PST) X-Gm-Message-State: AGRZ1gJZUIZk5fbVl9cp4RAjTRun1CqjAnBZWizi5ltgSasidsFlWAgb HYy8FpGpNc8VraRvE1CF8RWYg9I4V5VvT/maj24= X-Google-Smtp-Source: AJdET5eXMtF1UJPJBmL057+xROJmqS4iM3IHmL1kfSj5pbClfeeHUQstWT17wFyfaUMnIbeIIm1QkpzSSpX45okVejk= X-Received: by 2002:a19:cd50:: with SMTP id d77mr5210288lfg.125.1542858152827; Wed, 21 Nov 2018 19:42:32 -0800 (PST) MIME-Version: 1.0 References: <201810210208.w9L28vVc080088@repo.freebsd.org> In-Reply-To: <201810210208.w9L28vVc080088@repo.freebsd.org> From: Kyle Evans Date: Wed, 21 Nov 2018 21:42:21 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: C96EF87207 X-Spamd-Result: default: False [1.35 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.39)[0.389,0]; NEURAL_SPAM_MEDIUM(0.54)[0.537,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.42)[0.425,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 03:42:35 -0000 On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > Author: jhibbits > Date: Sun Oct 21 02:08:57 2018 > New Revision: 339516 > URL: https://svnweb.freebsd.org/changeset/base/339516 > > Log: > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > before the genassym is completed. This causes a build failure when PSL_EE > doesn't exist, and is read as 0. Get around this by explicitly specifying > the bits in the mask instead. > Hi, CI on the stable/12 branch still hits this, so I'm tempted to MFC this if you don't object. OTOH, the correct solution should be a `dependency "genassym.o"` in ^/sys/conf/files.powerpc for dtrace_asm.S, no? Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Thu Nov 22 05:24:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18B63113856D; Thu, 22 Nov 2018 05:24:35 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463848B252; Thu, 22 Nov 2018 05:24:34 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lj1-f193.google.com with SMTP id l15-v6so6830365lja.9; Wed, 21 Nov 2018 21:24:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fhrpDQY17AQirD3tA9zQ9OFiIeJVgaH2w9LaeQuNDRY=; b=gLtXqCJfNvPXtYjQVemx6DNyxjIaYz35icqI7gXvfuQ8qf2BEpjQKxf+3qmh6nhqOY urvWhO6XLM5ijzX0/8ra1S4ilhxie9mSe9Q+RPYn+FwrnpyiTXwjNJedyC/5XqVdUswv SnL+uzRdfLBsdU5LAmqkmbMje8OnvLxuFSLzr2JLrvkqHEiHuBE0u++MpnLrvN1gslz0 yM5hUHsiiAPrLqIWS9uu9KJ26JQw+3Xm86M7zn/wavdxZkk5vL4M9VjOtf8y8FyIDkqk QCVHSsh1EWNLm98gNpKZgRwI3qJSiwqbgiBFyPXB2YWJgpoEmDUCQBF5OA+nxUiw1K2E Xzfg== X-Gm-Message-State: AA+aEWbktAQoFZz4LOS6n0dx/381NQ+SJHLNVe+QbY6kQC7BHdP1L1Sy Q/+gj1aKVE2cZt/I5bWb9Ed1pGDgibqncUi0vDdWOw== X-Google-Smtp-Source: AJdET5dSxA2aMTjR6+7c3pP/HzgAhxJ629UeQ5OUpSa41SkVecDFHCaitbfxBrhblCLhecNQW9u6CwwkVTeNy49o1OY= X-Received: by 2002:a2e:4c1a:: with SMTP id z26-v6mr6302139lja.136.1542863876868; Wed, 21 Nov 2018 21:17:56 -0800 (PST) MIME-Version: 1.0 References: <201810210208.w9L28vVc080088@repo.freebsd.org> In-Reply-To: From: Justin Hibbits Date: Wed, 21 Nov 2018 23:17:44 -0600 Message-ID: Subject: Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc To: kevans@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 463848B252 X-Spamd-Result: default: False [-3.93 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.989,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.99)[-0.992,0]; IP_SCORE(-1.02)[ipnet: 209.85.128.0/17(-3.45), asn: 15169(-1.57), country: US(-0.09)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.91)[-0.913,0]; RCVD_IN_DNSWL_NONE(0.00)[193.208.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 05:24:35 -0000 On Wed, Nov 21, 2018 at 10:02 PM Kyle Evans wrote: > > On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > > > Author: jhibbits > > > Date: Sun Oct 21 02:08:57 2018 > > > New Revision: 339516 > > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > > > Log: > > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > > > before the genassym is completed. This causes a build failure when PSL_EE > > > doesn't exist, and is read as 0. Get around this by explicitly specifying > > > the bits in the mask instead. > > > > > > > Hi, > > > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > > if you don't object. OTOH, the correct solution should be a > > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > > dtrace_asm.S, no? > > > > Sorry, that should have read "genassym.inc" -- my naive understanding > of 'dependency' is that config(8) will turn it directly into a > makefile dependency that will alleviate this. Hm, I'm surprised we don't have a rule for all kernel .S files, even modules, being dependent on that. Should we add one? - Justin From owner-svn-src-head@freebsd.org Thu Nov 22 04:02:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED94B1134C70; Thu, 22 Nov 2018 04:02:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FE648857D; Thu, 22 Nov 2018 04:02:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 21442872C; Thu, 22 Nov 2018 04:02:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f44.google.com with SMTP id e26so5544481lfc.2; Wed, 21 Nov 2018 20:02:28 -0800 (PST) X-Gm-Message-State: AGRZ1gJ5BgXF109OW0jZsPHG+B0L+C9bIpY1dE+ScC26EjZo3kgnPq8G JPnoGyAzlEaHV1o6pjbAHzfBrjFaNsFNZ/T3LUc= X-Google-Smtp-Source: AJdET5esQC6QcdLFhOd9i1faSblp+m0uVt5ZIPvOT7zFiy2+dN6ARkdHF0Bry1PYEDIW+0d/8OboJjUafY9ugfTCRDg= X-Received: by 2002:a19:cd50:: with SMTP id d77mr5235522lfg.125.1542859346691; Wed, 21 Nov 2018 20:02:26 -0800 (PST) MIME-Version: 1.0 References: <201810210208.w9L28vVc080088@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 21 Nov 2018 22:02:15 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7FE648857D X-Spamd-Result: default: False [1.35 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.39)[0.389,0]; NEURAL_SPAM_MEDIUM(0.54)[0.537,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.42)[0.425,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 04:02:29 -0000 On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > Author: jhibbits > > Date: Sun Oct 21 02:08:57 2018 > > New Revision: 339516 > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > Log: > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > > before the genassym is completed. This causes a build failure when PSL_EE > > doesn't exist, and is read as 0. Get around this by explicitly specifying > > the bits in the mask instead. > > > > Hi, > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > if you don't object. OTOH, the correct solution should be a > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > dtrace_asm.S, no? > Sorry, that should have read "genassym.inc" -- my naive understanding of 'dependency' is that config(8) will turn it directly into a makefile dependency that will alleviate this. From owner-svn-src-head@freebsd.org Thu Nov 22 07:16:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11F4E113D29C; Thu, 22 Nov 2018 07:16:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 586998F2CF; Thu, 22 Nov 2018 07:16:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd42.google.com with SMTP id r200so5908311iod.11; Wed, 21 Nov 2018 23:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JOby5YdW3aP5kBtyUEJ40PPwMljdEKUxIyUT/tSvqkU=; b=ssGpy9/jc1T3HNppj+UO9wTjxJXxzx92aOfQd8b8qgE/JX6sCeoB5wiu9JQrEIslye aVkasC5JjjXkhm45C2iYtdY686DnKmiKtlAmb1F4PRMjxVpIQuY861fOAaFmZSWWLSbY yyVyUh/ImWzJYWfIc7C0YCgXeJznc1cNYVZkCUZuV0NrulDSPXEKxgmOf+owkzovVF5x +eIWmIPqN5TliXQEJ0F9LVDTYXq4/SrjVRv/i1nS/iB5mQN7Zl9KLeVUftPNDLVZzRtH X4nVO4US+gy1cz5NklTA5h4kpMsE9hFlm4A58kbQmAduZlqiOV/+aNTYj6ebGPwdZhVP YJOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=JOby5YdW3aP5kBtyUEJ40PPwMljdEKUxIyUT/tSvqkU=; b=I7qv/m3CbYNaensuai9FwBKn1EaNNVVMuxgaj0PLuoqteN5z532xmjCtu3jxqPfT1v attBnCXMqGisDzToPT42dCmtavkyHhR+n8AqzOIpZjT11rrcGVlKbrIHasSBDBJoUVok BeKeciP6gR+Kk3Pu6hE/MFgmhcVnzK55lvXlXUNzIdAirUg5+ukfLcVwF1KhgK80JRsf CK3nbnnAYa5v7hfxtRwTrx143tbg2vzdWvc9Eiw7EZeis2ArcWWWFdHzf/p0lhMYhw8t UFiQIEsOGgmETvJCEnZSC1zpdpyHdFp2PJaSEHBjgthIbvxykF63EobusmpeoomEIiUt Ofgg== X-Gm-Message-State: AA+aEWaSyFVVpmXlAF7naYi663Jkqj8/pzsuVFETjHxeK9k+cEBIuWBJ OkLUJtdE0z+SlAJZ/8UvWwTt7dowsTc= X-Google-Smtp-Source: AFSGD/XPCkmiXAg/3T/YVPKkjc7KTk3LIs06xpGjxnmzxTc6fO4gUWvp/mxOfbr1Mle9RgR9hWE0jA== X-Received: by 2002:a6b:3fd7:: with SMTP id m206mr7129531ioa.210.1542870994434; Wed, 21 Nov 2018 23:16:34 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id e80-v6sm1567315itc.35.2018.11.21.23.16.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Nov 2018 23:16:33 -0800 (PST) Sender: Mark Johnston Date: Thu, 22 Nov 2018 02:16:29 -0500 From: Mark Johnston To: Kyle Evans Cc: Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Subject: Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc Message-ID: <20181122071629.GA96830@raichu> References: <201810210208.w9L28vVc080088@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 586998F2CF X-Spamd-Result: default: False [-2.33 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-0.98)[-0.981,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-0.98)[-0.980,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.28)[ip: (2.56), ipnet: 2607:f8b0::/32(-2.31), asn: 15169(-1.57), country: US(-0.09)]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.37)[-0.373,0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 07:16:36 -0000 On Wed, Nov 21, 2018 at 10:02:15PM -0600, Kyle Evans wrote: > On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > > > Author: jhibbits > > > Date: Sun Oct 21 02:08:57 2018 > > > New Revision: 339516 > > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > > > Log: > > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > > > before the genassym is completed. This causes a build failure when PSL_EE > > > doesn't exist, and is read as 0. Get around this by explicitly specifying > > > the bits in the mask instead. > > > > > > > Hi, > > > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > > if you don't object. OTOH, the correct solution should be a > > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > > dtrace_asm.S, no? I believe that dtrace_asm.S will be built as part of dtrace.ko, not the kernel. dtrace/Makefile already specifies a dependency on assym.inc. Maybe this is the same issue as PR 233339? > Sorry, that should have read "genassym.inc" -- my naive understanding > of 'dependency' is that config(8) will turn it directly into a > makefile dependency that will alleviate this. > From owner-svn-src-head@freebsd.org Thu Nov 22 04:48:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD7941136BE9; Thu, 22 Nov 2018 04:48:28 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FFB089E0D; Thu, 22 Nov 2018 04:48:28 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A8D52D73; Thu, 22 Nov 2018 04:48:28 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM4mSFc014131; Thu, 22 Nov 2018 04:48:28 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM4mSZE014130; Thu, 22 Nov 2018 04:48:28 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811220448.wAM4mSZE014130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 22 Nov 2018 04:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340754 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 340754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FFB089E0D X-Spamd-Result: default: False [1.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.42)[0.419,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 04:48:29 -0000 Author: cy Date: Thu Nov 22 04:48:27 2018 New Revision: 340754 URL: https://svnweb.freebsd.org/changeset/base/340754 Log: Allow forced start of ipmon in special cases where testing is desired (or other special cases) and when ipfilter is disabled in rc.conf but started by other means. MFC after: 1 week Modified: head/libexec/rc/rc.d/ipmon Modified: head/libexec/rc/rc.d/ipmon ============================================================================== --- head/libexec/rc/rc.d/ipmon Thu Nov 22 04:39:06 2018 (r340753) +++ head/libexec/rc/rc.d/ipmon Thu Nov 22 04:48:27 2018 (r340754) @@ -21,7 +21,7 @@ ipmon_precmd() # Continue only if ipfilter or ipnat is enabled and the # ipfilter module is loaded. # - if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable ; then + if ! checkyesno ipfilter_enable && ! checkyesno ipnat_enable && ! checkyesno rc_force ; then err 1 "${name} requires either ipfilter or ipnat enabled" fi if ! ${ipfilter_program:-/sbin/ipf} -V | grep -q 'Running: yes' >/dev/null 2>&1; then From owner-svn-src-head@freebsd.org Thu Nov 22 13:17:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CDEC114875D; Thu, 22 Nov 2018 13:17:29 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA80764AA; Thu, 22 Nov 2018 13:17:29 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 9EF10BEFF; Thu, 22 Nov 2018 13:17:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f48.google.com with SMTP id f23so6496814lfc.13; Thu, 22 Nov 2018 05:17:28 -0800 (PST) X-Gm-Message-State: AGRZ1gLq34GWfYlJYwX/7Pf4Bqhypqy1toxQ0lreGRiUg4vK7eRxDHb5 VhhynQjrXXoMd9B92Aug60BYk8IeClTA5XLJtLo= X-Google-Smtp-Source: AJdET5fVBKOnFJ8oEVYZhiEOjGeTe9Lmdzc3aMQCdQxSkykVJxFtN/XF0z3P/E2a7t0G1/L4sAFS/wWSCjdUMGhHunQ= X-Received: by 2002:a19:c70a:: with SMTP id x10mr6362543lff.88.1542892647062; Thu, 22 Nov 2018 05:17:27 -0800 (PST) MIME-Version: 1.0 References: <201810210208.w9L28vVc080088@repo.freebsd.org> <20181122071629.GA96830@raichu> In-Reply-To: <20181122071629.GA96830@raichu> From: Kyle Evans Date: Thu, 22 Nov 2018 07:17:15 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339516 - head/sys/cddl/dev/dtrace/powerpc To: Mark Johnston Cc: Justin Hibbits , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0DA80764AA X-Spamd-Result: default: False [1.01 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_SHORT(0.09)[0.091,0]; NEURAL_SPAM_MEDIUM(0.54)[0.538,0]; NEURAL_SPAM_LONG(0.38)[0.383,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:17:29 -0000 On Thu, Nov 22, 2018 at 1:16 AM Mark Johnston wrote: > > On Wed, Nov 21, 2018 at 10:02:15PM -0600, Kyle Evans wrote: > > On Wed, Nov 21, 2018 at 9:42 PM Kyle Evans wrote: > > > > > > On Sat, Oct 20, 2018 at 9:09 PM Justin Hibbits wrote: > > > > > > > > Author: jhibbits > > > > Date: Sun Oct 21 02:08:57 2018 > > > > New Revision: 339516 > > > > URL: https://svnweb.freebsd.org/changeset/base/339516 > > > > > > > > Log: > > > > powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE > > > > > > > > There seems to be a race in CI, such that dtrace_asm.S might be assembled > > > > before the genassym is completed. This causes a build failure when PSL_EE > > > > doesn't exist, and is read as 0. Get around this by explicitly specifying > > > > the bits in the mask instead. > > > > > > > > > > Hi, > > > > > > CI on the stable/12 branch still hits this, so I'm tempted to MFC this > > > if you don't object. OTOH, the correct solution should be a > > > `dependency "genassym.o"` in ^/sys/conf/files.powerpc for > > > dtrace_asm.S, no? > > I believe that dtrace_asm.S will be built as part of dtrace.ko, not the > kernel. dtrace/Makefile already specifies a dependency on assym.inc. > Maybe this is the same issue as PR 233339? > Ah, indeed, this was the module rather than kernel build of dtrace_asm.S -- sorry about that. That one is indeed not as simple of a fix. =( From owner-svn-src-head@freebsd.org Thu Nov 22 14:10:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E46E1149825; Thu, 22 Nov 2018 14:10:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4C8777ED3; Thu, 22 Nov 2018 14:10:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95C0B10DD8; Thu, 22 Nov 2018 14:10:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMEAkoH003800; Thu, 22 Nov 2018 14:10:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMEAkVM003799; Thu, 22 Nov 2018 14:10:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811221410.wAMEAkVM003799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 22 Nov 2018 14:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340765 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4C8777ED3 X-Spamd-Result: default: False [1.36 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.47)[0.471,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 14:10:47 -0000 Author: arybchik Date: Thu Nov 22 14:10:46 2018 New Revision: 340765 URL: https://svnweb.freebsd.org/changeset/base/340765 Log: sfxge(4): cleanup: move into right place Due to incorrect merge the piece of code was put in incorrect place and diverge from libefx in other locations. Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18024 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 22 13:18:58 2018 (r340764) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 22 14:10:46 2018 (r340765) @@ -1092,6 +1092,18 @@ ef10_get_datapath_caps( CAP_FLAG2(flags2, INIT_EVQ_V2) ? B_TRUE : B_FALSE; /* + * Check if firmware-verified NVRAM updates must be used. + * + * The firmware trusted installer requires all NVRAM updates to use + * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) + * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated + * partition and report the result). + */ + encp->enc_fw_verified_nvram_update_required = + CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? + B_TRUE : B_FALSE; + + /* * Check if firmware provides packet memory and Rx datapath * counters. */ @@ -1104,18 +1116,6 @@ ef10_get_datapath_caps( */ encp->enc_mac_stats_40g_tx_size_bins = CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; - - /* - * Check if firmware-verified NVRAM updates must be used. - * - * The firmware trusted installer requires all NVRAM updates to use - * version 2 of MC_CMD_NVRAM_UPDATE_START (to enable verified update) - * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated - * partition and report the result). - */ - encp->enc_fw_verified_nvram_update_required = - CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? - B_TRUE : B_FALSE; #undef CAP_FLAG #undef CAP_FLAG2 From owner-svn-src-head@freebsd.org Thu Nov 22 14:31:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEC5F1149E8E; Thu, 22 Nov 2018 14:31:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C5AD78F35; Thu, 22 Nov 2018 14:31:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D4D011270; Thu, 22 Nov 2018 14:31:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMEVcse015763; Thu, 22 Nov 2018 14:31:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMEVapr015749; Thu, 22 Nov 2018 14:31:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811221431.wAMEVapr015749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 22 Nov 2018 14:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340766 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C5AD78F35 X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.48)[0.476,0]; NEURAL_SPAM_SHORT(0.49)[0.493,0]; NEURAL_SPAM_MEDIUM(0.58)[0.583,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 14:31:39 -0000 Author: arybchik Date: Thu Nov 22 14:31:35 2018 New Revision: 340766 URL: https://svnweb.freebsd.org/changeset/base/340766 Log: sfxge(4): support packed stream Rx mode in libefx Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18022 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_regs_ef10.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/ef10_ev.c Thu Nov 22 14:31:35 2018 (r340766) @@ -762,8 +762,90 @@ ef10_ev_qstats_update( } #endif /* EFSYS_OPT_QSTATS */ +#if EFSYS_OPT_RX_PACKED_STREAM static __checkReturn boolean_t +ef10_ev_rx_packed_stream( + __in efx_evq_t *eep, + __in efx_qword_t *eqp, + __in const efx_ev_callbacks_t *eecp, + __in_opt void *arg) +{ + uint32_t label; + uint32_t pkt_count_lbits; + uint16_t flags; + boolean_t should_abort; + efx_evq_rxq_state_t *eersp; + unsigned int pkt_count; + unsigned int current_id; + boolean_t new_buffer; + + pkt_count_lbits = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DSC_PTR_LBITS); + label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL); + new_buffer = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_EV_ROTATE); + + flags = 0; + + eersp = &eep->ee_rxq_state[label]; + + /* + * RX_DSC_PTR_LBITS has least significant bits of the global + * (not per-buffer) packet counter. It is guaranteed that + * maximum number of completed packets fits in lbits-mask. + * So, modulo lbits-mask arithmetic should be used to calculate + * packet counter increment. + */ + pkt_count = (pkt_count_lbits - eersp->eers_rx_stream_npackets) & + EFX_MASK32(ESF_DZ_RX_DSC_PTR_LBITS); + eersp->eers_rx_stream_npackets += pkt_count; + + if (new_buffer) { + flags |= EFX_PKT_PACKED_STREAM_NEW_BUFFER; + eersp->eers_rx_packed_stream_credits++; + eersp->eers_rx_read_ptr++; + } + current_id = eersp->eers_rx_read_ptr & eersp->eers_rx_mask; + + /* Check for errors that invalidate checksum and L3/L4 fields */ + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECC_ERR) != 0) { + /* RX frame truncated (error flag is misnamed) */ + EFX_EV_QSTAT_INCR(eep, EV_RX_FRM_TRUNC); + flags |= EFX_DISCARD; + goto deliver; + } + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECRC_ERR) != 0) { + /* Bad Ethernet frame CRC */ + EFX_EV_QSTAT_INCR(eep, EV_RX_ETH_CRC_ERR); + flags |= EFX_DISCARD; + goto deliver; + } + + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_PARSE_INCOMPLETE)) { + flags |= EFX_PKT_PACKED_STREAM_PARSE_INCOMPLETE; + goto deliver; + } + + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_IPCKSUM_ERR)) + EFX_EV_QSTAT_INCR(eep, EV_RX_IPV4_HDR_CHKSUM_ERR); + + if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_TCPUDP_CKSUM_ERR)) + EFX_EV_QSTAT_INCR(eep, EV_RX_TCP_UDP_CHKSUM_ERR); + +deliver: + /* If we're not discarding the packet then it is ok */ + if (~flags & EFX_DISCARD) + EFX_EV_QSTAT_INCR(eep, EV_RX_OK); + + EFSYS_ASSERT(eecp->eec_rx_ps != NULL); + should_abort = eecp->eec_rx_ps(arg, label, current_id, pkt_count, + flags); + + return (should_abort); +} + +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ + +static __checkReturn boolean_t ef10_ev_rx( __in efx_evq_t *eep, __in efx_qword_t *eqp, @@ -792,9 +874,20 @@ ef10_ev_rx( return (B_FALSE); /* Basic packet information */ + label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL); + eersp = &eep->ee_rxq_state[label]; + +#if EFSYS_OPT_RX_PACKED_STREAM + /* + * Packed stream events are very different, + * so handle them separately + */ + if (eersp->eers_rx_packed_stream) + return (ef10_ev_rx_packed_stream(eep, eqp, eecp, arg)); +#endif + size = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_BYTES); next_read_lbits = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_DSC_PTR_LBITS); - label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL); eth_tag_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ETH_TAG_CLASS); mac_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_MAC_CLASS); l3_class = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_L3_CLASS); @@ -824,7 +917,6 @@ ef10_ev_rx( flags |= EFX_PKT_UNICAST; /* Increment the count of descriptors read */ - eersp = &eep->ee_rxq_state[label]; desc_count = (next_read_lbits - eersp->eers_rx_read_ptr) & EFX_MASK32(ESF_DZ_RX_DSC_PTR_LBITS); eersp->eers_rx_read_ptr += desc_count; @@ -1246,7 +1338,8 @@ ef10_ev_mcdi( ef10_ev_rxlabel_init( __in efx_evq_t *eep, __in efx_rxq_t *erp, - __in unsigned int label) + __in unsigned int label, + __in boolean_t packed_stream) { efx_evq_rxq_state_t *eersp; @@ -1255,8 +1348,41 @@ ef10_ev_rxlabel_init( EFSYS_ASSERT3U(eersp->eers_rx_mask, ==, 0); +#if EFSYS_OPT_RX_PACKED_STREAM + /* + * For packed stream modes, the very first event will + * have a new buffer flag set, so it will be incremented, + * yielding the correct pointer. That results in a simpler + * code than trying to detect start-of-the-world condition + * in the event handler. + */ + eersp->eers_rx_read_ptr = packed_stream ? ~0 : 0; +#else eersp->eers_rx_read_ptr = 0; +#endif eersp->eers_rx_mask = erp->er_mask; +#if EFSYS_OPT_RX_PACKED_STREAM + eersp->eers_rx_stream_npackets = 0; + eersp->eers_rx_packed_stream = packed_stream; + if (packed_stream) { + eersp->eers_rx_packed_stream_credits = (eep->ee_mask + 1) / + EFX_DIV_ROUND_UP(EFX_RX_PACKED_STREAM_MEM_PER_CREDIT, + EFX_RX_PACKED_STREAM_MIN_PACKET_SPACE); + EFSYS_ASSERT3U(eersp->eers_rx_packed_stream_credits, !=, 0); + /* + * A single credit is allocated to the queue when it is started. + * It is immediately spent by the first packet which has NEW + * BUFFER flag set, though, but still we shall take into + * account, as to not wrap around the maximum number of credits + * accidentally + */ + eersp->eers_rx_packed_stream_credits--; + EFSYS_ASSERT3U(eersp->eers_rx_packed_stream_credits, <=, + EFX_RX_PACKED_STREAM_MAX_CREDITS); + } +#else + EFSYS_ASSERT(!packed_stream); +#endif } void @@ -1273,6 +1399,11 @@ ef10_ev_rxlabel_fini( eersp->eers_rx_read_ptr = 0; eersp->eers_rx_mask = 0; +#if EFSYS_OPT_RX_PACKED_STREAM + eersp->eers_rx_stream_npackets = 0; + eersp->eers_rx_packed_stream = B_FALSE; + eersp->eers_rx_packed_stream_credits = 0; +#endif } #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/ef10_impl.h Thu Nov 22 14:31:35 2018 (r340766) @@ -118,7 +118,8 @@ ef10_ev_qstats_update( ef10_ev_rxlabel_init( __in efx_evq_t *eep, __in efx_rxq_t *erp, - __in unsigned int label); + __in unsigned int label, + __in boolean_t packed_stream); void ef10_ev_rxlabel_fini( @@ -685,6 +686,22 @@ ef10_tx_qpush( __in unsigned int added, __in unsigned int pushed); +#if EFSYS_OPT_RX_PACKED_STREAM +extern void +ef10_rx_qpush_ps_credits( + __in efx_rxq_t *erp); + +extern __checkReturn uint8_t * +ef10_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp); +#endif + extern __checkReturn efx_rc_t ef10_tx_qpace( __in efx_txq_t *etp, @@ -1131,6 +1148,35 @@ ef10_external_port_mapping( __in uint32_t port, __out uint8_t *external_portp); +#if EFSYS_OPT_RX_PACKED_STREAM + +/* Data space per credit in packed stream mode */ +#define EFX_RX_PACKED_STREAM_MEM_PER_CREDIT (1 << 16) + +/* + * Received packets are always aligned at this boundary. Also there always + * exists a gap of this size between packets. + * (see SF-112241-TC, 4.5) + */ +#define EFX_RX_PACKED_STREAM_ALIGNMENT 64 + +/* + * Size of a pseudo-header prepended to received packets + * in packed stream mode + */ +#define EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE 8 + +/* Minimum space for packet in packed stream mode */ +#define EFX_RX_PACKED_STREAM_MIN_PACKET_SPACE \ + P2ROUNDUP(EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE + \ + EFX_MAC_PDU_MIN + \ + EFX_RX_PACKED_STREAM_ALIGNMENT, \ + EFX_RX_PACKED_STREAM_ALIGNMENT) + +/* Maximum number of credits */ +#define EFX_RX_PACKED_STREAM_MAX_CREDITS 127 + +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ #ifdef __cplusplus } Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 22 14:31:35 2018 (r340766) @@ -1072,6 +1072,17 @@ ef10_get_datapath_caps( encp->enc_rx_disable_scatter_supported = CAP_FLAG(flags, RX_DISABLE_SCATTER) ? B_TRUE : B_FALSE; + /* Check if the firmware supports packed stream mode */ + encp->enc_rx_packed_stream_supported = + CAP_FLAG(flags, RX_PACKED_STREAM) ? B_TRUE : B_FALSE; + + /* + * Check if the firmware supports configurable buffer sizes + * for packed stream mode (otherwise buffer size is 1Mbyte) + */ + encp->enc_rx_var_packed_stream_supported = + CAP_FLAG(flags, RX_PACKED_STREAM_VAR_BUFFERS) ? B_TRUE : B_FALSE; + /* Check if the firmware supports set mac with running filters */ encp->enc_allow_set_mac_with_installed_filters = CAP_FLAG(flags, VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED) ? Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/ef10_rx.c Thu Nov 22 14:31:35 2018 (r340766) @@ -46,41 +46,51 @@ efx_mcdi_init_rxq( __in uint32_t label, __in uint32_t instance, __in efsys_mem_t *esmp, - __in boolean_t disable_scatter) + __in boolean_t disable_scatter, + __in uint32_t ps_bufsize) { efx_mcdi_req_t req; - uint8_t payload[ - MC_CMD_INIT_RXQ_IN_LEN(EFX_RXQ_NBUFS(EFX_RXQ_MAXNDESCS))]; + uint8_t payload[MAX(MC_CMD_INIT_RXQ_EXT_IN_LEN, + MC_CMD_INIT_RXQ_EXT_OUT_LEN)]; int npages = EFX_RXQ_NBUFS(size); int i; efx_qword_t *dma_addr; uint64_t addr; efx_rc_t rc; + uint32_t dma_mode; /* If this changes, then the payload size might need to change. */ EFSYS_ASSERT3U(MC_CMD_INIT_RXQ_OUT_LEN, ==, 0); EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS); + if (ps_bufsize > 0) + dma_mode = MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM; + else + dma_mode = MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET; + (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_RXQ; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_INIT_RXQ_IN_LEN(npages); + req.emr_in_length = MC_CMD_INIT_RXQ_EXT_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_INIT_RXQ_OUT_LEN; + req.emr_out_length = MC_CMD_INIT_RXQ_EXT_OUT_LEN; - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_SIZE, size); - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_TARGET_EVQ, target_evq); - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_LABEL, label); - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_INSTANCE, instance); - MCDI_IN_POPULATE_DWORD_6(req, INIT_RXQ_IN_FLAGS, - INIT_RXQ_IN_FLAG_BUFF_MODE, 0, - INIT_RXQ_IN_FLAG_HDR_SPLIT, 0, - INIT_RXQ_IN_FLAG_TIMESTAMP, 0, - INIT_RXQ_IN_CRC_MODE, 0, - INIT_RXQ_IN_FLAG_PREFIX, 1, - INIT_RXQ_IN_FLAG_DISABLE_SCATTER, disable_scatter); - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_OWNER_ID, 0); - MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_SIZE, size); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_TARGET_EVQ, target_evq); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_LABEL, label); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_INSTANCE, instance); + MCDI_IN_POPULATE_DWORD_8(req, INIT_RXQ_EXT_IN_FLAGS, + INIT_RXQ_EXT_IN_FLAG_BUFF_MODE, 0, + INIT_RXQ_EXT_IN_FLAG_HDR_SPLIT, 0, + INIT_RXQ_EXT_IN_FLAG_TIMESTAMP, 0, + INIT_RXQ_EXT_IN_CRC_MODE, 0, + INIT_RXQ_EXT_IN_FLAG_PREFIX, 1, + INIT_RXQ_EXT_IN_FLAG_DISABLE_SCATTER, disable_scatter, + INIT_RXQ_EXT_IN_DMA_MODE, + dma_mode, + INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE, ps_bufsize); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_OWNER_ID, 0); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); dma_addr = MCDI_IN2(req, efx_qword_t, INIT_RXQ_IN_DMA_ADDR); addr = EFSYS_MEM_ADDR(esmp); @@ -707,6 +717,95 @@ ef10_rx_qpush( erp->er_index, &dword, B_FALSE); } +#if EFSYS_OPT_RX_PACKED_STREAM + + void +ef10_rx_qpush_ps_credits( + __in efx_rxq_t *erp) +{ + efx_nic_t *enp = erp->er_enp; + efx_dword_t dword; + efx_evq_rxq_state_t *rxq_state = + &erp->er_eep->ee_rxq_state[erp->er_label]; + uint32_t credits; + + EFSYS_ASSERT(rxq_state->eers_rx_packed_stream); + + if (rxq_state->eers_rx_packed_stream_credits == 0) + return; + + /* + * It is a bug if we think that FW has utilized more + * credits than it is allowed to have (maximum). However, + * make sure that we do not credit more than maximum anyway. + */ + credits = MIN(rxq_state->eers_rx_packed_stream_credits, + EFX_RX_PACKED_STREAM_MAX_CREDITS); + EFX_POPULATE_DWORD_3(dword, + ERF_DZ_RX_DESC_MAGIC_DOORBELL, 1, + ERF_DZ_RX_DESC_MAGIC_CMD, + ERE_DZ_RX_DESC_MAGIC_CMD_PS_CREDITS, + ERF_DZ_RX_DESC_MAGIC_DATA, credits); + EFX_BAR_TBL_WRITED(enp, ER_DZ_RX_DESC_UPD_REG, + erp->er_index, &dword, B_FALSE); + + rxq_state->eers_rx_packed_stream_credits = 0; +} + +/* + * In accordance with SF-112241-TC the received data has the following layout: + * - 8 byte pseudo-header which consist of: + * - 4 byte little-endian timestamp + * - 2 byte little-endian captured length in bytes + * - 2 byte little-endian original packet length in bytes + * - captured packet bytes + * - optional padding to align to 64 bytes boundary + * - 64 bytes scratch space for the host software + */ + __checkReturn uint8_t * +ef10_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp) +{ + uint16_t buf_len; + uint8_t *pkt_start; + efx_qword_t *qwordp; + efx_evq_rxq_state_t *rxq_state = + &erp->er_eep->ee_rxq_state[erp->er_label]; + + EFSYS_ASSERT(rxq_state->eers_rx_packed_stream); + + buffer += current_offset; + pkt_start = buffer + EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE; + + qwordp = (efx_qword_t *)buffer; + *timestamp = EFX_QWORD_FIELD(*qwordp, ES_DZ_PS_RX_PREFIX_TSTAMP); + *lengthp = EFX_QWORD_FIELD(*qwordp, ES_DZ_PS_RX_PREFIX_ORIG_LEN); + buf_len = EFX_QWORD_FIELD(*qwordp, ES_DZ_PS_RX_PREFIX_CAP_LEN); + + buf_len = P2ROUNDUP(buf_len + EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE, + EFX_RX_PACKED_STREAM_ALIGNMENT); + *next_offsetp = + current_offset + buf_len + EFX_RX_PACKED_STREAM_ALIGNMENT; + + EFSYS_ASSERT3U(*next_offsetp, <=, buffer_length); + EFSYS_ASSERT3U(current_offset + *lengthp, <, *next_offsetp); + + if ((*next_offsetp ^ current_offset) & + EFX_RX_PACKED_STREAM_MEM_PER_CREDIT) + rxq_state->eers_rx_packed_stream_credits++; + + return (pkt_start); +} + + +#endif + __checkReturn efx_rc_t ef10_rx_qflush( __in efx_rxq_t *erp) @@ -749,6 +848,7 @@ ef10_rx_qcreate( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_rc_t rc; boolean_t disable_scatter; + unsigned int ps_buf_size; _NOTE(ARGUNUSED(id, erp)) @@ -768,6 +868,51 @@ ef10_rx_qcreate( goto fail2; } + switch (type) { + case EFX_RXQ_TYPE_DEFAULT: + case EFX_RXQ_TYPE_SCATTER: + ps_buf_size = 0; + break; +#if EFSYS_OPT_RX_PACKED_STREAM + case EFX_RXQ_TYPE_PACKED_STREAM_1M: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M; + break; + case EFX_RXQ_TYPE_PACKED_STREAM_512K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_512K; + break; + case EFX_RXQ_TYPE_PACKED_STREAM_256K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_256K; + break; + case EFX_RXQ_TYPE_PACKED_STREAM_128K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_128K; + break; + case EFX_RXQ_TYPE_PACKED_STREAM_64K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_64K; + break; +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ + default: + rc = ENOTSUP; + goto fail3; + } + +#if EFSYS_OPT_RX_PACKED_STREAM + if (ps_buf_size != 0) { + /* Check if datapath firmware supports packed stream mode */ + if (encp->enc_rx_packed_stream_supported == B_FALSE) { + rc = ENOTSUP; + goto fail4; + } + /* Check if packed stream allows configurable buffer sizes */ + if ((type != EFX_RXQ_TYPE_PACKED_STREAM_1M) && + (encp->enc_rx_var_packed_stream_supported == B_FALSE)) { + rc = ENOTSUP; + goto fail5; + } + } +#else /* EFSYS_OPT_RX_PACKED_STREAM */ + EFSYS_ASSERT(ps_buf_size == 0); +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ + /* Scatter can only be disabled if the firmware supports doing so */ if (type == EFX_RXQ_TYPE_SCATTER) disable_scatter = B_FALSE; @@ -775,16 +920,24 @@ ef10_rx_qcreate( disable_scatter = encp->enc_rx_disable_scatter_supported; if ((rc = efx_mcdi_init_rxq(enp, n, eep->ee_index, label, index, - esmp, disable_scatter)) != 0) - goto fail3; + esmp, disable_scatter, ps_buf_size)) != 0) + goto fail6; erp->er_eep = eep; erp->er_label = label; - ef10_ev_rxlabel_init(eep, erp, label); + ef10_ev_rxlabel_init(eep, erp, label, ps_buf_size != 0); return (0); +fail6: + EFSYS_PROBE(fail6); +#if EFSYS_OPT_RX_PACKED_STREAM +fail5: + EFSYS_PROBE(fail5); +fail4: + EFSYS_PROBE(fail4); +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ fail3: EFSYS_PROBE(fail3); fail2: Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efsys.h Thu Nov 22 14:31:35 2018 (r340766) @@ -281,6 +281,8 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t ma #define EFSYS_OPT_ALLOW_UNCONFIGURED_NIC 0 +#define EFSYS_OPT_RX_PACKED_STREAM 0 + /* ID */ typedef struct __efsys_identifier_s efsys_identifier_t; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 22 14:31:35 2018 (r340766) @@ -52,6 +52,9 @@ extern "C" { #define EFX_FIELD_OFFSET(_type, _field) \ ((size_t) &(((_type *)0)->_field)) +/* The macro expands divider twice */ +#define EFX_DIV_ROUND_UP(_n, _d) (((_n) + (_d) - 1) / (_d)) + /* Return codes */ typedef __success(return == 0) int efx_rc_t; @@ -1086,6 +1089,7 @@ efx_bist_stop( #define EFX_FEATURE_PIO_BUFFERS 0x00000800 #define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000 #define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000 +#define EFX_FEATURE_PACKED_STREAM 0x00004000 typedef struct efx_nic_cfg_s { uint32_t enc_board_type; @@ -1181,6 +1185,8 @@ typedef struct efx_nic_cfg_s { boolean_t enc_allow_set_mac_with_installed_filters; boolean_t enc_enhanced_set_mac_supported; boolean_t enc_init_evq_v2_supported; + boolean_t enc_rx_packed_stream_supported; + boolean_t enc_rx_var_packed_stream_supported; boolean_t enc_pm_and_rxdp_counters; boolean_t enc_mac_stats_40g_tx_size_bins; /* External port identifier */ @@ -1622,6 +1628,16 @@ typedef __checkReturn boolean_t #define EFX_ADDR_MISMATCH 0x4000 #define EFX_DISCARD 0x8000 +/* + * The following flags are used only for packed stream + * mode. The values for the flags are reused to fit into 16 bit, + * since EFX_PKT_START and EFX_PKT_CONT are never used in + * packed stream mode + */ +#define EFX_PKT_PACKED_STREAM_NEW_BUFFER EFX_PKT_START +#define EFX_PKT_PACKED_STREAM_PARSE_INCOMPLETE EFX_PKT_CONT + + #define EFX_EV_RX_NLABELS 32 #define EFX_EV_TX_NLABELS 32 @@ -1633,7 +1649,29 @@ typedef __checkReturn boolean_t __in uint32_t size, __in uint16_t flags); +#if EFSYS_OPT_RX_PACKED_STREAM + +/* + * Packed stream mode is documented in SF-112241-TC. + * The general idea is that, instead of putting each incoming + * packet into a separate buffer which is specified in a RX + * descriptor, a large buffer is provided to the hardware and + * packets are put there in a continuous stream. + * The main advantage of such an approach is that RX queue refilling + * happens much less frequently. + */ + typedef __checkReturn boolean_t +(*efx_rx_ps_ev_t)( + __in_opt void *arg, + __in uint32_t label, + __in uint32_t id, + __in uint32_t pkt_count, + __in uint16_t flags); + +#endif + +typedef __checkReturn boolean_t (*efx_tx_ev_t)( __in_opt void *arg, __in uint32_t label, @@ -1722,6 +1760,9 @@ typedef __checkReturn boolean_t typedef struct efx_ev_callbacks_s { efx_initialized_ev_t eec_initialized; efx_rx_ev_t eec_rx; +#if EFSYS_OPT_RX_PACKED_STREAM + efx_rx_ps_ev_t eec_rx_ps; +#endif efx_tx_ev_t eec_tx; efx_exception_ev_t eec_exception; efx_rxq_flush_done_ev_t eec_rxq_flush_done; @@ -1900,6 +1941,11 @@ efx_pseudo_hdr_pkt_length_get( typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, EFX_RXQ_TYPE_SCATTER, + EFX_RXQ_TYPE_PACKED_STREAM_1M, + EFX_RXQ_TYPE_PACKED_STREAM_512K, + EFX_RXQ_TYPE_PACKED_STREAM_256K, + EFX_RXQ_TYPE_PACKED_STREAM_128K, + EFX_RXQ_TYPE_PACKED_STREAM_64K, EFX_RXQ_NTYPES } efx_rxq_type_t; @@ -1939,6 +1985,29 @@ efx_rx_qpush( __in efx_rxq_t *erp, __in unsigned int added, __inout unsigned int *pushedp); + +#if EFSYS_OPT_RX_PACKED_STREAM + +/* + * Fake length for RXQ descriptors in packed stream mode + * to make hardware happy + */ +#define EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32 + +extern void +efx_rx_qpush_ps_credits( + __in efx_rxq_t *erp); + +extern __checkReturn uint8_t * +efx_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp); +#endif extern __checkReturn efx_rc_t efx_rx_qflush( Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx_check.h Thu Nov 22 14:31:35 2018 (r340766) @@ -339,5 +339,11 @@ # endif #endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */ +/* Support packed stream mode */ +#if EFSYS_OPT_RX_PACKED_STREAM +# if !(EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "PACKED_STREAM requires HUNTINGTON or MEDFORD" +# endif +#endif #endif /* _SYS_EFX_CHECK_H */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Nov 22 14:31:35 2018 (r340766) @@ -170,6 +170,12 @@ typedef struct efx_rx_ops_s { unsigned int, unsigned int, unsigned int); void (*erxo_qpush)(efx_rxq_t *, unsigned int, unsigned int *); +#if EFSYS_OPT_RX_PACKED_STREAM + void (*erxo_qpush_ps_credits)(efx_rxq_t *); + uint8_t * (*erxo_qps_packet_info)(efx_rxq_t *, uint8_t *, + uint32_t, uint32_t, + uint16_t *, uint32_t *, uint32_t *); +#endif efx_rc_t (*erxo_qflush)(efx_rxq_t *); void (*erxo_qenable)(efx_rxq_t *); efx_rc_t (*erxo_qcreate)(efx_nic_t *enp, unsigned int, @@ -694,6 +700,11 @@ typedef boolean_t (*efx_ev_handler_t)(efx_evq_t *, efx typedef struct efx_evq_rxq_state_s { unsigned int eers_rx_read_ptr; unsigned int eers_rx_mask; +#if EFSYS_OPT_RX_PACKED_STREAM + unsigned int eers_rx_stream_npackets; + boolean_t eers_rx_packed_stream; + unsigned int eers_rx_packed_stream_credits; +#endif } efx_evq_rxq_state_t; struct efx_evq_s { Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx_nic.c Thu Nov 22 14:31:35 2018 (r340766) @@ -289,7 +289,8 @@ efx_nic_create( EFX_FEATURE_MCDI_DMA | EFX_FEATURE_PIO_BUFFERS | EFX_FEATURE_FW_ASSISTED_TSO | - EFX_FEATURE_FW_ASSISTED_TSO_V2; + EFX_FEATURE_FW_ASSISTED_TSO_V2 | + EFX_FEATURE_PACKED_STREAM; break; #endif /* EFSYS_OPT_HUNTINGTON */ @@ -308,7 +309,8 @@ efx_nic_create( EFX_FEATURE_MAC_HEADER_FILTERS | EFX_FEATURE_MCDI_DMA | EFX_FEATURE_PIO_BUFFERS | - EFX_FEATURE_FW_ASSISTED_TSO_V2; + EFX_FEATURE_FW_ASSISTED_TSO_V2 | + EFX_FEATURE_PACKED_STREAM; break; #endif /* EFSYS_OPT_MEDFORD */ Modified: head/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_ef10.h Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx_regs_ef10.h Thu Nov 22 14:31:35 2018 (r340766) @@ -169,7 +169,6 @@ extern "C" { #define ERF_DZ_RX_DESC_WPTR_LBN 0 #define ERF_DZ_RX_DESC_WPTR_WIDTH 12 - /* * TX_DESC_UPD_REG(96bit): * @@ -543,6 +542,31 @@ extern "C" { #define ERF_DD_EVQ_IND_TIMER_VAL_LBN 0 #define ERF_DD_EVQ_IND_TIMER_VAL_WIDTH 8 +/* Packed stream magic doorbell command */ +#define ERF_DZ_RX_DESC_MAGIC_DOORBELL_LBN 11 +#define ERF_DZ_RX_DESC_MAGIC_DOORBELL_WIDTH 1 + +#define ERF_DZ_RX_DESC_MAGIC_CMD_LBN 8 +#define ERF_DZ_RX_DESC_MAGIC_CMD_WIDTH 3 +#define ERE_DZ_RX_DESC_MAGIC_CMD_PS_CREDITS 0 + +#define ERF_DZ_RX_DESC_MAGIC_DATA_LBN 0 +#define ERF_DZ_RX_DESC_MAGIC_DATA_WIDTH 8 + +/* Packed stream RX packet prefix */ +#define ES_DZ_PS_RX_PREFIX_TSTAMP_LBN 0 +#define ES_DZ_PS_RX_PREFIX_TSTAMP_WIDTH 32 +#define ES_DZ_PS_RX_PREFIX_CAP_LEN_LBN 32 +#define ES_DZ_PS_RX_PREFIX_CAP_LEN_WIDTH 16 +#define ES_DZ_PS_RX_PREFIX_ORIG_LEN_LBN 48 +#define ES_DZ_PS_RX_PREFIX_ORIG_LEN_WIDTH 16 + +/* + * An extra flag for the packed stream mode, + * signalling the start of a new buffer + */ +#define ESF_DZ_RX_EV_ROTATE_LBN 53 +#define ESF_DZ_RX_EV_ROTATE_WIDTH 1 #ifdef __cplusplus } Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/efx_rx.c Thu Nov 22 14:31:35 2018 (r340766) @@ -103,6 +103,22 @@ siena_rx_qpush( __in unsigned int added, __inout unsigned int *pushedp); +#if EFSYS_OPT_RX_PACKED_STREAM +static void +siena_rx_qpush_ps_credits( + __in efx_rxq_t *erp); + +static __checkReturn uint8_t * +siena_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp); +#endif + static __checkReturn efx_rc_t siena_rx_qflush( __in efx_rxq_t *erp); @@ -146,6 +162,10 @@ static const efx_rx_ops_t __efx_rx_siena_ops = { siena_rx_prefix_pktlen, /* erxo_prefix_pktlen */ siena_rx_qpost, /* erxo_qpost */ siena_rx_qpush, /* erxo_qpush */ +#if EFSYS_OPT_RX_PACKED_STREAM + siena_rx_qpush_ps_credits, /* erxo_qpush_ps_credits */ + siena_rx_qps_packet_info, /* erxo_qps_packet_info */ +#endif siena_rx_qflush, /* erxo_qflush */ siena_rx_qenable, /* erxo_qenable */ siena_rx_qcreate, /* erxo_qcreate */ @@ -169,6 +189,10 @@ static const efx_rx_ops_t __efx_rx_ef10_ops = { ef10_rx_prefix_pktlen, /* erxo_prefix_pktlen */ ef10_rx_qpost, /* erxo_qpost */ ef10_rx_qpush, /* erxo_qpush */ +#if EFSYS_OPT_RX_PACKED_STREAM + ef10_rx_qpush_ps_credits, /* erxo_qpush_ps_credits */ + ef10_rx_qps_packet_info, /* erxo_qps_packet_info */ +#endif ef10_rx_qflush, /* erxo_qflush */ ef10_rx_qenable, /* erxo_qenable */ ef10_rx_qcreate, /* erxo_qcreate */ @@ -430,7 +454,41 @@ efx_rx_qpost( erxop->erxo_qpost(erp, addrp, size, n, completed, added); } +#if EFSYS_OPT_RX_PACKED_STREAM + void +efx_rx_qpush_ps_credits( + __in efx_rxq_t *erp) +{ + efx_nic_t *enp = erp->er_enp; + const efx_rx_ops_t *erxop = enp->en_erxop; + + EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC); + + erxop->erxo_qpush_ps_credits(erp); +} + + __checkReturn uint8_t * +efx_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp) +{ + efx_nic_t *enp = erp->er_enp; + const efx_rx_ops_t *erxop = enp->en_erxop; + + return (erxop->erxo_qps_packet_info(erp, buffer, + buffer_length, current_offset, lengthp, + next_offsetp, timestamp)); +} + +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ + + void efx_rx_qpush( __in efx_rxq_t *erp, __in unsigned int added, @@ -1075,6 +1133,32 @@ siena_rx_qpush( EFX_BAR_TBL_WRITED3(enp, FR_BZ_RX_DESC_UPD_REGP0, erp->er_index, &dword, B_FALSE); } + +#if EFSYS_OPT_RX_PACKED_STREAM +static void +siena_rx_qpush_ps_credits( + __in efx_rxq_t *erp) +{ + /* Not supported by Siena hardware */ + EFSYS_ASSERT(0); +} + +static uint8_t * +siena_rx_qps_packet_info( + __in efx_rxq_t *erp, + __in uint8_t *buffer, + __in uint32_t buffer_length, + __in uint32_t current_offset, + __out uint16_t *lengthp, + __out uint32_t *next_offsetp, + __out uint32_t *timestamp) +{ + /* Not supported by Siena hardware */ + EFSYS_ASSERT(0); + + return (NULL); +} +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ static __checkReturn efx_rc_t siena_rx_qflush( Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Nov 22 14:10:46 2018 (r340765) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Nov 22 14:31:35 2018 (r340766) @@ -167,6 +167,8 @@ siena_board_cfg( encp->enc_fw_assisted_tso_v2_enabled = B_FALSE; encp->enc_fw_assisted_tso_v2_n_contexts = 0; encp->enc_allow_set_mac_with_installed_filters = B_TRUE; + encp->enc_rx_packed_stream_supported = B_FALSE; + encp->enc_rx_var_packed_stream_supported = B_FALSE; /* Siena supports two 10G ports, and 8 lanes of PCIe Gen2 */ encp->enc_required_pcie_bandwidth_mbps = 2 * 10000; From owner-svn-src-head@freebsd.org Thu Nov 22 16:15:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D849114B6F6; Thu, 22 Nov 2018 16:15:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7AF97BB42; Thu, 22 Nov 2018 16:15:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95D50122EA; Thu, 22 Nov 2018 16:15:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMGFQ0d069249; Thu, 22 Nov 2018 16:15:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMGFPLT069239; Thu, 22 Nov 2018 16:15:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811221615.wAMGFPLT069239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 22 Nov 2018 16:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340767 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 340767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7AF97BB42 X-Spamd-Result: default: False [1.10 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.51)[0.514,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.17)[0.169,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:15:27 -0000 Author: arybchik Date: Thu Nov 22 16:15:24 2018 New Revision: 340767 URL: https://svnweb.freebsd.org/changeset/base/340767 Log: sfxge(4): limit max TXQ size on Medford to 2048 Queues with 4096 descriptors are not supported as the top bit is used for vfifo stuffing. Submitted by: Mark Spender Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D8948 Modified: head/sys/dev/sfxge/common/ef10_tx.c (contents, props changed) head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford_nic.c head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/sfxge.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/ef10_tx.c Thu Nov 22 16:15:24 2018 (r340767) @@ -67,7 +67,7 @@ efx_mcdi_init_txq( efx_rc_t rc; EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >= - EFX_TXQ_NBUFS(EFX_TXQ_MAXNDESCS(&enp->en_nic_cfg))); + EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs)); npages = EFX_TXQ_NBUFS(size); if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) { Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 22 16:15:24 2018 (r340767) @@ -1111,6 +1111,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_evq_limit; uint32_t enc_txq_limit; uint32_t enc_rxq_limit; + uint32_t enc_txq_max_ndescs; uint32_t enc_buftbl_limit; uint32_t enc_piobuf_limit; uint32_t enc_piobuf_size; @@ -2045,12 +2046,6 @@ efx_tx_init( extern void efx_tx_fini( __in efx_nic_t *enp); - -#define EFX_BUG35388_WORKAROUND(_encp) \ - (((_encp) == NULL) ? 1 : ((_encp)->enc_bug35388_workaround != 0)) - -#define EFX_TXQ_MAXNDESCS(_encp) \ - ((EFX_BUG35388_WORKAROUND(_encp)) ? 2048 : 4096) #define EFX_TXQ_MINNDESCS 512 Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/efx_tx.c Thu Nov 22 16:15:24 2018 (r340767) @@ -913,7 +913,7 @@ siena_tx_qcreate( (1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS); - EFSYS_ASSERT(ISP2(EFX_TXQ_MAXNDESCS(encp))); + EFSYS_ASSERT(ISP2(encp->enc_txq_max_ndescs)); EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS)); if (!ISP2(n) || (n < EFX_TXQ_MINNDESCS) || (n > EFX_EVQ_MAXNEVS)) { @@ -925,7 +925,7 @@ siena_tx_qcreate( goto fail2; } for (size = 0; - (1 << size) <= (EFX_TXQ_MAXNDESCS(encp) / EFX_TXQ_MINNDESCS); + (1 << size) <= (int)(encp->enc_txq_max_ndescs / EFX_TXQ_MINNDESCS); size++) if ((1 << size) == (int)(n / EFX_TXQ_MINNDESCS)) break; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/hunt_nic.c Thu Nov 22 16:15:24 2018 (r340767) @@ -318,6 +318,12 @@ hunt_board_cfg( encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; + /* + * The workaround for bug35388 uses the top bit of transmit queue + * descriptor writes, preventing the use of 4096 descriptor TXQs. + */ + encp->enc_txq_max_ndescs = encp->enc_bug35388_workaround ? 2048 : 4096; + encp->enc_buftbl_limit = 0xFFFFFFFF; encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/medford_nic.c Thu Nov 22 16:15:24 2018 (r340767) @@ -315,6 +315,13 @@ medford_board_cfg( encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; + /* + * The maximum supported transmit queue size is 2048. TXQs with 4096 + * descriptors are not supported as the top bit is used for vfifo + * stuffing. + */ + encp->enc_txq_max_ndescs = 2048; + encp->enc_buftbl_limit = 0xFFFFFFFF; encp->enc_piobuf_limit = MEDFORD_PIOBUF_NBUFS; Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/common/siena_nic.c Thu Nov 22 16:15:24 2018 (r340767) @@ -158,6 +158,8 @@ siena_board_cfg( encp->enc_rxq_limit = MIN(EFX_RXQ_LIMIT_TARGET, nrxq); encp->enc_txq_limit = MIN(EFX_TXQ_LIMIT_TARGET, ntxq); + encp->enc_txq_max_ndescs = 4096; + encp->enc_buftbl_limit = SIENA_SRAM_ROWS - (encp->enc_txq_limit * EFX_TXQ_DC_NDESCS(EFX_TXQ_DC_SIZE)) - (encp->enc_rxq_limit * EFX_RXQ_DC_NDESCS(EFX_RXQ_DC_SIZE)); Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Thu Nov 22 14:31:35 2018 (r340766) +++ head/sys/dev/sfxge/sfxge.c Thu Nov 22 16:15:24 2018 (r340767) @@ -764,10 +764,10 @@ sfxge_create(struct sfxge_softc *sc) if (!ISP2(sfxge_tx_ring_entries) || (sfxge_tx_ring_entries < EFX_TXQ_MINNDESCS) || - (sfxge_tx_ring_entries > EFX_TXQ_MAXNDESCS(efx_nic_cfg_get(enp)))) { + (sfxge_tx_ring_entries > efx_nic_cfg_get(enp)->enc_txq_max_ndescs)) { log(LOG_ERR, "%s=%d must be power of 2 from %u to %u", SFXGE_PARAM_TX_RING, sfxge_tx_ring_entries, - EFX_TXQ_MINNDESCS, EFX_TXQ_MAXNDESCS(efx_nic_cfg_get(enp))); + EFX_TXQ_MINNDESCS, efx_nic_cfg_get(enp)->enc_txq_max_ndescs); error = EINVAL; goto fail_tx_ring_entries; } From owner-svn-src-head@freebsd.org Thu Nov 22 16:55:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0206114C290; Thu, 22 Nov 2018 16:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56DD27D1E4; Thu, 22 Nov 2018 16:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DBC212948; Thu, 22 Nov 2018 16:55:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMGtA4Q089697; Thu, 22 Nov 2018 16:55:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMGt9p5089696; Thu, 22 Nov 2018 16:55:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811221655.wAMGt9p5089696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 22 Nov 2018 16:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340771 - head/sys/dev/proto X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/proto X-SVN-Commit-Revision: 340771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56DD27D1E4 X-Spamd-Result: default: False [1.04 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.15)[0.153,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:55:11 -0000 Author: emaste Date: Thu Nov 22 16:55:09 2018 New Revision: 340771 URL: https://svnweb.freebsd.org/changeset/base/340771 Log: proto: change device permissions to 0600 C Turt reports that the driver is not thread safe and may have exploitable races. Note that the proto device is intended for prototyping and development, and is not for use on production systems. From the man page: SECURITY CONSIDERATIONS Because programs have direct access to the hardware, the proto driver is inherently insecure. It is not advisable to use this driver on a production machine. The proto device is not included in any of FreeBSD's kernel config files (although the module is built). The issues in the proto device still need to be fixed, and the device is inherently (and intentionally) insecure, but it might as well be limited to root only. admbugs: 782 Reported by: C Turt MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/proto/proto_core.c Modified: head/sys/dev/proto/proto_core.c ============================================================================== --- head/sys/dev/proto/proto_core.c Thu Nov 22 16:53:30 2018 (r340770) +++ head/sys/dev/proto/proto_core.c Thu Nov 22 16:55:09 2018 (r340771) @@ -196,7 +196,7 @@ proto_attach(device_t dev) case SYS_RES_MEMORY: case SYS_RES_IOPORT: r->r_size = rman_get_size(r->r_d.res); - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/%02x.%s", device_get_desc(dev), r->r_rid, (r->r_type == SYS_RES_IOPORT) ? "io" : "mem"); r->r_u.cdev->si_drv1 = sc; @@ -204,7 +204,7 @@ proto_attach(device_t dev) break; case PROTO_RES_PCICFG: r->r_size = 4096; - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/pcicfg", device_get_desc(dev)); r->r_u.cdev->si_drv1 = sc; r->r_u.cdev->si_drv2 = r; @@ -212,7 +212,7 @@ proto_attach(device_t dev) case PROTO_RES_BUSDMA: r->r_d.busdma = proto_busdma_attach(sc); r->r_size = 0; /* no read(2) nor write(2) */ - r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0600, "proto/%s/busdma", device_get_desc(dev)); r->r_u.cdev->si_drv1 = sc; r->r_u.cdev->si_drv2 = r; From owner-svn-src-head@freebsd.org Thu Nov 22 17:28:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFD95114CD82; Thu, 22 Nov 2018 17:28:20 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44B177E1B0; Thu, 22 Nov 2018 17:28:20 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id p17so8125958qtl.5; Thu, 22 Nov 2018 09:28:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=T1K7xBYwwSWIfP8YrBX5MEiwIxTicRn7HRQUi4a/PMk=; b=rycF3iIHGKytC+QL6k84lxEMaZm+vuwmYNBdELj7RGjjPS0ixYCXjcr3IqeTtXAaWf PXUoOzUbOduvP76EuGDdzRwjHf8m5RBf3DfysYZfKorGpHeyCf8XRac5GO8OwbbDwDjL Kz+Mdq+ARvD1bBc7rj+N2b0lPdUlrqA2hHCdA62o3xm/otsA+/1KiVx2jtN6orDz/W06 3nHRZPrJOHRV9uWrD5ryZfikG803UD0Dy4dvaZeopvsmpdY6JYlVNv1BxSxddU2nNKmB Mx6lZ9VWfy21kGy/Wbt9PQTmxKKBJfRtW4ue8IMkkv3ZESlmX/TYnC2rpG4wVXrWh2Tw moLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=T1K7xBYwwSWIfP8YrBX5MEiwIxTicRn7HRQUi4a/PMk=; b=FJrQONlTohv3GZUbaDpPJ/mXOQYVnNEJoL7hXxEzpIl3r/cG/4xc4YpxYhbIX0NzSJ IzYY1Z2s6XRg3GKciBI8tlF/T6MG5aoUFOXSW3DlsKEjJ1iRjfZJQfCVKggafVESetD4 P7FxXj3O5jtpqfoRGfdAnM6jI8qAYXvWCoQwF8cxCunFBAeougLTtcl3yBT8ONYSpEkz YNlqtS6+4KK+RINMF05cNyGFscbINLhkZaoi3cLEHQyoarfcjKLDsjQoz+OcMlEVE2aU QGus6OHhh7DyOlqB8eMGPXyLxCYeGQFfb1j6gOApaTNYee1Uy6VPLj5UOQkPL0ac0/b2 KSqg== X-Gm-Message-State: AGRZ1gK7a7HVnbO0PF+oFfLEdQEihuUMDR88NWSQbbrlOg8MT6rVGNJN mjIdSrYaCy8XOrijS0v2XDG48QpJ+aJ6Wfg0mjs= X-Google-Smtp-Source: AFSGD/Wayi1GmD/67T/mLLPOel2fFN5qMZondQkLQ5J12GwLAhFloutbN8DnFt27NgNPDx0gfRHP2qyjPG6Xdhn6EIk= X-Received: by 2002:ac8:5053:: with SMTP id h19mr10683861qtm.280.1542907699918; Thu, 22 Nov 2018 09:28:19 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac8:784:0:0:0:0:0 with HTTP; Thu, 22 Nov 2018 09:28:19 -0800 (PST) In-Reply-To: References: <201811201458.wAKEwftP033152@repo.freebsd.org> <20181120150756.GD2378@kib.kiev.ua> From: Mateusz Guzik Date: Thu, 22 Nov 2018 18:28:19 +0100 Message-ID: Subject: Re: svn commit: r340676 - in head/sys: kern sys To: Warner Losh Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 44B177E1B0 X-Spamd-Result: default: False [-2.64 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.59)[-0.587,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.21)[ip: (4.77), ipnet: 2607:f8b0::/32(-2.10), asn: 15169(-1.51), country: US(-0.09)]; NEURAL_HAM_LONG(-0.66)[-0.656,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.59)[-0.593,0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_CC(0.00)[gmail.com] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 17:28:21 -0000 On 11/20/18, Warner Losh wrote: > On Tue, Nov 20, 2018 at 8:28 AM Mateusz Guzik wrote: > >> On 11/20/18, Konstantin Belousov wrote: >> >> +#if defined(__mips__) || defined(__powerpc__) >> > Please note what I asked about this #ifdefs in the review. mips >> > and powerpc machine/atomic.h should define some symbol like >> > __ATOMIC_NO_64_OPS and this case should be handled in less >> > arch-explicit >> > manner. >> > >> >> Right, should have mentioned that in the commit message. >> >> Anyhow, mips has some degree of 64 bit ops even for 32 bits so >> this becomes more iffy. In particular it does have atomic_add_64. >> I don't have a good way to test mips atomics and since non-atomic >> version for powerpc was needed anyway I decided not to try to >> add one. >> > > I thought the 64-bit stuff was not present in true 32-bit mips at all. You > need the lld/scd instructions to do 64-bit atomics which are only available > in a 64-bit environment (eg n32 or n64 execution). They throw a fatal > machine error if you execute them in o32 land. > > And I think the proper ifdef for this is defined(mips) && > !defined(__mips_n64) && !defined(__mips_n32) or something horrible like > that to not pessimize 64-bit executions. > And powerpc will require something of similar sort (as reported by Mark MIllard). It gets quite ugly indeed. I don't have strong opinion how to express the ifdefs, I think this is least bad if sticking to a mi header: diff --git a/sys/sys/systm.h b/sys/sys/systm.h index a1b98c5660c..fab94ee7979 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -523,7 +523,11 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); -#if defined(__mips__) || defined(__powerpc__) +#if defined(mips) && !defined(__mips_n64) && !defined(__mips_n32) +#define UNR64_LOCKED +#endif + +#if defined(__powerpc__) && !defined(__powerpc64__) #define UNR64_LOCKED #endif -- Mateusz Guzik From owner-svn-src-head@freebsd.org Thu Nov 22 17:42:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0029811022FC for ; Thu, 22 Nov 2018 17:42:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x12a.google.com (mail-it1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 319277EAA0 for ; Thu, 22 Nov 2018 17:42:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x12a.google.com with SMTP id h65so14820928ith.3 for ; Thu, 22 Nov 2018 09:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F9TdPOedxco+Cf6ygcxyxsJI+rHiqW8tRV6IC/Xvo9Y=; b=1KLPK3a7+nyrCGyN93vL1jkj3CTAqPnRhX3HplnaPLG6RRH9K9fO9BuxsALuBCWFg5 TQoXfsmXg9FRfRrg8jLmKvNjLnbL9kDDBYSc7K5nv8OXa6tWDp0Z9BBx2CCtIYy73DR5 ozjcunTx6TnB39MBDn6ZptrAZm7X3jZYrXd4Q96quw7rjXNqz42qNRtM2GPYZpR1HTFG 4eCAx+c0AUiCPUB6QOXAmELF44ertLaJ6F/6/uIBmOxZ0W8Zl9JEjoCWFtZjjUwsT/6t buVNrtyNNFEmfON+EiZ4Ky8NWAquwGo6ISulUnThHLmW92ycLc98oEojbQ8XB6IV2knP yaOQ== 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=F9TdPOedxco+Cf6ygcxyxsJI+rHiqW8tRV6IC/Xvo9Y=; b=PWFQBLbev18NxZ0PAZztjIfCjyWOu12LPNaaNCNgUADPbbFg6D/o0CZ1tNNGviXFyc ghLAwCLxnHWglf8W8UiSFIkQkiHRaiqKILSBc19zKLjUFpXaUj2lfD5SsnytRPu8orwC K6N8hmPx0kBI2PgW4iJRjfvYIXi10fOmbHajMgMEv9S7wRSsa2PhJrQMDS3VK0IzzX21 1H0aSKqYcfbptf+CtS41alIL13PFX0dNh6IMOlvCHOKnxxVxaoUxsFrynksfm8Xvc/Xn fEC3Cvb/JRi4NDuQhr1s03UEO63J6CzwXvVAwAXhMRp77mqInKn7gHEqnpWG0YeOilXL 3OVg== X-Gm-Message-State: AGRZ1gIC62YLXM922/8tllweg++V1paoyRBPCqSrL3PkMODAk4i0dQly kin/ADB91/JFcohbr5aDXIu8Y0zqGlN1rKjsExOQjQ== X-Google-Smtp-Source: AJdET5dBIGUb3Y3BF50eEIw2FaIWv4RtnY1hUDoKTb0KECr/Eip4iIWlFNhCN19ahvRWcNuKGQsnjdr9ZcMylU+GA3g= X-Received: by 2002:a24:3796:: with SMTP id r144-v6mr10151975itr.79.1542908545237; Thu, 22 Nov 2018 09:42:25 -0800 (PST) MIME-Version: 1.0 References: <201811201458.wAKEwftP033152@repo.freebsd.org> <20181120150756.GD2378@kib.kiev.ua> In-Reply-To: From: Warner Losh Date: Thu, 22 Nov 2018 10:42:14 -0700 Message-ID: Subject: Re: svn commit: r340676 - in head/sys: kern sys To: Mateusz Guzik Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 319277EAA0 X-Spamd-Result: default: False [-4.65 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[a.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.66)[ip: (-4.62), ipnet: 2607:f8b0::/32(-2.10), asn: 15169(-1.51), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_CC(0.00)[gmail.com] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 17:42:27 -0000 On Thu, Nov 22, 2018 at 10:28 AM Mateusz Guzik wrote: > On 11/20/18, Warner Losh wrote: > > On Tue, Nov 20, 2018 at 8:28 AM Mateusz Guzik wrote: > > > >> On 11/20/18, Konstantin Belousov wrote: > >> >> +#if defined(__mips__) || defined(__powerpc__) > >> > Please note what I asked about this #ifdefs in the review. mips > >> > and powerpc machine/atomic.h should define some symbol like > >> > __ATOMIC_NO_64_OPS and this case should be handled in less > >> > arch-explicit > >> > manner. > >> > > >> > >> Right, should have mentioned that in the commit message. > >> > >> Anyhow, mips has some degree of 64 bit ops even for 32 bits so > >> this becomes more iffy. In particular it does have atomic_add_64. > >> I don't have a good way to test mips atomics and since non-atomic > >> version for powerpc was needed anyway I decided not to try to > >> add one. > >> > > > > I thought the 64-bit stuff was not present in true 32-bit mips at all. > You > > need the lld/scd instructions to do 64-bit atomics which are only > available > > in a 64-bit environment (eg n32 or n64 execution). They throw a fatal > > machine error if you execute them in o32 land. > > > > And I think the proper ifdef for this is defined(mips) && > > !defined(__mips_n64) && !defined(__mips_n32) or something horrible like > > that to not pessimize 64-bit executions. > > > > And powerpc will require something of similar sort (as reported by Mark > MIllard). It gets quite ugly indeed. > > I don't have strong opinion how to express the ifdefs, I think this is > least > bad if sticking to a mi header: > > diff --git a/sys/sys/systm.h b/sys/sys/systm.h > index a1b98c5660c..fab94ee7979 100644 > --- a/sys/sys/systm.h > +++ b/sys/sys/systm.h > @@ -523,7 +523,11 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); > int alloc_unrl(struct unrhdr *uh); > void free_unr(struct unrhdr *uh, u_int item); > > -#if defined(__mips__) || defined(__powerpc__) > +#if defined(mips) && !defined(__mips_n64) && !defined(__mips_n32) > +#define UNR64_LOCKED > +#endif > + > +#if defined(__powerpc__) && !defined(__powerpc64__) > #define UNR64_LOCKED > #endif > We should move the defining of this to machine/atomic.h as suggested elsewhere. Once it's more than one phrase long, it makes no sense to pollute the MI header with MD stuff like this. Warner From owner-svn-src-head@freebsd.org Thu Nov 22 17:51:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 500B411024C6; Thu, 22 Nov 2018 17:51:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E79E97F2BA; Thu, 22 Nov 2018 17:51:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8B1B13178; Thu, 22 Nov 2018 17:51:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMHpJBm017720; Thu, 22 Nov 2018 17:51:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMHpJ7K017719; Thu, 22 Nov 2018 17:51:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811221751.wAMHpJ7K017719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 22 Nov 2018 17:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340772 - head/sys/amd64/ia32 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/ia32 X-SVN-Commit-Revision: 340772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E79E97F2BA X-Spamd-Result: default: False [1.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.49)[0.489,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.235,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 17:51:20 -0000 Author: markj Date: Thu Nov 22 17:51:19 2018 New Revision: 340772 URL: https://svnweb.freebsd.org/changeset/base/340772 Log: Clear unused bytes in ia32_osendsig(). Mirror the fix for the native i386 implementation from r218327. This code is compiled only when the non-default COMPAT_43 option is configured. Reported by: Ilja Van Sprundel Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18298 Modified: head/sys/amd64/ia32/ia32_signal.c Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Thu Nov 22 16:55:09 2018 (r340771) +++ head/sys/amd64/ia32/ia32_signal.c Thu Nov 22 17:51:19 2018 (r340772) @@ -364,12 +364,14 @@ ia32_osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc; + bzero(&sf.sf_siginfo, sizeof(sf.sf_siginfo)); if (SIGISMEMBER(psp->ps_siginfo, sig)) { /* Signal handler installed with SA_SIGINFO. */ sf.sf_arg2 = (register_t)&fp->sf_siginfo; sf.sf_siginfo.si_signo = sig; sf.sf_siginfo.si_code = ksi->ksi_code; sf.sf_ah = (uintptr_t)catcher; + sf.sf_addr = 0; } else { /* Old FreeBSD-style arguments. */ sf.sf_arg2 = ksi->ksi_code; From owner-svn-src-head@freebsd.org Thu Nov 22 19:49:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E67811052D4; Thu, 22 Nov 2018 19:49:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8B8D83589; Thu, 22 Nov 2018 19:49:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89A2A14486; Thu, 22 Nov 2018 19:49:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMJnrh3078977; Thu, 22 Nov 2018 19:49:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMJnrm0078975; Thu, 22 Nov 2018 19:49:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811221949.wAMJnrm0078975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 22 Nov 2018 19:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340774 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 340774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A8B8D83589 X-Spamd-Result: default: False [1.32 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.16)[0.158,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 19:49:54 -0000 Author: tuexen Date: Thu Nov 22 19:49:52 2018 New Revision: 340774 URL: https://svnweb.freebsd.org/changeset/base/340774 Log: Ensure that TCP RST-segments announce consistently a receiver window of zero. This was already done when sending them via tcp_respond(). Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D17949 Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Nov 22 18:59:05 2018 (r340773) +++ head/sys/netinet/tcp_output.c Thu Nov 22 19:49:52 2018 (r340774) @@ -1172,14 +1172,18 @@ send: /* * Calculate receive window. Don't shrink window, * but avoid silly window syndrome. + * If a RST segment is sent, advertise a window of zero. */ - if (recwin < (so->so_rcv.sb_hiwat / 4) && - recwin < tp->t_maxseg) + if (flags & TH_RST) { recwin = 0; - if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && - recwin < (tp->rcv_adv - tp->rcv_nxt)) - recwin = (tp->rcv_adv - tp->rcv_nxt); - + } else { + if (recwin < (so->so_rcv.sb_hiwat / 4) && + recwin < tp->t_maxseg) + recwin = 0; + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && + recwin < (tp->rcv_adv - tp->rcv_nxt)) + recwin = (tp->rcv_adv - tp->rcv_nxt); + } /* * According to RFC1323 the window field in a SYN (i.e., a * or ) segment itself is never scaled. The Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 18:59:05 2018 (r340773) +++ head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 19:49:52 2018 (r340774) @@ -8189,15 +8189,20 @@ send: /* * Calculate receive window. Don't shrink window, but avoid silly * window syndrome. + * If a RST segment is sent, advertise a window of zero. */ - if (recwin < (long)(so->so_rcv.sb_hiwat / 4) && - recwin < (long)tp->t_maxseg) + if (flags & TH_RST) { recwin = 0; - if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && - recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) - recwin = (long)(tp->rcv_adv - tp->rcv_nxt); - if (recwin > (long)TCP_MAXWIN << tp->rcv_scale) - recwin = (long)TCP_MAXWIN << tp->rcv_scale; + } else { + if (recwin < (long)(so->so_rcv.sb_hiwat / 4) && + recwin < (long)tp->t_maxseg) + recwin = 0; + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && + recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) + recwin = (long)(tp->rcv_adv - tp->rcv_nxt); + if (recwin > (long)TCP_MAXWIN << tp->rcv_scale) + recwin = (long)TCP_MAXWIN << tp->rcv_scale; + } /* * According to RFC1323 the window field in a SYN (i.e., a or From owner-svn-src-head@freebsd.org Thu Nov 22 19:56:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8C9F11056E0; Thu, 22 Nov 2018 19:56:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2F183BB7; Thu, 22 Nov 2018 19:56:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40D041464E; Thu, 22 Nov 2018 19:56:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMJurQJ083877; Thu, 22 Nov 2018 19:56:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMJurMK083876; Thu, 22 Nov 2018 19:56:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811221956.wAMJurMK083876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 22 Nov 2018 19:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340777 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 340777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E2F183BB7 X-Spamd-Result: default: False [1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.06)[0.059,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 19:56:53 -0000 Author: tuexen Date: Thu Nov 22 19:56:52 2018 New Revision: 340777 URL: https://svnweb.freebsd.org/changeset/base/340777 Log: Ensure that the default RTT stack can make an RTT measurement if the TCP connection was initiated using the RACK stack, but the peer does not support the TCP RACK extension. This ensures that the TCP behaviour on the wire is the same if the TCP connection is initated using the RACK stack or the default stack. Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18032 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 19:56:51 2018 (r340776) +++ head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 19:56:52 2018 (r340777) @@ -8493,9 +8493,7 @@ out: pass, rsm); if ((tp->t_flags & TF_FORCEDATA) == 0 || (rack->rc_in_persist == 0)) { -#ifdef NETFLIX_STATS tcp_seq startseq = tp->snd_nxt; -#endif /* * Advance snd_nxt over sequence space of this segment. @@ -8527,6 +8525,17 @@ out: tp->t_acktime = ticks; } tp->snd_max = tp->snd_nxt; + /* + * Time this transmission if not a retransmission and + * not currently timing anything. + * This is only relevant in case of switching back to + * the base stack. + */ + if (tp->t_rtttime == 0) { + tp->t_rtttime = ticks; + tp->t_rtseq = startseq; + TCPSTAT_INC(tcps_segstimed); + } #ifdef NETFLIX_STATS if (!(tp->t_flags & TF_GPUTINPROG) && len) { tp->t_flags |= TF_GPUTINPROG; From owner-svn-src-head@freebsd.org Thu Nov 22 20:02:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E6F11105EAD; Thu, 22 Nov 2018 20:02:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 004F984936; Thu, 22 Nov 2018 20:02:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD995147FA; Thu, 22 Nov 2018 20:02:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMK2dK3088968; Thu, 22 Nov 2018 20:02:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMK2dlM088967; Thu, 22 Nov 2018 20:02:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811222002.wAMK2dlM088967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 22 Nov 2018 20:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340781 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 340781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 004F984936 X-Spamd-Result: default: False [1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.06)[0.059,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 20:02:40 -0000 Author: tuexen Date: Thu Nov 22 20:02:39 2018 New Revision: 340781 URL: https://svnweb.freebsd.org/changeset/base/340781 Log: Ensure that the TCP RACK stack honours the setting of the net.inet.tcp.drop_synfin sysctl-variable. Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18033 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 20:00:56 2018 (r340780) +++ head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 20:02:39 2018 (r340781) @@ -6528,6 +6528,10 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th TCP_LOG_EVENT(tp, th, &so->so_rcv, &so->so_snd, TCP_LOG_IN, 0, tlen, &log, true); } + if ((thflags & TH_SYN) && (thflags & TH_FIN) && V_drop_synfin) { + way_out = 4; + goto done_with_input; + } /* * Segment received on connection. Reset idle time and keep-alive * timer. XXX: This should be done after segment validation to From owner-svn-src-head@freebsd.org Thu Nov 22 20:05:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D03B1106075; Thu, 22 Nov 2018 20:05:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9CBC84B66; Thu, 22 Nov 2018 20:05:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8508E14826; Thu, 22 Nov 2018 20:05:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMK5vTI089165; Thu, 22 Nov 2018 20:05:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMK5vGu089164; Thu, 22 Nov 2018 20:05:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201811222005.wAMK5vGu089164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 22 Nov 2018 20:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340782 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 340782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9CBC84B66 X-Spamd-Result: default: False [1.18 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_SHORT(0.06)[0.059,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 20:05:58 -0000 Author: tuexen Date: Thu Nov 22 20:05:57 2018 New Revision: 340782 URL: https://svnweb.freebsd.org/changeset/base/340782 Log: A TCP stack is required to check SEG.ACK first, when processing a segment in the SYN-SENT state as stated in Section 3.9 of RFC 793, page 66. Ensure this is also done by the TCP RACK stack. Reviewed by: rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18034 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 20:02:39 2018 (r340781) +++ head/sys/netinet/tcp_stacks/rack.c Thu Nov 22 20:05:57 2018 (r340782) @@ -6533,6 +6533,15 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th goto done_with_input; } /* + * If a segment with the ACK-bit set arrives in the SYN-SENT state + * check SEQ.ACK first as described on page 66 of RFC 793, section 3.9. + */ + if ((tp->t_state == TCPS_SYN_SENT) && (thflags & TH_ACK) && + (SEQ_LEQ(th->th_ack, tp->iss) || SEQ_GT(th->th_ack, tp->snd_max))) { + rack_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen); + return; + } + /* * Segment received on connection. Reset idle time and keep-alive * timer. XXX: This should be done after segment validation to * ignore broken/spoofed segs. From owner-svn-src-head@freebsd.org Thu Nov 22 20:49:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31CDC11074ED; Thu, 22 Nov 2018 20:49:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDC8486D5A; Thu, 22 Nov 2018 20:49:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEEBC14F17; Thu, 22 Nov 2018 20:49:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMKnh7M014586; Thu, 22 Nov 2018 20:49:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMKnf99014576; Thu, 22 Nov 2018 20:49:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811222049.wAMKnf99014576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 22 Nov 2018 20:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340783 - in head/sys: kern netinet netinet6 ofed/drivers/infiniband/ulp/sdp X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern netinet netinet6 ofed/drivers/infiniband/ulp/sdp X-SVN-Commit-Revision: 340783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDC8486D5A X-Spamd-Result: default: False [1.21 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.056,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 20:49:44 -0000 Author: markj Date: Thu Nov 22 20:49:41 2018 New Revision: 340783 URL: https://svnweb.freebsd.org/changeset/base/340783 Log: Plug some networking sysctl leaks. Various network protocol sysctl handlers were not zero-filling their output buffers and thus would export uninitialized stack memory to userland. Fix a number of such handlers. Reported by: Thomas Barabosch, Fraunhofer FKIE Reviewed by: tuexen MFC after: 3 days Security: kernel memory disclosure Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18301 Modified: head/sys/kern/uipc_socket.c head/sys/kern/uipc_usrreq.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_divert.c head/sys/netinet/raw_ip.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/ip6_mroute.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/kern/uipc_socket.c Thu Nov 22 20:49:41 2018 (r340783) @@ -4007,6 +4007,7 @@ void sotoxsocket(struct socket *so, struct xsocket *xso) { + bzero(xso, sizeof(*xso)); xso->xso_len = sizeof *xso; xso->xso_so = (uintptr_t)so; xso->so_type = so->so_type; @@ -4025,8 +4026,6 @@ sotoxsocket(struct socket *so, struct xsocket *xso) xso->so_incqlen = so->sol_incqlen; xso->so_qlimit = so->sol_qlimit; xso->so_oobmark = 0; - bzero(&xso->so_snd, sizeof(xso->so_snd)); - bzero(&xso->so_rcv, sizeof(xso->so_rcv)); } else { xso->so_state |= so->so_qstate; xso->so_qlen = xso->so_incqlen = xso->so_qlimit = 0; Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/kern/uipc_usrreq.c Thu Nov 22 20:49:41 2018 (r340783) @@ -1809,7 +1809,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) /* * OK, now we're committed to doing something. */ - xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK); + xug = malloc(sizeof(*xug), M_TEMP, M_WAITOK | M_ZERO); UNP_LINK_RLOCK(); gencnt = unp_gencnt; n = unp_count; Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/in_pcb.c Thu Nov 22 20:49:41 2018 (r340783) @@ -2883,11 +2883,10 @@ void in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb *xi) { + bzero(xi, sizeof(*xi)); xi->xi_len = sizeof(struct xinpcb); if (inp->inp_socket) sotoxsocket(inp->inp_socket, &xi->xi_socket); - else - bzero(&xi->xi_socket, sizeof(struct xsocket)); bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo)); xi->inp_gencnt = inp->inp_gencnt; xi->inp_ppcb = (uintptr_t)inp->inp_ppcb; Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/ip_divert.c Thu Nov 22 20:49:41 2018 (r340783) @@ -664,6 +664,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/raw_ip.c Thu Nov 22 20:49:41 2018 (r340783) @@ -1060,6 +1060,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) n = V_ripcbinfo.ipi_count; INP_INFO_WUNLOCK(&V_ripcbinfo); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/sctp_sysctl.c Thu Nov 22 20:49:41 2018 (r340783) @@ -395,6 +395,9 @@ sctp_sysctl_handle_assoclist(SYSCTL_HANDLER_ARGS) SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_SYSCTL, EPERM); return (EPERM); } + memset(&xinpcb, 0, sizeof(xinpcb)); + memset(&xstcb, 0, sizeof(xstcb)); + memset(&xraddr, 0, sizeof(xraddr)); LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { SCTP_INP_RLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/tcp_subr.c Thu Nov 22 20:49:41 2018 (r340783) @@ -556,6 +556,7 @@ sysctl_net_inet_list_func_info(SYSCTL_HANDLER_ARGS) cnt++; #endif if (req->oldptr != NULL) { + bzero(&tfi, sizeof(tfi)); tfi.tfi_refcnt = f->tf_fb->tfb_refcnt; tfi.tfi_id = f->tf_fb->tfb_id; (void)strncpy(tfi.tfi_alias, f->tf_name, @@ -2154,6 +2155,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n + m; xig.xig_gen = gencnt; @@ -3215,8 +3217,8 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x struct tcpcb *tp = intotcpcb(inp); sbintime_t now; + bzero(xt, sizeof(*xt)); if (inp->inp_flags & INP_TIMEWAIT) { - bzero(xt, sizeof(struct xtcpcb)); xt->t_state = TCPS_TIME_WAIT; } else { xt->t_state = tp->t_state; @@ -3244,7 +3246,6 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x bcopy(tp->t_fb->tfb_tcp_block_name, xt->xt_stack, TCP_FUNCTION_NAME_LEN_MAX); - bzero(xt->xt_logid, TCP_LOG_ID_LEN); #ifdef TCP_BLACKBOX (void)tcp_log_get_id(tp, xt->xt_logid); #endif Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet/udp_usrreq.c Thu Nov 22 20:49:41 2018 (r340783) @@ -887,6 +887,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = gencnt; Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/netinet6/ip6_mroute.c Thu Nov 22 20:49:41 2018 (r340783) @@ -203,7 +203,8 @@ sysctl_mif6table(SYSCTL_HANDLER_ARGS) struct mif6_sctl *out; int error; - out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, M_WAITOK); + out = malloc(sizeof(struct mif6_sctl) * MAXMIFS, M_TEMP, + M_WAITOK | M_ZERO); for (int i = 0; i < MAXMIFS; i++) { out[i].m6_flags = mif6table[i].m6_flags; out[i].m6_rate_limit = mif6table[i].m6_rate_limit; Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Thu Nov 22 20:05:57 2018 (r340782) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Thu Nov 22 20:49:41 2018 (r340783) @@ -1810,6 +1810,7 @@ sdp_pcblist(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); + bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; xig.xig_count = n; xig.xig_gen = 0; From owner-svn-src-head@freebsd.org Thu Nov 22 21:08:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FB581107E9E; Thu, 22 Nov 2018 21:08:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC74769BD1; Thu, 22 Nov 2018 21:08:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B14771526C; Thu, 22 Nov 2018 21:08:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAML8cSS024703; Thu, 22 Nov 2018 21:08:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAML8cnG024699; Thu, 22 Nov 2018 21:08:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811222108.wAML8cnG024699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 22 Nov 2018 21:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340784 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC74769BD1 X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.332,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 21:08:39 -0000 Author: mjg Date: Thu Nov 22 21:08:37 2018 New Revision: 340784 URL: https://svnweb.freebsd.org/changeset/base/340784 Log: fork: fix use-after-free with vfork The pointer to the child is stored without any reference held. Then it is blindly used to wait until P_PPWAIT is cleared. However, if the child is autoreaped it could have exited and get freed before the parent started waiting. Use the existing hold mechanism to mitigate the problem. Most common case of doing exec remains unchanged. The corner case of doing exit performs wake up before waiting for holds to clear. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18295 Modified: head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/subr_syscall.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Thu Nov 22 20:49:41 2018 (r340783) +++ head/sys/kern/kern_exit.c Thu Nov 22 21:08:37 2018 (r340784) @@ -285,6 +285,15 @@ exit1(struct thread *td, int rval, int signo) wakeup(&p->p_stype); /* + * If P_PPWAIT is set our parent holds us with p_lock and may + * be waiting on p_pwait. + */ + if (p->p_flag & P_PPWAIT) { + p->p_flag &= ~P_PPWAIT; + cv_broadcast(&p->p_pwait); + } + + /* * Wait for any processes that have a hold on our vmspace to * release their reference. */ @@ -329,13 +338,9 @@ exit1(struct thread *td, int rval, int signo) */ EVENTHANDLER_DIRECT_INVOKE(process_exit, p); - /* - * If parent is waiting for us to exit or exec, - * P_PPWAIT is set; we will wakeup the parent below. - */ PROC_LOCK(p); stopprofclock(p); - p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); + p->p_flag &= ~(P_TRACED | P_PPTRACE); p->p_ptevents = 0; /* @@ -636,7 +641,6 @@ exit1(struct thread *td, int rval, int signo) * proc lock. */ wakeup(p->p_pptr); - cv_broadcast(&p->p_pwait); sched_exit(p->p_pptr, td); PROC_SLOCK(p); p->p_state = PRS_ZOMBIE; Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Nov 22 20:49:41 2018 (r340783) +++ head/sys/kern/kern_fork.c Thu Nov 22 21:08:37 2018 (r340784) @@ -725,6 +725,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct */ _PHOLD(p2); if (fr->fr_flags & RFPPWAIT) { + _PHOLD(p2); td->td_pflags |= TDP_RFPPWAIT; td->td_rfppwait_p = p2; td->td_dbgflags |= TDB_VFORK; Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Thu Nov 22 20:49:41 2018 (r340783) +++ head/sys/kern/subr_syscall.c Thu Nov 22 21:08:37 2018 (r340784) @@ -257,6 +257,7 @@ again: } cv_timedwait(&p2->p_pwait, &p2->p_mtx, hz); } + _PRELE(p2); PROC_UNLOCK(p2); if (td->td_dbgflags & TDB_VFORK) { From owner-svn-src-head@freebsd.org Thu Nov 22 21:29:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BEE51108579; Thu, 22 Nov 2018 21:29:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2E816A58D; Thu, 22 Nov 2018 21:29:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE90B155A6; Thu, 22 Nov 2018 21:29:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMLTa0t035032; Thu, 22 Nov 2018 21:29:36 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMLTap8035031; Thu, 22 Nov 2018 21:29:36 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811222129.wAMLTap8035031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 22 Nov 2018 21:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340785 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2E816A58D X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.33)[0.330,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 21:29:37 -0000 Author: mjg Date: Thu Nov 22 21:29:36 2018 New Revision: 340785 URL: https://svnweb.freebsd.org/changeset/base/340785 Log: fork: remove avoidable proc lock/unlock pair We don't have to access the process after making it runnable, so there is no need to hold it either. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_fork.c head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Nov 22 21:08:37 2018 (r340784) +++ head/sys/kern/kern_fork.c Thu Nov 22 21:29:36 2018 (r340785) @@ -719,11 +719,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct if ((fr->fr_flags & RFMEM) == 0 && dtrace_fasttrap_fork) dtrace_fasttrap_fork(p1, p2); #endif - /* - * Hold the process so that it cannot exit after we make it runnable, - * but before we wait for the debugger. - */ - _PHOLD(p2); if (fr->fr_flags & RFPPWAIT) { _PHOLD(p2); td->td_pflags |= TDP_RFPPWAIT; @@ -783,8 +778,12 @@ do_fork(struct thread *td, struct fork_req *fr, struct PROC_UNLOCK(p2); sx_xunlock(&proctree_lock); } - + + racct_proc_fork_done(p2); + if ((fr->fr_flags & RFSTOPPED) == 0) { + if (fr->fr_pidp != NULL) + *fr->fr_pidp = p2->p_pid; /* * If RFSTOPPED not requested, make child runnable and * add to run queue. @@ -793,16 +792,9 @@ do_fork(struct thread *td, struct fork_req *fr, struct TD_SET_CAN_RUN(td2); sched_add(td2, SRQ_BORING); thread_unlock(td2); - if (fr->fr_pidp != NULL) - *fr->fr_pidp = p2->p_pid; } else { *fr->fr_procp = p2; } - - PROC_LOCK(p2); - _PRELE(p2); - racct_proc_fork_done(p2); - PROC_UNLOCK(p2); } int Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Thu Nov 22 21:08:37 2018 (r340784) +++ head/sys/kern/kern_racct.c Thu Nov 22 21:29:36 2018 (r340785) @@ -967,13 +967,13 @@ racct_proc_fork_done(struct proc *child) if (!racct_enable) return; - PROC_LOCK_ASSERT(child, MA_OWNED); - #ifdef RCTL + PROC_LOCK(child); RACCT_LOCK(); rctl_enforce(child, RACCT_NPROC, 0); rctl_enforce(child, RACCT_NTHR, 0); RACCT_UNLOCK(); + PROC_UNLOCK(child); #endif } From owner-svn-src-head@freebsd.org Thu Nov 22 21:38:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 314DA11087CF; Thu, 22 Nov 2018 21:38:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C47D86A991; Thu, 22 Nov 2018 21:38:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99AEB15736; Thu, 22 Nov 2018 21:38:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMLcOVB039890; Thu, 22 Nov 2018 21:38:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMLcOtw039889; Thu, 22 Nov 2018 21:38:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811222138.wAMLcOtw039889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 22 Nov 2018 21:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340786 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C47D86A991 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.33)[0.330,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 21:38:25 -0000 Author: mjg Date: Thu Nov 22 21:38:24 2018 New Revision: 340786 URL: https://svnweb.freebsd.org/changeset/base/340786 Log: Annotate TDP_RFPPWAIT as unlikely. The flag is only set on vfork, but is tested for *all* syscalls. On amd64 this shortens common-case (not vfork) code. Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Thu Nov 22 21:29:36 2018 (r340785) +++ head/sys/kern/subr_syscall.c Thu Nov 22 21:38:24 2018 (r340786) @@ -230,7 +230,7 @@ syscallret(struct thread *td, int error) PROC_UNLOCK(p); } - if (td->td_pflags & TDP_RFPPWAIT) { + if (__predict_false(td->td_pflags & TDP_RFPPWAIT)) { /* * Preserve synchronization semantics of vfork. If * waiting for child to exec or exit, fork set From owner-svn-src-head@freebsd.org Fri Nov 23 00:17:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CE9E1135149; Fri, 23 Nov 2018 00:17:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D667A6EBDD; Fri, 23 Nov 2018 00:17:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B04EC170F9; Fri, 23 Nov 2018 00:17:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN0HlwH021906; Fri, 23 Nov 2018 00:17:47 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN0HlAe021905; Fri, 23 Nov 2018 00:17:47 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811230017.wAN0HlAe021905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 23 Nov 2018 00:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340787 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 340787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D667A6EBDD X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.45)[0.452,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:17:48 -0000 Author: rmacklem Date: Fri Nov 23 00:17:47 2018 New Revision: 340787 URL: https://svnweb.freebsd.org/changeset/base/340787 Log: Make sure the NFS readdir client fills in all "struct dirent" data. The NFS client code (nfsrpc_readdir() and nfsrpc_readdirplus()) wasn't filling in parts of the readdir reply, such as d_pad[01] and the bytes at the end of d_name within d_reclen. As such, data left in a buffer cache block could be leaked to userland in the readdir reply. This patch makes sure all of the data is filled in. Reported by: Thomas Barabosch, Fraunhofer FKIE Reviewed by: kib, markj MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Thu Nov 22 21:38:24 2018 (r340786) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Nov 23 00:17:47 2018 (r340787) @@ -2959,6 +2959,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 return (error); nd->nd_mrep = NULL; dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotfileid; @@ -2978,6 +2979,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 uio_iov_base_add(uiop, dp->d_reclen); uio_iov_len_add(uiop, -(dp->d_reclen)); dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotdotfileid; @@ -3091,6 +3093,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 tlen += 8; /* To ensure null termination. */ left = DIRBLKSIZ - blksiz; if (_GENERIC_DIRLEN(len) + NFSX_HYPER > left) { + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3103,6 +3106,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 bigenough = 0; if (bigenough) { dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_namlen = len; dp->d_reclen = _GENERIC_DIRLEN(len) + @@ -3120,7 +3124,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 goto nfsmout; cp = uio_iov_base(uiop); tlen -= len; - *cp = '\0'; /* null terminate */ + NFSBZERO(cp, tlen); cp += tlen; /* points to cookie storage */ tl2 = (u_int32_t *)cp; uio_iov_base_add(uiop, (tlen + NFSX_HYPER)); @@ -3208,6 +3212,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 */ if (blksiz > 0) { left = DIRBLKSIZ - blksiz; + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3235,10 +3240,8 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 */ while (uio_uio_resid(uiop) > 0 && uio_uio_resid(uiop) != tresid) { dp = (struct dirent *)uio_iov_base(uiop); + NFSBZERO(dp, DIRBLKSIZ); dp->d_type = DT_UNKNOWN; - dp->d_fileno = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; tl = (u_int32_t *)&dp->d_name[4]; *tl++ = cookie.lval[0]; *tl = cookie.lval[1]; @@ -3393,6 +3396,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui return (error); nd->nd_mrep = NULL; dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotfileid; @@ -3412,6 +3416,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui uio_iov_base_add(uiop, dp->d_reclen); uio_iov_len_add(uiop, -(dp->d_reclen)); dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_type = DT_DIR; dp->d_fileno = dotdotfileid; @@ -3506,6 +3511,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui tlen += 8; /* To ensure null termination. */ left = DIRBLKSIZ - blksiz; if (_GENERIC_DIRLEN(len) + NFSX_HYPER > left) { + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3518,6 +3524,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui bigenough = 0; if (bigenough) { dp = (struct dirent *)uio_iov_base(uiop); + dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; dp->d_namlen = len; dp->d_reclen = _GENERIC_DIRLEN(len) + @@ -3538,7 +3545,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui goto nfsmout; cp = uio_iov_base(uiop); tlen -= len; - *cp = '\0'; + NFSBZERO(cp, tlen); cp += tlen; /* points to cookie storage */ tl2 = (u_int32_t *)cp; if (len == 2 && cnp->cn_nameptr[0] == '.' && @@ -3708,6 +3715,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui */ if (blksiz > 0) { left = DIRBLKSIZ - blksiz; + NFSBZERO(uio_iov_base(uiop), left); dp->d_reclen += left; uio_iov_base_add(uiop, left); uio_iov_len_add(uiop, -(left)); @@ -3735,10 +3743,8 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui */ while (uio_uio_resid(uiop) > 0 && uio_uio_resid(uiop) != tresid) { dp = (struct dirent *)uio_iov_base(uiop); + NFSBZERO(dp, DIRBLKSIZ); dp->d_type = DT_UNKNOWN; - dp->d_fileno = 0; - dp->d_namlen = 0; - dp->d_name[0] = '\0'; tl = (u_int32_t *)&dp->d_name[4]; *tl++ = cookie.lval[0]; *tl = cookie.lval[1]; From owner-svn-src-head@freebsd.org Fri Nov 23 03:42:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03A4B1139603; Fri, 23 Nov 2018 03:42:06 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99D4874026; Fri, 23 Nov 2018 03:42:05 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C2B319352; Fri, 23 Nov 2018 03:42:05 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN3g57p028717; Fri, 23 Nov 2018 03:42:05 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN3g5vs028716; Fri, 23 Nov 2018 03:42:05 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201811230342.wAN3g5vs028716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Fri, 23 Nov 2018 03:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340792 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 340792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99D4874026 X-Spamd-Result: default: False [1.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.59)[0.587,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 03:42:06 -0000 Author: ygy (doc committer) Date: Fri Nov 23 03:42:05 2018 New Revision: 340792 URL: https://svnweb.freebsd.org/changeset/base/340792 Log: Fix a minor typo in ipfw(8) manual page. PR: 230747 Submitted by: f.toscan@hotmail.it MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Nov 23 01:07:12 2018 (r340791) +++ head/sbin/ipfw/ipfw.8 Fri Nov 23 03:42:05 2018 (r340792) @@ -4567,7 +4567,7 @@ The ipfw core (ipfw2) has been completely redesigned a reimplemented by Luigi Rizzo in summer 2002. Further actions and -options have been added by various developer over the years. +options have been added by various developers over the years. .Pp .An -nosplit In-kernel NAT support written by From owner-svn-src-head@freebsd.org Fri Nov 23 04:38:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 056F6113A929; Fri, 23 Nov 2018 04:38:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99BFC758B8; Fri, 23 Nov 2018 04:38:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 629F919B9E; Fri, 23 Nov 2018 04:38:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN4cpaX055420; Fri, 23 Nov 2018 04:38:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN4coTa055417; Fri, 23 Nov 2018 04:38:50 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811230438.wAN4coTa055417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 23 Nov 2018 04:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340793 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99BFC758B8 X-Spamd-Result: default: False [1.67 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_SHORT(0.52)[0.517,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 04:38:52 -0000 Author: mjg Date: Fri Nov 23 04:38:50 2018 New Revision: 340793 URL: https://svnweb.freebsd.org/changeset/base/340793 Log: Revert "fork: fix use-after-free with vfork" This unreliably breaks libc handling of vfork where forking succeded, but execve did not. vfork code in libc performs waitpid with WNOHANG in case of failed exec. With the fix exit codepath was waking up the parent before the child fully transitioned to a zombie. Woken up parent would waitpid, which could find a not-yet-zombie child and fail to reap it due to the WNOHANG flag. While removing the flag fixes the problem, it is not an option due to older releases which would still suffer from the kernel change. Revert the fix until a solution can be worked out. Note that while use-after-free which gets back due to the revert is a real bug, it's side-effects are limited due to the fact that struct proc memory is never released by UMA. Modified: head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/subr_syscall.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Fri Nov 23 03:42:05 2018 (r340792) +++ head/sys/kern/kern_exit.c Fri Nov 23 04:38:50 2018 (r340793) @@ -285,15 +285,6 @@ exit1(struct thread *td, int rval, int signo) wakeup(&p->p_stype); /* - * If P_PPWAIT is set our parent holds us with p_lock and may - * be waiting on p_pwait. - */ - if (p->p_flag & P_PPWAIT) { - p->p_flag &= ~P_PPWAIT; - cv_broadcast(&p->p_pwait); - } - - /* * Wait for any processes that have a hold on our vmspace to * release their reference. */ @@ -338,9 +329,13 @@ exit1(struct thread *td, int rval, int signo) */ EVENTHANDLER_DIRECT_INVOKE(process_exit, p); + /* + * If parent is waiting for us to exit or exec, + * P_PPWAIT is set; we will wakeup the parent below. + */ PROC_LOCK(p); stopprofclock(p); - p->p_flag &= ~(P_TRACED | P_PPTRACE); + p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); p->p_ptevents = 0; /* @@ -641,6 +636,7 @@ exit1(struct thread *td, int rval, int signo) * proc lock. */ wakeup(p->p_pptr); + cv_broadcast(&p->p_pwait); sched_exit(p->p_pptr, td); PROC_SLOCK(p); p->p_state = PRS_ZOMBIE; Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Nov 23 03:42:05 2018 (r340792) +++ head/sys/kern/kern_fork.c Fri Nov 23 04:38:50 2018 (r340793) @@ -720,7 +720,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct dtrace_fasttrap_fork(p1, p2); #endif if (fr->fr_flags & RFPPWAIT) { - _PHOLD(p2); td->td_pflags |= TDP_RFPPWAIT; td->td_rfppwait_p = p2; td->td_dbgflags |= TDB_VFORK; Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Fri Nov 23 03:42:05 2018 (r340792) +++ head/sys/kern/subr_syscall.c Fri Nov 23 04:38:50 2018 (r340793) @@ -257,7 +257,6 @@ again: } cv_timedwait(&p2->p_pwait, &p2->p_mtx, hz); } - _PRELE(p2); PROC_UNLOCK(p2); if (td->td_dbgflags & TDB_VFORK) { From owner-svn-src-head@freebsd.org Fri Nov 23 07:26:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B89C2113DAF9; Fri, 23 Nov 2018 07:26:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56DB17A14B; Fri, 23 Nov 2018 07:26:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E4271B6EC; Fri, 23 Nov 2018 07:26:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7Qbax044139; Fri, 23 Nov 2018 07:26:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7Qbmr044136; Fri, 23 Nov 2018 07:26:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230726.wAN7Qbmr044136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340794 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56DB17A14B X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:26:39 -0000 Author: arybchik Date: Fri Nov 23 07:26:37 2018 New Revision: 340794 URL: https://svnweb.freebsd.org/changeset/base/340794 Log: sfxge(4): add MCDI agnostic wrapper for MAC stats clear If a libefx-based driver needs some way to clear port statistics, then an MCDI agnostic method is required. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18064 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 04:38:50 2018 (r340793) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 07:26:37 2018 (r340794) @@ -566,6 +566,10 @@ efx_mac_stats_get_mask( #define EFX_MAC_STATS_SIZE 0x400 +extern __checkReturn efx_rc_t +efx_mac_stats_clear( + __in efx_nic_t *enp); + /* * Upload mac statistics supported by the hardware into the given buffer. * Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 04:38:50 2018 (r340793) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 07:26:37 2018 (r340794) @@ -202,6 +202,7 @@ typedef struct efx_mac_ops_s { #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS efx_rc_t (*emo_stats_get_mask)(efx_nic_t *, uint32_t *, size_t); + efx_rc_t (*emo_stats_clear)(efx_nic_t *); efx_rc_t (*emo_stats_upload)(efx_nic_t *, efsys_mem_t *); efx_rc_t (*emo_stats_periodic)(efx_nic_t *, efsys_mem_t *, uint16_t, boolean_t); Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Fri Nov 23 04:38:50 2018 (r340793) +++ head/sys/dev/sfxge/common/efx_mac.c Fri Nov 23 07:26:37 2018 (r340794) @@ -60,6 +60,7 @@ static const efx_mac_ops_t __efx_siena_mac_ops = { #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS siena_mac_stats_get_mask, /* emo_stats_get_mask */ + efx_mcdi_mac_stats_clear, /* emo_stats_clear */ efx_mcdi_mac_stats_upload, /* emo_stats_upload */ efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */ siena_mac_stats_update /* emo_stats_update */ @@ -84,6 +85,7 @@ static const efx_mac_ops_t __efx_ef10_mac_ops = { #endif /* EFSYS_OPT_LOOPBACK */ #if EFSYS_OPT_MAC_STATS ef10_mac_stats_get_mask, /* emo_stats_get_mask */ + efx_mcdi_mac_stats_clear, /* emo_stats_clear */ efx_mcdi_mac_stats_upload, /* emo_stats_upload */ efx_mcdi_mac_stats_periodic, /* emo_stats_periodic */ ef10_mac_stats_update /* emo_stats_update */ @@ -708,6 +710,29 @@ efx_mac_stats_get_mask( (void) memset(maskp, 0, mask_size); if ((rc = emop->emo_stats_get_mask(enp, maskp, mask_size)) != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t +efx_mac_stats_clear( + __in efx_nic_t *enp) +{ + efx_port_t *epp = &(enp->en_port); + const efx_mac_ops_t *emop = epp->ep_emop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); + EFSYS_ASSERT(emop != NULL); + + if ((rc = emop->emo_stats_clear(enp)) != 0) goto fail1; return (0); From owner-svn-src-head@freebsd.org Fri Nov 23 07:39:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 035C9113DE01; Fri, 23 Nov 2018 07:39:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CF8E7A5FC; Fri, 23 Nov 2018 07:39:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76D001B87F; Fri, 23 Nov 2018 07:39:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7d0hx049120; Fri, 23 Nov 2018 07:39:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7cxk1049111; Fri, 23 Nov 2018 07:38:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230738.wAN7cxk1049111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340795 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CF8E7A5FC X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.334,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:39:01 -0000 Author: arybchik Date: Fri Nov 23 07:38:59 2018 New Revision: 340795 URL: https://svnweb.freebsd.org/changeset/base/340795 Log: sfxge(4): add advanced function to extract FW version Some libefx-based drivers might need this functionality to indicate DPCPU FW IDs as part of FW version info to assist experienced users. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18065 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 07:26:37 2018 (r340794) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 07:38:59 2018 (r340795) @@ -494,59 +494,6 @@ fail1: } static __checkReturn efx_rc_t -efx_mcdi_get_capabilities( - __in efx_nic_t *enp, - __out uint32_t *flagsp, - __out uint32_t *flags2p, - __out uint32_t *tso2ncp) -{ - efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, - MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)]; - efx_rc_t rc; - - (void) memset(payload, 0, sizeof (payload)); - req.emr_cmd = MC_CMD_GET_CAPABILITIES; - req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; - req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_GET_CAPABILITIES_V2_OUT_LEN; - - efx_mcdi_execute(enp, &req); - - if (req.emr_rc != 0) { - rc = req.emr_rc; - goto fail1; - } - - if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_OUT_LEN) { - rc = EMSGSIZE; - goto fail2; - } - - *flagsp = MCDI_OUT_DWORD(req, GET_CAPABILITIES_OUT_FLAGS1); - - if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) { - *flags2p = 0; - *tso2ncp = 0; - } else { - *flags2p = MCDI_OUT_DWORD(req, GET_CAPABILITIES_V2_OUT_FLAGS2); - *tso2ncp = MCDI_OUT_WORD(req, - GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS); - } - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - - -static __checkReturn efx_rc_t efx_mcdi_alloc_vis( __in efx_nic_t *enp, __in uint32_t min_vi_count, @@ -1015,8 +962,8 @@ ef10_get_datapath_caps( uint32_t tso2nc; efx_rc_t rc; - if ((rc = efx_mcdi_get_capabilities(enp, &flags, &flags2, - &tso2nc)) != 0) + if ((rc = efx_mcdi_get_capabilities(enp, &flags, NULL, NULL, + &flags2, &tso2nc)) != 0) goto fail1; if ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0) Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 07:26:37 2018 (r340794) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 07:38:59 2018 (r340795) @@ -1218,6 +1218,24 @@ extern const efx_nic_cfg_t * efx_nic_cfg_get( __in efx_nic_t *enp); +typedef struct efx_nic_fw_info_s { + /* Basic FW version information */ + uint16_t enfi_mc_fw_version[4]; + /* + * If datapath capabilities can be detected, + * additional FW information is to be shown + */ + boolean_t enfi_dpcpu_fw_ids_valid; + /* Rx and Tx datapath CPU FW IDs */ + uint16_t enfi_rx_dpcpu_fw_id; + uint16_t enfi_tx_dpcpu_fw_id; +} efx_nic_fw_info_t; + +extern __checkReturn efx_rc_t +efx_nic_get_fw_version( + __in efx_nic_t *enp, + __out efx_nic_fw_info_t *enfip); + /* Driver resource limits (minimum required/maximum usable). */ typedef struct efx_drv_limits_s { uint32_t edl_min_evq_count; Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 07:26:37 2018 (r340794) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 07:38:59 2018 (r340795) @@ -1029,6 +1029,79 @@ fail1: return (rc); } + __checkReturn efx_rc_t +efx_mcdi_get_capabilities( + __in efx_nic_t *enp, + __out_opt uint32_t *flagsp, + __out_opt uint16_t *rx_dpcpu_fw_idp, + __out_opt uint16_t *tx_dpcpu_fw_idp, + __out_opt uint32_t *flags2p, + __out_opt uint32_t *tso2ncp) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, + MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)]; + boolean_t v2_capable; + efx_rc_t rc; + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_GET_CAPABILITIES; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_GET_CAPABILITIES_V2_OUT_LEN; + + efx_mcdi_execute_quiet(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + if (flagsp != NULL) + *flagsp = MCDI_OUT_DWORD(req, GET_CAPABILITIES_OUT_FLAGS1); + + if (rx_dpcpu_fw_idp != NULL) + *rx_dpcpu_fw_idp = MCDI_OUT_WORD(req, + GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID); + + if (tx_dpcpu_fw_idp != NULL) + *tx_dpcpu_fw_idp = MCDI_OUT_WORD(req, + GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID); + + if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) + v2_capable = B_FALSE; + else + v2_capable = B_TRUE; + + if (flags2p != NULL) { + *flags2p = (v2_capable) ? + MCDI_OUT_DWORD(req, GET_CAPABILITIES_V2_OUT_FLAGS2) : + 0; + } + + if (tso2ncp != NULL) { + *tso2ncp = (v2_capable) ? + MCDI_OUT_WORD(req, + GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS) : + 0; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + static __checkReturn efx_rc_t efx_mcdi_do_reboot( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Fri Nov 23 07:26:37 2018 (r340794) +++ head/sys/dev/sfxge/common/efx_mcdi.h Fri Nov 23 07:38:59 2018 (r340795) @@ -139,6 +139,15 @@ efx_mcdi_version( __out_opt uint32_t *buildp, __out_opt efx_mcdi_boot_t *statusp); +extern __checkReturn efx_rc_t +efx_mcdi_get_capabilities( + __in efx_nic_t *enp, + __out_opt uint32_t *flagsp, + __out_opt uint16_t *rx_dpcpu_fw_idp, + __out_opt uint16_t *tx_dpcpu_fw_idp, + __out_opt uint32_t *flags2p, + __out_opt uint32_t *tso2ncp); + extern __checkReturn efx_rc_t efx_mcdi_read_assertion( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Fri Nov 23 07:26:37 2018 (r340794) +++ head/sys/dev/sfxge/common/efx_nic.c Fri Nov 23 07:38:59 2018 (r340795) @@ -621,6 +621,54 @@ efx_nic_cfg_get( return (&(enp->en_nic_cfg)); } + __checkReturn efx_rc_t +efx_nic_get_fw_version( + __in efx_nic_t *enp, + __out efx_nic_fw_info_t *enfip) +{ + uint16_t mc_fw_version[4]; + efx_rc_t rc; + + if (enfip == NULL) { + rc = EINVAL; + goto fail1; + } + + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); + EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI); + + rc = efx_mcdi_version(enp, mc_fw_version, NULL, NULL); + if (rc != 0) + goto fail2; + + rc = efx_mcdi_get_capabilities(enp, NULL, + &enfip->enfi_rx_dpcpu_fw_id, + &enfip->enfi_tx_dpcpu_fw_id, + NULL, NULL); + if (rc == 0) { + enfip->enfi_dpcpu_fw_ids_valid = B_TRUE; + } else if (rc == ENOTSUP) { + enfip->enfi_dpcpu_fw_ids_valid = B_FALSE; + enfip->enfi_rx_dpcpu_fw_id = 0; + enfip->enfi_tx_dpcpu_fw_id = 0; + } else { + goto fail3; + } + + memcpy(enfip->enfi_mc_fw_version, mc_fw_version, sizeof(mc_fw_version)); + + return (0); + +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #if EFSYS_OPT_DIAG __checkReturn efx_rc_t From owner-svn-src-head@freebsd.org Fri Nov 23 07:43:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77174113DFDB; Fri, 23 Nov 2018 07:43:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FDDD7AA45; Fri, 23 Nov 2018 07:43:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E500F1BA11; Fri, 23 Nov 2018 07:43:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7hiff054090; Fri, 23 Nov 2018 07:43:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7hijk054089; Fri, 23 Nov 2018 07:43:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230743.wAN7hijk054089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340796 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0FDDD7AA45 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.329,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:43:45 -0000 Author: arybchik Date: Fri Nov 23 07:43:44 2018 New Revision: 340796 URL: https://svnweb.freebsd.org/changeset/base/340796 Log: sfxge(4): fix failure path in EF10 Tx queue PIO enable Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18066 Modified: head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:38:59 2018 (r340795) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:43:44 2018 (r340796) @@ -285,9 +285,9 @@ ef10_tx_qpio_enable( fail3: EFSYS_PROBE(fail3); ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); - etp->et_pio_size = 0; fail2: EFSYS_PROBE(fail2); + etp->et_pio_size = 0; fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-head@freebsd.org Fri Nov 23 07:50:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1199113E137; Fri, 23 Nov 2018 07:50:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 926197ACD9; Fri, 23 Nov 2018 07:50:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DC481BA1A; Fri, 23 Nov 2018 07:50:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7oNfe054448; Fri, 23 Nov 2018 07:50:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7oNdC054447; Fri, 23 Nov 2018 07:50:23 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230750.wAN7oNdC054447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340797 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 926197ACD9 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.33)[0.329,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:50:24 -0000 Author: arybchik Date: Fri Nov 23 07:50:22 2018 New Revision: 340797 URL: https://svnweb.freebsd.org/changeset/base/340797 Log: sfxge(4): fix potential buffer overflow in Tx queue init Improve error checking to avoid a caller overflowing the MCDI request buffer if the requested TXQ size was excessively large. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18067 Modified: head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:43:44 2018 (r340796) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:50:22 2018 (r340797) @@ -70,7 +70,7 @@ efx_mcdi_init_txq( EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs)); npages = EFX_TXQ_NBUFS(size); - if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) { + if (MC_CMD_INIT_TXQ_IN_LEN(npages) > sizeof (payload)) { rc = EINVAL; goto fail1; } From owner-svn-src-head@freebsd.org Fri Nov 23 07:50:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D446C113E166; Fri, 23 Nov 2018 07:50:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6229C7ADD7; Fri, 23 Nov 2018 07:50:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D23931BA1C; Fri, 23 Nov 2018 07:50:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7oYVT054506; Fri, 23 Nov 2018 07:50:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7oYsT054505; Fri, 23 Nov 2018 07:50:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230750.wAN7oYsT054505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340798 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6229C7ADD7 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.33)[0.329,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:50:37 -0000 Author: arybchik Date: Fri Nov 23 07:50:34 2018 New Revision: 340798 URL: https://svnweb.freebsd.org/changeset/base/340798 Log: sfxge(4): fix out of bounds read in VIs allocation Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18068 Modified: head/sys/dev/sfxge/common/ef10_nic.c Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 07:50:22 2018 (r340797) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 07:50:34 2018 (r340798) @@ -504,7 +504,7 @@ efx_mcdi_alloc_vis( { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN, - MC_CMD_ALLOC_VIS_OUT_LEN)]; + MC_CMD_ALLOC_VIS_EXT_OUT_LEN)]; efx_rc_t rc; if (vi_countp == NULL) { @@ -517,7 +517,7 @@ efx_mcdi_alloc_vis( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_ALLOC_VIS_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_ALLOC_VIS_OUT_LEN; + req.emr_out_length = MC_CMD_ALLOC_VIS_EXT_OUT_LEN; MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MIN_VI_COUNT, min_vi_count); MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MAX_VI_COUNT, max_vi_count); From owner-svn-src-head@freebsd.org Fri Nov 23 07:50:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 497F0113E1A0; Fri, 23 Nov 2018 07:50:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E24A67AF20; Fri, 23 Nov 2018 07:50:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5F411BA38; Fri, 23 Nov 2018 07:50:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7ojtT054564; Fri, 23 Nov 2018 07:50:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7ojbQ054562; Fri, 23 Nov 2018 07:50:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230750.wAN7ojbQ054562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340799 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E24A67AF20 X-Spamd-Result: default: False [1.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.33)[0.329,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:50:51 -0000 Author: arybchik Date: Fri Nov 23 07:50:45 2018 New Revision: 340799 URL: https://svnweb.freebsd.org/changeset/base/340799 Log: sfxge(4): fix error code usage MCDI results returned in req.emr_rc have already been translated from MC_CMD_ERR_* to errno names, so using an MC_CMD_ERR_* value is incorrect. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18069 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 07:50:34 2018 (r340798) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 07:50:45 2018 (r340799) @@ -140,7 +140,7 @@ efx_mcdi_fini_rxq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) { + if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { rc = req.emr_rc; goto fail1; } Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:50:34 2018 (r340798) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:50:45 2018 (r340799) @@ -151,7 +151,7 @@ efx_mcdi_fini_txq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) { + if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { rc = req.emr_rc; goto fail1; } From owner-svn-src-head@freebsd.org Fri Nov 23 07:51:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D6EF113E1D1; Fri, 23 Nov 2018 07:51:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C73277AFF0; Fri, 23 Nov 2018 07:50:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 496031BA47; Fri, 23 Nov 2018 07:50:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN7ovef054623; Fri, 23 Nov 2018 07:50:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN7ouc7054620; Fri, 23 Nov 2018 07:50:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230750.wAN7ouc7054620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 07:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340800 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C73277AFF0 X-Spamd-Result: default: False [1.49 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.33)[0.334,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 07:51:00 -0000 Author: arybchik Date: Fri Nov 23 07:50:56 2018 New Revision: 340800 URL: https://svnweb.freebsd.org/changeset/base/340800 Log: sfxge(4): let caller know that queue is already flushed Tx/Rx queue may be already flushed due to Tx/Rx error on the queue or MC reboot. Caller needs to know that the queue is already flushed to avoid waiting for flush done event. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18070 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 23 07:50:45 2018 (r340799) +++ head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 23 07:50:56 2018 (r340800) @@ -434,7 +434,12 @@ efx_mcdi_fini_evq( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the EVQ has already been destroyed. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 07:50:45 2018 (r340799) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 07:50:56 2018 (r340800) @@ -140,7 +140,7 @@ efx_mcdi_fini_rxq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { + if (req.emr_rc != 0) { rc = req.emr_rc; goto fail1; } @@ -148,7 +148,12 @@ efx_mcdi_fini_rxq( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the RXQ has already been destroyed. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } @@ -819,7 +824,14 @@ ef10_rx_qflush( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the RXQ has already been destroyed. Callers need to know that + * the RXQ flush has completed to avoid waiting until timeout for a + * flush done event that will not be delivered. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:50:45 2018 (r340799) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 07:50:56 2018 (r340800) @@ -151,7 +151,7 @@ efx_mcdi_fini_txq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { + if (req.emr_rc != 0) { rc = req.emr_rc; goto fail1; } @@ -159,7 +159,12 @@ efx_mcdi_fini_txq( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the TXQ has already been destroyed. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } @@ -690,7 +695,14 @@ ef10_tx_qpace( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the TXQ has already been destroyed. Callers need to know that + * the TXQ flush has completed to avoid waiting until timeout for a + * flush done event that will not be delivered. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } From owner-svn-src-head@freebsd.org Fri Nov 23 09:02:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 759A2113FBEF; Fri, 23 Nov 2018 09:02:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A24F7D0F5; Fri, 23 Nov 2018 09:02:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5D171C6FF; Fri, 23 Nov 2018 09:02:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN92weq094620; Fri, 23 Nov 2018 09:02:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN92wTV094618; Fri, 23 Nov 2018 09:02:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230902.wAN92wTV094618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340801 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A24F7D0F5 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_SHORT(0.40)[0.395,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:02:59 -0000 Author: arybchik Date: Fri Nov 23 09:02:58 2018 New Revision: 340801 URL: https://svnweb.freebsd.org/changeset/base/340801 Log: sfxge(4): provide information about supported tunnels VXLAN/NVGRE (and Geneve) support is available on SFN8xxx with full-feature firmware variant running. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18071 Modified: head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 07:50:56 2018 (r340800) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 09:02:58 2018 (r340801) @@ -1075,6 +1075,16 @@ ef10_get_datapath_caps( encp->enc_mac_stats_40g_tx_size_bins = CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; + /* + * Check if firmware supports VXLAN and NVGRE tunnels. + * The capability indicates Geneve protocol support as well. + */ + if (CAP_FLAG(flags, VXLAN_NVGRE)) + encp->enc_tunnel_encapsulations_supported = + (1u << EFX_TUNNEL_PROTOCOL_VXLAN) | + (1u << EFX_TUNNEL_PROTOCOL_GENEVE) | + (1u << EFX_TUNNEL_PROTOCOL_NVGRE); + #undef CAP_FLAG #undef CAP_FLAG2 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 07:50:56 2018 (r340800) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:02:58 2018 (r340801) @@ -1095,6 +1095,14 @@ efx_bist_stop( #define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000 #define EFX_FEATURE_PACKED_STREAM 0x00004000 +typedef enum efx_tunnel_protocol_e { + EFX_TUNNEL_PROTOCOL_NONE = 0, + EFX_TUNNEL_PROTOCOL_VXLAN, + EFX_TUNNEL_PROTOCOL_GENEVE, + EFX_TUNNEL_PROTOCOL_NVGRE, + EFX_TUNNEL_NPROTOS +} efx_tunnel_protocol_t; + typedef struct efx_nic_cfg_s { uint32_t enc_board_type; uint32_t enc_phy_type; @@ -1194,6 +1202,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_rx_var_packed_stream_supported; boolean_t enc_pm_and_rxdp_counters; boolean_t enc_mac_stats_40g_tx_size_bins; + uint32_t enc_tunnel_encapsulations_supported; /* External port identifier */ uint8_t enc_external_port; uint32_t enc_mcdi_max_payload_length; From owner-svn-src-head@freebsd.org Fri Nov 23 09:03:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 214E7113FC13; Fri, 23 Nov 2018 09:03:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B74DD7D1E3; Fri, 23 Nov 2018 09:03:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59AA21C700; Fri, 23 Nov 2018 09:03:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN93Ax3094681; Fri, 23 Nov 2018 09:03:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN93AtI094680; Fri, 23 Nov 2018 09:03:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230903.wAN93AtI094680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340802 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B74DD7D1E3 X-Spamd-Result: default: False [1.59 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.75)[0.754,0]; NEURAL_SPAM_SHORT(0.40)[0.397,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:03:12 -0000 Author: arybchik Date: Fri Nov 23 09:03:09 2018 New Revision: 340802 URL: https://svnweb.freebsd.org/changeset/base/340802 Log: sfxge(4): use proper MCDI command for encap filters MC_CMD_FILTER_OP_IN_EXT is needed to set filters for encapsulated packets. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18072 Modified: head/sys/dev/sfxge/common/ef10_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:02:58 2018 (r340801) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:03:09 2018 (r340802) @@ -126,29 +126,29 @@ ef10_filter_init( #define MATCH_MASK(match) (EFX_MASK32(match) << EFX_LOW_BIT(match)) EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_HOST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_IP)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_HOST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_IP)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_MAC == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_PORT == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_MAC == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_MAC)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_PORT == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_PORT)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_ETHER_TYPE == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_INNER_VID == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_OUTER_VID == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST)); EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST)); #undef MATCH_MASK EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (ef10_filter_table_t), eftp); @@ -189,27 +189,27 @@ efx_mcdi_filter_op_add( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN, - MC_CMD_FILTER_OP_OUT_LEN)]; + uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, + MC_CMD_FILTER_OP_EXT_OUT_LEN)]; efx_rc_t rc; memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_FILTER_OP_IN_LEN; + req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_FILTER_OP_OUT_LEN; + req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN; switch (filter_op) { case MC_CMD_FILTER_OP_IN_OP_REPLACE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_LO, handle->efh_lo); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_HI, handle->efh_hi); /* Fall through */ case MC_CMD_FILTER_OP_IN_OP_INSERT: case MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, filter_op); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, filter_op); break; default: EFSYS_ASSERT(0); @@ -217,63 +217,63 @@ efx_mcdi_filter_op_add( goto fail1; } - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_PORT_ID, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_MATCH_FIELDS, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_MATCH_FIELDS, spec->efs_match_flags); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_DEST, - MC_CMD_FILTER_OP_IN_RX_DEST_HOST); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_QUEUE, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_DEST, + MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_QUEUE, spec->efs_dmaq_id); if (spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) { - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_CONTEXT, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_CONTEXT, spec->efs_rss_context); } - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_MODE, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_MODE, spec->efs_flags & EFX_FILTER_FLAG_RX_RSS ? - MC_CMD_FILTER_OP_IN_RX_MODE_RSS : - MC_CMD_FILTER_OP_IN_RX_MODE_SIMPLE); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_TX_DEST, - MC_CMD_FILTER_OP_IN_TX_DEST_DEFAULT); + MC_CMD_FILTER_OP_EXT_IN_RX_MODE_RSS : + MC_CMD_FILTER_OP_EXT_IN_RX_MODE_SIMPLE); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_TX_DEST, + MC_CMD_FILTER_OP_EXT_IN_TX_DEST_DEFAULT); if (filter_op != MC_CMD_FILTER_OP_IN_OP_REPLACE) { /* * NOTE: Unlike most MCDI requests, the filter fields * are presented in network (big endian) byte order. */ - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_SRC_MAC), + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_SRC_MAC), spec->efs_rem_mac, EFX_MAC_ADDR_LEN); - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_DST_MAC), + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_MAC), spec->efs_loc_mac, EFX_MAC_ADDR_LEN); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_SRC_PORT, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_SRC_PORT, __CPU_TO_BE_16(spec->efs_rem_port)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_DST_PORT, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_DST_PORT, __CPU_TO_BE_16(spec->efs_loc_port)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_ETHER_TYPE, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_ETHER_TYPE, __CPU_TO_BE_16(spec->efs_ether_type)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_INNER_VLAN, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_INNER_VLAN, __CPU_TO_BE_16(spec->efs_inner_vid)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_OUTER_VLAN, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_OUTER_VLAN, __CPU_TO_BE_16(spec->efs_outer_vid)); /* IP protocol (in low byte, high byte is zero) */ - MCDI_IN_SET_BYTE(req, FILTER_OP_IN_IP_PROTO, + MCDI_IN_SET_BYTE(req, FILTER_OP_EXT_IN_IP_PROTO, spec->efs_ip_proto); EFX_STATIC_ASSERT(sizeof (spec->efs_rem_host) == - MC_CMD_FILTER_OP_IN_SRC_IP_LEN); + MC_CMD_FILTER_OP_EXT_IN_SRC_IP_LEN); EFX_STATIC_ASSERT(sizeof (spec->efs_loc_host) == - MC_CMD_FILTER_OP_IN_DST_IP_LEN); + MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN); - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_SRC_IP), + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_SRC_IP), &spec->efs_rem_host.eo_byte[0], - MC_CMD_FILTER_OP_IN_SRC_IP_LEN); - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_DST_IP), + MC_CMD_FILTER_OP_EXT_IN_SRC_IP_LEN); + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_IP), &spec->efs_loc_host.eo_byte[0], - MC_CMD_FILTER_OP_IN_DST_IP_LEN); + MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN); } efx_mcdi_execute(enp, &req); @@ -283,13 +283,13 @@ efx_mcdi_filter_op_add( goto fail2; } - if (req.emr_out_length_used < MC_CMD_FILTER_OP_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) { rc = EMSGSIZE; goto fail3; } - handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_LO); - handle->efh_hi = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_HI); + handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_LO); + handle->efh_hi = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_HI); return (0); @@ -311,24 +311,24 @@ efx_mcdi_filter_op_delete( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN, - MC_CMD_FILTER_OP_OUT_LEN)]; + uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, + MC_CMD_FILTER_OP_EXT_OUT_LEN)]; efx_rc_t rc; memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_FILTER_OP_IN_LEN; + req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_FILTER_OP_OUT_LEN; + req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN; switch (filter_op) { case MC_CMD_FILTER_OP_IN_OP_REMOVE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, MC_CMD_FILTER_OP_IN_OP_REMOVE); break; case MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE); break; default: @@ -337,8 +337,8 @@ efx_mcdi_filter_op_delete( goto fail1; } - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, handle->efh_lo); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, handle->efh_hi); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_LO, handle->efh_lo); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_HI, handle->efh_hi); efx_mcdi_execute_quiet(enp, &req); @@ -347,7 +347,7 @@ efx_mcdi_filter_op_delete( goto fail2; } - if (req.emr_out_length_used < MC_CMD_FILTER_OP_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) { rc = EMSGSIZE; goto fail3; } From owner-svn-src-head@freebsd.org Fri Nov 23 09:03:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2EC2113FC36; Fri, 23 Nov 2018 09:03:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78ACC7D2E4; Fri, 23 Nov 2018 09:03:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B89631C705; Fri, 23 Nov 2018 09:03:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN93Lrj094740; Fri, 23 Nov 2018 09:03:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN93LxX094738; Fri, 23 Nov 2018 09:03:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230903.wAN93LxX094738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340803 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 78ACC7D2E4 X-Spamd-Result: default: False [1.59 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.75)[0.754,0]; NEURAL_SPAM_SHORT(0.40)[0.397,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:03:26 -0000 Author: arybchik Date: Fri Nov 23 09:03:20 2018 New Revision: 340803 URL: https://svnweb.freebsd.org/changeset/base/340803 Log: sfxge(4): support filters for encapsulated packets This supports filters which match all unicast or multicast inner frames in VXLAN, GENEVE, or NVGRE packets. (Additional fields to match on can be added easily.) Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18073 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:03:09 2018 (r340802) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:03:20 2018 (r340803) @@ -145,6 +145,10 @@ ef10_filter_init( MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO == MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO)); + EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST == + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST)); + EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST == + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST == MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST)); EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST == @@ -274,18 +278,47 @@ efx_mcdi_filter_op_add( memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_IP), &spec->efs_loc_host.eo_byte[0], MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN); + + /* + * On Medford, filters for encapsulated packets match based on + * the ether type and IP protocol in the outer frame. In + * addition we need to fill in the VNI or VSID type field. + */ + switch (spec->efs_encap_type) { + case EFX_TUNNEL_PROTOCOL_NONE: + break; + case EFX_TUNNEL_PROTOCOL_VXLAN: + case EFX_TUNNEL_PROTOCOL_GENEVE: + MCDI_IN_POPULATE_DWORD_1(req, + FILTER_OP_EXT_IN_VNI_OR_VSID, + FILTER_OP_EXT_IN_VNI_TYPE, + spec->efs_encap_type == EFX_TUNNEL_PROTOCOL_VXLAN ? + MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_VXLAN : + MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_GENEVE); + break; + case EFX_TUNNEL_PROTOCOL_NVGRE: + MCDI_IN_POPULATE_DWORD_1(req, + FILTER_OP_EXT_IN_VNI_OR_VSID, + FILTER_OP_EXT_IN_VSID_TYPE, + MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_NVGRE); + break; + default: + EFSYS_ASSERT(0); + rc = EINVAL; + goto fail2; + } } efx_mcdi_execute(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail3; } if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) { rc = EMSGSIZE; - goto fail3; + goto fail4; } handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_LO); @@ -293,6 +326,8 @@ efx_mcdi_filter_op_add( return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: @@ -392,6 +427,8 @@ ef10_filter_equal( if (left->efs_ether_type != right->efs_ether_type) return (B_FALSE); if (left->efs_ip_proto != right->efs_ip_proto) + return (B_FALSE); + if (left->efs_encap_type != right->efs_encap_type) return (B_FALSE); return (B_TRUE); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:03:09 2018 (r340802) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:03:20 2018 (r340803) @@ -2230,6 +2230,7 @@ efx_tx_qdestroy( #define EFX_IPPROTO_TCP 6 #define EFX_IPPROTO_UDP 17 +#define EFX_IPPROTO_GRE 47 /* Use RSS to spread across multiple queues */ #define EFX_FILTER_FLAG_RX_RSS 0x01 @@ -2248,6 +2249,10 @@ efx_tx_qdestroy( typedef unsigned int efx_filter_flags_t; +/* + * Flags which specify the fields to match on. The values are the same as in the + * MC_CMD_FILTER_OP/MC_CMD_FILTER_OP_EXT commands. + */ typedef enum efx_filter_match_flags_e { EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host * address */ @@ -2262,6 +2267,10 @@ typedef enum efx_filter_match_flags_e { EFX_FILTER_MATCH_OUTER_VID = 0x0100, /* Match by outer VLAN ID */ EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport * protocol */ + /* For encapsulated packets, match all multicast inner frames */ + EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST = 0x01000000, + /* For encapsulated packets, match all unicast inner frames */ + EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST = 0x02000000, /* Match otherwise-unmatched multicast and broadcast packets */ EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x40000000, /* Match otherwise-unmatched unicast packets */ @@ -2287,21 +2296,22 @@ typedef enum efx_filter_priority_s { */ typedef struct efx_filter_spec_s { - uint32_t efs_match_flags; - uint32_t efs_priority:2; - uint32_t efs_flags:6; - uint32_t efs_dmaq_id:12; - uint32_t efs_rss_context; - uint16_t efs_outer_vid; - uint16_t efs_inner_vid; - uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; - uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; - uint16_t efs_ether_type; - uint8_t efs_ip_proto; - uint16_t efs_loc_port; - uint16_t efs_rem_port; - efx_oword_t efs_rem_host; - efx_oword_t efs_loc_host; + uint32_t efs_match_flags; + uint32_t efs_priority:2; + uint32_t efs_flags:6; + uint32_t efs_dmaq_id:12; + uint32_t efs_rss_context; + uint16_t efs_outer_vid; + uint16_t efs_inner_vid; + uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; + uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; + uint16_t efs_ether_type; + uint8_t efs_ip_proto; + efx_tunnel_protocol_t efs_encap_type; + uint16_t efs_loc_port; + uint16_t efs_rem_port; + efx_oword_t efs_rem_host; + efx_oword_t efs_loc_host; } efx_filter_spec_t; @@ -2373,6 +2383,11 @@ efx_filter_spec_set_eth_local( __in uint16_t vid, __in const uint8_t *addr); +extern void +efx_filter_spec_set_ether_type( + __inout efx_filter_spec_t *spec, + __in uint16_t ether_type); + extern __checkReturn efx_rc_t efx_filter_spec_set_uc_def( __inout efx_filter_spec_t *spec); @@ -2380,6 +2395,19 @@ efx_filter_spec_set_uc_def( extern __checkReturn efx_rc_t efx_filter_spec_set_mc_def( __inout efx_filter_spec_t *spec); + +typedef enum efx_filter_inner_frame_match_e { + EFX_FILTER_INNER_FRAME_MATCH_OTHER = 0, + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST, + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_UCAST_DST +} efx_filter_inner_frame_match_t; + +extern __checkReturn efx_rc_t +efx_filter_spec_set_encap_type( + __inout efx_filter_spec_t *spec, + __in efx_tunnel_protocol_t encap_type, + __in efx_filter_inner_frame_match_t inner_frame_match); + #endif /* EFSYS_OPT_FILTER */ Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:03:09 2018 (r340802) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:03:20 2018 (r340803) @@ -401,6 +401,17 @@ efx_filter_spec_set_eth_local( return (0); } + void +efx_filter_spec_set_ether_type( + __inout efx_filter_spec_t *spec, + __in uint16_t ether_type) +{ + EFSYS_ASSERT3P(spec, !=, NULL); + + spec->efs_ether_type = ether_type; + spec->efs_match_flags |= EFX_FILTER_MATCH_ETHER_TYPE; +} + /* * Specify matching otherwise-unmatched unicast in a filter specification */ @@ -425,6 +436,63 @@ efx_filter_spec_set_mc_def( spec->efs_match_flags |= EFX_FILTER_MATCH_UNKNOWN_MCAST_DST; return (0); +} + + +__checkReturn efx_rc_t +efx_filter_spec_set_encap_type( + __inout efx_filter_spec_t *spec, + __in efx_tunnel_protocol_t encap_type, + __in efx_filter_inner_frame_match_t inner_frame_match) +{ + uint32_t match_flags = 0; + uint8_t ip_proto; + efx_rc_t rc; + + EFSYS_ASSERT3P(spec, !=, NULL); + + switch (encap_type) { + case EFX_TUNNEL_PROTOCOL_VXLAN: + case EFX_TUNNEL_PROTOCOL_GENEVE: + ip_proto = EFX_IPPROTO_UDP; + break; + case EFX_TUNNEL_PROTOCOL_NVGRE: + ip_proto = EFX_IPPROTO_GRE; + break; + default: + EFSYS_ASSERT(0); + rc = EINVAL; + goto fail1; + } + + switch (inner_frame_match) { + case EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST: + match_flags |= EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST; + break; + case EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_UCAST_DST: + match_flags |= EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST; + break; + case EFX_FILTER_INNER_FRAME_MATCH_OTHER: + /* This is for when specific inner frames are to be matched. */ + break; + default: + EFSYS_ASSERT(0); + rc = EINVAL; + goto fail2; + } + + spec->efs_encap_type = encap_type; + spec->efs_ip_proto = ip_proto; + spec->efs_match_flags |= (match_flags | EFX_FILTER_MATCH_IP_PROTO); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } From owner-svn-src-head@freebsd.org Fri Nov 23 09:03:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92DD0113FC7A; Fri, 23 Nov 2018 09:03:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52D267D3FD; Fri, 23 Nov 2018 09:03:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF1CC1C70A; Fri, 23 Nov 2018 09:03:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN93W8N094802; Fri, 23 Nov 2018 09:03:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN93WNw094801; Fri, 23 Nov 2018 09:03:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230903.wAN93WNw094801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340804 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 52D267D3FD X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:03:37 -0000 Author: arybchik Date: Fri Nov 23 09:03:32 2018 New Revision: 340804 URL: https://svnweb.freebsd.org/changeset/base/340804 Log: sfxge(4): insert filters for encapsulated packets On Medford, with full-featured firmware running, encapsulated packets may not be delivered unless filters are inserted for them, as ordinary filters are not applied to encapsulated packets. So filters for encapsulated packets need to be inserted for each class of encapsulated packet. For simplicity, catch-all filters are always inserted. These may match more packets than the OS has asked for, but trying to insert more precise filters increases complexity for little gain. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18074 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/ef10_impl.h Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:03:20 2018 (r340803) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:03:32 2018 (r340804) @@ -1234,6 +1234,108 @@ fail1: return (rc); } +typedef struct ef10_filter_encap_entry_s { + uint16_t ether_type; + efx_tunnel_protocol_t encap_type; + uint32_t inner_frame_match; +} ef10_filter_encap_entry_t; + +#define EF10_ENCAP_FILTER_ENTRY(ipv, encap_type, inner_frame_match) \ + { EFX_ETHER_TYPE_##ipv, EFX_TUNNEL_PROTOCOL_##encap_type, \ + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_##inner_frame_match } + +static ef10_filter_encap_entry_t ef10_filter_encap_list[] = { + EF10_ENCAP_FILTER_ENTRY(IPV4, VXLAN, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV4, VXLAN, MCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, VXLAN, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, VXLAN, MCAST_DST), + + EF10_ENCAP_FILTER_ENTRY(IPV4, GENEVE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV4, GENEVE, MCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, GENEVE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, GENEVE, MCAST_DST), + + EF10_ENCAP_FILTER_ENTRY(IPV4, NVGRE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV4, NVGRE, MCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, NVGRE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, NVGRE, MCAST_DST), +}; + +#undef EF10_ENCAP_FILTER_ENTRY + +static __checkReturn efx_rc_t +ef10_filter_insert_encap_filters( + __in efx_nic_t *enp, + __in boolean_t mulcst, + __in efx_filter_flags_t filter_flags) +{ + ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; + uint32_t i; + efx_rc_t rc; + + EFX_STATIC_ASSERT(EFX_ARRAY_SIZE(ef10_filter_encap_list) <= + EFX_ARRAY_SIZE(table->eft_encap_filter_indexes)); + + /* + * On Medford, full-featured firmware can identify packets as being + * tunnel encapsulated, even if no encapsulated packet offloads are in + * use. When packets are identified as such, ordinary filters are not + * applied, only ones specific to encapsulated packets. Hence we need to + * insert filters for encapsulated packets in order to receive them. + * + * Separate filters need to be inserted for each ether type, + * encapsulation type, and inner frame type (unicast or multicast). To + * keep things simple and reduce the number of filters needed, catch-all + * filters for all combinations of types are inserted, even if + * all_unicst or all_mulcst have not been set. (These catch-all filters + * may well, however, fail to insert on unprivileged functions.) + */ + table->eft_encap_filter_count = 0; + for (i = 0; i < EFX_ARRAY_SIZE(ef10_filter_encap_list); i++) { + efx_filter_spec_t spec; + ef10_filter_encap_entry_t *encap_filter = + &ef10_filter_encap_list[i]; + + /* + * Skip multicast filters if we've not been asked for + * any multicast traffic. + */ + if ((mulcst == B_FALSE) && + (encap_filter->inner_frame_match == + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST)) + continue; + + efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, + filter_flags, + table->eft_default_rxq); + efx_filter_spec_set_ether_type(&spec, encap_filter->ether_type); + rc = efx_filter_spec_set_encap_type(&spec, + encap_filter->encap_type, + encap_filter->inner_frame_match); + if (rc != 0) + goto fail1; + + rc = ef10_filter_add_internal(enp, &spec, B_TRUE, + &table->eft_encap_filter_indexes[ + table->eft_encap_filter_count]); + if (rc != 0) { + if (rc != EACCES) + goto fail2; + } else { + table->eft_encap_filter_count++; + } + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + static void ef10_filter_remove_old( __in efx_nic_t *enp) @@ -1329,6 +1431,12 @@ ef10_filter_reconfigure( } table->eft_mulcst_filter_count = 0; + for (i = 0; i < table->eft_encap_filter_count; i++) { + (void) ef10_filter_delete_internal(enp, + table->eft_encap_filter_indexes[i]); + } + table->eft_encap_filter_count = 0; + return (0); } @@ -1346,6 +1454,10 @@ ef10_filter_reconfigure( ef10_filter_set_entry_auto_old(table, table->eft_mulcst_filter_indexes[i]); } + for (i = 0; i < table->eft_encap_filter_count; i++) { + ef10_filter_set_entry_auto_old(table, + table->eft_encap_filter_indexes[i]); + } /* * Insert or renew unicast filters. @@ -1461,6 +1573,13 @@ ef10_filter_reconfigure( goto fail4; } } + } + + if (encp->enc_tunnel_encapsulations_supported != 0) { + /* Try to insert filters for encapsulated packets. */ + (void) ef10_filter_insert_encap_filters(enp, + mulcst || all_mulcst || brdcst, + filter_flags); } /* Remove old filters which were not renewed */ Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:03:20 2018 (r340803) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:03:32 2018 (r340804) @@ -1007,6 +1007,13 @@ typedef struct ef10_filter_entry_s { /* Allow for the broadcast address to be added to the multicast list */ #define EFX_EF10_FILTER_MULTICAST_FILTERS_MAX (EFX_MAC_MULTICAST_LIST_MAX + 1) +/* + * For encapsulated packets, there is one filter each for each combination of + * IPv4 or IPv6 outer frame, VXLAN, GENEVE or NVGRE packet type, and unicast or + * multicast inner frames. + */ +#define EFX_EF10_FILTER_ENCAP_FILTERS_MAX 12 + typedef struct ef10_filter_table_s { ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS]; efx_rxq_t *eft_default_rxq; @@ -1018,6 +1025,9 @@ typedef struct ef10_filter_table_s { EFX_EF10_FILTER_MULTICAST_FILTERS_MAX]; uint32_t eft_mulcst_filter_count; boolean_t eft_using_all_mulcst; + uint32_t eft_encap_filter_indexes[ + EFX_EF10_FILTER_ENCAP_FILTERS_MAX]; + uint32_t eft_encap_filter_count; } ef10_filter_table_t; __checkReturn efx_rc_t From owner-svn-src-head@freebsd.org Fri Nov 23 09:14:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34D9D1140123; Fri, 23 Nov 2018 09:14:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB4767DB36; Fri, 23 Nov 2018 09:14:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CF5F1C8A4; Fri, 23 Nov 2018 09:14:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9Ekn2099976; Fri, 23 Nov 2018 09:14:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9EkFV099973; Fri, 23 Nov 2018 09:14:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230914.wAN9EkFV099973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340805 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB4767DB36 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.40)[0.395,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:14:47 -0000 Author: arybchik Date: Fri Nov 23 09:14:45 2018 New Revision: 340805 URL: https://svnweb.freebsd.org/changeset/base/340805 Log: sfxge(4): define a handle to denote default RSS context Make the existing filter-specific define more general. This is the same as MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18075 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:03:32 2018 (r340804) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:14:45 2018 (r340805) @@ -1889,6 +1889,9 @@ efx_rx_scatter_enable( __in unsigned int buf_size); #endif /* EFSYS_OPT_RX_SCATTER */ +/* Handle to represent use of the default RSS context. */ +#define EFX_RSS_CONTEXT_DEFAULT 0xffffffff + #if EFSYS_OPT_RX_SCALE typedef enum efx_rx_hash_alg_e { @@ -2316,7 +2319,6 @@ typedef struct efx_filter_spec_s { /* Default values for use in filter specifications */ -#define EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT 0xffffffff #define EFX_FILTER_SPEC_RX_DMAQ_ID_DROP 0xfff #define EFX_FILTER_SPEC_VID_UNSPEC 0xffff Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:03:32 2018 (r340804) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:14:45 2018 (r340805) @@ -307,7 +307,7 @@ efx_filter_spec_init_rx( memset(spec, 0, sizeof (*spec)); spec->efs_priority = priority; spec->efs_flags = EFX_FILTER_FLAG_RX | flags; - spec->efs_rss_context = EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT; + spec->efs_rss_context = EFX_RSS_CONTEXT_DEFAULT; spec->efs_dmaq_id = (uint16_t)erp->er_index; } From owner-svn-src-head@freebsd.org Fri Nov 23 09:15:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A344114015F; Fri, 23 Nov 2018 09:15:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BB977DC36; Fri, 23 Nov 2018 09:15:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F53D1C8A5; Fri, 23 Nov 2018 09:14:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9Ew9T000134; Fri, 23 Nov 2018 09:14:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9Ew5p000133; Fri, 23 Nov 2018 09:14:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230914.wAN9Ew5p000133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340806 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BB977DC36 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_SHORT(0.40)[0.395,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:00 -0000 Author: arybchik Date: Fri Nov 23 09:14:57 2018 New Revision: 340806 URL: https://svnweb.freebsd.org/changeset/base/340806 Log: sfxge(4): fix default RSS context check on Siena Default RSS context check is carried out during filter insertion on Siena and it needs to be fixed Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18076 Modified: head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:14:45 2018 (r340805) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:14:57 2018 (r340806) @@ -527,9 +527,9 @@ siena_filter_spec_from_gen_spec( else EFSYS_ASSERT3U(gen_spec->efs_flags, &, EFX_FILTER_FLAG_RX); - /* Falconsiena only has one RSS context */ + /* Siena only has one RSS context */ if ((gen_spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) && - gen_spec->efs_rss_context != 0) { + gen_spec->efs_rss_context != EFX_RSS_CONTEXT_DEFAULT) { rc = EINVAL; goto fail1; } From owner-svn-src-head@freebsd.org Fri Nov 23 09:15:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B9DD11401B3; Fri, 23 Nov 2018 09:15:15 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A26AC7DD78; Fri, 23 Nov 2018 09:15:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F272C1C8AA; Fri, 23 Nov 2018 09:15:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9F94B000206; Fri, 23 Nov 2018 09:15:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9F9QS000202; Fri, 23 Nov 2018 09:15:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9F9QS000202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340807 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A26AC7DD78 X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:15 -0000 Author: arybchik Date: Fri Nov 23 09:15:08 2018 New Revision: 340807 URL: https://svnweb.freebsd.org/changeset/base/340807 Log: sfxge(4): add the max number of RSS exclusive contexts The patch adds enc_rx_scale_max_exclusive_contexts member to nic_cfg_t structure and sets the corresponding values for Siena, Huntington and Medford Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18077 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/medford_nic.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:14:57 2018 (r340806) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:08 2018 (r340807) @@ -1134,6 +1134,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_rx_prefix_size; uint32_t enc_rx_buf_align_start; uint32_t enc_rx_buf_align_end; + uint32_t enc_rx_scale_max_exclusive_contexts; #if EFSYS_OPT_LOOPBACK efx_qword_t enc_loopback_types[EFX_LINK_NMODES]; #endif /* EFSYS_OPT_LOOPBACK */ Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Fri Nov 23 09:14:57 2018 (r340806) +++ head/sys/dev/sfxge/common/hunt_nic.c Fri Nov 23 09:15:08 2018 (r340807) @@ -304,6 +304,13 @@ hunt_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + /* + * Maximum number of exclusive RSS contexts which can be allocated. The + * hardware supports 64, but 6 are reserved for shared contexts. They + * are a global resource so not all may be available. + */ + encp->enc_rx_scale_max_exclusive_contexts = 58; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); /* No boundary crossing limits */ encp->enc_tx_dma_desc_boundary = 0; Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Fri Nov 23 09:14:57 2018 (r340806) +++ head/sys/dev/sfxge/common/medford_nic.c Fri Nov 23 09:15:08 2018 (r340807) @@ -301,6 +301,13 @@ medford_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; + /* + * Maximum number of exclusive RSS contexts which can be allocated. The + * hardware supports 64, but 6 are reserved for shared contexts. They + * are a global resource so not all may be available. + */ + encp->enc_rx_scale_max_exclusive_contexts = 58; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(ESF_DZ_RX_KER_BYTE_CNT); /* No boundary crossing limits */ encp->enc_tx_dma_desc_boundary = 0; Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Fri Nov 23 09:14:57 2018 (r340806) +++ head/sys/dev/sfxge/common/siena_nic.c Fri Nov 23 09:15:08 2018 (r340807) @@ -140,6 +140,9 @@ siena_board_cfg( /* Alignment for WPTR updates */ encp->enc_rx_push_align = 1; + /* There is one RSS context per function */ + encp->enc_rx_scale_max_exclusive_contexts = 1; + encp->enc_tx_dma_desc_size_max = EFX_MASK32(FSF_AZ_TX_KER_BYTE_COUNT); /* Fragments must not span 4k boundaries. */ encp->enc_tx_dma_desc_boundary = 4096; From owner-svn-src-head@freebsd.org Fri Nov 23 09:15:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44E6B1140235; Fri, 23 Nov 2018 09:15:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE60F7DE3F; Fri, 23 Nov 2018 09:15:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89B171C8AF; Fri, 23 Nov 2018 09:15:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9FLc3000270; Fri, 23 Nov 2018 09:15:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9FKtX000265; Fri, 23 Nov 2018 09:15:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9FKtX000265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340808 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE60F7DE3F X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:23 -0000 Author: arybchik Date: Fri Nov 23 09:15:20 2018 New Revision: 340808 URL: https://svnweb.freebsd.org/changeset/base/340808 Log: sfxge(4): rename API to check Rx scale and hash support Rename efx_rx_scale_support_get() to efx_rx_scale_default_support_get(), and efx_rx_hash_support_get() to efx_rx_hash_default_support_get(). All these really report is whether an exclusive RSS context was successfully acquired at efx_rx_init(). efx_rx_scale_support_get() sounds like it reports whether the device supports RSS, and whether exclusive or shared contexts are supported, but it doesn't do that. Renaming it to efx_rx_scale_default_support_get() helps to reflect that it reports what RSS support the client gets without trying to allocate RSS contexts itself. Also rename efx_rx_scale_support_t to efx_rx_scale_context_type_t, to make the enum more suitable for specifying the type of an RSS context to be allocated. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18078 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:20 2018 (r340808) @@ -162,7 +162,7 @@ fail1: static __checkReturn efx_rc_t efx_mcdi_rss_context_alloc( __in efx_nic_t *enp, - __in efx_rx_scale_support_t scale_support, + __in efx_rx_scale_context_type_t type, __in uint32_t num_queues, __out uint32_t *rss_contextp) { @@ -178,7 +178,7 @@ efx_mcdi_rss_context_alloc( goto fail1; } - switch (scale_support) { + switch (type) { case EFX_RX_SCALE_EXCLUSIVE: context_type = MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE; break; @@ -464,7 +464,7 @@ ef10_rx_init( * Allocated an exclusive RSS context, which allows both the * indirection table and key to be modified. */ - enp->en_rss_support = EFX_RX_SCALE_EXCLUSIVE; + enp->en_rss_context_type = EFX_RX_SCALE_EXCLUSIVE; enp->en_hash_support = EFX_RX_HASH_AVAILABLE; } else { /* @@ -472,7 +472,7 @@ ef10_rx_init( * operation without support for RSS. The pseudo-header in * received packets will not contain a Toeplitz hash value. */ - enp->en_rss_support = EFX_RX_SCALE_UNAVAILABLE; + enp->en_rss_context_type = EFX_RX_SCALE_UNAVAILABLE; enp->en_hash_support = EFX_RX_HASH_UNAVAILABLE; } @@ -510,7 +510,7 @@ ef10_rx_scale_mode_set( goto fail1; } - if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; goto fail2; } @@ -541,7 +541,7 @@ ef10_rx_scale_key_set( { efx_rc_t rc; - if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; goto fail1; } @@ -570,7 +570,7 @@ ef10_rx_scale_tbl_set( { efx_rc_t rc; - if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; goto fail1; } @@ -981,11 +981,10 @@ ef10_rx_fini( __in efx_nic_t *enp) { #if EFSYS_OPT_RX_SCALE - if (enp->en_rss_support != EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type != EFX_RX_SCALE_UNAVAILABLE) (void) efx_mcdi_rss_context_free(enp, enp->en_rss_context); - } enp->en_rss_context = 0; - enp->en_rss_support = EFX_RX_SCALE_UNAVAILABLE; + enp->en_rss_context_type = EFX_RX_SCALE_UNAVAILABLE; #else _NOTE(ARGUNUSED(enp)) #endif /* EFSYS_OPT_RX_SCALE */ Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:20 2018 (r340808) @@ -1916,22 +1916,22 @@ typedef enum efx_rx_hash_support_e { #define EFX_MAXRSS 64 /* RX indirection entry range */ #define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */ -typedef enum efx_rx_scale_support_e { - EFX_RX_SCALE_UNAVAILABLE = 0, /* Not supported */ +typedef enum efx_rx_scale_context_type_e { + EFX_RX_SCALE_UNAVAILABLE = 0, /* No RX scale context */ EFX_RX_SCALE_EXCLUSIVE, /* Writable key/indirection table */ EFX_RX_SCALE_SHARED /* Read-only key/indirection table */ -} efx_rx_scale_support_t; +} efx_rx_scale_context_type_t; extern __checkReturn efx_rc_t -efx_rx_hash_support_get( +efx_rx_hash_default_support_get( __in efx_nic_t *enp, __out efx_rx_hash_support_t *supportp); extern __checkReturn efx_rc_t -efx_rx_scale_support_get( +efx_rx_scale_default_support_get( __in efx_nic_t *enp, - __out efx_rx_scale_support_t *supportp); + __out efx_rx_scale_context_type_t *typep); extern __checkReturn efx_rc_t efx_rx_scale_mode_set( Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:20 2018 (r340808) @@ -644,9 +644,9 @@ struct efx_nic_s { const efx_vpd_ops_t *en_evpdop; #endif /* EFSYS_OPT_VPD */ #if EFSYS_OPT_RX_SCALE - efx_rx_hash_support_t en_hash_support; - efx_rx_scale_support_t en_rss_support; - uint32_t en_rss_context; + efx_rx_hash_support_t en_hash_support; + efx_rx_scale_context_type_t en_rss_context_type; + uint32_t en_rss_context; #endif /* EFSYS_OPT_RX_SCALE */ uint32_t en_vport_id; #if EFSYS_OPT_LICENSING Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:20 2018 (r340808) @@ -309,7 +309,7 @@ fail1: #if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t -efx_rx_hash_support_get( +efx_rx_hash_default_support_get( __in efx_nic_t *enp, __out efx_rx_hash_support_t *supportp) { @@ -323,7 +323,10 @@ efx_rx_hash_support_get( goto fail1; } - /* Report if resources are available to insert RX hash value */ + /* + * Report the hashing support the client gets by default if it + * does not allocate an RSS context itself. + */ *supportp = enp->en_hash_support; return (0); @@ -335,22 +338,25 @@ fail1: } __checkReturn efx_rc_t -efx_rx_scale_support_get( +efx_rx_scale_default_support_get( __in efx_nic_t *enp, - __out efx_rx_scale_support_t *supportp) + __out efx_rx_scale_context_type_t *typep) { efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - if (supportp == NULL) { + if (typep == NULL) { rc = EINVAL; goto fail1; } - /* Report if resources are available to support RSS */ - *supportp = enp->en_rss_support; + /* + * Report the RSS support the client gets by default if it + * does not allocate an RSS context itself. + */ + *typep = enp->en_rss_context_type; return (0); @@ -659,7 +665,7 @@ siena_rx_init( #if EFSYS_OPT_RX_SCALE /* The RSS key and indirection table are writable. */ - enp->en_rss_support = EFX_RX_SCALE_EXCLUSIVE; + enp->en_rss_context_type = EFX_RX_SCALE_EXCLUSIVE; /* Hardware can insert RX hash with/without RSS */ enp->en_hash_support = EFX_RX_HASH_AVAILABLE; From owner-svn-src-head@freebsd.org Fri Nov 23 09:15:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBB0711402DE; Fri, 23 Nov 2018 09:15:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1D2D7DF40; Fri, 23 Nov 2018 09:15:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86B511C8B4; Fri, 23 Nov 2018 09:15:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9FXnA000335; Fri, 23 Nov 2018 09:15:33 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9FWPG000330; Fri, 23 Nov 2018 09:15:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9FWPG000330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340809 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1D2D7DF40 X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:34 -0000 Author: arybchik Date: Fri Nov 23 09:15:32 2018 New Revision: 340809 URL: https://svnweb.freebsd.org/changeset/base/340809 Log: sfxge(4): add API to allocate and free RSS contexts Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18079 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:15:20 2018 (r340808) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:15:32 2018 (r340809) @@ -900,6 +900,18 @@ ef10_rx_scatter_enable( #if EFSYS_OPT_RX_SCALE extern __checkReturn efx_rc_t +ef10_rx_scale_context_alloc( + __in efx_nic_t *enp, + __in efx_rx_scale_context_type_t type, + __in uint32_t num_queues, + __out uint32_t *rss_contextp); + +extern __checkReturn efx_rc_t +ef10_rx_scale_context_free( + __in efx_nic_t *enp, + __in uint32_t rss_context); + +extern __checkReturn efx_rc_t ef10_rx_scale_mode_set( __in efx_nic_t *enp, __in efx_rx_hash_alg_t alg, Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:20 2018 (r340808) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:32 2018 (r340809) @@ -494,6 +494,48 @@ ef10_rx_scatter_enable( #if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t +ef10_rx_scale_context_alloc( + __in efx_nic_t *enp, + __in efx_rx_scale_context_type_t type, + __in uint32_t num_queues, + __out uint32_t *rss_contextp) +{ + efx_rc_t rc; + + rc = efx_mcdi_rss_context_alloc(enp, type, num_queues, rss_contextp); + if (rc != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} +#endif /* EFSYS_OPT_RX_SCALE */ + +#if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t +ef10_rx_scale_context_free( + __in efx_nic_t *enp, + __in uint32_t rss_context) +{ + efx_rc_t rc; + + rc = efx_mcdi_rss_context_free(enp, rss_context); + if (rc != 0) + goto fail1; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} +#endif /* EFSYS_OPT_RX_SCALE */ + +#if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t ef10_rx_scale_mode_set( __in efx_nic_t *enp, __in efx_rx_hash_alg_t alg, Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:20 2018 (r340808) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:32 2018 (r340809) @@ -1934,6 +1934,18 @@ efx_rx_scale_default_support_get( __out efx_rx_scale_context_type_t *typep); extern __checkReturn efx_rc_t +efx_rx_scale_context_alloc( + __in efx_nic_t *enp, + __in efx_rx_scale_context_type_t type, + __in uint32_t num_queues, + __out uint32_t *rss_contextp); + +extern __checkReturn efx_rc_t +efx_rx_scale_context_free( + __in efx_nic_t *enp, + __in uint32_t rss_context); + +extern __checkReturn efx_rc_t efx_rx_scale_mode_set( __in efx_nic_t *enp, __in efx_rx_hash_alg_t alg, Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:20 2018 (r340808) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:32 2018 (r340809) @@ -156,6 +156,10 @@ typedef struct efx_rx_ops_s { efx_rc_t (*erxo_scatter_enable)(efx_nic_t *, unsigned int); #endif #if EFSYS_OPT_RX_SCALE + efx_rc_t (*erxo_scale_context_alloc)(efx_nic_t *, + efx_rx_scale_context_type_t, + uint32_t, uint32_t *); + efx_rc_t (*erxo_scale_context_free)(efx_nic_t *, uint32_t); efx_rc_t (*erxo_scale_mode_set)(efx_nic_t *, efx_rx_hash_alg_t, efx_rx_hash_type_t, boolean_t); efx_rc_t (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t); Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:20 2018 (r340808) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:32 2018 (r340809) @@ -154,6 +154,8 @@ static const efx_rx_ops_t __efx_rx_siena_ops = { siena_rx_scatter_enable, /* erxo_scatter_enable */ #endif #if EFSYS_OPT_RX_SCALE + NULL, /* erxo_scale_context_alloc */ + NULL, /* erxo_scale_context_free */ siena_rx_scale_mode_set, /* erxo_scale_mode_set */ siena_rx_scale_key_set, /* erxo_scale_key_set */ siena_rx_scale_tbl_set, /* erxo_scale_tbl_set */ @@ -181,6 +183,8 @@ static const efx_rx_ops_t __efx_rx_ef10_ops = { ef10_rx_scatter_enable, /* erxo_scatter_enable */ #endif #if EFSYS_OPT_RX_SCALE + ef10_rx_scale_context_alloc, /* erxo_scale_context_alloc */ + ef10_rx_scale_context_free, /* erxo_scale_context_free */ ef10_rx_scale_mode_set, /* erxo_scale_mode_set */ ef10_rx_scale_key_set, /* erxo_scale_key_set */ ef10_rx_scale_tbl_set, /* erxo_scale_tbl_set */ @@ -365,7 +369,71 @@ fail1: return (rc); } +#endif /* EFSYS_OPT_RX_SCALE */ +#if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t +efx_rx_scale_context_alloc( + __in efx_nic_t *enp, + __in efx_rx_scale_context_type_t type, + __in uint32_t num_queues, + __out uint32_t *rss_contextp) +{ + const efx_rx_ops_t *erxop = enp->en_erxop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); + + if (erxop->erxo_scale_context_alloc == NULL) { + rc = ENOTSUP; + goto fail1; + } + if ((rc = erxop->erxo_scale_context_alloc(enp, type, + num_queues, rss_contextp)) != 0) { + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} +#endif /* EFSYS_OPT_RX_SCALE */ + +#if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t +efx_rx_scale_context_free( + __in efx_nic_t *enp, + __in uint32_t rss_context) +{ + const efx_rx_ops_t *erxop = enp->en_erxop; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); + + if (erxop->erxo_scale_context_free == NULL) { + rc = ENOTSUP; + goto fail1; + } + if ((rc = erxop->erxo_scale_context_free(enp, rss_context)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} +#endif /* EFSYS_OPT_RX_SCALE */ + +#if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t efx_rx_scale_mode_set( __in efx_nic_t *enp, From owner-svn-src-head@freebsd.org Fri Nov 23 09:15:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25CA7114039E; Fri, 23 Nov 2018 09:15:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF0037E083; Fri, 23 Nov 2018 09:15:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1A541C8B9; Fri, 23 Nov 2018 09:15:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9FjBu000397; Fri, 23 Nov 2018 09:15:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9FiRw000392; Fri, 23 Nov 2018 09:15:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9FiRw000392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340810 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 340810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF0037E083 X-Spamd-Result: default: False [1.59 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.40)[0.397,0]; NEURAL_SPAM_MEDIUM(0.75)[0.754,0]; NEURAL_SPAM_LONG(0.44)[0.439,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:47 -0000 Author: arybchik Date: Fri Nov 23 09:15:44 2018 New Revision: 340810 URL: https://svnweb.freebsd.org/changeset/base/340810 Log: sfxge(4): update RSS API to take RSS context parameter Update efx_rx_scale_mode_set(), efx_rx_scale_key_set() and efx_rx_scale_tbl_set(). Submitted by: Mark Spender Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18080 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 09:15:44 2018 (r340810) @@ -914,6 +914,7 @@ ef10_rx_scale_context_free( extern __checkReturn efx_rc_t ef10_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert); @@ -921,12 +922,14 @@ ef10_rx_scale_mode_set( extern __checkReturn efx_rc_t ef10_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n); extern __checkReturn efx_rc_t ef10_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n); Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:44 2018 (r340810) @@ -538,6 +538,7 @@ fail1: __checkReturn efx_rc_t ef10_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert) @@ -552,13 +553,16 @@ ef10_rx_scale_mode_set( goto fail1; } - if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { - rc = ENOTSUP; - goto fail2; + if (rss_context == EFX_RSS_CONTEXT_DEFAULT) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { + rc = ENOTSUP; + goto fail2; + } + rss_context = enp->en_rss_context; } if ((rc = efx_mcdi_rss_context_set_flags(enp, - enp->en_rss_context, type)) != 0) + rss_context, type)) != 0) goto fail3; return (0); @@ -578,18 +582,21 @@ fail1: __checkReturn efx_rc_t ef10_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n) { efx_rc_t rc; - if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { - rc = ENOTSUP; - goto fail1; + if (rss_context == EFX_RSS_CONTEXT_DEFAULT) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { + rc = ENOTSUP; + goto fail1; + } + rss_context = enp->en_rss_context; } - if ((rc = efx_mcdi_rss_context_set_key(enp, - enp->en_rss_context, key, n)) != 0) + if ((rc = efx_mcdi_rss_context_set_key(enp, rss_context, key, n)) != 0) goto fail2; return (0); @@ -607,18 +614,23 @@ fail1: __checkReturn efx_rc_t ef10_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n) { efx_rc_t rc; - if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { - rc = ENOTSUP; - goto fail1; + + if (rss_context == EFX_RSS_CONTEXT_DEFAULT) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { + rc = ENOTSUP; + goto fail1; + } + rss_context = enp->en_rss_context; } if ((rc = efx_mcdi_rss_context_set_table(enp, - enp->en_rss_context, table, n)) != 0) + rss_context, table, n)) != 0) goto fail2; return (0); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:44 2018 (r340810) @@ -1948,6 +1948,7 @@ efx_rx_scale_context_free( extern __checkReturn efx_rc_t efx_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert); @@ -1955,12 +1956,14 @@ efx_rx_scale_mode_set( extern __checkReturn efx_rc_t efx_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n); extern __checkReturn efx_rc_t efx_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:44 2018 (r340810) @@ -160,11 +160,13 @@ typedef struct efx_rx_ops_s { efx_rx_scale_context_type_t, uint32_t, uint32_t *); efx_rc_t (*erxo_scale_context_free)(efx_nic_t *, uint32_t); - efx_rc_t (*erxo_scale_mode_set)(efx_nic_t *, efx_rx_hash_alg_t, + efx_rc_t (*erxo_scale_mode_set)(efx_nic_t *, uint32_t, + efx_rx_hash_alg_t, efx_rx_hash_type_t, boolean_t); - efx_rc_t (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t); - efx_rc_t (*erxo_scale_tbl_set)(efx_nic_t *, unsigned int *, - size_t); + efx_rc_t (*erxo_scale_key_set)(efx_nic_t *, uint32_t, + uint8_t *, size_t); + efx_rc_t (*erxo_scale_tbl_set)(efx_nic_t *, uint32_t, + unsigned int *, size_t); uint32_t (*erxo_prefix_hash)(efx_nic_t *, efx_rx_hash_alg_t, uint8_t *); #endif /* EFSYS_OPT_RX_SCALE */ Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:44 2018 (r340810) @@ -58,6 +58,7 @@ siena_rx_scatter_enable( static __checkReturn efx_rc_t siena_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert); @@ -65,12 +66,14 @@ siena_rx_scale_mode_set( static __checkReturn efx_rc_t siena_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n); static __checkReturn efx_rc_t siena_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n); @@ -437,6 +440,7 @@ fail1: __checkReturn efx_rc_t efx_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert) @@ -448,7 +452,7 @@ efx_rx_scale_mode_set( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); if (erxop->erxo_scale_mode_set != NULL) { - if ((rc = erxop->erxo_scale_mode_set(enp, alg, + if ((rc = erxop->erxo_scale_mode_set(enp, rss_context, alg, type, insert)) != 0) goto fail1; } @@ -465,6 +469,7 @@ fail1: __checkReturn efx_rc_t efx_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n) { @@ -474,7 +479,7 @@ efx_rx_scale_key_set( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - if ((rc = erxop->erxo_scale_key_set(enp, key, n)) != 0) + if ((rc = erxop->erxo_scale_key_set(enp, rss_context, key, n)) != 0) goto fail1; return (0); @@ -490,6 +495,7 @@ fail1: __checkReturn efx_rc_t efx_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n) { @@ -499,7 +505,7 @@ efx_rx_scale_tbl_set( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - if ((rc = erxop->erxo_scale_tbl_set(enp, table, n)) != 0) + if ((rc = erxop->erxo_scale_tbl_set(enp, rss_context, table, n)) != 0) goto fail1; return (0); @@ -852,12 +858,18 @@ fail1: static __checkReturn efx_rc_t siena_rx_scale_mode_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in efx_rx_hash_alg_t alg, __in efx_rx_hash_type_t type, __in boolean_t insert) { efx_rc_t rc; + if (rss_context != EFX_RSS_CONTEXT_DEFAULT) { + rc = EINVAL; + goto fail1; + } + switch (alg) { case EFX_RX_HASHALG_LFSR: EFX_RX_LFSR_HASH(enp, insert); @@ -873,17 +885,19 @@ siena_rx_scale_mode_set( type & EFX_RX_HASH_TCPIPV6, rc); if (rc != 0) - goto fail1; + goto fail2; break; default: rc = EINVAL; - goto fail2; + goto fail3; } return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: @@ -899,6 +913,7 @@ fail1: static __checkReturn efx_rc_t siena_rx_scale_key_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) uint8_t *key, __in size_t n) { @@ -907,6 +922,11 @@ siena_rx_scale_key_set( unsigned int offset; efx_rc_t rc; + if (rss_context != EFX_RSS_CONTEXT_DEFAULT) { + rc = EINVAL; + goto fail1; + } + byte = 0; /* Write Toeplitz IPv4 hash key */ @@ -927,7 +947,7 @@ siena_rx_scale_key_set( --offset) { if (oword.eo_u8[offset - 1] != key[byte++]) { rc = EFAULT; - goto fail1; + goto fail2; } } @@ -976,7 +996,7 @@ siena_rx_scale_key_set( --offset) { if (oword.eo_u8[offset - 1] != key[byte++]) { rc = EFAULT; - goto fail2; + goto fail3; } } @@ -988,7 +1008,7 @@ siena_rx_scale_key_set( --offset) { if (oword.eo_u8[offset - 1] != key[byte++]) { rc = EFAULT; - goto fail3; + goto fail4; } } @@ -1000,13 +1020,15 @@ siena_rx_scale_key_set( --offset) { if (oword.eo_u8[offset - 1] != key[byte++]) { rc = EFAULT; - goto fail4; + goto fail5; } } done: return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: @@ -1024,6 +1046,7 @@ fail1: static __checkReturn efx_rc_t siena_rx_scale_tbl_set( __in efx_nic_t *enp, + __in uint32_t rss_context, __in_ecount(n) unsigned int *table, __in size_t n) { @@ -1034,11 +1057,16 @@ siena_rx_scale_tbl_set( EFX_STATIC_ASSERT(EFX_RSS_TBL_SIZE == FR_BZ_RX_INDIRECTION_TBL_ROWS); EFX_STATIC_ASSERT(EFX_MAXRSS == (1 << FRF_BZ_IT_QUEUE_WIDTH)); - if (n > FR_BZ_RX_INDIRECTION_TBL_ROWS) { + if (rss_context != EFX_RSS_CONTEXT_DEFAULT) { rc = EINVAL; goto fail1; } + if (n > FR_BZ_RX_INDIRECTION_TBL_ROWS) { + rc = EINVAL; + goto fail2; + } + for (index = 0; index < FR_BZ_RX_INDIRECTION_TBL_ROWS; index++) { uint32_t byte; @@ -1067,12 +1095,14 @@ siena_rx_scale_tbl_set( /* Verify the entry */ if (EFX_OWORD_FIELD(oword, FRF_BZ_IT_QUEUE) != byte) { rc = EFAULT; - goto fail2; + goto fail3; } } return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Fri Nov 23 09:15:32 2018 (r340809) +++ head/sys/dev/sfxge/sfxge_rx.c Fri Nov 23 09:15:44 2018 (r340810) @@ -1138,17 +1138,20 @@ sfxge_rx_start(struct sfxge_softc *sc) #else sc->rx_indir_table[index] = index % sc->rxq_count; #endif - if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table, + if ((rc = efx_rx_scale_tbl_set(sc->enp, EFX_RSS_CONTEXT_DEFAULT, + sc->rx_indir_table, nitems(sc->rx_indir_table))) != 0) goto fail; - (void)efx_rx_scale_mode_set(sc->enp, EFX_RX_HASHALG_TOEPLITZ, + (void)efx_rx_scale_mode_set(sc->enp, EFX_RSS_CONTEXT_DEFAULT, + EFX_RX_HASHALG_TOEPLITZ, EFX_RX_HASH_IPV4 | EFX_RX_HASH_TCPIPV4 | EFX_RX_HASH_IPV6 | EFX_RX_HASH_TCPIPV6, B_TRUE); #ifdef RSS rss_getkey(toep_key); #endif - if ((rc = efx_rx_scale_key_set(sc->enp, toep_key, + if ((rc = efx_rx_scale_key_set(sc->enp, EFX_RSS_CONTEXT_DEFAULT, + toep_key, sizeof(toep_key))) != 0) goto fail; From owner-svn-src-head@freebsd.org Fri Nov 23 09:15:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14476114043B; Fri, 23 Nov 2018 09:15:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A1087E1CD; Fri, 23 Nov 2018 09:15:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5239D1C8C2; Fri, 23 Nov 2018 09:15:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9Fv7Y000456; Fri, 23 Nov 2018 09:15:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9FuGC000453; Fri, 23 Nov 2018 09:15:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9FuGC000453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340811 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A1087E1CD X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:59 -0000 Author: arybchik Date: Fri Nov 23 09:15:56 2018 New Revision: 340811 URL: https://svnweb.freebsd.org/changeset/base/340811 Log: sfxge(4): add API to set an RSS context for a filter Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18081 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_filter.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:15:44 2018 (r340810) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Nov 23 09:15:56 2018 (r340811) @@ -229,10 +229,20 @@ efx_mcdi_filter_op_add( MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST); MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_QUEUE, spec->efs_dmaq_id); + +#if EFSYS_OPT_RX_SCALE if (spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) { + uint32_t rss_context; + + if (spec->efs_rss_context == EFX_RSS_CONTEXT_DEFAULT) + rss_context = enp->en_rss_context; + else + rss_context = spec->efs_rss_context; MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_CONTEXT, - spec->efs_rss_context); + rss_context); } +#endif + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_MODE, spec->efs_flags & EFX_FILTER_FLAG_RX_RSS ? MC_CMD_FILTER_OP_EXT_IN_RX_MODE_RSS : @@ -588,10 +598,6 @@ ef10_filter_add_internal( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - -#if EFSYS_OPT_RX_SCALE - spec->efs_rss_context = enp->en_rss_context; -#endif hash = ef10_filter_hash(spec); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:44 2018 (r340810) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:56 2018 (r340811) @@ -2426,7 +2426,12 @@ efx_filter_spec_set_encap_type( __in efx_tunnel_protocol_t encap_type, __in efx_filter_inner_frame_match_t inner_frame_match); - +#if EFSYS_OPT_RX_SCALE +extern __checkReturn efx_rc_t +efx_filter_spec_set_rss_context( + __inout efx_filter_spec_t *spec, + __in uint32_t rss_context); +#endif #endif /* EFSYS_OPT_FILTER */ /* HASH */ Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:15:44 2018 (r340810) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Nov 23 09:15:56 2018 (r340811) @@ -122,10 +122,6 @@ efx_filter_remove( EFSYS_ASSERT3P(spec, !=, NULL); EFSYS_ASSERT3U(spec->efs_flags, &, EFX_FILTER_FLAG_RX); -#if EFSYS_OPT_RX_SCALE - spec->efs_rss_context = enp->en_rss_context; -#endif - return (efop->efo_delete(enp, spec)); } @@ -495,7 +491,32 @@ fail1: return (rc); } +#if EFSYS_OPT_RX_SCALE + __checkReturn efx_rc_t +efx_filter_spec_set_rss_context( + __inout efx_filter_spec_t *spec, + __in uint32_t rss_context) +{ + efx_rc_t rc; + EFSYS_ASSERT3P(spec, !=, NULL); + + /* The filter must have been created with EFX_FILTER_FLAG_RX_RSS. */ + if ((spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) == 0) { + rc = EINVAL; + goto fail1; + } + + spec->efs_rss_context = rss_context; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} +#endif #if EFSYS_OPT_SIENA From owner-svn-src-head@freebsd.org Fri Nov 23 09:16:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E4D411404F1; Fri, 23 Nov 2018 09:16:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAC747E335; Fri, 23 Nov 2018 09:16:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FDBA1C8C3; Fri, 23 Nov 2018 09:16:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9G8pU000518; Fri, 23 Nov 2018 09:16:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9G81M000516; Fri, 23 Nov 2018 09:16:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230916.wAN9G81M000516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340812 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAC747E335 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_SHORT(0.40)[0.395,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:16:12 -0000 Author: arybchik Date: Fri Nov 23 09:16:07 2018 New Revision: 340812 URL: https://svnweb.freebsd.org/changeset/base/340812 Log: sfxge(4): add RSS key size define Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18082 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:56 2018 (r340811) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:16:07 2018 (r340812) @@ -588,6 +588,9 @@ ef10_rx_scale_key_set( { efx_rc_t rc; + EFX_STATIC_ASSERT(EFX_RSS_KEY_SIZE == + MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN); + if (rss_context == EFX_RSS_CONTEXT_DEFAULT) { if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:56 2018 (r340811) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:16:07 2018 (r340812) @@ -1912,6 +1912,7 @@ typedef enum efx_rx_hash_support_e { EFX_RX_HASH_AVAILABLE /* Insert hash with/without RSS */ } efx_rx_hash_support_t; +#define EFX_RSS_KEY_SIZE 40 /* RSS key size (bytes) */ #define EFX_RSS_TBL_SIZE 128 /* Rows in RX indirection table */ #define EFX_MAXRSS 64 /* RX indirection entry range */ #define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */ From owner-svn-src-head@freebsd.org Fri Nov 23 10:19:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 446F91141A5C; Fri, 23 Nov 2018 10:19:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D963B808B7; Fri, 23 Nov 2018 10:19:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B48CE1D24D; Fri, 23 Nov 2018 10:19:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAJkLI031328; Fri, 23 Nov 2018 10:19:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAJkav031327; Fri, 23 Nov 2018 10:19:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231019.wANAJkav031327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340813 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D963B808B7 X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.50)[0.501,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:19:47 -0000 Author: arybchik Date: Fri Nov 23 10:19:46 2018 New Revision: 340813 URL: https://svnweb.freebsd.org/changeset/base/340813 Log: sfxge(4): copy new header from firmware src Submitted by: Andrew Jackson Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18083 Modified: head/sys/dev/sfxge/common/siena_flash.h Modified: head/sys/dev/sfxge/common/siena_flash.h ============================================================================== --- head/sys/dev/sfxge/common/siena_flash.h Fri Nov 23 09:16:07 2018 (r340812) +++ head/sys/dev/sfxge/common/siena_flash.h Fri Nov 23 10:19:46 2018 (r340813) @@ -117,15 +117,21 @@ typedef struct siena_mc_boot_hdr_s { /* GENERATED BY efx_word_t checksum; /* of whole header area + firmware image */ efx_word_t firmware_version_d; efx_byte_t mcfw_subtype; - efx_byte_t generation; /* Valid for medford, SBZ for earlier chips */ + efx_byte_t generation; /* MC (Medford and later): MC partition generation when */ + /* written to NVRAM. */ + /* MUM & SUC images: subtype. */ + /* (Otherwise set to 0) */ efx_dword_t firmware_text_offset; /* offset to firmware .text */ efx_dword_t firmware_text_size; /* length of firmware .text, in bytes */ efx_dword_t firmware_data_offset; /* offset to firmware .data */ efx_dword_t firmware_data_size; /* length of firmware .data, in bytes */ efx_byte_t spi_rate; /* SPI rate for reading image, 0 is BootROM default */ efx_byte_t spi_phase_adj; /* SPI SDO/SCL phase adjustment, 0 is default (no adj) */ - efx_word_t xpm_sector; /* The sector that contains the key, or 0xffff if unsigned (medford) SBZ (earlier) */ - efx_dword_t reserved_c[7]; /* (set to 0) */ + efx_word_t xpm_sector; /* XPM (MEDFORD and later): The sector that contains */ + /* the key, or 0xffff if unsigned. (Otherwise set to 0) */ + efx_byte_t mumfw_subtype; /* MUM & SUC images: subtype. (Otherwise set to 0) */ + efx_byte_t reserved_b[3]; /* (set to 0) */ + efx_dword_t reserved_c[6]; /* (set to 0) */ } siena_mc_boot_hdr_t; #define SIENA_MC_BOOT_HDR_PADDING \ From owner-svn-src-head@freebsd.org Fri Nov 23 10:20:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95ABF1141A85; Fri, 23 Nov 2018 10:20:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22158809B8; Fri, 23 Nov 2018 10:20:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E3471D24E; Fri, 23 Nov 2018 10:19:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAJvj3031389; Fri, 23 Nov 2018 10:19:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAJvIx031388; Fri, 23 Nov 2018 10:19:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231019.wANAJvIx031388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340814 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22158809B8 X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.501,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:00 -0000 Author: arybchik Date: Fri Nov 23 10:19:57 2018 New Revision: 340814 URL: https://svnweb.freebsd.org/changeset/base/340814 Log: sfxge(4): fix result code in MCDI NVRAM update finish Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18084 Modified: head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:19:46 2018 (r340813) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:19:57 2018 (r340814) @@ -926,7 +926,7 @@ efx_mcdi_nvram_update_finish( efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN, MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN)]; - uint32_t result = 0; /* FIXME: use MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */ + uint32_t result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); From owner-svn-src-head@freebsd.org Fri Nov 23 10:20:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02B921141AB3; Fri, 23 Nov 2018 10:20:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94F6E80ACB; Fri, 23 Nov 2018 10:20:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE1041D256; Fri, 23 Nov 2018 10:20:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAK8jG031478; Fri, 23 Nov 2018 10:20:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAK8ok031477; Fri, 23 Nov 2018 10:20:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231020.wANAK8ok031477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340815 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94F6E80ACB X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.501,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:13 -0000 Author: arybchik Date: Fri Nov 23 10:20:08 2018 New Revision: 340815 URL: https://svnweb.freebsd.org/changeset/base/340815 Log: sfxge(4): simplify verify result handling Simplify verify result handling in NVRAM update finish Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18085 Modified: head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:19:57 2018 (r340814) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:08 2018 (r340815) @@ -949,24 +949,23 @@ efx_mcdi_nvram_update_finish( goto fail1; } - if (encp->enc_fw_verified_nvram_update_required == B_FALSE) { - /* Report success if verified updates are not supported. */ - result = MC_CMD_NVRAM_VERIFY_RC_SUCCESS; - } else { - /* Firmware-verified NVRAM updates are required */ - if (req.emr_out_length_used < - MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) { + result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; + if (encp->enc_fw_verified_nvram_update_required) { + /* Mandatory verification result is missing */ rc = EMSGSIZE; goto fail2; } + } else { result = MCDI_OUT_DWORD(req, NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE); + } - if (result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS) { - /* Mandatory verification failed */ - rc = EINVAL; - goto fail3; - } + if ((encp->enc_fw_verified_nvram_update_required) && + (result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS)) { + /* Mandatory verification failed */ + rc = EINVAL; + goto fail3; } if (resultp != NULL) From owner-svn-src-head@freebsd.org Fri Nov 23 10:20:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D7C71141AEC; Fri, 23 Nov 2018 10:20:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10D4B80BF2; Fri, 23 Nov 2018 10:20:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 538B71D25B; Fri, 23 Nov 2018 10:20:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAKMZE031541; Fri, 23 Nov 2018 10:20:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAKKdn031534; Fri, 23 Nov 2018 10:20:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231020.wANAKKdn031534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340816 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 10D4B80BF2 X-Spamd-Result: default: False [1.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.75)[0.754,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.54)[0.537,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:27 -0000 Author: arybchik Date: Fri Nov 23 10:20:20 2018 New Revision: 340816 URL: https://svnweb.freebsd.org/changeset/base/340816 Log: sfxge(4): report verify result from RW finish callback This makes the verify result visible to efx_nvram_rw_finish(), which can be extended to report it in a later patch. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18086 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nvram.c head/sys/dev/sfxge/common/siena_vpd.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 10:20:20 2018 (r340816) @@ -462,7 +462,8 @@ ef10_nvram_partn_write( extern __checkReturn efx_rc_t ef10_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in uint32_t partn); + __in uint32_t partn, + __out_opt uint32_t *verify_resultp); extern __checkReturn efx_rc_t ef10_nvram_partn_get_version( Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:20:20 2018 (r340816) @@ -2050,15 +2050,15 @@ fail1: ef10_nvram_partn_unlock( __in efx_nic_t *enp, __in uint32_t partn, - __out_opt uint32_t *resultp) + __out_opt uint32_t *verify_resultp) { boolean_t reboot = B_FALSE; efx_rc_t rc; - if (resultp != NULL) - *resultp = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; + if (verify_resultp != NULL) + *verify_resultp = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; - rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, resultp); + rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, verify_resultp); if (rc != 0) goto fail1; @@ -2368,11 +2368,12 @@ fail1: __checkReturn efx_rc_t ef10_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in uint32_t partn) + __in uint32_t partn, + __out_opt uint32_t *verify_resultp) { efx_rc_t rc; - if ((rc = ef10_nvram_partn_unlock(enp, partn, NULL)) != 0) + if ((rc = ef10_nvram_partn_unlock(enp, partn, verify_resultp)) != 0) goto fail1; return (0); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:20:20 2018 (r340816) @@ -471,7 +471,8 @@ typedef struct efx_nvram_ops_s { unsigned int, size_t); efx_rc_t (*envo_partn_write)(efx_nic_t *, uint32_t, unsigned int, caddr_t, size_t); - efx_rc_t (*envo_partn_rw_finish)(efx_nic_t *, uint32_t); + efx_rc_t (*envo_partn_rw_finish)(efx_nic_t *, uint32_t, + uint32_t *); efx_rc_t (*envo_partn_get_version)(efx_nic_t *, uint32_t, uint32_t *, uint16_t *); efx_rc_t (*envo_partn_set_version)(efx_nic_t *, uint32_t, @@ -560,7 +561,7 @@ efx_mcdi_nvram_update_finish( __in efx_nic_t *enp, __in uint32_t partn, __in boolean_t reboot, - __out_opt uint32_t *resultp); + __out_opt uint32_t *verify_resultp); #if EFSYS_OPT_DIAG Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:20 2018 (r340816) @@ -371,6 +371,7 @@ efx_nvram_rw_finish( { const efx_nvram_ops_t *envop = enp->en_envop; uint32_t partn; + uint32_t verify_result; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -384,7 +385,7 @@ efx_nvram_rw_finish( if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; - if ((rc = envop->envo_partn_rw_finish(enp, partn)) != 0) + if ((rc = envop->envo_partn_rw_finish(enp, partn, &verify_result)) != 0) goto fail2; enp->en_nvram_locked = EFX_NVRAM_INVALID; @@ -920,13 +921,13 @@ efx_mcdi_nvram_update_finish( __in efx_nic_t *enp, __in uint32_t partn, __in boolean_t reboot, - __out_opt uint32_t *resultp) + __out_opt uint32_t *verify_resultp) { const efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN, MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN)]; - uint32_t result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; + uint32_t verify_result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); @@ -950,26 +951,26 @@ efx_mcdi_nvram_update_finish( } if (req.emr_out_length_used < MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) { - result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; + verify_result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; if (encp->enc_fw_verified_nvram_update_required) { /* Mandatory verification result is missing */ rc = EMSGSIZE; goto fail2; } } else { - result = + verify_result = MCDI_OUT_DWORD(req, NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE); } if ((encp->enc_fw_verified_nvram_update_required) && - (result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS)) { + (verify_result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS)) { /* Mandatory verification failed */ rc = EINVAL; goto fail3; } - if (resultp != NULL) - *resultp = result; + if (verify_resultp != NULL) + *verify_resultp = verify_result; return (0); @@ -981,8 +982,8 @@ fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); /* Always report verification result */ - if (resultp != NULL) - *resultp = result; + if (verify_resultp != NULL) + *verify_resultp = verify_result; return (rc); } Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/siena_impl.h Fri Nov 23 10:20:20 2018 (r340816) @@ -147,7 +147,8 @@ siena_nvram_partn_lock( extern __checkReturn efx_rc_t siena_nvram_partn_unlock( __in efx_nic_t *enp, - __in uint32_t partn); + __in uint32_t partn, + __out_opt uint32_t *verify_resultp); extern __checkReturn efx_rc_t siena_nvram_get_dynamic_cfg( @@ -219,7 +220,8 @@ siena_nvram_partn_write( extern __checkReturn efx_rc_t siena_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in uint32_t partn); + __in uint32_t partn, + __out_opt uint32_t *verify_resultp); extern __checkReturn efx_rc_t siena_nvram_partn_get_version( Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/siena_nvram.c Fri Nov 23 10:20:20 2018 (r340816) @@ -175,7 +175,8 @@ fail1: __checkReturn efx_rc_t siena_nvram_partn_unlock( __in efx_nic_t *enp, - __in uint32_t partn) + __in uint32_t partn, + __out_opt uint32_t *verify_resultp) { boolean_t reboot; efx_rc_t rc; @@ -188,7 +189,7 @@ siena_nvram_partn_unlock( partn == MC_CMD_NVRAM_TYPE_PHY_PORT1 || partn == MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO); - rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, NULL); + rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, verify_resultp); if (rc != 0) goto fail1; @@ -592,11 +593,12 @@ fail1: __checkReturn efx_rc_t siena_nvram_partn_rw_finish( __in efx_nic_t *enp, - __in uint32_t partn) + __in uint32_t partn, + __out_opt uint32_t *verify_resultp) { efx_rc_t rc; - if ((rc = siena_nvram_partn_unlock(enp, partn)) != 0) + if ((rc = siena_nvram_partn_unlock(enp, partn, verify_resultp)) != 0) goto fail1; return (0); @@ -710,7 +712,7 @@ siena_nvram_partn_set_version( EFSYS_KMEM_FREE(enp->en_esip, length, dcfg); - siena_nvram_partn_unlock(enp, dcfg_partn); + siena_nvram_partn_unlock(enp, dcfg_partn, NULL); return (0); Modified: head/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Fri Nov 23 10:20:08 2018 (r340815) +++ head/sys/dev/sfxge/common/siena_vpd.c Fri Nov 23 10:20:20 2018 (r340816) @@ -577,7 +577,7 @@ siena_vpd_write( EFSYS_KMEM_FREE(enp->en_esip, dcfg_size, dcfg); - siena_nvram_partn_unlock(enp, dcfg_partn); + siena_nvram_partn_unlock(enp, dcfg_partn, NULL); return (0); @@ -592,7 +592,7 @@ fail5: fail4: EFSYS_PROBE(fail4); - siena_nvram_partn_unlock(enp, dcfg_partn); + siena_nvram_partn_unlock(enp, dcfg_partn, NULL); fail3: EFSYS_PROBE(fail3); fail2: From owner-svn-src-head@freebsd.org Fri Nov 23 10:20:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C3101141B2B; Fri, 23 Nov 2018 10:20:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0548B80CB2; Fri, 23 Nov 2018 10:20:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E00DA1D345; Fri, 23 Nov 2018 10:20:33 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAKXma031601; Fri, 23 Nov 2018 10:20:33 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAKXHd031598; Fri, 23 Nov 2018 10:20:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231020.wANAKXHd031598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340817 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 340817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0548B80CB2 X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:37 -0000 Author: arybchik Date: Fri Nov 23 10:20:32 2018 New Revision: 340817 URL: https://svnweb.freebsd.org/changeset/base/340817 Log: sfxge(4): extend NVRAM RW finish to return verify result Extend efx_nvram_rw_finish() to return firmware verify result code. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18087 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_bootcfg.c head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/sfxge_nvram.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:20:20 2018 (r340816) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:20:32 2018 (r340817) @@ -1418,7 +1418,8 @@ efx_nvram_rw_start( extern __checkReturn efx_rc_t efx_nvram_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type); + __in efx_nvram_type_t type, + __out_opt uint32_t *verify_resultp); extern __checkReturn efx_rc_t efx_nvram_get_version( Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Fri Nov 23 10:20:20 2018 (r340816) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Fri Nov 23 10:20:32 2018 (r340817) @@ -350,11 +350,11 @@ efx_bootcfg_read( if ((rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, sector_offset, (caddr_t)payload, sector_length)) != 0) { - (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); + (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL); goto fail6; } - if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) + if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) goto fail7; /* Verify that the area is correctly formatted and checksummed */ @@ -526,7 +526,7 @@ efx_bootcfg_write( 0, (caddr_t)partn_data, partn_length)) != 0) goto fail11; - if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) + if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) goto fail12; EFSYS_KMEM_FREE(enp->en_esip, partn_length, partn_data); @@ -542,7 +542,7 @@ fail10: fail9: EFSYS_PROBE(fail9); - (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); + (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL); fail8: EFSYS_PROBE(fail8); Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:20 2018 (r340816) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:32 2018 (r340817) @@ -367,11 +367,12 @@ fail1: __checkReturn efx_rc_t efx_nvram_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type) + __in efx_nvram_type_t type, + __out_opt uint32_t *verify_resultp) { const efx_nvram_ops_t *envop = enp->en_envop; uint32_t partn; - uint32_t verify_result; + uint32_t verify_result = 0; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -390,6 +391,9 @@ efx_nvram_rw_finish( enp->en_nvram_locked = EFX_NVRAM_INVALID; + if (verify_resultp != NULL) + *verify_resultp = verify_result; + return (0); fail2: @@ -398,6 +402,10 @@ fail2: fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); + + /* Always report verification result */ + if (verify_resultp != NULL) + *verify_resultp = verify_result; return (rc); } Modified: head/sys/dev/sfxge/sfxge_nvram.c ============================================================================== --- head/sys/dev/sfxge/sfxge_nvram.c Fri Nov 23 10:20:20 2018 (r340816) +++ head/sys/dev/sfxge/sfxge_nvram.c Fri Nov 23 10:20:32 2018 (r340817) @@ -104,7 +104,7 @@ sfxge_nvram_rw(struct sfxge_softc *sc, sfxge_ioc_t *ip fail3: free(buf, M_TEMP); - efx_nvram_rw_finish(enp, type); + efx_nvram_rw_finish(enp, type, NULL); fail1: return (rc); } @@ -125,7 +125,7 @@ sfxge_nvram_erase(struct sfxge_softc *sc, efx_nvram_ty rc = efx_nvram_erase(enp, type); - efx_nvram_rw_finish(enp, type); + efx_nvram_rw_finish(enp, type, NULL); return (rc); } From owner-svn-src-head@freebsd.org Fri Nov 23 10:20:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A1641141B64; Fri, 23 Nov 2018 10:20:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B98180E3D; Fri, 23 Nov 2018 10:20:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1FFE1D385; Fri, 23 Nov 2018 10:20:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAKj57032596; Fri, 23 Nov 2018 10:20:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAKiZg032592; Fri, 23 Nov 2018 10:20:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231020.wANAKiZg032592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340818 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B98180E3D X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:50 -0000 Author: arybchik Date: Fri Nov 23 10:20:44 2018 New Revision: 340818 URL: https://svnweb.freebsd.org/changeset/base/340818 Log: sfxge(4): rename firmware update verify result cap field The existing name confuses support for secure boot with support for reporting a verify result after an NVRAM update. As the capability only reports support for returning a verify result, change the name to be less confusing. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18088 Modified: head/sys/dev/sfxge/common/ef10_mcdi.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Fri Nov 23 10:20:32 2018 (r340817) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Fri Nov 23 10:20:44 2018 (r340818) @@ -133,7 +133,7 @@ ef10_mcdi_get_timeout( case MC_CMD_NVRAM_ERASE: case MC_CMD_LICENSING_V3: case MC_CMD_NVRAM_UPDATE_FINISH: - if (encp->enc_fw_verified_nvram_update_required != B_FALSE) { + if (encp->enc_nvram_update_verify_result_supported != B_FALSE) { /* * Potentially longer running commands, which firmware * may choose to process in a background thread. Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 10:20:32 2018 (r340817) +++ head/sys/dev/sfxge/common/ef10_nic.c Fri Nov 23 10:20:44 2018 (r340818) @@ -1057,7 +1057,7 @@ ef10_get_datapath_caps( * and version 2 of MC_CMD_NVRAM_UPDATE_FINISH (to verify the updated * partition and report the result). */ - encp->enc_fw_verified_nvram_update_required = + encp->enc_nvram_update_verify_result_supported = CAP_FLAG2(flags2, NVRAM_UPDATE_REPORT_VERIFY_RESULT) ? B_TRUE : B_FALSE; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:20:32 2018 (r340817) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:20:44 2018 (r340818) @@ -1213,7 +1213,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_required_pcie_bandwidth_mbps; uint32_t enc_max_pcie_link_gen; /* Firmware verifies integrity of NVRAM updates */ - uint32_t enc_fw_verified_nvram_update_required; + uint32_t enc_nvram_update_verify_result_supported; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:32 2018 (r340817) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:44 2018 (r340818) @@ -960,8 +960,8 @@ efx_mcdi_nvram_update_finish( if (req.emr_out_length_used < MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) { verify_result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; - if (encp->enc_fw_verified_nvram_update_required) { - /* Mandatory verification result is missing */ + if (encp->enc_nvram_update_verify_result_supported) { + /* Result of update verification is missing */ rc = EMSGSIZE; goto fail2; } @@ -970,9 +970,9 @@ efx_mcdi_nvram_update_finish( MCDI_OUT_DWORD(req, NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE); } - if ((encp->enc_fw_verified_nvram_update_required) && + if ((encp->enc_nvram_update_verify_result_supported) && (verify_result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS)) { - /* Mandatory verification failed */ + /* Update verification failed */ rc = EINVAL; goto fail3; } Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Fri Nov 23 10:20:32 2018 (r340817) +++ head/sys/dev/sfxge/common/siena_nic.c Fri Nov 23 10:20:44 2018 (r340818) @@ -179,7 +179,7 @@ siena_board_cfg( encp->enc_required_pcie_bandwidth_mbps = 2 * 10000; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN2; - encp->enc_fw_verified_nvram_update_required = B_FALSE; + encp->enc_nvram_update_verify_result_supported = B_FALSE; return (0); From owner-svn-src-head@freebsd.org Fri Nov 23 10:20:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79A901141BA5; Fri, 23 Nov 2018 10:20:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C00E680EF2; Fri, 23 Nov 2018 10:20:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A55F1D393; Fri, 23 Nov 2018 10:20:56 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAKuNd034869; Fri, 23 Nov 2018 10:20:56 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAKu2T034868; Fri, 23 Nov 2018 10:20:56 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231020.wANAKu2T034868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340819 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C00E680EF2 X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:20:57 -0000 Author: arybchik Date: Fri Nov 23 10:20:55 2018 New Revision: 340819 URL: https://svnweb.freebsd.org/changeset/base/340819 Log: sfxge(4): simplify NVRAM type to partition mappings Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18089 Modified: head/sys/dev/sfxge/common/ef10_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:20:44 2018 (r340818) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:20:55 2018 (r340819) @@ -2109,83 +2109,47 @@ fail1: typedef struct ef10_parttbl_entry_s { unsigned int partn; - unsigned int port; + unsigned int port_mask; efx_nvram_type_t nvtype; } ef10_parttbl_entry_t; +/* Port mask values */ +#define PORT_1 (1u << 1) +#define PORT_2 (1u << 2) +#define PORT_3 (1u << 3) +#define PORT_4 (1u << 4) +#define PORT_ALL (0xffffffffu) + +#define PARTN_MAP_ENTRY(partn, port_mask, nvtype) \ +{ (NVRAM_PARTITION_TYPE_##partn), (PORT_##port_mask), (EFX_NVRAM_##nvtype) } + /* Translate EFX NVRAM types to firmware partition types */ static ef10_parttbl_entry_t hunt_parttbl[] = { - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 1, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 2, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 3, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 4, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 1, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 2, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 3, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 4, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 1, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 2, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 3, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 4, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 1, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT1, 2, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT2, 3, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT3, 4, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 1, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 2, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 3, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 4, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_FPGA, 1, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 2, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 3, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 4, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE} + /* partn ports nvtype */ + PARTN_MAP_ENTRY(MC_FIRMWARE, ALL, MC_FIRMWARE), + PARTN_MAP_ENTRY(MC_FIRMWARE_BACKUP, ALL, MC_GOLDEN), + PARTN_MAP_ENTRY(EXPANSION_ROM, ALL, BOOTROM), + PARTN_MAP_ENTRY(EXPROM_CONFIG_PORT0, 1, BOOTROM_CFG), + PARTN_MAP_ENTRY(EXPROM_CONFIG_PORT1, 2, BOOTROM_CFG), + PARTN_MAP_ENTRY(EXPROM_CONFIG_PORT2, 3, BOOTROM_CFG), + PARTN_MAP_ENTRY(EXPROM_CONFIG_PORT3, 4, BOOTROM_CFG), + PARTN_MAP_ENTRY(DYNAMIC_CONFIG, ALL, DYNAMIC_CFG), + PARTN_MAP_ENTRY(FPGA, ALL, FPGA), + PARTN_MAP_ENTRY(FPGA_BACKUP, ALL, FPGA_BACKUP), + PARTN_MAP_ENTRY(LICENSE, ALL, LICENSE), }; static ef10_parttbl_entry_t medford_parttbl[] = { - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 1, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 2, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 3, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE, 4, EFX_NVRAM_MC_FIRMWARE}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 1, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 2, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 3, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_MC_FIRMWARE_BACKUP, 4, EFX_NVRAM_MC_GOLDEN}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 1, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 2, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 3, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_ROM, 4, EFX_NVRAM_BOOTROM}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 1, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 2, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 3, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0, 4, EFX_NVRAM_BOOTROM_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 1, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 2, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 3, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 4, EFX_NVRAM_DYNAMIC_CFG}, - {NVRAM_PARTITION_TYPE_FPGA, 1, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 2, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 3, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA, 4, EFX_NVRAM_FPGA}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}, - {NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE}, - {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 1, EFX_NVRAM_UEFIROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 2, EFX_NVRAM_UEFIROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 3, EFX_NVRAM_UEFIROM}, - {NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 4, EFX_NVRAM_UEFIROM} + /* partn ports nvtype */ + PARTN_MAP_ENTRY(MC_FIRMWARE, ALL, MC_FIRMWARE), + PARTN_MAP_ENTRY(MC_FIRMWARE_BACKUP, ALL, MC_GOLDEN), + PARTN_MAP_ENTRY(EXPANSION_ROM, ALL, BOOTROM), + PARTN_MAP_ENTRY(EXPROM_CONFIG, ALL, BOOTROM_CFG), + PARTN_MAP_ENTRY(DYNAMIC_CONFIG, ALL, DYNAMIC_CFG), + PARTN_MAP_ENTRY(FPGA, ALL, FPGA), + PARTN_MAP_ENTRY(FPGA_BACKUP, ALL, FPGA_BACKUP), + PARTN_MAP_ENTRY(LICENSE, ALL, LICENSE), + PARTN_MAP_ENTRY(EXPANSION_UEFI, ALL, UEFIROM), }; static __checkReturn efx_rc_t @@ -2230,8 +2194,8 @@ ef10_nvram_type_to_partn( for (i = 0; i < parttbl_rows; i++) { ef10_parttbl_entry_t *entry = &parttbl[i]; - if (entry->nvtype == type && - entry->port == emip->emi_port) { + if ((entry->nvtype == type) && + (entry->port_mask & (1u << emip->emi_port))) { *partnp = entry->partn; return (0); } @@ -2260,8 +2224,8 @@ ef10_nvram_partn_to_type( for (i = 0; i < parttbl_rows; i++) { ef10_parttbl_entry_t *entry = &parttbl[i]; - if (entry->partn == partn && - entry->port == emip->emi_port) { + if ((entry->partn == partn) && + (entry->port_mask & (1u << emip->emi_port))) { *typep = entry->nvtype; return (0); } From owner-svn-src-head@freebsd.org Fri Nov 23 10:21:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29CE41141BEF; Fri, 23 Nov 2018 10:21:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE9C981078; Fri, 23 Nov 2018 10:21:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FD131D3A2; Fri, 23 Nov 2018 10:21:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAL7k0035715; Fri, 23 Nov 2018 10:21:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAL7ml035713; Fri, 23 Nov 2018 10:21:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231021.wANAL7ml035713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340820 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE9C981078 X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:21:11 -0000 Author: arybchik Date: Fri Nov 23 10:21:06 2018 New Revision: 340820 URL: https://svnweb.freebsd.org/changeset/base/340820 Log: sfxge(4): check NVRAM locking by partition ID Tracking which partition is locked avoids being overly conservative when EFX_NVRAM_xxx maps to more than one partition (depnding on the current port number). Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18090 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:20:55 2018 (r340819) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:21:06 2018 (r340820) @@ -457,6 +457,10 @@ typedef struct efx_mcdi_s { #endif /* EFSYS_OPT_MCDI */ #if EFSYS_OPT_NVRAM + +/* Invalid partition ID for en_nvram_partn_locked field of efx_nc_t */ +#define EFX_NVRAM_PARTN_INVALID (0xffffffffu) + typedef struct efx_nvram_ops_s { #if EFSYS_OPT_DIAG efx_rc_t (*envo_test)(efx_nic_t *); @@ -644,7 +648,7 @@ struct efx_nic_s { efx_mcdi_t en_mcdi; #endif /* EFSYS_OPT_MCDI */ #if EFSYS_OPT_NVRAM - efx_nvram_type_t en_nvram_locked; + uint32_t en_nvram_partn_locked; const efx_nvram_ops_t *en_envop; #endif /* EFSYS_OPT_NVRAM */ #if EFSYS_OPT_VPD Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:20:55 2018 (r340819) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:06 2018 (r340820) @@ -117,6 +117,8 @@ efx_nvram_init( enp->en_envop = envop; enp->en_mod_flags |= EFX_MOD_NVRAM; + enp->en_nvram_partn_locked = EFX_NVRAM_PARTN_INVALID; + return (0); fail1: @@ -232,15 +234,15 @@ efx_nvram_rw_start( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, EFX_NVRAM_PARTN_INVALID); + if ((rc = envop->envo_partn_rw_start(enp, partn, chunk_sizep)) != 0) goto fail2; - enp->en_nvram_locked = type; + enp->en_nvram_partn_locked = partn; return (0); @@ -270,11 +272,11 @@ efx_nvram_read_chunk( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); + if ((rc = envop->envo_partn_read(enp, partn, offset, data, size)) != 0) goto fail2; @@ -305,11 +307,11 @@ efx_nvram_erase( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); + if ((rc = envop->envo_partn_size(enp, partn, &size)) != 0) goto fail2; @@ -346,11 +348,11 @@ efx_nvram_write_chunk( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); + if ((rc = envop->envo_partn_write(enp, partn, offset, data, size)) != 0) goto fail2; @@ -381,15 +383,15 @@ efx_nvram_rw_finish( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, type); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); + if ((rc = envop->envo_partn_rw_finish(enp, partn, &verify_result)) != 0) goto fail2; - enp->en_nvram_locked = EFX_NVRAM_INVALID; + enp->en_nvram_partn_locked = EFX_NVRAM_PARTN_INVALID; if (verify_resultp != NULL) *verify_resultp = verify_result; @@ -398,7 +400,7 @@ efx_nvram_rw_finish( fail2: EFSYS_PROBE(fail2); - enp->en_nvram_locked = EFX_NVRAM_INVALID; + enp->en_nvram_partn_locked = EFX_NVRAM_PARTN_INVALID; fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); @@ -426,16 +428,16 @@ efx_nvram_set_version( EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) + goto fail1; + /* * The Siena implementation of envo_set_version() will attempt to - * acquire the NVRAM_UPDATE lock for the DYNAMIC_CONFIG sector. + * acquire the NVRAM_UPDATE lock for the DYNAMIC_CONFIG partition. * Therefore, you can't have already acquired the NVRAM_UPDATE lock. */ - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID); + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, EFX_NVRAM_PARTN_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) - goto fail1; - if ((rc = envop->envo_partn_set_version(enp, partn, version)) != 0) goto fail2; @@ -495,7 +497,7 @@ efx_nvram_fini( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(enp->en_nvram_locked, ==, EFX_NVRAM_INVALID); + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, EFX_NVRAM_PARTN_INVALID); enp->en_envop = NULL; enp->en_mod_flags &= ~EFX_MOD_NVRAM; From owner-svn-src-head@freebsd.org Fri Nov 23 10:21:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCAD1141C30; Fri, 23 Nov 2018 10:21:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F96B81161; Fri, 23 Nov 2018 10:21:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4369B1D3B8; Fri, 23 Nov 2018 10:21:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANALIL9035771; Fri, 23 Nov 2018 10:21:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANALIUT035770; Fri, 23 Nov 2018 10:21:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231021.wANALIUT035770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340821 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F96B81161 X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.501,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:21:19 -0000 Author: arybchik Date: Fri Nov 23 10:21:17 2018 New Revision: 340821 URL: https://svnweb.freebsd.org/changeset/base/340821 Log: sfxge(4): report correct partition write chunk size If the firmware reports a non-zero write chunk size then nvram writes may fail if a different granularity is used (e.g. for MUM firmware on Sorrento). Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18091 Modified: head/sys/dev/sfxge/common/ef10_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:06 2018 (r340820) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:17 2018 (r340821) @@ -2313,16 +2313,27 @@ ef10_nvram_partn_rw_start( __in uint32_t partn, __out size_t *chunk_sizep) { + uint32_t write_size = 0; efx_rc_t rc; - if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) + if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL, + NULL, &write_size)) != 0) goto fail1; - if (chunk_sizep != NULL) - *chunk_sizep = EF10_NVRAM_CHUNK; + if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) + goto fail2; + if (chunk_sizep != NULL) { + if (write_size == 0) + *chunk_sizep = EF10_NVRAM_CHUNK; + else + *chunk_sizep = write_size; + } + return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-head@freebsd.org Fri Nov 23 10:21:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06B311141C77; Fri, 23 Nov 2018 10:21:30 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 837D281279; Fri, 23 Nov 2018 10:21:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 118991D3C4; Fri, 23 Nov 2018 10:21:29 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANALSHO035828; Fri, 23 Nov 2018 10:21:28 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANALSpg035827; Fri, 23 Nov 2018 10:21:28 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231021.wANALSpg035827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340822 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 837D281279 X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.501,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:21:30 -0000 Author: arybchik Date: Fri Nov 23 10:21:28 2018 New Revision: 340822 URL: https://svnweb.freebsd.org/changeset/base/340822 Log: sfxge(4): fix check in NVRAM validate Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18092 Modified: head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:17 2018 (r340821) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:28 2018 (r340822) @@ -473,10 +473,11 @@ efx_nvram_validate( if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; - if (envop->envo_type_to_partn != NULL && - ((rc = envop->envo_buffer_validate(enp, partn, - partn_data, partn_size)) != 0)) - goto fail2; + if (envop->envo_buffer_validate != NULL) { + if ((rc = envop->envo_buffer_validate(enp, partn, + partn_data, partn_size)) != 0) + goto fail2; + } return (0); From owner-svn-src-head@freebsd.org Fri Nov 23 10:21:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94AA51141DD2; Fri, 23 Nov 2018 10:21:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF31081390; Fri, 23 Nov 2018 10:21:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9F8F1D3D5; Fri, 23 Nov 2018 10:21:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANALbsN035889; Fri, 23 Nov 2018 10:21:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANALao0035881; Fri, 23 Nov 2018 10:21:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231021.wANALao0035881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340823 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF31081390 X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:21:40 -0000 Author: arybchik Date: Fri Nov 23 10:21:36 2018 New Revision: 340823 URL: https://svnweb.freebsd.org/changeset/base/340823 Log: sfxge(4): precheck and verify flash writes Read existing flash content before writing, so the flash write can be avoided if the existing partition content matches the new image. This avoids unnecessary write cycles for the flash device, and may also be faster. If the flash does need to be updated, verify the content after writing. Note that reading the flash content after writing but before calling efx_nvram-rw_finish() avoids firmware bug68170, which can lead to signed image updates failing on Medford. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18093 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 10:21:28 2018 (r340822) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 10:21:36 2018 (r340823) @@ -445,6 +445,14 @@ ef10_nvram_partn_read( __in size_t size); extern __checkReturn efx_rc_t +ef10_nvram_partn_read_backup( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size); + +extern __checkReturn efx_rc_t ef10_nvram_partn_erase( __in efx_nic_t *enp, __in uint32_t partn, Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:28 2018 (r340822) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:36 2018 (r340823) @@ -1940,11 +1940,34 @@ ef10_nvram_partn_read( __in size_t size) { /* - * Read requests which come in through the EFX API expect to - * read the current, active partition. + * An A/B partition has two data stores (current and backup). + * Read requests which come in through the EFX API expect to read the + * current, active store of an A/B partition. For non A/B partitions, + * there is only a single store and so the mode param is ignored. */ return ef10_nvram_partn_read_mode(enp, partn, offset, data, size, MC_CMD_NVRAM_READ_IN_V2_TARGET_CURRENT); +} + + __checkReturn efx_rc_t +ef10_nvram_partn_read_backup( + __in efx_nic_t *enp, + __in uint32_t partn, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size) +{ + /* + * An A/B partition has two data stores (current and backup). + * Read the backup store of an A/B partition (i.e. the store currently + * being written to if the partition is locked). + * + * This is needed when comparing the existing partition content to avoid + * unnecessary writes, or to read back what has been written to check + * that the writes have succeeded. + */ + return ef10_nvram_partn_read_mode(enp, partn, offset, data, size, + MC_CMD_NVRAM_READ_IN_V2_TARGET_BACKUP); } __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:21:28 2018 (r340822) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:21:36 2018 (r340823) @@ -1437,6 +1437,14 @@ efx_nvram_read_chunk( __in size_t size); extern __checkReturn efx_rc_t +efx_nvram_read_backup( + __in efx_nic_t *enp, + __in efx_nvram_type_t type, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size); + +extern __checkReturn efx_rc_t efx_nvram_set_version( __in efx_nic_t *enp, __in efx_nvram_type_t type, Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:21:28 2018 (r340822) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 10:21:36 2018 (r340823) @@ -471,6 +471,8 @@ typedef struct efx_nvram_ops_s { efx_rc_t (*envo_partn_rw_start)(efx_nic_t *, uint32_t, size_t *); efx_rc_t (*envo_partn_read)(efx_nic_t *, uint32_t, unsigned int, caddr_t, size_t); + efx_rc_t (*envo_partn_read_backup)(efx_nic_t *, uint32_t, + unsigned int, caddr_t, size_t); efx_rc_t (*envo_partn_erase)(efx_nic_t *, uint32_t, unsigned int, size_t); efx_rc_t (*envo_partn_write)(efx_nic_t *, uint32_t, Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:28 2018 (r340822) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:36 2018 (r340823) @@ -48,6 +48,7 @@ static const efx_nvram_ops_t __efx_nvram_siena_ops = { siena_nvram_partn_size, /* envo_partn_size */ siena_nvram_partn_rw_start, /* envo_partn_rw_start */ siena_nvram_partn_read, /* envo_partn_read */ + siena_nvram_partn_read, /* envo_partn_read_backup */ siena_nvram_partn_erase, /* envo_partn_erase */ siena_nvram_partn_write, /* envo_partn_write */ siena_nvram_partn_rw_finish, /* envo_partn_rw_finish */ @@ -68,6 +69,7 @@ static const efx_nvram_ops_t __efx_nvram_ef10_ops = { ef10_nvram_partn_size, /* envo_partn_size */ ef10_nvram_partn_rw_start, /* envo_partn_rw_start */ ef10_nvram_partn_read, /* envo_partn_read */ + ef10_nvram_partn_read_backup, /* envo_partn_read_backup */ ef10_nvram_partn_erase, /* envo_partn_erase */ ef10_nvram_partn_write, /* envo_partn_write */ ef10_nvram_partn_rw_finish, /* envo_partn_rw_finish */ @@ -278,6 +280,48 @@ efx_nvram_read_chunk( EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); if ((rc = envop->envo_partn_read(enp, partn, offset, data, size)) != 0) + goto fail2; + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +/* + * Read from the backup (writeable) store of an A/B partition. + * For non A/B partitions, there is only a single store, and so this + * function has the same behaviour as efx_nvram_read_chunk(). + */ + __checkReturn efx_rc_t +efx_nvram_read_backup( + __in efx_nic_t *enp, + __in efx_nvram_type_t type, + __in unsigned int offset, + __out_bcount(size) caddr_t data, + __in size_t size) +{ + const efx_nvram_ops_t *envop = enp->en_envop; + uint32_t partn; + efx_rc_t rc; + + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); + + EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); + EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); + + if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) + goto fail1; + + EFSYS_ASSERT3U(enp->en_nvram_partn_locked, ==, partn); + + if ((rc = envop->envo_partn_read_backup(enp, partn, offset, + data, size)) != 0) goto fail2; return (0); From owner-svn-src-head@freebsd.org Fri Nov 23 10:21:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88CA21141E20; Fri, 23 Nov 2018 10:21:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E17B8151F; Fri, 23 Nov 2018 10:21:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21FE81D3EE; Fri, 23 Nov 2018 10:21:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANALoeT035948; Fri, 23 Nov 2018 10:21:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANALopp035945; Fri, 23 Nov 2018 10:21:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231021.wANALopp035945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340824 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E17B8151F X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.519,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:21:55 -0000 Author: arybchik Date: Fri Nov 23 10:21:50 2018 New Revision: 340824 URL: https://svnweb.freebsd.org/changeset/base/340824 Log: sfxge(4): remove duplicate NVRAM asserts The checking performed in the ->envo_type_to_partn internal method make these assertions unnecessary. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18094 Modified: head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:36 2018 (r340823) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 10:21:50 2018 (r340824) @@ -2210,6 +2210,7 @@ ef10_nvram_type_to_partn( size_t parttbl_rows = 0; unsigned int i; + EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT(partnp != NULL); Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:36 2018 (r340823) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:50 2018 (r340824) @@ -167,8 +167,6 @@ efx_nvram_size( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -201,8 +199,6 @@ efx_nvram_get_version( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -233,9 +229,6 @@ efx_nvram_rw_start( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -271,9 +264,6 @@ efx_nvram_read_chunk( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -312,9 +302,6 @@ efx_nvram_read_backup( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -348,9 +335,6 @@ efx_nvram_erase( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -389,9 +373,6 @@ efx_nvram_write_chunk( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -424,9 +405,6 @@ efx_nvram_rw_finish( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -470,8 +448,6 @@ efx_nvram_set_version( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -510,9 +486,6 @@ efx_nvram_validate( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; Modified: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Fri Nov 23 10:21:36 2018 (r340823) +++ head/sys/dev/sfxge/common/siena_nvram.c Fri Nov 23 10:21:50 2018 (r340824) @@ -245,6 +245,7 @@ siena_nvram_type_to_partn( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); unsigned int i; + EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT(partnp != NULL); From owner-svn-src-head@freebsd.org Fri Nov 23 10:22:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 898851141E69; Fri, 23 Nov 2018 10:22:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CBE28166A; Fri, 23 Nov 2018 10:22:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBA361D403; Fri, 23 Nov 2018 10:22:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANAM1qI036030; Fri, 23 Nov 2018 10:22:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANAM1fa036029; Fri, 23 Nov 2018 10:22:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231022.wANAM1fa036029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 10:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340825 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8CBE28166A X-Spamd-Result: default: False [1.62 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.501,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 10:22:07 -0000 Author: arybchik Date: Fri Nov 23 10:22:01 2018 New Revision: 340825 URL: https://svnweb.freebsd.org/changeset/base/340825 Log: sfxge(4): quieten get version methods Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18095 Modified: head/sys/dev/sfxge/common/efx_nvram.c Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:21:50 2018 (r340824) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Nov 23 10:22:01 2018 (r340825) @@ -613,7 +613,7 @@ efx_mcdi_nvram_metadata( MCDI_IN_SET_DWORD(req, NVRAM_METADATA_IN_TYPE, partn); - efx_mcdi_execute(enp, &req); + efx_mcdi_execute_quiet(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; From owner-svn-src-head@freebsd.org Fri Nov 23 11:31:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17DD81143A7B; Fri, 23 Nov 2018 11:31:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE21C8472B; Fri, 23 Nov 2018 11:31:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FFC71DFDA; Fri, 23 Nov 2018 11:31:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBVk6b072140; Fri, 23 Nov 2018 11:31:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBVkb0072139; Fri, 23 Nov 2018 11:31:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231131.wANBVkb0072139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340826 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE21C8472B X-Spamd-Result: default: False [1.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.65)[0.646,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:31:47 -0000 Author: arybchik Date: Fri Nov 23 11:31:45 2018 New Revision: 340826 URL: https://svnweb.freebsd.org/changeset/base/340826 Log: sfxge(4): fix ignoring function return value fix PreFAST issue, add missing annotation that function return value should not be ignored. Fix alignment. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18096 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 10:22:01 2018 (r340825) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 11:31:45 2018 (r340826) @@ -920,13 +920,13 @@ efx_phy_media_type_get( __in efx_nic_t *enp, __out efx_phy_media_type_t *typep); -extern efx_rc_t +extern __checkReturn efx_rc_t efx_phy_module_get_info( - __in efx_nic_t *enp, - __in uint8_t dev_addr, - __in uint8_t offset, - __in uint8_t len, - __out_bcount(len) uint8_t *data); + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data); #if EFSYS_OPT_PHY_STATS Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Fri Nov 23 10:22:01 2018 (r340825) +++ head/sys/dev/sfxge/common/efx_phy.c Fri Nov 23 11:31:45 2018 (r340826) @@ -301,7 +301,7 @@ efx_phy_media_type_get( *typep = epp->ep_fixed_port_type; } - __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_phy_module_get_info( __in efx_nic_t *enp, __in uint8_t dev_addr, From owner-svn-src-head@freebsd.org Fri Nov 23 11:32:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C64A1143AA2; Fri, 23 Nov 2018 11:32:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2847A84849; Fri, 23 Nov 2018 11:32:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 478571DFEB; Fri, 23 Nov 2018 11:31:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBVwOO072198; Fri, 23 Nov 2018 11:31:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBVviC072196; Fri, 23 Nov 2018 11:31:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231131.wANBVviC072196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340827 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2847A84849 X-Spamd-Result: default: False [1.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.65)[0.646,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:32:02 -0000 Author: arybchik Date: Fri Nov 23 11:31:57 2018 New Revision: 340827 URL: https://svnweb.freebsd.org/changeset/base/340827 Log: sfxge(4): support MUM/SUC firmware partitions Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18097 Modified: head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 11:31:45 2018 (r340826) +++ head/sys/dev/sfxge/common/ef10_nvram.c Fri Nov 23 11:31:57 2018 (r340827) @@ -2173,6 +2173,7 @@ static ef10_parttbl_entry_t medford_parttbl[] = { PARTN_MAP_ENTRY(FPGA_BACKUP, ALL, FPGA_BACKUP), PARTN_MAP_ENTRY(LICENSE, ALL, LICENSE), PARTN_MAP_ENTRY(EXPANSION_UEFI, ALL, UEFIROM), + PARTN_MAP_ENTRY(MUM_FIRMWARE, ALL, MUM_FIRMWARE), }; static __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 11:31:45 2018 (r340826) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 11:31:57 2018 (r340827) @@ -1388,6 +1388,7 @@ typedef enum efx_nvram_type_e { EFX_NVRAM_DYNAMIC_CFG, EFX_NVRAM_LICENSE, EFX_NVRAM_UEFIROM, + EFX_NVRAM_MUM_FIRMWARE, EFX_NVRAM_NTYPES, } efx_nvram_type_t; From owner-svn-src-head@freebsd.org Fri Nov 23 11:38:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AE5711440AF; Fri, 23 Nov 2018 11:38:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40F5684ED4; Fri, 23 Nov 2018 11:38:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DE8B1E025; Fri, 23 Nov 2018 11:38:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBcoZa073243; Fri, 23 Nov 2018 11:38:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBcosh073238; Fri, 23 Nov 2018 11:38:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231138.wANBcosh073238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340828 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 40F5684ED4 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.390,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:38:51 -0000 Author: arybchik Date: Fri Nov 23 11:38:50 2018 New Revision: 340828 URL: https://svnweb.freebsd.org/changeset/base/340828 Log: sfxge(4): improve RxQ label init prototype RxQ type provides more information which may be useful to setup event queue appropriately. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18098 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 23 11:31:57 2018 (r340827) +++ head/sys/dev/sfxge/common/ef10_ev.c Fri Nov 23 11:38:50 2018 (r340828) @@ -1344,9 +1344,11 @@ ef10_ev_rxlabel_init( __in efx_evq_t *eep, __in efx_rxq_t *erp, __in unsigned int label, - __in boolean_t packed_stream) + __in efx_rxq_type_t type) { efx_evq_rxq_state_t *eersp; + boolean_t packed_stream = (type >= EFX_RXQ_TYPE_PACKED_STREAM_1M) && + (type <= EFX_RXQ_TYPE_PACKED_STREAM_64K); EFSYS_ASSERT3U(label, <, EFX_ARRAY_SIZE(eep->ee_rxq_state)); eersp = &eep->ee_rxq_state[label]; Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 11:31:57 2018 (r340827) +++ head/sys/dev/sfxge/common/ef10_impl.h Fri Nov 23 11:38:50 2018 (r340828) @@ -119,7 +119,7 @@ ef10_ev_rxlabel_init( __in efx_evq_t *eep, __in efx_rxq_t *erp, __in unsigned int label, - __in boolean_t packed_stream); + __in efx_rxq_type_t type); void ef10_ev_rxlabel_fini( Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:31:57 2018 (r340827) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:38:50 2018 (r340828) @@ -995,7 +995,7 @@ ef10_rx_qcreate( erp->er_eep = eep; erp->er_label = label; - ef10_ev_rxlabel_init(eep, erp, label, ps_buf_size != 0); + ef10_ev_rxlabel_init(eep, erp, label, type); return (0); From owner-svn-src-head@freebsd.org Fri Nov 23 11:39:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0197111440DA; Fri, 23 Nov 2018 11:39:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9932384FBD; Fri, 23 Nov 2018 11:39:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A28051E026; Fri, 23 Nov 2018 11:39:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBd2Dl073304; Fri, 23 Nov 2018 11:39:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBd2Vq073303; Fri, 23 Nov 2018 11:39:02 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231139.wANBd2Vq073303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340829 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9932384FBD X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.39)[0.390,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:39:04 -0000 Author: arybchik Date: Fri Nov 23 11:39:02 2018 New Revision: 340829 URL: https://svnweb.freebsd.org/changeset/base/340829 Log: sfxge(4): provide simple access to RxQ state in EvQ Packed stream Rx datapath requires access to packed stream state stored in event queue. Number of credits is upstead in event handler on a new buffer, packets parsing on 64k boundary crossing and Rx doorbell push to give credits back. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18099 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx_impl.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:38:50 2018 (r340828) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:39:02 2018 (r340829) @@ -787,8 +787,7 @@ ef10_rx_qpush_ps_credits( { efx_nic_t *enp = erp->er_enp; efx_dword_t dword; - efx_evq_rxq_state_t *rxq_state = - &erp->er_eep->ee_rxq_state[erp->er_label]; + efx_evq_rxq_state_t *rxq_state = erp->er_ev_qstate; uint32_t credits; EFSYS_ASSERT(rxq_state->eers_rx_packed_stream); @@ -837,8 +836,7 @@ ef10_rx_qps_packet_info( uint16_t buf_len; uint8_t *pkt_start; efx_qword_t *qwordp; - efx_evq_rxq_state_t *rxq_state = - &erp->er_eep->ee_rxq_state[erp->er_label]; + efx_evq_rxq_state_t *rxq_state = erp->er_ev_qstate; EFSYS_ASSERT(rxq_state->eers_rx_packed_stream); @@ -996,6 +994,8 @@ ef10_rx_qcreate( erp->er_label = label; ef10_ev_rxlabel_init(eep, erp, label, type); + + erp->er_ev_qstate = &erp->er_eep->ee_rxq_state[label]; return (0); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 11:38:50 2018 (r340828) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 11:39:02 2018 (r340829) @@ -757,6 +757,7 @@ struct efx_rxq_s { unsigned int er_label; unsigned int er_mask; efsys_mem_t *er_esmp; + efx_evq_rxq_state_t *er_ev_qstate; }; #define EFX_RXQ_MAGIC 0x15022005 From owner-svn-src-head@freebsd.org Fri Nov 23 11:39:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD6711144107; Fri, 23 Nov 2018 11:39:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA276850DE; Fri, 23 Nov 2018 11:39:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF0561E033; Fri, 23 Nov 2018 11:39:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBdD9R073363; Fri, 23 Nov 2018 11:39:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBdDaN073361; Fri, 23 Nov 2018 11:39:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231139.wANBdDaN073361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340830 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA276850DE X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.390,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:39:19 -0000 Author: arybchik Date: Fri Nov 23 11:39:13 2018 New Revision: 340830 URL: https://svnweb.freebsd.org/changeset/base/340830 Log: sfxge(4): enforce packed stream fake buffer size In the case of packed stream real size of the buffer does not fit in Rx descriptor byte count. Real size is specified on Rx queue setup. Non-zero fake should be used to bypass hardware checks. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18100 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:39:02 2018 (r340829) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 11:39:13 2018 (r340830) @@ -710,6 +710,14 @@ ef10_rx_prefix_hash( } #endif /* EFSYS_OPT_RX_SCALE */ +#if EFSYS_OPT_RX_PACKED_STREAM +/* + * Fake length for RXQ descriptors in packed stream mode + * to make hardware happy + */ +#define EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32 +#endif + void ef10_rx_qpost( __in efx_rxq_t *erp, @@ -723,6 +731,15 @@ ef10_rx_qpost( unsigned int i; unsigned int offset; unsigned int id; + +#if EFSYS_OPT_RX_PACKED_STREAM + /* + * Real size of the buffer does not fit into ESF_DZ_RX_KER_BYTE_CNT + * and equal to 0 after applying mask. Hardware does not like it. + */ + if (erp->er_ev_qstate->eers_rx_packed_stream) + size = EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE; +#endif /* The client driver must not overfill the queue */ EFSYS_ASSERT3U(added - completed + n, <=, Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 11:39:02 2018 (r340829) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 11:39:13 2018 (r340830) @@ -2050,12 +2050,6 @@ efx_rx_qpush( #if EFSYS_OPT_RX_PACKED_STREAM -/* - * Fake length for RXQ descriptors in packed stream mode - * to make hardware happy - */ -#define EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32 - extern void efx_rx_qpush_ps_credits( __in efx_rxq_t *erp); From owner-svn-src-head@freebsd.org Fri Nov 23 11:39:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7F9C1144143; Fri, 23 Nov 2018 11:39:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFFE88515D; Fri, 23 Nov 2018 11:39:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D36D1E038; Fri, 23 Nov 2018 11:39:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANBdOKr073420; Fri, 23 Nov 2018 11:39:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANBdOba073419; Fri, 23 Nov 2018 11:39:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231139.wANBdOba073419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 11:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340831 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFFE88515D X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.390,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 11:39:27 -0000 Author: arybchik Date: Fri Nov 23 11:39:24 2018 New Revision: 340831 URL: https://svnweb.freebsd.org/changeset/base/340831 Log: sfxge(4): make MAC naming consistent with other modules Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18101 Modified: head/sys/dev/sfxge/common/efx_mac.c Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Fri Nov 23 11:39:13 2018 (r340830) +++ head/sys/dev/sfxge/common/efx_mac.c Fri Nov 23 11:39:24 2018 (r340831) @@ -45,7 +45,7 @@ siena_mac_multicast_list_set( #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_SIENA -static const efx_mac_ops_t __efx_siena_mac_ops = { +static const efx_mac_ops_t __efx_mac_siena_ops = { siena_mac_poll, /* emo_poll */ siena_mac_up, /* emo_up */ siena_mac_reconfigure, /* emo_addr_set */ @@ -69,7 +69,7 @@ static const efx_mac_ops_t __efx_siena_mac_ops = { #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static const efx_mac_ops_t __efx_ef10_mac_ops = { +static const efx_mac_ops_t __efx_mac_ef10_ops = { ef10_mac_poll, /* emo_poll */ ef10_mac_up, /* emo_up */ ef10_mac_addr_set, /* emo_addr_set */ @@ -845,21 +845,21 @@ efx_mac_select( switch (enp->en_family) { #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - emop = &__efx_siena_mac_ops; + emop = &__efx_mac_siena_ops; type = EFX_MAC_SIENA; break; #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - emop = &__efx_ef10_mac_ops; + emop = &__efx_mac_ef10_ops; type = EFX_MAC_HUNTINGTON; break; #endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - emop = &__efx_ef10_mac_ops; + emop = &__efx_mac_ef10_ops; type = EFX_MAC_MEDFORD; break; #endif /* EFSYS_OPT_MEDFORD */ From owner-svn-src-head@freebsd.org Fri Nov 23 12:03:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E120114532F; Fri, 23 Nov 2018 12:03:03 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03C8386457; Fri, 23 Nov 2018 12:03:02 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4ABC1E503; Fri, 23 Nov 2018 12:03:01 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANC31B8088511; Fri, 23 Nov 2018 12:03:01 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANC317N088510; Fri, 23 Nov 2018 12:03:01 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201811231203.wANC317N088510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Fri, 23 Nov 2018 12:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340832 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 340832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03C8386457 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.39)[0.390,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 12:03:03 -0000 Author: thj Date: Fri Nov 23 12:03:01 2018 New Revision: 340832 URL: https://svnweb.freebsd.org/changeset/base/340832 Log: Add support for none ACPI battery method batteries Remove the requirement that a device be a ACPI method battery to be supported as a battery. Require now that the device be in the battery devclass and implement the get_status and get_info functions. This allows batteries which are not ACPI method batteries to be supported. Reviewed by: jtl Approved by: jtl (mentor) MFC after: 1 Month Differential Revision: https://reviews.freebsd.org/D17434 Modified: head/sys/dev/acpica/acpi_battery.c Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Fri Nov 23 11:39:24 2018 (r340831) +++ head/sys/dev/acpica/acpi_battery.c Fri Nov 23 12:03:01 2018 (r340832) @@ -169,14 +169,11 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_ba dev_idx = i; /* - * Be sure we can get various info from the battery. Note that - * acpi_BatteryIsPresent() is not enough because smart batteries only - * return that the device is present. + * Be sure we can get various info from the battery. */ - if (!acpi_BatteryIsPresent(batt_dev) || - ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || - ACPI_BATT_GET_INFO(batt_dev, bif) != 0) - continue; + if (ACPI_BATT_GET_STATUS(batt_dev, &bst[i]) != 0 || + ACPI_BATT_GET_INFO(batt_dev, bif) != 0) + continue; /* If a battery is not installed, we sometimes get strange values. */ if (!acpi_battery_bst_valid(&bst[i]) || From owner-svn-src-head@freebsd.org Fri Nov 23 13:12:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D022011469B5; Fri, 23 Nov 2018 13:12:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D82A891D4; Fri, 23 Nov 2018 13:12:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EA0B1F000; Fri, 23 Nov 2018 13:12:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANDC5ls022292; Fri, 23 Nov 2018 13:12:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANDC4vb022289; Fri, 23 Nov 2018 13:12:04 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231312.wANDC4vb022289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 13:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340833 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D82A891D4 X-Spamd-Result: default: False [1.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.52)[0.522,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 13:12:06 -0000 Author: arybchik Date: Fri Nov 23 13:12:04 2018 New Revision: 340833 URL: https://svnweb.freebsd.org/changeset/base/340833 Log: sfxge(4): support inner checksum offload on transmit Inner checksum offloads may be used only if firmware supports these tunnels. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18102 Modified: head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_tx.c Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 12:03:01 2018 (r340832) +++ head/sys/dev/sfxge/common/ef10_tx.c Fri Nov 23 13:12:04 2018 (r340833) @@ -87,12 +87,16 @@ efx_mcdi_init_txq( MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance); - MCDI_IN_POPULATE_DWORD_7(req, INIT_TXQ_IN_FLAGS, + MCDI_IN_POPULATE_DWORD_9(req, INIT_TXQ_IN_FLAGS, INIT_TXQ_IN_FLAG_BUFF_MODE, 0, INIT_TXQ_IN_FLAG_IP_CSUM_DIS, (flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1, INIT_TXQ_IN_FLAG_TCP_CSUM_DIS, (flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1, + INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN, + (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0, + INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN, + (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0, INIT_TXQ_EXT_IN_FLAG_TSOV2_EN, (flags & EFX_TXQ_FATSOV2) ? 1 : 0, INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0, INIT_TXQ_IN_CRC_MODE, 0, @@ -197,14 +201,23 @@ ef10_tx_qcreate( __in efx_txq_t *etp, __out unsigned int *addedp) { + efx_nic_cfg_t *encp = &enp->en_nic_cfg; + uint16_t inner_csum; efx_qword_t desc; efx_rc_t rc; _NOTE(ARGUNUSED(id)) + inner_csum = EFX_TXQ_CKSUM_INNER_IPV4 | EFX_TXQ_CKSUM_INNER_TCPUDP; + if (((flags & inner_csum) != 0) && + (encp->enc_tunnel_encapsulations_supported == 0)) { + rc = EINVAL; + goto fail1; + } + if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags, esmp)) != 0) - goto fail1; + goto fail2; /* * A previous user of this TX queue may have written a descriptor to the @@ -215,19 +228,25 @@ ef10_tx_qcreate( * a no-op TX option descriptor. See bug29981 for details. */ *addedp = 1; - EFX_POPULATE_QWORD_4(desc, + EFX_POPULATE_QWORD_6(desc, ESF_DZ_TX_DESC_IS_OPT, 1, ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM, ESF_DZ_TX_OPTION_UDP_TCP_CSUM, (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0, ESF_DZ_TX_OPTION_IP_CSUM, - (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0); + (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0, + ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM, + (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0, + ESF_DZ_TX_OPTION_INNER_IP_CSUM, + (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0); EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc); ef10_tx_qpush(etp, *addedp, 0); return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 12:03:01 2018 (r340832) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 13:12:04 2018 (r340833) @@ -2111,9 +2111,11 @@ efx_tx_fini( #define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */ -#define EFX_TXQ_CKSUM_IPV4 0x0001 -#define EFX_TXQ_CKSUM_TCPUDP 0x0002 -#define EFX_TXQ_FATSOV2 0x0004 +#define EFX_TXQ_CKSUM_IPV4 0x0001 +#define EFX_TXQ_CKSUM_TCPUDP 0x0002 +#define EFX_TXQ_FATSOV2 0x0004 +#define EFX_TXQ_CKSUM_INNER_IPV4 0x0008 +#define EFX_TXQ_CKSUM_INNER_TCPUDP 0x0010 extern __checkReturn efx_rc_t efx_tx_qcreate( Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Fri Nov 23 12:03:01 2018 (r340832) +++ head/sys/dev/sfxge/common/efx_tx.c Fri Nov 23 13:12:04 2018 (r340833) @@ -905,6 +905,7 @@ siena_tx_qcreate( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_oword_t oword; uint32_t size; + uint16_t inner_csum; efx_rc_t rc; _NOTE(ARGUNUSED(esmp)) @@ -934,6 +935,12 @@ siena_tx_qcreate( goto fail3; } + inner_csum = EFX_TXQ_CKSUM_INNER_IPV4 | EFX_TXQ_CKSUM_INNER_TCPUDP; + if ((flags & inner_csum) != 0) { + rc = EINVAL; + goto fail4; + } + /* Set up the new descriptor queue */ *addedp = 0; @@ -956,6 +963,8 @@ siena_tx_qcreate( return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: From owner-svn-src-head@freebsd.org Fri Nov 23 13:50:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A28BF11471B2; Fri, 23 Nov 2018 13:50:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BC888A2FF; Fri, 23 Nov 2018 13:50:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 134E61F572; Fri, 23 Nov 2018 13:50:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANDoI4b040442; Fri, 23 Nov 2018 13:50:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANDoIvl040441; Fri, 23 Nov 2018 13:50:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811231350.wANDoIvl040441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 13:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340834 - head/stand/i386 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/stand/i386 X-SVN-Commit-Revision: 340834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3BC888A2FF X-Spamd-Result: default: False [1.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.519,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 13:50:19 -0000 Author: emaste Date: Fri Nov 23 13:50:18 2018 New Revision: 340834 URL: https://svnweb.freebsd.org/changeset/base/340834 Log: Disable build-id in i386 binary boot components A user may enable build-id for all builds by adding LDFLAGS=-Wl,--build-id=sha1 to /etc/make.conf. In this case the build-id note ends added up to mbr and pmbr's .text, which makes it too large (it ends up being 532 bytes). To avoid this explicitly turn off build-id for these components. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15470 Modified: head/stand/i386/Makefile.inc Modified: head/stand/i386/Makefile.inc ============================================================================== --- head/stand/i386/Makefile.inc Fri Nov 23 13:12:04 2018 (r340833) +++ head/stand/i386/Makefile.inc Fri Nov 23 13:50:18 2018 (r340834) @@ -2,6 +2,8 @@ # # $FreeBSD$ +.include "bsd.linker.mk" + LOADER_ADDRESS?=0x200000 LDFLAGS+= -nostdlib LDFLAGS.lld+= -Wl,--no-rosegment @@ -22,6 +24,9 @@ LDSCRIPT= ${BOOTSRC}/i386/boot.ldscript # LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary # LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +.if ${LINKER_FEATURES:Mbuild-id} != "" +LDFLAGS_BIN+=-Wl,--build-id=none +.endif LD_FLAGS_BIN=-static -N --gc-sections .if ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-head@freebsd.org Fri Nov 23 15:49:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D67114A26D; Fri, 23 Nov 2018 15:49:20 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC90F8F5DD; Fri, 23 Nov 2018 15:49:19 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 899C220A19; Fri, 23 Nov 2018 15:49:19 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANFnJ8p004742; Fri, 23 Nov 2018 15:49:19 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANFnJ0n004739; Fri, 23 Nov 2018 15:49:19 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811231549.wANFnJ0n004739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Fri, 23 Nov 2018 15:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340835 - in head/lib/libc: regex tests/regex X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head/lib/libc: regex tests/regex X-SVN-Commit-Revision: 340835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC90F8F5DD X-Spamd-Result: default: False [0.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.21)[-0.215,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 15:49:20 -0000 Author: yuripv Date: Fri Nov 23 15:49:18 2018 New Revision: 340835 URL: https://svnweb.freebsd.org/changeset/base/340835 Log: regexec: fix processing multibyte strings. Matcher function incorrectly assumed that moffset that we get from findmust is in bytes. Fix this by introducing a stepback function, taking short path if MB_CUR_MAX is 1, and going back byte-by-byte, checking if we have a legal character sequence otherwise. PR: 153502 Reviewed by: pfg, kevans Approved by: kib (mentor, implicit) Differential revision: https://reviews.freebsd.org/D18297 Added: head/lib/libc/tests/regex/multibyte.sh (contents, props changed) Modified: head/lib/libc/regex/engine.c head/lib/libc/tests/regex/Makefile Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Fri Nov 23 13:50:18 2018 (r340834) +++ head/lib/libc/regex/engine.c Fri Nov 23 15:49:18 2018 (r340835) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); */ #ifdef SNAMES +#define stepback sstepback #define matcher smatcher #define walk swalk #define dissect sdissect @@ -58,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define match smat #endif #ifdef LNAMES +#define stepback lstepback #define matcher lmatcher #define walk lwalk #define dissect ldissect @@ -68,6 +70,7 @@ __FBSDID("$FreeBSD$"); #define match lmat #endif #ifdef MNAMES +#define stepback mstepback #define matcher mmatcher #define walk mwalk #define dissect mdissect @@ -142,6 +145,39 @@ static const char *pchar(int ch); #endif /* + * Given a multibyte string pointed to by start, step back nchar characters + * from current position pointed to by cur. + */ +static const char * +stepback(const char *start, const char *cur, int nchar) +{ + const char *ret; + int wc, mbc; + mbstate_t mbs; + size_t clen; + + if (MB_CUR_MAX == 1) + return ((cur - nchar) > start ? cur - nchar : NULL); + + ret = cur; + for (wc = nchar; wc > 0; wc--) { + for (mbc = 1; mbc <= MB_CUR_MAX; mbc++) { + if ((ret - mbc) < start) + return (NULL); + memset(&mbs, 0, sizeof(mbs)); + clen = mbrtowc(NULL, ret - mbc, mbc, &mbs); + if (clen != (size_t)-1 && clen != (size_t)-2) + break; + } + if (mbc > MB_CUR_MAX) + return (NULL); + ret -= mbc; + } + + return (ret); +} + +/* - matcher - the actual matching engine == static int matcher(struct re_guts *g, const char *string, \ == size_t nmatch, regmatch_t pmatch[], int eflags); @@ -244,9 +280,14 @@ matcher(struct re_guts *g, ZAPSTATE(&m->mbs); /* Adjust start according to moffset, to speed things up */ - if (dp != NULL && g->moffset > -1) - start = ((dp - g->moffset) < start) ? start : dp - g->moffset; + if (dp != NULL && g->moffset > -1) { + const char *nstart; + nstart = stepback(start, dp, g->moffset); + if (nstart != NULL) + start = nstart; + } + SP("mloop", m->st, *start); /* this loop does only one repetition except for backrefs */ @@ -1083,6 +1124,7 @@ pchar(int ch) #endif #endif +#undef stepback #undef matcher #undef walk #undef dissect Modified: head/lib/libc/tests/regex/Makefile ============================================================================== --- head/lib/libc/tests/regex/Makefile Fri Nov 23 13:50:18 2018 (r340834) +++ head/lib/libc/tests/regex/Makefile Fri Nov 23 15:49:18 2018 (r340835) @@ -2,6 +2,9 @@ PACKAGE= tests +# local test cases +ATF_TESTS_SH+= multibyte + .include "Makefile.inc" .include "${.CURDIR:H}/Makefile.netbsd-tests" .include Added: head/lib/libc/tests/regex/multibyte.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/regex/multibyte.sh Fri Nov 23 15:49:18 2018 (r340835) @@ -0,0 +1,35 @@ +# $FreeBSD$ + +atf_test_case multibyte +multibyte_head() +{ + atf_set "descr" "Check matching multibyte characters (PR153502)" +} +multibyte_body() +{ + export LC_CTYPE="C.UTF-8" + + printf 'Ă©' | atf_check -o "inline:Ă©" \ + sed -ne '/^.$/p' + printf 'Ă©Ă©' | atf_check -o "inline:Ă©Ă©" \ + sed -ne '/^..$/p' + printf 'aĂ©a' | atf_check -o "inline:aĂ©a" \ + sed -ne '/a.a/p' + printf 'aĂ©a'| atf_check -o "inline:aĂ©a" \ + sed -ne '/a.*a/p' + printf 'aaĂ©aa' | atf_check -o "inline:aaĂ©aa" \ + sed -ne '/aa.aa/p' + printf 'aĂ©aĂ©a' | atf_check -o "inline:aĂ©aĂ©a" \ + sed -ne '/a.a.a/p' + printf 'Ă©a' | atf_check -o "inline:Ă©a" \ + sed -ne '/.a/p' + printf 'aĂ©aa' | atf_check -o "inline:aĂ©aa" \ + sed -ne '/a.aa/p' + printf 'Ă©aĂ©' | atf_check -o "inline:Ă©aĂ©" \ + sed -ne '/.a./p' +} + +atf_init_test_cases() +{ + atf_add_test_case multibyte +} From owner-svn-src-head@freebsd.org Fri Nov 23 15:59:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B924C114A798; Fri, 23 Nov 2018 15:59:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DCAD8FE5F; Fri, 23 Nov 2018 15:59:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C9D620BBA; Fri, 23 Nov 2018 15:59:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANFxc8r010085; Fri, 23 Nov 2018 15:59:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANFxcrL010084; Fri, 23 Nov 2018 15:59:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231559.wANFxcrL010084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 15:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340836 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DCAD8FE5F X-Spamd-Result: default: False [0.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_HAM_SHORT(-0.31)[-0.309,0]; NEURAL_SPAM_LONG(0.40)[0.400,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 15:59:38 -0000 Author: arybchik Date: Fri Nov 23 15:59:37 2018 New Revision: 340836 URL: https://svnweb.freebsd.org/changeset/base/340836 Log: sfxge(4): use MCDIv2 for requests with too long response Use MCDIv2 for requests with a response size too long for MCDIv1. Required for MC_CMD_MAC_STATS to reports the stats without using DMA. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18103 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 15:49:18 2018 (r340835) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 15:59:37 2018 (r340836) @@ -295,7 +295,8 @@ efx_mcdi_request_start( */ if ((max_version >= 2) && ((emrp->emr_cmd > MC_CMD_CMD_SPACE_ESCAPE_7) || - (emrp->emr_in_length > MCDI_CTL_SDU_LEN_MAX_V1))) { + (emrp->emr_in_length > MCDI_CTL_SDU_LEN_MAX_V1) || + (emrp->emr_out_length > MCDI_CTL_SDU_LEN_MAX_V1))) { /* Construct MCDI v2 header */ hdr_len = sizeof (hdr); EFX_POPULATE_DWORD_8(hdr[0], From owner-svn-src-head@freebsd.org Fri Nov 23 15:59:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE0BA114A7B8; Fri, 23 Nov 2018 15:59:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D55C8FF58; Fri, 23 Nov 2018 15:59:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84C1120BBB; Fri, 23 Nov 2018 15:59:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANFxnW3010142; Fri, 23 Nov 2018 15:59:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANFxn66010141; Fri, 23 Nov 2018 15:59:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231559.wANFxn66010141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 15:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340837 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D55C8FF58 X-Spamd-Result: default: False [0.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.31)[-0.309,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 15:59:52 -0000 Author: arybchik Date: Fri Nov 23 15:59:49 2018 New Revision: 340837 URL: https://svnweb.freebsd.org/changeset/base/340837 Log: sfxge(4): ignore error in completion event on MCDIv2 HW With MCDIv2, the reponse length can be to big to fit into the CMDDONE_DATALEN field in the MCDI completion event. But rather that the length being truncated, it can overflow into the CMDDONE_ERRNO field (this is a longstanding firmware bug). Hence the CMDDONE_ERRNO field may not be valid. It isn't necessary to use the value in the CMDDONE_ERRNO field though, so it can be ignored. The actual error code is already read from the response header on MCDIv2 capable hardware and stored in emr_rc, so that can be used instead. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18104 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 15:59:37 2018 (r340836) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Nov 23 15:59:49 2018 (r340837) @@ -798,9 +798,8 @@ efx_mcdi_ev_cpl( emrp->emr_rc = 0; } } - if (errcode == 0) { + if (emrp->emr_rc == 0) efx_mcdi_finish_response(enp, emrp); - } emtp->emt_ev_cpl(emtp->emt_context); } From owner-svn-src-head@freebsd.org Fri Nov 23 16:18:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65288114B340; Fri, 23 Nov 2018 16:18:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 052256AB49; Fri, 23 Nov 2018 16:18:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D811320FCF; Fri, 23 Nov 2018 16:18:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANGIalj020382; Fri, 23 Nov 2018 16:18:36 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANGIaMB020381; Fri, 23 Nov 2018 16:18:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811231618.wANGIaMB020381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 16:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340838 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 052256AB49 X-Spamd-Result: default: False [1.02 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.14)[-0.137,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 16:18:37 -0000 Author: arybchik Date: Fri Nov 23 16:18:36 2018 New Revision: 340838 URL: https://svnweb.freebsd.org/changeset/base/340838 Log: sfxge(4): request info about outer frame in Rx events For encapsulated packets, the firmware gives info about the inner frame fields by default. When not using encapsulation offload, ask for info about the outer frame instead. On SFN8xxx with firmware version before v6.4.2.1007 driver reload is needed after switching from full-feature to low-latency firmware variant since the driver still thinks that firmware supports encapsulation, but firmware does not tolerate request to provide info about outer frame in Rx events. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18105 Modified: head/sys/dev/sfxge/common/ef10_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 15:59:49 2018 (r340837) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 16:18:36 2018 (r340838) @@ -49,6 +49,7 @@ efx_mcdi_init_rxq( __in boolean_t disable_scatter, __in uint32_t ps_bufsize) { + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_INIT_RXQ_EXT_IN_LEN, MC_CMD_INIT_RXQ_EXT_OUT_LEN)]; @@ -58,6 +59,7 @@ efx_mcdi_init_rxq( uint64_t addr; efx_rc_t rc; uint32_t dma_mode; + boolean_t want_outer_classes; /* If this changes, then the payload size might need to change. */ EFSYS_ASSERT3U(MC_CMD_INIT_RXQ_OUT_LEN, ==, 0); @@ -68,6 +70,25 @@ efx_mcdi_init_rxq( else dma_mode = MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET; + if (encp->enc_tunnel_encapsulations_supported != 0) { + /* + * WANT_OUTER_CLASSES can only be specified on hardware which + * supports tunnel encapsulation offloads, even though it is + * effectively the behaviour the hardware gives. + * + * Also, on hardware which does support such offloads, older + * firmware rejects the flag if the offloads are not supported + * by the current firmware variant, which means this may fail if + * the capabilities are not updated when the firmware variant + * changes. This is not an issue on newer firmware, as it was + * changed in bug 69842 (v6.4.2.1007) to permit this flag to be + * specified on all firmware variants. + */ + want_outer_classes = B_TRUE; + } else { + want_outer_classes = B_FALSE; + } + (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_RXQ; req.emr_in_buf = payload; @@ -79,7 +100,7 @@ efx_mcdi_init_rxq( MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_TARGET_EVQ, target_evq); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_INSTANCE, instance); - MCDI_IN_POPULATE_DWORD_8(req, INIT_RXQ_EXT_IN_FLAGS, + MCDI_IN_POPULATE_DWORD_9(req, INIT_RXQ_EXT_IN_FLAGS, INIT_RXQ_EXT_IN_FLAG_BUFF_MODE, 0, INIT_RXQ_EXT_IN_FLAG_HDR_SPLIT, 0, INIT_RXQ_EXT_IN_FLAG_TIMESTAMP, 0, @@ -88,7 +109,8 @@ efx_mcdi_init_rxq( INIT_RXQ_EXT_IN_FLAG_DISABLE_SCATTER, disable_scatter, INIT_RXQ_EXT_IN_DMA_MODE, dma_mode, - INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE, ps_bufsize); + INIT_RXQ_EXT_IN_PACKED_STREAM_BUFF_SIZE, ps_bufsize, + INIT_RXQ_EXT_IN_FLAG_WANT_OUTER_CLASSES, want_outer_classes); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_OWNER_ID, 0); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); From owner-svn-src-head@freebsd.org Fri Nov 23 16:33:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1201114B99E; Fri, 23 Nov 2018 16:33:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A7116B5E0; Fri, 23 Nov 2018 16:33:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BA2021321; Fri, 23 Nov 2018 16:33:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANGX33F030691; Fri, 23 Nov 2018 16:33:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANGX3NM030690; Fri, 23 Nov 2018 16:33:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811231633.wANGX3NM030690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 23 Nov 2018 16:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340840 - head/lib/csu/mips X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/mips X-SVN-Commit-Revision: 340840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A7116B5E0 X-Spamd-Result: default: False [0.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_HAM_SHORT(-0.13)[-0.133,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 16:33:04 -0000 Author: andrew Date: Fri Nov 23 16:33:03 2018 New Revision: 340840 URL: https://svnweb.freebsd.org/changeset/base/340840 Log: Mark the function called by the MIPS .init/.fini sequence with .local. As with r328939 we need to mark local symbols as such. Without this the assembly parser treats the symbols as global and created relocations against these private symbols. MFC with: r339738 Sponsored by: DARPA, AFRL Modified: head/lib/csu/mips/crt.h Modified: head/lib/csu/mips/crt.h ============================================================================== --- head/lib/csu/mips/crt.h Fri Nov 23 16:32:27 2018 (r340839) +++ head/lib/csu/mips/crt.h Fri Nov 23 16:33:03 2018 (r340840) @@ -36,6 +36,7 @@ "1: \n" \ ".cpload $ra \n" \ ".set reorder \n" \ + ".local " __STRING(func) "\n" \ "jal " __STRING(func) #else #define INIT_CALL_SEQ(func) \ @@ -45,6 +46,7 @@ "1: \n" \ ".set reorder \n" \ ".cpsetup $ra, $v0, 1b \n" \ + ".local " __STRING(func) "\n" \ "jal " __STRING(func) #endif From owner-svn-src-head@freebsd.org Fri Nov 23 16:45:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2509E114BE38; Fri, 23 Nov 2018 16:45:09 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB4656BCBE; Fri, 23 Nov 2018 16:45:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97631214C7; Fri, 23 Nov 2018 16:45:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANGj840035697; Fri, 23 Nov 2018 16:45:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANGj8BW035694; Fri, 23 Nov 2018 16:45:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811231645.wANGj8BW035694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 23 Nov 2018 16:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340841 - in head: . share/mk sys/sys X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head: . share/mk sys/sys X-SVN-Commit-Revision: 340841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB4656BCBE X-Spamd-Result: default: False [0.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.72)[0.721,0]; NEURAL_HAM_SHORT(-0.13)[-0.133,0]; NEURAL_SPAM_LONG(0.40)[0.400,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 16:45:09 -0000 Author: andrew Date: Fri Nov 23 16:45:07 2018 New Revision: 340841 URL: https://svnweb.freebsd.org/changeset/base/340841 Log: Enable the BSD crtbegin/crtend by default. It has passed an exp run on amd64 and i386, and has testing on arm64. On other architectures it is expected to run, however it can be disabled by building world with -DWITHOUT_BSD_CRTBEGIN. Sponsored by: DARPA, AFRL Modified: head/UPDATING head/share/mk/src.opts.mk head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Nov 23 16:33:03 2018 (r340840) +++ head/UPDATING Fri Nov 23 16:45:07 2018 (r340841) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20181123: + The BSD crtbegin and crtend code has been enabled by default. It has + had extensive testing on amd64, arm64, and i386. It can be disabled + by building a world with -DWITHOUT_BSD_CRTBEGIN. + 20181115: The set of CTM commands (ctm, ctm_smail, ctm_rmail, ctm_dequeue) has been converted to a port (misc/ctm) and will be removed from Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Nov 23 16:33:03 2018 (r340840) +++ head/share/mk/src.opts.mk Fri Nov 23 16:45:07 2018 (r340841) @@ -71,6 +71,7 @@ __DEFAULT_YES_OPTIONS = \ BOOTPARAMD \ BOOTPD \ BSD_CPIO \ + BSD_CRTBEGIN \ BSDINSTALL \ BSNMP \ BZIP2 \ @@ -193,7 +194,6 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ - BSD_CRTBEGIN \ BSD_GREP \ CLANG_EXTRAS \ DTRACE_TESTS \ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Nov 23 16:33:03 2018 (r340840) +++ head/sys/sys/param.h Fri Nov 23 16:45:07 2018 (r340841) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300003 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300004 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Nov 23 18:15:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16E20114E0BA; Fri, 23 Nov 2018 18:15:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACC6D6F1DC; Fri, 23 Nov 2018 18:15:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AAC122352; Fri, 23 Nov 2018 18:15:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANIFNDd082282; Fri, 23 Nov 2018 18:15:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANIFN1q082281; Fri, 23 Nov 2018 18:15:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811231815.wANIFN1q082281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 18:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340842 - head/libexec/rtld-elf/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf/amd64 X-SVN-Commit-Revision: 340842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ACC6D6F1DC X-Spamd-Result: default: False [1.25 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.14)[0.139,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 18:15:24 -0000 Author: kib Date: Fri Nov 23 18:15:23 2018 New Revision: 340842 URL: https://svnweb.freebsd.org/changeset/base/340842 Log: Silence gcc warnings. Reported by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/libexec/rtld-elf/amd64/reloc.c Modified: head/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- head/libexec/rtld-elf/amd64/reloc.c Fri Nov 23 16:45:07 2018 (r340841) +++ head/libexec/rtld-elf/amd64/reloc.c Fri Nov 23 18:15:23 2018 (r340842) @@ -138,6 +138,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int int r; r = -1; + symval = 0; + def = NULL; + /* * The dynamic loader may be called from a thread, we have * limited amounts of stack available so we cannot use alloca(). From owner-svn-src-head@freebsd.org Fri Nov 23 18:23:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0629114E4FB; Fri, 23 Nov 2018 18:23:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94C4E6F7C4; Fri, 23 Nov 2018 18:23:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74994224F2; Fri, 23 Nov 2018 18:23:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANINTSo087469; Fri, 23 Nov 2018 18:23:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANINTGa087468; Fri, 23 Nov 2018 18:23:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201811231823.wANINTGa087468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 23 Nov 2018 18:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340843 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 340843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94C4E6F7C4 X-Spamd-Result: default: False [1.37 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.26)[0.257,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 18:23:30 -0000 Author: cem Date: Fri Nov 23 18:23:29 2018 New Revision: 340843 URL: https://svnweb.freebsd.org/changeset/base/340843 Log: rtld: Silence a false positive GCC 6.4.0 warning The function reloc_non_plt has complicated variable lifetimes that GCC 6.4.0 (the version currently used by amd64-xtoolchain-gcc) misunderstands and produces an erroneous warning about. Silence it to allow the -Werror build to proceed. Reviewed by: emaste Modified: head/libexec/rtld-elf/Makefile Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Fri Nov 23 18:15:23 2018 (r340842) +++ head/libexec/rtld-elf/Makefile Fri Nov 23 18:23:29 2018 (r340843) @@ -102,6 +102,10 @@ ${PROG_FULL}: ${VERSION_MAP} # GCC warns about redeclarations even though they have __exported # and are therefore not identical to the ones from the system headers. CFLAGS+= -Wno-redundant-decls +# GCC (6.4.0) doesn't grok the complicated lifetimes in reloc_non_plt(): +.if ${MACHINE_CPUARCH} == "amd64" +CFLAGS.reloc.c+=-Wno-maybe-uninitialized +.endif .if ${COMPILER_VERSION} < 40300 # Silence -Wshadow false positives in ancient GCC CFLAGS+= -Wno-shadow From owner-svn-src-head@freebsd.org Fri Nov 23 18:27:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1619114E5BB; Fri, 23 Nov 2018 18:27:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9713C6F973; Fri, 23 Nov 2018 18:27:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74A60224F3; Fri, 23 Nov 2018 18:27:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANIRGTe087656; Fri, 23 Nov 2018 18:27:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANIRGkQ087655; Fri, 23 Nov 2018 18:27:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201811231827.wANIRGkQ087655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 23 Nov 2018 18:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340844 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 340844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9713C6F973 X-Spamd-Result: default: False [1.37 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.257,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 18:27:17 -0000 Author: cem Date: Fri Nov 23 18:27:16 2018 New Revision: 340844 URL: https://svnweb.freebsd.org/changeset/base/340844 Log: Revert r340843 - addressed independently in r340842! Modified: head/libexec/rtld-elf/Makefile Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Fri Nov 23 18:23:29 2018 (r340843) +++ head/libexec/rtld-elf/Makefile Fri Nov 23 18:27:16 2018 (r340844) @@ -102,10 +102,6 @@ ${PROG_FULL}: ${VERSION_MAP} # GCC warns about redeclarations even though they have __exported # and are therefore not identical to the ones from the system headers. CFLAGS+= -Wno-redundant-decls -# GCC (6.4.0) doesn't grok the complicated lifetimes in reloc_non_plt(): -.if ${MACHINE_CPUARCH} == "amd64" -CFLAGS.reloc.c+=-Wno-maybe-uninitialized -.endif .if ${COMPILER_VERSION} < 40300 # Silence -Wshadow false positives in ancient GCC CFLAGS+= -Wno-shadow From owner-svn-src-head@freebsd.org Fri Nov 23 19:43:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C12C114FCD7; Fri, 23 Nov 2018 19:43:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D27B171FDB; Fri, 23 Nov 2018 19:43:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEF1A23269; Fri, 23 Nov 2018 19:43:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANJhJRm028117; Fri, 23 Nov 2018 19:43:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANJhIA6028111; Fri, 23 Nov 2018 19:43:18 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811231943.wANJhIA6028111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 23 Nov 2018 19:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340845 - in head/sys: conf dev/extres/phy X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: conf dev/extres/phy X-SVN-Commit-Revision: 340845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D27B171FDB X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.439,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.37)[0.368,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 19:43:20 -0000 Author: manu Date: Fri Nov 23 19:43:18 2018 New Revision: 340845 URL: https://svnweb.freebsd.org/changeset/base/340845 Log: Derive PHY class to new one specialized for USB PHY functions. Submitted by: mmel Added: head/sys/dev/extres/phy/phy_internal.h (contents, props changed) head/sys/dev/extres/phy/phy_usb.c (contents, props changed) head/sys/dev/extres/phy/phy_usb.h (contents, props changed) head/sys/dev/extres/phy/phynode_usb_if.m (contents, props changed) Modified: head/sys/conf/files head/sys/dev/extres/phy/phy.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 23 18:27:16 2018 (r340844) +++ head/sys/conf/files Fri Nov 23 19:43:18 2018 (r340845) @@ -1734,6 +1734,8 @@ dev/extres/clk/clk_mux.c optional ext_resources clk fd dev/extres/phy/phy.c optional ext_resources phy fdt dev/extres/phy/phydev_if.m optional ext_resources phy fdt dev/extres/phy/phynode_if.m optional ext_resources phy fdt +dev/extres/phy/phy_usb.c optional ext_resources phy fdt +dev/extres/phy/phynode_usb_if.m optional ext_resources phy fdt dev/extres/hwreset/hwreset.c optional ext_resources hwreset fdt dev/extres/hwreset/hwreset_if.m optional ext_resources hwreset fdt dev/extres/nvmem/nvmem.c optional ext_resources nvmem fdt Modified: head/sys/dev/extres/phy/phy.c ============================================================================== --- head/sys/dev/extres/phy/phy.c Fri Nov 23 18:27:16 2018 (r340844) +++ head/sys/dev/extres/phy/phy.c Fri Nov 23 19:43:18 2018 (r340845) @@ -43,18 +43,12 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #include "phydev_if.h" MALLOC_DEFINE(M_PHY, "phy", "Phy framework"); -/* Forward declarations. */ -struct phy; -struct phynode; - -typedef TAILQ_HEAD(phynode_list, phynode) phynode_list_t; -typedef TAILQ_HEAD(phy_list, phy) phy_list_t; - /* Default phy methods. */ static int phynode_method_init(struct phynode *phynode); static int phynode_method_enable(struct phynode *phynode, bool disable); @@ -73,52 +67,9 @@ static phynode_method_t phynode_methods[] = { }; DEFINE_CLASS_0(phynode, phynode_class, phynode_methods, 0); -/* - * Phy node - */ -struct phynode { - KOBJ_FIELDS; - - TAILQ_ENTRY(phynode) phylist_link; /* Global list entry */ - phy_list_t consumers_list; /* Consumers list */ - - - /* Details of this device. */ - const char *name; /* Globally unique name */ - - device_t pdev; /* Producer device_t */ - void *softc; /* Producer softc */ - intptr_t id; /* Per producer unique id */ -#ifdef FDT - phandle_t ofw_node; /* OFW node of phy */ -#endif - struct sx lock; /* Lock for this phy */ - int ref_cnt; /* Reference counter */ - int enable_cnt; /* Enabled counter */ -}; - -struct phy { - device_t cdev; /* consumer device*/ - struct phynode *phynode; - TAILQ_ENTRY(phy) link; /* Consumers list entry */ - - int enable_cnt; -}; - static phynode_list_t phynode_list = TAILQ_HEAD_INITIALIZER(phynode_list); -static struct sx phynode_topo_lock; SX_SYSINIT(phy_topology, &phynode_topo_lock, "Phy topology lock"); - -#define PHY_TOPO_SLOCK() sx_slock(&phynode_topo_lock) -#define PHY_TOPO_XLOCK() sx_xlock(&phynode_topo_lock) -#define PHY_TOPO_UNLOCK() sx_unlock(&phynode_topo_lock) -#define PHY_TOPO_ASSERT() sx_assert(&phynode_topo_lock, SA_LOCKED) -#define PHY_TOPO_XASSERT() sx_assert(&phynode_topo_lock, SA_XLOCKED) - -#define PHYNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) -#define PHYNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) -#define PHYNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) /* ---------------------------------------------------------------------------- * Added: head/sys/dev/extres/phy/phy_internal.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phy_internal.h Fri Nov 23 19:43:18 2018 (r340845) @@ -0,0 +1,83 @@ +/*- + * Copyright 2018 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef DEV_EXTRES_PHY_INTERNAL_H +#define DEV_EXTRES_PHY_INTERNAL_H + +/* Forward declarations. */ +struct phy; +struct phynode; + +typedef TAILQ_HEAD(phynode_list, phynode) phynode_list_t; +typedef TAILQ_HEAD(phy_list, phy) phy_list_t; + +/* + * Phy node + */ +struct phynode { + KOBJ_FIELDS; + + TAILQ_ENTRY(phynode) phylist_link; /* Global list entry */ + phy_list_t consumers_list; /* Consumers list */ + + + /* Details of this device. */ + const char *name; /* Globally unique name */ + + device_t pdev; /* Producer device_t */ + void *softc; /* Producer softc */ + intptr_t id; /* Per producer unique id */ +#ifdef FDT + phandle_t ofw_node; /* OFW node of phy */ +#endif + struct sx lock; /* Lock for this phy */ + int ref_cnt; /* Reference counter */ + int enable_cnt; /* Enabled counter */ +}; + +struct phy { + device_t cdev; /* consumer device*/ + struct phynode *phynode; + TAILQ_ENTRY(phy) link; /* Consumers list entry */ + + int enable_cnt; +}; + + +#define PHY_TOPO_SLOCK() sx_slock(&phynode_topo_lock) +#define PHY_TOPO_XLOCK() sx_xlock(&phynode_topo_lock) +#define PHY_TOPO_UNLOCK() sx_unlock(&phynode_topo_lock) +#define PHY_TOPO_ASSERT() sx_assert(&phynode_topo_lock, SA_LOCKED) +#define PHY_TOPO_XASSERT() sx_assert(&phynode_topo_lock, SA_XLOCKED) + +#define PHYNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) +#define PHYNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) +#define PHYNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) + +struct sx phynode_topo_lock; + +#endif /* DEV_EXTRES_PHY_INTERNAL_H */ Added: head/sys/dev/extres/phy/phy_usb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phy_usb.c Fri Nov 23 19:43:18 2018 (r340845) @@ -0,0 +1,149 @@ +/*- + * Copyright 2018 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + + +#include +#include + +#include "phydev_if.h" + +/* + * USB phy controller methods. + */ +static phynode_usb_method_t phynode_usb_methods[] = { + + PHYNODEUSBMETHOD_END +}; +DEFINE_CLASS_1(phynode_usb, phynode_usb_class, phynode_usb_methods, + 0, phynode_class); + +/* + * Create and initialize phy object, but do not register it. + */ +struct phynode * +phynode_usb_create(device_t pdev, phynode_class_t phynode_class, + struct phynode_usb_init_def *def) + +{ + struct phynode *phynode; + struct phynode_usb_sc *sc; + + phynode = phynode_create(pdev, phynode_class, &def->phynode_init_def); + if (phynode == NULL) + return (NULL); + sc = phynode_get_softc(phynode); + sc->std_param = def->std_param; + return (phynode); +} + +struct phynode +*phynode_usb_register(struct phynode *phynode) +{ + + return (phynode_register(phynode)); +} + +/* -------------------------------------------------------------------------- + * + * Real consumers executive + * + */ + +/* + * Set USB phy mode. (PHY_USB_MODE_*) + */ +int +phynode_usb_set_mode(struct phynode *phynode, int usb_mode) +{ + int rv; + + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + rv = PHYNODE_USB_SET_MODE(phynode, usb_mode); + PHYNODE_UNLOCK(phynode); + return (rv); +} + +/* + * Get USB phy mode. (PHY_USB_MODE_*) + */ +int +phynode_usb_get_mode(struct phynode *phynode, int *usb_mode) +{ + int rv; + + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + rv = PHYNODE_USB_GET_MODE(phynode, usb_mode); + PHYNODE_UNLOCK(phynode); + return (rv); +} + + /* -------------------------------------------------------------------------- + * + * USB phy consumers interface. + * + */ +int phy_usb_set_mode(phy_t phy, int usb_mode) +{ + int rv; + struct phynode *phynode; + + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_usb_set_mode(phynode, usb_mode); + PHY_TOPO_UNLOCK(); + return (rv); +} + +int phy_usb_get_mode(phy_t phy, int *usb_mode) +{ + int rv; + struct phynode *phynode; + + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_usb_get_mode(phynode, usb_mode); + PHY_TOPO_UNLOCK(); + return (rv); +} Added: head/sys/dev/extres/phy/phy_usb.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phy_usb.h Fri Nov 23 19:43:18 2018 (r340845) @@ -0,0 +1,85 @@ +/*- + * Copyright 2018 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_EXTRES_PHY_USB_H_ +#define _DEV_EXTRES_PHY_USB_H_ + +#include +#include "phynode_usb_if.h" + +#define PHY_USB_MODE_UNKNOWN 0 +#define PHY_USB_MODE_HOST 1 +#define PHY_USB_MODE_OTG 2 +#define PHY_USB_MODE_DEVICE 3 + +/* Standard USB phy parameters. */ +struct phynode_usb_std_param { + int usb_mode; +}; + +struct phynode_usb_sc { + struct phynode_usb_std_param std_param; +}; + +/* Initialization parameters. */ +struct phynode_usb_init_def { + struct phynode_init_def phynode_init_def; + struct phynode_usb_std_param std_param; /* Standard parameters */ +}; + + +/* + * Shorthands for constructing method tables. + */ +#define PHYNODEUSBMETHOD KOBJMETHOD +#define PHYNODEUSBMETHOD_END KOBJMETHOD_END +#define phynode_usb_method_t kobj_method_t +#define phynode_usb_class_t kobj_class_t +DECLARE_CLASS(phynode_usb_class); + +struct phynode *phynode_usb_create(device_t pdev, phynode_class_t phynode_class, + struct phynode_usb_init_def *def); +struct phynode *phynode_usb_register(struct phynode *phynode); + +#if 0 +/* XXX to be implemented */ +#ifdef FDT +int phynode_usb_parse_ofw_stdparam(device_t dev, phandle_t node, + struct phynode_usb_init_def *def); +#endif +#endif + +/* Phynode functions. */ +int phynode_usb_set_mode(struct phynode *phynode, int usb_mode); +int phynode_usb_get_mode(struct phynode *phynode, int *usb_mode); + +/* Consumer functions. */ +int phy_usb_set_mode(phy_t phy, int usb_mode); +int phy_usb_get_mode(phy_t phy, int *usb_mode); + +#endif /*_DEV_EXTRES_PHY_USB_H_*/ Added: head/sys/dev/extres/phy/phynode_usb_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phynode_usb_if.m Fri Nov 23 19:43:18 2018 (r340845) @@ -0,0 +1,51 @@ +#- +# Copyright 2018 Michal Meloun +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +INTERFACE phynode_usb; + +HEADER { + struct phynode; +} + +# +# Set USB mode for phy +# Returns 0 on success or a standard errno value. +# +METHOD int set_mode { + struct phynode *phynode; + int usb_mode; /* PHY_USB_MODE_* */ +}; + +# +# Get USB mode +# Returns 0 on success or a standard errno value. +# +METHOD int get_mode { + struct phynode *phynode; + int *usb_mode; /* PHY_USB_MODE_* */ +}; From owner-svn-src-head@freebsd.org Fri Nov 23 19:44:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22701114FD77; Fri, 23 Nov 2018 19:44:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD0CA72213; Fri, 23 Nov 2018 19:44:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DEAA2326C; Fri, 23 Nov 2018 19:44:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANJiQnm028471; Fri, 23 Nov 2018 19:44:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANJiQJW028470; Fri, 23 Nov 2018 19:44:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811231944.wANJiQJW028470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 23 Nov 2018 19:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340846 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 340846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BD0CA72213 X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.37)[0.368,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; NEURAL_SPAM_LONG(0.42)[0.420,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 19:44:27 -0000 Author: manu Date: Fri Nov 23 19:44:26 2018 New Revision: 340846 URL: https://svnweb.freebsd.org/changeset/base/340846 Log: aw_usbphy: Convert to usbphy subclass Instead of routing the phy when enabling it, do the configuration and routing in the phynode_usb_set_mode function. While here, if we don't have a vbus detection method, enable the phy if requested. MFC after: 1 month Modified: head/sys/arm/allwinner/aw_usbphy.c Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Fri Nov 23 19:43:18 2018 (r340845) +++ head/sys/arm/allwinner/aw_usbphy.c Fri Nov 23 19:44:26 2018 (r340846) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include "phynode_if.h" @@ -139,17 +139,22 @@ struct awusbphy_softc { gpio_pin_t vbus_det_pin; int vbus_det_valid; struct aw_usbphy_conf *phy_conf; + int mode; }; /* Phy class and methods. */ static int awusbphy_phy_enable(struct phynode *phy, bool enable); -static phynode_method_t awusbphy_phynode_methods[] = { +static int awusbphy_get_mode(struct phynode *phy, int *mode); +static int awusbphy_set_mode(struct phynode *phy, int mode); +static phynode_usb_method_t awusbphy_phynode_methods[] = { PHYNODEMETHOD(phynode_enable, awusbphy_phy_enable), + PHYNODEMETHOD(phynode_usb_get_mode, awusbphy_get_mode), + PHYNODEMETHOD(phynode_usb_set_mode, awusbphy_set_mode), PHYNODEMETHOD_END }; DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_class, awusbphy_phynode_methods, - 0, phynode_class); + sizeof(struct phynode_usb_sc), phynode_usb_class); #define RD4(res, o) bus_read_4(res, (o)) #define WR4(res, o, v) bus_write_4(res, (o), (v)) @@ -165,6 +170,18 @@ DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_clas #define PMU_ULPI_BYPASS (1 << 0) #define PMU_UNK_H3 0x10 #define PMU_UNK_H3_CLR 0x2 +#define PHY_CSR 0x00 +#define ID_PULLUP_EN (1 << 17) +#define DPDM_PULLUP_EN (1 << 16) +#define FORCE_ID (0x3 << 14) +#define FORCE_ID_SHIFT 14 +#define FORCE_ID_LOW 2 +#define FORCE_VBUS_VALID (0x3 << 12) +#define FORCE_VBUS_VALID_SHIFT 12 +#define FORCE_VBUS_VALID_HIGH 3 +#define VBUS_CHANGE_DET (1 << 6) +#define ID_CHANGE_DET (1 << 5) +#define DPDM_CHANGE_DET (1 << 4) static void awusbphy_configure(device_t dev, int phyno) @@ -287,7 +304,7 @@ awusbphy_vbus_detect(device_t dev, int *val) return (0); } - *val = 1; + *val = 0; return (0); } @@ -315,30 +332,22 @@ awusbphy_phy_enable(struct phynode *phynode, bool enab if (reg == NULL) return (0); - if (enable) { + if (phy == 0) { /* If an external vbus is detected, do not enable phy 0 */ - if (phy == 0) { - error = awusbphy_vbus_detect(dev, &vbus_det); - if (error) - goto out; + error = awusbphy_vbus_detect(dev, &vbus_det); + if (error) + goto out; - /* Depending on the PHY we need to route OTG to OHCI/EHCI */ - if (sc->phy_conf->phy0_route == true) { - if (vbus_det == 0) - /* Host mode */ - CLR4(sc->phy_ctrl, OTG_PHY_CFG, - OTG_PHY_ROUTE_OTG); - else - /* Peripheral mode */ - SET4(sc->phy_ctrl, OTG_PHY_CFG, - OTG_PHY_ROUTE_OTG); - } - if (vbus_det == 1) - return (0); - } else - error = 0; - if (error == 0) - error = regulator_enable(reg); + if (vbus_det == 1) { + if (bootverbose) + device_printf(dev, "External VBUS detected, not enabling the regulator\n"); + + return (0); + } + } + if (enable) { + /* Depending on the PHY we need to route OTG to OHCI/EHCI */ + error = regulator_enable(reg); } else error = regulator_disable(reg); @@ -350,6 +359,70 @@ out: return (error); } + return (0); +} + +static int +awusbphy_get_mode(struct phynode *phynode, int *mode) +{ + struct awusbphy_softc *sc; + device_t dev; + + dev = phynode_get_device(phynode); + sc = device_get_softc(dev); + + *mode = sc->mode; + + return (0); +} + +static int +awusbphy_set_mode(struct phynode *phynode, int mode) +{ + device_t dev; + intptr_t phy; + struct awusbphy_softc *sc; + uint32_t val; + int error, vbus_det; + + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + + if (phy != 0) + return (EINVAL); + + switch (mode) { + case PHY_USB_MODE_HOST: + val = bus_read_4(sc->phy_ctrl, PHY_CSR); + val &= ~(VBUS_CHANGE_DET | ID_CHANGE_DET | DPDM_CHANGE_DET); + val |= (ID_PULLUP_EN | DPDM_PULLUP_EN); + val &= ~FORCE_ID; + val |= (FORCE_ID_LOW << FORCE_ID_SHIFT); + val &= ~FORCE_VBUS_VALID; + val |= (FORCE_VBUS_VALID_HIGH << FORCE_VBUS_VALID_SHIFT); + bus_write_4(sc->phy_ctrl, PHY_CSR, val); + if (sc->phy_conf->phy0_route == true) { + error = awusbphy_vbus_detect(dev, &vbus_det); + if (error) + goto out; + if (vbus_det == 0) + CLR4(sc->phy_ctrl, OTG_PHY_CFG, + OTG_PHY_ROUTE_OTG); + else + SET4(sc->phy_ctrl, OTG_PHY_CFG, + OTG_PHY_ROUTE_OTG); + } + break; + case PHY_USB_MODE_OTG: + /* TODO */ + break; + } + + sc->mode = mode; + + +out: return (0); } From owner-svn-src-head@freebsd.org Fri Nov 23 19:45:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBBF8114FDED; Fri, 23 Nov 2018 19:45:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C9B272343; Fri, 23 Nov 2018 19:45:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D9932326E; Fri, 23 Nov 2018 19:45:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANJjCPR028559; Fri, 23 Nov 2018 19:45:12 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANJjCnh028558; Fri, 23 Nov 2018 19:45:12 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811231945.wANJjCnh028558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 23 Nov 2018 19:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340847 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 340847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C9B272343 X-Spamd-Result: default: False [1.48 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_SHORT(0.37)[0.368,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 19:45:13 -0000 Author: manu Date: Fri Nov 23 19:45:11 2018 New Revision: 340847 URL: https://svnweb.freebsd.org/changeset/base/340847 Log: a10_ehci: Always set the phy to host mode MFC after: 1 month Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Fri Nov 23 19:44:26 2018 (r340846) +++ head/sys/arm/allwinner/a10_ehci.c Fri Nov 23 19:45:11 2018 (r340847) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #define EHCI_HC_DEVSTR "Allwinner Integrated USB 2.0 controller" @@ -242,6 +242,11 @@ a10_ehci_attach(device_t self) /* Enable USB PHY */ if (phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy) == 0) { + err = phy_usb_set_mode(aw_sc->phy, PHY_USB_MODE_HOST); + if (err != 0) { + device_printf(self, "Could not set phy to host mode\n"); + goto error; + } err = phy_enable(aw_sc->phy); if (err != 0) { device_printf(self, "Could not enable phy\n"); From owner-svn-src-head@freebsd.org Fri Nov 23 19:45:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B239A110200F; Fri, 23 Nov 2018 19:45:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45A22725A7; Fri, 23 Nov 2018 19:45:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 267BF2326F; Fri, 23 Nov 2018 19:45:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANJjwoO028634; Fri, 23 Nov 2018 19:45:58 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANJjwKE028633; Fri, 23 Nov 2018 19:45:58 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201811231945.wANJjwKE028633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 23 Nov 2018 19:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340848 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 340848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45A22725A7 X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.439,0]; NEURAL_SPAM_SHORT(0.37)[0.368,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 19:45:58 -0000 Author: manu Date: Fri Nov 23 19:45:57 2018 New Revision: 340848 URL: https://svnweb.freebsd.org/changeset/base/340848 Log: axp8xx: Rework the enable part and add the GPIOXLDO regulators MFC after: 1 month Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Fri Nov 23 19:45:11 2018 (r340847) +++ head/sys/arm/allwinner/axp81x.c Fri Nov 23 19:45:57 2018 (r340848) @@ -126,12 +126,16 @@ MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8x #define AXP_IRQSTAT5 0x4c #define AXP_IRQSTAT5_POKSIRQ (1 << 4) #define AXP_GPIO0_CTRL 0x90 +#define AXP_GPIO0LDO_CTRL 0x91 #define AXP_GPIO1_CTRL 0x92 +#define AXP_GPIO1LDO_CTRL 0x93 #define AXP_GPIO_FUNC (0x7 << 0) #define AXP_GPIO_FUNC_SHIFT 0 #define AXP_GPIO_FUNC_DRVLO 0 #define AXP_GPIO_FUNC_DRVHI 1 #define AXP_GPIO_FUNC_INPUT 2 +#define AXP_GPIO_FUNC_LDO_ON 3 +#define AXP_GPIO_FUNC_LDO_OFF 4 #define AXP_GPIO_SIGBIT 0x94 #define AXP_GPIO_PD 0x97 @@ -166,6 +170,8 @@ struct axp8xx_regdef { char *supply_name; uint8_t enable_reg; uint8_t enable_mask; + uint8_t enable_value; + uint8_t disable_value; uint8_t voltage_reg; int voltage_min; int voltage_max; @@ -197,6 +203,8 @@ enum axp8xx_reg_id { AXP8XX_REG_ID_FLDO1, AXP8XX_REG_ID_FLDO2, AXP813_REG_ID_FLDO3, + AXP8XX_REG_ID_GPIO0_LDO, + AXP8XX_REG_ID_GPIO1_LDO, }; static struct axp8xx_regdef axp803_regdefs[] = { @@ -204,7 +212,8 @@ static struct axp8xx_regdef axp803_regdefs[] = { .id = AXP803_REG_ID_DC1SW, .name = "dc1sw", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DC1SW, + .enable_mask = (uint8_t) AXP_POWERCTL2_DC1SW, + .enable_value = AXP_POWERCTL2_DC1SW, }, }; @@ -213,7 +222,8 @@ static struct axp8xx_regdef axp813_regdefs[] = { .id = AXP813_REG_ID_DCDC7, .name = "dcdc7", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC7, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC7, + .enable_value = AXP_POWERCTL1_DCDC7, .voltage_reg = AXP_VOLTCTL_DCDC7, .voltage_min = 600, .voltage_max = 1520, @@ -229,7 +239,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC1, .name = "dcdc1", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC1, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC1, + .enable_value = AXP_POWERCTL1_DCDC1, .voltage_reg = AXP_VOLTCTL_DCDC1, .voltage_min = 1600, .voltage_max = 3400, @@ -240,7 +251,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC2, .name = "dcdc2", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC2, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC2, + .enable_value = AXP_POWERCTL1_DCDC2, .voltage_reg = AXP_VOLTCTL_DCDC2, .voltage_min = 500, .voltage_max = 1300, @@ -253,7 +265,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC3, .name = "dcdc3", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC3, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC3, + .enable_value = AXP_POWERCTL1_DCDC3, .voltage_reg = AXP_VOLTCTL_DCDC3, .voltage_min = 500, .voltage_max = 1300, @@ -266,7 +279,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC4, .name = "dcdc4", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC4, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC4, + .enable_value = AXP_POWERCTL1_DCDC4, .voltage_reg = AXP_VOLTCTL_DCDC4, .voltage_min = 500, .voltage_max = 1300, @@ -279,7 +293,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC5, .name = "dcdc5", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC5, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC5, + .enable_value = AXP_POWERCTL1_DCDC5, .voltage_reg = AXP_VOLTCTL_DCDC5, .voltage_min = 800, .voltage_max = 1840, @@ -292,7 +307,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC6, .name = "dcdc6", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC6, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC6, + .enable_value = AXP_POWERCTL1_DCDC6, .voltage_reg = AXP_VOLTCTL_DCDC6, .voltage_min = 600, .voltage_max = 1520, @@ -305,7 +321,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO1, .name = "dldo1", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO1, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO1, + .enable_value = AXP_POWERCTL2_DLDO1, .voltage_reg = AXP_VOLTCTL_DLDO1, .voltage_min = 700, .voltage_max = 3300, @@ -316,7 +333,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO2, .name = "dldo2", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO2, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO2, + .enable_value = AXP_POWERCTL2_DLDO2, .voltage_reg = AXP_VOLTCTL_DLDO2, .voltage_min = 700, .voltage_max = 4200, @@ -329,7 +347,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO3, .name = "dldo3", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO3, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO3, + .enable_value = AXP_POWERCTL2_DLDO3, .voltage_reg = AXP_VOLTCTL_DLDO3, .voltage_min = 700, .voltage_max = 3300, @@ -340,7 +359,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO4, .name = "dldo4", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO4, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO4, + .enable_value = AXP_POWERCTL2_DLDO4, .voltage_reg = AXP_VOLTCTL_DLDO4, .voltage_min = 700, .voltage_max = 3300, @@ -351,7 +371,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ALDO1, .name = "aldo1", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_ALDO1, + .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO1, + .enable_value = AXP_POWERCTL3_ALDO1, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -361,7 +382,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ALDO2, .name = "aldo2", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_ALDO2, + .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO2, + .enable_value = AXP_POWERCTL3_ALDO2, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -371,7 +393,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ALDO3, .name = "aldo3", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_ALDO3, + .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO3, + .enable_value = AXP_POWERCTL3_ALDO3, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -381,7 +404,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ELDO1, .name = "eldo1", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_ELDO1, + .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO1, + .enable_value = AXP_POWERCTL2_ELDO1, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -391,7 +415,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ELDO2, .name = "eldo2", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_ELDO2, + .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO2, + .enable_value = AXP_POWERCTL2_ELDO2, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -401,7 +426,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ELDO3, .name = "eldo3", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_ELDO3, + .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO3, + .enable_value = AXP_POWERCTL2_ELDO3, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -411,7 +437,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_FLDO1, .name = "fldo1", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_FLDO1, + .enable_mask = (uint8_t) ~AXP_POWERCTL3_FLDO1, + .enable_value = AXP_POWERCTL3_FLDO1, .voltage_min = 700, .voltage_max = 1450, .voltage_step1 = 50, @@ -421,12 +448,39 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_FLDO2, .name = "fldo2", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_FLDO2, + .enable_mask = (uint8_t) AXP_POWERCTL3_FLDO2, + .enable_value = AXP_POWERCTL3_FLDO2, .voltage_min = 700, .voltage_max = 1450, .voltage_step1 = 50, .voltage_nstep1 = 15, }, + { + .id = AXP8XX_REG_ID_GPIO0_LDO, + .name = "ldo-io0", + .enable_reg = AXP_GPIO0_CTRL, + .enable_mask = (uint8_t) AXP_GPIO_FUNC, + .enable_value = AXP_GPIO_FUNC_LDO_ON, + .disable_value = AXP_GPIO_FUNC_LDO_OFF, + .voltage_reg = AXP_GPIO0LDO_CTRL, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, + { + .id = AXP8XX_REG_ID_GPIO1_LDO, + .name = "ldo-io1", + .enable_reg = AXP_GPIO1_CTRL, + .enable_mask = (uint8_t) AXP_GPIO_FUNC, + .enable_value = AXP_GPIO_FUNC_LDO_ON, + .disable_value = AXP_GPIO_FUNC_LDO_OFF, + .voltage_reg = AXP_GPIO1LDO_CTRL, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, }; struct axp8xx_softc; @@ -520,10 +574,15 @@ axp8xx_regnode_enable(struct regnode *regnode, bool en sc->def->name); axp8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); + val &= ~sc->def->enable_mask; if (enable) - val |= sc->def->enable_mask; - else - val &= ~sc->def->enable_mask; + val |= sc->def->enable_value; + else { + if (sc->def->disable_value) + val |= sc->def->disable_value; + else + val &= ~sc->def->enable_value; + } axp8xx_write(sc->base_dev, sc->def->enable_reg, val); *udelay = 0; From owner-svn-src-head@freebsd.org Fri Nov 23 22:25:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54C401106E20; Fri, 23 Nov 2018 22:25:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03513772FC; Fri, 23 Nov 2018 22:25:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5B9D24C69; Fri, 23 Nov 2018 22:25:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANMP32j011389; Fri, 23 Nov 2018 22:25:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANMOxxB011356; Fri, 23 Nov 2018 22:24:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811232224.wANMOxxB011356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 22:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340856 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/autofs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/pseudofs fs/smbfs fs/tmpfs fs/udf ker... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/autofs fs/cd9660 fs/devfs fs/ext2fs fs/fdescfs fs/fuse fs/msdosfs fs/nandfs fs/pseudofs fs/smbfs fs/tmpfs fs/udf kern sys ufs/ufs X-SVN-Commit-Revision: 340856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03513772FC X-Spamd-Result: default: False [1.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.433,0]; NEURAL_SPAM_MEDIUM(0.76)[0.762,0]; NEURAL_SPAM_LONG(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 22:25:04 -0000 Author: markj Date: Fri Nov 23 22:24:59 2018 New Revision: 340856 URL: https://svnweb.freebsd.org/changeset/base/340856 Log: Ensure that directory entry padding bytes are zeroed. Directory entries must be padded to maintain alignment; in many filesystems the padding was not initialized, resulting in stack memory being copied out to userspace. With the ino64 work there are also some explicit pad fields in struct dirent. Add a subroutine to clear these bytes and use it in the in-tree filesystems. The NFS client is omitted for now as it was fixed separately in r340787. Reported by: Thomas Barabosch, Fraunhofer FKIE Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/autofs/autofs_vnops.c head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/devfs/devfs_devs.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/fuse/fuse_internal.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/fs/smbfs/smbfs_io.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/udf/udf_vnops.c head/sys/kern/uipc_mqueue.c head/sys/kern/vfs_export.c head/sys/sys/dirent.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Nov 23 22:24:59 2018 (r340856) @@ -262,9 +262,9 @@ sfs_readdir_common(uint64_t parent_id, uint64_t id, st entry.d_fileno = id; entry.d_type = DT_DIR; entry.d_name[0] = '.'; - entry.d_name[1] = '\0'; entry.d_namlen = 1; entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) return (SET_ERROR(error)); @@ -277,9 +277,9 @@ sfs_readdir_common(uint64_t parent_id, uint64_t id, st entry.d_type = DT_DIR; entry.d_name[0] = '.'; entry.d_name[1] = '.'; - entry.d_name[2] = '\0'; entry.d_namlen = 2; entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) return (SET_ERROR(error)); @@ -694,6 +694,7 @@ zfsctl_root_readdir(ap) strcpy(entry.d_name, node->snapdir->sn_name); entry.d_namlen = strlen(entry.d_name); entry.d_reclen = sizeof(entry); + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) @@ -1099,6 +1100,7 @@ zfsctl_snapdir_readdir(ap) entry.d_reclen = sizeof(entry); /* NOTE: d_off is the offset for the *next* entry. */ entry.d_off = cookie + dots_offset; + dirent_terminate(&entry); error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -2547,6 +2547,7 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * next = &odp->d_off; (void) strlcpy(odp->d_name, zap.za_name, odp->d_namlen + 1); odp->d_type = type; + dirent_terminate(odp); odp = (dirent64_t *)((intptr_t)odp + reclen); } outcount += reclen; Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/autofs/autofs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -44,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -354,14 +354,11 @@ autofs_readdir_one(struct uio *uio, const char *name, size_t *reclenp) { struct dirent dirent; - size_t namlen, padded_namlen, reclen; + size_t namlen, reclen; int error; namlen = strlen(name); - padded_namlen = roundup2(namlen + 1, __alignof(struct dirent)); - KASSERT(padded_namlen <= MAXNAMLEN, ("%zd > MAXNAMLEN", padded_namlen)); - reclen = offsetof(struct dirent, d_name) + padded_namlen; - + reclen = _GENERIC_DIRLEN(namlen); if (reclenp != NULL) *reclenp = reclen; @@ -376,7 +373,7 @@ autofs_readdir_one(struct uio *uio, const char *name, dirent.d_type = DT_DIR; dirent.d_namlen = namlen; memcpy(dirent.d_name, name, namlen); - memset(dirent.d_name + namlen, 0, padded_namlen - namlen); + dirent_terminate(&dirent); error = uiomove(&dirent, reclen, uio); return (error); Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/cd9660/cd9660_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -380,8 +380,8 @@ iso_uiodir(idp,dp,off) { int error; - dp->d_name[dp->d_namlen] = 0; dp->d_reclen = GENERIC_DIRSIZ(dp); + dirent_terminate(dp); if (idp->uio->uio_resid < dp->d_reclen) { idp->eofflag = 0; Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/devfs/devfs_devs.c Fri Nov 23 22:24:59 2018 (r340856) @@ -226,7 +226,7 @@ devfs_newdirent(char *name, int namelen) de->de_dirent->d_namlen = namelen; de->de_dirent->d_reclen = GENERIC_DIRSIZ(&d); bcopy(name, de->de_dirent->d_name, namelen); - de->de_dirent->d_name[namelen] = '\0'; + dirent_terminate(de->de_dirent); vfs_timestamp(&de->de_ctime); de->de_mtime = de->de_atime = de->de_ctime; de->de_links = 1; Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/ext2fs/ext2_lookup.c Fri Nov 23 22:24:59 2018 (r340856) @@ -223,9 +223,9 @@ ext2_readdir(struct vop_readdir_args *ap) dstdp.d_fileno = dp->e2d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->e2d_name, dstdp.d_name, dstdp.d_namlen); - dstdp.d_name[dstdp.d_namlen] = '\0'; /* NOTE: d_off is the offset of the *next* entry. */ dstdp.d_off = offset + dp->e2d_reclen; + dirent_terminate(&dstdp); if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/fdescfs/fdesc_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -561,8 +561,8 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_namlen = i + 1; dp->d_reclen = UIO_MX; bcopy("..", dp->d_name, dp->d_namlen); - dp->d_name[i + 1] = '\0'; dp->d_type = DT_DIR; + dirent_terminate(dp); break; default: if (fdp->fd_ofiles[fcnt].fde_file == NULL) @@ -572,6 +572,7 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_type = (fmp->flags & FMNT_LINRDLNKF) == 0 ? DT_CHR : DT_LNK; dp->d_fileno = i + FD_DESC; + dirent_terminate(dp); break; } /* NOTE: d_off is the offset of the *next* entry. */ Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/fuse/fuse_internal.c Fri Nov 23 22:24:59 2018 (r340856) @@ -357,7 +357,7 @@ fuse_internal_readdir_processdata(struct uio *uio, memcpy((char *)cookediov->base + sizeof(struct dirent) - MAXNAMLEN - 1, (char *)buf + FUSE_NAME_OFFSET, fudge->namelen); - ((char *)cookediov->base)[bytesavail - 1] = '\0'; + dirent_terminate(de); err = uiomove(cookediov->base, cookediov->len, uio); if (err) { Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -1550,16 +1550,18 @@ msdosfs_readdir(struct vop_readdir_args *ap) switch (n) { case 0: dirbuf.d_namlen = 1; - strcpy(dirbuf.d_name, "."); + dirbuf.d_name[0] = '.'; break; case 1: dirbuf.d_namlen = 2; - strcpy(dirbuf.d_name, ".."); + dirbuf.d_name[0] = '.'; + dirbuf.d_name[1] = '.'; break; } dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); /* NOTE: d_off is the offset of the *next* entry. */ dirbuf.d_off = offset + sizeof(struct direntry); + dirent_terminate(&dirbuf); if (uio->uio_resid < dirbuf.d_reclen) goto out; error = uiomove(&dirbuf, dirbuf.d_reclen, uio); Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/nandfs/nandfs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -1226,7 +1226,6 @@ nandfs_readdir(struct vop_readdir_args *ap) ndirent = (struct nandfs_dir_entry *)pos; name_len = ndirent->name_len; - memset(&dirent, 0, sizeof(struct dirent)); dirent.d_fileno = ndirent->inode; if (dirent.d_fileno) { dirent.d_type = ndirent->file_type; @@ -1235,6 +1234,7 @@ nandfs_readdir(struct vop_readdir_args *ap) dirent.d_reclen = GENERIC_DIRSIZ(&dirent); /* NOTE: d_off is the offset of the *next* entry. */ dirent.d_off = diroffset + ndirent->rec_len; + dirent_terminate(&dirent); DPRINTF(READDIR, ("copying `%*.*s`\n", name_len, name_len, dirent.d_name)); } @@ -1243,12 +1243,12 @@ nandfs_readdir(struct vop_readdir_args *ap) * If there isn't enough space in the uio to return a * whole dirent, break off read */ - if (uio->uio_resid < GENERIC_DIRSIZ(&dirent)) + if (uio->uio_resid < dirent.d_reclen) break; /* Transfer */ if (dirent.d_fileno) - uiomove(&dirent, GENERIC_DIRSIZ(&dirent), uio); + uiomove(&dirent, dirent.d_reclen, uio); /* Advance */ diroffset += ndirent->rec_len; Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -828,7 +828,6 @@ pfs_readdir(struct vop_readdir_args *va) /* PFS_DELEN was picked to fit PFS_NAMLEN */ for (i = 0; i < PFS_NAMELEN - 1 && pn->pn_name[i] != '\0'; ++i) pfsent->entry.d_name[i] = pn->pn_name[i]; - pfsent->entry.d_name[i] = 0; pfsent->entry.d_namlen = i; /* NOTE: d_off is the offset of the *next* entry. */ pfsent->entry.d_off = offset + PFS_DELEN; @@ -855,6 +854,7 @@ pfs_readdir(struct vop_readdir_args *va) panic("%s has unexpected node type: %d", pn->pn_name, pn->pn_type); } PFS_TRACE(("%s", pfsent->entry.d_name)); + dirent_terminate(&pfsent->entry); STAILQ_INSERT_TAIL(&lst, pfsent, link); offset += PFS_DELEN; resid -= PFS_DELEN; Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/smbfs/smbfs_io.c Fri Nov 23 22:24:59 2018 (r340856) @@ -106,8 +106,8 @@ smbfs_readvdir(struct vnode *vp, struct uio *uio, stru de.d_namlen = offset + 1; de.d_name[0] = '.'; de.d_name[1] = '.'; - de.d_name[offset + 1] = '\0'; de.d_type = DT_DIR; + dirent_terminate(&de); error = uiomove(&de, DE_SIZE, uio); if (error) goto out; @@ -156,7 +156,7 @@ smbfs_readvdir(struct vnode *vp, struct uio *uio, stru de.d_type = (ctx->f_attr.fa_attr & SMB_FA_DIR) ? DT_DIR : DT_REG; de.d_namlen = ctx->f_nmlen; bcopy(ctx->f_name, de.d_name, de.d_namlen); - de.d_name[de.d_namlen] = '\0'; + dirent_terminate(&de); if (smbfs_fastlookup) { error = smbfs_nget(vp->v_mount, vp, ctx->f_name, ctx->f_nmlen, &ctx->f_attr, &newvp); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/tmpfs/tmpfs_subr.c Fri Nov 23 22:24:59 2018 (r340856) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -50,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1120,8 +1120,8 @@ tmpfs_dir_getdotdent(struct tmpfs_node *node, struct u dent.d_type = DT_DIR; dent.d_namlen = 1; dent.d_name[0] = '.'; - dent.d_name[1] = '\0'; dent.d_reclen = GENERIC_DIRSIZ(&dent); + dirent_terminate(&dent); if (dent.d_reclen > uio->uio_resid) error = EJUSTRETURN; @@ -1164,8 +1164,8 @@ tmpfs_dir_getdotdotdent(struct tmpfs_node *node, struc dent.d_namlen = 2; dent.d_name[0] = '.'; dent.d_name[1] = '.'; - dent.d_name[2] = '\0'; dent.d_reclen = GENERIC_DIRSIZ(&dent); + dirent_terminate(&dent); if (dent.d_reclen > uio->uio_resid) error = EJUSTRETURN; @@ -1285,8 +1285,8 @@ tmpfs_dir_getdents(struct tmpfs_node *node, struct uio d.d_namlen = de->td_namelen; MPASS(de->td_namelen < sizeof(d.d_name)); (void)memcpy(d.d_name, de->ud.td_name, de->td_namelen); - d.d_name[de->td_namelen] = '\0'; d.d_reclen = GENERIC_DIRSIZ(&d); + dirent_terminate(&d); /* Stop reading if the directory entry we are treating is * bigger than the amount of data that can be returned. */ Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -56,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -51,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/fs/udf/udf_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -843,10 +843,10 @@ udf_readdir(struct vop_readdir_args *a) dir.d_fileno = node->hash_id; dir.d_type = DT_DIR; dir.d_name[0] = '.'; - dir.d_name[1] = '\0'; dir.d_namlen = 1; dir.d_reclen = GENERIC_DIRSIZ(&dir); dir.d_off = 1; + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 1); if (error) @@ -856,10 +856,10 @@ udf_readdir(struct vop_readdir_args *a) dir.d_type = DT_DIR; dir.d_name[0] = '.'; dir.d_name[1] = '.'; - dir.d_name[2] = '\0'; dir.d_namlen = 2; dir.d_reclen = GENERIC_DIRSIZ(&dir); dir.d_off = 2; + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 2); } else { @@ -870,6 +870,7 @@ udf_readdir(struct vop_readdir_args *a) DT_DIR : DT_UNKNOWN; dir.d_reclen = GENERIC_DIRSIZ(&dir); dir.d_off = ds->this_off; + dirent_terminate(&dir); uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, ds->this_off); Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/kern/uipc_mqueue.c Fri Nov 23 22:24:59 2018 (r340856) @@ -1428,7 +1428,6 @@ mqfs_readdir(struct vop_readdir_args *ap) entry.d_fileno = pn->mn_fileno; for (i = 0; i < MQFS_NAMELEN - 1 && pn->mn_name[i] != '\0'; ++i) entry.d_name[i] = pn->mn_name[i]; - entry.d_name[i] = 0; entry.d_namlen = i; switch (pn->mn_type) { case mqfstype_root: @@ -1447,6 +1446,7 @@ mqfs_readdir(struct vop_readdir_args *ap) panic("%s has unexpected node type: %d", pn->mn_name, pn->mn_type); } + dirent_terminate(&entry); if (entry.d_reclen > uio->uio_resid) break; if (offset >= uio->uio_offset) { Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/kern/vfs_export.c Fri Nov 23 22:24:59 2018 (r340856) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include +#include #include #include #include @@ -55,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/sys/dirent.h ============================================================================== --- head/sys/sys/dirent.h Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/sys/dirent.h Fri Nov 23 22:24:59 2018 (r340856) @@ -126,6 +126,19 @@ struct freebsd11_dirent { #ifdef _KERNEL #define GENERIC_DIRSIZ(dp) _GENERIC_DIRSIZ(dp) + +/* + * Ensure that padding bytes are zeroed and that the name is NUL-terminated. + */ +static inline void +dirent_terminate(struct dirent *dp) +{ + + dp->d_pad0 = 0; + dp->d_pad1 = 0; + memset(dp->d_name + dp->d_namlen, 0, + dp->d_reclen - (__offsetof(struct dirent, d_name) + dp->d_namlen)); +} #endif #endif /* !_SYS_DIRENT_H_ */ Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Fri Nov 23 21:08:11 2018 (r340855) +++ head/sys/ufs/ufs/ufs_vnops.c Fri Nov 23 22:24:59 2018 (r340856) @@ -2217,9 +2217,9 @@ ufs_readdir(ap) dstdp.d_fileno = dp->d_ino; dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); - dstdp.d_name[dstdp.d_namlen] = '\0'; /* NOTE: d_off is the offset of the *next* entry. */ dstdp.d_off = offset + dp->d_reclen; + dirent_terminate(&dstdp); if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; From owner-svn-src-head@freebsd.org Fri Nov 23 22:36:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B961113314F; Fri, 23 Nov 2018 22:36:57 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF818778ED; Fri, 23 Nov 2018 22:36:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BC3024E02; Fri, 23 Nov 2018 22:36:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANMauKl016900; Fri, 23 Nov 2018 22:36:56 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANMau1c016899; Fri, 23 Nov 2018 22:36:56 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201811232236.wANMau1c016899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 23 Nov 2018 22:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340857 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 340857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF818778ED X-Spamd-Result: default: False [1.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.41)[0.415,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; NEURAL_SPAM_LONG(0.42)[0.420,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 22:36:57 -0000 Author: sobomax Date: Fri Nov 23 22:36:56 2018 New Revision: 340857 URL: https://svnweb.freebsd.org/changeset/base/340857 Log: Nuke out buffer overflow safety marker code, it duplicates similar code in the malloc()/free() as well as having potential of softening the handling in case error is detected down to a mere warning as compared to hard panic in free(). Submitted by: tsoome Differential Revision: https://reviews.freebsd.org/D18299 Modified: head/stand/common/bcache.c Modified: head/stand/common/bcache.c ============================================================================== --- head/stand/common/bcache.c Fri Nov 23 22:24:59 2018 (r340856) +++ head/stand/common/bcache.c Fri Nov 23 22:36:56 2018 (r340857) @@ -86,7 +86,6 @@ static u_int bcache_rablks; ((bc)->bcache_ctl[BHASH((bc), (blkno))].bc_blkno != (blkno)) #define BCACHE_READAHEAD 256 #define BCACHE_MINREADAHEAD 32 -#define BCACHE_MARKER 0xdeadbeef static void bcache_invalidate(struct bcache *bc, daddr_t blkno); static void bcache_insert(struct bcache *bc, daddr_t blkno); @@ -123,7 +122,6 @@ bcache_allocate(void) u_int i; struct bcache *bc = malloc(sizeof (struct bcache)); int disks = bcache_numdev; - uint32_t *marker; if (disks == 0) disks = 1; /* safe guard */ @@ -142,8 +140,7 @@ bcache_allocate(void) bc->bcache_nblks = bcache_total_nblks >> i; bcache_unit_nblks = bc->bcache_nblks; - bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize + - sizeof(uint32_t)); + bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize); if (bc->bcache_data == NULL) { /* dont error out yet. fall back to 32 blocks and try again */ bc->bcache_nblks = 32; @@ -158,9 +155,6 @@ bcache_allocate(void) errno = ENOMEM; return (NULL); } - /* Insert cache end marker. */ - marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize); - *marker = BCACHE_MARKER; /* Flush the cache */ for (i = 0; i < bc->bcache_nblks; i++) { @@ -222,15 +216,12 @@ read_strategy(void *devdata, int rw, daddr_t blk, size int result; daddr_t p_blk; caddr_t p_buf; - uint32_t *marker; if (bc == NULL) { errno = ENODEV; return (-1); } - marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize); - if (rsize != NULL) *rsize = 0; @@ -348,12 +339,6 @@ read_strategy(void *devdata, int rw, daddr_t blk, size if (size != 0) { bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size); result = 0; - } - - if (*marker != BCACHE_MARKER) { - printf("BUG: bcache corruption detected: nblks: %zu p_blk: %lu, " - "p_size: %zu, ra: %zu\n", bc->bcache_nblks, - (long unsigned)BHASH(bc, p_blk), p_size, ra); } done: From owner-svn-src-head@freebsd.org Fri Nov 23 22:37:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5FE511331A8; Fri, 23 Nov 2018 22:37:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76CAD77A3B; Fri, 23 Nov 2018 22:37:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58D5424E07; Fri, 23 Nov 2018 22:37:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANMbaQI017004; Fri, 23 Nov 2018 22:37:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANMbaWc017002; Fri, 23 Nov 2018 22:37:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811232237.wANMbaWc017002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 22:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340858 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 340858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76CAD77A3B X-Spamd-Result: default: False [1.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_SHORT(0.41)[0.405,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 22:37:37 -0000 Author: kib Date: Fri Nov 23 22:37:35 2018 New Revision: 340858 URL: https://svnweb.freebsd.org/changeset/base/340858 Log: rtld: parse FreeBSD Feature Control note on the object load. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Nov 23 22:36:56 2018 (r340857) +++ head/libexec/rtld-elf/rtld.c Fri Nov 23 22:37:35 2018 (r340858) @@ -1477,6 +1477,7 @@ digest_notes(Obj_Entry *obj, Elf_Addr note_start, Elf_ note->n_descsz != sizeof(int32_t)) continue; if (note->n_type != NT_FREEBSD_ABI_TAG && + note->n_type != NT_FREEBSD_FEATURE_CTL && note->n_type != NT_FREEBSD_NOINIT_TAG) continue; note_name = (const char *)(note + 1); @@ -1490,6 +1491,13 @@ digest_notes(Obj_Entry *obj, Elf_Addr note_start, Elf_ p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); obj->osrel = *(const int32_t *)(p); dbg("note osrel %d", obj->osrel); + break; + case NT_FREEBSD_FEATURE_CTL: + /* FreeBSD ABI feature control note */ + p = (uintptr_t)(note + 1); + p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); + obj->fctl0 = *(const uint32_t *)(p); + dbg("note fctl0 %#x", obj->fctl0); break; case NT_FREEBSD_NOINIT_TAG: /* FreeBSD 'crt does not call init' note */ Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Fri Nov 23 22:36:56 2018 (r340857) +++ head/libexec/rtld-elf/rtld.h Fri Nov 23 22:37:35 2018 (r340858) @@ -235,6 +235,7 @@ typedef struct Struct_Obj_Entry { int fini_array_num; /* Number of entries in fini_array */ int32_t osrel; /* OSREL note value */ + uint32_t fctl0; /* FEATURE_CONTROL note desc[0] value */ bool mainprog : 1; /* True if this is the main program */ bool rtld : 1; /* True if this is the dynamic linker */ From owner-svn-src-head@freebsd.org Fri Nov 23 23:07:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E59F311339F8; Fri, 23 Nov 2018 23:07:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62B197872F; Fri, 23 Nov 2018 23:07:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35397252D7; Fri, 23 Nov 2018 23:07:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANN7obi032723; Fri, 23 Nov 2018 23:07:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANN7oNH032722; Fri, 23 Nov 2018 23:07:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811232307.wANN7oNH032722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 23:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340859 - head/sys/fs/nandfs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/nandfs X-SVN-Commit-Revision: 340859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 62B197872F X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.50)[0.502,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:07:51 -0000 Author: markj Date: Fri Nov 23 23:07:49 2018 New Revision: 340859 URL: https://svnweb.freebsd.org/changeset/base/340859 Log: Ensure the dirent remains initialized when dirent.d_fileno is unset. Reported by: rmacklem MFC with: r340856 Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nandfs/nandfs_vnops.c Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Fri Nov 23 22:37:35 2018 (r340858) +++ head/sys/fs/nandfs/nandfs_vnops.c Fri Nov 23 23:07:49 2018 (r340859) @@ -1226,6 +1226,7 @@ nandfs_readdir(struct vop_readdir_args *ap) ndirent = (struct nandfs_dir_entry *)pos; name_len = ndirent->name_len; + memset(&dirent, 0, sizeof(dirent)); dirent.d_fileno = ndirent->inode; if (dirent.d_fileno) { dirent.d_type = ndirent->file_type; @@ -1243,7 +1244,7 @@ nandfs_readdir(struct vop_readdir_args *ap) * If there isn't enough space in the uio to return a * whole dirent, break off read */ - if (uio->uio_resid < dirent.d_reclen) + if (uio->uio_resid < GENERIC_DIRSIZ(&dirent)) break; /* Transfer */ From owner-svn-src-head@freebsd.org Fri Nov 23 23:08:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F7151133A1A; Fri, 23 Nov 2018 23:08:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 695337880B; Fri, 23 Nov 2018 23:08:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40E20252D8; Fri, 23 Nov 2018 23:07:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANN7wAF032779; Fri, 23 Nov 2018 23:07:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANN7vYH032776; Fri, 23 Nov 2018 23:07:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811232307.wANN7vYH032776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 23:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340860 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 340860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 695337880B X-Spamd-Result: default: False [1.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.51)[0.506,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:08:04 -0000 Author: kib Date: Fri Nov 23 23:07:57 2018 New Revision: 340860 URL: https://svnweb.freebsd.org/changeset/base/340860 Log: Provide storage for the process feature control flags in struct proc. The flags are cleared on exec, it is up to the image activator to set them. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/kern_exec.c head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Nov 23 23:07:49 2018 (r340859) +++ head/sys/kern/kern_exec.c Fri Nov 23 23:07:57 2018 (r340860) @@ -488,6 +488,7 @@ interpret: goto exec_fail_dealloc; imgp->proc->p_osrel = 0; + imgp->proc->p_fctl0 = 0; /* * Implement image setuid/setgid. Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Fri Nov 23 23:07:49 2018 (r340859) +++ head/sys/kern/kern_thread.c Fri Nov 23 23:07:57 2018 (r340860) @@ -92,9 +92,9 @@ _Static_assert(offsetof(struct proc, p_pid) == 0xbc, "struct proc KBI p_pid"); _Static_assert(offsetof(struct proc, p_filemon) == 0x3d0, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x3e4, +_Static_assert(offsetof(struct proc, p_comm) == 0x3e8, "struct proc KBI p_comm"); -_Static_assert(offsetof(struct proc, p_emuldata) == 0x4b8, +_Static_assert(offsetof(struct proc, p_emuldata) == 0x4c0, "struct proc KBI p_emuldata"); #endif #ifdef __i386__ @@ -112,9 +112,9 @@ _Static_assert(offsetof(struct proc, p_pid) == 0x74, "struct proc KBI p_pid"); _Static_assert(offsetof(struct proc, p_filemon) == 0x27c, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x28c, +_Static_assert(offsetof(struct proc, p_comm) == 0x290, "struct proc KBI p_comm"); -_Static_assert(offsetof(struct proc, p_emuldata) == 0x318, +_Static_assert(offsetof(struct proc, p_emuldata) == 0x31c, "struct proc KBI p_emuldata"); #endif Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Nov 23 23:07:49 2018 (r340859) +++ head/sys/sys/proc.h Fri Nov 23 23:07:57 2018 (r340860) @@ -642,6 +642,7 @@ struct proc { u_int p_magic; /* (b) Magic number. */ int p_osrel; /* (x) osreldate for the binary (from ELF note, if any) */ + uint32_t p_fctl0; /* (x) ABI feature control, ELF note */ char p_comm[MAXCOMLEN + 1]; /* (x) Process name. */ struct sysentvec *p_sysent; /* (b) Syscall dispatch info. */ struct pargs *p_args; /* (c) Process arguments. */ From owner-svn-src-head@freebsd.org Fri Nov 23 23:10:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF58C1133B0B; Fri, 23 Nov 2018 23:10:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8429B78E21; Fri, 23 Nov 2018 23:10:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65520252DE; Fri, 23 Nov 2018 23:10:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANNA4bq032946; Fri, 23 Nov 2018 23:10:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANNA4ct032945; Fri, 23 Nov 2018 23:10:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811232310.wANNA4ct032945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 23:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340861 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8429B78E21 X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:10:05 -0000 Author: markj Date: Fri Nov 23 23:10:03 2018 New Revision: 340861 URL: https://svnweb.freebsd.org/changeset/base/340861 Log: Honour the waitok parameter in kevent_expand(). Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18316 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Fri Nov 23 23:07:57 2018 (r340860) +++ head/sys/kern/kern_event.c Fri Nov 23 23:10:03 2018 (r340861) @@ -1686,10 +1686,6 @@ kqueue_schedtask(struct kqueue *kq) * Expand the kq to make sure we have storage for fops/ident pair. * * Return 0 on success (or no work necessary), return errno on failure. - * - * Not calling hashinit w/ waitok (proper malloc flag) should be safe. - * If kqueue_register is called from a non-fd context, there usually/should - * be no locks held. */ static int kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident, @@ -1734,8 +1730,9 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop } } else { if (kq->kq_knhashmask == 0) { - tmp_knhash = hashinit(KN_HASHSIZE, M_KQUEUE, - &tmp_knhashmask); + tmp_knhash = hashinit_flags(KN_HASHSIZE, M_KQUEUE, + &tmp_knhashmask, + waitok ? HASH_WAITOK : HASH_NOWAIT); if (tmp_knhash == NULL) return ENOMEM; KQ_LOCK(kq); From owner-svn-src-head@freebsd.org Fri Nov 23 23:16:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A44461133FDD; Fri, 23 Nov 2018 23:16:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BB6579351; Fri, 23 Nov 2018 23:16:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 482B425472; Fri, 23 Nov 2018 23:16:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANNG2DZ037678; Fri, 23 Nov 2018 23:16:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANNG2nK037677; Fri, 23 Nov 2018 23:16:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811232316.wANNG2nK037677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 23:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340862 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6BB6579351 X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.50)[0.502,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:16:02 -0000 Author: kib Date: Fri Nov 23 23:16:01 2018 New Revision: 340862 URL: https://svnweb.freebsd.org/changeset/base/340862 Log: Trivial reduction of the code duplication, reuse the return FALSE code. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Nov 23 23:10:03 2018 (r340861) +++ head/sys/kern/imgact_elf.c Fri Nov 23 23:16:01 2018 (r340862) @@ -2364,8 +2364,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Bra curthread->td_ucred, NOCRED, NULL, curthread); if (error != 0) { uprintf("i/o error PT_NOTE\n"); - res = FALSE; - goto ret; + goto retf; } note = note0 = (const Elf_Note *)buf; note_end = (const Elf_Note *)(buf + pnote->p_filesz); @@ -2379,8 +2378,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Bra for (i = 0; i < 100 && note >= note0 && note < note_end; i++) { if (!aligned(note, Elf32_Addr) || (const char *)note_end - (const char *)note < sizeof(Elf_Note)) { - res = FALSE; - goto ret; + goto retf; } if (note->n_namesz != checknote->hdr.n_namesz || note->n_descsz != checknote->hdr.n_descsz || @@ -2408,6 +2406,7 @@ nextnote: roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) + roundup2(note->n_descsz, ELF_NOTE_ROUNDSIZE)); } +retf: res = FALSE; ret: free(buf, M_TEMP); From owner-svn-src-head@freebsd.org Fri Nov 23 23:29:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FC94113453B; Fri, 23 Nov 2018 23:29:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA5E5798A3; Fri, 23 Nov 2018 23:29:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 865E325633; Fri, 23 Nov 2018 23:29:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANNTE16042908; Fri, 23 Nov 2018 23:29:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANNTEAx042907; Fri, 23 Nov 2018 23:29:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811232329.wANNTEAx042907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 23:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340863 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA5E5798A3 X-Spamd-Result: default: False [1.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_SHORT(0.51)[0.506,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:29:15 -0000 Author: kib Date: Fri Nov 23 23:29:14 2018 New Revision: 340863 URL: https://svnweb.freebsd.org/changeset/base/340863 Log: Generalize ELF parse_notes(). Remove the knowledge of the ABI note type and brandnote from it, instead provide it with a callback to do note-specific matching and data fetching. Implement callback to match against ELF brand. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Nov 23 23:16:01 2018 (r340862) +++ head/sys/kern/imgact_elf.c Fri Nov 23 23:29:14 2018 (r340863) @@ -2341,8 +2341,9 @@ __elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, } static boolean_t -__elfN(parse_notes)(struct image_params *imgp, Elf_Brandnote *checknote, - int32_t *osrel, const Elf_Phdr *pnote) +__elfN(parse_notes)(struct image_params *imgp, Elf_Note *checknote, + const char *note_vendor, const Elf_Phdr *pnote, + boolean_t (*cb)(const Elf_Note *, void *, boolean_t *), void *cb_arg) { const Elf_Note *note, *note0, *note_end; const char *note_name; @@ -2380,27 +2381,18 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Bra (const char *)note < sizeof(Elf_Note)) { goto retf; } - if (note->n_namesz != checknote->hdr.n_namesz || - note->n_descsz != checknote->hdr.n_descsz || - note->n_type != checknote->hdr.n_type) + if (note->n_namesz != checknote->n_namesz || + note->n_descsz != checknote->n_descsz || + note->n_type != checknote->n_type) goto nextnote; note_name = (const char *)(note + 1); - if (note_name + checknote->hdr.n_namesz >= - (const char *)note_end || strncmp(checknote->vendor, - note_name, checknote->hdr.n_namesz) != 0) + if (note_name + checknote->n_namesz >= + (const char *)note_end || strncmp(note_vendor, + note_name, checknote->n_namesz) != 0) goto nextnote; - /* - * Fetch the osreldate for binary - * from the ELF OSABI-note if necessary. - */ - if ((checknote->flags & BN_TRANSLATE_OSREL) != 0 && - checknote->trans_osrel != NULL) { - res = checknote->trans_osrel(note, osrel); + if (cb(note, cb_arg, &res)) goto ret; - } - res = TRUE; - goto ret; nextnote: note = (const Elf_Note *)((const char *)(note + 1) + roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) + @@ -2413,26 +2405,54 @@ ret: return (res); } +struct brandnote_cb_arg { + Elf_Brandnote *brandnote; + int32_t *osrel; +}; + +static boolean_t +brandnote_cb(const Elf_Note *note, void *arg0, boolean_t *res) +{ + struct brandnote_cb_arg *arg; + + arg = arg0; + + /* + * Fetch the osreldate for binary from the ELF OSABI-note if + * necessary. + */ + *res = (arg->brandnote->flags & BN_TRANSLATE_OSREL) != 0 && + arg->brandnote->trans_osrel != NULL ? + arg->brandnote->trans_osrel(note, arg->osrel) : TRUE; + + return (TRUE); +} + /* * Try to find the appropriate ABI-note section for checknote, * fetch the osreldate for binary from the ELF OSABI-note. Only the * first page of the image is searched, the same as for headers. */ static boolean_t -__elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote, +__elfN(check_note)(struct image_params *imgp, Elf_Brandnote *brandnote, int32_t *osrel) { const Elf_Phdr *phdr; const Elf_Ehdr *hdr; + struct brandnote_cb_arg b_arg; int i; hdr = (const Elf_Ehdr *)imgp->image_header; phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); + b_arg.brandnote = brandnote; + b_arg.osrel = osrel; for (i = 0; i < hdr->e_phnum; i++) { - if (phdr[i].p_type == PT_NOTE && - __elfN(parse_notes)(imgp, checknote, osrel, &phdr[i])) + if (phdr[i].p_type == PT_NOTE && __elfN(parse_notes)(imgp, + &brandnote->hdr, brandnote->vendor, &phdr[i], brandnote_cb, + &b_arg)) { return (TRUE); + } } return (FALSE); From owner-svn-src-head@freebsd.org Fri Nov 23 23:33:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F98B1134782; Fri, 23 Nov 2018 23:33:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F3C579D62; Fri, 23 Nov 2018 23:33:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5D2E257C5; Fri, 23 Nov 2018 23:33:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANNXta3047713; Fri, 23 Nov 2018 23:33:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANNXtts047712; Fri, 23 Nov 2018 23:33:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811232333.wANNXtts047712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Nov 2018 23:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340864 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F3C579D62 X-Spamd-Result: default: False [1.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.51)[0.506,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 23:33:56 -0000 Author: kib Date: Fri Nov 23 23:33:55 2018 New Revision: 340864 URL: https://svnweb.freebsd.org/changeset/base/340864 Log: Parse FreeBSD Feature Control note on the ELF image activation. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Nov 23 23:29:14 2018 (r340863) +++ head/sys/kern/imgact_elf.c Fri Nov 23 23:33:55 2018 (r340864) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); static int __elfN(check_header)(const Elf_Ehdr *hdr); static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, - const char *interp, int interp_name_len, int32_t *osrel); + const char *interp, int interp_name_len, int32_t *osrel, uint32_t *fctl0); static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, u_long *entry, size_t pagesize); static int __elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset, @@ -99,7 +99,7 @@ static bool __elfN(freebsd_trans_osrel)(const Elf_Note int32_t *osrel); static bool kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel); static boolean_t __elfN(check_note)(struct image_params *imgp, - Elf_Brandnote *checknote, int32_t *osrel); + Elf_Brandnote *checknote, int32_t *osrel, uint32_t *fctl0); static vm_prot_t __elfN(trans_prot)(Elf_Word); static Elf_Word __elfN(untrans_prot)(vm_prot_t); @@ -256,7 +256,7 @@ __elfN(brand_inuse)(Elf_Brandinfo *entry) static Elf_Brandinfo * __elfN(get_brandinfo)(struct image_params *imgp, const char *interp, - int interp_name_len, int32_t *osrel) + int interp_name_len, int32_t *osrel, uint32_t *fctl0) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi, *bi_m; @@ -280,7 +280,8 @@ __elfN(get_brandinfo)(struct image_params *imgp, const continue; if (hdr->e_machine == bi->machine && (bi->flags & (BI_BRAND_NOTE|BI_BRAND_NOTE_MANDATORY)) != 0) { - ret = __elfN(check_note)(imgp, bi->brand_note, osrel); + ret = __elfN(check_note)(imgp, bi->brand_note, osrel, + fctl0); /* Give brand a chance to veto check_note's guess */ if (ret && bi->header_supported) ret = bi->header_supported(imgp); @@ -789,6 +790,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i vm_prot_t prot; u_long text_size, data_size, total_size, text_addr, data_addr; u_long seg_size, seg_addr, addr, baddr, et_dyn_addr, entry, proghdr; + uint32_t fctl0; int32_t osrel; int error, i, n, interp_name_len, have_interp; @@ -824,6 +826,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i n = error = 0; baddr = 0; osrel = 0; + fctl0 = 0; text_size = data_size = total_size = text_addr = data_addr = 0; entry = proghdr = 0; interp_name_len = 0; @@ -889,7 +892,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i } brand_info = __elfN(get_brandinfo)(imgp, interp, interp_name_len, - &osrel); + &osrel, &fctl0); if (brand_info == NULL) { uprintf("ELF binary type \"%u\" not known.\n", hdr->e_ident[EI_OSABI]); @@ -1092,6 +1095,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i imgp->interpreted = 0; imgp->reloc_base = addr; imgp->proc->p_osrel = osrel; + imgp->proc->p_fctl0 = fctl0; imgp->proc->p_elf_machine = hdr->e_machine; imgp->proc->p_elf_flags = hdr->e_flags; @@ -2428,29 +2432,64 @@ brandnote_cb(const Elf_Note *note, void *arg0, boolean return (TRUE); } +static Elf_Note fctl_note = { + .n_namesz = sizeof(FREEBSD_ABI_VENDOR), + .n_descsz = sizeof(uint32_t), + .n_type = NT_FREEBSD_FEATURE_CTL, +}; + +struct fctl_cb_arg { + uint32_t *fctl0; +}; + +static boolean_t +note_fctl_cb(const Elf_Note *note, void *arg0, boolean_t *res) +{ + struct fctl_cb_arg *arg; + const Elf32_Word *desc; + uintptr_t p; + + arg = arg0; + p = (uintptr_t)(note + 1); + p += roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE); + desc = (const Elf32_Word *)p; + *arg->fctl0 = desc[0]; + return (TRUE); +} + /* - * Try to find the appropriate ABI-note section for checknote, - * fetch the osreldate for binary from the ELF OSABI-note. Only the - * first page of the image is searched, the same as for headers. + * Try to find the appropriate ABI-note section for checknote, fetch + * the osreldate and feature control flags for binary from the ELF + * OSABI-note. Only the first page of the image is searched, the same + * as for headers. */ static boolean_t __elfN(check_note)(struct image_params *imgp, Elf_Brandnote *brandnote, - int32_t *osrel) + int32_t *osrel, uint32_t *fctl0) { const Elf_Phdr *phdr; const Elf_Ehdr *hdr; struct brandnote_cb_arg b_arg; - int i; + struct fctl_cb_arg f_arg; + int i, j; hdr = (const Elf_Ehdr *)imgp->image_header; phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); b_arg.brandnote = brandnote; b_arg.osrel = osrel; + f_arg.fctl0 = fctl0; for (i = 0; i < hdr->e_phnum; i++) { if (phdr[i].p_type == PT_NOTE && __elfN(parse_notes)(imgp, &brandnote->hdr, brandnote->vendor, &phdr[i], brandnote_cb, &b_arg)) { + for (j = 0; j < hdr->e_phnum; j++) { + if (phdr[j].p_type == PT_NOTE && + __elfN(parse_notes)(imgp, &fctl_note, + FREEBSD_ABI_VENDOR, &phdr[j], + note_fctl_cb, &f_arg)) + break; + } return (TRUE); } } From owner-svn-src-head@freebsd.org Sat Nov 24 01:25:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 208731137424; Sat, 24 Nov 2018 01:25:48 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9A927D01F; Sat, 24 Nov 2018 01:25:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA93926BCB; Sat, 24 Nov 2018 01:25:47 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAO1PlGb004373; Sat, 24 Nov 2018 01:25:47 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAO1PjKn004363; Sat, 24 Nov 2018 01:25:45 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201811240125.wAO1PjKn004363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 24 Nov 2018 01:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340866 - in head/contrib/libarchive: cpio libarchive libarchive/test tar X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head/contrib/libarchive: cpio libarchive libarchive/test tar X-SVN-Commit-Revision: 340866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C9A927D01F X-Spamd-Result: default: False [1.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.46)[0.458,0]; NEURAL_SPAM_MEDIUM(0.76)[0.762,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.19)[0.194,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 01:25:48 -0000 Author: mm Date: Sat Nov 24 01:25:45 2018 New Revision: 340866 URL: https://svnweb.freebsd.org/changeset/base/340866 Log: MFV r340865: Sync libarchive with vendor. Relevant vendor changes: PR #1080: Spelling fixes PR #1084: RAR5 reader bugfixes PR #1091: fix use-after-free in delayed newc link processing PR #1092: Fix a few obvious resource leaks and strcpy() misuses MFC after: 1 week Modified: head/contrib/libarchive/cpio/cpio.c head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/archive_write_set_format_xar.c head/contrib/libarchive/libarchive/test/test_fuzz.c head/contrib/libarchive/libarchive/test/test_read_format_rar5.c head/contrib/libarchive/libarchive/test/test_write_disk_perms.c head/contrib/libarchive/tar/write.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/cpio/cpio.c Sat Nov 24 01:25:45 2018 (r340866) @@ -755,8 +755,10 @@ file_to_archive(struct cpio *cpio, const char *srcpath } if (cpio->option_rename) destpath = cpio_rename(destpath); - if (destpath == NULL) + if (destpath == NULL) { + archive_entry_free(entry); return (0); + } archive_entry_copy_pathname(entry, destpath); /* Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_acl.c Sat Nov 24 01:25:45 2018 (r340866) @@ -753,8 +753,10 @@ archive_acl_to_text_w(struct archive_acl *acl, ssize_t append_entry_w(&wp, prefix, ap->type, ap->tag, flags, wname, ap->permset, id); count++; - } else if (r < 0 && errno == ENOMEM) + } else if (r < 0 && errno == ENOMEM) { + free(ws); return (NULL); + } } /* Add terminating character */ @@ -975,8 +977,10 @@ archive_acl_to_text_l(struct archive_acl *acl, ssize_t prefix = NULL; r = archive_mstring_get_mbs_l( &ap->name, &name, &len, sc); - if (r != 0) + if (r != 0) { + free(s); return (NULL); + } if (count > 0) *p++ = separator; if (name == NULL || Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Sat Nov 24 01:25:45 2018 (r340866) @@ -88,6 +88,7 @@ struct file_header { uint8_t solid : 1; /* Is this a solid stream? */ uint8_t service : 1; /* Is this file a service data? */ + uint8_t eof : 1; /* Did we finish unpacking the file? */ /* Optional time fields. */ uint64_t e_mtime; @@ -176,7 +177,7 @@ struct comp_state { decompression. */ uint8_t* filtered_buf; /* Buffer used when applying filters. */ const uint8_t* block_buf; /* Buffer used when merging blocks. */ - size_t window_mask; /* Convinience field; window_size - 1. */ + size_t window_mask; /* Convenience field; window_size - 1. */ int64_t write_ptr; /* This amount of data has been unpacked in the window buffer. */ int64_t last_write_ptr; /* This amount of data has been stored in @@ -279,7 +280,7 @@ struct rar5 { int skip_mode; /* An offset to QuickOpen list. This is not supported by this unpacker, - * becuase we're focusing on streaming interface. QuickOpen is designed + * because we're focusing on streaming interface. QuickOpen is designed * to make things quicker for non-stream interfaces, so it's not our * use case. */ uint64_t qlist_offset; @@ -387,7 +388,7 @@ static void cdeque_pop_front_fast(struct cdeque* d, vo d->size--; } -/* Pops a front element of this cicrular deque object and returns its value. +/* Pops a front element of this circular deque object and returns its value. * This function performs bounds checking. */ static int cdeque_pop_front(struct cdeque* d, void** value) { if(!d || !value) @@ -400,17 +401,17 @@ static int cdeque_pop_front(struct cdeque* d, void** v return CDE_OK; } -/* Convinience function to cast filter_info** to void **. */ +/* Convenience function to cast filter_info** to void **. */ static void** cdeque_filter_p(struct filter_info** f) { return (void**) (size_t) f; } -/* Convinience function to cast filter_info* to void *. */ +/* Convenience function to cast filter_info* to void *. */ static void* cdeque_filter(struct filter_info* f) { return (void**) (size_t) f; } -/* Destroys this circular deque object. Dellocates the memory of the collection +/* Destroys this circular deque object. Deallocates the memory of the collection * buffer, but doesn't deallocate the memory of any pointer passed to this * deque as a value. */ static void cdeque_free(struct cdeque* d) { @@ -434,7 +435,7 @@ static inline struct rar5* get_context(struct archive_ // TODO: make sure these functions return a little endian number -/* Convinience functions used by filter implementations. */ +/* Convenience functions used by filter implementations. */ static uint32_t read_filter_data(struct rar5* rar, uint32_t offset) { uint32_t* dptr = (uint32_t*) &rar->cstate.window_buf[offset]; @@ -672,7 +673,7 @@ static void push_data(struct archive_read* a, struct r } } -/* Convinience function that submits the data to the user. It uses the +/* Convenience function that submits the data to the user. It uses the * unpack window buffer as a source location. */ static void push_window_data(struct archive_read* a, struct rar5* rar, int64_t idx_begin, int64_t idx_end) @@ -753,7 +754,7 @@ static void free_filters(struct rar5* rar) { /* Free any remaining filters. All filters should be naturally consumed by * the unpacking function, so remaining filters after unpacking normally - * mean that unpacking wasn't successfull. But still of course we shouldn't + * mean that unpacking wasn't successful. But still of course we shouldn't * leak memory in such case. */ /* cdeque_size() is a fast operation, so we can use it as a loop @@ -885,7 +886,7 @@ static int read_var(struct archive_read* a, uint64_t* * it will not have the possibility to advance the file * pointer, because it will not know how many bytes it needs * to consume. This is why we handle such situation here - * autmatically. */ + * automatically. */ if(ARCHIVE_OK != consume(a, 1 + i)) { return 0; } @@ -918,7 +919,7 @@ static int read_var_sized(struct archive_read* a, size size_t* pvalue_len) { uint64_t v; - uint64_t v_size; + uint64_t v_size = 0; const int ret = pvalue_len ? read_var(a, &v, &v_size) @@ -1218,7 +1219,7 @@ static int process_head_file_extra(struct archive_read ssize_t extra_data_size) { size_t extra_field_size; - size_t extra_field_id; + size_t extra_field_id = 0; int ret = ARCHIVE_FATAL; size_t var_size; @@ -1288,7 +1289,7 @@ static int process_head_file(struct archive_read* a, s size_t host_os = 0; size_t name_size = 0; uint64_t unpacked_size; - uint32_t mtime = 0, crc; + uint32_t mtime = 0, crc = 0; int c_method = 0, c_version = 0, is_dir; char name_utf8_buf[2048 * 4]; const uint8_t* p; @@ -1522,7 +1523,7 @@ static int process_head_main(struct archive_read* a, s enum MAIN_FLAGS { VOLUME = 0x0001, /* multi-volume archive */ - VOLUME_NUMBER = 0x0002, /* volume number, first vol doesnt have it */ + VOLUME_NUMBER = 0x0002, /* volume number, first vol doesn't have it */ SOLID = 0x0004, /* solid archive */ PROTECT = 0x0008, /* contains Recovery info */ LOCK = 0x0010, /* readonly flag, not used */ @@ -1647,7 +1648,7 @@ static int process_base_block(struct archive_read* a, { struct rar5* rar = get_context(a); uint32_t hdr_crc, computed_crc; - size_t raw_hdr_size, hdr_size_len, hdr_size; + size_t raw_hdr_size = 0, hdr_size_len, hdr_size; size_t header_id = 0; size_t header_flags = 0; const uint8_t* p; @@ -2211,7 +2212,7 @@ static int parse_block_header(struct archive_read* a, return ARCHIVE_OK; } -/* Convinience function used during filter processing. */ +/* Convenience function used during filter processing. */ static int parse_filter_data(struct rar5* rar, const uint8_t* p, uint32_t* filter_data) { @@ -2685,6 +2686,12 @@ static int merge_block(struct archive_read* a, ssize_t cur_block_size = rar5_min(rar->file.bytes_remaining, block_size - partial_offset); + if(cur_block_size == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Encountered block size == 0 during block merge"); + return ARCHIVE_FATAL; + } + if(!read_ahead(a, cur_block_size, &lp)) return ARCHIVE_EOF; @@ -3116,6 +3123,9 @@ static int do_unstore_file(struct archive_read* a, } size_t to_read = rar5_min(rar->file.bytes_remaining, 64 * 1024); + if(to_read == 0) { + return ARCHIVE_EOF; + } if(!read_ahead(a, to_read, &p)) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "I/O error " @@ -3186,7 +3196,7 @@ static int verify_checksums(struct archive_read* a) { * data and discarding the result). */ if(!rar->skip_mode) { - /* Always check checkums if we're not in skip mode */ + /* Always check checksums if we're not in skip mode */ verify_crc = 1; } else { /* We can override the logic above with a compile-time option @@ -3283,9 +3293,14 @@ static int rar5_read_data(struct archive_read *a, cons } ret = use_data(rar, buff, size, offset); - if(ret == ARCHIVE_OK) + if(ret == ARCHIVE_OK) { return ret; + } + if(rar->file.eof == 1) { + return ARCHIVE_EOF; + } + ret = do_unpack(a, rar, buff, size, offset); if(ret != ARCHIVE_OK) { return ret; @@ -3301,6 +3316,7 @@ static int rar5_read_data(struct archive_read *a, cons * value in the last `archive_read_data` call to signal an error * to the user. */ + rar->file.eof = 1; return verify_global_checksums(a); } Modified: head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Sat Nov 24 01:25:45 2018 (r340866) @@ -4899,10 +4899,10 @@ isofile_gen_utility_names(struct archive_write *a, str if (p[0] == '/') { if (p[1] == '/') /* Convert '//' --> '/' */ - strcpy(p, p+1); + memmove(p, p+1, strlen(p+1) + 1); else if (p[1] == '.' && p[2] == '/') /* Convert '/./' --> '/' */ - strcpy(p, p+2); + memmove(p, p+2, strlen(p+2) + 1); else if (p[1] == '.' && p[2] == '.' && p[3] == '/') { /* Convert 'dir/dir1/../dir2/' * --> 'dir/dir2/' Modified: head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c Sat Nov 24 01:25:45 2018 (r340866) @@ -1810,10 +1810,10 @@ mtree_entry_setup_filenames(struct archive_write *a, s if (p[0] == '/') { if (p[1] == '/') /* Convert '//' --> '/' */ - strcpy(p, p+1); + memmove(p, p+1, strlen(p+1) + 1); else if (p[1] == '.' && p[2] == '/') /* Convert '/./' --> '/' */ - strcpy(p, p+2); + memmove(p, p+2, strlen(p+2) + 1); else if (p[1] == '.' && p[2] == '.' && p[3] == '/') { /* Convert 'dir/dir1/../dir2/' * --> 'dir/dir2/' Modified: head/contrib/libarchive/libarchive/archive_write_set_format_pax.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_pax.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_write_set_format_pax.c Sat Nov 24 01:25:45 2018 (r340866) @@ -522,11 +522,13 @@ add_pax_acl(struct archive_write *a, ARCHIVE_ERRNO_FILE_FORMAT, "%s %s %s", "Can't translate ", attr, " to UTF-8"); return(ARCHIVE_WARN); - } else if (*p != '\0') { + } + + if (*p != '\0') { add_pax_attr(&(pax->pax_header), attr, p); - free(p); } + free(p); return(ARCHIVE_OK); } Modified: head/contrib/libarchive/libarchive/archive_write_set_format_xar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_xar.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/archive_write_set_format_xar.c Sat Nov 24 01:25:45 2018 (r340866) @@ -2120,10 +2120,10 @@ file_gen_utility_names(struct archive_write *a, struct if (p[0] == '/') { if (p[1] == '/') /* Convert '//' --> '/' */ - strcpy(p, p+1); + memmove(p, p+1, strlen(p+1) + 1); else if (p[1] == '.' && p[2] == '/') /* Convert '/./' --> '/' */ - strcpy(p, p+2); + memmove(p, p+2, strlen(p+2) + 1); else if (p[1] == '.' && p[2] == '.' && p[3] == '/') { /* Convert 'dir/dir1/../dir2/' * --> 'dir/dir2/' @@ -3169,8 +3169,10 @@ save_xattrs(struct archive_write *a, struct file *file checksum_update(&(xar->a_sumwrk), xar->wbuff, size); if (write_to_temp(a, xar->wbuff, size) - != ARCHIVE_OK) + != ARCHIVE_OK) { + free(heap); return (ARCHIVE_FATAL); + } if (r == ARCHIVE_OK) { xar->stream.next_out = xar->wbuff; xar->stream.avail_out = sizeof(xar->wbuff); Modified: head/contrib/libarchive/libarchive/test/test_fuzz.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_fuzz.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/test/test_fuzz.c Sat Nov 24 01:25:45 2018 (r340866) @@ -433,7 +433,7 @@ DEFINE_TEST(test_fuzz_tar) {0, fileset9}, /* Exercise lzo decompressor. */ #endif #if HAVE_ZSTD_H && HAVE_LIBZSTD - {0, fileset10}, /* Excercise zstd decompressor. */ + {0, fileset10}, /* Exercise zstd decompressor. */ #endif {1, NULL} }; Modified: head/contrib/libarchive/libarchive/test/test_read_format_rar5.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar5.c Sat Nov 24 01:25:45 2018 (r340866) @@ -726,3 +726,44 @@ DEFINE_TEST(test_read_format_rar5_extract_win32) assertA(0 == extract_one(a, ae, 0x36A448FF)); EPILOGUE(); } + +DEFINE_TEST(test_read_format_rar5_block_by_block) +{ + /* This test uses strange buffer sizes intentionally. */ + + struct archive_entry *ae; + struct archive *a; + uint8_t buf[173]; + int bytes_read; + uint32_t computed_crc = 0; + + extract_reference_file("test_read_format_rar5_compressed.rar"); + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_support_filter_all(a)); + assertA(0 == archive_read_support_format_all(a)); + assertA(0 == archive_read_open_filename(a, "test_read_format_rar5_compressed.rar", 130)); + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("test.bin", archive_entry_pathname(ae)); + assertEqualInt(1200, archive_entry_size(ae)); + + /* File size is 1200 bytes, we're reading it using a buffer of 173 bytes. + * Libarchive is configured to use a buffer of 130 bytes. */ + + while(1) { + /* archive_read_data should return one of: + * a) 0, if there is no more data to be read, + * b) negative value, if there was an error, + * c) positive value, meaning how many bytes were read. + */ + + bytes_read = archive_read_data(a, buf, sizeof(buf)); + assertA(bytes_read >= 0); + if(bytes_read <= 0) + break; + + computed_crc = crc32(computed_crc, buf, bytes_read); + } + + assertEqualInt(computed_crc, 0x7CCA70CD); + EPILOGUE(); +} Modified: head/contrib/libarchive/libarchive/test/test_write_disk_perms.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_write_disk_perms.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/libarchive/test/test_write_disk_perms.c Sat Nov 24 01:25:45 2018 (r340866) @@ -203,7 +203,7 @@ DEFINE_TEST(test_write_disk_perms) failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode); assertEqualInt(st.st_mode & 0777, 0744); - /* For dir, the owner should get left when not overwritting. */ + /* For dir, the owner should get left when not overwriting. */ assertMakeDir("dir_owner", 0744); if (getuid() == 0) { Modified: head/contrib/libarchive/tar/write.c ============================================================================== --- head/contrib/libarchive/tar/write.c Sat Nov 24 01:15:08 2018 (r340865) +++ head/contrib/libarchive/tar/write.c Sat Nov 24 01:25:45 2018 (r340866) @@ -540,8 +540,7 @@ write_archive(struct archive *a, struct bsdtar *bsdtar lafe_warnc(archive_errno(disk), "%s", archive_error_string(disk)); bsdtar->return_value = 1; - archive_entry_free(entry); - continue; + goto next_entry; } /* @@ -557,15 +556,14 @@ write_archive(struct archive *a, struct bsdtar *bsdtar "%s", archive_error_string(disk)); if (r == ARCHIVE_FATAL) bsdtar->return_value = 1; - else - archive_read_close(disk); - archive_entry_free(entry); - continue; + archive_read_close(disk); + goto next_entry; } write_file(bsdtar, a, entry); - archive_entry_free(entry); archive_read_close(disk); +next_entry: + archive_entry_free(entry); entry = NULL; archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry); } From owner-svn-src-head@freebsd.org Sat Nov 24 06:49:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AED051143318; Sat, 24 Nov 2018 06:49:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 436C06AFED; Sat, 24 Nov 2018 06:49:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AF3423A2; Sat, 24 Nov 2018 06:49:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAO6nfXT068169; Sat, 24 Nov 2018 06:49:41 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAO6nfCb068168; Sat, 24 Nov 2018 06:49:41 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811240649.wAO6nfCb068168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 24 Nov 2018 06:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340867 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 340867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 436C06AFED X-Spamd-Result: default: False [1.08 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.031,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 06:49:42 -0000 Author: cy Date: Sat Nov 24 06:49:41 2018 New Revision: 340867 URL: https://svnweb.freebsd.org/changeset/base/340867 Log: FreeBSD 7 has been history for many moons. Remove some dead code. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 01:25:45 2018 (r340866) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 06:49:41 2018 (r340867) @@ -57,15 +57,7 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) #include -#else -#define CURVNET_SET(arg) -#define CURVNET_RESTORE() -#define VNET_DEFINE(_t, _v) _t _v -#define VNET_DECLARE(_t, _v) extern _t _v -#define VNET(arg) arg -#endif #if defined(__osf__) # include #endif From owner-svn-src-head@freebsd.org Sat Nov 24 07:16:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD9EE114424C; Sat, 24 Nov 2018 07:16:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FBAB6BE6F; Sat, 24 Nov 2018 07:16:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C019286E; Sat, 24 Nov 2018 07:16:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAO7GjnS083245; Sat, 24 Nov 2018 07:16:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAO7GjCM083244; Sat, 24 Nov 2018 07:16:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811240716.wAO7GjCM083244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 24 Nov 2018 07:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340868 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 340868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FBAB6BE6F X-Spamd-Result: default: False [1.08 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.031,0]; NEURAL_SPAM_LONG(0.40)[0.400,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 07:16:45 -0000 Author: cy Date: Sat Nov 24 07:16:44 2018 New Revision: 340868 URL: https://svnweb.freebsd.org/changeset/base/340868 Log: An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source file. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 06:49:41 2018 (r340867) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 07:16:44 2018 (r340868) @@ -58,9 +58,6 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -#if defined(__osf__) -# include -#endif #include #include #include From owner-svn-src-head@freebsd.org Sat Nov 24 13:28:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A610114ECBF; Sat, 24 Nov 2018 13:28:43 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1014F78625; Sat, 24 Nov 2018 13:28:43 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id F24F5FDAA; Sat, 24 Nov 2018 13:28:42 +0000 (UTC) Date: Sat, 24 Nov 2018 13:28:42 +0000 From: Alexey Dokuchaev To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340702 - in head/lib/csu: amd64 common i386 Message-ID: <20181124132842.GA50931@FreeBSD.org> References: <201811202104.wAKL4KZl030127@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201811202104.wAKL4KZl030127@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 1014F78625 X-Spamd-Result: default: False [1.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.84)[0.836,0]; NEURAL_SPAM_SHORT(0.22)[0.217,0]; NEURAL_SPAM_MEDIUM(0.90)[0.900,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 13:28:43 -0000 On Tue, Nov 20, 2018 at 09:04:20PM +0000, Ed Maste wrote: > New Revision: 340702 > URL: https://svnweb.freebsd.org/changeset/base/340702 > > Log: > csu: use BSD-1-clause license on csu files > > Copyright on these files is held by kib@ and/or the Foundation, > and both agree to this change. Out of curiosity (and in faint hope that maybe one day people would start writing sensible commit logs): may I ask why? ./danfe From owner-svn-src-head@freebsd.org Sat Nov 24 15:22:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB26811515F6; Sat, 24 Nov 2018 15:22:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B3B17C7DE; Sat, 24 Nov 2018 15:22:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36CC57C86; Sat, 24 Nov 2018 15:22:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFMwmm050917; Sat, 24 Nov 2018 15:22:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFMwAX050916; Sat, 24 Nov 2018 15:22:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241522.wAOFMwAX050916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340871 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B3B17C7DE X-Spamd-Result: default: False [1.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.23)[0.227,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:22:58 -0000 Author: arybchik Date: Sat Nov 24 15:22:57 2018 New Revision: 340871 URL: https://svnweb.freebsd.org/changeset/base/340871 Log: sfxge(4): remove assertion on no longer used define MC_CMD_INIT_RXQ_OUT_LEN is not used any more. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18106 Modified: head/sys/dev/sfxge/common/ef10_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 15:10:05 2018 (r340870) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 15:22:57 2018 (r340871) @@ -61,8 +61,6 @@ efx_mcdi_init_rxq( uint32_t dma_mode; boolean_t want_outer_classes; - /* If this changes, then the payload size might need to change. */ - EFSYS_ASSERT3U(MC_CMD_INIT_RXQ_OUT_LEN, ==, 0); EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS); if (ps_bufsize > 0) From owner-svn-src-head@freebsd.org Sat Nov 24 15:23:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A75831151617; Sat, 24 Nov 2018 15:23:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9DF7C8BE; Sat, 24 Nov 2018 15:23:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F244A7C87; Sat, 24 Nov 2018 15:23:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFNAMs050993; Sat, 24 Nov 2018 15:23:10 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFNAQP050988; Sat, 24 Nov 2018 15:23:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241523.wAOFNAQP050988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340872 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D9DF7C8BE X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.216,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:23:11 -0000 Author: arybchik Date: Sat Nov 24 15:23:09 2018 New Revision: 340872 URL: https://svnweb.freebsd.org/changeset/base/340872 Log: sfxge(4): improve names for EVQ descriptor counts Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18107 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_ev.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 15:22:57 2018 (r340871) +++ head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 15:23:09 2018 (r340872) @@ -466,7 +466,7 @@ ef10_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, @@ -480,7 +480,8 @@ ef10_ev_qcreate( EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MAXNEVS)); EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MINNEVS)); - if (!ISP2(n) || (n < EFX_EVQ_MINNEVS) || (n > EFX_EVQ_MAXNEVS)) { + if (!ISP2(ndescs) || + (ndescs < EFX_EVQ_MINNEVS) || (ndescs > EFX_EVQ_MAXNEVS)) { rc = EINVAL; goto fail1; } @@ -529,7 +530,8 @@ ef10_ev_qcreate( * it will choose the best settings for low latency, otherwise * it will choose the best settings for throughput. */ - rc = efx_mcdi_init_evq_v2(enp, index, esmp, n, irq, us, flags); + rc = efx_mcdi_init_evq_v2(enp, index, esmp, ndescs, irq, us, + flags); if (rc != 0) goto fail4; } else { @@ -545,7 +547,7 @@ ef10_ev_qcreate( * to choose it.) */ boolean_t low_latency = encp->enc_datapath_cap_evb ? 0 : 1; - rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us, flags, + rc = efx_mcdi_init_evq(enp, index, esmp, ndescs, irq, us, flags, low_latency); if (rc != 0) goto fail5; Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:22:57 2018 (r340871) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:23:09 2018 (r340872) @@ -82,7 +82,7 @@ ef10_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:22:57 2018 (r340871) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:09 2018 (r340872) @@ -1638,7 +1638,7 @@ efx_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 15:22:57 2018 (r340871) +++ head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 15:23:09 2018 (r340872) @@ -70,7 +70,7 @@ siena_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, @@ -221,7 +221,7 @@ efx_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, @@ -261,7 +261,7 @@ efx_ev_qcreate( eep->ee_magic = EFX_EVQ_MAGIC; eep->ee_enp = enp; eep->ee_index = index; - eep->ee_mask = n - 1; + eep->ee_mask = ndescs - 1; eep->ee_flags = flags; eep->ee_esmp = esmp; @@ -276,7 +276,7 @@ efx_ev_qcreate( enp->en_ev_qcount++; *eepp = eep; - if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, us, flags, + if ((rc = eevop->eevo_qcreate(enp, index, esmp, ndescs, id, us, flags, eep)) != 0) goto fail4; @@ -1286,7 +1286,7 @@ siena_ev_qcreate( __in efx_nic_t *enp, __in unsigned int index, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint32_t us, __in uint32_t flags, @@ -1303,7 +1303,8 @@ siena_ev_qcreate( EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MAXNEVS)); EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MINNEVS)); - if (!ISP2(n) || (n < EFX_EVQ_MINNEVS) || (n > EFX_EVQ_MAXNEVS)) { + if (!ISP2(ndescs) || + (ndescs < EFX_EVQ_MINNEVS) || (ndescs > EFX_EVQ_MAXNEVS)) { rc = EINVAL; goto fail1; } @@ -1320,7 +1321,7 @@ siena_ev_qcreate( #endif for (size = 0; (1 << size) <= (EFX_EVQ_MAXNEVS / EFX_EVQ_MINNEVS); size++) - if ((1 << size) == (int)(n / EFX_EVQ_MINNEVS)) + if ((1 << size) == (int)(ndescs / EFX_EVQ_MINNEVS)) break; if (id + (1 << size) >= encp->enc_buftbl_limit) { rc = EINVAL; From owner-svn-src-head@freebsd.org Sat Nov 24 15:23:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE6541151641; Sat, 24 Nov 2018 15:23:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6141F7C9E3; Sat, 24 Nov 2018 15:23:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50E427C88; Sat, 24 Nov 2018 15:23:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFNNbo051061; Sat, 24 Nov 2018 15:23:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFNMeu051057; Sat, 24 Nov 2018 15:23:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241523.wAOFNMeu051057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340873 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6141F7C9E3 X-Spamd-Result: default: False [1.63 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.21)[0.205,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:23:26 -0000 Author: arybchik Date: Sat Nov 24 15:23:22 2018 New Revision: 340873 URL: https://svnweb.freebsd.org/changeset/base/340873 Log: sfxge(4): improve names for RXQ descriptor counts Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18108 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:23:09 2018 (r340872) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:23:22 2018 (r340873) @@ -956,14 +956,14 @@ ef10_rx_prefix_pktlen( __in uint8_t *buffer, __out uint16_t *lengthp); -extern void +extern void ef10_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added); + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added); extern void ef10_rx_qpush( @@ -986,7 +986,7 @@ ef10_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __in efx_rxq_t *erp); Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 15:23:09 2018 (r340872) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 15:23:22 2018 (r340873) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); static __checkReturn efx_rc_t efx_mcdi_init_rxq( __in efx_nic_t *enp, - __in uint32_t size, + __in uint32_t ndescs, __in uint32_t target_evq, __in uint32_t label, __in uint32_t instance, @@ -53,7 +53,7 @@ efx_mcdi_init_rxq( efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_INIT_RXQ_EXT_IN_LEN, MC_CMD_INIT_RXQ_EXT_OUT_LEN)]; - int npages = EFX_RXQ_NBUFS(size); + int npages = EFX_RXQ_NBUFS(ndescs); int i; efx_qword_t *dma_addr; uint64_t addr; @@ -61,7 +61,7 @@ efx_mcdi_init_rxq( uint32_t dma_mode; boolean_t want_outer_classes; - EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS); + EFSYS_ASSERT3U(ndescs, <=, EFX_RXQ_MAXNDESCS); if (ps_bufsize > 0) dma_mode = MC_CMD_INIT_RXQ_EXT_IN_PACKED_STREAM; @@ -94,7 +94,7 @@ efx_mcdi_init_rxq( req.emr_out_buf = payload; req.emr_out_length = MC_CMD_INIT_RXQ_EXT_OUT_LEN; - MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_SIZE, size); + MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_SIZE, ndescs); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_TARGET_EVQ, target_evq); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_RXQ_EXT_IN_INSTANCE, instance); @@ -738,14 +738,14 @@ ef10_rx_prefix_hash( #define EFX_RXQ_PACKED_STREAM_FAKE_BUF_SIZE 32 #endif - void + void ef10_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added) + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added) { efx_qword_t qword; unsigned int i; @@ -762,11 +762,11 @@ ef10_rx_qpost( #endif /* The client driver must not overfill the queue */ - EFSYS_ASSERT3U(added - completed + n, <=, + EFSYS_ASSERT3U(added - completed + ndescs, <=, EFX_RXQ_LIMIT(erp->er_mask + 1)); id = added & (erp->er_mask); - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { EFSYS_PROBE4(rx_post, unsigned int, erp->er_index, unsigned int, id, efsys_dma_addr_t, addrp[i], size_t, size); @@ -944,7 +944,7 @@ ef10_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __in efx_rxq_t *erp) @@ -963,7 +963,8 @@ ef10_rx_qcreate( EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MAXNDESCS)); EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MINNDESCS)); - if (!ISP2(n) || (n < EFX_RXQ_MINNDESCS) || (n > EFX_RXQ_MAXNDESCS)) { + if (!ISP2(ndescs) || + (ndescs < EFX_RXQ_MINNDESCS) || (ndescs > EFX_RXQ_MAXNDESCS)) { rc = EINVAL; goto fail1; } @@ -1023,7 +1024,7 @@ ef10_rx_qcreate( else disable_scatter = encp->enc_rx_disable_scatter_supported; - if ((rc = efx_mcdi_init_rxq(enp, n, eep->ee_index, label, index, + if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep->ee_index, label, index, esmp, disable_scatter, ps_buf_size)) != 0) goto fail6; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:09 2018 (r340872) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:22 2018 (r340873) @@ -2018,7 +2018,7 @@ efx_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp); @@ -2033,14 +2033,14 @@ typedef struct efx_desc_s { efx_qword_t ed_eq; } efx_desc_t; -extern void +extern void efx_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added); + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added); extern void efx_rx_qpush( Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 15:23:09 2018 (r340872) +++ head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 15:23:22 2018 (r340873) @@ -91,14 +91,14 @@ siena_rx_prefix_pktlen( __in uint8_t *buffer, __out uint16_t *lengthp); -static void +static void siena_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added); + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added); static void siena_rx_qpush( @@ -137,7 +137,7 @@ siena_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __in efx_rxq_t *erp); @@ -517,21 +517,21 @@ fail1: } #endif /* EFSYS_OPT_RX_SCALE */ - void + void efx_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added) + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added) { efx_nic_t *enp = erp->er_enp; const efx_rx_ops_t *erxop = enp->en_erxop; EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC); - erxop->erxo_qpost(erp, addrp, size, n, completed, added); + erxop->erxo_qpost(erp, addrp, size, ndescs, completed, added); } #if EFSYS_OPT_RX_PACKED_STREAM @@ -622,7 +622,7 @@ efx_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp) @@ -645,10 +645,10 @@ efx_rx_qcreate( erp->er_magic = EFX_RXQ_MAGIC; erp->er_enp = enp; erp->er_index = index; - erp->er_mask = n - 1; + erp->er_mask = ndescs - 1; erp->er_esmp = esmp; - if ((rc = erxop->erxo_qcreate(enp, index, label, type, esmp, n, id, + if ((rc = erxop->erxo_qcreate(enp, index, label, type, esmp, ndescs, id, eep, erp)) != 0) goto fail2; @@ -1168,14 +1168,14 @@ siena_rx_prefix_pktlen( } -static void +static void siena_rx_qpost( - __in efx_rxq_t *erp, - __in_ecount(n) efsys_dma_addr_t *addrp, - __in size_t size, - __in unsigned int n, - __in unsigned int completed, - __in unsigned int added) + __in efx_rxq_t *erp, + __in_ecount(ndescs) efsys_dma_addr_t *addrp, + __in size_t size, + __in unsigned int ndescs, + __in unsigned int completed, + __in unsigned int added) { efx_qword_t qword; unsigned int i; @@ -1183,11 +1183,11 @@ siena_rx_qpost( unsigned int id; /* The client driver must not overfill the queue */ - EFSYS_ASSERT3U(added - completed + n, <=, + EFSYS_ASSERT3U(added - completed + ndescs, <=, EFX_RXQ_LIMIT(erp->er_mask + 1)); id = added & (erp->er_mask); - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { EFSYS_PROBE4(rx_post, unsigned int, erp->er_index, unsigned int, id, efsys_dma_addr_t, addrp[i], size_t, size); @@ -1309,7 +1309,7 @@ siena_rx_qcreate( __in unsigned int label, __in efx_rxq_type_t type, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in efx_evq_t *eep, __in efx_rxq_t *erp) @@ -1330,7 +1330,8 @@ siena_rx_qcreate( EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MAXNDESCS)); EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MINNDESCS)); - if (!ISP2(n) || (n < EFX_RXQ_MINNDESCS) || (n > EFX_RXQ_MAXNDESCS)) { + if (!ISP2(ndescs) || + (ndescs < EFX_RXQ_MINNDESCS) || (ndescs > EFX_RXQ_MAXNDESCS)) { rc = EINVAL; goto fail1; } @@ -1340,7 +1341,7 @@ siena_rx_qcreate( } for (size = 0; (1 << size) <= (EFX_RXQ_MAXNDESCS / EFX_RXQ_MINNDESCS); size++) - if ((1 << size) == (int)(n / EFX_RXQ_MINNDESCS)) + if ((1 << size) == (int)(ndescs / EFX_RXQ_MINNDESCS)) break; if (id + (1 << size) >= encp->enc_buftbl_limit) { rc = EINVAL; From owner-svn-src-head@freebsd.org Sat Nov 24 15:23:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC0341151680; Sat, 24 Nov 2018 15:23:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 905857CAE8; Sat, 24 Nov 2018 15:23:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66B5D7C92; Sat, 24 Nov 2018 15:23:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFNZ99051129; Sat, 24 Nov 2018 15:23:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFNYPm051126; Sat, 24 Nov 2018 15:23:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241523.wAOFNYPm051126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340874 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 905857CAE8 X-Spamd-Result: default: False [1.63 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.21)[0.205,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:23:38 -0000 Author: arybchik Date: Sat Nov 24 15:23:34 2018 New Revision: 340874 URL: https://svnweb.freebsd.org/changeset/base/340874 Log: sfxge(4): improve names for TXQ descriptor counts Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18109 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_tx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:23:22 2018 (r340873) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:23:34 2018 (r340874) @@ -670,7 +670,7 @@ ef10_tx_qcreate( __in unsigned int index, __in unsigned int label, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint16_t flags, __in efx_evq_t *eep, @@ -681,13 +681,13 @@ extern void ef10_tx_qdestroy( __in efx_txq_t *etp); -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t ef10_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp); + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *ebp, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp); extern void ef10_tx_qpush( Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Sat Nov 24 15:23:22 2018 (r340873) +++ head/sys/dev/sfxge/common/ef10_tx.c Sat Nov 24 15:23:34 2018 (r340874) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); static __checkReturn efx_rc_t efx_mcdi_init_txq( __in efx_nic_t *enp, - __in uint32_t size, + __in uint32_t ndescs, __in uint32_t target_evq, __in uint32_t label, __in uint32_t instance, @@ -69,7 +69,7 @@ efx_mcdi_init_txq( EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >= EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs)); - npages = EFX_TXQ_NBUFS(size); + npages = EFX_TXQ_NBUFS(ndescs); if (MC_CMD_INIT_TXQ_IN_LEN(npages) > sizeof (payload)) { rc = EINVAL; goto fail1; @@ -82,7 +82,7 @@ efx_mcdi_init_txq( req.emr_out_buf = payload; req.emr_out_length = MC_CMD_INIT_TXQ_OUT_LEN; - MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_SIZE, size); + MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_SIZE, ndescs); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_TARGET_EVQ, target_evq); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance); @@ -194,7 +194,7 @@ ef10_tx_qcreate( __in unsigned int index, __in unsigned int label, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint16_t flags, __in efx_evq_t *eep, @@ -215,8 +215,8 @@ ef10_tx_qcreate( goto fail1; } - if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags, - esmp)) != 0) + if ((rc = efx_mcdi_init_txq(enp, ndescs, eep->ee_index, label, index, + flags, esmp)) != 0) goto fail2; /* @@ -436,24 +436,24 @@ fail1: return (rc); } - __checkReturn efx_rc_t + __checkReturn efx_rc_t ef10_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *eb, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { unsigned int added = *addedp; unsigned int i; efx_rc_t rc; - if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) { + if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) { rc = ENOSPC; goto fail1; } - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { efx_buffer_t *ebp = &eb[i]; efsys_dma_addr_t addr = ebp->eb_addr; size_t size = ebp->eb_size; @@ -559,24 +559,24 @@ ef10_tx_qpush( } } - __checkReturn efx_rc_t + __checkReturn efx_rc_t ef10_tx_qdesc_post( - __in efx_txq_t *etp, - __in_ecount(n) efx_desc_t *ed, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_desc_t *ed, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { unsigned int added = *addedp; unsigned int i; efx_rc_t rc; - if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) { + if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) { rc = ENOSPC; goto fail1; } - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { efx_desc_t *edp = &ed[i]; unsigned int id; size_t offset; @@ -588,7 +588,7 @@ ef10_tx_qdesc_post( } EFSYS_PROBE3(tx_desc_post, unsigned int, etp->et_index, - unsigned int, added, unsigned int, n); + unsigned int, added, unsigned int, ndescs); EFX_TX_QSTAT_INCR(etp, TX_POST); Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:22 2018 (r340873) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:34 2018 (r340874) @@ -2130,13 +2130,13 @@ efx_tx_qcreate( __deref_out efx_txq_t **etpp, __out unsigned int *addedp); -extern __checkReturn efx_rc_t +extern __checkReturn efx_rc_t efx_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp); + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *eb, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp); extern __checkReturn efx_rc_t efx_tx_qpace( Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Sat Nov 24 15:23:22 2018 (r340873) +++ head/sys/dev/sfxge/common/efx_tx.c Sat Nov 24 15:23:34 2018 (r340874) @@ -62,7 +62,7 @@ siena_tx_qcreate( __in unsigned int index, __in unsigned int label, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint16_t flags, __in efx_evq_t *eep, @@ -73,13 +73,13 @@ static void siena_tx_qdestroy( __in efx_txq_t *etp); -static __checkReturn efx_rc_t +static __checkReturn efx_rc_t siena_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp); + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *eb, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp); static void siena_tx_qpush( @@ -100,13 +100,13 @@ static void siena_tx_qenable( __in efx_txq_t *etp); - __checkReturn efx_rc_t + __checkReturn efx_rc_t siena_tx_qdesc_post( - __in efx_txq_t *etp, - __in_ecount(n) efx_desc_t *ed, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp); + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_desc_t *ed, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp); void siena_tx_qdesc_dma_create( @@ -295,7 +295,7 @@ efx_tx_qcreate( __in unsigned int index, __in unsigned int label, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint16_t flags, __in efx_evq_t *eep, @@ -323,14 +323,14 @@ efx_tx_qcreate( etp->et_magic = EFX_TXQ_MAGIC; etp->et_enp = enp; etp->et_index = index; - etp->et_mask = n - 1; + etp->et_mask = ndescs - 1; etp->et_esmp = esmp; /* Initial descriptor index may be modified by etxo_qcreate */ *addedp = 0; if ((rc = etxop->etxo_qcreate(enp, index, label, esmp, - n, id, flags, eep, etp, addedp)) != 0) + ndescs, id, flags, eep, etp, addedp)) != 0) goto fail2; enp->en_tx_qcount++; @@ -364,13 +364,13 @@ efx_tx_qdestroy( EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_txq_t), etp); } - __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *eb, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { efx_nic_t *enp = etp->et_enp; const efx_tx_ops_t *etxop = enp->en_etxop; @@ -378,8 +378,7 @@ efx_tx_qpost( EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); - if ((rc = etxop->etxo_qpost(etp, eb, - n, completed, addedp)) != 0) + if ((rc = etxop->etxo_qpost(etp, eb, ndescs, completed, addedp)) != 0) goto fail1; return (0); @@ -555,13 +554,13 @@ fail1: return (rc); } - __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_tx_qdesc_post( - __in efx_txq_t *etp, - __in_ecount(n) efx_desc_t *ed, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_desc_t *ed, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { efx_nic_t *enp = etp->et_enp; const efx_tx_ops_t *etxop = enp->en_etxop; @@ -570,7 +569,7 @@ efx_tx_qdesc_post( EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); if ((rc = etxop->etxo_qdesc_post(etp, ed, - n, completed, addedp)) != 0) + ndescs, completed, addedp)) != 0) goto fail1; return (0); @@ -729,22 +728,22 @@ siena_tx_init( _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) -static __checkReturn efx_rc_t +static __checkReturn efx_rc_t siena_tx_qpost( - __in efx_txq_t *etp, - __in_ecount(n) efx_buffer_t *eb, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_buffer_t *eb, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { unsigned int added = *addedp; unsigned int i; int rc = ENOSPC; - if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) + if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) goto fail1; - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { efx_buffer_t *ebp = &eb[i]; efsys_dma_addr_t start = ebp->eb_addr; size_t size = ebp->eb_size; @@ -895,7 +894,7 @@ siena_tx_qcreate( __in unsigned int index, __in unsigned int label, __in efsys_mem_t *esmp, - __in size_t n, + __in size_t ndescs, __in uint32_t id, __in uint16_t flags, __in efx_evq_t *eep, @@ -917,7 +916,8 @@ siena_tx_qcreate( EFSYS_ASSERT(ISP2(encp->enc_txq_max_ndescs)); EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS)); - if (!ISP2(n) || (n < EFX_TXQ_MINNDESCS) || (n > EFX_EVQ_MAXNEVS)) { + if (!ISP2(ndescs) || + (ndescs < EFX_TXQ_MINNDESCS) || (ndescs > EFX_EVQ_MAXNEVS)) { rc = EINVAL; goto fail1; } @@ -928,7 +928,7 @@ siena_tx_qcreate( for (size = 0; (1 << size) <= (int)(encp->enc_txq_max_ndescs / EFX_TXQ_MINNDESCS); size++) - if ((1 << size) == (int)(n / EFX_TXQ_MINNDESCS)) + if ((1 << size) == (int)(ndescs / EFX_TXQ_MINNDESCS)) break; if (id + (1 << size) >= encp->enc_buftbl_limit) { rc = EINVAL; @@ -975,24 +975,24 @@ fail1: return (rc); } - __checkReturn efx_rc_t + __checkReturn efx_rc_t siena_tx_qdesc_post( - __in efx_txq_t *etp, - __in_ecount(n) efx_desc_t *ed, - __in unsigned int n, - __in unsigned int completed, - __inout unsigned int *addedp) + __in efx_txq_t *etp, + __in_ecount(ndescs) efx_desc_t *ed, + __in unsigned int ndescs, + __in unsigned int completed, + __inout unsigned int *addedp) { unsigned int added = *addedp; unsigned int i; efx_rc_t rc; - if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) { + if (added - completed + ndescs > EFX_TXQ_LIMIT(etp->et_mask + 1)) { rc = ENOSPC; goto fail1; } - for (i = 0; i < n; i++) { + for (i = 0; i < ndescs; i++) { efx_desc_t *edp = &ed[i]; unsigned int id; size_t offset; @@ -1004,7 +1004,7 @@ siena_tx_qdesc_post( } EFSYS_PROBE3(tx_desc_post, unsigned int, etp->et_index, - unsigned int, added, unsigned int, n); + unsigned int, added, unsigned int, ndescs); EFX_TX_QSTAT_INCR(etp, TX_POST); From owner-svn-src-head@freebsd.org Sat Nov 24 15:23:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C521D11516A6; Sat, 24 Nov 2018 15:23:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B4777CBEB; Sat, 24 Nov 2018 15:23:50 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95F637C9B; Sat, 24 Nov 2018 15:23:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFNlaN051200; Sat, 24 Nov 2018 15:23:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFNkiR051196; Sat, 24 Nov 2018 15:23:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241523.wAOFNkiR051196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340875 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B4777CBEB X-Spamd-Result: default: False [1.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.216,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:23:51 -0000 Author: arybchik Date: Sat Nov 24 15:23:46 2018 New Revision: 340875 URL: https://svnweb.freebsd.org/changeset/base/340875 Log: sfxge(4): fix build issue with PHY LED control enabled Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and Medford. Submitted by: Vijay Srivastava Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18110 Modified: head/sys/dev/sfxge/common/ef10_phy.c head/sys/dev/sfxge/common/efx_check.h head/sys/dev/sfxge/common/siena_nic.c head/sys/dev/sfxge/common/siena_phy.c Modified: head/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_phy.c Sat Nov 24 15:23:34 2018 (r340874) +++ head/sys/dev/sfxge/common/ef10_phy.c Sat Nov 24 15:23:46 2018 (r340875) @@ -283,7 +283,9 @@ ef10_phy_reconfigure( uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN, MC_CMD_SET_LINK_OUT_LEN)]; uint32_t cap_mask; +#if EFSYS_OPT_PHY_LED_CONTROL unsigned int led_mode; +#endif unsigned int speed; boolean_t supported; efx_rc_t rc; Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Sat Nov 24 15:23:34 2018 (r340874) +++ head/sys/dev/sfxge/common/efx_check.h Sat Nov 24 15:23:46 2018 (r340875) @@ -226,8 +226,8 @@ /* Support for PHY LED control */ #if EFSYS_OPT_PHY_LED_CONTROL -# if !EFSYS_OPT_SIENA -# error "PHY_LED_CONTROL requires SIENA" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "PHY_LED_CONTROL requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_PHY_LED_CONTROL */ Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 15:23:34 2018 (r340874) +++ head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 15:23:46 2018 (r340875) @@ -195,7 +195,9 @@ static __checkReturn efx_rc_t siena_phy_cfg( __in efx_nic_t *enp) { +#if EFSYS_OPT_PHY_STATS efx_nic_cfg_t *encp = &(enp->en_nic_cfg); +#endif /* EFSYS_OPT_PHY_STATS */ efx_rc_t rc; /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ Modified: head/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- head/sys/dev/sfxge/common/siena_phy.c Sat Nov 24 15:23:34 2018 (r340874) +++ head/sys/dev/sfxge/common/siena_phy.c Sat Nov 24 15:23:46 2018 (r340875) @@ -278,7 +278,9 @@ siena_phy_reconfigure( MAX(MC_CMD_SET_LINK_IN_LEN, MC_CMD_SET_LINK_OUT_LEN))]; uint32_t cap_mask; +#if EFSYS_OPT_PHY_LED_CONTROL unsigned int led_mode; +#endif unsigned int speed; efx_rc_t rc; From owner-svn-src-head@freebsd.org Sat Nov 24 15:24:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8098D11516E3; Sat, 24 Nov 2018 15:24:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 231687CD44; Sat, 24 Nov 2018 15:24:04 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7795E7CA0; Sat, 24 Nov 2018 15:23:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFNxJb051268; Sat, 24 Nov 2018 15:23:59 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFNwUE051266; Sat, 24 Nov 2018 15:23:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241523.wAOFNwUE051266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340876 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 231687CD44 X-Spamd-Result: default: False [1.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.227,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:24:04 -0000 Author: arybchik Date: Sat Nov 24 15:23:58 2018 New Revision: 340876 URL: https://svnweb.freebsd.org/changeset/base/340876 Log: sfxge(4): move Siena-specific defs to right header Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18111 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/siena_impl.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:46 2018 (r340875) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:58 2018 (r340876) @@ -2107,7 +2107,6 @@ efx_tx_fini( #define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) #define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) #define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) -#define EFX_TXQ_DC_NDESCS(_dcsize) (8 << _dcsize) #define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 15:23:46 2018 (r340875) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 15:23:58 2018 (r340876) @@ -362,12 +362,7 @@ typedef struct efx_nic_ops_s { #ifndef EFX_RXQ_LIMIT_TARGET #define EFX_RXQ_LIMIT_TARGET 512 #endif -#ifndef EFX_TXQ_DC_SIZE -#define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */ -#endif -#ifndef EFX_RXQ_DC_SIZE -#define EFX_RXQ_DC_SIZE 3 /* 64 descriptors */ -#endif + #if EFSYS_OPT_FILTER Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Sat Nov 24 15:23:46 2018 (r340875) +++ head/sys/dev/sfxge/common/siena_impl.h Sat Nov 24 15:23:58 2018 (r340876) @@ -44,7 +44,16 @@ extern "C" { #endif +#ifndef EFX_TXQ_DC_SIZE +#define EFX_TXQ_DC_SIZE 1 /* 16 descriptors */ +#endif +#ifndef EFX_RXQ_DC_SIZE +#define EFX_RXQ_DC_SIZE 3 /* 64 descriptors */ +#endif +#define EFX_TXQ_DC_NDESCS(_dcsize) (8 << (_dcsize)) + #define SIENA_NVRAM_CHUNK 0x80 + extern __checkReturn efx_rc_t siena_nic_probe( From owner-svn-src-head@freebsd.org Sat Nov 24 15:24:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 442821151723; Sat, 24 Nov 2018 15:24:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD36E7CE5E; Sat, 24 Nov 2018 15:24:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07DC87CA5; Sat, 24 Nov 2018 15:24:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFOCv5051343; Sat, 24 Nov 2018 15:24:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFOCoD051339; Sat, 24 Nov 2018 15:24:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241524.wAOFOCoD051339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340877 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD36E7CE5E X-Spamd-Result: default: False [1.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.227,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:24:17 -0000 Author: arybchik Date: Sat Nov 24 15:24:12 2018 New Revision: 340877 URL: https://svnweb.freebsd.org/changeset/base/340877 Log: sfxge(4): add new sensors Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18112 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mon.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:23:58 2018 (r340876) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:24:12 2018 (r340877) @@ -631,7 +631,7 @@ efx_mon_init( #define EFX_MON_STATS_PAGE_SIZE 0x100 #define EFX_MON_MASK_ELEMENT_SIZE 32 -/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 5d4ee5185e419abe */ +/* START MKCONFIG GENERATED MonitorHeaderStatsBlock aa0233c80156308e */ typedef enum efx_mon_stat_e { EFX_MON_STAT_2_5V, EFX_MON_STAT_VCCP1, @@ -710,6 +710,8 @@ typedef enum efx_mon_stat_e { EFX_MON_STAT_CONTROLLER_TDIODE_TEMP, EFX_MON_STAT_BOARD_FRONT_TEMP, EFX_MON_STAT_BOARD_BACK_TEMP, + EFX_MON_STAT_I1V8, + EFX_MON_STAT_I2V5, EFX_MON_NSTATS } efx_mon_stat_t; Modified: head/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Sat Nov 24 15:23:58 2018 (r340876) +++ head/sys/dev/sfxge/common/efx_mon.c Sat Nov 24 15:24:12 2018 (r340877) @@ -128,7 +128,7 @@ fail1: #if EFSYS_OPT_NAMES -/* START MKCONFIG GENERATED MonitorStatNamesBlock 5daa2a5725ba734b */ +/* START MKCONFIG GENERATED MonitorStatNamesBlock d92af1538001301f */ static const char * const __mon_stat_name[] = { "value_2_5v", "value_vccp1", @@ -207,6 +207,8 @@ static const char * const __mon_stat_name[] = { "controller_tdiode_temp", "board_front_temp", "board_back_temp", + "i1v8", + "i2v5", }; /* END MKCONFIG GENERATED MonitorStatNamesBlock */ From owner-svn-src-head@freebsd.org Sat Nov 24 15:24:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B56BB1151762; Sat, 24 Nov 2018 15:24:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C81F7CF2F; Sat, 24 Nov 2018 15:24:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62EAD7CA6; Sat, 24 Nov 2018 15:24:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFOOLm051406; Sat, 24 Nov 2018 15:24:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFOOxN051404; Sat, 24 Nov 2018 15:24:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241524.wAOFOOxN051404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340878 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C81F7CF2F X-Spamd-Result: default: False [1.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.227,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:24:27 -0000 Author: arybchik Date: Sat Nov 24 15:24:23 2018 New Revision: 340878 URL: https://svnweb.freebsd.org/changeset/base/340878 Log: sfxge(4): support new sensors Submitted by: Andrew Jackson Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18113 Modified: head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 15:24:12 2018 (r340877) +++ head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 15:24:23 2018 (r340878) @@ -160,6 +160,8 @@ static const struct mcdi_sensor_map_s { STAT(Px, CONTROLLER_TDIODE_TEMP), /* 0x4e CONTROLLER_TDIODE_TEMP */ STAT(Px, BOARD_FRONT_TEMP), /* 0x4f BOARD_FRONT_TEMP */ STAT(Px, BOARD_BACK_TEMP), /* 0x50 BOARD_BACK_TEMP */ + STAT(Px, I1V8), /* 0x51 IN_I1V8 */ + STAT(Px, I2V5), /* 0x52 IN_I2V5 */ }; #define MCDI_STATIC_SENSOR_ASSERT(_field) \ From owner-svn-src-head@freebsd.org Sat Nov 24 15:24:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0130115179F; Sat, 24 Nov 2018 15:24:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97DF07D031; Sat, 24 Nov 2018 15:24:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B58DF7CAB; Sat, 24 Nov 2018 15:24:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFOZXl051472; Sat, 24 Nov 2018 15:24:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFOZeK051471; Sat, 24 Nov 2018 15:24:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241524.wAOFOZeK051471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340879 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 97DF07D031 X-Spamd-Result: default: False [1.58 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.23)[0.227,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:24:38 -0000 Author: arybchik Date: Sat Nov 24 15:24:35 2018 New Revision: 340879 URL: https://svnweb.freebsd.org/changeset/base/340879 Log: sfxge(4): remove unused defined for WPTR alignment MEDFORD_RX_WPTR_ALIGN is not used. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18114 Modified: head/sys/dev/sfxge/common/medford_impl.h Modified: head/sys/dev/sfxge/common/medford_impl.h ============================================================================== --- head/sys/dev/sfxge/common/medford_impl.h Sat Nov 24 15:24:23 2018 (r340878) +++ head/sys/dev/sfxge/common/medford_impl.h Sat Nov 24 15:24:35 2018 (r340879) @@ -37,14 +37,6 @@ extern "C" { #endif -/* Alignment requirement for value written to RX WPTR: - * the WPTR must be aligned to an 8 descriptor boundary - * - * FIXME: Is this the same on Medford as Huntington? - */ -#define MEDFORD_RX_WPTR_ALIGN 8 - - #ifndef ER_EZ_TX_PIOBUF_SIZE #define ER_EZ_TX_PIOBUF_SIZE 4096 From owner-svn-src-head@freebsd.org Sat Nov 24 15:24:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0654B11517DF; Sat, 24 Nov 2018 15:24:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A61287D1CF; Sat, 24 Nov 2018 15:24:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C9A87CB4; Sat, 24 Nov 2018 15:24:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFOnDa051548; Sat, 24 Nov 2018 15:24:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFOlXg051536; Sat, 24 Nov 2018 15:24:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241524.wAOFOlXg051536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 15:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340880 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A61287D1CF X-Spamd-Result: default: False [1.67 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.71)[0.710,0]; NEURAL_SPAM_SHORT(0.18)[0.185,0]; NEURAL_SPAM_MEDIUM(0.78)[0.776,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:24:54 -0000 Author: arybchik Date: Sat Nov 24 15:24:47 2018 New Revision: 340880 URL: https://svnweb.freebsd.org/changeset/base/340880 Log: sfxge(4): fix coding style Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18115 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/efx_types.h head/sys/dev/sfxge/common/medford_nic.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/ef10_filter.c Sat Nov 24 15:24:47 2018 (r340880) @@ -1246,8 +1246,8 @@ typedef struct ef10_filter_encap_entry_s { uint32_t inner_frame_match; } ef10_filter_encap_entry_t; -#define EF10_ENCAP_FILTER_ENTRY(ipv, encap_type, inner_frame_match) \ - { EFX_ETHER_TYPE_##ipv, EFX_TUNNEL_PROTOCOL_##encap_type, \ +#define EF10_ENCAP_FILTER_ENTRY(ipv, encap_type, inner_frame_match) \ + { EFX_ETHER_TYPE_##ipv, EFX_TUNNEL_PROTOCOL_##encap_type, \ EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_##inner_frame_match } static ef10_filter_encap_entry_t ef10_filter_encap_list[] = { @@ -1308,8 +1308,8 @@ ef10_filter_insert_encap_filters( */ if ((mulcst == B_FALSE) && (encap_filter->inner_frame_match == - EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST)) - continue; + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST)) + continue; efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 15:24:47 2018 (r340880) @@ -52,8 +52,9 @@ extern "C" { */ #define EF10_NVRAM_CHUNK 0x80 -/* Alignment requirement for value written to RX WPTR: - * the WPTR must be aligned to an 8 descriptor boundary +/* + * Alignment requirement for value written to RX WPTR: the WPTR must be aligned + * to an 8 descriptor boundary. */ #define EF10_RX_WPTR_ALIGN 8 @@ -507,8 +508,7 @@ ef10_nvram_buffer_find_item_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ); + __out uint32_t *startp); extern __checkReturn efx_rc_t ef10_nvram_buffer_find_end( @@ -516,8 +516,7 @@ ef10_nvram_buffer_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ); + __out uint32_t *endp); extern __checkReturn __success(return != B_FALSE) boolean_t ef10_nvram_buffer_find_item( @@ -526,8 +525,7 @@ ef10_nvram_buffer_find_item( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); extern __checkReturn efx_rc_t ef10_nvram_buffer_get_item( @@ -539,8 +537,7 @@ ef10_nvram_buffer_get_item( __out_bcount_part(item_max_size, *lengthp) caddr_t itemp, __in size_t item_max_size, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); extern __checkReturn efx_rc_t ef10_nvram_buffer_insert_item( @@ -550,8 +547,7 @@ ef10_nvram_buffer_insert_item( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); extern __checkReturn efx_rc_t ef10_nvram_buffer_delete_item( @@ -560,15 +556,13 @@ ef10_nvram_buffer_delete_item( __in size_t buffer_size, __in uint32_t offset, __in uint32_t length, - __in uint32_t end - ); + __in uint32_t end); extern __checkReturn efx_rc_t ef10_nvram_buffer_finish( __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); #endif /* EFSYS_OPT_NVRAM */ @@ -797,7 +791,7 @@ ef10_tx_qstats_update( typedef uint32_t efx_piobuf_handle_t; -#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1) +#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t)-1) extern __checkReturn efx_rc_t ef10_nic_pio_alloc( @@ -1036,7 +1030,7 @@ typedef struct ef10_filter_entry_s { * IPv4 or IPv6 outer frame, VXLAN, GENEVE or NVGRE packet type, and unicast or * multicast inner frames. */ -#define EFX_EF10_FILTER_ENCAP_FILTERS_MAX 12 +#define EFX_EF10_FILTER_ENCAP_FILTERS_MAX 12 typedef struct ef10_filter_table_s { ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS]; @@ -1203,9 +1197,9 @@ ef10_external_port_mapping( /* Minimum space for packet in packed stream mode */ #define EFX_RX_PACKED_STREAM_MIN_PACKET_SPACE \ P2ROUNDUP(EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE + \ - EFX_MAC_PDU_MIN + \ - EFX_RX_PACKED_STREAM_ALIGNMENT, \ - EFX_RX_PACKED_STREAM_ALIGNMENT) + EFX_MAC_PDU_MIN + \ + EFX_RX_PACKED_STREAM_ALIGNMENT, \ + EFX_RX_PACKED_STREAM_ALIGNMENT) /* Maximum number of credits */ #define EFX_RX_PACKED_STREAM_MAX_CREDITS 127 Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 15:24:47 2018 (r340880) @@ -44,13 +44,13 @@ extern "C" { #endif #define EFX_STATIC_ASSERT(_cond) \ - ((void)sizeof(char[(_cond) ? 1 : -1])) + ((void)sizeof (char[(_cond) ? 1 : -1])) #define EFX_ARRAY_SIZE(_array) \ - (sizeof(_array) / sizeof((_array)[0])) + (sizeof (_array) / sizeof ((_array)[0])) #define EFX_FIELD_OFFSET(_type, _field) \ - ((size_t) &(((_type *)0)->_field)) + ((size_t)&(((_type *)0)->_field)) /* The macro expands divider twice */ #define EFX_DIV_ROUND_UP(_n, _d) (((_n) + (_d) - 1) / (_d)) @@ -562,7 +562,7 @@ efx_mac_stats_get_mask( #define EFX_MAC_STAT_SUPPORTED(_mask, _stat) \ ((_mask)[(_stat) / EFX_MAC_STATS_MASK_BITS_PER_PAGE] & \ - (1ULL << ((_stat) & (EFX_MAC_STATS_MASK_BITS_PER_PAGE - 1)))) + (1ULL << ((_stat) & (EFX_MAC_STATS_MASK_BITS_PER_PAGE - 1)))) #define EFX_MAC_STATS_SIZE 0x400 @@ -912,7 +912,8 @@ typedef enum efx_phy_media_type_e { EFX_PHY_MEDIA_NTYPES } efx_phy_media_type_t; -/* Get the type of medium currently used. If the board has ports for +/* + * Get the type of medium currently used. If the board has ports for * modules, a module is present, and we recognise the media type of * the module, then this will be the media type of the module. * Otherwise it will be the media type of the port. @@ -1013,7 +1014,7 @@ typedef enum efx_bist_type_e { EFX_BIST_TYPE_PHY_CABLE_SHORT, EFX_BIST_TYPE_PHY_CABLE_LONG, EFX_BIST_TYPE_MC_MEM, /* Test the MC DMEM and IMEM */ - EFX_BIST_TYPE_SAT_MEM, /* Test the DMEM and IMEM of satellite cpus*/ + EFX_BIST_TYPE_SAT_MEM, /* Test the DMEM and IMEM of satellite cpus */ EFX_BIST_TYPE_REG, /* Test the register memories */ EFX_BIST_TYPE_NTYPES, } efx_bist_type_t; @@ -1044,8 +1045,10 @@ typedef enum efx_bist_value_e { EFX_BIST_PHY_CABLE_STATUS_C, EFX_BIST_PHY_CABLE_STATUS_D, EFX_BIST_FAULT_CODE, - /* Memory BIST specific values. These match to the MC_CMD_BIST_POLL - * response. */ + /* + * Memory BIST specific values. These match to the MC_CMD_BIST_POLL + * response. + */ EFX_BIST_MEM_TEST, EFX_BIST_MEM_ADDR, EFX_BIST_MEM_BUS, @@ -1797,8 +1800,7 @@ typedef __checkReturn boolean_t typedef __checkReturn boolean_t (*efx_mac_stats_ev_t)( __in_opt void *arg, - __in uint32_t generation - ); + __in uint32_t generation); #endif /* EFSYS_OPT_MAC_STATS */ @@ -2514,8 +2516,7 @@ efx_lic_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ); + __out uint32_t *startp); extern __checkReturn efx_rc_t efx_lic_find_end( @@ -2524,8 +2525,7 @@ efx_lic_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ); + __out uint32_t *endp); extern __checkReturn __success(return != B_FALSE) boolean_t efx_lic_find_key( @@ -2535,15 +2535,13 @@ efx_lic_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); extern __checkReturn __success(return != B_FALSE) boolean_t efx_lic_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ); + __in uint32_t length); extern __checkReturn efx_rc_t efx_lic_read_key( @@ -2556,8 +2554,7 @@ efx_lic_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); extern __checkReturn efx_rc_t efx_lic_write_key( @@ -2568,8 +2565,7 @@ efx_lic_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn efx_rc_t efx_lic_delete_key( @@ -2580,24 +2576,21 @@ efx_lic_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ); + __out uint32_t *deltap); extern __checkReturn efx_rc_t efx_lic_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); extern __checkReturn efx_rc_t efx_lic_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); #endif /* EFSYS_OPT_LICENSING */ Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 15:24:47 2018 (r340880) @@ -1035,8 +1035,7 @@ struct efx_txq_s { do { \ EFX_CHECK_REG((_enp), (_reg)); \ EFSYS_PROBE7(efx_bar_tbl_doorbell_writeo, \ - const char *, \ - #_reg, \ + const char *, #_reg, \ uint32_t, (_index), \ uint32_t, _reg ## _OFST, \ uint32_t, (_eop)->eo_u32[3], \ Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 15:24:47 2018 (r340880) @@ -46,8 +46,7 @@ efx_lic_v1v2_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ); + __out uint32_t *startp); __checkReturn efx_rc_t efx_lic_v1v2_find_end( @@ -56,8 +55,7 @@ efx_lic_v1v2_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ); + __out uint32_t *endp); __checkReturn __success(return != B_FALSE) boolean_t efx_lic_v1v2_find_key( @@ -67,15 +65,13 @@ efx_lic_v1v2_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn __success(return != B_FALSE) boolean_t efx_lic_v1v2_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ); + __in uint32_t length); __checkReturn efx_rc_t efx_lic_v1v2_read_key( @@ -88,8 +84,7 @@ efx_lic_v1v2_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn efx_rc_t efx_lic_v1v2_write_key( @@ -100,8 +95,7 @@ efx_lic_v1v2_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn efx_rc_t efx_lic_v1v2_delete_key( @@ -112,24 +106,21 @@ efx_lic_v1v2_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ); + __out uint32_t *deltap); __checkReturn efx_rc_t efx_lic_v1v2_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); __checkReturn efx_rc_t efx_lic_v1v2_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); #endif /* EFSYS_OPT_HUNTINGTON | EFSYS_OPT_SIENA */ @@ -230,8 +221,7 @@ efx_lic_v3_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ); + __out uint32_t *startp); __checkReturn efx_rc_t efx_lic_v3_find_end( @@ -240,8 +230,7 @@ efx_lic_v3_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ); + __out uint32_t *endp); __checkReturn __success(return != B_FALSE) boolean_t efx_lic_v3_find_key( @@ -251,15 +240,13 @@ efx_lic_v3_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn __success(return != B_FALSE) boolean_t efx_lic_v3_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ); + __in uint32_t length); __checkReturn efx_rc_t efx_lic_v3_read_key( @@ -272,8 +259,7 @@ efx_lic_v3_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn efx_rc_t efx_lic_v3_write_key( @@ -284,8 +270,7 @@ efx_lic_v3_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ); + __out uint32_t *lengthp); __checkReturn efx_rc_t efx_lic_v3_delete_key( @@ -296,31 +281,28 @@ efx_lic_v3_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ); + __out uint32_t *deltap); __checkReturn efx_rc_t efx_lic_v3_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); __checkReturn efx_rc_t efx_lic_v3_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ); + __in size_t buffer_size); static const efx_lic_ops_t __efx_lic_v3_ops = { efx_mcdi_licensing_v3_update_licenses, /* elo_update_licenses */ efx_mcdi_licensing_v3_report_license, /* elo_get_key_stats */ efx_mcdi_licensing_v3_app_state, /* elo_app_state */ efx_mcdi_licensing_v3_get_id, /* elo_get_id */ - efx_lic_v3_find_start, /* elo_find_start*/ + efx_lic_v3_find_start, /* elo_find_start */ efx_lic_v3_find_end, /* elo_find_end */ efx_lic_v3_find_key, /* elo_find_key */ efx_lic_v3_validate_key, /* elo_validate_key */ @@ -455,8 +437,8 @@ fail1: * Length (L): 16bit - value length in bytes * Value (V): L bytes - payload */ -#define EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX (256) -#define EFX_LICENSE_V1V2_HEADER_LENGTH (2 * sizeof(uint16_t)) +#define EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX (256) +#define EFX_LICENSE_V1V2_HEADER_LENGTH (2 * sizeof (uint16_t)) __checkReturn efx_rc_t efx_lic_v1v2_find_start( @@ -464,8 +446,7 @@ efx_lic_v1v2_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ) + __out uint32_t *startp) { _NOTE(ARGUNUSED(enp, bufferp, buffer_size)) @@ -480,8 +461,7 @@ efx_lic_v1v2_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ) + __out uint32_t *endp) { _NOTE(ARGUNUSED(enp, bufferp, buffer_size)) @@ -497,8 +477,7 @@ efx_lic_v1v2_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { boolean_t found; uint16_t tlv_type; @@ -531,8 +510,7 @@ fail1: efx_lic_v1v2_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ) + __in uint32_t length) { uint16_t tlv_type; uint16_t tlv_length; @@ -582,8 +560,7 @@ efx_lic_v1v2_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { efx_rc_t rc; @@ -616,8 +593,7 @@ efx_lic_v1v2_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { efx_rc_t rc; @@ -653,8 +629,7 @@ efx_lic_v1v2_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ) + __out uint32_t *deltap) { uint32_t move_start = offset + length; uint32_t move_length = end - move_start; @@ -675,8 +650,7 @@ efx_lic_v1v2_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { _NOTE(ARGUNUSED(enp)) EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size); @@ -692,8 +666,7 @@ efx_lic_v1v2_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { _NOTE(ARGUNUSED(enp, bufferp, buffer_size)) @@ -1005,7 +978,8 @@ efx_mcdi_licensing_v3_app_state( goto fail1; } - if (req.emr_out_length_used < MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN) { + if (req.emr_out_length_used < + MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN) { rc = EMSGSIZE; goto fail2; } @@ -1055,7 +1029,8 @@ efx_mcdi_licensing_v3_get_id( req.emr_in_buf = bufferp; req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; req.emr_out_buf = bufferp; - req.emr_out_length = MIN(buffer_size, MC_CMD_LICENSING_GET_ID_V3_OUT_LENMAX); + req.emr_out_length = + MIN(buffer_size, MC_CMD_LICENSING_GET_ID_V3_OUT_LENMAX); (void) memset(bufferp, 0, req.emr_out_length); } @@ -1072,12 +1047,14 @@ efx_mcdi_licensing_v3_get_id( } *typep = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_TYPE); - *lengthp = MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH); + *lengthp = + MCDI_OUT_DWORD(req, LICENSING_GET_ID_V3_OUT_LICENSE_ID_LENGTH); if (bufferp == NULL) { - /* modify length requirements to indicate to caller the extra buffering - ** needed to read the complete output. - */ + /* + * Modify length requirements to indicate to caller the extra + * buffering needed to read the complete output. + */ *lengthp += MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN; } else { /* Shift ID down to start of buffer */ @@ -1099,8 +1076,8 @@ fail1: } /* V3 format uses Huntington TLV format partition. See SF-108797-SW */ -#define EFX_LICENSE_V3_KEY_LENGTH_MIN (64) -#define EFX_LICENSE_V3_KEY_LENGTH_MAX (160) +#define EFX_LICENSE_V3_KEY_LENGTH_MIN (64) +#define EFX_LICENSE_V3_KEY_LENGTH_MAX (160) __checkReturn efx_rc_t efx_lic_v3_find_start( @@ -1108,12 +1085,12 @@ efx_lic_v3_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ) + __out uint32_t *startp) { _NOTE(ARGUNUSED(enp)) - return ef10_nvram_buffer_find_item_start(bufferp, buffer_size, startp); + return (ef10_nvram_buffer_find_item_start(bufferp, buffer_size, + startp)); } __checkReturn efx_rc_t @@ -1123,12 +1100,11 @@ efx_lic_v3_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ) + __out uint32_t *endp) { _NOTE(ARGUNUSED(enp)) - return ef10_nvram_buffer_find_end(bufferp, buffer_size, offset, endp); + return (ef10_nvram_buffer_find_end(bufferp, buffer_size, offset, endp)); } __checkReturn __success(return != B_FALSE) boolean_t @@ -1139,8 +1115,7 @@ efx_lic_v3_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { _NOTE(ARGUNUSED(enp)) @@ -1152,8 +1127,7 @@ efx_lic_v3_find_key( efx_lic_v3_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ) + __in uint32_t length) { /* Check key is a valid V3 key */ uint8_t key_type; @@ -1203,8 +1177,7 @@ efx_lic_v3_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { _NOTE(ARGUNUSED(enp)) @@ -1221,8 +1194,7 @@ efx_lic_v3_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { _NOTE(ARGUNUSED(enp)) EFSYS_ASSERT(length <= EFX_LICENSE_V3_KEY_LENGTH_MAX); @@ -1240,8 +1212,7 @@ efx_lic_v3_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ) + __out uint32_t *deltap) { efx_rc_t rc; @@ -1267,8 +1238,7 @@ efx_lic_v3_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { efx_rc_t rc; @@ -1293,8 +1263,7 @@ efx_lic_v3_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { efx_rc_t rc; @@ -1386,7 +1355,7 @@ efx_lic_check_support( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); - return enp->en_licensing_supported; + return (enp->en_licensing_supported); } void @@ -1477,8 +1446,7 @@ efx_lic_get_id( __in size_t buffer_size, __out uint32_t *typep, __out size_t *lengthp, - __out_opt uint8_t *bufferp - ) + __out_opt uint8_t *bufferp) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1501,7 +1469,10 @@ fail1: return (rc); } -/* Buffer management API - abstracts varying TLV format used for License partition */ +/* + * Buffer management API - abstracts varying TLV format used for License + * partition. + */ __checkReturn efx_rc_t efx_lic_find_start( @@ -1509,8 +1480,7 @@ efx_lic_find_start( __in_bcount(buffer_size) caddr_t bufferp, __in size_t buffer_size, - __out uint32_t *startp - ) + __out uint32_t *startp) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1536,8 +1506,7 @@ efx_lic_find_end( caddr_t bufferp, __in size_t buffer_size, __in uint32_t offset, - __out uint32_t *endp - ) + __out uint32_t *endp) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1545,7 +1514,8 @@ efx_lic_find_end( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); - if ((rc = elop->elo_find_end(enp, bufferp, buffer_size, offset, endp)) != 0) + rc = elop->elo_find_end(enp, bufferp, buffer_size, offset, endp); + if (rc != 0) goto fail1; return (0); @@ -1564,8 +1534,7 @@ efx_lic_find_key( __in size_t buffer_size, __in uint32_t offset, __out uint32_t *startp, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { const efx_lic_ops_t *elop = enp->en_elop; @@ -1581,15 +1550,15 @@ efx_lic_find_key( } -/* Validate that the buffer contains a single key in a recognised format. -** An empty or terminator buffer is not accepted as a valid key. -*/ +/* + * Validate that the buffer contains a single key in a recognised format. + * An empty or terminator buffer is not accepted as a valid key. + */ __checkReturn __success(return != B_FALSE) boolean_t efx_lic_validate_key( __in efx_nic_t *enp, __in_bcount(length) caddr_t keyp, - __in uint32_t length - ) + __in uint32_t length) { const efx_lic_ops_t *elop = enp->en_elop; boolean_t rc; @@ -1619,8 +1588,7 @@ efx_lic_read_key( __out_bcount_part(key_max_size, *lengthp) caddr_t keyp, __in size_t key_max_size, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1649,8 +1617,7 @@ efx_lic_write_key( __in uint32_t offset, __in_bcount(length) caddr_t keyp, __in uint32_t length, - __out uint32_t *lengthp - ) + __out uint32_t *lengthp) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1679,8 +1646,7 @@ efx_lic_delete_key( __in uint32_t offset, __in uint32_t length, __in uint32_t end, - __out uint32_t *deltap - ) + __out uint32_t *deltap) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1705,8 +1671,7 @@ efx_lic_create_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; @@ -1731,8 +1696,7 @@ efx_lic_finish_partition( __in efx_nic_t *enp, __in_bcount(buffer_size) caddr_t bufferp, - __in size_t buffer_size - ) + __in size_t buffer_size) { const efx_lic_ops_t *elop = enp->en_elop; efx_rc_t rc; Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx_mcdi.h Sat Nov 24 15:24:47 2018 (r340880) @@ -55,7 +55,7 @@ struct efx_mcdi_req_s { unsigned int emr_cmd; uint8_t *emr_in_buf; size_t emr_in_length; - /* Outputs: retcode, buffer, length, and length used*/ + /* Outputs: retcode, buffer, length, and length used */ efx_rc_t emr_rc; uint8_t *emr_out_buf; size_t emr_out_length; Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 15:24:47 2018 (r340880) @@ -642,9 +642,9 @@ efx_nic_get_fw_version( goto fail2; rc = efx_mcdi_get_capabilities(enp, NULL, - &enfip->enfi_rx_dpcpu_fw_id, - &enfip->enfi_tx_dpcpu_fw_id, - NULL, NULL); + &enfip->enfi_rx_dpcpu_fw_id, + &enfip->enfi_tx_dpcpu_fw_id, + NULL, NULL); if (rc == 0) { enfip->enfi_dpcpu_fw_ids_valid = B_TRUE; } else if (rc == ENOTSUP) { @@ -655,7 +655,8 @@ efx_nic_get_fw_version( goto fail3; } - memcpy(enfip->enfi_mc_fw_version, mc_fw_version, sizeof(mc_fw_version)); + memcpy(enfip->enfi_mc_fw_version, mc_fw_version, + sizeof (mc_fw_version)); return (0); Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/efx_types.h Sat Nov 24 15:24:47 2018 (r340880) @@ -120,7 +120,8 @@ extern "C" { #define EFX_DWORD_3_LBN 96 #define EFX_DWORD_3_WIDTH 32 -/* There are intentionally no EFX_QWORD_0 or EFX_QWORD_1 field definitions +/* + * There are intentionally no EFX_QWORD_0 or EFX_QWORD_1 field definitions * here as the implementaion of EFX_QWORD_FIELD and EFX_OWORD_FIELD do not * support field widths larger than 32 bits. */ Modified: head/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- head/sys/dev/sfxge/common/medford_nic.c Sat Nov 24 15:24:35 2018 (r340879) +++ head/sys/dev/sfxge/common/medford_nic.c Sat Nov 24 15:24:47 2018 (r340880) @@ -181,7 +181,8 @@ medford_board_cfg( if (EFX_PCI_FUNCTION_IS_PF(encp)) { rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); #if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC - /* Disable static config checking for Medford NICs, ONLY + /* + * Disable static config checking for Medford NICs, ONLY * for manufacturing test and setup at the factory, to * allow the static config to be installed. */ From owner-svn-src-head@freebsd.org Sat Nov 24 16:05:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 862411152D97; Sat, 24 Nov 2018 16:05:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29C417F102; Sat, 24 Nov 2018 16:05:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C21010334; Sat, 24 Nov 2018 16:05:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOG5eAp073576; Sat, 24 Nov 2018 16:05:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOG5ejn073575; Sat, 24 Nov 2018 16:05:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811241605.wAOG5ejn073575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 24 Nov 2018 16:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340881 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 340881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 29C417F102 X-Spamd-Result: default: False [1.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.62)[0.625,0]; NEURAL_SPAM_SHORT(0.49)[0.490,0]; NEURAL_SPAM_MEDIUM(0.69)[0.693,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:05:41 -0000 Author: andrew Date: Sat Nov 24 16:05:40 2018 New Revision: 340881 URL: https://svnweb.freebsd.org/changeset/base/340881 Log: Disable the dynamiclib test until a failure can be debugged Modified: head/lib/csu/tests/Makefile Modified: head/lib/csu/tests/Makefile ============================================================================== --- head/lib/csu/tests/Makefile Sat Nov 24 15:24:47 2018 (r340880) +++ head/lib/csu/tests/Makefile Sat Nov 24 16:05:40 2018 (r340881) @@ -2,7 +2,7 @@ SUBDIR= dso TESTS_SUBDIRS= dynamic -TESTS_SUBDIRS+= dynamiclib +#TESTS_SUBDIRS+= dynamiclib TESTS_SUBDIRS+= static .include From owner-svn-src-head@freebsd.org Sat Nov 24 16:29:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC9F1102B3E; Sat, 24 Nov 2018 16:29:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08EE97FFE2; Sat, 24 Nov 2018 16:29:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE4AC1067D; Sat, 24 Nov 2018 16:29:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGTC86085379; Sat, 24 Nov 2018 16:29:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGTCAC085376; Sat, 24 Nov 2018 16:29:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241629.wAOGTCAC085376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340883 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08EE97FFE2 X-Spamd-Result: default: False [1.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.51)[0.507,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:29:13 -0000 Author: arybchik Date: Sat Nov 24 16:29:11 2018 New Revision: 340883 URL: https://svnweb.freebsd.org/changeset/base/340883 Log: sfxge(4): fix diagnostics support build without Siena The compilation failed because __efx_sram_pattern_fns was used in efx_nic.c, but defined in efx_sram.c which is only needed when supporting Siena. To fix it move all the code using __efx_sram_pattern_fns into Siena-specific files (except for the definition in efx_sram.c itself, as that file only needs to be included in Siena-supporting builds anyway). The functions to test registers and tables are unlikely to apply to any new hardware and so can be moved into Siena files. Since Huntington such tests have been implemented in firmware. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18117 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:28:58 2018 (r340882) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:29:11 2018 (r340883) @@ -1141,32 +1141,6 @@ efx_vpd_hunk_set( #endif /* EFSYS_OPT_VPD */ -#if EFSYS_OPT_DIAG - -extern efx_sram_pattern_fn_t __efx_sram_pattern_fns[]; - -typedef struct efx_register_set_s { - unsigned int address; - unsigned int step; - unsigned int rows; - efx_oword_t mask; -} efx_register_set_t; - -extern __checkReturn efx_rc_t -efx_nic_test_registers( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in size_t count); - -extern __checkReturn efx_rc_t -efx_nic_test_tables( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in efx_pattern_type_t pattern, - __in size_t count); - -#endif /* EFSYS_OPT_DIAG */ - #if EFSYS_OPT_MCDI extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 16:28:58 2018 (r340882) +++ head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 16:29:11 2018 (r340883) @@ -694,139 +694,6 @@ fail1: return (rc); } - __checkReturn efx_rc_t -efx_nic_test_registers( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in size_t count) -{ - unsigned int bit; - efx_oword_t original; - efx_oword_t reg; - efx_oword_t buf; - efx_rc_t rc; - - while (count > 0) { - /* This function is only suitable for registers */ - EFSYS_ASSERT(rsp->rows == 1); - - /* bit sweep on and off */ - EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original, - B_TRUE); - for (bit = 0; bit < 128; bit++) { - /* Is this bit in the mask? */ - if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit)) - continue; - - /* Test this bit can be set in isolation */ - reg = original; - EFX_AND_OWORD(reg, rsp->mask); - EFX_SET_OWORD_BIT(reg, bit); - - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, - B_TRUE); - EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, - B_TRUE); - - EFX_AND_OWORD(buf, rsp->mask); - if (memcmp(®, &buf, sizeof (reg))) { - rc = EIO; - goto fail1; - } - - /* Test this bit can be cleared in isolation */ - EFX_OR_OWORD(reg, rsp->mask); - EFX_CLEAR_OWORD_BIT(reg, bit); - - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, - B_TRUE); - EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, - B_TRUE); - - EFX_AND_OWORD(buf, rsp->mask); - if (memcmp(®, &buf, sizeof (reg))) { - rc = EIO; - goto fail2; - } - } - - /* Restore the old value */ - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, - B_TRUE); - - --count; - ++rsp; - } - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - /* Restore the old value */ - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, B_TRUE); - - return (rc); -} - - __checkReturn efx_rc_t -efx_nic_test_tables( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in efx_pattern_type_t pattern, - __in size_t count) -{ - efx_sram_pattern_fn_t func; - unsigned int index; - unsigned int address; - efx_oword_t reg; - efx_oword_t buf; - efx_rc_t rc; - - EFSYS_ASSERT(pattern < EFX_PATTERN_NTYPES); - func = __efx_sram_pattern_fns[pattern]; - - while (count > 0) { - /* Write */ - address = rsp->address; - for (index = 0; index < rsp->rows; ++index) { - func(2 * index + 0, B_FALSE, ®.eo_qword[0]); - func(2 * index + 1, B_FALSE, ®.eo_qword[1]); - EFX_AND_OWORD(reg, rsp->mask); - EFSYS_BAR_WRITEO(enp->en_esbp, address, ®, B_TRUE); - - address += rsp->step; - } - - /* Read */ - address = rsp->address; - for (index = 0; index < rsp->rows; ++index) { - func(2 * index + 0, B_FALSE, ®.eo_qword[0]); - func(2 * index + 1, B_FALSE, ®.eo_qword[1]); - EFX_AND_OWORD(reg, rsp->mask); - EFSYS_BAR_READO(enp->en_esbp, address, &buf, B_TRUE); - if (memcmp(®, &buf, sizeof (reg))) { - rc = EIO; - goto fail1; - } - - address += rsp->step; - } - - ++rsp; - --count; - } - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - #endif /* EFSYS_OPT_DIAG */ #if EFSYS_OPT_LOOPBACK Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Sat Nov 24 16:28:58 2018 (r340882) +++ head/sys/dev/sfxge/common/siena_impl.h Sat Nov 24 16:29:11 2018 (r340883) @@ -69,6 +69,15 @@ siena_nic_init( #if EFSYS_OPT_DIAG +extern efx_sram_pattern_fn_t __efx_sram_pattern_fns[]; + +typedef struct siena_register_set_s { + unsigned int address; + unsigned int step; + unsigned int rows; + efx_oword_t mask; +} siena_register_set_t; + extern __checkReturn efx_rc_t siena_nic_register_test( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 16:28:58 2018 (r340882) +++ head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 16:29:11 2018 (r340883) @@ -462,7 +462,7 @@ siena_nic_unprobe( #if EFSYS_OPT_DIAG -static efx_register_set_t __siena_registers[] = { +static siena_register_set_t __siena_registers[] = { { FR_AZ_ADR_REGION_REG_OFST, 0, 1 }, { FR_CZ_USR_EV_CFG_OFST, 0, 1 }, { FR_AZ_RX_CFG_REG_OFST, 0, 1 }, @@ -494,7 +494,7 @@ static const uint32_t __siena_register_masks[] = { 0xFFFFFFFF, 0xFFFFFFFF, 0x00000007, 0x00000000 }; -static efx_register_set_t __siena_tables[] = { +static siena_register_set_t __siena_tables[] = { { FR_AZ_RX_FILTER_TBL0_OFST, FR_AZ_RX_FILTER_TBL0_STEP, FR_AZ_RX_FILTER_TBL0_ROWS }, { FR_CZ_RX_MAC_FILTER_TBL0_OFST, FR_CZ_RX_MAC_FILTER_TBL0_STEP, @@ -521,10 +521,144 @@ static const uint32_t __siena_table_masks[] = { }; __checkReturn efx_rc_t +siena_nic_test_registers( + __in efx_nic_t *enp, + __in siena_register_set_t *rsp, + __in size_t count) +{ + unsigned int bit; + efx_oword_t original; + efx_oword_t reg; + efx_oword_t buf; + efx_rc_t rc; + + while (count > 0) { + /* This function is only suitable for registers */ + EFSYS_ASSERT(rsp->rows == 1); + + /* bit sweep on and off */ + EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original, + B_TRUE); + for (bit = 0; bit < 128; bit++) { + /* Is this bit in the mask? */ + if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit)) + continue; + + /* Test this bit can be set in isolation */ + reg = original; + EFX_AND_OWORD(reg, rsp->mask); + EFX_SET_OWORD_BIT(reg, bit); + + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, + B_TRUE); + EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, + B_TRUE); + + EFX_AND_OWORD(buf, rsp->mask); + if (memcmp(®, &buf, sizeof (reg))) { + rc = EIO; + goto fail1; + } + + /* Test this bit can be cleared in isolation */ + EFX_OR_OWORD(reg, rsp->mask); + EFX_CLEAR_OWORD_BIT(reg, bit); + + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, + B_TRUE); + EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, + B_TRUE); + + EFX_AND_OWORD(buf, rsp->mask); + if (memcmp(®, &buf, sizeof (reg))) { + rc = EIO; + goto fail2; + } + } + + /* Restore the old value */ + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, + B_TRUE); + + --count; + ++rsp; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + /* Restore the old value */ + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, B_TRUE); + + return (rc); +} + + __checkReturn efx_rc_t +siena_nic_test_tables( + __in efx_nic_t *enp, + __in siena_register_set_t *rsp, + __in efx_pattern_type_t pattern, + __in size_t count) +{ + efx_sram_pattern_fn_t func; + unsigned int index; + unsigned int address; + efx_oword_t reg; + efx_oword_t buf; + efx_rc_t rc; + + EFSYS_ASSERT(pattern < EFX_PATTERN_NTYPES); + func = __efx_sram_pattern_fns[pattern]; + + while (count > 0) { + /* Write */ + address = rsp->address; + for (index = 0; index < rsp->rows; ++index) { + func(2 * index + 0, B_FALSE, ®.eo_qword[0]); + func(2 * index + 1, B_FALSE, ®.eo_qword[1]); + EFX_AND_OWORD(reg, rsp->mask); + EFSYS_BAR_WRITEO(enp->en_esbp, address, ®, B_TRUE); + + address += rsp->step; + } + + /* Read */ + address = rsp->address; + for (index = 0; index < rsp->rows; ++index) { + func(2 * index + 0, B_FALSE, ®.eo_qword[0]); + func(2 * index + 1, B_FALSE, ®.eo_qword[1]); + EFX_AND_OWORD(reg, rsp->mask); + EFSYS_BAR_READO(enp->en_esbp, address, &buf, B_TRUE); + if (memcmp(®, &buf, sizeof (reg))) { + rc = EIO; + goto fail1; + } + + address += rsp->step; + } + + ++rsp; + --count; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + + __checkReturn efx_rc_t siena_nic_register_test( __in efx_nic_t *enp) { - efx_register_set_t *rsp; + siena_register_set_t *rsp; const uint32_t *dwordp; unsigned int nitems; unsigned int count; @@ -558,21 +692,21 @@ siena_nic_register_test( rsp->mask.eo_u32[3] = *dwordp++; } - if ((rc = efx_nic_test_registers(enp, __siena_registers, + if ((rc = siena_nic_test_registers(enp, __siena_registers, EFX_ARRAY_SIZE(__siena_registers))) != 0) goto fail1; - if ((rc = efx_nic_test_tables(enp, __siena_tables, + if ((rc = siena_nic_test_tables(enp, __siena_tables, EFX_PATTERN_BYTE_ALTERNATE, EFX_ARRAY_SIZE(__siena_tables))) != 0) goto fail2; - if ((rc = efx_nic_test_tables(enp, __siena_tables, + if ((rc = siena_nic_test_tables(enp, __siena_tables, EFX_PATTERN_BYTE_CHANGING, EFX_ARRAY_SIZE(__siena_tables))) != 0) goto fail3; - if ((rc = efx_nic_test_tables(enp, __siena_tables, + if ((rc = siena_nic_test_tables(enp, __siena_tables, EFX_PATTERN_BIT_SWEEP, EFX_ARRAY_SIZE(__siena_tables))) != 0) goto fail4; From owner-svn-src-head@freebsd.org Sat Nov 24 16:29:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 415801102BB5; Sat, 24 Nov 2018 16:29:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8E53801B5; Sat, 24 Nov 2018 16:29:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B929E1067F; Sat, 24 Nov 2018 16:29:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGTZjB085510; Sat, 24 Nov 2018 16:29:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGTZKM085508; Sat, 24 Nov 2018 16:29:35 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241629.wAOGTZKM085508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340885 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D8E53801B5 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:29:38 -0000 Author: arybchik Date: Sat Nov 24 16:29:35 2018 New Revision: 340885 URL: https://svnweb.freebsd.org/changeset/base/340885 Log: sfxge(4): fix warnings from VS2015 C compiler (C4310) Fix level 4 warning "C4310: cast truncates constant value"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18119 Modified: head/sys/dev/sfxge/common/efx_bootcfg.c Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Sat Nov 24 16:29:23 2018 (r340884) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Sat Nov 24 16:29:35 2018 (r340885) @@ -361,7 +361,7 @@ efx_bootcfg_read( rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length, &used_bytes); if (rc != 0 || used_bytes == 0) { - payload[0] = (uint8_t)~DHCP_END; + payload[0] = (uint8_t)(~DHCP_END & 0xff); payload[1] = DHCP_END; used_bytes = 2; } From owner-svn-src-head@freebsd.org Sat Nov 24 16:29:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 971771102C0F; Sat, 24 Nov 2018 16:29:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3812880282; Sat, 24 Nov 2018 16:29:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ECA110681; Sat, 24 Nov 2018 16:29:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGTl7M085573; Sat, 24 Nov 2018 16:29:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGTl6H085572; Sat, 24 Nov 2018 16:29:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241629.wAOGTl6H085572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340886 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3812880282 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:29:48 -0000 Author: arybchik Date: Sat Nov 24 16:29:46 2018 New Revision: 340886 URL: https://svnweb.freebsd.org/changeset/base/340886 Log: sfxge(4): fix warnings from VS2015 C compiler (C4244) Fix level 4 warning "C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible loss of data"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18120 Modified: head/sys/dev/sfxge/common/efx_vpd.c Modified: head/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Sat Nov 24 16:29:35 2018 (r340885) +++ head/sys/dev/sfxge/common/efx_vpd.c Sat Nov 24 16:29:46 2018 (r340886) @@ -933,7 +933,7 @@ efx_vpd_hunk_set( } /* Modify tag length (large resource type) */ - taglen += (dest - source); + taglen += (uint16_t)(dest - source); EFX_POPULATE_WORD_1(word, EFX_WORD_0, taglen); data[offset - 2] = EFX_WORD_FIELD(word, EFX_BYTE_0); data[offset - 1] = EFX_WORD_FIELD(word, EFX_BYTE_1); From owner-svn-src-head@freebsd.org Sat Nov 24 16:29:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C2851102B7A; Sat, 24 Nov 2018 16:29:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C5FE8010A; Sat, 24 Nov 2018 16:29:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 784021067E; Sat, 24 Nov 2018 16:29:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGTOX6085444; Sat, 24 Nov 2018 16:29:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGTOSQ085443; Sat, 24 Nov 2018 16:29:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241629.wAOGTOSQ085443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340884 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C5FE8010A X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:29:28 -0000 Author: arybchik Date: Sat Nov 24 16:29:23 2018 New Revision: 340884 URL: https://svnweb.freebsd.org/changeset/base/340884 Log: sfxge(4): fix probes in licensing support EFSYS_PROBE1 takes one typed value (in addition to the probe name), whereas EFSYS_PROBE has just the probe name. Which to use is determined by the probe name - "fail1" probes are expected to include the function result. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18118 Modified: head/sys/dev/sfxge/common/efx_lic.c Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 16:29:11 2018 (r340883) +++ head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 16:29:23 2018 (r340884) @@ -501,7 +501,7 @@ efx_lic_v1v2_find_key( return (found); fail1: - EFSYS_PROBE(fail1); + EFSYS_PROBE1(fail1, boolean_t, B_FALSE); return (B_FALSE); } @@ -543,7 +543,7 @@ fail3: fail2: EFSYS_PROBE(fail2); fail1: - EFSYS_PROBE(fail1); + EFSYS_PROBE1(fail1, boolean_t, B_FALSE); return (B_FALSE); } @@ -1161,7 +1161,7 @@ fail3: fail2: EFSYS_PROBE(fail2); fail1: - EFSYS_PROBE(fail1); + EFSYS_PROBE1(fail1, boolean_t, B_FALSE); return (B_FALSE); } From owner-svn-src-head@freebsd.org Sat Nov 24 16:30:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBB001102CB7; Sat, 24 Nov 2018 16:30:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79A3780505; Sat, 24 Nov 2018 16:30:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73F6210686; Sat, 24 Nov 2018 16:30:11 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGUBvk085746; Sat, 24 Nov 2018 16:30:11 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGUAl6085739; Sat, 24 Nov 2018 16:30:10 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241630.wAOGUAl6085739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340888 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79A3780505 X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:30:14 -0000 Author: arybchik Date: Sat Nov 24 16:30:09 2018 New Revision: 340888 URL: https://svnweb.freebsd.org/changeset/base/340888 Log: sfxge(4): fix warnings from VS2015 C compiler (C4100) Fix multiple level 4 warnings "C4100: 'xxx': unreferenced formal parameter" no functional changes. The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual Studio 2015 C compiler with the following: #define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__)); #define _NOTE(_annotation) _NOTE_ ## _annotation Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18122 Modified: head/sys/dev/sfxge/common/ef10_nvram.c head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/ef10_tx.c head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_lic.c head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nvram.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/ef10_nvram.c Sat Nov 24 16:30:09 2018 (r340888) @@ -675,6 +675,7 @@ ef10_nvram_buffer_validate( int pos; efx_rc_t rc; + _NOTE(ARGUNUSED(enp, partn)) EFX_STATIC_ASSERT(sizeof (*header) <= EF10_NVRAM_CHUNK); if ((partn_data == NULL) || (partn_size == 0)) { @@ -1284,6 +1285,8 @@ ef10_nvram_buf_read_tlv( size_t length; caddr_t value; efx_rc_t rc; + + _NOTE(ARGUNUSED(enp)) if ((seg_data == NULL) || (max_seg_size == 0)) { rc = EINVAL; Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 16:30:09 2018 (r340888) @@ -752,6 +752,8 @@ ef10_rx_qpost( unsigned int offset; unsigned int id; + _NOTE(ARGUNUSED(completed)) + #if EFSYS_OPT_RX_PACKED_STREAM /* * Real size of the buffer does not fit into ESF_DZ_RX_KER_BYTE_CNT Modified: head/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_tx.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/ef10_tx.c Sat Nov 24 16:30:09 2018 (r340888) @@ -609,6 +609,8 @@ ef10_tx_qdesc_dma_create( __in boolean_t eop, __out efx_desc_t *edp) { + _NOTE(ARGUNUSED(etp)) + /* No limitations on boundary crossing */ EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max); @@ -632,6 +634,8 @@ ef10_tx_qdesc_tso_create( __in uint8_t tcp_flags, __out efx_desc_t *edp) { + _NOTE(ARGUNUSED(etp)) + EFSYS_PROBE4(tx_desc_tso_create, unsigned int, etp->et_index, uint16_t, ipv4_id, uint32_t, tcp_seq, uint8_t, tcp_flags); @@ -654,6 +658,8 @@ ef10_tx_qdesc_tso2_create( __out_ecount(count) efx_desc_t *edp, __in int count) { + _NOTE(ARGUNUSED(etp, count)) + EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index, uint16_t, ipv4_id, uint32_t, tcp_seq, uint16_t, tcp_mss); @@ -683,6 +689,8 @@ ef10_tx_qdesc_vlantci_create( __in uint16_t tci, __out efx_desc_t *edp) { + _NOTE(ARGUNUSED(etp)) + EFSYS_PROBE2(tx_desc_vlantci_create, unsigned int, etp->et_index, uint16_t, tci); Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 16:30:09 2018 (r340888) @@ -1422,6 +1422,8 @@ efx_ev_qstat_name( __in efx_nic_t *enp, __in unsigned int id) { + _NOTE(ARGUNUSED(enp)) + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(id, <, EV_NQSTATS); Modified: head/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/efx_lic.c Sat Nov 24 16:30:09 2018 (r340888) @@ -564,7 +564,7 @@ efx_lic_v1v2_read_key( { efx_rc_t rc; - _NOTE(ARGUNUSED(enp)) + _NOTE(ARGUNUSED(enp, buffer_size)) EFSYS_ASSERT(length <= (EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX + EFX_LICENSE_V1V2_HEADER_LENGTH)); @@ -634,7 +634,7 @@ efx_lic_v1v2_delete_key( uint32_t move_start = offset + length; uint32_t move_length = end - move_start; - _NOTE(ARGUNUSED(enp)) + _NOTE(ARGUNUSED(enp, buffer_size)) EFSYS_ASSERT(end <= buffer_size); /* Shift everything after the key down */ @@ -652,7 +652,7 @@ efx_lic_v1v2_create_partition( caddr_t bufferp, __in size_t buffer_size) { - _NOTE(ARGUNUSED(enp)) + _NOTE(ARGUNUSED(enp, buffer_size)) EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size); /* Write terminator */ Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Sat Nov 24 16:29:58 2018 (r340887) +++ head/sys/dev/sfxge/common/efx_mcdi.c Sat Nov 24 16:30:09 2018 (r340888) @@ -814,6 +814,8 @@ efx_mcdi_get_proxy_handle( { efx_rc_t rc; + _NOTE(ARGUNUSED(enp)) + /* * Return proxy handle from MCDI request that returned with error * MC_MCD_ERR_PROXY_PENDING. This handle is used to wait for a matching From owner-svn-src-head@freebsd.org Sat Nov 24 16:30:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 277FE1102D0E; Sat, 24 Nov 2018 16:30:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C118E80627; Sat, 24 Nov 2018 16:30:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3C8D10687; Sat, 24 Nov 2018 16:30:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGUNH7085819; Sat, 24 Nov 2018 16:30:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGUMQL085809; Sat, 24 Nov 2018 16:30:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241630.wAOGUMQL085809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340889 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C118E80627 X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:30:26 -0000 Author: arybchik Date: Sat Nov 24 16:30:22 2018 New Revision: 340889 URL: https://svnweb.freebsd.org/changeset/base/340889 Log: sfxge(4): fix warnings from VS2015 C compiler (C4189) Fix multiple level 4 warnings "C4189: 'xxx': local variable is initialized but not referenced"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18123 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 16:30:09 2018 (r340888) +++ head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 16:30:22 2018 (r340889) @@ -578,7 +578,7 @@ ef10_ev_qdestroy( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - (void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index); + (void) efx_mcdi_fini_evq(enp, eep->ee_index); } __checkReturn efx_rc_t @@ -1349,9 +1349,12 @@ ef10_ev_rxlabel_init( __in efx_rxq_type_t type) { efx_evq_rxq_state_t *eersp; +#if EFSYS_OPT_RX_PACKED_STREAM boolean_t packed_stream = (type >= EFX_RXQ_TYPE_PACKED_STREAM_1M) && (type <= EFX_RXQ_TYPE_PACKED_STREAM_64K); +#endif + _NOTE(ARGUNUSED(type)) EFSYS_ASSERT3U(label, <, EFX_ARRAY_SIZE(eep->ee_rxq_state)); eersp = &eep->ee_rxq_state[label]; @@ -1389,8 +1392,6 @@ ef10_ev_rxlabel_init( EFSYS_ASSERT3U(eersp->eers_rx_packed_stream_credits, <=, EFX_RX_PACKED_STREAM_MAX_CREDITS); } -#else - EFSYS_ASSERT(!packed_stream); #endif } Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 16:30:09 2018 (r340888) +++ head/sys/dev/sfxge/common/efx_ev.c Sat Nov 24 16:30:22 2018 (r340889) @@ -228,14 +228,14 @@ efx_ev_qcreate( __deref_out efx_evq_t **eepp) { const efx_ev_ops_t *eevop = enp->en_eevop; - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_evq_t *eep; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV); - EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, encp->enc_evq_limit); + EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, + enp->en_nic_cfg.enc_evq_limit); switch (flags & EFX_EVQ_FLAGS_NOTIFY_MASK) { case EFX_EVQ_FLAGS_NOTIFY_INTERRUPT: Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Sat Nov 24 16:30:09 2018 (r340888) +++ head/sys/dev/sfxge/common/efx_tx.c Sat Nov 24 16:30:22 2018 (r340889) @@ -303,14 +303,14 @@ efx_tx_qcreate( __out unsigned int *addedp) { const efx_tx_ops_t *etxop = enp->en_etxop; - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_txq_t *etp; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX); - EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit); + EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, + enp->en_nic_cfg.enc_txq_limit); /* Allocate an TXQ object */ EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_txq_t), etp); Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 16:30:09 2018 (r340888) +++ head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 16:30:22 2018 (r340889) @@ -267,7 +267,6 @@ mcdi_mon_ev( __out efx_mon_stat_value_t *valuep) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint16_t port_mask; uint16_t sensor; uint16_t state; @@ -283,11 +282,13 @@ mcdi_mon_ev( value = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_VALUE); /* Hardware must support this MCDI sensor */ - EFSYS_ASSERT3U(sensor, <, (8 * encp->enc_mcdi_sensor_mask_size)); + EFSYS_ASSERT3U(sensor, <, + (8 * enp->en_nic_cfg.enc_mcdi_sensor_mask_size)); EFSYS_ASSERT((sensor % MCDI_MON_PAGE_SIZE) != MC_CMD_SENSOR_PAGE0_NEXT); - EFSYS_ASSERT(encp->enc_mcdi_sensor_maskp != NULL); - EFSYS_ASSERT((encp->enc_mcdi_sensor_maskp[sensor / MCDI_MON_PAGE_SIZE] & - (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0); + EFSYS_ASSERT(enp->en_nic_cfg.enc_mcdi_sensor_maskp != NULL); + EFSYS_ASSERT( + (enp->en_nic_cfg.enc_mcdi_sensor_maskp[sensor/MCDI_MON_PAGE_SIZE] & + (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0); /* But we don't have to understand it */ if (sensor >= EFX_ARRAY_SIZE(mcdi_sensor_map)) { From owner-svn-src-head@freebsd.org Sat Nov 24 16:28:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDE941102AFF; Sat, 24 Nov 2018 16:28:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 816027FEFA; Sat, 24 Nov 2018 16:28:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E4271067B; Sat, 24 Nov 2018 16:28:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGSxF8085301; Sat, 24 Nov 2018 16:28:59 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGSxnL085300; Sat, 24 Nov 2018 16:28:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241628.wAOGSxnL085300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340882 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 816027FEFA X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:29:00 -0000 Author: arybchik Date: Sat Nov 24 16:28:58 2018 New Revision: 340882 URL: https://svnweb.freebsd.org/changeset/base/340882 Log: sfxge(4): allow to use PHY stats on Huntington/Medford EFSYS_OPT_PHY_STATS can be used with Huntington or Medford, not just Siena. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18116 Modified: head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Sat Nov 24 16:05:40 2018 (r340881) +++ head/sys/dev/sfxge/common/efx_check.h Sat Nov 24 16:28:58 2018 (r340882) @@ -261,8 +261,8 @@ /* Support PHY statistics */ #if EFSYS_OPT_PHY_STATS -# if !EFSYS_OPT_SIENA -# error "PHY_STATS requires SIENA" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "PHY_STATS requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_PHY_STATS */ From owner-svn-src-head@freebsd.org Sat Nov 24 16:30:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8963D1102D9A; Sat, 24 Nov 2018 16:30:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2A7A80742; Sat, 24 Nov 2018 16:30:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4272A1068A; Sat, 24 Nov 2018 16:30:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGUZq4086673; Sat, 24 Nov 2018 16:30:35 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGUYSI086671; Sat, 24 Nov 2018 16:30:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241630.wAOGUYSI086671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340890 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F2A7A80742 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:30:38 -0000 Author: arybchik Date: Sat Nov 24 16:30:34 2018 New Revision: 340890 URL: https://svnweb.freebsd.org/changeset/base/340890 Log: sfxge(4): fix warnings from VS2015 C compiler (C4057) Fix two level 4 warnings "C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'caddr_t'"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18124 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_bootcfg.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:30:22 2018 (r340889) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:30:34 2018 (r340890) @@ -1510,13 +1510,13 @@ efx_bootcfg_copy_sector( extern efx_rc_t efx_bootcfg_read( __in efx_nic_t *enp, - __out_bcount(size) caddr_t data, + __out_bcount(size) uint8_t *data, __in size_t size); extern efx_rc_t efx_bootcfg_write( __in efx_nic_t *enp, - __in_bcount(size) caddr_t data, + __in_bcount(size) uint8_t *data, __in size_t size); #endif /* EFSYS_OPT_BOOTCFG */ Modified: head/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Sat Nov 24 16:30:22 2018 (r340889) +++ head/sys/dev/sfxge/common/efx_bootcfg.c Sat Nov 24 16:30:34 2018 (r340890) @@ -295,7 +295,7 @@ fail1: efx_rc_t efx_bootcfg_read( __in efx_nic_t *enp, - __out_bcount(size) caddr_t data, + __out_bcount(size) uint8_t *data, __in size_t size) { uint8_t *payload = NULL; @@ -358,7 +358,7 @@ efx_bootcfg_read( goto fail7; /* Verify that the area is correctly formatted and checksummed */ - rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length, + rc = efx_bootcfg_verify(enp, payload, sector_length, &used_bytes); if (rc != 0 || used_bytes == 0) { payload[0] = (uint8_t)(~DHCP_END & 0xff); @@ -435,7 +435,7 @@ fail1: efx_rc_t efx_bootcfg_write( __in efx_nic_t *enp, - __in_bcount(size) caddr_t data, + __in_bcount(size) uint8_t *data, __in size_t size) { uint8_t *partn_data; From owner-svn-src-head@freebsd.org Sat Nov 24 16:30:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E2B61102E1A; Sat, 24 Nov 2018 16:30:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA14280812; Sat, 24 Nov 2018 16:30:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A271910696; Sat, 24 Nov 2018 16:30:46 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGUkuJ087441; Sat, 24 Nov 2018 16:30:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGUkfR087440; Sat, 24 Nov 2018 16:30:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241630.wAOGUkfR087440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340891 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA14280812 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:30:47 -0000 Author: arybchik Date: Sat Nov 24 16:30:46 2018 New Revision: 340891 URL: https://svnweb.freebsd.org/changeset/base/340891 Log: sfxge(4): fix warnings from VS2015 C compiler (C4214) Fix multiple level 4 warnings "C4214: nonstandard extension used: bit field types other than int"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18125 Modified: head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:30:34 2018 (r340890) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:30:46 2018 (r340891) @@ -2276,7 +2276,7 @@ efx_tx_qdestroy( /* Filter is for TX */ #define EFX_FILTER_FLAG_TX 0x10 -typedef unsigned int efx_filter_flags_t; +typedef uint8_t efx_filter_flags_t; /* * Flags which specify the fields to match on. The values are the same as in the @@ -2333,22 +2333,22 @@ typedef enum efx_filter_priority_s { */ typedef struct efx_filter_spec_s { - uint32_t efs_match_flags; - uint32_t efs_priority:2; - uint32_t efs_flags:6; - uint32_t efs_dmaq_id:12; - uint32_t efs_rss_context; - uint16_t efs_outer_vid; - uint16_t efs_inner_vid; - uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; - uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; - uint16_t efs_ether_type; - uint8_t efs_ip_proto; - efx_tunnel_protocol_t efs_encap_type; - uint16_t efs_loc_port; - uint16_t efs_rem_port; - efx_oword_t efs_rem_host; - efx_oword_t efs_loc_host; + efx_filter_match_flags_t efs_match_flags; + uint8_t efs_priority; + efx_filter_flags_t efs_flags; + uint16_t efs_dmaq_id; + uint32_t efs_rss_context; + uint16_t efs_outer_vid; + uint16_t efs_inner_vid; + uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; + uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; + uint16_t efs_ether_type; + uint8_t efs_ip_proto; + efx_tunnel_protocol_t efs_encap_type; + uint16_t efs_loc_port; + uint16_t efs_rem_port; + efx_oword_t efs_rem_host; + efx_oword_t efs_loc_host; } efx_filter_spec_t; From owner-svn-src-head@freebsd.org Sat Nov 24 16:30:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE8A81102C9D; Sat, 24 Nov 2018 16:30:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C969803FB; Sat, 24 Nov 2018 16:30:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA8B110682; Sat, 24 Nov 2018 16:29:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGTwRa085643; Sat, 24 Nov 2018 16:29:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGTwQr085642; Sat, 24 Nov 2018 16:29:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241629.wAOGTwQr085642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340887 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C969803FB X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:30:03 -0000 Author: arybchik Date: Sat Nov 24 16:29:58 2018 New Revision: 340887 URL: https://svnweb.freebsd.org/changeset/base/340887 Log: sfxge(4): fix warnings from VS2015 C compiler (C4245) Fix level 4 warning "C4245: 'initializing': conversion from 'int' to 'uint32_t', signed/unsigned mismatch" warning; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18121 Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Sat Nov 24 16:29:46 2018 (r340886) +++ head/sys/dev/sfxge/common/ef10_filter.c Sat Nov 24 16:29:58 2018 (r340887) @@ -998,7 +998,7 @@ ef10_filter_supported_filters( size_t list_length; uint32_t i; efx_rc_t rc; - uint32_t all_filter_flags = + efx_filter_match_flags_t all_filter_flags = (EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_REM_PORT | EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_PORT | Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:29:46 2018 (r340886) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 16:29:58 2018 (r340887) @@ -2282,29 +2282,37 @@ typedef unsigned int efx_filter_flags_t; * Flags which specify the fields to match on. The values are the same as in the * MC_CMD_FILTER_OP/MC_CMD_FILTER_OP_EXT commands. */ -typedef enum efx_filter_match_flags_e { - EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host - * address */ - EFX_FILTER_MATCH_LOC_HOST = 0x0002, /* Match by local IP host - * address */ - EFX_FILTER_MATCH_REM_MAC = 0x0004, /* Match by remote MAC address */ - EFX_FILTER_MATCH_REM_PORT = 0x0008, /* Match by remote TCP/UDP port */ - EFX_FILTER_MATCH_LOC_MAC = 0x0010, /* Match by remote TCP/UDP port */ - EFX_FILTER_MATCH_LOC_PORT = 0x0020, /* Match by local TCP/UDP port */ - EFX_FILTER_MATCH_ETHER_TYPE = 0x0040, /* Match by Ether-type */ - EFX_FILTER_MATCH_INNER_VID = 0x0080, /* Match by inner VLAN ID */ - EFX_FILTER_MATCH_OUTER_VID = 0x0100, /* Match by outer VLAN ID */ - EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport - * protocol */ - /* For encapsulated packets, match all multicast inner frames */ - EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST = 0x01000000, - /* For encapsulated packets, match all unicast inner frames */ - EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST = 0x02000000, - /* Match otherwise-unmatched multicast and broadcast packets */ - EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x40000000, - /* Match otherwise-unmatched unicast packets */ - EFX_FILTER_MATCH_UNKNOWN_UCAST_DST = 0x80000000, -} efx_filter_match_flags_t; + +/* Match by remote IP host address */ +#define EFX_FILTER_MATCH_REM_HOST 0x00000001 +/* Match by local IP host address */ +#define EFX_FILTER_MATCH_LOC_HOST 0x00000002 +/* Match by remote MAC address */ +#define EFX_FILTER_MATCH_REM_MAC 0x00000004 +/* Match by remote TCP/UDP port */ +#define EFX_FILTER_MATCH_REM_PORT 0x00000008 +/* Match by remote TCP/UDP port */ +#define EFX_FILTER_MATCH_LOC_MAC 0x00000010 +/* Match by local TCP/UDP port */ +#define EFX_FILTER_MATCH_LOC_PORT 0x00000020 +/* Match by Ether-type */ +#define EFX_FILTER_MATCH_ETHER_TYPE 0x00000040 +/* Match by inner VLAN ID */ +#define EFX_FILTER_MATCH_INNER_VID 0x00000080 +/* Match by outer VLAN ID */ +#define EFX_FILTER_MATCH_OUTER_VID 0x00000100 +/* Match by IP transport protocol */ +#define EFX_FILTER_MATCH_IP_PROTO 0x00000200 +/* For encapsulated packets, match all multicast inner frames */ +#define EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST 0x01000000 +/* For encapsulated packets, match all unicast inner frames */ +#define EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST 0x02000000 +/* Match otherwise-unmatched multicast and broadcast packets */ +#define EFX_FILTER_MATCH_UNKNOWN_MCAST_DST 0x40000000 +/* Match otherwise-unmatched unicast packets */ +#define EFX_FILTER_MATCH_UNKNOWN_UCAST_DST 0x80000000 + +typedef uint32_t efx_filter_match_flags_t; typedef enum efx_filter_priority_s { EFX_FILTER_PRI_HINT = 0, /* Performance hint */ From owner-svn-src-head@freebsd.org Sat Nov 24 16:31:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0289A1102E70; Sat, 24 Nov 2018 16:31:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96ACF8096C; Sat, 24 Nov 2018 16:30:59 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3B9F106A7; Sat, 24 Nov 2018 16:30:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGUvHr088202; Sat, 24 Nov 2018 16:30:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGUvsI088201; Sat, 24 Nov 2018 16:30:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241630.wAOGUvsI088201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340892 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96ACF8096C X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:31:00 -0000 Author: arybchik Date: Sat Nov 24 16:30:57 2018 New Revision: 340892 URL: https://svnweb.freebsd.org/changeset/base/340892 Log: sfxge(4): remove obsolete check for pre-Siena hardware The fail4 label was used twice, so it doesn't need removing. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18126 Modified: head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 16:30:46 2018 (r340891) +++ head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 16:30:57 2018 (r340892) @@ -1355,10 +1355,6 @@ siena_rx_qcreate( #if EFSYS_OPT_RX_SCATTER case EFX_RXQ_TYPE_SCATTER: - if (enp->en_family < EFX_FAMILY_SIENA) { - rc = EINVAL; - goto fail4; - } jumbo = B_TRUE; break; #endif /* EFSYS_OPT_RX_SCATTER */ From owner-svn-src-head@freebsd.org Sat Nov 24 16:31:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 682A91102ED9; Sat, 24 Nov 2018 16:31:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A93780AB9; Sat, 24 Nov 2018 16:31:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E84D106B5; Sat, 24 Nov 2018 16:31:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGV98j088278; Sat, 24 Nov 2018 16:31:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGV90p088277; Sat, 24 Nov 2018 16:31:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241631.wAOGV90p088277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340893 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A93780AB9 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:31:12 -0000 Author: arybchik Date: Sat Nov 24 16:31:08 2018 New Revision: 340893 URL: https://svnweb.freebsd.org/changeset/base/340893 Log: sfxge(4): expand on comment on number of queues field Expand on comment on RSS_CONTEXT_ALLOC_IN_NUM_QUEUES field. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18127 Modified: head/sys/dev/sfxge/common/ef10_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 16:30:57 2018 (r340892) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 16:31:08 2018 (r340893) @@ -220,7 +220,13 @@ efx_mcdi_rss_context_alloc( MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID, EVB_PORT_ID_ASSIGNED); MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_TYPE, context_type); - /* NUM_QUEUES is only used to validate indirection table offsets */ + + /* + * For exclusive contexts, NUM_QUEUES is only used to validate + * indirection table offsets. + * For shared contexts, the provided context will spread traffic over + * NUM_QUEUES many queues. + */ MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_NUM_QUEUES, num_queues); efx_mcdi_execute(enp, &req); From owner-svn-src-head@freebsd.org Sat Nov 24 16:31:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13D961102F4B; Sat, 24 Nov 2018 16:31:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABE5C80B96; Sat, 24 Nov 2018 16:31:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E40E106C4; Sat, 24 Nov 2018 16:31:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGVKN3088344; Sat, 24 Nov 2018 16:31:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGVKXm088343; Sat, 24 Nov 2018 16:31:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241631.wAOGVKXm088343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340894 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ABE5C80B96 X-Spamd-Result: default: False [1.85 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.496,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:31:21 -0000 Author: arybchik Date: Sat Nov 24 16:31:20 2018 New Revision: 340894 URL: https://svnweb.freebsd.org/changeset/base/340894 Log: sfxge(4): fix PreFAST static analysis warning (C6001) Fix warning "C6001: Using uninitialized memory '*sensor_maskp'" which could occur when the npages argument to efx_mcdi_sensor_info() is less than or equal to zero. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18128 Modified: head/sys/dev/sfxge/common/mcdi_mon.c Modified: head/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 16:31:08 2018 (r340893) +++ head/sys/dev/sfxge/common/mcdi_mon.c Sat Nov 24 16:31:20 2018 (r340894) @@ -399,6 +399,11 @@ efx_mcdi_sensor_info( EFSYS_ASSERT(sensor_maskp != NULL); + if (npages < 1) { + rc = EINVAL; + goto fail1; + } + for (page = 0; page < npages; page++) { uint32_t mask; @@ -415,7 +420,7 @@ efx_mcdi_sensor_info( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail1; + goto fail2; } mask = MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK); @@ -423,18 +428,20 @@ efx_mcdi_sensor_info( if ((page != (npages - 1)) && ((mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) == 0)) { rc = EINVAL; - goto fail2; + goto fail3; } sensor_maskp[page] = mask; } if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) { rc = EINVAL; - goto fail3; + goto fail4; } return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: From owner-svn-src-head@freebsd.org Sat Nov 24 16:31:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 074E311030F7; Sat, 24 Nov 2018 16:31:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7834B80CEB; Sat, 24 Nov 2018 16:31:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A66F106D5; Sat, 24 Nov 2018 16:31:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGVWhK088414; Sat, 24 Nov 2018 16:31:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGVVqM088411; Sat, 24 Nov 2018 16:31:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241631.wAOGVVqM088411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340895 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7834B80CEB X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:31:45 -0000 Author: arybchik Date: Sat Nov 24 16:31:31 2018 New Revision: 340895 URL: https://svnweb.freebsd.org/changeset/base/340895 Log: sfxge(4): move BIU test code into Siena-specific file Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18129 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nic.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:31:20 2018 (r340894) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:31:31 2018 (r340895) @@ -1070,10 +1070,6 @@ struct efx_txq_s { } while (B_FALSE) extern __checkReturn efx_rc_t -efx_nic_biu_test( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t efx_mac_select( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 16:31:20 2018 (r340894) +++ head/sys/dev/sfxge/common/efx_nic.c Sat Nov 24 16:31:31 2018 (r340895) @@ -107,78 +107,6 @@ efx_family( return (ENOTSUP); } - -#define EFX_BIU_MAGIC0 0x01234567 -#define EFX_BIU_MAGIC1 0xfedcba98 - - __checkReturn efx_rc_t -efx_nic_biu_test( - __in efx_nic_t *enp) -{ - efx_oword_t oword; - efx_rc_t rc; - - /* - * Write magic values to scratch registers 0 and 1, then - * verify that the values were written correctly. Interleave - * the accesses to ensure that the BIU is not just reading - * back the cached value that was last written. - */ - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) { - rc = EIO; - goto fail1; - } - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) { - rc = EIO; - goto fail2; - } - - /* - * Perform the same test, with the values swapped. This - * ensures that subsequent tests don't start with the correct - * values already written into the scratch registers. - */ - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) { - rc = EIO; - goto fail3; - } - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) { - rc = EIO; - goto fail4; - } - - return (0); - -fail4: - EFSYS_PROBE(fail4); -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - #if EFSYS_OPT_SIENA static const efx_nic_ops_t __efx_nic_siena_ops = { Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 16:31:20 2018 (r340894) +++ head/sys/dev/sfxge/common/siena_nic.c Sat Nov 24 16:31:31 2018 (r340895) @@ -218,6 +218,77 @@ fail1: return (rc); } +#define SIENA_BIU_MAGIC0 0x01234567 +#define SIENA_BIU_MAGIC1 0xfedcba98 + +static __checkReturn efx_rc_t +siena_nic_biu_test( + __in efx_nic_t *enp) +{ + efx_oword_t oword; + efx_rc_t rc; + + /* + * Write magic values to scratch registers 0 and 1, then + * verify that the values were written correctly. Interleave + * the accesses to ensure that the BIU is not just reading + * back the cached value that was last written. + */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC0); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC1); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC0) { + rc = EIO; + goto fail1; + } + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC1) { + rc = EIO; + goto fail2; + } + + /* + * Perform the same test, with the values swapped. This + * ensures that subsequent tests don't start with the correct + * values already written into the scratch registers. + */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC1); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC0); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC1) { + rc = EIO; + goto fail3; + } + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC0) { + rc = EIO; + goto fail4; + } + + return (0); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t siena_nic_probe( __in efx_nic_t *enp) @@ -232,7 +303,7 @@ siena_nic_probe( EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA); /* Test BIU */ - if ((rc = efx_nic_biu_test(enp)) != 0) + if ((rc = siena_nic_biu_test(enp)) != 0) goto fail1; /* Clear the region register */ From owner-svn-src-head@freebsd.org Sat Nov 24 16:31:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F821103136; Sat, 24 Nov 2018 16:31:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94E5680E09; Sat, 24 Nov 2018 16:31:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DC1E107D5; Sat, 24 Nov 2018 16:31:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGVivY088481; Sat, 24 Nov 2018 16:31:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGVhSp088479; Sat, 24 Nov 2018 16:31:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241631.wAOGVhSp088479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 16:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340896 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 94E5680E09 X-Spamd-Result: default: False [1.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.502,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:31:47 -0000 Author: arybchik Date: Sat Nov 24 16:31:43 2018 New Revision: 340896 URL: https://svnweb.freebsd.org/changeset/base/340896 Log: sfxge(4): remove Falcon-specific concurrency check Falcon support has been withdrawn from libefx, however, there is still an obsolete Falcon-specific assertion that efx_mac_stats_upload() and efx_port_poll() aren't concurrent. To be consistent with an overall Falcon support revocation it's desirable to remove it. Fix debug build invalid assertion failure. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18130 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mac.c head/sys/dev/sfxge/common/efx_port.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:31:31 2018 (r340895) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 16:31:43 2018 (r340896) @@ -300,7 +300,6 @@ typedef struct efx_port_s { uint32_t ep_default_adv_cap_mask; uint32_t ep_phy_cap_mask; boolean_t ep_mac_drain; - boolean_t ep_mac_stats_pending; #if EFSYS_OPT_BIST efx_bist_type_t ep_current_bist; #endif Modified: head/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Sat Nov 24 16:31:31 2018 (r340895) +++ head/sys/dev/sfxge/common/efx_mac.c Sat Nov 24 16:31:43 2018 (r340896) @@ -756,16 +756,9 @@ efx_mac_stats_upload( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); EFSYS_ASSERT(emop != NULL); - /* - * Don't assert !ep_mac_stats_pending, because the client might - * have failed to finalise statistics when previously stopping - * the port. - */ if ((rc = emop->emo_stats_upload(enp, esmp)) != 0) goto fail1; - epp->ep_mac_stats_pending = B_TRUE; - return (0); fail1: @@ -825,8 +818,6 @@ efx_mac_stats_update( EFSYS_ASSERT(emop != NULL); rc = emop->emo_stats_update(enp, esmp, essp, generationp); - if (rc == 0) - epp->ep_mac_stats_pending = B_FALSE; return (rc); } Modified: head/sys/dev/sfxge/common/efx_port.c ============================================================================== --- head/sys/dev/sfxge/common/efx_port.c Sat Nov 24 16:31:31 2018 (r340895) +++ head/sys/dev/sfxge/common/efx_port.c Sat Nov 24 16:31:43 2018 (r340896) @@ -114,7 +114,6 @@ efx_port_poll( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); EFSYS_ASSERT(emop != NULL); - EFSYS_ASSERT(!epp->ep_mac_stats_pending); if (link_modep == NULL) link_modep = &ignore_link_mode; From owner-svn-src-head@freebsd.org Sat Nov 24 16:41:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A34311038EA; Sat, 24 Nov 2018 16:41:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E193681999; Sat, 24 Nov 2018 16:41:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2A4C108A4; Sat, 24 Nov 2018 16:41:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGfTqZ094571; Sat, 24 Nov 2018 16:41:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGfTQC094570; Sat, 24 Nov 2018 16:41:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241641.wAOGfTQC094570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 16:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340897 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E193681999 X-Spamd-Result: default: False [1.87 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.516,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:41:30 -0000 Author: markj Date: Sat Nov 24 16:41:29 2018 New Revision: 340897 URL: https://svnweb.freebsd.org/changeset/base/340897 Log: Lock the knlist before releasing the in-flux state in knote_fork(). Otherwise there is a window, before iteration is resumed, during which the knote may be freed. The in-flux state ensures that the knote will not be removed from the knlist while locks are dropped. PR: 228858 Reviewed by: kib Tested by: pho MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18316 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Nov 24 16:31:43 2018 (r340896) +++ head/sys/kern/kern_event.c Sat Nov 24 16:41:29 2018 (r340897) @@ -600,10 +600,10 @@ knote_fork(struct knlist *list, int pid) kn->kn_fflags |= NOTE_TRACKERR; if (kn->kn_fop->f_event(kn, NOTE_FORK)) KNOTE_ACTIVATE(kn, 0); + list->kl_lock(list->kl_lockarg); KQ_LOCK(kq); kn_leave_flux(kn); KQ_UNLOCK_FLUX(kq); - list->kl_lock(list->kl_lockarg); } list->kl_unlock(list->kl_lockarg); } From owner-svn-src-head@freebsd.org Sat Nov 24 16:58:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E1D61103DF2; Sat, 24 Nov 2018 16:58:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F6B1827AD; Sat, 24 Nov 2018 16:58:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E08B210B9D; Sat, 24 Nov 2018 16:58:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOGwYZW002452; Sat, 24 Nov 2018 16:58:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOGwYdY002451; Sat, 24 Nov 2018 16:58:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241658.wAOGwYdY002451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 16:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340898 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F6B1827AD X-Spamd-Result: default: False [1.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.521,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 16:58:35 -0000 Author: markj Date: Sat Nov 24 16:58:34 2018 New Revision: 340898 URL: https://svnweb.freebsd.org/changeset/base/340898 Log: Ensure that knotes do not get registered when KQ_CLOSING is set. KQ_CLOSING is set before draining the knotes associated with a kqueue, so we must ensure that new knotes are not added after that point. In particular, some kernel facilities may register for events on behalf of a userspace process and race with a close of the kqueue. PR: 228858 Reviewed by: kib Tested by: pho MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18316 Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Nov 24 16:41:29 2018 (r340897) +++ head/sys/kern/kern_event.c Sat Nov 24 16:58:34 2018 (r340898) @@ -1460,8 +1460,11 @@ findkn: break; } } else { - if ((kev->flags & EV_ADD) == EV_ADD) - kqueue_expand(kq, fops, kev->ident, waitok); + if ((kev->flags & EV_ADD) == EV_ADD) { + error = kqueue_expand(kq, fops, kev->ident, waitok); + if (error != 0) + goto done; + } KQ_LOCK(kq); @@ -1693,12 +1696,12 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop { struct klist *list, *tmp_knhash, *to_free; u_long tmp_knhashmask; - int size; - int fd; + int error, fd, size; int mflag = waitok ? M_WAITOK : M_NOWAIT; KQ_NOTOWNED(kq); + error = 0; to_free = NULL; if (fops->f_isfd) { fd = ident; @@ -1710,9 +1713,11 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop if (list == NULL) return ENOMEM; KQ_LOCK(kq); - if (kq->kq_knlistsize > fd) { + if ((kq->kq_state & KQ_CLOSING) != 0) { to_free = list; - list = NULL; + error = EBADF; + } else if (kq->kq_knlistsize > fd) { + to_free = list; } else { if (kq->kq_knlist != NULL) { bcopy(kq->kq_knlist, list, @@ -1734,9 +1739,12 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop &tmp_knhashmask, waitok ? HASH_WAITOK : HASH_NOWAIT); if (tmp_knhash == NULL) - return ENOMEM; + return (ENOMEM); KQ_LOCK(kq); - if (kq->kq_knhashmask == 0) { + if ((kq->kq_state & KQ_CLOSING) != 0) { + to_free = tmp_knhash; + error = EBADF; + } else if (kq->kq_knhashmask == 0) { kq->kq_knhash = tmp_knhash; kq->kq_knhashmask = tmp_knhashmask; } else { @@ -1748,7 +1756,7 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop free(to_free, M_KQUEUE); KQ_NOTOWNED(kq); - return 0; + return (error); } static void @@ -2597,6 +2605,8 @@ knote_attach(struct knote *kn, struct kqueue *kq) KASSERT(kn_in_flux(kn), ("knote %p not marked influx", kn)); KQ_OWNED(kq); + if ((kq->kq_state & KQ_CLOSING) != 0) + return (EBADF); if (kn->kn_fop->f_isfd) { if (kn->kn_id >= kq->kq_knlistsize) return (ENOMEM); From owner-svn-src-head@freebsd.org Sat Nov 24 17:02:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 498151104491; Sat, 24 Nov 2018 17:02:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E475082D47; Sat, 24 Nov 2018 17:02:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4B3010D2E; Sat, 24 Nov 2018 17:02:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOH2Vn9007780; Sat, 24 Nov 2018 17:02:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOH2Viv007776; Sat, 24 Nov 2018 17:02:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241702.wAOH2Viv007776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340899 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E475082D47 X-Spamd-Result: default: False [1.87 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.516,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:02:32 -0000 Author: markj Date: Sat Nov 24 17:02:31 2018 New Revision: 340899 URL: https://svnweb.freebsd.org/changeset/base/340899 Log: Plug some kernel memory disclosures via kevent(2). The kernel may register for events on behalf of a userspace process, in which case it must be careful to zero the kevent struct that will be copied out to userspace. Reviewed by: kib MFC after: 3 days Security: kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18317 Modified: head/sys/kern/kern_event.c head/sys/kern/vfs_aio.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Nov 24 16:58:34 2018 (r340898) +++ head/sys/kern/kern_event.c Sat Nov 24 17:02:31 2018 (r340899) @@ -535,8 +535,9 @@ knote_fork(struct knlist *list, int pid) if (list == NULL) return; - list->kl_lock(list->kl_lockarg); + memset(&kev, 0, sizeof(kev)); + list->kl_lock(list->kl_lockarg); SLIST_FOREACH(kn, &list->kl_list, kn_selnext) { kq = kn->kn_kq; KQ_LOCK(kq); Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sat Nov 24 16:58:34 2018 (r340898) +++ head/sys/kern/vfs_aio.c Sat Nov 24 17:02:31 2018 (r340899) @@ -1589,6 +1589,7 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, stru goto aqueue_fail; } kqfd = job->uaiocb.aio_sigevent.sigev_notify_kqueue; + memset(&kev, 0, sizeof(kev)); kev.ident = (uintptr_t)job->ujob; kev.filter = EVFILT_AIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags; @@ -2155,6 +2156,7 @@ kern_lio_listio(struct thread *td, int mode, struct ai bcopy(sig, &lj->lioj_signal, sizeof(lj->lioj_signal)); if (lj->lioj_signal.sigev_notify == SIGEV_KEVENT) { /* Assume only new style KEVENT */ + memset(&kev, 0, sizeof(kev)); kev.filter = EVFILT_LIO; kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1; kev.ident = (uintptr_t)uacb_list; /* something unique */ From owner-svn-src-head@freebsd.org Sat Nov 24 17:06:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FD5011046AF; Sat, 24 Nov 2018 17:06:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9057982FDF; Sat, 24 Nov 2018 17:06:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C96F10D3A; Sat, 24 Nov 2018 17:06:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOH62Jf008142; Sat, 24 Nov 2018 17:06:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOH61RG008138; Sat, 24 Nov 2018 17:06:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241706.wAOH61RG008138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340900 - in head/sys: compat/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: compat/linux kern sys X-SVN-Commit-Revision: 340900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9057982FDF X-Spamd-Result: default: False [1.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.525,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:06:03 -0000 Author: markj Date: Sat Nov 24 17:06:01 2018 New Revision: 340900 URL: https://svnweb.freebsd.org/changeset/base/340900 Log: Pass malloc flags directly through kevent(2) subroutines. Some kevent functions have a boolean "waitok" parameter for use when calling malloc(9). Replace them with the corresponding malloc() flags: the desired behaviour is known at compile-time, so this eliminates a couple of conditional branches, and makes the code easier to read. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18318 Modified: head/sys/compat/linux/linux_event.c head/sys/kern/kern_event.c head/sys/kern/vfs_aio.c head/sys/sys/event.h Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Sat Nov 24 17:02:31 2018 (r340899) +++ head/sys/compat/linux/linux_event.c Sat Nov 24 17:06:01 2018 (r340900) @@ -504,7 +504,7 @@ linux_epoll_ctl(struct thread *td, struct linux_epoll_ * and the EV_ADD flag is not set. */ kev[0].flags &= ~EV_ADD; - error = kqfd_register(args->epfd, &kev[0], td, 1); + error = kqfd_register(args->epfd, &kev[0], td, M_WAITOK); if (error != ENOENT) { error = EEXIST; goto leave0; Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Nov 24 17:02:31 2018 (r340899) +++ head/sys/kern/kern_event.c Sat Nov 24 17:06:01 2018 (r340900) @@ -102,13 +102,13 @@ TASKQUEUE_DEFINE_THREAD(kqueue_ctx); static int kevent_copyout(void *arg, struct kevent *kevp, int count); static int kevent_copyin(void *arg, struct kevent *kevp, int count); static int kqueue_register(struct kqueue *kq, struct kevent *kev, - struct thread *td, int waitok); + struct thread *td, int mflag); static int kqueue_acquire(struct file *fp, struct kqueue **kqp); static void kqueue_release(struct kqueue *kq, int locked); static void kqueue_destroy(struct kqueue *kq); static void kqueue_drain(struct kqueue *kq, struct thread *td); static int kqueue_expand(struct kqueue *kq, struct filterops *fops, - uintptr_t ident, int waitok); + uintptr_t ident, int mflag); static void kqueue_task(void *arg, int pending); static int kqueue_scan(struct kqueue *kq, int maxevents, struct kevent_copyops *k_ops, @@ -150,7 +150,7 @@ static void knote_drop_detached(struct knote *kn, str static void knote_enqueue(struct knote *kn); static void knote_dequeue(struct knote *kn); static void knote_init(void); -static struct knote *knote_alloc(int waitok); +static struct knote *knote_alloc(int mflag); static void knote_free(struct knote *kn); static void filt_kqdetach(struct knote *kn); @@ -582,7 +582,7 @@ knote_fork(struct knlist *list, int pid) kev.fflags = kn->kn_sfflags; kev.data = kn->kn_id; /* parent */ kev.udata = kn->kn_kevent.udata;/* preserve udata */ - error = kqueue_register(kq, &kev, NULL, 0); + error = kqueue_register(kq, &kev, NULL, M_NOWAIT); if (error) kn->kn_fflags |= NOTE_TRACKERR; @@ -596,7 +596,7 @@ knote_fork(struct knlist *list, int pid) kev.fflags = kn->kn_sfflags; kev.data = kn->kn_id; /* parent */ kev.udata = kn->kn_kevent.udata;/* preserve udata */ - error = kqueue_register(kq, &kev, NULL, 0); + error = kqueue_register(kq, &kev, NULL, M_NOWAIT); if (error) kn->kn_fflags |= NOTE_TRACKERR; if (kn->kn_fop->f_event(kn, NOTE_FORK)) @@ -1229,7 +1229,7 @@ kqueue_kevent(struct kqueue *kq, struct thread *td, in if (!kevp->filter) continue; kevp->flags &= ~EV_SYSFLAGS; - error = kqueue_register(kq, kevp, td, 1); + error = kqueue_register(kq, kevp, td, M_WAITOK); if (error || (kevp->flags & EV_RECEIPT)) { if (nevents == 0) return (error); @@ -1370,12 +1370,11 @@ kqueue_fo_release(int filt) } /* - * A ref to kq (obtained via kqueue_acquire) must be held. waitok will - * influence if memory allocation should wait. Make sure it is 0 if you - * hold any mutexes. + * A ref to kq (obtained via kqueue_acquire) must be held. */ static int -kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *td, int waitok) +kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *td, + int mflag) { struct filterops *fops; struct file *fp; @@ -1405,7 +1404,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, * allocation failures are handled in the loop, only * if the spare knote appears to be actually required. */ - tkn = knote_alloc(waitok); + tkn = knote_alloc(mflag); } else { tkn = NULL; } @@ -1421,11 +1420,11 @@ findkn: goto done; if ((kev->flags & EV_ADD) == EV_ADD && kqueue_expand(kq, fops, - kev->ident, 0) != 0) { + kev->ident, M_NOWAIT) != 0) { /* try again */ fdrop(fp, td); fp = NULL; - error = kqueue_expand(kq, fops, kev->ident, waitok); + error = kqueue_expand(kq, fops, kev->ident, mflag); if (error) goto done; goto findkn; @@ -1462,7 +1461,7 @@ findkn: } } else { if ((kev->flags & EV_ADD) == EV_ADD) { - error = kqueue_expand(kq, fops, kev->ident, waitok); + error = kqueue_expand(kq, fops, kev->ident, mflag); if (error != 0) goto done; } @@ -1693,12 +1692,11 @@ kqueue_schedtask(struct kqueue *kq) */ static int kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident, - int waitok) + int mflag) { struct klist *list, *tmp_knhash, *to_free; u_long tmp_knhashmask; int error, fd, size; - int mflag = waitok ? M_WAITOK : M_NOWAIT; KQ_NOTOWNED(kq); @@ -1737,8 +1735,8 @@ kqueue_expand(struct kqueue *kq, struct filterops *fop } else { if (kq->kq_knhashmask == 0) { tmp_knhash = hashinit_flags(KN_HASHSIZE, M_KQUEUE, - &tmp_knhashmask, - waitok ? HASH_WAITOK : HASH_NOWAIT); + &tmp_knhashmask, (mflag & M_WAITOK) != 0 ? + HASH_WAITOK : HASH_NOWAIT); if (tmp_knhash == NULL) return (ENOMEM); KQ_LOCK(kq); @@ -1827,7 +1825,7 @@ kqueue_scan(struct kqueue *kq, int maxevents, struct k asbt = -1; } else asbt = 0; - marker = knote_alloc(1); + marker = knote_alloc(M_WAITOK); marker->kn_status = KN_MARKER; KQ_LOCK(kq); @@ -2703,11 +2701,10 @@ knote_init(void) SYSINIT(knote, SI_SUB_PSEUDO, SI_ORDER_ANY, knote_init, NULL); static struct knote * -knote_alloc(int waitok) +knote_alloc(int mflag) { - return (uma_zalloc(knote_zone, (waitok ? M_WAITOK : M_NOWAIT) | - M_ZERO)); + return (uma_zalloc(knote_zone, mflag | M_ZERO)); } static void @@ -2721,7 +2718,7 @@ knote_free(struct knote *kn) * Register the kev w/ the kq specified by fd. */ int -kqfd_register(int fd, struct kevent *kev, struct thread *td, int waitok) +kqfd_register(int fd, struct kevent *kev, struct thread *td, int mflag) { struct kqueue *kq; struct file *fp; @@ -2734,7 +2731,7 @@ kqfd_register(int fd, struct kevent *kev, struct threa if ((error = kqueue_acquire(fp, &kq)) != 0) goto noacquire; - error = kqueue_register(kq, kev, td, waitok); + error = kqueue_register(kq, kev, td, mflag); kqueue_release(kq, 0); noacquire: Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sat Nov 24 17:02:31 2018 (r340899) +++ head/sys/kern/vfs_aio.c Sat Nov 24 17:06:01 2018 (r340900) @@ -1595,7 +1595,7 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, stru kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags; kev.data = (intptr_t)job; kev.udata = job->uaiocb.aio_sigevent.sigev_value.sival_ptr; - error = kqfd_register(kqfd, &kev, td, 1); + error = kqfd_register(kqfd, &kev, td, M_WAITOK); if (error) goto aqueue_fail; @@ -2164,7 +2164,8 @@ kern_lio_listio(struct thread *td, int mode, struct ai /* pass user defined sigval data */ kev.udata = lj->lioj_signal.sigev_value.sival_ptr; error = kqfd_register( - lj->lioj_signal.sigev_notify_kqueue, &kev, td, 1); + lj->lioj_signal.sigev_notify_kqueue, &kev, td, + M_WAITOK); if (error) { uma_zfree(aiolio_zone, lj); return (error); Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Sat Nov 24 17:02:31 2018 (r340899) +++ head/sys/sys/event.h Sat Nov 24 17:06:01 2018 (r340900) @@ -348,7 +348,7 @@ void knlist_cleardel(struct knlist *knl, struct thread knlist_cleardel((knl), (td), (islocked), 1) void knote_fdclose(struct thread *p, int fd); int kqfd_register(int fd, struct kevent *kev, struct thread *p, - int waitok); + int mflag); int kqueue_add_filteropts(int filt, struct filterops *filtops); int kqueue_del_filteropts(int filt); From owner-svn-src-head@freebsd.org Sat Nov 24 18:13:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F7851134253; Sat, 24 Nov 2018 18:13:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5FCA859D4; Sat, 24 Nov 2018 18:13:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96343118B7; Sat, 24 Nov 2018 18:13:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOID9Ro044907; Sat, 24 Nov 2018 18:13:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOID8PY044901; Sat, 24 Nov 2018 18:13:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241813.wAOID8PY044901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 18:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340906 - in head/sys/dev/sfxge: . common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in head/sys/dev/sfxge: . common X-SVN-Commit-Revision: 340906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B5FCA859D4 X-Spamd-Result: default: False [1.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.56)[0.560,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; NEURAL_SPAM_LONG(0.66)[0.661,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:13:10 -0000 Author: arybchik Date: Sat Nov 24 18:13:07 2018 New Revision: 340906 URL: https://svnweb.freebsd.org/changeset/base/340906 Log: sfxge(4): control RxQ scatter using flag instead of type Rx scatter may be applicable to different Rx queue types. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18131 Modified: head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 18:13:07 2018 (r340906) @@ -982,6 +982,7 @@ ef10_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __in efx_rxq_t *erp); Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 18:13:07 2018 (r340906) @@ -954,6 +954,7 @@ ef10_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __in efx_rxq_t *erp) { @@ -983,7 +984,6 @@ ef10_rx_qcreate( switch (type) { case EFX_RXQ_TYPE_DEFAULT: - case EFX_RXQ_TYPE_SCATTER: ps_buf_size = 0; break; #if EFSYS_OPT_RX_PACKED_STREAM @@ -1027,7 +1027,7 @@ ef10_rx_qcreate( #endif /* EFSYS_OPT_RX_PACKED_STREAM */ /* Scatter can only be disabled if the firmware supports doing so */ - if (type == EFX_RXQ_TYPE_SCATTER) + if (flags & EFX_RXQ_FLAG_SCATTER) disable_scatter = B_FALSE; else disable_scatter = encp->enc_rx_disable_scatter_supported; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 18:13:07 2018 (r340906) @@ -2006,7 +2006,6 @@ efx_pseudo_hdr_pkt_length_get( typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, - EFX_RXQ_TYPE_SCATTER, EFX_RXQ_TYPE_PACKED_STREAM_1M, EFX_RXQ_TYPE_PACKED_STREAM_512K, EFX_RXQ_TYPE_PACKED_STREAM_256K, @@ -2015,6 +2014,13 @@ typedef enum efx_rxq_type_e { EFX_RXQ_NTYPES } efx_rxq_type_t; +/* + * Dummy flag to be used instead of 0 to make it clear that the argument + * is receive queue flags. + */ +#define EFX_RXQ_FLAG_NONE 0x0 +#define EFX_RXQ_FLAG_SCATTER 0x1 + extern __checkReturn efx_rc_t efx_rx_qcreate( __in efx_nic_t *enp, @@ -2024,6 +2030,7 @@ efx_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp); Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 18:13:07 2018 (r340906) @@ -187,6 +187,7 @@ typedef struct efx_rx_ops_s { efx_rc_t (*erxo_qcreate)(efx_nic_t *enp, unsigned int, unsigned int, efx_rxq_type_t, efsys_mem_t *, size_t, uint32_t, + unsigned int, efx_evq_t *, efx_rxq_t *); void (*erxo_qdestroy)(efx_rxq_t *); } efx_rx_ops_t; Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 18:13:07 2018 (r340906) @@ -139,6 +139,7 @@ siena_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __in efx_rxq_t *erp); @@ -624,6 +625,7 @@ efx_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp) { @@ -649,7 +651,7 @@ efx_rx_qcreate( erp->er_esmp = esmp; if ((rc = erxop->erxo_qcreate(enp, index, label, type, esmp, ndescs, id, - eep, erp)) != 0) + flags, eep, erp)) != 0) goto fail2; enp->en_rx_qcount++; @@ -1311,13 +1313,14 @@ siena_rx_qcreate( __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, + __in unsigned int flags, __in efx_evq_t *eep, __in efx_rxq_t *erp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_oword_t oword; uint32_t size; - boolean_t jumbo; + boolean_t jumbo = B_FALSE; efx_rc_t rc; _NOTE(ARGUNUSED(esmp)) @@ -1350,20 +1353,22 @@ siena_rx_qcreate( switch (type) { case EFX_RXQ_TYPE_DEFAULT: - jumbo = B_FALSE; break; -#if EFSYS_OPT_RX_SCATTER - case EFX_RXQ_TYPE_SCATTER: - jumbo = B_TRUE; - break; -#endif /* EFSYS_OPT_RX_SCATTER */ - default: rc = EINVAL; goto fail4; } + if (flags & EFX_RXQ_FLAG_SCATTER) { +#if EFSYS_OPT_RX_SCATTER + jumbo = B_TRUE; +#else + rc = EINVAL; + goto fail5; +#endif /* EFSYS_OPT_RX_SCATTER */ + } + /* Set up the new descriptor queue */ EFX_POPULATE_OWORD_7(oword, FRF_AZ_RX_DESCQ_BUF_BASE_ID, id, @@ -1379,6 +1384,10 @@ siena_rx_qcreate( return (0); +#if !EFSYS_OPT_RX_SCATTER +fail5: + EFSYS_PROBE(fail5); +#endif fail4: EFSYS_PROBE(fail4); fail3: Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Sat Nov 24 17:47:53 2018 (r340905) +++ head/sys/dev/sfxge/sfxge_rx.c Sat Nov 24 18:13:07 2018 (r340906) @@ -1037,8 +1037,8 @@ sfxge_rx_qstart(struct sfxge_softc *sc, unsigned int i /* Create the common code receive queue. */ if ((rc = efx_rx_qcreate(sc->enp, index, 0, EFX_RXQ_TYPE_DEFAULT, - esmp, sc->rxq_entries, rxq->buf_base_id, evq->common, - &rxq->common)) != 0) + esmp, sc->rxq_entries, rxq->buf_base_id, EFX_RXQ_FLAG_NONE, + evq->common, &rxq->common)) != 0) goto fail; SFXGE_EVQ_LOCK(evq); From owner-svn-src-head@freebsd.org Sat Nov 24 18:13:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A94AB113428C; Sat, 24 Nov 2018 18:13:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C6E185AC4; Sat, 24 Nov 2018 18:13:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F10AD118B8; Sat, 24 Nov 2018 18:13:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOIDMUG044974; Sat, 24 Nov 2018 18:13:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOIDL0d044968; Sat, 24 Nov 2018 18:13:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241813.wAOIDL0d044968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 18:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340907 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C6E185AC4 X-Spamd-Result: default: False [2.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.68)[0.678,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.58)[0.576,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:13:23 -0000 Author: arybchik Date: Sat Nov 24 18:13:21 2018 New Revision: 340907 URL: https://svnweb.freebsd.org/changeset/base/340907 Log: sfxge(4): add function to create packed stream RxQ Encoding packed stream buffer size in RxQ type is not a future-proof idea taking into account a new RxQ types with extra parameters. To be consistent make packet stream buffer size a separate parameter. In order to avoid blowing of the default RxQ create function prototype add a dedicated function to create packed stream RxQ without not applicable paramters. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18132 Modified: head/sys/dev/sfxge/common/ef10_ev.c head/sys/dev/sfxge/common/ef10_impl.h head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/ef10_ev.c Sat Nov 24 18:13:21 2018 (r340907) @@ -1350,8 +1350,7 @@ ef10_ev_rxlabel_init( { efx_evq_rxq_state_t *eersp; #if EFSYS_OPT_RX_PACKED_STREAM - boolean_t packed_stream = (type >= EFX_RXQ_TYPE_PACKED_STREAM_1M) && - (type <= EFX_RXQ_TYPE_PACKED_STREAM_64K); + boolean_t packed_stream = (type == EFX_RXQ_TYPE_PACKED_STREAM); #endif _NOTE(ARGUNUSED(type)) Modified: head/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/ef10_impl.h Sat Nov 24 18:13:21 2018 (r340907) @@ -979,6 +979,7 @@ ef10_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, + __in uint32_t type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 18:13:21 2018 (r340907) @@ -951,6 +951,7 @@ ef10_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, + __in uint32_t type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -963,7 +964,7 @@ ef10_rx_qcreate( boolean_t disable_scatter; unsigned int ps_buf_size; - _NOTE(ARGUNUSED(id, erp)) + _NOTE(ARGUNUSED(id, erp, type_data)) EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << ESF_DZ_RX_QLABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS); @@ -987,25 +988,32 @@ ef10_rx_qcreate( ps_buf_size = 0; break; #if EFSYS_OPT_RX_PACKED_STREAM - case EFX_RXQ_TYPE_PACKED_STREAM_1M: - ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M; + case EFX_RXQ_TYPE_PACKED_STREAM: + switch (type_data) { + case EFX_RXQ_PACKED_STREAM_BUF_SIZE_1M: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M; + break; + case EFX_RXQ_PACKED_STREAM_BUF_SIZE_512K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_512K; + break; + case EFX_RXQ_PACKED_STREAM_BUF_SIZE_256K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_256K; + break; + case EFX_RXQ_PACKED_STREAM_BUF_SIZE_128K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_128K; + break; + case EFX_RXQ_PACKED_STREAM_BUF_SIZE_64K: + ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_64K; + break; + default: + rc = ENOTSUP; + goto fail3; + } break; - case EFX_RXQ_TYPE_PACKED_STREAM_512K: - ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_512K; - break; - case EFX_RXQ_TYPE_PACKED_STREAM_256K: - ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_256K; - break; - case EFX_RXQ_TYPE_PACKED_STREAM_128K: - ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_128K; - break; - case EFX_RXQ_TYPE_PACKED_STREAM_64K: - ps_buf_size = MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_64K; - break; #endif /* EFSYS_OPT_RX_PACKED_STREAM */ default: rc = ENOTSUP; - goto fail3; + goto fail4; } #if EFSYS_OPT_RX_PACKED_STREAM @@ -1013,13 +1021,13 @@ ef10_rx_qcreate( /* Check if datapath firmware supports packed stream mode */ if (encp->enc_rx_packed_stream_supported == B_FALSE) { rc = ENOTSUP; - goto fail4; + goto fail5; } /* Check if packed stream allows configurable buffer sizes */ - if ((type != EFX_RXQ_TYPE_PACKED_STREAM_1M) && + if ((ps_buf_size != MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_1M) && (encp->enc_rx_var_packed_stream_supported == B_FALSE)) { rc = ENOTSUP; - goto fail5; + goto fail6; } } #else /* EFSYS_OPT_RX_PACKED_STREAM */ @@ -1034,7 +1042,7 @@ ef10_rx_qcreate( if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep->ee_index, label, index, esmp, disable_scatter, ps_buf_size)) != 0) - goto fail6; + goto fail7; erp->er_eep = eep; erp->er_label = label; @@ -1045,16 +1053,20 @@ ef10_rx_qcreate( return (0); +fail7: + EFSYS_PROBE(fail7); +#if EFSYS_OPT_RX_PACKED_STREAM fail6: EFSYS_PROBE(fail6); -#if EFSYS_OPT_RX_PACKED_STREAM fail5: EFSYS_PROBE(fail5); +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ fail4: EFSYS_PROBE(fail4); -#endif /* EFSYS_OPT_RX_PACKED_STREAM */ +#if EFSYS_OPT_RX_PACKED_STREAM fail3: EFSYS_PROBE(fail3); +#endif /* EFSYS_OPT_RX_PACKED_STREAM */ fail2: EFSYS_PROBE(fail2); fail1: Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 18:13:21 2018 (r340907) @@ -2006,11 +2006,7 @@ efx_pseudo_hdr_pkt_length_get( typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, - EFX_RXQ_TYPE_PACKED_STREAM_1M, - EFX_RXQ_TYPE_PACKED_STREAM_512K, - EFX_RXQ_TYPE_PACKED_STREAM_256K, - EFX_RXQ_TYPE_PACKED_STREAM_128K, - EFX_RXQ_TYPE_PACKED_STREAM_64K, + EFX_RXQ_TYPE_PACKED_STREAM, EFX_RXQ_NTYPES } efx_rxq_type_t; @@ -2033,6 +2029,27 @@ efx_rx_qcreate( __in unsigned int flags, __in efx_evq_t *eep, __deref_out efx_rxq_t **erpp); + +#if EFSYS_OPT_RX_PACKED_STREAM + +#define EFX_RXQ_PACKED_STREAM_BUF_SIZE_1M (1U * 1024 * 1024) +#define EFX_RXQ_PACKED_STREAM_BUF_SIZE_512K (512U * 1024) +#define EFX_RXQ_PACKED_STREAM_BUF_SIZE_256K (256U * 1024) +#define EFX_RXQ_PACKED_STREAM_BUF_SIZE_128K (128U * 1024) +#define EFX_RXQ_PACKED_STREAM_BUF_SIZE_64K (64U * 1024) + +extern __checkReturn efx_rc_t +efx_rx_qcreate_packed_stream( + __in efx_nic_t *enp, + __in unsigned int index, + __in unsigned int label, + __in uint32_t ps_buf_size, + __in efsys_mem_t *esmp, + __in size_t ndescs, + __in efx_evq_t *eep, + __deref_out efx_rxq_t **erpp); + +#endif typedef struct efx_buffer_s { efsys_dma_addr_t eb_addr; Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/efx_impl.h Sat Nov 24 18:13:21 2018 (r340907) @@ -185,7 +185,7 @@ typedef struct efx_rx_ops_s { efx_rc_t (*erxo_qflush)(efx_rxq_t *); void (*erxo_qenable)(efx_rxq_t *); efx_rc_t (*erxo_qcreate)(efx_nic_t *enp, unsigned int, - unsigned int, efx_rxq_type_t, + unsigned int, efx_rxq_type_t, uint32_t, efsys_mem_t *, size_t, uint32_t, unsigned int, efx_evq_t *, efx_rxq_t *); Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 18:13:07 2018 (r340906) +++ head/sys/dev/sfxge/common/efx_rx.c Sat Nov 24 18:13:21 2018 (r340907) @@ -136,6 +136,7 @@ siena_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, + __in uint32_t type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -616,12 +617,13 @@ efx_rx_qenable( erxop->erxo_qenable(erp); } - __checkReturn efx_rc_t -efx_rx_qcreate( +static __checkReturn efx_rc_t +efx_rx_qcreate_internal( __in efx_nic_t *enp, __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, + __in uint32_t type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -650,8 +652,8 @@ efx_rx_qcreate( erp->er_mask = ndescs - 1; erp->er_esmp = esmp; - if ((rc = erxop->erxo_qcreate(enp, index, label, type, esmp, ndescs, id, - flags, eep, erp)) != 0) + if ((rc = erxop->erxo_qcreate(enp, index, label, type, type_data, esmp, + ndescs, id, flags, eep, erp)) != 0) goto fail2; enp->en_rx_qcount++; @@ -669,6 +671,43 @@ fail1: return (rc); } + __checkReturn efx_rc_t +efx_rx_qcreate( + __in efx_nic_t *enp, + __in unsigned int index, + __in unsigned int label, + __in efx_rxq_type_t type, + __in efsys_mem_t *esmp, + __in size_t ndescs, + __in uint32_t id, + __in unsigned int flags, + __in efx_evq_t *eep, + __deref_out efx_rxq_t **erpp) +{ + return efx_rx_qcreate_internal(enp, index, label, type, 0, esmp, ndescs, + id, flags, eep, erpp); +} + +#if EFSYS_OPT_RX_PACKED_STREAM + + __checkReturn efx_rc_t +efx_rx_qcreate_packed_stream( + __in efx_nic_t *enp, + __in unsigned int index, + __in unsigned int label, + __in uint32_t ps_buf_size, + __in efsys_mem_t *esmp, + __in size_t ndescs, + __in efx_evq_t *eep, + __deref_out efx_rxq_t **erpp) +{ + return efx_rx_qcreate_internal(enp, index, label, + EFX_RXQ_TYPE_PACKED_STREAM, ps_buf_size, esmp, ndescs, + 0 /* id unused on EF10 */, EFX_RXQ_FLAG_NONE, eep, erpp); +} + +#endif + void efx_rx_qdestroy( __in efx_rxq_t *erp) @@ -1310,6 +1349,7 @@ siena_rx_qcreate( __in unsigned int index, __in unsigned int label, __in efx_rxq_type_t type, + __in uint32_t type_data, __in efsys_mem_t *esmp, __in size_t ndescs, __in uint32_t id, @@ -1324,6 +1364,7 @@ siena_rx_qcreate( efx_rc_t rc; _NOTE(ARGUNUSED(esmp)) + _NOTE(ARGUNUSED(type_data)) EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH)); From owner-svn-src-head@freebsd.org Sat Nov 24 18:13:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1474611342CE; Sat, 24 Nov 2018 18:13:36 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A828785BB3; Sat, 24 Nov 2018 18:13:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB400118B9; Sat, 24 Nov 2018 18:13:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOIDYhv045033; Sat, 24 Nov 2018 18:13:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOIDY4h045031; Sat, 24 Nov 2018 18:13:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811241813.wAOIDY4h045031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 24 Nov 2018 18:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340908 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A828785BB3 X-Spamd-Result: default: False [1.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.66)[0.661,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.56)[0.560,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:13:36 -0000 Author: arybchik Date: Sat Nov 24 18:13:34 2018 New Revision: 340908 URL: https://svnweb.freebsd.org/changeset/base/340908 Log: sfxge(4): allow to request inner classes for Rx packets If HW/FW supports tunnel encapsulations, Rx event may contain either inner or outer packet classes. By default outer classes are requested. Make it possible to request inner classes to have more information about packet type and allow to interpret inner frame checksum validation results correctly. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18133 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 18:13:21 2018 (r340907) +++ head/sys/dev/sfxge/common/ef10_rx.c Sat Nov 24 18:13:34 2018 (r340908) @@ -47,6 +47,7 @@ efx_mcdi_init_rxq( __in uint32_t instance, __in efsys_mem_t *esmp, __in boolean_t disable_scatter, + __in boolean_t want_inner_classes, __in uint32_t ps_bufsize) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); @@ -68,7 +69,8 @@ efx_mcdi_init_rxq( else dma_mode = MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET; - if (encp->enc_tunnel_encapsulations_supported != 0) { + if (encp->enc_tunnel_encapsulations_supported != 0 && + !want_inner_classes) { /* * WANT_OUTER_CLASSES can only be specified on hardware which * supports tunnel encapsulation offloads, even though it is @@ -962,6 +964,7 @@ ef10_rx_qcreate( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_rc_t rc; boolean_t disable_scatter; + boolean_t want_inner_classes; unsigned int ps_buf_size; _NOTE(ARGUNUSED(id, erp, type_data)) @@ -1040,8 +1043,14 @@ ef10_rx_qcreate( else disable_scatter = encp->enc_rx_disable_scatter_supported; + if (flags & EFX_RXQ_FLAG_INNER_CLASSES) + want_inner_classes = B_TRUE; + else + want_inner_classes = B_FALSE; + if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep->ee_index, label, index, - esmp, disable_scatter, ps_buf_size)) != 0) + esmp, disable_scatter, want_inner_classes, + ps_buf_size)) != 0) goto fail7; erp->er_eep = eep; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Sat Nov 24 18:13:21 2018 (r340907) +++ head/sys/dev/sfxge/common/efx.h Sat Nov 24 18:13:34 2018 (r340908) @@ -2016,6 +2016,15 @@ typedef enum efx_rxq_type_e { */ #define EFX_RXQ_FLAG_NONE 0x0 #define EFX_RXQ_FLAG_SCATTER 0x1 +/* + * If tunnels are supported and Rx event can provide information about + * either outer or inner packet classes (e.g. SFN8xxx adapters with + * full-feature firmware variant running), outer classes are requested by + * default. However, if the driver supports tunnels, the flag allows to + * request inner classes which are required to be able to interpret inner + * Rx checksum offload results. + */ +#define EFX_RXQ_FLAG_INNER_CLASSES 0x2 extern __checkReturn efx_rc_t efx_rx_qcreate( From owner-svn-src-head@freebsd.org Sat Nov 24 18:23:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACF5511347D0; Sat, 24 Nov 2018 18:23:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BAE386247; Sat, 24 Nov 2018 18:23:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2706711A61; Sat, 24 Nov 2018 18:23:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOIN6cZ050277; Sat, 24 Nov 2018 18:23:06 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOIN6af050276; Sat, 24 Nov 2018 18:23:06 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201811241823.wAOIN6af050276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 24 Nov 2018 18:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340909 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 340909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BAE386247 X-Spamd-Result: default: False [1.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.54)[0.543,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; NEURAL_SPAM_LONG(0.64)[0.643,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:23:06 -0000 Author: cy Date: Sat Nov 24 18:23:05 2018 New Revision: 340909 URL: https://svnweb.freebsd.org/changeset/base/340909 Log: Combine two lines into one following unifdef for r255332. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 18:13:34 2018 (r340908) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Nov 24 18:23:05 2018 (r340909) @@ -288,8 +288,7 @@ ipfdetach(softc) * Filter ioctl interface. */ int -ipfioctl(dev, cmd, data, mode -, p) +ipfioctl(dev, cmd, data, mode, p) struct thread *p; # define p_cred td_ucred # define p_uid td_ucred->cr_ruid From owner-svn-src-head@freebsd.org Sat Nov 24 18:23:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C7461134833; Sat, 24 Nov 2018 18:23:54 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4C3586394; Sat, 24 Nov 2018 18:23:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A786011A62; Sat, 24 Nov 2018 18:23:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOINrlC050352; Sat, 24 Nov 2018 18:23:53 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOINrqF050351; Sat, 24 Nov 2018 18:23:53 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811241823.wAOINrqF050351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 24 Nov 2018 18:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340910 - head/lib/csu/common X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/common X-SVN-Commit-Revision: 340910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4C3586394 X-Spamd-Result: default: False [1.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_SHORT(0.54)[0.543,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:23:54 -0000 Author: andrew Date: Sat Nov 24 18:23:53 2018 New Revision: 340910 URL: https://svnweb.freebsd.org/changeset/base/340910 Log: Add the missing 0 at the end of the .jcr section. Without this the dynamic library test was failing as it was calling _Jv_RegisterClasses multiple times. Modified: head/lib/csu/common/crtend.c Modified: head/lib/csu/common/crtend.c ============================================================================== --- head/lib/csu/common/crtend.c Sat Nov 24 18:23:05 2018 (r340909) +++ head/lib/csu/common/crtend.c Sat Nov 24 18:23:53 2018 (r340910) @@ -41,6 +41,9 @@ static crt_func __CTOR_END__[] __section(".ctors") __u static crt_func __DTOR_END__[] __section(".dtors") __used = { (crt_func)0 }; +static crt_func __JCR_LIST__[] __section(".jcr") __used = { + (crt_func)0 +}; static void __do_global_ctors_aux(void) From owner-svn-src-head@freebsd.org Sat Nov 24 18:25:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1B1311348E8; Sat, 24 Nov 2018 18:25:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 695728650A; Sat, 24 Nov 2018 18:25:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A67011A63; Sat, 24 Nov 2018 18:25:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOIP1VU050452; Sat, 24 Nov 2018 18:25:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOIP1Cp050451; Sat, 24 Nov 2018 18:25:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201811241825.wAOIP1Cp050451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 24 Nov 2018 18:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340911 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 340911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 695728650A X-Spamd-Result: default: False [1.84 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.525,0]; NEURAL_SPAM_MEDIUM(0.69)[0.693,0]; NEURAL_SPAM_LONG(0.62)[0.625,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 18:25:01 -0000 Author: andrew Date: Sat Nov 24 18:25:00 2018 New Revision: 340911 URL: https://svnweb.freebsd.org/changeset/base/340911 Log: Re-enable the dynamiclib tests. These should be fixed by r340910. Modified: head/lib/csu/tests/Makefile Modified: head/lib/csu/tests/Makefile ============================================================================== --- head/lib/csu/tests/Makefile Sat Nov 24 18:23:53 2018 (r340910) +++ head/lib/csu/tests/Makefile Sat Nov 24 18:25:00 2018 (r340911) @@ -2,7 +2,7 @@ SUBDIR= dso TESTS_SUBDIRS= dynamic -#TESTS_SUBDIRS+= dynamiclib +TESTS_SUBDIRS+= dynamiclib TESTS_SUBDIRS+= static .include From owner-svn-src-head@freebsd.org Sat Nov 24 21:17:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11F991139AA5; Sat, 24 Nov 2018 21:17:52 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9D828C6ED; Sat, 24 Nov 2018 21:17:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 851EE135E3; Sat, 24 Nov 2018 21:17:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOLHp3a039480; Sat, 24 Nov 2018 21:17:51 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOLHpu2039479; Sat, 24 Nov 2018 21:17:51 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201811242117.wAOLHpu2039479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 24 Nov 2018 21:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340912 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 340912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9D828C6ED X-Spamd-Result: default: False [1.70 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.31)[0.308,0]; NEURAL_SPAM_MEDIUM(0.73)[0.730,0]; NEURAL_SPAM_LONG(0.66)[0.661,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 21:17:52 -0000 Author: wulf Date: Sat Nov 24 21:17:51 2018 New Revision: 340912 URL: https://svnweb.freebsd.org/changeset/base/340912 Log: Revert r328640: Add kludge for 0x46 identity middle byte Synaptics touchpads. It appeared that "0x46 identity middle byte" response is caused by so called "Active PS/2 multiplexing controller" presence. Support for it will be added in next commit. Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Nov 24 18:25:00 2018 (r340911) +++ head/sys/dev/atkbdc/psm.c Sat Nov 24 21:17:51 2018 (r340912) @@ -136,7 +136,6 @@ struct psmcpnp_softc { enum { PSMCPNP_GENERIC, PSMCPNP_FORCEPAD, - PSMCPNP_HPSYN81, } type; /* Based on PnP ID */ }; @@ -175,15 +174,6 @@ typedef struct packetbuf { #define PSM_PACKETQUEUE 128 #endif -/* - * Typical bezel limits. Taken from 'Synaptics - * PS/2 TouchPad Interfacing Guide' p.3.2.3. - */ -#define SYNAPTICS_DEFAULT_MAX_X 5472 -#define SYNAPTICS_DEFAULT_MAX_Y 4448 -#define SYNAPTICS_DEFAULT_MIN_X 1472 -#define SYNAPTICS_DEFAULT_MIN_Y 1408 - typedef struct synapticsinfo { struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -1109,7 +1099,7 @@ doopen(struct psm_softc *sc, int command_byte) mouse_ext_command(sc->kbdc, 1); get_mouse_status(sc->kbdc, stat, 0, 3); if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) || - stat[1] == 0x46 || stat[1] == 0x47) && + stat[1] == 0x47) && stat[2] == 0x40) { synaptics_set_mode(sc, synaptics_preferred_mode(sc)); VLOG(5, (LOG_DEBUG, "psm%d: Synaptis Absolute Mode " @@ -6047,7 +6037,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a KBDC kbdc = sc->kbdc; synapticshw_t synhw; int status[3]; - int buttons, middle_byte; + int buttons; VLOG(3, (LOG_DEBUG, "synaptics: BEGIN init\n")); @@ -6064,8 +6054,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); - middle_byte = status[1]; - if (middle_byte != 0x46 && middle_byte != 0x47) + if (status[1] != 0x47) return (FALSE); bzero(&synhw, sizeof(synhw)); @@ -6076,15 +6065,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a printf("Synaptics Touchpad v%d.%d\n", synhw.infoMajor, synhw.infoMinor); - /* - * Most synaptics touchpads return 0x47 in middle byte in responce to - * identify command as stated in p.4.4 of "Synaptics PS/2 TouchPad - * Interfacing Guide" and we only support v4.0 or better. But some - * devices return 0x46 here and have a different numbering scheme. - * In the case of 0x46, we allow versions as low as v2.0 - */ - if ((middle_byte == 0x47 && synhw.infoMajor < 4) || - (middle_byte == 0x46 && synhw.infoMajor < 2)) { + if (synhw.infoMajor < 4) { printf(" Unsupported (pre-v4) Touchpad detected\n"); return (FALSE); } @@ -6125,7 +6106,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); - if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != middle_byte) { + if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != 0x47) { printf(" Failed to read extended capability bits\n"); return (FALSE); } @@ -6134,29 +6115,10 @@ enable_synaptics(struct psm_softc *sc, enum probearg a sc->unit); psmcpnp_sc = (psmcpnp != NULL) ? device_get_softc(psmcpnp) : NULL; - /* - * Set conservative defaults for 0x46 middle byte touchpads - * as ExtendedQueries return bogus data. - */ - if (middle_byte == 0x46) { - synhw.capExtended = 1; - synhw.capPalmDetect = 1; - synhw.capPassthrough = 1; - synhw.capMultiFinger = 1; - synhw.maximumXCoord = SYNAPTICS_DEFAULT_MAX_X; - synhw.maximumYCoord = SYNAPTICS_DEFAULT_MAX_Y; - synhw.minimumXCoord = SYNAPTICS_DEFAULT_MIN_X; - synhw.minimumYCoord = SYNAPTICS_DEFAULT_MIN_Y; - /* Enable multitouch mode for HW v8.1 devices */ - if (psmcpnp_sc != NULL && - psmcpnp_sc->type == PSMCPNP_HPSYN81) - synhw.capReportsV = 1; - } else - synhw.capExtended = (status[0] & 0x80) != 0; - /* Set the different capabilities when they exist. */ buttons = 0; - if (synhw.capExtended && middle_byte == 0x47) { + synhw.capExtended = (status[0] & 0x80) != 0; + if (synhw.capExtended) { synhw.nExtendedQueries = (status[0] & 0x70) >> 4; synhw.capMiddle = (status[0] & 0x04) != 0; synhw.capPassthrough = (status[2] & 0x80) != 0; @@ -6278,8 +6240,12 @@ enable_synaptics(struct psm_softc *sc, enum probearg a synhw.maximumYCoord = (status[2] << 5) | ((status[1] & 0xf0) >> 3); } else { - synhw.maximumXCoord = SYNAPTICS_DEFAULT_MAX_X; - synhw.maximumYCoord = SYNAPTICS_DEFAULT_MAX_Y; + /* + * Typical bezel limits. Taken from 'Synaptics + * PS/2 * TouchPad Interfacing Guide' p.3.2.3. + */ + synhw.maximumXCoord = 5472; + synhw.maximumYCoord = 4448; } if (synhw.capReportsMin) { @@ -6295,8 +6261,12 @@ enable_synaptics(struct psm_softc *sc, enum probearg a synhw.minimumYCoord = (status[2] << 5) | ((status[1] & 0xf0) >> 3); } else { - synhw.minimumXCoord = SYNAPTICS_DEFAULT_MIN_X; - synhw.minimumYCoord = SYNAPTICS_DEFAULT_MIN_Y; + /* + * Typical bezel limits. Taken from 'Synaptics + * PS/2 * TouchPad Interfacing Guide' p.3.2.3. + */ + synhw.minimumXCoord = 1472; + synhw.minimumYCoord = 1408; } /* @@ -6382,7 +6352,7 @@ enable_synaptics(struct psm_softc *sc, enum probearg a return (FALSE); if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); - if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != middle_byte) { + if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != 0x47) { printf(" Failed to read mode byte\n"); return (FALSE); } @@ -7205,12 +7175,6 @@ static struct isa_pnp_id forcepad_ids[] = { { 0 } }; -/* List of HW v8.1 synaptics touchpads erroneously detected as HW v2.0 */ -static struct isa_pnp_id hpsyn81_ids[] = { - { 0x9e012e4f, "HP PS/2 trackpad port" }, /* SYN019E, EB 9470 */ - { 0 } -}; - static int create_a_copy(device_t atkbdc, device_t me) { @@ -7244,8 +7208,6 @@ psmcpnp_probe(device_t dev) if (ISA_PNP_PROBE(device_get_parent(dev), dev, forcepad_ids) == 0) sc->type = PSMCPNP_FORCEPAD; - else if(ISA_PNP_PROBE(device_get_parent(dev), dev, hpsyn81_ids) == 0) - sc->type = PSMCPNP_HPSYN81; else if (ISA_PNP_PROBE(device_get_parent(dev), dev, psmcpnp_ids) == 0) sc->type = PSMCPNP_GENERIC; else From owner-svn-src-head@freebsd.org Sat Nov 24 21:23:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21C301139EB4; Sat, 24 Nov 2018 21:23:14 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1CFF8CD17; Sat, 24 Nov 2018 21:23:13 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A163F13780; Sat, 24 Nov 2018 21:23:13 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOLNDEp044770; Sat, 24 Nov 2018 21:23:13 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOLND6V044767; Sat, 24 Nov 2018 21:23:13 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201811242123.wAOLND6V044767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 24 Nov 2018 21:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340913 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 340913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1CFF8CD17 X-Spamd-Result: default: False [1.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.32)[0.316,0]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; NEURAL_SPAM_LONG(0.68)[0.678,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 21:23:14 -0000 Author: wulf Date: Sat Nov 24 21:23:12 2018 New Revision: 340913 URL: https://svnweb.freebsd.org/changeset/base/340913 Log: psm(4): Add minimal support for active AUX port multiplexers Active PS/2 multiplexing is a method for attaching up to four PS/2 pointing devices to a computer. Enabling of multiplexed mode allows commands to be directed to individual devices using routing prefixes. Multiplexed mode reports input with each byte tagged to identify its source. This method differs from one currently supported by psm(4) where so called guest device (trackpoint) is attached to special interface located on the host device (touchpad) and latter performs guest protocol conversion to special encapsulation packet format. At present time active PS/2 multiplexing is used in some models of HP laptops e.g. EliteBook 8560w, 9470m. Enabling of absolute operation mode on such touchpads is connected with following problems: 1. Touchpad's port priority is lower than trackpoint's. That blocks information queries thus prevents touchpad detection and configuration. 2. Touchpad and trackpoint have different protocol packet sizes and sync bytes. As PS/2 usage is on decline only minimal possible set of changes to support Synaptics touchpad and generic mouses is implemented. Active multiplexing mode is enabled only at probe stage to scan through attached PS/2 devices to query and configure Synaptics touchpad. After touchpad has been configured, mux is switched back to legacy (hidden multiplexing) mode to perform normal interrupt-driven input data processing. Overflow bit values rather than tags are used to separate packets produced by different devices. Switching back to legacy mode allows to avoid psm(4) and atkbd(4) rework to support 4 instances of mouse driver. Note: While in hidden multiplexing mode KBC does some editing of the packet stream. It remembers the button bits from the last packet received from each device, and replaces the button bits of every packet with the logical OR of all devices’ most recent button bits. This sort of button crosstalk results in spurious button events which are inhibitted with various tricks. E.g. trackpoint middle button events are suppressed while trackpad surface is touched and touchpad left and right button events are suppressed if corresponding trackpoint buttons are pressed. PR: 231058 Reported by: Michael Figiel Tested by: Michael Figiel MFC after: 2 weeks Modified: head/sys/dev/atkbdc/atkbdc.c head/sys/dev/atkbdc/atkbdcreg.h head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/atkbdc.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc.c Sat Nov 24 21:17:51 2018 (r340912) +++ head/sys/dev/atkbdc/atkbdc.c Sat Nov 24 21:23:12 2018 (r340913) @@ -296,6 +296,7 @@ atkbdc_setup(atkbdc_softc_t *sc, bus_space_tag_t tag, sc->lock = FALSE; sc->kbd.head = sc->kbd.tail = 0; sc->aux.head = sc->aux.tail = 0; + sc->aux_mux_enabled = FALSE; #if KBDIO_DEBUG >= 2 sc->kbd.call_count = 0; sc->kbd.qcount = sc->kbd.max_qcount = 0; @@ -639,7 +640,12 @@ write_kbd_command(KBDC p, int c) int write_aux_command(KBDC p, int c) { - if (!write_controller_command(p, KBDC_WRITE_TO_AUX)) + int f; + + f = aux_mux_is_enabled(p) ? + KBDC_WRITE_TO_AUX_MUX + kbdcp(p)->aux_mux_port : KBDC_WRITE_TO_AUX; + + if (!write_controller_command(p, f)) return FALSE; return write_controller_data(p, c); } @@ -1200,4 +1206,79 @@ set_controller_command_byte(KBDC p, int mask, int comm command); return TRUE; +} + +/* + * Rudimentary support for active PS/2 AUX port multiplexing. + * Only write commands can be routed to a selected AUX port. + * Source port of data processed by read commands is totally ignored. + */ +static int +set_aux_mux_state(KBDC p, int enabled) +{ + int command, version; + + if (write_controller_command(p, KBDC_FORCE_AUX_OUTPUT) == 0 || + write_controller_data(p, 0xF0) == 0 || + read_controller_data(p) != 0xF0) + return (-1); + + if (write_controller_command(p, KBDC_FORCE_AUX_OUTPUT) == 0 || + write_controller_data(p, 0x56) == 0 || + read_controller_data(p) != 0x56) + return (-1); + + command = enabled ? 0xa4 : 0xa5; + if (write_controller_command(p, KBDC_FORCE_AUX_OUTPUT) == 0 || + write_controller_data(p, command) == 0 || + (version = read_controller_data(p)) == command) + return (-1); + + return (version); +} + +int +set_active_aux_mux_port(KBDC p, int port) +{ + + if (!aux_mux_is_enabled(p)) + return (FALSE); + + if (port < 0 || port >= KBDC_AUX_MUX_NUM_PORTS) + return (FALSE); + + kbdcp(p)->aux_mux_port = port; + + return (TRUE); +} + +/* Checks for active multiplexing support and enables it */ +int +enable_aux_mux(KBDC p) +{ + int version; + + version = set_aux_mux_state(p, TRUE); + if (version >= 0) { + kbdcp(p)->aux_mux_enabled = TRUE; + set_active_aux_mux_port(p, 0); + } + + return (version); +} + +int +disable_aux_mux(KBDC p) +{ + + kbdcp(p)->aux_mux_enabled = FALSE; + + return (set_aux_mux_state(p, FALSE)); +} + +int +aux_mux_is_enabled(KBDC p) +{ + + return (kbdcp(p)->aux_mux_enabled); } Modified: head/sys/dev/atkbdc/atkbdcreg.h ============================================================================== --- head/sys/dev/atkbdc/atkbdcreg.h Sat Nov 24 21:17:51 2018 (r340912) +++ head/sys/dev/atkbdc/atkbdcreg.h Sat Nov 24 21:23:12 2018 (r340913) @@ -51,6 +51,8 @@ /* controller commands (sent to KBD_COMMAND_PORT) */ #define KBDC_SET_COMMAND_BYTE 0x0060 #define KBDC_GET_COMMAND_BYTE 0x0020 +#define KBDC_WRITE_TO_AUX_MUX 0x0090 +#define KBDC_FORCE_AUX_OUTPUT 0x00d3 #define KBDC_WRITE_TO_AUX 0x00d4 #define KBDC_DISABLE_AUX_PORT 0x00a7 #define KBDC_ENABLE_AUX_PORT 0x00a8 @@ -209,6 +211,8 @@ typedef struct atkbdc_softc { #define KBDC_QUIRK_IGNORE_PROBE_RESULT (1 << 1) #define KBDC_QUIRK_RESET_AFTER_PROBE (1 << 2) #define KBDC_QUIRK_SETLEDS_ON_INIT (1 << 3) + int aux_mux_enabled; /* active PS/2 multiplexing is enabled */ + int aux_mux_port; /* current aux mux port */ } atkbdc_softc_t; enum kbdc_device_ivar { @@ -223,6 +227,8 @@ typedef caddr_t KBDC; #define KBDC_RID_KBD 0 #define KBDC_RID_AUX 1 +#define KBDC_AUX_MUX_NUM_PORTS 4 + /* function prototypes */ atkbdc_softc_t *atkbdc_get_softc(int unit); @@ -267,6 +273,11 @@ void kbdc_set_device_mask(KBDC kbdc, int mask); int get_controller_command_byte(KBDC kbdc); int set_controller_command_byte(KBDC kbdc, int command, int flag); + +int set_active_aux_mux_port(KBDC p, int port); +int enable_aux_mux(KBDC p); +int disable_aux_mux(KBDC p); +int aux_mux_is_enabled(KBDC p); #endif /* _KERNEL */ Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sat Nov 24 21:17:51 2018 (r340912) +++ head/sys/dev/atkbdc/psm.c Sat Nov 24 21:23:12 2018 (r340913) @@ -150,6 +150,9 @@ struct psmcpnp_softc { #define PSM_LEVEL_MIN PSM_LEVEL_BASE #define PSM_LEVEL_MAX PSM_LEVEL_NATIVE +/* Active PS/2 multiplexing */ +#define PSM_NOMUX (-1) + /* Logitech PS2++ protocol */ #define MOUSE_PS2PLUS_CHECKBITS(b) \ ((((b[2] & 0x03) << 2) | 0x02) == (b[1] & 0x0f)) @@ -438,6 +441,11 @@ struct psm_softc { /* Driver status information */ int cmdcount; struct sigio *async; /* Processes waiting for SIGIO */ int extended_buttons; + int muxport; /* MUX port with attached Synaptics */ + u_char muxsave[3]; /* 3->6 byte proto conversion buffer */ + int muxtpbuttons; /* Touchpad button state */ + int muxmsbuttons; /* Mouse (trackpoint) button state */ + struct timeval muxmidtimeout; /* middle button supression timeout */ #ifdef EVDEV_SUPPORT struct evdev_dev *evdev_a; /* Absolute reporting device */ struct evdev_dev *evdev_r; /* Relative reporting device */ @@ -603,6 +611,7 @@ static void proc_mmanplus(struct psm_softc *, packetbu mousestatus_t *, int *, int *, int *); static int proc_synaptics(struct psm_softc *, packetbuf_t *, mousestatus_t *, int *, int *, int *); +static int proc_synaptics_mux(struct psm_softc *, packetbuf_t *); static void proc_versapad(struct psm_softc *, packetbuf_t *, mousestatus_t *, int *, int *, int *); static int proc_elantech(struct psm_softc *, packetbuf_t *, @@ -632,6 +641,7 @@ static probefunc_t enable_4dmouse; static probefunc_t enable_4dplus; static probefunc_t enable_mmanplus; static probefunc_t enable_synaptics; +static probefunc_t enable_synaptics_mux; static probefunc_t enable_trackpoint; static probefunc_t enable_versapad; static probefunc_t enable_elantech; @@ -652,6 +662,8 @@ static struct { * WARNING: the order of probe is very important. Don't mess it * unless you know what you are doing. */ + { MOUSE_MODEL_SYNAPTICS, /* Synaptics Touchpad on Active Mux */ + 0x00, MOUSE_PS2_PACKETSIZE, enable_synaptics_mux }, { MOUSE_MODEL_NET, /* Genius NetMouse */ 0x08, MOUSE_PS2INTELLI_PACKETSIZE, enable_gmouse }, { MOUSE_MODEL_NETSCROLL, /* Genius NetScroll */ @@ -1082,6 +1094,7 @@ static int doopen(struct psm_softc *sc, int command_byte) { int stat[3]; + int mux_enabled = FALSE; /* * FIXME: Synaptics TouchPad seems to go back to Relative Mode with @@ -1096,6 +1109,15 @@ doopen(struct psm_softc *sc, int command_byte) * doesn't show any evidence of such a command. */ if (sc->hw.model == MOUSE_MODEL_SYNAPTICS) { + if (sc->muxport != PSM_NOMUX) { + mux_enabled = enable_aux_mux(sc->kbdc) >= 0; + if (mux_enabled) + set_active_aux_mux_port(sc->kbdc, sc->muxport); + else + log(LOG_ERR, "psm%d: failed to enable " + "active multiplexing mode.\n", + sc->unit); + } mouse_ext_command(sc->kbdc, 1); get_mouse_status(sc->kbdc, stat, 0, 3); if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) || @@ -1106,6 +1128,8 @@ doopen(struct psm_softc *sc, int command_byte) "hopefully restored\n", sc->unit)); } + if (mux_enabled) + disable_aux_mux(sc->kbdc); } /* @@ -1354,6 +1378,7 @@ psmprobe(device_t dev) #endif #endif /* PSM_HOOKRESUME | PSM_HOOKAPM */ sc->flags = 0; + sc->muxport = PSM_NOMUX; if (bootverbose) ++verbose; @@ -1823,7 +1848,7 @@ psm_register_synaptics(device_t dev) evdev_support_key(evdev_a, BTN_0 + i); error = evdev_register_mtx(evdev_a, &Giant); - if (!error && sc->synhw.capPassthrough) { + if (!error && (sc->synhw.capPassthrough || sc->muxport != PSM_NOMUX)) { guest_model = sc->tpinfo.sysctl_tree != NULL ? MOUSE_MODEL_TRACKPOINT : MOUSE_MODEL_GENERIC; error = psm_register(dev, guest_model); @@ -2931,6 +2956,9 @@ psmintr(void *arg) int c; packetbuf_t *pb; + if (aux_mux_is_enabled(sc->kbdc)) + VLOG(2, (LOG_DEBUG, "psmintr: active multiplexing mode is not " + "supported!\n")); /* read until there is nothing to read */ while((c = read_aux_data_no_wait(sc->kbdc)) != -1) { @@ -3282,7 +3310,7 @@ proc_synaptics(struct psm_softc *sc, packetbuf_t *pb, * Handle packets from the guest device. See: * Synaptics PS/2 TouchPad Interfacing Guide, Section 5.1 */ - if (sc->synhw.capPassthrough) { + if (sc->synhw.capPassthrough || sc->muxport != PSM_NOMUX) { *x = ((pb->ipacket[1] & 0x10) ? pb->ipacket[4] - 256 : pb->ipacket[4]); *y = ((pb->ipacket[1] & 0x20) ? @@ -3582,6 +3610,83 @@ SYNAPTICS_END: } static int +proc_synaptics_mux(struct psm_softc *sc, packetbuf_t *pb) +{ + int butt; + + /* + * Convert 3-byte interleaved mixture of Synaptics and generic mouse + * packets into plain 6-byte Synaptics packet protocol. + * While in hidden multiplexing mode KBC does some editing of the + * packet stream. It remembers the button bits from the last packet + * received from each device, and replaces the button bits of every + * packet with the logical OR of all devices’ most recent button bits. + * This button crosstalk should be filtered out as Synaptics and + * generic mouse encode middle button presses in a different way. + */ + switch (pb->ipacket[0] & 0xc0) { + case 0x80: /* First 3 bytes of Synaptics packet */ + bcopy(pb->ipacket, sc->muxsave, 3); + /* Compute middle mouse button supression timeout. */ + sc->muxmidtimeout.tv_sec = 0; + sc->muxmidtimeout.tv_usec = 50000; /* ~2-3 ints */ + timevaladd(&sc->muxmidtimeout, &sc->lastsoftintr); + return (1); + + case 0xc0: /* Second 3 bytes of Synaptics packet */ + /* Join two 3-bytes absolute packets */ + bcopy(pb->ipacket, pb->ipacket + 3, 3); + bcopy(sc->muxsave, pb->ipacket, 3); + /* Prefer trackpoint buttons over touchpad's */ + pb->ipacket[0] &= ~(0x08 | sc->muxmsbuttons); + pb->ipacket[3] &= ~(0x08 | sc->muxmsbuttons); + butt = (pb->ipacket[3] & 0x03) << 2 | (pb->ipacket[0] & 0x03); + /* Add hysteresis to remove spurious middle button events */ + if (butt != sc->muxtpbuttons && sc->fpcount < 1) { + pb->ipacket[0] &= 0xfc; + pb->ipacket[0] |= sc->muxtpbuttons & 0x03; + pb->ipacket[3] &= 0xfc; + pb->ipacket[3] |= sc->muxtpbuttons >> 2 & 0x03; + ++sc->fpcount; + } else { + sc->fpcount = 0; + sc->muxtpbuttons = butt; + } + /* Filter out impossible w induced by middle trackpoint btn */ + if (sc->synhw.capExtended && !sc->synhw.capPassthrough && + (pb->ipacket[0] & 0x34) == 0x04 && + (pb->ipacket[3] & 0x04) == 0x04) { + pb->ipacket[0] &= 0xfb; + pb->ipacket[3] &= 0xfb; + } + sc->muxsave[0] &= 0x30; + break; + + default: /* Generic mouse (Trackpoint) packet */ + /* Filter out middle button events induced by some w values */ + if (sc->muxmsbuttons & 0x03 || pb->ipacket[0] & 0x03 || + (timevalcmp(&sc->lastsoftintr, &sc->muxmidtimeout, <=) && + (sc->muxsave[0] & 0x30 || sc->muxsave[2] > 8))) + pb->ipacket[0] &= 0xfb; + sc->muxmsbuttons = pb->ipacket[0] & 0x07; + /* Convert to Synaptics pass-through protocol */ + pb->ipacket[4] = pb->ipacket[1]; + pb->ipacket[5] = pb->ipacket[2]; + pb->ipacket[1] = pb->ipacket[0]; + pb->ipacket[2] = 0; + pb->ipacket[0] = 0x84 | (sc->muxtpbuttons & 0x03); + pb->ipacket[3] = 0xc4 | (sc->muxtpbuttons >> 2 & 0x03); + } + + VLOG(4, (LOG_DEBUG, "synaptics: %02x %02x %02x %02x %02x %02x\n", + pb->ipacket[0], pb->ipacket[1], pb->ipacket[2], + pb->ipacket[3], pb->ipacket[4], pb->ipacket[5])); + + pb->inputbytes = MOUSE_SYNAPTICS_PACKETSIZE; + return (0); +} + +static int psmpalmdetect(struct psm_softc *sc, finger_t *f, int nfingers) { if (!( @@ -4919,6 +5024,10 @@ psmsoftintr(void *arg) break; case MOUSE_MODEL_SYNAPTICS: + if (pb->inputbytes == MOUSE_PS2_PACKETSIZE) + if (proc_synaptics_mux(sc, pb)) + goto next; + if (proc_synaptics(sc, pb, &ms, &x, &y, &z) != 0) { VLOG(3, (LOG_DEBUG, "synaptics: " "packet rejected\n")); @@ -6027,6 +6136,60 @@ synaptics_set_mode(struct psm_softc *sc, int mode_byte mouse_ext_command(sc->kbdc, 3); set_mouse_sampling_rate(sc->kbdc, 0xc8); } +} + +/* + * AUX MUX detection code should be placed at very beginning of probe sequence + * at least before 4-byte protocol mouse probes e.g. MS IntelliMouse probe as + * latter can trigger switching the MUX to incompatible state. + */ +static int +enable_synaptics_mux(struct psm_softc *sc, enum probearg arg) +{ + KBDC kbdc = sc->kbdc; + int port, version; + int probe = FALSE; + int active_ports_count = 0; + int active_ports_mask = 0; + + version = enable_aux_mux(kbdc); + if (version == -1) + return (FALSE); + + for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) { + VLOG(3, (LOG_DEBUG, "aux_mux: ping port %d\n", port)); + set_active_aux_mux_port(kbdc, port); + if (enable_aux_dev(kbdc) && disable_aux_dev(kbdc)) { + active_ports_count++; + active_ports_mask |= 1 << port; + } + } + + if (verbose >= 2) + printf("Active Multiplexing PS/2 controller v%d.%d with %d " + "active port(s)\n", version >> 4 & 0x0f, version & 0x0f, + active_ports_count); + + /* psm has a special support for GenMouse + SynTouchpad combination */ + if (active_ports_count >= 2) { + for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) { + if ((active_ports_mask & 1 << port) == 0) + continue; + VLOG(3, (LOG_DEBUG, "aux_mux: probe port %d\n", port)); + set_active_aux_mux_port(kbdc, port); + probe = enable_synaptics(sc, arg); + if (probe) { + if (arg == PROBE) + sc->muxport = port; + break; + } + } + } + + /* IRQ handler does not support active multiplexing mode */ + disable_aux_mux(kbdc); + + return (probe); } static int From owner-svn-src-head@freebsd.org Sat Nov 24 21:52:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F9CF113AE8B; Sat, 24 Nov 2018 21:52:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 456088DEDA; Sat, 24 Nov 2018 21:52:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27EB113B6A; Sat, 24 Nov 2018 21:52:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOLqAsu060245; Sat, 24 Nov 2018 21:52:10 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOLqAD6060244; Sat, 24 Nov 2018 21:52:10 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201811242152.wAOLqAD6060244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 24 Nov 2018 21:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340914 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 340914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 456088DEDA X-Spamd-Result: default: False [1.65 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.71)[0.712,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.30)[0.299,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 21:52:11 -0000 Author: alc Date: Sat Nov 24 21:52:10 2018 New Revision: 340914 URL: https://svnweb.freebsd.org/changeset/base/340914 Log: blist_meta_alloc assumes that mask=scan->bm_bitmap is nonzero. But if the cursor lies in the middle of the space that the meta node represents, then blanking the low bits of mask may make it zero, and break later code that expects a nonzero value. Add a test that returns failure if the mask has been cleared. Submitted by: Doug Moore Reported by: pho Tested by: pho X-MFC with: r340402 Differential Revision: https://reviews.freebsd.org/D18058 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Sat Nov 24 21:23:12 2018 (r340913) +++ head/sys/kern/subr_blist.c Sat Nov 24 21:52:10 2018 (r340914) @@ -764,6 +764,8 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ /* Discard any candidates that appear before cursor. */ digit = (cursor / radix) & BLIST_META_MASK; mask &= (u_daddr_t)-1 << digit; + if (mask == 0) + return (SWAPBLK_NONE); /* * If the first try is for a block that includes the cursor, pre-undo