From owner-svn-src-all@freebsd.org Sun Apr 8 00:56:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B82C8F940C8; Sun, 8 Apr 2018 00:56:21 +0000 (UTC) (envelope-from gonzo@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 6C08A73974; Sun, 8 Apr 2018 00:56:21 +0000 (UTC) (envelope-from gonzo@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 65F525E2; Sun, 8 Apr 2018 00:56:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w380uLMU024113; Sun, 8 Apr 2018 00:56:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w380uKAg024101; Sun, 8 Apr 2018 00:56:20 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804080056.w380uKAg024101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Apr 2018 00:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332262 - in head/sys: arm/broadcom/bcm2835 arm/conf dts/arm X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 arm/conf dts/arm X-SVN-Commit-Revision: 332262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 00:56:22 -0000 Author: gonzo Date: Sun Apr 8 00:56:19 2018 New Revision: 332262 URL: https://svnweb.freebsd.org/changeset/base/332262 Log: [rpi] Add fdt_pinctrl(4) support to Raspberry Pi GPIO driver On Raspberry Pi platform GPIO controller also responsible for pins multiplexing. Pi code predates proper FDT support in FreeBSD so a lot of pinmux info is hardcoded. This patch: - Implements pinctl methods in bcm2835_gpio - Converts all devices with ad-hoc pinmux info to proper pin control mechanisms and adds pinmux info in FreeBSD's custom dts files. - Adds fdt_pinctrl option to RPI2 and RPI-B kernels - Adds SPI pinmux config to FreeBSD's customization of GNU DTS. Reviewed by: imp, manu Differential Revision: https://reviews.freebsd.org/D14104 Deleted: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_intr.c head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c head/sys/arm/broadcom/bcm2835/bcm2835_spi.c head/sys/arm/broadcom/bcm2835/bcm2835_spivar.h head/sys/arm/broadcom/bcm2835/bcm2836.c head/sys/arm/conf/RPI-B head/sys/arm/conf/RPI2 head/sys/dts/arm/rpi.dts head/sys/dts/arm/rpi2.dts Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Sun Apr 8 00:56:19 2018 (r332262) @@ -100,7 +100,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -298,9 +297,7 @@ static int bcm_bsc_attach(device_t dev) { struct bcm_bsc_softc *sc; - unsigned long start; - device_t gpio; - int i, rid; + int rid; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -315,31 +312,6 @@ bcm_bsc_attach(device_t dev) sc->sc_bst = rman_get_bustag(sc->sc_mem_res); sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); - - /* Check the unit we are attaching by its base address. */ - start = rman_get_start(sc->sc_mem_res); - for (i = 0; i < nitems(bcm_bsc_pins); i++) { - if (bcm_bsc_pins[i].start == (start & BCM_BSC_BASE_MASK)) - break; - } - if (i == nitems(bcm_bsc_pins)) { - device_printf(dev, "only bsc0 and bsc1 are supported\n"); - bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); - return (ENXIO); - } - - /* - * Configure the GPIO pins to ALT0 function to enable BSC control - * over the pins. - */ - gpio = devclass_get_device(devclass_find("gpio"), 0); - if (!gpio) { - device_printf(dev, "cannot find gpio0\n"); - bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); - return (ENXIO); - } - bcm_gpio_set_alternate(gpio, bcm_bsc_pins[i].sda, BCM_GPIO_ALT0); - bcm_gpio_set_alternate(gpio, bcm_bsc_pins[i].scl, BCM_GPIO_ALT0); rid = 0; sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h Sun Apr 8 00:56:19 2018 (r332262) @@ -32,16 +32,6 @@ #ifndef _BCM2835_BSCVAR_H #define _BCM2835_BSCVAR_H -struct { - uint32_t sda; - uint32_t scl; - unsigned long start; -} bcm_bsc_pins[] = { - { 0, 1, 0x205000 }, /* BSC0 GPIO pins and base address. */ - { 2, 3, 0x804000 } /* BSC1 GPIO pins and base address. */ -}; -#define BCM_BSC_BASE_MASK 0x00ffffff - struct iic_msg; struct bcm_bsc_softc { Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sun Apr 8 00:56:19 2018 (r332262) @@ -48,11 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#include - #include "gpio_if.h" #include "pic_if.h" @@ -73,6 +72,19 @@ __FBSDID("$FreeBSD$"); GPIO_INTR_LEVEL_HIGH | GPIO_INTR_EDGE_RISING | \ GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH) +#define BCM2835_FSEL_GPIO_IN 0 +#define BCM2835_FSEL_GPIO_OUT 1 +#define BCM2835_FSEL_ALT5 2 +#define BCM2835_FSEL_ALT4 3 +#define BCM2835_FSEL_ALT0 4 +#define BCM2835_FSEL_ALT1 5 +#define BCM2835_FSEL_ALT2 6 +#define BCM2835_FSEL_ALT3 7 + +#define BCM2835_PUD_OFF 0 +#define BCM2835_PUD_DOWN 1 +#define BCM2835_PUD_UP 2 + static struct resource_spec bcm_gpio_res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, /* bank 0 interrupt */ @@ -187,28 +199,28 @@ bcm_gpio_func_str(uint32_t nfunc, char *buf, int bufsi { switch (nfunc) { - case BCM_GPIO_INPUT: + case BCM2835_FSEL_GPIO_IN: strncpy(buf, "input", bufsize); break; - case BCM_GPIO_OUTPUT: + case BCM2835_FSEL_GPIO_OUT: strncpy(buf, "output", bufsize); break; - case BCM_GPIO_ALT0: + case BCM2835_FSEL_ALT0: strncpy(buf, "alt0", bufsize); break; - case BCM_GPIO_ALT1: + case BCM2835_FSEL_ALT1: strncpy(buf, "alt1", bufsize); break; - case BCM_GPIO_ALT2: + case BCM2835_FSEL_ALT2: strncpy(buf, "alt2", bufsize); break; - case BCM_GPIO_ALT3: + case BCM2835_FSEL_ALT3: strncpy(buf, "alt3", bufsize); break; - case BCM_GPIO_ALT4: + case BCM2835_FSEL_ALT4: strncpy(buf, "alt4", bufsize); break; - case BCM_GPIO_ALT5: + case BCM2835_FSEL_ALT5: strncpy(buf, "alt5", bufsize); break; default: @@ -221,21 +233,21 @@ bcm_gpio_str_func(char *func, uint32_t *nfunc) { if (strcasecmp(func, "input") == 0) - *nfunc = BCM_GPIO_INPUT; + *nfunc = BCM2835_FSEL_GPIO_IN; else if (strcasecmp(func, "output") == 0) - *nfunc = BCM_GPIO_OUTPUT; + *nfunc = BCM2835_FSEL_GPIO_OUT; else if (strcasecmp(func, "alt0") == 0) - *nfunc = BCM_GPIO_ALT0; + *nfunc = BCM2835_FSEL_ALT0; else if (strcasecmp(func, "alt1") == 0) - *nfunc = BCM_GPIO_ALT1; + *nfunc = BCM2835_FSEL_ALT1; else if (strcasecmp(func, "alt2") == 0) - *nfunc = BCM_GPIO_ALT2; + *nfunc = BCM2835_FSEL_ALT2; else if (strcasecmp(func, "alt3") == 0) - *nfunc = BCM_GPIO_ALT3; + *nfunc = BCM2835_FSEL_ALT3; else if (strcasecmp(func, "alt4") == 0) - *nfunc = BCM_GPIO_ALT4; + *nfunc = BCM2835_FSEL_ALT4; else if (strcasecmp(func, "alt5") == 0) - *nfunc = BCM_GPIO_ALT5; + *nfunc = BCM2835_FSEL_ALT5; else return (-1); @@ -247,9 +259,9 @@ bcm_gpio_func_flag(uint32_t nfunc) { switch (nfunc) { - case BCM_GPIO_INPUT: + case BCM2835_FSEL_GPIO_IN: return (GPIO_PIN_INPUT); - case BCM_GPIO_OUTPUT: + case BCM2835_FSEL_GPIO_OUT: return (GPIO_PIN_OUTPUT); } return (0); @@ -288,7 +300,7 @@ bcm_gpio_set_pud(struct bcm_gpio_softc *sc, uint32_t p BCM_GPIO_WRITE(sc, BCM_GPIO_GPPUDCLK(bank), 0); } -void +static void bcm_gpio_set_alternate(device_t dev, uint32_t pin, uint32_t nfunc) { struct bcm_gpio_softc *sc; @@ -297,10 +309,7 @@ bcm_gpio_set_alternate(device_t dev, uint32_t pin, uin sc = device_get_softc(dev); BCM_GPIO_LOCK(sc); - /* Disable pull-up or pull-down on pin. */ - bcm_gpio_set_pud(sc, pin, BCM_GPIO_NONE); - - /* And now set the pin function. */ + /* Set the pin function. */ bcm_gpio_set_function(sc, pin, nfunc); /* Update the pin flags. */ @@ -329,11 +338,11 @@ bcm_gpio_pin_configure(struct bcm_gpio_softc *sc, stru if (flags & GPIO_PIN_OUTPUT) { pin->gp_flags |= GPIO_PIN_OUTPUT; bcm_gpio_set_function(sc, pin->gp_pin, - BCM_GPIO_OUTPUT); + BCM2835_FSEL_GPIO_OUT); } else { pin->gp_flags |= GPIO_PIN_INPUT; bcm_gpio_set_function(sc, pin->gp_pin, - BCM_GPIO_INPUT); + BCM2835_FSEL_GPIO_IN); } } @@ -793,6 +802,9 @@ bcm_gpio_attach(device_t dev) if (sc->sc_busdev == NULL) goto fail; + fdt_pinctrl_register(dev, "brcm,pins"); + fdt_pinctrl_configure_tree(dev); + return (0); fail: @@ -1187,6 +1199,84 @@ bcm_gpio_get_node(device_t bus, device_t dev) return (ofw_bus_get_node(bus)); } +static int +bcm_gpio_configure_pins(device_t dev, phandle_t cfgxref) +{ + phandle_t cfgnode; + int i, pintuples, pulltuples; + uint32_t pin; + uint32_t *pins; + uint32_t *pulls; + uint32_t function; + static struct bcm_gpio_softc *sc; + + sc = device_get_softc(dev); + cfgnode = OF_node_from_xref(cfgxref); + + pins = NULL; + pintuples = OF_getencprop_alloc(cfgnode, "brcm,pins", sizeof(*pins), + (void **)&pins); + + char name[32]; + OF_getprop(cfgnode, "name", &name, sizeof(name)); + + if (pintuples < 0) + return (ENOENT); + + if (pintuples == 0) + return (0); /* Empty property is not an error. */ + + if (OF_getencprop(cfgnode, "brcm,function", &function, + sizeof(function)) <= 0) { + OF_prop_free(pins); + return (EINVAL); + } + + pulls = NULL; + pulltuples = OF_getencprop_alloc(cfgnode, "brcm,pull", sizeof(*pulls), + (void **)&pulls); + + if ((pulls != NULL) && (pulltuples != pintuples)) { + OF_prop_free(pins); + OF_prop_free(pulls); + return (EINVAL); + } + + for (i = 0; i < pintuples; i++) { + pin = pins[i]; + bcm_gpio_set_alternate(dev, pin, function); + if (bootverbose) + device_printf(dev, "set pin %d to func %d", pin, function); + if (pulls) { + if (bootverbose) + printf(", pull %d", pulls[i]); + switch (pulls[i]) { + /* Convert to gpio(4) flags */ + case BCM2835_PUD_OFF: + bcm_gpio_pin_setflags(dev, pin, 0); + break; + case BCM2835_PUD_UP: + bcm_gpio_pin_setflags(dev, pin, GPIO_PIN_PULLUP); + break; + case BCM2835_PUD_DOWN: + bcm_gpio_pin_setflags(dev, pin, GPIO_PIN_PULLDOWN); + break; + default: + printf("%s: invalid pull value for pin %d: %d\n", + name, pin, pulls[i]); + } + } + if (bootverbose) + printf("\n"); + } + + OF_prop_free(pins); + if (pulls) + OF_prop_free(pulls); + + return (0); +} + static device_method_t bcm_gpio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bcm_gpio_probe), @@ -1217,6 +1307,9 @@ static device_method_t bcm_gpio_methods[] = { /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, bcm_gpio_get_node), + /* fdt_pinctrl interface */ + DEVMETHOD(fdt_pinctrl_configure, bcm_gpio_configure_pins), + DEVMETHOD_END }; @@ -1228,4 +1321,4 @@ static driver_t bcm_gpio_driver = { sizeof(struct bcm_gpio_softc), }; -DRIVER_MODULE(bcm_gpio, simplebus, bcm_gpio_driver, bcm_gpio_devclass, 0, 0); +EARLY_DRIVER_MODULE(bcm_gpio, simplebus, bcm_gpio_driver, bcm_gpio_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Sun Apr 8 00:56:19 2018 (r332262) @@ -452,4 +452,4 @@ static driver_t bcm_intc_driver = { static devclass_t bcm_intc_devclass; EARLY_DRIVER_MODULE(intc, simplebus, bcm_intc_driver, bcm_intc_devclass, - 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Sun Apr 8 00:56:19 2018 (r332262) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include static struct ofw_compat_data compat_data[] = { @@ -93,7 +92,6 @@ static int bcm_pwm_reconf(struct bcm_pwm_softc *sc) { uint32_t u; - device_t gpio; /* Disable PWM */ W_CTL(sc, 0); @@ -103,14 +101,6 @@ bcm_pwm_reconf(struct bcm_pwm_softc *sc) if (sc->mode == 0) return (0); - - /* Ask GPIO0 to set ALT0 for pin 12 */ - gpio = devclass_get_device(devclass_find("gpio"), 0); - if (!gpio) { - device_printf(sc->sc_dev, "cannot find gpio0\n"); - return (ENXIO); - } - bcm_gpio_set_alternate(gpio, 12, BCM_GPIO_ALT0); u = bcm2835_clkman_set_frequency(sc->clkman, BCM_PWM_CLKSRC, sc->freq); if (u == 0) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Sun Apr 8 00:56:19 2018 (r332262) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -250,8 +249,7 @@ static int bcm_spi_attach(device_t dev) { struct bcm_spi_softc *sc; - device_t gpio; - int i, rid; + int rid; if (device_get_unit(dev) != 0) { device_printf(dev, "only one SPI controller supported\n"); @@ -260,15 +258,6 @@ bcm_spi_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; - - /* Configure the GPIO pins to ALT0 function to enable SPI the pins. */ - gpio = devclass_get_device(devclass_find("gpio"), 0); - if (!gpio) { - device_printf(dev, "cannot find gpio0\n"); - return (ENXIO); - } - for (i = 0; i < nitems(bcm_spi_pins); i++) - bcm_gpio_set_alternate(gpio, bcm_spi_pins[i], BCM_GPIO_ALT0); rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spivar.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_spivar.h Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spivar.h Sun Apr 8 00:56:19 2018 (r332262) @@ -32,18 +32,6 @@ #ifndef _BCM2835_SPIVAR_H_ #define _BCM2835_SPIVAR_H_ -/* - * Only the available pins are listed here. - * i.e. CS2 isn't available. - */ -uint32_t bcm_spi_pins[] = { - 7, /* CS1 */ - 8, /* CS0 */ - 9, /* MISO */ - 10, /* MOSI */ - 11 /* SCLK */ -}; - struct bcm_spi_softc { device_t sc_dev; struct mtx sc_mtx; Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836.c Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Sun Apr 8 00:56:19 2018 (r332262) @@ -736,4 +736,4 @@ static driver_t bcm_lintc_driver = { static devclass_t bcm_lintc_devclass; EARLY_DRIVER_MODULE(local_intc, simplebus, bcm_lintc_driver, bcm_lintc_devclass, - 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); + 0, 0, BUS_PASS_INTERRUPT); Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/arm/conf/RPI-B Sun Apr 8 00:56:19 2018 (r332262) @@ -90,6 +90,8 @@ device bcm2835_spi device vchiq device sound +device fdt_pinctrl + # Flattened Device Tree options FDT # Configure using FDT/DTB data # Note: DTB is normally loaded and modified by RPi boot loader, then Modified: head/sys/arm/conf/RPI2 ============================================================================== --- head/sys/arm/conf/RPI2 Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/arm/conf/RPI2 Sun Apr 8 00:56:19 2018 (r332262) @@ -93,6 +93,8 @@ device bcm2835_spi device vchiq device sound +device fdt_pinctrl + # Flattened Device Tree options FDT # Configure using FDT/DTB data # Note: DTB is normally loaded and modified by RPi boot loader, then Modified: head/sys/dts/arm/rpi.dts ============================================================================== --- head/sys/dts/arm/rpi.dts Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/dts/arm/rpi.dts Sun Apr 8 00:56:19 2018 (r332262) @@ -53,6 +53,10 @@ spi@7e204000 { status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins &spi0_cs_pins>; + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins &spi0_cs_pins>; }; gpio@7e200000 { @@ -67,6 +71,16 @@ broadcom,pins = <48>, <49>, <50>, <51>, <52>, <53>; }; + + spi0_pins: spi0_pins { + brcm,pins = <9 10 11>; + brcm,function = <4>; /* alt0 */ + }; + + spi0_cs_pins: spi0_cs_pins { + brcm,pins = <8 7>; + brcm,function = <1>; /* output */ + }; } vchiq { @@ -89,4 +103,3 @@ }; }; - Modified: head/sys/dts/arm/rpi2.dts ============================================================================== --- head/sys/dts/arm/rpi2.dts Sat Apr 7 23:31:55 2018 (r332261) +++ head/sys/dts/arm/rpi2.dts Sun Apr 8 00:56:19 2018 (r332262) @@ -53,6 +53,8 @@ spi@7e204000 { status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins &spi0_cs_pins>; }; gpio@7e200000 { @@ -66,6 +68,16 @@ pins_reserved: reserved { broadcom,pins = <48>, <49>, <50>, <51>, <52>, <53>; + }; + + spi0_pins: spi0_pins { + brcm,pins = <9 10 11>; + brcm,function = <4>; /* alt0 */ + }; + + spi0_cs_pins: spi0_cs_pins { + brcm,pins = <8 7>; + brcm,function = <1>; /* output */ }; } From owner-svn-src-all@freebsd.org Sun Apr 8 01:32:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89857F9679A; Sun, 8 Apr 2018 01:32:59 +0000 (UTC) (envelope-from mp@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 32E4B879EA; Sun, 8 Apr 2018 01:32:59 +0000 (UTC) (envelope-from mp@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 2CEA0CB2; Sun, 8 Apr 2018 01:32:59 +0000 (UTC) (envelope-from mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w381WxQP043814; Sun, 8 Apr 2018 01:32:59 GMT (envelope-from mp@FreeBSD.org) Received: (from mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w381Wuob043783; Sun, 8 Apr 2018 01:32:56 GMT (envelope-from mp@FreeBSD.org) Message-Id: <201804080132.w381Wuob043783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mp set sender to mp@FreeBSD.org using -f From: Mark Peek Date: Sun, 8 Apr 2018 01:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332263 - in head: share/man/man4 sys/dev/vmware/vmci sys/modules/vmware/vmci X-SVN-Group: head X-SVN-Commit-Author: mp X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/vmware/vmci sys/modules/vmware/vmci X-SVN-Commit-Revision: 332263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 01:32:59 -0000 Author: mp Date: Sun Apr 8 01:32:56 2018 New Revision: 332263 URL: https://svnweb.freebsd.org/changeset/base/332263 Log: Update VMCI license based on comments from core, the FreeBSD Foundation, and VMware legal: - Add a dual BSD-2 Clause/GPLv2 LICENSE file in the VMCI directory - Remove the use of "All Rights Reserved" - Per best practice, remove copyright/license info from Makefile Reviewed by: imp, emaste, jhb, Vishnu Dasa Approved by: VMware legal via Mark Peek Differential Revision: https://reviews.freebsd.org/D14979 Added: head/sys/dev/vmware/vmci/LICENSE (contents, props changed) Modified: head/share/man/man4/vmci.4 head/sys/dev/vmware/vmci/vmci.c head/sys/dev/vmware/vmci/vmci.h head/sys/dev/vmware/vmci/vmci_call_defs.h head/sys/dev/vmware/vmci/vmci_datagram.c head/sys/dev/vmware/vmci/vmci_datagram.h head/sys/dev/vmware/vmci/vmci_defs.h head/sys/dev/vmware/vmci/vmci_doorbell.c head/sys/dev/vmware/vmci/vmci_doorbell.h head/sys/dev/vmware/vmci/vmci_driver.c head/sys/dev/vmware/vmci/vmci_driver.h head/sys/dev/vmware/vmci/vmci_event.c head/sys/dev/vmware/vmci/vmci_event.h head/sys/dev/vmware/vmci/vmci_hashtable.c head/sys/dev/vmware/vmci/vmci_hashtable.h head/sys/dev/vmware/vmci/vmci_kernel_api.h head/sys/dev/vmware/vmci/vmci_kernel_api_1.h head/sys/dev/vmware/vmci/vmci_kernel_api_2.h head/sys/dev/vmware/vmci/vmci_kernel_defs.h head/sys/dev/vmware/vmci/vmci_kernel_if.c head/sys/dev/vmware/vmci/vmci_kernel_if.h head/sys/dev/vmware/vmci/vmci_qpair.c head/sys/dev/vmware/vmci/vmci_queue.h head/sys/dev/vmware/vmci/vmci_queue_pair.c head/sys/dev/vmware/vmci/vmci_queue_pair.h head/sys/dev/vmware/vmci/vmci_resource.c head/sys/dev/vmware/vmci/vmci_resource.h head/sys/dev/vmware/vmci/vmci_utils.h head/sys/modules/vmware/vmci/Makefile Modified: head/share/man/man4/vmci.4 ============================================================================== --- head/share/man/man4/vmci.4 Sun Apr 8 00:56:19 2018 (r332262) +++ head/share/man/man4/vmci.4 Sun Apr 8 01:32:56 2018 (r332263) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2018 VMware, Inc. All Rights Reserved. +.\" Copyright (c) 2018 VMware, Inc. .\" .\" SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) .\" Added: head/sys/dev/vmware/vmci/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/vmware/vmci/LICENSE Sun Apr 8 01:32:56 2018 (r332263) @@ -0,0 +1,51 @@ +$FreeBSD$ + +These files are provided under a dual BSD-2 Clause/GPLv2 license. When +using or redistributing this file, you may do so under either license. + +BSD-2 Clause License + +Copyright (c) 2018 VMware, Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +GPL License Summary + +Copyright (c) 2018 VMware, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of version 2 of the GNU General Public License as +published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +The full GNU General Public License is included in this distribution +in the file called LICENSE.GPL. Modified: head/sys/dev/vmware/vmci/vmci.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci.c Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci.c Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) */ Modified: head/sys/dev/vmware/vmci/vmci.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_call_defs.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_call_defs.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_call_defs.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_datagram.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci_datagram.c Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_datagram.c Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) */ Modified: head/sys/dev/vmware/vmci/vmci_datagram.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_datagram.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_datagram.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_defs.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_defs.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_defs.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_doorbell.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci_doorbell.c Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_doorbell.c Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) */ Modified: head/sys/dev/vmware/vmci/vmci_doorbell.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_doorbell.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_doorbell.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_driver.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci_driver.c Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_driver.c Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) */ Modified: head/sys/dev/vmware/vmci/vmci_driver.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_driver.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_driver.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_event.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci_event.c Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_event.c Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) */ Modified: head/sys/dev/vmware/vmci/vmci_event.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_event.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_event.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_hashtable.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci_hashtable.c Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_hashtable.c Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) */ Modified: head/sys/dev/vmware/vmci/vmci_hashtable.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_hashtable.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_hashtable.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_kernel_api.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_kernel_api.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_kernel_api.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_kernel_api_1.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_kernel_api_1.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_kernel_api_1.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_kernel_api_2.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_kernel_api_2.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_kernel_api_2.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_kernel_defs.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_kernel_defs.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_kernel_defs.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_kernel_if.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci_kernel_if.c Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_kernel_if.c Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) */ Modified: head/sys/dev/vmware/vmci/vmci_kernel_if.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_kernel_if.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_kernel_if.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_qpair.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci_qpair.c Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_qpair.c Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) */ Modified: head/sys/dev/vmware/vmci/vmci_queue.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_queue.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_queue.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_queue_pair.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci_queue_pair.c Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_queue_pair.c Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) */ Modified: head/sys/dev/vmware/vmci/vmci_queue_pair.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_queue_pair.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_queue_pair.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_resource.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci_resource.c Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_resource.c Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) */ Modified: head/sys/dev/vmware/vmci/vmci_resource.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_resource.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_resource.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/dev/vmware/vmci/vmci_utils.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_utils.h Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/dev/vmware/vmci/vmci_utils.h Sun Apr 8 01:32:56 2018 (r332263) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * Copyright (c) 2018 VMware, Inc. * * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) * Modified: head/sys/modules/vmware/vmci/Makefile ============================================================================== --- head/sys/modules/vmware/vmci/Makefile Sun Apr 8 00:56:19 2018 (r332262) +++ head/sys/modules/vmware/vmci/Makefile Sun Apr 8 01:32:56 2018 (r332263) @@ -1,8 +1,3 @@ -# -# Copyright (c) 2018 VMware, Inc. All Rights Reserved. -# -# SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) -# # $FreeBSD$ .PATH: ${SRCTOP}/sys/dev/vmware/vmci From owner-svn-src-all@freebsd.org Sun Apr 8 02:05:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96D0BF98BA7; Sun, 8 Apr 2018 02:05:06 +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 D9049792B8; Sun, 8 Apr 2018 02:05:05 +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 w38251bM011204; Sat, 7 Apr 2018 19:05:01 -0700 (PDT) (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 w38250B6011200; Sat, 7 Apr 2018 19:05:00 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804080205.w38250B6011200@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332263 - in head: share/man/man4 sys/dev/vmware/vmci sys/modules/vmware/vmci In-Reply-To: <201804080132.w381Wuob043783@repo.freebsd.org> To: Mark Peek Date: Sat, 7 Apr 2018 19:05:00 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 02:05:07 -0000 > Author: mp > Date: Sun Apr 8 01:32:56 2018 > New Revision: 332263 > URL: https://svnweb.freebsd.org/changeset/base/332263 > > Log: > Update VMCI license based on comments from core, the FreeBSD Foundation, > and VMware legal: > - Add a dual BSD-2 Clause/GPLv2 LICENSE file in the VMCI directory > - Remove the use of "All Rights Reserved" > - Per best practice, remove copyright/license info from Makefile > > Reviewed by: imp, emaste, jhb, Vishnu Dasa > Approved by: VMware legal via Mark Peek > Differential Revision: https://reviews.freebsd.org/D14979 Interesting that I was the one that raised issue with this, yet was not included in the diffential resolving it. For an "inclusive" project it seems to do a lot of "exclusive" things. > Added: > head/sys/dev/vmware/vmci/LICENSE (contents, props changed) > Modified: > head/share/man/man4/vmci.4 ... So lets say someone comes along and reworks one of these files, how does that person assert their copyright without asserting it on all of these files, which is what would happen if they did it in LICENSE. If they put it in the individual file it is discoupled from the clause that says "the above copyright", which they may or may not want as with it decoupled there would be no requirement to place this per file copyright notice per clause 1 and 2 in the end product. I still feel this is just an unworkable model for the long run. I do however thank you for improving the situation, at least now the "LICENSE" file is of complete form with a copyright above to make clause 1 and 2 work correctly, as well as the other fine nits repaired. There is one other fine niglect though, and that is the other SPDX work has the tags placed at the very top of the file on the line after /*-. I think this is done on intention for tooling, and is documented by exmaple in the "8. Preferred License for New Files" section of the committers-guide here: https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/pref-license.html Regards, Rod Grimes > Modified: head/share/man/man4/vmci.4 > ============================================================================== > --- head/share/man/man4/vmci.4 Sun Apr 8 00:56:19 2018 (r332262) > +++ head/share/man/man4/vmci.4 Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,4 +1,4 @@ > -.\" Copyright (c) 2018 VMware, Inc. All Rights Reserved. > +.\" Copyright (c) 2018 VMware, Inc. > .\" > .\" SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > .\" > > Added: head/sys/dev/vmware/vmci/LICENSE > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/vmware/vmci/LICENSE Sun Apr 8 01:32:56 2018 (r332263) > @@ -0,0 +1,51 @@ > +$FreeBSD$ > + > +These files are provided under a dual BSD-2 Clause/GPLv2 license. When > +using or redistributing this file, you may do so under either license. > + > +BSD-2 Clause License > + > +Copyright (c) 2018 VMware, Inc. > + > +Redistribution and use in source and binary forms, with or without > +modification, are permitted provided that the following conditions > +are met: > + > + * Redistributions of source code must retain the above copyright > + notice, this list of conditions and the following disclaimer. > + > + * Redistributions in binary form must reproduce the above copyright > + notice, this list of conditions and the following disclaimer in > + the documentation and/or other materials provided with the > + distribution. > + > +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR > +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT > +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + > +GPL License Summary > + > +Copyright (c) 2018 VMware, Inc. > + > +This program is free software; you can redistribute it and/or modify > +it under the terms of version 2 of the GNU General Public License as > +published by the Free Software Foundation. > + > +This program is distributed in the hope that it will be useful, but > +WITHOUT ANY WARRANTY; without even the implied warranty of > +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +General Public License for more details. > + > +You should have received a copy of the GNU General Public License > +along with this program; if not, write to the Free Software > +Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. > +The full GNU General Public License is included in this distribution > +in the file called LICENSE.GPL. > > Modified: head/sys/dev/vmware/vmci/vmci.c > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci.c Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci.c Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > */ > > Modified: head/sys/dev/vmware/vmci/vmci.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_call_defs.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_call_defs.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_call_defs.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_datagram.c > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_datagram.c Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_datagram.c Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > */ > > Modified: head/sys/dev/vmware/vmci/vmci_datagram.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_datagram.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_datagram.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_defs.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_defs.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_defs.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_doorbell.c > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_doorbell.c Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_doorbell.c Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > */ > > Modified: head/sys/dev/vmware/vmci/vmci_doorbell.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_doorbell.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_doorbell.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_driver.c > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_driver.c Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_driver.c Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > */ > > Modified: head/sys/dev/vmware/vmci/vmci_driver.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_driver.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_driver.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_event.c > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_event.c Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_event.c Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > */ > > Modified: head/sys/dev/vmware/vmci/vmci_event.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_event.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_event.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_hashtable.c > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_hashtable.c Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_hashtable.c Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > */ > > Modified: head/sys/dev/vmware/vmci/vmci_hashtable.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_hashtable.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_hashtable.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_kernel_api.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_kernel_api.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_kernel_api.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_kernel_api_1.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_kernel_api_1.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_kernel_api_1.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_kernel_api_2.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_kernel_api_2.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_kernel_api_2.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_kernel_defs.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_kernel_defs.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_kernel_defs.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_kernel_if.c > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_kernel_if.c Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_kernel_if.c Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > */ > > Modified: head/sys/dev/vmware/vmci/vmci_kernel_if.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_kernel_if.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_kernel_if.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_qpair.c > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_qpair.c Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_qpair.c Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > */ > > Modified: head/sys/dev/vmware/vmci/vmci_queue.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_queue.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_queue.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_queue_pair.c > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_queue_pair.c Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_queue_pair.c Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > */ > > Modified: head/sys/dev/vmware/vmci/vmci_queue_pair.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_queue_pair.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_queue_pair.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_resource.c > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_resource.c Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_resource.c Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > */ > > Modified: head/sys/dev/vmware/vmci/vmci_resource.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_resource.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_resource.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/dev/vmware/vmci/vmci_utils.h > ============================================================================== > --- head/sys/dev/vmware/vmci/vmci_utils.h Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/dev/vmware/vmci/vmci_utils.h Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2018 VMware, Inc. All Rights Reserved. > + * Copyright (c) 2018 VMware, Inc. > * > * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > * > > Modified: head/sys/modules/vmware/vmci/Makefile > ============================================================================== > --- head/sys/modules/vmware/vmci/Makefile Sun Apr 8 00:56:19 2018 (r332262) > +++ head/sys/modules/vmware/vmci/Makefile Sun Apr 8 01:32:56 2018 (r332263) > @@ -1,8 +1,3 @@ > -# > -# Copyright (c) 2018 VMware, Inc. All Rights Reserved. > -# > -# SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0) > -# > # $FreeBSD$ > > .PATH: ${SRCTOP}/sys/dev/vmware/vmci > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Apr 8 02:27:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A54DCF9A3F7 for ; Sun, 8 Apr 2018 02:27:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DFE685761 for ; Sun, 8 Apr 2018 02:27:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id e98-v6so6192601itd.4 for ; Sat, 07 Apr 2018 19:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HAc4a7KFiEU39x0hZHt4t8zMjD+xPb4m47CvH1exNE0=; b=ZjYEHTOBURJ3VJOUkUicMYmybBH0kJ+DSSYCTNZm/QtEtASkDGgp5mmU9h0GsNn0uZ GjX6SDvsAaxlcd2pgcM/c+F25HBrnIHJY01VqjLpiYJsm7N3qmAFJuRF+ZzFi9JBqjBP 29l6XxKp0eU7VJG8qr2pKmcVIyiXhg3GvhQqV6tXNZjz+0jBQRdCcb+IasTkpxgnwxPE i+7oNAwcp4Hh/g6XQpPVfDKGVT1fK0j9HYbMm9fevoDqaZIQXnuFnNLqcnAuXzOjRRKy Ru3YomBxjarsnluCkAXkZraCO8qJPFwz9CNFmolujPsNm6xPuAykJ0QoIEIavS1FwSlU hAxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HAc4a7KFiEU39x0hZHt4t8zMjD+xPb4m47CvH1exNE0=; b=EcX8lAZCtmBnw+yWZ0EdcV4PGo7oze3k2Yag5yuwA5UPS+WzI0YcKOD1qQhXSA7fXL 8IkD1xNPmU3ieMjwUf+jcpG34IOQ8ZphLWFp3fcwA8+zf5/XZONvYF5kOn+41POERCpP 7g4y3Q3AEbu29MSodKeI3LwDXbrAKsR9z7013OgOkmWABVsGXkkj8ozlxJCtQrXMgPNN s09GN0TqvxQ+KJGSDWuQ+LNnlGK/rCkM4qw919zsetYrY75dKSoruJ9A/d0ir5yepOtl 4JTk5RS1Ggha9V06s4BxA1na3KilikvNKQlWozBJP6Ceaw6uKKH7yLLdX8iyVwFL1bBR uJwg== X-Gm-Message-State: ALQs6tBSXazzou1oNOYYenOkKKSSGxXS19kaTyY+9I6mf5+SzUTiHINk 4wuC9p9hupGLqgwbWxRHcqmg3eEcpW2GfWcuSpn+Qg== X-Google-Smtp-Source: AIpwx4+WjbDGBYO3NezqgcZOybb6csePrB/qz+IZHwox0yL9kUPYYBr8RX6tPkbUGQ4aqZ53XfLYkfJjvj/xQruUyZ8= X-Received: by 2002:a24:19c9:: with SMTP id b192-v6mr23252434itb.1.1523154443133; Sat, 07 Apr 2018 19:27:23 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.228.135 with HTTP; Sat, 7 Apr 2018 19:27:22 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201804080205.w38250B6011200@pdx.rh.CN85.dnsmgr.net> References: <201804080132.w381Wuob043783@repo.freebsd.org> <201804080205.w38250B6011200@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sat, 7 Apr 2018 20:27:22 -0600 X-Google-Sender-Auth: L8-0HdyJADS2x-Py87NtdPcdkL4 Message-ID: Subject: Re: svn commit: r332263 - in head: share/man/man4 sys/dev/vmware/vmci sys/modules/vmware/vmci To: "Rodney W. Grimes" Cc: Mark Peek , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 02:27:24 -0000 On Sat, Apr 7, 2018 at 8:05 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: mp > > Date: Sun Apr 8 01:32:56 2018 > > New Revision: 332263 > > URL: https://svnweb.freebsd.org/changeset/base/332263 > > > > Log: > > Update VMCI license based on comments from core, the FreeBSD > Foundation, > > and VMware legal: > > - Add a dual BSD-2 Clause/GPLv2 LICENSE file in the VMCI directory > > - Remove the use of "All Rights Reserved" > > - Per best practice, remove copyright/license info from Makefile > > > > Reviewed by: imp, emaste, jhb, Vishnu Dasa > > Approved by: VMware legal via Mark Peek > > Differential Revision: https://reviews.freebsd.org/D14979 > > Interesting that I was the one that raised issue with this, > yet was not included in the diffential resolving it. > For an "inclusive" project it seems to do a lot of "exclusive" things. > This action was also explicitly approved also by core@, in consultation with the FF lawyers. You were dropped from the discussions because you weren't adding to the discussions, just arguing, I suppose. Warner From owner-svn-src-all@freebsd.org Sun Apr 8 02:39:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B1CDF9B31F; Sun, 8 Apr 2018 02:39:34 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 3F5916C1A4; Sun, 8 Apr 2018 02:39:34 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 1E9BBD403; Sun, 8 Apr 2018 02:39:34 +0000 (UTC) Date: Sun, 8 Apr 2018 02:39:34 +0000 From: Alexey Dokuchaev To: Conrad Meyer Cc: Roger Pau Monn?? , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r332092 - in head/sys: amd64/amd64 sys x86/x86 Message-ID: <20180408023934.GA85042@FreeBSD.org> References: <201804061120.w36BK6s6074635@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 02:39:34 -0000 On Fri, Apr 06, 2018 at 07:14:42AM -0700, Conrad Meyer wrote: > I like something like this for clarity. But I don't see any reason > for these function-like macros instead of the more general definition > of an SI prefix constant multiple. A multiple works with numeric > literals and variables alike. Something like: As Bruce had said, 1G is normally written as 1024 * 1024 * 1024 and this is clearer than 1 << 30. Macros/functions like these are evil and bring more problems than they solve (again, as Bruce had explained). GiB name is also ugly (correct spelling is GB). IMHO the whole thing should just be removed. ./danfe From owner-svn-src-all@freebsd.org Sun Apr 8 02:47:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09F9DF9BF46; Sun, 8 Apr 2018 02:47:39 +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 65F9470906; Sun, 8 Apr 2018 02:47:38 +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 w382laNa011394; Sat, 7 Apr 2018 19:47:36 -0700 (PDT) (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 w382la7E011393; Sat, 7 Apr 2018 19:47:36 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804080247.w382la7E011393@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332092 - in head/sys: amd64/amd64 sys x86/x86 In-Reply-To: <20180408023934.GA85042@FreeBSD.org> To: Alexey Dokuchaev Date: Sat, 7 Apr 2018 19:47:36 -0700 (PDT) CC: Conrad Meyer , "Roger Pau Monn??" , 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 02:47:39 -0000 > On Fri, Apr 06, 2018 at 07:14:42AM -0700, Conrad Meyer wrote: > > I like something like this for clarity. But I don't see any reason > > for these function-like macros instead of the more general definition > > of an SI prefix constant multiple. A multiple works with numeric > > literals and variables alike. Something like: > > As Bruce had said, 1G is normally written as 1024 * 1024 * 1024 and this > is clearer than 1 << 30. Macros/functions like these are evil and bring > more problems than they solve (again, as Bruce had explained). GiB name > is also ugly (correct spelling is GB). IMHO the whole thing should just > be removed. I support this as well. 1K, 1M and 1G can all very easily be express as products of 1024, and have been expressed that way for most of the life of the BSD source code. I would even support this being an addition to style(9). > ./danfe -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Apr 8 02:55:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76D0DF9C953; Sun, 8 Apr 2018 02:55:40 +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 CA0D075087; Sun, 8 Apr 2018 02:55:39 +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 w382tZD6011426; Sat, 7 Apr 2018 19:55:35 -0700 (PDT) (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 w382tZAh011425; Sat, 7 Apr 2018 19:55:35 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804080255.w382tZAh011425@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332263 - in head: share/man/man4 sys/dev/vmware/vmci sys/modules/vmware/vmci In-Reply-To: To: Warner Losh Date: Sat, 7 Apr 2018 19:55:35 -0700 (PDT) CC: "Rodney W. Grimes" , Mark Peek , 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 02:55:40 -0000 > On Sat, Apr 7, 2018 at 8:05 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > Author: mp > > > Date: Sun Apr 8 01:32:56 2018 > > > New Revision: 332263 > > > URL: https://svnweb.freebsd.org/changeset/base/332263 > > > > > > Log: > > > Update VMCI license based on comments from core, the FreeBSD > > Foundation, > > > and VMware legal: > > > - Add a dual BSD-2 Clause/GPLv2 LICENSE file in the VMCI directory > > > - Remove the use of "All Rights Reserved" > > > - Per best practice, remove copyright/license info from Makefile > > > > > > Reviewed by: imp, emaste, jhb, Vishnu Dasa > > > Approved by: VMware legal via Mark Peek > > > Differential Revision: https://reviews.freebsd.org/D14979 > > > > Interesting that I was the one that raised issue with this, > > yet was not included in the diffential resolving it. > > For an "inclusive" project it seems to do a lot of "exclusive" things. > > > > This action was also explicitly approved also by core@, in consultation > with the FF lawyers. The consulted a free legal service that is mostly involved in GPL, which, imho, was not legal advice at all. As in you more or less get what you pay for in the legal arena, and that free lawyer is not going to be by your side if you should ever end up in a court. > You were dropped from the discussions because you weren't adding to the > discussions, just arguing, I suppose. You suppose, as in speculating or know for a fact? Either way, that is an "exclusitory" move. Most people see someone elses view as being argumentative when they do not take the time to actually try to understand the other persons view, or persuade them to take there view. Any discussion with 2 sides could be considered an argument. I find it I would assert that I was actually sighting verifiable facts, with URL's, that clarified what and why certain things had been done with respect to SPDX rather than hand waving generalizatons that could not be directly verified. Sighting users of it without saying how they used, etc. How did you put it? I poo poo'ed on your claims? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Apr 8 05:15:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28E07F82424; Sun, 8 Apr 2018 05:15:35 +0000 (UTC) (envelope-from mckusick@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 C7215813B8; Sun, 8 Apr 2018 05:15:34 +0000 (UTC) (envelope-from mckusick@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 BEB0C3213; Sun, 8 Apr 2018 05:15:34 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w385FYSi053812; Sun, 8 Apr 2018 05:15:34 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w385FYdC053811; Sun, 8 Apr 2018 05:15:34 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804080515.w385FYdC053811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 8 Apr 2018 05:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332264 - head/lib/libufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/lib/libufs X-SVN-Commit-Revision: 332264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 05:15:35 -0000 Author: mckusick Date: Sun Apr 8 05:15:34 2018 New Revision: 332264 URL: https://svnweb.freebsd.org/changeset/base/332264 Log: Defensive programming when reading inodes in getino(). Specifically check for out-of-range inodes, and whether return-value pointers are NULL. Modified: head/lib/libufs/inode.c Modified: head/lib/libufs/inode.c ============================================================================== --- head/lib/libufs/inode.c Sun Apr 8 01:32:56 2018 (r332263) +++ head/lib/libufs/inode.c Sun Apr 8 05:15:34 2018 (r332264) @@ -60,6 +60,10 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i ERROR(disk, NULL); fs = &disk->d_fs; + if (inode >= fs->fs_ipg * fs->fs_ncg) { + ERROR(disk, "inode number out of range"); + return (-1); + } inoblock = disk->d_inoblock; min = disk->d_inomin; max = disk->d_inomax; @@ -81,13 +85,17 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i gotit: switch (disk->d_ufs) { case 1: dp1 = &((struct ufs1_dinode *)inoblock)[inode - min]; - *mode = dp1->di_mode & IFMT; - *dino = dp1; + if (mode != NULL) + *mode = dp1->di_mode & IFMT; + if (dino != NULL) + *dino = dp1; return (0); case 2: dp2 = &((struct ufs2_dinode *)inoblock)[inode - min]; - *mode = dp2->di_mode & IFMT; - *dino = dp2; + if (mode != NULL) + *mode = dp2->di_mode & IFMT; + if (dino != NULL) + *dino = dp2; return (0); default: break; From owner-svn-src-all@freebsd.org Sun Apr 8 05:40:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1748FF83C01; Sun, 8 Apr 2018 05:40:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 8A0E56EB7D; Sun, 8 Apr 2018 05:40:01 +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 mail109.syd.optusnet.com.au (Postfix) with ESMTPS id BA9D4D6AA31; Sun, 8 Apr 2018 15:39:52 +1000 (AEST) Date: Sun, 8 Apr 2018 15:39:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Cy Schubert cc: Jeff Roberson , Justin Hibbits , Jeff Roberson , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331369 - head/sys/vm In-Reply-To: <201804072223.w37MNBQI009248@slippy.cwsent.com> Message-ID: <20180408153431.J1050@besplex.bde.org> References: <201804072223.w37MNBQI009248@slippy.cwsent.com> 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=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=VxmjJ2MpAAAA:8 a=JzwRw_2MAAAA:8 a=GXryfc7mSUmSGEy9oAIA:9 a=CjuIK1q_8ugA:10 a=jDxBBm0fxBEA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=_bBvcJC8wCc67rcU61zu:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 05:40:03 -0000 On Sat, 7 Apr 2018, Cy Schubert wrote: > In message <201803230615.w2N6FTMJ040628@slippy.cwsent.com>, Cy Schubert > writes: >> In message <20180323150709.H968@besplex.bde.org>, Bruce Evans writes: >>> On Thu, 22 Mar 2018, Jeff Roberson wrote: >>> >>>> On Thu, 22 Mar 2018, Cy Schubert wrote: >>>> >>>>> It broke i386 too. >>>> >>>> I just did >>>> TARGET_ARCH=i386 make buildworld >>>> TARGET_ARCH=i386 make buildkernel >>>> >>>> This worked for me? >>>>> >>>>> Index: sys/vm/vm_reserv.c >>>>> =================================================================== >>>>> --- sys/vm/vm_reserv.c (revision 331399) >>>>> +++ sys/vm/vm_reserv.c (working copy) >>>>> @@ -45,8 +45,6 @@ >>>>> >>>>> #include >>>>> #include >>>>> -#include >>>>> -#include >>>>> #include >>>>> #include >>>>> #include >>>>> @@ -55,6 +53,8 @@ >>>>> #include >>>>> #include >>>>> #include >>>>> +#include >>>>> +#include >>>>> #include >>>>> #include >>>>> >>>>> This is because sys/i386/include/machine.h uses critical_enter() and >>>>> critical_exit() which are defined in sys/systm.h. >>> >>> Wrong fix. I see you committed this. Now there are more bugs to fix. >>> >>> is a prerequisite for all kernel headers except >>> , since it defines and declares things like KASSERT() and > ... > Can you please give this a once over? > > diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c > index d8869e3bdbe..6d31d79da39 100644 > --- a/sys/vm/vm_reserv.c > +++ b/sys/vm/vm_reserv.c > @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); > #include "opt_vm.h" > > #include > +#include > #include > #include > #include > @@ -52,7 +53,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #include > #include It is missing backing out the unsorting of counter.h and ktr.h. This should be fixed in the same commit, so that it only takes 3 instead of 4 commits to do the sorting. Reverting changes in historical order is too much for small patches, and doesn't work when the intermediate version is broken. Bruce From owner-svn-src-all@freebsd.org Sun Apr 8 06:52:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09F20F884C1; Sun, 8 Apr 2018 06:52:59 +0000 (UTC) (envelope-from mckusick@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 AB7FA76C40; Sun, 8 Apr 2018 06:52:58 +0000 (UTC) (envelope-from mckusick@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 A36BF46BF; Sun, 8 Apr 2018 06:52:58 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w386qweP003666; Sun, 8 Apr 2018 06:52:58 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w386qwvo003663; Sun, 8 Apr 2018 06:52:58 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804080652.w386qwvo003663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 8 Apr 2018 06:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332265 - head/tools/diag/prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/tools/diag/prtblknos X-SVN-Commit-Revision: 332265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 06:52:59 -0000 Author: mckusick Date: Sun Apr 8 06:52:58 2018 New Revision: 332265 URL: https://svnweb.freebsd.org/changeset/base/332265 Log: Split tools/diag/prtblknos into two parts: main.c - opens disk and processes the argument list of inodes to be printed prtblknos.c - prints out the list of blocks used by an inode This change allows the fsdb program to import prtblknos() to use when printing out the set of blocks used by an inode. This program was switched to using the libufs library to ease its integration with fsdb and any other filesystem utility that might want to use it in the future. Added: head/tools/diag/prtblknos/main.c (contents, props changed) Modified: head/tools/diag/prtblknos/Makefile head/tools/diag/prtblknos/prtblknos.c Modified: head/tools/diag/prtblknos/Makefile ============================================================================== --- head/tools/diag/prtblknos/Makefile Sun Apr 8 05:15:34 2018 (r332264) +++ head/tools/diag/prtblknos/Makefile Sun Apr 8 06:52:58 2018 (r332265) @@ -1,8 +1,13 @@ # $FreeBSD$ -PROG= prtblknos +BINDIR?= /usr/bin +PROG= prtblknos MAN= + +SRCS= main.c prtblknos.c + +LIBADD+=ufs test: ${PROG} ./${PROG} > a Added: head/tools/diag/prtblknos/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/main.c Sun Apr 8 06:52:58 2018 (r332265) @@ -0,0 +1,80 @@ +/* + * Copyright (c) 1998, 2003, 2013, 2018 Marshall Kirk McKusick. + * 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 MARSHALL KIRK MCKUSICK ``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 MARSHALL KIRK MCKUSICK BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include +#include +#include + +union dinode { + struct ufs1_dinode *dp1; + struct ufs2_dinode *dp2; +}; + +void prtblknos(struct uufsd *disk, union dinode *dp); + +int +main(argc, argv) + int argc; + char *argv[]; +{ + struct uufsd disk; + union dinode *dp; + struct fs *fs; + char *fsname; + int inonum, error; + + if (argc < 3) { + (void)fprintf(stderr,"usage: prtblknos filesystem inode ...\n"); + exit(1); + } + + fsname = *++argv; + + /* get the superblock. */ + if ((error = ufs_disk_fillout(&disk, fsname)) < 0) + errx(1, "Cannot find file system superblock on %s\n", fsname); + fs = (struct fs *)&disk.d_sb; + + /* remaining arguments are inode numbers. */ + while (*++argv) { + /* get the inode number. */ + if ((inonum = atoi(*argv)) <= 0 || + inonum >= fs->fs_ipg * fs->fs_ncg) + errx(1, "%s is not a valid inode number", *argv); + (void)printf("%d:", inonum); + + if ((error = getino(&disk, (void **)&dp, inonum, NULL)) < 0) + err(1, "Read of inode %d on %s failed", inonum, fsname); + + prtblknos(&disk, dp); + } + exit(0); +} Modified: head/tools/diag/prtblknos/prtblknos.c ============================================================================== --- head/tools/diag/prtblknos/prtblknos.c Sun Apr 8 05:15:34 2018 (r332264) +++ head/tools/diag/prtblknos/prtblknos.c Sun Apr 8 06:52:58 2018 (r332265) @@ -27,146 +27,78 @@ */ #include -#include -#include - -#include #include #include -#include -#include -#include -#include #include -#include -#include +#include union dinode { - struct ufs1_dinode *dp1; - struct ufs2_dinode *dp2; + struct ufs1_dinode dp1; + struct ufs2_dinode dp2; }; -struct fs *sbp; -char *fsname; -int fd; -void indirprt(int level, int blksperindir, int lbn, ufs2_daddr_t blkno, - int lastlbn); -void printblk(int lbn, ufs2_daddr_t blkno, int numblks, int lastlbn); +void prtblknos(struct uufsd *disk, union dinode *dp); -/* - * Possible superblock locations ordered from most to least likely. - */ -static int sblock_try[] = SBLOCKSEARCH; +static void indirprt(struct uufsd *, int, int, int, ufs2_daddr_t, int); +static char *distance(struct fs *, daddr_t, daddr_t); +static void printblk(struct fs *, int, ufs2_daddr_t, int, int); -int -main(argc, argv) - int argc; - char *argv[]; +void +prtblknos(disk, dp) + struct uufsd *disk; + union dinode *dp; { - int i, len, lbn, frags, inonum, numblks, blksperindir; - char sblock[SBLOCKSIZE], ibuf[MAXBSIZE]; + int i, len, lbn, frags, numblks, blksperindir; ufs2_daddr_t blkno; - off_t size, offset; - union dinode dp; + struct fs *fs; + off_t size; - if (argc < 3) { - (void)fprintf(stderr,"usage: prtblknos filesystem inode ...\n"); - exit(1); + fs = (struct fs *)&disk->d_sb; + if (fs->fs_magic == FS_UFS1_MAGIC) + size = dp->dp1.di_size; + else + size = dp->dp2.di_size; + numblks = howmany(size, fs->fs_bsize); + if (numblks == 0) { + printf(" empty file\n"); + return; } - - fsname = *++argv; - - /* get the superblock. */ - if ((fd = open(fsname, O_RDONLY, 0)) < 0) - err(1, "%s", fsname); - for (i = 0; sblock_try[i] != -1; i++) { - if (lseek(fd, sblock_try[i], SEEK_SET) < 0) - err(1, "lseek: %s", fsname); - if (read(fd, sblock, (long)SBLOCKSIZE) != SBLOCKSIZE) - err(1, "can't read superblock: %s", fsname); - sbp = (struct fs *)sblock; - if ((sbp->fs_magic == FS_UFS1_MAGIC || - (sbp->fs_magic == FS_UFS2_MAGIC && - sbp->fs_sblockloc == sblock_try[i])) && - sbp->fs_bsize <= MAXBSIZE && - sbp->fs_bsize >= sizeof(struct fs)) - break; + len = numblks < UFS_NDADDR ? numblks : UFS_NDADDR; + for (i = 0; i < len; i++) { + if (i < numblks - 1) + frags = fs->fs_frag; + else + frags = howmany(size % fs->fs_bsize, + fs->fs_fsize); + if (fs->fs_magic == FS_UFS1_MAGIC) + blkno = dp->dp1.di_db[i]; + else + blkno = dp->dp2.di_db[i]; + printblk(fs, i, blkno, frags, numblks); } - if (sblock_try[i] == -1) - errx(1, "Cannot find file system superblock\n"); - /* remaining arguments are inode numbers. */ - while (*++argv) { - /* get the inode number. */ - if ((inonum = atoi(*argv)) <= 0) - errx(1, "%s is not a valid inode number", *argv); - (void)printf("%d:", inonum); - - /* read in the appropriate block. */ - offset = ino_to_fsba(sbp, inonum); /* inode to fs blk */ - offset = fsbtodb(sbp, offset); /* fs blk disk blk */ - offset *= DEV_BSIZE; /* disk blk to bytes */ - - /* seek and read the block */ - if (lseek(fd, offset, SEEK_SET) < 0) - err(1, "%s", fsname); - if (read(fd, ibuf, sbp->fs_bsize) != sbp->fs_bsize) - err(1, "%s", fsname); - - /* get the inode within the block. */ - if (sbp->fs_magic == FS_UFS1_MAGIC) { - dp.dp1 = &((struct ufs1_dinode *)(ibuf)) - [ino_to_fsbo(sbp, inonum)]; - size = dp.dp1->di_size; - } else { - dp.dp2 = &((struct ufs2_dinode *)(ibuf)) - [ino_to_fsbo(sbp, inonum)]; - size = dp.dp2->di_size; - } - - numblks = howmany(size, sbp->fs_bsize); - if (numblks == 0) { - printf(" empty file\n"); - continue; - } - len = numblks < UFS_NDADDR ? numblks : UFS_NDADDR; - for (i = 0; i < len; i++) { - if (i < numblks - 1) - frags = sbp->fs_frag; - else - frags = howmany(size % sbp->fs_bsize, - sbp->fs_fsize); - if (sbp->fs_magic == FS_UFS1_MAGIC) - blkno = dp.dp1->di_db[i]; - else - blkno = dp.dp2->di_db[i]; - printblk(i, blkno, frags, numblks); - } - - blksperindir = 1; - len = numblks - UFS_NDADDR; - lbn = UFS_NDADDR; - for (i = 0; len > 0 && i < UFS_NIADDR; i++) { - if (sbp->fs_magic == FS_UFS1_MAGIC) - blkno = dp.dp1->di_ib[i]; - else - blkno = dp.dp2->di_ib[i]; - indirprt(i, blksperindir, lbn, blkno, numblks); - blksperindir *= NINDIR(sbp); - lbn += blksperindir; - len -= blksperindir; - } - - /* dummy print to flush out last extent */ - printblk(numblks, 0, frags, 0); + blksperindir = 1; + len = numblks - UFS_NDADDR; + lbn = UFS_NDADDR; + for (i = 0; len > 0 && i < UFS_NIADDR; i++) { + if (fs->fs_magic == FS_UFS1_MAGIC) + blkno = dp->dp1.di_ib[i]; + else + blkno = dp->dp2.di_ib[i]; + indirprt(disk, i, blksperindir, lbn, blkno, numblks); + blksperindir *= NINDIR(fs); + lbn += blksperindir; + len -= blksperindir; } - (void)close(fd); - exit(0); + + /* dummy print to flush out last extent */ + printblk(fs, numblks, 0, frags, 0); } -void -indirprt(level, blksperindir, lbn, blkno, lastlbn) +static void +indirprt(disk, level, blksperindir, lbn, blkno, lastlbn) + struct uufsd *disk; int level; int blksperindir; int lbn; @@ -174,41 +106,39 @@ indirprt(level, blksperindir, lbn, blkno, lastlbn) int lastlbn; { char indir[MAXBSIZE]; - off_t offset; + struct fs *fs; int i, last; - printblk(lbn, blkno, sbp->fs_frag, -level); + fs = (struct fs *)&disk->d_sb; + printblk(fs, lbn, blkno, fs->fs_frag, -level); /* read in the indirect block. */ - offset = fsbtodb(sbp, blkno); /* fs blk disk blk */ - offset *= DEV_BSIZE; /* disk blk to bytes */ - if (lseek(fd, offset, SEEK_SET) < 0) - err(1, "%s", fsname); - if (read(fd, indir, sbp->fs_bsize) != sbp->fs_bsize) - err(1, "%s", fsname); - last = howmany(lastlbn - lbn, blksperindir) < NINDIR(sbp) ? - howmany(lastlbn - lbn, blksperindir) : NINDIR(sbp); + if (bread(disk, fsbtodb(fs, blkno), indir, fs->fs_bsize) == -1) + err(1, "Read of indirect block %jd failed", (intmax_t)blkno); + last = howmany(lastlbn - lbn, blksperindir) < NINDIR(fs) ? + howmany(lastlbn - lbn, blksperindir) : NINDIR(fs); if (blksperindir == 1) { for (i = 0; i < last; i++) { - if (sbp->fs_magic == FS_UFS1_MAGIC) + if (fs->fs_magic == FS_UFS1_MAGIC) blkno = ((ufs1_daddr_t *)indir)[i]; else blkno = ((ufs2_daddr_t *)indir)[i]; - printblk(lbn + i, blkno, sbp->fs_frag, lastlbn); + printblk(fs, lbn + i, blkno, fs->fs_frag, lastlbn); } return; } for (i = 0; i < last; i++) { - if (sbp->fs_magic == FS_UFS1_MAGIC) + if (fs->fs_magic == FS_UFS1_MAGIC) blkno = ((ufs1_daddr_t *)indir)[i]; else blkno = ((ufs2_daddr_t *)indir)[i]; - indirprt(level - 1, blksperindir / NINDIR(sbp), + indirprt(disk, level - 1, blksperindir / NINDIR(fs), lbn + blksperindir * i, blkno, lastlbn); } } -char * -distance(lastblk, firstblk) +static char * +distance(fs, lastblk, firstblk) + struct fs *fs; daddr_t lastblk; daddr_t firstblk; { @@ -219,22 +149,23 @@ distance(lastblk, firstblk) if (lastblk == 0) return (""); delta = firstblk - lastblk - 1; - firstcg = dtog(sbp, firstblk); - lastcg = dtog(sbp, lastblk); + firstcg = dtog(fs, firstblk); + lastcg = dtog(fs, lastblk); if (firstcg == lastcg) { snprintf(buf, 100, " distance %jd", (intmax_t)delta); return (&buf[0]); } snprintf(buf, 100, " cg %d blk %jd to cg %d blk %jd", - lastcg, dtogd(sbp, lastblk), firstcg, dtogd(sbp, firstblk)); + lastcg, dtogd(fs, lastblk), firstcg, dtogd(fs, firstblk)); return (&buf[0]); } -char *indirname[UFS_NIADDR] = { "First", "Second", "Third" }; +static char *indirname[UFS_NIADDR] = { "First", "Second", "Third" }; -void -printblk(lbn, blkno, numblks, lastlbn) +static void +printblk(fs, lbn, blkno, numblks, lastlbn) + struct fs *fs; int lbn; ufs2_daddr_t blkno; int numblks; @@ -282,19 +213,19 @@ flush: } else if (seq == 1) { if (numblks == 1) printf("\tlbn %d blkno %jd%s\n", lbn - seq, - (intmax_t)firstblk, distance(lastblk, firstblk)); + (intmax_t)firstblk, distance(fs, lastblk, firstblk)); else printf("\tlbn %d blkno %jd-%jd%s\n", lbn - seq, (intmax_t)firstblk, (intmax_t)(firstblk + numblks - 1), - distance(lastblk, firstblk)); + distance(fs, lastblk, firstblk)); lastblk = firstblk + numblks - 1; } else { printf("\tlbn %d-%d blkno %jd-%jd%s\n", lbn - seq, lbn - 1, (intmax_t)firstblk, (intmax_t)(firstblk + - (seq - 1) * sbp->fs_frag + numblks - 1), - distance(lastblk, firstblk)); - lastblk = firstblk + (seq - 1) * sbp->fs_frag + numblks - 1; + (seq - 1) * fs->fs_frag + numblks - 1), + distance(fs, lastblk, firstblk)); + lastblk = firstblk + (seq - 1) * fs->fs_frag + numblks - 1; } if (lastlbn > 0 || blkno == 0) { seq = 1; @@ -302,13 +233,13 @@ flush: return; } prtindir: - if (seq != 0 && (sbp->fs_metaspace == 0 || lastindirblk == 0)) + if (seq != 0 && (fs->fs_metaspace == 0 || lastindirblk == 0)) lastindirblk = lastblk; printf("%s-level indirect, blkno %jd-%jd%s\n", indirname[-lastlbn], (intmax_t)blkno, (intmax_t)(blkno + numblks - 1), - distance(lastindirblk, blkno)); + distance(fs, lastindirblk, blkno)); lastindirblk = blkno + numblks - 1; - if (sbp->fs_metaspace == 0) + if (fs->fs_metaspace == 0) lastblk = lastindirblk; seq = 0; } From owner-svn-src-all@freebsd.org Sun Apr 8 06:59:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 536F1F88BEE; Sun, 8 Apr 2018 06:59:43 +0000 (UTC) (envelope-from mckusick@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 05C747A349; Sun, 8 Apr 2018 06:59:43 +0000 (UTC) (envelope-from mckusick@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 00AE846C3; Sun, 8 Apr 2018 06:59:43 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w386xgtH003947; Sun, 8 Apr 2018 06:59:42 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w386xgPc003946; Sun, 8 Apr 2018 06:59:42 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804080659.w386xgPc003946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 8 Apr 2018 06:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332266 - head/lib/libufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/lib/libufs X-SVN-Commit-Revision: 332266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 06:59:43 -0000 Author: mckusick Date: Sun Apr 8 06:59:42 2018 New Revision: 332266 URL: https://svnweb.freebsd.org/changeset/base/332266 Log: The ufs_disk_write() function is used to upgrade a read-only descriptor to a read-write descriptor. Do not close the read-only descriptor until the read-write is successfully obtained. Before this fix, a failed upgrade left no usable descriptor with which to work. Modified: head/lib/libufs/type.c Modified: head/lib/libufs/type.c ============================================================================== --- head/lib/libufs/type.c Sun Apr 8 06:52:58 2018 (r332265) +++ head/lib/libufs/type.c Sun Apr 8 06:59:42 2018 (r332266) @@ -60,6 +60,7 @@ ufs_disk_close(struct uufsd *disk) { ERROR(disk, NULL); close(disk->d_fd); + disk->d_fd = -1; if (disk->d_inoblock != NULL) { free(disk->d_inoblock); disk->d_inoblock = NULL; @@ -181,19 +182,21 @@ again: if ((ret = stat(name, &st)) < 0) { int ufs_disk_write(struct uufsd *disk) { + int fd; + ERROR(disk, NULL); if (disk->d_mine & MINE_WRITE) return (0); - close(disk->d_fd); - - disk->d_fd = open(disk->d_name, O_RDWR); - if (disk->d_fd < 0) { + fd = open(disk->d_name, O_RDWR); + if (fd < 0) { ERROR(disk, "failed to open disk for writing"); return (-1); } + close(disk->d_fd); + disk->d_fd = fd; disk->d_mine |= MINE_WRITE; return (0); From owner-svn-src-all@freebsd.org Sun Apr 8 07:06:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C649DF892E0; Sun, 8 Apr 2018 07:06:12 +0000 (UTC) (envelope-from mckusick@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 7AA497DBC9; Sun, 8 Apr 2018 07:06:12 +0000 (UTC) (envelope-from mckusick@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 758844858; Sun, 8 Apr 2018 07:06:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3876CEr008777; Sun, 8 Apr 2018 07:06:12 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3876Cmv008775; Sun, 8 Apr 2018 07:06:12 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804080706.w3876Cmv008775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 8 Apr 2018 07:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332267 - head/sbin/fsdb X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsdb X-SVN-Commit-Revision: 332267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 07:06:13 -0000 Author: mckusick Date: Sun Apr 8 07:06:12 2018 New Revision: 332267 URL: https://svnweb.freebsd.org/changeset/base/332267 Log: When using the fsdb `blocks' command, replace the long and ugly list of blocks with the much more concise and readable block list shown by the prtblknos() function imported from tools/diag/prtblknos. Modified: head/sbin/fsdb/Makefile head/sbin/fsdb/fsdbutil.c Modified: head/sbin/fsdb/Makefile ============================================================================== --- head/sbin/fsdb/Makefile Sun Apr 8 06:59:42 2018 (r332266) +++ head/sbin/fsdb/Makefile Sun Apr 8 07:06:12 2018 (r332267) @@ -7,10 +7,11 @@ PROG= fsdb MAN= fsdb.8 SRCS= fsdb.c fsdbutil.c \ dir.c ea.c fsutil.c inode.c pass1.c pass1b.c pass2.c pass3.c pass4.c \ - pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c globs.c + pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c globs.c prtblknos.c CFLAGS+= -I${.CURDIR:H}/fsck_ffs WARNS?= 2 LIBADD= edit ufs -.PATH: ${.CURDIR:H}/fsck_ffs ${SRCTOP}/sys/ufs/ffs +.PATH: ${.CURDIR:H}/fsck_ffs ${SRCTOP}/sys/ufs/ffs \ + ${SRCTOP}/tools/diag/prtblknos .include Modified: head/sbin/fsdb/fsdbutil.c ============================================================================== --- head/sbin/fsdb/fsdbutil.c Sun Apr 8 06:59:42 2018 (r332266) +++ head/sbin/fsdb/fsdbutil.c Sun Apr 8 07:06:12 2018 (r332267) @@ -53,9 +53,7 @@ static const char rcsid[] = #include "fsdb.h" #include "fsck.h" -static int charsperline(void); -static void printindir(ufs2_daddr_t blk, int level, char *bufp); -static void printblocks(ino_t inum, union dinode *dp); +void prtblknos(struct uufsd *disk, union dinode *dp); char ** crack(char *line, int *argc) @@ -200,127 +198,6 @@ printstat(const char *cp, ino_t inum, union dinode *dp } -/* - * Determine the number of characters in a - * single line. - */ - -static int -charsperline(void) -{ - int columns; - char *cp; - struct winsize ws; - - columns = 0; - if (ioctl(0, TIOCGWINSZ, &ws) != -1) - columns = ws.ws_col; - if (columns == 0 && (cp = getenv("COLUMNS"))) - columns = atoi(cp); - if (columns == 0) - columns = 80; /* last resort */ - return (columns); -} - - -/* - * Recursively print a list of indirect blocks. - */ -static void -printindir(ufs2_daddr_t blk, int level, char *bufp) -{ - struct bufarea buf, *bp; - char tempbuf[32]; /* enough to print an ufs2_daddr_t */ - int i, j, cpl, charssofar; - ufs2_daddr_t blkno; - - if (blk == 0) - return; - printf("%jd (%d) =>\n", (intmax_t)blk, level); - if (level == 0) { - /* for the final indirect level, don't use the cache */ - bp = &buf; - bp->b_un.b_buf = bufp; - initbarea(bp, BT_UNKNOWN); - - getblk(bp, blk, sblock.fs_bsize); - } else - bp = getdatablk(blk, sblock.fs_bsize, BT_UNKNOWN); - - cpl = charsperline(); - for (i = charssofar = 0; i < NINDIR(&sblock); i++) { - if (sblock.fs_magic == FS_UFS1_MAGIC) - blkno = bp->b_un.b_indir1[i]; - else - blkno = bp->b_un.b_indir2[i]; - if (blkno == 0) - continue; - j = sprintf(tempbuf, "%jd", (intmax_t)blkno); - if (level == 0) { - charssofar += j; - if (charssofar >= cpl - 2) { - putchar('\n'); - charssofar = j; - } - } - fputs(tempbuf, stdout); - if (level == 0) { - printf(", "); - charssofar += 2; - } else { - printf(" =>\n"); - printindir(blkno, level - 1, bufp); - printf("\n"); - charssofar = 0; - } - } - if (level == 0) - putchar('\n'); - return; -} - - -/* - * Print the block pointers for one inode. - */ -static void -printblocks(ino_t inum, union dinode *dp) -{ - char *bufp; - int i, nfrags; - long ndb, offset; - ufs2_daddr_t blkno; - - printf("Blocks for inode %ju:\n", (uintmax_t)inum); - printf("Direct blocks:\n"); - ndb = howmany(DIP(dp, di_size), sblock.fs_bsize); - for (i = 0; i < UFS_NDADDR && i < ndb; i++) { - if (i > 0) - printf(", "); - blkno = DIP(dp, di_db[i]); - printf("%jd", (intmax_t)blkno); - } - if (ndb <= UFS_NDADDR) { - offset = blkoff(&sblock, DIP(dp, di_size)); - if (offset != 0) { - nfrags = numfrags(&sblock, fragroundup(&sblock, offset)); - printf(" (%d frag%s)", nfrags, nfrags > 1? "s": ""); - } - } - putchar('\n'); - if (ndb <= UFS_NDADDR) - return; - - bufp = malloc((unsigned int)sblock.fs_bsize); - if (bufp == NULL) - errx(EEXIT, "cannot allocate indirect block buffer"); - printf("Indirect blocks:\n"); - for (i = 0; i < UFS_NIADDR; i++) - printindir(DIP(dp, di_ib[i]), i, bufp); - free(bufp); -} - - int checkactive(void) { @@ -359,7 +236,7 @@ printactive(int doblocks) case IFSOCK: case IFIFO: if (doblocks) - printblocks(curinum, curinode); + prtblknos(&disk, curinode); else printstat("current inode", curinum, curinode); break; From owner-svn-src-all@freebsd.org Sun Apr 8 07:18:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78FEEF89E27; Sun, 8 Apr 2018 07:18:30 +0000 (UTC) (envelope-from mckusick@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 2B682845F6; Sun, 8 Apr 2018 07:18:30 +0000 (UTC) (envelope-from mckusick@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 237E249EE; Sun, 8 Apr 2018 07:18:30 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w387IUwL014139; Sun, 8 Apr 2018 07:18:30 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w387IULU014138; Sun, 8 Apr 2018 07:18:30 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804080718.w387IULU014138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 8 Apr 2018 07:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332268 - head/tools/diag/prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/tools/diag/prtblknos X-SVN-Commit-Revision: 332268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 07:18:30 -0000 Author: mckusick Date: Sun Apr 8 07:18:29 2018 New Revision: 332268 URL: https://svnweb.freebsd.org/changeset/base/332268 Log: Add (intmax_t) type casts to some printf parameters to keep i386 happy. Modified: head/tools/diag/prtblknos/prtblknos.c Modified: head/tools/diag/prtblknos/prtblknos.c ============================================================================== --- head/tools/diag/prtblknos/prtblknos.c Sun Apr 8 07:06:12 2018 (r332267) +++ head/tools/diag/prtblknos/prtblknos.c Sun Apr 8 07:18:29 2018 (r332268) @@ -156,7 +156,8 @@ distance(fs, lastblk, firstblk) return (&buf[0]); } snprintf(buf, 100, " cg %d blk %jd to cg %d blk %jd", - lastcg, dtogd(fs, lastblk), firstcg, dtogd(fs, firstblk)); + lastcg, (intmax_t)dtogd(fs, lastblk), firstcg, + (intmax_t)dtogd(fs, firstblk)); return (&buf[0]); } From owner-svn-src-all@freebsd.org Sun Apr 8 11:37:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92A24F9BDE4; Sun, 8 Apr 2018 11:37:01 +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 4225C68E69; Sun, 8 Apr 2018 11:37:01 +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 3BA467494; Sun, 8 Apr 2018 11:37:01 +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 w38Bb1Kd046914; Sun, 8 Apr 2018 11:37:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38Bb1sL046913; Sun, 8 Apr 2018 11:37:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081137.w38Bb1sL046913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 11:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332269 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 332269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 11:37:01 -0000 Author: tuexen Date: Sun Apr 8 11:37:00 2018 New Revision: 332269 URL: https://svnweb.freebsd.org/changeset/base/332269 Log: Fix a signed/unsigned warning showing up for the userland stack on some platforms. Thanks to Felix Weinrank for reporting the issue. MFC after:i 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Apr 8 07:18:29 2018 (r332268) +++ head/sys/netinet/sctp_input.c Sun Apr 8 11:37:00 2018 (r332269) @@ -2616,7 +2616,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in (sizeof(uint32_t)))); diff = now; timevalsub(&diff, &time_expires); - if (diff.tv_sec > UINT32_MAX / 1000000) { + if ((uint32_t)diff.tv_sec > UINT32_MAX / 1000000) { staleness = UINT32_MAX; } else { staleness = diff.tv_sec * 1000000; From owner-svn-src-all@freebsd.org Sun Apr 8 11:39:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F05A1F9C07C; Sun, 8 Apr 2018 11:39:27 +0000 (UTC) (envelope-from tsoome@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 A726F6A407; Sun, 8 Apr 2018 11:39:27 +0000 (UTC) (envelope-from tsoome@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 9ED3D7499; Sun, 8 Apr 2018 11:39:27 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38BdR6m047039; Sun, 8 Apr 2018 11:39:27 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38BdR0t047036; Sun, 8 Apr 2018 11:39:27 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804081139.w38BdR0t047036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 8 Apr 2018 11:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332270 - head/stand/forth X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/forth X-SVN-Commit-Revision: 332270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 11:39:28 -0000 Author: tsoome Date: Sun Apr 8 11:39:27 2018 New Revision: 332270 URL: https://svnweb.freebsd.org/changeset/base/332270 Log: loader: include efi.4th only if we do have uefi Also simplify efi.4th. Modified: head/stand/forth/efi.4th head/stand/forth/loader.4th head/stand/forth/loader.rc Modified: head/stand/forth/efi.4th ============================================================================== --- head/stand/forth/efi.4th Sun Apr 8 11:37:00 2018 (r332269) +++ head/stand/forth/efi.4th Sun Apr 8 11:39:27 2018 (r332270) @@ -26,16 +26,5 @@ only forth definitions -: efiboot? ( -- flag ) - s" efi-version" getenv -1 <> dup if - swap drop ( c-addr flag -- flag ) - then -; - -: maybe-efi-resizecons - efiboot? if - s" efi-autoresizecons" evaluate - then -; - +s" efi-autoresizecons" evaluate .( EFI boot environment) cr Modified: head/stand/forth/loader.4th ============================================================================== --- head/stand/forth/loader.4th Sun Apr 8 11:37:00 2018 (r332269) +++ head/stand/forth/loader.4th Sun Apr 8 11:39:27 2018 (r332270) @@ -46,6 +46,9 @@ include /boot/support.4th include /boot/color.4th include /boot/delay.4th include /boot/check-password.4th +s" efi-version" getenv? [if] + include /boot/forth/efi.4th +[then] only forth definitions Modified: head/stand/forth/loader.rc ============================================================================== --- head/stand/forth/loader.rc Sun Apr 8 11:37:00 2018 (r332269) +++ head/stand/forth/loader.rc Sun Apr 8 11:39:27 2018 (r332270) @@ -6,14 +6,11 @@ \ \ Includes additional commands include /boot/loader.4th -include /boot/efi.4th try-include /boot/loader.rc.local \ Reads and processes loader.conf variables \ NOTE: Change to `initialize' if you enable the below boot menu start - -maybe-efi-resizecons \ Tests for password -- executes autoboot first if a password was defined check-password From owner-svn-src-all@freebsd.org Sun Apr 8 11:50:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 103ABF9CD79; Sun, 8 Apr 2018 11:50:07 +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 B47EA7020A; Sun, 8 Apr 2018 11:50:06 +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 AC1A57644; Sun, 8 Apr 2018 11:50:06 +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 w38Bo6H3051846; Sun, 8 Apr 2018 11:50:06 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38Bo6FP051845; Sun, 8 Apr 2018 11:50:06 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081150.w38Bo6FP051845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 11:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332271 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 332271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 11:50:07 -0000 Author: tuexen Date: Sun Apr 8 11:50:06 2018 New Revision: 332271 URL: https://svnweb.freebsd.org/changeset/base/332271 Log: Small cleanup, no functional change. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Apr 8 11:39:27 2018 (r332270) +++ head/sys/netinet/sctp_usrreq.c Sun Apr 8 11:50:06 2018 (r332271) @@ -705,22 +705,10 @@ sctp_disconnect(struct socket *so) if (SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_WAIT) { /* Left with Data unread */ - struct mbuf *err; + struct mbuf *op_err; - err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA); - if (err) { - /* - * Fill in the user - * initiated abort - */ - struct sctp_paramhdr *ph; - - ph = mtod(err, struct sctp_paramhdr *); - SCTP_BUF_LEN(err) = sizeof(struct sctp_paramhdr); - ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons(SCTP_BUF_LEN(err)); - } - sctp_send_abort_tcb(stcb, err, SCTP_SO_LOCKED); + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); + sctp_send_abort_tcb(stcb, op_err, SCTP_SO_LOCKED); SCTP_STAT_INCR_COUNTER32(sctps_aborted); } SCTP_INP_RUNLOCK(inp); From owner-svn-src-all@freebsd.org Sun Apr 8 11:55:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D834FF9D47B; Sun, 8 Apr 2018 11:55:27 +0000 (UTC) (envelope-from tsoome@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 8B4AF73211; Sun, 8 Apr 2018 11:55:27 +0000 (UTC) (envelope-from tsoome@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 8650577D8; Sun, 8 Apr 2018 11:55:27 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38BtR3F056447; Sun, 8 Apr 2018 11:55:27 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38BtR1K056446; Sun, 8 Apr 2018 11:55:27 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804081155.w38BtR1K056446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 8 Apr 2018 11:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332272 - head/stand/forth X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/forth X-SVN-Commit-Revision: 332272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 11:55:28 -0000 Author: tsoome Date: Sun Apr 8 11:55:27 2018 New Revision: 332272 URL: https://svnweb.freebsd.org/changeset/base/332272 Log: loader: 332270 did use wrong path for efi.4th The correct path is still /boot/efi.4th Modified: head/stand/forth/loader.4th Modified: head/stand/forth/loader.4th ============================================================================== --- head/stand/forth/loader.4th Sun Apr 8 11:50:06 2018 (r332271) +++ head/stand/forth/loader.4th Sun Apr 8 11:55:27 2018 (r332272) @@ -47,7 +47,7 @@ include /boot/color.4th include /boot/delay.4th include /boot/check-password.4th s" efi-version" getenv? [if] - include /boot/forth/efi.4th + include /boot/efi.4th [then] only forth definitions From owner-svn-src-all@freebsd.org Sun Apr 8 12:08:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0212EF9E87E; Sun, 8 Apr 2018 12:08:22 +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 672BA7A3A4; Sun, 8 Apr 2018 12:08:21 +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 5FCD7798A; Sun, 8 Apr 2018 12:08:21 +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 w38C8LQu061824; Sun, 8 Apr 2018 12:08:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38C8LFt061822; Sun, 8 Apr 2018 12:08:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081208.w38C8LFt061822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 12:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332273 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 332273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 12:08:22 -0000 Author: tuexen Date: Sun Apr 8 12:08:20 2018 New Revision: 332273 URL: https://svnweb.freebsd.org/changeset/base/332273 Log: Fix a logical inversion bug. Thanks to Irene Ruengeler for finding and reporting this bug. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Apr 8 11:55:27 2018 (r332272) +++ head/sys/netinet/sctp_usrreq.c Sun Apr 8 12:08:20 2018 (r332273) @@ -204,7 +204,7 @@ sctp_notify(struct sctp_inpcb *inp, #endif /* no need to unlock here, since the TCB is gone */ } else if (icmp_code == ICMP_UNREACH_NEEDFRAG) { - if ((net->dest_state & SCTP_ADDR_NO_PMTUD) == 0) { + if (net->dest_state & SCTP_ADDR_NO_PMTUD) { SCTP_TCB_UNLOCK(stcb); return; } Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun Apr 8 11:55:27 2018 (r332272) +++ head/sys/netinet6/sctp6_usrreq.c Sun Apr 8 12:08:20 2018 (r332273) @@ -223,7 +223,7 @@ sctp6_notify(struct sctp_inpcb *inp, } break; case ICMP6_PACKET_TOO_BIG: - if ((net->dest_state & SCTP_ADDR_NO_PMTUD) == 0) { + if (net->dest_state & SCTP_ADDR_NO_PMTUD) { SCTP_TCB_UNLOCK(stcb); break; } From owner-svn-src-all@freebsd.org Sun Apr 8 12:20:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED30F9F6FC; Sun, 8 Apr 2018 12:20: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 D301380CA2; Sun, 8 Apr 2018 12:20:07 +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 A099B7B2C; Sun, 8 Apr 2018 12:20:07 +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 w38CK7lg067559; Sun, 8 Apr 2018 12:20:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38CK6YD067551; Sun, 8 Apr 2018 12:20:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201804081220.w38CK6YD067551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 8 Apr 2018 12:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332274 - in head/sys: arm/mv dev/fdt X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/mv dev/fdt X-SVN-Commit-Revision: 332274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 12:20:09 -0000 Author: andrew Date: Sun Apr 8 12:20:06 2018 New Revision: 332274 URL: https://svnweb.freebsd.org/changeset/base/332274 Log: Move fdt_is_type to be a Marvell specific function. It's not used by any other SoCs. Sponsored by: DARPA, AFRL Modified: head/sys/arm/mv/armv5_machdep.c head/sys/arm/mv/mv_armv7_machdep.c head/sys/arm/mv/mv_common.c head/sys/arm/mv/mv_pci.c head/sys/arm/mv/mvvar.h head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h Modified: head/sys/arm/mv/armv5_machdep.c ============================================================================== --- head/sys/arm/mv/armv5_machdep.c Sun Apr 8 12:08:20 2018 (r332273) +++ head/sys/arm/mv/armv5_machdep.c Sun Apr 8 12:20:06 2018 (r332274) @@ -377,7 +377,8 @@ platform_devmap_init(void) * PCI range(s) and localbus. */ for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (fdt_is_type(child, "pci") || fdt_is_type(child, "pciep")) { + if (mv_fdt_is_type(child, "pci") || + mv_fdt_is_type(child, "pciep")) { /* * Check space: each PCI node will consume 2 devmap * entries. Modified: head/sys/arm/mv/mv_armv7_machdep.c ============================================================================== --- head/sys/arm/mv/mv_armv7_machdep.c Sun Apr 8 12:08:20 2018 (r332273) +++ head/sys/arm/mv/mv_armv7_machdep.c Sun Apr 8 12:20:06 2018 (r332274) @@ -397,7 +397,8 @@ mv_a38x_platform_devmap_init(platform_t plat) * PCI range(s) and localbus. */ for (child = OF_child(root); child != 0; child = OF_peer(child)) { - if (fdt_is_type(child, "pci") || fdt_is_type(child, "pciep")) { + if (mv_fdt_is_type(child, "pci") || + mv_fdt_is_type(child, "pciep")) { /* * Check space: each PCI node will consume 2 devmap * entries. Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Sun Apr 8 12:08:20 2018 (r332273) +++ head/sys/arm/mv/mv_common.c Sun Apr 8 12:20:06 2018 (r332274) @@ -484,6 +484,26 @@ pm_disable_device(int mask) } int +mv_fdt_is_type(phandle_t node, const char *typestr) +{ +#define FDT_TYPE_LEN 64 + char type[FDT_TYPE_LEN]; + + if (OF_getproplen(node, "device_type") <= 0) + return (0); + + if (OF_getprop(node, "device_type", type, FDT_TYPE_LEN) < 0) + return (0); + + if (strncasecmp(type, typestr, FDT_TYPE_LEN) == 0) + /* This fits. */ + return (1); + + return (0); +#undef FDT_TYPE_LEN +} + +int mv_fdt_pm(phandle_t node) { uint32_t cpu_pm_ctrl; Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Sun Apr 8 12:08:20 2018 (r332273) +++ head/sys/arm/mv/mv_pci.c Sun Apr 8 12:20:06 2018 (r332274) @@ -420,7 +420,7 @@ mv_pcib_probe(device_t self) phandle_t node; node = ofw_bus_get_node(self); - if (!fdt_is_type(node, "pci")) + if (!mv_fdt_is_type(node, "pci")) return (ENXIO); if (!(ofw_bus_is_compatible(self, "mrvl,pcie") || Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Sun Apr 8 12:08:20 2018 (r332273) +++ head/sys/arm/mv/mvvar.h Sun Apr 8 12:20:06 2018 (r332274) @@ -141,6 +141,7 @@ int mv_pci_devmap(phandle_t, struct devmap_entry *, vm int fdt_localbus_devmap(phandle_t, struct devmap_entry *, int, int *); enum soc_family mv_check_soc_family(void); +int mv_fdt_is_type(phandle_t, const char *); int mv_fdt_pm(phandle_t); uint32_t get_tclk_armadaxp(void); Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sun Apr 8 12:08:20 2018 (r332273) +++ head/sys/dev/fdt/fdt_common.c Sun Apr 8 12:20:06 2018 (r332274) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #endif #define FDT_COMPAT_LEN 255 -#define FDT_TYPE_LEN 64 #define FDT_REG_CELLS 4 #define FDT_RANGES_SIZE 48 @@ -331,24 +330,6 @@ fdt_depth_search_compatible(phandle_t start, const cha if (child != 0) return (child); } - return (0); -} - -int -fdt_is_type(phandle_t node, const char *typestr) -{ - char type[FDT_TYPE_LEN]; - - if (OF_getproplen(node, "device_type") <= 0) - return (0); - - if (OF_getprop(node, "device_type", type, FDT_TYPE_LEN) < 0) - return (0); - - if (strncasecmp(type, typestr, FDT_TYPE_LEN) == 0) - /* This fits. */ - return (1); - return (0); } Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Sun Apr 8 12:08:20 2018 (r332273) +++ head/sys/dev/fdt/fdt_common.h Sun Apr 8 12:20:06 2018 (r332274) @@ -91,7 +91,6 @@ int fdt_get_range(phandle_t, int, u_long *, u_long *); int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); int fdt_is_compatible_strict(phandle_t, const char *); -int fdt_is_type(phandle_t, const char *); int fdt_parent_addr_cells(phandle_t); int fdt_get_chosen_bootargs(char *bootargs, size_t max_size); From owner-svn-src-all@freebsd.org Sun Apr 8 13:40:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B0D2F82628; Sun, 8 Apr 2018 13:40:39 +0000 (UTC) (envelope-from tsoome@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 DFA0F6D010; Sun, 8 Apr 2018 13:40:38 +0000 (UTC) (envelope-from tsoome@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 D70EB108E0; Sun, 8 Apr 2018 13:40:38 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38Dec95007501; Sun, 8 Apr 2018 13:40:38 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38DecUO007500; Sun, 8 Apr 2018 13:40:38 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201804081340.w38DecUO007500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 8 Apr 2018 13:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332275 - head/stand/i386/loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/loader X-SVN-Commit-Revision: 332275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 13:40:39 -0000 Author: tsoome Date: Sun Apr 8 13:40:38 2018 New Revision: 332275 URL: https://svnweb.freebsd.org/changeset/base/332275 Log: loader: 332270 did left out stand/i386/loader/loader.rc we have 2 instances of loader.rc... Modified: head/stand/i386/loader/loader.rc Modified: head/stand/i386/loader/loader.rc ============================================================================== --- head/stand/i386/loader/loader.rc Sun Apr 8 12:20:06 2018 (r332274) +++ head/stand/i386/loader/loader.rc Sun Apr 8 13:40:38 2018 (r332275) @@ -3,13 +3,10 @@ \ \ Includes additional commands include /boot/loader.4th -include /boot/efi.4th try-include /boot/loader.rc.local \ Reads and processes loader.conf variables initialize - -maybe-efi-resizecons \ Tests for password -- executes autoboot first if a password was defined check-password From owner-svn-src-all@freebsd.org Sun Apr 8 14:09:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45E4CF84495; Sun, 8 Apr 2018 14:09:28 +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 EDC667CAEF; Sun, 8 Apr 2018 14:09:27 +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 E571810DBB; Sun, 8 Apr 2018 14:09:27 +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 w38E9Rg3022461; Sun, 8 Apr 2018 14:09:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38E9Rq5022460; Sun, 8 Apr 2018 14:09:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081409.w38E9Rq5022460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 14:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332276 - stable/11/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet/libalias X-SVN-Commit-Revision: 332276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 14:09:28 -0000 Author: tuexen Date: Sun Apr 8 14:09:27 2018 New Revision: 332276 URL: https://svnweb.freebsd.org/changeset/base/332276 Log: MFC r327203: Allow the first (and second) argument of sn_calloc() be a sum. This fixes a bug reported in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224103 PR: 224103 Modified: stable/11/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/11/sys/netinet/libalias/alias_sctp.c Sun Apr 8 13:40:38 2018 (r332275) +++ stable/11/sys/netinet/libalias/alias_sctp.c Sun Apr 8 14:09:27 2018 (r332276) @@ -185,7 +185,7 @@ static MALLOC_DEFINE(M_SCTPNAT, "sctpnat", "sctp nat d /* Use kernel allocator. */ #ifdef _SYS_MALLOC_H_ #define sn_malloc(x) malloc(x, M_SCTPNAT, M_NOWAIT|M_ZERO) -#define sn_calloc(n,x) sn_malloc(x * n) +#define sn_calloc(n,x) sn_malloc((x) * (n)) #define sn_free(x) free(x, M_SCTPNAT) #endif// #ifdef _SYS_MALLOC_H_ From owner-svn-src-all@freebsd.org Sun Apr 8 14:24:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D01BF854BC; Sun, 8 Apr 2018 14:24:03 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6EB984DAE; Sun, 8 Apr 2018 14:24:02 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.55.165.26]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M9fLX-1fCZdX1dN9-00CzFK; Sun, 08 Apr 2018 16:24:00 +0200 Date: Sun, 8 Apr 2018 16:23:27 +0200 From: "O. Hartmann" To: Toomas Soome Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332272 - head/stand/forth Message-ID: <20180408162354.7985909a@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201804081155.w38BtR1K056446@repo.freebsd.org> References: <201804081155.w38BtR1K056446@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:gLxQ+9H2RiyipWEz5tWgbByKn6x8l8tZhyYwRU88bvI5qMYD/7k laeOJp/LG/7jfxW6LCAsj8Dr8BCT5Nc2ub0Ph7bAWXbg2etTHC1u5/ohMOf7vX6l/H9P4jl xksBKaRGspnxn55lZ2UbD4mxahsao6A7oCU7pIJtBjzXKu2UbnD2oHP6gXjw8kkcvTpThzn myoQzV9q2k8dZgEA9KV/g== X-UI-Out-Filterresults: notjunk:1;V01:K0:tbI1f6JDokg=:207xVUAIGFsFgDaXETv+MP k7S7pIcH9UYzX47y0AXzp/rFVsmV+S1C0oYzeNmC8e/0zsGJUDElv+tdox9RGYbcevaNfdcTp j/Ti2+xWQwgMv+GphXz6GOzu8wyHlialmCCbqnsv/9hYAzqxPjYvyQp1hWjQUvRYdhdWxhkGX IOXUl9dr+S//j5WChCfqnP7mFZLi+wQSW1FAE4s3ogeUeDEBkcFQHTRnR00Y8DbZntzQ5EMOJ V3camUrL4j0E+diAdMt4kIuTYLRfB1bD9cOksdDztNN2ZVfGHWm8mE40guUlEU98IT2y5f3A/ caFAwKpjShp2nfnpB0f9ZH7Vv/fuy/Ajy6Lt+5AuUqUeOpnIvV7l7OK19ny46FVvZCp3rcmct FcxpdbJwEwXAN4ktz82sVyuvsWQDdDiIIwwKSrTXtM+G9mr2IOFExsQ3OPWaM89T48lkjM+zU LrXXFM0G6TBFhO4vZ6J3GeXFg3wed268UeV/SBVLWUELuEH1h1AUbH4iMLOXToBKpC7aoPEKG YU9+tqM3FCOCmhyrdLtEI6PDKDuOgkjUz32djPG4BoSCBfJ0gs0s82pG6P4v/lbGqsg4f416J uxnnxXsbb2ZLDq9xQjAiaQXuaPio8E6GB1HP/yHokmApk7jBwxnyay+Q93CMJ7ggkvlZ2Ysbx ZH6dwkZr6atnzaEiPUzpY6vucsQfFXLNLo9DiCRXxEerjwvbibw8JK2f2noSHglKfcfex35eT YMjGI9cBGY0ykTk9l08/AaJSiHla/cEyopWGgmipzRDfbFopPQgJbUGqVVM0D0cspXKq7oG0j sSLye66XWNpG/uRxb1UatT/sn9Na3x7beSlR6CxKjTbQ2HRMyY= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 14:24:03 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFN1 biwgOCBBcHIgMjAxOCAxMTo1NToyNyArMDAwMCAoVVRDKQ0KVG9vbWFzIFNvb21lIDx0c29vbWVA RnJlZUJTRC5vcmc+IHNjaHJpZWI6DQoNCj4gQXV0aG9yOiB0c29vbWUNCj4gRGF0ZTogU3VuIEFw ciAgOCAxMTo1NToyNyAyMDE4DQo+IE5ldyBSZXZpc2lvbjogMzMyMjcyDQo+IFVSTDogaHR0cHM6 Ly9zdm53ZWIuZnJlZWJzZC5vcmcvY2hhbmdlc2V0L2Jhc2UvMzMyMjcyDQo+IA0KPiBMb2c6DQo+ ICAgbG9hZGVyOiAzMzIyNzAgZGlkIHVzZSB3cm9uZyBwYXRoIGZvciBlZmkuNHRoDQo+ICAgDQo+ ICAgVGhlIGNvcnJlY3QgIHBhdGggaXMgc3RpbGwgL2Jvb3QvZWZpLjR0aA0KPiANCj4gTW9kaWZp ZWQ6DQo+ICAgaGVhZC9zdGFuZC9mb3J0aC9sb2FkZXIuNHRoDQo+IA0KPiBNb2RpZmllZDogaGVh ZC9zdGFuZC9mb3J0aC9sb2FkZXIuNHRoDQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0g aGVhZC9zdGFuZC9mb3J0aC9sb2FkZXIuNHRoCVN1biBBcHIgIDggMTE6NTA6MDYgMjAxOAkocjMz MjI3MSkNCj4gKysrIGhlYWQvc3RhbmQvZm9ydGgvbG9hZGVyLjR0aAlTdW4gQXByICA4IDExOjU1 OjI3IDIwMTgJKHIzMzIyNzIpDQo+IEBAIC00Nyw3ICs0Nyw3IEBAIGluY2x1ZGUgL2Jvb3QvY29s b3IuNHRoDQo+ICBpbmNsdWRlIC9ib290L2RlbGF5LjR0aA0KPiAgaW5jbHVkZSAvYm9vdC9jaGVj ay1wYXNzd29yZC40dGgNCj4gIHMiIGVmaS12ZXJzaW9uIiBnZXRlbnY/IFtpZl0NCj4gLQlpbmNs dWRlIC9ib290L2ZvcnRoL2VmaS40dGgNCj4gKwlpbmNsdWRlIC9ib290L2VmaS40dGgNCj4gIFt0 aGVuXQ0KPiAgDQo+ICBvbmx5IGZvcnRoIGRlZmluaXRpb25zDQo+IF9fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fDQo+IHN2bi1zcmMtaGVhZEBmcmVlYnNkLm9y ZyBtYWlsaW5nIGxpc3QNCj4gaHR0cHM6Ly9saXN0cy5mcmVlYnNkLm9yZy9tYWlsbWFuL2xpc3Rp bmZvL3N2bi1zcmMtaGVhZA0KPiBUbyB1bnN1YnNjcmliZSwgc2VuZCBhbnkgbWFpbCB0byAic3Zu LXNyYy1oZWFkLXVuc3Vic2NyaWJlQGZyZWVic2Qub3JnIg0KDQpSZWNlbnQgQ1VSUkVOVCAoMzMy Mjc0KSBmYWlscyB0byBib290IG9uIE5hbm9CU0Qgd2l0aCA6DQpbLi4uXQ0KZWZpLWF1dG9yZXNp emVjb25zIG5vdCBmb3VuZA0KRXJyb3Igd2hpbGUgaW5jbHVkaW5nIC9ib290L2VmaS40dGgsDQoN CkdvdCB0aGlzIHRlc3RlZCBhbnl3YXk/DQoNCi0gLS0gDQpPLiBIYXJ0bWFubg0KDQpJY2ggd2lk ZXJzcHJlY2hlIGRlciBOdXR6dW5nIG9kZXIgw5xiZXJtaXR0bHVuZyBtZWluZXIgRGF0ZW4gZsO8 cg0KV2VyYmV6d2Vja2Ugb2RlciBmw7xyIGRpZSBNYXJrdC0gb2RlciBNZWludW5nc2ZvcnNjaHVu ZyAowqcgMjggQWJzLiA0IEJEU0cpLg0KLS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0NCg0K aUxVRUFSTUtBQjBXSVFRWlZaTXpBdHdDMlQvODZUclM1MjhmeUZoWWxBVUNXc29sK2dBS0NSRFM1 MjhmeUZoWQ0KbEdFL0Fmd0pld0dEY21mVU9mVkFReE9xMnQxSUJFZkM5dkxJNEg2a3BkU2RpeEJN eUFUKzhtand0SytDYXpmUg0KYkE2UVJBcUpLZVdRMEtOK3NTWDdOVmZhR0lrbkFnQ296bHA1S2JE TnIvL1k2QStjRUhoYUdlU3pINUFWQ0txeA0KQWZXRXV6T2RYWDQ5U3h4a0Y0TFMzNXVaR3U1VTc1 eThwcElnSVRYeStYbU1MWUFRSzB4QQ0KPTlPeGENCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0t LQ0K From owner-svn-src-all@freebsd.org Sun Apr 8 15:09:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 032C6F88C99; Sun, 8 Apr 2018 15:09:25 +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 797F47DFEF; Sun, 8 Apr 2018 15:09:24 +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 w38F9LwV013755; Sun, 8 Apr 2018 08:09:21 -0700 (PDT) (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 w38F9LEk013754; Sun, 8 Apr 2018 08:09:21 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804081509.w38F9LEk013754@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332265 - head/tools/diag/prtblknos In-Reply-To: <201804080652.w386qwvo003663@repo.freebsd.org> To: Kirk McKusick Date: Sun, 8 Apr 2018 08:09:21 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 15:09:25 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: mckusick > Date: Sun Apr 8 06:52:58 2018 > New Revision: 332265 > URL: https://svnweb.freebsd.org/changeset/base/332265 > > Log: > Split tools/diag/prtblknos into two parts: > main.c - opens disk and processes the argument list > of inodes to be printed > prtblknos.c - prints out the list of blocks used by an inode > > This change allows the fsdb program to import prtblknos() to use when > printing out the set of blocks used by an inode. YEA!!! Oh thank you Kirk! ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Apr 8 15:12:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 374F1F891A5; Sun, 8 Apr 2018 15:12:37 +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 E10977FE66; Sun, 8 Apr 2018 15:12:36 +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 DC12811965; Sun, 8 Apr 2018 15:12:36 +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 w38FCatJ056962; Sun, 8 Apr 2018 15:12:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38FCaDO056961; Sun, 8 Apr 2018 15:12:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201804081512.w38FCaDO056961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 8 Apr 2018 15:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332277 - head/sys/dev/fdt X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/fdt X-SVN-Commit-Revision: 332277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 15:12:37 -0000 Author: andrew Date: Sun Apr 8 15:12:36 2018 New Revision: 332277 URL: https://svnweb.freebsd.org/changeset/base/332277 Log: Replace calls to fdt_is_compatible with ofw_bus_node_is_compatible. These are almost identical so there is no need to keep the former around. Sponsored by: DARPA, AFRL Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sun Apr 8 14:09:27 2018 (r332276) +++ head/sys/dev/fdt/fdt_common.c Sun Apr 8 15:12:36 2018 (r332277) @@ -71,8 +71,6 @@ vm_offset_t fdt_immr_size; struct fdt_ic_list fdt_ic_list_head = SLIST_HEAD_INITIALIZER(fdt_ic_list_head); -static int fdt_is_compatible(phandle_t, const char *); - static int fdt_get_range_by_busaddr(phandle_t node, u_long addr, u_long *base, u_long *size) @@ -205,77 +203,6 @@ fdt_get_range(phandle_t node, int range_id, u_long *ba } int -fdt_immr_addr(vm_offset_t immr_va) -{ - phandle_t node; - u_long base, size; - int r; - - /* - * Try to access the SOC node directly i.e. through /aliases/. - */ - if ((node = OF_finddevice("soc")) != -1) - if (fdt_is_compatible(node, "simple-bus")) - goto moveon; - /* - * Find the node the long way. - */ - if ((node = OF_finddevice("/")) == -1) - return (ENXIO); - - if ((node = fdt_find_compatible(node, "simple-bus", 0)) == 0) - return (ENXIO); - -moveon: - if ((r = fdt_get_range(node, 0, &base, &size)) == 0) { - fdt_immr_pa = base; - fdt_immr_va = immr_va; - fdt_immr_size = size; - } - - return (r); -} - -/* - * This routine is an early-usage version of the ofw_bus_is_compatible() when - * the ofw_bus I/F is not available (like early console routines and similar). - * Note the buffer has to be on the stack since malloc() is usually not - * available in such cases either. - */ -static int -fdt_is_compatible(phandle_t node, const char *compatstr) -{ - char buf[FDT_COMPAT_LEN]; - char *compat; - int len, onelen, l, rv; - - if ((len = OF_getproplen(node, "compatible")) <= 0) - return (0); - - compat = (char *)&buf; - bzero(compat, FDT_COMPAT_LEN); - - if (OF_getprop(node, "compatible", compat, FDT_COMPAT_LEN) < 0) - return (0); - - onelen = strlen(compatstr); - rv = 0; - while (len > 0) { - if (strncasecmp(compat, compatstr, onelen) == 0) { - /* Found it. */ - rv = 1; - break; - } - /* Slide to the next sub-string. */ - l = strlen(compat) + 1; - compat += l; - len -= l; - } - - return (rv); -} - -int fdt_is_compatible_strict(phandle_t node, const char *compatible) { char compat[FDT_COMPAT_LEN]; @@ -303,7 +230,7 @@ fdt_find_compatible(phandle_t start, const char *compa * matching 'compatible' property. */ for (child = OF_child(start); child != 0; child = OF_peer(child)) - if (fdt_is_compatible(child, compat)) { + if (ofw_bus_node_is_compatible(child, compat)) { if (strict) if (!fdt_is_compatible_strict(child, compat)) continue; @@ -322,7 +249,7 @@ fdt_depth_search_compatible(phandle_t start, const cha * matching 'compatible' property. */ for (node = OF_child(start); node != 0; node = OF_peer(node)) { - if (fdt_is_compatible(node, compat) && + if (ofw_bus_node_is_compatible(node, compat) && (strict == 0 || fdt_is_compatible_strict(node, compat))) { return (node); } From owner-svn-src-all@freebsd.org Sun Apr 8 15:21:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48416F89B4C; Sun, 8 Apr 2018 15:21:13 +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 F1321849C7; Sun, 8 Apr 2018 15:21:12 +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 EC37811999; Sun, 8 Apr 2018 15:21:12 +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 w38FLCHF058044; Sun, 8 Apr 2018 15:21:12 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38FLCJ2058043; Sun, 8 Apr 2018 15:21:12 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201804081521.w38FLCJ2058043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 8 Apr 2018 15:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332278 - head/sys/dev/fdt X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/fdt X-SVN-Commit-Revision: 332278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 15:21:13 -0000 Author: andrew Date: Sun Apr 8 15:21:12 2018 New Revision: 332278 URL: https://svnweb.freebsd.org/changeset/base/332278 Log: Revert r332277, it contained an unintended extra change Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sun Apr 8 15:12:36 2018 (r332277) +++ head/sys/dev/fdt/fdt_common.c Sun Apr 8 15:21:12 2018 (r332278) @@ -71,6 +71,8 @@ vm_offset_t fdt_immr_size; struct fdt_ic_list fdt_ic_list_head = SLIST_HEAD_INITIALIZER(fdt_ic_list_head); +static int fdt_is_compatible(phandle_t, const char *); + static int fdt_get_range_by_busaddr(phandle_t node, u_long addr, u_long *base, u_long *size) @@ -203,6 +205,77 @@ fdt_get_range(phandle_t node, int range_id, u_long *ba } int +fdt_immr_addr(vm_offset_t immr_va) +{ + phandle_t node; + u_long base, size; + int r; + + /* + * Try to access the SOC node directly i.e. through /aliases/. + */ + if ((node = OF_finddevice("soc")) != -1) + if (fdt_is_compatible(node, "simple-bus")) + goto moveon; + /* + * Find the node the long way. + */ + if ((node = OF_finddevice("/")) == -1) + return (ENXIO); + + if ((node = fdt_find_compatible(node, "simple-bus", 0)) == 0) + return (ENXIO); + +moveon: + if ((r = fdt_get_range(node, 0, &base, &size)) == 0) { + fdt_immr_pa = base; + fdt_immr_va = immr_va; + fdt_immr_size = size; + } + + return (r); +} + +/* + * This routine is an early-usage version of the ofw_bus_is_compatible() when + * the ofw_bus I/F is not available (like early console routines and similar). + * Note the buffer has to be on the stack since malloc() is usually not + * available in such cases either. + */ +static int +fdt_is_compatible(phandle_t node, const char *compatstr) +{ + char buf[FDT_COMPAT_LEN]; + char *compat; + int len, onelen, l, rv; + + if ((len = OF_getproplen(node, "compatible")) <= 0) + return (0); + + compat = (char *)&buf; + bzero(compat, FDT_COMPAT_LEN); + + if (OF_getprop(node, "compatible", compat, FDT_COMPAT_LEN) < 0) + return (0); + + onelen = strlen(compatstr); + rv = 0; + while (len > 0) { + if (strncasecmp(compat, compatstr, onelen) == 0) { + /* Found it. */ + rv = 1; + break; + } + /* Slide to the next sub-string. */ + l = strlen(compat) + 1; + compat += l; + len -= l; + } + + return (rv); +} + +int fdt_is_compatible_strict(phandle_t node, const char *compatible) { char compat[FDT_COMPAT_LEN]; @@ -230,7 +303,7 @@ fdt_find_compatible(phandle_t start, const char *compa * matching 'compatible' property. */ for (child = OF_child(start); child != 0; child = OF_peer(child)) - if (ofw_bus_node_is_compatible(child, compat)) { + if (fdt_is_compatible(child, compat)) { if (strict) if (!fdt_is_compatible_strict(child, compat)) continue; @@ -249,7 +322,7 @@ fdt_depth_search_compatible(phandle_t start, const cha * matching 'compatible' property. */ for (node = OF_child(start); node != 0; node = OF_peer(node)) { - if (ofw_bus_node_is_compatible(node, compat) && + if (fdt_is_compatible(node, compat) && (strict == 0 || fdt_is_compatible_strict(node, compat))) { return (node); } From owner-svn-src-all@freebsd.org Sun Apr 8 15:29:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1303FF8A25A; Sun, 8 Apr 2018 15:29:15 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (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 AC98B691FE; Sun, 8 Apr 2018 15:29:14 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P6V00900EN2M900@st13p35im-asmtp001.me.com>; Sun, 08 Apr 2018 14:28:52 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1523197732; bh=AoToFNdQwfoKDzALTLp1V8NT5eW5GZoGoMcO94n+OG8=; h=From:Message-id:Content-type:MIME-version:Subject:Date:To; b=FIfNBgXQ0VaROeZOg0YFIv3fGm/zzwUryTUF5Yvv+VOK1PlJ9cYLB3Vtu3sp8M/C7 i3Tmr+A57QA89jvsnWqd5451r4uxUMN1ValJIrJd9c+SWqJHfN+MG8xswVxL49dBdS r1c13/hh+QoS7s4LZ0/g7kni4Aj7K8x+9QTqUeWMnV5jL4Sl34UQ3AlWYeZbQp/h0o kvNhPUhlzM9fDul0El+vr/nnBL9pPTafyRt0dARNS/7nw8kX2MtlFegdbVaztJxHfl CAffgoCugZgSu+gKVWazB758dMPRLOh8AroGWTkKKRqOpdjU15k5JmV6cFT0huKq6l yfJWRy3KLB7qQ== Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P6V003USEVZ4J00@st13p35im-asmtp001.me.com>; Sun, 08 Apr 2018 14:28:52 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-04-08_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=8 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1804080157 From: Toomas Soome Message-id: <39953A88-34F1-4FA4-A852-9859841E1356@me.com> MIME-version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r332272 - head/stand/forth Date: Sun, 08 Apr 2018 17:28:46 +0300 In-reply-to: <20180408162354.7985909a@thor.intern.walstatt.dynvpn.de> Cc: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: "O. Hartmann" References: <201804081155.w38BtR1K056446@repo.freebsd.org> <20180408162354.7985909a@thor.intern.walstatt.dynvpn.de> X-Mailer: Apple Mail (2.3445.6.18) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 15:29:15 -0000 > On 8 Apr 2018, at 17:23, O. Hartmann wrote: >=20 > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 >=20 > Am Sun, 8 Apr 2018 11:55:27 +0000 (UTC) > Toomas Soome schrieb: >=20 >> Author: tsoome >> Date: Sun Apr 8 11:55:27 2018 >> New Revision: 332272 >> URL: https://svnweb.freebsd.org/changeset/base/332272 >>=20 >> Log: >> loader: 332270 did use wrong path for efi.4th >>=20 >> The correct path is still /boot/efi.4th >>=20 >> Modified: >> head/stand/forth/loader.4th >>=20 >> Modified: head/stand/forth/loader.4th >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/stand/forth/loader.4th Sun Apr 8 11:50:06 2018 = (r332271) >> +++ head/stand/forth/loader.4th Sun Apr 8 11:55:27 2018 = (r332272) >> @@ -47,7 +47,7 @@ include /boot/color.4th >> include /boot/delay.4th >> include /boot/check-password.4th >> s" efi-version" getenv? [if] >> - include /boot/forth/efi.4th >> + include /boot/efi.4th >> [then] >>=20 >> only forth definitions >> _______________________________________________ >> 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" >=20 > Recent CURRENT (332274) fails to boot on NanoBSD with : > [...] > efi-autoresizecons not found > Error while including /boot/efi.4th, >=20 > Got this tested anyway? >=20 I'm sorry, you need r332275 - I totally did miss the i386 subdir has = another loader.rc.=20 rgds, toomas From owner-svn-src-all@freebsd.org Sun Apr 8 15:30:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FBD0F8A461; Sun, 8 Apr 2018 15:30:59 +0000 (UTC) (envelope-from brooks@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 1D52E6A1E2; Sun, 8 Apr 2018 15:30:59 +0000 (UTC) (envelope-from brooks@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 EDC8911B3A; Sun, 8 Apr 2018 15:30:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38FUwLr063222; Sun, 8 Apr 2018 15:30:58 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38FUwmc063221; Sun, 8 Apr 2018 15:30:58 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081530.w38FUwmc063221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 15:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332279 - stable/11/sys/dev/nxge X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/dev/nxge X-SVN-Commit-Revision: 332279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 15:30:59 -0000 Author: brooks Date: Sun Apr 8 15:30:58 2018 New Revision: 332279 URL: https://svnweb.freebsd.org/changeset/base/332279 Log: MFC r331654, r331869 r331654: Don't access userspace directly from the kernel in nxge(4). Update to what the previous code seemed to be doing via the correct interfaces. Further issues exist in xge_ioctl_registers(), but this is debugging code in a driver that has few users and they don't appear to be crashes or leaks. Reviewed by: jhb (prior version) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14848 r331869: Fix the build on arches with default unsigned char. Capture the fubyte() return value in an int as well as the char, and test the full int value for fubyte() failure. Modified: stable/11/sys/dev/nxge/if_nxge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nxge/if_nxge.c ============================================================================== --- stable/11/sys/dev/nxge/if_nxge.c Sun Apr 8 15:21:12 2018 (r332278) +++ stable/11/sys/dev/nxge/if_nxge.c Sun Apr 8 15:30:58 2018 (r332279) @@ -1362,11 +1362,16 @@ int xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifreqp) { xge_hal_status_e status = XGE_HAL_OK; - char *data = (char *)ifreqp->ifr_data; + char cmd, mode; void *info = NULL; - int retValue = EINVAL; + int retValue; - switch(*data) { + cmd = retValue = fubyte(ifreqp->ifr_data); + if (retValue == -1) + return (EFAULT); + + retValue = EINVAL; + switch(cmd) { case XGE_QUERY_STATS: mtx_lock(&lldev->mtx_drv); status = xge_hal_stats_hw(lldev->devh, @@ -1494,8 +1499,8 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre case XGE_SET_BUFFER_MODE_1: case XGE_SET_BUFFER_MODE_2: case XGE_SET_BUFFER_MODE_5: - *data = (*data == XGE_SET_BUFFER_MODE_1) ? 'Y':'N'; - if(copyout(data, ifreqp->ifr_data, sizeof(data)) == 0) + mode = (cmd == XGE_SET_BUFFER_MODE_1) ? 'Y':'N'; + if(copyout(&mode, ifreqp->ifr_data, sizeof(mode)) == 0) retValue = 0; break; default: @@ -1516,10 +1521,17 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre int xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq *ifreqp) { - xge_register_t *data = (xge_register_t *)ifreqp->ifr_data; + xge_register_t tmpdata; + xge_register_t *data; xge_hal_status_e status = XGE_HAL_OK; int retValue = EINVAL, offset = 0, index = 0; + int error; u64 val64 = 0; + + error = copyin(ifreqp->ifr_data, &tmpdata, sizeof(tmpdata)); + if (error != 0) + return (error); + data = &tmpdata; /* Reading a register */ if(strcmp(data->option, "-r") == 0) { From owner-svn-src-all@freebsd.org Sun Apr 8 15:35:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 540FCF8AB60; Sun, 8 Apr 2018 15:35:58 +0000 (UTC) (envelope-from brooks@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 062AA6CFC9; Sun, 8 Apr 2018 15:35:58 +0000 (UTC) (envelope-from brooks@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 D931C11CAA; Sun, 8 Apr 2018 15:35:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38FZv0M067032; Sun, 8 Apr 2018 15:35:57 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38FZvwg067031; Sun, 8 Apr 2018 15:35:57 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081535.w38FZvwg067031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 15:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332280 - stable/10/sys/dev/nxge X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/sys/dev/nxge X-SVN-Commit-Revision: 332280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 15:35:58 -0000 Author: brooks Date: Sun Apr 8 15:35:57 2018 New Revision: 332280 URL: https://svnweb.freebsd.org/changeset/base/332280 Log: MFC r331654, r331869 r331654: Don't access userspace directly from the kernel in nxge(4). Update to what the previous code seemed to be doing via the correct interfaces. Further issues exist in xge_ioctl_registers(), but this is debugging code in a driver that has few users and they don't appear to be crashes or leaks. Reviewed by: jhb (prior version) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14848 r331869: Fix the build on arches with default unsigned char. Capture the fubyte() return value in an int as well as the char, and test the full int value for fubyte() failure. Modified: stable/10/sys/dev/nxge/if_nxge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nxge/if_nxge.c ============================================================================== --- stable/10/sys/dev/nxge/if_nxge.c Sun Apr 8 15:30:58 2018 (r332279) +++ stable/10/sys/dev/nxge/if_nxge.c Sun Apr 8 15:35:57 2018 (r332280) @@ -1361,11 +1361,16 @@ int xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifreqp) { xge_hal_status_e status = XGE_HAL_OK; - char *data = (char *)ifreqp->ifr_data; + char cmd, mode; void *info = NULL; - int retValue = EINVAL; + int retValue; - switch(*data) { + cmd = retValue = fubyte(ifreqp->ifr_data); + if (retValue == -1) + return (EFAULT); + + retValue = EINVAL; + switch(cmd) { case XGE_QUERY_STATS: mtx_lock(&lldev->mtx_drv); status = xge_hal_stats_hw(lldev->devh, @@ -1493,8 +1498,8 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre case XGE_SET_BUFFER_MODE_1: case XGE_SET_BUFFER_MODE_2: case XGE_SET_BUFFER_MODE_5: - *data = (*data == XGE_SET_BUFFER_MODE_1) ? 'Y':'N'; - if(copyout(data, ifreqp->ifr_data, sizeof(data)) == 0) + mode = (cmd == XGE_SET_BUFFER_MODE_1) ? 'Y':'N'; + if(copyout(&mode, ifreqp->ifr_data, sizeof(mode)) == 0) retValue = 0; break; default: @@ -1515,10 +1520,17 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre int xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq *ifreqp) { - xge_register_t *data = (xge_register_t *)ifreqp->ifr_data; + xge_register_t tmpdata; + xge_register_t *data; xge_hal_status_e status = XGE_HAL_OK; int retValue = EINVAL, offset = 0, index = 0; + int error; u64 val64 = 0; + + error = copyin(ifreqp->ifr_data, &tmpdata, sizeof(tmpdata)); + if (error != 0) + return (error); + data = &tmpdata; /* Reading a register */ if(strcmp(data->option, "-r") == 0) { From owner-svn-src-all@freebsd.org Sun Apr 8 15:52:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AC23F8BD5B; Sun, 8 Apr 2018 15:52:33 +0000 (UTC) (envelope-from brooks@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 B85B17643F; Sun, 8 Apr 2018 15:52:32 +0000 (UTC) (envelope-from brooks@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 B166011FEB; Sun, 8 Apr 2018 15:52:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38FqWA6077074; Sun, 8 Apr 2018 15:52:32 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38FqWMj077072; Sun, 8 Apr 2018 15:52:32 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081552.w38FqWMj077072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 15:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332281 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 332281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 15:52:33 -0000 Author: brooks Date: Sun Apr 8 15:52:32 2018 New Revision: 332281 URL: https://svnweb.freebsd.org/changeset/base/332281 Log: MFC r331641, r331644, r332158 r331641: Fix access to ifru_buffer on freebsd32. Make all kernel accesses to ifru_buffer go via access functions which take the process ABI into account and use an appropriate union to access members in the correct place in struct ifreq. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14846 r331644: Fix a whitespace bug missed in refactoring prior to r331641. MFC with: r331641 r332158: Remove the thread argument from ifr_buffer_*() accessors. They are always used in a context where curthread is the correct thread. This makes them more similar to the ifr_data_get_ptr() accessor. Modified: stable/11/sys/net/if.c stable/11/sys/net/if.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Sun Apr 8 15:35:57 2018 (r332280) +++ stable/11/sys/net/if.c Sun Apr 8 15:52:32 2018 (r332281) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -97,8 +98,50 @@ #ifdef COMPAT_FREEBSD32 #include #include + +struct ifreq_buffer32 { + uint32_t length; /* (size_t) */ + uint32_t buffer; /* (void *) */ +}; + +/* + * Interface request structure used for socket + * ioctl's. All interface ioctl's must have parameter + * definitions which begin with ifr_name. The + * remainder may be interface specific. + */ +struct ifreq32 { + char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + union { + struct sockaddr ifru_addr; + struct sockaddr ifru_dstaddr; + struct sockaddr ifru_broadaddr; + struct ifreq_buffer32 ifru_buffer; + short ifru_flags[2]; + short ifru_index; + int ifru_jid; + int ifru_metric; + int ifru_mtu; + int ifru_phys; + int ifru_media; + uint32_t ifru_data; + int ifru_cap[2]; + u_int ifru_fib; + u_char ifru_vlan_pcp; + } ifr_ifru; +}; +CTASSERT(sizeof(struct ifreq) == sizeof(struct ifreq32)); +CTASSERT(__offsetof(struct ifreq, ifr_ifru) == + __offsetof(struct ifreq32, ifr_ifru)); #endif +union ifreq_union { + struct ifreq ifr; +#ifdef COMPAT_FREEBSD32 + struct ifreq32 ifr32; +#endif +}; + SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); @@ -2302,6 +2345,61 @@ ifunit(const char *name) return (ifp); } +static void * +ifr_buffer_get_buffer(void *data) +{ + union ifreq_union *ifrup; + + ifrup = data; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return ((void *)(uintptr_t) + ifrup->ifr32.ifr_ifru.ifru_buffer.buffer); +#endif + return (ifrup->ifr.ifr_ifru.ifru_buffer.buffer); +} + +static void +ifr_buffer_set_buffer_null(void *data) +{ + union ifreq_union *ifrup; + + ifrup = data; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + ifrup->ifr32.ifr_ifru.ifru_buffer.buffer = 0; + else +#endif + ifrup->ifr.ifr_ifru.ifru_buffer.buffer = NULL; +} + +static size_t +ifr_buffer_get_length(void *data) +{ + union ifreq_union *ifrup; + + ifrup = data; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return (ifrup->ifr32.ifr_ifru.ifru_buffer.length); +#endif + return (ifrup->ifr.ifr_ifru.ifru_buffer.length); +} + +static void +ifr_buffer_set_length(void *data, size_t len) +{ + union ifreq_union *ifrup; + + ifrup = data; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + ifrup->ifr32.ifr_ifru.ifru_buffer.length = len; + else +#endif + ifrup->ifr.ifr_ifru.ifru_buffer.length = len; +} + /* * Hardware specific interface ioctls. */ @@ -2362,12 +2460,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, else { /* space for terminating nul */ descrlen = strlen(ifp->if_description) + 1; - if (ifr->ifr_buffer.length < descrlen) - ifr->ifr_buffer.buffer = NULL; + if (ifr_buffer_get_length(ifr) < descrlen) + ifr_buffer_set_buffer_null(ifr); else error = copyout(ifp->if_description, - ifr->ifr_buffer.buffer, descrlen); - ifr->ifr_buffer.length = descrlen; + ifr_buffer_get_buffer(ifr), descrlen); + ifr_buffer_set_length(ifr, descrlen); } sx_sunlock(&ifdescr_sx); break; @@ -2383,15 +2481,15 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, * length parameter is supposed to count the * terminating nul in. */ - if (ifr->ifr_buffer.length > ifdescr_maxlen) + if (ifr_buffer_get_length(ifr) > ifdescr_maxlen) return (ENAMETOOLONG); - else if (ifr->ifr_buffer.length == 0) + else if (ifr_buffer_get_length(ifr) == 0) descrbuf = NULL; else { - descrbuf = malloc(ifr->ifr_buffer.length, M_IFDESCR, - M_WAITOK | M_ZERO); - error = copyin(ifr->ifr_buffer.buffer, descrbuf, - ifr->ifr_buffer.length - 1); + descrbuf = malloc(ifr_buffer_get_length(ifr), + M_IFDESCR, M_WAITOK | M_ZERO); + error = copyin(ifr_buffer_get_buffer(ifr), descrbuf, + ifr_buffer_get_length(ifr) - 1); if (error) { free(descrbuf, M_IFDESCR); break; Modified: stable/11/sys/net/if.h ============================================================================== --- stable/11/sys/net/if.h Sun Apr 8 15:35:57 2018 (r332280) +++ stable/11/sys/net/if.h Sun Apr 8 15:52:32 2018 (r332281) @@ -398,7 +398,9 @@ struct ifreq { #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ +#ifndef _KERNEL #define ifr_buffer ifr_ifru.ifru_buffer /* user supplied buffer with its length */ +#endif #define ifr_flags ifr_ifru.ifru_flags[0] /* flags (low 16 bits) */ #define ifr_flagshigh ifr_ifru.ifru_flags[1] /* flags (high 16 bits) */ #define ifr_jid ifr_ifru.ifru_jid /* jail/vnet */ From owner-svn-src-all@freebsd.org Sun Apr 8 16:24:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 191D0F8E07F; Sun, 8 Apr 2018 16:24:38 +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 BDF45683C3; Sun, 8 Apr 2018 16:24:37 +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 B5A27124F7; Sun, 8 Apr 2018 16:24:37 +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 w38GObcQ092210; Sun, 8 Apr 2018 16:24:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GOb3r092209; Sun, 8 Apr 2018 16:24:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081624.w38GOb3r092209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 16:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332282 - stable/10/sys/netinet/libalias X-SVN-Group: stable-10 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/10/sys/netinet/libalias X-SVN-Commit-Revision: 332282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:24:38 -0000 Author: tuexen Date: Sun Apr 8 16:24:37 2018 New Revision: 332282 URL: https://svnweb.freebsd.org/changeset/base/332282 Log: MFC r327203: Allow the first (and second) argument of sn_calloc() be a sum. This fixes a bug reported in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224103 PR: 224103 Modified: stable/10/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 15:52:32 2018 (r332281) +++ stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 16:24:37 2018 (r332282) @@ -185,7 +185,7 @@ static MALLOC_DEFINE(M_SCTPNAT, "sctpnat", "sctp nat d /* Use kernel allocator. */ #ifdef _SYS_MALLOC_H_ #define sn_malloc(x) malloc(x, M_SCTPNAT, M_NOWAIT|M_ZERO) -#define sn_calloc(n,x) sn_malloc(x * n) +#define sn_calloc(n,x) sn_malloc((x) * (n)) #define sn_free(x) free(x, M_SCTPNAT) #endif// #ifdef _SYS_MALLOC_H_ From owner-svn-src-all@freebsd.org Sun Apr 8 16:26:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8A06F8E229; Sun, 8 Apr 2018 16:26: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 868C4692E0; Sun, 8 Apr 2018 16:26: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 81136124FB; Sun, 8 Apr 2018 16:26: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 w38GQGYl092335; Sun, 8 Apr 2018 16:26:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GQGnp092334; Sun, 8 Apr 2018 16:26:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081626.w38GQGnp092334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 16:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332283 - stable/10/sys/netinet/libalias X-SVN-Group: stable-10 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/10/sys/netinet/libalias X-SVN-Commit-Revision: 332283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:26:17 -0000 Author: tuexen Date: Sun Apr 8 16:26:16 2018 New Revision: 332283 URL: https://svnweb.freebsd.org/changeset/base/332283 Log: MFC r327205: Fix an assignment. While there, do some whitespace cleanups. CID: 1008936 Modified: stable/10/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 16:24:37 2018 (r332282) +++ stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 16:26:16 2018 (r332283) @@ -2114,31 +2114,31 @@ FindSctpGlobal(struct libalias *la, struct in_addr g_a * @return pointer to association or NULL */ static struct sctp_nat_assoc* -FindSctpLocalT(struct libalias *la, struct in_addr g_addr, uint32_t l_vtag, uint16_t g_port, uint16_t l_port) +FindSctpLocalT(struct libalias *la, struct in_addr g_addr, uint32_t l_vtag, uint16_t g_port, uint16_t l_port) { u_int i; struct sctp_nat_assoc *assoc = NULL, *lastmatch = NULL; struct sctp_GlobalAddress *G_Addr = NULL; int cnt = 0; - + if (l_vtag != 0) { /* an init packet, vtag==0 */ i = SN_TABLE_HASH(l_vtag, g_port, la->sctpNatTableSize); LIST_FOREACH(assoc, &la->sctpTableGlobal[i], list_G) { if ((assoc->g_vtag == l_vtag) && (assoc->g_port == g_port) && (assoc->l_port == l_port)) { if (assoc->num_Gaddr) { LIST_FOREACH(G_Addr, &(assoc->Gaddr), list_Gaddr) { - if(G_Addr->g_addr.s_addr == G_Addr->g_addr.s_addr) - return(assoc); /* full match */ + if (G_Addr->g_addr.s_addr == g_addr.s_addr) + return (assoc); /* full match */ } } else { - if (++cnt > 1) return(NULL); + if (++cnt > 1) return (NULL); lastmatch = assoc; } } } } /* If there is more than one match we do not know which local address to send to */ - return( cnt ? lastmatch : NULL ); + return (cnt ? lastmatch : NULL); } /** @ingroup Hash From owner-svn-src-all@freebsd.org Sun Apr 8 16:29:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5899BF8E513; Sun, 8 Apr 2018 16:29:25 +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 0D2166AF01; Sun, 8 Apr 2018 16:29:25 +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 054D212501; Sun, 8 Apr 2018 16:29:25 +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 w38GTOhq092494; Sun, 8 Apr 2018 16:29:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GTOuG092493; Sun, 8 Apr 2018 16:29:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804081629.w38GTOuG092493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 8 Apr 2018 16:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332284 - stable/10/sys/netinet/libalias X-SVN-Group: stable-10 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/10/sys/netinet/libalias X-SVN-Commit-Revision: 332284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:29:25 -0000 Author: tuexen Date: Sun Apr 8 16:29:24 2018 New Revision: 332284 URL: https://svnweb.freebsd.org/changeset/base/332284 Log: Fix an assignment to force the level to be in the required interval. CID: 1008428 Modified: stable/10/sys/netinet/libalias/alias_sctp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/libalias/alias_sctp.c ============================================================================== --- stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 16:26:16 2018 (r332283) +++ stable/10/sys/netinet/libalias/alias_sctp.c Sun Apr 8 16:29:24 2018 (r332284) @@ -420,9 +420,9 @@ int sysctl_chg_loglevel(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &level, 0, req); if (error) return (error); - sysctl_log_level = (level > SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level); - sysctl_log_level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level); - + level = (level > SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level); + level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level); + sysctl_log_level = level; return (0); } From owner-svn-src-all@freebsd.org Sun Apr 8 16:34:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1284FF8EA8D; Sun, 8 Apr 2018 16:34: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 B77B76DB88; Sun, 8 Apr 2018 16:34:10 +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 AF1D112697; Sun, 8 Apr 2018 16:34:10 +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 w38GYArJ097151; Sun, 8 Apr 2018 16:34:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GYA8N097150; Sun, 8 Apr 2018 16:34:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804081634.w38GYA8N097150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 8 Apr 2018 16:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332285 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:34:11 -0000 Author: mjg Date: Sun Apr 8 16:34:10 2018 New Revision: 332285 URL: https://svnweb.freebsd.org/changeset/base/332285 Log: locks: tweak backoff a little bit Previous limits were chosen when locking primitives had spurious lock accesses. Flipping the starting point to 1 (or rather 2 as the first call shifts it) provides a modest win when mild contention is seen while not hurting worse cases. Tested on a bunch of one, two and four socket old and new systems (Westmere, Skylake, Threadreaper and others) by doing concurrent page faults, buildkernel/buildworld and other stuff (although not all systems got all the tests). Another thing is the upper limit. It is semi-arbitrarily chosen as it was getting out of hand for slightly less small systems (e.g. a 128-thread one). Note that backoff is fundamentally a speculative bandaid and this change just makes it fit a little bit better. It remains completely oblivious to the hardware topology or the contention pattern. This is being experimented with. Modified: head/sys/kern/subr_lock.c Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Sun Apr 8 16:29:24 2018 (r332284) +++ head/sys/kern/subr_lock.c Sun Apr 8 16:34:10 2018 (r332285) @@ -156,8 +156,10 @@ void lock_delay_default_init(struct lock_delay_config *lc) { - lc->base = lock_roundup_2(mp_ncpus) / 4; - lc->max = lc->base * 1024; + lc->base = 1; + lc->max = lock_roundup_2(mp_ncpus) * 256; + if (lc->max > 32678) + lc->max = 32678; } #ifdef DDB From owner-svn-src-all@freebsd.org Sun Apr 8 16:43:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15757F8F3D4; Sun, 8 Apr 2018 16:43:57 +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 BB761734C6; Sun, 8 Apr 2018 16:43:56 +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 B660812831; Sun, 8 Apr 2018 16:43:56 +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 w38Ghulf002765; Sun, 8 Apr 2018 16:43:56 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GhuSN002764; Sun, 8 Apr 2018 16:43:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804081643.w38GhuSN002764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 8 Apr 2018 16:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332286 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 332286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:43:57 -0000 Author: jhibbits Date: Sun Apr 8 16:43:56 2018 New Revision: 332286 URL: https://svnweb.freebsd.org/changeset/base/332286 Log: powerpc/ofw: Fix malloc inside lock Summary: Currently ofw_real_bounce_alloc() is requesting memory, using WAITOK, holding a non-sleepable locks, called 'OF Bounce Page'. Fix this by allocating the pages outside of the lock, and only updating the global variables while holding the lock. Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D14955 Modified: head/sys/powerpc/ofw/ofw_real.c Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Sun Apr 8 16:34:10 2018 (r332285) +++ head/sys/powerpc/ofw/ofw_real.c Sun Apr 8 16:43:56 2018 (r332286) @@ -197,6 +197,8 @@ ofw_real_stop(void) static void ofw_real_bounce_alloc(void *junk) { + caddr_t temp; + /* * Check that ofw_real is actually in use before allocating wads * of memory. Do this by checking if our mutex has been set up. @@ -208,12 +210,15 @@ ofw_real_bounce_alloc(void *junk) * Allocate a page of contiguous, wired physical memory that can * fit into a 32-bit address space and accessed from real mode. */ + temp = contigmalloc(4 * PAGE_SIZE, M_OFWREAL, 0, 0, + ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), PAGE_SIZE, + 4 * PAGE_SIZE); + if (temp == NULL) + panic("%s: Not able to allocated contiguous memory\n", __func__); mtx_lock(&of_bounce_mtx); - of_bounce_virt = contigmalloc(4 * PAGE_SIZE, M_OFWREAL, 0, 0, - ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), PAGE_SIZE, - 4 * PAGE_SIZE); + of_bounce_virt = temp; of_bounce_phys = vtophys(of_bounce_virt); of_bounce_size = 4 * PAGE_SIZE; From owner-svn-src-all@freebsd.org Sun Apr 8 16:46:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74D5AF8F702; Sun, 8 Apr 2018 16:46:25 +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 2674B74B09; Sun, 8 Apr 2018 16:46:25 +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 217031283B; Sun, 8 Apr 2018 16:46:25 +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 w38GkPqK002914; Sun, 8 Apr 2018 16:46:25 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GkOY6002912; Sun, 8 Apr 2018 16:46:24 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804081646.w38GkOY6002912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 8 Apr 2018 16:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332287 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 332287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:46:25 -0000 Author: jhibbits Date: Sun Apr 8 16:46:24 2018 New Revision: 332287 URL: https://svnweb.freebsd.org/changeset/base/332287 Log: powerpc64: Avoid calling isync twice Summary: It is not necessary to call isync() after calling mtmsr() function, mainly because the mtmsr() calls 'isync' internally to synchronize the machine state register. Other than that, isync() just calls the 'isync' instruction, thus, the 'isync' instruction is being called twice, and that seems to be unnecessary. This patch just remove the unecessary calls to isync() after mtmsr(). Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D14583 Modified: head/sys/powerpc/powerpc/altivec.c head/sys/powerpc/powerpc/cpu.c head/sys/powerpc/powerpc/fpu.c Modified: head/sys/powerpc/powerpc/altivec.c ============================================================================== --- head/sys/powerpc/powerpc/altivec.c Sun Apr 8 16:43:56 2018 (r332286) +++ head/sys/powerpc/powerpc/altivec.c Sun Apr 8 16:46:24 2018 (r332287) @@ -58,7 +58,6 @@ save_vec_int(struct thread *td) */ msr = mfmsr(); mtmsr(msr | PSL_VEC); - isync(); /* * Save the vector registers and VSCR to the PCB @@ -120,7 +119,6 @@ enable_vec(struct thread *td) */ msr = mfmsr(); mtmsr(msr | PSL_VEC); - isync(); /* * Restore VSCR by first loading it into a vector and then into VSCR. Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sun Apr 8 16:43:56 2018 (r332286) +++ head/sys/powerpc/powerpc/cpu.c Sun Apr 8 16:46:24 2018 (r332287) @@ -710,7 +710,6 @@ cpu_idle_60x(sbintime_t sbt) default: powerpc_sync(); mtmsr(msr | PSL_POW); - isync(); break; } #endif @@ -739,7 +738,6 @@ cpu_idle_booke(sbintime_t sbt) default: powerpc_sync(); mtmsr(msr | PSL_WE); - isync(); break; } #endif Modified: head/sys/powerpc/powerpc/fpu.c ============================================================================== --- head/sys/powerpc/powerpc/fpu.c Sun Apr 8 16:43:56 2018 (r332286) +++ head/sys/powerpc/powerpc/fpu.c Sun Apr 8 16:46:24 2018 (r332287) @@ -87,7 +87,6 @@ enable_fpu(struct thread *td) mtmsr(msr | PSL_FP | PSL_VSX); else mtmsr(msr | PSL_FP); - isync(); /* * Load the floating point registers and FPSCR from the PCB. @@ -143,7 +142,6 @@ save_fpu(struct thread *td) mtmsr(msr | PSL_FP | PSL_VSX); else mtmsr(msr | PSL_FP); - isync(); /* * Save the floating-point registers and FPSCR to the PCB From owner-svn-src-all@freebsd.org Sun Apr 8 16:54:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49706F90100; Sun, 8 Apr 2018 16:54:11 +0000 (UTC) (envelope-from brooks@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 EC481792BB; Sun, 8 Apr 2018 16:54:10 +0000 (UTC) (envelope-from brooks@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 E4661129EF; Sun, 8 Apr 2018 16:54:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38GsAW0007814; Sun, 8 Apr 2018 16:54:10 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38Gs7JY007779; Sun, 8 Apr 2018 16:54:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081654.w38Gs7JY007779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 16:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev/patm dev/qlnx/qlnxe dev/... X-SVN-Commit-Revision: 332288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:54:11 -0000 Author: brooks Date: Sun Apr 8 16:54:07 2018 New Revision: 332288 URL: https://svnweb.freebsd.org/changeset/base/332288 Log: MFC r331797: Use an accessor function to access ifr_data. This fixes 32-bit compat (no ioctl command defintions are required as struct ifreq is the same size). Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14900 Modified: stable/11/sys/dev/an/if_an.c stable/11/sys/dev/ath/if_ath_ioctl.c stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/de/if_de.c stable/11/sys/dev/en/midway.c stable/11/sys/dev/fatm/if_fatm.c stable/11/sys/dev/hatm/if_hatm_ioctl.c stable/11/sys/dev/if_ndis/if_ndis.c stable/11/sys/dev/iwi/if_iwi.c stable/11/sys/dev/ixgbe/if_ix.c stable/11/sys/dev/ixl/ixl_pf_main.c stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mwl/if_mwl.c stable/11/sys/dev/nxge/if_nxge.c stable/11/sys/dev/oce/oce_if.c stable/11/sys/dev/patm/if_patm_ioctl.c stable/11/sys/dev/qlnx/qlnxe/qlnx_os.c stable/11/sys/dev/sbni/if_sbni.c stable/11/sys/dev/sfxge/sfxge.c stable/11/sys/dev/vxge/vxge.c stable/11/sys/dev/wl/if_wl.c stable/11/sys/net/if.c stable/11/sys/net/if.h stable/11/sys/net/if_gif.c stable/11/sys/net/if_gre.c stable/11/sys/net/if_ipsec.c stable/11/sys/net/if_spppsubr.c stable/11/sys/net/if_var.h stable/11/sys/net/if_vlan.c stable/11/sys/net/iflib.c stable/11/sys/net80211/ieee80211_ioctl.c stable/11/sys/netinet/ip_carp.c stable/11/sys/netpfil/pf/if_pfsync.c stable/11/sys/security/mac/mac_net.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/an/if_an.c ============================================================================== --- stable/11/sys/dev/an/if_an.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/an/if_an.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1932,7 +1932,8 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da error = 0; break; case SIOCGAIRONET: - error = copyin(ifr->ifr_data, &sc->areq, sizeof(sc->areq)); + error = copyin(ifr_data_get_ptr(ifr), &sc->areq, + sizeof(sc->areq)); if (error != 0) break; AN_LOCK(sc); @@ -1961,13 +1962,15 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da break; } AN_UNLOCK(sc); - error = copyout(&sc->areq, ifr->ifr_data, sizeof(sc->areq)); + error = copyout(&sc->areq, ifr_data_get_ptr(ifr), + sizeof(sc->areq)); break; case SIOCSAIRONET: if ((error = priv_check(td, PRIV_DRIVER))) goto out; AN_LOCK(sc); - error = copyin(ifr->ifr_data, &sc->areq, sizeof(sc->areq)); + error = copyin(ifr_data_get_ptr(ifr), &sc->areq, + sizeof(sc->areq)); if (error != 0) break; an_setdef(sc, &sc->areq); @@ -1976,7 +1979,8 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da case SIOCGPRIVATE_0: /* used by Cisco client utility */ if ((error = priv_check(td, PRIV_DRIVER))) goto out; - error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl)); + error = copyin(ifr_data_get_ptr(ifr), &l_ioctl, + sizeof(l_ioctl)); if (error) goto out; mode = l_ioctl.command; @@ -1994,13 +1998,15 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da AN_UNLOCK(sc); if (!error) { /* copy out the updated command info */ - error = copyout(&l_ioctl, ifr->ifr_data, sizeof(l_ioctl)); + error = copyout(&l_ioctl, ifr_data_get_ptr(ifr), + sizeof(l_ioctl)); } break; case SIOCGPRIVATE_1: /* used by Cisco client utility */ if ((error = priv_check(td, PRIV_DRIVER))) goto out; - error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl)); + error = copyin(ifr_data_get_ptr(ifr), &l_ioctl, + sizeof(l_ioctl)); if (error) goto out; l_ioctl.command = 0; Modified: stable/11/sys/dev/ath/if_ath_ioctl.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_ioctl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/ath/if_ath_ioctl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -267,12 +267,12 @@ ath_ioctl(struct ieee80211com *ic, u_long cmd, void *d rt->info[sc->sc_txrix].dot11Rate &~ IEEE80211_RATE_BASIC; if (rt->info[sc->sc_txrix].phy & IEEE80211_T_HT) sc->sc_stats.ast_tx_rate |= IEEE80211_RATE_MCS; - return copyout(&sc->sc_stats, - ifr->ifr_data, sizeof (sc->sc_stats)); + return copyout(&sc->sc_stats, ifr_data_get_ptr(ifr), + sizeof (sc->sc_stats)); } case SIOCGATHAGSTATS: - return copyout(&sc->sc_aggr_stats, - ifr->ifr_data, sizeof (sc->sc_aggr_stats)); + return copyout(&sc->sc_aggr_stats, ifr_data_get_ptr(ifr), + sizeof (sc->sc_aggr_stats)); case SIOCZATHSTATS: { int error; Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1795,7 +1795,7 @@ fail: case SIOCGI2C: { struct ifi2creq i2c; - rc = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + rc = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (rc != 0) break; if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) { @@ -1813,7 +1813,7 @@ fail: i2c.offset, i2c.len, &i2c.data[0]); end_synchronized_op(sc, 0); if (rc == 0) - rc = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + rc = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; } Modified: stable/11/sys/dev/de/if_de.c ============================================================================== --- stable/11/sys/dev/de/if_de.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/de/if_de.c Sun Apr 8 16:54:07 2018 (r332288) @@ -4266,7 +4266,7 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t #ifdef SIOCGADDRROM case SIOCGADDRROM: { - error = copyout(sc->tulip_rombuf, ifr->ifr_data, sizeof(sc->tulip_rombuf)); + error = copyout(sc->tulip_rombuf, ifr_data_get_ptr(ifr), sizeof(sc->tulip_rombuf)); break; } #endif Modified: stable/11/sys/dev/en/midway.c ============================================================================== --- stable/11/sys/dev/en/midway.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/en/midway.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1609,7 +1609,7 @@ en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCATMGVCCS: /* return vcc table */ vtab = atm_getvccs((struct atmio_vcc **)sc->vccs, MID_N_VC, sc->vccs_open, &sc->en_mtx, 1); - error = copyout(vtab, ifr->ifr_data, sizeof(*vtab) + + error = copyout(vtab, ifr_data_get_ptr(ifr), sizeof(*vtab) + vtab->count * sizeof(vtab->vccs[0])); free(vtab, M_DEVBUF); break; Modified: stable/11/sys/dev/fatm/if_fatm.c ============================================================================== --- stable/11/sys/dev/fatm/if_fatm.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/fatm/if_fatm.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2497,7 +2497,7 @@ fatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t arg) /* return vcc table */ vtab = atm_getvccs((struct atmio_vcc **)sc->vccs, FORE_MAX_VCC + 1, sc->open_vccs, &sc->mtx, 1); - error = copyout(vtab, ifr->ifr_data, sizeof(*vtab) + + error = copyout(vtab, ifr_data_get_ptr(ifr), sizeof(*vtab) + vtab->count * sizeof(vtab->vccs[0])); free(vtab, M_DEVBUF); break; Modified: stable/11/sys/dev/hatm/if_hatm_ioctl.c ============================================================================== --- stable/11/sys/dev/hatm/if_hatm_ioctl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/hatm/if_hatm_ioctl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -334,7 +334,7 @@ hatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data /* return vcc table */ vtab = atm_getvccs((struct atmio_vcc **)sc->vccs, HE_MAX_VCCS, sc->open_vccs, &sc->mtx, 1); - error = copyout(vtab, ifr->ifr_data, sizeof(*vtab) + + error = copyout(vtab, ifr_data_get_ptr(ifr), sizeof(*vtab) + vtab->count * sizeof(vtab->vccs[0])); free(vtab, M_DEVBUF); break; Modified: stable/11/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/11/sys/dev/if_ndis/if_ndis.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/if_ndis/if_ndis.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2973,11 +2973,12 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v switch (cmd) { case SIOCGDRVSPEC: case SIOCSDRVSPEC: - error = copyin(ifr->ifr_data, &oid, sizeof(oid)); + error = copyin(ifr_data_get_ptr(ifr), &oid, sizeof(oid)); if (error) break; oidbuf = malloc(oid.len, M_TEMP, M_WAITOK | M_ZERO); - error = copyin(ifr->ifr_data + sizeof(oid), oidbuf, oid.len); + error = copyin((caddr_t)ifr_data_get_ptr(ifr) + sizeof(oid), + oidbuf, oid.len); } if (error) { @@ -2999,7 +3000,7 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v NDIS_UNLOCK(sc); break; } - error = copyin(ifr->ifr_data, &evt, sizeof(evt)); + error = copyin(ifr_data_get_ptr(ifr), &evt, sizeof(evt)); if (error) { NDIS_UNLOCK(sc); break; @@ -3010,14 +3011,15 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v break; } error = copyout(&sc->ndis_evt[sc->ndis_evtcidx], - ifr->ifr_data, sizeof(uint32_t) * 2); + ifr_data_get_ptr(ifr), sizeof(uint32_t) * 2); if (error) { NDIS_UNLOCK(sc); break; } if (sc->ndis_evt[sc->ndis_evtcidx].ne_len) { error = copyout(sc->ndis_evt[sc->ndis_evtcidx].ne_buf, - ifr->ifr_data + (sizeof(uint32_t) * 2), + (caddr_t)ifr_data_get_ptr(ifr) + + (sizeof(uint32_t) * 2), sc->ndis_evt[sc->ndis_evtcidx].ne_len); if (error) { NDIS_UNLOCK(sc); @@ -3039,10 +3041,11 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v switch (cmd) { case SIOCGDRVSPEC: case SIOCSDRVSPEC: - error = copyout(&oid, ifr->ifr_data, sizeof(oid)); + error = copyout(&oid, ifr_data_get_ptr(ifr), sizeof(oid)); if (error) break; - error = copyout(oidbuf, ifr->ifr_data + sizeof(oid), oid.len); + error = copyout(oidbuf, + (caddr_t)ifr_data_get_ptr(ifr) + sizeof(oid), oid.len); } free(oidbuf, M_TEMP); Modified: stable/11/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/11/sys/dev/iwi/if_iwi.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/iwi/if_iwi.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2057,7 +2057,7 @@ iwi_ioctl(struct ieee80211com *ic, u_long cmd, void *d switch (cmd) { case SIOCGIWISTATS: /* XXX validate permissions/memory/etc? */ - error = copyout(&sc->sc_linkqual, ifr->ifr_data, + error = copyout(&sc->sc_linkqual, ifr_data_get_ptr(ifr), sizeof(struct iwi_notif_link_quality)); break; case SIOCZIWISTATS: Modified: stable/11/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_ix.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/ixgbe/if_ix.c Sun Apr 8 16:54:07 2018 (r332288) @@ -4826,7 +4826,7 @@ ixgbe_ioctl(struct ifnet *ifp, u_long command, caddr_t int i; IOCTL_DEBUGOUT("ioctl: SIOCGI2C (Get I2C Data)"); - error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (error != 0) break; if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) { @@ -4841,7 +4841,7 @@ ixgbe_ioctl(struct ifnet *ifp, u_long command, caddr_t for (i = 0; i < i2c.len; i++) hw->phy.ops.read_i2c_byte(hw, i2c.offset + i, i2c.dev_addr, &i2c.data[i]); - error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; } #endif Modified: stable/11/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- stable/11/sys/dev/ixl/ixl_pf_main.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/ixl/ixl_pf_main.c Sun Apr 8 16:54:07 2018 (r332288) @@ -5173,7 +5173,7 @@ ixl_ioctl(struct ifnet * ifp, u_long command, caddr_t if (!pf->has_i2c) return (ENOTTY); - error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (error != 0) break; if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) { @@ -5190,7 +5190,7 @@ ixl_ioctl(struct ifnet * ifp, u_long command, caddr_t i2c.dev_addr, &i2c.data[i])) return (EIO); - error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; } #endif Modified: stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2058,7 +2058,7 @@ out: case SIOCGI2C: { struct ifi2creq i2c; - error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (error) break; if (i2c.len > sizeof(i2c.data)) { @@ -2075,7 +2075,7 @@ out: error = -error; break; } - error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; } #endif Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2769,7 +2769,7 @@ out: * Copy from the user-space address ifr_data to the * kernel-space address i2c */ - error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (error) break; @@ -2833,7 +2833,7 @@ out: goto err_i2c; } - error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); err_i2c: PRIV_UNLOCK(priv); break; Modified: stable/11/sys/dev/mwl/if_mwl.c ============================================================================== --- stable/11/sys/dev/mwl/if_mwl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/mwl/if_mwl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -4744,8 +4744,8 @@ mwl_ioctl(struct ieee80211com *ic, u_long cmd, void *d * statistics. The alternative is to copy the data * to a local structure. */ - return (copyout(&sc->sc_stats, - ifr->ifr_data, sizeof (sc->sc_stats))); + return (copyout(&sc->sc_stats, ifr_data_get_ptr(ifr), + sizeof (sc->sc_stats))); #ifdef MWL_DIAGAPI case SIOCGMVDIAG: /* XXX check privs */ Modified: stable/11/sys/dev/nxge/if_nxge.c ============================================================================== --- stable/11/sys/dev/nxge/if_nxge.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/nxge/if_nxge.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1366,7 +1366,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre void *info = NULL; int retValue; - cmd = retValue = fubyte(ifreqp->ifr_data); + cmd = retValue = fubyte(ifr_data_get_ptr(ifreqp)); if (retValue == -1) return (EFAULT); @@ -1378,7 +1378,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre (xge_hal_stats_hw_info_t **)&info); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(info, ifreqp->ifr_data, + if(copyout(info, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_stats_hw_info_t)) == 0) retValue = 0; } @@ -1396,7 +1396,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre sizeof(xge_hal_pci_config_t)); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(info, ifreqp->ifr_data, + if(copyout(info, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_pci_config_t)) == 0) retValue = 0; } @@ -1416,7 +1416,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre sizeof(xge_hal_stats_device_info_t)); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(info, ifreqp->ifr_data, + if(copyout(info, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_stats_device_info_t)) == 0) retValue = 0; } @@ -1437,7 +1437,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre sizeof(xge_hal_stats_sw_err_t)); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(info, ifreqp->ifr_data, + if(copyout(info, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_stats_sw_err_t)) == 0) retValue = 0; } @@ -1450,7 +1450,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre break; case XGE_QUERY_DRIVERSTATS: - if(copyout(&lldev->driver_stats, ifreqp->ifr_data, + if(copyout(&lldev->driver_stats, ifr_data_get_ptr(ifreqp), sizeof(xge_driver_stats_t)) == 0) { retValue = 0; } @@ -1464,7 +1464,8 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre info = xge_os_malloc(NULL, XGE_BUFFER_SIZE); if(info != NULL) { strcpy(info, XGE_DRIVER_VERSION); - if(copyout(info, ifreqp->ifr_data, XGE_BUFFER_SIZE) == 0) + if(copyout(info, ifr_data_get_ptr(ifreqp), + XGE_BUFFER_SIZE) == 0) retValue = 0; xge_os_free(NULL, info, XGE_BUFFER_SIZE); } @@ -1478,7 +1479,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre sizeof(xge_hal_device_config_t)); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(info, ifreqp->ifr_data, + if(copyout(info, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_device_config_t)) == 0) retValue = 0; } @@ -1491,7 +1492,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre break; case XGE_QUERY_BUFFER_MODE: - if(copyout(&lldev->buffer_mode, ifreqp->ifr_data, + if(copyout(&lldev->buffer_mode, ifr_data_get_ptr(ifreqp), sizeof(int)) == 0) retValue = 0; break; @@ -1500,7 +1501,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre case XGE_SET_BUFFER_MODE_2: case XGE_SET_BUFFER_MODE_5: mode = (cmd == XGE_SET_BUFFER_MODE_1) ? 'Y':'N'; - if(copyout(&mode, ifreqp->ifr_data, sizeof(mode)) == 0) + if(copyout(&mode, ifr_data_get_ptr(ifreqp), sizeof(mode)) == 0) retValue = 0; break; default: @@ -1528,7 +1529,7 @@ xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq * int error; u64 val64 = 0; - error = copyin(ifreqp->ifr_data, &tmpdata, sizeof(tmpdata)); + error = copyin(ifr_data_get_ptr(ifreqp), &tmpdata, sizeof(tmpdata)); if (error != 0) return (error); data = &tmpdata; @@ -1541,7 +1542,8 @@ xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq * &data->value); mtx_unlock(&lldev->mtx_drv); if(status == XGE_HAL_OK) { - if(copyout(data, ifreqp->ifr_data, sizeof(xge_register_t)) == 0) + if(copyout(data, ifr_data_get_ptr(ifreqp), + sizeof(xge_register_t)) == 0) retValue = 0; } } @@ -1586,7 +1588,7 @@ xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq * mtx_unlock(&lldev->mtx_drv); if(retValue == 0) { - if(copyout(data, ifreqp->ifr_data, + if(copyout(data, ifr_data_get_ptr(ifreqp), sizeof(xge_hal_pci_bar0_t)) != 0) { xge_trace(XGE_ERR, "Copyout of register values failed"); retValue = EINVAL; Modified: stable/11/sys/dev/oce/oce_if.c ============================================================================== --- stable/11/sys/dev/oce/oce_if.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/oce/oce_if.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1832,7 +1832,7 @@ oce_handle_passthrough(struct ifnet *ifp, caddr_t data struct ifreq *ifr = (struct ifreq *)data; int rc = ENXIO; char cookie[32] = {0}; - void *priv_data = (void *)ifr->ifr_data; + void *priv_data = ifr_data_get_ptr(ifr); void *ioctl_ptr; uint32_t req_size; struct mbx_hdr req; Modified: stable/11/sys/dev/patm/if_patm_ioctl.c ============================================================================== --- stable/11/sys/dev/patm/if_patm_ioctl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/patm/if_patm_ioctl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -387,7 +387,7 @@ patm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data /* return vcc table */ vtab = atm_getvccs((struct atmio_vcc **)sc->vccs, sc->mmap->max_conn, sc->vccs_open, &sc->mtx, 1); - error = copyout(vtab, ifr->ifr_data, sizeof(*vtab) + + error = copyout(vtab, ifr_data_get_ptr(ifr), sizeof(*vtab) + vtab->count * sizeof(vtab->vccs[0])); free(vtab, M_DEVBUF); break; Modified: stable/11/sys/dev/qlnx/qlnxe/qlnx_os.c ============================================================================== --- stable/11/sys/dev/qlnx/qlnxe/qlnx_os.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/qlnx/qlnxe/qlnx_os.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2464,7 +2464,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data struct ecore_hwfn *p_hwfn = &ha->cdev.hwfns[0]; struct ecore_ptt *p_ptt; - ret = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + ret = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (ret) break; @@ -2494,7 +2494,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; } - ret = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + ret = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); QL_DPRINT8(ha, "SIOCGI2C copyout ret = %d \ len = %d addr = 0x%02x offset = 0x%04x \ Modified: stable/11/sys/dev/sbni/if_sbni.c ============================================================================== --- stable/11/sys/dev/sbni/if_sbni.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/sbni/if_sbni.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1153,7 +1153,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t SBNI_LOCK(sc); bcopy(&sc->in_stats, in_stats, sizeof(struct sbni_in_stats)); SBNI_UNLOCK(sc); - error = copyout(ifr->ifr_data, in_stats, + error = copyout(ifr_data_get_ptr(ifr), in_stats, sizeof(struct sbni_in_stats)); free(in_stats, M_DEVBUF); break; Modified: stable/11/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/sfxge/sfxge.c Sun Apr 8 16:54:07 2018 (r332288) @@ -527,7 +527,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long comman { struct ifi2creq i2c; - error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (error != 0) break; @@ -542,7 +542,8 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long comman &i2c.data[0]); SFXGE_ADAPTER_UNLOCK(sc); if (error == 0) - error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + error = copyout(&i2c, ifr_data_get_ptr(ifr), + sizeof(i2c)); break; } #endif @@ -550,12 +551,13 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long comman error = priv_check(curthread, PRIV_DRIVER); if (error != 0) break; - error = copyin(ifr->ifr_data, &ioc, sizeof(ioc)); + error = copyin(ifr_data_get_ptr(ifr), &ioc, sizeof(ioc)); if (error != 0) return (error); error = sfxge_private_ioctl(sc, &ioc); if (error == 0) { - error = copyout(&ioc, ifr->ifr_data, sizeof(ioc)); + error = copyout(&ioc, ifr_data_get_ptr(ifr), + sizeof(ioc)); } break; default: Modified: stable/11/sys/dev/vxge/vxge.c ============================================================================== --- stable/11/sys/dev/vxge/vxge.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/vxge/vxge.c Sun Apr 8 16:54:07 2018 (r332288) @@ -3708,8 +3708,8 @@ vxge_ioctl_regs(vxge_dev_t *vdev, struct ifreq *ifr) u32 offset, reqd_size = 0; int i, err = EINVAL; - char *command = (char *) ifr->ifr_data; - void *reg_info = (void *) ifr->ifr_data; + char *command = ifr_data_get_ptr(ifr); + void *reg_info = ifr_data_get_ptr(ifr); vxge_vpath_t *vpath; vxge_hal_status_e status = VXGE_HAL_OK; @@ -3816,7 +3816,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) vxge_drv_stats_t *drv_stat; char *buffer = NULL; - char *command = (char *) ifr->ifr_data; + char *command = ifr_data_get_ptr(ifr); vxge_hal_status_e status = VXGE_HAL_OK; switch (*command) { @@ -3827,7 +3827,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) status = vxge_hal_aux_pci_config_read(vdev->devh, bufsize, buffer, &retsize); if (status == VXGE_HAL_OK) - err = copyout(buffer, ifr->ifr_data, retsize); + err = copyout(buffer, ifr_data_get_ptr(ifr), + retsize); else device_printf(vdev->ndev, "failed pciconfig statistics query\n"); @@ -3846,7 +3847,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) status = vxge_hal_aux_stats_mrpcim_read(vdev->devh, bufsize, buffer, &retsize); if (status == VXGE_HAL_OK) - err = copyout(buffer, ifr->ifr_data, retsize); + err = copyout(buffer, ifr_data_get_ptr(ifr), + retsize); else device_printf(vdev->ndev, "failed mrpcim statistics query\n"); @@ -3862,7 +3864,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) status = vxge_hal_aux_stats_device_read(vdev->devh, bufsize, buffer, &retsize); if (status == VXGE_HAL_OK) - err = copyout(buffer, ifr->ifr_data, retsize); + err = copyout(buffer, ifr_data_get_ptr(ifr), + retsize); else device_printf(vdev->ndev, "failed device statistics query\n"); @@ -3886,7 +3889,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) ((vxge_device_hw_info_t *) buffer)->port_failure = vdev->port_failure; - err = copyout(buffer, ifr->ifr_data, bufsize); + err = copyout(buffer, ifr_data_get_ptr(ifr), bufsize); if (err != 0) device_printf(vdev->ndev, "failed device hardware info query\n"); @@ -3913,7 +3916,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) sizeof(vxge_drv_stats_t)); } - err = copyout(drv_stat, ifr->ifr_data, bufsize); + err = copyout(drv_stat, ifr_data_get_ptr(ifr), bufsize); if (err != 0) device_printf(vdev->ndev, "failed driver statistics query\n"); @@ -3923,7 +3926,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) break; case VXGE_GET_BANDWIDTH: - bw_info = (vxge_bw_info_t *) ifr->ifr_data; + bw_info = ifr_data_get_ptr(ifr); if ((vdev->config.hw_info.func_id != 0) && (vdev->hw_fw_version < VXGE_FW_VERSION(1, 8, 0))) @@ -3936,7 +3939,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) if (status != VXGE_HAL_OK) break; - err = copyout(bw_info, ifr->ifr_data, sizeof(vxge_bw_info_t)); + err = copyout(bw_info, ifr_data_get_ptr(ifr), + sizeof(vxge_bw_info_t)); break; case VXGE_SET_BANDWIDTH: @@ -3947,7 +3951,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) case VXGE_SET_PORT_MODE: if (vdev->is_privilaged) { if (vdev->config.hw_info.ports == VXGE_DUAL_PORT_MODE) { - port_info = (vxge_port_info_t *) ifr->ifr_data; + port_info = ifr_data_get_ptr(ifr); vdev->config.port_mode = port_info->port_mode; err = vxge_port_mode_update(vdev); if (err != ENXIO) @@ -3964,10 +3968,11 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr) case VXGE_GET_PORT_MODE: if (vdev->is_privilaged) { if (vdev->config.hw_info.ports == VXGE_DUAL_PORT_MODE) { - port_info = (vxge_port_info_t *) ifr->ifr_data; + port_info = ifr_data_get_ptr(ifr); err = vxge_port_mode_get(vdev, port_info); if (err == VXGE_HAL_OK) { - err = copyout(port_info, ifr->ifr_data, + err = copyout(port_info, + ifr_data_get_ptr(ifr), sizeof(vxge_port_info_t)); } } @@ -4003,7 +4008,7 @@ vxge_bw_priority_set(vxge_dev_t *vdev, struct ifreq *i u32 func_id; vxge_bw_info_t *bw_info; - bw_info = (vxge_bw_info_t *) ifr->ifr_data; + bw_info = ifr_data_get_ptr(ifr); func_id = bw_info->func_id; vdev->config.bw_info[func_id].priority = bw_info->priority; Modified: stable/11/sys/dev/wl/if_wl.c ============================================================================== --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } WL_UNLOCK(sc); - error = copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); + error = copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); break; @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if ((error = priv_check(td, PRIV_DRIVER))) break; - error = copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); + error = copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); if (error) break; @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* get the current NWID out of the sc since we stored it there */ case SIOCGWLCNWID: WL_LOCK(sc); - ifr->ifr_data = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); + ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); WL_UNLOCK(sc); break; @@ -1382,8 +1382,8 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* * soft c nwid shadows radio modem setting */ - sc->nwid[0] = (int)ifr->ifr_data >> 8; - sc->nwid[1] = (int)ifr->ifr_data & 0xff; + sc->nwid[0] = (int)ifr_data_get_ptr(ifr) >> 8; + sc->nwid[1] = (int)ifr_data_get_ptr(ifr) & 0xff; MMC_WRITE(MMC_NETW_ID_L,sc->nwid[1]); MMC_WRITE(MMC_NETW_ID_H,sc->nwid[0]); } @@ -1409,7 +1409,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) wlmmcread(sc, MMC_EEDATALrv); /* 2.4 Gz: EEPROM word */ } WL_UNLOCK(sc); - error = copyout(ifr->ifr_data, eeprom_buf, sizeof(eeprom_buf)); + error = copyout(ifr_data_get_ptr(ifr), eeprom_buf, sizeof(eeprom_buf)); break; #ifdef WLCACHE @@ -1426,7 +1426,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* read out the number of used cache elements */ case SIOCGWLCITEM: WL_LOCK(sc); - ifr->ifr_data = (caddr_t) sc->w_sigitems; + ifr_data_get_ptr(ifr) = (caddr_t) sc->w_sigitems; WL_UNLOCK(sc); break; @@ -1443,7 +1443,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) bcopy(sc->w_sigcache, cpt, size); WL_UNLOCK(sc); - error = copyout(cpt, ifr->ifr_data, size); + error = copyout(cpt, ifr_data_get_ptr(ifr), size); free(cpt, M_DEVBUF); break; #endif Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if.c Sun Apr 8 16:54:07 2018 (r332288) @@ -2400,6 +2400,20 @@ ifr_buffer_set_length(void *data, size_t len) ifrup->ifr.ifr_ifru.ifru_buffer.length = len; } +void * +ifr_data_get_ptr(void *ifrp) +{ + union ifreq_union *ifrup; + + ifrup = ifrp; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return ((void *)(uintptr_t) + ifrup->ifr32.ifr_ifru.ifru_data); +#endif + return (ifrup->ifr.ifr_ifru.ifru_data); +} + /* * Hardware specific interface ioctls. */ @@ -2581,7 +2595,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, error = priv_check(td, PRIV_NET_SETIFNAME); if (error) return (error); - error = copyinstr(ifr->ifr_data, new_name, IFNAMSIZ, NULL); + error = copyinstr(ifr_data_get_ptr(ifr), new_name, IFNAMSIZ, + NULL); if (error != 0) return (error); if (new_name[0] == '\0') @@ -2896,8 +2911,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s error = priv_check(td, PRIV_NET_IFCREATE); if (error == 0) error = if_clone_create(ifr->ifr_name, - sizeof(ifr->ifr_name), - cmd == SIOCIFCREATE2 ? ifr->ifr_data : NULL); + sizeof(ifr->ifr_name), cmd == SIOCIFCREATE2 ? + ifr_data_get_ptr(ifr) : NULL); CURVNET_RESTORE(); return (error); case SIOCIFDESTROY: Modified: stable/11/sys/net/if.h ============================================================================== --- stable/11/sys/net/if.h Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if.h Sun Apr 8 16:54:07 2018 (r332288) @@ -408,7 +408,9 @@ struct ifreq { #define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ #define ifr_phys ifr_ifru.ifru_phys /* physical wire */ #define ifr_media ifr_ifru.ifru_media /* physical media */ +#ifndef _KERNEL #define ifr_data ifr_ifru.ifru_data /* for use by interface */ +#endif #define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */ #define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */ #define ifr_index ifr_ifru.ifru_index /* interface index */ Modified: stable/11/sys/net/if_gif.c ============================================================================== --- stable/11/sys/net/if_gif.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_gif.c Sun Apr 8 16:54:07 2018 (r332288) @@ -906,12 +906,14 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case GIFGOPTS: options = sc->gif_options; - error = copyout(&options, ifr->ifr_data, sizeof(options)); + error = copyout(&options, ifr_data_get_ptr(ifr), + sizeof(options)); break; case GIFSOPTS: if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0) break; - error = copyin(ifr->ifr_data, &options, sizeof(options)); + error = copyin(ifr_data_get_ptr(ifr), &options, + sizeof(options)); if (error) break; if (options & ~GIF_OPTMASK) Modified: stable/11/sys/net/if_gre.c ============================================================================== --- stable/11/sys/net/if_gre.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_gre.c Sun Apr 8 16:54:07 2018 (r332288) @@ -453,7 +453,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case GRESKEY: if ((error = priv_check(curthread, PRIV_NET_GRE)) != 0) break; - if ((error = copyin(ifr->ifr_data, &opt, sizeof(opt))) != 0) + if ((error = copyin(ifr_data_get_ptr(ifr), &opt, + sizeof(opt))) != 0) break; if (sc->gre_key != opt) { GRE_WLOCK(sc); @@ -463,13 +464,14 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } break; case GREGKEY: - error = copyout(&sc->gre_key, ifr->ifr_data, + error = copyout(&sc->gre_key, ifr_data_get_ptr(ifr), sizeof(sc->gre_key)); break; case GRESOPTS: if ((error = priv_check(curthread, PRIV_NET_GRE)) != 0) break; - if ((error = copyin(ifr->ifr_data, &opt, sizeof(opt))) != 0) + if ((error = copyin(ifr_data_get_ptr(ifr), &opt, + sizeof(opt))) != 0) break; if (opt & ~GRE_OPTMASK) error = EINVAL; @@ -484,7 +486,7 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case GREGOPTS: - error = copyout(&sc->gre_options, ifr->ifr_data, + error = copyout(&sc->gre_options, ifr_data_get_ptr(ifr), sizeof(sc->gre_options)); break; default: Modified: stable/11/sys/net/if_ipsec.c ============================================================================== --- stable/11/sys/net/if_ipsec.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_ipsec.c Sun Apr 8 16:54:07 2018 (r332288) @@ -688,12 +688,12 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat break; case IPSECGREQID: reqid = sc->reqid; - error = copyout(&reqid, ifr->ifr_data, sizeof(reqid)); + error = copyout(&reqid, ifr_data_get_ptr(ifr), sizeof(reqid)); break; case IPSECSREQID: if ((error = priv_check(curthread, PRIV_NET_SETIFCAP)) != 0) break; - error = copyin(ifr->ifr_data, &reqid, sizeof(reqid)); + error = copyin(ifr_data_get_ptr(ifr), &reqid, sizeof(reqid)); if (error != 0) break; error = ipsec_set_reqid(ifp, reqid); Modified: stable/11/sys/net/if_spppsubr.c ============================================================================== --- stable/11/sys/net/if_spppsubr.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_spppsubr.c Sun Apr 8 16:54:07 2018 (r332288) @@ -5058,17 +5058,17 @@ sppp_params(struct sppp *sp, u_long cmd, void *data) if ((spr = malloc(sizeof(struct spppreq), M_TEMP, M_NOWAIT)) == NULL) return (EAGAIN); /* - * ifr->ifr_data is supposed to point to a struct spppreq. + * ifr_data_get_ptr(ifr) is supposed to point to a struct spppreq. * Check the cmd word first before attempting to fetch all the * data. */ - rv = fueword(ifr->ifr_data, &subcmd); + rv = fueword(ifr_data_get_ptr(ifr), &subcmd); if (rv == -1) { rv = EFAULT; goto quit; } - if (copyin((caddr_t)ifr->ifr_data, spr, sizeof(struct spppreq)) != 0) { + if (copyin(ifr_data_get_ptr(ifr), spr, sizeof(struct spppreq)) != 0) { rv = EFAULT; goto quit; } @@ -5105,8 +5105,8 @@ sppp_params(struct sppp *sp, u_long cmd, void *data) * setting it. */ spr->defs.lcp.timeout = sp->lcp.timeout * 1000 / hz; - rv = copyout(spr, (caddr_t)ifr->ifr_data, - sizeof(struct spppreq)); + rv = copyout(spr, ifr_data_get_ptr(ifr), + sizeof(struct spppreq)); break; case (u_long)SPPPIOSDEFS: Modified: stable/11/sys/net/if_var.h ============================================================================== --- stable/11/sys/net/if_var.h Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_var.h Sun Apr 8 16:54:07 2018 (r332288) @@ -658,6 +658,9 @@ int drbr_enqueue_drv(if_t ifp, struct buf_ring *br, st void if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *); int if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *); +/* accessors for struct ifreq */ +void *ifr_data_get_ptr(void *ifrp); + #ifdef DEVICE_POLLING enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS }; Modified: stable/11/sys/net/if_vlan.c ============================================================================== --- stable/11/sys/net/if_vlan.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/if_vlan.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1909,7 +1909,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; } #endif - error = copyin(ifr->ifr_data, &vlr, sizeof(vlr)); + error = copyin(ifr_data_get_ptr(ifr), &vlr, sizeof(vlr)); if (error) break; if (vlr.vlr_parent[0] == '\0') { @@ -1940,7 +1940,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data vlr.vlr_tag = ifv->ifv_vid; } VLAN_SUNLOCK(); - error = copyout(&vlr, ifr->ifr_data, sizeof(vlr)); + error = copyout(&vlr, ifr_data_get_ptr(ifr), sizeof(vlr)); break; case SIOCSIFFLAGS: Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net/iflib.c Sun Apr 8 16:54:07 2018 (r332288) @@ -3260,7 +3260,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) { struct ifi2creq i2c; - err = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + err = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c)); if (err != 0) break; if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) { @@ -3273,7 +3273,8 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) } if ((err = IFDI_I2C_REQ(ctx, &i2c)) == 0) - err = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + err = copyout(&i2c, ifr_data_get_ptr(ifr), + sizeof(i2c)); break; } case SIOCSIFCAP: Modified: stable/11/sys/net80211/ieee80211_ioctl.c ============================================================================== --- stable/11/sys/net80211/ieee80211_ioctl.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/net80211/ieee80211_ioctl.c Sun Apr 8 16:54:07 2018 (r332288) @@ -3424,7 +3424,8 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t break; case SIOCG80211STATS: ifr = (struct ifreq *)data; - copyout(&vap->iv_stats, ifr->ifr_data, sizeof (vap->iv_stats)); + copyout(&vap->iv_stats, ifr_data_get_ptr(ifr), + sizeof (vap->iv_stats)); break; case SIOCSIFMTU: ifr = (struct ifreq *)data; Modified: stable/11/sys/netinet/ip_carp.c ============================================================================== --- stable/11/sys/netinet/ip_carp.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/netinet/ip_carp.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1624,7 +1624,7 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa struct carp_softc *sc = NULL; int error = 0, locked = 0; - if ((error = copyin(ifr->ifr_data, &carpr, sizeof carpr))) + if ((error = copyin(ifr_data_get_ptr(ifr), &carpr, sizeof carpr))) return (error); ifp = ifunit_ref(ifr->ifr_name); @@ -1741,7 +1741,8 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa break; } carp_carprcp(&carpr, sc, priveleged); - error = copyout(&carpr, ifr->ifr_data, sizeof(carpr)); + error = copyout(&carpr, ifr_data_get_ptr(ifr), + sizeof(carpr)); } else { int i, count; @@ -1759,7 +1760,8 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa IFNET_FOREACH_CARP(ifp, sc) { carp_carprcp(&carpr, sc, priveleged); carpr.carpr_count = count; - error = copyout(&carpr, ifr->ifr_data + + error = copyout(&carpr, + (caddr_t)ifr_data_get_ptr(ifr) + (i * sizeof(carpr)), sizeof(carpr)); if (error) { CIF_UNLOCK(ifp->if_carp); Modified: stable/11/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/11/sys/netpfil/pf/if_pfsync.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/netpfil/pf/if_pfsync.c Sun Apr 8 16:54:07 2018 (r332288) @@ -1317,7 +1317,8 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat pfsyncr.pfsyncr_defer = (PFSYNCF_DEFER == (sc->sc_flags & PFSYNCF_DEFER)); PFSYNC_UNLOCK(sc); - return (copyout(&pfsyncr, ifr->ifr_data, sizeof(pfsyncr))); + return (copyout(&pfsyncr, ifr_data_get_ptr(ifr), + sizeof(pfsyncr))); case SIOCSETPFSYNC: { @@ -1328,7 +1329,8 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat if ((error = priv_check(curthread, PRIV_NETINET_PF)) != 0) return (error); - if ((error = copyin(ifr->ifr_data, &pfsyncr, sizeof(pfsyncr)))) + if ((error = copyin(ifr_data_get_ptr(ifr), &pfsyncr, + sizeof(pfsyncr)))) return (error); if (pfsyncr.pfsyncr_maxupdates > 255) Modified: stable/11/sys/security/mac/mac_net.c ============================================================================== --- stable/11/sys/security/mac/mac_net.c Sun Apr 8 16:46:24 2018 (r332287) +++ stable/11/sys/security/mac/mac_net.c Sun Apr 8 16:54:07 2018 (r332288) @@ -406,7 +406,7 @@ mac_ifnet_ioctl_get(struct ucred *cred, struct ifreq * if (!(mac_labeled & MPC_OBJECT_IFNET)) return (EINVAL); - error = copyin(ifr->ifr_ifru.ifru_data, &mac, sizeof(mac)); + error = copyin(ifr_data_get_ptr(ifr), &mac, sizeof(mac)); if (error) return (error); @@ -449,7 +449,7 @@ mac_ifnet_ioctl_set(struct ucred *cred, struct ifreq * if (!(mac_labeled & MPC_OBJECT_IFNET)) return (EINVAL); - error = copyin(ifr->ifr_ifru.ifru_data, &mac, sizeof(mac)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 8 16:55:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE4D9F9028B; Sun, 8 Apr 2018 16:55:28 +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 8FD8D79E94; Sun, 8 Apr 2018 16:55:28 +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 89DAE129F1; Sun, 8 Apr 2018 16:55:28 +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 w38GtS4A007923; Sun, 8 Apr 2018 16:55:28 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GtSr1007922; Sun, 8 Apr 2018 16:55:28 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804081655.w38GtSr1007922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 8 Apr 2018 16:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332289 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 332289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:55:29 -0000 Author: jhibbits Date: Sun Apr 8 16:55:28 2018 New Revision: 332289 URL: https://svnweb.freebsd.org/changeset/base/332289 Log: powerpc64: Print current MSR on printtrap() Summary: Print current MSR on printtrap(). Currently, printtrap just prints srr1, which contains part of the MSR prior to the exception. I find useful to dump the current value of the MSR, since it changes when there is an interruption. With this patch, this is the new printtrap model: handled user trap: exception = 0x700 (program) srr0 = 0x100008a0 (0x100008a0) srr1 = 0x800000000002f032 current msr = 0x8000000000009032 lr = 0x1000089c (0x1000089c) curthread = 0x7a50000 pid = 714, comm = ttrap2 Submitted by: Breno Leitao Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D14600 Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sun Apr 8 16:54:07 2018 (r332288) +++ head/sys/powerpc/powerpc/trap.c Sun Apr 8 16:55:28 2018 (r332289) @@ -507,6 +507,7 @@ printtrap(u_int vector, struct trapframe *frame, int i printf(" srr0 = 0x%" PRIxPTR " (0x%" PRIxPTR ")\n", frame->srr0, frame->srr0 - (register_t)(__startkernel - KERNBASE)); printf(" srr1 = 0x%lx\n", (u_long)frame->srr1); + printf(" current msr = 0x%" PRIxPTR "\n", mfmsr()); printf(" lr = 0x%" PRIxPTR " (0x%" PRIxPTR ")\n", frame->lr, frame->lr - (register_t)(__startkernel - KERNBASE)); printf(" curthread = %p\n", curthread); From owner-svn-src-all@freebsd.org Sun Apr 8 16:59:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EB10F90995; Sun, 8 Apr 2018 16:59:40 +0000 (UTC) (envelope-from brooks@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 C4B287C3FB; Sun, 8 Apr 2018 16:59:39 +0000 (UTC) (envelope-from brooks@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 BF9D6129FE; Sun, 8 Apr 2018 16:59:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38GxdrL008126; Sun, 8 Apr 2018 16:59:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38GxdFE008124; Sun, 8 Apr 2018 16:59:39 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081659.w38GxdFE008124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 16:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332290 - stable/11/sys/dev/de X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/dev/de X-SVN-Commit-Revision: 332290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 16:59:40 -0000 Author: brooks Date: Sun Apr 8 16:59:39 2018 New Revision: 332290 URL: https://svnweb.freebsd.org/changeset/base/332290 Log: GC never enabled support for SIOCGADDRROM and SIOCGCHIPID. When de(4) was imported in 1997 the world was not ready for these ioctls. In over 20 years that hasn't changed so it seems safe to assume their time will never come. Reviewed by: imp, jhb Approved by: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14889 Modified: stable/11/sys/dev/de/if_de.c stable/11/sys/dev/de/if_devar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/de/if_de.c ============================================================================== --- stable/11/sys/dev/de/if_de.c Sun Apr 8 16:55:28 2018 (r332289) +++ stable/11/sys/dev/de/if_de.c Sun Apr 8 16:59:39 2018 (r332290) @@ -4264,18 +4264,6 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t break; } -#ifdef SIOCGADDRROM - case SIOCGADDRROM: { - error = copyout(sc->tulip_rombuf, ifr_data_get_ptr(ifr), sizeof(sc->tulip_rombuf)); - break; - } -#endif -#ifdef SIOCGCHIPID - case SIOCGCHIPID: { - ifr->ifr_metric = (int) sc->tulip_chipid; - break; - } -#endif default: { error = ether_ioctl(ifp, cmd, data); break; Modified: stable/11/sys/dev/de/if_devar.h ============================================================================== --- stable/11/sys/dev/de/if_devar.h Sun Apr 8 16:55:28 2018 (r332289) +++ stable/11/sys/dev/de/if_devar.h Sun Apr 8 16:59:39 2018 (r332290) @@ -874,11 +874,6 @@ static const struct { #define TULIP_TXMAP_POSTSYNC(ri, di) \ _TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_POSTWRITE) -#ifdef notyet -#define SIOCGADDRROM _IOW('i', 240, struct ifreq) /* get 128 bytes of ROM */ -#define SIOCGCHIPID _IOWR('i', 241, struct ifreq) /* get chipid */ -#endif - #if defined(TULIP_HDR_DATA) static tulip_softc_t *tulips[TULIP_MAX_DEVICES]; #endif From owner-svn-src-all@freebsd.org Sun Apr 8 17:03:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5D65F91156; Sun, 8 Apr 2018 17:03:39 +0000 (UTC) (envelope-from brooks@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 97D8F7E769; Sun, 8 Apr 2018 17:03:39 +0000 (UTC) (envelope-from brooks@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 92AB812BA5; Sun, 8 Apr 2018 17:03:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38H3duS014075; Sun, 8 Apr 2018 17:03:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38H3dgR014073; Sun, 8 Apr 2018 17:03:39 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081703.w38H3dgR014073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 17:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332291 - stable/10/sys/dev/de X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/sys/dev/de X-SVN-Commit-Revision: 332291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:03:40 -0000 Author: brooks Date: Sun Apr 8 17:03:39 2018 New Revision: 332291 URL: https://svnweb.freebsd.org/changeset/base/332291 Log: MFC r331737: GC never enabled support for SIOCGADDRROM and SIOCGCHIPID. When de(4) was imported in 1997 the world was not ready for these ioctls. In over 20 years that hasn't changed so it seems safe to assume their time will never come. Reviewed by: imp, jhb Approved by: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14889 Modified: stable/10/sys/dev/de/if_de.c stable/10/sys/dev/de/if_devar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/de/if_de.c ============================================================================== --- stable/10/sys/dev/de/if_de.c Sun Apr 8 16:59:39 2018 (r332290) +++ stable/10/sys/dev/de/if_de.c Sun Apr 8 17:03:39 2018 (r332291) @@ -4263,18 +4263,6 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t break; } -#ifdef SIOCGADDRROM - case SIOCGADDRROM: { - error = copyout(sc->tulip_rombuf, ifr->ifr_data, sizeof(sc->tulip_rombuf)); - break; - } -#endif -#ifdef SIOCGCHIPID - case SIOCGCHIPID: { - ifr->ifr_metric = (int) sc->tulip_chipid; - break; - } -#endif default: { error = ether_ioctl(ifp, cmd, data); break; Modified: stable/10/sys/dev/de/if_devar.h ============================================================================== --- stable/10/sys/dev/de/if_devar.h Sun Apr 8 16:59:39 2018 (r332290) +++ stable/10/sys/dev/de/if_devar.h Sun Apr 8 17:03:39 2018 (r332291) @@ -874,11 +874,6 @@ static const struct { #define TULIP_TXMAP_POSTSYNC(ri, di) \ _TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_POSTWRITE) -#ifdef notyet -#define SIOCGADDRROM _IOW('i', 240, struct ifreq) /* get 128 bytes of ROM */ -#define SIOCGCHIPID _IOWR('i', 241, struct ifreq) /* get chipid */ -#endif - #if defined(TULIP_HDR_DATA) static tulip_softc_t *tulips[TULIP_MAX_DEVICES]; #endif From owner-svn-src-all@freebsd.org Sun Apr 8 17:06:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08978F9156D; Sun, 8 Apr 2018 17:06:31 +0000 (UTC) (envelope-from ian@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 A855880221; Sun, 8 Apr 2018 17:06:30 +0000 (UTC) (envelope-from ian@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 9D84012BA6; Sun, 8 Apr 2018 17:06:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38H6Uvi014224; Sun, 8 Apr 2018 17:06:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38H6UPH014223; Sun, 8 Apr 2018 17:06:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804081706.w38H6UPH014223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Apr 2018 17:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332292 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:06:31 -0000 Author: ian Date: Sun Apr 8 17:06:30 2018 New Revision: 332292 URL: https://svnweb.freebsd.org/changeset/base/332292 Log: Allow hinted attachment on FDT-based systems. Instead of returning ENXIO when the FDT data doesn't enable the device instance, return BUS_PROBE_NOWILDCARD, the same as for non-FDT systems. Modified: head/sys/dev/spibus/spigen.c Modified: head/sys/dev/spibus/spigen.c ============================================================================== --- head/sys/dev/spibus/spigen.c Sun Apr 8 17:03:39 2018 (r332291) +++ head/sys/dev/spibus/spigen.c Sun Apr 8 17:06:30 2018 (r332292) @@ -79,16 +79,19 @@ spigen_probe(device_t dev) { int rv; -#ifdef FDT - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "freebsd,spigen")) - return (ENXIO); - rv = BUS_PROBE_DEFAULT; -#else + /* + * By default we only bid to attach if specifically added by our parent + * (usually via hint.spigen.#.at=busname). On FDT systems we bid as the + * default driver based on being configured in the FDT data. + */ rv = BUS_PROBE_NOWILDCARD; + +#ifdef FDT + if (ofw_bus_status_okay(dev) && + ofw_bus_is_compatible(dev, "freebsd,spigen")) + rv = BUS_PROBE_DEFAULT; #endif + device_set_desc(dev, "SPI Generic IO"); return (rv); From owner-svn-src-all@freebsd.org Sun Apr 8 17:10:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E851F91A02; Sun, 8 Apr 2018 17:10:33 +0000 (UTC) (envelope-from brooks@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 D64F782590; Sun, 8 Apr 2018 17:10:32 +0000 (UTC) (envelope-from brooks@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 CCD6C12BAC; Sun, 8 Apr 2018 17:10:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38HAWr6014440; Sun, 8 Apr 2018 17:10:32 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38HAWMS014439; Sun, 8 Apr 2018 17:10:32 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081710.w38HAWMS014439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 17:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332293 - head/sys/amd64/linux32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/amd64/linux32 X-SVN-Commit-Revision: 332293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:10:33 -0000 Author: brooks Date: Sun Apr 8 17:10:32 2018 New Revision: 332293 URL: https://svnweb.freebsd.org/changeset/base/332293 Log: Fix LINT (and static COMPAT_LINUX32) after r332122. Modified: head/sys/amd64/linux32/linux32_machdep.c Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Sun Apr 8 17:06:30 2018 (r332292) +++ head/sys/amd64/linux32/linux32_machdep.c Sun Apr 8 17:10:32 2018 (r332293) @@ -33,6 +33,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include From owner-svn-src-all@freebsd.org Sun Apr 8 17:15:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D317FF9213B; Sun, 8 Apr 2018 17:15:20 +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 2B1988524E; Sun, 8 Apr 2018 17:15:19 +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 w38HFBEC014285; Sun, 8 Apr 2018 10:15:11 -0700 (PDT) (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 w38HFB4t014284; Sun, 8 Apr 2018 10:15:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804081715.w38HFB4t014284@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332290 - stable/11/sys/dev/de In-Reply-To: <201804081659.w38GxdFE008124@repo.freebsd.org> To: Brooks Davis Date: Sun, 8 Apr 2018 10:15:11 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:15:21 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: brooks > Date: Sun Apr 8 16:59:39 2018 > New Revision: 332290 > URL: https://svnweb.freebsd.org/changeset/base/332290 > > Log: MFC r331737: > GC never enabled support for SIOCGADDRROM and SIOCGCHIPID. > > When de(4) was imported in 1997 the world was not ready for these ioctls. > In over 20 years that hasn't changed so it seems safe to assume their > time will never come. > > Reviewed by: imp, jhb > Approved by: CheriBSD > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D14889 > > Modified: > stable/11/sys/dev/de/if_de.c > stable/11/sys/dev/de/if_devar.h > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sys/dev/de/if_de.c > ============================================================================== > --- stable/11/sys/dev/de/if_de.c Sun Apr 8 16:55:28 2018 (r332289) > +++ stable/11/sys/dev/de/if_de.c Sun Apr 8 16:59:39 2018 (r332290) > @@ -4264,18 +4264,6 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t > break; > } > > -#ifdef SIOCGADDRROM > - case SIOCGADDRROM: { > - error = copyout(sc->tulip_rombuf, ifr_data_get_ptr(ifr), sizeof(sc->tulip_rombuf)); > - break; > - } > -#endif > -#ifdef SIOCGCHIPID > - case SIOCGCHIPID: { > - ifr->ifr_metric = (int) sc->tulip_chipid; > - break; > - } > -#endif > default: { > error = ether_ioctl(ifp, cmd, data); > break; > > Modified: stable/11/sys/dev/de/if_devar.h > ============================================================================== > --- stable/11/sys/dev/de/if_devar.h Sun Apr 8 16:55:28 2018 (r332289) > +++ stable/11/sys/dev/de/if_devar.h Sun Apr 8 16:59:39 2018 (r332290) > @@ -874,11 +874,6 @@ static const struct { > #define TULIP_TXMAP_POSTSYNC(ri, di) \ > _TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_POSTWRITE) > > -#ifdef notyet > -#define SIOCGADDRROM _IOW('i', 240, struct ifreq) /* get 128 bytes of ROM */ > -#define SIOCGCHIPID _IOWR('i', 241, struct ifreq) /* get chipid */ > -#endif > - > #if defined(TULIP_HDR_DATA) > static tulip_softc_t *tulips[TULIP_MAX_DEVICES]; > #endif > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Apr 8 17:16:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0267F92270; Sun, 8 Apr 2018 17:16:11 +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 6574085BF7; Sun, 8 Apr 2018 17:16:11 +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 w38HG9GG014295; Sun, 8 Apr 2018 10:16:09 -0700 (PDT) (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 w38HG9ih014294; Sun, 8 Apr 2018 10:16:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804081716.w38HG9ih014294@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332293 - head/sys/amd64/linux32 In-Reply-To: <201804081710.w38HAWMS014439@repo.freebsd.org> To: Brooks Davis Date: Sun, 8 Apr 2018 10:16:09 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:16:12 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: brooks > Date: Sun Apr 8 17:10:32 2018 > New Revision: 332293 > URL: https://svnweb.freebsd.org/changeset/base/332293 > > Log: > Fix LINT (and static COMPAT_LINUX32) after r332122. FYI last time I tried LINT on 11/stable it had issues with kbd_mux stuff. This was about 2 weeks ago. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Apr 8 17:18:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3E26F925A4; Sun, 8 Apr 2018 17:18:51 +0000 (UTC) (envelope-from brooks@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 7326C87386; Sun, 8 Apr 2018 17:18:51 +0000 (UTC) (envelope-from brooks@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 6DB8B12D57; Sun, 8 Apr 2018 17:18:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38HIpgG019631; Sun, 8 Apr 2018 17:18:51 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38HIpL5019630; Sun, 8 Apr 2018 17:18:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081718.w38HIpL5019630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 17:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332294 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 332294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:18:51 -0000 Author: brooks Date: Sun Apr 8 17:18:51 2018 New Revision: 332294 URL: https://svnweb.freebsd.org/changeset/base/332294 Log: MFC r332087: ifconf(): Always zero the whole struct ifreq. The previous split of zeroing ifr_name and ifr_addr seperately is safe on current architectures, but would be unsafe if pointers were larger than 8 bytes. Combining the zeroing adds no real cost (a few instructions) and makes the security property easier to verify. Reviewed by: kib, emaste Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14912 Modified: stable/11/sys/net/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Sun Apr 8 17:10:32 2018 (r332293) +++ stable/11/sys/net/if.c Sun Apr 8 17:18:51 2018 (r332294) @@ -3123,10 +3123,10 @@ again: int addrs; /* - * Zero the ifr_name buffer to make sure we don't - * disclose the contents of the stack. + * Zero the ifr to make sure we don't disclose the contents + * of the stack. */ - memset(ifr.ifr_name, 0, sizeof(ifr.ifr_name)); + memset(&ifr, 0, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) { @@ -3169,7 +3169,6 @@ again: } IF_ADDR_RUNLOCK(ifp); if (addrs == 0) { - bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr)); sbuf_bcat(sb, &ifr, sizeof(ifr)); max_len += sizeof(ifr); From owner-svn-src-all@freebsd.org Sun Apr 8 17:23:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FFD7F92CA2; Sun, 8 Apr 2018 17:23:34 +0000 (UTC) (envelope-from brooks@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 D0D5F6A040; Sun, 8 Apr 2018 17:23:33 +0000 (UTC) (envelope-from brooks@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 CBD9512EFD; Sun, 8 Apr 2018 17:23:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38HNXdk024805; Sun, 8 Apr 2018 17:23:33 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38HNXpP024804; Sun, 8 Apr 2018 17:23:33 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804081723.w38HNXpP024804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 8 Apr 2018 17:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332295 - stable/10/sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/sys/net X-SVN-Commit-Revision: 332295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:23:34 -0000 Author: brooks Date: Sun Apr 8 17:23:33 2018 New Revision: 332295 URL: https://svnweb.freebsd.org/changeset/base/332295 Log: MFC r332087: ifconf(): Always zero the whole struct ifreq. The previous split of zeroing ifr_name and ifr_addr seperately is safe on current architectures, but would be unsafe if pointers were larger than 8 bytes. Combining the zeroing adds no real cost (a few instructions) and makes the security property easier to verify. Reviewed by: kib, emaste Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14912 Modified: stable/10/sys/net/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Sun Apr 8 17:18:51 2018 (r332294) +++ stable/10/sys/net/if.c Sun Apr 8 17:23:33 2018 (r332295) @@ -3024,10 +3024,10 @@ again: int addrs; /* - * Zero the ifr_name buffer to make sure we don't - * disclose the contents of the stack. + * Zero the ifr to make sure we don't disclose the contents + * of the stack. */ - memset(ifr.ifr_name, 0, sizeof(ifr.ifr_name)); + memset(&ifr, 0, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) { @@ -3071,7 +3071,6 @@ again: } IF_ADDR_RUNLOCK(ifp); if (addrs == 0) { - bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr)); sbuf_bcat(sb, &ifr, sizeof(ifr)); max_len += sizeof(ifr); From owner-svn-src-all@freebsd.org Sun Apr 8 19:06:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28709F9A860 for ; Sun, 8 Apr 2018 19:06:59 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 940DC83432 for ; Sun, 8 Apr 2018 19:06:58 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wr0-x22b.google.com with SMTP id d1so6489308wrj.13 for ; Sun, 08 Apr 2018 12:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=EDy6D5dJ9csYO9WdnDSyscrBurNC5Zh+IjGY7AO7Bo8=; b=tKmioO21gP453PEBoOrp8yP/LF+LL7QbwvZRLYeoGKF9nxSPsNoNA81h3ZSdfdDO6H y5hVBQwL7wh8wBWw/iqj+zLbtz3/4pFSrOzpnFn1sb3c5stRjn3ZL55he1ps5o9dwP6h tRVTgYjNmE9tCuHTn9aOVoLYGc3B5RH36T+PHU+jKzvfTsdBHOT9+kWrNQKvvGPo3AaY OWe0cXS4DumHqB+HnAcRbTDvTKWmRciAxv1KfLA/PcjU1wZbl277FW6SmSANmDOivSim egwFbdc0K7wnFWCfX0qvzMB40NEZENur+mq8B5+sMIG9qAcpwIB7jZMsXDakVmdPi0BH 9wSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=EDy6D5dJ9csYO9WdnDSyscrBurNC5Zh+IjGY7AO7Bo8=; b=V2T9qDWVSXOpM5Z7W1sgXkZJBEktfOq5NlWYBR6IgaqtTKcLipaDNn/VjL/LcjKKyU 3P9h4JpYKlVBYTovJEN1skcXl5gdrjf1n5ZRllEtH64WzPhVcTCXBYHd58Bqm+uBOXQd jUdsuDdKljuK6Ok37lJ5aJb6bkhzdBXPf/cB7DJoxE8BCW4LSpHpQYSiHWyyqwC3uNm0 LOYOAH3nhFcthBg8iVaYXIfYpaPLP0k0F4+Q4eYqz4uRdKVgovH/B08pV58f4Izz6XAe 669tfHsWhVMzklrcZ8UT/npnsTHOytSgNyLuJisXYRXidTozu5RZKP5W6sxx4q6W+K8B jA9w== X-Gm-Message-State: AElRT7GL71HSVJGCLWG6vrfoIZK2hTrGPPM43ndi79H0W+irMJTwdDRS FGigHdYd9544thXgEDXQKIe0Og== X-Google-Smtp-Source: AIpwx4/wVn2glAnN/IkT8Ifu1d1ek9tfZlrUo4tqb3H4DRz8yn++lqRdalIAFKQxwbkvHmr98eIuOA== X-Received: by 10.223.219.1 with SMTP id s1mr22574137wri.125.1523214417113; Sun, 08 Apr 2018 12:06:57 -0700 (PDT) Received: from [10.10.1.111] ([185.97.61.1]) by smtp.gmail.com with ESMTPSA id v22sm9911462wra.91.2018.04.08.12.06.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Apr 2018 12:06:56 -0700 (PDT) Subject: Re: svn commit: r332285 - head/sys/kern To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804081634.w38GYA8N097150@repo.freebsd.org> From: Steven Hartland Message-ID: Date: Sun, 8 Apr 2018 20:06:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201804081634.w38GYA8N097150@repo.freebsd.org> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 19:06:59 -0000 Worth making the sysctls so they can be tuned the the HW / use case? On 08/04/2018 17:34, Mateusz Guzik wrote: > Author: mjg > Date: Sun Apr 8 16:34:10 2018 > New Revision: 332285 > URL: https://svnweb.freebsd.org/changeset/base/332285 > > Log: > locks: tweak backoff a little bit > > Previous limits were chosen when locking primitives had spurious lock > accesses. > > Flipping the starting point to 1 (or rather 2 as the first call shifts it) > provides a modest win when mild contention is seen while not hurting worse > cases. Tested on a bunch of one, two and four socket old and new systems > (Westmere, Skylake, Threadreaper and others) by doing concurrent page faults, > buildkernel/buildworld and other stuff (although not all systems got all the > tests). > > Another thing is the upper limit. It is semi-arbitrarily chosen as it was > getting out of hand for slightly less small systems (e.g. a 128-thread one). > > Note that backoff is fundamentally a speculative bandaid and this change just > makes it fit a little bit better. It remains completely oblivious to the > hardware topology or the contention pattern. This is being experimented with. > > Modified: > head/sys/kern/subr_lock.c > > Modified: head/sys/kern/subr_lock.c > ============================================================================== > --- head/sys/kern/subr_lock.c Sun Apr 8 16:29:24 2018 (r332284) > +++ head/sys/kern/subr_lock.c Sun Apr 8 16:34:10 2018 (r332285) > @@ -156,8 +156,10 @@ void > lock_delay_default_init(struct lock_delay_config *lc) > { > > - lc->base = lock_roundup_2(mp_ncpus) / 4; > - lc->max = lc->base * 1024; > + lc->base = 1; > + lc->max = lock_roundup_2(mp_ncpus) * 256; > + if (lc->max > 32678) > + lc->max = 32678; > } > > #ifdef DDB > From owner-svn-src-all@freebsd.org Sun Apr 8 19:11:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B54C7F9AC8B; Sun, 8 Apr 2018 19:11:26 +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 65C0F85D7F; Sun, 8 Apr 2018 19:11:26 +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 60BA113FCC; Sun, 8 Apr 2018 19:11:26 +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 w38JBQ27082820; Sun, 8 Apr 2018 19:11:26 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38JBQmF082818; Sun, 8 Apr 2018 19:11:26 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804081911.w38JBQmF082818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 8 Apr 2018 19:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332296 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 332296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 19:11:27 -0000 Author: jhibbits Date: Sun Apr 8 19:11:25 2018 New Revision: 332296 URL: https://svnweb.freebsd.org/changeset/base/332296 Log: Powerpc64: Add the facility unavailable trap subsystem Summary: This code adds the basic infrastructure for the facility subsystem. A facility trap is raised when an unavailable instruction is executed. One example is executing a Hardware Transactional Memory instruction while the MSR[TM] is disabled. In the past, there was a specific interrupt for it (FP, VEC), but the new instructions seem to be multiplexed on this facility interrupt. The root cause of the trap is provided on Facility Status and Control Register (FSCR) register. Submitted by: Breno Leitao Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D14566 Modified: head/sys/powerpc/include/spr.h head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sun Apr 8 17:23:33 2018 (r332295) +++ head/sys/powerpc/include/spr.h Sun Apr 8 19:11:25 2018 (r332296) @@ -120,6 +120,20 @@ #define SPR_EIE 0x050 /* ..8 Exception Interrupt ??? */ #define SPR_EID 0x051 /* ..8 Exception Interrupt ??? */ #define SPR_NRI 0x052 /* ..8 Exception Interrupt ??? */ +#define SPR_FSCR 0x099 /* Facility Status and Control Register */ +#define FSCR_IC_MASK 0xFF00000000000000ULL /* FSCR[0:7] is Interrupt Cause */ +#define FSCR_IC_FP 0x0000000000000000ULL /* FP unavailable */ +#define FSCR_IC_VSX 0x0100000000000000ULL /* VSX unavailable */ +#define FSCR_IC_DSCR 0x0200000000000000ULL /* Access to the DSCR at SPRs 3 or 17 */ +#define FSCR_IC_PM 0x0300000000000000ULL /* Read or write access of a Performance Monitor SPR in group A */ +#define FSCR_IC_BHRB 0x0400000000000000ULL /* Execution of a BHRB Instruction */ +#define FSCR_IC_HTM 0x0500000000000000ULL /* Access to a Transactional Memory */ +/* Reserved 0x0500000000000000ULL */ +#define FSCR_IC_EBB 0x0700000000000000ULL /* Access to Event-Based Branch */ +#define FSCR_IC_TAR 0x0800000000000000ULL /* Access to Target Address Register */ +#define FSCR_IC_STOP 0x0900000000000000ULL /* Access to the 'stop' instruction in privileged non-hypervisor state */ +#define FSCR_IC_MSG 0x0A00000000000000ULL /* Access to 'msgsndp' or 'msgclrp' instructions */ +#define FSCR_IC_SCV 0x0C00000000000000ULL /* Execution of a 'scv' instruction */ #define SPR_USPRG0 0x100 /* 4.. User SPR General 0 */ #define SPR_VRSAVE 0x100 /* .6. AltiVec VRSAVE */ #define SPR_SPRG0 0x110 /* 468 SPR General 0 */ Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sun Apr 8 17:23:33 2018 (r332295) +++ head/sys/powerpc/powerpc/trap.c Sun Apr 8 19:11:25 2018 (r332296) @@ -204,6 +204,7 @@ trap(struct trapframe *frame) int sig, type, user; u_int ucode; ksiginfo_t ksi; + register_t fscr; VM_CNT_INC(v_trap); @@ -294,6 +295,13 @@ trap(struct trapframe *frame) break; case EXC_FAC: + fscr = mfspr(SPR_FSCR); + if ((fscr & FSCR_IC_MASK) == FSCR_IC_HTM) { + CTR0(KTR_TRAP, "Hardware Transactional Memory subsystem disabled"); + } + sig = SIGILL; + ucode = ILL_ILLOPC; + break; case EXC_HEA: sig = SIGILL; ucode = ILL_ILLOPC; From owner-svn-src-all@freebsd.org Sun Apr 8 19:23:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 283F4F9BB48; Sun, 8 Apr 2018 19:23:52 +0000 (UTC) (envelope-from phk@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 D1C5C6CB24; Sun, 8 Apr 2018 19:23:51 +0000 (UTC) (envelope-from phk@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 CC5A6142D7; Sun, 8 Apr 2018 19:23:51 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38JNpHh090980; Sun, 8 Apr 2018 19:23:51 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38JNp6t090973; Sun, 8 Apr 2018 19:23:51 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201804081923.w38JNp6t090973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 8 Apr 2018 19:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332297 - in head/sys/teken: . libteken X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: in head/sys/teken: . libteken X-SVN-Commit-Revision: 332297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 19:23:52 -0000 Author: phk Date: Sun Apr 8 19:23:50 2018 New Revision: 332297 URL: https://svnweb.freebsd.org/changeset/base/332297 Log: Pedantic polishing of code to please FlexeLint. Approved by: ed Modified: head/sys/teken/libteken/teken.3 head/sys/teken/teken.c head/sys/teken/teken.h head/sys/teken/teken_scs.h head/sys/teken/teken_subr.h head/sys/teken/teken_subr_compat.h head/sys/teken/teken_wcwidth.h Modified: head/sys/teken/libteken/teken.3 ============================================================================== --- head/sys/teken/libteken/teken.3 Sun Apr 8 19:11:25 2018 (r332296) +++ head/sys/teken/libteken/teken.3 Sun Apr 8 19:23:50 2018 (r332297) @@ -43,25 +43,25 @@ .Ft void .Fn teken_set_winsize "teken_t *t" "const teken_pos_t *size" .Ft const teken_pos_t * -.Fn teken_get_cursor "teken_t *t" +.Fn teken_get_cursor "const teken_t *t" .Ft void .Fn teken_set_cursor "teken_t *t" "const teken_pos_t *pos" .Ft const teken_attr_t * -.Fn teken_get_curattr "teken_t *t" +.Fn teken_get_curattr "const teken_t *t" .Ft void .Fn teken_set_curattr "teken_t *t" "const teken_attr_t *attr" .Ft const teken_attr_t * -.Fn teken_get_defattr "teken_t *t" +.Fn teken_get_defattr "const teken_t *t" .Ft void .Fn teken_set_defattr "teken_t *t" "const teken_attr_t *attr" .Ft const char * -.Fn teken_get_sequence "teken_t *t" "unsigned int id" +.Fn teken_get_sequence "const teken_t *t" "unsigned int id" .Ft teken_color_t .Fn teken_256to16 "teken_color_t color" .Ft teken_color_t .Fn teken_256to8 "teken_color_t color" .Ft void -.Fn teken_get_defattr_cons25 "teken_t *t" "int *fg" "int *bg" +.Fn teken_get_defattr_cons25 "const teken_t *t" "int *fg" "int *bg" .Ft void .Fn teken_set_8bit "teken_t *t" .Ft void Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Sun Apr 8 19:11:25 2018 (r332296) +++ head/sys/teken/teken.c Sun Apr 8 19:23:50 2018 (r332297) @@ -73,35 +73,38 @@ static teken_state_t teken_state_init; */ static inline void -teken_funcs_bell(teken_t *t) +teken_funcs_bell(const teken_t *t) { + teken_assert(t->t_funcs->tf_bell != NULL); t->t_funcs->tf_bell(t->t_softc); } static inline void -teken_funcs_cursor(teken_t *t) +teken_funcs_cursor(const teken_t *t) { teken_assert(t->t_cursor.tp_row < t->t_winsize.tp_row); teken_assert(t->t_cursor.tp_col < t->t_winsize.tp_col); + teken_assert(t->t_funcs->tf_cursor != NULL); t->t_funcs->tf_cursor(t->t_softc, &t->t_cursor); } static inline void -teken_funcs_putchar(teken_t *t, const teken_pos_t *p, teken_char_t c, +teken_funcs_putchar(const teken_t *t, const teken_pos_t *p, teken_char_t c, const teken_attr_t *a) { teken_assert(p->tp_row < t->t_winsize.tp_row); teken_assert(p->tp_col < t->t_winsize.tp_col); + teken_assert(t->t_funcs->tf_putchar != NULL); t->t_funcs->tf_putchar(t->t_softc, p, c, a); } static inline void -teken_funcs_fill(teken_t *t, const teken_rect_t *r, +teken_funcs_fill(const teken_t *t, const teken_rect_t *r, const teken_char_t c, const teken_attr_t *a) { @@ -110,11 +113,12 @@ teken_funcs_fill(teken_t *t, const teken_rect_t *r, teken_assert(r->tr_end.tp_col > r->tr_begin.tp_col); teken_assert(r->tr_end.tp_col <= t->t_winsize.tp_col); + teken_assert(t->t_funcs->tf_fill != NULL); t->t_funcs->tf_fill(t->t_softc, r, c, a); } static inline void -teken_funcs_copy(teken_t *t, const teken_rect_t *r, const teken_pos_t *p) +teken_funcs_copy(const teken_t *t, const teken_rect_t *r, const teken_pos_t *p) { teken_assert(r->tr_end.tp_row > r->tr_begin.tp_row); @@ -124,20 +128,23 @@ teken_funcs_copy(teken_t *t, const teken_rect_t *r, co teken_assert(p->tp_row + (r->tr_end.tp_row - r->tr_begin.tp_row) <= t->t_winsize.tp_row); teken_assert(p->tp_col + (r->tr_end.tp_col - r->tr_begin.tp_col) <= t->t_winsize.tp_col); + teken_assert(t->t_funcs->tf_copy != NULL); t->t_funcs->tf_copy(t->t_softc, r, p); } static inline void -teken_funcs_param(teken_t *t, int cmd, unsigned int value) +teken_funcs_param(const teken_t *t, int cmd, unsigned int value) { + teken_assert(t->t_funcs->tf_param != NULL); t->t_funcs->tf_param(t->t_softc, cmd, value); } static inline void -teken_funcs_respond(teken_t *t, const void *buf, size_t len) +teken_funcs_respond(const teken_t *t, const void *buf, size_t len) { + teken_assert(t->t_funcs->tf_respond != NULL); t->t_funcs->tf_respond(t->t_softc, buf, len); } @@ -290,7 +297,7 @@ teken_input(teken_t *t, const void *buf, size_t len) } const teken_pos_t * -teken_get_cursor(teken_t *t) +teken_get_cursor(const teken_t *t) { return (&t->t_cursor); @@ -308,7 +315,7 @@ teken_set_cursor(teken_t *t, const teken_pos_t *p) } const teken_attr_t * -teken_get_curattr(teken_t *t) +teken_get_curattr(const teken_t *t) { return (&t->t_curattr); @@ -322,7 +329,7 @@ teken_set_curattr(teken_t *t, const teken_attr_t *a) } const teken_attr_t * -teken_get_defattr(teken_t *t) +teken_get_defattr(const teken_t *t) { return (&t->t_defattr); @@ -336,7 +343,7 @@ teken_set_defattr(teken_t *t, const teken_attr_t *a) } const teken_pos_t * -teken_get_winsize(teken_t *t) +teken_get_winsize(const teken_t *t) { return (&t->t_winsize); @@ -693,7 +700,7 @@ static const char * const special_strings_normal[] = { }; const char * -teken_get_sequence(teken_t *t, unsigned int k) +teken_get_sequence(const teken_t *t, unsigned int k) { /* Cons25 mode. */ Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Sun Apr 8 19:11:25 2018 (r332296) +++ head/sys/teken/teken.h Sun Apr 8 19:23:50 2018 (r332297) @@ -118,7 +118,7 @@ typedef struct { tf_respond_t *tf_respond; } teken_funcs_t; -typedef teken_char_t teken_scs_t(teken_t *, teken_char_t); +typedef teken_char_t teken_scs_t(const teken_t *, teken_char_t); /* * Terminal state. @@ -166,11 +166,11 @@ void teken_init(teken_t *, const teken_funcs_t *, void void teken_input(teken_t *, const void *, size_t); /* Get/set teken attributes. */ -const teken_pos_t *teken_get_cursor(teken_t *); -const teken_attr_t *teken_get_curattr(teken_t *); -const teken_attr_t *teken_get_defattr(teken_t *); -void teken_get_defattr_cons25(teken_t *, int *, int *); -const teken_pos_t *teken_get_winsize(teken_t *); +const teken_pos_t *teken_get_cursor(const teken_t *); +const teken_attr_t *teken_get_curattr(const teken_t *); +const teken_attr_t *teken_get_defattr(const teken_t *); +void teken_get_defattr_cons25(const teken_t *, int *, int *); +const teken_pos_t *teken_get_winsize(const teken_t *); void teken_set_cursor(teken_t *, const teken_pos_t *); void teken_set_curattr(teken_t *, const teken_attr_t *); void teken_set_defattr(teken_t *, const teken_attr_t *); @@ -202,7 +202,7 @@ void teken_set_winsize_noreset(teken_t *, const teken_ #define TKEY_F10 0x13 #define TKEY_F11 0x14 #define TKEY_F12 0x15 -const char *teken_get_sequence(teken_t *, unsigned int); +const char *teken_get_sequence(const teken_t *, unsigned int); /* Legacy features. */ void teken_set_8bit(teken_t *); Modified: head/sys/teken/teken_scs.h ============================================================================== --- head/sys/teken/teken_scs.h Sun Apr 8 19:11:25 2018 (r332296) +++ head/sys/teken/teken_scs.h Sun Apr 8 19:23:50 2018 (r332297) @@ -29,7 +29,7 @@ */ static inline teken_char_t -teken_scs_process(teken_t *t, teken_char_t c) +teken_scs_process(const teken_t *t, teken_char_t c) { return (t->t_scs[t->t_curscs](t, c)); @@ -52,7 +52,7 @@ static const uint8_t teken_boxdrawing_8bit[31] = { }; static teken_char_t -teken_scs_special_graphics(teken_t *t, teken_char_t c) +teken_scs_special_graphics(const teken_t *t, teken_char_t c) { /* Box drawing. */ @@ -64,7 +64,7 @@ teken_scs_special_graphics(teken_t *t, teken_char_t c) } static teken_char_t -teken_scs_uk_national(teken_t *t, teken_char_t c) +teken_scs_uk_national(const teken_t *t, teken_char_t c) { /* Pound sign. */ @@ -74,9 +74,10 @@ teken_scs_uk_national(teken_t *t, teken_char_t c) } static teken_char_t -teken_scs_us_ascii(teken_t *t __unused, teken_char_t c) +teken_scs_us_ascii(const teken_t *t, teken_char_t c) { /* No processing. */ + (void)t; return (c); } Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sun Apr 8 19:11:25 2018 (r332296) +++ head/sys/teken/teken_subr.h Sun Apr 8 19:23:50 2018 (r332297) @@ -29,13 +29,13 @@ */ static void teken_subr_cursor_up(teken_t *, unsigned int); -static void teken_subr_erase_line(teken_t *, unsigned int); +static void teken_subr_erase_line(const teken_t *, unsigned int); static void teken_subr_regular_character(teken_t *, teken_char_t); static void teken_subr_reset_to_initial_state(teken_t *); static void teken_subr_save_cursor(teken_t *); static inline int -teken_tab_isset(teken_t *t, unsigned int col) +teken_tab_isset(const teken_t *t, unsigned int col) { unsigned int b, o; @@ -45,7 +45,7 @@ teken_tab_isset(teken_t *t, unsigned int col) b = col / (sizeof(unsigned int) * 8); o = col % (sizeof(unsigned int) * 8); - return (t->t_tabstops[b] & (1 << o)); + return (t->t_tabstops[b] & (1U << o)); } static inline void @@ -59,7 +59,7 @@ teken_tab_clear(teken_t *t, unsigned int col) b = col / (sizeof(unsigned int) * 8); o = col % (sizeof(unsigned int) * 8); - t->t_tabstops[b] &= ~(1 << o); + t->t_tabstops[b] &= ~(1U << o); } static inline void @@ -73,7 +73,7 @@ teken_tab_set(teken_t *t, unsigned int col) b = col / (sizeof(unsigned int) * 8); o = col % (sizeof(unsigned int) * 8); - t->t_tabstops[b] |= 1 << o; + t->t_tabstops[b] |= 1U << o; } static void @@ -81,14 +81,14 @@ teken_tab_default(teken_t *t) { unsigned int i; - memset(&t->t_tabstops, 0, T_NUMCOL / 8); + memset(t->t_tabstops, 0, T_NUMCOL / 8); for (i = 8; i < T_NUMCOL; i += 8) teken_tab_set(t, i); } static void -teken_subr_do_scroll(teken_t *t, int amount) +teken_subr_do_scroll(const teken_t *t, int amount) { teken_rect_t tr; teken_pos_t tp; @@ -149,7 +149,7 @@ teken_subr_do_scroll(teken_t *t, int amount) } static ssize_t -teken_subr_do_cpr(teken_t *t, unsigned int cmd, char response[16]) +teken_subr_do_cpr(const teken_t *t, unsigned int cmd, char response[16]) { switch (cmd) { @@ -225,7 +225,7 @@ teken_subr_backspace(teken_t *t) } static void -teken_subr_bell(teken_t *t) +teken_subr_bell(const teken_t *t) { teken_funcs_bell(t); @@ -326,7 +326,7 @@ static void teken_subr_cursor_position(teken_t *t, unsigned int row, unsigned int col) { - row = row - 1 + t->t_originreg.ts_begin; + row = (row - 1) + t->t_originreg.ts_begin; t->t_cursor.tp_row = row < t->t_originreg.ts_end ? row : t->t_originreg.ts_end - 1; @@ -339,7 +339,7 @@ teken_subr_cursor_position(teken_t *t, unsigned int ro } static void -teken_subr_cursor_position_report(teken_t *t, unsigned int cmd) +teken_subr_cursor_position_report(const teken_t *t, unsigned int cmd) { char response[18] = "\x1B["; ssize_t len; @@ -372,7 +372,7 @@ teken_subr_cursor_up(teken_t *t, unsigned int nrows) } static void -teken_subr_delete_character(teken_t *t, unsigned int ncols) +teken_subr_delete_character(const teken_t *t, unsigned int ncols) { teken_rect_t tr; @@ -395,7 +395,7 @@ teken_subr_delete_character(teken_t *t, unsigned int n } static void -teken_subr_delete_line(teken_t *t, unsigned int nrows) +teken_subr_delete_line(const teken_t *t, unsigned int nrows) { teken_rect_t tr; @@ -435,7 +435,7 @@ teken_subr_device_control_string(teken_t *t) } static void -teken_subr_device_status_report(teken_t *t, unsigned int cmd) +teken_subr_device_status_report(const teken_t *t, unsigned int cmd) { char response[19] = "\x1B[?"; ssize_t len; @@ -448,21 +448,23 @@ teken_subr_device_status_report(teken_t *t, unsigned i } static void -teken_subr_double_height_double_width_line_top(teken_t *t __unused) +teken_subr_double_height_double_width_line_top(const teken_t *t) { + (void)t; teken_printf("double height double width top\n"); } static void -teken_subr_double_height_double_width_line_bottom(teken_t *t __unused) +teken_subr_double_height_double_width_line_bottom(const teken_t *t) { + (void)t; teken_printf("double height double width bottom\n"); } static void -teken_subr_erase_character(teken_t *t, unsigned int ncols) +teken_subr_erase_character(const teken_t *t, unsigned int ncols) { teken_rect_t tr; @@ -478,7 +480,7 @@ teken_subr_erase_character(teken_t *t, unsigned int nc } static void -teken_subr_erase_display(teken_t *t, unsigned int mode) +teken_subr_erase_display(const teken_t *t, unsigned int mode) { teken_rect_t r; @@ -514,7 +516,7 @@ teken_subr_erase_display(teken_t *t, unsigned int mode } static void -teken_subr_erase_line(teken_t *t, unsigned int mode) +teken_subr_erase_line(const teken_t *t, unsigned int mode) { teken_rect_t r; @@ -540,42 +542,42 @@ teken_subr_erase_line(teken_t *t, unsigned int mode) } static void -teken_subr_g0_scs_special_graphics(teken_t *t __unused) +teken_subr_g0_scs_special_graphics(teken_t *t) { t->t_scs[0] = teken_scs_special_graphics; } static void -teken_subr_g0_scs_uk_national(teken_t *t __unused) +teken_subr_g0_scs_uk_national(teken_t *t) { t->t_scs[0] = teken_scs_uk_national; } static void -teken_subr_g0_scs_us_ascii(teken_t *t __unused) +teken_subr_g0_scs_us_ascii(teken_t *t) { t->t_scs[0] = teken_scs_us_ascii; } static void -teken_subr_g1_scs_special_graphics(teken_t *t __unused) +teken_subr_g1_scs_special_graphics(teken_t *t) { t->t_scs[1] = teken_scs_special_graphics; } static void -teken_subr_g1_scs_uk_national(teken_t *t __unused) +teken_subr_g1_scs_uk_national(teken_t *t) { t->t_scs[1] = teken_scs_uk_national; } static void -teken_subr_g1_scs_us_ascii(teken_t *t __unused) +teken_subr_g1_scs_us_ascii(teken_t *t) { t->t_scs[1] = teken_scs_us_ascii; @@ -621,7 +623,7 @@ teken_subr_index(teken_t *t) } static void -teken_subr_insert_character(teken_t *t, unsigned int ncols) +teken_subr_insert_character(const teken_t *t, unsigned int ncols) { teken_rect_t tr; @@ -647,7 +649,7 @@ teken_subr_insert_character(teken_t *t, unsigned int n } static void -teken_subr_insert_line(teken_t *t, unsigned int nrows) +teken_subr_insert_line(const teken_t *t, unsigned int nrows) { teken_rect_t tr; @@ -679,14 +681,14 @@ teken_subr_insert_line(teken_t *t, unsigned int nrows) } static void -teken_subr_keypad_application_mode(teken_t *t) +teken_subr_keypad_application_mode(const teken_t *t) { teken_funcs_param(t, TP_KEYPADAPP, 1); } static void -teken_subr_keypad_numeric_mode(teken_t *t) +teken_subr_keypad_numeric_mode(const teken_t *t) { teken_funcs_param(t, TP_KEYPADAPP, 0); @@ -748,21 +750,21 @@ teken_subr_operating_system_command(teken_t *t) } static void -teken_subr_pan_down(teken_t *t, unsigned int nrows) +teken_subr_pan_down(const teken_t *t, unsigned int nrows) { teken_subr_do_scroll(t, (int)nrows); } static void -teken_subr_pan_up(teken_t *t, unsigned int nrows) +teken_subr_pan_up(const teken_t *t, unsigned int nrows) { teken_subr_do_scroll(t, -(int)nrows); } static void -teken_subr_primary_device_attributes(teken_t *t, unsigned int request) +teken_subr_primary_device_attributes(const teken_t *t, unsigned int request) { if (request == 0) { @@ -775,7 +777,7 @@ teken_subr_primary_device_attributes(teken_t *t, unsig } static void -teken_subr_do_putchar(teken_t *t, const teken_pos_t *tp, teken_char_t c, +teken_subr_do_putchar(const teken_t *t, const teken_pos_t *tp, teken_char_t c, int width) { @@ -1042,7 +1044,7 @@ teken_subr_save_cursor(teken_t *t) } static void -teken_subr_secondary_device_attributes(teken_t *t, unsigned int request) +teken_subr_secondary_device_attributes(const teken_t *t, unsigned int request) { if (request == 0) { @@ -1121,7 +1123,7 @@ teken_subr_set_mode(teken_t *t, unsigned int cmd) static void teken_subr_set_graphic_rendition(teken_t *t, unsigned int ncmds, - unsigned int cmds[]) + const unsigned int cmds[]) { unsigned int i, n; @@ -1208,7 +1210,7 @@ teken_subr_set_graphic_rendition(teken_t *t, unsigned case 95: /* Set bright foreground color: magenta */ case 96: /* Set bright foreground color: cyan */ case 97: /* Set bright foreground color: white */ - t->t_curattr.ta_fgcolor = n - 90 + 8; + t->t_curattr.ta_fgcolor = (n - 90) + 8; break; case 100: /* Set bright background color: black */ case 101: /* Set bright background color: red */ @@ -1218,7 +1220,7 @@ teken_subr_set_graphic_rendition(teken_t *t, unsigned case 105: /* Set bright background color: magenta */ case 106: /* Set bright background color: cyan */ case 107: /* Set bright background color: white */ - t->t_curattr.ta_bgcolor = n - 100 + 8; + t->t_curattr.ta_bgcolor = (n - 100) + 8; break; default: teken_printf("unsupported attribute %u\n", n); @@ -1258,23 +1260,26 @@ teken_subr_set_top_and_bottom_margins(teken_t *t, unsi } static void -teken_subr_single_height_double_width_line(teken_t *t __unused) +teken_subr_single_height_double_width_line(const teken_t *t) { + (void)t; teken_printf("single height double width???\n"); } static void -teken_subr_single_height_single_width_line(teken_t *t __unused) +teken_subr_single_height_single_width_line(const teken_t *t) { + (void)t; teken_printf("single height single width???\n"); } static void -teken_subr_string_terminator(teken_t *t __unused) +teken_subr_string_terminator(const teken_t *t) { + (void)t; /* * Strings are already terminated in teken_input_char() when ^[ * is inserted. @@ -1290,8 +1295,10 @@ teken_subr_tab_clear(teken_t *t, unsigned int cmd) teken_tab_clear(t, t->t_cursor.tp_col); break; case 3: - memset(&t->t_tabstops, 0, T_NUMCOL / 8); + memset(t->t_tabstops, 0, T_NUMCOL / 8); break; + default: + break; } } @@ -1299,7 +1306,7 @@ static void teken_subr_vertical_position_absolute(teken_t *t, unsigned int row) { - row = row - 1 + t->t_originreg.ts_begin; + row = (row - 1) + t->t_originreg.ts_begin; t->t_cursor.tp_row = row < t->t_originreg.ts_end ? row : t->t_originreg.ts_end - 1; Modified: head/sys/teken/teken_subr_compat.h ============================================================================== --- head/sys/teken/teken_subr_compat.h Sun Apr 8 19:11:25 2018 (r332296) +++ head/sys/teken/teken_subr_compat.h Sun Apr 8 19:23:50 2018 (r332297) @@ -29,15 +29,15 @@ */ static void -teken_subr_cons25_set_border(teken_t *t, unsigned int c) +teken_subr_cons25_set_border(const teken_t *t, unsigned int c) { teken_funcs_param(t, TP_SETBORDER, c); } static void -teken_subr_cons25_set_global_cursor_shape(teken_t *t, unsigned int ncmds, - unsigned int cmds[]) +teken_subr_cons25_set_global_cursor_shape(const teken_t *t, unsigned int ncmds, + const unsigned int cmds[]) { unsigned int code, i; @@ -58,7 +58,7 @@ teken_subr_cons25_set_global_cursor_shape(teken_t *t, } static void -teken_subr_cons25_set_local_cursor_type(teken_t *t, unsigned int type) +teken_subr_cons25_set_local_cursor_type(const teken_t *t, unsigned int type) { teken_funcs_param(t, TP_SETLOCALCURSOR, type); @@ -86,7 +86,7 @@ teken_subr_cons25_set_default_foreground(teken_t *t, u static const teken_color_t cons25_revcolors[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; void -teken_get_defattr_cons25(teken_t *t, int *fg, int *bg) +teken_get_defattr_cons25(const teken_t *t, int *fg, int *bg) { *fg = cons25_revcolors[teken_256to8(t->t_defattr.ta_fgcolor)]; @@ -96,14 +96,14 @@ teken_get_defattr_cons25(teken_t *t, int *fg, int *bg) } static void -teken_subr_cons25_switch_virtual_terminal(teken_t *t, unsigned int vt) +teken_subr_cons25_switch_virtual_terminal(const teken_t *t, unsigned int vt) { teken_funcs_param(t, TP_SWITCHVT, vt); } static void -teken_subr_cons25_set_bell_pitch_duration(teken_t *t, unsigned int pitch, +teken_subr_cons25_set_bell_pitch_duration(const teken_t *t, unsigned int pitch, unsigned int duration) { @@ -113,9 +113,10 @@ teken_subr_cons25_set_bell_pitch_duration(teken_t *t, static void teken_subr_cons25_set_graphic_rendition(teken_t *t, unsigned int cmd, - unsigned int param __unused) + unsigned int param) { + (void)param; switch (cmd) { case 0: /* Reset. */ t->t_curattr = t->t_defattr; @@ -135,6 +136,8 @@ teken_subr_cons25_set_terminal_mode(teken_t *t, unsign break; case 1: /* Switch terminal to cons25. */ t->t_stateflags |= TS_CONS25; + break; + default: break; } } Modified: head/sys/teken/teken_wcwidth.h ============================================================================== --- head/sys/teken/teken_wcwidth.h Sun Apr 8 19:11:25 2018 (r332296) +++ head/sys/teken/teken_wcwidth.h Sun Apr 8 19:23:50 2018 (r332297) @@ -103,7 +103,7 @@ static int teken_wcwidth(teken_char_t ucs) /* if we arrive here, ucs is not a combining or C0/C1 control character */ - return 1 + + return 1 + (ucs >= 0x1100 && (ucs <= 0x115f || /* Hangul Jamo init. consonants */ ucs == 0x2329 || ucs == 0x232a || From owner-svn-src-all@freebsd.org Sun Apr 8 19:24:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDF5AF9BC51; Sun, 8 Apr 2018 19:24:50 +0000 (UTC) (envelope-from rgrimes@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 7E8B36D449; Sun, 8 Apr 2018 19:24:50 +0000 (UTC) (envelope-from rgrimes@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 793FD142D8; Sun, 8 Apr 2018 19:24:50 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38JOoTT091064; Sun, 8 Apr 2018 19:24:50 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38JOnX1091052; Sun, 8 Apr 2018 19:24:49 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201804081924.w38JOnX1091052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Sun, 8 Apr 2018 19:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332298 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Commit-Revision: 332298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 19:24:51 -0000 Author: rgrimes Date: Sun Apr 8 19:24:49 2018 New Revision: 332298 URL: https://svnweb.freebsd.org/changeset/base/332298 Log: Add the ability to control the CPU topology of created VMs from userland without the need to use sysctls, it allows the old sysctls to continue to function, but deprecates them at FreeBSD_version 1200060 (Relnotes for deprecate). The command line of bhyve is maintained in a backwards compatible way. The API of libvmmapi is maintained in a backwards compatible way. The sysctl's are maintained in a backwards compatible way. Added command option looks like: bhyve -c [[cpus=]n][,sockets=n][,cores=n][,threads=n][,maxcpus=n] The optional parts can be specified in any order, but only a single integer invokes the backwards compatible parse. [,maxcpus=n] is hidden by #ifdef until kernel support is added, though the api is put in place. bhyvectl --get-cpu-topology option added. Reviewed by: grehan (maintainer, earlier version), Reviewed by: bcr (manpages) Approved by: bde (mentor), phk (mentor) Tested by: Oleg Ginzburg (cbsd) MFC after: 1 week Relnotes: Y Differential Revision: https://reviews.freebsd.org/D9930 Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/x86.c head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Sun Apr 8 19:23:50 2018 (r332297) +++ head/lib/libvmmapi/vmmapi.c Sun Apr 8 19:24:49 2018 (r332298) @@ -1506,6 +1506,38 @@ vm_restart_instruction(void *arg, int vcpu) } int +vm_set_topology(struct vmctx *ctx, + uint16_t sockets, uint16_t cores, uint16_t threads, uint16_t maxcpus) +{ + struct vm_cpu_topology topology; + + bzero(&topology, sizeof (struct vm_cpu_topology)); + topology.sockets = sockets; + topology.cores = cores; + topology.threads = threads; + topology.maxcpus = maxcpus; + return (ioctl(ctx->fd, VM_SET_TOPOLOGY, &topology)); +} + +int +vm_get_topology(struct vmctx *ctx, + uint16_t *sockets, uint16_t *cores, uint16_t *threads, uint16_t *maxcpus) +{ + struct vm_cpu_topology topology; + int error; + + bzero(&topology, sizeof (struct vm_cpu_topology)); + error = ioctl(ctx->fd, VM_GET_TOPOLOGY, &topology); + if (error == 0) { + *sockets = topology.sockets; + *cores = topology.cores; + *threads = topology.threads; + *maxcpus = topology.maxcpus; + } + return (error); +} + +int vm_get_device_fd(struct vmctx *ctx) { @@ -1535,7 +1567,7 @@ vm_get_ioctls(size_t *len) VM_ACTIVATE_CPU, VM_GET_CPUS, VM_SUSPEND_CPU, VM_RESUME_CPU, VM_SET_INTINFO, VM_GET_INTINFO, VM_RTC_WRITE, VM_RTC_READ, VM_RTC_SETTIME, VM_RTC_GETTIME, - VM_RESTART_INSTRUCTION }; + VM_RESTART_INSTRUCTION, VM_SET_TOPOLOGY, VM_GET_TOPOLOGY }; if (len == NULL) { cmds = malloc(sizeof(vm_ioctl_cmds)); Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Sun Apr 8 19:23:50 2018 (r332297) +++ head/lib/libvmmapi/vmmapi.h Sun Apr 8 19:24:49 2018 (r332298) @@ -221,6 +221,12 @@ int vm_activate_cpu(struct vmctx *ctx, int vcpu); int vm_suspend_cpu(struct vmctx *ctx, int vcpu); int vm_resume_cpu(struct vmctx *ctx, int vcpu); +/* CPU topology */ +int vm_set_topology(struct vmctx *ctx, uint16_t sockets, uint16_t cores, + uint16_t threads, uint16_t maxcpus); +int vm_get_topology(struct vmctx *ctx, uint16_t *sockets, uint16_t *cores, + uint16_t *threads, uint16_t *maxcpus); + /* * FreeBSD specific APIs */ Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sun Apr 8 19:23:50 2018 (r332297) +++ head/sys/amd64/include/vmm.h Sun Apr 8 19:24:49 2018 (r332298) @@ -181,6 +181,10 @@ int vm_create(const char *name, struct vm **retvm); void vm_destroy(struct vm *vm); int vm_reinit(struct vm *vm); const char *vm_name(struct vm *vm); +void vm_get_topology(struct vm *vm, uint16_t *sockets, uint16_t *cores, + uint16_t *threads, uint16_t *maxcpus); +int vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, + uint16_t threads, uint16_t maxcpus); /* * APIs that modify the guest memory map require all vcpus to be frozen. Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Sun Apr 8 19:23:50 2018 (r332297) +++ head/sys/amd64/include/vmm_dev.h Sun Apr 8 19:24:49 2018 (r332298) @@ -226,6 +226,13 @@ struct vm_rtc_data { uint8_t value; }; +struct vm_cpu_topology { + uint16_t sockets; + uint16_t cores; + uint16_t threads; + uint16_t maxcpus; +}; + enum { /* general routines */ IOCNUM_ABIVERS = 0, @@ -284,6 +291,10 @@ enum { IOCNUM_GET_X2APIC_STATE = 61, IOCNUM_GET_HPET_CAPABILITIES = 62, + /* CPU Topology */ + IOCNUM_SET_TOPOLOGY = 63, + IOCNUM_GET_TOPOLOGY = 64, + /* legacy interrupt injection */ IOCNUM_ISA_ASSERT_IRQ = 80, IOCNUM_ISA_DEASSERT_IRQ = 81, @@ -379,6 +390,10 @@ enum { _IOWR('v', IOCNUM_GET_X2APIC_STATE, struct vm_x2apic) #define VM_GET_HPET_CAPABILITIES \ _IOR('v', IOCNUM_GET_HPET_CAPABILITIES, struct vm_hpet_cap) +#define VM_SET_TOPOLOGY \ + _IOW('v', IOCNUM_SET_TOPOLOGY, struct vm_cpu_topology) +#define VM_GET_TOPOLOGY \ + _IOR('v', IOCNUM_GET_TOPOLOGY, struct vm_cpu_topology) #define VM_GET_GPA_PMAP \ _IOWR('v', IOCNUM_GET_GPA_PMAP, struct vm_gpa_pte) #define VM_GLA2GPA \ Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sun Apr 8 19:23:50 2018 (r332297) +++ head/sys/amd64/vmm/vmm.c Sun Apr 8 19:24:49 2018 (r332298) @@ -166,6 +166,11 @@ struct vm { struct vmspace *vmspace; /* (o) guest's address space */ char name[VM_MAX_NAMELEN]; /* (o) virtual machine name */ struct vcpu vcpu[VM_MAXCPU]; /* (i) guest vcpus */ + /* The following describe the vm cpu topology */ + uint16_t sockets; /* (o) num of sockets */ + uint16_t cores; /* (o) num of cores/socket */ + uint16_t threads; /* (o) num of threads/core */ + uint16_t maxcpus; /* (o) max pluggable cpus */ }; static int vmm_initialized; @@ -425,6 +430,12 @@ vm_init(struct vm *vm, bool create) vcpu_init(vm, i, create); } +/* + * The default CPU topology is a single thread per package. + */ +u_int cores_per_package = 1; +u_int threads_per_core = 1; + int vm_create(const char *name, struct vm **retvm) { @@ -450,10 +461,41 @@ vm_create(const char *name, struct vm **retvm) vm->vmspace = vmspace; mtx_init(&vm->rendezvous_mtx, "vm rendezvous lock", 0, MTX_DEF); + vm->sockets = 1; + vm->cores = cores_per_package; /* XXX backwards compatibility */ + vm->threads = threads_per_core; /* XXX backwards compatibility */ + vm->maxcpus = 0; /* XXX not implemented */ + vm_init(vm, true); *retvm = vm; return (0); +} + +void +vm_get_topology(struct vm *vm, uint16_t *sockets, uint16_t *cores, + uint16_t *threads, uint16_t *maxcpus) +{ + *sockets = vm->sockets; + *cores = vm->cores; + *threads = vm->threads; + *maxcpus = vm->maxcpus; +} + +int +vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, + uint16_t threads, uint16_t maxcpus) +{ + if (maxcpus != 0) + return (EINVAL); /* XXX remove when supported */ + if ((sockets * cores * threads) > VM_MAXCPU) + return (EINVAL); + /* XXX need to check sockets * cores * threads == vCPU, how? */ + vm->sockets = sockets; + vm->cores = cores; + vm->threads = threads; + vm->maxcpus = maxcpus; + return(0); } static void Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Sun Apr 8 19:23:50 2018 (r332297) +++ head/sys/amd64/vmm/vmm_dev.c Sun Apr 8 19:24:49 2018 (r332298) @@ -346,6 +346,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da struct vm_rtc_time *rtctime; struct vm_rtc_data *rtcdata; struct vm_memmap *mm; + struct vm_cpu_topology *topology; uint64_t *regvals; int *regnums; @@ -736,6 +737,17 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da break; case VM_RESTART_INSTRUCTION: error = vm_restart_instruction(sc->vm, vcpu); + break; + case VM_SET_TOPOLOGY: + topology = (struct vm_cpu_topology *)data; + error = vm_set_topology(sc->vm, topology->sockets, + topology->cores, topology->threads, topology->maxcpus); + break; + case VM_GET_TOPOLOGY: + topology = (struct vm_cpu_topology *)data; + vm_get_topology(sc->vm, &topology->sockets, &topology->cores, + &topology->threads, &topology->maxcpus); + error = 0; break; default: error = ENOTTY; Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Sun Apr 8 19:23:50 2018 (r332297) +++ head/sys/amd64/vmm/x86.c Sun Apr 8 19:24:49 2018 (r332298) @@ -60,16 +60,15 @@ static uint64_t bhyve_xcpuids; SYSCTL_ULONG(_hw_vmm, OID_AUTO, bhyve_xcpuids, CTLFLAG_RW, &bhyve_xcpuids, 0, "Number of times an unknown cpuid leaf was accessed"); -/* - * The default CPU topology is a single thread per package. - */ -static u_int threads_per_core = 1; +#if __FreeBSD_version < 1200060 /* Remove after 11 EOL helps MFCing */ +extern u_int threads_per_core; SYSCTL_UINT(_hw_vmm_topology, OID_AUTO, threads_per_core, CTLFLAG_RDTUN, &threads_per_core, 0, NULL); -static u_int cores_per_package = 1; +extern u_int cores_per_package; SYSCTL_UINT(_hw_vmm_topology, OID_AUTO, cores_per_package, CTLFLAG_RDTUN, &cores_per_package, 0, NULL); +#endif static int cpuid_leaf_b = 1; SYSCTL_INT(_hw_vmm_topology, OID_AUTO, cpuid_leaf_b, CTLFLAG_RDTUN, @@ -95,6 +94,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, int error, enable_invpcid, level, width, x2apic_id; unsigned int func, regs[4], logical_cpus; enum x2apic_state x2apic_state; + uint16_t cores, maxcpus, sockets, threads; VCPU_CTR2(vm, vcpu_id, "cpuid %#x,%#x", *eax, *ecx); @@ -142,11 +142,11 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, * * However this matches the logical cpus as * advertised by leaf 0x1 and will work even - * if the 'threads_per_core' tunable is set - * incorrectly on an AMD host. + * if threads is set incorrectly on an AMD host. */ - logical_cpus = threads_per_core * - cores_per_package; + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); + logical_cpus = threads * cores; regs[2] = logical_cpus - 1; } break; @@ -305,7 +305,9 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, */ regs[3] |= (CPUID_MCA | CPUID_MCE | CPUID_MTRR); - logical_cpus = threads_per_core * cores_per_package; + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); + logical_cpus = threads * cores; regs[1] &= ~CPUID_HTT_CORES; regs[1] |= (logical_cpus & 0xff) << 16; regs[3] |= CPUID_HTT; @@ -315,8 +317,10 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, cpuid_count(*eax, *ecx, regs); if (regs[0] || regs[1] || regs[2] || regs[3]) { + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); regs[0] &= 0x3ff; - regs[0] |= (cores_per_package - 1) << 26; + regs[0] |= (cores - 1) << 26; /* * Cache topology: * - L1 and L2 are shared only by the logical @@ -324,10 +328,10 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, * - L3 and above are shared by all logical * processors in the package. */ - logical_cpus = threads_per_core; + logical_cpus = threads; level = (regs[0] >> 5) & 0x7; if (level >= 3) - logical_cpus *= cores_per_package; + logical_cpus *= cores; regs[0] |= (logical_cpus - 1) << 14; } break; @@ -389,16 +393,17 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, /* * Processor topology enumeration */ + vm_get_topology(vm, &sockets, &cores, &threads, + &maxcpus); if (*ecx == 0) { - logical_cpus = threads_per_core; + logical_cpus = threads; width = log2(logical_cpus); level = CPUID_TYPE_SMT; x2apic_id = vcpu_id; } if (*ecx == 1) { - logical_cpus = threads_per_core * - cores_per_package; + logical_cpus = threads * cores; width = log2(logical_cpus); level = CPUID_TYPE_CORE; x2apic_id = vcpu_id; Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Sun Apr 8 19:23:50 2018 (r332297) +++ head/usr.sbin/bhyve/bhyve.8 Sun Apr 8 19:24:49 2018 (r332298) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2017 +.Dd April 6, 2018 .Dt BHYVE 8 .Os .Sh NAME @@ -33,7 +33,16 @@ .Sh SYNOPSIS .Nm .Op Fl abehuwxACHPSWY -.Op Fl c Ar numcpus +.Oo +.Fl c\~ Ns +.Oo +.Op Ar cpus= Ns +.Ar numcpus Ns +.Oc Ns +.Op Ar ,sockets=n Ns +.Op Ar ,cores=n Ns +.Op Ar ,threads=n +.Oc .Op Fl g Ar gdbport .Op Fl l Ar lpcdev Ns Op , Ns Ar conf .Op Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t @@ -77,9 +86,30 @@ Enable a low-level console device supported by kernels compiled with .Cd "device bvmconsole" . This option will be deprecated in a future version. -.It Fl c Ar numcpus -Number of guest virtual CPUs. -The default is 1 and the maximum is 16. +.It Fl c Op Ar setting ... +Number of guest virtual CPUs +and/or the CPU topology. +The default value for each of +.Ar numcpus , +.Ar sockets , +.Ar cores , +and +.Ar threads +is 1. +The current maximum number of guest virtual CPUs is 16. +If +.Ar numcpus +is not specified then it will be calculated from the other arguments. +The topology must be consistent in that the +.Ar numcpus +must equal the product of +.Ar sockets , +.Ar cores , +and +.Ar threads . +If a +.Ar setting +is specified more than once the last one has precedence. .It Fl C Include guest memory in core file. .It Fl e Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Sun Apr 8 19:23:50 2018 (r332297) +++ head/usr.sbin/bhyve/bhyverun.c Sun Apr 8 19:24:49 2018 (r332298) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifndef WITHOUT_CAPSICUM @@ -93,6 +94,8 @@ extern int vmexit_task_switch(struct vmctx *, struct v char *vmname; int guest_ncpus; +uint16_t cores, maxcpus, sockets, threads; + char *guest_uuid_str; static int guest_vmexit_on_hlt, guest_vmexit_on_pause; @@ -137,11 +140,13 @@ usage(int code) { fprintf(stderr, - "Usage: %s [-abehuwxACHPSWY] [-c vcpus] [-g ] [-l ]\n" + "Usage: %s [-abehuwxACHPSWY]\n" + " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" + " %*s [-g ] [-l ]\n" " %*s [-m mem] [-p vcpu:hostcpu] [-s ] [-U uuid] \n" " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create ACPI tables\n" - " -c: # cpus (default 1)\n" + " -c: number of cpus and/or topology specification" " -C: include guest memory in core file\n" " -e: exit on unhandled I/O access\n" " -g: gdb port\n" @@ -159,12 +164,92 @@ usage(int code) " -W: force virtio to use single-vector MSI\n" " -x: local apic is in x2APIC mode\n" " -Y: disable MPtable generation\n", - progname, (int)strlen(progname), ""); + progname, (int)strlen(progname), "", (int)strlen(progname), "", + (int)strlen(progname), ""); exit(code); } +/* + * XXX This parser is known to have the following issues: + * 1. It accepts null key=value tokens ",,". + * 2. It accepts whitespace after = and before value. + * 3. Values out of range of INT are silently wrapped. + * 4. It doesn't check non-final values. + * 5. The apparently bogus limits of UINT16_MAX are for future expansion. + * + * The acceptance of a null specification ('-c ""') is by design to match the + * manual page syntax specification, this results in a topology of 1 vCPU. + */ static int +topology_parse(const char *opt) +{ + uint64_t ncpus; + int c, chk, n, s, t, tmp; + char *cp, *str; + bool ns, scts; + + c = 1, n = 1, s = 1, t = 1; + ns = false, scts = false; + str = strdup(opt); + + while ((cp = strsep(&str, ",")) != NULL) { + if (sscanf(cp, "%i%n", &tmp, &chk) == 1) { + n = tmp; + ns = true; + } else if (sscanf(cp, "cpus=%i%n", &tmp, &chk) == 1) { + n = tmp; + ns = true; + } else if (sscanf(cp, "sockets=%i%n", &tmp, &chk) == 1) { + s = tmp; + scts = true; + } else if (sscanf(cp, "cores=%i%n", &tmp, &chk) == 1) { + c = tmp; + scts = true; + } else if (sscanf(cp, "threads=%i%n", &tmp, &chk) == 1) { + t = tmp; + scts = true; +#ifdef notyet /* Do not expose this until vmm.ko implements it */ + } else if (sscanf(cp, "maxcpus=%i%n", &tmp, &chk) == 1) { + m = tmp; +#endif + /* Skip the empty argument case from -c "" */ + } else if (cp[0] == '\0') + continue; + else + return (-1); + /* Any trailing garbage causes an error */ + if (cp[chk] != '\0') + return (-1); + } + /* + * Range check 1 <= n <= UINT16_MAX all values + */ + if (n < 1 || s < 1 || c < 1 || t < 1 || + n > UINT16_MAX || s > UINT16_MAX || c > UINT16_MAX || + t > UINT16_MAX) + return (-1); + + /* If only the cpus was specified, use that as sockets */ + if (!scts) + s = n; + /* + * Compute sockets * cores * threads avoiding overflow + * The range check above insures these are 16 bit values + * If n was specified check it against computed ncpus + */ + ncpus = (uint64_t)s * c * t; + if (ncpus > UINT16_MAX || (ns && n != ncpus)) + return (-1); + + guest_ncpus = ncpus; + sockets = s; + cores = c; + threads = t; + return(0); +} + +static int pincpu_parse(const char *opt) { int vcpu, pcpu; @@ -783,6 +868,9 @@ do_open(const char *vmname) exit(1); } } + error = vm_set_topology(ctx, sockets, cores, threads, maxcpus); + if (error) + errx(EX_OSERR, "vm_set_topology"); return (ctx); } @@ -801,6 +889,8 @@ main(int argc, char *argv[]) progname = basename(argv[0]); gdb_port = 0; guest_ncpus = 1; + sockets = cores = threads = 1; + maxcpus = 0; memsize = 256 * MB; mptgen = 1; rtc_localtime = 1; @@ -825,7 +915,10 @@ main(int argc, char *argv[]) } break; case 'c': - guest_ncpus = atoi(optarg); + if (topology_parse(optarg) != 0) { + errx(EX_USAGE, "invalid cpu topology " + "'%s'", optarg); + } break; case 'C': memflags |= VM_MEM_F_INCORE; @@ -902,11 +995,6 @@ main(int argc, char *argv[]) vmname = argv[0]; ctx = do_open(vmname); - - if (guest_ncpus < 1) { - fprintf(stderr, "Invalid guest vCPUs (%d)\n", guest_ncpus); - exit(1); - } max_vcpus = num_vcpus_allowed(ctx); if (guest_ncpus > max_vcpus) { Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Sun Apr 8 19:23:50 2018 (r332297) +++ head/usr.sbin/bhyvectl/bhyvectl.c Sun Apr 8 19:24:49 2018 (r332298) @@ -191,7 +191,8 @@ usage(bool cpu_intel) " [--get-msr-bitmap]\n" " [--get-msr-bitmap-address]\n" " [--get-guest-sysenter]\n" - " [--get-exit-reason]\n", + " [--get-exit-reason]\n" + " [--get-cpu-topology]\n", progname); if (cpu_intel) { @@ -285,6 +286,7 @@ static int set_x2apic_state, get_x2apic_state; enum x2apic_state x2apic_state; static int unassign_pptdev, bus, slot, func; static int run; +static int get_cpu_topology; /* * VMCB specific. @@ -1456,6 +1458,7 @@ setup_options(bool cpu_intel) { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, { "get-intinfo", NO_ARG, &get_intinfo, 1 }, + { "get-cpu-topology", NO_ARG, &get_cpu_topology, 1 }, }; const struct option intel_opts[] = { @@ -2310,6 +2313,14 @@ main(int argc, char *argv[]) printf("%-40s\t%ld\n", desc, stats[i]); } } + } + + if (!error && (get_cpu_topology || get_all)) { + uint16_t sockets, cores, threads, maxcpus; + + vm_get_topology(ctx, &sockets, &cores, &threads, &maxcpus); + printf("cpu_topology:\tsockets=%hu, cores=%hu, threads=%hu, " + "maxcpus=%hu\n", sockets, cores, threads, maxcpus); } if (!error && run) { From owner-svn-src-all@freebsd.org Sun Apr 8 19:33:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBAAAF9C699; Sun, 8 Apr 2018 19:33:05 +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 7E38871E5A; Sun, 8 Apr 2018 19:33:05 +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 793E71448E; Sun, 8 Apr 2018 19:33:05 +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 w38JX5HB095975; Sun, 8 Apr 2018 19:33:05 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38JX5fl095974; Sun, 8 Apr 2018 19:33:05 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804081933.w38JX5fl095974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 8 Apr 2018 19:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332299 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 332299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 19:33:06 -0000 Author: jhibbits Date: Sun Apr 8 19:33:05 2018 New Revision: 332299 URL: https://svnweb.freebsd.org/changeset/base/332299 Log: Fix typo Reserved cause is 6, not 5. Reported by: cem Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sun Apr 8 19:24:49 2018 (r332298) +++ head/sys/powerpc/include/spr.h Sun Apr 8 19:33:05 2018 (r332299) @@ -128,7 +128,7 @@ #define FSCR_IC_PM 0x0300000000000000ULL /* Read or write access of a Performance Monitor SPR in group A */ #define FSCR_IC_BHRB 0x0400000000000000ULL /* Execution of a BHRB Instruction */ #define FSCR_IC_HTM 0x0500000000000000ULL /* Access to a Transactional Memory */ -/* Reserved 0x0500000000000000ULL */ +/* Reserved 0x0600000000000000ULL */ #define FSCR_IC_EBB 0x0700000000000000ULL /* Access to Event-Based Branch */ #define FSCR_IC_TAR 0x0800000000000000ULL /* Access to Target Address Register */ #define FSCR_IC_STOP 0x0900000000000000ULL /* Access to the 'stop' instruction in privileged non-hypervisor state */ From owner-svn-src-all@freebsd.org Sun Apr 8 20:26:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02088FA032A; Sun, 8 Apr 2018 20:26:51 +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 AADFB6F5B1; Sun, 8 Apr 2018 20:26: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 A2E6314CE2; Sun, 8 Apr 2018 20:26: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 w38KQoH7020884; Sun, 8 Apr 2018 20:26:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KQoeC020883; Sun, 8 Apr 2018 20:26:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082026.w38KQoeC020883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332300 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 332300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:26:51 -0000 Author: emaste Date: Sun Apr 8 20:26:50 2018 New Revision: 332300 URL: https://svnweb.freebsd.org/changeset/base/332300 Log: MFC r320243 (bdrewery): Fix spelling error. Modified: stable/11/share/mk/bsd.compiler.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.compiler.mk ============================================================================== --- stable/11/share/mk/bsd.compiler.mk Sun Apr 8 19:33:05 2018 (r332299) +++ stable/11/share/mk/bsd.compiler.mk Sun Apr 8 20:26:50 2018 (r332300) @@ -9,7 +9,7 @@ # # COMPILER_VERSION is a numeric constant equal to: # major * 10000 + minor * 100 + tiny -# It too can be overriden on the command line. When testing it, be sure to +# It too can be overridden on the command line. When testing it, be sure to # make sure that you are limiting the test to a specific compiler. Testing # against 30300 for gcc likely isn't what you wanted (since versions of gcc # prior to 4.2 likely have no prayer of working). From owner-svn-src-all@freebsd.org Sun Apr 8 20:28:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 820FCFA0564; Sun, 8 Apr 2018 20:28:38 +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 31D127059F; Sun, 8 Apr 2018 20:28:38 +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 2C99414CE4; Sun, 8 Apr 2018 20:28:38 +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 w38KScc8021002; Sun, 8 Apr 2018 20:28:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KSbtT020999; Sun, 8 Apr 2018 20:28:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082028.w38KSbtT020999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332301 - in stable/11: . share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11: . share/mk X-SVN-Commit-Revision: 332301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:28:38 -0000 Author: emaste Date: Sun Apr 8 20:28:37 2018 New Revision: 332301 URL: https://svnweb.freebsd.org/changeset/base/332301 Log: MFC r328972: add retpoline compiler and linker feature flags These features indicate that the compiler and linker support the retpoline speculative execution vulnerability (CVE-2017-5715) mitigation. Modified: stable/11/Makefile.inc1 stable/11/share/mk/bsd.compiler.mk stable/11/share/mk/bsd.linker.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Sun Apr 8 20:26:50 2018 (r332300) +++ stable/11/Makefile.inc1 Sun Apr 8 20:28:37 2018 (r332301) @@ -166,11 +166,11 @@ test-system-compiler: .PHONY .if !defined(X_COMPILER_TYPE) CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ COMPILER_TYPE=${COMPILER_TYPE} \ - COMPILER_FEATURES=${COMPILER_FEATURES} \ + COMPILER_FEATURES="${COMPILER_FEATURES}" \ COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} .else CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \ - COMPILER_FEATURES=${X_COMPILER_FEATURES} \ + COMPILER_FEATURES="${X_COMPILER_FEATURES}" \ COMPILER_TYPE=${X_COMPILER_TYPE} \ COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION} .endif Modified: stable/11/share/mk/bsd.compiler.mk ============================================================================== --- stable/11/share/mk/bsd.compiler.mk Sun Apr 8 20:26:50 2018 (r332300) +++ stable/11/share/mk/bsd.compiler.mk Sun Apr 8 20:28:37 2018 (r332301) @@ -19,7 +19,9 @@ # COMPILER_FEATURES will contain one or more of the following, based on # compiler support for that feature: # -# - c++11 : supports full (or nearly full) C++11 programming environment. +# - c++11: supports full (or nearly full) C++11 programming environment. +# - retpoline: supports the retpoline speculative execution vulnerability +# mitigation. # # These variables with an X_ prefix will also be provided if XCC is set. # @@ -168,11 +170,13 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown .endif .endif +${X_}COMPILER_FEATURES= .if ${${X_}COMPILER_TYPE} == "clang" || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) -${X_}COMPILER_FEATURES= c++11 -.else -${X_}COMPILER_FEATURES= +${X_}COMPILER_FEATURES+= c++11 +.endif +.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 +${X_}COMPILER_FEATURES+= retpoline .endif .else Modified: stable/11/share/mk/bsd.linker.mk ============================================================================== --- stable/11/share/mk/bsd.linker.mk Sun Apr 8 20:26:50 2018 (r332300) +++ stable/11/share/mk/bsd.linker.mk Sun Apr 8 20:28:37 2018 (r332301) @@ -12,7 +12,9 @@ # LINKER_FEATURES may contain one or more of the following, based on # linker support for that feature: # -# - build-id : support for generating a Build-ID note +# - build-id: support for generating a Build-ID note +# - retpoline: support for generating PLT with retpoline speculative +# execution vulnerability mitigation # # These variables with an X_ prefix will also be provided if XLD is set. # @@ -72,6 +74,9 @@ ${X_}LINKER_FEATURES+= build-id .endif .if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000 ${X_}LINKER_FEATURES+= filter +.endif +.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 +${X_}LINKER_FEATURES+= retpoline .endif .endif .else From owner-svn-src-all@freebsd.org Sun Apr 8 20:30:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61D06FA08C4; Sun, 8 Apr 2018 20:30:53 +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 0F552719AF; Sun, 8 Apr 2018 20:30:53 +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 0892B14D01; Sun, 8 Apr 2018 20:30:53 +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 w38KUqam023382; Sun, 8 Apr 2018 20:30:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KUq0s023381; Sun, 8 Apr 2018 20:30:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082030.w38KUq0s023381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332302 - stable/11/usr.bin/vtfontcvt X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.bin/vtfontcvt X-SVN-Commit-Revision: 332302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:30:53 -0000 Author: emaste Date: Sun Apr 8 20:30:52 2018 New Revision: 332302 URL: https://svnweb.freebsd.org/changeset/base/332302 Log: MFC r331935: vtfontcvt: allow .bdf characters less than full height Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/11/usr.bin/vtfontcvt/vtfontcvt.c Sun Apr 8 20:28:37 2018 (r332301) +++ stable/11/usr.bin/vtfontcvt/vtfontcvt.c Sun Apr 8 20:30:52 2018 (r332302) @@ -265,10 +265,23 @@ parse_bdf(FILE *fp, unsigned int map_idx) if (strncmp(ln, "BITMAP", 6) == 0 && (ln[6] == ' ' || ln[6] == '\0')) { + /* + * Assume that the next _height_ lines are bitmap + * data. ENDCHAR is allowed to terminate the bitmap + * early but is not otherwise checked; any extra data + * is ignored. + */ for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) errx(1, "Unexpected EOF!\n"); ln[length - 1] = '\0'; + if (strcmp(ln, "ENDCHAR") == 0) { + memset(bytes + i * wbytes, 0, + (height - i) * wbytes); + memset(bytes_r + i * wbytes, 0, + (height - i) * wbytes); + break; + } sscanf(ln, "%x", &line); if (parse_bitmap_line(bytes + i * wbytes, bytes_r + i * wbytes, line, dwidth) != 0) From owner-svn-src-all@freebsd.org Sun Apr 8 20:50:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB9BBFA1E72; Sun, 8 Apr 2018 20:50:17 +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 7DA907C37C; Sun, 8 Apr 2018 20:50:17 +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 76F1315022; Sun, 8 Apr 2018 20:50:17 +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 w38KoHQH031650; Sun, 8 Apr 2018 20:50:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KoHug031646; Sun, 8 Apr 2018 20:50:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082050.w38KoHug031646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332303 - stable/11/sys/dev/ath X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/dev/ath X-SVN-Commit-Revision: 332303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:50:18 -0000 Author: emaste Date: Sun Apr 8 20:50:16 2018 New Revision: 332303 URL: https://svnweb.freebsd.org/changeset/base/332303 Log: MFC ath(4) potential memory disclosure fixes [1] r327499: ath: fix memory disclosure from ath_btcoex_ioctl The ath_btcoex_ioctl handler allocated a buffer without M_ZERO and returned it to userland without writing to it. The device has permissions only for root so this is not urgent, and the fix can be MFCd and considered for a future EN. [2] r327500: ath: fix possible memory disclosures in ioctl handlers Apply the fix from r327499 to additional ioctl handlers. [3] r327529: ath: fix possible memory disclosure in ioctl handler Submitted by: Domagoj Stolfa [1,3] Reported by: Ilja van Sprundel [1,2] Reviewed by: adrian [1] Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/dev/ath/if_ath_btcoex.c stable/11/sys/dev/ath/if_ath_ioctl.c stable/11/sys/dev/ath/if_ath_lna_div.c stable/11/sys/dev/ath/if_ath_spectral.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ath/if_ath_btcoex.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_btcoex.c Sun Apr 8 20:30:52 2018 (r332302) +++ stable/11/sys/dev/ath/if_ath_btcoex.c Sun Apr 8 20:50:16 2018 (r332303) @@ -457,7 +457,7 @@ ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -466,6 +466,7 @@ ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag switch (id) { default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; Modified: stable/11/sys/dev/ath/if_ath_ioctl.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_ioctl.c Sun Apr 8 20:30:52 2018 (r332302) +++ stable/11/sys/dev/ath/if_ath_ioctl.c Sun Apr 8 20:50:16 2018 (r332303) @@ -197,7 +197,7 @@ ath_ioctl_diag(struct ath_softc *sc, struct ath_diag * * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; Modified: stable/11/sys/dev/ath/if_ath_lna_div.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_lna_div.c Sun Apr 8 20:30:52 2018 (r332302) +++ stable/11/sys/dev/ath/if_ath_lna_div.c Sun Apr 8 20:50:16 2018 (r332303) @@ -187,7 +187,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_dia * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -196,6 +196,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_dia switch (id) { default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; Modified: stable/11/sys/dev/ath/if_ath_spectral.c ============================================================================== --- stable/11/sys/dev/ath/if_ath_spectral.c Sun Apr 8 20:30:52 2018 (r332302) +++ stable/11/sys/dev/ath/if_ath_spectral.c Sun Apr 8 20:50:16 2018 (r332303) @@ -212,7 +212,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_di * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -275,6 +275,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_di break; default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; From owner-svn-src-all@freebsd.org Sun Apr 8 20:52:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D6FAFA21E4; Sun, 8 Apr 2018 20:52: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 2E0437D62D; Sun, 8 Apr 2018 20:52: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 28FAD15195; Sun, 8 Apr 2018 20:52: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 w38KqAfT036126; Sun, 8 Apr 2018 20:52:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38Kq9P0036124; Sun, 8 Apr 2018 20:52:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082052.w38Kq9P0036124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332304 - in stable/11/sys/x86: isa x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11/sys/x86: isa x86 X-SVN-Commit-Revision: 332304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:52:10 -0000 Author: emaste Date: Sun Apr 8 20:52:09 2018 New Revision: 332304 URL: https://svnweb.freebsd.org/changeset/base/332304 Log: MFC r331082: ANSIfy sys/x86 Modified: stable/11/sys/x86/isa/isa_dma.c stable/11/sys/x86/x86/autoconf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/isa/isa_dma.c ============================================================================== --- stable/11/sys/x86/isa/isa_dma.c Sun Apr 8 20:50:16 2018 (r332303) +++ stable/11/sys/x86/isa/isa_dma.c Sun Apr 8 20:52:09 2018 (r332304) @@ -144,8 +144,7 @@ isa_dma_init(int chan, u_int bouncebufsize, int flag) * in open() or during its initialization. */ int -isa_dma_acquire(chan) - int chan; +isa_dma_acquire(int chan) { #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) @@ -170,8 +169,7 @@ isa_dma_acquire(chan) * during close() or during its shutdown. */ void -isa_dma_release(chan) - int chan; +isa_dma_release(int chan) { #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) @@ -205,8 +203,7 @@ isa_dma_release(chan) * external dma control by a board. */ void -isa_dmacascade(chan) - int chan; +isa_dmacascade(int chan) { #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) Modified: stable/11/sys/x86/x86/autoconf.c ============================================================================== --- stable/11/sys/x86/x86/autoconf.c Sun Apr 8 20:50:16 2018 (r332303) +++ stable/11/sys/x86/x86/autoconf.c Sun Apr 8 20:52:09 2018 (r332304) @@ -90,8 +90,7 @@ SYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, co * Determine i/o configuration for a machine. */ static void -configure_first(dummy) - void *dummy; +configure_first(void *dummy) { /* nexus0 is the top of the x86 device tree */ @@ -99,8 +98,7 @@ configure_first(dummy) } static void -configure(dummy) - void *dummy; +configure(void *dummy) { /* initialize new bus architecture */ @@ -117,8 +115,7 @@ configure(dummy) } static void -configure_final(dummy) - void *dummy; +configure_final(void *dummy) { cninit_finish(); From owner-svn-src-all@freebsd.org Sun Apr 8 20:53:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E56D5FA22F7; Sun, 8 Apr 2018 20:53:01 +0000 (UTC) (envelope-from gonzo@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 96DA87DE47; Sun, 8 Apr 2018 20:53:01 +0000 (UTC) (envelope-from gonzo@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 90593151B2; Sun, 8 Apr 2018 20:53:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38Kr1M8036203; Sun, 8 Apr 2018 20:53:01 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38Kr12X036199; Sun, 8 Apr 2018 20:53:01 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804082053.w38Kr12X036199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Apr 2018 20:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332305 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 332305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:53:02 -0000 Author: gonzo Date: Sun Apr 8 20:53:00 2018 New Revision: 332305 URL: https://svnweb.freebsd.org/changeset/base/332305 Log: Document ofw_bus_subr helpers "compatible" and "status" properties Add documentation for following functions: - ofw_bus_is_compatible - ofw_bus_is_compatible_strict - ofw_bus_node_is_compatible - ofw_bus_search_compatible - ofw_bus_get_status - ofw_bus_status_okay - ofw_bus_node_status_okay MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14724 Added: head/share/man/man9/ofw_bus_is_compatible.9 (contents, props changed) head/share/man/man9/ofw_bus_status_okay.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Apr 8 20:52:09 2018 (r332304) +++ head/share/man/man9/Makefile Sun Apr 8 20:53:00 2018 (r332305) @@ -208,6 +208,8 @@ MAN= accept_filter.9 \ namei.9 \ netisr.9 \ nv.9 \ + ofw_bus_is_compatible.9 \ + ofw_bus_status_okay.9 \ osd.9 \ owll.9 \ own.9 \ @@ -1525,6 +1527,11 @@ MLINKS+=nv.9 libnv.9 \ nv.9 nvlist_take_string_array.9 \ nv.9 nvlist_unpack.9 \ nv.9 nvlist_xfer.9 +MLINKS+=ofw_bus_is_compatible.9 ofw_bus_is_compatible_strict.9 \ + ofw_bus_is_compatible.9 ofw_bus_node_is_compatible.9 \ + ofw_bus_is_compatible.9 ofw_bus_search_compatible.9 +MLINKS+= ofw_bus_status_okay.9 ofw_bus_get_status.9 \ + ofw_bus_status_okay.9 ofw_bus_node_status_okay.9 MLINKS+=osd.9 osd_call.9 \ osd.9 osd_del.9 \ osd.9 osd_deregister.9 \ Added: head/share/man/man9/ofw_bus_is_compatible.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/ofw_bus_is_compatible.9 Sun Apr 8 20:53:00 2018 (r332305) @@ -0,0 +1,147 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 8, 2018 +.Dt ofw_bus_is_compatible 9 +.Os +.Sh NAME +.Nm ofw_bus_is_compatible +.Nm ofw_bus_is_compatible_strict +.Nm ofw_bus_node_is_compatible +.Nm ofw_bus_search_compatible +.Nd check device tree nodes for compatibility with drivers +.Sh SYNOPSIS +.In dev/ofw/openfirm.h +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft int +.Fn ofw_bus_is_compatible "device_t dev" "const char *compatstr" +.Ft int +.Fn ofw_bus_is_compatible_strict "device_t dev" "const char *compatstr" +.Ft int +.Fn ofw_bus_node_is_compatible "phandle_t node" "const char *compatstr" +.Ft const struct ofw_compat_data * +.Fn ofw_bus_search_compatible "device_t dev" "const struct ofw_compat_data *compat" +.Sh DESCRIPTION +.Pp +The "compatible" property of the device tree node is used to +identify the type of the device the node represents. +The property is a list of one or more strings that represent +hardware types the device is compatible with. +The common format for such strings is "vendor,hardware" +where "vendor" is an abbreviated name of the manufacturer +and "hardware" is a device identifier, for instance, "fsl" +for "Freescale" and "imx6ul-i2c" for the I2C controller. +More than one string is required for compatibility with +older revisions of the driver. +If hardware revision B is backward compatible with revision +A device tree node can signal this compatibility by +providing both "vndr,hrdwrA" and "vndr,hrdwrB" strings in +the "compatibile" property value. +This way older driver can use features available only in +revision A, and the new version of the driver can take +advantage of revision B feature set. +.Pp +.Fn ofw_bus_is_compatible +returns 1 if the +.Fa compatstr +value occurs in the "compatible" property list of the device +tree node associated with the device +.Fa dev , +and 0 otherwise. +.Pp +.Fn ofw_bus_is_compatible_strict +return 1 if the "compatible" +property of the device tree node associated with the device +.Fa dev +consists of only one string and this string is equal to +.Fa compatstr , +and 0 otherwise. +.Pp +.Fn ofw_bus_node_is_compatible +returns 1 if the +.Fa compatstr +value occurs in the "compatible" property list of the device +tree node +.Fa node , +and 0 otherwise. +.Pp +.Fn ofw_bus_search_compatible +returns pointer to the first entry of the +.Fa compat +table whose ocd_str field occurs in "compatible" property of +the device tree node associated with the device +.Fa dev . +The +.Fa compat +table is an array of struct ofw_compat_data elements defined as follows: +.Bd -literal -offset indent +struct ofw_compat_data { + const char *ocd_str; + uintptr_t ocd_data; +}; +.Ed +The +.Fa compat +table must be terminated by the entry with ocd_str set to NULL. +If the device tree node is not compatible with any of +the entries, the function returns the pointer to the +terminating entry. +.Sh EXAMPLES +.Bd -literal -offset indent +static struct ofw_compat_data compat_data[] = { + {"arm,hrdwrA", FEATURE_A}, + {"arm,hrdwrB", FEATURE_A | FEATURE_B}, + {NULL, 0} +}; + +static int +hrdwr_probe(device_t dev) +{ + ... + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + ... +} + +static int +hrdwr_attach(device_t dev) +{ + ... + sc = device_get_softc(dev); + sc->sc_features = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + ... +} +.Ed +.Sh SEE ALSO +.Xr ofw_bus_find_compatible 9 +.Sh AUTHORS +This manual page was written by +.An Oleksandr Tymoshenko . Added: head/share/man/man9/ofw_bus_status_okay.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/ofw_bus_status_okay.9 Sun Apr 8 20:53:00 2018 (r332305) @@ -0,0 +1,77 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 8, 2018 +.Dt ofw_bus_status_okay 9 +.Os +.Sh NAME +.Nm ofw_bus_get_status +.Nm ofw_bus_status_okay +.Nm ofw_bus_node_status_okay +.Nd check status of the device tree node +.Sh SYNOPSIS +.In dev/ofw/openfirm.h +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft const char * +.Fn ofw_bus_get_status "device_t dev" +.Ft int +.Fn ofw_bus_status_okay "device_t dev" +.Ft int +.Fn ofw_bus_node_status_okay "phandle_t node" +.Sh DESCRIPTION +.Pp +The "status" property of the device tree node indicates whether the device is +enabled or not. +Multiple hardware versions might be built using the same base System-on-Chip +but with a different set of blocks enabled. +It is common to use SoC device tree and only enable/disable device nodes for +the derivative boards. +The device tree node is considered enabled only if it has "status" property +with the value set to either "ok" or "okay". +.Pp +.Fn ofw_bus_get_status +returns the value of the "status" property of the device tree node associated with the device +.Fa dev . +If the node does not have "status" property or there is no node associated with +the device the function returns NULL. +.Pp +.Fn ofw_bus_status_okay +returns 1 if the device tree node associated with the device +.Fa dev +has "status" property and its value is either "ok" or "okay". +.Pp +.Fn ofw_bus_node_status_okay +returns 1 if the device tree node +.Fa node +has "status" property and its value is either "ok" or "okay". +.Sh AUTHORS +This manual page was written by +.An Oleksandr Tymoshenko . From owner-svn-src-all@freebsd.org Sun Apr 8 20:54:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44D4DFA24E5; Sun, 8 Apr 2018 20:54:14 +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 DD3827E9CC; Sun, 8 Apr 2018 20:54:13 +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 D6169151C4; Sun, 8 Apr 2018 20:54:13 +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 w38KsDOt036301; Sun, 8 Apr 2018 20:54:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KsDeB036297; Sun, 8 Apr 2018 20:54:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082054.w38KsDeB036297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332306 - in stable/11: sys/conf tools/build/options X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11: sys/conf tools/build/options X-SVN-Commit-Revision: 332306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:54:14 -0000 Author: emaste Date: Sun Apr 8 20:54:13 2018 New Revision: 332306 URL: https://svnweb.freebsd.org/changeset/base/332306 Log: MFC r330110: Add kernel retpoline option for amd64 Retpoline is a compiler-based mitigation for CVE-2017-5715, also known as Spectre V2, that protects against speculative execution branch target injection attacks. In this commit it is disabled by default, but will be changed in a followup commit. MFC r330962: Remove KERNEL_RETPOLINE from BROKEN_OPTIONS on i386 Clang will compile both amd64 and i386 with retpoline. Sponsored by: The FreeBSD Foundation Added: stable/11/tools/build/options/WITHOUT_KERNEL_RETPOLINE - copied unchanged from r330110, head/tools/build/options/WITHOUT_KERNEL_RETPOLINE stable/11/tools/build/options/WITH_KERNEL_RETPOLINE - copied unchanged from r330110, head/tools/build/options/WITH_KERNEL_RETPOLINE Modified: stable/11/sys/conf/kern.mk stable/11/sys/conf/kern.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kern.mk ============================================================================== --- stable/11/sys/conf/kern.mk Sun Apr 8 20:53:00 2018 (r332305) +++ stable/11/sys/conf/kern.mk Sun Apr 8 20:54:13 2018 (r332306) @@ -192,7 +192,7 @@ CFLAGS+= -ffreestanding # gcc and clang opimizers take advantage of this. The kernel makes # use of signed integer wraparound mechanics so we need the compiler # to treat it as a wraparound and not take shortcuts. -# +# CFLAGS+= -fwrapv # @@ -201,6 +201,14 @@ CFLAGS+= -fwrapv .if ${MK_SSP} != "no" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" CFLAGS+= -fstack-protector +.endif + +# +# Retpoline speculative execution vulnerability mitigation (CVE-2017-5715) +# +.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Mretpoline} != "" && \ + ${MK_KERNEL_RETPOLINE} != "no" +CFLAGS+= -mretpoline .endif # Modified: stable/11/sys/conf/kern.opts.mk ============================================================================== --- stable/11/sys/conf/kern.opts.mk Sun Apr 8 20:53:00 2018 (r332305) +++ stable/11/sys/conf/kern.opts.mk Sun Apr 8 20:54:13 2018 (r332306) @@ -48,6 +48,7 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ EISA \ EXTRA_TCP_STACKS \ + KERNEL_RETPOLINE \ NAND \ OFED \ REPRODUCIBLE_BUILD @@ -83,6 +84,11 @@ BROKEN_OPTIONS+= EISA .if ${MACHINE} != "i386" && ${MACHINE} != "amd64" BROKEN_OPTIONS+= OFED +.endif + +# Things that don't work based on toolchain support. +.if ${MACHINE} != "i386" && ${MACHINE} != "amd64" +BROKEN_OPTIONS+= KERNEL_RETPOLINE .endif # expanded inline from bsd.mkopt.mk to avoid share/mk dependency Copied: stable/11/tools/build/options/WITHOUT_KERNEL_RETPOLINE (from r330110, head/tools/build/options/WITHOUT_KERNEL_RETPOLINE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITHOUT_KERNEL_RETPOLINE Sun Apr 8 20:54:13 2018 (r332306, copy of r330110, head/tools/build/options/WITHOUT_KERNEL_RETPOLINE) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to disable the "retpoline" mitigation for CVE-2017-5715 in the kernel +build. Copied: stable/11/tools/build/options/WITH_KERNEL_RETPOLINE (from r330110, head/tools/build/options/WITH_KERNEL_RETPOLINE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITH_KERNEL_RETPOLINE Sun Apr 8 20:54:13 2018 (r332306, copy of r330110, head/tools/build/options/WITH_KERNEL_RETPOLINE) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to enable the "retpoline" mitigation for CVE-2017-5715 in the kernel +build. From owner-svn-src-all@freebsd.org Sun Apr 8 20:58:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31382FA292B; Sun, 8 Apr 2018 20:58:14 +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 D0DB880CBC; Sun, 8 Apr 2018 20:58:13 +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 C69ED151CA; Sun, 8 Apr 2018 20:58:13 +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 w38KwDwO036521; Sun, 8 Apr 2018 20:58:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38KwDne036520; Sun, 8 Apr 2018 20:58:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804082058.w38KwDne036520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 8 Apr 2018 20:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332307 - stable/11/share/man/man5 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/share/man/man5 X-SVN-Commit-Revision: 332307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 20:58:14 -0000 Author: emaste Date: Sun Apr 8 20:58:13 2018 New Revision: 332307 URL: https://svnweb.freebsd.org/changeset/base/332307 Log: Regen src.conf.5 after r332306 (WITH_KERNEL_RETPOLINE MFC) Modified: stable/11/share/man/man5/src.conf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Sun Apr 8 20:54:13 2018 (r332306) +++ stable/11/share/man/man5/src.conf.5 Sun Apr 8 20:58:13 2018 (r332307) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 6, 2018 +.Dd April 8, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -870,6 +870,9 @@ Set to build some programs without Kerberos support, l .Xr sshd 8 , and .Xr telnetd 8 . +.It Va WITH_KERNEL_RETPOLINE +Set to enable the "retpoline" mitigation for CVE-2017-5715 in the kernel +build. .It Va WITHOUT_KERNEL_SYMBOLS Set to not install kernel symbol files. .Bf -symbolic From owner-svn-src-all@freebsd.org Sun Apr 8 21:31:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19647F81BF0; Sun, 8 Apr 2018 21:31:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AADB73E46; Sun, 8 Apr 2018 21:31:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x241.google.com with SMTP id z23so7096518qti.5; Sun, 08 Apr 2018 14:31:46 -0700 (PDT) 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=altA39wFAls7sHkx5MSV0COyhUiux9zMIqTG2cJq6JU=; b=qKo9bsgk7XTowvmtEoWAlIEqjvFRDs6CZI8VkVwRYjwvdZw9S3LE4EljijAfMcg3Qr IzaAtgoRFs5GQ822zf3AY+b29h0w3NEQ8I0sgV17yb5CoK+I1+ePCchg/Z13+Wduno0X niuVLePvj8QQ0mL1rmfY2gAa5LJ3r3VZ8T08hsJHbUh04lxte997FgERJ2YftuhLXwQp WaNsGZMFeIZkiSKAUzsE2Nei5T7N6l/7bEbOLWDDsTWJRhVvfaNgFGM01iZztGOGkeIr 8k0aMRk991ANQEaotCLwoSCcLFgR6LCYX//MCD1UJ1JSlhhNNTziPT8+nq+dZseL+UK+ JOHA== 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=altA39wFAls7sHkx5MSV0COyhUiux9zMIqTG2cJq6JU=; b=iY2/QLm3N2XWpceRiO5ZzI1dJkJMJlNrnAM/6CROl1ZFY6ed2tCXzw9AOY75piTUv7 6Dhqfj8vL3wMyeyXG/1pW8IlgW0rK8J7czpoJqwYxBPoNdmECbSvghqCIbjBPmoPETKV jPdlQfm/wVCBsuAZd9yzUw1YOiPVNo7rbsV59I5EsxxwOjRhuPpcCBoQFnVYRERCcIoO z0xlbQOvxk3DKGeDMvFMouWfi8FT+yKhDnlsirZnxAm/6S2fSCiE7kknRNeAwahFlAMr oRakgle2zWV1QFWqu3uxqGEB2ujwBMnLhlWQBPMWvYiFjlX34j2vLqxZwFjrzs4kdmyV 2IjQ== X-Gm-Message-State: ALQs6tBT5xwnixkvw8LzVdXk/lasVsCL8CU8Ecml529teZLg/O2Fq6eu U26/riK2JzsSBMKsA0gi1dHdoBk6yW3BXqfnllpsNg== X-Google-Smtp-Source: AIpwx48v45y4yKmXbGXpvDdARs7Xraz5drBZ/Jxp3I8JzMqQpUMibQeiAAt6AE0pkpFT6LFMHnKrO+BzbJ/sRhBYWJc= X-Received: by 10.200.67.4 with SMTP id z4mr47454137qtm.196.1523223106247; Sun, 08 Apr 2018 14:31:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.36.52 with HTTP; Sun, 8 Apr 2018 14:31:45 -0700 (PDT) In-Reply-To: References: <201804081634.w38GYA8N097150@repo.freebsd.org> From: Mateusz Guzik Date: Sun, 8 Apr 2018 23:31:45 +0200 Message-ID: Subject: Re: svn commit: r332285 - head/sys/kern To: Steven Hartland Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 21:31:47 -0000 On Sun, Apr 8, 2018 at 9:06 PM, Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > Worth making the sysctls so they can be tuned the the HW / use case? > they already are, see: sysctl debug.mtx debug.mtx_spin debug.rwlock debug.sx -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sun Apr 8 21:56:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 009B9F83B3F; Sun, 8 Apr 2018 21:56:36 +0000 (UTC) (envelope-from pfg@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 A2A218193D; Sun, 8 Apr 2018 21:56:35 +0000 (UTC) (envelope-from pfg@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 9AA9915BD8; Sun, 8 Apr 2018 21:56:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38LuZws066747; Sun, 8 Apr 2018 21:56:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38LuZNW066746; Sun, 8 Apr 2018 21:56:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201804082156.w38LuZNW066746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 8 Apr 2018 21:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332308 - stable/11/include X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/include X-SVN-Commit-Revision: 332308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 21:56:36 -0000 Author: pfg Date: Sun Apr 8 21:56:35 2018 New Revision: 332308 URL: https://svnweb.freebsd.org/changeset/base/332308 Log: MFC r331969, r332035: pthread.h: drop nullability attributes. These have been found to be practically useless. We were actually following the Android bionic library and had some interest in replicating the same warnings and behaviour but Android has since removed them. We are still keeping some uses of nullability attributes in other headers, somewhat in line with Apple's libc. Hinted by: bionic (git 3f66e74b903905e763e104396aff52a81718cfde) Modified: stable/11/include/pthread.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/pthread.h ============================================================================== --- stable/11/include/pthread.h Sun Apr 8 20:58:13 2018 (r332307) +++ stable/11/include/pthread.h Sun Apr 8 21:56:35 2018 (r332308) @@ -46,8 +46,6 @@ #include #include -__NULLABILITY_PRAGMA_PUSH - /* * Run-time invariant values: */ @@ -149,35 +147,33 @@ struct _pthread_cleanup_info { */ __BEGIN_DECLS int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); -int pthread_attr_destroy(pthread_attr_t * _Nonnull); +int pthread_attr_destroy(pthread_attr_t *); int pthread_attr_getstack( - const pthread_attr_t * _Nonnull __restrict, - void ** _Nonnull __restrict, - size_t * _Nonnull __restrict); -int pthread_attr_getstacksize(const pthread_attr_t * _Nonnull, - size_t * _Nonnull); -int pthread_attr_getguardsize(const pthread_attr_t * _Nonnull, - size_t * _Nonnull); + const pthread_attr_t * __restrict, void ** __restrict, + size_t * __restrict); +int pthread_attr_getstacksize(const pthread_attr_t *, + size_t *); +int pthread_attr_getguardsize(const pthread_attr_t *, + size_t *); int pthread_attr_getstackaddr(const pthread_attr_t *, void **); -int pthread_attr_getdetachstate(const pthread_attr_t * _Nonnull, - int * _Nonnull); -int pthread_attr_init(pthread_attr_t * _Nonnull); -int pthread_attr_setstacksize(pthread_attr_t * _Nonnull, size_t); -int pthread_attr_setguardsize(pthread_attr_t * _Nonnull, size_t); -int pthread_attr_setstack(pthread_attr_t * _Nonnull, void *, +int pthread_attr_getdetachstate(const pthread_attr_t *, + int *); +int pthread_attr_init(pthread_attr_t *); +int pthread_attr_setstacksize(pthread_attr_t *, size_t); +int pthread_attr_setguardsize(pthread_attr_t *, size_t); +int pthread_attr_setstack(pthread_attr_t *, void *, size_t); int pthread_attr_setstackaddr(pthread_attr_t *, void *); -int pthread_attr_setdetachstate(pthread_attr_t * _Nonnull, int); -int pthread_barrier_destroy(pthread_barrier_t * _Nonnull); -int pthread_barrier_init(pthread_barrier_t * _Nonnull, +int pthread_attr_setdetachstate(pthread_attr_t *, int); +int pthread_barrier_destroy(pthread_barrier_t *); +int pthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *, unsigned); -int pthread_barrier_wait(pthread_barrier_t * _Nonnull); -int pthread_barrierattr_destroy(pthread_barrierattr_t * _Nonnull); +int pthread_barrier_wait(pthread_barrier_t *); +int pthread_barrierattr_destroy(pthread_barrierattr_t *); int pthread_barrierattr_getpshared( - const pthread_barrierattr_t * _Nonnull, int * _Nonnull); -int pthread_barrierattr_init(pthread_barrierattr_t * _Nonnull); -int pthread_barrierattr_setpshared(pthread_barrierattr_t * _Nonnull, - int); + const pthread_barrierattr_t *, int *); +int pthread_barrierattr_init(pthread_barrierattr_t *); +int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ { \ @@ -192,108 +188,99 @@ int pthread_barrierattr_setpshared(pthread_barrieratt __pthread_cleanup_pop_imp(execute); \ } -int pthread_condattr_destroy(pthread_condattr_t * _Nonnull); -int pthread_condattr_getclock(const pthread_condattr_t * _Nonnull, - clockid_t * _Nonnull); -int pthread_condattr_getpshared(const pthread_condattr_t * _Nonnull, - int * _Nonnull); -int pthread_condattr_init(pthread_condattr_t * _Nonnull); -int pthread_condattr_setclock(pthread_condattr_t * _Nonnull, - clockid_t); -int pthread_condattr_setpshared(pthread_condattr_t * _Nonnull, int); -int pthread_cond_broadcast(pthread_cond_t * _Nonnull); -int pthread_cond_destroy(pthread_cond_t * _Nonnull); -int pthread_cond_init(pthread_cond_t * _Nonnull, - const pthread_condattr_t *); -int pthread_cond_signal(pthread_cond_t * _Nonnull); -int pthread_cond_timedwait(pthread_cond_t * _Nonnull, - pthread_mutex_t * _Nonnull __mutex, - const struct timespec * _Nonnull) +int pthread_condattr_destroy(pthread_condattr_t *); +int pthread_condattr_getclock(const pthread_condattr_t *, + clockid_t *); +int pthread_condattr_getpshared(const pthread_condattr_t *, int *); +int pthread_condattr_init(pthread_condattr_t *); +int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); +int pthread_condattr_setpshared(pthread_condattr_t *, int); +int pthread_cond_broadcast(pthread_cond_t *); +int pthread_cond_destroy(pthread_cond_t *); +int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); +int pthread_cond_signal(pthread_cond_t *); +int pthread_cond_timedwait(pthread_cond_t *, + pthread_mutex_t * __mutex, + const struct timespec *) __requires_exclusive(*__mutex); -int pthread_cond_wait(pthread_cond_t * _Nonnull, - pthread_mutex_t * _Nonnull __mutex) +int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); -int pthread_create(pthread_t * _Nonnull, const pthread_attr_t *, - void *(* _Nonnull) (void *), void *); +int pthread_create(pthread_t *, const pthread_attr_t *, + void *(*) (void *), void *); int pthread_detach(pthread_t); int pthread_equal(pthread_t, pthread_t); void pthread_exit(void *) __dead2; void *pthread_getspecific(pthread_key_t); -int pthread_getcpuclockid(pthread_t, clockid_t * _Nonnull); +int pthread_getcpuclockid(pthread_t, clockid_t *); int pthread_join(pthread_t, void **); -int pthread_key_create(pthread_key_t * _Nonnull, - void (*) (void *)); +int pthread_key_create(pthread_key_t *, void (*) (void *)); int pthread_key_delete(pthread_key_t); -int pthread_mutexattr_init(pthread_mutexattr_t * _Nonnull); -int pthread_mutexattr_destroy(pthread_mutexattr_t * _Nonnull); -int pthread_mutexattr_getpshared( - const pthread_mutexattr_t * _Nonnull, int * _Nonnull); -int pthread_mutexattr_gettype(pthread_mutexattr_t * _Nonnull, - int * _Nonnull); -int pthread_mutexattr_settype(pthread_mutexattr_t * _Nonnull, int); -int pthread_mutexattr_setpshared(pthread_mutexattr_t * _Nonnull, - int); -int pthread_mutex_consistent(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutexattr_init(pthread_mutexattr_t *); +int pthread_mutexattr_destroy(pthread_mutexattr_t *); +int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, + int *); +int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *); +int pthread_mutexattr_settype(pthread_mutexattr_t *, int); +int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); +int pthread_mutex_consistent(pthread_mutex_t * __mutex) __requires_exclusive(*__mutex); -int pthread_mutex_destroy(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_destroy(pthread_mutex_t * __mutex) __requires_unlocked(*__mutex); -int pthread_mutex_init(pthread_mutex_t * _Nonnull __mutex, +int pthread_mutex_init(pthread_mutex_t * __mutex, const pthread_mutexattr_t *) __requires_unlocked(*__mutex); -int pthread_mutex_lock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_lock(pthread_mutex_t * __mutex) __locks_exclusive(*__mutex); -int pthread_mutex_trylock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_trylock(pthread_mutex_t * __mutex) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_timedlock(pthread_mutex_t * _Nonnull __mutex, - const struct timespec * _Nonnull) +int pthread_mutex_timedlock(pthread_mutex_t * __mutex, + const struct timespec *) __trylocks_exclusive(0, *__mutex); -int pthread_mutex_unlock(pthread_mutex_t * _Nonnull __mutex) +int pthread_mutex_unlock(pthread_mutex_t * __mutex) __unlocks(*__mutex); -int pthread_once(pthread_once_t * _Nonnull, - void (* _Nonnull) (void)); -int pthread_rwlock_destroy(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_once(pthread_once_t *, void (*) (void)); +int pthread_rwlock_destroy(pthread_rwlock_t * __rwlock) __requires_unlocked(*__rwlock); -int pthread_rwlock_init(pthread_rwlock_t * _Nonnull __rwlock, +int pthread_rwlock_init(pthread_rwlock_t * __rwlock, const pthread_rwlockattr_t *) __requires_unlocked(*__rwlock); -int pthread_rwlock_rdlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_rdlock(pthread_rwlock_t * __rwlock) __locks_shared(*__rwlock); -int pthread_rwlock_timedrdlock(pthread_rwlock_t * _Nonnull __rwlock, - const struct timespec * _Nonnull) +int pthread_rwlock_timedrdlock(pthread_rwlock_t * __rwlock, + const struct timespec *) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_timedwrlock(pthread_rwlock_t * _Nonnull __rwlock, - const struct timespec * _Nonnull) +int pthread_rwlock_timedwrlock(pthread_rwlock_t * __rwlock, + const struct timespec *) __trylocks_exclusive(0, *__rwlock); -int pthread_rwlock_tryrdlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_tryrdlock(pthread_rwlock_t * __rwlock) __trylocks_shared(0, *__rwlock); -int pthread_rwlock_trywrlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_trywrlock(pthread_rwlock_t * __rwlock) __trylocks_exclusive(0, *__rwlock); -int pthread_rwlock_unlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_unlock(pthread_rwlock_t * __rwlock) __unlocks(*__rwlock); -int pthread_rwlock_wrlock(pthread_rwlock_t * _Nonnull __rwlock) +int pthread_rwlock_wrlock(pthread_rwlock_t * __rwlock) __locks_exclusive(*__rwlock); -int pthread_rwlockattr_destroy(pthread_rwlockattr_t * _Nonnull); -int pthread_rwlockattr_getkind_np( - const pthread_rwlockattr_t * _Nonnull, int *); -int pthread_rwlockattr_getpshared( - const pthread_rwlockattr_t * _Nonnull, int * _Nonnull); -int pthread_rwlockattr_init(pthread_rwlockattr_t * _Nonnull); -int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t * _Nonnull, +int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); +int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *, + int *); +int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, + int *); +int pthread_rwlockattr_init(pthread_rwlockattr_t *); +int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int); -int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * _Nonnull, - int); +int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); -int pthread_spin_init(pthread_spinlock_t * _Nonnull __spin, int) +int pthread_spin_init(pthread_spinlock_t * __spin, int) __requires_unlocked(*__spin); -int pthread_spin_destroy(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_destroy(pthread_spinlock_t * __spin) __requires_unlocked(*__spin); -int pthread_spin_lock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_lock(pthread_spinlock_t * __spin) __locks_exclusive(*__spin); -int pthread_spin_trylock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_trylock(pthread_spinlock_t * __spin) __trylocks_exclusive(0, *__spin); -int pthread_spin_unlock(pthread_spinlock_t * _Nonnull __spin) +int pthread_spin_unlock(pthread_spinlock_t * __spin) __unlocks(*__spin); int pthread_cancel(pthread_t); int pthread_setcancelstate(int, int *); @@ -315,27 +302,23 @@ int pthread_mutexattr_getprotocol(pthread_mutexattr_t int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); int pthread_mutexattr_getrobust( - pthread_mutexattr_t * _Nonnull __restrict, - int * _Nonnull __restrict); -int pthread_mutexattr_setrobust(pthread_mutexattr_t * _Nonnull, - int); + pthread_mutexattr_t * __restrict, int * __restrict); +int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int); int pthread_attr_getinheritsched(const pthread_attr_t *, int *); -int pthread_attr_getschedparam(const pthread_attr_t * _Nonnull, - struct sched_param * _Nonnull); -int pthread_attr_getschedpolicy(const pthread_attr_t * _Nonnull, - int * _Nonnull); -int pthread_attr_getscope(const pthread_attr_t * _Nonnull, - int * _Nonnull); +int pthread_attr_getschedparam(const pthread_attr_t *, + struct sched_param *); +int pthread_attr_getschedpolicy(const pthread_attr_t *, int *); +int pthread_attr_getscope(const pthread_attr_t *, int *); int pthread_attr_setinheritsched(pthread_attr_t *, int); -int pthread_attr_setschedparam(pthread_attr_t * _Nonnull, - const struct sched_param * _Nonnull); -int pthread_attr_setschedpolicy(pthread_attr_t * _Nonnull, int); -int pthread_attr_setscope(pthread_attr_t * _Nonnull, int); -int pthread_getschedparam(pthread_t pthread, int * _Nonnull, - struct sched_param * _Nonnull); +int pthread_attr_setschedparam(pthread_attr_t *, + const struct sched_param *); +int pthread_attr_setschedpolicy(pthread_attr_t *, int); +int pthread_attr_setscope(pthread_attr_t *, int); +int pthread_getschedparam(pthread_t pthread, int *, + struct sched_param *); int pthread_setschedparam(pthread_t, int, - const struct sched_param * _Nonnull); + const struct sched_param *); #if __XSI_VISIBLE int pthread_getconcurrency(void); int pthread_setconcurrency(int); @@ -345,6 +328,5 @@ void __pthread_cleanup_push_imp(void (*)(void *), voi struct _pthread_cleanup_info *); void __pthread_cleanup_pop_imp(int); __END_DECLS -__NULLABILITY_PRAGMA_POP #endif /* !_PTHREAD_H_ */ From owner-svn-src-all@freebsd.org Sun Apr 8 22:07:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C17B2F847CE; Sun, 8 Apr 2018 22:07:07 +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 713FB87793; Sun, 8 Apr 2018 22:07:07 +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 6BC3115D7A; Sun, 8 Apr 2018 22:07:07 +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 w38M77t8071635; Sun, 8 Apr 2018 22:07:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38M77sN071634; Sun, 8 Apr 2018 22:07:07 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201804082207.w38M77sN071634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 8 Apr 2018 22:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332309 - head/sys/dev/fdt X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/fdt X-SVN-Commit-Revision: 332309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 22:07:08 -0000 Author: andrew Date: Sun Apr 8 22:07:06 2018 New Revision: 332309 URL: https://svnweb.freebsd.org/changeset/base/332309 Log: Replace calls to fdt_is_compatible with ofw_bus_node_is_compatible. These are almost identical so there is no need to keep the former around. Sponsored by: DARPA, AFRL Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sun Apr 8 21:56:35 2018 (r332308) +++ head/sys/dev/fdt/fdt_common.c Sun Apr 8 22:07:06 2018 (r332309) @@ -71,8 +71,6 @@ vm_offset_t fdt_immr_size; struct fdt_ic_list fdt_ic_list_head = SLIST_HEAD_INITIALIZER(fdt_ic_list_head); -static int fdt_is_compatible(phandle_t, const char *); - static int fdt_get_range_by_busaddr(phandle_t node, u_long addr, u_long *base, u_long *size) @@ -215,7 +213,7 @@ fdt_immr_addr(vm_offset_t immr_va) * Try to access the SOC node directly i.e. through /aliases/. */ if ((node = OF_finddevice("soc")) != -1) - if (fdt_is_compatible(node, "simple-bus")) + if (ofw_bus_node_is_compatible(node, "simple-bus")) goto moveon; /* * Find the node the long way. @@ -236,45 +234,6 @@ moveon: return (r); } -/* - * This routine is an early-usage version of the ofw_bus_is_compatible() when - * the ofw_bus I/F is not available (like early console routines and similar). - * Note the buffer has to be on the stack since malloc() is usually not - * available in such cases either. - */ -static int -fdt_is_compatible(phandle_t node, const char *compatstr) -{ - char buf[FDT_COMPAT_LEN]; - char *compat; - int len, onelen, l, rv; - - if ((len = OF_getproplen(node, "compatible")) <= 0) - return (0); - - compat = (char *)&buf; - bzero(compat, FDT_COMPAT_LEN); - - if (OF_getprop(node, "compatible", compat, FDT_COMPAT_LEN) < 0) - return (0); - - onelen = strlen(compatstr); - rv = 0; - while (len > 0) { - if (strncasecmp(compat, compatstr, onelen) == 0) { - /* Found it. */ - rv = 1; - break; - } - /* Slide to the next sub-string. */ - l = strlen(compat) + 1; - compat += l; - len -= l; - } - - return (rv); -} - int fdt_is_compatible_strict(phandle_t node, const char *compatible) { @@ -303,7 +262,7 @@ fdt_find_compatible(phandle_t start, const char *compa * matching 'compatible' property. */ for (child = OF_child(start); child != 0; child = OF_peer(child)) - if (fdt_is_compatible(child, compat)) { + if (ofw_bus_node_is_compatible(child, compat)) { if (strict) if (!fdt_is_compatible_strict(child, compat)) continue; @@ -322,7 +281,7 @@ fdt_depth_search_compatible(phandle_t start, const cha * matching 'compatible' property. */ for (node = OF_child(start); node != 0; node = OF_peer(node)) { - if (fdt_is_compatible(node, compat) && + if (ofw_bus_node_is_compatible(node, compat) && (strict == 0 || fdt_is_compatible_strict(node, compat))) { return (node); } From owner-svn-src-all@freebsd.org Sun Apr 8 22:59:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC32EF88642; Sun, 8 Apr 2018 22:59:40 +0000 (UTC) (envelope-from gonzo@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 5B3AE8404D; Sun, 8 Apr 2018 22:59:40 +0000 (UTC) (envelope-from gonzo@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 53FED165B4; Sun, 8 Apr 2018 22:59:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38MxeVk096345; Sun, 8 Apr 2018 22:59:40 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38MxZQG096292; Sun, 8 Apr 2018 22:59:35 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804082259.w38MxZQG096292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Apr 2018 22:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332310 - in head/sys: arm/allwinner arm/amlogic/aml8726 arm/broadcom/bcm2835 arm/freescale/vybrid arm/mv arm/nvidia arm/nvidia/tegra124 arm/ti arm/ti/cpsw arm/ti/usb dev/altera/avgen d... X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/amlogic/aml8726 arm/broadcom/bcm2835 arm/freescale/vybrid arm/mv arm/nvidia arm/nvidia/tegra124 arm/ti arm/ti/cpsw arm/ti/usb dev/altera/avgen dev/atkbdc dev/etherswitch... X-SVN-Commit-Revision: 332310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 22:59:41 -0000 Author: gonzo Date: Sun Apr 8 22:59:34 2018 New Revision: 332310 URL: https://svnweb.freebsd.org/changeset/base/332310 Log: Clean up OF_getprop_alloc API OF_getprop_alloc takes element size argument and returns number of elements in the property. There are valid use cases for such behavior but mostly API consumers pass 1 as element size to get string properties. What API users would expect from OF_getprop_alloc is to be a combination of malloc + OF_getprop with the same semantic of return value. This patch modifies API signature to match these expectations. For the valid use cases with element size != 1 and to reduce modification scope new OF_getprop_alloc_multi function has been introduced that behaves the same way OF_getprop_alloc behaved prior to this patch. Reviewed by: ian, manu Differential Revision: https://reviews.freebsd.org/D14850 Modified: head/sys/arm/allwinner/aw_gpio.c head/sys/arm/allwinner/aw_if_dwc.c head/sys/arm/allwinner/if_awg.c head/sys/arm/amlogic/aml8726/aml8726_ccm.c head/sys/arm/amlogic/aml8726/aml8726_mmc.c head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/freescale/vybrid/vf_ccm.c head/sys/arm/mv/mv_localbus.c head/sys/arm/nvidia/as3722_gpio.c head/sys/arm/nvidia/as3722_regulators.c head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c head/sys/arm/nvidia/tegra_pinmux.c head/sys/arm/nvidia/tegra_usbphy.c head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/ti_hwmods.c head/sys/arm/ti/usb/omap_host.c head/sys/dev/altera/avgen/altera_avgen_fdt.c head/sys/dev/atkbdc/atkbdc_ebus.c head/sys/dev/etherswitch/e6000sw/e6000sw.c head/sys/dev/extres/regulator/regulator.c head/sys/dev/fdt/fdt_pinctrl.c head/sys/dev/fdt/fdt_slicer.c head/sys/dev/gpio/gpiokeys.c head/sys/dev/gpio/gpioled_fdt.c head/sys/dev/iicbus/adt746x.c head/sys/dev/le/lebuffer_sbus.c head/sys/dev/neta/if_mvneta_fdt.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h head/sys/dev/usb/controller/ehci_fsl.c head/sys/dev/vnic/thunder_bgx_fdt.c head/sys/mips/mediatek/mtk_pinctrl.c head/sys/powerpc/mpc85xx/fsl_diu.c head/sys/powerpc/powermac/macio.c head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/psim/iobus.c head/sys/sparc64/central/central.c head/sys/sparc64/ebus/ebus.c head/sys/sparc64/fhc/fhc.c head/sys/sparc64/isa/isa.c head/sys/sparc64/pci/ofw_pci.c head/sys/sparc64/sbus/dma_sbus.c head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sparc64/nexus.c head/sys/sparc64/sparc64/upa.c Modified: head/sys/arm/allwinner/aw_gpio.c ============================================================================== --- head/sys/arm/allwinner/aw_gpio.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/allwinner/aw_gpio.c Sun Apr 8 22:59:34 2018 (r332310) @@ -559,10 +559,10 @@ aw_gpio_parse_function(phandle_t node) { char *function; - if (OF_getprop_alloc(node, "function", sizeof(*function), + if (OF_getprop_alloc(node, "function", (void **)&function) != -1) return (function); - if (OF_getprop_alloc(node, "allwinner,function", sizeof(*function), + if (OF_getprop_alloc(node, "allwinner,function", (void **)&function) != -1) return (function); Modified: head/sys/arm/allwinner/aw_if_dwc.c ============================================================================== --- head/sys/arm/allwinner/aw_if_dwc.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/allwinner/aw_if_dwc.c Sun Apr 8 22:59:34 2018 (r332310) @@ -72,7 +72,7 @@ a20_if_dwc_init(device_t dev) node = ofw_bus_get_node(dev); /* Configure PHY for MII or RGMII mode */ - if (OF_getprop_alloc(node, "phy-mode", 1, (void **)&phy_type)) { + if (OF_getprop_alloc(node, "phy-mode", (void **)&phy_type)) { error = clk_get_by_ofw_name(dev, 0, "allwinner_gmac_tx", &clk_tx); if (error != 0) { device_printf(dev, "could not get tx clk\n"); Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/allwinner/if_awg.c Sun Apr 8 22:59:34 2018 (r332310) @@ -1233,7 +1233,7 @@ awg_setup_phy(device_t dev) node = ofw_bus_get_node(dev); use_syscon = false; - if (OF_getprop_alloc(node, "phy-mode", 1, (void **)&phy_type) == 0) + if (OF_getprop_alloc(node, "phy-mode", (void **)&phy_type) == 0) return (0); if (sc->syscon != NULL || sc->res[_RES_SYSCON] != NULL) Modified: head/sys/arm/amlogic/aml8726/aml8726_ccm.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_ccm.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/amlogic/aml8726/aml8726_ccm.c Sun Apr 8 22:59:34 2018 (r332310) @@ -87,7 +87,7 @@ aml8726_ccm_configure_gates(struct aml8726_ccm_softc * node = ofw_bus_get_node(sc->dev); - len = OF_getprop_alloc(node, "functions", sizeof(char), + len = OF_getprop_alloc(node, "functions", (void **)&functions); if (len < 0) { Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_mmc.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/amlogic/aml8726/aml8726_mmc.c Sun Apr 8 22:59:34 2018 (r332310) @@ -585,7 +585,7 @@ aml8726_mmc_attach(device_t dev) } len = OF_getprop_alloc(OF_node_from_xref(prop[0]), "amlogic,function", - sizeof(char), (void **)&function_name); + (void **)&function_name); if (len < 0) { device_printf(dev, @@ -635,7 +635,7 @@ aml8726_mmc_attach(device_t dev) } len = OF_getprop_alloc(node, "mmc-voltages", - sizeof(char), (void **)&voltages); + (void **)&voltages); if (len < 0) { device_printf(dev, "missing mmc-voltages attribute in FDT\n"); Modified: head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c Sun Apr 8 22:59:34 2018 (r332310) @@ -194,7 +194,7 @@ aml8726_pinctrl_configure_pins(device_t dev, phandle_t node = OF_node_from_xref(cfgxref); len = OF_getprop_alloc(node, "amlogic,function", - sizeof(char), (void **)&function_name); + (void **)&function_name); if (len < 0) { device_printf(dev, @@ -216,7 +216,7 @@ aml8726_pinctrl_configure_pins(device_t dev, phandle_t OF_prop_free(function_name); len = OF_getprop_alloc(node, "amlogic,pull", - sizeof(char), (void **)&pull); + (void **)&pull); pm = aml8726_unknown_pm; @@ -257,7 +257,7 @@ aml8726_pinctrl_configure_pins(device_t dev, phandle_t } len = OF_getprop_alloc(node, "amlogic,pins", - sizeof(char), (void **)&pins); + (void **)&pins); if (len < 0) { device_printf(dev, "missing amlogic,pins attribute in FDT\n"); Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c Sun Apr 8 22:59:34 2018 (r332310) @@ -796,7 +796,7 @@ aml8726_sdxc_attach(device_t dev) } len = OF_getprop_alloc(node, "mmc-voltages", - sizeof(char), (void **)&voltages); + (void **)&voltages); if (len < 0) { device_printf(dev, "missing mmc-voltages attribute in FDT\n"); Modified: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c Sun Apr 8 22:59:34 2018 (r332310) @@ -126,7 +126,7 @@ aml8726_usb_phy_mode(const char *dwcotg_path, uint32_t *mode = 0; len = OF_getprop_alloc(node, "dr_mode", - sizeof(char), (void **)&usb_mode); + (void **)&usb_mode); if (len <= 0) return (0); Modified: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c Sun Apr 8 22:59:34 2018 (r332310) @@ -154,7 +154,7 @@ aml8726_usb_phy_attach(device_t dev) node = ofw_bus_get_node(dev); len = OF_getprop_alloc(node, "force-aca", - sizeof(char), (void **)&force_aca); + (void **)&force_aca); sc->force_aca = FALSE; Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Sun Apr 8 22:59:34 2018 (r332310) @@ -677,7 +677,7 @@ bcm_gpio_get_reserved_pins(struct bcm_gpio_softc *sc) reserved = 0; node = OF_child(gpio); while ((node != 0) && (reserved == 0)) { - len = OF_getprop_alloc(node, "name", 1, (void **)&name); + len = OF_getprop_alloc(node, "name", (void **)&name); if (len == -1) return (-1); if (strcmp(name, "reserved") == 0) Modified: head/sys/arm/freescale/vybrid/vf_ccm.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ccm.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/freescale/vybrid/vf_ccm.c Sun Apr 8 22:59:34 2018 (r332310) @@ -419,7 +419,7 @@ ccm_fdt_set(struct ccm_softc *sc) if ((len = OF_getproplen(child, "clock_names")) > 0) { len = OF_getproplen(child, "clock_names"); - OF_getprop_alloc(child, "clock_names", 1, + OF_getprop_alloc(child, "clock_names", (void **)&fdt_config); while (len > 0) { Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/mv/mv_localbus.c Sun Apr 8 22:59:34 2018 (r332310) @@ -175,7 +175,7 @@ fdt_localbus_reg_decode(phandle_t node, struct localbu return (ENXIO); tuple_size = sizeof(pcell_t) * (addr_cells + size_cells); - tuples = OF_getprop_alloc(node, "reg", tuple_size, (void **)®); + tuples = OF_getprop_alloc_multi(node, "reg", tuple_size, (void **)®); debugf("addr_cells = %d, size_cells = %d\n", addr_cells, size_cells); debugf("tuples = %d, tuple size = %d\n", tuples, tuple_size); if (tuples <= 0) Modified: head/sys/arm/nvidia/as3722_gpio.c ============================================================================== --- head/sys/arm/nvidia/as3722_gpio.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/nvidia/as3722_gpio.c Sun Apr 8 22:59:34 2018 (r332310) @@ -212,12 +212,12 @@ as3722_pinmux_read_node(struct as3722_softc *sc, phand { int rv, i; - *lpins = OF_getprop_alloc(node, "pins", 1, (void **)pins); + *lpins = OF_getprop_alloc(node, "pins", (void **)pins); if (*lpins <= 0) return (ENOENT); /* Read function (mux) settings. */ - rv = OF_getprop_alloc(node, "function", 1, (void **)&cfg->function); + rv = OF_getprop_alloc(node, "function", (void **)&cfg->function); if (rv <= 0) cfg->function = NULL; Modified: head/sys/arm/nvidia/as3722_regulators.c ============================================================================== --- head/sys/arm/nvidia/as3722_regulators.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/nvidia/as3722_regulators.c Sun Apr 8 22:59:34 2018 (r332310) @@ -542,7 +542,7 @@ struct as3722_regnode_init_def *init_def) if (rv <= 0) return; supply_node = OF_node_from_xref(supply_node); - rv = OF_getprop_alloc(supply_node, "regulator-name", 1, + rv = OF_getprop_alloc(supply_node, "regulator-name", (void **)&init_def->reg_init_def.parent_name); if (rv <= 0) init_def->reg_init_def.parent_name = NULL; Modified: head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c Sun Apr 8 22:59:34 2018 (r332310) @@ -874,7 +874,7 @@ process_lane(struct padctl_softc *sc, phandle_t node, name = NULL; function = NULL; - rv = OF_getprop_alloc(node, "name", 1, (void **)&name); + rv = OF_getprop_alloc(node, "name", (void **)&name); if (rv <= 0) { device_printf(sc->dev, "Cannot read lane name.\n"); return (ENXIO); @@ -888,7 +888,7 @@ process_lane(struct padctl_softc *sc, phandle_t node, } /* Read function (mux) settings. */ - rv = OF_getprop_alloc(node, "nvidia,function", 1, (void **)&function); + rv = OF_getprop_alloc(node, "nvidia,function", (void **)&function); if (rv <= 0) { device_printf(sc->dev, "Cannot read lane function.\n"); rv = ENXIO; @@ -947,7 +947,7 @@ process_pad(struct padctl_softc *sc, phandle_t node) int rv; name = NULL; - rv = OF_getprop_alloc(node, "name", 1, (void **)&name); + rv = OF_getprop_alloc(node, "name", (void **)&name); if (rv <= 0) { device_printf(sc->dev, "Cannot read pad name.\n"); return (ENXIO); @@ -992,7 +992,7 @@ process_port(struct padctl_softc *sc, phandle_t node) int rv; name = NULL; - rv = OF_getprop_alloc(node, "name", 1, (void **)&name); + rv = OF_getprop_alloc(node, "name", (void **)&name); if (rv <= 0) { device_printf(sc->dev, "Cannot read port name.\n"); return (ENXIO); Modified: head/sys/arm/nvidia/tegra_pinmux.c ============================================================================== --- head/sys/arm/nvidia/tegra_pinmux.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/nvidia/tegra_pinmux.c Sun Apr 8 22:59:34 2018 (r332310) @@ -648,12 +648,12 @@ pinmux_read_node(struct pinmux_softc *sc, phandle_t no { int rv, i; - *lpins = OF_getprop_alloc(node, "nvidia,pins", 1, (void **)pins); + *lpins = OF_getprop_alloc(node, "nvidia,pins", (void **)pins); if (*lpins <= 0) return (ENOENT); /* Read function (mux) settings. */ - rv = OF_getprop_alloc(node, "nvidia,function", 1, + rv = OF_getprop_alloc(node, "nvidia,function", (void **)&cfg->function); if (rv <= 0) cfg->function = NULL; Modified: head/sys/arm/nvidia/tegra_usbphy.c ============================================================================== --- head/sys/arm/nvidia/tegra_usbphy.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/nvidia/tegra_usbphy.c Sun Apr 8 22:59:34 2018 (r332310) @@ -593,7 +593,7 @@ usb_get_ifc_mode(device_t dev, phandle_t node, char *n int rv; enum usb_ifc_type ret; - rv = OF_getprop_alloc(node, name, 1, (void **)&tmpstr); + rv = OF_getprop_alloc(node, name, (void **)&tmpstr); if (rv <= 0) return (USB_IFC_TYPE_UNKNOWN); @@ -615,7 +615,7 @@ usb_get_dr_mode(device_t dev, phandle_t node, char *na int rv; enum usb_dr_mode ret; - rv = OF_getprop_alloc(node, name, 1, (void **)&tmpstr); + rv = OF_getprop_alloc(node, name, (void **)&tmpstr); if (rv <= 0) return (USB_DR_MODE_UNKNOWN); Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Apr 8 22:59:34 2018 (r332310) @@ -746,7 +746,7 @@ cpsw_get_fdt_data(struct cpsw_softc *sc, int port) phy = -1; vlan = -1; for (child = OF_child(sc->node); child != 0; child = OF_peer(child)) { - if (OF_getprop_alloc(child, "name", 1, (void **)&name) < 0) + if (OF_getprop_alloc(child, "name", (void **)&name) < 0) continue; if (sscanf(name, "slave@%lx", &mdio_child_addr) != 1) { OF_prop_free(name); Modified: head/sys/arm/ti/ti_hwmods.c ============================================================================== --- head/sys/arm/ti/ti_hwmods.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/ti/ti_hwmods.c Sun Apr 8 22:59:34 2018 (r332310) @@ -110,7 +110,7 @@ ti_hwmods_get_clock(device_t dev) if ((node = ofw_bus_get_node(dev)) == 0) return (INVALID_CLK_IDENT); - if ((len = OF_getprop_alloc(node, "ti,hwmods", 1, (void**)&name)) <= 0) + if ((len = OF_getprop_alloc(node, "ti,hwmods", (void**)&name)) <= 0) return (INVALID_CLK_IDENT); buf = name; @@ -148,7 +148,7 @@ int ti_hwmods_contains(device_t dev, const char *hwmod if ((node = ofw_bus_get_node(dev)) == 0) return (0); - if ((len = OF_getprop_alloc(node, "ti,hwmods", 1, (void**)&name)) <= 0) + if ((len = OF_getprop_alloc(node, "ti,hwmods", (void**)&name)) <= 0) return (0); buf = name; @@ -182,7 +182,7 @@ ti_hwmods_get_unit(device_t dev, const char *hwmod) if ((node = ofw_bus_get_node(dev)) == 0) return (0); - if ((len = OF_getprop_alloc(node, "ti,hwmods", 1, (void**)&name)) <= 0) + if ((len = OF_getprop_alloc(node, "ti,hwmods", (void**)&name)) <= 0) return (0); buf = name; Modified: head/sys/arm/ti/usb/omap_host.c ============================================================================== --- head/sys/arm/ti/usb/omap_host.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/arm/ti/usb/omap_host.c Sun Apr 8 22:59:34 2018 (r332310) @@ -392,7 +392,7 @@ omap_uhh_attach(device_t dev) snprintf(propname, sizeof(propname), "port%d-mode", i+1); - if (OF_getprop_alloc(node, propname, 1, (void**)&mode) <= 0) + if (OF_getprop_alloc(node, propname, (void**)&mode) <= 0) continue; if (strcmp(mode, "ehci-phy") == 0) isc->port_mode[i] = EHCI_HCD_OMAP_MODE_PHY; Modified: head/sys/dev/altera/avgen/altera_avgen_fdt.c ============================================================================== --- head/sys/dev/altera/avgen/altera_avgen_fdt.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/altera/avgen/altera_avgen_fdt.c Sun Apr 8 22:59:34 2018 (r332310) @@ -100,13 +100,13 @@ altera_avgen_fdt_attach(device_t dev) node = ofw_bus_get_node(dev); if (OF_getprop(node, "sri-cambridge,width", &cell, sizeof(cell)) > 0) sc->avg_width = cell; - (void)OF_getprop_alloc(node, "sri-cambridge,fileio", sizeof(char), + (void)OF_getprop_alloc(node, "sri-cambridge,fileio", (void **)&str_fileio); - (void)OF_getprop_alloc(node, "sri-cambridge,geomio", sizeof(char), + (void)OF_getprop_alloc(node, "sri-cambridge,geomio", (void **)&str_geomio); - (void)OF_getprop_alloc(node, "sri-cambridge,mmapio", sizeof(char), + (void)OF_getprop_alloc(node, "sri-cambridge,mmapio", (void **)&str_mmapio); - (void)OF_getprop_alloc(node, "sri-cambridge,devname", sizeof(char), + (void)OF_getprop_alloc(node, "sri-cambridge,devname", (void **)&str_devname); if (OF_getprop(node, "sri-cambridge,devunit", &cell, sizeof(cell)) > 0) devunit = cell; Modified: head/sys/dev/atkbdc/atkbdc_ebus.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_ebus.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/atkbdc/atkbdc_ebus.c Sun Apr 8 22:59:34 2018 (r332310) @@ -238,7 +238,7 @@ atkbdc_ebus_attach(device_t dev) children = 0; for (child = OF_child(ofw_bus_get_node(dev)); child != 0; child = OF_peer(child)) { - if ((OF_getprop_alloc(child, "name", 1, (void **)&cname)) == -1) + if ((OF_getprop_alloc(child, "name", (void **)&cname)) == -1) continue; if (children >= 2) { device_printf(dev, Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Sun Apr 8 22:59:34 2018 (r332310) @@ -276,7 +276,7 @@ e6000sw_parse_child_fdt(e6000sw_softc_t *sc, phandle_t return (ENXIO); *pport = port; - if (OF_getprop_alloc(child, "label", 1, (void **)&portlabel) > 0) { + if (OF_getprop_alloc(child, "label", (void **)&portlabel) > 0) { if (strncmp(portlabel, "cpu", 3) == 0) { device_printf(sc->dev, "CPU port at %d\n", port); sc->cpuports_mask |= (1 << port); @@ -287,7 +287,7 @@ e6000sw_parse_child_fdt(e6000sw_softc_t *sc, phandle_t fixed_link = OF_child(child); if (fixed_link != 0 && - OF_getprop_alloc(fixed_link, "name", 1, (void **)&name) > 0) { + OF_getprop_alloc(fixed_link, "name", (void **)&name) > 0) { if (strncmp(name, "fixed-link", 10) == 0) { /* Assume defaults: 1g - full-duplex. */ sc->fixed_mask |= (1 << port); Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/extres/regulator/regulator.c Sun Apr 8 22:59:34 2018 (r332310) @@ -1007,7 +1007,7 @@ regulator_parse_ofw_stdparam(device_t pdev, phandle_t int rv; par = &def->std_param; - rv = OF_getprop_alloc(node, "regulator-name", 1, + rv = OF_getprop_alloc(node, "regulator-name", (void **)&def->name); if (rv <= 0) { device_printf(pdev, "%s: Missing regulator name\n", @@ -1057,7 +1057,7 @@ regulator_parse_ofw_stdparam(device_t pdev, phandle_t rv = OF_getencprop(node, "vin-supply", &supply_xref, sizeof(supply_xref)); if (rv >= 0) { - rv = OF_getprop_alloc(supply_xref, "regulator-name", 1, + rv = OF_getprop_alloc(supply_xref, "regulator-name", (void **)&def->parent_name); if (rv <= 0) def->parent_name = NULL; Modified: head/sys/dev/fdt/fdt_pinctrl.c ============================================================================== --- head/sys/dev/fdt/fdt_pinctrl.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/fdt/fdt_pinctrl.c Sun Apr 8 22:59:34 2018 (r332310) @@ -67,7 +67,7 @@ fdt_pinctrl_configure_by_name(device_t client, const c int i, offset, nameslen; nameslen = OF_getprop_alloc(ofw_bus_get_node(client), "pinctrl-names", - sizeof(*names), (void **)&names); + (void **)&names); if (nameslen <= 0) return (ENOENT); for (i = 0, offset = 0; offset < nameslen; i++) { Modified: head/sys/dev/fdt/fdt_slicer.c ============================================================================== --- head/sys/dev/fdt/fdt_slicer.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/fdt/fdt_slicer.c Sun Apr 8 22:59:34 2018 (r332310) @@ -94,12 +94,12 @@ fdt_flash_fill_slices(device_t dev, const char *provid /* * Retrieve label. */ - name_len = OF_getprop_alloc(dt_child, "label", sizeof(char), + name_len = OF_getprop_alloc(dt_child, "label", (void **)&slice_name); if (name_len <= 0) { /* Use node name if no label defined */ name_len = OF_getprop_alloc(dt_child, "name", - sizeof(char), (void **)&slice_name); + (void **)&slice_name); if (name_len <= 0) { debugf("slice i=%d with no name\n", i); slice_name = NULL; Modified: head/sys/dev/gpio/gpiokeys.c ============================================================================== --- head/sys/dev/gpio/gpiokeys.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/gpio/gpiokeys.c Sun Apr 8 22:59:34 2018 (r332310) @@ -271,8 +271,8 @@ gpiokeys_attach_key(struct gpiokeys_softc *sc, phandle callout_init_mtx(&key->repeat_callout, &key->mtx, 0); name = NULL; - if (OF_getprop_alloc(node, "label", 1, (void **)&name) == -1) - OF_getprop_alloc(node, "name", 1, (void **)&name); + if (OF_getprop_alloc(node, "label", (void **)&name) == -1) + OF_getprop_alloc(node, "name", (void **)&name); if (name != NULL) key_name = name; Modified: head/sys/dev/gpio/gpioled_fdt.c ============================================================================== --- head/sys/dev/gpio/gpioled_fdt.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/gpio/gpioled_fdt.c Sun Apr 8 22:59:34 2018 (r332310) @@ -89,7 +89,7 @@ gpioleds_attach_led(struct gpioleds_softc *sc, phandle state = 0; if (OF_getprop_alloc(node, "default-state", - sizeof(char), (void **)&default_state) != -1) { + (void **)&default_state) != -1) { if (strcasecmp(default_state, "on") == 0) state = 1; else if (strcasecmp(default_state, "off") == 0) @@ -105,8 +105,8 @@ gpioleds_attach_led(struct gpioleds_softc *sc, phandle } name = NULL; - if (OF_getprop_alloc(node, "label", 1, (void **)&name) == -1) - OF_getprop_alloc(node, "name", 1, (void **)&name); + if (OF_getprop_alloc(node, "label", (void **)&name) == -1) + OF_getprop_alloc(node, "name", (void **)&name); if (name == NULL) { device_printf(sc->sc_dev, Modified: head/sys/dev/iicbus/adt746x.c ============================================================================== --- head/sys/dev/iicbus/adt746x.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/iicbus/adt746x.c Sun Apr 8 22:59:34 2018 (r332310) @@ -360,8 +360,8 @@ adt746x_fill_fan_prop(device_t dev) child = ofw_bus_get_node(dev); /* Fill the fan location property. */ - location_len = OF_getprop_alloc(child, "hwctrl-location", 1, (void **)&location); - id_len = OF_getprop_alloc(child, "hwctrl-id", sizeof(cell_t), (void **)&id); + location_len = OF_getprop_alloc(child, "hwctrl-location", (void **)&location); + id_len = OF_getprop_alloc_multi(child, "hwctrl-id", sizeof(cell_t), (void **)&id); if (location_len == -1 || id_len == -1) { OF_prop_free(location); OF_prop_free(id); Modified: head/sys/dev/le/lebuffer_sbus.c ============================================================================== --- head/sys/dev/le/lebuffer_sbus.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/le/lebuffer_sbus.c Sun Apr 8 22:59:34 2018 (r332310) @@ -183,7 +183,7 @@ lebuffer_setup_dinfo(device_t dev, phandle_t node) } resource_list_init(&ldi->ldi_rl); slot = -1; - nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + nreg = OF_getprop_alloc_multi(node, "reg", sizeof(*reg), (void **)®); if (nreg == -1) { device_printf(dev, "<%s>: incomplete\n", ldi->ldi_obdinfo.obd_name); @@ -217,7 +217,7 @@ lebuffer_setup_dinfo(device_t dev, phandle_t node) /* * The `interrupts' property contains the SBus interrupt level. */ - nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), + nintr = OF_getprop_alloc_multi(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr != -1) { for (i = 0; i < nintr; i++) { Modified: head/sys/dev/neta/if_mvneta_fdt.c ============================================================================== --- head/sys/dev/neta/if_mvneta_fdt.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/neta/if_mvneta_fdt.c Sun Apr 8 22:59:34 2018 (r332310) @@ -159,7 +159,7 @@ mvneta_fdt_phy_acquire(device_t dev) /* Test for fixed-link (present i.e. in 388-gp) */ for (child = OF_child(node); child != 0; child = OF_peer(child)) { if (OF_getprop_alloc(child, - "name", 1, (void **)&name) <= 0) { + "name", (void **)&name) <= 0) { continue; } if (strncmp(name, "fixed-link", 10) == 0) { Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/ofw/ofw_bus_subr.c Sun Apr 8 22:59:34 2018 (r332310) @@ -57,12 +57,12 @@ ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *obd, if (obd == NULL) return (ENOMEM); /* The 'name' property is considered mandatory. */ - if ((OF_getprop_alloc(node, "name", 1, (void **)&obd->obd_name)) == -1) + if ((OF_getprop_alloc(node, "name", (void **)&obd->obd_name)) == -1) return (EINVAL); - OF_getprop_alloc(node, "compatible", 1, (void **)&obd->obd_compat); - OF_getprop_alloc(node, "device_type", 1, (void **)&obd->obd_type); - OF_getprop_alloc(node, "model", 1, (void **)&obd->obd_model); - OF_getprop_alloc(node, "status", 1, (void **)&obd->obd_status); + OF_getprop_alloc(node, "compatible", (void **)&obd->obd_compat); + OF_getprop_alloc(node, "device_type", (void **)&obd->obd_type); + OF_getprop_alloc(node, "model", (void **)&obd->obd_model); + OF_getprop_alloc(node, "status", (void **)&obd->obd_status); obd->obd_node = node; return (0); } @@ -502,7 +502,7 @@ ofw_bus_reg_to_rl_helper(device_t dev, phandle_t node, * This may be just redundant when having ofw_bus_devinfo * but makes this routine independent of it. */ - ret = OF_getprop_alloc(node, "name", sizeof(*name), (void **)&name); + ret = OF_getprop_alloc(node, "name", (void **)&name); if (ret == -1) name = NULL; @@ -720,7 +720,7 @@ ofw_bus_find_child(phandle_t start, const char *child_ phandle_t child; for (child = OF_child(start); child != 0; child = OF_peer(child)) { - ret = OF_getprop_alloc(child, "name", sizeof(*name), (void **)&name); + ret = OF_getprop_alloc(child, "name", (void **)&name); if (ret == -1) continue; if (strcmp(name, child_name) == 0) { @@ -916,7 +916,7 @@ ofw_bus_find_string_index(phandle_t node, const char * int rv, i, cnt, nelems; elems = NULL; - nelems = OF_getprop_alloc(node, list_name, 1, (void **)&elems); + nelems = OF_getprop_alloc(node, list_name, (void **)&elems); if (nelems <= 0) return (ENOENT); @@ -947,7 +947,7 @@ ofw_bus_string_list_to_array(phandle_t node, const cha int i, cnt, nelems, len; elems = NULL; - nelems = OF_getprop_alloc(node, list_name, 1, (void **)&elems); + nelems = OF_getprop_alloc(node, list_name, (void **)&elems); if (nelems <= 0) return (nelems); Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/ofw/openfirm.c Sun Apr 8 22:59:34 2018 (r332310) @@ -440,11 +440,35 @@ OF_searchencprop(phandle_t node, const char *propname, /* * Store the value of a property of a package into newly allocated memory + * (using the M_OFWPROP malloc pool and M_WAITOK). + */ +ssize_t +OF_getprop_alloc(phandle_t package, const char *propname, void **buf) +{ + int len; + + *buf = NULL; + if ((len = OF_getproplen(package, propname)) == -1) + return (-1); + + if (len > 0) { + *buf = malloc(len, M_OFWPROP, M_WAITOK); + if (OF_getprop(package, propname, *buf, len) == -1) { + free(*buf, M_OFWPROP); + *buf = NULL; + return (-1); + } + } + return (len); +} + +/* + * Store the value of a property of a package into newly allocated memory * (using the M_OFWPROP malloc pool and M_WAITOK). elsz is the size of a * single element, the number of elements is return in number. */ ssize_t -OF_getprop_alloc(phandle_t package, const char *propname, int elsz, void **buf) +OF_getprop_alloc_multi(phandle_t package, const char *propname, int elsz, void **buf) { int len; @@ -453,15 +477,18 @@ OF_getprop_alloc(phandle_t package, const char *propna len % elsz != 0) return (-1); - *buf = malloc(len, M_OFWPROP, M_WAITOK); - if (OF_getprop(package, propname, *buf, len) == -1) { - free(*buf, M_OFWPROP); - *buf = NULL; - return (-1); + if (len > 0) { + *buf = malloc(len, M_OFWPROP, M_WAITOK); + if (OF_getprop(package, propname, *buf, len) == -1) { + free(*buf, M_OFWPROP); + *buf = NULL; + return (-1); + } } return (len / elsz); } + ssize_t OF_getencprop_alloc(phandle_t package, const char *name, int elsz, void **buf) { @@ -469,7 +496,7 @@ OF_getencprop_alloc(phandle_t package, const char *nam pcell_t *cell; int i; - retval = OF_getprop_alloc(package, name, elsz, buf); + retval = OF_getprop_alloc_multi(package, name, elsz, buf); if (retval == -1) return (-1); if (retval * elsz % 4 != 0) { Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/ofw/openfirm.h Sun Apr 8 22:59:34 2018 (r332310) @@ -116,6 +116,8 @@ ssize_t OF_searchprop(phandle_t node, const char *pro ssize_t OF_searchencprop(phandle_t node, const char *propname, void *buf, size_t len); ssize_t OF_getprop_alloc(phandle_t node, const char *propname, + void **buf); +ssize_t OF_getprop_alloc_multi(phandle_t node, const char *propname, int elsz, void **buf); ssize_t OF_getencprop_alloc(phandle_t node, const char *propname, int elsz, void **buf); Modified: head/sys/dev/usb/controller/ehci_fsl.c ============================================================================== --- head/sys/dev/usb/controller/ehci_fsl.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/usb/controller/ehci_fsl.c Sun Apr 8 22:59:34 2018 (r332310) @@ -175,7 +175,7 @@ enable_usb(device_t dev, bus_space_tag_t iot, bus_spac node = ofw_bus_get_node(dev); if ((node != 0) && - (OF_getprop_alloc(node, "phy_type", 1, (void **)&phy_type) > 0)) { + (OF_getprop_alloc(node, "phy_type", (void **)&phy_type) > 0)) { if (strncasecmp(phy_type, "utmi", strlen("utmi")) == 0) tmp |= UTMI_PHY_EN; OF_prop_free(phy_type); Modified: head/sys/dev/vnic/thunder_bgx_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx_fdt.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Sun Apr 8 22:59:34 2018 (r332310) @@ -396,7 +396,7 @@ bgx_fdt_init_phy(struct bgx *bgx) continue; } } else { - len = OF_getprop_alloc(child, "name", 1, + len = OF_getprop_alloc(child, "name", (void **)&node_name); if (len <= 0) { continue; Modified: head/sys/mips/mediatek/mtk_pinctrl.c ============================================================================== --- head/sys/mips/mediatek/mtk_pinctrl.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/mips/mediatek/mtk_pinctrl.c Sun Apr 8 22:59:34 2018 (r332310) @@ -136,7 +136,7 @@ mtk_pinctrl_process_node(device_t dev, struct mtk_pin_ if (num_groups <= 0) return (ENOENT); - if (OF_getprop_alloc(node, "ralink,function", sizeof(*pin_function), + if (OF_getprop_alloc_multi(node, "ralink,function", sizeof(*pin_function), (void **)&pin_function) == -1) { ret = ENOENT; goto out; Modified: head/sys/powerpc/mpc85xx/fsl_diu.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_diu.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/powerpc/mpc85xx/fsl_diu.c Sun Apr 8 22:59:34 2018 (r332310) @@ -362,7 +362,7 @@ diu_attach(device_t dev) } /* TODO: Eventually, allow EDID to be dynamically provided. */ - if (OF_getprop_alloc(node, "edid", 1, &edid_cells) <= 0) { + if (OF_getprop_alloc(node, "edid", &edid_cells) <= 0) { /* * u-boot uses the environment variable name 'video-mode', so * just use the same name here. Should allow another variable Modified: head/sys/powerpc/powermac/macio.c ============================================================================== --- head/sys/powerpc/powermac/macio.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/powerpc/powermac/macio.c Sun Apr 8 22:59:34 2018 (r332310) @@ -203,10 +203,10 @@ macio_add_intr(phandle_t devnode, struct macio_devinfo return; } - nintr = OF_getprop_alloc(devnode, "interrupts", sizeof(*intr), + nintr = OF_getprop_alloc_multi(devnode, "interrupts", sizeof(*intr), (void **)&intr); if (nintr == -1) { - nintr = OF_getprop_alloc(devnode, "AAPL,interrupts", + nintr = OF_getprop_alloc_multi(devnode, "AAPL,interrupts", sizeof(*intr), (void **)&intr); if (nintr == -1) return; @@ -243,7 +243,7 @@ macio_add_reg(phandle_t devnode, struct macio_devinfo char buf[8]; int i, layout_id = 0, nreg, res; - nreg = OF_getprop_alloc(devnode, "reg", sizeof(*reg), (void **)®); + nreg = OF_getprop_alloc_multi(devnode, "reg", sizeof(*reg), (void **)®); if (nreg == -1) return; @@ -269,7 +269,7 @@ macio_add_reg(phandle_t devnode, struct macio_devinfo sizeof(layout_id)); if (res > 0 && (layout_id == 36 || layout_id == 76)) { - res = OF_getprop_alloc(OF_parent(devnode), "reg", + res = OF_getprop_alloc_multi(OF_parent(devnode), "reg", sizeof(*regp), (void **)®p); reg[0] = regp[0]; reg[1].mr_base = regp[1].mr_base; Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/powerpc/powermac/uninorth.c Sun Apr 8 22:59:34 2018 (r332310) @@ -164,10 +164,10 @@ unin_chip_add_intr(phandle_t devnode, struct unin_chip return; } - nintr = OF_getprop_alloc(devnode, "interrupts", sizeof(*intr), + nintr = OF_getprop_alloc_multi(devnode, "interrupts", sizeof(*intr), (void **)&intr); if (nintr == -1) { - nintr = OF_getprop_alloc(devnode, "AAPL,interrupts", + nintr = OF_getprop_alloc_multi(devnode, "AAPL,interrupts", sizeof(*intr), (void **)&intr); if (nintr == -1) return; @@ -207,7 +207,7 @@ unin_chip_add_reg(phandle_t devnode, struct unin_chip_ struct unin_chip_reg *reg; int i, nreg; - nreg = OF_getprop_alloc(devnode, "reg", sizeof(*reg), (void **)®); + nreg = OF_getprop_alloc_multi(devnode, "reg", sizeof(*reg), (void **)®); if (nreg == -1) return; Modified: head/sys/powerpc/psim/iobus.c ============================================================================== --- head/sys/powerpc/psim/iobus.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/powerpc/psim/iobus.c Sun Apr 8 22:59:34 2018 (r332310) @@ -221,7 +221,7 @@ iobus_attach(device_t dev) root = sc->sc_node; for (child = OF_child(root); child != 0; child = OF_peer(child)) { - OF_getprop_alloc(child, "name", 1, (void **)&name); + OF_getprop_alloc(child, "name", (void **)&name); cdev = device_add_child(dev, NULL, -1); if (cdev != NULL) { Modified: head/sys/sparc64/central/central.c ============================================================================== --- head/sys/sparc64/central/central.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/sparc64/central/central.c Sun Apr 8 22:59:34 2018 (r332310) @@ -140,7 +140,7 @@ central_attach(device_t dev) sc = device_get_softc(dev); node = ofw_bus_get_node(dev); - sc->sc_nrange = OF_getprop_alloc(node, "ranges", + sc->sc_nrange = OF_getprop_alloc_multi(node, "ranges", sizeof(*sc->sc_ranges), (void **)&sc->sc_ranges); if (sc->sc_nrange == -1) { device_printf(dev, "can't get ranges\n"); @@ -153,7 +153,7 @@ central_attach(device_t dev) free(cdi, M_DEVBUF); continue; } - nreg = OF_getprop_alloc(child, "reg", sizeof(*reg), + nreg = OF_getprop_alloc_multi(child, "reg", sizeof(*reg), (void **)®); if (nreg == -1) { device_printf(dev, "<%s>: incomplete\n", Modified: head/sys/sparc64/ebus/ebus.c ============================================================================== --- head/sys/sparc64/ebus/ebus.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/sparc64/ebus/ebus.c Sun Apr 8 22:59:34 2018 (r332310) @@ -292,7 +292,7 @@ ebus_nexus_attach(device_t dev) } #endif - sc->sc_nrange = OF_getprop_alloc(node, "ranges", + sc->sc_nrange = OF_getprop_alloc_multi(node, "ranges", sizeof(struct ebus_nexus_ranges), &sc->sc_range); if (sc->sc_nrange == -1) { device_printf(dev, "could not get ranges property\n"); @@ -321,7 +321,7 @@ ebus_pci_attach(device_t dev) pci_write_config(dev, PCIR_LATTIMER, 64 /* 64 PCI cycles */, 1); node = ofw_bus_get_node(dev); - sc->sc_nrange = OF_getprop_alloc(node, "ranges", + sc->sc_nrange = OF_getprop_alloc_multi(node, "ranges", sizeof(struct isa_ranges), &sc->sc_range); if (sc->sc_nrange == -1) { device_printf(dev, "could not get ranges property\n"); @@ -660,7 +660,7 @@ ebus_setup_dinfo(device_t dev, struct ebus_softc *sc, return (NULL); } resource_list_init(&edi->edi_rl); - nreg = OF_getprop_alloc(node, "reg", sizeof(*regs), (void **)®s); + nreg = OF_getprop_alloc_multi(node, "reg", sizeof(*regs), (void **)®s); if (nreg == -1) { device_printf(dev, "<%s>: incomplete\n", edi->edi_obdinfo.obd_name); @@ -674,7 +674,7 @@ ebus_setup_dinfo(device_t dev, struct ebus_softc *sc, } OF_prop_free(regs); - nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs), + nintr = OF_getprop_alloc_multi(node, "interrupts", sizeof(*intrs), (void **)&intrs); if (nintr == -1) return (edi); Modified: head/sys/sparc64/fhc/fhc.c ============================================================================== --- head/sys/sparc64/fhc/fhc.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/sparc64/fhc/fhc.c Sun Apr 8 22:59:34 2018 (r332310) @@ -205,7 +205,7 @@ fhc_attach(device_t dev) } device_printf(dev, "board %d, ", board); - if (OF_getprop_alloc(node, "board-model", 1, (void **)&name) != -1) { + if (OF_getprop_alloc(node, "board-model", (void **)&name) != -1) { printf("model %s\n", name); OF_prop_free(name); } else @@ -227,7 +227,7 @@ fhc_attach(device_t dev) bus_write_4(sc->sc_memres[FHC_INTERNAL], FHC_CTRL, ctrl); (void)bus_read_4(sc->sc_memres[FHC_INTERNAL], FHC_CTRL); - sc->sc_nrange = OF_getprop_alloc(node, "ranges", + sc->sc_nrange = OF_getprop_alloc_multi(node, "ranges", sizeof(*sc->sc_ranges), (void **)&sc->sc_ranges); if (sc->sc_nrange == -1) { device_printf(dev, "cannot get ranges\n"); @@ -285,7 +285,7 @@ fhc_attach(device_t dev) free(fdi, M_DEVBUF); continue; } - i = OF_getprop_alloc(child, "reg", sizeof(*reg), + i = OF_getprop_alloc_multi(child, "reg", sizeof(*reg), (void **)®); if (i == -1) { device_printf(dev, "<%s>: incomplete\n", @@ -301,7 +301,7 @@ fhc_attach(device_t dev) reg[j].sbr_size, reg[j].sbr_size); OF_prop_free(reg); if (central == 1) { - i = OF_getprop_alloc(child, "interrupts", + i = OF_getprop_alloc_multi(child, "interrupts", sizeof(*intr), (void **)&intr); if (i != -1) { for (j = 0; j < i; j++) { Modified: head/sys/sparc64/isa/isa.c ============================================================================== --- head/sys/sparc64/isa/isa.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/sparc64/isa/isa.c Sun Apr 8 22:59:34 2018 (r332310) @@ -92,7 +92,7 @@ isa_init(device_t dev) /* The parent of the bus must be a PCI-ISA bridge. */ bridge = device_get_parent(dev); isab_node = ofw_bus_get_node(bridge); - isab_nrange = OF_getprop_alloc(isab_node, "ranges", + isab_nrange = OF_getprop_alloc_multi(isab_node, "ranges", sizeof(*isab_ranges), (void **)&isab_ranges); if (isab_nrange <= 0) panic("isa_init: cannot get bridge range property"); @@ -162,7 +162,7 @@ isa_setup_children(device_t dev, phandle_t parent) * allow for an isa_activate_resource(). */ for (node = OF_child(parent); node != 0; node = OF_peer(node)) { - if ((OF_getprop_alloc(node, "name", 1, (void **)&name)) == -1) + if ((OF_getprop_alloc(node, "name", (void **)&name)) == -1) continue; /* @@ -192,7 +192,7 @@ isa_setup_children(device_t dev, phandle_t parent) isa_set_vendorid(cdev, ofw_isa_pnp_map[i].id); rl = BUS_GET_RESOURCE_LIST(dev, cdev); - nreg = OF_getprop_alloc(node, "reg", sizeof(*regs), + nreg = OF_getprop_alloc_multi(node, "reg", sizeof(*regs), (void **)®s); for (i = 0; i < nreg; i++) { start = ISA_REG_PHYS(®s[i]); @@ -211,12 +211,12 @@ isa_setup_children(device_t dev, phandle_t parent) * the set of registers of the parent device like * with the nodes hanging off of the `8042' node. */ - nregidx = OF_getprop_alloc(node, "reg", sizeof(*regidx), + nregidx = OF_getprop_alloc_multi(node, "reg", sizeof(*regidx), (void **)®idx); if (nregidx > 2) panic("isa_setup_children: impossible number " "of register indices"); - if (nregidx != -1 && (nreg = OF_getprop_alloc(parent, + if (nregidx != -1 && (nreg = OF_getprop_alloc_multi(parent, "reg", sizeof(*regs), (void **)®s)) >= nregidx) { for (i = 0; i < nregidx; i++) { start = ISA_REG_PHYS(®s[regidx[i]]); @@ -237,7 +237,7 @@ isa_setup_children(device_t dev, phandle_t parent) if (regs != NULL) OF_prop_free(regs); - nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs), + nintr = OF_getprop_alloc_multi(node, "interrupts", sizeof(*intrs), (void **)&intrs); for (i = 0; i < nintr; i++) { if (intrs[i] > 7) @@ -255,7 +255,7 @@ isa_setup_children(device_t dev, phandle_t parent) if (intrs != NULL) OF_prop_free(intrs); - ndrq = OF_getprop_alloc(node, "dma-channel", sizeof(*drqs), + ndrq = OF_getprop_alloc_multi(node, "dma-channel", sizeof(*drqs), (void **)&drqs); for (i = 0; i < ndrq; i++) bus_set_resource(cdev, SYS_RES_DRQ, i, drqs[i], 1); Modified: head/sys/sparc64/pci/ofw_pci.c ============================================================================== --- head/sys/sparc64/pci/ofw_pci.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/sparc64/pci/ofw_pci.c Sun Apr 8 22:59:34 2018 (r332310) @@ -93,7 +93,7 @@ ofw_pci_attach_common(device_t dev, bus_dma_tag_t dmat * start addresses of the ranges are the configuration, I/O and * memory handles. There should not be multiple ones of one kind. */ - nrange = OF_getprop_alloc(node, "ranges", sizeof(*range), + nrange = OF_getprop_alloc_multi(node, "ranges", sizeof(*range), (void **)&range); for (i = 0; i < nrange; i++) { j = OFW_PCI_RANGE_CS(&range[i]); Modified: head/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- head/sys/sparc64/sbus/dma_sbus.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/sparc64/sbus/dma_sbus.c Sun Apr 8 22:59:34 2018 (r332310) @@ -209,7 +209,7 @@ dma_attach(device_t dev) * the user can change it via a "media" option to ifconfig. */ csr = L64854_GCSR(lsc); - if ((OF_getprop_alloc(node, "cable-selection", 1, + if ((OF_getprop_alloc(node, "cable-selection", (void **)&cabletype)) == -1) { /* assume TP if nothing there */ csr |= E_TP_AUI; @@ -295,7 +295,7 @@ dma_setup_dinfo(device_t dev, struct dma_softc *dsc, p } resource_list_init(&ddi->ddi_rl); slot = -1; - nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + nreg = OF_getprop_alloc_multi(node, "reg", sizeof(*reg), (void **)®); if (nreg == -1) { device_printf(dev, "<%s>: incomplete\n", ddi->ddi_obdinfo.obd_name); @@ -329,7 +329,7 @@ dma_setup_dinfo(device_t dev, struct dma_softc *dsc, p /* * The `interrupts' property contains the SBus interrupt level. */ - nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), + nintr = OF_getprop_alloc_multi(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr != -1) { for (i = 0; i < nintr; i++) { Modified: head/sys/sparc64/sbus/sbus.c ============================================================================== --- head/sys/sparc64/sbus/sbus.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/sparc64/sbus/sbus.c Sun Apr 8 22:59:34 2018 (r332310) @@ -299,7 +299,7 @@ sbus_attach(device_t dev) /* * Collect address translations from the OBP. */ - if ((sc->sc_nrange = OF_getprop_alloc(node, "ranges", + if ((sc->sc_nrange = OF_getprop_alloc_multi(node, "ranges", sizeof(*range), (void **)&range)) == -1) { panic("%s: error getting ranges property", __func__); } @@ -478,7 +478,7 @@ sbus_setup_dinfo(device_t dev, struct sbus_softc *sc, } resource_list_init(&sdi->sdi_rl); slot = -1; - nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + nreg = OF_getprop_alloc_multi(node, "reg", sizeof(*reg), (void **)®); if (nreg == -1) { if (sdi->sdi_obdinfo.obd_type == NULL || strcmp(sdi->sdi_obdinfo.obd_type, "hierarchical") != 0) { @@ -512,7 +512,7 @@ sbus_setup_dinfo(device_t dev, struct sbus_softc *sc, /* * The `interrupts' property contains the SBus interrupt level. */ - nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), + nintr = OF_getprop_alloc_multi(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr != -1) { for (i = 0; i < nintr; i++) { Modified: head/sys/sparc64/sparc64/nexus.c ============================================================================== --- head/sys/sparc64/sparc64/nexus.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/sparc64/sparc64/nexus.c Sun Apr 8 22:59:34 2018 (r332310) @@ -545,7 +545,7 @@ nexus_setup_dinfo(device_t dev, phandle_t node) return (NULL); } resource_list_init(&ndi->ndi_rl); - nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)®); + nreg = OF_getprop_alloc_multi(node, "reg", sizeof(*reg), (void **)®); if (nreg == -1) { device_printf(dev, "<%s>: incomplete\n", ndi->ndi_obdinfo.obd_name); @@ -561,7 +561,7 @@ nexus_setup_dinfo(device_t dev, phandle_t node) } OF_prop_free(reg); - nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), + nintr = OF_getprop_alloc_multi(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { if (OF_getprop(node, PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? Modified: head/sys/sparc64/sparc64/upa.c ============================================================================== --- head/sys/sparc64/sparc64/upa.c Sun Apr 8 22:07:06 2018 (r332309) +++ head/sys/sparc64/sparc64/upa.c Sun Apr 8 22:59:34 2018 (r332310) @@ -285,7 +285,7 @@ upa_attach(device_t dev) goto fail; } - sc->sc_nrange = OF_getprop_alloc(node, "ranges", sizeof(*sc->sc_ranges), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 8 23:17:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB9E1F899F7; Sun, 8 Apr 2018 23:17:51 +0000 (UTC) (envelope-from gonzo@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 8652C6E0CB; Sun, 8 Apr 2018 23:17:51 +0000 (UTC) (envelope-from gonzo@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 7B55A168F1; Sun, 8 Apr 2018 23:17:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38NHp6u006411; Sun, 8 Apr 2018 23:17:51 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38NHp1N006410; Sun, 8 Apr 2018 23:17:51 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804082317.w38NHp1N006410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Apr 2018 23:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332311 - head/sys/arm64/coresight X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm64/coresight X-SVN-Commit-Revision: 332311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 23:17:52 -0000 Author: gonzo Date: Sun Apr 8 23:17:51 2018 New Revision: 332311 URL: https://svnweb.freebsd.org/changeset/base/332311 Log: Fix one more OF_getprop_alloc instance missed in r332310 X-MFC-With: r332310 Modified: head/sys/arm64/coresight/coresight.c Modified: head/sys/arm64/coresight/coresight.c ============================================================================== --- head/sys/arm64/coresight/coresight.c Sun Apr 8 22:59:34 2018 (r332310) +++ head/sys/arm64/coresight/coresight.c Sun Apr 8 23:17:51 2018 (r332311) @@ -68,7 +68,7 @@ coresight_get_ports(phandle_t dev_node, node = dev_node; for (child = OF_child(node); child != 0; child = OF_peer(child)) { - ret = OF_getprop_alloc(child, "name", sizeof(*name), (void **)&name); + ret = OF_getprop_alloc(child, "name", (void **)&name); if (ret == -1) continue; From owner-svn-src-all@freebsd.org Mon Apr 9 00:38:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3047AF8FCEE; Mon, 9 Apr 2018 00:38:25 +0000 (UTC) (envelope-from gonzo@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 D780D7A190; Mon, 9 Apr 2018 00:38:24 +0000 (UTC) (envelope-from gonzo@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 D12741763A; Mon, 9 Apr 2018 00:38:24 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w390cOjH045806; Mon, 9 Apr 2018 00:38:24 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w390cO4x045804; Mon, 9 Apr 2018 00:38:24 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804090038.w390cO4x045804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 9 Apr 2018 00:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332312 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 332312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 00:38:25 -0000 Author: gonzo Date: Mon Apr 9 00:38:24 2018 New Revision: 332312 URL: https://svnweb.freebsd.org/changeset/base/332312 Log: Make OF_searchencprop signature consistent with OF_getencprop Use pcell_t* as a destination buffer argument instead of void pointer to be consistent with OF_getencprop signature. Modified: head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Sun Apr 8 23:17:51 2018 (r332311) +++ head/sys/dev/ofw/openfirm.c Mon Apr 9 00:38:24 2018 (r332312) @@ -428,7 +428,7 @@ OF_searchprop(phandle_t node, const char *propname, vo } ssize_t -OF_searchencprop(phandle_t node, const char *propname, void *buf, size_t len) +OF_searchencprop(phandle_t node, const char *propname, pcell_t *buf, size_t len) { ssize_t rv; Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Sun Apr 8 23:17:51 2018 (r332311) +++ head/sys/dev/ofw/openfirm.h Mon Apr 9 00:38:24 2018 (r332312) @@ -114,7 +114,7 @@ int OF_hasprop(phandle_t node, const char *propname); ssize_t OF_searchprop(phandle_t node, const char *propname, void *buf, size_t len); ssize_t OF_searchencprop(phandle_t node, const char *propname, - void *buf, size_t len); + pcell_t *buf, size_t len); ssize_t OF_getprop_alloc(phandle_t node, const char *propname, void **buf); ssize_t OF_getprop_alloc_multi(phandle_t node, const char *propname, From owner-svn-src-all@freebsd.org Mon Apr 9 01:02:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02795F91C5D; Mon, 9 Apr 2018 01:02:33 +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 AB2A8879CB; Mon, 9 Apr 2018 01:02:32 +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 A60DF17B17; Mon, 9 Apr 2018 01:02:32 +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 w3912WKq060424; Mon, 9 Apr 2018 01:02:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3912W7o060423; Mon, 9 Apr 2018 01:02:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804090102.w3912W7o060423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Apr 2018 01:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332313 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 332313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 01:02:33 -0000 Author: kevans Date: Mon Apr 9 01:02:32 2018 New Revision: 332313 URL: https://svnweb.freebsd.org/changeset/base/332313 Log: MFC r332146: Re-sort LOADER options Modified: stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Mon Apr 9 00:38:24 2018 (r332312) +++ stable/11/share/mk/src.opts.mk Mon Apr 9 01:02:32 2018 (r332313) @@ -126,13 +126,13 @@ __DEFAULT_YES_OPTIONS = \ LIBPTHREAD \ LIBTHR \ LOADER_GELI \ + LOADER_OFW \ + LOADER_UBOOT \ LOCALES \ LOCATE \ LPR \ LS_COLORS \ LZMA_SUPPORT \ - LOADER_OFW \ - LOADER_UBOOT \ MAIL \ MAILWRAPPER \ MAKE \ From owner-svn-src-all@freebsd.org Mon Apr 9 01:06:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3A2EF92067; Mon, 9 Apr 2018 01:06:09 +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 7624B69A2C; Mon, 9 Apr 2018 01:06:09 +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 6E41517B1D; Mon, 9 Apr 2018 01:06:09 +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 w39169YM060604; Mon, 9 Apr 2018 01:06:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w391692u060603; Mon, 9 Apr 2018 01:06:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804090106.w391692u060603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 01:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332314 - stable/11/sys/i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/i386/i386 X-SVN-Commit-Revision: 332314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 01:06:09 -0000 Author: emaste Date: Mon Apr 9 01:06:09 2018 New Revision: 332314 URL: https://svnweb.freebsd.org/changeset/base/332314 Log: MFC r331053: ANSIfy i386/vm86.c Modified: stable/11/sys/i386/i386/vm86.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/i386/vm86.c ============================================================================== --- stable/11/sys/i386/i386/vm86.c Mon Apr 9 01:02:32 2018 (r332313) +++ stable/11/sys/i386/i386/vm86.c Mon Apr 9 01:06:09 2018 (r332314) @@ -128,8 +128,7 @@ POPL(struct vm86frame *vmf) } int -vm86_emulate(vmf) - struct vm86frame *vmf; +vm86_emulate(struct vm86frame *vmf) { struct vm86_kernel *vm86; caddr_t addr; @@ -586,10 +585,7 @@ vm86_intcall(int intnum, struct vm86frame *vmf) * caller's cs:ip routine. */ int -vm86_datacall(intnum, vmf, vmc) - int intnum; - struct vm86frame *vmf; - struct vm86context *vmc; +vm86_datacall(int intnum, struct vm86frame *vmf, struct vm86context *vmc) { pt_entry_t *pte = (pt_entry_t *)vm86paddr; vm_paddr_t page; @@ -634,11 +630,8 @@ vm86_getaddr(struct vm86context *vmc, u_short sel, u_s } int -vm86_getptr(vmc, kva, sel, off) - struct vm86context *vmc; - vm_offset_t kva; - u_short *sel; - u_short *off; +vm86_getptr(struct vm86context *vmc, vm_offset_t kva, u_short *sel, + u_short *off) { int i; @@ -653,9 +646,7 @@ vm86_getptr(vmc, kva, sel, off) } int -vm86_sysarch(td, args) - struct thread *td; - char *args; +vm86_sysarch(struct thread *td, char *args) { int error = 0; struct i386_vm86_args ua; From owner-svn-src-all@freebsd.org Mon Apr 9 01:07:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DD69F92239; Mon, 9 Apr 2018 01:07:49 +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 B53246A921; Mon, 9 Apr 2018 01:07:48 +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 AB90717B21; Mon, 9 Apr 2018 01:07:48 +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 w3917moY060716; Mon, 9 Apr 2018 01:07:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3917mcW060711; Mon, 9 Apr 2018 01:07:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804090107.w3917mcW060711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 01:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332315 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 332315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 01:07:49 -0000 Author: emaste Date: Mon Apr 9 01:07:47 2018 New Revision: 332315 URL: https://svnweb.freebsd.org/changeset/base/332315 Log: MFC r331439: Sort headers in MD Linuxulator files Bring #includes closer to style(9) and reduce differences between the (three) MD versions of linux_machdep.c and linux_sysvec.c. Modified: stable/11/sys/amd64/linux/linux_machdep.c stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_machdep.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/11/sys/amd64/linux/linux_machdep.c Mon Apr 9 01:06:09 2018 (r332314) +++ stable/11/sys/amd64/linux/linux_machdep.c Mon Apr 9 01:07:47 2018 (r332315) @@ -33,15 +33,14 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include +#include #include -#include #include +#include #include -#include #include +#include #include #include #include @@ -55,8 +54,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include +#include #include #include @@ -72,21 +72,21 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include #include #include #include #include -#include +#include #include +#include #include #include #include #include -#include #include Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Mon Apr 9 01:06:09 2018 (r332314) +++ stable/11/sys/amd64/linux/linux_sysvec.c Mon Apr 9 01:07:47 2018 (r332315) @@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include #include Modified: stable/11/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_machdep.c Mon Apr 9 01:06:09 2018 (r332314) +++ stable/11/sys/amd64/linux32/linux32_machdep.c Mon Apr 9 01:07:47 2018 (r332315) @@ -34,13 +34,12 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include -#include -#include #include -#include -#include #include +#include +#include #include +#include #include #include #include @@ -52,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,19 +61,19 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include #include #include #include +#include #include #include #include #include #include -#include static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru); Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Mon Apr 9 01:06:09 2018 (r332314) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Mon Apr 9 01:07:47 2018 (r332315) @@ -54,8 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include #include Modified: stable/11/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/11/sys/i386/linux/linux_machdep.c Mon Apr 9 01:06:09 2018 (r332314) +++ stable/11/sys/i386/linux/linux_machdep.c Mon Apr 9 01:07:47 2018 (r332315) @@ -30,45 +30,45 @@ __FBSDID("$FreeBSD$"); #include -#include #include -#include #include +#include #include #include #include #include #include -#include #include #include #include #include #include +#include #include #include #include +#include +#include #include #include -#include #include #include #include #include -#include #include +#include #include #include #include +#include #include #include #include #include #include -#include #include /* needed for pcb definition in linux_set_thread_area */ From owner-svn-src-all@freebsd.org Mon Apr 9 05:43:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0F41F82842; Mon, 9 Apr 2018 05:43:30 +0000 (UTC) (envelope-from gonzo@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 94A137B784; Mon, 9 Apr 2018 05:43:30 +0000 (UTC) (envelope-from gonzo@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 8C4511A95D; Mon, 9 Apr 2018 05:43:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w395hUNe099739; Mon, 9 Apr 2018 05:43:30 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w395hUAT099738; Mon, 9 Apr 2018 05:43:30 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804090543.w395hUAT099738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 9 Apr 2018 05:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332316 - stable/11/usr.sbin/daemon X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/usr.sbin/daemon X-SVN-Commit-Revision: 332316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 05:43:31 -0000 Author: gonzo Date: Mon Apr 9 05:43:30 2018 New Revision: 332316 URL: https://svnweb.freebsd.org/changeset/base/332316 Log: MFC r328434 by maxim: o A command line flag for the syslog_facility fixed in the SYNOPSIS. PR: 225441 Modified: stable/11/usr.sbin/daemon/daemon.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/daemon/daemon.8 ============================================================================== --- stable/11/usr.sbin/daemon/daemon.8 Mon Apr 9 01:07:47 2018 (r332315) +++ stable/11/usr.sbin/daemon/daemon.8 Mon Apr 9 05:43:30 2018 (r332316) @@ -43,7 +43,7 @@ .Op Fl o Ar output_file .Op Fl s Ar syslog_priority .Op Fl T Ar syslog_tag -.Op Fl s Ar syslog_facility +.Op Fl l Ar syslog_facility .Ar command arguments ... .Sh DESCRIPTION The From owner-svn-src-all@freebsd.org Mon Apr 9 05:48:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D641AF82E83; Mon, 9 Apr 2018 05:48:12 +0000 (UTC) (envelope-from gonzo@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 8815B7E08A; Mon, 9 Apr 2018 05:48:12 +0000 (UTC) (envelope-from gonzo@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 829821A964; Mon, 9 Apr 2018 05:48:12 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w395mCYK099969; Mon, 9 Apr 2018 05:48:12 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w395mC59099968; Mon, 9 Apr 2018 05:48:12 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804090548.w395mC59099968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 9 Apr 2018 05:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332317 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 332317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 05:48:13 -0000 Author: gonzo Date: Mon Apr 9 05:48:12 2018 New Revision: 332317 URL: https://svnweb.freebsd.org/changeset/base/332317 Log: [man] Fix return type of BUS_ADD_CHILD(9) Fix return type of BUS_ADD_CHILD(9) in SYNOPSYS section, it should be device_t, not int PR: 207389 MFC after: 3 days Modified: head/share/man/man9/BUS_ADD_CHILD.9 Modified: head/share/man/man9/BUS_ADD_CHILD.9 ============================================================================== --- head/share/man/man9/BUS_ADD_CHILD.9 Mon Apr 9 05:43:30 2018 (r332316) +++ head/share/man/man9/BUS_ADD_CHILD.9 Mon Apr 9 05:48:12 2018 (r332317) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2015 +.Dd April 8, 2018 .Dt BUS_ADD_CHILD 9 .Os .Sh NAME @@ -37,7 +37,7 @@ .Sh SYNOPSIS .In sys/param.h .In sys/bus.h -.Ft int +.Ft device_t .Fn BUS_ADD_CHILD "device_t dev" "int order" "const char *name" "int unit" .Sh DESCRIPTION The From owner-svn-src-all@freebsd.org Mon Apr 9 08:25:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D78B7F8EB01; Mon, 9 Apr 2018 08:25:29 +0000 (UTC) (envelope-from smh@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 8A5AF745C2; Mon, 9 Apr 2018 08:25:29 +0000 (UTC) (envelope-from smh@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 847FE1C3A2; Mon, 9 Apr 2018 08:25:29 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w398PTqt079355; Mon, 9 Apr 2018 08:25:29 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w398PTFH079353; Mon, 9 Apr 2018 08:25:29 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201804090825.w398PTFH079353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 9 Apr 2018 08:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332318 - in stable/11: . sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: smh X-SVN-Commit-Paths: in stable/11: . sys/net X-SVN-Commit-Revision: 332318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 08:25:30 -0000 Author: smh Date: Mon Apr 9 08:25:29 2018 New Revision: 332318 URL: https://svnweb.freebsd.org/changeset/base/332318 Log: MFC r327559: Disabled the use of flowid for lagg by default Sponsored by: Multiplay Modified: stable/11/UPDATING stable/11/sys/net/if_lagg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Mon Apr 9 05:48:12 2018 (r332317) +++ stable/11/UPDATING Mon Apr 9 08:25:29 2018 (r332318) @@ -16,6 +16,14 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20180409: + The use of RSS hash from the network card aka flowid has been + disabled by default for lagg(4) as it's currently incompatible with + the lacp and loadbalance protocols. + + This can be re-enabled by setting the following in loader.conf: + net.link.lagg.default_use_flowid="1" + 20180331: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 6.0.0. Please see the 20141231 entry below for information about Modified: stable/11/sys/net/if_lagg.c ============================================================================== --- stable/11/sys/net/if_lagg.c Mon Apr 9 05:48:12 2018 (r332317) +++ stable/11/sys/net/if_lagg.c Mon Apr 9 08:25:29 2018 (r332318) @@ -238,7 +238,7 @@ SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, "Accept input from any interface in a failover lagg"); /* Default value for using flowid */ -static VNET_DEFINE(int, def_use_flowid) = 1; +static VNET_DEFINE(int, def_use_flowid) = 0; #define V_def_use_flowid VNET(def_use_flowid) SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RWTUN, &VNET_NAME(def_use_flowid), 0, From owner-svn-src-all@freebsd.org Mon Apr 9 08:36:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AFACF8F522; Mon, 9 Apr 2018 08:36:00 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D18B7A2A8; Mon, 9 Apr 2018 08:36:00 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id r191so17027532wmg.4; Mon, 09 Apr 2018 01:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mIeL8MStg/IyrwzX3MbeAknLDcJgxaEKI5uGo6XNYZI=; b=lxQhu3mIU5/WImTpwMfgVR+WSlsCtHRHBYUWfPMjQmyAFMwDkzopfLBcm3spojn/G4 zZj+tLrQ4fDejZAImes6/lblgxni7DydQXqr7tawjniwJIma1ew+XRtUddP2oD1TxEFc ASxkoU3A6qRoJc6ua+m1UWw5ZEFjmc+Qysh6waHmnPc0XyBhMhINR7q3UuQ8vZJ8TsKh Z/zasuSW3yG0Km2Karj1Xk93qMPcLvoPc3ZR74ccCDZW9FGfW8NxuePQVLaVQ4mPrcsb qnyRyS68crgQXo4dAS0iV/lBSBoq19IEHXNsXN5q+ww4fUWqlg6FrMUimGrXVmbL65EU tmWQ== 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=mIeL8MStg/IyrwzX3MbeAknLDcJgxaEKI5uGo6XNYZI=; b=mrYZ/ucn5cFrkNEewjlIKoEp372Sjkqs2qS4EDOk4dMX4dNqiShjeNihOVr+dVskCh lXkcDbu7oqdM/UnkyN6msX7ewrhvvsTk20zUGKpa5xLdJfpEPwp7+az1Kph8v4FHd3/Q ah0ZVyCxS2dKcgivCLon1CjSfVbcA5fb0dMTz1ifWa+2Rz39qzfo26tIPuZ9c/zf+VIv jOIm/81GgGnO8MrSYNGLhGG6Rf5HyLk+bg8EVYFh2GSOpuIPfYCaHEf67Hg/xyVKn99/ NiXDQNS/9ZFj3xxwpLBVwM2GCFMAzTQSje2IV56klbudPSUHxalXtm1wz+52yOUZ/YV7 71Rw== X-Gm-Message-State: ALQs6tC4UcIrQaREWDLOJfFa+fB3cMibA+s49HAlXFTJP2g/r3q4azbS VtqOletT9uLdDIVWXN9Gs3CKgg== X-Google-Smtp-Source: AIpwx4+YaIS90HJpJKh5irpIy7af40sdbgvqideGlUwdATxKWFZy1AwWqLsuh6A+ssjVZMuvP/TEDw== X-Received: by 10.80.179.92 with SMTP id r28mr9892284edd.145.1523262958354; Mon, 09 Apr 2018 01:35:58 -0700 (PDT) Received: from localhost (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id q19sm74948edd.39.2018.04.09.01.35.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 01:35:57 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Mon, 9 Apr 2018 09:35:54 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332092 - in head/sys: amd64/amd64 sys x86/x86 Message-ID: <20180409083554.k34hfijxiztwdne6@MacBook-Pro-de-Roger.local> References: <201804061120.w36BK6s6074635@repo.freebsd.org> <201804061617.w36GH9sw003442@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804061617.w36GH9sw003442@pdx.rh.CN85.dnsmgr.net> User-Agent: NeoMutt/20180323 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 08:36:00 -0000 On Fri, Apr 06, 2018 at 09:17:09AM -0700, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: royger > > Date: Fri Apr 6 11:20:06 2018 > > New Revision: 332092 > > URL: https://svnweb.freebsd.org/changeset/base/332092 > > > > Log: > > remove GiB/MiB macros from param.h > > > > And instead define them in the files where they are used. > > It would of been better to "revert" your prior change and > make a seperate new commit. It is rarely desireable to combine > a revert of a change with anything. A plain revert of r332072 would have left the tree in a broken state, because r332073 depends on those macros. IMO it's better to have a buildable tree at all times in order for it to be bisectable. Roger. From owner-svn-src-all@freebsd.org Mon Apr 9 09:24:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF41FF92CBB; Mon, 9 Apr 2018 09:24:27 +0000 (UTC) (envelope-from vmaffione@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 5F22774930; Mon, 9 Apr 2018 09:24:27 +0000 (UTC) (envelope-from vmaffione@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 51EE51CD62; Mon, 9 Apr 2018 09:24:27 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w399OR2D009314; Mon, 9 Apr 2018 09:24:27 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w399OQiQ009301; Mon, 9 Apr 2018 09:24:26 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201804090924.w399OQiQ009301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 9 Apr 2018 09:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332319 - in head/sys: dev/netmap net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys: dev/netmap net X-SVN-Commit-Revision: 332319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 09:24:28 -0000 Author: vmaffione Date: Mon Apr 9 09:24:26 2018 New Revision: 332319 URL: https://svnweb.freebsd.org/changeset/base/332319 Log: netmap: align codebase to upstream version v11.4 Changelist: - remove unused nkr_slot_flags - new nm_intr adapter callback to enable/disable interrupts - remove unused sysctls and document the other sysctls - new infrastructure to support NS_MOREFRAG for NIC ports - support for external memory allocator (for now linux-only), including linux-specific changes in common headers - optimizations within netmap pipes datapath - improvements on VALE control API - new nm_parse() helper function in netmap_user.h - various bug fixes and code clean up Approved by: hrs (mentor) Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_ixl_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_ptnet.c head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/if_vtnet_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/netmap/netmap_mem2.h head/sys/dev/netmap/netmap_monitor.c head/sys/dev/netmap/netmap_offloadings.c head/sys/dev/netmap/netmap_pipe.c head/sys/dev/netmap/netmap_pt.c head/sys/dev/netmap/netmap_vale.c head/sys/net/netmap.h head/sys/net/netmap_user.h head/sys/net/netmap_virt.h Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/if_em_netmap.h Mon Apr 9 09:24:26 2018 (r332319) @@ -235,8 +235,6 @@ em_netmap_rxsync(struct netmap_kring *kring, int flags * First part: import newly received packets. */ if (netmap_no_pendintr || force_update) { - uint16_t slot_flags = kring->nkr_slot_flags; - nic_i = rxr->next_to_check; nm_i = netmap_idx_n2k(kring, nic_i); @@ -247,7 +245,7 @@ em_netmap_rxsync(struct netmap_kring *kring, int flags if ((staterr & E1000_RXD_STAT_DD) == 0) break; ring->slot[nm_i].len = le16toh(curr->wb.upper.length); - ring->slot[nm_i].flags = slot_flags; + ring->slot[nm_i].flags = 0; bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[nic_i].map, BUS_DMASYNC_POSTREAD); nm_i = nm_next(nm_i, lim); Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/if_igb_netmap.h Mon Apr 9 09:24:26 2018 (r332319) @@ -217,8 +217,6 @@ igb_netmap_rxsync(struct netmap_kring *kring, int flag * First part: import newly received packets. */ if (netmap_no_pendintr || force_update) { - uint16_t slot_flags = kring->nkr_slot_flags; - nic_i = rxr->next_to_check; nm_i = netmap_idx_n2k(kring, nic_i); @@ -229,7 +227,7 @@ igb_netmap_rxsync(struct netmap_kring *kring, int flag if ((staterr & E1000_RXD_STAT_DD) == 0) break; ring->slot[nm_i].len = le16toh(curr->wb.upper.length); - ring->slot[nm_i].flags = slot_flags; + ring->slot[nm_i].flags = 0; bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[nic_i].pmap, BUS_DMASYNC_POSTREAD); nm_i = nm_next(nm_i, lim); Modified: head/sys/dev/netmap/if_ixl_netmap.h ============================================================================== --- head/sys/dev/netmap/if_ixl_netmap.h Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/if_ixl_netmap.h Mon Apr 9 09:24:26 2018 (r332319) @@ -331,7 +331,6 @@ ixl_netmap_rxsync(struct netmap_kring *kring, int flag */ if (netmap_no_pendintr || force_update) { int crclen = ixl_crcstrip ? 0 : 4; - uint16_t slot_flags = kring->nkr_slot_flags; nic_i = rxr->next_check; // or also k2n(kring->nr_hwtail) nm_i = netmap_idx_n2k(kring, nic_i); @@ -346,7 +345,7 @@ ixl_netmap_rxsync(struct netmap_kring *kring, int flag break; ring->slot[nm_i].len = ((qword & I40E_RXD_QW1_LENGTH_PBUF_MASK) >> I40E_RXD_QW1_LENGTH_PBUF_SHIFT) - crclen; - ring->slot[nm_i].flags = slot_flags; + ring->slot[nm_i].flags = 0; bus_dmamap_sync(rxr->ptag, rxr->buffers[nic_i].pmap, BUS_DMASYNC_POSTREAD); nm_i = nm_next(nm_i, lim); Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/if_lem_netmap.h Mon Apr 9 09:24:26 2018 (r332319) @@ -216,8 +216,6 @@ lem_netmap_rxsync(struct netmap_kring *kring, int flag * First part: import newly received packets. */ if (netmap_no_pendintr || force_update) { - uint16_t slot_flags = kring->nkr_slot_flags; - nic_i = adapter->next_rx_desc_to_check; nm_i = netmap_idx_n2k(kring, nic_i); @@ -234,7 +232,7 @@ lem_netmap_rxsync(struct netmap_kring *kring, int flag len = 0; } ring->slot[nm_i].len = len; - ring->slot[nm_i].flags = slot_flags; + ring->slot[nm_i].flags = 0; bus_dmamap_sync(adapter->rxtag, adapter->rx_buffer_area[nic_i].map, BUS_DMASYNC_POSTREAD); Modified: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- head/sys/dev/netmap/if_ptnet.c Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/if_ptnet.c Mon Apr 9 09:24:26 2018 (r332319) @@ -216,6 +216,7 @@ static void ptnet_update_vnet_hdr(struct ptnet_softc * static int ptnet_nm_register(struct netmap_adapter *na, int onoff); static int ptnet_nm_txsync(struct netmap_kring *kring, int flags); static int ptnet_nm_rxsync(struct netmap_kring *kring, int flags); +static void ptnet_nm_intr(struct netmap_adapter *na, int onoff); static void ptnet_tx_intr(void *opaque); static void ptnet_rx_intr(void *opaque); @@ -477,6 +478,7 @@ ptnet_attach(device_t dev) na_arg.nm_krings_create = ptnet_nm_krings_create; na_arg.nm_krings_delete = ptnet_nm_krings_delete; na_arg.nm_dtor = ptnet_nm_dtor; + na_arg.nm_intr = ptnet_nm_intr; na_arg.nm_register = ptnet_nm_register; na_arg.nm_txsync = ptnet_nm_txsync; na_arg.nm_rxsync = ptnet_nm_rxsync; @@ -1296,6 +1298,18 @@ ptnet_nm_rxsync(struct netmap_kring *kring, int flags) } return 0; +} + +static void +ptnet_nm_intr(struct netmap_adapter *na, int onoff) +{ + struct ptnet_softc *sc = if_getsoftc(na->ifp); + int i; + + for (i = 0; i < sc->num_rings; i++) { + struct ptnet_queue *pq = sc->queues + i; + pq->ptgh->guest_need_kick = onoff; + } } static void Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/if_re_netmap.h Mon Apr 9 09:24:26 2018 (r332319) @@ -201,7 +201,6 @@ re_netmap_rxsync(struct netmap_kring *kring, int flags * is to stop right before nm_hwcur. */ if (netmap_no_pendintr || force_update) { - uint16_t slot_flags = kring->nkr_slot_flags; uint32_t stop_i = nm_prev(kring->nr_hwcur, lim); nic_i = sc->rl_ldata.rl_rx_prodidx; /* next pkt to check */ @@ -218,7 +217,7 @@ re_netmap_rxsync(struct netmap_kring *kring, int flags /* XXX subtract crc */ total_len = (total_len < 4) ? 0 : total_len - 4; ring->slot[nm_i].len = total_len; - ring->slot[nm_i].flags = slot_flags; + ring->slot[nm_i].flags = 0; /* sync was in re_newbuf() */ bus_dmamap_sync(sc->rl_ldata.rl_rx_mtag, rxd[nic_i].rx_dmamap, BUS_DMASYNC_POSTREAD); Modified: head/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- head/sys/dev/netmap/if_vtnet_netmap.h Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/if_vtnet_netmap.h Mon Apr 9 09:24:26 2018 (r332319) @@ -122,6 +122,7 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int fl struct SOFTC_T *sc = ifp->if_softc; struct vtnet_txq *txq = &sc->vtnet_txqs[ring_nr]; struct virtqueue *vq = txq->vtntx_vq; + int interrupts = !(kring->nr_kflags & NKR_NOINTR); /* * First part: process new packets to send. @@ -179,7 +180,9 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int fl ring->head, ring->tail, virtqueue_nused(vq), (virtqueue_dump(vq), 1)); virtqueue_notify(vq); - virtqueue_enable_intr(vq); // like postpone with 0 + if (interrupts) { + virtqueue_enable_intr(vq); // like postpone with 0 + } } @@ -209,7 +212,7 @@ vtnet_netmap_txsync(struct netmap_kring *kring, int fl if (nm_i != kring->nr_hwtail /* && vtnet_txq_below_threshold(txq) == 0*/) { ND(3, "disable intr, hwcur %d", nm_i); virtqueue_disable_intr(vq); - } else { + } else if (interrupts) { ND(3, "enable intr, hwcur %d", nm_i); virtqueue_postpone_intr(vq, VQ_POSTPONE_SHORT); } @@ -277,6 +280,7 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl u_int const lim = kring->nkr_num_slots - 1; u_int const head = kring->rhead; int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; + int interrupts = !(kring->nr_kflags & NKR_NOINTR); /* device-specific */ struct SOFTC_T *sc = ifp->if_softc; @@ -297,7 +301,6 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl * and vtnet_netmap_init_buffers(). */ if (netmap_no_pendintr || force_update) { - uint16_t slot_flags = kring->nkr_slot_flags; struct netmap_adapter *token; nm_i = kring->nr_hwtail; @@ -309,7 +312,7 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl break; if (likely(token == (void *)rxq)) { ring->slot[nm_i].len = len; - ring->slot[nm_i].flags = slot_flags; + ring->slot[nm_i].flags = 0; nm_i = nm_next(nm_i, lim); n++; } else { @@ -334,7 +337,9 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl kring->nr_hwcur = err; virtqueue_notify(vq); /* After draining the queue may need an intr from the hypervisor */ - vtnet_rxq_enable_intr(rxq); + if (interrupts) { + vtnet_rxq_enable_intr(rxq); + } } ND("[C] h %d c %d t %d hwcur %d hwtail %d", @@ -345,6 +350,28 @@ vtnet_netmap_rxsync(struct netmap_kring *kring, int fl } +/* Enable/disable interrupts on all virtqueues. */ +static void +vtnet_netmap_intr(struct netmap_adapter *na, int onoff) +{ + struct SOFTC_T *sc = na->ifp->if_softc; + int i; + + for (i = 0; i < sc->vtnet_max_vq_pairs; i++) { + struct vtnet_rxq *rxq = &sc->vtnet_rxqs[i]; + struct vtnet_txq *txq = &sc->vtnet_txqs[i]; + struct virtqueue *txvq = txq->vtntx_vq; + + if (onoff) { + vtnet_rxq_enable_intr(rxq); + virtqueue_enable_intr(txvq); + } else { + vtnet_rxq_disable_intr(rxq); + virtqueue_disable_intr(txvq); + } + } +} + /* Make RX virtqueues buffers pointing to netmap buffers. */ static int vtnet_netmap_init_rx_buffers(struct SOFTC_T *sc) @@ -417,6 +444,7 @@ vtnet_netmap_attach(struct SOFTC_T *sc) na.nm_txsync = vtnet_netmap_txsync; na.nm_rxsync = vtnet_netmap_rxsync; na.nm_config = vtnet_netmap_config; + na.nm_intr = vtnet_netmap_intr; na.num_tx_rings = na.num_rx_rings = sc->vtnet_max_vq_pairs; D("max rings %d", sc->vtnet_max_vq_pairs); netmap_attach(&na); Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/ixgbe_netmap.h Mon Apr 9 09:24:26 2018 (r332319) @@ -397,7 +397,6 @@ ixgbe_netmap_rxsync(struct netmap_kring *kring, int fl */ if (netmap_no_pendintr || force_update) { int crclen = (ix_crcstrip || IXGBE_IS_VF(adapter) ) ? 0 : 4; - uint16_t slot_flags = kring->nkr_slot_flags; nic_i = rxr->next_to_check; // or also k2n(kring->nr_hwtail) nm_i = netmap_idx_n2k(kring, nic_i); @@ -409,7 +408,7 @@ ixgbe_netmap_rxsync(struct netmap_kring *kring, int fl if ((staterr & IXGBE_RXD_STAT_DD) == 0) break; ring->slot[nm_i].len = le16toh(curr->wb.upper.length) - crclen; - ring->slot[nm_i].flags = slot_flags; + ring->slot[nm_i].flags = 0; bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[nic_i].pmap, BUS_DMASYNC_POSTREAD); nm_i = nm_next(nm_i, lim); Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/netmap.c Mon Apr 9 09:24:26 2018 (r332319) @@ -482,10 +482,8 @@ ports attached to the switch) int netmap_verbose; static int netmap_no_timestamp; /* don't timestamp on rxsync */ -int netmap_mitigate = 1; int netmap_no_pendintr = 1; int netmap_txsync_retry = 2; -int netmap_flags = 0; /* debug flags */ static int netmap_fwd = 0; /* force transparent forwarding */ /* @@ -515,7 +513,9 @@ int netmap_generic_mit = 100*1000; * Anyway users looking for the best performance should * use native adapters. */ +#ifdef linux int netmap_generic_txqdisc = 1; +#endif /* Default number of slots and queues for generic adapters. */ int netmap_generic_ringsize = 1024; @@ -539,21 +539,32 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, verbose, CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, CTLFLAG_RW, &netmap_no_timestamp, 0, "no_timestamp"); -SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, - CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); +SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, CTLFLAG_RW, &netmap_no_pendintr, + 0, "Always look for new received packets."); SYSCTL_INT(_dev_netmap, OID_AUTO, txsync_retry, CTLFLAG_RW, - &netmap_txsync_retry, 0 , "Number of txsync loops in bridge's flush."); + &netmap_txsync_retry, 0, "Number of txsync loops in bridge's flush."); -SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, admode, CTLFLAG_RW, &netmap_admode, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, generic_mit, CTLFLAG_RW, &netmap_generic_mit, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, generic_ringsize, CTLFLAG_RW, &netmap_generic_ringsize, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, generic_rings, CTLFLAG_RW, &netmap_generic_rings, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, generic_txqdisc, CTLFLAG_RW, &netmap_generic_txqdisc, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, ptnet_vnet_hdr, CTLFLAG_RW, &ptnet_vnet_hdr, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, ptnetmap_tx_workers, CTLFLAG_RW, &ptnetmap_tx_workers, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0, + "Force NR_FORWARD mode"); +SYSCTL_INT(_dev_netmap, OID_AUTO, admode, CTLFLAG_RW, &netmap_admode, 0, + "Adapter mode. 0 selects the best option available," + "1 forces native adapter, 2 forces emulated adapter"); +SYSCTL_INT(_dev_netmap, OID_AUTO, generic_mit, CTLFLAG_RW, &netmap_generic_mit, + 0, "RX notification interval in nanoseconds"); +SYSCTL_INT(_dev_netmap, OID_AUTO, generic_ringsize, CTLFLAG_RW, + &netmap_generic_ringsize, 0, + "Number of per-ring slots for emulated netmap mode"); +SYSCTL_INT(_dev_netmap, OID_AUTO, generic_rings, CTLFLAG_RW, + &netmap_generic_rings, 0, + "Number of TX/RX queues for emulated netmap adapters"); +#ifdef linux +SYSCTL_INT(_dev_netmap, OID_AUTO, generic_txqdisc, CTLFLAG_RW, + &netmap_generic_txqdisc, 0, "Use qdisc for generic adapters"); +#endif +SYSCTL_INT(_dev_netmap, OID_AUTO, ptnet_vnet_hdr, CTLFLAG_RW, &ptnet_vnet_hdr, + 0, "Allow ptnet devices to use virtio-net headers"); +SYSCTL_INT(_dev_netmap, OID_AUTO, ptnetmap_tx_workers, CTLFLAG_RW, + &ptnetmap_tx_workers, 0, "Use worker threads for pnetmap TX processing"); SYSEND; @@ -912,8 +923,20 @@ netmap_hw_krings_delete(struct netmap_adapter *na) netmap_krings_delete(na); } +static void +netmap_mem_drop(struct netmap_adapter *na) +{ + int last = netmap_mem_deref(na->nm_mem, na); + /* if the native allocator had been overrided on regif, + * restore it now and drop the temporary one + */ + if (last && na->nm_mem_prev) { + netmap_mem_put(na->nm_mem); + na->nm_mem = na->nm_mem_prev; + na->nm_mem_prev = NULL; + } +} - /* * Undo everything that was done in netmap_do_regif(). In particular, * call nm_register(ifp,0) to stop netmap mode on the interface and @@ -980,7 +1003,7 @@ netmap_do_unregif(struct netmap_priv_d *priv) /* delete the nifp */ netmap_mem_if_delete(na, priv->np_nifp); /* drop the allocator */ - netmap_mem_deref(na->nm_mem, na); + netmap_mem_drop(na); /* mark the priv as unregistered */ priv->np_na = NULL; priv->np_nifp = NULL; @@ -1289,7 +1312,7 @@ netmap_rxsync_from_host(struct netmap_kring *kring, in D("%s", nm_dump_buf(NMB(na, slot),len, 128, NULL)); slot->len = len; - slot->flags = kring->nkr_slot_flags; + slot->flags = 0; nm_i = nm_next(nm_i, lim); mbq_enqueue(&fq, m); } @@ -1409,7 +1432,7 @@ netmap_get_hw_na(struct ifnet *ifp, struct netmap_mem_ assign_mem: if (nmd != NULL && !((*na)->na_flags & NAF_MEM_OWNER) && (*na)->active_fds == 0 && ((*na)->nm_mem != nmd)) { - netmap_mem_put((*na)->nm_mem); + (*na)->nm_mem_prev = (*na)->nm_mem; (*na)->nm_mem = netmap_mem_get(nmd); } @@ -1896,7 +1919,8 @@ netmap_krings_get(struct netmap_priv_d *priv) int excl = (priv->np_flags & NR_EXCLUSIVE); enum txrx t; - ND("%s: grabbing tx [%d, %d) rx [%d, %d)", + if (netmap_verbose) + D("%s: grabbing tx [%d, %d) rx [%d, %d)", na->name, priv->np_qfirst[NR_TX], priv->np_qlast[NR_TX], @@ -2059,10 +2083,58 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net if (na->active_fds == 0) { /* * If this is the first registration of the adapter, - * create the in-kernel view of the netmap rings, - * the netmap krings. + * perform sanity checks and create the in-kernel view + * of the netmap rings (the netmap krings). */ + if (na->ifp) { + /* This netmap adapter is attached to an ifnet. */ + unsigned nbs = netmap_mem_bufsize(na->nm_mem); + unsigned mtu = nm_os_ifnet_mtu(na->ifp); + /* The maximum amount of bytes that a single + * receive or transmit NIC descriptor can hold. */ + unsigned hw_max_slot_len = 4096; + if (mtu <= hw_max_slot_len) { + /* The MTU fits a single NIC slot. We only + * Need to check that netmap buffers are + * large enough to hold an MTU. NS_MOREFRAG + * cannot be used in this case. */ + if (nbs < mtu) { + nm_prerr("error: netmap buf size (%u) " + "< device MTU (%u)", nbs, mtu); + error = EINVAL; + goto err_drop_mem; + } + } else { + /* More NIC slots may be needed to receive + * or transmit a single packet. Check that + * the adapter supports NS_MOREFRAG and that + * netmap buffers are large enough to hold + * the maximum per-slot size. */ + if (!(na->na_flags & NAF_MOREFRAG)) { + nm_prerr("error: large MTU (%d) needed " + "but %s does not support " + "NS_MOREFRAG", mtu, + na->ifp->if_xname); + error = EINVAL; + goto err_drop_mem; + } else if (nbs < hw_max_slot_len) { + nm_prerr("error: using NS_MOREFRAG on " + "%s requires netmap buf size " + ">= %u", na->ifp->if_xname, + hw_max_slot_len); + error = EINVAL; + goto err_drop_mem; + } else { + nm_prinf("info: netmap application on " + "%s needs to support " + "NS_MOREFRAG " + "(MTU=%u,netmap_buf_size=%u)", + na->ifp->if_xname, mtu, nbs); + } + } + } + /* * Depending on the adapter, this may also create * the netmap rings themselves @@ -2128,15 +2200,15 @@ err_put_lut: memset(&na->na_lut, 0, sizeof(na->na_lut)); err_del_if: netmap_mem_if_delete(na, nifp); -err_rel_excl: - netmap_krings_put(priv); err_del_rings: netmap_mem_rings_delete(na); +err_rel_excl: + netmap_krings_put(priv); err_del_krings: if (na->active_fds == 0) na->nm_krings_delete(na); err_drop_mem: - netmap_mem_deref(na->nm_mem, na); + netmap_mem_drop(na); err: priv->np_na = NULL; return error; @@ -2224,6 +2296,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c do { /* memsize is always valid */ u_int memflags; + uint64_t memsize; if (nmr->nr_name[0] != '\0') { @@ -2243,10 +2316,11 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c } } - error = netmap_mem_get_info(nmd, &nmr->nr_memsize, &memflags, + error = netmap_mem_get_info(nmd, &memsize, &memflags, &nmr->nr_arg2); if (error) break; + nmr->nr_memsize = (uint32_t)memsize; if (na == NULL) /* only memory info */ break; nmr->nr_offset = 0; @@ -2304,6 +2378,17 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c } NMG_UNLOCK(); break; + } else if (i == NETMAP_POOLS_CREATE) { + nmd = netmap_mem_ext_create(nmr, &error); + if (nmd == NULL) + break; + /* reset the fields used by POOLS_CREATE to + * avoid confusing the rest of the code + */ + nmr->nr_cmd = 0; + nmr->nr_arg1 = 0; + nmr->nr_arg2 = 0; + nmr->nr_arg3 = 0; } else if (i != 0) { D("nr_cmd must be 0 not %d", i); error = EINVAL; @@ -2314,7 +2399,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c NMG_LOCK(); do { u_int memflags; - struct ifnet *ifp; + uint64_t memsize; if (priv->np_nifp != NULL) { /* thread already registered */ error = EBUSY; @@ -2356,12 +2441,13 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c nmr->nr_tx_rings = na->num_tx_rings; nmr->nr_rx_slots = na->num_rx_desc; nmr->nr_tx_slots = na->num_tx_desc; - error = netmap_mem_get_info(na->nm_mem, &nmr->nr_memsize, &memflags, + error = netmap_mem_get_info(na->nm_mem, &memsize, &memflags, &nmr->nr_arg2); if (error) { netmap_do_unregif(priv); break; } + nmr->nr_memsize = (uint32_t)memsize; if (memflags & NETMAP_MEM_PRIVATE) { *(uint32_t *)(uintptr_t)&nifp->ni_flags |= NI_PRIV_MEM; } @@ -2533,7 +2619,6 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM #define want_tx want[NR_TX] #define want_rx want[NR_RX] struct mbq q; /* packets from RX hw queues to host stack */ - enum txrx t; /* * In order to avoid nested locks, we need to "double check" @@ -2585,14 +2670,15 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM check_all_tx = nm_si_user(priv, NR_TX); check_all_rx = nm_si_user(priv, NR_RX); +#ifdef __FreeBSD__ /* * We start with a lock free round which is cheap if we have * slots available. If this fails, then lock and call the sync - * routines. + * routines. We can't do this on Linux, as the contract says + * that we must call nm_os_selrecord() unconditionally. */ -#if 1 /* new code- call rx if any of the ring needs to release or read buffers */ if (want_tx) { - t = NR_TX; + enum txrx t = NR_TX; for (i = priv->np_qfirst[t]; want[t] && i < priv->np_qlast[t]; i++) { kring = &NMR(na, t)[i]; /* XXX compare ring->cur and kring->tail */ @@ -2603,8 +2689,8 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM } } if (want_rx) { + enum txrx t = NR_RX; want_rx = 0; /* look for a reason to run the handlers */ - t = NR_RX; for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { kring = &NMR(na, t)[i]; if (kring->ring->cur == kring->ring->tail /* try fetch new buffers */ @@ -2615,24 +2701,20 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM if (!want_rx) revents |= events & (POLLIN | POLLRDNORM); /* we have data */ } -#else /* old code */ - for_rx_tx(t) { - for (i = priv->np_qfirst[t]; want[t] && i < priv->np_qlast[t]; i++) { - kring = &NMR(na, t)[i]; - /* XXX compare ring->cur and kring->tail */ - if (!nm_ring_empty(kring->ring)) { - revents |= want[t]; - want[t] = 0; /* also breaks the loop */ - } - } - } -#endif /* old code */ +#endif +#ifdef linux + /* The selrecord must be unconditional on linux. */ + nm_os_selrecord(sr, check_all_tx ? + &na->si[NR_TX] : &na->tx_rings[priv->np_qfirst[NR_TX]].si); + nm_os_selrecord(sr, check_all_rx ? + &na->si[NR_RX] : &na->rx_rings[priv->np_qfirst[NR_RX]].si); +#endif /* linux */ + /* * If we want to push packets out (priv->np_txpoll) or * want_tx is still set, we must issue txsync calls * (on all rings, to avoid that the tx rings stall). - * XXX should also check cur != hwcur on the tx rings. * Fortunately, normal tx mode has np_txpoll set. */ if (priv->np_txpoll || want_tx) { @@ -2649,6 +2731,12 @@ flush_tx: kring = &na->tx_rings[i]; ring = kring->ring; + /* + * Don't try to txsync this TX ring if we already found some + * space in some of the TX rings (want_tx == 0) and there are no + * TX slots in this ring that need to be flushed to the NIC + * (cur == hwcur). + */ if (!send_down && !want_tx && ring->cur == kring->nr_hwcur) continue; @@ -2676,14 +2764,18 @@ flush_tx: if (found) { /* notify other listeners */ revents |= want_tx; want_tx = 0; +#ifndef linux kring->nm_notify(kring, 0); +#endif /* linux */ } } /* if there were any packet to forward we must have handled them by now */ send_down = 0; if (want_tx && retry_tx && sr) { +#ifndef linux nm_os_selrecord(sr, check_all_tx ? &na->si[NR_TX] : &na->tx_rings[priv->np_qfirst[NR_TX]].si); +#endif /* !linux */ retry_tx = 0; goto flush_tx; } @@ -2734,14 +2826,18 @@ do_retry_rx: if (found) { revents |= want_rx; retry_rx = 0; +#ifndef linux kring->nm_notify(kring, 0); +#endif /* linux */ } } +#ifndef linux if (retry_rx && sr) { nm_os_selrecord(sr, check_all_rx ? &na->si[NR_RX] : &na->rx_rings[priv->np_qfirst[NR_RX]].si); } +#endif /* !linux */ if (send_down || retry_rx) { retry_rx = 0; if (send_down) @@ -2766,7 +2862,45 @@ do_retry_rx: #undef want_rx } +int +nma_intr_enable(struct netmap_adapter *na, int onoff) +{ + bool changed = false; + enum txrx t; + int i; + for_rx_tx(t) { + for (i = 0; i < nma_get_nrings(na, t); i++) { + struct netmap_kring *kring = &NMR(na, t)[i]; + int on = !(kring->nr_kflags & NKR_NOINTR); + + if (!!onoff != !!on) { + changed = true; + } + if (onoff) { + kring->nr_kflags &= ~NKR_NOINTR; + } else { + kring->nr_kflags |= NKR_NOINTR; + } + } + } + + if (!changed) { + return 0; /* nothing to do */ + } + + if (!na->nm_intr) { + D("Cannot %s interrupts for %s", onoff ? "enable" : "disable", + na->name); + return -1; + } + + na->nm_intr(na, onoff); + + return 0; +} + + /*-------------------- driver support routines -------------------*/ /* default notify callback */ @@ -2804,6 +2938,7 @@ netmap_attach_common(struct netmap_adapter *na) if (na->na_flags & NAF_HOST_RINGS && na->ifp) { na->if_input = na->ifp->if_input; /* for netmap_send_up */ } + na->pdev = na; /* make sure netmap_mem_map() is called */ #endif /* __FreeBSD__ */ if (na->nm_krings_create == NULL) { /* we assume that we have been called by a driver, @@ -2832,22 +2967,6 @@ netmap_attach_common(struct netmap_adapter *na) return 0; } - -/* standard cleanup, called by all destructors */ -void -netmap_detach_common(struct netmap_adapter *na) -{ - if (na->tx_rings) { /* XXX should not happen */ - D("freeing leftover tx_rings"); - na->nm_krings_delete(na); - } - netmap_pipe_dealloc(na); - if (na->nm_mem) - netmap_mem_put(na->nm_mem); - bzero(na, sizeof(*na)); - nm_os_free(na); -} - /* Wrapper for the register callback provided netmap-enabled * hardware drivers. * nm_iszombie(na) means that the driver module has been @@ -2900,7 +3019,7 @@ netmap_hw_dtor(struct netmap_adapter *na) * Return 0 on success, ENOMEM otherwise. */ int -netmap_attach_ext(struct netmap_adapter *arg, size_t size) +netmap_attach_ext(struct netmap_adapter *arg, size_t size, int override_reg) { struct netmap_hw_adapter *hwna = NULL; struct ifnet *ifp = NULL; @@ -2912,15 +3031,27 @@ netmap_attach_ext(struct netmap_adapter *arg, size_t s if (arg == NULL || arg->ifp == NULL) goto fail; + ifp = arg->ifp; + if (NA(ifp) && !NM_NA_VALID(ifp)) { + /* If NA(ifp) is not null but there is no valid netmap + * adapter it means that someone else is using the same + * pointer (e.g. ax25_ptr on linux). This happens for + * instance when also PF_RING is in use. */ + D("Error: netmap adapter hook is busy"); + return EBUSY; + } + hwna = nm_os_malloc(size); if (hwna == NULL) goto fail; hwna->up = *arg; hwna->up.na_flags |= NAF_HOST_RINGS | NAF_NATIVE; strncpy(hwna->up.name, ifp->if_xname, sizeof(hwna->up.name)); - hwna->nm_hw_register = hwna->up.nm_register; - hwna->up.nm_register = netmap_hw_reg; + if (override_reg) { + hwna->nm_hw_register = hwna->up.nm_register; + hwna->up.nm_register = netmap_hw_reg; + } if (netmap_attach_common(&hwna->up)) { nm_os_free(hwna); goto fail; @@ -2939,6 +3070,7 @@ netmap_attach_ext(struct netmap_adapter *arg, size_t s #endif /* NETMAP_LINUX_HAVE_NETDEV_OPS */ } hwna->nm_ndo.ndo_start_xmit = linux_netmap_start_xmit; + hwna->nm_ndo.ndo_change_mtu = linux_netmap_change_mtu; if (ifp->ethtool_ops) { hwna->nm_eto = *ifp->ethtool_ops; } @@ -2968,7 +3100,8 @@ fail: int netmap_attach(struct netmap_adapter *arg) { - return netmap_attach_ext(arg, sizeof(struct netmap_hw_adapter)); + return netmap_attach_ext(arg, sizeof(struct netmap_hw_adapter), + 1 /* override nm_reg */); } @@ -2996,7 +3129,15 @@ NM_DBG(netmap_adapter_put)(struct netmap_adapter *na) if (na->nm_dtor) na->nm_dtor(na); - netmap_detach_common(na); + if (na->tx_rings) { /* XXX should not happen */ + D("freeing leftover tx_rings"); + na->nm_krings_delete(na); + } + netmap_pipe_dealloc(na); + if (na->nm_mem) + netmap_mem_put(na->nm_mem); + bzero(na, sizeof(*na)); + nm_os_free(na); return 1; } @@ -3029,15 +3170,14 @@ netmap_detach(struct ifnet *ifp) NMG_LOCK(); netmap_set_all_rings(na, NM_KR_LOCKED); - na->na_flags |= NAF_ZOMBIE; /* * if the netmap adapter is not native, somebody * changed it, so we can not release it here. * The NAF_ZOMBIE flag will notify the new owner that * the driver is gone. */ - if (na->na_flags & NAF_NATIVE) { - netmap_adapter_put(na); + if (!(na->na_flags & NAF_NATIVE) || !netmap_adapter_put(na)) { + na->na_flags |= NAF_ZOMBIE; } /* give active users a chance to notice that NAF_ZOMBIE has been * turned on, so that they can stop and return an error to userspace. @@ -3116,9 +3256,9 @@ netmap_transmit(struct ifnet *ifp, struct mbuf *m) */ mbq_lock(q); - busy = kring->nr_hwtail - kring->nr_hwcur; - if (busy < 0) - busy += kring->nkr_num_slots; + busy = kring->nr_hwtail - kring->nr_hwcur; + if (busy < 0) + busy += kring->nkr_num_slots; if (busy + mbq_len(q) >= kring->nkr_num_slots - 1) { RD(2, "%s full hwcur %d hwtail %d qlen %d", na->name, kring->nr_hwcur, kring->nr_hwtail, mbq_len(q)); @@ -3216,16 +3356,6 @@ netmap_reset(struct netmap_adapter *na, enum txrx tx, kring->nr_hwtail -= lim + 1; } -#if 0 // def linux - /* XXX check that the mappings are correct */ - /* need ring_nr, adapter->pdev, direction */ - buffer_info->dma = dma_map_single(&pdev->dev, addr, adapter->rx_buffer_len, DMA_FROM_DEVICE); - if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma)) { - D("error mapping rx netmap buffer %d", i); - // XXX fix error handling - } - -#endif /* linux */ /* * Wakeup on the individual and global selwait * We do the wakeup here, but the ring is not yet reconfigured. Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/netmap_freebsd.c Mon Apr 9 09:24:26 2018 (r332319) @@ -173,6 +173,16 @@ nm_os_ifnet_fini(void) nm_ifnet_dh_tag); } +unsigned +nm_os_ifnet_mtu(struct ifnet *ifp) +{ +#if __FreeBSD_version < 1100030 + return ifp->if_data.ifi_mtu; +#else /* __FreeBSD_version >= 1100030 */ + return ifp->if_mtu; +#endif +} + rawsum_t nm_os_csum_raw(uint8_t *data, size_t len, rawsum_t cur_sum) { @@ -294,24 +304,30 @@ nm_os_catch_rx(struct netmap_generic_adapter *gna, int { struct netmap_adapter *na = &gna->up.up; struct ifnet *ifp = na->ifp; + int ret = 0; + nm_os_ifnet_lock(); if (intercept) { if (gna->save_if_input) { D("cannot intercept again"); - return EINVAL; /* already set */ + ret = EINVAL; /* already set */ + goto out; } gna->save_if_input = ifp->if_input; ifp->if_input = freebsd_generic_rx_handler; } else { if (!gna->save_if_input){ D("cannot restore"); - return EINVAL; /* not saved */ + ret = EINVAL; /* not saved */ + goto out; } ifp->if_input = gna->save_if_input; gna->save_if_input = NULL; } +out: + nm_os_ifnet_unlock(); - return 0; + return ret; } @@ -327,12 +343,14 @@ nm_os_catch_tx(struct netmap_generic_adapter *gna, int struct netmap_adapter *na = &gna->up.up; struct ifnet *ifp = netmap_generic_getifp(gna); + nm_os_ifnet_lock(); if (intercept) { na->if_transmit = ifp->if_transmit; ifp->if_transmit = netmap_transmit; } else { ifp->if_transmit = na->if_transmit; } + nm_os_ifnet_unlock(); return 0; } Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Mon Apr 9 08:25:29 2018 (r332318) +++ head/sys/dev/netmap/netmap_generic.c Mon Apr 9 09:24:26 2018 (r332319) @@ -86,8 +86,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define rtnl_lock() ND("rtnl_lock called") -#define rtnl_unlock() ND("rtnl_unlock called") #define MBUF_RXQ(m) ((m)->m_pkthdr.flowid) #define smp_mb() @@ -168,7 +166,13 @@ nm_os_get_mbuf(struct ifnet *ifp, int len) * has a KASSERT(), checking that the mbuf dtor function is not NULL. */ +#if __FreeBSD_version <= 1200050 +static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { } +#else /* __FreeBSD_version >= 1200051 */ +/* The arg1 and arg2 pointers argument were removed by r324446, which + * in included since version 1200051. */ static void void_mbuf_dtor(struct mbuf *m) { } +#endif /* __FreeBSD_version >= 1200051 */ #define SET_MBUF_DESTRUCTOR(m, fn) do { \ (m)->m_ext.ext_free = (fn != NULL) ? \ @@ -200,8 +204,6 @@ nm_os_get_mbuf(struct ifnet *ifp, int len) #include "win_glue.h" -#define rtnl_lock() ND("rtnl_lock called") -#define rtnl_unlock() ND("rtnl_unlock called") #define MBUF_TXQ(m) 0//((m)->m_pkthdr.flowid) #define MBUF_RXQ(m) 0//((m)->m_pkthdr.flowid) #define smp_mb() //XXX: to be correctly defined @@ -210,7 +212,6 @@ nm_os_get_mbuf(struct ifnet *ifp, int len) #include "bsd_glue.h" -#include /* rtnl_[un]lock() */ #include /* struct ethtool_ops, get_ringparam */ #include @@ -339,17 +340,13 @@ generic_netmap_unregister(struct netmap_adapter *na) int i, r; if (na->active_fds == 0) { - rtnl_lock(); - na->na_flags &= ~NAF_NETMAP_ON; - /* Release packet steering control. */ - nm_os_catch_tx(gna, 0); - /* Stop intercepting packets on the RX path. */ nm_os_catch_rx(gna, 0); - rtnl_unlock(); + /* Release packet steering control. */ + nm_os_catch_tx(gna, 0); } for_each_rx_kring_h(r, kring, na) { @@ -510,24 +507,20 @@ generic_netmap_register(struct netmap_adapter *na, int } if (na->active_fds == 0) { - rtnl_lock(); - /* Prepare to intercept incoming traffic. */ error = nm_os_catch_rx(gna, 1); if (error) { D("nm_os_catch_rx(1) failed (%d)", error); - goto register_handler; + goto free_tx_pools; } - /* Make netmap control the packet steering. */ + /* Let netmap control the packet steering. */ error = nm_os_catch_tx(gna, 1); if (error) { D("nm_os_catch_tx(1) failed (%d)", error); goto catch_rx; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Apr 9 12:53:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C757FFA1F87; Mon, 9 Apr 2018 12:53:16 +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 775FC86D34; Mon, 9 Apr 2018 12:53:16 +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 711ED1EF51; Mon, 9 Apr 2018 12:53:16 +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 w39CrG6H013967; Mon, 9 Apr 2018 12:53:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39CrGZa013963; Mon, 9 Apr 2018 12:53:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091253.w39CrGZa013963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 12:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332320 - stable/10/sys/dev/ath X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/dev/ath X-SVN-Commit-Revision: 332320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 12:53:17 -0000 Author: emaste Date: Mon Apr 9 12:53:15 2018 New Revision: 332320 URL: https://svnweb.freebsd.org/changeset/base/332320 Log: MFC ath(4) potential memory disclosure fixes [1] r327499: ath: fix memory disclosure from ath_btcoex_ioctl The ath_btcoex_ioctl handler allocated a buffer without M_ZERO and returned it to userland without writing to it. The device has permissions only for root so this is not urgent, and the fix can be MFCd and considered for a future EN. [2] r327500: ath: fix possible memory disclosures in ioctl handlers Apply the fix from r327499 to additional ioctl handlers. Note: related fix in r327529 does not apply directly to stable/10 and will be addressed in a followup commit. Submitted by: Domagoj Stolfa [1] Reported by: Ilja van Sprundel [1,2] Reviewed by: adrian [1] Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/ath/if_ath_btcoex.c stable/10/sys/dev/ath/if_ath_lna_div.c stable/10/sys/dev/ath/if_ath_spectral.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ath/if_ath_btcoex.c ============================================================================== --- stable/10/sys/dev/ath/if_ath_btcoex.c Mon Apr 9 09:24:26 2018 (r332319) +++ stable/10/sys/dev/ath/if_ath_btcoex.c Mon Apr 9 12:53:15 2018 (r332320) @@ -321,7 +321,7 @@ ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -330,6 +330,7 @@ ath_btcoex_ioctl(struct ath_softc *sc, struct ath_diag switch (id) { default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; Modified: stable/10/sys/dev/ath/if_ath_lna_div.c ============================================================================== --- stable/10/sys/dev/ath/if_ath_lna_div.c Mon Apr 9 09:24:26 2018 (r332319) +++ stable/10/sys/dev/ath/if_ath_lna_div.c Mon Apr 9 12:53:15 2018 (r332320) @@ -185,7 +185,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_dia * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -194,6 +194,7 @@ ath_lna_div_ioctl(struct ath_softc *sc, struct ath_dia switch (id) { default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; Modified: stable/10/sys/dev/ath/if_ath_spectral.c ============================================================================== --- stable/10/sys/dev/ath/if_ath_spectral.c Mon Apr 9 09:24:26 2018 (r332319) +++ stable/10/sys/dev/ath/if_ath_spectral.c Mon Apr 9 12:53:15 2018 (r332320) @@ -210,7 +210,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_di * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; @@ -273,6 +273,7 @@ ath_ioctl_spectral(struct ath_softc *sc, struct ath_di break; default: error = EINVAL; + goto bad; } if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; From owner-svn-src-all@freebsd.org Mon Apr 9 12:55:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8931BFA21E1; Mon, 9 Apr 2018 12: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 3CE9787E02; Mon, 9 Apr 2018 12: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 3213B1EF52; Mon, 9 Apr 2018 12: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 w39CtAFo014110; Mon, 9 Apr 2018 12:55:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39CtA8L014109; Mon, 9 Apr 2018 12:55:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091255.w39CtA8L014109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 12:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332321 - stable/10/sys/dev/ath X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/dev/ath X-SVN-Commit-Revision: 332321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 12:55:10 -0000 Author: emaste Date: Mon Apr 9 12:55:09 2018 New Revision: 332321 URL: https://svnweb.freebsd.org/changeset/base/332321 Log: MFC r327529: ath: fix possible memory disclosure in ioctl handler Submitted by: Domagoj Stolfa Modified: stable/10/sys/dev/ath/if_ath.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ath/if_ath.c ============================================================================== --- stable/10/sys/dev/ath/if_ath.c Mon Apr 9 12:53:15 2018 (r332320) +++ stable/10/sys/dev/ath/if_ath.c Mon Apr 9 12:55:09 2018 (r332321) @@ -5910,7 +5910,7 @@ ath_ioctl_diag(struct ath_softc *sc, struct ath_diag * * pointer for us to use below in reclaiming the buffer; * may want to be more defensive. */ - outdata = malloc(outsize, M_TEMP, M_NOWAIT); + outdata = malloc(outsize, M_TEMP, M_NOWAIT | M_ZERO); if (outdata == NULL) { error = ENOMEM; goto bad; From owner-svn-src-all@freebsd.org Mon Apr 9 12:57:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 183F4FA2405; Mon, 9 Apr 2018 12:57:09 +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 BF5F668F5A; Mon, 9 Apr 2018 12:57:08 +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 B4F4E1EF53; Mon, 9 Apr 2018 12:57:08 +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 w39Cv88H014242; Mon, 9 Apr 2018 12:57:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39Cv8wL014241; Mon, 9 Apr 2018 12:57:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091257.w39Cv8wL014241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 12:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332322 - stable/10/usr.bin/vtfontcvt X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/usr.bin/vtfontcvt X-SVN-Commit-Revision: 332322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 12:57:09 -0000 Author: emaste Date: Mon Apr 9 12:57:08 2018 New Revision: 332322 URL: https://svnweb.freebsd.org/changeset/base/332322 Log: MFC r331935: vtfontcvt: allow .bdf characters less than full height Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:55:09 2018 (r332321) +++ stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:57:08 2018 (r332322) @@ -265,10 +265,23 @@ parse_bdf(FILE *fp, unsigned int map_idx) if (strncmp(ln, "BITMAP", 6) == 0 && (ln[6] == ' ' || ln[6] == '\0')) { + /* + * Assume that the next _height_ lines are bitmap + * data. ENDCHAR is allowed to terminate the bitmap + * early but is not otherwise checked; any extra data + * is ignored. + */ for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) errx(1, "Unexpected EOF!\n"); ln[length - 1] = '\0'; + if (strcmp(ln, "ENDCHAR") == 0) { + memset(bytes + i * wbytes, 0, + (height - i) * wbytes); + memset(bytes_r + i * wbytes, 0, + (height - i) * wbytes); + break; + } sscanf(ln, "%x", &line); if (parse_bitmap_line(bytes + i * wbytes, bytes_r + i * wbytes, line, dwidth) != 0) From owner-svn-src-all@freebsd.org Mon Apr 9 12:58:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92889FA25ED; Mon, 9 Apr 2018 12:58:57 +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 8C12B69FD1; Mon, 9 Apr 2018 12:58:54 +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 E1C1F1EF55; Mon, 9 Apr 2018 12:58:53 +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 w39Cwro7014350; Mon, 9 Apr 2018 12:58:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39Cwr3p014349; Mon, 9 Apr 2018 12:58:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091258.w39Cwr3p014349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 12:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332323 - stable/10/usr.bin/vtfontcvt X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/usr.bin/vtfontcvt X-SVN-Commit-Revision: 332323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 12:58:57 -0000 Author: emaste Date: Mon Apr 9 12:58:53 2018 New Revision: 332323 URL: https://svnweb.freebsd.org/changeset/base/332323 Log: MFC r296920: vtfontcvt: support .hex fonts with chars beyond Unicode BMP This is already supported by the vt(4) vfnt format mapping from code points to glyphs. Update the .hex font parser to accept up to six hex digits. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:57:08 2018 (r332322) +++ stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:58:53 2018 (r332323) @@ -328,12 +328,13 @@ parse_hex(FILE *fp, unsigned int map_idx) if (bytes != NULL) errx(1, "malformed input: Width tag after font data"); set_width(atoi(ln + 9)); - } else if (sscanf(ln, "%4x:", &curchar)) { + } else if (sscanf(ln, "%6x:", &curchar)) { if (bytes == NULL) { bytes = xmalloc(wbytes * height); bytes_r = xmalloc(wbytes * height); } - p = ln + 5; + /* ln is guaranteed to have a colon here. */ + p = strchr(ln, ':') + 1; chars_per_row = strlen(p) / height; dwidth = width; if (chars_per_row / 2 > (width + 7) / 8) From owner-svn-src-all@freebsd.org Mon Apr 9 13:00:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6D5AFA270C; Mon, 9 Apr 2018 13:00:03 +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 733626AA23; Mon, 9 Apr 2018 13:00:03 +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 6E15F1EF5A; Mon, 9 Apr 2018 13:00:03 +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 w39D03Ob014501; Mon, 9 Apr 2018 13:00:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39D03eI014500; Mon, 9 Apr 2018 13:00:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091300.w39D03eI014500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 13:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332324 - stable/10/usr.bin/vtfontcvt X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/usr.bin/vtfontcvt X-SVN-Commit-Revision: 332324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 13:00:04 -0000 Author: emaste Date: Mon Apr 9 13:00:03 2018 New Revision: 332324 URL: https://svnweb.freebsd.org/changeset/base/332324 Log: MFC r282920: vtfontcvt: Allow 6 digits in verbose output Some fonts (e.g. GNU Unifont) have more than 100,000 (half-)glyphs. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 12:58:53 2018 (r332323) +++ stable/10/usr.bin/vtfontcvt/vtfontcvt.c Mon Apr 9 13:00:03 2018 (r332324) @@ -513,24 +513,24 @@ print_font_info(void) { printf( "Statistics:\n" -"- glyph_total: %5u\n" -"- glyph_normal: %5u\n" -"- glyph_normal_right: %5u\n" -"- glyph_bold: %5u\n" -"- glyph_bold_right: %5u\n" -"- glyph_unique: %5u\n" -"- glyph_dupe: %5u\n" -"- mapping_total: %5u\n" -"- mapping_normal: %5u\n" -"- mapping_normal_folded: %5u\n" -"- mapping_normal_right: %5u\n" -"- mapping_normal_right_folded: %5u\n" -"- mapping_bold: %5u\n" -"- mapping_bold_folded: %5u\n" -"- mapping_bold_right: %5u\n" -"- mapping_bold_right_folded: %5u\n" -"- mapping_unique: %5u\n" -"- mapping_dupe: %5u\n", +"- glyph_total: %6u\n" +"- glyph_normal: %6u\n" +"- glyph_normal_right: %6u\n" +"- glyph_bold: %6u\n" +"- glyph_bold_right: %6u\n" +"- glyph_unique: %6u\n" +"- glyph_dupe: %6u\n" +"- mapping_total: %6u\n" +"- mapping_normal: %6u\n" +"- mapping_normal_folded: %6u\n" +"- mapping_normal_right: %6u\n" +"- mapping_normal_right_folded: %6u\n" +"- mapping_bold: %6u\n" +"- mapping_bold_folded: %6u\n" +"- mapping_bold_right: %6u\n" +"- mapping_bold_right_folded: %6u\n" +"- mapping_unique: %6u\n" +"- mapping_dupe: %6u\n", glyph_total, glyph_count[0], glyph_count[1], From owner-svn-src-all@freebsd.org Mon Apr 9 13:01:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AB22FA29BB; Mon, 9 Apr 2018 13:01: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 B24B66BA39; Mon, 9 Apr 2018 13:01: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 AD5851EFAE; Mon, 9 Apr 2018 13:01: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 w39D1hOO019154; Mon, 9 Apr 2018 13:01:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39D1heB019153; Mon, 9 Apr 2018 13:01:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091301.w39D1heB019153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 13:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332325 - stable/10/sys/i386/i386 X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/i386/i386 X-SVN-Commit-Revision: 332325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 13:01:44 -0000 Author: emaste Date: Mon Apr 9 13:01:43 2018 New Revision: 332325 URL: https://svnweb.freebsd.org/changeset/base/332325 Log: MFC r331053: ANSIfy i386/vm86.c Modified: stable/10/sys/i386/i386/vm86.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/vm86.c ============================================================================== --- stable/10/sys/i386/i386/vm86.c Mon Apr 9 13:00:03 2018 (r332324) +++ stable/10/sys/i386/i386/vm86.c Mon Apr 9 13:01:43 2018 (r332325) @@ -128,8 +128,7 @@ POPL(struct vm86frame *vmf) } int -vm86_emulate(vmf) - struct vm86frame *vmf; +vm86_emulate(struct vm86frame *vmf) { struct vm86_kernel *vm86; caddr_t addr; @@ -586,10 +585,7 @@ vm86_intcall(int intnum, struct vm86frame *vmf) * caller's cs:ip routine. */ int -vm86_datacall(intnum, vmf, vmc) - int intnum; - struct vm86frame *vmf; - struct vm86context *vmc; +vm86_datacall(int intnum, struct vm86frame *vmf, struct vm86context *vmc) { pt_entry_t *pte = (pt_entry_t *)vm86paddr; vm_paddr_t page; @@ -634,11 +630,8 @@ vm86_getaddr(struct vm86context *vmc, u_short sel, u_s } int -vm86_getptr(vmc, kva, sel, off) - struct vm86context *vmc; - vm_offset_t kva; - u_short *sel; - u_short *off; +vm86_getptr(struct vm86context *vmc, vm_offset_t kva, u_short *sel, + u_short *off) { int i; @@ -653,9 +646,7 @@ vm86_getptr(vmc, kva, sel, off) } int -vm86_sysarch(td, args) - struct thread *td; - char *args; +vm86_sysarch(struct thread *td, char *args) { int error = 0; struct i386_vm86_args ua; From owner-svn-src-all@freebsd.org Mon Apr 9 13:32:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74BF1F80C15; Mon, 9 Apr 2018 13:32:13 +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 21AD47CB3D; Mon, 9 Apr 2018 13:32:13 +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 1C4F91F5B3; Mon, 9 Apr 2018 13:32:13 +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 w39DWC59034299; Mon, 9 Apr 2018 13:32:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39DWC1Y034298; Mon, 9 Apr 2018 13:32:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804091332.w39DWC1Y034298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Apr 2018 13:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332326 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 332326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 13:32:13 -0000 Author: trasz Date: Mon Apr 9 13:32:12 2018 New Revision: 332326 URL: https://svnweb.freebsd.org/changeset/base/332326 Log: cfumass(4) no longer requires iscsi(4). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/cfumass.4 Modified: head/share/man/man4/cfumass.4 ============================================================================== --- head/share/man/man4/cfumass.4 Mon Apr 9 13:01:43 2018 (r332325) +++ head/share/man/man4/cfumass.4 Mon Apr 9 13:32:12 2018 (r332326) @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 27, 2017 +.Dd April 9, 2018 .Dt CFUMASS 4 .Os .Sh NAME @@ -38,7 +38,6 @@ the kernel configuration file: .Bd -ragged -offset indent .Cd "device usb" .Cd "device usb_template" -.Cd "device iscsi" .Cd "device ctl" .Cd "device cfumass" .Ed From owner-svn-src-all@freebsd.org Mon Apr 9 13:37:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 322BAF81165; Mon, 9 Apr 2018 13:37:20 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 D65807F878; Mon, 9 Apr 2018 13:37:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 8E73A140ED; Mon, 9 Apr 2018 13:37:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 9 Apr 2018 13:37:17 +0000 From: Glen Barber To: Benno Rice Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331843 - in head/usr.sbin/makefs: . cd9660 Message-ID: <20180409133717.GB82598@FreeBSD.org> References: <201803311504.w2VF4gxR024784@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jy6Sn24JjFx/iggw" Content-Disposition: inline In-Reply-To: <201803311504.w2VF4gxR024784@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 13:37:20 -0000 --jy6Sn24JjFx/iggw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 31, 2018 at 03:04:42PM +0000, Benno Rice wrote: > Author: benno > Date: Sat Mar 31 15:04:41 2018 > New Revision: 331843 > URL: https://svnweb.freebsd.org/changeset/base/331843 >=20 > Log: > Synchronise with NetBSD's version of EFI handling for El Torito images. > =20 > When I implemented my EFI support I failed to check if the upstream ver= sion > of makefs in NetBSD had done the same. Override my version with theirs = to > make it easier to stay in sync with them in the future. > =20 > Reviewed by: imp, mav > Obtained from: NetBSD > MFC after: 1 week > Sponsored by: iXsystems, Inc. > Differential Revision: https://reviews.freebsd.org/D14913 >=20 > Modified: > head/usr.sbin/makefs/cd9660.c > head/usr.sbin/makefs/cd9660/cd9660_eltorito.c > head/usr.sbin/makefs/cd9660/cd9660_eltorito.h > head/usr.sbin/makefs/makefs.8 >=20 > Modified: head/usr.sbin/makefs/cd9660.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/makefs/cd9660.c Sat Mar 31 13:19:27 2018 (r331842) > +++ head/usr.sbin/makefs/cd9660.c Sat Mar 31 15:04:41 2018 (r331843) > @@ -309,6 +309,7 @@ cd9660_prep_opts(fsinfo_t *fsopts) > OPT_STR('\0', "no-boot", "No boot support"), > OPT_STR('\0', "hard-disk-boot", "Boot from hard disk"), > OPT_STR('\0', "boot-load-segment", "Boot load segment"), > + OPT_STR('\0', "platformid", "Section Header Platform ID"), > =20 > { .name =3D NULL } > }; > @@ -444,7 +445,8 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts > /* RRIP */ > cd9660_eltorito_add_boot_option(diskStructure, name, 0); > rv =3D 1; > - } else if (strcmp(name, "boot-load-segment") =3D=3D 0) { > + } else if (strcmp(name, "boot-load-segment") =3D=3D 0 || > + strcmp(name, "platformid") =3D=3D 0) { > if (buf[0] =3D=3D '\0') { > warnx("Option `%s' doesn't contain a value", > name); >=20 > Modified: head/usr.sbin/makefs/cd9660/cd9660_eltorito.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/makefs/cd9660/cd9660_eltorito.c Sat Mar 31 13:19:27 201= 8 (r331842) > +++ head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sat Mar 31 15:04:41 201= 8 (r331843) > @@ -1,4 +1,4 @@ > -/* $NetBSD: cd9660_eltorito.c,v 1.17 2011/06/23 02:35:56 enami Exp $ */ > +/* $NetBSD: cd9660_eltorito.c,v 1.23 2018/03/28 06:48:55 nonaka Exp $ */ > =20 > /*- > * SPDX-License-Identifier: BSD-2-Clause-NetBSD > @@ -47,16 +47,19 @@ __FBSDID("$FreeBSD$"); > #define ELTORITO_DPRINTF(__x) > #endif > =20 > +#include > + > static struct boot_catalog_entry *cd9660_init_boot_catalog_entry(void); > static struct boot_catalog_entry *cd9660_boot_setup_validation_entry(cha= r); > static struct boot_catalog_entry *cd9660_boot_setup_default_entry( > struct cd9660_boot_image *); > static struct boot_catalog_entry *cd9660_boot_setup_section_head(char); > -static struct boot_catalog_entry *cd9660_boot_setup_validation_entry(cha= r); > #if 0 > static u_char cd9660_boot_get_system_type(struct cd9660_boot_image *); > #endif > =20 > +static struct cd9660_boot_image *default_boot_image; > + > int > cd9660_add_boot_disk(iso9660_disk *diskStructure, const char *boot_info) > { > @@ -104,12 +107,9 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, co= ns > else if (strcmp(sysname, "macppc") =3D=3D 0 || > strcmp(sysname, "mac68k") =3D=3D 0) > new_image->system =3D ET_SYS_MAC; > - else if (strcmp(sysname, "efi") =3D=3D 0 || > - strcmp(sysname, "uefi") =3D=3D 0) > - new_image->system =3D ET_SYS_UEFI; > else { > warnx("boot disk system must be " > - "efi, i386, powerpc, macppc, mac68k"); > + "i386, powerpc, macppc, or mac68k"); > free(temp); > free(new_image); > return 0; It appears this part has broken creating disc1.iso (and other ISO images) for amd64. I see the following error: sh /usr/src/release/amd64/mkisoimages.sh -b 12_0_CURRENT_amd64_CD disc1.is= o disc1=20 200+0 records in 200+0 records out 819200 bytes transferred in 0.004175 secs (196222290 bytes/sec) newfs_msdos: cannot get number of sectors per track: Operation not support= ed newfs_msdos: cannot get number of heads: Operation not supported /dev/md3: 1557 sectors in 1557 FAT12 clusters (512 bytes/cluster) BytesPerSec=3D512 SecPerClust=3D1 ResSectors=3D1 FATs=3D2 RootDirEnts=3D51= 2 Sectors=3D1600 Media=3D0xf8 FATsecs=3D5 SecPerTrack=3D63 Heads=3D1 Hidden= Secs=3D0 makefs: boot disk system must be i386, powerpc, macppc, or mac68k Usage: makefs [-xZ] [-B endian] [-b free-blocks] [-d debug-mask] [-F mtree-specfile] [-f free-files] [-M minimum-size] [-m maximum-= size] [-N userdb-dir] [-O offset] [-o fs-options] [-R roundup-size] [-S sector-size] [-s image-size] [-T ] [-t fs-type] image-file directory | manifest [extra-directory ...] =20 cd9660 specific options: l, isolevel ISO Level v, verbose Turns on verbose output h, help Show help message S, follow-symlinks Resolve symlinks in pathnames R, rockridge Enable Rock-Ridge extensions C, chrp-boot Enable CHRP boot K, keep-bad-images Keep bad images D, allow-deep-trees Allow trees more than 8 levels a, allow-max-name Allow 37 char filenames (unimplemented) i, allow-illegal-chars Allow illegal characters in filenames m, allow-multidot Allow multiple periods in filenames o,omit-trailing-period Omit trailing periods in filenames allow-lowercase Allow lowercase characters in filenames archimedes Enable Archimedes structure no-trailing-padding Include padding areas A, applicationid Application Identifier P, publisher Publisher Identifier p, preparer Preparer Identifier L, label Disk Label V, volumeid Volume Set Identifier B, bootimage Boot image parameter G, generic-bootimage Generic boot image param bootimagedir Boot image directory no-emul-boot No boot emulation no-boot No boot support hard-disk-boot Boot from hard disk boot-load-segment Boot load segment platformid Section Header Platform ID Glen --jy6Sn24JjFx/iggw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlrLbI0ACgkQAxRYpUeP 4pN2KA//YS6DybQM7naJlv0iF88oKo8e8M7dYxi0MgLekVO/+pRStjaWEkp5AEHh RAz/N8wBlXRbn2d8Eku8p59KcL4+xOS6+PfOpjXPN1LbGXQjUCysOsVnK8+4tukU wRn2e6F6DdT6p3qTubGjO+cZPr9PzOw1wmMB3QGhjIKWdzkOWcFPdYsY3BCYCk0C tOIwQ2NCgs8xjnbKG+n5nJlfr/uXwjnz/vw83jLXbPkevLV1MaOHtDZ69VSoX+cQ i3WA0EwjDKHnx2eDwif1RxMkklrLmmGyRtO5ox+feNmYdb44CF50dvxjMSaX69G4 uVS6GndB0Cx/6H26Yt7TPr487q1sTITuz/8idYg6S4r5lqz8HqHRtOuvxZBdE8Wu zZ9Gkw4MFeWwVwh1L48tSPuNmD8vkmHKrft+CofRc7oyiUIQYoOJRRwIpkAssaN1 aw2ZwELixcopJGQ4LE4YgnCINSECmyRtzu2QlIlKj0Gx0d2Dwv90MDZf7NHI+9JO 0FJHZ/nzSo2ntMv0GY9YZYJm8R3TLo8n0KSVLdFtaL2IHsnFnIcA5viaOCiBPOYH uoVxXk3c+8OZ70rRqDQzJbHC1OodGnlma02TXeWU4euQUXPNn9g/HqLLLpM55uri 5g2AVuZlALyotYwpbumaFyjJEQPv2cXp0joHQMhil4eyOecbcAU= =BJNc -----END PGP SIGNATURE----- --jy6Sn24JjFx/iggw-- From owner-svn-src-all@freebsd.org Mon Apr 9 13:58:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19C18F828A1; Mon, 9 Apr 2018 13:58:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 AED7B6BC34; Mon, 9 Apr 2018 13:58:51 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 5EE1B54CF; Mon, 9 Apr 2018 13:58:51 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 9 Apr 2018 13:58:49 +0000 From: Glen Barber To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... Message-ID: <20180409135849.GA84067@FreeBSD.org> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <201804081654.w38Gs7JY007779@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 13:58:52 -0000 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > Author: brooks > Date: Sun Apr 8 16:54:07 2018 > New Revision: 332288 > URL: https://svnweb.freebsd.org/changeset/base/332288 >=20 > Log: > MFC r331797: > =20 > Use an accessor function to access ifr_data. > =20 > This fixes 32-bit compat (no ioctl command defintions are required > as struct ifreq is the same size). > =20 > Reviewed by: kib > Obtained from: CheriBSD > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D14900 >=20 > Modified: [...] > stable/11/sys/dev/wl/if_wl.c > Directory Properties: > stable/11/ (props changed) >=20 [...] > Modified: stable/11/sys/dev/wl/if_wl.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 > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 (r332287) > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 (r332288) > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) > } > WL_UNLOCK(sc); > =20 > - error =3D copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > + error =3D copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); > break; > =20 > =20 > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) > if ((error =3D priv_check(td, PRIV_DRIVER))) > break; > =20 > - error =3D copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > + error =3D copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > if (error) > break; > =09 > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) > /* get the current NWID out of the sc since we stored it there */ > case SIOCGWLCNWID: > WL_LOCK(sc); > - ifr->ifr_data =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > + ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > WL_UNLOCK(sc); > break; > =20 This part of the change appears to have broken i386 with the following: /usr/src/sys/modules/wl/../../dev/wl/if_wl.c:1360:24: error: expression is= not assignable ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1= ]); ~~~~~~~~~~~~~~~~~~~~~ ^ 1 error generated. --- if_wl.o --- *** [if_wl.o] Error code 1 make[4]: stopped in /usr/src/sys/modules/wl 1 error Glen --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlrLcZkACgkQAxRYpUeP 4pNpFRAAgEQj8AQMV+Kdt6xTLxrUejFNBrWsEAWhYrggK5OYyRCSbYcVfxTv8Va1 5q9HsuA/UpCoIAPdZznowhXzdAYUg7+jIo3z401N1Q9Lj2CPKqQZzVN3eyPXYaxk D4XgfeJV2AfrkHB9TvIVNVcfOuPGnDueTk8EYnLSWsQ3lPjh5luSnmPpe+wazZpl 6IAJh2qbECzSJihGd6yp6nXWJz42+q56N2B9Ccg0oUgf8zs7ncPoF5gOFSfDcdCp sGHhOXR9+Y9d1dB2r9eU0KhZYdH3DlY0uG7nFFIwxd3Yd4Mwwd4ubUF3nkpn/y3b qbioQdIFu2pCcnJQt6R4UibVqzOf/DeBwAhBmZfPsckAlWFBbSITRSb9zDHmIJMM PUIO2Mb3yBraAQUfLRCodq4qleUdA1w1mcAy85mp+f+iK6XHYJ42nCiSq/iGy2DO DysR5N7b5TvP/pmbcYBr/qv1oJAZva3w2LZFGB/dEsYTYYmdZLp1zMIROgIBtlO6 F71ECZtMAPIVBFl3evYiMCl9j5lnbkBvAi1HIG4PAhuTu22OjPPTw+7kACwbvcoI 1dI+x8hq1UOj+RM9S383a2K2vBs+D2PveepNQwSqJ+iP1Jp0uqbee+V9hq0cbk9z H6Uey4CX7cBKvjjTtOiNWHkr8OTHEibw8lZ8zyDKvQXQEZ5QfsY= =5Y1d -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs-- From owner-svn-src-all@freebsd.org Mon Apr 9 14:04:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B66E0F82F97; Mon, 9 Apr 2018 14:04:25 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) 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 551906EFD8; Mon, 9 Apr 2018 14:04:25 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 40KX9C6bdNzDhHq; Mon, 9 Apr 2018 14:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=daemonic.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=20151023; t=1523282655; bh=n8t1Xcs5UktdCZjSdPMX8w2B xEeE4ymM4EPHNZnTGMU=; b=JpjRpcxB5N+iWdxKgxrSMhUojvvwtwvKgcl7QW6B 2Pc+7Uc/Zq/L1UvmsXrl73NRFUvDN5lei0cvmmG18hfm2H6uF8CJ/1oXaSumSy3t IeiBBZivOioWUu+OPlym/mHcEWuaLHoJEgO9FX4oCiWEW2XTi6cuek3grmeEw6rF 2XU= 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 iIRL8nS-L3xx; Mon, 9 Apr 2018 14:04:15 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-191-149.mobileonline.telia.com [95.192.191.149]) by mail.daemonic.se (Postfix) with ESMTPSA id 40KX9C0TntzDh2K; Mon, 9 Apr 2018 14:04:15 +0000 (UTC) Subject: Re: svn commit: r331880 - stable/11/etc To: rgrimes@freebsd.org, Kyle Evans Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-11@freebsd.org References: <201804021539.w32FdaID083096@pdx.rh.CN85.dnsmgr.net> From: Niclas Zeising Message-ID: <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> Date: Mon, 9 Apr 2018 16:04:14 +0200 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201804021539.w32FdaID083096@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:04:25 -0000 On 04/02/18 17:39, Rodney W. Grimes wrote: >> Author: kevans >> Date: Mon Apr 2 15:28:48 2018 >> New Revision: 331880 >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> Log: >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> Modified: >> stable/11/etc/rc.subr >> Directory Properties: >> stable/11/ (props changed) >> >> Modified: stable/11/etc/rc.subr >> ============================================================================== >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> @@ -773,6 +773,8 @@ check_startmsgs() >> # >> # ${name}_login_class n Login class to use, else "daemon". >> # >> +# ${name}_limits n limits(1) to apply to ${command}. >> +# > > Caution, limits(1) is in /usr/bin, this code can fail if used before > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > this change if a call is made to limits. > > Sorry for jumping on this so late. This is also an issue in CURRENT, and has been since at least 2016. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 Regards -- Niclas From owner-svn-src-all@freebsd.org Mon Apr 9 14:05:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A34E3F830C9; Mon, 9 Apr 2018 14:05:44 +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 4DF9B6FBFC; Mon, 9 Apr 2018 14:05:44 +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 409AC1FAA4; Mon, 9 Apr 2018 14:05:44 +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 w39E5ipD049358; Mon, 9 Apr 2018 14:05:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39E5in8049357; Mon, 9 Apr 2018 14:05:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804091405.w39E5in8049357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Apr 2018 14:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332327 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 332327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:05:44 -0000 Author: kevans Date: Mon Apr 9 14:05:43 2018 New Revision: 332327 URL: https://svnweb.freebsd.org/changeset/base/332327 Log: if_awg: Add support for allwinner,{tx,rx}-delay-ps bindings Split out delay parsing into a separate function; we'll support both {tx,rx}-delay as well as the new versions. While here, validate that they're within the expected range and fail to attach if they are not. Assuming that we can clamp the delay is a bad idea that might result in a non-working awg anyways, so we'll fail early to make it easier to catch. This version also unsets the tx and rx delay registers unconditionally and then sets them if we read a non-zero delay. These delay properties should default to 0 if not specified, as declared in the binding documentation. Presumably the delays will be set via hardware configuration if they're not explicitly set in FDT. Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Mon Apr 9 13:32:12 2018 (r332326) +++ head/sys/arm/allwinner/if_awg.c Mon Apr 9 14:05:43 2018 (r332327) @@ -221,6 +221,8 @@ static struct resource_spec awg_spec[] = { static void awg_txeof(struct awg_softc *sc); +static int awg_parse_delay(device_t dev, uint32_t *tx_delay, + uint32_t *rx_delay); static uint32_t syscon_read_emac_clk_reg(device_t dev); static void syscon_write_emac_clk_reg(device_t dev, uint32_t val); static phandle_t awg_get_phy_node(device_t dev); @@ -1218,6 +1220,50 @@ awg_has_internal_phy(device_t dev) } static int +awg_parse_delay(device_t dev, uint32_t *tx_delay, uint32_t *rx_delay) +{ + phandle_t node; + uint32_t delay; + + if (tx_delay == NULL || rx_delay == NULL) + return (EINVAL); + *tx_delay = *rx_delay = 0; + node = ofw_bus_get_node(dev); + + if (OF_getencprop(node, "tx-delay", &delay, sizeof(delay)) >= 0) + *tx_delay = delay; + else if (OF_getencprop(node, "allwinner,tx-delay-ps", &delay, + sizeof(delay)) >= 0) { + if ((delay % 100) != 0) { + device_printf(dev, "tx-delay-ps is not a multiple of 100\n"); + return (EDOM); + } + *tx_delay = delay / 100; + } + if (*tx_delay > 7) { + device_printf(dev, "tx-delay out of range\n"); + return (ERANGE); + } + + if (OF_getencprop(node, "rx-delay", &delay, sizeof(delay)) >= 0) + *rx_delay = delay; + else if (OF_getencprop(node, "allwinner,rx-delay-ps", &delay, + sizeof(delay)) >= 0) { + if ((delay % 100) != 0) { + device_printf(dev, "rx-delay-ps is not within documented domain\n"); + return (EDOM); + } + *rx_delay = delay / 100; + } + if (*rx_delay > 31) { + device_printf(dev, "rx-delay out of range\n"); + return (ERANGE); + } + + return (0); +} + +static int awg_setup_phy(device_t dev) { struct awg_softc *sc; @@ -1260,16 +1306,22 @@ awg_setup_phy(device_t dev) else reg |= EMAC_CLK_PIT_MII | EMAC_CLK_SRC_MII; - if (OF_getencprop(node, "tx-delay", &tx_delay, - sizeof(tx_delay)) > 0) { - reg &= ~EMAC_CLK_ETXDC; + /* + * Fail attach if we fail to parse either of the delay + * parameters. If we don't have the proper delay to write to + * syscon, then awg likely won't function properly anyways. + * Lack of delay is not an error! + */ + error = awg_parse_delay(dev, &tx_delay, &rx_delay); + if (error != 0) + goto fail; + + /* Default to 0 and we'll increase it if we need to. */ + reg &= ~(EMAC_CLK_ETXDC | EMAC_CLK_ERXDC); + if (tx_delay > 0) reg |= (tx_delay << EMAC_CLK_ETXDC_SHIFT); - } - if (OF_getencprop(node, "rx-delay", &rx_delay, - sizeof(rx_delay)) > 0) { - reg &= ~EMAC_CLK_ERXDC; + if (rx_delay > 0) reg |= (rx_delay << EMAC_CLK_ERXDC_SHIFT); - } if (sc->type == EMAC_H3) { if (awg_has_internal_phy(dev)) { From owner-svn-src-all@freebsd.org Mon Apr 9 14:08:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA587F83292; Mon, 9 Apr 2018 14:08:00 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5583571063; Mon, 9 Apr 2018 14:08:00 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f42.google.com with SMTP id u3-v6so6767181lff.5; Mon, 09 Apr 2018 07:08:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oCGYrwQHHJ0IFmJbbht60KlBdEywmFujRzQDamoDZkc=; b=jU1bjweif2Kd3yllgiPT4+B74VbHWU/mPaR3/MLkPKyrEEErDdrYi0afhYHLrOqTjX +Y8X9sXP6+vqW75O6LfXTVne1jJADEwfXR9xg5auFd3visID+yb2Wr4x9mWI/1gCOudR eolnZGoZ3QRR4/H8amD8eJM2QINARGMpjJIJHN+4lCBdkBgbeD0jgX6IXluYPNoku+MQ b4Xi93ODDZH+2wsb2NDvYPgmBQZvN9HPuuTeMWxR0+pSsRCAtXI8dJ5YgXJmNBo9LmSo 8OxIu033ZajVjnIdg8cv1IZbLuXnfkFzlXD//ecACzZ8LQJiFnZMTtn8ZdoiEsIEPuW/ 3Sww== X-Gm-Message-State: ALQs6tBFU2QbMEA4UEdLIW87QbmdNLxXmxIcFLAoK0sMNnyR4DLV8G2J hCT3T5YHV4NcPpWpCGEr6b8SsFxC X-Google-Smtp-Source: AIpwx48rlwWtzsoXAH4GZtDCi9BSpazvmGajPyl5fLNXYA4uUENDesTM80RxRP+ap6FpT3MCdMDTRw== X-Received: by 10.46.77.80 with SMTP id a77mr22499836ljb.91.1523282872576; Mon, 09 Apr 2018 07:07:52 -0700 (PDT) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com. [209.85.215.43]) by smtp.gmail.com with ESMTPSA id y22sm81223ljy.70.2018.04.09.07.07.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 07:07:52 -0700 (PDT) Received: by mail-lf0-f43.google.com with SMTP id d20-v6so911233lfe.3; Mon, 09 Apr 2018 07:07:52 -0700 (PDT) X-Received: by 10.46.155.204 with SMTP id w12mr20724015ljj.76.1523282872326; Mon, 09 Apr 2018 07:07:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 07:07:31 -0700 (PDT) In-Reply-To: <201804091405.w39E5in8049357@repo.freebsd.org> References: <201804091405.w39E5in8049357@repo.freebsd.org> From: Kyle Evans Date: Mon, 9 Apr 2018 09:07:31 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332327 - head/sys/arm/allwinner To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:08:01 -0000 On Mon, Apr 9, 2018 at 9:05 AM, Kyle Evans wrote: > Author: kevans > Date: Mon Apr 9 14:05:43 2018 > New Revision: 332327 > URL: https://svnweb.freebsd.org/changeset/base/332327 > > Log: > if_awg: Add support for allwinner,{tx,rx}-delay-ps bindings > > Split out delay parsing into a separate function; we'll support both > {tx,rx}-delay as well as the new versions. > > While here, validate that they're within the expected range and fail to > attach if they are not. Assuming that we can clamp the delay is a bad idea > that might result in a non-working awg anyways, so we'll fail early to make > it easier to catch. > > This version also unsets the tx and rx delay registers unconditionally and > then sets them if we read a non-zero delay. These delay properties should > default to 0 if not specified, as declared in the binding documentation. > Presumably the delays will be set via hardware configuration if they're not > explicitly set in FDT. > Ugh, I dropped these: Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D15008 From owner-svn-src-all@freebsd.org Mon Apr 9 14:17:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1296F83CB0; Mon, 9 Apr 2018 14:17:37 +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 3480F76509; Mon, 9 Apr 2018 14:17:36 +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 w39EHXJh018894; Mon, 9 Apr 2018 07:17:33 -0700 (PDT) (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 w39EHXUH018893; Mon, 9 Apr 2018 07:17:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091417.w39EHXUH018893@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332092 - in head/sys: amd64/amd64 sys x86/x86 In-Reply-To: <20180409083554.k34hfijxiztwdne6@MacBook-Pro-de-Roger.local> To: "Roger Pau Monn?" Date: Mon, 9 Apr 2018 07:17:33 -0700 (PDT) CC: rgrimes@freebsd.org, 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:17:37 -0000 > On Fri, Apr 06, 2018 at 09:17:09AM -0700, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > > > Author: royger > > > Date: Fri Apr 6 11:20:06 2018 > > > New Revision: 332092 > > > URL: https://svnweb.freebsd.org/changeset/base/332092 > > > > > > Log: > > > remove GiB/MiB macros from param.h > > > > > > And instead define them in the files where they are used. > > > > It would of been better to "revert" your prior change and > > make a seperate new commit. It is rarely desireable to combine > > a revert of a change with anything. > > A plain revert of r332072 would have left the tree in a broken state, > because r332073 depends on those macros. IMO it's better to have a > buildable tree at all times in order for it to be bisectable. Well a revert of r332073 could of been combined leaving the tree building, and in the state before the attempt to do {MG}iB() macros. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 9 14:23:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 407D9F843AF; Mon, 9 Apr 2018 14:23:47 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF9C479D3A; Mon, 9 Apr 2018 14:23:46 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f66.google.com with SMTP id q9-v6so6835885lfk.9; Mon, 09 Apr 2018 07:23:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DHvm8bSuojJ4nBAae3KzlSPjh2sCYq3rLhLOOQoqvec=; b=hYy1/aY0zQ1+BZDe3KGUba1BlaXSvlxnApSBK45jcxNBSfIGA0mcstg1IJfmdk/P35 zJ4JrZ5heLV2lx47tmyZLCvg67XfWj6BfIR/VTyPXrHOvHhE/MMP95IAuHehNkjj1OJY 7quxghNEH/HB2csXwyvmDkBtCgvsp4KUImLLNj2NYlDZLDzHaVjExCPJz+Xic/tNZbq8 jincipO4w1ecgcXcVGvIhLeQelyyXP1mmBfptecUedCPkA7SSnNc+01LJpYBNs/NTT22 reJ3C6DLWV6TElQ8SJY2nZZUIvDuz+jvoZfqDWuADOD38or+7ZfTjjBoNIHTT0SVPd/X c2lQ== X-Gm-Message-State: ALQs6tBle1vzIZMDthA4R8ZmUF9kodKfOuhATMiJz9ErLaB3QPiO49Cq Qdg8V2e2UxKBzRYtSzTxhnNjKMmV X-Google-Smtp-Source: AIpwx4+4EWSuK22vXkv0qu/N9tg9mWNba7Cs1alXhrGHLM0O6mmfqzZDtSumA5FMFWUw+GmaHcZa4Q== X-Received: by 2002:a19:1a88:: with SMTP id a130-v6mr15517646lfa.7.1523283463809; Mon, 09 Apr 2018 07:17:43 -0700 (PDT) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com. [209.85.215.51]) by smtp.gmail.com with ESMTPSA id q23sm89522ljh.10.2018.04.09.07.17.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 07:17:43 -0700 (PDT) Received: by mail-lf0-f51.google.com with SMTP id q5-v6so6818542lff.12; Mon, 09 Apr 2018 07:17:43 -0700 (PDT) X-Received: by 10.46.148.72 with SMTP id o8mr22873605ljh.74.1523283463543; Mon, 09 Apr 2018 07:17:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 07:17:22 -0700 (PDT) In-Reply-To: <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> References: <201804021539.w32FdaID083096@pdx.rh.CN85.dnsmgr.net> <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> From: Kyle Evans Date: Mon, 9 Apr 2018 09:17:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Niclas Zeising Cc: "Rodney W. Grimes" , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:23:47 -0000 On Mon, Apr 9, 2018 at 9:04 AM, Niclas Zeising wrote: > On 04/02/18 17:39, Rodney W. Grimes wrote: >>> >>> Author: kevans >>> Date: Mon Apr 2 15:28:48 2018 >>> New Revision: 331880 >>> URL: https://svnweb.freebsd.org/changeset/base/331880 >>> >>> Log: >>> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf >>> daemon >>> Usage is ${name}_limits, and the argument is any flags accepted by >>> limits(1), such as `-n 100' (e.g. only allow 100 open files). >>> >>> Modified: >>> stable/11/etc/rc.subr >>> Directory Properties: >>> stable/11/ (props changed) >>> >>> Modified: stable/11/etc/rc.subr >>> >>> ============================================================================== >>> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >>> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >>> @@ -773,6 +773,8 @@ check_startmsgs() >>> # >>> # ${name}_login_class n Login class to use, else "daemon". >>> # >>> +# ${name}_limits n limits(1) to apply to ${command}. >>> +# >> >> >> Caution, limits(1) is in /usr/bin, this code can fail if used before >> /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> this change if a call is made to limits. >> >> > > Sorry for jumping on this so late. This is also an issue in CURRENT, and > has been since at least 2016. > > See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 > I kind of like Cy's approach in Comment #7.. scripts that start pretty early, at least, are bound to trip over all kinds of issues. I don't think it's a good idea to work around this in rc.subr like his "relief valve" patch since it'll just create hidden inconsistencies in some of these things. _limits isn't getting applied, but it's not obvious that _limits isn't getting applied because we just silently work around it. Before we know it, we'll be adding something else that's nice in the general case but not applicable for some of these earlier bits. Rod, what are you thoughts on these approaches? From owner-svn-src-all@freebsd.org Mon Apr 9 14:29:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5569FF849E1 for ; Mon, 9 Apr 2018 14:29:23 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-pf0-x22f.google.com (mail-pf0-x22f.google.com [IPv6:2607:f8b0:400e:c00::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C70D67CE41 for ; Mon, 9 Apr 2018 14:29:22 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-pf0-x22f.google.com with SMTP id f15so5850893pfn.0 for ; Mon, 09 Apr 2018 07:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vzSUPSfv1UrbfhO4BTkCq2gJBpbWdIxhL62NroYSdRg=; b=di7PkF52fSc7+dv08Ti1N5jddaNZgxuf1QyLjarirrF3FrXM7EGs2iMyfaoyY7i66H wlzA2Y+av0cRx/vDAzrSnq7JaRxzXnTicYM1J41ugXS0EqWww9HshjiDzkrHOmt3wd1z 051RudwBLLOc3ZA2OhjWtOklrjVVixuy8IxcD5q7HhijEcGtajX2aRlPUMpGDYsHJui4 38uj/iB7f1BpkGfEYT6Ov3VPMngmw66DbLH51y3v8yJ2jPrPxq/Xu2X7xJmJ0KOlANkA d96vLnxs+hNkcoOum4hq8RMwd9prh9nBd4awxWbmAhowT+z2upC8DDTjSZIjZNRPTQvj ih8w== 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=vzSUPSfv1UrbfhO4BTkCq2gJBpbWdIxhL62NroYSdRg=; b=LtE51pwxBSx2YCnzehPlHztmv0VndGIBzVWcM+2qFOP8OL29PpOB2dOnhD6sR8iF4Q mNjIwFJeLZJ4a7zkzdiCXghQDth5q+TJ1IdUozczxeHxSh3nrX6QjSjnJYq7RISKFpak buDSvB6orteldEOBlttCrNVUpPTOjycOk2O0veey6tLikUXLxUTnhyPZ9+3qQoqij3q3 KIKRdWnDCvgPm9EOE5q7FPzH2bHEWYyMRiu50YYxr7GrdEV/EwOMRGupWO2nLWgrWdqN yO14S3f2HOyzpnDoCCtY7247Qu4pU29iy2LFjpFnbBYJxIm1wU/y9fcqaLzkYHvVXTcf nMwA== X-Gm-Message-State: ALQs6tDD8vgLx+mhoBhBrb/Snve4RJrfATZ+nhKqobHExVx6IVl4yJvj DcsCKQHS8PxQCcf7sU2dzjWXWg== X-Google-Smtp-Source: AIpwx4+g2e7DedSn9DCtyCVJzmak/CWkTBnKD91h6/jM2Do8Dsb+pjmIy95XlGinP6IU2cg0RC2KKQ== X-Received: by 10.167.128.207 with SMTP id a15mr21562196pfn.116.1523284161516; Mon, 09 Apr 2018 07:29:21 -0700 (PDT) Received: from mutt-hbsd (abelohost-22.93.217.185.dedicated-ip.abelons.com. [185.217.93.22]) by smtp.gmail.com with ESMTPSA id u7sm1364243pgc.71.2018.04.09.07.29.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 07:29:20 -0700 (PDT) Date: Mon, 9 Apr 2018 10:29:06 -0400 From: Shawn Webb To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r331880 - stable/11/etc Message-ID: <20180409142906.74ohdz4eynugkqw5@mutt-hbsd> References: <201804021528.w32FSmd7023856@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gyszjjfkqrhzjybb" Content-Disposition: inline In-Reply-To: <201804021528.w32FSmd7023856@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:29:23 -0000 --gyszjjfkqrhzjybb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 02, 2018 at 03:28:48PM +0000, Kyle Evans wrote: > Author: kevans > Date: Mon Apr 2 15:28:48 2018 > New Revision: 331880 > URL: https://svnweb.freebsd.org/changeset/base/331880 >=20 > Log: > MFC r328331: Support configuring arbitrary limits(1) for any rc.conf da= emon > =20 > Usage is ${name}_limits, and the argument is any flags accepted by > limits(1), such as `-n 100' (e.g. only allow 100 open files). A HardenedBSD user has reported an issue with this commit: https://twitter.com/0x666c7578/status/982901931969597440 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 --gyszjjfkqrhzjybb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlrLeK0ACgkQaoRlj1JF bu6V0Q//Qf8xHDDtVOON3pqcBoEvb6eriu1pD9dYrc3jQ3gB9263m5mXjRgcEJec O1mc1/HH3GRyY5NA0Eb9Seuumwxmyi7qlyiz4YShvbFmxFZLhm4WykE0h7m5i2Io Agy2AhB8fELU8QdsRTq2k2FLT1dxJEIDcdkapqg5H0RnetZTePLyQdp4K9B5MClT IQpOEG2IA0r9BpEc1HdK8cL4uULhWAdwFhPNazTZKFjxlE7rolh81s/tiDyfoLip 5l/fFtU2PF3Axw+u/DaD25KYUWQd6qqZyOF0ycFmZi/hgrg1m4Cuh8lhE3dj6nnu aQOpBvAVhQSXY5PuO61gAy7uYe4MdLvCqJ4r55nY9NOdEQzZjlhOGBGyTOeqV3Oh 8WsUETwNlvCjTu9We2FENvsIrkUQebGZ/o+hK5DOSnxhObkWVMUOwcsWoBowWeE8 CYFbE0KQaYzNLpzA9biG3j4wKaM2zO4FPQPt7yTIgoOFiYGk+FdZiuWE59PoCc1i FsrIv9B/zyR+xBHYS7cTu92EiqFegAAbgeIKrgW9Z2akU0Qt4wa6PlmZXMgUBHL8 u3lyH3QxXILArhjm5FNky5tJ8dRB/+Vz9aQPx3ypBg2+obR0RJ7/jHxACr1TuEtG Ws7J0iKgTn3ToYDCGN+AZ2HNAcJM06oz1BLTi1REy85fRmxkgeU= =Zzh7 -----END PGP SIGNATURE----- --gyszjjfkqrhzjybb-- From owner-svn-src-all@freebsd.org Mon Apr 9 14:36:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 589BFF85178 for ; Mon, 9 Apr 2018 14:36:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA0C080CA8 for ; Mon, 9 Apr 2018 14:36:14 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wm0-x22f.google.com with SMTP id g8so19557144wmd.2 for ; Mon, 09 Apr 2018 07:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=IjeswyJELsWOv3khC7TPOXk/jzxm08WrTG7ZEdBM3Gc=; b=DaNks3h04X3u0lyPYYRlWP+bl0wacF5UXDH/5PVVvvnvwLi2Rk/WB/hOnoSzyZ6w6L r2m/W732+9yc9SE0ypfv0CVBnkg7zY7kmErI2C80E9CDgkqd4q5sBSBGy9TaeAe24llm FZl5CpbFGGL860xsVpaJ0FwnS0W5o+ed3VQcjok9jbIRNGsgODK7SQf+mRuVoH3dJH3a ON8lN0qTTxxFOxH6uK7zPJgmBFfW9jk0ER6PsuDMI92nLklbafqSXLCRe38ZLPG7RkST zEsfe1N+Q23ShNPrX/HyDjm72EYBEY80RyvnQicba25e7ciHtsGaEPGBAB/CDnWrYffv UJgw== 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=IjeswyJELsWOv3khC7TPOXk/jzxm08WrTG7ZEdBM3Gc=; b=AzCuwWzHJwD8ATs1jDm39Vpjfn1lk/L4Xi+oDpgyG2PXQ4DzgmFunMsusBNCaj/Z6p 6i/IEDsd3uggZzEZqvicmrVcljw51biomdJsncK31BHXfn7Os/iqBi0XHrNvxe6r5NwB REA1IhAJu5ACocR9IOziEUuyY5nT/K4RZtKll6Hbk1megCjJcvsPZ4nONXrocy6zv7FZ jos9ofDSu454FXue3Gw7iypBmcrexvUPGa+9wBEz+avfbMnMcYKfPHceIh8QzWz76r/N O2lwIOysvJZS8wEjyXjAUA3bP2afaowwKtK6idZd04GGT8M4r7VBi52lmjGOxEXbmSYz Tycw== X-Gm-Message-State: ALQs6tBQTk7lTvvrrt57C1QlO9BjEtTlWXbmF3tcQQ94bvEA6BFAjbpA /cwJAMz2ReUFGkJ5lga0HXsizw== X-Google-Smtp-Source: AIpwx4+JGA/nZkvaBi/NpOHdHqVPasWePb+OCtk3fvZ6AzK1H9VqsEPn31GRZ4vDaq3JvKJhvVN7FA== X-Received: by 10.80.164.182 with SMTP id w51mr22768622edb.152.1523284573338; Mon, 09 Apr 2018 07:36:13 -0700 (PDT) Received: from mutt-hbsd (abelohost-22.93.217.185.dedicated-ip.abelons.com. [185.217.93.22]) by smtp.gmail.com with ESMTPSA id s8sm411254edk.76.2018.04.09.07.36.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 07:36:12 -0700 (PDT) Date: Mon, 9 Apr 2018 10:35:51 -0400 From: Shawn Webb To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r331880 - stable/11/etc Message-ID: <20180409143551.i5uyt75zxe3cdpch@mutt-hbsd> References: <201804021528.w32FSmd7023856@repo.freebsd.org> <20180409142906.74ohdz4eynugkqw5@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ohd734bibnkchbxl" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171215 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:36:15 -0000 --ohd734bibnkchbxl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 09:33:38AM -0500, Kyle Evans wrote: > On Mon, Apr 9, 2018 at 9:29 AM, Shawn Webb w= rote: > > On Mon, Apr 02, 2018 at 03:28:48PM +0000, Kyle Evans wrote: > >> Author: kevans > >> Date: Mon Apr 2 15:28:48 2018 > >> New Revision: 331880 > >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> > >> Log: > >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf= daemon > >> > >> Usage is ${name}_limits, and the argument is any flags accepted by > >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > > > > A HardenedBSD user has reported an issue with this commit: > > > > https://twitter.com/0x666c7578/status/982901931969597440 > > >=20 > The mariadb ports should be good with this after ports r466451, > tracking PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227205 Awesome. 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 --ohd734bibnkchbxl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlrLekYACgkQaoRlj1JF bu4aLA/+OXXfsJ8qqUHGiO4fqAuvs6PjZle3N/gIvUMQzYFLJNVpRhi02dvcGSHX 3a/1nuyALE2D1dtlv5m3zxRJtVhLn6IiqELce8VGOhbgFtt1bI7Uwk9uHoS+JNk3 0mK12QYP2PJhzjaCQinjiT1B3yvXOWHuA5Iz4PTaF0sV5mAUT2rclXAzRiFhzk9C YktfYCs6Rmzk1zLqN2UeyR/aazoVFIgf2AB/fwz8YWxAc/ZdH/foUUd151yg2wVj DdyH1cdWIdz7xPO11L0247UCSUSy5HtNySgc63tXCw4ewG5WE3PKna6W/sAlB24s 1RN8NdhzKdwsg0g+3ydFh5N9pewNvD/379+xAH+CHGvalBcyxDycpw4jBjwB5si2 RMW3ZXnQKqEQwUD5RtnWIezZ/2ZkXtpW4UbEkAWcKxQdvxH7lUyJ0bTQcGjkqegh bmcg6lhk2GLe05jR2AAZh/M2Bg9OeKElHXC+uZpoR6EFPBv272yqkBxZ8UrubwXS ud2rgqeLfGS5oYkT+8h0CbtD7nJelZlgteWR8fYgRWI8N1MW+7cu96qd0ifoKGCQ dxJv6nBrepMGcHFrJMeTLzxH4HnkrdI1gFkJKF70MQusSY29ICkadjcb/tOadXo9 XotEy289YF2Ig86+YKjkrN43AHLf9WqJkhZo1ew9mqCHOdpCfO4= =ELwC -----END PGP SIGNATURE----- --ohd734bibnkchbxl-- From owner-svn-src-all@freebsd.org Mon Apr 9 14:46:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73853F85CC8; Mon, 9 Apr 2018 14:46:23 +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 E9BCF86A4F; Mon, 9 Apr 2018 14:46:22 +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 w39EkKmG019018; Mon, 9 Apr 2018 07:46:20 -0700 (PDT) (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 w39EkKdr019017; Mon, 9 Apr 2018 07:46:20 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091446.w39EkKdr019017@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> To: Niclas Zeising Date: Mon, 9 Apr 2018 07:46:20 -0700 (PDT) CC: rgrimes@freebsd.org, Kyle Evans , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:46:23 -0000 > On 04/02/18 17:39, Rodney W. Grimes wrote: > >> Author: kevans > >> Date: Mon Apr 2 15:28:48 2018 > >> New Revision: 331880 > >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> > >> Log: > >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > >> > >> Usage is ${name}_limits, and the argument is any flags accepted by > >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >> > >> Modified: > >> stable/11/etc/rc.subr > >> Directory Properties: > >> stable/11/ (props changed) > >> > >> Modified: stable/11/etc/rc.subr > >> ============================================================================== > >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >> @@ -773,6 +773,8 @@ check_startmsgs() > >> # > >> # ${name}_login_class n Login class to use, else "daemon". > >> # > >> +# ${name}_limits n limits(1) to apply to ${command}. > >> +# > > > > Caution, limits(1) is in /usr/bin, this code can fail if used before > > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > > this change if a call is made to limits. > > > > > > Sorry for jumping on this so late. This is also an issue in CURRENT, > and has been since at least 2016. I was aware that it was an issue and why I made a comment about it being MFC'ed. Though I had forgot a bug report existed. > See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 This bug is rat holed as it has no FreeBSD-foo@ in the cc list. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 9 15:00:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97EDCF86C4E; Mon, 9 Apr 2018 15:00:43 +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 146DB6E95D; Mon, 9 Apr 2018 15:00:42 +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 w39F0eN3019073; Mon, 9 Apr 2018 08:00:40 -0700 (PDT) (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 w39F0dIq019072; Mon, 9 Apr 2018 08:00:39 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091500.w39F0dIq019072@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 08:00:39 -0700 (PDT) CC: Niclas Zeising , "Rodney W. Grimes" , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org, dteske@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:00:43 -0000 Adding Devin Teske to cc: > On Mon, Apr 9, 2018 at 9:04 AM, Niclas Zeising > wrote: > > On 04/02/18 17:39, Rodney W. Grimes wrote: > >>> > >>> Author: kevans > >>> Date: Mon Apr 2 15:28:48 2018 > >>> New Revision: 331880 > >>> URL: https://svnweb.freebsd.org/changeset/base/331880 > >>> > >>> Log: > >>> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf > >>> daemon > >>> Usage is ${name}_limits, and the argument is any flags accepted by > >>> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >>> > >>> Modified: > >>> stable/11/etc/rc.subr > >>> Directory Properties: > >>> stable/11/ (props changed) > >>> > >>> Modified: stable/11/etc/rc.subr > >>> > >>> ============================================================================== > >>> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >>> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >>> @@ -773,6 +773,8 @@ check_startmsgs() > >>> # > >>> # ${name}_login_class n Login class to use, else "daemon". > >>> # > >>> +# ${name}_limits n limits(1) to apply to ${command}. > >>> +# > >> > >> > >> Caution, limits(1) is in /usr/bin, this code can fail if used before > >> /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > >> this change if a call is made to limits. > >> > >> > > > > Sorry for jumping on this so late. This is also an issue in CURRENT, and > > has been since at least 2016. > > > > See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 > > > > I kind of like Cy's approach in Comment #7.. scripts that start pretty > early, at least, are bound to trip over all kinds of issues. I think you mean comment #5, with a specific patch to rc.d/ddb in #7? If so I like that approach. > I don't think it's a good idea to work around this in rc.subr like his > "relief valve" patch since it'll just create hidden inconsistencies in > some of these things. _limits isn't getting applied, but it's not > obvious that _limits isn't getting applied because we just silently > work around it. Before we know it, we'll be adding something else > that's nice in the general case but not applicable for some of these > earlier bits. Agree fully with that, changing behavior based on avaliablility of a critical function would be a POLA issue. > Rod, what are you thoughts on these approaches? I am ok with Cy's #5/#7 fix. I would like to look closer at this limits(1) issue, as I do not understand why /etc/rc* suddenly grew the need to start tossing limits on programs in a generic way. Also if a specific user has a specific need to put a limit on a program could that not be done with: program_foo_limits="-C blah blah" foo_program="limits ${program_foo_limits} foo" in /etc/rc.conf or where ever else it is valid to do this. I would also like to ask Devin Teske to weigh in on these issues, so have added them to the CC: of this reply. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 9 15:01:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13F4CF86D24; Mon, 9 Apr 2018 15:01:41 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7338C6F2C7; Mon, 9 Apr 2018 15:01:40 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f41.google.com with SMTP id j20-v6so7048509lfk.2; Mon, 09 Apr 2018 08:01:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EsbbcdfpoboM9UAp9VJ/39H7uKzH5FQSUqR5l+l+MuY=; b=N0CNpypBuGgCg6g1v3eZpia0uhEKOBb/s6jDwD4C+tfUnXACoAxfAFssR5AtLq/HZP i87fC/KQUz8YhCLtfgPcwC6d/RxBk1NpPoq4le5gwFRM8+dtqhqrn9cY7oFtqZW6MlBG /TBVVLpsVGJpIr5T5M8XEwUcJr4pQ802QrQDWnFCdB4jG1Mw8sclyGKxFanq2BWwVaxf EjKVfk0xiWI/84p/0hrLPjN8JBVaDJFQKmMnxi9boq41DQz0ZvDQIJNoMxR5XL+u662j 2bVYuKSUaKNuSl2YQ0/ebgdQ9jpKusp4enErTed+BL31PzR5lHQv9R6Cp8mHndvucfPr 2WmQ== X-Gm-Message-State: ALQs6tB2g7jYYGuFw1tUhxSgbgnM3fB8xtsO13sDjCssdvKNvB4MjhD1 asCw/ZCrfJqKASChHWvyUVzZrqgx X-Google-Smtp-Source: AIpwx48fxevyK97vlp5oUqAJM+ISLsxOaATkuwFv/M9rUUwvVLp/x4of8kMY/KxZiLOPKMNHZO7T6Q== X-Received: by 2002:a19:511d:: with SMTP id f29-v6mr22014707lfb.39.1523285754323; Mon, 09 Apr 2018 07:55:54 -0700 (PDT) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com. [209.85.215.53]) by smtp.gmail.com with ESMTPSA id g22sm100318lje.36.2018.04.09.07.55.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 07:55:54 -0700 (PDT) Received: by mail-lf0-f53.google.com with SMTP id c78-v6so7008465lfh.1; Mon, 09 Apr 2018 07:55:54 -0700 (PDT) X-Received: by 10.46.128.132 with SMTP id i4mr22397396ljg.51.1523285753944; Mon, 09 Apr 2018 07:55:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 07:55:33 -0700 (PDT) In-Reply-To: <201804091446.w39EkKdr019017@pdx.rh.CN85.dnsmgr.net> References: <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> <201804091446.w39EkKdr019017@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 9 Apr 2018 09:55:33 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:01:41 -0000 On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes wrote: >> On 04/02/18 17:39, Rodney W. Grimes wrote: >> >> Author: kevans >> >> Date: Mon Apr 2 15:28:48 2018 >> >> New Revision: 331880 >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> >> >> Log: >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> >> >> Modified: >> >> stable/11/etc/rc.subr >> >> Directory Properties: >> >> stable/11/ (props changed) >> >> >> >> Modified: stable/11/etc/rc.subr >> >> ============================================================================== >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> >> @@ -773,6 +773,8 @@ check_startmsgs() >> >> # >> >> # ${name}_login_class n Login class to use, else "daemon". >> >> # >> >> +# ${name}_limits n limits(1) to apply to ${command}. >> >> +# >> > >> > Caution, limits(1) is in /usr/bin, this code can fail if used before >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> > this change if a call is made to limits. >> > >> > >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, >> and has been since at least 2016. > > I was aware that it was an issue and why I made a comment about it > being MFC'ed. Though I had forgot a bug report existed. I'm kind of surprised we haven't had more complaints about this- the original commit for this stuff landed before stable/11 was even branched, so it's been broken for all of 11.x's lifetime. >> See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 > > This bug is rat holed as it has no FreeBSD-foo@ in the cc list. > > > -- > Rod Grimes rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Mon Apr 9 15:09:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32BCEF87625; Mon, 9 Apr 2018 15:09:04 +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 A6203735D0; Mon, 9 Apr 2018 15:09:03 +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 w39F91r7019102; Mon, 9 Apr 2018 08:09:01 -0700 (PDT) (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 w39F91lw019101; Mon, 9 Apr 2018 08:09:01 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091509.w39F91lw019101@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: <20180409143551.i5uyt75zxe3cdpch@mutt-hbsd> To: Shawn Webb Date: Mon, 9 Apr 2018 08:09:01 -0700 (PDT) CC: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, dteske@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:09:04 -0000 -- Start of PGP signed section. > On Mon, Apr 09, 2018 at 09:33:38AM -0500, Kyle Evans wrote: > > On Mon, Apr 9, 2018 at 9:29 AM, Shawn Webb wrote: > > > On Mon, Apr 02, 2018 at 03:28:48PM +0000, Kyle Evans wrote: > > >> Author: kevans > > >> Date: Mon Apr 2 15:28:48 2018 > > >> New Revision: 331880 > > >> URL: https://svnweb.freebsd.org/changeset/base/331880 > > >> > > >> Log: > > >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > > >> > > >> Usage is ${name}_limits, and the argument is any flags accepted by > > >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > > > > > > A HardenedBSD user has reported an issue with this commit: > > > > > > https://twitter.com/0x666c7578/status/982901931969597440 > > > > > > > The mariadb ports should be good with this after ports r466451, > > tracking PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227205 > > Awesome. Thanks! Maybe not so awesome, as now if we go trying to fix the earlier issues it also now effects a pile of ports... *sigh*. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 9 15:11:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA9D4F878A4; Mon, 9 Apr 2018 15:11:17 +0000 (UTC) (envelope-from kp@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 5CAF374A6D; Mon, 9 Apr 2018 15:11:17 +0000 (UTC) (envelope-from kp@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 53341204BA; Mon, 9 Apr 2018 15:11:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39FBHfI082568; Mon, 9 Apr 2018 15:11:17 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39FBHOe082550; Mon, 9 Apr 2018 15:11:17 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804091511.w39FBHOe082550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 9 Apr 2018 15:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332328 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 332328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:11:17 -0000 Author: kp Date: Mon Apr 9 15:11:17 2018 New Revision: 332328 URL: https://svnweb.freebsd.org/changeset/base/332328 Log: MFC r331225: pf: Fix memory leak in DIOCRADDTABLES If a user attempts to add two tables with the same name the duplicate table will not be added, but we forgot to free the duplicate table, leaking memory. Ensure we free the duplicate table in the error path. Reported by: Coverity CID: 1382111 Modified: stable/11/sys/netpfil/pf/pf_table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_table.c Mon Apr 9 14:05:43 2018 (r332327) +++ stable/11/sys/netpfil/pf/pf_table.c Mon Apr 9 15:11:17 2018 (r332328) @@ -1124,8 +1124,10 @@ pfr_add_tables(struct pfr_table *tbl, int size, int *n if (p == NULL) senderr(ENOMEM); SLIST_FOREACH(q, &addq, pfrkt_workq) { - if (!pfr_ktable_compare(p, q)) + if (!pfr_ktable_compare(p, q)) { + pfr_destroy_ktable(p, 0); goto _skip; + } } SLIST_INSERT_HEAD(&addq, p, pfrkt_workq); xadd++; From owner-svn-src-all@freebsd.org Mon Apr 9 15:11:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53692F87A74 for ; Mon, 9 Apr 2018 15:11:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6EF974F6F for ; Mon, 9 Apr 2018 15:11:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id m134-v6so11497468itb.3 for ; Mon, 09 Apr 2018 08:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=IcgP45LvsA0dxyeA0F5EW1p0Yr7dianjX+d4V6ZrOmw=; b=l/crAJKOKejT228zU2mnz4qwfgtJGLXfWQlFmu4LQKFeXSdTjiZG6/QOlFc+ph6nPU d8X13eZtO5DhDSqg1KwSrPF/+GkwFAxQe09x3tenR3lVkoJqgEWOwHdTa3dg6gmuMhWf cCQpVZnzsH2e1M6gTGjGNDickGt/dMx2ww+qATptKX+MDbfHy+KkUw27Qo2yPuehrk2U fT0bT/a3e8WLV0wk5pFFfcgvvG8JUk6aHi0RYKCcxa3wvPZPNDdGhzM5BEqMl15rw4gy shdcVKpLfKQE5Sos63SGfZJAMfttlw+qk1CtR7ZomC2a6yCVXHyC/NCeDln/jYruVOhJ B/ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=IcgP45LvsA0dxyeA0F5EW1p0Yr7dianjX+d4V6ZrOmw=; b=H6OD4KTzP6tvwGSnFSAyqXVLmKoHZzbD7/FkEE4bqya+Ah/42yuEbBhhwTKp64VfTB b/eziikth1c9obbh2wv8DznIAwnVtfHLCXu11wK8dJrl6iuiiIFL70psXbAfAkA21R37 laV5rOAzqwVc3VGjC6OOErGGOqhwwsfTQZGuu4RWZBES732Sc0w1jBDWfRUcfl2h/fBa EfmMO47N8Cs3Jpf42z0ssWRfABYtfsdd04GiAHVZyZ3hOoyin+dAiM7Irkwv+ZRoAgER UQMcpuCSvVZEGtzzv6fWuIPfs7hr2FTk1W+KLd+F5GhGyR3kIpCu4m+pPELB7/9f7BeA 4KMA== X-Gm-Message-State: ALQs6tD/5lL7VFm3y/dIR4ASBF4zxh8mOAqWAs44CHTp1QWErEJypeqN 1uCBXFkKPeUSTRrIsQwiQfqsTnCvvPHA7EqtjXlzyA== X-Google-Smtp-Source: AIpwx48G8UifDIiCumYNYZnEkbHmI6nfkad4PBC1hfaTOKv6c8meWpAFX8pnQiO71Q2Cxm0qRBkPRjcRzMiBw5TEdUU= X-Received: by 2002:a24:1fc7:: with SMTP id d190-v6mr414606itd.57.1523286704589; Mon, 09 Apr 2018 08:11:44 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.228.135 with HTTP; Mon, 9 Apr 2018 08:11:44 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: <20180409135849.GA84067@FreeBSD.org> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> <20180409135849.GA84067@FreeBSD.org> From: Warner Losh Date: Mon, 9 Apr 2018 09:11:44 -0600 X-Google-Sender-Auth: PfZDE9aWdWQF_Hg9Ef2QAAxScP0 Message-ID: Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... To: Glen Barber Cc: Brooks Davis , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:11:46 -0000 On Mon, Apr 9, 2018 at 7:58 AM, Glen Barber wrote: > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Sun Apr 8 16:54:07 2018 > > New Revision: 332288 > > URL: https://svnweb.freebsd.org/changeset/base/332288 > > > > Log: > > MFC r331797: > > > > Use an accessor function to access ifr_data. > > > > This fixes 32-bit compat (no ioctl command defintions are required > > as struct ifreq is the same size). > > > > Reviewed by: kib > > Obtained from: CheriBSD > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D14900 > > > > Modified: > [...] > > stable/11/sys/dev/wl/if_wl.c > > > Directory Properties: > > stable/11/ (props changed) > > > [...] > > Modified: stable/11/sys/dev/wl/if_wl.c > > ============================================================ > ================== > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 > (r332287) > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 > (r332288) > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > data) > > } > > WL_UNLOCK(sc); > > > > - error = copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > + error = copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); > > break; > > > > > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > data) > > if ((error = priv_check(td, PRIV_DRIVER))) > > break; > > > > - error = copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > + error = copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > > if (error) > > break; > > > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > data) > > /* get the current NWID out of the sc since we stored it there */ > > case SIOCGWLCNWID: > > WL_LOCK(sc); > > - ifr->ifr_data = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > + ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > WL_UNLOCK(sc); > > break; > > > > This part of the change appears to have broken i386 with the following: > > /usr/src/sys/modules/wl/../../dev/wl/if_wl.c:1360:24: error: expression > is not assignable > ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | > sc->nwid[1]); > ~~~~~~~~~~~~~~~~~~~~~ ^ > 1 error generated. > --- if_wl.o --- > *** [if_wl.o] Error code 1 > > make[4]: stopped in /usr/src/sys/modules/wl > 1 error > wl has been removed in -current. It's pre-802.11 ISA card with thin market penetration. I would be shocked if anybody has run this on a FreeBSD system > 4.x. Warner From owner-svn-src-all@freebsd.org Mon Apr 9 15:14:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A2A3F87D7B; Mon, 9 Apr 2018 15:14:28 +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 983C9769BA; Mon, 9 Apr 2018 15:14:27 +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 w39FEPev019141; Mon, 9 Apr 2018 08:14:25 -0700 (PDT) (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 w39FEPRv019139; Mon, 9 Apr 2018 08:14:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091514.w39FEPRv019139@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 08:14:25 -0700 (PDT) CC: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:14:28 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes > wrote: > >> On 04/02/18 17:39, Rodney W. Grimes wrote: > >> >> Author: kevans > >> >> Date: Mon Apr 2 15:28:48 2018 > >> >> New Revision: 331880 > >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> >> > >> >> Log: > >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > >> >> > >> >> Usage is ${name}_limits, and the argument is any flags accepted by > >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >> >> > >> >> Modified: > >> >> stable/11/etc/rc.subr > >> >> Directory Properties: > >> >> stable/11/ (props changed) > >> >> > >> >> Modified: stable/11/etc/rc.subr > >> >> ============================================================================== > >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >> >> @@ -773,6 +773,8 @@ check_startmsgs() > >> >> # > >> >> # ${name}_login_class n Login class to use, else "daemon". > >> >> # > >> >> +# ${name}_limits n limits(1) to apply to ${command}. > >> >> +# > >> > > >> > Caution, limits(1) is in /usr/bin, this code can fail if used before > >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > >> > this change if a call is made to limits. > >> > > >> > > >> > >> Sorry for jumping on this so late. This is also an issue in CURRENT, > >> and has been since at least 2016. > > > > I was aware that it was an issue and why I made a comment about it > > being MFC'ed. Though I had forgot a bug report existed. > > I'm kind of surprised we haven't had more complaints about this- the > original commit for this stuff landed before stable/11 was even > branched, so it's been broken for all of 11.x's lifetime. History has taught me it takes a long time for this type of breakage to usually surface in a noticable way. Also I think until you merged this last ${name}_limits thing it actually didn't cause an issue, except for the few like me running diskless systems and or seperate /usr. This latest issue is a name space collision between base and ports. People who see limits issues due to missing /usr files usually know how to work around it, and they do, they just cp /usr/bin/limits to /bin, and do not submit a bug report or send an email. > >> See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 > > > > This bug is rat holed as it has no FreeBSD-foo@ in the cc list. > > > > > > -- > > Rod Grimes rgrimes@freebsd.org > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 9 15:19:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA1B0F88232; Mon, 9 Apr 2018 15:19:04 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478CD79370; Mon, 9 Apr 2018 15:19:04 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f46.google.com with SMTP id v207-v6so7130537lfa.10; Mon, 09 Apr 2018 08:19:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=30g27/wpeTpHfBYaLd2HMQVMSQ7oQOvmsWp5vEUCArg=; b=FU8OWa/7PdQK9StUIAt6J0IfIfdTp3uj+bzBBMOsSbpGG5AWdjvVygLNgss+unZMo+ 9AKKO8SfV0un9AMRuEO4mb0mMeycgBlrjwRXZ+dwPpuAL1Ye4TBpqWM5QaRYQKqIcFF7 rjqBAkTYwubmhR/u/qg8B/o3kIL3hQLJIHD26yN6H+3yQdS3y9G3RNtICio03OJJsYQr VcnNghW3KktXJizawRgSPJs25Yq11YoVuDAvSuFPCwpCCECiYumXMm3jiBw6tVZRUNR2 xMpx9qCtvqPK7FZguK29ZQyZl6NoH7/ipKxKc/30SmC8hYUHeBnyP117mED+nRr2Bl+y nevQ== X-Gm-Message-State: ALQs6tCEbuHwN+PGQ3Q7FIsnYnCHaRcx76e/HQ8IuQhGRMYxp6WIpRF9 Uo5QIoblDkAfkuk5X1hrmGD7RE7K X-Google-Smtp-Source: AIpwx48O8KFmZQMagSk83kJM8DVi6MnYfYFBY0ZwuprpOqlygOmOPw7oOm8yntXWCKzEcxW13W6ZeA== X-Received: by 10.46.135.134 with SMTP id n6mr23334599lji.52.1523287136763; Mon, 09 Apr 2018 08:18:56 -0700 (PDT) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com. [209.85.215.52]) by smtp.gmail.com with ESMTPSA id m127-v6sm118096lfm.79.2018.04.09.08.18.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 08:18:56 -0700 (PDT) Received: by mail-lf0-f52.google.com with SMTP id m200-v6so7135570lfm.4; Mon, 09 Apr 2018 08:18:56 -0700 (PDT) X-Received: by 10.46.91.21 with SMTP id p21mr23629606ljb.38.1523287136434; Mon, 09 Apr 2018 08:18:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 08:18:35 -0700 (PDT) In-Reply-To: <201804091514.w39FEPRv019139@pdx.rh.CN85.dnsmgr.net> References: <201804091514.w39FEPRv019139@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 9 Apr 2018 10:18:35 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Kyle Evans , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:19:05 -0000 On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes >> wrote: >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: >> >> >> Author: kevans >> >> >> Date: Mon Apr 2 15:28:48 2018 >> >> >> New Revision: 331880 >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> >> >> >> >> Log: >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> >> >> >> >> Modified: >> >> >> stable/11/etc/rc.subr >> >> >> Directory Properties: >> >> >> stable/11/ (props changed) >> >> >> >> >> >> Modified: stable/11/etc/rc.subr >> >> >> ============================================================================== >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() >> >> >> # >> >> >> # ${name}_login_class n Login class to use, else "daemon". >> >> >> # >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. >> >> >> +# >> >> > >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> >> > this change if a call is made to limits. >> >> > >> >> > >> >> >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, >> >> and has been since at least 2016. >> > >> > I was aware that it was an issue and why I made a comment about it >> > being MFC'ed. Though I had forgot a bug report existed. >> >> I'm kind of surprised we haven't had more complaints about this- the >> original commit for this stuff landed before stable/11 was even >> branched, so it's been broken for all of 11.x's lifetime. > > History has taught me it takes a long time for this type of > breakage to usually surface in a noticable way. Also I think > until you merged this last ${name}_limits thing it actually > didn't cause an issue, except for the few like me running > diskless systems and or seperate /usr. I don't see how this merge could possibly have been the cause of any claimed issues- like I said before, it didn't add any limits invocations, it added an arg to the limits invocation that already existed. You can see this pretty clearly from the diff, we didn't even change any conditions for limits to be invoked. > > This latest issue is a name space collision between base and ports. > > People who see limits issues due to missing /usr files usually > know how to work around it, and they do, they just cp /usr/bin/limits > to /bin, and do not submit a bug report or send an email. > That saddens me. =/ From owner-svn-src-all@freebsd.org Mon Apr 9 15:19:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C51DF8827E; Mon, 9 Apr 2018 15:19:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 EE1897953B; Mon, 9 Apr 2018 15:19:14 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 9F2005416; Mon, 9 Apr 2018 15:19:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 9 Apr 2018 15:19:09 +0000 From: Glen Barber To: Warner Losh Cc: Brooks Davis , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... Message-ID: <20180409151909.GA86045@FreeBSD.org> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> <20180409135849.GA84067@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:19:16 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 09:11:44AM -0600, Warner Losh wrote: > On Mon, Apr 9, 2018 at 7:58 AM, Glen Barber wrote: >=20 > > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Sun Apr 8 16:54:07 2018 > > > New Revision: 332288 > > > URL: https://svnweb.freebsd.org/changeset/base/332288 > > > > > > Log: > > > MFC r331797: > > > > > > Use an accessor function to access ifr_data. > > > > > > This fixes 32-bit compat (no ioctl command defintions are required > > > as struct ifreq is the same size). > > > > > > Reviewed by: kib > > > Obtained from: CheriBSD > > > Sponsored by: DARPA, AFRL > > > Differential Revision: https://reviews.freebsd.org/D14900 > > > > > > Modified: > > [...] > > > stable/11/sys/dev/wl/if_wl.c > > > > > Directory Properties: > > > stable/11/ (props changed) > > > > > [...] > > > Modified: stable/11/sys/dev/wl/if_wl.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 > > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 > > (r332287) > > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 > > (r332288) > > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > } > > > WL_UNLOCK(sc); > > > > > > - error =3D copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > > + error =3D copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_bu= f)); > > > break; > > > > > > > > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > if ((error =3D priv_check(td, PRIV_DRIVER))) > > > break; > > > > > > - error =3D copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > > + error =3D copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf= )); > > > if (error) > > > break; > > > > > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > /* get the current NWID out of the sc since we stored it there = */ > > > case SIOCGWLCNWID: > > > WL_LOCK(sc); > > > - ifr->ifr_data =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > > + ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwi= d[1]); > > > WL_UNLOCK(sc); > > > break; > > > > > > > This part of the change appears to have broken i386 with the following: > > > > /usr/src/sys/modules/wl/../../dev/wl/if_wl.c:1360:24: error: expression > > is not assignable > > ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | > > sc->nwid[1]); > > ~~~~~~~~~~~~~~~~~~~~~ ^ > > 1 error generated. > > --- if_wl.o --- > > *** [if_wl.o] Error code 1 > > > > make[4]: stopped in /usr/src/sys/modules/wl > > 1 error > > >=20 > wl has been removed in -current. It's pre-802.11 ISA card with thin mark= et > penetration. I would be shocked if anybody has run this on a FreeBSD syst= em > > 4.x. >=20 This commit is to stable/11. Glen --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlrLhGkACgkQAxRYpUeP 4pMzKg/+IF5RcZA2549N9JKhbGbIMtbGvqJv8YYvRI8arP77ABLzUQIb7VietEv9 Ddvtg64dRuEWQiHGpkZZbey5qN2uw8A2hVXqqNA1YKXoZUEsVw8PD6ww8dVy9N7n T+iPE/7oRMlby97fH/p2SshZiQ0rlghkNvidkEwjjj1cdGhwQLMGOATN8TR7zs0t 6dJnuJxcUgwOdC84U9q10J17x0Kx+vmz0szikCR0AF5wURkheYwTZUKsYgZ4Bjlu hskgFyd+S6emqpIjZ61RMJ1dT0IjcyoxMhYLmghQjcF3t2Okg+CWdAAtEv196S8x /+08kMYfKWu8anxqFbLf4TRcBL5rMxp9unXY/9Fq2wn0Xipz6AtGuPjarBNxMOJq 744FZU9rQTm7N6oU5cN7YrUDI7uododbFC5Ir3ZgzP8IegaxMOmFgo+CK/bOL/88 X5ddvQXeKmw9eV6ko7iV/ULS4KVj5Ze/LT6Gp0HSd5pXbBLEezlSTR4kgxzkBS8s 1b3ViZ98XteVHgP52Hp6hyJisdM8pVEsJVppfDcCU6rfgGJVu+56BAYQcrWwBQrC d/Ub9kEMjzh81HOfwRwJ5Vqk4rpWL0DmAaW8wD9yKUeSfda8tDkxrdEeismHmWX8 3bf5fyfVHKKQQ3YVEjEG94L3gcTo39uq5/nZGKhjoWUIPq/sGtc= =dxuA -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc-- From owner-svn-src-all@freebsd.org Mon Apr 9 15:20:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4A4BF8836D; Mon, 9 Apr 2018 15:20:01 +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 63FD179CCF; Mon, 9 Apr 2018 15:20:01 +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 w39FJxM6019162; Mon, 9 Apr 2018 08:19:59 -0700 (PDT) (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 w39FJx7f019161; Mon, 9 Apr 2018 08:19:59 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091519.w39FJx7f019161@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... In-Reply-To: To: Warner Losh Date: Mon, 9 Apr 2018 08:19:59 -0700 (PDT) CC: Glen Barber , Brooks Davis , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:20:02 -0000 > On Mon, Apr 9, 2018 at 7:58 AM, Glen Barber wrote: > > > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Sun Apr 8 16:54:07 2018 > > > New Revision: 332288 > > > URL: https://svnweb.freebsd.org/changeset/base/332288 > > > > > > Log: > > > MFC r331797: > > > > > > Use an accessor function to access ifr_data. > > > > > > This fixes 32-bit compat (no ioctl command defintions are required > > > as struct ifreq is the same size). > > > > > > Reviewed by: kib > > > Obtained from: CheriBSD > > > Sponsored by: DARPA, AFRL > > > Differential Revision: https://reviews.freebsd.org/D14900 > > > > > > Modified: > > [...] > > > stable/11/sys/dev/wl/if_wl.c > > > > > Directory Properties: > > > stable/11/ (props changed) > > > > > [...] > > > Modified: stable/11/sys/dev/wl/if_wl.c > > > ============================================================ > > ================== > > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 > > (r332287) > > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 > > (r332288) > > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > } > > > WL_UNLOCK(sc); > > > > > > - error = copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > > + error = copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); > > > break; > > > > > > > > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > if ((error = priv_check(td, PRIV_DRIVER))) > > > break; > > > > > > - error = copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > > + error = copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > > > if (error) > > > break; > > > > > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t > > data) > > > /* get the current NWID out of the sc since we stored it there */ > > > case SIOCGWLCNWID: > > > WL_LOCK(sc); > > > - ifr->ifr_data = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > > + ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > > WL_UNLOCK(sc); > > > break; > > > > > > > This part of the change appears to have broken i386 with the following: > > > > /usr/src/sys/modules/wl/../../dev/wl/if_wl.c:1360:24: error: expression > > is not assignable > > ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | > > sc->nwid[1]); > > ~~~~~~~~~~~~~~~~~~~~~ ^ > > 1 error generated. > > --- if_wl.o --- > > *** [if_wl.o] Error code 1 > > > > make[4]: stopped in /usr/src/sys/modules/wl > > 1 error > > > > wl has been removed in -current. It's pre-802.11 ISA card with thin market > penetration. I would be shocked if anybody has run this on a FreeBSD system > > 4.x. The last version of our Wireless WAN using these cards was at 5.4, the wl cards have been decomissioned and replaced with newer hardware, either way, we need stable/11 i386 to build please :-) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 9 15:21:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E173DF886FD; Mon, 9 Apr 2018 15:21:40 +0000 (UTC) (envelope-from brooks@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 8A47B7ACD6; Mon, 9 Apr 2018 15:21:40 +0000 (UTC) (envelope-from brooks@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 82CE520776; Mon, 9 Apr 2018 15:21:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39FLeVN087771; Mon, 9 Apr 2018 15:21:40 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39FLeED087770; Mon, 9 Apr 2018 15:21:40 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804091521.w39FLeED087770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 9 Apr 2018 15:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332329 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 332329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:21:41 -0000 Author: brooks Date: Mon Apr 9 15:21:40 2018 New Revision: 332329 URL: https://svnweb.freebsd.org/changeset/base/332329 Log: MFC r332151: ifconf(): correct handling of sockaddrs smaller than struct sockaddr. Portable programs that use SIOCGIFCONF (e.g. traceroute) assume that each pseudo ifreq is of length MAX(sizeof(struct ifreq), sizeof(ifr_name) + ifr_addr.sa_len). For short sockaddrs we copied too much from the source sockaddr resulting in a heap leak. I believe only one such sockaddr exists (struct sockaddr_sco which is 8 bytes) and it is unclear if such sockaddrs end up on interfaces in practice. If it did, the result would be an 8 byte heap leak on current architectures. admbugs: 869 Reviewed by: kib Obtained from: CheriBSD Security: kernel heap leak Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14981 Modified: stable/11/sys/net/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Mon Apr 9 15:11:17 2018 (r332328) +++ stable/11/sys/net/if.c Mon Apr 9 15:21:40 2018 (r332329) @@ -3153,7 +3153,13 @@ again: max_len += sizeof(ifr); } else if (sa->sa_len <= sizeof(*sa)) { - ifr.ifr_addr = *sa; + if (sa->sa_len < sizeof(*sa)) { + memset(&ifr.ifr_ifru.ifru_addr, 0, + sizeof(ifr.ifr_ifru.ifru_addr)); + memcpy(&ifr.ifr_ifru.ifru_addr, sa, + sa->sa_len); + } else + ifr.ifr_ifru.ifru_addr = *sa; sbuf_bcat(sb, &ifr, sizeof(ifr)); max_len += sizeof(ifr); } else { From owner-svn-src-all@freebsd.org Mon Apr 9 15:29:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB8EFF88EDF; Mon, 9 Apr 2018 15:29:15 +0000 (UTC) (envelope-from kp@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 5973A7F105; Mon, 9 Apr 2018 15:29:15 +0000 (UTC) (envelope-from kp@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 50DF5207B2; Mon, 9 Apr 2018 15:29:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39FTFk9089687; Mon, 9 Apr 2018 15:29:15 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39FTFdH089686; Mon, 9 Apr 2018 15:29:15 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804091529.w39FTFdH089686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 9 Apr 2018 15:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332330 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/10/sys/netpfil/pf X-SVN-Commit-Revision: 332330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:29:15 -0000 Author: kp Date: Mon Apr 9 15:29:14 2018 New Revision: 332330 URL: https://svnweb.freebsd.org/changeset/base/332330 Log: MFC r331225: pf: Fix memory leak in DIOCRADDTABLES If a user attempts to add two tables with the same name the duplicate table will not be added, but we forgot to free the duplicate table, leaking memory. Ensure we free the duplicate table in the error path. Reported by: Coverity CID: 1382111 Modified: stable/10/sys/netpfil/pf/pf_table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_table.c Mon Apr 9 15:21:40 2018 (r332329) +++ stable/10/sys/netpfil/pf/pf_table.c Mon Apr 9 15:29:14 2018 (r332330) @@ -1123,8 +1123,10 @@ pfr_add_tables(struct pfr_table *tbl, int size, int *n if (p == NULL) senderr(ENOMEM); SLIST_FOREACH(q, &addq, pfrkt_workq) { - if (!pfr_ktable_compare(p, q)) + if (!pfr_ktable_compare(p, q)) { + pfr_destroy_ktable(p, 0); goto _skip; + } } SLIST_INSERT_HEAD(&addq, p, pfrkt_workq); xadd++; From owner-svn-src-all@freebsd.org Mon Apr 9 15:30:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33588F8905B; Mon, 9 Apr 2018 15:30:06 +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 7986E7F93F; Mon, 9 Apr 2018 15:30:05 +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 w39FU3Q6019212; Mon, 9 Apr 2018 08:30:03 -0700 (PDT) (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 w39FU3vU019211; Mon, 9 Apr 2018 08:30:03 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091530.w39FU3vU019211@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 08:30:03 -0700 (PDT) CC: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:30:06 -0000 > On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes > wrote: > >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes > >> wrote: > >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: > >> >> >> Author: kevans > >> >> >> Date: Mon Apr 2 15:28:48 2018 > >> >> >> New Revision: 331880 > >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> >> >> > >> >> >> Log: > >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > >> >> >> > >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by > >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >> >> >> > >> >> >> Modified: > >> >> >> stable/11/etc/rc.subr > >> >> >> Directory Properties: > >> >> >> stable/11/ (props changed) > >> >> >> > >> >> >> Modified: stable/11/etc/rc.subr > >> >> >> ============================================================================== > >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() > >> >> >> # > >> >> >> # ${name}_login_class n Login class to use, else "daemon". > >> >> >> # > >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. > >> >> >> +# > >> >> > > >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before > >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > >> >> > this change if a call is made to limits. > >> >> > > >> >> > > >> >> > >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, > >> >> and has been since at least 2016. > >> > > >> > I was aware that it was an issue and why I made a comment about it > >> > being MFC'ed. Though I had forgot a bug report existed. > >> > >> I'm kind of surprised we haven't had more complaints about this- the > >> original commit for this stuff landed before stable/11 was even > >> branched, so it's been broken for all of 11.x's lifetime. > > > > History has taught me it takes a long time for this type of > > breakage to usually surface in a noticable way. Also I think > > until you merged this last ${name}_limits thing it actually > > didn't cause an issue, except for the few like me running > > diskless systems and or seperate /usr. > > I don't see how this merge could possibly have been the cause of any > claimed issues- like I said before, it didn't add any limits > invocations, it added an arg to the limits invocation that already > existed. You can see this pretty clearly from the diff, we didn't even > change any conditions for limits to be invoked. limits_mysql="NO" is defined by the startup script for mysql, that now causes /etc/rc to try and use that variable in a different way. You added a variable, one that was already in use by some other /etc/rc* related component. Collision of differening uses is causing errors. > > This latest issue is a name space collision between base and ports. > > > > People who see limits issues due to missing /usr files usually > > know how to work around it, and they do, they just cp /usr/bin/limits > > to /bin, and do not submit a bug report or send an email. > > > > That saddens me. =/ Sorry for the reality check. Breakage can often take years before someone notices some side effect that was never for seen. Its just the nature of the beast. I am *still* dealing with the fall out that was the FreeBSD 6.0 conversion from standalone ata code to ata over cam. Our error reporting and handling is still not as robust as that which I have in my 5.4p8 based systems. I think it was near 2 years before someone noticed that a change to telldir() caused Samba performance to go in the tank. And iirc that change was done to make it Posix compliant! I try to keep in mind that every bug being fixed often has an unknown new bug being introduced, and some times 2. If you do not believe this, go look at the coverty graphs, despite the fact that many coverty errors have been fixed, we are actually increasing the number of issues over the long term. In the statistic process model of manufacturing when you see this the first thing that comes to mind is "we have an open loop and out of control manufacturing system". Now that saddens me. =/ -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 9 15:32:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AED5F8956D; Mon, 9 Apr 2018 15:32:52 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 B10DC8141F; Mon, 9 Apr 2018 15:32:51 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 7E3D25A9F13; Mon, 9 Apr 2018 15:32:50 +0000 (UTC) Date: Mon, 9 Apr 2018 15:32:50 +0000 From: Brooks Davis To: Glen Barber Cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... Message-ID: <20180409153250.GB3560@spindle.one-eyed-alien.net> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> <20180409135849.GA84067@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gKMricLos+KVdGMg" Content-Disposition: inline In-Reply-To: <20180409135849.GA84067@FreeBSD.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:32:52 -0000 --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 01:58:49PM +0000, Glen Barber wrote: > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Sun Apr 8 16:54:07 2018 > > New Revision: 332288 > > URL: https://svnweb.freebsd.org/changeset/base/332288 > >=20 > > Log: > > MFC r331797: > > =20 > > Use an accessor function to access ifr_data. > > =20 > > This fixes 32-bit compat (no ioctl command defintions are required > > as struct ifreq is the same size). > > =20 > > Reviewed by: kib > > Obtained from: CheriBSD > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D14900 > >=20 > > Modified: > [...] > > stable/11/sys/dev/wl/if_wl.c >=20 > > Directory Properties: > > stable/11/ (props changed) > >=20 > [...] > > Modified: stable/11/sys/dev/wl/if_wl.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 > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 (r332287) > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 (r332288) > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t da= ta) > > } > > WL_UNLOCK(sc); > > =20 > > - error =3D copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > + error =3D copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); > > break; > > =20 > > =20 > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t da= ta) > > if ((error =3D priv_check(td, PRIV_DRIVER))) > > break; > > =20 > > - error =3D copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > + error =3D copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > > if (error) > > break; > > =09 > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t da= ta) > > /* get the current NWID out of the sc since we stored it there */ > > case SIOCGWLCNWID: > > WL_LOCK(sc); > > - ifr->ifr_data =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > + ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > WL_UNLOCK(sc); > > break; > > =20 >=20 > This part of the change appears to have broken i386 with the following: Sorry about this, will fix shortly. -- Brooks --gKMricLos+KVdGMg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJay4ehAAoJEKzQXbSebgfAErIH/3SD+9q+NLglY1UYdmltmGHE m/ExxRsFPAD46U1GTqWvqoDXLwWTjMf7smOO6ZRbTdio2LDL8GidwrkcYxaMnNJI wTx5NeXBmEWuthpsBvkwCRSGSJNNfPpBZPZh8FoZAyuTVW0iTMzKlxzPlYEWVIX2 b3RTzTuGz6TUhY1DeX5kMAnhGjjU+lhCpM0dqSzJo6kMjqnBDsyVhijT05dhMu6x Fgb2WUto1mAZe7gteXms094Ew0lV/XPeUlySwWVF8kSENk1DtGcFKSZynsHnj7uT AviVYckVnjsWt2FqxWWpbza9Msm2TmuKMqytRCMPBvJHjOs2wNQ2bFb6CkHUHo8= =X/6a -----END PGP SIGNATURE----- --gKMricLos+KVdGMg-- From owner-svn-src-all@freebsd.org Mon Apr 9 15:36:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA792F89B3D; Mon, 9 Apr 2018 15:36:49 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C6CD83709; Mon, 9 Apr 2018 15:36:49 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f48.google.com with SMTP id j20-v6so7224369lfk.2; Mon, 09 Apr 2018 08:36:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=C7LezMUtjWuvFLw5pdRHZ37U6/aXh9f+gHl6wQnjOTg=; b=Jy2zoCROJQuEOfVgBCdQHsOCyxwx2If5xfYHXVss/yy0iiuLZ2ldReEAdLRMoDqKld C8/TqX6zjSZUN/u01WwrMXVo6Q9cn4ncCwfOTNLp36zy53oFlZ376i7LZi4gnLoN6/qe pmqYy/pY1NbmxkMHI8IteYZSKX8jpXS1YgcB4it7XlwjgjysYV7Lhl9nbAZx52Ftux/r xDVGaxRPFBtbxrMuBdLQGOeBxuPX033kT9pdQr1bZrK9sDVJ4jnigt7ABcGKuGn7Rzsg vGZ2aQs2EXO/iA6v/y7566cVr6NR296WHbUqede9DHbiFQZR9zYgtmXmYkdTz6yzRXrQ h9Sw== X-Gm-Message-State: ALQs6tBhgg2hrdK1f7iaNS/K+nf56mDgedBVh7PL6x4Ig02P2lJ7OPrw 7I1rNw6VG6hCOKBvwv6PXl9bo9cN X-Google-Smtp-Source: AIpwx4/fhLEZBuoPG1+irzjWXzjNiQ74rG0mYhDeA079IdNPwy3CAPmXn3O91tBxzaxtLqGOwgY56g== X-Received: by 2002:a19:b516:: with SMTP id e22-v6mr22990297lff.47.1523288207100; Mon, 09 Apr 2018 08:36:47 -0700 (PDT) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com. [209.85.215.46]) by smtp.gmail.com with ESMTPSA id z19sm117823ljz.1.2018.04.09.08.36.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 08:36:46 -0700 (PDT) Received: by mail-lf0-f46.google.com with SMTP id x70-v6so7208789lfa.0; Mon, 09 Apr 2018 08:36:46 -0700 (PDT) X-Received: by 2002:a19:c4c8:: with SMTP id u191-v6mr23141263lff.109.1523288206725; Mon, 09 Apr 2018 08:36:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 08:36:26 -0700 (PDT) In-Reply-To: <201804091530.w39FU3vU019211@pdx.rh.CN85.dnsmgr.net> References: <201804091530.w39FU3vU019211@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 9 Apr 2018 10:36:26 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:36:50 -0000 On Mon, Apr 9, 2018 at 10:30 AM, Rodney W. Grimes wrote: >> On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes >> wrote: >> >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes >> >> wrote: >> >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: >> >> >> >> Author: kevans >> >> >> >> Date: Mon Apr 2 15:28:48 2018 >> >> >> >> New Revision: 331880 >> >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> >> >> >> >> >> >> Log: >> >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> >> >> >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> >> >> >> >> >> >> Modified: >> >> >> >> stable/11/etc/rc.subr >> >> >> >> Directory Properties: >> >> >> >> stable/11/ (props changed) >> >> >> >> >> >> >> >> Modified: stable/11/etc/rc.subr >> >> >> >> ============================================================================== >> >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() >> >> >> >> # >> >> >> >> # ${name}_login_class n Login class to use, else "daemon". >> >> >> >> # >> >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. >> >> >> >> +# >> >> >> > >> >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before >> >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> >> >> > this change if a call is made to limits. >> >> >> > >> >> >> > >> >> >> >> >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, >> >> >> and has been since at least 2016. >> >> > >> >> > I was aware that it was an issue and why I made a comment about it >> >> > being MFC'ed. Though I had forgot a bug report existed. >> >> >> >> I'm kind of surprised we haven't had more complaints about this- the >> >> original commit for this stuff landed before stable/11 was even >> >> branched, so it's been broken for all of 11.x's lifetime. >> > >> > History has taught me it takes a long time for this type of >> > breakage to usually surface in a noticable way. Also I think >> > until you merged this last ${name}_limits thing it actually >> > didn't cause an issue, except for the few like me running >> > diskless systems and or seperate /usr. >> >> I don't see how this merge could possibly have been the cause of any >> claimed issues- like I said before, it didn't add any limits >> invocations, it added an arg to the limits invocation that already >> existed. You can see this pretty clearly from the diff, we didn't even >> change any conditions for limits to be invoked. > > limits_mysql="NO" is defined by the startup script for mysql, > that now causes /etc/rc to try and use that variable in a > different way. > > You added a variable, one that was already in use by some other > /etc/rc* related component. Collision of differening uses is > causing errors. > Ah, apologies, I misread your previous e-mail and had interpreted it as you claiming again that this broke things for those of you "running diskless systems and or seperate /usr." -- this other breakage, these are things we can fix and aren't really large hurdles to climb over. We just need people like 0mp that are actually inclined to address it in ports, and we need to actually communicate changes like this with ports people and assess what's going to break and make a plan to get it fixed. IMO this in particular wasn't a major change, and it shouldn't have been too big of a deal (unlike the commit that it built upon). I don't think it should've been broken in head for two months in the various ports that 0mp has identified- even if people don't run these databases on head, we should've assessed the fallout and fixed it somewhere in the two month's time. We're not talking half the ports tree, we're talking < 30 ports. =( From owner-svn-src-all@freebsd.org Mon Apr 9 15:52:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82604F8AD35; Mon, 9 Apr 2018 15:52:59 +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 02A906C82B; Mon, 9 Apr 2018 15:52:58 +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 w39Fqvqf019417; Mon, 9 Apr 2018 08:52:57 -0700 (PDT) (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 w39Fqv2S019416; Mon, 9 Apr 2018 08:52:57 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 08:52:56 -0700 (PDT) CC: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 15:52:59 -0000 > On Mon, Apr 9, 2018 at 10:30 AM, Rodney W. Grimes > wrote: > >> On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes > >> wrote: > >> >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes > >> >> wrote: > >> >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: > >> >> >> >> Author: kevans > >> >> >> >> Date: Mon Apr 2 15:28:48 2018 > >> >> >> >> New Revision: 331880 > >> >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> >> >> >> > >> >> >> >> Log: > >> >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > >> >> >> >> > >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by > >> >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >> >> >> >> > >> >> >> >> Modified: > >> >> >> >> stable/11/etc/rc.subr > >> >> >> >> Directory Properties: > >> >> >> >> stable/11/ (props changed) > >> >> >> >> > >> >> >> >> Modified: stable/11/etc/rc.subr > >> >> >> >> ============================================================================== > >> >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >> >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >> >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() > >> >> >> >> # > >> >> >> >> # ${name}_login_class n Login class to use, else "daemon". > >> >> >> >> # > >> >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. > >> >> >> >> +# > >> >> >> > > >> >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before > >> >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > >> >> >> > this change if a call is made to limits. > >> >> >> > > >> >> >> > > >> >> >> > >> >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, > >> >> >> and has been since at least 2016. > >> >> > > >> >> > I was aware that it was an issue and why I made a comment about it > >> >> > being MFC'ed. Though I had forgot a bug report existed. > >> >> > >> >> I'm kind of surprised we haven't had more complaints about this- the > >> >> original commit for this stuff landed before stable/11 was even > >> >> branched, so it's been broken for all of 11.x's lifetime. > >> > > >> > History has taught me it takes a long time for this type of > >> > breakage to usually surface in a noticable way. Also I think > >> > until you merged this last ${name}_limits thing it actually > >> > didn't cause an issue, except for the few like me running > >> > diskless systems and or seperate /usr. > >> > >> I don't see how this merge could possibly have been the cause of any > >> claimed issues- like I said before, it didn't add any limits > >> invocations, it added an arg to the limits invocation that already > >> existed. You can see this pretty clearly from the diff, we didn't even > >> change any conditions for limits to be invoked. > > > > limits_mysql="NO" is defined by the startup script for mysql, > > that now causes /etc/rc to try and use that variable in a > > different way. > > > > You added a variable, one that was already in use by some other > > /etc/rc* related component. Collision of differening uses is > > causing errors. > > > > Ah, apologies, I misread your previous e-mail and had interpreted it > as you claiming again that this broke things for those of you "running > diskless systems and or seperate /usr." -- this other breakage, these > are things we can fix and aren't really large hurdles to climb over. Mostly true, other than the hurdle of that 0mp mentions in his https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227205 We need to remember that we cannot simply switch to the new mechanism as it is only available in 12-CURRENT and soon in 11-STABLE (and 11.2). I am not sure how to handle that with the users, it is a operational interface change in how limits are done for these ports and probably is going to break a lot of peoples systems if they try to update from 11.1 to 11.2 because there /etc/rc.conf file is full of old stuff that this new stuff is incompatible with. IMHO, it would be best to post pone this change to 12, as people are more willing to suffer painful upgrades when going between major versions. > > We just need people like 0mp that are actually inclined to address it > in ports, and we need to actually communicate changes like this with > ports people and assess what's going to break and make a plan to get > it fixed. Problem was/is no one had the foresight to see the ports breakage coming and avoid it in some way. That happens, its engineering, lets find a fix and move on. > IMO this in particular wasn't a major change, and it shouldn't have > been too big of a deal (unlike the commit that it built upon). I don't > think it should've been broken in head for two months in the various > ports that 0mp has identified- even if people don't run these > databases on head, we should've assessed the fallout and fixed it > somewhere in the two month's time. We're not talking half the ports > tree, we're talking < 30 ports. =( Its usually the tiny, minor, itty bit little nit change that bites the hardest :-) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 9 16:07:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F8C4F8BAEB; Mon, 9 Apr 2018 16:07:26 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A24E1747E7; Mon, 9 Apr 2018 16:07:25 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f50.google.com with SMTP id d20-v6so1513506lfe.3; Mon, 09 Apr 2018 09:07:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0Blp8pOn788k9UegBzOysyf31Xj/C6SNpy4aXkUesI0=; b=kF2ln9a2bzTg6jwyY16/Cx2RuyReUUw13kFA8D9N64gdmn7i9mFaTE0IOEGMmXmUy+ Hgqv/mioRTh275N345q5+9n1EjJCZVCJx7MibMBREwwe2I+4GQj47HWBOyu1GX33a8ko eEqiJUqvILNFZqdqQNnRIggF/JQtbJqJIv1XqplPdToyM++UHBhzrFYthUxa5mFW97Kp eg5uqojPFJIXYBIoQyWFBwzvCcO1OkMMui5lqpH2UAisCt3Ss0b/vvQph4wCXn2ElDgP jzb6zx5laGF7MlF3zKfBIFNH9Cdm5Hy7V+2Nn5GOXCLgDjQv1zVD3K7/y9SRhEmT2IC7 /D6A== X-Gm-Message-State: AElRT7HMcuEQ5KRv0u/w013VvoV4qFz1noubVA8DM6PsuayCH3Yo7Iqa FdcrTGg+h7TVGxZ5wkJ/nveobsH3 X-Google-Smtp-Source: AIpwx49oS/3UrZfFOvfuuB++MiihjCIoReAAmxJwjHa8fZsGcJvXDtRk9zZ06wdAE2fuRXqHGL71XQ== X-Received: by 10.46.23.202 with SMTP id 71mr22704818ljx.49.1523284439376; Mon, 09 Apr 2018 07:33:59 -0700 (PDT) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com. [209.85.215.54]) by smtp.gmail.com with ESMTPSA id u19sm92263lje.29.2018.04.09.07.33.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 07:33:59 -0700 (PDT) Received: by mail-lf0-f54.google.com with SMTP id c78-v6so6896240lfh.1; Mon, 09 Apr 2018 07:33:59 -0700 (PDT) X-Received: by 10.46.29.1 with SMTP id d1mr22723804ljd.22.1523284439092; Mon, 09 Apr 2018 07:33:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 07:33:38 -0700 (PDT) In-Reply-To: <20180409142906.74ohdz4eynugkqw5@mutt-hbsd> References: <201804021528.w32FSmd7023856@repo.freebsd.org> <20180409142906.74ohdz4eynugkqw5@mutt-hbsd> From: Kyle Evans Date: Mon, 9 Apr 2018 09:33:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Shawn Webb Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:07:26 -0000 On Mon, Apr 9, 2018 at 9:29 AM, Shawn Webb wrote: > On Mon, Apr 02, 2018 at 03:28:48PM +0000, Kyle Evans wrote: >> Author: kevans >> Date: Mon Apr 2 15:28:48 2018 >> New Revision: 331880 >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> Log: >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > > A HardenedBSD user has reported an issue with this commit: > > https://twitter.com/0x666c7578/status/982901931969597440 > The mariadb ports should be good with this after ports r466451, tracking PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227205 From owner-svn-src-all@freebsd.org Mon Apr 9 16:10:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E28EF8BD91; Mon, 9 Apr 2018 16:10:10 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70B2B7603A; Mon, 9 Apr 2018 16:10:09 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f41.google.com with SMTP id m200-v6so7381860lfm.4; Mon, 09 Apr 2018 09:10:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=V1k5M3IzMOcDcP7hplQt9EJnvkDe/G7uDiDmQ9VqB8o=; b=Jov5uyWnHVTjtNCQWf8WWeQfn7I8DPkKWK8CFaWfw6Te6c5MeiWLsjJwRaFMJ7ivIA aNTI2PLgnuPaJ9JoNb/X9H6XBIq+sAgP83IlvnSs4T97HHKguBrTbTkare6Wspxw6hnN smN6lQuc2ETX9wpt6yfgujrKq9dUUp99rG0q3ApS2XSlYoB3KfttOSIi57aZN/vuPGCw 9aXRhDHyR/8htBgA1BFyT6ktTfMflO4GzjEZ5vmJKn+kXhNuopWhpMOgx7Knix8sURxQ iaRWqGFvLKLDBKkACJGQU3LdWQgUW135xq0G4k1Li3imlhp5L1XA6Bmc25CJ1pqo/mfY Fs9w== X-Gm-Message-State: AElRT7Hp66BJSWvMavt28vLVYmVKpM7h7qFo6VRtazhJZmF+OnyK6UgT +irCZ8X5tVFlRRttFkIGRr4iHbgL X-Google-Smtp-Source: AIpwx4/64mYgxj0K0efYlgJHvweMDdrlxingsQSg2NaUn5AJydn4DBKg3B6tLoTTaZOJdXEqTZHgbA== X-Received: by 10.46.154.71 with SMTP id k7mr22680759ljj.42.1523290207211; Mon, 09 Apr 2018 09:10:07 -0700 (PDT) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com. [209.85.215.44]) by smtp.gmail.com with ESMTPSA id r6sm124184ljh.55.2018.04.09.09.10.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 09:10:07 -0700 (PDT) Received: by mail-lf0-f44.google.com with SMTP id c78-v6so7372242lfh.1; Mon, 09 Apr 2018 09:10:07 -0700 (PDT) X-Received: by 2002:a19:c4c8:: with SMTP id u191-v6mr23216084lff.109.1523290206852; Mon, 09 Apr 2018 09:10:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 09:09:46 -0700 (PDT) In-Reply-To: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 9 Apr 2018 11:09:46 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:10:10 -0000 On Mon, Apr 9, 2018 at 10:52 AM, Rodney W. Grimes wrote: >> On Mon, Apr 9, 2018 at 10:30 AM, Rodney W. Grimes >> wrote: >> >> On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes >> >> wrote: >> >> >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes >> >> >> wrote: >> >> >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: >> >> >> >> >> Author: kevans >> >> >> >> >> Date: Mon Apr 2 15:28:48 2018 >> >> >> >> >> New Revision: 331880 >> >> >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 >> >> >> >> >> >> >> >> >> >> Log: >> >> >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon >> >> >> >> >> >> >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by >> >> >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). >> >> >> >> >> >> >> >> >> >> Modified: >> >> >> >> >> stable/11/etc/rc.subr >> >> >> >> >> Directory Properties: >> >> >> >> >> stable/11/ (props changed) >> >> >> >> >> >> >> >> >> >> Modified: stable/11/etc/rc.subr >> >> >> >> >> ============================================================================== >> >> >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >> >> >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >> >> >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() >> >> >> >> >> # >> >> >> >> >> # ${name}_login_class n Login class to use, else "daemon". >> >> >> >> >> # >> >> >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. >> >> >> >> >> +# >> >> >> >> > >> >> >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before >> >> >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> >> >> >> > this change if a call is made to limits. >> >> >> >> > >> >> >> >> > >> >> >> >> >> >> >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, >> >> >> >> and has been since at least 2016. >> >> >> > >> >> >> > I was aware that it was an issue and why I made a comment about it >> >> >> > being MFC'ed. Though I had forgot a bug report existed. >> >> >> >> >> >> I'm kind of surprised we haven't had more complaints about this- the >> >> >> original commit for this stuff landed before stable/11 was even >> >> >> branched, so it's been broken for all of 11.x's lifetime. >> >> > >> >> > History has taught me it takes a long time for this type of >> >> > breakage to usually surface in a noticable way. Also I think >> >> > until you merged this last ${name}_limits thing it actually >> >> > didn't cause an issue, except for the few like me running >> >> > diskless systems and or seperate /usr. >> >> >> >> I don't see how this merge could possibly have been the cause of any >> >> claimed issues- like I said before, it didn't add any limits >> >> invocations, it added an arg to the limits invocation that already >> >> existed. You can see this pretty clearly from the diff, we didn't even >> >> change any conditions for limits to be invoked. >> > >> > limits_mysql="NO" is defined by the startup script for mysql, >> > that now causes /etc/rc to try and use that variable in a >> > different way. >> > >> > You added a variable, one that was already in use by some other >> > /etc/rc* related component. Collision of differening uses is >> > causing errors. >> > >> >> Ah, apologies, I misread your previous e-mail and had interpreted it >> as you claiming again that this broke things for those of you "running >> diskless systems and or seperate /usr." -- this other breakage, these >> are things we can fix and aren't really large hurdles to climb over. > > Mostly true, other than the hurdle of that 0mp mentions in his > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227205 > We need to remember that we cannot simply switch to > the new mechanism as it is only available in 12-CURRENT > and soon in 11-STABLE (and 11.2). > > I am not sure how to handle that with the users, it is a operational > interface change in how limits are done for these ports and probably > is going to break a lot of peoples systems if they try to update > from 11.1 to 11.2 because there /etc/rc.conf file is full of old > stuff that this new stuff is incompatible with. > > IMHO, it would be best to post pone this change to 12, as people > are more willing to suffer painful upgrades when going between > major versions. > Right- so, back out this MFC (and the subsequent FreeBSD_version bump) and fix the ports to do the right thing for 12.x while that's still not a technically supported branch? >> >> We just need people like 0mp that are actually inclined to address it >> in ports, and we need to actually communicate changes like this with >> ports people and assess what's going to break and make a plan to get >> it fixed. > > Problem was/is no one had the foresight to see the ports breakage > coming and avoid it in some way. That happens, its engineering, > lets find a fix and move on. > >> IMO this in particular wasn't a major change, and it shouldn't have >> been too big of a deal (unlike the commit that it built upon). I don't >> think it should've been broken in head for two months in the various >> ports that 0mp has identified- even if people don't run these >> databases on head, we should've assessed the fallout and fixed it >> somewhere in the two month's time. We're not talking half the ports >> tree, we're talking < 30 ports. =( > > Its usually the tiny, minor, itty bit little nit change that bites > the hardest :-) > From owner-svn-src-all@freebsd.org Mon Apr 9 16:18:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13F69F8C5E9; Mon, 9 Apr 2018 16:18:03 +0000 (UTC) (envelope-from brooks@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 B8F2F7A530; Mon, 9 Apr 2018 16:18:02 +0000 (UTC) (envelope-from brooks@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 AB15920FD2; Mon, 9 Apr 2018 16:18:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39GI2XL015238; Mon, 9 Apr 2018 16:18:02 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39GI2Zi015237; Mon, 9 Apr 2018 16:18:02 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804091618.w39GI2Zi015237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 9 Apr 2018 16:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332331 - stable/11/sys/dev/wl X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/dev/wl X-SVN-Commit-Revision: 332331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:18:03 -0000 Author: brooks Date: Mon Apr 9 16:18:02 2018 New Revision: 332331 URL: https://svnweb.freebsd.org/changeset/base/332331 Log: Fix wl(4) after r332288. I missed that this was an assignment (a bad pattern, use another member) on i386. As wl(4) is i386 only and gone in head, just expand the ifr_ifru member rather than adding an accessor. Reported by: gjb Modified: stable/11/sys/dev/wl/if_wl.c Modified: stable/11/sys/dev/wl/if_wl.c ============================================================================== --- stable/11/sys/dev/wl/if_wl.c Mon Apr 9 15:29:14 2018 (r332330) +++ stable/11/sys/dev/wl/if_wl.c Mon Apr 9 16:18:02 2018 (r332331) @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* get the current NWID out of the sc since we stored it there */ case SIOCGWLCNWID: WL_LOCK(sc); - ifr_data_get_ptr(ifr) = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); + ifr->ifr_ifru.ifru_data = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); WL_UNLOCK(sc); break; From owner-svn-src-all@freebsd.org Mon Apr 9 16:19:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49F42F8C6D3; Mon, 9 Apr 2018 16:19:13 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 D17CF7AFD2; Mon, 9 Apr 2018 16:19:12 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id E3FC65A9F12; Mon, 9 Apr 2018 16:19:11 +0000 (UTC) Date: Mon, 9 Apr 2018 16:19:11 +0000 From: Brooks Davis To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... Message-ID: <20180409161911.GC3560@spindle.one-eyed-alien.net> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> <20180409135849.GA84067@FreeBSD.org> <20180409153250.GB3560@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1LKvkjL3sHcu1TtY" Content-Disposition: inline In-Reply-To: <20180409153250.GB3560@spindle.one-eyed-alien.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:19:13 -0000 --1LKvkjL3sHcu1TtY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 03:32:50PM +0000, Brooks Davis wrote: > On Mon, Apr 09, 2018 at 01:58:49PM +0000, Glen Barber wrote: > > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Sun Apr 8 16:54:07 2018 > > > New Revision: 332288 > > > URL: https://svnweb.freebsd.org/changeset/base/332288 > > >=20 > > > Log: > > > MFC r331797: > > > =20 > > > Use an accessor function to access ifr_data. > > > =20 > > > This fixes 32-bit compat (no ioctl command defintions are required > > > as struct ifreq is the same size). > > > =20 > > > Reviewed by: kib > > > Obtained from: CheriBSD > > > Sponsored by: DARPA, AFRL > > > Differential Revision: https://reviews.freebsd.org/D14900 > > >=20 > > > Modified: > > [...] > > > stable/11/sys/dev/wl/if_wl.c > >=20 > > > Directory Properties: > > > stable/11/ (props changed) > > >=20 > > [...] > > > Modified: stable/11/sys/dev/wl/if_wl.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 > > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 (r332287) > > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 (r332288) > > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t = data) > > > } > > > WL_UNLOCK(sc); > > > =20 > > > - error =3D copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > > + error =3D copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)); > > > break; > > > =20 > > > =20 > > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t = data) > > > if ((error =3D priv_check(td, PRIV_DRIVER))) > > > break; > > > =20 > > > - error =3D copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > > + error =3D copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > > > if (error) > > > break; > > > =09 > > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t = data) > > > /* get the current NWID out of the sc since we stored it there */ > > > case SIOCGWLCNWID: > > > WL_LOCK(sc); > > > - ifr->ifr_data =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > > + ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]= ); > > > WL_UNLOCK(sc); > > > break; > > > =20 > >=20 > > This part of the change appears to have broken i386 with the following: >=20 > Sorry about this, will fix shortly. Fixed in r332331. -- Brooks --1LKvkjL3sHcu1TtY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJay5J/AAoJEKzQXbSebgfAT4gH/1dY7yDxUyfscJ9TrUuianVi usazJ9LnZvvm85ONAW//7fwAmllrp5yKMt/+h3RffUyvcC3jWJHC5m7kBy2+6ECl qoVwuB/nkgFyS8ReT834ntt4DkLyjMI/QiAY7RuUFOy+CRzvbeDl0Z/hbMDm2SaS eARgvStpE3tc8qllzYhDr+jIKjRyCYxyLitM7erdHer6dRI79OTXOhDhZx96mYIM V3ET1R4ltUY8pp2/eii+pJ4+qjw7PHerij4+kKfrcc5/20qEGGedjIaSyG+10tQa GXFxVDfjbM5KxE3yBCbSPkZNnbH+43VmtiPjYzVCHJHCBTdtIYBZE37IU1HRFRw= =RbjH -----END PGP SIGNATURE----- --1LKvkjL3sHcu1TtY-- From owner-svn-src-all@freebsd.org Mon Apr 9 16:25:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 595F8F8CCF4; Mon, 9 Apr 2018 16:25:38 +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 8C9427E928; Mon, 9 Apr 2018 16:25:37 +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 w39GPXaA019558; Mon, 9 Apr 2018 09:25:33 -0700 (PDT) (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 w39GPXpK019557; Mon, 9 Apr 2018 09:25:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804091625.w39GPXpK019557@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 09:25:33 -0700 (PDT) CC: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:25:38 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Apr 9, 2018 at 10:52 AM, Rodney W. Grimes > wrote: > >> On Mon, Apr 9, 2018 at 10:30 AM, Rodney W. Grimes > >> wrote: > >> >> On Mon, Apr 9, 2018 at 10:14 AM, Rodney W. Grimes > >> >> wrote: > >> >> >> On Mon, Apr 9, 2018 at 9:46 AM, Rodney W. Grimes > >> >> >> wrote: > >> >> >> >> On 04/02/18 17:39, Rodney W. Grimes wrote: > >> >> >> >> >> Author: kevans > >> >> >> >> >> Date: Mon Apr 2 15:28:48 2018 > >> >> >> >> >> New Revision: 331880 > >> >> >> >> >> URL: https://svnweb.freebsd.org/changeset/base/331880 > >> >> >> >> >> > >> >> >> >> >> Log: > >> >> >> >> >> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf daemon > >> >> >> >> >> > >> >> >> >> >> Usage is ${name}_limits, and the argument is any flags accepted by > >> >> >> >> >> limits(1), such as `-n 100' (e.g. only allow 100 open files). > >> >> >> >> >> > >> >> >> >> >> Modified: > >> >> >> >> >> stable/11/etc/rc.subr > >> >> >> >> >> Directory Properties: > >> >> >> >> >> stable/11/ (props changed) > >> >> >> >> >> > >> >> >> >> >> Modified: stable/11/etc/rc.subr > >> >> >> >> >> ============================================================================== > >> >> >> >> >> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) > >> >> >> >> >> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) > >> >> >> >> >> @@ -773,6 +773,8 @@ check_startmsgs() > >> >> >> >> >> # > >> >> >> >> >> # ${name}_login_class n Login class to use, else "daemon". > >> >> >> >> >> # > >> >> >> >> >> +# ${name}_limits n limits(1) to apply to ${command}. > >> >> >> >> >> +# > >> >> >> >> > > >> >> >> >> > Caution, limits(1) is in /usr/bin, this code can fail if used before > >> >> >> >> > /usr is mounted. (Ie, our rc.initdiskless) is probably broken by > >> >> >> >> > this change if a call is made to limits. > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > >> >> >> >> Sorry for jumping on this so late. This is also an issue in CURRENT, > >> >> >> >> and has been since at least 2016. > >> >> >> > > >> >> >> > I was aware that it was an issue and why I made a comment about it > >> >> >> > being MFC'ed. Though I had forgot a bug report existed. > >> >> >> > >> >> >> I'm kind of surprised we haven't had more complaints about this- the > >> >> >> original commit for this stuff landed before stable/11 was even > >> >> >> branched, so it's been broken for all of 11.x's lifetime. > >> >> > > >> >> > History has taught me it takes a long time for this type of > >> >> > breakage to usually surface in a noticable way. Also I think > >> >> > until you merged this last ${name}_limits thing it actually > >> >> > didn't cause an issue, except for the few like me running > >> >> > diskless systems and or seperate /usr. > >> >> > >> >> I don't see how this merge could possibly have been the cause of any > >> >> claimed issues- like I said before, it didn't add any limits > >> >> invocations, it added an arg to the limits invocation that already > >> >> existed. You can see this pretty clearly from the diff, we didn't even > >> >> change any conditions for limits to be invoked. > >> > > >> > limits_mysql="NO" is defined by the startup script for mysql, > >> > that now causes /etc/rc to try and use that variable in a > >> > different way. > >> > > >> > You added a variable, one that was already in use by some other > >> > /etc/rc* related component. Collision of differening uses is > >> > causing errors. > >> > > >> > >> Ah, apologies, I misread your previous e-mail and had interpreted it > >> as you claiming again that this broke things for those of you "running > >> diskless systems and or seperate /usr." -- this other breakage, these > >> are things we can fix and aren't really large hurdles to climb over. > > > > Mostly true, other than the hurdle of that 0mp mentions in his > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227205 > > We need to remember that we cannot simply switch to > > the new mechanism as it is only available in 12-CURRENT > > and soon in 11-STABLE (and 11.2). > > > > I am not sure how to handle that with the users, it is a operational > > interface change in how limits are done for these ports and probably > > is going to break a lot of peoples systems if they try to update > > from 11.1 to 11.2 because there /etc/rc.conf file is full of old > > stuff that this new stuff is incompatible with. > > > > IMHO, it would be best to post pone this change to 12, as people > > are more willing to suffer painful upgrades when going between > > major versions. > > > > Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > and fix the ports to do the right thing for 12.x while that's still > not a technically supported branch? I think that might be the easiest path forward. Not sure if you can back out the version bump, maybe move it forward another notch, leaving a narrow window of when this existed, and no one should have to deal with that window hopefuly. You may want to wait for input from 0mp. > >> We just need people like 0mp that are actually inclined to address it > >> in ports, and we need to actually communicate changes like this with > >> ports people and assess what's going to break and make a plan to get > >> it fixed. > > > > Problem was/is no one had the foresight to see the ports breakage > > coming and avoid it in some way. That happens, its engineering, > > lets find a fix and move on. > > > >> IMO this in particular wasn't a major change, and it shouldn't have > >> been too big of a deal (unlike the commit that it built upon). I don't > >> think it should've been broken in head for two months in the various > >> ports that 0mp has identified- even if people don't run these > >> databases on head, we should've assessed the fallout and fixed it > >> somewhere in the two month's time. We're not talking half the ports > >> tree, we're talking < 30 ports. =( > > > > Its usually the tiny, minor, itty bit little nit change that bites > > the hardest :-) > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 9 16:25:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0373F8CD45; Mon, 9 Apr 2018 16:25:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 92ED37EAFD; Mon, 9 Apr 2018 16:25:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id C80F41981B; Mon, 9 Apr 2018 16:25:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 9 Apr 2018 16:25:43 +0000 From: Glen Barber To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332288 - in stable/11/sys: dev/an dev/ath dev/cxgbe dev/de dev/en dev/fatm dev/hatm dev/if_ndis dev/iwi dev/ixgbe dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce dev... Message-ID: <20180409162543.GE33065@FreeBSD.org> References: <201804081654.w38Gs7JY007779@repo.freebsd.org> <20180409135849.GA84067@FreeBSD.org> <20180409153250.GB3560@spindle.one-eyed-alien.net> <20180409161911.GC3560@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b5gNqxB1S1yM7hjW" Content-Disposition: inline In-Reply-To: <20180409161911.GC3560@spindle.one-eyed-alien.net> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:25:49 -0000 --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 04:19:11PM +0000, Brooks Davis wrote: > On Mon, Apr 09, 2018 at 03:32:50PM +0000, Brooks Davis wrote: > > On Mon, Apr 09, 2018 at 01:58:49PM +0000, Glen Barber wrote: > > > On Sun, Apr 08, 2018 at 04:54:07PM +0000, Brooks Davis wrote: > > > > Author: brooks > > > > Date: Sun Apr 8 16:54:07 2018 > > > > New Revision: 332288 > > > > URL: https://svnweb.freebsd.org/changeset/base/332288 > > > >=20 > > > > Log: > > > > MFC r331797: > > > > =20 > > > > Use an accessor function to access ifr_data. > > > > =20 > > > > This fixes 32-bit compat (no ioctl command defintions are required > > > > as struct ifreq is the same size). > > > > =20 > > > > Reviewed by: kib > > > > Obtained from: CheriBSD > > > > Sponsored by: DARPA, AFRL > > > > Differential Revision: https://reviews.freebsd.org/D14900 > > > >=20 > > > > Modified: > > > [...] > > > > stable/11/sys/dev/wl/if_wl.c > > >=20 > > > > Directory Properties: > > > > stable/11/ (props changed) > > > >=20 > > > [...] > > > > Modified: stable/11/sys/dev/wl/if_wl.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 > > > > --- stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:46:24 2018 (r332287) > > > > +++ stable/11/sys/dev/wl/if_wl.c Sun Apr 8 16:54:07 2018 (r332288) > > > > @@ -1313,7 +1313,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_= t data) > > > > } > > > > WL_UNLOCK(sc); > > > > =20 > > > > - error =3D copyout(psa_buf, ifr->ifr_data, sizeof(psa_buf)); > > > > + error =3D copyout(psa_buf, ifr_data_get_ptr(ifr), sizeof(psa_buf)= ); > > > > break; > > > > =20 > > > > =20 > > > > @@ -1323,7 +1323,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_= t data) > > > > if ((error =3D priv_check(td, PRIV_DRIVER))) > > > > break; > > > > =20 > > > > - error =3D copyin(ifr->ifr_data, psa_buf, sizeof(psa_buf)); > > > > + error =3D copyin(ifr_data_get_ptr(ifr), psa_buf, sizeof(psa_buf)); > > > > if (error) > > > > break; > > > > =09 > > > > @@ -1357,7 +1357,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_= t data) > > > > /* get the current NWID out of the sc since we stored it there */ > > > > case SIOCGWLCNWID: > > > > WL_LOCK(sc); > > > > - ifr->ifr_data =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); > > > > + ifr_data_get_ptr(ifr) =3D (caddr_t) (sc->nwid[0] << 8 | sc->nwid[= 1]); > > > > WL_UNLOCK(sc); > > > > break; > > > > =20 > > >=20 > > > This part of the change appears to have broken i386 with the followin= g: > >=20 > > Sorry about this, will fix shortly. >=20 > Fixed in r332331. >=20 Thank you. Glen --b5gNqxB1S1yM7hjW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlrLlAcACgkQAxRYpUeP 4pPOFg/8C8YQzraWFW75rkAi3pyXmDc9lGX0sJdSDPLMMzzdFiAB5Ngp/99sb657 Ub+UkquTBBy+s8LSxxirM+iQPD5T95Cu0D2QmGlTgi4RK4DKXUqAvP7p3ChBvI8q GHnKbtZp2QAaagt/geqaCBekyuuRwbQJS374goE4c8u7UOpDlWQffaUL95MGvdq/ aiTz7ojTiWe4cFWN3uYo1+1Q5LQpR2VAIaGsILuye/L79iUOnrCOs5+qoTojFPOB RfDR3aVgb/EG3pJMTlUY27Bv2Gym58sNRo4qIkWtN2SFPqftPAL2OGPKXPXOQ8YO RohTM78hhMhjGrUyvgOpODhXsn3uGZY5MxH0mXckZNtahrJP14G/ZAEEyRVGO7cV 02EDEOJziuxE+jgDu4b2VRSnPDi8aOrhyc/8v8G01LVEaRxmXiFH9Ywur/dUqmrf HTWEtgrDQozqFVSlvDiGQkwEue5y3fNANsLiP8GCAJnzDp7PmubgaRZ51jgOFpyF Hnxdt3I8HN/rLzZHh3qenI64nDN7qntrf3vDqFQ+0npa3LZyX/t1RMWopwY9j7Ye LYn0uB9OsLct1HV/n0VMd1UfSl3xAWAMTHVsOT1/J+u8n+Z/TdfAnnekiN1rD81o 3CSGjF2XImOqni+KpF5s81oEnRGHrWT2u+36WD13rKUl0yVHuww= =ZLUi -----END PGP SIGNATURE----- --b5gNqxB1S1yM7hjW-- From owner-svn-src-all@freebsd.org Mon Apr 9 16:32:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1918F8D510; Mon, 9 Apr 2018 16:32:49 +0000 (UTC) (envelope-from brooks@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 81A61828D0; Mon, 9 Apr 2018 16:32:49 +0000 (UTC) (envelope-from brooks@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 784272130B; Mon, 9 Apr 2018 16:32:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39GWna2024736; Mon, 9 Apr 2018 16:32:49 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39GWnui024735; Mon, 9 Apr 2018 16:32:49 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804091632.w39GWnui024735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 9 Apr 2018 16:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332332 - stable/10/sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/10/sys/net X-SVN-Commit-Revision: 332332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:32:50 -0000 Author: brooks Date: Mon Apr 9 16:32:49 2018 New Revision: 332332 URL: https://svnweb.freebsd.org/changeset/base/332332 Log: MFC r332151: ifconf(): correct handling of sockaddrs smaller than struct sockaddr. Portable programs that use SIOCGIFCONF (e.g. traceroute) assume that each pseudo ifreq is of length MAX(sizeof(struct ifreq), sizeof(ifr_name) + ifr_addr.sa_len). For short sockaddrs we copied too much from the source sockaddr resulting in a heap leak. I believe only one such sockaddr exists (struct sockaddr_sco which is 8 bytes) and it is unclear if such sockaddrs end up on interfaces in practice. If it did, the result would be an 8 byte heap leak on current architectures. admbugs: 869 Reviewed by: kib Obtained from: CheriBSD Security: kernel heap leak Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14981 Modified: stable/10/sys/net/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Mon Apr 9 16:18:02 2018 (r332331) +++ stable/10/sys/net/if.c Mon Apr 9 16:32:49 2018 (r332332) @@ -3055,7 +3055,13 @@ again: } else #endif if (sa->sa_len <= sizeof(*sa)) { - ifr.ifr_addr = *sa; + if (sa->sa_len < sizeof(*sa)) { + memset(&ifr.ifr_ifru.ifru_addr, 0, + sizeof(ifr.ifr_ifru.ifru_addr)); + memcpy(&ifr.ifr_ifru.ifru_addr, sa, + sa->sa_len); + } else + ifr.ifr_ifru.ifru_addr = *sa; sbuf_bcat(sb, &ifr, sizeof(ifr)); max_len += sizeof(ifr); } else { From owner-svn-src-all@freebsd.org Mon Apr 9 16:44:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 792F4F8E07D; Mon, 9 Apr 2018 16:44:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBDB0692A8; Mon, 9 Apr 2018 16:44:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x22f.google.com with SMTP id f6-v6so11920239ita.2; Mon, 09 Apr 2018 09:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=p0gpY3NnHoBEkt/FCRadBmxICtkGC+paXkggQiXUUqI=; b=dpBTzDqutjLF2w7nUOL4ScyH7BCGbusCy9H7j4En4FubeaAG3JpeqVBbznXzDl2jpu BpnybzwewuK3k+CoyuP6wKxg9rWBN9WllDxemAeiiOGm7IPLysGMqB2Vv3nl4SleRZrZ OT9pCkDPZPrXyfnwR447I5cvbQPhcf4hIpleAYxSpKeyZIIOI+qbjEsx2I3oIYrMAcE+ pNrBBYKpBYIdGP1uJv6rd4REy5hAj/wenvAlz/tbT9sROYKQpu7ciZc7WGNcrMOX3oki o24a5BLMas+7WY4yTa4wJYcgor6H6B/6p1E3Aqjkh65VJAUFZi5gS9WiKoXsilrossTs kvMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=p0gpY3NnHoBEkt/FCRadBmxICtkGC+paXkggQiXUUqI=; b=qwAuB3SvDiTp8M2siMGs4UZhJEIO9gRiEAbeK1X4tXU1gj4E7Fg82g63syjykDo88P EY8RDnUveUD5gtPPd3KdVVTWOPoepRHkR13oCTMlD1EDNQWYofcvqD2ZIKwEdvyy+3RD Kg1VsEKrckGhjF4qgUhUG+oMwe7zbqL1uVqNYR+WZOywKm664rD/Uepsv5XoIDhyCRMH 2PTXJQiLEu9+QCcMnmkIMgOP600XAuTEBNOMvxlo2nySHj6V8WIJ+PC8r1E6VIRgwpze OdDFFwVJ4n2uyoC0JvFqzKGeHVOsR5ICSHJqCSpTRo2dwIkObmcw01kkEj/MWRSwz5AH bS5g== X-Gm-Message-State: ALQs6tCq/BsbNshEbdH3J0iD0p5/Gl0ZLqXztHV75bHFi4oC9T9aoymt RrMOypGVqmjmEhoK6RktaKr5RrvqzykNM4NoLKV7Qkfc X-Google-Smtp-Source: AIpwx4+Emhn6SDQK930NI+A/XgU/Rkt+QvDPc/WgCEc89nY+PbVwRUKYiVNfB215N3Dv9gMlSGsORi4trWU3SpK/QzQ= X-Received: by 2002:a24:a0c6:: with SMTP id o189-v6mr805084ite.52.1523292275783; Mon, 09 Apr 2018 09:44:35 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.197 with HTTP; Mon, 9 Apr 2018 09:44:15 -0700 (PDT) In-Reply-To: <8352524.sDEuJtqkT0@ralph.baldwin.cx> References: <201804060257.w362vwi3023158@repo.freebsd.org> <8352524.sDEuJtqkT0@ralph.baldwin.cx> From: Ed Maste Date: Mon, 9 Apr 2018 12:44:15 -0400 X-Google-Sender-Auth: 2BQI0ILmFKYUc2PRYKGVRCEg5G4 Message-ID: Subject: Re: svn commit: r332090 - head/stand/i386 To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:44:37 -0000 On 6 April 2018 at 13:54, John Baldwin wrote: > On Friday, April 06, 2018 02:57:58 AM Ed Maste wrote: >> Author: emaste >> Date: Fri Apr 6 02:57:58 2018 >> New Revision: 332090 >> URL: https://svnweb.freebsd.org/changeset/base/332090 >> >> Log: >> stand: pass --no-rosegment for i386 bits when linking with lld >> > > Maybe we should support LDFLAGS.${LINKER_TYPE} as we do for CFLAGS, etc.? I don't anticipate LINKER_TYPE tests proliferating, but a good point nonetheless. Change proposed in review D14998. From owner-svn-src-all@freebsd.org Mon Apr 9 16:59:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6B06F8EF28 for ; Mon, 9 Apr 2018 16:59:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B2C971558 for ; Mon, 9 Apr 2018 16:59:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id h143-v6so11970326ita.4 for ; Mon, 09 Apr 2018 09:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=FS5t4Hf99CLVYaQUF66oF0XeEDsc4EWc0ox6lLX1tyc=; b=Hz67eeGdXvI6Bvvqt0WBErW4g6HePlKiFjZngxE2BiOWuO23UOdGA7rRcgQQHZjWMr zaBQqrK8Rvnbs32OYaawJZnEw6Y/k91b+j4SCB/lw5rW7KMNra83dpRquB/0kusyvTo4 q7kYyM/G00l6Q69N+jNRvZ9CWCPXchCYpcTiE2ecoGZA6iM/8IDzAIX8DDrYcNN/5eYS oveXatxZluslDRS7HvHSht32vRh4VOcGG1scks7tVyGeAN7UpCHTzV6E5NrHKHrZeAV3 mKVXKIyRchXQ7CtuFOZ0S3NbmuMpSR37FSI1lqHunoIhH5vcZsszLGGU+wn5nLBwOfjr HfvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=FS5t4Hf99CLVYaQUF66oF0XeEDsc4EWc0ox6lLX1tyc=; b=Cw+Ap3ivdwr5suJJVv02wilhmx87dX3YMXjbpRQnJtcZnRlgRU4hNFYJtNDriXvasx Cuqzk8iUQCjvNqGaKdW+ZmmO9/IT2lf/VRL8aFEhl0Dy8hKm/ZwQ6QyZ+NWUMbR0+H4O aqih9eVKlNgdh4TIDTmJ3yeuURE8OUsJF7Pom016cc3eD8pWJr5j4Hnw9oZqAtbtw+9T xeFKhPNJ6Mwn5efaaLWW3jsplDdZHFlySTxoLwQlAHdDRYOl3lMsmmDwY+aMHrOkXwfq oeRCg8vlrjbPO1vG/BQTGw2/8LKOUZqts86PATgbPpriuEGzM4ZLwjmA1qZvCbr3oq1B BZ+A== X-Gm-Message-State: ALQs6tBmfDs2pBEiP+pqdWx043JM4+SCx3u9rllXTx4yrULpkvC//Ojk kWgZupxxNJ1H/4cFEFWyDJtT5TStBIQGXdlMEIv0JA== X-Google-Smtp-Source: AIpwx4/SE27738y6Jp4RQUC20GVmLCtaDxHMYq/hbaqx0JeJ5u0hcAqTfGZ4K7h5OqAGJNkGUZ5vB5qcS2asIfbveco= X-Received: by 2002:a24:b649:: with SMTP id d9-v6mr866731itj.51.1523293173298; Mon, 09 Apr 2018 09:59:33 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.228.135 with HTTP; Mon, 9 Apr 2018 09:59:32 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 9 Apr 2018 10:59:32 -0600 X-Google-Sender-Auth: wCbUoe9fjUTxxBpkGTwJgWm1pzs Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Kyle Evans Cc: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 16:59:35 -0000 On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: > Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > and fix the ports to do the right thing for 12.x while that's still > not a technically supported branch? Don't back out the version bump. Other things may be riding along on it 'for free'. Better to bump it again when you unMFC (if it's been more than a few days since we've had one), and then yet-again when a fixed MFC happens. Unless there's something you can ride along on for free :) Otherwise, that's a great plan. Warner From owner-svn-src-all@freebsd.org Mon Apr 9 17:02:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45084F8F248 for ; Mon, 9 Apr 2018 17:02:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F77272C80 for ; Mon, 9 Apr 2018 17:02:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id m83so10431115ioi.8 for ; Mon, 09 Apr 2018 10:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=6tmpR9PXoFXNciwsKQoZOKoO6bxno+YwlBtfKrzQVjg=; b=ni6Xp4VI1LxVzwTryyplkGM6dGIuWd0yo0avrM7VXv0HP6QsY5nAaKYJZ/VnUW3lrt vUTojxjspt5J6J41M+XCJ5s10l+R+8H+PmrmxmM74u1KdE0zc8DNlqjNhXFUBtYx+GcX V6iCFPBqgIxXMsgUm23RAdYHYIODwPIVB4VkYeUIcdN0dtQlyOEDQjugqXuAvXW67Nuh ABWIqxfQobP4MFckxIdA8MFNBhPfVjv6DOv9vqrIvKLcO1f7ryastd9tFett9xvZM7uI JIn1GeE8ZqbX77xvPxf9FIsT/zRg+vVcIhUWLoykV8OGYd5o1SXSqlj48m7S6dc+XwW9 QPiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=6tmpR9PXoFXNciwsKQoZOKoO6bxno+YwlBtfKrzQVjg=; b=ad1FgT9SQIbNB6da/zEVH1nltf8qKZUoLdMpiOLQoByVARkuknMlWTmDkl1fm1hdep TLENO8d+XGrtwvQ7gn+aGlCyk2znHCNPwOCwr+7KrE9JIZ+bAcDHwNaMtwLDpTEfBVZA Eg70mMH3oVrkvIf4OOLRLf7Q0PTdXUhn1l/NxUmxv1J23irxRS77nT5X+iFBDmpgU1je y6N/oMnRvmc9EtmyXX5UoAeaW7csWbGjRGMlluvejItbPz7xDZWKGOr5HQrYORByZdNS JtQAB+8Pu3m8y25ko951JPBLWvcY8sNOtsB+dUc7+WFQtOeZMvBnXH9mLj40D8616ciH mQvQ== X-Gm-Message-State: ALQs6tCQUeuQRl+MH+4a2kLF4UT/Zz460bUdCS3Pv/7/Vc0X47gmjs5D ADLeafSuEyf/Zcb3zIIhwfcU9bLNQOiGZh5vNmtCEA== X-Google-Smtp-Source: AIpwx48lHjAUiXKvYJGTJUoz3ulloips1g9Z7hiroUdMx1aAKbPHWqITf7HHd6nNX1tsLKcnoFrimc0zhlriNJSq1FI= X-Received: by 10.107.18.162 with SMTP id 34mr34563971ios.168.1523293322334; Mon, 09 Apr 2018 10:02:02 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.228.135 with HTTP; Mon, 9 Apr 2018 10:02:01 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: References: <201804060257.w362vwi3023158@repo.freebsd.org> <8352524.sDEuJtqkT0@ralph.baldwin.cx> From: Warner Losh Date: Mon, 9 Apr 2018 11:02:01 -0600 X-Google-Sender-Auth: Z4dKwHiryGAQLuBCAioSmgj1TAc Message-ID: Subject: Re: svn commit: r332090 - head/stand/i386 To: Ed Maste Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 17:02:04 -0000 On Mon, Apr 9, 2018 at 10:44 AM, Ed Maste wrote: > On 6 April 2018 at 13:54, John Baldwin wrote: > > On Friday, April 06, 2018 02:57:58 AM Ed Maste wrote: > >> Author: emaste > >> Date: Fri Apr 6 02:57:58 2018 > >> New Revision: 332090 > >> URL: https://svnweb.freebsd.org/changeset/base/332090 > >> > >> Log: > >> stand: pass --no-rosegment for i386 bits when linking with lld > >> > > > > Maybe we should support LDFLAGS.${LINKER_TYPE} as we do for CFLAGS, etc.? > > I don't anticipate LINKER_TYPE tests proliferating, but a good point > nonetheless. Change proposed in review D14998. > We only really support two compilers. This lets us have fewer .if statements which historically people have messed often enough that we've move to constructs that avoid them. Warner From owner-svn-src-all@freebsd.org Mon Apr 9 17:09:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81BB3F8F96B; Mon, 9 Apr 2018 17:09:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 1519B76B23; Mon, 9 Apr 2018 17:09:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1f5ZfJ-000OAM-6T; Mon, 09 Apr 2018 19:29:09 +0300 Date: Mon, 9 Apr 2018 19:29:09 +0300 From: Slawa Olhovchenkov To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Message-ID: <20180409162909.GF6612@zxy.spb.ru> References: <201804060925.w369P8c2019558@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804060925.w369P8c2019558@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 17:09:11 -0000 On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri Apr 6 09:25:08 2018 > New Revision: 332091 > URL: https://svnweb.freebsd.org/changeset/base/332091 > > Log: > MFC r331760: > Make vm_map_max/min/pmap KBI stable. > > Modified: > stable/11/sys/vm/vm_map.c > stable/11/sys/vm/vm_map.h > Directory Properties: > stable/11/ (props changed) -STABLE still crashed after load vboxnet build on 11.1-RELEASE nvidia (build on 11.1-RELEASE) also don't work From owner-svn-src-all@freebsd.org Mon Apr 9 17:24:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75721F90BB6; Mon, 9 Apr 2018 17:24:02 +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 266B57EF91; Mon, 9 Apr 2018 17:24:02 +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 1F47921B6E; Mon, 9 Apr 2018 17:24:02 +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 w39HO2rB050655; Mon, 9 Apr 2018 17:24:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39HO1eX050650; Mon, 9 Apr 2018 17:24:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091724.w39HO1eX050650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 17:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332333 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 332333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 17:24:02 -0000 Author: emaste Date: Mon Apr 9 17:24:01 2018 New Revision: 332333 URL: https://svnweb.freebsd.org/changeset/base/332333 Log: linuxulator: deduplicate linux_exec_imgact_try Previously linuxulator had three identical copies of linux_exec_imgact_try. Deduplicate before adding another arch to linuxulator. Sponsored by: Turing Robotic Industries Inc Differential Revision: https://reviews.freebsd.org/D14856 Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_emul.h head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Mon Apr 9 16:32:49 2018 (r332332) +++ head/sys/amd64/linux/linux_sysvec.c Mon Apr 9 17:24:01 2018 (r332333) @@ -86,12 +86,6 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(linux64, 1); -#if BYTE_ORDER == LITTLE_ENDIAN -#define SHELLMAGIC 0x2123 /* #! */ -#else -#define SHELLMAGIC 0x2321 -#endif - #if defined(DEBUG) SYSCTL_PROC(_compat_linux, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, @@ -125,7 +119,6 @@ static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); static void linux_set_syscall_retval(struct thread *td, int error); static int linux_fetch_syscall_args(struct thread *td); -static int linux_exec_imgact_try(struct image_params *iparams); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static int linux_vsyscall(struct thread *td); @@ -661,42 +654,6 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse set_pcb_flags(td->td_pcb, PCB_FULL_IRET); PROC_LOCK(p); mtx_lock(&psp->ps_mtx); -} - -/* - * If a Linux binary is exec'ing something, try this image activator - * first. We override standard shell script execution in order to - * be able to modify the interpreter path. We only do this if a Linux - * binary is doing the exec, so we do not create an EXEC module for it. - */ -static int -linux_exec_imgact_try(struct image_params *imgp) -{ - const char *head = (const char *)imgp->image_header; - char *rpath; - int error = -1; - - /* - * The interpreter for shell scripts run from a Linux binary needs - * to be located in /compat/linux if possible in order to recursively - * maintain Linux path emulation. - */ - if (((const short *)head)[0] == SHELLMAGIC) { - /* - * Run our normal shell image activator. If it succeeds then - * attempt to use the alternate path for the interpreter. If - * an alternate path is found, use our stringspace to store it. - */ - if ((error = exec_shell_imgact(imgp)) == 0) { - linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), - imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, - AT_FDCWD); - if (rpath != NULL) - imgp->args->fname_buf = - imgp->interpreter_name = rpath; - } - } - return (error); } #define LINUX_VSYSCALL_START (-10UL << 20) Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Apr 9 16:32:49 2018 (r332332) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon Apr 9 17:24:01 2018 (r332333) @@ -95,12 +95,6 @@ MODULE_VERSION(linux, 1); suword32(pos++, val); \ } while (0) -#if BYTE_ORDER == LITTLE_ENDIAN -#define SHELLMAGIC 0x2123 /* #! */ -#else -#define SHELLMAGIC 0x2321 -#endif - /* * Allow the sendsig functions to use the ldebug() facility even though they * are not syscalls themselves. Map them to syscall 0. This is slightly less @@ -124,7 +118,6 @@ static int linux_fixup_elf(register_t **stack_base, struct image_params *iparams); static register_t *linux_copyout_strings(struct image_params *imgp); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); -static int linux_exec_imgact_try(struct image_params *iparams); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); @@ -715,42 +708,6 @@ linux32_fetch_syscall_args(struct thread *td) td->td_retval[1] = frame->tf_rdx; return (0); -} - -/* - * If a Linux binary is exec'ing something, try this image activator - * first. We override standard shell script execution in order to - * be able to modify the interpreter path. We only do this if a Linux - * binary is doing the exec, so we do not create an EXEC module for it. - */ -static int -linux_exec_imgact_try(struct image_params *imgp) -{ - const char *head = (const char *)imgp->image_header; - char *rpath; - int error = -1; - - /* - * The interpreter for shell scripts run from a Linux binary needs - * to be located in /compat/linux if possible in order to recursively - * maintain Linux path emulation. - */ - if (((const short *)head)[0] == SHELLMAGIC) { - /* - * Run our normal shell image activator. If it succeeds then - * attempt to use the alternate path for the interpreter. If - * an alternate path is found, use our stringspace to store it. - */ - if ((error = exec_shell_imgact(imgp)) == 0) { - linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), - imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, - AT_FDCWD); - if (rpath != NULL) - imgp->args->fname_buf = - imgp->interpreter_name = rpath; - } - } - return (error); } /* Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Mon Apr 9 16:32:49 2018 (r332332) +++ head/sys/compat/linux/linux_emul.c Mon Apr 9 17:24:01 2018 (r332333) @@ -1,6 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 1994-1996 Søren Schmidt * Copyright (c) 2006 Roman Divacky * Copyright (c) 2013 Dmitry Chagin * All rights reserved. @@ -32,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -48,6 +50,11 @@ __FBSDID("$FreeBSD$"); #include #include +#if BYTE_ORDER == LITTLE_ENDIAN +#define SHELLMAGIC 0x2123 /* #! */ +#else +#define SHELLMAGIC 0x2321 +#endif /* * This returns reference to the thread emuldata entry (if found) @@ -166,6 +173,42 @@ linux_proc_exit(void *arg __unused, struct proc *p) sx_destroy(&pem->pem_sx); free(pem, M_LINUX); +} + +/* + * If a Linux binary is exec'ing something, try this image activator + * first. We override standard shell script execution in order to + * be able to modify the interpreter path. We only do this if a Linux + * binary is doing the exec, so we do not create an EXEC module for it. + */ +int +linux_exec_imgact_try(struct image_params *imgp) +{ + const char *head = (const char *)imgp->image_header; + char *rpath; + int error = -1; + + /* + * The interpreter for shell scripts run from a Linux binary needs + * to be located in /compat/linux if possible in order to recursively + * maintain Linux path emulation. + */ + if (((const short *)head)[0] == SHELLMAGIC) { + /* + * Run our normal shell image activator. If it succeeds attempt + * to use the alternate path for the interpreter. If an + * alternate path is found, use our stringspace to store it. + */ + if ((error = exec_shell_imgact(imgp)) == 0) { + linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), + imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, + AT_FDCWD); + if (rpath != NULL) + imgp->args->fname_buf = + imgp->interpreter_name = rpath; + } + } + return (error); } int Modified: head/sys/compat/linux/linux_emul.h ============================================================================== --- head/sys/compat/linux/linux_emul.h Mon Apr 9 16:32:49 2018 (r332332) +++ head/sys/compat/linux/linux_emul.h Mon Apr 9 17:24:01 2018 (r332333) @@ -49,6 +49,7 @@ struct linux_emuldata { struct linux_emuldata *em_find(struct thread *); +int linux_exec_imgact_try(struct image_params *); void linux_proc_init(struct thread *, struct thread *, int); void linux_proc_exit(void *, struct proc *); void linux_schedtail(struct thread *); Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Mon Apr 9 16:32:49 2018 (r332332) +++ head/sys/i386/linux/linux_sysvec.c Mon Apr 9 17:24:01 2018 (r332333) @@ -77,12 +77,6 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(linux, 1); -#if BYTE_ORDER == LITTLE_ENDIAN -#define SHELLMAGIC 0x2123 /* #! */ -#else -#define SHELLMAGIC 0x2321 -#endif - #if defined(DEBUG) SYSCTL_PROC(_compat_linux, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, linux_sysctl_debug, "A", "Linux debugging control"); @@ -113,7 +107,6 @@ static int linux_fixup(register_t **stack_base, static int linux_fixup_elf(register_t **stack_base, struct image_params *iparams); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); -static int linux_exec_imgact_try(struct image_params *iparams); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static register_t *linux_copyout_strings(struct image_params *imgp); @@ -813,42 +806,6 @@ linux_fetch_syscall_args(struct thread *td) td->td_retval[1] = frame->tf_edx; return (0); -} - -/* - * If a Linux binary is exec'ing something, try this image activator - * first. We override standard shell script execution in order to - * be able to modify the interpreter path. We only do this if a Linux - * binary is doing the exec, so we do not create an EXEC module for it. - */ -static int -linux_exec_imgact_try(struct image_params *imgp) -{ - const char *head = (const char *)imgp->image_header; - char *rpath; - int error = -1; - - /* - * The interpreter for shell scripts run from a Linux binary needs - * to be located in /compat/linux if possible in order to recursively - * maintain Linux path emulation. - */ - if (((const short *)head)[0] == SHELLMAGIC) { - /* - * Run our normal shell image activator. If it succeeds then - * attempt to use the alternate path for the interpreter. If - * an alternate path is found, use our stringspace to store it. - */ - if ((error = exec_shell_imgact(imgp)) == 0) { - linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), - imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, - AT_FDCWD); - if (rpath != NULL) - imgp->args->fname_buf = - imgp->interpreter_name = rpath; - } - } - return (error); } /* From owner-svn-src-all@freebsd.org Mon Apr 9 17:30:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38E2BF91208; Mon, 9 Apr 2018 17:30:31 +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 DC2A08288D; Mon, 9 Apr 2018 17:30:30 +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 B95FF21B7A; Mon, 9 Apr 2018 17:30:30 +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 w39HUU9r051042; Mon, 9 Apr 2018 17:30:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39HUUxw051037; Mon, 9 Apr 2018 17:30:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804091730.w39HUUxw051037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Apr 2018 17:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332334 - in head: share/man/man4 sys/conf sys/geom X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/geom X-SVN-Commit-Revision: 332334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 17:30:31 -0000 Author: kevans Date: Mon Apr 9 17:30:30 2018 New Revision: 332334 URL: https://svnweb.freebsd.org/changeset/base/332334 Log: Retire the geom_aes class It's had a good life, but it's not really configurable and not really used. Obtained from: opBSD (with some changes) Differential Revision: https://reviews.freebsd.org/D14991 Deleted: head/sys/geom/geom_aes.c Modified: head/share/man/man4/geom.4 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options Modified: head/share/man/man4/geom.4 ============================================================================== --- head/share/man/man4/geom.4 Mon Apr 9 17:24:01 2018 (r332333) +++ head/share/man/man4/geom.4 Mon Apr 9 17:30:30 2018 (r332334) @@ -34,14 +34,13 @@ .\" .\" $FreeBSD$ .\" -.Dd August 9, 2017 +.Dd April 9, 2018 .Dt GEOM 4 .Os .Sh NAME .Nm GEOM .Nd "modular disk I/O request transformation framework" .Sh SYNOPSIS -.Cd options GEOM_AES .Cd options GEOM_BDE .Cd options GEOM_CACHE .Cd options GEOM_CONCAT Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Apr 9 17:24:01 2018 (r332333) +++ head/sys/conf/NOTES Mon Apr 9 17:30:30 2018 (r332334) @@ -145,7 +145,6 @@ options INCLUDE_CONFIG_FILE # Include this file i options BOOTVERBOSE=1 options BOOTHOWTO=RB_MULTIPLE -options GEOM_AES # Don't use, use GEOM_BDE options GEOM_BDE # Disk encryption. options GEOM_BSD # BSD disklabels (obsolete, gone in 12) options GEOM_CACHE # Disk cache. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Apr 9 17:24:01 2018 (r332333) +++ head/sys/conf/files Mon Apr 9 17:30:30 2018 (r332334) @@ -3658,7 +3658,6 @@ geom/eli/g_eli_key_cache.c optional geom_eli geom/eli/g_eli_privacy.c optional geom_eli geom/eli/pkcs5v2.c optional geom_eli geom/gate/g_gate.c optional geom_gate -geom/geom_aes.c optional geom_aes geom/geom_bsd.c optional geom_bsd geom/geom_bsd_enc.c optional geom_bsd | geom_part_bsd geom/geom_ccd.c optional ccd | geom_ccd Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Apr 9 17:24:01 2018 (r332333) +++ head/sys/conf/options Mon Apr 9 17:30:30 2018 (r332334) @@ -104,7 +104,6 @@ FULL_PREEMPTION opt_sched.h GZIO opt_gzio.h IMAGACT_BINMISC opt_dontuse.h IPI_PREEMPTION opt_sched.h -GEOM_AES opt_geom.h GEOM_BDE opt_geom.h GEOM_BSD opt_geom.h GEOM_CACHE opt_geom.h From owner-svn-src-all@freebsd.org Mon Apr 9 19:11:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F470F9AEEA; Mon, 9 Apr 2018 19:11:25 +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 06C888D91C; Mon, 9 Apr 2018 19:11:25 +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 01E5B22C50; Mon, 9 Apr 2018 19:11:25 +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 w39JBOLk006250; Mon, 9 Apr 2018 19:11:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39JBOIi006249; Mon, 9 Apr 2018 19:11:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804091911.w39JBOIi006249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 19:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332335 - head/sys/amd64/linux32 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/amd64/linux32 X-SVN-Commit-Revision: 332335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 19:11:26 -0000 Author: emaste Date: Mon Apr 9 19:11:24 2018 New Revision: 332335 URL: https://svnweb.freebsd.org/changeset/base/332335 Log: linuxulator: add else case braces to reduce diffs between archs Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/amd64/linux32/linux32_sysvec.c Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Apr 9 17:30:30 2018 (r332334) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon Apr 9 19:11:24 2018 (r332335) @@ -805,13 +805,14 @@ linux_copyout_strings(struct image_params *imgp) imgp->args->envc + 2 + imgp->auxarg_size) * sizeof(u_int32_t)); - } else + } else { /* * The '+ 2' is for the null pointers at the end of each of * the arg and env vector sets */ vectp = (u_int32_t *)(destp - (imgp->args->argc + imgp->args->envc + 2) * sizeof(u_int32_t)); + } /* vectp also becomes our initial stack base. */ stack_base = vectp; From owner-svn-src-all@freebsd.org Mon Apr 9 19:52:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A78DF9E294; Mon, 9 Apr 2018 19:52:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D343E6EB81; Mon, 9 Apr 2018 19:52:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 042CA10AFAD; Mon, 9 Apr 2018 15:52:45 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: Ed Maste , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332090 - head/stand/i386 Date: Mon, 09 Apr 2018 12:28:47 -0700 Message-ID: <3188731.iHBUE9bOzj@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201804060257.w362vwi3023158@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 09 Apr 2018 15:52:45 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 19:52:46 -0000 On Monday, April 09, 2018 11:02:01 AM Warner Losh wrote: > On Mon, Apr 9, 2018 at 10:44 AM, Ed Maste wrote: > > > On 6 April 2018 at 13:54, John Baldwin wrote: > > > On Friday, April 06, 2018 02:57:58 AM Ed Maste wrote: > > >> Author: emaste > > >> Date: Fri Apr 6 02:57:58 2018 > > >> New Revision: 332090 > > >> URL: https://svnweb.freebsd.org/changeset/base/332090 > > >> > > >> Log: > > >> stand: pass --no-rosegment for i386 bits when linking with lld > > >> > > > > > > Maybe we should support LDFLAGS.${LINKER_TYPE} as we do for CFLAGS, etc.? > > > > I don't anticipate LINKER_TYPE tests proliferating, but a good point > > nonetheless. Change proposed in review D14998. > > > > We only really support two compilers. This lets us have fewer .if > statements which historically people have messed often enough that we've > move to constructs that avoid them. I do think we are likely to have far fewer conditional LDFLAGS rather than CFLAGS though. I think if we are only going to have 1 or 2 instances in the tree then LDFLAGS.LINKER_TYPE might perhaps be overkill, but if we think there will be several then I think it is more readable. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Apr 9 20:00:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1221F9EB15; Mon, 9 Apr 2018 20:00:07 +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 9E8F77071E; Mon, 9 Apr 2018 20:00:07 +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 996DB23422; Mon, 9 Apr 2018 20:00:07 +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 w39K07UQ032269; Mon, 9 Apr 2018 20:00:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39K07X4032268; Mon, 9 Apr 2018 20:00:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804092000.w39K07X4032268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 20:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332336 - stable/11/contrib/dma X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/dma X-SVN-Commit-Revision: 332336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 20:00:08 -0000 Author: emaste Date: Mon Apr 9 20:00:07 2018 New Revision: 332336 URL: https://svnweb.freebsd.org/changeset/base/332336 Log: MFC r326641 by bapt: Split body of mails not respecting RFC2822 For mails which has a body not respecting RFC2822 (which often happen with crontabs) try to split by words finding the last space before 1000's character If no spaces are found then consider the mail to be malformed anyway PR: 208261 Modified: stable/11/contrib/dma/mail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/dma/mail.c ============================================================================== --- stable/11/contrib/dma/mail.c Mon Apr 9 19:11:24 2018 (r332335) +++ stable/11/contrib/dma/mail.c Mon Apr 9 20:00:07 2018 (r332336) @@ -41,6 +41,8 @@ #include "dma.h" +#define MAX_LINE_RFC822 1000 + void bounce(struct qitem *it, const char *reason) { @@ -341,19 +343,47 @@ newaddr: goto again; } +static int +writeline(struct queue *queue, const char *line, ssize_t linelen) +{ + ssize_t len; + + while (linelen > 0) { + len = linelen; + if (linelen > MAX_LINE_RFC822) { + len = MAX_LINE_RFC822 - 10; + } + + if (fwrite(line, len, 1, queue->mailf) != 1) + return (-1); + + if (linelen <= MAX_LINE_RFC822) + break; + + if (fwrite("\n", 1, 1, queue->mailf) != 1) + return (-1); + + line += MAX_LINE_RFC822 - 10; + linelen = strlen(line); + } + return (0); +} + int readmail(struct queue *queue, int nodot, int recp_from_header) { struct parse_state parse_state; - char line[1000]; /* by RFC2822 */ - size_t linelen; + char *line = NULL; + ssize_t linelen; + size_t linecap = 0; + char newline[MAX_LINE_RFC822]; size_t error; int had_headers = 0; int had_from = 0; int had_messagid = 0; int had_date = 0; - int had_last_line = 0; int nocopy = 0; + int ret = -1; parse_state.state = NONE; @@ -372,24 +402,17 @@ readmail(struct queue *queue, int nodot, int recp_from return (-1); while (!feof(stdin)) { - if (fgets(line, sizeof(line) - 1, stdin) == NULL) + newline[0] = '\0'; + if ((linelen = getline(&line, &linecap, stdin)) <= 0) break; - if (had_last_line) - errlogx(EX_DATAERR, "bad mail input format:" - " from %s (uid %d) (envelope-from %s)", - username, useruid, queue->sender); - linelen = strlen(line); - if (linelen == 0 || line[linelen - 1] != '\n') { - /* - * This line did not end with a newline character. - * If we fix it, it better be the last line of - * the file. - */ - line[linelen] = '\n'; - line[linelen + 1] = 0; - had_last_line = 1; - } + if (!had_headers) { + if (linelen > MAX_LINE_RFC822) { + /* XXX also split headers */ + errlogx(EX_DATAERR, "bad mail input format:" + " from %s (uid %d) (envelope-from %s)", + username, useruid, queue->sender); + } /* * Unless this is a continuation, switch of * the Bcc: nocopy flag. @@ -430,31 +453,39 @@ readmail(struct queue *queue, int nodot, int recp_from while (!had_date || !had_messagid || !had_from) { if (!had_date) { had_date = 1; - snprintf(line, sizeof(line), "Date: %s\n", rfc822date()); + snprintf(newline, sizeof(newline), "Date: %s\n", rfc822date()); } else if (!had_messagid) { /* XXX msgid, assign earlier and log? */ had_messagid = 1; - snprintf(line, sizeof(line), "Message-Id: <%"PRIxMAX".%s.%"PRIxMAX"@%s>\n", + snprintf(newline, sizeof(newline), "Message-Id: <%"PRIxMAX".%s.%"PRIxMAX"@%s>\n", (uintmax_t)time(NULL), queue->id, (uintmax_t)random(), hostname()); } else if (!had_from) { had_from = 1; - snprintf(line, sizeof(line), "From: <%s>\n", queue->sender); + snprintf(newline, sizeof(newline), "From: <%s>\n", queue->sender); } - if (fwrite(line, strlen(line), 1, queue->mailf) != 1) - return (-1); + if (fwrite(newline, strlen(newline), 1, queue->mailf) != 1) + goto fail; } - strcpy(line, "\n"); + strlcpy(newline, "\n", sizeof(newline)); } if (!nodot && linelen == 2 && line[0] == '.') break; if (!nocopy) { - if (fwrite(line, strlen(line), 1, queue->mailf) != 1) - return (-1); + if (newline[0]) { + if (fwrite(newline, strlen(newline), 1, queue->mailf) != 1) + goto fail; + } else { + if (writeline(queue, line, linelen) != 0) + goto fail; + } } } - return (0); + ret = 0; +fail: + free(line); + return (ret); } From owner-svn-src-all@freebsd.org Mon Apr 9 21:16:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79689FA37C5; Mon, 9 Apr 2018 21:16:29 +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 22EA28467B; Mon, 9 Apr 2018 21:16:29 +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 0F34B24141; Mon, 9 Apr 2018 21:16:29 +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 w39LGSwL072153; Mon, 9 Apr 2018 21:16:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39LGSDm072152; Mon, 9 Apr 2018 21:16:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804092116.w39LGSDm072152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 9 Apr 2018 21:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332337 - stable/11/libexec/dma/dmagent X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/libexec/dma/dmagent X-SVN-Commit-Revision: 332337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 21:16:29 -0000 Author: emaste Date: Mon Apr 9 21:16:28 2018 New Revision: 332337 URL: https://svnweb.freebsd.org/changeset/base/332337 Log: dmagent: add -D_WITH_GETLINE to fix stable/11 build The need for _WITH_GETLINE and _WITH_DPRINTF was removed in HEAD in r303524 but is still needed in stable/11 to enable prototypes for these functions. Modified: stable/11/libexec/dma/dmagent/Makefile Modified: stable/11/libexec/dma/dmagent/Makefile ============================================================================== --- stable/11/libexec/dma/dmagent/Makefile Mon Apr 9 20:00:07 2018 (r332336) +++ stable/11/libexec/dma/dmagent/Makefile Mon Apr 9 21:16:28 2018 (r332337) @@ -20,6 +20,7 @@ SRCS= aliases_parse.y \ MAN8= dma.8 CONFS= dma.conf CONFSDIR= ${CONFDIR}/dma +CFLAGS+= -D_WITH_GETLINE YFLAGS+= -i CLEANFILES= aliases_parse.i FILES= mailer.conf From owner-svn-src-all@freebsd.org Mon Apr 9 21:46:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F322F815F7; Mon, 9 Apr 2018 21:46:59 +0000 (UTC) (envelope-from jtl@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 42D416B6A2; Mon, 9 Apr 2018 21:46:59 +0000 (UTC) (envelope-from jtl@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 3C95724616; Mon, 9 Apr 2018 21:46:59 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39LkxKR087163; Mon, 9 Apr 2018 21:46:59 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39LkwtE087161; Mon, 9 Apr 2018 21:46:58 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804092146.w39LkwtE087161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 9 Apr 2018 21:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r332340 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 332340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 21:46:59 -0000 Author: jtl Date: Mon Apr 9 21:46:58 2018 New Revision: 332340 URL: https://svnweb.freebsd.org/changeset/base/332340 Log: Add Tom Jones (thj@) as a source committer. Tom has been doing work to add support for the GPD Pocket, as well as doing some transport-related work. He plans to continue working on GPD Pocket support. He also plans to work on UDP options support. I will be his mentor. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Mon Apr 9 21:38:45 2018 (r332339) +++ svnadmin/conf/access Mon Apr 9 21:46:58 2018 (r332340) @@ -208,6 +208,7 @@ stevek syrinx takawata theraven +thj thomas thompsa tijl Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Apr 9 21:38:45 2018 (r332339) +++ svnadmin/conf/mentors Mon Apr 9 21:46:58 2018 (r332340) @@ -30,4 +30,5 @@ rgrimes grehan sef mav slavash kib Co-mentor: hselasky slm ken Co-mentor: scottl, ambrisko +thj jtl wosch cem From owner-svn-src-all@freebsd.org Mon Apr 9 22:06:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D434F826F7; Mon, 9 Apr 2018 22:06:19 +0000 (UTC) (envelope-from gonzo@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 3DE0770898; Mon, 9 Apr 2018 22:06:19 +0000 (UTC) (envelope-from gonzo@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 3592624948; Mon, 9 Apr 2018 22:06:19 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39M6JUS096883; Mon, 9 Apr 2018 22:06:19 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39M6GwK096856; Mon, 9 Apr 2018 22:06:16 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804092206.w39M6GwK096856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 9 Apr 2018 22:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332341 - in head/sys: arm/amlogic/aml8726 arm/annapurna/alpine arm/at91 arm/broadcom/bcm2835 arm/freescale/imx arm/nvidia/drm2 arm/ti dev/cpufreq dev/dpaa dev/extres/clk dev/extres/phy... X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys: arm/amlogic/aml8726 arm/annapurna/alpine arm/at91 arm/broadcom/bcm2835 arm/freescale/imx arm/nvidia/drm2 arm/ti dev/cpufreq dev/dpaa dev/extres/clk dev/extres/phy dev/extres/regulator dev... X-SVN-Commit-Revision: 332341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 22:06:20 -0000 Author: gonzo Date: Mon Apr 9 22:06:16 2018 New Revision: 332341 URL: https://svnweb.freebsd.org/changeset/base/332341 Log: Align OF_getencprop_alloc API with OF_getencprop and OF_getprop_alloc Change OF_getencprop_alloc semantics to be combination of malloc and OF_getencprop and return size of the property, not number of elements allocated. For the use cases where number of elements is preferred introduce OF_getencprop_alloc_multi helper function that copies semantics of OF_getencprop_alloc prior to this change. This is to make OF_getencprop_alloc and OF_getencprop_alloc_multi function signatures consistent with OF_getencprop_alloc and OF_getencprop_alloc_multi. Functionality-wise this patch is mostly rename of OF_getencprop_alloc to OF_getencprop_alloc_multi except two calls in ofw_bus_setup_iinfo where 1 was used as a block size. Modified: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c head/sys/arm/annapurna/alpine/alpine_pci_msix.c head/sys/arm/at91/at91_pinctrl.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/freescale/imx/imx_iomux.c head/sys/arm/nvidia/drm2/tegra_drm_subr.c head/sys/arm/ti/ti_adc.c head/sys/arm/ti/ti_pinmux.c head/sys/dev/cpufreq/cpufreq_dt.c head/sys/dev/dpaa/qman_fdt.c head/sys/dev/extres/clk/clk.c head/sys/dev/extres/phy/phy.c head/sys/dev/extres/regulator/regulator.c head/sys/dev/extres/syscon/syscon.c head/sys/dev/fdt/fdt_clock.c head/sys/dev/fdt/fdt_pinctrl.c head/sys/dev/gpio/gpioregulator.c head/sys/dev/gpio/ofw_gpiobus.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h head/sys/dev/vnic/thunder_bgx_fdt.c head/sys/mips/ingenic/jz4780_pinctrl.c head/sys/mips/mediatek/fdt_reset.c head/sys/powerpc/mpc85xx/lbc.c Modified: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c Mon Apr 9 22:06:16 2018 (r332341) @@ -195,7 +195,7 @@ aml8726_usb_phy_attach(device_t dev) err = 0; - len = OF_getencprop_alloc(node, "usb-pwr-en", + len = OF_getencprop_alloc_multi(node, "usb-pwr-en", 3 * sizeof(pcell_t), (void **)&prop); npwr_en = (len > 0) ? len : 0; Modified: head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c Mon Apr 9 22:06:16 2018 (r332341) @@ -167,7 +167,7 @@ aml8726_usb_phy_attach(device_t dev) err = 0; - len = OF_getencprop_alloc(node, "usb-pwr-en", + len = OF_getencprop_alloc_multi(node, "usb-pwr-en", 3 * sizeof(pcell_t), (void **)&prop); npwr_en = (len > 0) ? len : 0; @@ -188,7 +188,7 @@ aml8726_usb_phy_attach(device_t dev) OF_prop_free(prop); - len = OF_getencprop_alloc(node, "usb-hub-rst", + len = OF_getencprop_alloc_multi(node, "usb-hub-rst", 3 * sizeof(pcell_t), (void **)&prop); if (len > 0) { sc->hub_rst.dev = OF_device_from_xref(prop[0]); Modified: head/sys/arm/annapurna/alpine/alpine_pci_msix.c ============================================================================== --- head/sys/arm/annapurna/alpine/alpine_pci_msix.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/arm/annapurna/alpine/alpine_pci_msix.c Mon Apr 9 22:06:16 2018 (r332341) @@ -188,7 +188,7 @@ al_msix_attach(device_t dev) sc->gic_dev = gic_dev; /* Manually read range of interrupts from DTB */ - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + nintr = OF_getencprop_alloc_multi(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr == 0) { device_printf(dev, "Cannot read interrupts prop from DTB\n"); Modified: head/sys/arm/at91/at91_pinctrl.c ============================================================================== --- head/sys/arm/at91/at91_pinctrl.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/arm/at91/at91_pinctrl.c Mon Apr 9 22:06:16 2018 (r332341) @@ -101,7 +101,8 @@ at91_pinctrl_setup_dinfo(device_t dev, phandle_t node) } resource_list_init(&ndi->rl); - nreg = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)®); + nreg = OF_getencprop_alloc_multi(node, "reg", sizeof(*reg), + (void **)®); if (nreg == -1) nreg = 0; if (nreg % (sc->acells + sc->scells) != 0) { @@ -127,7 +128,7 @@ at91_pinctrl_setup_dinfo(device_t dev, phandle_t node) } OF_prop_free(reg); - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + nintr = OF_getencprop_alloc_multi(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { if (OF_searchencprop(node, "interrupt-parent", &iparent, @@ -393,7 +394,7 @@ pinctrl_configure_pins(device_t bus, phandle_t cfgxref node = OF_node_from_xref(cfgxref); memset(name, 0, sizeof(name)); OF_getprop(node, "name", name, sizeof(name)); - npins = OF_getencprop_alloc(node, "atmel,pins", sizeof(*cfgdata), + npins = OF_getencprop_alloc_multi(node, "atmel,pins", sizeof(*cfgdata), (void **)&cfgdata); if (npins < 0) { printf("We're doing it wrong %s\n", name); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Mon Apr 9 22:06:16 2018 (r332341) @@ -623,7 +623,7 @@ bcm_gpio_get_ro_pins(struct bcm_gpio_softc *sc, phandl pcell_t *pins; /* Get the property data. */ - npins = OF_getencprop_alloc(node, propname, sizeof(*pins), + npins = OF_getencprop_alloc_multi(node, propname, sizeof(*pins), (void **)&pins); if (npins < 0) return (-1); @@ -1214,8 +1214,8 @@ bcm_gpio_configure_pins(device_t dev, phandle_t cfgxre cfgnode = OF_node_from_xref(cfgxref); pins = NULL; - pintuples = OF_getencprop_alloc(cfgnode, "brcm,pins", sizeof(*pins), - (void **)&pins); + pintuples = OF_getencprop_alloc_multi(cfgnode, "brcm,pins", + sizeof(*pins), (void **)&pins); char name[32]; OF_getprop(cfgnode, "name", &name, sizeof(name)); @@ -1233,8 +1233,8 @@ bcm_gpio_configure_pins(device_t dev, phandle_t cfgxre } pulls = NULL; - pulltuples = OF_getencprop_alloc(cfgnode, "brcm,pull", sizeof(*pulls), - (void **)&pulls); + pulltuples = OF_getencprop_alloc_multi(cfgnode, "brcm,pull", + sizeof(*pulls), (void **)&pulls); if ((pulls != NULL) && (pulltuples != pintuples)) { OF_prop_free(pins); Modified: head/sys/arm/freescale/imx/imx_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx_iomux.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/arm/freescale/imx/imx_iomux.c Mon Apr 9 22:06:16 2018 (r332341) @@ -153,8 +153,8 @@ iomux_configure_pins(device_t dev, phandle_t cfgxref) sc = device_get_softc(dev); cfgnode = OF_node_from_xref(cfgxref); - ntuples = OF_getencprop_alloc(cfgnode, "fsl,pins", sizeof(*cfgtuples), - (void **)&cfgtuples); + ntuples = OF_getencprop_alloc_multi(cfgnode, "fsl,pins", + sizeof(*cfgtuples), (void **)&cfgtuples); if (ntuples < 0) return (ENOENT); if (ntuples == 0) Modified: head/sys/arm/nvidia/drm2/tegra_drm_subr.c ============================================================================== --- head/sys/arm/nvidia/drm2/tegra_drm_subr.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/arm/nvidia/drm2/tegra_drm_subr.c Mon Apr 9 22:06:16 2018 (r332341) @@ -125,7 +125,7 @@ tegra_drm_encoder_attach(struct tegra_drm_encoder *out /* XXX parse output panel here */ - rv = OF_getencprop_alloc(node, "nvidia,edid", 1, + rv = OF_getencprop_alloc(node, "nvidia,edid", (void **)&output->edid); /* EDID exist but have invalid size */ @@ -174,4 +174,4 @@ int tegra_drm_encoder_exit(struct tegra_drm_encoder *o /* detach panel */ } return (0); -} \ No newline at end of file +} Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/arm/ti/ti_adc.c Mon Apr 9 22:06:16 2018 (r332341) @@ -777,8 +777,9 @@ ti_adc_attach(device_t dev) if ((OF_getencprop(child, "ti,charge-delay", &cell, sizeof(cell))) > 0) sc->sc_charge_delay = cell; - nwire_configs = OF_getencprop_alloc(child, "ti,wire-config", - sizeof(*wire_configs), (void **)&wire_configs); + nwire_configs = OF_getencprop_alloc_multi(child, + "ti,wire-config", sizeof(*wire_configs), + (void **)&wire_configs); if (nwire_configs != sc->sc_tsc_wires) { device_printf(sc->sc_dev, "invalid number of ti,wire-config: %d (should be %d)\n", @@ -795,8 +796,8 @@ ti_adc_attach(device_t dev) /* Read "adc" node properties */ child = ofw_bus_find_child(node, "adc"); if (child != 0) { - sc->sc_adc_nchannels = OF_getencprop_alloc(child, "ti,adc-channels", - sizeof(*channels), (void **)&channels); + sc->sc_adc_nchannels = OF_getencprop_alloc_multi(child, + "ti,adc-channels", sizeof(*channels), (void **)&channels); if (sc->sc_adc_nchannels > 0) { for (i = 0; i < sc->sc_adc_nchannels; i++) sc->sc_adc_channels[i] = channels[i]; Modified: head/sys/arm/ti/ti_pinmux.c ============================================================================== --- head/sys/arm/ti/ti_pinmux.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/arm/ti/ti_pinmux.c Mon Apr 9 22:06:16 2018 (r332341) @@ -340,8 +340,8 @@ ti_pinmux_configure_pins(device_t dev, phandle_t cfgxr sc = device_get_softc(dev); cfgnode = OF_node_from_xref(cfgxref); - ntuples = OF_getencprop_alloc(cfgnode, "pinctrl-single,pins", sizeof(*cfgtuples), - (void **)&cfgtuples); + ntuples = OF_getencprop_alloc_multi(cfgnode, "pinctrl-single,pins", + sizeof(*cfgtuples), (void **)&cfgtuples); if (ntuples < 0) return (ENOENT); Modified: head/sys/dev/cpufreq/cpufreq_dt.c ============================================================================== --- head/sys/dev/cpufreq/cpufreq_dt.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/cpufreq/cpufreq_dt.c Mon Apr 9 22:06:16 2018 (r332341) @@ -289,7 +289,7 @@ cpufreq_dt_attach(device_t dev) return (ENXIO); } - sc->nopp = OF_getencprop_alloc(node, "operating-points", + sc->nopp = OF_getencprop_alloc_multi(node, "operating-points", sizeof(*sc->opp), (void **)&opp); if (sc->nopp == -1) return (ENXIO); Modified: head/sys/dev/dpaa/qman_fdt.c ============================================================================== --- head/sys/dev/dpaa/qman_fdt.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/dpaa/qman_fdt.c Mon Apr 9 22:06:16 2018 (r332341) @@ -185,7 +185,7 @@ qman_portals_fdt_attach(device_t dev) get_addr_props(ofw_bus_get_node(device_get_parent(dev)), &paddr, &size); get_addr_props(node, &addr, &size); - nrange = OF_getencprop_alloc(node, "ranges", + nrange = OF_getencprop_alloc_multi(node, "ranges", sizeof(*range), (void **)&range); if (nrange < addr + paddr + size) return (ENXIO); Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/extres/clk/clk.c Mon Apr 9 22:06:16 2018 (r332341) @@ -1409,7 +1409,7 @@ clk_parse_ofw_out_names(device_t dev, phandle_t node, if (!OF_hasprop(node, "clock-indices")) return (name_items); - rv = OF_getencprop_alloc(node, "clock-indices", sizeof (uint32_t), + rv = OF_getencprop_alloc_multi(node, "clock-indices", sizeof (uint32_t), (void **)indices); if (rv != name_items) { device_printf(dev, " Size of 'clock-output-names' and " Modified: head/sys/dev/extres/phy/phy.c ============================================================================== --- head/sys/dev/extres/phy/phy.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/extres/phy/phy.c Mon Apr 9 22:06:16 2018 (r332341) @@ -563,7 +563,7 @@ phy_get_by_ofw_property(device_t consumer_dev, phandle "%s called on not ofw based device\n", __func__); return (ENXIO); } - ncells = OF_getencprop_alloc(cnode, name, sizeof(pcell_t), + ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(pcell_t), (void **)&cells); if (ncells < 1) return (ENXIO); Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/extres/regulator/regulator.c Mon Apr 9 22:06:16 2018 (r332341) @@ -1085,7 +1085,7 @@ regulator_get_by_ofw_property(device_t cdev, phandle_t } cells = NULL; - ncells = OF_getencprop_alloc(cnode, name, sizeof(*cells), + ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(*cells), (void **)&cells); if (ncells <= 0) return (ENXIO); Modified: head/sys/dev/extres/syscon/syscon.c ============================================================================== --- head/sys/dev/extres/syscon/syscon.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/extres/syscon/syscon.c Mon Apr 9 22:06:16 2018 (r332341) @@ -236,7 +236,7 @@ syscon_get_by_ofw_property(device_t cdev, phandle_t cn "%s called on not ofw based device\n", __func__); return (ENXIO); } - ncells = OF_getencprop_alloc(cnode, name, sizeof(pcell_t), + ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(pcell_t), (void **)&cells); if (ncells < 1) return (ENXIO); Modified: head/sys/dev/fdt/fdt_clock.c ============================================================================== --- head/sys/dev/fdt/fdt_clock.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/fdt/fdt_clock.c Mon Apr 9 22:06:16 2018 (r332341) @@ -58,7 +58,7 @@ enable_disable_all(device_t consumer, boolean_t enable boolean_t anyerrors; cnode = ofw_bus_get_node(consumer); - ncells = OF_getencprop_alloc(cnode, "clocks", sizeof(*clks), + ncells = OF_getencprop_alloc_multi(cnode, "clocks", sizeof(*clks), (void **)&clks); if (enable && ncells < 2) { device_printf(consumer, "Warning: No clocks specified in fdt " @@ -102,7 +102,7 @@ fdt_clock_get_info(device_t consumer, int n, struct fd uint32_t *clks; cnode = ofw_bus_get_node(consumer); - ncells = OF_getencprop_alloc(cnode, "clocks", sizeof(*clks), + ncells = OF_getencprop_alloc_multi(cnode, "clocks", sizeof(*clks), (void **)&clks); if (ncells <= 0) return (ENXIO); Modified: head/sys/dev/fdt/fdt_pinctrl.c ============================================================================== --- head/sys/dev/fdt/fdt_pinctrl.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/fdt/fdt_pinctrl.c Mon Apr 9 22:06:16 2018 (r332341) @@ -46,7 +46,7 @@ fdt_pinctrl_configure(device_t client, u_int index) char name[16]; snprintf(name, sizeof(name), "pinctrl-%u", index); - nconfigs = OF_getencprop_alloc(ofw_bus_get_node(client), name, + nconfigs = OF_getencprop_alloc_multi(ofw_bus_get_node(client), name, sizeof(*configs), (void **)&configs); if (nconfigs < 0) return (ENOENT); @@ -122,7 +122,7 @@ pinctrl_configure_children(device_t pinctrl, phandle_t if (!ofw_bus_node_status_okay(node)) continue; pinctrl_configure_children(pinctrl, node); - nconfigs = OF_getencprop_alloc(node, "pinctrl-0", + nconfigs = OF_getencprop_alloc_multi(node, "pinctrl-0", sizeof(*configs), (void **)&configs); if (nconfigs <= 0) continue; Modified: head/sys/dev/gpio/gpioregulator.c ============================================================================== --- head/sys/dev/gpio/gpioregulator.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/gpio/gpioregulator.c Mon Apr 9 22:06:16 2018 (r332341) @@ -216,7 +216,7 @@ gpioregulator_parse_fdt(struct gpioregulator_softc *sc return (error); /* "states" property (required) */ - len = OF_getencprop_alloc(node, "states", sizeof(*pstates), + len = OF_getencprop_alloc_multi(node, "states", sizeof(*pstates), (void **)&pstates); if (len < 2) { device_printf(sc->dev, "invalid 'states' property\n"); Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/gpio/ofw_gpiobus.c Mon Apr 9 22:06:16 2018 (r332341) @@ -364,7 +364,7 @@ ofw_gpiobus_parse_gpios_impl(device_t consumer, phandl pcell_t *gpios; phandle_t gpio; - ncells = OF_getencprop_alloc(cnode, pname, sizeof(*gpios), + ncells = OF_getencprop_alloc_multi(cnode, pname, sizeof(*gpios), (void **)&gpios); if (ncells == -1) { device_printf(consumer, Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/ofw/ofw_bus_subr.c Mon Apr 9 22:06:16 2018 (r332341) @@ -319,10 +319,10 @@ ofw_bus_setup_iinfo(phandle_t node, struct ofw_bus_iin addrc = 2; ii->opi_addrc = addrc * sizeof(pcell_t); - ii->opi_imapsz = OF_getencprop_alloc(node, "interrupt-map", 1, + ii->opi_imapsz = OF_getencprop_alloc(node, "interrupt-map", (void **)&ii->opi_imap); if (ii->opi_imapsz > 0) { - msksz = OF_getencprop_alloc(node, "interrupt-map-mask", 1, + msksz = OF_getencprop_alloc(node, "interrupt-map-mask", (void **)&ii->opi_imapmsk); /* * Failure to get the mask is ignored; a full mask is used @@ -449,7 +449,8 @@ ofw_bus_msimap(phandle_t node, uint16_t pci_rid, phand int err, i; /* TODO: This should be OF_searchprop_alloc if we had it */ - len = OF_getencprop_alloc(node, "msi-map", sizeof(*map), (void **)&map); + len = OF_getencprop_alloc_multi(node, "msi-map", sizeof(*map), + (void **)&map); if (len < 0) { if (msi_parent != NULL) { *msi_parent = 0; @@ -506,7 +507,8 @@ ofw_bus_reg_to_rl_helper(device_t dev, phandle_t node, if (ret == -1) name = NULL; - ret = OF_getencprop_alloc(node, reg_source, sizeof(*reg), (void **)®); + ret = OF_getencprop_alloc_multi(node, reg_source, sizeof(*reg), + (void **)®); nreg = (ret == -1) ? 0 : ret; if (nreg % (acells + scells) != 0) { @@ -584,7 +586,7 @@ ofw_bus_intr_to_rl(device_t dev, phandle_t node, int err, i, irqnum, nintr, rid; boolean_t extended; - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + nintr = OF_getencprop_alloc_multi(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { iparent = ofw_bus_find_iparent(node); @@ -607,7 +609,7 @@ ofw_bus_intr_to_rl(device_t dev, phandle_t node, } extended = false; } else { - nintr = OF_getencprop_alloc(node, "interrupts-extended", + nintr = OF_getencprop_alloc_multi(node, "interrupts-extended", sizeof(*intr), (void **)&intr); if (nintr <= 0) return (0); @@ -650,7 +652,7 @@ ofw_bus_intr_by_rid(device_t dev, phandle_t node, int int err, i, nintr, rid; boolean_t extended; - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + nintr = OF_getencprop_alloc_multi(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { iparent = ofw_bus_find_iparent(node); @@ -673,7 +675,7 @@ ofw_bus_intr_by_rid(device_t dev, phandle_t node, int } extended = false; } else { - nintr = OF_getencprop_alloc(node, "interrupts-extended", + nintr = OF_getencprop_alloc_multi(node, "interrupts-extended", sizeof(*intr), (void **)&intr); if (nintr <= 0) return (ESRCH); @@ -821,7 +823,7 @@ ofw_bus_parse_xref_list_internal(phandle_t node, const int rv, i, j, nelems, cnt; elems = NULL; - nelems = OF_getencprop_alloc(node, list_name, sizeof(*elems), + nelems = OF_getencprop_alloc_multi(node, list_name, sizeof(*elems), (void **)&elems); if (nelems <= 0) return (ENOENT); Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/ofw/openfirm.c Mon Apr 9 22:06:16 2018 (r332341) @@ -488,9 +488,22 @@ OF_getprop_alloc_multi(phandle_t package, const char * return (len / elsz); } +ssize_t +OF_getencprop_alloc(phandle_t package, const char *name, void **buf) +{ + ssize_t ret; + ret = OF_getencprop_alloc_multi(package, name, sizeof(pcell_t), + buf); + if (ret < 0) + return (ret); + else + return (ret * sizeof(pcell_t)); +} + ssize_t -OF_getencprop_alloc(phandle_t package, const char *name, int elsz, void **buf) +OF_getencprop_alloc_multi(phandle_t package, const char *name, int elsz, + void **buf) { ssize_t retval; pcell_t *cell; @@ -499,11 +512,6 @@ OF_getencprop_alloc(phandle_t package, const char *nam retval = OF_getprop_alloc_multi(package, name, elsz, buf); if (retval == -1) return (-1); - if (retval * elsz % 4 != 0) { - free(*buf, M_OFWPROP); - *buf = NULL; - return (-1); - } cell = *buf; for (i = 0; i < retval * elsz / 4; i++) Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/ofw/openfirm.h Mon Apr 9 22:06:16 2018 (r332341) @@ -120,6 +120,8 @@ ssize_t OF_getprop_alloc(phandle_t node, const char * ssize_t OF_getprop_alloc_multi(phandle_t node, const char *propname, int elsz, void **buf); ssize_t OF_getencprop_alloc(phandle_t node, const char *propname, + void **buf); +ssize_t OF_getencprop_alloc_multi(phandle_t node, const char *propname, int elsz, void **buf); void OF_prop_free(void *buf); int OF_nextprop(phandle_t node, const char *propname, char *buf, Modified: head/sys/dev/vnic/thunder_bgx_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx_fdt.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Mon Apr 9 22:06:16 2018 (r332341) @@ -258,7 +258,7 @@ bgx_fdt_traverse_nodes(uint8_t unit, phandle_t start, BGX_NODE_NAME, sizeof(BGX_NODE_NAME) - 1) != 0) continue; /* Get reg */ - err = OF_getencprop_alloc(node, "reg", sizeof(*reg), + err = OF_getencprop_alloc_multi(node, "reg", sizeof(*reg), (void **)®); if (err == -1) { free(reg, M_OFWPROP); Modified: head/sys/mips/ingenic/jz4780_pinctrl.c ============================================================================== --- head/sys/mips/ingenic/jz4780_pinctrl.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/mips/ingenic/jz4780_pinctrl.c Mon Apr 9 22:06:16 2018 (r332341) @@ -196,8 +196,8 @@ jz4780_pinctrl_configure_pins(device_t dev, phandle_t node = OF_node_from_xref(cfgxref); - len = OF_getencprop_alloc(node, "ingenic,pins", sizeof(uint32_t) * 4, - (void **)&value); + len = OF_getencprop_alloc_multi(node, "ingenic,pins", + sizeof(uint32_t) * 4, (void **)&value); if (len < 0) { device_printf(dev, "missing ingenic,pins attribute in FDT\n"); Modified: head/sys/mips/mediatek/fdt_reset.c ============================================================================== --- head/sys/mips/mediatek/fdt_reset.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/mips/mediatek/fdt_reset.c Mon Apr 9 22:06:16 2018 (r332341) @@ -59,7 +59,7 @@ assert_deassert_all(device_t consumer, boolean_t asser boolean_t anyerrors; rnode = ofw_bus_get_node(consumer); - ncells = OF_getencprop_alloc(rnode, "resets", sizeof(*resets), + ncells = OF_getencprop_alloc_multi(rnode, "resets", sizeof(*resets), (void **)&resets); if (!assert && ncells < 2) { device_printf(consumer, "Warning: No resets specified in fdt " Modified: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.c Mon Apr 9 21:46:58 2018 (r332340) +++ head/sys/powerpc/mpc85xx/lbc.c Mon Apr 9 22:06:16 2018 (r332341) @@ -374,7 +374,8 @@ fdt_lbc_reg_decode(phandle_t node, struct lbc_softc *s return (ENXIO); tuple_size = sizeof(pcell_t) * (addr_cells + size_cells); - tuples = OF_getencprop_alloc(node, "reg", tuple_size, (void **)®); + tuples = OF_getencprop_alloc_multi(node, "reg", tuple_size, + (void **)®); debugf("addr_cells = %d, size_cells = %d\n", addr_cells, size_cells); debugf("tuples = %d, tuple size = %d\n", tuples, tuple_size); if (tuples <= 0) @@ -545,7 +546,7 @@ lbc_attach(device_t dev) tuple_size = sizeof(pcell_t) * (sc->sc_addr_cells + par_addr_cells + sc->sc_size_cells); - tuples = OF_getencprop_alloc(node, "ranges", tuple_size, + tuples = OF_getencprop_alloc_multi(node, "ranges", tuple_size, (void **)&ranges); if (tuples < 0) { device_printf(dev, "could not retrieve 'ranges' property\n"); From owner-svn-src-all@freebsd.org Mon Apr 9 22:23:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83370F837C9; Mon, 9 Apr 2018 22:23:46 +0000 (UTC) (envelope-from gonzo@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 31D7174826; Mon, 9 Apr 2018 22:23:46 +0000 (UTC) (envelope-from gonzo@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 2CACF24C70; Mon, 9 Apr 2018 22:23:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39MNkvi007275; Mon, 9 Apr 2018 22:23:46 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39MNjp5007268; Mon, 9 Apr 2018 22:23:45 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804092223.w39MNjp5007268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 9 Apr 2018 22:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332342 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 332342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 22:23:47 -0000 Author: gonzo Date: Mon Apr 9 22:23:45 2018 New Revision: 332342 URL: https://svnweb.freebsd.org/changeset/base/332342 Log: [man] Add documentation for OpenFirmware API Add man pages for following OpenFirmware functions: OF_child, OF_parent, OF_peer, OF_device_from_xref, OF_device_register_xref, OF_xref_from_device, OF_getprop, OF_getencprop, OF_getencprop_alloc, OF_getprop_alloc, OF_getproplen, OF_hasprop, OF_nextprop, OF_prop_free, OF_searchencprop, OF_searchprop, OF_setprop Edited by: wblock MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D14511 Added: head/share/man/man9/OF_child.9 (contents, props changed) head/share/man/man9/OF_device_from_xref.9 (contents, props changed) head/share/man/man9/OF_finddevice.9 (contents, props changed) head/share/man/man9/OF_getprop.9 (contents, props changed) head/share/man/man9/OF_node_from_xref.9 (contents, props changed) head/share/man/man9/OF_package_to_path.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Apr 9 22:06:16 2018 (r332341) +++ head/share/man/man9/Makefile Mon Apr 9 22:23:45 2018 (r332342) @@ -208,6 +208,12 @@ MAN= accept_filter.9 \ namei.9 \ netisr.9 \ nv.9 \ + OF_child.9 \ + OF_device_from_xref.9 \ + OF_finddevice.9 \ + OF_getprop.9 \ + OF_node_from_xref.9 \ + OF_package_to_path.9 \ ofw_bus_is_compatible.9 \ ofw_bus_status_okay.9 \ osd.9 \ @@ -1527,6 +1533,21 @@ MLINKS+=nv.9 libnv.9 \ nv.9 nvlist_take_string_array.9 \ nv.9 nvlist_unpack.9 \ nv.9 nvlist_xfer.9 +MLINKS+=OF_child.9 OF_parent.9 \ + OF_child.9 OF_peer.9 +MLINKS+=OF_device_from_xref.9 OF_device_register_xref.9 \ + OF_device_from_xref.9 OF_xref_from_device.9 +MLINKS+=OF_getprop.9 OF_getencprop.9 \ + OF_getprop.9 OF_getencprop_alloc.9 \ + OF_getprop.9 OF_getprop_alloc.9 \ + OF_getprop.9 OF_getproplen.9 \ + OF_getprop.9 OF_hasprop.9 \ + OF_getprop.9 OF_nextprop.9 \ + OF_getprop.9 OF_prop_free.9 \ + OF_getprop.9 OF_searchencprop.9 \ + OF_getprop.9 OF_searchprop.9 \ + OF_getprop.9 OF_setprop.9 +MLINKS+=OF_node_from_xref.9 OF_xref_from_node.9 MLINKS+=ofw_bus_is_compatible.9 ofw_bus_is_compatible_strict.9 \ ofw_bus_is_compatible.9 ofw_bus_node_is_compatible.9 \ ofw_bus_is_compatible.9 ofw_bus_search_compatible.9 Added: head/share/man/man9/OF_child.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/OF_child.9 Mon Apr 9 22:23:45 2018 (r332342) @@ -0,0 +1,76 @@ +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 9, 2018 +.Dt OF_CHILD 9 +.Os +.Sh NAME +.Nm OF_child , +.Nm OF_parent , +.Nm OF_peer +.Nd navigate device tree +.Sh SYNOPSIS +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft phandle_t +.Fn OF_child "phandle_t node" +.Ft phandle_t +.Fn OF_parent "phandle_t node" +.Ft phandle_t +.Fn OF_peer "phandle_t node" +.Sh DESCRIPTION +.Pp +.Fn OF_child +returns the phandle value of the first child of the +.Fa node . +Zero is returned if there are no child nodes. +.Pp +.Fn OF_parent +returns the phandle for the parent of the +.Fa node . +Zero is returned if +.Fa node +is the root node. +.Pp +.Fn OF_peer +returns the phandle value of the next sibling of the +.Fa node . +Zero is returned if there is no sibling node. +.Sh EXAMPLES +.Bd -literal +phandle_t node, child; + ... +for (child = OF_child(node); child != 0; child = OF_peer(child) { + ... +} +.Ed +.Sh SEE ALSO +.Xr OF_finddevice 9 +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . Added: head/share/man/man9/OF_device_from_xref.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/OF_device_from_xref.9 Mon Apr 9 22:23:45 2018 (r332342) @@ -0,0 +1,91 @@ +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 9, 2018 +.Dt OF_DEVICE_FROM_XREF 9 +.Os +.Sh NAME +.Nm OF_device_from_xref , +.Nm OF_xref_from_device, +.Nm OF_device_register_xref +.Nd "manage mappings between xrefs and devices" +.Sh SYNOPSIS +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft int +.Fn OF_device_register_xref "phandle_t xref" "device_t dev" +.Ft device_t +.Fn OF_device_from_xref "phandle_t xref" +.Ft phandle_t +.Fn OF_xref_from_device "device_t dev" +.Sh DESCRIPTION +.Pp +When a device tree node references another node, the driver may +need to get a device_t instance associated with the referenced node. +For instance, an Ethernet driver accessing a PHY device. +To make this possible, the kernel maintains a table that +maps effective handles to device_t instances. +.Pp +.Fn OF_device_register_xref +adds a map entry from the effective phandle +.Fa xref +to device +.Fa dev . +If a mapping entry for +.Fa xref +already exists, it is replaced with the new one. +The function always returns 0. +.Pp +.Fn OF_device_from_xref +returns a device_t instance associated with the effective phandle +.Fa xref . +If no such mapping exists, the function returns NULL. +.Pp +.Fn OF_xref_from_device +returns the effective phandle associated with the device +.Fa dev . +If no such mapping exists, the function returns 0. +.Sh EXAMPLES +.Bd -literal + static int + acmephy_attach(device_t dev) + { + phandle_t node; + + /* PHY node is referenced from eth device, register it */ + node = ofw_bus_get_node(dev); + OF_device_register_xref(OF_xref_from_node(node), dev); + + return (0); + } +.Ed +.Sh SEE ALSO +.Xr OF_node_to_xref 9 +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . Added: head/share/man/man9/OF_finddevice.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/OF_finddevice.9 Mon Apr 9 22:23:45 2018 (r332342) @@ -0,0 +1,74 @@ +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 9, 2018 +.Dt OF_FINDDEVICE 9 +.Os +.Sh NAME +.Nm OF_finddevice +.Nd find node in device tree +.Sh SYNOPSIS +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft phandle_t +.Fn OF_finddevice "const char *path" +.Sh DESCRIPTION +.Pp +.Fn OF_finddevice +returns the phandle for the node specified by the +.Fa path . +Returns -1 if the path cannot be found in the tree. +.Sh CAVEATS +The return value should only be checked with equality +operators (equal to, not equal to) and not relational comparison +(less than, greater than ). +There is a discrepancy between IEEE 1275 standard and +.Fx Ns 's +internal representation of a phandle: IEEE 1275 +requires the return value of this function to be -1 if the path +is not found. +But phandle_t is an unsigned type, so it cannot +be relationally compared with -1 or 0, this comparison +is always true or always false. +.Sh EXAMPLES +.Bd -literal + phandle_t root, i2c; + + root = OF_finddevice("/"); + i2c = OF_finddevice("/soc/axi/i2c@a0e0000"); + if (i2c != -1) { + ... + } +.Ed +.Sh SEE ALSO +.Xr OF_child 9 +.Xr OF_parent 9 +.Xr OF_peer 9 +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . Added: head/share/man/man9/OF_getprop.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/OF_getprop.9 Mon Apr 9 22:23:45 2018 (r332342) @@ -0,0 +1,291 @@ +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 9, 2018 +.Dt OF_CHILD 9 +.Os +.Sh NAME +.Nm OF_getprop , +.Nm OF_getproplen , +.Nm OF_getencprop , +.Nm OF_hasprop , +.Nm OF_searchprop , +.Nm OF_searchencprop , +.Nm OF_getprop_alloc , +.Nm OF_getencprop_alloc , +.Nm OF_prop_free , +.Nm OF_nextprop , +.Nm OF_setprop +.Nd access properties of device tree node +.Sh SYNOPSIS +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft ssize_t +.Fn OF_getproplen "phandle_t node" "const char *propname" +.Ft ssize_t +.Fn OF_getprop "phandle_t node" "const char *propname" \ +"void *buf" "size_t len" +.Ft ssize_t +.Fn OF_getencprop "phandle_t node" "const char *prop" \ +"pcell_t *buf" "size_t len" +.Ft int +.Fn OF_hasprop "phandle_t node" "const char *propname" +.Ft ssize_t +.Fn OF_searchprop "phandle_t node" "const char *propname" \ +"void *buf" "size_t len" +.Ft ssize_t +.Fn OF_searchencprop "phandle_t node" "const char *propname" \ +"pcell_t *buf" "size_t len" +.Ft ssize_t +.Fn OF_getprop_alloc "phandle_t node" "const char *propname" \ +"void **buf" +.Ft ssize_t +.Fn OF_getencprop_alloc "phandle_t node" "const char *propname" \ +"pcell_t **buf" +.Ft void +.Fn OF_prop_free "void *buf" +.Ft int +.Fn OF_nextprop "phandle_t node" "const char *propname" \ +"char *buf" "size_t len" +.Ft int +.Fn OF_setprop "phandle_t node" "const char *propname" \ +"const void *buf" "size_t len" +.Sh DESCRIPTION +.Pp +Device nodes can have associated properties. +Properties consist of a name and a value. +A name is a human-readable string from 1 to 31 characters long. +A value is an array of zero or more bytes that encode certain +information. +The meaning of that bytes depends on how drivers interpret them. +Properties can encode byte arrays, text strings, unsigned 32-bit +values or any combination of these types. +.Pp +Property with a zero-length value usually represents boolean +information. +If the property is present, it signifies true, otherwise false. +.Pp +A byte array is encoded as a sequence of bytes and represents +values like MAC addresses. +.Pp +A text string is a sequence of n printable characters. +It is encoded as a byte array of length n + 1 bytes with +characters represented as bytes plus a terminating null character. +.Pp +Unsigned 32-bit values, also sometimes called cells, are +encoded as a sequence of 4 bytes in big-endian order. +.Pp +.Fn OF_getproplen +returns either the length of the value associated with the property +.Fa propname +in the node identified by +.Fa node , +or 0 if the property exists but has no associated value. +If +.Fa propname +does not exist, -1 is returned. +.Pp +.Fn OF_getprop +copies a maximum of +.Fa len +bytes from the value associated with the property +.Fa propname +of the device node +.Fa node +into the memory specified by +.Fa buf . +Returns the actual size of the value or -1 if the +property does not exist. +.Pp +.Fn OF_getencprop +copies a maximum of +.Fa len +bytes into memory specified by +.Fa buf , +then converts cell values from big-endian to host byte order. +Returns the actual size of the value in bytes, or -1 +if the property does not exist. +.Fa len +must be a multiple of 4. +.Pp +.Fn OF_hasprop +returns 1 if the device node +.Fa node +has a property specified by +.Fa propname , +and zero if the property does not exist. +.Pp +.Fn OF_searchprop +recursively looks for the property specified by +.Fa propname +starting with the device node +.Fa node +followed by the parent node and up to the root node. +If the property is found, the function copies a maximum of +.Fa len +bytes of the value associated with the property +into the memory specified by +.Fa buf . +Returns the actual size in bytes of the value, +or -1 if the property does not exist. +.Pp +.Fn OF_searchencprop +recursively looks for the property specified by +.Fa propname +starting with the device node +.Fa node +followed by the parent node and up to the root node. +If the property is found, the function copies a maximum of +.Fa len +bytes of the value associated with the property +into the memory specified by +.Fa buf , +then converts cell values from big-endian to host byte order. +Returns the actual size in bytes of the value, +or -1 if the property does not exist. +.Pp +.Fn OF_getprop_alloc +allocates memory large enough to hold the +value associated with the property +.Fa propname +of the device node +.Fa node +and copies the value into the newly allocated memory region. +Returns the actual size of the value and stores +the address of the allocated memory in +.Fa *buf . +If the property has a zero-sized value +.Fa *buf +is set NULL. +Returns -1 if the property does not exist or +memory allocation failed. +Allocated memory should be released when no longer required +by calling +.Fn OF_prop_free . +The function might sleep when allocating memory. +.Pp +.Fn OF_getencprop_alloc +allocates enough memory to hold the +value associated with the property +.Fa propname +of the device node +.Fa node , +copies the value into the newly allocated memory region, and +then converts cell values from big-endian to host byte +order. +The actual size of the value is returned and the +address of allocated memory is stored in +.Fa *buf . +If the property has zero-length value, +.Fa *buf +is set to NULL. +Returns -1 if the property does not exist or +memory allocation failed. +Allocated memory should be released when no longer required +by calling +.Fn OF_prop_free . +The function might sleep when allocating memory. +.Pp +.Fn OF_prop_free +releases memory at +.Fa buf +that was allocated by +.Fn OF_getprop_alloc +or +.Fn OF_getencprop_alloc . +.Pp +.Fn OF_nextprop +copies a maximum of +.Fa size +bytes of the name of the property following the +.Fa propname +property into +.Fa buf . +If +.Fa propname +is NULL, the function copies the name of the first property of the +device node +.Fa node . +.Fn OF_nextprop +returns -1 if +.Fa propname +is invalid or there is an internal error, 0 if there are no more +properties after +.Fa propname , +or 1 otherwise. +.Pp +.Fn OF_setprop +sets the value of the property +.Fa propname +in the device node +.Fa node +to the value beginning at the address specified by +.Fa buf +and running for +.Fa len +bytes. +If the property does not exist, the function tries to create +it. +.Fn OF_setprop +returns the actual size of the new value, or -1 if the +property value cannot be changed or the new property +cannot be created. +.Sh EXAMPLES +.Bd -literal + phandle_t node; + phandle_t hdmixref, hdminode; + device_t hdmi; + uint8_t mac[6]; + char *model; + + /* + * Get a byte array property + */ + if (OF_getprop(node, "eth,hwaddr", mac, sizeof(mac)) != sizeof(mac)) + return; + + /* + * Get internal node reference and device associated with it + */ + if (OF_getencprop(node, "hdmi", &hdmixref) <= 0) + return; + hdmi = OF_device_from_xref(hdmixref); + + /* + * Get string value of model property of HDMI framer node + */ + hdminode = OF_node_from_xref(hdmixref); + if (OF_getprop_alloc(hdminode, "model", (void **)&model) <= 0) + return; +.Ed +.Sh SEE ALSO +.Xr OF_device_from_xref 9 +.Xr OF_node_from_xref 9 +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . Added: head/share/man/man9/OF_node_from_xref.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/OF_node_from_xref.9 Mon Apr 9 22:23:45 2018 (r332342) @@ -0,0 +1,100 @@ +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 9, 2018 +.Dt OF_NODE_FROM_XREF 9 +.Os +.Sh NAME +.Nm OF_node_from_xref , +.Nm OF_xref_from_node +.Nd convert between kernel phandle and effective phandle +.Sh SYNOPSIS +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft phandle_t +.Fn OF_node_from_xref "phandle_t xref" +.Ft phandle_t +.Fn OF_xref_from_node "phandle_t node" +.Sh DESCRIPTION +.Pp +Some OpenFirmware implementations (FDT, IBM) have a concept +of effective phandle or xrefs. +They are used to cross-reference device tree nodes. +For instance, a framebuffer controller may refer to a GPIO +controller and pin that controls the backlight. +In this example, the GPIO node would have a cell (32-bit integer) +property with a reserved name like "phandle" or "linux,phandle" +whose value uniquely identifies the node. +The actual name depends on the implementation. +The framebuffer node would have a property with the name +described by device bindings (device-specific set of properties). +It can be a cell property or a combined property with one part +of it being a cell. +The value of the framebuffer node's property would be the same +as the value of the GPIO "phandle" property so it can be said +that the framebuffer node refers to the GPIO node. +The kernel uses internal logic to assign unique identifiers +to the device tree nodes, and these values do not match +the values of "phandle" properties. +.Fn OF_node_from_xref +and +.Fn OF_xref_from_node +are used to perform conversion between these two kinds of node +identifiers. +.Pp +.Fn OF_node_from_xref +returns the kernel phandle for the effective phandle +.Fa xref . +If one cannot be found or the OpenFirmware implementation +does not support effective phandles, the function returns +the input value. +.Pp +.Fn OF_xref_from_xref +returns the effective phandle for the kernel phandle +.Fa xref . +If one cannot be found or the OpenFirmware implementation +does not support effective phandles, the function returns +the input value. +.Sh EXAMPLES +.Bd -literal + phandle_t panelnode, panelxref; + char *model; + + if (OF_getencprop(node, "lcd-panel", &panelxref) <= 0) + return; + + panelnode = OF_node_from_xref(panelxref); + if (OF_getprop_alloc(hdminode, "model", (void **)&model) <= 0) + return; +.Ed +.Sh SEE ALSO +.Xr OF_device_from_xref 9 +.Xr OF_device_register_xref 9 +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . Added: head/share/man/man9/OF_package_to_path.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/OF_package_to_path.9 Mon Apr 9 22:23:45 2018 (r332342) @@ -0,0 +1,54 @@ +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 9, 2018 +.Dt OF_PACKAGE_TO_PATH 9 +.Os +.Sh NAME +.Nm OF_package_to_path +.Nd get fully qualified path to a device tree node +.Sh SYNOPSIS +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft ssize_t +.Fn OF_package_to_path "phandle_t node" "char *buf" "size_t len" +.Sh DESCRIPTION +.Pp +.Fn OF_package_to_path +copies at most +.Fa len +bytes of the fully qualified path to the device tree node +.Fa node +into the memory specified by +.Fa buf . +The function returns the number of bytes copied or -1 in case of the error. +.Sh SEE ALSO +.Xr OF_finddevice 9 +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . From owner-svn-src-all@freebsd.org Mon Apr 9 22:59:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1287F85C37; Mon, 9 Apr 2018 22:59:10 +0000 (UTC) (envelope-from brooks@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 749EF7F1AD; Mon, 9 Apr 2018 22:59:10 +0000 (UTC) (envelope-from brooks@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 6B58E25140; Mon, 9 Apr 2018 22:59:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39MxAfn022142; Mon, 9 Apr 2018 22:59:10 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39MxA7L022141; Mon, 9 Apr 2018 22:59:10 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804092259.w39MxA7L022141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 9 Apr 2018 22:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332343 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 332343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 22:59:11 -0000 Author: brooks Date: Mon Apr 9 22:59:10 2018 New Revision: 332343 URL: https://svnweb.freebsd.org/changeset/base/332343 Log: Refactor PCIOCGETCONF for improved readability. The code now has a single, consistant flow for all three ioctl variants. ifdefs and for pre-FreeBSD-7 compatability are moved to functions and macros. So the flow is alwasy the same, we impose the cost of allocating, copying to, updating from, and freeing a copy of struct pci_conf_io on all paths. This change will allow PCIOCGETCONF32 support currently in sys/compat/freebsd32/freebsd32_ioctl.c to be moved here. Reviewed by: kib, jhb Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14978 Modified: head/sys/dev/pci/pci_user.c Modified: head/sys/dev/pci/pci_user.c ============================================================================== --- head/sys/dev/pci/pci_user.c Mon Apr 9 22:23:45 2018 (r332342) +++ head/sys/dev/pci/pci_user.c Mon Apr 9 22:59:10 2018 (r332343) @@ -65,8 +65,6 @@ __FBSDID("$FreeBSD$"); static d_open_t pci_open; static d_close_t pci_close; -static int pci_conf_match(struct pci_match_conf *matches, int num_matches, - struct pci_conf *match_buf); static d_ioctl_t pci_ioctl; struct cdevsw pcicdev = { @@ -106,7 +104,7 @@ pci_close(struct cdev *dev, int flag, int devtype, str * This function returns 1 on failure, 0 on success. */ static int -pci_conf_match(struct pci_match_conf *matches, int num_matches, +pci_conf_match_native(struct pci_match_conf *matches, int num_matches, struct pci_conf *match_buf) { int i; @@ -275,9 +273,6 @@ struct pci_conf_io32 { #define PCIOCREAD_OLD _IOWR('p', 2, struct pci_io_old) #define PCIOCWRITE_OLD _IOWR('p', 3, struct pci_io_old) -static int pci_conf_match_old(struct pci_match_conf_old *matches, - int num_matches, struct pci_conf *match_buf); - static int pci_conf_match_old(struct pci_match_conf_old *matches, int num_matches, struct pci_conf *match_buf) @@ -405,9 +400,46 @@ pci_conf_match_old32(struct pci_match_conf_old32 *matc return (1); } #endif /* COMPAT_FREEBSD32 */ -#endif /* PRE7_COMPAT */ +#endif /* !PRE7_COMPAT */ +union pci_conf_union { + struct pci_conf pc; +#ifdef PRE7_COMPAT + struct pci_conf_old pco; +#ifdef COMPAT_FREEBSD32 + struct pci_conf_old32 pco32; +#endif +#endif +}; + static int +pci_conf_match(u_long cmd, struct pci_match_conf *matches, int num_matches, + struct pci_conf *match_buf) +{ + + switch (cmd) { + case PCIOCGETCONF: + return (pci_conf_match_native( + (struct pci_match_conf *)matches, num_matches, match_buf)); +#ifdef PRE7_COMPAT + case PCIOCGETCONF_OLD: + return (pci_conf_match_old( + (struct pci_match_conf_old *)matches, num_matches, + match_buf)); +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF_OLD32: + return (pci_conf_match_old32( + (struct pci_match_conf_old32 *)matches, num_matches, + match_buf)); +#endif +#endif + default: + /* programmer error */ + return (0); + } +} + +static int pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvio) { struct pci_vpd_element vpd_element, *vpd_user; @@ -490,11 +522,184 @@ pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvi return (0); } +static size_t +pci_match_conf_size(u_long cmd) +{ + + switch (cmd) { + case PCIOCGETCONF: + return (sizeof(struct pci_match_conf)); +#ifdef PRE7_COMPAT + case PCIOCGETCONF_OLD: + return (sizeof(struct pci_match_conf_old)); +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF_OLD32: + return (sizeof(struct pci_match_conf_old32)); +#endif +#endif + default: + /* programmer error */ + return (0); + } +} + +static size_t +pci_conf_size(u_long cmd) +{ + + switch (cmd) { + case PCIOCGETCONF: + return (sizeof(struct pci_conf)); +#ifdef PRE7_COMPAT + case PCIOCGETCONF_OLD: + return (sizeof(struct pci_conf_old)); +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF_OLD32: + return (sizeof(struct pci_conf_old32)); +#endif +#endif + default: + /* programmer error */ + return (0); + } +} + +static void +pci_conf_io_init(struct pci_conf_io *cio, caddr_t data, u_long cmd) +{ +#if defined(PRE7_COMPAT) && defined(COMPAT_FREEBSD32) + struct pci_conf_io32 *cio32; +#endif + + switch (cmd) { + case PCIOCGETCONF: +#ifdef PRE7_COMPAT + case PCIOCGETCONF_OLD: +#endif + *cio = *(struct pci_conf_io *)data; + return; + +#if defined(PRE7_COMPAT) && defined(COMPAT_FREEBSD32) + case PCIOCGETCONF_OLD32: + cio32 = (struct pci_conf_io32 *)data; + cio->pat_buf_len = cio32->pat_buf_len; + cio->num_patterns = cio32->num_patterns; + cio->patterns = (void *)(uintptr_t)cio32->patterns; + cio->match_buf_len = cio32->match_buf_len; + cio->num_matches = cio32->num_matches; + cio->matches = (void *)(uintptr_t)cio32->matches; + cio->offset = cio32->offset; + cio->generation = cio32->generation; + cio->status = cio32->status; + return; +#endif + + default: + /* programmer error */ + return; + } +} + +static void +pci_conf_io_update_data(const struct pci_conf_io *cio, caddr_t data, + u_long cmd) +{ + struct pci_conf_io *d_cio; +#if defined(PRE7_COMPAT) && defined(COMPAT_FREEBSD32) + struct pci_conf_io32 *cio32; +#endif + + switch (cmd) { + case PCIOCGETCONF: +#ifdef PRE7_COMPAT + case PCIOCGETCONF_OLD: +#endif + d_cio = (struct pci_conf_io *)data; + d_cio->status = cio->status; + d_cio->generation = cio->generation; + d_cio->offset = cio->offset; + d_cio->num_matches = cio->num_matches; + return; + +#if defined(PRE7_COMPAT) && defined(COMPAT_FREEBSD32) + case PCIOCGETCONF_OLD32: + cio32 = (struct pci_conf_io32 *)data; + + cio32->status = cio->status; + cio32->generation = cio->generation; + cio32->offset = cio->offset; + cio32->num_matches = cio->num_matches; + return; +#endif + + default: + /* programmer error */ + return; + } +} + +static void +pci_conf_for_copyout(const struct pci_conf *pcp, union pci_conf_union *pcup, + u_long cmd) +{ + + memset(pcup, 0, sizeof(*pcup)); + + switch (cmd) { + case PCIOCGETCONF: + pcup->pc = *pcp; + return; + +#ifdef PRE7_COMPAT +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF_OLD32: + pcup->pco32.pc_sel.pc_bus = pcp->pc_sel.pc_bus; + pcup->pco32.pc_sel.pc_dev = pcp->pc_sel.pc_dev; + pcup->pco32.pc_sel.pc_func = pcp->pc_sel.pc_func; + pcup->pco32.pc_hdr = pcp->pc_hdr; + pcup->pco32.pc_subvendor = pcp->pc_subvendor; + pcup->pco32.pc_subdevice = pcp->pc_subdevice; + pcup->pco32.pc_vendor = pcp->pc_vendor; + pcup->pco32.pc_device = pcp->pc_device; + pcup->pco32.pc_class = pcp->pc_class; + pcup->pco32.pc_subclass = pcp->pc_subclass; + pcup->pco32.pc_progif = pcp->pc_progif; + pcup->pco32.pc_revid = pcp->pc_revid; + strlcpy(pcup->pco32.pd_name, pcp->pd_name, + sizeof(pcup->pco32.pd_name)); + pcup->pco32.pd_unit = (uint32_t)pcp->pd_unit; + return; + +#endif /* COMPAT_FREEBSD32 */ + case PCIOCGETCONF_OLD: + pcup->pco.pc_sel.pc_bus = pcp->pc_sel.pc_bus; + pcup->pco.pc_sel.pc_dev = pcp->pc_sel.pc_dev; + pcup->pco.pc_sel.pc_func = pcp->pc_sel.pc_func; + pcup->pco.pc_hdr = pcp->pc_hdr; + pcup->pco.pc_subvendor = pcp->pc_subvendor; + pcup->pco.pc_subdevice = pcp->pc_subdevice; + pcup->pco.pc_vendor = pcp->pc_vendor; + pcup->pco.pc_device = pcp->pc_device; + pcup->pco.pc_class = pcp->pc_class; + pcup->pco.pc_subclass = pcp->pc_subclass; + pcup->pco.pc_progif = pcp->pc_progif; + pcup->pco.pc_revid = pcp->pc_revid; + strlcpy(pcup->pco.pd_name, pcp->pd_name, + sizeof(pcup->pco.pd_name)); + pcup->pco.pd_unit = pcp->pd_unit; + return; +#endif /* PRE7_COMPAT */ + + default: + /* programmer error */ + return; + } +} + static int pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { device_t pcidev; - void *confdata; const char *name; struct devlist *devlist_head; struct pci_conf_io *cio = NULL; @@ -504,31 +709,25 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, struct pci_list_vpd_io *lvio; struct pci_match_conf *pattern_buf; struct pci_map *pm; - size_t confsz, iolen, pbufsz; + size_t confsz, iolen; int error, ionum, i, num_patterns; + union pci_conf_union pcu; #ifdef PRE7_COMPAT -#ifdef COMPAT_FREEBSD32 - struct pci_conf_io32 *cio32 = NULL; - struct pci_conf_old32 conf_old32; - struct pci_match_conf_old32 *pattern_buf_old32 = NULL; -#endif - struct pci_conf_old conf_old; struct pci_io iodata; struct pci_io_old *io_old; - struct pci_match_conf_old *pattern_buf_old = NULL; io_old = NULL; #endif if (!(flag & FWRITE)) { switch (cmd) { + case PCIOCGETCONF: #ifdef PRE7_COMPAT + case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 case PCIOCGETCONF_OLD32: #endif - case PCIOCGETCONF_OLD: #endif - case PCIOCGETCONF: case PCIOCGETBAR: case PCIOCLISTVPD: break; @@ -537,39 +736,18 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, } } - switch (cmd) { -#ifdef PRE7_COMPAT -#ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: - cio32 = (struct pci_conf_io32 *)data; - cio = malloc(sizeof(struct pci_conf_io), M_TEMP, M_WAITOK); - cio->pat_buf_len = cio32->pat_buf_len; - cio->num_patterns = cio32->num_patterns; - cio->patterns = (void *)(uintptr_t)cio32->patterns; - cio->match_buf_len = cio32->match_buf_len; - cio->num_matches = cio32->num_matches; - cio->matches = (void *)(uintptr_t)cio32->matches; - cio->offset = cio32->offset; - cio->generation = cio32->generation; - cio->status = cio32->status; - cio32->num_matches = 0; - break; -#endif - case PCIOCGETCONF_OLD: -#endif - case PCIOCGETCONF: - cio = (struct pci_conf_io *)data; - } switch (cmd) { + case PCIOCGETCONF: #ifdef PRE7_COMPAT + case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 case PCIOCGETCONF_OLD32: #endif - case PCIOCGETCONF_OLD: #endif - case PCIOCGETCONF: - + cio = malloc(sizeof(struct pci_conf_io), M_TEMP, + M_WAITOK | M_ZERO); + pci_conf_io_init(cio, data, cmd); pattern_buf = NULL; num_patterns = 0; dinfo = NULL; @@ -608,17 +786,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, * multiple of sizeof(struct pci_conf) in case the user * didn't specify a multiple of that size. */ -#ifdef PRE7_COMPAT -#ifdef COMPAT_FREEBSD32 - if (cmd == PCIOCGETCONF_OLD32) - confsz = sizeof(struct pci_conf_old32); - else -#endif - if (cmd == PCIOCGETCONF_OLD) - confsz = sizeof(struct pci_conf_old); - else -#endif - confsz = sizeof(struct pci_conf); + confsz = pci_conf_size(cmd); iolen = min(cio->match_buf_len - (cio->match_buf_len % confsz), pci_numdevs * confsz); @@ -647,18 +815,8 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, * it's far more likely to just catch folks that * updated their kernel but not their userland. */ -#ifdef PRE7_COMPAT -#ifdef COMPAT_FREEBSD32 - if (cmd == PCIOCGETCONF_OLD32) - pbufsz = sizeof(struct pci_match_conf_old32); - else -#endif - if (cmd == PCIOCGETCONF_OLD) - pbufsz = sizeof(struct pci_match_conf_old); - else -#endif - pbufsz = sizeof(struct pci_match_conf); - if (cio->num_patterns * pbufsz != cio->pat_buf_len) { + if (cio->num_patterns * pci_match_conf_size(cmd) != + cio->pat_buf_len) { /* The user made a mistake, return an error. */ cio->status = PCI_GETCONF_ERROR; error = EINVAL; @@ -668,28 +826,10 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, /* * Allocate a buffer to hold the patterns. */ -#ifdef PRE7_COMPAT -#ifdef COMPAT_FREEBSD32 - if (cmd == PCIOCGETCONF_OLD32) { - pattern_buf_old32 = malloc(cio->pat_buf_len, - M_TEMP, M_WAITOK); - error = copyin(cio->patterns, - pattern_buf_old32, cio->pat_buf_len); - } else -#endif /* COMPAT_FREEBSD32 */ - if (cmd == PCIOCGETCONF_OLD) { - pattern_buf_old = malloc(cio->pat_buf_len, - M_TEMP, M_WAITOK); - error = copyin(cio->patterns, - pattern_buf_old, cio->pat_buf_len); - } else -#endif /* PRE7_COMPAT */ - { - pattern_buf = malloc(cio->pat_buf_len, M_TEMP, - M_WAITOK); - error = copyin(cio->patterns, pattern_buf, - cio->pat_buf_len); - } + pattern_buf = malloc(cio->pat_buf_len, M_TEMP, + M_WAITOK); + error = copyin(cio->patterns, pattern_buf, + cio->pat_buf_len); if (error != 0) { error = EINVAL; goto getconfexit; @@ -732,27 +872,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, dinfo->conf.pd_unit = 0; } -#ifdef PRE7_COMPAT - if ( -#ifdef COMPAT_FREEBSD32 - (cmd == PCIOCGETCONF_OLD32 && - (pattern_buf_old32 == NULL || - pci_conf_match_old32(pattern_buf_old32, - num_patterns, &dinfo->conf) == 0)) || -#endif - (cmd == PCIOCGETCONF_OLD && - (pattern_buf_old == NULL || - pci_conf_match_old(pattern_buf_old, num_patterns, - &dinfo->conf) == 0)) || - (cmd == PCIOCGETCONF && - (pattern_buf == NULL || - pci_conf_match(pattern_buf, num_patterns, - &dinfo->conf) == 0))) { -#else if (pattern_buf == NULL || - pci_conf_match(pattern_buf, num_patterns, + pci_conf_match(cmd, pattern_buf, num_patterns, &dinfo->conf) == 0) { -#endif /* * If we've filled up the user's buffer, * break out at this point. Since we've @@ -766,79 +888,8 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, break; } -#ifdef PRE7_COMPAT -#ifdef COMPAT_FREEBSD32 - if (cmd == PCIOCGETCONF_OLD32) { - memset(&conf_old32, 0, - sizeof(conf_old32)); - conf_old32.pc_sel.pc_bus = - dinfo->conf.pc_sel.pc_bus; - conf_old32.pc_sel.pc_dev = - dinfo->conf.pc_sel.pc_dev; - conf_old32.pc_sel.pc_func = - dinfo->conf.pc_sel.pc_func; - conf_old32.pc_hdr = dinfo->conf.pc_hdr; - conf_old32.pc_subvendor = - dinfo->conf.pc_subvendor; - conf_old32.pc_subdevice = - dinfo->conf.pc_subdevice; - conf_old32.pc_vendor = - dinfo->conf.pc_vendor; - conf_old32.pc_device = - dinfo->conf.pc_device; - conf_old32.pc_class = - dinfo->conf.pc_class; - conf_old32.pc_subclass = - dinfo->conf.pc_subclass; - conf_old32.pc_progif = - dinfo->conf.pc_progif; - conf_old32.pc_revid = - dinfo->conf.pc_revid; - strncpy(conf_old32.pd_name, - dinfo->conf.pd_name, - sizeof(conf_old32.pd_name)); - conf_old32.pd_name[PCI_MAXNAMELEN] = 0; - conf_old32.pd_unit = - (uint32_t)dinfo->conf.pd_unit; - confdata = &conf_old32; - } else -#endif /* COMPAT_FREEBSD32 */ - if (cmd == PCIOCGETCONF_OLD) { - memset(&conf_old, 0, sizeof(conf_old)); - conf_old.pc_sel.pc_bus = - dinfo->conf.pc_sel.pc_bus; - conf_old.pc_sel.pc_dev = - dinfo->conf.pc_sel.pc_dev; - conf_old.pc_sel.pc_func = - dinfo->conf.pc_sel.pc_func; - conf_old.pc_hdr = dinfo->conf.pc_hdr; - conf_old.pc_subvendor = - dinfo->conf.pc_subvendor; - conf_old.pc_subdevice = - dinfo->conf.pc_subdevice; - conf_old.pc_vendor = - dinfo->conf.pc_vendor; - conf_old.pc_device = - dinfo->conf.pc_device; - conf_old.pc_class = - dinfo->conf.pc_class; - conf_old.pc_subclass = - dinfo->conf.pc_subclass; - conf_old.pc_progif = - dinfo->conf.pc_progif; - conf_old.pc_revid = - dinfo->conf.pc_revid; - strncpy(conf_old.pd_name, - dinfo->conf.pd_name, - sizeof(conf_old.pd_name)); - conf_old.pd_name[PCI_MAXNAMELEN] = 0; - conf_old.pd_unit = - dinfo->conf.pd_unit; - confdata = &conf_old; - } else -#endif /* PRE7_COMPAT */ - confdata = &dinfo->conf; - error = copyout(confdata, + pci_conf_for_copyout(&dinfo->conf, &pcu, cmd); + error = copyout(&pcu, (caddr_t)cio->matches + confsz * cio->num_matches, confsz); if (error) @@ -871,23 +922,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, cio->status = PCI_GETCONF_MORE_DEVS; getconfexit: -#ifdef PRE7_COMPAT -#ifdef COMPAT_FREEBSD32 - if (cmd == PCIOCGETCONF_OLD32) { - cio32->status = cio->status; - cio32->generation = cio->generation; - cio32->offset = cio->offset; - cio32->num_matches = cio->num_matches; - free(cio, M_TEMP); - } - if (pattern_buf_old32 != NULL) - free(pattern_buf_old32, M_TEMP); -#endif - if (pattern_buf_old != NULL) - free(pattern_buf_old, M_TEMP); -#endif - if (pattern_buf != NULL) - free(pattern_buf, M_TEMP); + pci_conf_io_update_data(cio, data, cmd); + free(cio, M_TEMP); + free(pattern_buf, M_TEMP); break; From owner-svn-src-all@freebsd.org Mon Apr 9 23:29:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2413F87A7D for ; Mon, 9 Apr 2018 23:29:20 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A97285345 for ; Mon, 9 Apr 2018 23:29:20 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw0-x22c.google.com with SMTP id y64so3417427ywa.3 for ; Mon, 09 Apr 2018 16:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=15DB257Xt+oZjbKrDa9MBlUzkIygopw131tYfR3WzHs=; b=t4+uOIblZJ2WDJOAa1tNbs7TZt3ACJVLwTrY7e3zjw4bBZhhakskFqNFK5eZOg+d0a 3WGm4+Fj75ynSTlqSSETOrfapc3GBHdB6fr8Q+uVB5g6vSRfNKcpGx/ey+7rWBeY9ymg LM7WhIUOFiu/WMTiIk+q/Q/qeRBo7SMi8NHzATdxRgjB2Jw7RMsHrr5ipEyIg3dzxwBK 1i7bV3gn5R8U1n/Yb0uTO8MQeJXV1Ni0KxGCsoR3nHgsR3szDAy3RBAU8RfeKxXqU/Cn 6b9KBIVx2bzSknPjdyuYP4lGWm8q/VMvofoKyp7K779C+4VjpmHQFo96fyBtzWvsOGQt UHMQ== 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=15DB257Xt+oZjbKrDa9MBlUzkIygopw131tYfR3WzHs=; b=svsI26MAHkWh7xi91giXYEcHq8DzI6d4npaPihcaNOEMnUOzzFsNuSk53LhdTPNE/9 W2nILmXUQFg+DTfmC+jineGOLseQoGdwWIlpXrOr4Eb6fnJXuZoFGAprNGcalYSFCBCU zAJoK7FhHJjGL7FWkFGcNVWl/EejsJQrRH2mSrWsOjNMwQWJl6tqHeNYS/kqkj67FSUU KPvqsDzvYfGaHagbietYdV9M1WJBJ/5m7afHJC+IY1GKA+Q3BJoLTbpIiG5lpT7EH3bw Ng0jZf9dCFfPLlnFUFLo0q2381HXtqutUai85rq4Y6YvMhWLVAobBzQUru7pYpY+mF1p ij/Q== X-Gm-Message-State: ALQs6tATaDmxhqNtMhty312f/a2nWicrwcORu2fOwtSuOO97bmkhjIiJ j1hRaHAP5fXnTD96nffs0NogISNABNfqTBJ+0R5DVQ== X-Google-Smtp-Source: AIpwx4/3OdqOZEhaUXa7jZ7oJAB3Xh+Dgs9fPG0KAHwnSBl0w5eucVochx0jF0FA3G4yU4Mcv1HKCv4TkKbxh6rY6oE= X-Received: by 10.129.173.25 with SMTP id l25mr12428423ywh.382.1523316559928; Mon, 09 Apr 2018 16:29:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ae64:0:0:0:0:0 with HTTP; Mon, 9 Apr 2018 16:29:19 -0700 (PDT) In-Reply-To: References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> From: Oliver Pinter Date: Tue, 10 Apr 2018 01:29:19 +0200 Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Warner Losh Cc: Kyle Evans , src-committers , "svn-src-stable@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable-11@freebsd.org" , "Rodney W. Grimes" , Niclas Zeising Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 23:29:21 -0000 On Monday, April 9, 2018, Warner Losh wrote: > On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: > > > Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > > and fix the ports to do the right thing for 12.x while that's still > > not a technically supported branch? > > > Don't back out the version bump. Other things may be riding along on it > 'for free'. Better to bump it again when you unMFC (if it's been more than > a few days since we've had one), and then yet-again when a fixed MFC > happens. Unless there's something you can ride along on for free :) > > Otherwise, that's a great plan. What's about "direction Z"? Like moving find to /bin and do a compatibility symlink for them from /usr/bin? > > Warner > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to " > svn-src-stable-11-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Mon Apr 9 23:36:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFE9AF882BA; Mon, 9 Apr 2018 23:36:53 +0000 (UTC) (envelope-from mw@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 71D9186DBA; Mon, 9 Apr 2018 23:36:53 +0000 (UTC) (envelope-from mw@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 66E47257B4; Mon, 9 Apr 2018 23:36:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w39Nar7p042371; Mon, 9 Apr 2018 23:36:53 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w39NaqVs042367; Mon, 9 Apr 2018 23:36:52 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804092336.w39NaqVs042367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Mon, 9 Apr 2018 23:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332344 - in head/sys: arm/mv dev/cesa X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: arm/mv dev/cesa X-SVN-Commit-Revision: 332344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 23:36:54 -0000 Author: mw Date: Mon Apr 9 23:36:52 2018 New Revision: 332344 URL: https://svnweb.freebsd.org/changeset/base/332344 Log: Enable cesa driver to work with Linux DT binding Linux device tree binding, whose usage is obligatory, comprises faulty representation of Marvell cryptographic engine (CESA) - two engines are artificially gathered into single DT node, in order to avoid certain SW limitation. This patch improves the cesa driver to support above binding, depending on compatible string, which helps to ensure backward compatibility. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14760 Modified: head/sys/arm/mv/mv_common.c head/sys/arm/mv/mvwin.h head/sys/dev/cesa/cesa.c head/sys/dev/cesa/cesa.h Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Mon Apr 9 22:59:10 2018 (r332343) +++ head/sys/arm/mv/mv_common.c Mon Apr 9 23:36:52 2018 (r332344) @@ -108,6 +108,7 @@ static int decode_win_xor_valid(void); static void decode_win_cpu_setup(void); static int decode_win_sdram_fixup(void); static void decode_win_cesa_setup(u_long); +static void decode_win_a38x_cesa_setup(u_long); static void decode_win_usb_setup(u_long); static void decode_win_usb3_setup(u_long); static void decode_win_eth_setup(u_long); @@ -120,6 +121,7 @@ static void decode_win_idma_setup(u_long); static void decode_win_xor_setup(u_long); static void decode_win_cesa_dump(u_long); +static void decode_win_a38x_cesa_dump(u_long); static void decode_win_usb_dump(u_long); static void decode_win_usb3_dump(u_long); static void decode_win_eth_dump(u_long base); @@ -226,6 +228,8 @@ static struct soc_node_spec soc_nodes[] = { { "mrvl,idma", &decode_win_idma_setup, &decode_win_idma_dump, &decode_win_idma_valid}, { "mrvl,cesa", &decode_win_cesa_setup, &decode_win_cesa_dump, &decode_win_cesa_valid}, { "mrvl,pcie", &decode_win_pcie_setup, &decode_win_pcie_dump, &decode_win_pcie_valid}, + { "marvell,armada-38x-crypto", &decode_win_a38x_cesa_setup, + &decode_win_a38x_cesa_dump, &decode_win_cesa_valid}, { NULL, NULL, NULL, NULL }, }; @@ -1558,6 +1562,20 @@ decode_win_cesa_setup(u_long base) } } } +} + +static void +decode_win_a38x_cesa_setup(u_long base) +{ + decode_win_cesa_setup(base); + decode_win_cesa_setup(base + MV_WIN_CESA_OFFSET); +} + +static void +decode_win_a38x_cesa_dump(u_long base) +{ + decode_win_cesa_dump(base); + decode_win_cesa_dump(base + MV_WIN_CESA_OFFSET); } /************************************************************************** Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Mon Apr 9 22:59:10 2018 (r332343) +++ head/sys/arm/mv/mvwin.h Mon Apr 9 23:36:52 2018 (r332344) @@ -202,6 +202,8 @@ #define MV_WIN_NETA_OFFSET 0x2000 #define MV_WIN_NETA_BASE(n) MV_WIN_ETH_BASE(n) + MV_WIN_NETA_OFFSET +#define MV_WIN_CESA_OFFSET 0x2000 + #define MV_WIN_ETH_BASE(n) (0x8 * (n) + 0x200) #define MV_WIN_ETH_SIZE(n) (0x8 * (n) + 0x204) #define MV_WIN_ETH_REMAP(n) (0x4 * (n) + 0x280) Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Mon Apr 9 22:59:10 2018 (r332343) +++ head/sys/dev/cesa/cesa.c Mon Apr 9 23:36:52 2018 (r332344) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -76,6 +77,7 @@ __FBSDID("$FreeBSD$"); static int cesa_probe(device_t); static int cesa_attach(device_t); +static int cesa_attach_late(device_t); static int cesa_detach(device_t); static void cesa_intr(void *); static int cesa_newsession(device_t, u_int32_t *, struct cryptoini *); @@ -1003,14 +1005,130 @@ cesa_setup_sram(struct cesa_softc *sc) return (0); } +/* + * Function: device_from_node + * This function returns appropriate device_t to phandle_t + * Parameters: + * root - device where you want to start search + * if you provide NULL here, function will take + * "root0" device as root. + * node - we are checking every device_t to be + * appropriate with this. + */ +static device_t +device_from_node(device_t root, phandle_t node) +{ + device_t *children, retval; + int nkid, i; + + /* Nothing matches no node */ + if (node == -1) + return (NULL); + + if (root == NULL) + /* Get root of device tree */ + if ((root = device_lookup_by_name("root0")) == NULL) + return (NULL); + + if (device_get_children(root, &children, &nkid) != 0) + return (NULL); + + retval = NULL; + for (i = 0; i < nkid; i++) { + /* Check if device and node matches */ + if (OFW_BUS_GET_NODE(root, children[i]) == node) { + retval = children[i]; + break; + } + /* or go deeper */ + if ((retval = device_from_node(children[i], node)) != NULL) + break; + } + free(children, M_TEMP); + + return (retval); +} + static int +cesa_setup_sram_armada(struct cesa_softc *sc) +{ + phandle_t sram_node; + ihandle_t sram_ihandle; + pcell_t sram_handle[2]; + void *sram_va; + int rv, j; + struct resource_list rl; + struct resource_list_entry *rle; + struct simplebus_softc *ssc; + device_t sdev; + + /* Get refs to SRAMS from CESA node */ + rv = OF_getencprop(ofw_bus_get_node(sc->sc_dev), "marvell,crypto-srams", + (void *)sram_handle, sizeof(sram_handle)); + if (rv <= 0) + return (rv); + + if (sc->sc_cesa_engine_id >= 2) + return (ENXIO); + + /* Get SRAM node on the basis of sc_cesa_engine_id */ + sram_ihandle = (ihandle_t)sram_handle[sc->sc_cesa_engine_id]; + sram_node = OF_instance_to_package(sram_ihandle); + + /* Get device_t of simplebus (sram_node parent) */ + sdev = device_from_node(NULL, OF_parent(sram_node)); + if (!sdev) + return (ENXIO); + + ssc = device_get_softc(sdev); + + resource_list_init(&rl); + /* Parse reg property to resource list */ + ofw_bus_reg_to_rl(sdev, sram_node, ssc->acells, + ssc->scells, &rl); + + /* We expect only one resource */ + rle = resource_list_find(&rl, SYS_RES_MEMORY, 0); + if (rle == NULL) + return (ENXIO); + + /* Remap through ranges property */ + for (j = 0; j < ssc->nranges; j++) { + if (rle->start >= ssc->ranges[j].bus && + rle->end < ssc->ranges[j].bus + ssc->ranges[j].size) { + rle->start -= ssc->ranges[j].bus; + rle->start += ssc->ranges[j].host; + rle->end -= ssc->ranges[j].bus; + rle->end += ssc->ranges[j].host; + } + } + + sc->sc_sram_base_pa = rle->start; + sc->sc_sram_size = rle->count; + + /* SRAM memory was not mapped in platform_sram_devmap(), map it now */ + sram_va = pmap_mapdev(sc->sc_sram_base_pa, sc->sc_sram_size); + if (sram_va == NULL) + return (ENOMEM); + sc->sc_sram_base_va = (vm_offset_t)sram_va; + + return (0); +} + +struct ofw_compat_data cesa_devices[] = { + { "mrvl,cesa", (uintptr_t)true }, + { "marvell,armada-38x-crypto", (uintptr_t)true }, + { NULL, 0 } +}; + +static int cesa_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "mrvl,cesa")) + if (!ofw_bus_search_compatible(dev, cesa_devices)->ocd_data) return (ENXIO); device_set_desc(dev, "Marvell Cryptographic Engine and Security " @@ -1022,7 +1140,78 @@ cesa_probe(device_t dev) static int cesa_attach(device_t dev) { + static int engine_idx = 0; + struct simplebus_devinfo *ndi; + struct resource_list *rl; struct cesa_softc *sc; + + if (!ofw_bus_is_compatible(dev, "marvell,armada-38x-crypto")) + return (cesa_attach_late(dev)); + + /* + * Get simplebus_devinfo which contains + * resource list filled with adresses and + * interrupts read form FDT. + * Let's correct it by splitting resources + * for each engine. + */ + if ((ndi = device_get_ivars(dev)) == NULL) + return (ENXIO); + + rl = &ndi->rl; + + switch (engine_idx) { + case 0: + /* Update regs values */ + resource_list_add(rl, SYS_RES_MEMORY, 0, CESA0_TDMA_ADDR, + CESA0_TDMA_ADDR + CESA_TDMA_SIZE - 1, CESA_TDMA_SIZE); + resource_list_add(rl, SYS_RES_MEMORY, 1, CESA0_CESA_ADDR, + CESA0_CESA_ADDR + CESA_CESA_SIZE - 1, CESA_CESA_SIZE); + + /* Remove unused interrupt */ + resource_list_delete(rl, SYS_RES_IRQ, 1); + break; + + case 1: + /* Update regs values */ + resource_list_add(rl, SYS_RES_MEMORY, 0, CESA1_TDMA_ADDR, + CESA1_TDMA_ADDR + CESA_TDMA_SIZE - 1, CESA_TDMA_SIZE); + resource_list_add(rl, SYS_RES_MEMORY, 1, CESA1_CESA_ADDR, + CESA1_CESA_ADDR + CESA_CESA_SIZE - 1, CESA_CESA_SIZE); + + /* Remove unused interrupt */ + resource_list_delete(rl, SYS_RES_IRQ, 0); + resource_list_find(rl, SYS_RES_IRQ, 1)->rid = 0; + break; + + default: + device_printf(dev, "Bad cesa engine_idx\n"); + return (ENXIO); + } + + sc = device_get_softc(dev); + sc->sc_cesa_engine_id = engine_idx; + + /* + * Call simplebus_add_device only once. + * It will create second cesa driver instance + * with the same FDT node as first instance. + * When second driver reach this function, + * it will be configured to use second cesa engine + */ + if (engine_idx == 0) + simplebus_add_device(device_get_parent(dev), ofw_bus_get_node(dev), + 0, "cesa", 1, NULL); + + engine_idx++; + + return (cesa_attach_late(dev)); +} + +static int +cesa_attach_late(device_t dev) +{ + struct cesa_softc *sc; uint32_t d, r, val; int error; int i; @@ -1086,7 +1275,11 @@ cesa_attach(device_t dev) } /* Acquire SRAM base address */ - error = cesa_setup_sram(sc); + if (!ofw_bus_is_compatible(dev, "marvell,armada-38x-crypto")) + error = cesa_setup_sram(sc); + else + error = cesa_setup_sram_armada(sc); + if (error) { device_printf(dev, "could not setup SRAM\n"); goto err1; Modified: head/sys/dev/cesa/cesa.h ============================================================================== --- head/sys/dev/cesa/cesa.h Mon Apr 9 22:59:10 2018 (r332343) +++ head/sys/dev/cesa/cesa.h Mon Apr 9 23:36:52 2018 (r332344) @@ -239,6 +239,7 @@ struct cesa_softc { bus_dma_tag_t sc_data_dtag; int sc_error; int sc_tperr; + uint8_t sc_cesa_engine_id; struct mtx sc_sc_lock; int sc_blocked; @@ -367,4 +368,10 @@ struct cesa_chain_info { #define CESA_SA_SR 0x0E0C #define CESA_SA_SR_ACTIVE (1 << 0) +#define CESA_TDMA_SIZE 0x1000 +#define CESA_CESA_SIZE 0x1000 +#define CESA0_TDMA_ADDR 0x90000 +#define CESA0_CESA_ADDR 0x9D000 +#define CESA1_TDMA_ADDR 0x92000 +#define CESA1_CESA_ADDR 0x9F000 #endif From owner-svn-src-all@freebsd.org Mon Apr 9 23:38:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E96C4F884C8; Mon, 9 Apr 2018 23:38:41 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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 8384A875B6; Mon, 9 Apr 2018 23:38:41 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C521221080; Mon, 9 Apr 2018 19:38:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 09 Apr 2018 19:38:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=yQTr6e0Lfj/6KWrjW2usGY5+GCpg/ AkjJo3F8kOY3Fg=; b=MsgxOPZodzb2YqGMVR6PC4bPJFZZOh5JD6pA+YKrJNj7z zLw6YtsbjbBBYHne967y+LyvUKlr5LArPSDh7dzQwgioxWegzbYecCOtC0UYvTLT DE1aVjJHoZzGjL4QXQ1jxiFc3a99hoebr023NEOYzMRTa1FGpJ+5Zaq6pxXQQuoH ZVBYClreoQRY27q9QagcOlIkIm+HVlJRrdINMDe8io1upl3lfjesyF9fKqkqsICL nLf7zxDwLClvki4oIETbvMtxn1Ekg1BjQx/zsbziwmcIR23x0ch5mzeS8rNrYUCo cx/6Vi3/C2JUDD4AqdBDAqOSoyatVgq3HfFY+86RQ== X-ME-Sender: Received: from [10.57.2.204] (unknown [209.63.143.172]) by mail.messagingengine.com (Postfix) with ESMTPA id 20804E4449; Mon, 9 Apr 2018 19:38:40 -0400 (EDT) From: Benno Rice Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r331843 - in head/usr.sbin/makefs: . cd9660 Date: Mon, 9 Apr 2018 16:38:38 -0700 In-Reply-To: <20180409133717.GB82598@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Glen Barber References: <201803311504.w2VF4gxR024784@repo.freebsd.org> <20180409133717.GB82598@FreeBSD.org> X-Mailer: Apple Mail (2.3445.6.18) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 23:38:42 -0000 > On Apr 9, 2018, at 6:37 AM, Glen Barber wrote: [snip] > It appears this part has broken creating disc1.iso (and other ISO > images) for amd64. I see the following error: [snip] Yep, that=E2=80=99s on me. I forgot to update mkisoimages.sh. Could you = try the attached patch? From owner-svn-src-all@freebsd.org Tue Apr 10 00:39:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D248F8C58F; Tue, 10 Apr 2018 00:39:21 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD9AD76A73; Tue, 10 Apr 2018 00:39:20 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x236.google.com with SMTP id 15-v6so12654961itl.1; Mon, 09 Apr 2018 17:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=+J9iqXZFvIgvyLERMoSmzE53hieHEb96jkcbgW6Lr4E=; b=lj7NX1gpYVtNvQO0LSBiGjrRSVsPclvjs6XMAhIgxeuVapiekpd3B9KdgBZxatAVWk vH297c+aynj2Cf2TzXL14J4+r2XiAc1iXWpi3lg9B8wJa/L50ktn9C8pTBfzZw773FW3 pAFnKqBwZHs9IkSxh7fwGgiYe+c+6csMlqmLOEZoKBMSVu4RMcIv62f6Kxd9f2N9bYdA fTzhiNR17nQIJLdpT6qvRd2dgFrhokIOMuW/CveOzHJLJVDIcMIcZ4vEEZ5EWONFqxqw o0rqRVI7DQVePTUZotyA1IEHcPvdFrPDDmtm24F9TNE6FZ6DBJ26LrH8fFxgAYxUr36u 0CpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=+J9iqXZFvIgvyLERMoSmzE53hieHEb96jkcbgW6Lr4E=; b=inwex4HojUTOPa8Nsyvb8Wf7iH1i0PF1XSPUiJbG/acaffjclEIIH36+H7jHZlXSrA vRL0XHXuIxfs9sWzUuGlfE+4IPb2LCoX6ih5jDRK6DvMKQqhLReKpw7YAW/TbXkup+5T r4rYhj0Bn6gFeltzewbgTJZAl3ms1Sg4FnEN1iFJIkbZsBw9rYHmc7w5QV9rdbIZ/neo FMTqP9x5BA4uWhIfqzHH+Hx0lgteKVo0UQKb7wEv7s6BwlbUDex4XJcj69SN4moJHEle 7GouqIzTmXQK7BfnWcAS28+rIjI4BTC6i/5j57x/sPZBx791pjhznoJK9EBi5eeEEQ6F 3LWQ== X-Gm-Message-State: ALQs6tAnF4KaievVMtsIsIBvpbQ+TK08KqMBWlk4pzGyk7Ah/BtrRwDr K/hdSdk59Jjdy1DejMOuVMpJrlpQq31t9qiGrQDc3dnd X-Google-Smtp-Source: AIpwx4+5MIkSBBUNvIWLbDPLBzKBIZrjNpbgsYqgJvBI54xNObDP87HtUGy/CaChbcpEXZJUjGqJhrpqo/tF+LlGqGI= X-Received: by 2002:a24:a0c6:: with SMTP id o189-v6mr58205ite.52.1523320760193; Mon, 09 Apr 2018 17:39:20 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.197 with HTTP; Mon, 9 Apr 2018 17:38:59 -0700 (PDT) In-Reply-To: <3188731.iHBUE9bOzj@ralph.baldwin.cx> References: <201804060257.w362vwi3023158@repo.freebsd.org> <3188731.iHBUE9bOzj@ralph.baldwin.cx> From: Ed Maste Date: Mon, 9 Apr 2018 20:38:59 -0400 X-Google-Sender-Auth: paa6-3UAbG1K_cTCzkBqn1WWE58 Message-ID: Subject: Re: svn commit: r332090 - head/stand/i386 To: John Baldwin Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 00:39:21 -0000 On 9 April 2018 at 15:28, John Baldwin wrote: > > I do think we are likely to have far fewer conditional LDFLAGS rather > than CFLAGS though. I think if we are only going to have 1 or 2 > instances in the tree then LDFLAGS.LINKER_TYPE might perhaps be > overkill, but if we think there will be several then I think it is > more readable. Indeed, I don't anticipate we'd end up with more than 1 or 2 instances, but even with only the single case today I think it is clearer (D14998). From owner-svn-src-all@freebsd.org Tue Apr 10 01:44:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3589EF915D6; Tue, 10 Apr 2018 01:44:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 DB3A5878D6; Tue, 10 Apr 2018 01:44:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 82BC81DFCA; Tue, 10 Apr 2018 01:44:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Tue, 10 Apr 2018 01:44:04 +0000 From: Glen Barber To: Benno Rice Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331843 - in head/usr.sbin/makefs: . cd9660 Message-ID: <20180410014404.GK91263@FreeBSD.org> References: <201803311504.w2VF4gxR024784@repo.freebsd.org> <20180409133717.GB82598@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="/rDaUNvWv5XYRSKj" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 01:44:07 -0000 --/rDaUNvWv5XYRSKj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2018 at 04:38:38PM -0700, Benno Rice wrote: >=20 >=20 > > On Apr 9, 2018, at 6:37 AM, Glen Barber wrote: >=20 > [snip] >=20 > > It appears this part has broken creating disc1.iso (and other ISO > > images) for amd64. I see the following error: >=20 > [snip] >=20 > Yep, that=E2=80=99s on me. I forgot to update mkisoimages.sh. Could you t= ry the attached patch? >=20 % Index: release/amd64/mkisoimages.sh % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D % --- release/amd64/mkisoimages.sh (revision 332343) % +++ release/amd64/mkisoimages.sh (working copy) % @@ -38,7 +38,7 @@ % umount efi % rmdir efi % mdconfig -d -u $device % - bootable=3D"-o bootimage=3Defi;efiboot.img -o no-emul-boot $bootable" % + bootable=3D"-o bootimage=3Di386;efiboot.img -o no-emul-boot $bootable -= o platformid=3Defi" % =09 % shift % else This appears to have fixed it. Glen --/rDaUNvWv5XYRSKj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlrMFt8ACgkQAxRYpUeP 4pP+uxAAoHi8+UlSwH4cIGRyXv9k6ZEnFnJtVEVP+TFOe9BCQjuhOOY+3UPP+LeQ DBdcueFlohITGeUI7XBFqYB1bbP7GXe2fhFRX+OjABdtKscQ5p4CiYyUtbHf0z/u N7tNLuUnDV4eQU3oPMlh7yAzooq1OuFJvNK25FPwSFdye1ApMRbiH9DdPpELd/WG 7WX5qtFhTCIlOWnJmvm3+WnFTgvmwNGoKSENPdrhZrY1J+yPc7yr4wD/hClnHZQC shZ/UeY9MgKLW9f1Vppw6nFoFYqBiDj+QfvjBhG1IkLzu1y3jFJtDzd+aBrcOY7W KIT8dKUG4L4xzQggG5ozuXFCQmzK8CHADxdpnx7HTrRJoxetJDH0+LP5rsBPs8Ga WURJsirPY8AUysdipnn1xjPvRa+rlE8OG5ahli/eUGiiCpLeAgI/iKDa3t7wdcOt 2CAXJ2KU+n8o+u+ozYtGyxBJMjfDhUhrqIde7PbQlHz7OzJcM7qX1DcADXhVo5y+ +k7qvX6d+yj2hYhb8gqEVaL9EBgbzrG4XGANYu/Lm0+Q0M3+DFOO6Tv5Y+3U9eE6 +a0wTrLHnjkB79Zlc0TBeJ5zqO5qlVTgWVUaaeVtGwrEQhmtI59NVpszX6K8jCYi n6y03ZLlCQXt7Jm++o18axb7E+BZXvlPSbbU/QmdzqSFvQXgIgI= =f7DL -----END PGP SIGNATURE----- --/rDaUNvWv5XYRSKj-- From owner-svn-src-all@freebsd.org Tue Apr 10 02:28:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C799AF9465E; Tue, 10 Apr 2018 02:28:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (unknown [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 72A3373B0A; Tue, 10 Apr 2018 02:28:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 1EFB8CDC5; Tue, 10 Apr 2018 02:28:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f53.google.com with SMTP id x70-v6so9389808lfa.0; Mon, 09 Apr 2018 19:28:24 -0700 (PDT) X-Gm-Message-State: ALQs6tA36P8k/Vw7v8wivFxe0owhYN1to/P67lDtX2Z4/It0QCIHcGHw qTbFK7o+BHOjHljnpDoyHVnYURB68V8yLZEUPUY= X-Google-Smtp-Source: AIpwx48gFoO7n1Xrrt1uQ0pQ5oaFFU9+SqtBJsn3cO9gdkCmhAhEoKL6TEzkS1tGvUO7JtT/6wXOOIHpWBQH6q2p/rI= X-Received: by 10.46.29.1 with SMTP id d1mr23874733ljd.22.1523327302552; Mon, 09 Apr 2018 19:28:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 19:28:01 -0700 (PDT) In-Reply-To: References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Mon, 9 Apr 2018 21:28:01 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Warner Losh Cc: "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 02:28:25 -0000 On Mon, Apr 9, 2018 at 11:59 AM, Warner Losh wrote: > > > On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: >> >> Right- so, back out this MFC (and the subsequent FreeBSD_version bump) >> and fix the ports to do the right thing for 12.x while that's still >> not a technically supported branch? > > > Don't back out the version bump. Other things may be riding along on it 'for > free'. Better to bump it again when you unMFC (if it's been more than a few > days since we've had one), and then yet-again when a fixed MFC happens. > Unless there's something you can ride along on for free :) > > Otherwise, that's a great plan. Ok, I think the result of this thread and discussion with 0mp is the following set of actions: 1.) One (1) commit to stable/11 to revert the MFC and bump FreeBSD_Version again for the removal 2.) One (1) commit to doc to document the new FreeBSD_Version 3.) Fixing ports to use the "new" behavior on 12, both the yet-to-be-patched ports and the ports that had already been patched under the assumption that it would still land first in 11.1-stable 4.) Documenting the original commit? The hard part of point #3 has already been done by 0mp, who has submitted patches for all of the ports using this behavior. His patches will just need a bump of the version they're testing to the 12.x FreeBSD_Version and a fix-up on the patches that already landed. For point #4, this seems like the type of breakage we should be documenting in release notes or something for the eventual upgrading of systems to 12.0. All usage of _limits stuff in custom rc scripts need to be audited, and all rc.conf(5)'s need to be scrubbed for ${name}_limits usage that doesn't make sense with the new context. I'm not sure what the most appropriate action here is, or what we should do this far ahead of time for such a thing. If this sounds like a good path forward, I'll execute #1 and #2 in the morning (CST, so ~11 hours from this e-mail being sent). From owner-svn-src-all@freebsd.org Tue Apr 10 02:43:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28D92F95860; Tue, 10 Apr 2018 02:43:08 +0000 (UTC) (envelope-from benno@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 CD13C778A0; Tue, 10 Apr 2018 02:43:07 +0000 (UTC) (envelope-from benno@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 C7D7F2768F; Tue, 10 Apr 2018 02:43:07 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A2h7fh038651; Tue, 10 Apr 2018 02:43:07 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A2h7oF038650; Tue, 10 Apr 2018 02:43:07 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804100243.w3A2h7oF038650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 10 Apr 2018 02:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332345 - head/release/amd64 X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/release/amd64 X-SVN-Commit-Revision: 332345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 02:43:08 -0000 Author: benno Date: Tue Apr 10 02:43:07 2018 New Revision: 332345 URL: https://svnweb.freebsd.org/changeset/base/332345 Log: Fix makefs invocation after r331843. Reported by: gjb Reviewed by: gjb Sponsored by: iXsystems, Inc. Pointy hat to: benno Modified: head/release/amd64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Mon Apr 9 23:36:52 2018 (r332344) +++ head/release/amd64/mkisoimages.sh Tue Apr 10 02:43:07 2018 (r332345) @@ -38,7 +38,7 @@ if [ "$1" = "-b" ]; then umount efi rmdir efi mdconfig -d -u $device - bootable="-o bootimage=efi;efiboot.img -o no-emul-boot $bootable" + bootable="-o bootimage=i386;efiboot.img -o no-emul-boot $bootable -o platformid=efi" shift else From owner-svn-src-all@freebsd.org Tue Apr 10 02:49:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7280CF95EC1; Tue, 10 Apr 2018 02:49:54 +0000 (UTC) (envelope-from benno@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 1F0137A2AB; Tue, 10 Apr 2018 02:49:54 +0000 (UTC) (envelope-from benno@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 1401C2769D; Tue, 10 Apr 2018 02:49:54 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A2nra7038915; Tue, 10 Apr 2018 02:49:53 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A2nrqV038914; Tue, 10 Apr 2018 02:49:53 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804100249.w3A2nrqV038914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 10 Apr 2018 02:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332346 - head/release/amd64 X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/release/amd64 X-SVN-Commit-Revision: 332346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 02:49:54 -0000 Author: benno Date: Tue Apr 10 02:49:53 2018 New Revision: 332346 URL: https://svnweb.freebsd.org/changeset/base/332346 Log: Fix the position of $bootable so that -o platformid=efi applies correctly. Sponsored by: iXsystems, Inc. Pointy hat to: benno (again) Modified: head/release/amd64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Tue Apr 10 02:43:07 2018 (r332345) +++ head/release/amd64/mkisoimages.sh Tue Apr 10 02:49:53 2018 (r332346) @@ -38,7 +38,7 @@ if [ "$1" = "-b" ]; then umount efi rmdir efi mdconfig -d -u $device - bootable="-o bootimage=i386;efiboot.img -o no-emul-boot $bootable -o platformid=efi" + bootable="-o bootimage=i386;efiboot.img -o no-emul-boot -o platformid=efi $bootable" shift else From owner-svn-src-all@freebsd.org Tue Apr 10 03:12:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 144D7F97CA3; Tue, 10 Apr 2018 03:12:23 +0000 (UTC) (envelope-from delphij@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 B870C7F00C; Tue, 10 Apr 2018 03:12:22 +0000 (UTC) (envelope-from delphij@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 AF51727C1A; Tue, 10 Apr 2018 03:12:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A3CMqj054649; Tue, 10 Apr 2018 03:12:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A3CMVj054648; Tue, 10 Apr 2018 03:12:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201804100312.w3A3CMVj054648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 10 Apr 2018 03:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332347 - stable/11/usr.sbin/rpcbind X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/usr.sbin/rpcbind X-SVN-Commit-Revision: 332347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 03:12:23 -0000 Author: delphij Date: Tue Apr 10 03:12:22 2018 New Revision: 332347 URL: https://svnweb.freebsd.org/changeset/base/332347 Log: MFC r331180: Plug a possible memory leak. Modified: stable/11/usr.sbin/rpcbind/rpcbind.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- stable/11/usr.sbin/rpcbind/rpcbind.c Tue Apr 10 02:49:53 2018 (r332346) +++ stable/11/usr.sbin/rpcbind/rpcbind.c Tue Apr 10 03:12:22 2018 (r332347) @@ -550,6 +550,8 @@ init_transport(struct netconfig *nconf) pml->pml_map.pm_port = PMAPPORT; if (strcmp(nconf->nc_proto, NC_TCP) == 0) { if (tcptrans[0]) { + free(pml); + pml = NULL; syslog(LOG_ERR, "cannot have more than one TCP transport"); goto error; From owner-svn-src-all@freebsd.org Tue Apr 10 03:15:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEC43F97FBD; Tue, 10 Apr 2018 03:15:07 +0000 (UTC) (envelope-from delphij@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 A524880736; Tue, 10 Apr 2018 03:15:07 +0000 (UTC) (envelope-from delphij@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 9FD2727C2D; Tue, 10 Apr 2018 03:15:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A3F7wN054791; Tue, 10 Apr 2018 03:15:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A3F7Tk054790; Tue, 10 Apr 2018 03:15:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201804100315.w3A3F7Tk054790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 10 Apr 2018 03:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332348 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/usr.sbin/rpcbind X-SVN-Commit-Revision: 332348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 03:15:08 -0000 Author: delphij Date: Tue Apr 10 03:15:07 2018 New Revision: 332348 URL: https://svnweb.freebsd.org/changeset/base/332348 Log: MFC r331180: Plug a possible memory leak. Modified: stable/10/usr.sbin/rpcbind/rpcbind.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- stable/10/usr.sbin/rpcbind/rpcbind.c Tue Apr 10 03:12:22 2018 (r332347) +++ stable/10/usr.sbin/rpcbind/rpcbind.c Tue Apr 10 03:15:07 2018 (r332348) @@ -548,6 +548,8 @@ init_transport(struct netconfig *nconf) pml->pml_map.pm_port = PMAPPORT; if (strcmp(nconf->nc_proto, NC_TCP) == 0) { if (tcptrans[0]) { + free(pml); + pml = NULL; syslog(LOG_ERR, "cannot have more than one TCP transport"); goto error; From owner-svn-src-all@freebsd.org Tue Apr 10 04:22:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E63F9D52A; Tue, 10 Apr 2018 04:22:24 +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 BB6DD6F606; Tue, 10 Apr 2018 04:22:23 +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 w3A4M8Rp021575; Mon, 9 Apr 2018 21:22:08 -0700 (PDT) (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 w3A4M7VO021574; Mon, 9 Apr 2018 21:22:07 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804100422.w3A4M7VO021574@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: To: Kyle Evans Date: Mon, 9 Apr 2018 21:22:07 -0700 (PDT) CC: Warner Losh , "Rodney W. Grimes" , Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 04:22:24 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mon, Apr 9, 2018 at 11:59 AM, Warner Losh wrote: > > > > > > On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: > >> > >> Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > >> and fix the ports to do the right thing for 12.x while that's still > >> not a technically supported branch? > > > > > > Don't back out the version bump. Other things may be riding along on it 'for > > free'. Better to bump it again when you unMFC (if it's been more than a few > > days since we've had one), and then yet-again when a fixed MFC happens. > > Unless there's something you can ride along on for free :) > > > > Otherwise, that's a great plan. > > Ok, I think the result of this thread and discussion with 0mp is the > following set of actions: > > 1.) One (1) commit to stable/11 to revert the MFC and bump > FreeBSD_Version again for the removal > 2.) One (1) commit to doc to document the new FreeBSD_Version > 3.) Fixing ports to use the "new" behavior on 12, both the > yet-to-be-patched ports and the ports that had already been patched > under the assumption that it would still land first in 11.1-stable > 4.) Documenting the original commit? > > The hard part of point #3 has already been done by 0mp, who has > submitted patches for all of the ports using this behavior. His > patches will just need a bump of the version they're testing to the > 12.x FreeBSD_Version and a fix-up on the patches that already landed. > > For point #4, this seems like the type of breakage we should be > documenting in release notes or something for the eventual upgrading > of systems to 12.0. All usage of _limits stuff in custom rc scripts > need to be audited, and all rc.conf(5)'s need to be scrubbed for > ${name}_limits usage that doesn't make sense with the new context. I'm > not sure what the most appropriate action here is, or what we should > do this far ahead of time for such a thing. We do need a way to stack little notes that need to make it into the release notes, even if there is no single commit they are related to, or in this case we find out later that a change had wider impacts and needs to have a note added. Maybe gjb@ has a place we can just commit to that gets collected for the release? > If this sounds like a good path forward, I'll execute #1 and #2 in the > morning (CST, so ~11 hours from this e-mail being sent). I am on board with this much of this plan. What about cy@ changes to the ddb and other startup scripts? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Apr 10 04:56:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3C1CF9F919; Tue, 10 Apr 2018 04:56:31 +0000 (UTC) (envelope-from bapt@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 A438875EDE; Tue, 10 Apr 2018 04:56:31 +0000 (UTC) (envelope-from bapt@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 9E0BACE8; Tue, 10 Apr 2018 04:56:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A4uVsV004073; Tue, 10 Apr 2018 04:56:31 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A4uVX2004072; Tue, 10 Apr 2018 04:56:31 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201804100456.w3A4uVX2004072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Apr 2018 04:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r332349 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 332349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 04:56:32 -0000 Author: bapt Date: Tue Apr 10 04:56:31 2018 New Revision: 332349 URL: https://svnweb.freebsd.org/changeset/base/332349 Log: rgrimes@ mentors has been changed to be bde@ and phk@ reflect it in the svn administration files With hat: core Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Apr 10 03:15:07 2018 (r332348) +++ svnadmin/conf/mentors Tue Apr 10 04:56:31 2018 (r332349) @@ -26,7 +26,7 @@ kadesai ken Co-mentor: scottl, ambrisko mahrens mckusick mjoras rstone peterj jhb Co-mentor: grog -rgrimes grehan +rgrimes phk Co-mentor: bde sef mav slavash kib Co-mentor: hselasky slm ken Co-mentor: scottl, ambrisko From owner-svn-src-all@freebsd.org Tue Apr 10 06:10:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE1B5FA4566; Tue, 10 Apr 2018 06:10:37 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FEC287D12; Tue, 10 Apr 2018 06:10:34 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (115-166-20-68.dyn.iinet.net.au [115.166.20.68]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id w3A6ATtm087627 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 9 Apr 2018 23:10:32 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r332041 - svnadmin/conf To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org References: <201804041827.w34IRINd001484@repo.freebsd.org> From: Julian Elischer Message-ID: Date: Tue, 10 Apr 2018 14:10:23 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201804041827.w34IRINd001484@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 06:10:38 -0000 On 5/4/18 2:27 am, Alexander Motin wrote: > Author: mav > Date: Wed Apr 4 18:27:18 2018 > New Revision: 332041 > URL: https://svnweb.freebsd.org/changeset/base/332041 > > Log: > Restore Sean Eric Fagan (sef) src commit bit. !!  Welcome back SEF! > > I (mav) will be his mentor. > > Approved by: core > > Modified: > svnadmin/conf/access > svnadmin/conf/mentors > > Modified: svnadmin/conf/access > ============================================================================== > --- svnadmin/conf/access Wed Apr 4 18:06:52 2018 (r332040) > +++ svnadmin/conf/access Wed Apr 4 18:27:18 2018 (r332041) > @@ -192,6 +192,7 @@ scf > schweikh > scottl > se > +sef > sephe > sgalabov > shurd > > Modified: svnadmin/conf/mentors > ============================================================================== > --- svnadmin/conf/mentors Wed Apr 4 18:06:52 2018 (r332040) > +++ svnadmin/conf/mentors Wed Apr 4 18:27:18 2018 (r332041) > @@ -27,6 +27,7 @@ mahrens mckusick > mjoras rstone > peterj jhb Co-mentor: grog > rgrimes grehan > +sef mav > slavash kib Co-mentor: hselasky > slm ken Co-mentor: scottl, ambrisko > wosch cem > > From owner-svn-src-all@freebsd.org Tue Apr 10 06:57:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 552DCF821BA; Tue, 10 Apr 2018 06:57:07 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (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 DB4FE71855; Tue, 10 Apr 2018 06:57:06 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 40Kydr2lynzDhHq; Tue, 10 Apr 2018 06:57:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=daemonic.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=20151023; t=1523343423; bh=iNrI/OSAJSpIEv3gK06oGAq0 nfftQzeNb9W5ui1JO50=; b=ObxJlAbBB0z5BZF0MClLYI+iRRe/9X3bDRR3vaHN au3CQO7AaHVgT4EoKXCVWKWU4i7/HUCkbTpXGuOZKyxBXScqnkx1KOSqgZyiyFki PLB4ZyvNXEmrztJscNRF7gcc7RJyZrbqEIpbMCQZbfDHKi+LaWX6vKaOMuBYBU5g mlk= 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 p-FRygrG-u5T; Tue, 10 Apr 2018 06:57:03 +0000 (UTC) Received: from garnet.daemonic.se (host-90-232-228-250.mobileonline.telia.com [90.232.228.250]) by mail.daemonic.se (Postfix) with ESMTPSA id 40Kydq0gdxzDh2K; Tue, 10 Apr 2018 06:57:03 +0000 (UTC) Subject: Re: svn commit: r331880 - stable/11/etc To: Kyle Evans , Warner Losh Cc: "Rodney W. Grimes" , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> From: Niclas Zeising Message-ID: <6928b703-536e-b1a7-2a80-6796db15affc@daemonic.se> Date: Tue, 10 Apr 2018 08:56:44 +0200 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 06:57:07 -0000 On 04/10/18 04:28, Kyle Evans wrote: > On Mon, Apr 9, 2018 at 11:59 AM, Warner Losh wrote: >> >> >> On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: >>> >>> Right- so, back out this MFC (and the subsequent FreeBSD_version bump) >>> and fix the ports to do the right thing for 12.x while that's still >>> not a technically supported branch? >> >> >> Don't back out the version bump. Other things may be riding along on it 'for >> free'. Better to bump it again when you unMFC (if it's been more than a few >> days since we've had one), and then yet-again when a fixed MFC happens. >> Unless there's something you can ride along on for free :) >> >> Otherwise, that's a great plan. > > Ok, I think the result of this thread and discussion with 0mp is the > following set of actions: > > 1.) One (1) commit to stable/11 to revert the MFC and bump > FreeBSD_Version again for the removal > 2.) One (1) commit to doc to document the new FreeBSD_Version > 3.) Fixing ports to use the "new" behavior on 12, both the > yet-to-be-patched ports and the ports that had already been patched > under the assumption that it would still land first in 11.1-stable > 4.) Documenting the original commit? > > The hard part of point #3 has already been done by 0mp, who has > submitted patches for all of the ports using this behavior. His > patches will just need a bump of the version they're testing to the > 12.x FreeBSD_Version and a fix-up on the patches that already landed. > > For point #4, this seems like the type of breakage we should be > documenting in release notes or something for the eventual upgrading > of systems to 12.0. All usage of _limits stuff in custom rc scripts > need to be audited, and all rc.conf(5)'s need to be scrubbed for > ${name}_limits usage that doesn't make sense with the new context. I'm > not sure what the most appropriate action here is, or what we should > do this far ahead of time for such a thing. > > If this sounds like a good path forward, I'll execute #1 and #2 in the > morning (CST, so ~11 hours from this e-mail being sent). > This still doesn't fix the issue of some early start up scripts depending on stuff that's not available yet, when for instance /usr is on a separate FS (which was the normal way to set up a system way back when). This issue was first noticed more than 2 years ago, so someone did notice the breakage. It just hasn't been fixed for an entire release cycle. Regards -- Niclas From owner-svn-src-all@freebsd.org Tue Apr 10 08:01:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D56EF86B3C; Tue, 10 Apr 2018 08:01:56 +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 D903F7F4B5; Tue, 10 Apr 2018 08:01:55 +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 D40622AA0; Tue, 10 Apr 2018 08:01:55 +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 w3A81tCx096312; Tue, 10 Apr 2018 08:01:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A81t61096311; Tue, 10 Apr 2018 08:01:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804100801.w3A81t61096311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 Apr 2018 08:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332350 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 332350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 08:01:56 -0000 Author: trasz Date: Tue Apr 10 08:01:55 2018 New Revision: 332350 URL: https://svnweb.freebsd.org/changeset/base/332350 Log: Make development(7) mention tests and section 9 of manual pages. MFC after: 2 weeks Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Tue Apr 10 04:56:31 2018 (r332349) +++ head/share/man/man7/development.7 Tue Apr 10 08:01:55 2018 (r332350) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2018 +.Dd April 10, 2018 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -75,6 +75,11 @@ Build instructions can be found in .Xr build 7 and .Xr release 7 . +Kernel APIs are usually documented, use +.Cm apropos -s 9 '' +for a list. +Regression test suite is described in +.Xr tests 7 . For coding conventions, see .Xr style 9 . .Pp From owner-svn-src-all@freebsd.org Tue Apr 10 08:07:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE783F870FF; Tue, 10 Apr 2018 08:07:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-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 5631780E5E; Tue, 10 Apr 2018 08:07:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 4C67E12E64; Tue, 10 Apr 2018 08:07:56 +0000 (UTC) Date: Tue, 10 Apr 2018 08:07:56 +0000 From: Alexey Dokuchaev To: Oliver Pinter Cc: Warner Losh , src-committers , Kyle Evans , "svn-src-all@freebsd.org" , "svn-src-stable-11@freebsd.org" , "Rodney W. Grimes" , "svn-src-stable@freebsd.org" , Niclas Zeising Subject: Re: svn commit: r331880 - stable/11/etc Message-ID: <20180410080756.GA1703@FreeBSD.org> References: <201804091552.w39Fqv2S019416@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 08:07:56 -0000 On Tue, Apr 10, 2018 at 01:29:19AM +0200, Oliver Pinter wrote: > On Monday, April 9, 2018, Warner Losh wrote: > > On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: > > > Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > > > and fix the ports to do the right thing for 12.x while that's still > > > not a technically supported branch? > > > > Don't back out the version bump. Other things may be riding along on it > > 'for free'. Better to bump it again when you unMFC (if it's been more than > > a few days since we've had one), and then yet-again when a fixed MFC > > happens. Unless there's something you can ride along on for free :) > > > > Otherwise, that's a great plan. > > What's about "direction Z"? Like moving find to /bin and do a compatibility > symlink for them from /usr/bin? That smells fishy. Reminds me of GNU/Linux where I typically have to parse through gazillion of compatibility symlinks before stumbling upon 30-byte shim saying "implemented in systemd now". :-( ./danfe From owner-svn-src-all@freebsd.org Tue Apr 10 08:14:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55594F877C3; Tue, 10 Apr 2018 08:14:00 +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 0331B824B0; Tue, 10 Apr 2018 08:14:00 +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 D80542C5F; Tue, 10 Apr 2018 08:13:59 +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 w3A8DxZr002269; Tue, 10 Apr 2018 08:13:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A8DxKI002268; Tue, 10 Apr 2018 08:13:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804100813.w3A8DxKI002268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 Apr 2018 08:13:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332351 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 332351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 08:14:00 -0000 Author: trasz Date: Tue Apr 10 08:13:59 2018 New Revision: 332351 URL: https://svnweb.freebsd.org/changeset/base/332351 Log: Strip trailing whitespace. MFC after: 2 weeks Modified: head/sbin/camcontrol/camcontrol.8 Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Tue Apr 10 08:01:55 2018 (r332350) +++ head/sbin/camcontrol/camcontrol.8 Tue Apr 10 08:13:59 2018 (r332351) @@ -561,7 +561,7 @@ the blocksize. Note that this command only displays the information, it does not update the kernel data structures. Use the -.Nm +.Nm reprobe subcommand to do that. .It Ic start Send the SCSI Start/Stop Unit (0x1B) command to the given device with the @@ -1593,7 +1593,7 @@ If the device is a .Tn SCSI device and it provides a recommended timeout for the WRITE BUFFER command (see the -.Nm +.Nm opcodes subcommand), that timeout will be used for the firmware download. The drive-recommended timeout value may be overridden on the command line with the @@ -1644,12 +1644,12 @@ will currently attempt a firmware download to any .Tn ATA or .Tn SATA -device, since the standard +device, since the standard .Tn ATA DOWNLOAD MICROCODE command may work. Firmware downloads to .Tn ATA -and +and .Tn SATA devices are supported for devices connected to standard @@ -1658,7 +1658,7 @@ and .Tn SATA controllers, and devices connected to SAS controllers with -.Tn SCSI +.Tn SCSI to .Tn ATA translation capability. @@ -1667,7 +1667,7 @@ In the latter case, uses the .Tn SCSI .Tn ATA -PASS-THROUGH command to send the +PASS-THROUGH command to send the .Tn ATA DOWNLOAD MICROCODE command to the drive. Some @@ -1991,9 +1991,9 @@ For instance, .Tn LTO tapes have MAM. Either the -.Fl r +.Fl r option or the -.Fl w +.Fl w option must be specified. .Bl -tag -width 14n .It Fl r Ar action @@ -2022,7 +2022,7 @@ This option is not yet implemented. .It Fl a Ar num Specify the attribute number to display. This option only works with the attr_values, attr_list and supp_attr -arguments to +arguments to .Fl r . .It Fl c Display cached attributes. @@ -2038,7 +2038,7 @@ Specify the output format for the attribute values (at comma separated list of options. The default output is currently set to field_all,nonascii_trim,text_raw. Once this code is ported to FreeBSD 10, any text fields will be converted -from their codeset to the user's native codeset with +from their codeset to the user's native codeset with .Xr iconv 3 . .Pp The text options are mutually exclusive; if you specify more than one, you @@ -2146,7 +2146,7 @@ action. This requests that the device report Nominal and Recommended timeout values for the given command or commands. The timeout values are in seconds. -The timeout descriptor also includes a command-specific +The timeout descriptor also includes a command-specific .El .It Ic zone Manage @@ -2287,8 +2287,8 @@ The summary and column headings are printed, fields ar and the fields themselves may contain spaces. .It summary Just print the summary: the number of zones, the maximum LBA (LBA of the -last logical block on the drive), and the value of the -.Dq same +last logical block on the drive), and the value of the +.Dq same field. The .Dq same @@ -2319,7 +2319,7 @@ to translation layer (SAT). It may be helpful to read the ATA Command Set - 4 (ACS-4) description of the Extended Power Conditions feature set, available at t13.org, to -understand the details of this particular +understand the details of this particular .Nm subcommand. .Bl -tag -width 6n @@ -2365,7 +2365,7 @@ Idle and Standby mode supported by the drive. .Bl -tag -width 8n .It Fl e Enable the power condition. -One of +One of .Fl e or .Fl d @@ -2395,7 +2395,7 @@ Enable or disable a particular power condition. .Bl -tag -width 7n .It Fl e Enable the power condition. -One of +One of .Fl e or .Fl d @@ -2485,7 +2485,7 @@ time, but override the system time zone and use UTC in .It Fl s Set the device's timestamp. Either the .Fl f -and +and .Fl T options or the .Fl U @@ -2494,7 +2494,7 @@ option must be specified. .It Fl f Ar format Specify the strptime format string, as documented in strptime(3). The time must also be specified with the -.Fl T +.Fl T option. .It Fl T Ar time Provide the time in the format specified with the @@ -2790,7 +2790,7 @@ camcontrol epc da4 -c goto -p Standby_z -H Tell drive .Pa da4 to go to the Standby_z power state (which is -the drive's lowest power state) and hold in that state until it is +the drive's lowest power state) and hold in that state until it is explicitly released by another .Cm goto command. @@ -2802,14 +2802,14 @@ camcontrol epc da2 -c status -P Report only the power state of drive .Pa da2 . -Some drives will power up in response to the commands sent by the +Some drives will power up in response to the commands sent by the .Pa status subcommand, and the .Fl P option causes .Nm to only send the -.Tn ATA +.Tn ATA CHECK POWER MODE command, which should not trigger a change in the drive's power state. .Pp @@ -2829,7 +2829,7 @@ camcontrol timestamp sa0 -s -f "%a, %d %b %Y %T %z" \e Set the timestamp of drive .Pa sa0 using a -.Xr strptime 3 +.Xr strptime 3 format string followed by a time string that was created using this format string. .Sh SEE ALSO From owner-svn-src-all@freebsd.org Tue Apr 10 08:14:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22E8AF87893; Tue, 10 Apr 2018 08:14:32 +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 C58B1825CD; Tue, 10 Apr 2018 08:14:31 +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 C08222C60; Tue, 10 Apr 2018 08:14:31 +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 w3A8EVCQ002332; Tue, 10 Apr 2018 08:14:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A8EVoh002331; Tue, 10 Apr 2018 08:14:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804100814.w3A8EVoh002331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 Apr 2018 08:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332352 - head/usr.sbin/ctld X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/ctld X-SVN-Commit-Revision: 332352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 08:14:32 -0000 Author: trasz Date: Tue Apr 10 08:14:31 2018 New Revision: 332352 URL: https://svnweb.freebsd.org/changeset/base/332352 Log: Strip trailing whitespace. MFC after: 2 weeks Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Tue Apr 10 08:13:59 2018 (r332351) +++ head/usr.sbin/ctld/ctl.conf.5 Tue Apr 10 08:14:31 2018 (r332352) @@ -483,7 +483,7 @@ target naa.50015178f369f092 { .Ed .Pp An equivalent configuration in UCL format, for use with -.Fl u : +.Fl u : .Bd -literal auth-group { ag0 { From owner-svn-src-all@freebsd.org Tue Apr 10 08:19:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D530F87E0A; Tue, 10 Apr 2018 08:19:15 +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 0FBE08291B; Tue, 10 Apr 2018 08:19:15 +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 0AAB12C71; Tue, 10 Apr 2018 08:19:15 +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 w3A8JElo002520; Tue, 10 Apr 2018 08:19:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A8JEKE002519; Tue, 10 Apr 2018 08:19:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201804100819.w3A8JEKE002519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 10 Apr 2018 08:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332353 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 332353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 08:19:15 -0000 Author: tuexen Date: Tue Apr 10 08:19:14 2018 New Revision: 332353 URL: https://svnweb.freebsd.org/changeset/base/332353 Log: Don't show the number of currently established SCTP associations, since this is not monotonically increasing. It's number can be derived from the other counters shown. MFC after: 3 days Modified: head/usr.bin/systat/sctp.c Modified: head/usr.bin/systat/sctp.c ============================================================================== --- head/usr.bin/systat/sctp.c Tue Apr 10 08:14:31 2018 (r332352) +++ head/usr.bin/systat/sctp.c Tue Apr 10 08:19:14 2018 (r332353) @@ -53,24 +53,23 @@ static struct sctpstat curstat, initstat, oldstat; 00 SCTP Associations SCTP Packets 01999999999999 associations initiated 999999999999 packets sent 02999999999999 associations accepted 999999999999 packets received -03999999999999 associations established 999999999999 - out of the blue -04999999999999 associations restarted 999999999999 - bad vtag -05999999999999 associations terminated 999999999999 - bad crc32c -06999999999999 associations aborted -07 -08 SCTP Timers SCTP Chunks -09999999999999 init timeouts 999999999999 control chunks sent -10999999999999 cookie timeouts 999999999999 data chunks sent -11999999999999 data timeouts 999999999999 - ordered -12999999999999 delayed sack timeouts 999999999999 - unordered -13999999999999 shutdown timeouts 999999999999 control chunks received -14999999999999 shutdown-ack timeouts 999999999999 data chunks received -15999999999999 shutdown guard timeouts 999999999999 - ordered -16999999999999 heartbeat timeouts 999999999999 - unordered -17999999999999 path MTU timeouts -18999999999999 autoclose timeouts SCTP user messages -19999999999999 asconf timeouts 999999999999 fragmented -20999999999999 stream reset timeouts 999999999999 reassembled +03999999999999 associations restarted 999999999999 - out of the blue +04999999999999 associations terminated 999999999999 - bad vtag +05999999999999 associations aborted 999999999999 - bad crc32c +06 +07 SCTP Timers SCTP Chunks +08999999999999 init timeouts 999999999999 control chunks sent +09999999999999 cookie timeouts 999999999999 data chunks sent +10999999999999 data timeouts 999999999999 - ordered +11999999999999 delayed sack timeouts 999999999999 - unordered +12999999999999 shutdown timeouts 999999999999 control chunks received +13999999999999 shutdown-ack timeouts 999999999999 data chunks received +14999999999999 shutdown guard timeouts 999999999999 - ordered +15999999999999 heartbeat timeouts 999999999999 - unordered +16999999999999 path MTU timeouts +17999999999999 autoclose timeouts SCTP user messages +18999999999999 asconf timeouts 999999999999 fragmented +19999999999999 stream reset timeouts 999999999999 reassembled --0123456789012345678901234567890123456789012345678901234567890123456789012345 --0 1 2 3 4 5 6 7 */ @@ -100,24 +99,23 @@ labelsctp(void) L(0, "SCTP Associations"); R(0, "SCTP Packets"); L(1, "associations initiated"); R(1, "packets sent"); L(2, "associations accepted"); R(2, "packets received"); - L(3, "associations established"); R(3, "- out of the blue"); - L(4, "associations restarted"); R(4, "- bad vtag"); - L(5, "associations terminated"); R(5, "- bad crc32c"); - L(6, "associations aborted"); + L(3, "associations restarted"); R(3, "- out of the blue"); + L(4, "associations terminated"); R(4, "- bad vtag"); + L(5, "associations aborted"); R(5, "- bad crc32c"); - L(8, "SCTP Timers"); R(8, "SCTP Chunks"); - L(9, "init timeouts"); R(9, "control chunks sent"); - L(10, "cookie timeouts"); R(10, "data chunks sent"); - L(11, "data timeouts"); R(11, "- ordered"); - L(12, "delayed sack timeouts"); R(12, "- unordered"); - L(13, "shutdown timeouts"); R(13, "control chunks received"); - L(14, "shutdown-ack timeouts"); R(14, "data chunks received"); - L(15, "shutdown guard timeouts"); R(15, "- ordered"); - L(16, "heartbeat timeouts"); R(16, "- unordered"); - L(17, "path MTU timeouts"); - L(18, "autoclose timeouts"); R(18, "SCTP User Messages"); - L(19, "asconf timeouts"); R(19, "fragmented"); - L(20, "stream reset timeouts"); R(20, "reassembled"); + L(7, "SCTP Timers"); R(7, "SCTP Chunks"); + L(8, "init timeouts"); R(8, "control chunks sent"); + L(9, "cookie timeouts"); R(9, "data chunks sent"); + L(10, "data timeouts"); R(10, "- ordered"); + L(11, "delayed sack timeouts"); R(11, "- unordered"); + L(12, "shutdown timeouts"); R(12, "control chunks received"); + L(13, "shutdown-ack timeouts"); R(13, "data chunks received"); + L(14, "shutdown guard timeouts"); R(14, "- ordered"); + L(15, "heartbeat timeouts"); R(15, "- unordered"); + L(16, "path MTU timeouts"); + L(17, "autoclose timeouts"); R(17, "SCTP User Messages"); + L(18, "asconf timeouts"); R(18, "fragmented"); + L(19, "stream reset timeouts"); R(19, "reassembled"); #undef L #undef R } @@ -286,24 +284,23 @@ showsctp(void) #define R(row, stat) DO(stat, row, 38) L(1, sctps_activeestab); R(1, sctps_outpackets); L(2, sctps_passiveestab); R(2, sctps_inpackets); - L(3, sctps_currestab); R(3, sctps_outoftheblue); - L(4, sctps_restartestab); R(4, sctps_badvtag); - L(5, sctps_shutdown); R(5, sctps_checksumerrors); - L(6, sctps_aborted); + L(3, sctps_restartestab); R(3, sctps_outoftheblue); + L(4, sctps_shutdown); R(4, sctps_badvtag); + L(5, sctps_aborted); R(5, sctps_checksumerrors); - L(9, sctps_timoinit); R(9, sctps_outcontrolchunks); - L(10, sctps_timocookie); R(10, sctps_senddata); - L(11, sctps_timodata); R(11, sctps_outorderchunks); - L(12, sctps_timosack); R(12, sctps_outunorderchunks); - L(13, sctps_timoshutdown); R(13, sctps_incontrolchunks); - L(14, sctps_timoshutdownack); R(14, sctps_recvdata); - L(15, sctps_timoshutdownguard); R(15, sctps_inorderchunks); - L(16, sctps_timoheartbeat); R(16, sctps_inunorderchunks); - L(17, sctps_timopathmtu); - L(18, sctps_timoautoclose); - L(19, sctps_timoasconf); R(19, sctps_fragusrmsgs); - L(20, sctps_timostrmrst); R(20, sctps_reasmusrmsgs); + L(8, sctps_timoinit); R(8, sctps_outcontrolchunks); + L(9, sctps_timocookie); R(9, sctps_senddata); + L(10, sctps_timodata); R(10, sctps_outorderchunks); + L(11, sctps_timosack); R(11, sctps_outunorderchunks); + L(12, sctps_timoshutdown); R(12, sctps_incontrolchunks); + L(13, sctps_timoshutdownack); R(13, sctps_recvdata); + L(14, sctps_timoshutdownguard); R(14, sctps_inorderchunks); + L(15, sctps_timoheartbeat); R(15, sctps_inunorderchunks); + L(16, sctps_timopathmtu); + L(17, sctps_timoautoclose); + L(18, sctps_timoasconf); R(18, sctps_fragusrmsgs); + L(19, sctps_timostrmrst); R(19, sctps_reasmusrmsgs); #undef DO #undef L #undef R From owner-svn-src-all@freebsd.org Tue Apr 10 08:35:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06023F88FD9; Tue, 10 Apr 2018 08:35:44 +0000 (UTC) (envelope-from mw@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 914298611D; Tue, 10 Apr 2018 08:35:43 +0000 (UTC) (envelope-from mw@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 885522F88; Tue, 10 Apr 2018 08:35:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3A8ZhMi012720; Tue, 10 Apr 2018 08:35:43 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3A8ZhVD012719; Tue, 10 Apr 2018 08:35:43 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804100835.w3A8ZhVD012719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 10 Apr 2018 08:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332354 - head/sys/dev/etherswitch/e6000sw X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/etherswitch/e6000sw X-SVN-Commit-Revision: 332354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 08:35:44 -0000 Author: mw Date: Tue Apr 10 08:35:43 2018 New Revision: 332354 URL: https://svnweb.freebsd.org/changeset/base/332354 Log: Improve detection of addressing mode in e6000sw Some devices cannot rely on the switch MDIO address passed in the DTB for specifying single/multi-chip addressing mode. Introduce new property "single-chip-addressing" which added to DTS will force single-chip mode. Submitted by: Michal Mazur Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14800 Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Tue Apr 10 08:19:14 2018 (r332353) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Tue Apr 10 08:35:43 2018 (r332354) @@ -213,7 +213,9 @@ e6000sw_probe(device_t dev) if (OF_getencprop(sc->node, "reg", &sc->sw_addr, sizeof(sc->sw_addr)) < 0) return (ENXIO); - if (sc->sw_addr != 0 && (sc->sw_addr % 2) == 0) + + if (!OF_hasprop(sc->node, "single-chip-addressing") && + (sc->sw_addr != 0 && (sc->sw_addr % 2) == 0)) sc->multi_chip = true; /* From owner-svn-src-all@freebsd.org Tue Apr 10 12:45:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2A21F99A10; Tue, 10 Apr 2018 12:45:34 +0000 (UTC) (envelope-from kp@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 8044C804C2; Tue, 10 Apr 2018 12:45:34 +0000 (UTC) (envelope-from kp@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 7B2205C01; Tue, 10 Apr 2018 12:45:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ACjYoR038213; Tue, 10 Apr 2018 12:45:34 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ACjYeD038212; Tue, 10 Apr 2018 12:45:34 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804101245.w3ACjYeD038212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 10 Apr 2018 12:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332358 - head/tests/sys/netpfil X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil X-SVN-Commit-Revision: 332358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 12:45:35 -0000 Author: kp Date: Tue Apr 10 12:45:34 2018 New Revision: 332358 URL: https://svnweb.freebsd.org/changeset/base/332358 Log: pf tests: Do not build or install if pf is not enabled Do not build or install pf tests if WITHOUT_PF is set. This fixes the build failure with WITHOUT_PF=yes. Reported by: Vladimir Zakharov Modified: head/tests/sys/netpfil/Makefile Modified: head/tests/sys/netpfil/Makefile ============================================================================== --- head/tests/sys/netpfil/Makefile Tue Apr 10 10:27:55 2018 (r332357) +++ head/tests/sys/netpfil/Makefile Tue Apr 10 12:45:34 2018 (r332358) @@ -1,7 +1,11 @@ # $FreeBSD$ +.include + TESTSDIR= ${TESTSBASE}/sys/netpfil +.if ${MK_PF} != "no" TESTS_SUBDIRS+= pf +.endif .include From owner-svn-src-all@freebsd.org Tue Apr 10 12:53:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34CB9F9A54A; Tue, 10 Apr 2018 12:53:49 +0000 (UTC) (envelope-from br@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 D66E28296B; Tue, 10 Apr 2018 12:53:48 +0000 (UTC) (envelope-from br@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 D172B5D8E; Tue, 10 Apr 2018 12:53:48 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ACrm81042864; Tue, 10 Apr 2018 12:53:48 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ACrmjE042861; Tue, 10 Apr 2018 12:53:48 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804101253.w3ACrmjE042861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 10 Apr 2018 12:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332359 - in head/sys: arm64/conf arm64/qualcomm conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: arm64/conf arm64/qualcomm conf X-SVN-Commit-Revision: 332359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 12:53:49 -0000 Author: br Date: Tue Apr 10 12:53:48 2018 New Revision: 332359 URL: https://svnweb.freebsd.org/changeset/base/332359 Log: Enable Qualcomm Debug Subsystem (QDSS) block on MSM8916 SoC. This is required for ARM Coresight operation on Dragonboard 410c. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14987 Added: head/sys/arm64/qualcomm/ head/sys/arm64/qualcomm/qcom_gcc.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Apr 10 12:45:34 2018 (r332358) +++ head/sys/arm64/conf/GENERIC Tue Apr 10 12:53:48 2018 (r332359) @@ -106,6 +106,9 @@ device al_iofic # I/O Fabric Interrupt Controller device al_serdes # Serializer/Deserializer device al_udma # Universal DMA +# Qualcomm Snapdragon drivers +device qcom_gcc # Global Clock Controller + # VirtIO support device virtio device virtio_pci Added: head/sys/arm64/qualcomm/qcom_gcc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/qualcomm/qcom_gcc.c Tue Apr 10 12:53:48 2018 (r332359) @@ -0,0 +1,148 @@ +/*- + * Copyright (c) 2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by BAE Systems, the University of Cambridge + * Computer Laboratory, and Memorial University under DARPA/AFRL contract + * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing + * (TC) research program. + * + * 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 + +#include +#include + +#define GCC_QDSS_BCR 0x29000 +#define GCC_QDSS_BCR_BLK_ARES (1 << 0) /* Async software reset. */ +#define GCC_QDSS_CFG_AHB_CBCR 0x29008 +#define AHB_CBCR_CLK_ENABLE (1 << 0) /* AHB clk branch ctrl */ +#define GCC_QDSS_ETR_USB_CBCR 0x29028 +#define ETR_USB_CBCR_CLK_ENABLE (1 << 0) /* ETR USB clk branch ctrl */ +#define GCC_QDSS_DAP_CBCR 0x29084 +#define DAP_CBCR_CLK_ENABLE (1 << 0) /* DAP clk branch ctrl */ + +static struct ofw_compat_data compat_data[] = { + { "qcom,gcc-msm8916", 1 }, + { NULL, 0 } +}; + +struct qcom_gcc_softc { + struct resource *res; +}; + +static struct resource_spec qcom_gcc_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +/* + * Qualcomm Debug Subsystem (QDSS) + * block enabling routine. + */ +static void +qcom_qdss_enable(struct qcom_gcc_softc *sc) +{ + + /* Put QDSS block to reset */ + bus_write_4(sc->res, GCC_QDSS_BCR, GCC_QDSS_BCR_BLK_ARES); + + /* Enable AHB clock branch */ + bus_write_4(sc->res, GCC_QDSS_CFG_AHB_CBCR, AHB_CBCR_CLK_ENABLE); + + /* Enable DAP clock branch */ + bus_write_4(sc->res, GCC_QDSS_DAP_CBCR, DAP_CBCR_CLK_ENABLE); + + /* Enable ETR USB clock branch */ + bus_write_4(sc->res, GCC_QDSS_ETR_USB_CBCR, ETR_USB_CBCR_CLK_ENABLE); + + /* Out of reset */ + bus_write_4(sc->res, GCC_QDSS_BCR, 0); +} + +static int +qcom_gcc_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Qualcomm Global Clock Controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +qcom_gcc_attach(device_t dev) +{ + struct qcom_gcc_softc *sc; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, qcom_gcc_spec, &sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + + /* + * Enable debug unit. + * This is required for Coresight operation. + * This also enables USB clock branch. + */ + qcom_qdss_enable(sc); + + return (0); +} + +static device_method_t qcom_gcc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, qcom_gcc_probe), + DEVMETHOD(device_attach, qcom_gcc_attach), + + DEVMETHOD_END +}; + +static driver_t qcom_gcc_driver = { + "qcom_gcc", + qcom_gcc_methods, + sizeof(struct qcom_gcc_softc), +}; + +static devclass_t qcom_gcc_devclass; + +EARLY_DRIVER_MODULE(qcom_gcc, simplebus, qcom_gcc_driver, qcom_gcc_devclass, + 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(qcom_gcc, 1); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Apr 10 12:45:34 2018 (r332358) +++ head/sys/conf/files.arm64 Tue Apr 10 12:53:48 2018 (r332359) @@ -151,6 +151,7 @@ arm64/coresight/coresight-dynamic-replicator.c standar arm64/coresight/coresight-etm4x.c standard arm64/coresight/coresight-funnel.c standard arm64/coresight/coresight-tmc.c standard +arm64/qualcomm/qcom_gcc.c optional qcom_gcc fdt contrib/vchiq/interface/compat/vchi_bsd.c optional vchiq soc_brcm_bcm2837 \ compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c optional vchiq soc_brcm_bcm2837 \ From owner-svn-src-all@freebsd.org Tue Apr 10 13:16:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 619CBF9C066; Tue, 10 Apr 2018 13:16:01 +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 07D99692D8; Tue, 10 Apr 2018 13:16:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id B25CA10D4A; Tue, 10 Apr 2018 13:16:00 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f44.google.com with SMTP id q9-v6so11608092lfk.9; Tue, 10 Apr 2018 06:16:00 -0700 (PDT) X-Gm-Message-State: ALQs6tDI14rFqQ+j90mGb/az+p/q1Ps7KAgOYRpYrg3AZGlNZ438OCks VGIsqEIYoBQ/8FC/jtky4GGECU5aGXPAV3HIqNE= X-Google-Smtp-Source: AIpwx4+GnyrOvqJoMF866D+SCGoD2fdS85Jc04L9qYQ3Tir9ITaUdZG53zg45lSWvGiaEjS3AcHIVJUOvZXeA42xne8= X-Received: by 2002:a19:d911:: with SMTP id q17-v6mr194455lfg.99.1523366159330; Tue, 10 Apr 2018 06:15:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Tue, 10 Apr 2018 06:15:38 -0700 (PDT) In-Reply-To: <201804100422.w3A4M7VO021574@pdx.rh.CN85.dnsmgr.net> References: <201804100422.w3A4M7VO021574@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Tue, 10 Apr 2018 08:15:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: "Rodney W. Grimes" Cc: Niclas Zeising , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:16:01 -0000 On Mon, Apr 9, 2018 at 11:22 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> On Mon, Apr 9, 2018 at 11:59 AM, Warner Losh wrote: >> > >> > >> > On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: >> >> >> >> Right- so, back out this MFC (and the subsequent FreeBSD_version bump) >> >> and fix the ports to do the right thing for 12.x while that's still >> >> not a technically supported branch? >> > >> > >> > Don't back out the version bump. Other things may be riding along on it 'for >> > free'. Better to bump it again when you unMFC (if it's been more than a few >> > days since we've had one), and then yet-again when a fixed MFC happens. >> > Unless there's something you can ride along on for free :) >> > >> > Otherwise, that's a great plan. >> >> Ok, I think the result of this thread and discussion with 0mp is the >> following set of actions: >> >> 1.) One (1) commit to stable/11 to revert the MFC and bump >> FreeBSD_Version again for the removal >> 2.) One (1) commit to doc to document the new FreeBSD_Version >> 3.) Fixing ports to use the "new" behavior on 12, both the >> yet-to-be-patched ports and the ports that had already been patched >> under the assumption that it would still land first in 11.1-stable >> 4.) Documenting the original commit? >> >> The hard part of point #3 has already been done by 0mp, who has >> submitted patches for all of the ports using this behavior. His >> patches will just need a bump of the version they're testing to the >> 12.x FreeBSD_Version and a fix-up on the patches that already landed. >> >> For point #4, this seems like the type of breakage we should be >> documenting in release notes or something for the eventual upgrading >> of systems to 12.0. All usage of _limits stuff in custom rc scripts >> need to be audited, and all rc.conf(5)'s need to be scrubbed for >> ${name}_limits usage that doesn't make sense with the new context. I'm >> not sure what the most appropriate action here is, or what we should >> do this far ahead of time for such a thing. > > We do need a way to stack little notes that need to make it into > the release notes, even if there is no single commit they are related > to, or in this case we find out later that a change had wider > impacts and needs to have a note added. Maybe gjb@ has a place we > can just commit to that gets collected for the release? > >> If this sounds like a good path forward, I'll execute #1 and #2 in the >> morning (CST, so ~11 hours from this e-mail being sent). > > I am on board with this much of this plan. > > > What about cy@ changes to the ddb and other startup scripts? > Right- I was mostly concerned with fixing the fallout from this particular commit. I think that merits its own discussion in a separate thread or in the early referenced PR, but I'm tempted to go ahead and commit Cy's ddb patch to start while we assess the other damage. From owner-svn-src-all@freebsd.org Tue Apr 10 13:16:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6763F9C163; Tue, 10 Apr 2018 13:16:51 +0000 (UTC) (envelope-from ken@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 5AD8D6941E; Tue, 10 Apr 2018 13:16:51 +0000 (UTC) (envelope-from ken@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 55B2A60D4; Tue, 10 Apr 2018 13:16:51 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ADGpkC053011; Tue, 10 Apr 2018 13:16:51 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ADGpjM053009; Tue, 10 Apr 2018 13:16:51 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201804101316.w3ADGpjM053009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 10 Apr 2018 13:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r332360 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: ken X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 332360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:16:51 -0000 Author: ken Date: Tue Apr 10 13:16:50 2018 New Revision: 332360 URL: https://svnweb.freebsd.org/changeset/base/332360 Log: Add Ram Kishore Vegesna (ram) as a src committer. Ram works for Broadcom and will be maintaining the Broadcom / Emulex ocs_fc(4) fibre channel driver. Alexander Motin (mav) and I will be his mentors. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Apr 10 12:53:48 2018 (r332359) +++ svnadmin/conf/access Tue Apr 10 13:16:50 2018 (r332360) @@ -175,6 +175,7 @@ pkelsey pluknet pstef qingli +ram ray rgrimes rlibby Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Apr 10 12:53:48 2018 (r332359) +++ svnadmin/conf/mentors Tue Apr 10 13:16:50 2018 (r332360) @@ -26,6 +26,7 @@ kadesai ken Co-mentor: scottl, ambrisko mahrens mckusick mjoras rstone peterj jhb Co-mentor: grog +ram ken Co-mentor: mav rgrimes phk Co-mentor: bde sef mav slavash kib Co-mentor: hselasky From owner-svn-src-all@freebsd.org Tue Apr 10 13:22:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D637F9C754; Tue, 10 Apr 2018 13:22:49 +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 AE6BD6AE4F; Tue, 10 Apr 2018 13:22:48 +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 A96886265; Tue, 10 Apr 2018 13:22:48 +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 w3ADMm8I057916; Tue, 10 Apr 2018 13:22:48 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ADMmhg057913; Tue, 10 Apr 2018 13:22:48 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201804101322.w3ADMmhg057913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Apr 2018 13:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332361 - in head: sbin/geom/class/eli sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: sbin/geom/class/eli sys/geom/eli X-SVN-Commit-Revision: 332361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:22:49 -0000 Author: oshogbo Date: Tue Apr 10 13:22:48 2018 New Revision: 332361 URL: https://svnweb.freebsd.org/changeset/base/332361 Log: Introduce dry run option for attaching the device. This will allow us to verify if passphrase and key is valid without decrypting whole device. Reviewed by: cem@, allanjude@ Differential Revision: https://reviews.freebsd.org/D15000 Modified: head/sbin/geom/class/eli/geli.8 head/sbin/geom/class/eli/geom_eli.c head/sys/geom/eli/g_eli_ctl.c Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Tue Apr 10 13:16:50 2018 (r332360) +++ head/sbin/geom/class/eli/geli.8 Tue Apr 10 13:22:48 2018 (r332361) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2017 +.Dd April 10, 2018 .Dt GELI 8 .Os .Sh NAME @@ -67,7 +67,7 @@ utility: .Cm init .Nm .Cm attach -.Op Fl dprv +.Op Fl dnprv .Op Fl j Ar passfile .Op Fl k Ar keyfile .Ar prov @@ -420,6 +420,9 @@ For more information see the description of the option for the .Cm init subcommand. +.It Fl n +Do a dry-run decryption. +This is useful to verify passphrase and keyfile without decrypting the device. .It Fl p Do not use a passphrase as a component of the User Key. Cannot be combined with the Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Tue Apr 10 13:16:50 2018 (r332360) +++ head/sbin/geom/class/eli/geom_eli.c Tue Apr 10 13:22:48 2018 (r332361) @@ -148,11 +148,12 @@ struct g_command class_commands[] = { { 'd', "detach", NULL, G_TYPE_BOOL }, { 'j', "passfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, { 'k', "keyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, + { 'n', "dryrun", NULL, G_TYPE_BOOL }, { 'p', "nopassphrase", NULL, G_TYPE_BOOL }, { 'r', "readonly", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-dprv] [-j passfile] [-k keyfile] prov" + "[-dnprv] [-j passfile] [-k keyfile] prov" }, { "detach", 0, NULL, { Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Tue Apr 10 13:16:50 2018 (r332360) +++ head/sys/geom/eli/g_eli_ctl.c Tue Apr 10 13:22:48 2018 (r332361) @@ -59,7 +59,7 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class struct g_provider *pp; const char *name; u_char *key, mkey[G_ELI_DATAIVKEYLEN]; - int *nargs, *detach, *readonly; + int *nargs, *detach, *readonly, *dryrun; int keysize, error; u_int nkey; @@ -87,6 +87,12 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class return; } + dryrun = gctl_get_paraml(req, "dryrun", sizeof(*dryrun)); + if (dryrun == NULL) { + gctl_error(req, "No '%s' argument.", "dryrun"); + return; + } + if (*detach && *readonly) { gctl_error(req, "Options -d and -r are mutually exclusive."); return; @@ -141,7 +147,8 @@ g_eli_ctl_attach(struct gctl_req *req, struct g_class md.md_flags |= G_ELI_FLAG_WO_DETACH; if (*readonly) md.md_flags |= G_ELI_FLAG_RO; - g_eli_create(req, mp, pp, &md, mkey, nkey); + if (!*dryrun) + g_eli_create(req, mp, pp, &md, mkey, nkey); explicit_bzero(mkey, sizeof(mkey)); explicit_bzero(&md, sizeof(md)); } From owner-svn-src-all@freebsd.org Tue Apr 10 13:25:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AADC4F9CAAE; Tue, 10 Apr 2018 13:25:42 +0000 (UTC) (envelope-from mw@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 5D9426C297; Tue, 10 Apr 2018 13:25:42 +0000 (UTC) (envelope-from mw@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 5886D6279; Tue, 10 Apr 2018 13:25:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ADPgG7058058; Tue, 10 Apr 2018 13:25:42 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ADPgaW058057; Tue, 10 Apr 2018 13:25:42 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804101325.w3ADPgaW058057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 10 Apr 2018 13:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332362 - head/sys/dts/arm X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dts/arm X-SVN-Commit-Revision: 332362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:25:42 -0000 Author: mw Date: Tue Apr 10 13:25:42 2018 New Revision: 332362 URL: https://svnweb.freebsd.org/changeset/base/332362 Log: Remove deprecated DT sources of Armada 38x SoCs Now, as all platform code and drivers support Linux DT binding, safely remove deprecated sources and rely on sys/gnu/dts from now on. Obtained from: Semihalf Sponsored by: Stormshield Deleted: head/sys/dts/arm/armada-380.dtsi head/sys/dts/arm/armada-385-db-ap.dts head/sys/dts/arm/armada-385.dtsi head/sys/dts/arm/armada-388-clearfog.dts head/sys/dts/arm/armada-388-gp.dts head/sys/dts/arm/armada-388.dtsi head/sys/dts/arm/armada-38x-solidrun-microsom.dtsi head/sys/dts/arm/armada-38x.dtsi From owner-svn-src-all@freebsd.org Tue Apr 10 13:35:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 504E2F9D5A2; Tue, 10 Apr 2018 13:35:08 +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 ED3E96F0B1; Tue, 10 Apr 2018 13:35:07 +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 E42CD6420; Tue, 10 Apr 2018 13:35:07 +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 w3ADZ7e3062807; Tue, 10 Apr 2018 13:35:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ADZ75V062805; Tue, 10 Apr 2018 13:35:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101335.w3ADZ75V062805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 13:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332363 - in stable/11: etc sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: etc sys/sys X-SVN-Commit-Revision: 332363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:35:08 -0000 Author: kevans Date: Tue Apr 10 13:35:07 2018 New Revision: 332363 URL: https://svnweb.freebsd.org/changeset/base/332363 Log: Revert r331880, MFC of r328331 and bump FreeBSD_version There are logistics issues that weren't considered when this was originally MFC'd. All rc scripts in ports need audited (this is in progress) for usage of ${name}_limits that doesn't line up with the new interpretation, and individual rc.conf(5)'s need to be scrubbed of usage that doesn't line up. It's since been decided that it should be left for a feature in 12. 1101514 introduced interpretation of ${name}_limits for rc scripts; this feature no longer exists as of 1101515. Modified: stable/11/etc/rc.subr stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.subr ============================================================================== --- stable/11/etc/rc.subr Tue Apr 10 13:25:42 2018 (r332362) +++ stable/11/etc/rc.subr Tue Apr 10 13:35:07 2018 (r332363) @@ -773,8 +773,6 @@ check_startmsgs() # # ${name}_login_class n Login class to use, else "daemon". # -# ${name}_limits n limits(1) to apply to ${command}. -# # ${rc_arg}_cmd n If set, use this as the method when invoked; # Otherwise, use default command (see below) # @@ -954,7 +952,7 @@ run_rc_command() _group=\$${name}_group _groups=\$${name}_groups \ _fib=\$${name}_fib _env=\$${name}_env \ _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-daemon} \ - _limits=\$${name}_limits _oomprotect=\$${name}_oomprotect + _oomprotect=\$${name}_oomprotect if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then @@ -1075,7 +1073,7 @@ $command $rc_flags $command_args" fi # Prepend default limits - _doit="$_cd limits -C $_login_class $_limits $_doit" + _doit="$_cd limits -C $_login_class $_doit" # run the full command # Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Tue Apr 10 13:25:42 2018 (r332362) +++ stable/11/sys/sys/param.h Tue Apr 10 13:35:07 2018 (r332363) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1101514 /* Master, propagated to newvers */ +#define __FreeBSD_version 1101515 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Apr 10 13:47:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AE18F9E2E3; Tue, 10 Apr 2018 13:47:10 +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 D0D426F980; Tue, 10 Apr 2018 13:47: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 CBA7B65AC; Tue, 10 Apr 2018 13:47: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 w3ADl9HN067641; Tue, 10 Apr 2018 13:47:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ADl9st067639; Tue, 10 Apr 2018 13:47:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804101347.w3ADl9st067639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Apr 2018 13:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332364 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Commit-Revision: 332364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:47:10 -0000 Author: markj Date: Tue Apr 10 13:47:09 2018 New Revision: 332364 URL: https://svnweb.freebsd.org/changeset/base/332364 Log: Assert that dtrace_probe() doesn't re-enter itself. This helps catch cases where an instrumented function is called while in probe context. Submitted by: Domagoj Stolfa MFC after: 2 weeks Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D14863 Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/dev/dtrace/dtrace_cddl.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Apr 10 13:35:07 2018 (r332363) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Apr 10 13:47:09 2018 (r332364) @@ -7257,6 +7257,44 @@ dtrace_store_by_ref(dtrace_difo_t *dp, caddr_t tomax, } /* + * Disables interrupts and sets the per-thread inprobe flag. When DEBUG is + * defined, we also assert that we are not recursing unless the probe ID is an + * error probe. + */ +static dtrace_icookie_t +dtrace_probe_enter(dtrace_id_t id) +{ + dtrace_icookie_t cookie; + + cookie = dtrace_interrupt_disable(); + + /* + * Unless this is an ERROR probe, we are not allowed to recurse in + * dtrace_probe(). Recursing into DTrace probe usually means that a + * function is instrumented that should not have been instrumented or + * that the ordering guarantee of the records will be violated, + * resulting in unexpected output. If there is an exception to this + * assertion, a new case should be added. + */ + ASSERT(curthread->t_dtrace_inprobe == 0 || + id == dtrace_probeid_error); + curthread->t_dtrace_inprobe = 1; + + return (cookie); +} + +/* + * Disables interrupts and clears the per-thread inprobe flag. + */ +static void +dtrace_probe_exit(dtrace_icookie_t cookie) +{ + + curthread->t_dtrace_inprobe = 0; + dtrace_interrupt_enable(cookie); +} + +/* * If you're looking for the epicenter of DTrace, you just found it. This * is the function called by the provider to fire a probe -- from which all * subsequent probe-context DTrace activity emanates. @@ -7290,7 +7328,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t return; #endif - cookie = dtrace_interrupt_disable(); + cookie = dtrace_probe_enter(id); probe = dtrace_probes[id - 1]; cpuid = curcpu; onintr = CPU_ON_INTR(CPU); @@ -7301,7 +7339,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t * We have hit in the predicate cache; we know that * this predicate would evaluate to be false. */ - dtrace_interrupt_enable(cookie); + dtrace_probe_exit(cookie); return; } @@ -7313,7 +7351,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t /* * We don't trace anything if we're panicking. */ - dtrace_interrupt_enable(cookie); + dtrace_probe_exit(cookie); return; } @@ -7939,7 +7977,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t if (vtime) curthread->t_dtrace_start = dtrace_gethrtime(); - dtrace_interrupt_enable(cookie); + dtrace_probe_exit(cookie); } /* Modified: head/sys/cddl/dev/dtrace/dtrace_cddl.h ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_cddl.h Tue Apr 10 13:35:07 2018 (r332363) +++ head/sys/cddl/dev/dtrace/dtrace_cddl.h Tue Apr 10 13:47:09 2018 (r332364) @@ -46,6 +46,7 @@ typedef struct kdtrace_proc { typedef struct kdtrace_thread { u_int8_t td_dtrace_stop; /* Indicates a DTrace-desired stop */ u_int8_t td_dtrace_sig; /* Signal sent via DTrace's raise() */ + u_int8_t td_dtrace_inprobe; /* Are we in a probe? */ u_int td_predcache; /* DTrace predicate cache */ u_int64_t td_dtrace_vtime; /* DTrace virtual time */ u_int64_t td_dtrace_start; /* DTrace slice start time */ @@ -97,6 +98,7 @@ typedef struct kdtrace_thread { #define t_dtrace_start td_dtrace->td_dtrace_start #define t_dtrace_stop td_dtrace->td_dtrace_stop #define t_dtrace_sig td_dtrace->td_dtrace_sig +#define t_dtrace_inprobe td_dtrace->td_dtrace_inprobe #define t_predcache td_dtrace->td_predcache #define t_dtrace_ft td_dtrace->td_dtrace_ft #define t_dtrace_on td_dtrace->td_dtrace_on From owner-svn-src-all@freebsd.org Tue Apr 10 13:56:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F25A8F9EBB6; Tue, 10 Apr 2018 13:56:06 +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 93A4B726C8; Tue, 10 Apr 2018 13:56:06 +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 8E7FE6745; Tue, 10 Apr 2018 13:56:06 +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 w3ADu6v6072767; Tue, 10 Apr 2018 13:56:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ADu6Jr072766; Tue, 10 Apr 2018 13:56:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804101356.w3ADu6Jr072766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Apr 2018 13:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332365 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 332365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:56:07 -0000 Author: markj Date: Tue Apr 10 13:56:06 2018 New Revision: 332365 URL: https://svnweb.freebsd.org/changeset/base/332365 Log: Set zfs_arc_free_target to v_free_target. Page daemon output is now regulated by a PID controller with a setpoint of v_free_target. Moreover, the page daemon now wakes up regularly rather than waiting for a wakeup from another thread. This means that the free page count is unlikely to drop below the old zfs_arc_free_target value, and as a result the ARC was not readily freeing pages under memory pressure. Address the immediate problem by updating zfs_arc_free_target to match the page daemon's new behaviour. Reported and tested by: truckman Discussed with: jeff X-MFC with: r329882 Differential Revision: https://reviews.freebsd.org/D14994 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Apr 10 13:47:09 2018 (r332364) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Apr 10 13:56:06 2018 (r332365) @@ -389,7 +389,7 @@ static void arc_free_target_init(void *unused __unused) { - zfs_arc_free_target = (vm_cnt.v_free_min / 10) * 11; + zfs_arc_free_target = vm_cnt.v_free_target; } SYSINIT(arc_free_target_init, SI_SUB_KTHREAD_PAGE, SI_ORDER_ANY, arc_free_target_init, NULL); From owner-svn-src-all@freebsd.org Tue Apr 10 13:56:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 061AAF9EC15; Tue, 10 Apr 2018 13:56:31 +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 AD22A7281B; Tue, 10 Apr 2018 13:56:30 +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 A81846757; Tue, 10 Apr 2018 13:56:30 +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 w3ADuUDw072833; Tue, 10 Apr 2018 13:56:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ADuU98072832; Tue, 10 Apr 2018 13:56:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101356.w3ADuU98072832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 13:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332366 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 332366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 13:56:31 -0000 Author: kevans Date: Tue Apr 10 13:56:30 2018 New Revision: 332366 URL: https://svnweb.freebsd.org/changeset/base/332366 Log: MFC r316487, r316516, r316546, r316567: One big nop r316487: Allow command modifiers (fast, quiet etc.) to be stacked in any order. Add a "debug" modifier that sets rc_debug. r316516: r316487 altered the defined values of rc_force from "yes" (for yes) and NULL (for no) to "no" (for no) and no change to the definition of yes. Two rc.d scripts, dhclient and bgfsck check rc_force for yesi, using test -n, and no, using test -z. The redefinition of yes and no by r316487 caused rc.d/dhclient, when invoked by devd using a devd.conf rule, to assign DHCP assigned IP addresses for interfaces with statically assigned interfaces, breaking boot. Point of breakage was at line 25 of etc/rc.d/dhclient (r301068) where $rc_force needs to be NULL. X-MFC with: r316487 r316546: Revert r316516. des@ asked that r316516 be reverted so that he can spend a little more time getting r316487 right. Requested by: des@ r316567: Revert r316487. It is broken, causing boot to fail due to line 25 in etc/rc.d/dhclient unconditionally testing true when called by a devd rule during boot, ignoring statically assigned IP addresses in rc.conf. Requested by: des@ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Tue Apr 10 14:00:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A557F9F135; Tue, 10 Apr 2018 14:00:46 +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 B410372C44; Tue, 10 Apr 2018 14:00:45 +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 AF0CC676B; Tue, 10 Apr 2018 14:00:45 +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 w3AE0js3073299; Tue, 10 Apr 2018 14:00:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AE0jKe073298; Tue, 10 Apr 2018 14:00:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101400.w3AE0jKe073298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 14:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332367 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 332367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:00:46 -0000 Author: kevans Date: Tue Apr 10 14:00:45 2018 New Revision: 332367 URL: https://svnweb.freebsd.org/changeset/base/332367 Log: MFC r308896 r308896: rc.subr: $(ps -p $$ -o jid=) is always 0, so do not fork ps for it. The JID keyword writes 0 for a process also in the host system or in the same jail. Modified: stable/11/etc/rc.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.subr ============================================================================== --- stable/11/etc/rc.subr Tue Apr 10 13:56:30 2018 (r332366) +++ stable/11/etc/rc.subr Tue Apr 10 14:00:45 2018 (r332367) @@ -49,7 +49,7 @@ PROTECT="/usr/bin/protect" ID="/usr/bin/id" IDCMD="if [ -x $ID ]; then $ID -un; fi" PS="/bin/ps -ww" -JID=`$PS -p $$ -o jid=` +JID=0 # # functions From owner-svn-src-all@freebsd.org Tue Apr 10 14:04:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C50F1F9F6DD; Tue, 10 Apr 2018 14:04:11 +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 72E9073234; Tue, 10 Apr 2018 14:04:11 +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 6DD2D68F4; Tue, 10 Apr 2018 14:04:11 +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 w3AE4B04078212; Tue, 10 Apr 2018 14:04:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AE4BVw078210; Tue, 10 Apr 2018 14:04:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101404.w3AE4BVw078210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 14:04:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332368 - in stable/11/etc: . defaults X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/etc: . defaults X-SVN-Commit-Revision: 332368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:04:12 -0000 Author: kevans Date: Tue Apr 10 14:04:11 2018 New Revision: 332368 URL: https://svnweb.freebsd.org/changeset/base/332368 Log: MFC r309350, r309352 r309350: If the kenv variable rc_debug is set, turn on rc_debug. r309352: Finish incomplete comments in prior revision. I was going to fix this after I tested it, but didn't. Modified: stable/11/etc/defaults/rc.conf stable/11/etc/rc.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/defaults/rc.conf ============================================================================== --- stable/11/etc/defaults/rc.conf Tue Apr 10 14:00:45 2018 (r332367) +++ stable/11/etc/defaults/rc.conf Tue Apr 10 14:04:11 2018 (r332368) @@ -21,6 +21,8 @@ ### Important initial Boot-time options #################### ############################################################## +# rc_debug can't be set here without interferring with rc.subr's setting it +# when the kenv variable rc.debug is set. #rc_debug="NO" # Set to YES to enable debugging output from rc.d rc_info="NO" # Enables display of informational messages at boot. rc_startmsgs="YES" # Show "Starting foo:" messages at boot Modified: stable/11/etc/rc.subr ============================================================================== --- stable/11/etc/rc.subr Tue Apr 10 14:00:45 2018 (r332367) +++ stable/11/etc/rc.subr Tue Apr 10 14:04:11 2018 (r332368) @@ -2166,6 +2166,13 @@ _echoonce() esac } +# If the loader env variable rc.debug is set, turn on debugging. rc.conf will +# still override this, but /etc/defaults/rc.conf can't unconditionally set this +# since it would undo what we've done here. +if kenv -q rc.debug > /dev/null ; then + rc_debug=YES +fi + fi # [ -z "${_rc_subr_loaded}" ] _rc_subr_loaded=: From owner-svn-src-all@freebsd.org Tue Apr 10 14:07:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86D71F9FA2A; Tue, 10 Apr 2018 14:07: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 31B1B74311; Tue, 10 Apr 2018 14:07:03 +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 2C9FA68F7; Tue, 10 Apr 2018 14:07: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 w3AE73Ne078355; Tue, 10 Apr 2018 14:07:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AE73Nh078354; Tue, 10 Apr 2018 14:07:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804101407.w3AE73Nh078354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Apr 2018 14:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332369 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Commit-Revision: 332369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:07:03 -0000 Author: markj Date: Tue Apr 10 14:07:02 2018 New Revision: 332369 URL: https://svnweb.freebsd.org/changeset/base/332369 Log: Correct a comment. Submitted by: Domagoj Stolfa X-MFC with: r332364 Sponsored by: DARPA, AFRL Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Apr 10 14:04:11 2018 (r332368) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Apr 10 14:07:02 2018 (r332369) @@ -7284,7 +7284,7 @@ dtrace_probe_enter(dtrace_id_t id) } /* - * Disables interrupts and clears the per-thread inprobe flag. + * Clears the per-thread inprobe flag and enables interrupts. */ static void dtrace_probe_exit(dtrace_icookie_t cookie) From owner-svn-src-all@freebsd.org Tue Apr 10 14:07:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7421F9FA95; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@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 866AE747BC; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@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 8167868F9; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AE7ULo078426; Tue, 10 Apr 2018 14:07:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AE7UU3078424; Tue, 10 Apr 2018 14:07:30 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201804101407.w3AE7UU3078424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 Apr 2018 14:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332370 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Commit-Revision: 332370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:07:31 -0000 Author: gjb Date: Tue Apr 10 14:07:29 2018 New Revision: 332370 URL: https://svnweb.freebsd.org/changeset/base/332370 Log: Document EN-18:03, EN-18:04, SA-18:04, SA-18:05. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/share/xml/errata.xml stable/10/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/errata.xml ============================================================================== --- stable/11/release/doc/share/xml/errata.xml Tue Apr 10 14:07:02 2018 (r332369) +++ stable/11/release/doc/share/xml/errata.xml Tue Apr 10 14:07:29 2018 (r332370) @@ -56,6 +56,22 @@ 07 March 2018 Stack-based buffer overflow + + + FreeBSD-EN-18:03.tzdata + 04 April 2018 + Update timezone database + information + + + + FreeBSD-EN-18:04.mem + 04 April 2018 + Multiple small kernel memory + disclosures + Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Tue Apr 10 14:07:02 2018 (r332369) +++ stable/11/release/doc/share/xml/security.xml Tue Apr 10 14:07:29 2018 (r332370) @@ -91,6 +91,21 @@ + + + FreeBSD-SA-18:04.vt + 04 April 2018 + Fix &man.vt.4; console memory + disclosure + + + + FreeBSD-SA-18:05.ipsec + 04 April 2018 + Fix denial of service + From owner-svn-src-all@freebsd.org Tue Apr 10 14:07:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1606F9FA94; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@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 536C6747B8; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@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 4B5D068F8; Tue, 10 Apr 2018 14:07:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AE7UYD078419; Tue, 10 Apr 2018 14:07:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AE7Twe078417; Tue, 10 Apr 2018 14:07:29 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201804101407.w3AE7Twe078417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 Apr 2018 14:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332370 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Commit-Revision: 332370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:07:31 -0000 Author: gjb Date: Tue Apr 10 14:07:29 2018 New Revision: 332370 URL: https://svnweb.freebsd.org/changeset/base/332370 Log: Document EN-18:03, EN-18:04, SA-18:04, SA-18:05. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/errata.xml stable/10/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Modified: stable/10/release/doc/share/xml/errata.xml ============================================================================== --- stable/10/release/doc/share/xml/errata.xml Tue Apr 10 14:07:02 2018 (r332369) +++ stable/10/release/doc/share/xml/errata.xml Tue Apr 10 14:07:29 2018 (r332370) @@ -40,6 +40,22 @@ 07 March 2018 Stack-based buffer overflow + + + FreeBSD-EN-18:03.tzdata + 04 April 2018 + Update timezone database + information + + + + FreeBSD-EN-18:04.mem + 04 April 2018 + Multiple small kernel memory + disclosures + Modified: stable/10/release/doc/share/xml/security.xml ============================================================================== --- stable/10/release/doc/share/xml/security.xml Tue Apr 10 14:07:02 2018 (r332369) +++ stable/10/release/doc/share/xml/security.xml Tue Apr 10 14:07:29 2018 (r332370) @@ -83,6 +83,21 @@ 07 March 2018 Multiple vulnerabilities + + + FreeBSD-SA-18:04.vt + 04 April 2018 + Fix &man.vt.4; console memory + disclosure + + + + FreeBSD-SA-18:05.ipsec + 04 April 2018 + Fix denial of service + From owner-svn-src-all@freebsd.org Tue Apr 10 14:10:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E780F9FE3A; Tue, 10 Apr 2018 14:10:01 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 CDE1975FD0; Tue, 10 Apr 2018 14:10:00 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1f5ty9-000Bnj-Sg; Tue, 10 Apr 2018 17:09:57 +0300 Date: Tue, 10 Apr 2018 17:09:57 +0300 From: Slawa Olhovchenkov To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332365 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20180410140957.GG6612@zxy.spb.ru> References: <201804101356.w3ADu6Jr072766@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804101356.w3ADu6Jr072766@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:10:01 -0000 On Tue, Apr 10, 2018 at 01:56:06PM +0000, Mark Johnston wrote: > Author: markj > Date: Tue Apr 10 13:56:06 2018 > New Revision: 332365 > URL: https://svnweb.freebsd.org/changeset/base/332365 > > Log: > Set zfs_arc_free_target to v_free_target. > > Page daemon output is now regulated by a PID controller with a setpoint > of v_free_target. Moreover, the page daemon now wakes up regularly > rather than waiting for a wakeup from another thread. This means that > the free page count is unlikely to drop below the old > zfs_arc_free_target value, and as a result the ARC was not readily > freeing pages under memory pressure. Address the immediate problem by > updating zfs_arc_free_target to match the page daemon's new behaviour. Can you explain some more about new page daemon algo (and reclaim zone free memory)? PS: zfs need some more time for free pages from ARC. Also, vanila zfs have broken logic for count used and free ARC's memory. For most correctly count system-wide used and free memory need accounting in-zone free memory. > arc_free_target_init(void *unused __unused) > { > > - zfs_arc_free_target = (vm_cnt.v_free_min / 10) * 11; > + zfs_arc_free_target = vm_cnt.v_free_target; > } From owner-svn-src-all@freebsd.org Tue Apr 10 14:13:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6687FA03D1; Tue, 10 Apr 2018 14:13:36 +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 62A6C766C2; Tue, 10 Apr 2018 14:13:36 +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 448516A99; Tue, 10 Apr 2018 14:13:36 +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 w3AEDamm083246; Tue, 10 Apr 2018 14:13:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AEDar4083245; Tue, 10 Apr 2018 14:13:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101413.w3AEDar4083245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 14:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332371 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 332371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:13:37 -0000 Author: kevans Date: Tue Apr 10 14:13:35 2018 New Revision: 332371 URL: https://svnweb.freebsd.org/changeset/base/332371 Log: MFC r319828, r324625 r319828: rc.subr: Optimize repeated sourcing. When /etc/rc runs all /etc/rc.d scripts, it has already loaded /etc/rc.subr but each /etc/rc.d script sources it again (since /etc/rc.d scripts must also work when started stand-alone). Therefore, if rc.subr is already loaded, return so sh need not parse the rest of the file. A second effect is that there is no longer a compound command around most of rc.subr. This reduces memory usage while sh is loading rc.subr for the first time (but this memory is free()d once rc.subr is loaded). For purposes of porting this to other systems, I do not recommend porting this to systems with shells that do not have the change to the return special builtin like in r255215 (before FreeBSD 10.0-RELEASE). This change ensures that return in the top level of a dot script returns from the dot script, even if the dot script was sourced from a function. A comparison of CPU time on an amd64 bhyve virtual machine from a times command added near the end of /etc/rc, all four values summed: x orig1 + quickreturn +--------------------------------------------------------------------------+ | + + + x x x| ||______M__A_________| |______M___A__________| | +--------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 1.704 1.802 1.726 1.744 0.051419841 + 3 1.467 1.559 1.487 1.5043333 0.048387326 Difference at 95.0% confidence -0.239667 +/- 0.113163 -13.7424% +/- 6.48873% (Student's t, pooled s = 0.0499266) r324625: rc.subr: Remove test that is always true. The code above always sets _pidcmd to a non-empty value. Modified: stable/11/etc/rc.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.subr ============================================================================== --- stable/11/etc/rc.subr Tue Apr 10 14:07:29 2018 (r332370) +++ stable/11/etc/rc.subr Tue Apr 10 14:13:35 2018 (r332371) @@ -38,7 +38,9 @@ # Operating System dependent/independent variables # -if [ -z "${_rc_subr_loaded}" ]; then +if [ -n "${_rc_subr_loaded}" ]; then + return +fi _rc_subr_loaded="YES" @@ -928,9 +930,7 @@ run_rc_command() else _pidcmd='rc_pid=$(check_process '"$_procname $command_interpreter"')' fi - if [ -n "$_pidcmd" ]; then - _keywords="${_keywords} status poll" - fi + _keywords="${_keywords} status poll" fi if [ -z "$rc_arg" ]; then @@ -2172,7 +2172,3 @@ _echoonce() if kenv -q rc.debug > /dev/null ; then rc_debug=YES fi - -fi # [ -z "${_rc_subr_loaded}" ] - -_rc_subr_loaded=: From owner-svn-src-all@freebsd.org Tue Apr 10 14:27:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51227FA0FDF; Tue, 10 Apr 2018 14:27:28 +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 EF1B37956F; Tue, 10 Apr 2018 14:27:27 +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 EA2A96C30; Tue, 10 Apr 2018 14:27:27 +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 w3AERRAN088110; Tue, 10 Apr 2018 14:27:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AERR7G088108; Tue, 10 Apr 2018 14:27:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101427.w3AERR7G088108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 14:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332372 - head/usr.bin/tail X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/tail X-SVN-Commit-Revision: 332372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:27:28 -0000 Author: kevans Date: Tue Apr 10 14:27:27 2018 New Revision: 332372 URL: https://svnweb.freebsd.org/changeset/base/332372 Log: tail(1): Add some long options Add --blocks, --bytes, and --lines long options for -b, -c, and -n respectively. This improves tail(1)'s compatibility with its GNU counterpart in a straightforward way. Reviewed by: eadler (earlier version) MFC after: 3 days Modified: head/usr.bin/tail/tail.1 head/usr.bin/tail/tail.c Modified: head/usr.bin/tail/tail.1 ============================================================================== --- head/usr.bin/tail/tail.1 Tue Apr 10 14:13:35 2018 (r332371) +++ head/usr.bin/tail/tail.1 Tue Apr 10 14:27:27 2018 (r332372) @@ -31,7 +31,7 @@ .\" @(#)tail.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 16, 2013 +.Dd April 10, 2018 .Dt TAIL 1 .Os .Sh NAME @@ -73,11 +73,11 @@ or the last 10 lines of the input. .Pp The options are as follows: .Bl -tag -width indent -.It Fl b Ar number +.It Fl b Ar number , Fl -blocks Ns = Ns Ar number The location is .Ar number 512-byte blocks. -.It Fl c Ar number +.It Fl c Ar number , Fl -bytes Ns = Ns Ar number The location is .Ar number bytes. @@ -112,7 +112,7 @@ The option is the same as the .Fl f option if reading from standard input rather than a file. -.It Fl n Ar number +.It Fl n Ar number, Fl -lines Ns = Ns Ar number The location is .Ar number lines. Modified: head/usr.bin/tail/tail.c ============================================================================== --- head/usr.bin/tail/tail.c Tue Apr 10 14:13:35 2018 (r332371) +++ head/usr.bin/tail/tail.c Tue Apr 10 14:27:27 2018 (r332372) @@ -51,6 +51,7 @@ static const char sccsid[] = "@(#)tail.c 8.1 (Berkeley #include #include +#include #include #include #include @@ -65,6 +66,14 @@ static file_info_t *files; static void obsolete(char **); static void usage(void); +static const struct option long_opts[] = +{ + {"blocks", required_argument, NULL, 'b'}, + {"bytes", required_argument, NULL, 'c'}, + {"lines", required_argument, NULL, 'n'}, + {NULL, no_argument, NULL, 0} +}; + int main(int argc, char *argv[]) { @@ -113,7 +122,8 @@ main(int argc, char *argv[]) obsolete(argv); style = NOTSET; off = 0; - while ((ch = getopt(argc, argv, "Fb:c:fn:qr")) != -1) + while ((ch = getopt_long(argc, argv, "+Fb:c:fn:qr", long_opts, NULL)) != + -1) switch(ch) { case 'F': /* -F is superset of (and implies) -f */ Fflag = fflag = 1; From owner-svn-src-all@freebsd.org Tue Apr 10 14:28:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB581FA1111; Tue, 10 Apr 2018 14:28:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (unknown [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 65EFF7A08E; Tue, 10 Apr 2018 14:28:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 15E9711403; Tue, 10 Apr 2018 14:28:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f49.google.com with SMTP id q9-v6so11979922lfk.9; Tue, 10 Apr 2018 07:28:37 -0700 (PDT) X-Gm-Message-State: ALQs6tBWO6/YG/f0SXVD/aKbEBs5kf4mR/Eo0w4GVH+OphrsS1O0avve gCCFf+2A8xdH3RcERqqK3V75PS+eo7PCZZM3BfM= X-Google-Smtp-Source: AIpwx48I3boobdyCXEXhknUl0vxh+1Pndg2aRij+oLWPSLt3teAEm4QxpiIvS3KVNWy2LERUPaYhC4XTYDZrayBLVHs= X-Received: by 10.46.29.1 with SMTP id d1mr434617ljd.22.1523370515508; Tue, 10 Apr 2018 07:28:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Tue, 10 Apr 2018 07:28:14 -0700 (PDT) In-Reply-To: <201804101427.w3AERR7G088108@repo.freebsd.org> References: <201804101427.w3AERR7G088108@repo.freebsd.org> From: Kyle Evans Date: Tue, 10 Apr 2018 09:28:14 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332372 - head/usr.bin/tail To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:28:37 -0000 On Tue, Apr 10, 2018 at 9:27 AM, Kyle Evans wrote: > Author: kevans > Date: Tue Apr 10 14:27:27 2018 > New Revision: 332372 > URL: https://svnweb.freebsd.org/changeset/base/332372 > > Log: > tail(1): Add some long options > > Add --blocks, --bytes, and --lines long options for -b, -c, and -n > respectively. This improves tail(1)'s compatibility with its GNU counterpart > in a straightforward way. > > Reviewed by: eadler (earlier version) > MFC after: 3 days > ... Differential revision: https://reviews.freebsd.org/D14140 From owner-svn-src-all@freebsd.org Tue Apr 10 14:42:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04BA9FA1EE0; Tue, 10 Apr 2018 14:42:25 +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 A9FF67D5F4; Tue, 10 Apr 2018 14:42:24 +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 A4F5B6F62; Tue, 10 Apr 2018 14:42:24 +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 w3AEgOgR098086; Tue, 10 Apr 2018 14:42:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AEgOfU098085; Tue, 10 Apr 2018 14:42:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101442.w3AEgOfU098085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 14:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332373 - head/usr.bin/tail X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/tail X-SVN-Commit-Revision: 332373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:42:25 -0000 Author: kevans Date: Tue Apr 10 14:42:24 2018 New Revision: 332373 URL: https://svnweb.freebsd.org/changeset/base/332373 Log: tail(1): Address mandoc concern (space before punctuation after macro) X-MFC-With: r332372 Modified: head/usr.bin/tail/tail.1 Modified: head/usr.bin/tail/tail.1 ============================================================================== --- head/usr.bin/tail/tail.1 Tue Apr 10 14:27:27 2018 (r332372) +++ head/usr.bin/tail/tail.1 Tue Apr 10 14:42:24 2018 (r332373) @@ -112,7 +112,7 @@ The option is the same as the .Fl f option if reading from standard input rather than a file. -.It Fl n Ar number, Fl -lines Ns = Ns Ar number +.It Fl n Ar number , Fl -lines Ns = Ns Ar number The location is .Ar number lines. From owner-svn-src-all@freebsd.org Tue Apr 10 14:44:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FA9DFA2046; Tue, 10 Apr 2018 14:44:08 +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 13CAF7D7E3; Tue, 10 Apr 2018 14:44:08 +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 0E9C86F70; Tue, 10 Apr 2018 14:44:08 +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 w3AEi71F098234; Tue, 10 Apr 2018 14:44:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AEi79n098232; Tue, 10 Apr 2018 14:44:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101444.w3AEi79n098232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 14:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332374 - head/usr.bin/head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/head X-SVN-Commit-Revision: 332374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:44:08 -0000 Author: kevans Date: Tue Apr 10 14:44:07 2018 New Revision: 332374 URL: https://svnweb.freebsd.org/changeset/base/332374 Log: head(1): Provide long options Provide long options --bytes and --lines to match -c and -n respectively. This improves head(1)'s compatibility with its GNU counterpart in a sensible way. Reviewed by: eadler (previous version) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D14139 Modified: head/usr.bin/head/head.1 head/usr.bin/head/head.c Modified: head/usr.bin/head/head.1 ============================================================================== --- head/usr.bin/head/head.1 Tue Apr 10 14:42:24 2018 (r332373) +++ head/usr.bin/head/head.1 Tue Apr 10 14:44:07 2018 (r332374) @@ -28,7 +28,7 @@ .\" @(#)head.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 16, 2013 +.Dd April 10, 2018 .Dt HEAD 1 .Os .Sh NAME @@ -48,6 +48,18 @@ files are specified. If .Ar count is omitted it defaults to 10. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl c Ar bytes , Fl -bytes Ns = Ns Ar bytes +Print +.Ar bytes +of each of the specified files. +.It Fl n Ar count , Fl -lines Ns = Ns Ar count +Print +.Ar count +lines of each of the specified files. +.El .Pp If more than a single file is specified, each file is preceded by a header consisting of the string Modified: head/usr.bin/head/head.c ============================================================================== --- head/usr.bin/head/head.c Tue Apr 10 14:42:24 2018 (r332373) +++ head/usr.bin/head/head.c Tue Apr 10 14:44:07 2018 (r332374) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -64,6 +65,13 @@ static void head_bytes(FILE *, off_t); static void obsolete(char *[]); static void usage(void); +static const struct option long_opts[] = +{ + {"bytes", required_argument, NULL, 'c'}, + {"lines", required_argument, NULL, 'n'}, + {NULL, no_argument, NULL, 0} +}; + int main(int argc, char *argv[]) { @@ -74,7 +82,7 @@ main(int argc, char *argv[]) char *ep; obsolete(argv); - while ((ch = getopt(argc, argv, "n:c:")) != -1) + while ((ch = getopt_long(argc, argv, "+n:c:", long_opts, NULL)) != -1) switch(ch) { case 'c': bytecnt = strtoimax(optarg, &ep, 10); From owner-svn-src-all@freebsd.org Tue Apr 10 14:54:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DAAAFA2BEE; Tue, 10 Apr 2018 14:54:30 +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 B724B807A8; Tue, 10 Apr 2018 14:54:29 +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 w3AEsPwk023666; Tue, 10 Apr 2018 07:54:25 -0700 (PDT) (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 w3AEsPip023665; Tue, 10 Apr 2018 07:54:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804101454.w3AEsPip023665@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332041 - svnadmin/conf In-Reply-To: To: Julian Elischer Date: Tue, 10 Apr 2018 07:54:25 -0700 (PDT) CC: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 14:54:30 -0000 [ Charset UTF-8 unsupported, converting... ] > On 5/4/18 2:27 am, Alexander Motin wrote: > > Author: mav > > Date: Wed Apr 4 18:27:18 2018 > > New Revision: 332041 > > URL: https://svnweb.freebsd.org/changeset/base/332041 > > > > Log: > > Restore Sean Eric Fagan (sef) src commit bit. > > !!? Welcome back SEF! Yes, welcome Back Sean! > > I (mav) will be his mentor. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Apr 10 15:01:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89B63FA30C5; Tue, 10 Apr 2018 15:01:07 +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 0819E811F2; Tue, 10 Apr 2018 15:01:06 +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 w3AF0ro9023724; Tue, 10 Apr 2018 08:00:53 -0700 (PDT) (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 w3AF0r8o023723; Tue, 10 Apr 2018 08:00:53 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804101500.w3AF0r8o023723@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331880 - stable/11/etc In-Reply-To: <6928b703-536e-b1a7-2a80-6796db15affc@daemonic.se> To: Niclas Zeising Date: Tue, 10 Apr 2018 08:00:53 -0700 (PDT) CC: Kyle Evans , Warner Losh , "Rodney W. Grimes" , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 15:01:07 -0000 > On 04/10/18 04:28, Kyle Evans wrote: > > On Mon, Apr 9, 2018 at 11:59 AM, Warner Losh wrote: > >> > >> > >> On Mon, Apr 9, 2018 at 10:09 AM, Kyle Evans wrote: > >>> > >>> Right- so, back out this MFC (and the subsequent FreeBSD_version bump) > >>> and fix the ports to do the right thing for 12.x while that's still > >>> not a technically supported branch? > >> > >> > >> Don't back out the version bump. Other things may be riding along on it 'for > >> free'. Better to bump it again when you unMFC (if it's been more than a few > >> days since we've had one), and then yet-again when a fixed MFC happens. > >> Unless there's something you can ride along on for free :) > >> > >> Otherwise, that's a great plan. > > > > Ok, I think the result of this thread and discussion with 0mp is the > > following set of actions: > > > > 1.) One (1) commit to stable/11 to revert the MFC and bump > > FreeBSD_Version again for the removal > > 2.) One (1) commit to doc to document the new FreeBSD_Version > > 3.) Fixing ports to use the "new" behavior on 12, both the > > yet-to-be-patched ports and the ports that had already been patched > > under the assumption that it would still land first in 11.1-stable > > 4.) Documenting the original commit? > > > > The hard part of point #3 has already been done by 0mp, who has > > submitted patches for all of the ports using this behavior. His > > patches will just need a bump of the version they're testing to the > > 12.x FreeBSD_Version and a fix-up on the patches that already landed. > > > > For point #4, this seems like the type of breakage we should be > > documenting in release notes or something for the eventual upgrading > > of systems to 12.0. All usage of _limits stuff in custom rc scripts > > need to be audited, and all rc.conf(5)'s need to be scrubbed for > > ${name}_limits usage that doesn't make sense with the new context. I'm > > not sure what the most appropriate action here is, or what we should > > do this far ahead of time for such a thing. > > > > If this sounds like a good path forward, I'll execute #1 and #2 in the > > morning (CST, so ~11 hours from this e-mail being sent). > > > > This still doesn't fix the issue of some early start up scripts > depending on stuff that's not available yet, when for instance /usr is > on a separate FS (which was the normal way to set up a system way back > when). The words "way back when" is become less needed. With the advent of hypervisors, 100GbE and NVMe over fabric the idea of sharing /usr across a whole cluster of VM's is become more desireable. 1 copy of /usr shared from a memory file system via fast network technologies has advantages. > This issue was first noticed more than 2 years ago, so someone did > notice the breakage. It just hasn't been fixed for an entire release cycle. > Regards One thing that is not helping the bit rot is that some reworking of /etc/rc* stuff has caused it to now ignore most errors from my things, and that just causes a message on the console that no one is reading so when something gets broke it a) doesnt get noticed cause thier machine just boots, and b) doesnt get fixed cause few are actually effected by the caused error. If you are willing to help me weed out the failure modes, I am willing to try and mount an effort, along with others, to try and get us back on track. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Apr 10 15:17:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 786ADF8004D; Tue, 10 Apr 2018 15:17:39 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA0B853D1; Tue, 10 Apr 2018 15:17:39 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id o4so14097639iod.3; Tue, 10 Apr 2018 08:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7ZG8VPnm7ia40tPK+biKdB0HSXwTeSWZl/Jh539jx9M=; b=mYreIj9gyoM6FnO9TpR3FQqzA+HD+e2fyPJR2ykhYIVQpigbBGe/6Gy0ZSxRuZx94d 4QIhtw7uymb4GUWXw3/mgxA8rh0K+WMZwLNTb4AQLQOL97O9MwpxOuCuBYVG54bNWdbl EllAKg/UlguBVXSasZMmjQoxLXbK6rEv0zqGnVdlAeSQLbwdv/hy6tCrsewJIR1D+UcP KtzytywOy584zFKGrajtJYjGP5nmczASF0kPH5CpgzaH3n4EjJHVPNMoWF1/TYcuPnse v6POB4w1z+ItzBTn/IZCC4oatX/o5dSd07FXZzmTyv/Pc/zyNu5rA3dE1vhIOh+hUWz7 ut+g== 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=7ZG8VPnm7ia40tPK+biKdB0HSXwTeSWZl/Jh539jx9M=; b=h41AEwV4eihu7DzyRo+3hQeu6NqKnESKUC+16Ubyed/DixVXw1IX3+1dCoisCEg0Vq V5hKVn3110wj+RFM5piR6t+Kcr9jo8vjzUHa2uskDTLRKb7a1kJW8gvFra41MZlJoLUj VuRMBIh74yA4BaGSvrBw5EuSryJaLl6aAEAU6V06CE6tM2vDFdXzHrn8HN+adjNOKc4g v8iYLSCY4wiaT3Vf98Kk0PpYJW3klgrnVNIBrnBR7AV66M3xbY8k3RsEvKBkaHxlyiAc zXmtlmriEVUbkIfRXwRPOBs63scJWRU7mPgnAa/T9VygF0REwgJkY5PcagRFFt/cxFeF 3X+w== X-Gm-Message-State: ALQs6tDeWv6OPZVuJxvwpb2WLV+EZYHhscjOoW5ytLWJ06Vk9rIGQ+ka pvBxOM4vlcvRr4EK/BTrn8oMiw== X-Google-Smtp-Source: AIpwx492rDXUX7o2M+f1FMMHe2rRBDLRTu9b/78gByz62A5SW914jaerm6jtKcziqJfADJjShD41AQ== X-Received: by 10.107.135.157 with SMTP id r29mr919413ioi.248.1523373458360; Tue, 10 Apr 2018 08:17:38 -0700 (PDT) Received: from raichu (toroon0560w-lp130-04-184-145-252-74.dsl.bell.ca. [184.145.252.74]) by smtp.gmail.com with ESMTPSA id n142-v6sm1023053itn.38.2018.04.10.08.17.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Apr 2018 08:17:37 -0700 (PDT) Sender: Mark Johnston Date: Tue, 10 Apr 2018 11:17:33 -0400 From: Mark Johnston To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332365 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20180410151733.GA64021@raichu> References: <201804101356.w3ADu6Jr072766@repo.freebsd.org> <20180410140957.GG6612@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180410140957.GG6612@zxy.spb.ru> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 15:17:39 -0000 On Tue, Apr 10, 2018 at 05:09:57PM +0300, Slawa Olhovchenkov wrote: > On Tue, Apr 10, 2018 at 01:56:06PM +0000, Mark Johnston wrote: > > > Author: markj > > Date: Tue Apr 10 13:56:06 2018 > > New Revision: 332365 > > URL: https://svnweb.freebsd.org/changeset/base/332365 > > > > Log: > > Set zfs_arc_free_target to v_free_target. > > > > Page daemon output is now regulated by a PID controller with a setpoint > > of v_free_target. Moreover, the page daemon now wakes up regularly > > rather than waiting for a wakeup from another thread. This means that > > the free page count is unlikely to drop below the old > > zfs_arc_free_target value, and as a result the ARC was not readily > > freeing pages under memory pressure. Address the immediate problem by > > updating zfs_arc_free_target to match the page daemon's new behaviour. > > Can you explain some more about new page daemon algo (and reclaim zone > free memory)? The old algorithm was pretty simple: there was a free page target and below that, a wakeup threshold. Any time a thread allocated a page and in so doing caused the free page count to drop below the wakeup threshold, that thread would wake up the page daemon, which would scan the inactive queue and free pages until the free target is reached, or the end of the inactive queue was reached. This is simple and easy to reason about, but has some drawbacks. When memory pressure is constant, it leads to bursts of CPU usage and lock contention. The static watermarks may also be insufficient for some demanding workloads. In particular, the wakeup threshold might be too low, thus allowing the free page count to drop to dangerous levels and triggering expensive memory shortage handling (i.e., VM_WAIT). The new algorithm uses a control loop to dynamically compute a target for each scan of the inactive queue. The loop takes as input the magnitude of the page shortage (v_free_target - v_free_count) and keeps track of the rate of change of this difference (i.e., the rate at which free pages are being consumed) and the sum of this difference over time (i.e., a cumulative value for the magnitude of recent page shortages). These factors are used to compute "shortage", the number of pages to reclaim with the goal of maintaining a free page count of v_free_target. The effect of the new algorithm is that the page daemon runs more frequently but for shorter durations, so its CPU usage is more even. It responds dynamically to the demands of the workload, so the shortcomings of a pair of static watermarks are gone. r329882 doesn't really change anything with respect to reclamation of pages from UMA zones. There are some plans to address shortcomings there in the near future though. > PS: zfs need some more time for free pages from ARC. Also, vanila zfs > have broken logic for count used and free ARC's memory. For most > correctly count system-wide used and free memory need accounting > in-zone free memory. Yes, there is a number of problems in this area predating r329882. This commit is really just a bandaid. From owner-svn-src-all@freebsd.org Tue Apr 10 15:38:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12EF1F81750; Tue, 10 Apr 2018 15:38:17 +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 B33A06B234; Tue, 10 Apr 2018 15:38:16 +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 93F2B77B9; Tue, 10 Apr 2018 15:38:16 +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 w3AFcGO2085682; Tue, 10 Apr 2018 15:38:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AFcGge085681; Tue, 10 Apr 2018 15:38:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101538.w3AFcGge085681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 15:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332377 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 332377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 15:38:17 -0000 Author: kevans Date: Tue Apr 10 15:38:16 2018 New Revision: 332377 URL: https://svnweb.freebsd.org/changeset/base/332377 Log: MFC r328037: Rename 'recv' to 'receive' to appease shadow warnings from GCC. Modified: stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Tue Apr 10 15:19:30 2018 (r332376) +++ stable/11/usr.bin/truss/syscalls.c Tue Apr 10 15:38:16 2018 (r332377) @@ -1291,20 +1291,20 @@ print_sctp_initmsg(FILE *fp, struct sctp_initmsg *init } static void -print_sctp_sndrcvinfo(FILE *fp, bool recv, struct sctp_sndrcvinfo *info) +print_sctp_sndrcvinfo(FILE *fp, bool receive, struct sctp_sndrcvinfo *info) { fprintf(fp, "{sid=%u,", info->sinfo_stream); - if (recv) { + if (receive) { fprintf(fp, "ssn=%u,", info->sinfo_ssn); } fputs("flgs=", fp); sysdecode_sctp_sinfo_flags(fp, info->sinfo_flags); fprintf(fp, ",ppid=%u,", ntohl(info->sinfo_ppid)); - if (!recv) { + if (!receive) { fprintf(fp, "ctx=%u,", info->sinfo_context); fprintf(fp, "ttl=%u,", info->sinfo_timetolive); } - if (recv) { + if (receive) { fprintf(fp, "tsn=%u,", info->sinfo_tsn); fprintf(fp, "cumtsn=%u,", info->sinfo_cumtsn); } @@ -1388,7 +1388,7 @@ print_sctp_ipv6_addr(FILE *fp, struct in6_addr *addr) } static void -print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *cmsghdr) +print_sctp_cmsg(FILE *fp, bool receive, struct cmsghdr *cmsghdr) { void *data; socklen_t len; @@ -1404,7 +1404,7 @@ print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *c break; case SCTP_SNDRCV: if (len == CMSG_LEN(sizeof(struct sctp_sndrcvinfo))) - print_sctp_sndrcvinfo(fp, recv, + print_sctp_sndrcvinfo(fp, receive, (struct sctp_sndrcvinfo *)data); else print_gen_cmsg(fp, cmsghdr); @@ -1466,7 +1466,7 @@ print_sctp_cmsg(FILE *fp, bool recv, struct cmsghdr *c } static void -print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msghdr *msghdr) +print_cmsgs(FILE *fp, pid_t pid, bool receive, struct msghdr *msghdr) { struct cmsghdr *cmsghdr; char *cmsgbuf; @@ -1507,7 +1507,7 @@ print_cmsgs(FILE *fp, pid_t pid, bool recv, struct msg fputs(",data=", fp); switch (level) { case IPPROTO_SCTP: - print_sctp_cmsg(fp, recv, cmsghdr); + print_sctp_cmsg(fp, receive, cmsghdr); break; default: print_gen_cmsg(fp, cmsghdr); From owner-svn-src-all@freebsd.org Tue Apr 10 15:51:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54399F826AB; Tue, 10 Apr 2018 15:51:38 +0000 (UTC) (envelope-from jtl@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 043B96EC5E; Tue, 10 Apr 2018 15:51:38 +0000 (UTC) (envelope-from jtl@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 F1BE27A8A; Tue, 10 Apr 2018 15:51:37 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AFpbI5041501; Tue, 10 Apr 2018 15:51:37 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AFpb1v041499; Tue, 10 Apr 2018 15:51:37 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804101551.w3AFpb1v041499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 10 Apr 2018 15:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332378 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 332378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 15:51:38 -0000 Author: jtl Date: Tue Apr 10 15:51:37 2018 New Revision: 332378 URL: https://svnweb.freebsd.org/changeset/base/332378 Log: Clean up some debugging code left in tcp_log_buf.c from r331347. Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_log_buf.c Modified: head/sys/netinet/tcp_log_buf.c ============================================================================== --- head/sys/netinet/tcp_log_buf.c Tue Apr 10 15:38:16 2018 (r332377) +++ head/sys/netinet/tcp_log_buf.c Tue Apr 10 15:51:37 2018 (r332378) @@ -1667,52 +1667,7 @@ tcp_log_logs_to_buf(struct sockopt *sopt, struct tcp_l #ifdef TCPLOG_DEBUG_COUNTERS counter_u64_add(tcp_log_que_copyout, 1); #endif -#if 0 - struct tcp_log_buffer *lb = &log_entry->tlm_buf; - int i; - printf("lb = %p:\n", lb); -#define PRINT(f) printf(#f " = %u\n", (unsigned int)lb->f) - printf("tlb_tv = {%lu, %lu}\n", lb->tlb_tv.tv_sec, lb->tlb_tv.tv_usec); - PRINT(tlb_ticks); - PRINT(tlb_sn); - PRINT(tlb_stackid); - PRINT(tlb_eventid); - PRINT(tlb_eventflags); - PRINT(tlb_errno); - PRINT(tlb_rxbuf.tls_sb_acc); - PRINT(tlb_rxbuf.tls_sb_ccc); - PRINT(tlb_rxbuf.tls_sb_spare); - PRINT(tlb_txbuf.tls_sb_acc); - PRINT(tlb_txbuf.tls_sb_ccc); - PRINT(tlb_txbuf.tls_sb_spare); - PRINT(tlb_state); - PRINT(tlb_flags); - PRINT(tlb_snd_una); - PRINT(tlb_snd_max); - PRINT(tlb_snd_cwnd); - PRINT(tlb_snd_nxt); - PRINT(tlb_snd_recover); - PRINT(tlb_snd_wnd); - PRINT(tlb_snd_ssthresh); - PRINT(tlb_srtt); - PRINT(tlb_rttvar); - PRINT(tlb_rcv_up); - PRINT(tlb_rcv_adv); - PRINT(tlb_rcv_nxt); - PRINT(tlb_sack_newdata); - PRINT(tlb_rcv_wnd); - PRINT(tlb_dupacks); - PRINT(tlb_segqlen); - PRINT(tlb_snd_numholes); - PRINT(tlb_snd_scale); - PRINT(tlb_rcv_scale); - PRINT(tlb_len); - printf("hex dump: "); - for (i = 0; i < sizeof(struct tcp_log_buffer); i++) - printf("%02x", *(((uint8_t *)lb) + i)); -#undef PRINT -#endif /* * Skip copying out the header if it isn't present. * Instead, copy out zeros (to ensure we don't leak info). From owner-svn-src-all@freebsd.org Tue Apr 10 15:54:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E3EDF82A50; Tue, 10 Apr 2018 15:54:30 +0000 (UTC) (envelope-from jtl@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 1BB1B707EB; Tue, 10 Apr 2018 15:54:30 +0000 (UTC) (envelope-from jtl@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 148D77AD3; Tue, 10 Apr 2018 15:54:30 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AFsTx0048638; Tue, 10 Apr 2018 15:54:29 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AFsTE5048636; Tue, 10 Apr 2018 15:54:29 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804101554.w3AFsTE5048636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 10 Apr 2018 15:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332379 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 332379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 15:54:30 -0000 Author: jtl Date: Tue Apr 10 15:54:29 2018 New Revision: 332379 URL: https://svnweb.freebsd.org/changeset/base/332379 Log: Move the TCP Blackbox Recorder probe in tcp_output.c to be with the other tracing/debugging code. Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Tue Apr 10 15:51:37 2018 (r332378) +++ head/sys/netinet/tcp_output.c Tue Apr 10 15:54:29 2018 (r332379) @@ -1311,10 +1311,6 @@ send: } #endif - /* We're getting ready to send; log now. */ - TCP_LOG_EVENT(tp, th, &so->so_rcv, &so->so_snd, TCP_LOG_OUT, ERRNO_UNK, - len, NULL, false); - /* * Enable TSO and specify the size of the segments. * The TCP pseudo header checksum is always provided. @@ -1362,6 +1358,10 @@ send: } #endif /* TCPDEBUG */ TCP_PROBE3(debug__output, tp, th, m); + + /* We're getting ready to send; log now. */ + TCP_LOG_EVENT(tp, th, &so->so_rcv, &so->so_snd, TCP_LOG_OUT, ERRNO_UNK, + len, NULL, false); /* * Fill in IP length and desired time to live and From owner-svn-src-all@freebsd.org Tue Apr 10 16:02:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D202F8366C; Tue, 10 Apr 2018 16:02:41 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 998FE71483; Tue, 10 Apr 2018 16:02:40 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1f5vjB-000CXN-KT; Tue, 10 Apr 2018 19:02:37 +0300 Date: Tue, 10 Apr 2018 19:02:37 +0300 From: Slawa Olhovchenkov To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332365 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20180410160237.GP4305@zxy.spb.ru> References: <201804101356.w3ADu6Jr072766@repo.freebsd.org> <20180410140957.GG6612@zxy.spb.ru> <20180410151733.GA64021@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180410151733.GA64021@raichu> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 16:02:41 -0000 On Tue, Apr 10, 2018 at 11:17:33AM -0400, Mark Johnston wrote: > On Tue, Apr 10, 2018 at 05:09:57PM +0300, Slawa Olhovchenkov wrote: > > On Tue, Apr 10, 2018 at 01:56:06PM +0000, Mark Johnston wrote: > > > > > Author: markj > > > Date: Tue Apr 10 13:56:06 2018 > > > New Revision: 332365 > > > URL: https://svnweb.freebsd.org/changeset/base/332365 > > > > > > Log: > > > Set zfs_arc_free_target to v_free_target. > > > > > > Page daemon output is now regulated by a PID controller with a setpoint > > > of v_free_target. Moreover, the page daemon now wakes up regularly > > > rather than waiting for a wakeup from another thread. This means that > > > the free page count is unlikely to drop below the old > > > zfs_arc_free_target value, and as a result the ARC was not readily > > > freeing pages under memory pressure. Address the immediate problem by > > > updating zfs_arc_free_target to match the page daemon's new behaviour. > > > > Can you explain some more about new page daemon algo (and reclaim zone > > free memory)? > > The old algorithm was pretty simple: there was a free page target and > below that, a wakeup threshold. Any time a thread allocated a page and > in so doing caused the free page count to drop below the wakeup > threshold, that thread would wake up the page daemon, which would scan > the inactive queue and free pages until the free target is reached, or > the end of the inactive queue was reached. > > This is simple and easy to reason about, but has some drawbacks. When > memory pressure is constant, it leads to bursts of CPU usage and lock > contention. The static watermarks may also be insufficient for some > demanding workloads. In particular, the wakeup threshold might be too > low, thus allowing the free page count to drop to dangerous levels and > triggering expensive memory shortage handling (i.e., VM_WAIT). > > The new algorithm uses a control loop to dynamically compute a target > for each scan of the inactive queue. The loop takes as input the > magnitude of the page shortage (v_free_target - v_free_count) and keeps > track of the rate of change of this difference (i.e., the rate at which > free pages are being consumed) and the sum of this difference over time > (i.e., a cumulative value for the magnitude of recent page shortages). > These factors are used to compute "shortage", the number of pages to > reclaim with the goal of maintaining a free page count of v_free_target. > > The effect of the new algorithm is that the page daemon runs more > frequently but for shorter durations, so its CPU usage is more even. It > responds dynamically to the demands of the workload, so the shortcomings > of a pair of static watermarks are gone. > > r329882 doesn't really change anything with respect to reclamation of > pages from UMA zones. There are some plans to address shortcomings there > in the near future though. Thank, very nice explain. IMHO, in this case for ZFS best is old zfs_arc_free_target: too close zfs_arc_free_target to vm_cnt.v_free_min can cause too often run arc_target correction and cause CPU consumption and memory subsystem overuse. ZFS need more correct pressure, ZFS-specific, and I am try it in D7538. > > PS: zfs need some more time for free pages from ARC. Also, vanila zfs > > have broken logic for count used and free ARC's memory. For most > > correctly count system-wide used and free memory need accounting > > in-zone free memory. > > Yes, there is a number of problems in this area predating r329882. This > commit is really just a bandaid. From owner-svn-src-all@freebsd.org Tue Apr 10 16:44:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68284F85FE8; Tue, 10 Apr 2018 16:44:41 +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 1BEE07C7F7; Tue, 10 Apr 2018 16:44:41 +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 16EE0102CD; Tue, 10 Apr 2018 16:44:41 +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 w3AGieC9076007; Tue, 10 Apr 2018 16:44:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AGiecB076006; Tue, 10 Apr 2018 16:44:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804101644.w3AGiecB076006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Apr 2018 16:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332380 - stable/11/sys/sparc64/include X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/sparc64/include X-SVN-Commit-Revision: 332380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 16:44:41 -0000 Author: emaste Date: Tue Apr 10 16:44:40 2018 New Revision: 332380 URL: https://svnweb.freebsd.org/changeset/base/332380 Log: MFC r318412: fix sparc64 build by restoring 'register' in pcpu.h Modified: stable/11/sys/sparc64/include/pcpu.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sparc64/include/pcpu.h ============================================================================== --- stable/11/sys/sparc64/include/pcpu.h Tue Apr 10 15:54:29 2018 (r332379) +++ stable/11/sys/sparc64/include/pcpu.h Tue Apr 10 16:44:40 2018 (r332380) @@ -71,8 +71,8 @@ extern void *dpcpu0; struct pcb; struct pcpu; -struct pcb *curpcb __asm__(__XSTRING(PCB_REG)); -struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG)); +register struct pcb *curpcb __asm__(__XSTRING(PCB_REG)); +register struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG)); #define PCPU_GET(member) (pcpup->pc_ ## member) From owner-svn-src-all@freebsd.org Tue Apr 10 16:59:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF686F86EEE; Tue, 10 Apr 2018 16:59:36 +0000 (UTC) (envelope-from jtl@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 9FB6E7F931; Tue, 10 Apr 2018 16:59:36 +0000 (UTC) (envelope-from jtl@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 92D7310477; Tue, 10 Apr 2018 16:59:36 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AGxaon005257; Tue, 10 Apr 2018 16:59:36 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AGxa9d005256; Tue, 10 Apr 2018 16:59:36 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804101659.w3AGxa9d005256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 10 Apr 2018 16:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332381 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 332381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 16:59:37 -0000 Author: jtl Date: Tue Apr 10 16:59:36 2018 New Revision: 332381 URL: https://svnweb.freebsd.org/changeset/base/332381 Log: Modify the net.inet.tcp.function_ids sysctl introduced in r331347. Export additional information which may be helpful to userspace consumers and rename the sysctl to net.inet.tcp.function_info. Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Apr 10 16:44:40 2018 (r332380) +++ head/sys/netinet/tcp_subr.c Tue Apr 10 16:59:36 2018 (r332381) @@ -255,6 +255,7 @@ static struct tcp_function_block tcp_def_funcblk = { }; int t_functions_inited = 0; +static int tcp_fb_cnt = 0; struct tcp_funchead t_functions; static struct tcp_function_block *tcp_func_set_ptr = &tcp_def_funcblk; @@ -426,14 +427,14 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, functions_availab "list available TCP Function sets"); /* - * Exports one (struct tcp_function_id) for each non-alias. + * Exports one (struct tcp_function_info) for each alias/name. */ static int -sysctl_net_inet_list_func_ids(SYSCTL_HANDLER_ARGS) +sysctl_net_inet_list_func_info(SYSCTL_HANDLER_ARGS) { - int error, cnt; + int cnt, error; struct tcp_function *f; - struct tcp_function_id tfi; + struct tcp_function_info tfi; /* * We don't allow writes. @@ -452,21 +453,32 @@ sysctl_net_inet_list_func_ids(SYSCTL_HANDLER_ARGS) } /* - * Walk the list, comparing the name of the function entry and - * function block to determine which is an alias. - * If exporting the list, copy out matching entries. Otherwise, - * just record the total length. + * Walk the list and copy out matching entries. If INVARIANTS + * is compiled in, also walk the list to verify the length of + * the list matches what we have recorded. */ - cnt = 0; rw_rlock(&tcp_function_lock); +#ifdef INVARIANTS + cnt = 0; +#else + if (req->oldptr == NULL) { + cnt = tcp_fb_cnt; + goto skip_loop; + } +#endif TAILQ_FOREACH(f, &t_functions, tf_next) { - if (strncmp(f->tf_name, f->tf_fb->tfb_tcp_block_name, - TCP_FUNCTION_NAME_LEN_MAX)) - continue; +#ifdef INVARIANTS + cnt++; +#endif if (req->oldptr != NULL) { + tfi.tfi_refcnt = f->tf_fb->tfb_refcnt; tfi.tfi_id = f->tf_fb->tfb_id; - (void)strncpy(tfi.tfi_name, f->tf_name, + (void)strncpy(tfi.tfi_alias, f->tf_name, TCP_FUNCTION_NAME_LEN_MAX); + tfi.tfi_alias[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; + (void)strncpy(tfi.tfi_name, + f->tf_fb->tfb_tcp_block_name, + TCP_FUNCTION_NAME_LEN_MAX); tfi.tfi_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; error = SYSCTL_OUT(req, &tfi, sizeof(tfi)); /* @@ -474,20 +486,24 @@ sysctl_net_inet_list_func_ids(SYSCTL_HANDLER_ARGS) * mechanism we use to accumulate length * information if the buffer was too short. */ - } else - cnt++; + } } + KASSERT(cnt == tcp_fb_cnt, + ("%s: cnt (%d) != tcp_fb_cnt (%d)", __func__, cnt, tcp_fb_cnt)); +#ifndef INVARIANTS +skip_loop: +#endif rw_runlock(&tcp_function_lock); if (req->oldptr == NULL) error = SYSCTL_OUT(req, NULL, - (cnt + 1) * sizeof(struct tcp_function_id)); + (cnt + 1) * sizeof(struct tcp_function_info)); return (error); } -SYSCTL_PROC(_net_inet_tcp, OID_AUTO, function_ids, +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, function_info, CTLTYPE_OPAQUE | CTLFLAG_SKIP | CTLFLAG_RD | CTLFLAG_MPSAFE, - NULL, 0, sysctl_net_inet_list_func_ids, "S,tcp_function_id", + NULL, 0, sysctl_net_inet_list_func_info, "S,tcp_function_info", "List TCP function block name-to-ID mappings"); /* @@ -653,6 +669,7 @@ register_tcp_functions_as_names(struct tcp_function_bl (void)strncpy(n->tf_name, names[i], TCP_FUNCTION_NAME_LEN_MAX); n->tf_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; TAILQ_INSERT_TAIL(&t_functions, n, tf_next); + tcp_fb_cnt++; rw_wunlock(&tcp_function_lock); } return(0); @@ -669,6 +686,7 @@ cleanup: if (!strncmp(n->tf_name, names[i], TCP_FUNCTION_NAME_LEN_MAX)) { TAILQ_REMOVE(&t_functions, n, tf_next); + tcp_fb_cnt--; n->tf_fb = NULL; free(n, M_TCPFUNCTIONS); break; @@ -739,6 +757,7 @@ deregister_tcp_functions(struct tcp_function_block *bl while (find_tcp_fb_locked(blk, &f) != NULL) { /* Found */ TAILQ_REMOVE(&t_functions, f, tf_next); + tcp_fb_cnt--; f->tf_fb = NULL; free(f, M_TCPFUNCTIONS); error = 0; From owner-svn-src-all@freebsd.org Tue Apr 10 17:00:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B84FF870EE; Tue, 10 Apr 2018 17:00:38 +0000 (UTC) (envelope-from jtl@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 F1FF97FD79; Tue, 10 Apr 2018 17:00:37 +0000 (UTC) (envelope-from jtl@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 EC5001048B; Tue, 10 Apr 2018 17:00:37 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AH0bnw007037; Tue, 10 Apr 2018 17:00:37 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AH0b4X007036; Tue, 10 Apr 2018 17:00:37 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804101700.w3AH0b4X007036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 10 Apr 2018 17:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332382 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 332382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 17:00:38 -0000 Author: jtl Date: Tue Apr 10 17:00:37 2018 New Revision: 332382 URL: https://svnweb.freebsd.org/changeset/base/332382 Log: Add missing header change from r332381. Sponsored by: Netflix, Inc. Pointy hat: jtl Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Apr 10 16:59:36 2018 (r332381) +++ head/sys/netinet/tcp_var.h Tue Apr 10 17:00:37 2018 (r332382) @@ -688,11 +688,14 @@ void tcp_inptoxtp(const struct inpcb *, struct xtcpcb #endif /* - * TCP function name-to-id mapping exported to user-land via sysctl(3). + * TCP function information (name-to-id mapping, aliases, and refcnt) + * exported to user-land via sysctl(3). */ -struct tcp_function_id { +struct tcp_function_info { + uint32_t tfi_refcnt; uint8_t tfi_id; char tfi_name[TCP_FUNCTION_NAME_LEN_MAX]; + char tfi_alias[TCP_FUNCTION_NAME_LEN_MAX]; }; /* From owner-svn-src-all@freebsd.org Tue Apr 10 17:32:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E97C7F89B16; Tue, 10 Apr 2018 17:32:27 +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 9DA258787B; Tue, 10 Apr 2018 17:32:27 +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 98B5810AD6; Tue, 10 Apr 2018 17:32:27 +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 w3AHWRSe071985; Tue, 10 Apr 2018 17:32:27 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AHWRER071984; Tue, 10 Apr 2018 17:32:27 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804101732.w3AHWRER071984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 10 Apr 2018 17:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332383 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 332383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 17:32:28 -0000 Author: jhibbits Date: Tue Apr 10 17:32:27 2018 New Revision: 332383 URL: https://svnweb.freebsd.org/changeset/base/332383 Log: Call through powerpc_interrupt for all Book-E interrupts Make int_external_input, int_decrementer, and int_performance_counter all now use trap_common, just like on AIM. The effects of this are: * All traps are now properly displayed in ddb. Previously traps from external input, decrementer, and performance counters, would display as just basic stack traces. Now the frame is displayed. * External interrupts are now handled with interrupts enabled, so handling can be preempted. This seems to fix a hang found post-r329882. Modified: head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Tue Apr 10 17:00:37 2018 (r332382) +++ head/sys/powerpc/booke/trap_subr.S Tue Apr 10 17:32:27 2018 (r332383) @@ -563,11 +563,7 @@ INTERRUPT(int_instr_storage) INTERRUPT(int_external_input) STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_EXI) - GET_TOCBASE(%r2) - addi %r3, %r1, CALLSIZE - bl CNAME(powerpc_interrupt) - TOC_RESTORE - b trapexit + b trap_common INTERRUPT(int_alignment) @@ -603,11 +599,7 @@ INTERRUPT(int_syscall) INTERRUPT(int_decrementer) STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_DECR) - GET_TOCBASE(%r2) - addi %r3, %r1, CALLSIZE - bl CNAME(powerpc_interrupt) - TOC_RESTORE - b trapexit + b trap_common /***************************************************************************** @@ -653,11 +645,7 @@ INTERRUPT(int_vecast) INTERRUPT(int_performance_counter) STANDARD_PROLOG(SPR_SPRG3, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) FRAME_SETUP(SPR_SPRG3, PC_TEMPSAVE, EXC_PERF) - GET_TOCBASE(%r2) - addi %r3, %r1, CALLSIZE - bl CNAME(powerpc_interrupt) - TOC_RESTORE - b trapexit + b trap_common #endif @@ -1002,7 +990,7 @@ trap_common: /* Call C trap dispatcher */ GET_TOCBASE(%r2) addi %r3, %r1, CALLSIZE - bl CNAME(trap) + bl CNAME(powerpc_interrupt) TOC_RESTORE .globl CNAME(trapexit) /* exported for db_backtrace use */ From owner-svn-src-all@freebsd.org Tue Apr 10 17:40:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C60E0F8A67B; Tue, 10 Apr 2018 17:40:44 +0000 (UTC) (envelope-from gjb@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 793F76AB88; Tue, 10 Apr 2018 17:40:44 +0000 (UTC) (envelope-from gjb@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 741B510B02; Tue, 10 Apr 2018 17:40:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AHeiVu084094; Tue, 10 Apr 2018 17:40:44 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AHeiaq084093; Tue, 10 Apr 2018 17:40:44 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201804101740.w3AHeiaq084093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 10 Apr 2018 17:40:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332384 - head/release/arm64 X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/arm64 X-SVN-Commit-Revision: 332384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 17:40:44 -0000 Author: gjb Date: Tue Apr 10 17:40:44 2018 New Revision: 332384 URL: https://svnweb.freebsd.org/changeset/base/332384 Log: Following r331292, many of the files (such as the LICENSE file) have moved from the u-boot-rpi3 share directory to the default rpi-firmware share directory. Remove the files from UBOOT_FILES and append the DTB file to a DTB_FILES list so the correct path is used, fixing a build failure. Sponsored by: The FreeBSD Foundation Modified: head/release/arm64/RPI3.conf Modified: head/release/arm64/RPI3.conf ============================================================================== --- head/release/arm64/RPI3.conf Tue Apr 10 17:32:27 2018 (r332383) +++ head/release/arm64/RPI3.conf Tue Apr 10 17:40:44 2018 (r332384) @@ -22,9 +22,10 @@ export BOARDNAME="RPI3" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi3" - UBOOT_FILES="LICENCE.broadcom README armstub8.bin bootcode.bin config.txt \ - fixup.dat fixup_cd.dat fixup_x.dat start.elf start_cd.elf \ - start_x.elf u-boot.bin" + UBOOT_FILES="README u-boot.bin" + DTB_FILES="armstub8.bin bootcode.bin config.txt fixup_cd.dat \ + fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \ + start_cd.elf start_db.elf start_x.elf start.elf ${DTB}" FATMOUNT="${DESTDIR%${KERNEL}}fat" UFSMOUNT="${DESTDIR%${KERNEL}}ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" @@ -34,7 +35,10 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ ${FATMOUNT}/${_UF} done - chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${DTB} ${FATMOUNT}/${DTB} + for _DF in ${DTB_FILES}; do + chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \ + ${FATMOUNT}/${_DF} + done chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays for _OL in ${OVERLAYS}; do chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \ From owner-svn-src-all@freebsd.org Tue Apr 10 17:42:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFAE3F8AA0D for ; Tue, 10 Apr 2018 17:42:00 +0000 (UTC) (envelope-from neha@credible.com) Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 775896AF85 for ; Tue, 10 Apr 2018 17:42:00 +0000 (UTC) (envelope-from neha@credible.com) Received: by mail-qk0-x242.google.com with SMTP id g7so14285691qkm.1 for ; Tue, 10 Apr 2018 10:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=credible-com.20150623.gappssmtp.com; s=20150623; h=date:to:from:reply-to:subject:message-id:mime-version :content-transfer-encoding; bh=X+YwLKrCpSYIG7ggahXsynQxGek9bT4bS6y8u+/2gRE=; b=anmppsDaGOsS3vf/U5CbmsjsHpudLarvmt6GyG3V2srTggm9np3hsC/u0CweGiaZIj EQV/0lwftfw5rxMTjzDrFlPKWbbHcXhLGNBDRw1k4lxU8Pak1s+Ga7Zgs2+gCG1SpLPI Lpd/gSH4JMPLlTh32BYgPlvL2AsB1giQSD7A3POjJcLaeAcLTzIPZAKmB3STj4m3CS+/ 1c5yFZTIMjsxqNRfgc5HDss01VBIi+1nxkZkpiXliyxdy2YGncTRzF2LmljKeL4Gge12 2NdTKtIxujPMqoglwD0s2hMledEMaZnuBPRh9OtgPaF34scdvdaaZK1/283A2z/lmTGk t6uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:to:from:reply-to:subject:message-id :mime-version:content-transfer-encoding; bh=X+YwLKrCpSYIG7ggahXsynQxGek9bT4bS6y8u+/2gRE=; b=BZuv3PjQhMtpMMO0L2z4SpfS3+xBO4toKrbpJ2UbNAzi7WKql8EOKNwG+WGwPv7TIz Kdxu6PU6onmbNzVg8ufUFMVtPk3B6Q2eHZtj9sWadaxqeQTdiR7Jljyn6f+aOm02514p I+hlKDi6WVBBpACd5ryPtPFaxjl2zAPXrZAvh5odg/mtrIynPbgeW6tUr7jyVp4biZju 8fwSKrYLm2P1qHXKr2udXsOpqOqt18V21cLt8lKGC+HJDQQj6EfiSyLuYfGIv/ajaUW1 KfMm5vC2FiIXFBedvFEq33GQqgfKXLdCdrDkbfh0ll/EGLVoi/JPofcVQOkbZaEaAXc6 XCTQ== X-Gm-Message-State: ALQs6tDz9EbiJrHgOmqfwj+JrfKQdsmM/b8HCPKJQQhrgM7mDkzfGwGw jEMKbdt4oJUcaMlyOLabxSNN4rwQEFIp8T72k7Kwptn4+yZ9lbak3DlZM7jt65OMrX0EM8ND37q +tAzlaDKrd3VJjuXSdXuWIGXjV3i8Ovd8y2XnfuTHj6k7j6CGwpM6FSCUeQ2gd5t90g== X-Google-Smtp-Source: AIpwx4/4McYjLMHW/7uEJjrMo0H9h+NURA6EXcHTAFs7Vk2GUqYcByYAQjZjHwpk2SvWnUa2Y3OhMg== X-Received: by 10.55.222.16 with SMTP id h16mr2016652qkj.40.1523382119726; Tue, 10 Apr 2018 10:41:59 -0700 (PDT) Received: from credible.com (ec2-54-81-0-34.compute-1.amazonaws.com. [54.81.0.34]) by smtp.gmail.com with ESMTPSA id z3sm2369560qki.5.2018.04.10.10.41.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Apr 2018 10:41:58 -0700 (PDT) Date: Tue, 10 Apr 2018 17:41:58 +0000 To: svn-src-all@freebsd.org From: Neha Chhabdiya Reply-To: Neha Chhabdiya Subject: Re: New study: the best & worst states at managing debt Message-ID: <16776324.or_mail@credible.com> X-Priority: 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 17:42:01 -0000 Hi there, Just following up because I didn’t hear back from you. Do you have a quick minute to check out our report? Here it is: https://www.credible.com/blog/best-worst-states-managing-debt/ I’m trying to spread the word and would love to share it with your audience. If you're interested, I could even write a personalized introduction to pair with it for you. What do you think of these survey results? Thanks, Neha -------- Community Manager p: 866-540-6005 e: neha@credible.com w: credible.com On Fri, Apr 6, 2018 at 5:45 PM, Neha Chhabdiya wrote: Hi there, Debt is a major issue many Americans face today and we wanted to find out where people are faring the worst. I wanted to share this new analysis from Credible because you’ve touched on debt in the past. Here are a few highlights of the best and worst states at managing debt: On average, people in Michigan have the least debt relative to the income they make Hawaii has the highest average debt-to-income ratio of all states On average, borrowers are paying nearly $1,500 on monthly credit card bills, student loan debt, and housing costs I think it would be really interesting to see how your audience would respond to that. Will you let me know what you think of this piece? :) I can even send you a quick line of code to embed a map on your site if you’re interested. Thanks, Neha -------- Neha Chhabdiya Community Manager p: 866-540-6005 e: neha@credible.com w: credible.comDon't want emails from us anymore? Reply to this email with the word "UNSUBSCRIBE" in the subject line. Credible Labs Inc., 101 Green Street Level 2, San Francisco California, 94111, United States Don't want emails from us anymore? Reply to this email with the word "UNSUBSCRIBE" in the subject line. Credible Labs Inc., 101 Green Street Level 2, San Francisco California, 94111, United States From owner-svn-src-all@freebsd.org Tue Apr 10 18:05:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A46ADF8C1B0; Tue, 10 Apr 2018 18:05:03 +0000 (UTC) (envelope-from dexuan@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 5619A6FF77; Tue, 10 Apr 2018 18:05:03 +0000 (UTC) (envelope-from dexuan@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 50F9B11005; Tue, 10 Apr 2018 18:05:03 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AI533S007921; Tue, 10 Apr 2018 18:05:03 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AI53lb007920; Tue, 10 Apr 2018 18:05:03 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201804101805.w3AI53lb007920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Tue, 10 Apr 2018 18:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332385 - head/sys/dev/hyperv/storvsc X-SVN-Group: head X-SVN-Commit-Author: dexuan X-SVN-Commit-Paths: head/sys/dev/hyperv/storvsc X-SVN-Commit-Revision: 332385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 18:05:03 -0000 Author: dexuan Date: Tue Apr 10 18:05:02 2018 New Revision: 332385 URL: https://svnweb.freebsd.org/changeset/base/332385 Log: hyperv/storvsc: storvsc_io_done(): do not use CAM_SEL_TIMEOUT CAM_SEL_TIMEOUT was introduced in https://reviews.freebsd.org/D7521 (r304251), which claimed: "VM shall response to CAM layer with CAM_SEL_TIMEOUT to filter those invalid LUNs. Never use CAM_DEV_NOT_THERE which will block LUN scan for LUN number higher than 7." But it turns out this is not correct: I think what really filters the invalid LUNs in r304251 is that: before r304251, we could set the CAM_REQ_CMP without checking vm_srb->srb_status at all: ccb->ccb_h.status |= CAM_REQ_CMP. r304251 checks vm_srb->srb_status and sets ccb->ccb_h.status properly, so the invalid LUNs are filtered. I changed my code version to r304251 but replaced the CAM_SEL_TIMEOUT with CAM_DEV_NOT_THERE, and I confirmed the invalid LUNs can also be filtered, and I successfully hot-added and hot-removed 8 disks to/from the VM without any issue. CAM_SEL_TIMEOUT has an unwanted side effect -- see cam_periph_error(): For a selection timeout, we consider all of the LUNs on the target to be gone. If the status is CAM_DEV_NOT_THERE, then we only get rid of the device(s) specified by the path in the original CCB. This means: for a VM with a valid LUN on 3:0:0:0, when the VM inquires 3:0:0:1 and the host reports 3:0:0:1 doesn't exist and storvsc returns CAM_SEL_TIMEOUT to the CAM layer, CAM will detech 3:0:0:0 as well: this is the bug I reported recently: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226583 PR: 226583 Reviewed by: mav MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D14690 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 10 17:40:44 2018 (r332384) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 10 18:05:02 2018 (r332385) @@ -2173,20 +2173,7 @@ storvsc_io_done(struct hv_storvsc_request *reqp) scsi_op_desc(cmd->opcode, NULL)); } } - - /* - * XXX For a selection timeout, all of the LUNs - * on the target will be gone. It works for SCSI - * disks, but does not work for IDE disks. - * - * For CAM_DEV_NOT_THERE, CAM will only get - * rid of the device(s) specified by the path. - */ - if (storvsc_get_storage_type(sc->hs_dev) == - DRIVER_STORVSC) - ccb->ccb_h.status |= CAM_SEL_TIMEOUT; - else - ccb->ccb_h.status |= CAM_DEV_NOT_THERE; + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; } else { ccb->ccb_h.status |= CAM_REQ_CMP; } From owner-svn-src-all@freebsd.org Tue Apr 10 18:39:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23ECFF8ED73; Tue, 10 Apr 2018 18:39:21 +0000 (UTC) (envelope-from ram@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 C669E79DE8; Tue, 10 Apr 2018 18:39:20 +0000 (UTC) (envelope-from ram@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 C15511152C; Tue, 10 Apr 2018 18:39:20 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AIdKfD026213; Tue, 10 Apr 2018 18:39:20 GMT (envelope-from ram@FreeBSD.org) Received: (from ram@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AIdKZk026212; Tue, 10 Apr 2018 18:39:20 GMT (envelope-from ram@FreeBSD.org) Message-Id: <201804101839.w3AIdKZk026212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ram set sender to ram@FreeBSD.org using -f From: Ram Kishore Vegesna Date: Tue, 10 Apr 2018 18:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332386 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: ram X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 332386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 18:39:21 -0000 Author: ram Date: Tue Apr 10 18:39:20 2018 New Revision: 332386 URL: https://svnweb.freebsd.org/changeset/base/332386 Log: Updated mentors information. Approved by: ken, mav Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Apr 10 18:05:02 2018 (r332385) +++ head/share/misc/committers-src.dot Tue Apr 10 18:39:20 2018 (r332386) @@ -76,6 +76,7 @@ nate [label="Nate Willams\nnate@FreeBSD.org\n1993/06/1 njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07\n2008/02/16"] non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\n2000/06/19\n2007/03/06"] onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/07/21\n2008/11/10"] +ram [label="Ram Kishore Vegesna\nram@FreeBSD.org\n2018/04/04\n???/??/??"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31\n2012/07/23"] randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20\n2012/05/10"] rink [label="Rink Springer\nrink@FreeBSD.org\n2006/01/16\n2010/11/04"] @@ -629,6 +630,7 @@ kan -> kib ken -> asomers ken -> chuck +ken -> ram ken -> slm kib -> ae @@ -671,6 +673,7 @@ markm -> sheldonh mav -> ae mav -> eugen +mav -> ram mdf -> gleb From owner-svn-src-all@freebsd.org Tue Apr 10 19:18:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68D51F91A02; Tue, 10 Apr 2018 19:18:20 +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 150CF830B1; Tue, 10 Apr 2018 19:18:20 +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 0FCEA11BC1; Tue, 10 Apr 2018 19:18:20 +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 w3AJIJXs049220; Tue, 10 Apr 2018 19:18:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AJIG62049183; Tue, 10 Apr 2018 19:18:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804101918.w3AJIG62049183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 10 Apr 2018 19:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332387 - in head/sys/geom: . bde cache concat eli gate journal label linux_lvm mirror mountver multipath nop part raid3 shsec stripe uzip vinum virstor zero X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys/geom: . bde cache concat eli gate journal label linux_lvm mirror mountver multipath nop part raid3 shsec stripe uzip vinum virstor zero X-SVN-Commit-Revision: 332387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 19:18:20 -0000 Author: kevans Date: Tue Apr 10 19:18:16 2018 New Revision: 332387 URL: https://svnweb.freebsd.org/changeset/base/332387 Log: Annotate geom modules with MODULE_VERSION GEOM ELI may double ask the password during boot. Once at loader time, and once at init time. This happens due a module loading bug. By default GEOM ELI caches the password in the kernel, but without the MODULE_VERSION annotation, the kernel loads over the kernel module, even if the GEOM ELI was compiled into the kernel. In this case, the newly loaded module purges/invalidates/overwrites the GEOM ELI's password cache, which causes the double asking. MFC Note: There's a pc98 component to the original submission that is omitted here due to pc98 removal in head. This part will need to be revived upon MFC. Reviewed by: imp Submitted by: op Obtained from: opBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14992 Modified: head/sys/geom/bde/g_bde.c head/sys/geom/cache/g_cache.c head/sys/geom/concat/g_concat.c head/sys/geom/eli/g_eli.c head/sys/geom/gate/g_gate.c head/sys/geom/geom_bsd.c head/sys/geom/geom_ccd.c head/sys/geom/geom_fox.c head/sys/geom/geom_map.c head/sys/geom/geom_mbr.c head/sys/geom/geom_redboot.c head/sys/geom/geom_sunlabel.c head/sys/geom/geom_vol_ffs.c head/sys/geom/journal/g_journal_ufs.c head/sys/geom/label/g_label.c head/sys/geom/linux_lvm/g_linux_lvm.c head/sys/geom/mirror/g_mirror.c head/sys/geom/mountver/g_mountver.c head/sys/geom/multipath/g_multipath.c head/sys/geom/nop/g_nop.c head/sys/geom/part/g_part_apm.c head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_bsd64.c head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_ldm.c head/sys/geom/part/g_part_mbr.c head/sys/geom/part/g_part_vtoc8.c head/sys/geom/raid3/g_raid3.c head/sys/geom/shsec/g_shsec.c head/sys/geom/stripe/g_stripe.c head/sys/geom/uzip/g_uzip.c head/sys/geom/vinum/geom_vinum.c head/sys/geom/virstor/g_virstor.c head/sys/geom/zero/g_zero.c Modified: head/sys/geom/bde/g_bde.c ============================================================================== --- head/sys/geom/bde/g_bde.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/bde/g_bde.c Tue Apr 10 19:18:16 2018 (r332387) @@ -292,3 +292,4 @@ static struct g_class g_bde_class = { }; DECLARE_GEOM_CLASS(g_bde_class, g_bde); +MODULE_VERSION(geom_bde, 0); Modified: head/sys/geom/cache/g_cache.c ============================================================================== --- head/sys/geom/cache/g_cache.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/cache/g_cache.c Tue Apr 10 19:18:16 2018 (r332387) @@ -1016,3 +1016,4 @@ g_cache_dumpconf(struct sbuf *sb, const char *indent, } DECLARE_GEOM_CLASS(g_cache_class, g_cache); +MODULE_VERSION(geom_cache, 0); Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/concat/g_concat.c Tue Apr 10 19:18:16 2018 (r332387) @@ -993,3 +993,4 @@ g_concat_dumpconf(struct sbuf *sb, const char *indent, } DECLARE_GEOM_CLASS(g_concat_class, g_concat); +MODULE_VERSION(geom_concat, 0); Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/eli/g_eli.c Tue Apr 10 19:18:16 2018 (r332387) @@ -1333,3 +1333,4 @@ g_eli_fini(struct g_class *mp) DECLARE_GEOM_CLASS(g_eli_class, g_eli); MODULE_DEPEND(g_eli, crypto, 1, 1, 1); +MODULE_VERSION(geom_eli, 0); Modified: head/sys/geom/gate/g_gate.c ============================================================================== --- head/sys/geom/gate/g_gate.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/gate/g_gate.c Tue Apr 10 19:18:16 2018 (r332387) @@ -964,3 +964,4 @@ static moduledata_t g_gate_module = { }; DECLARE_MODULE(geom_gate, g_gate_module, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); DECLARE_GEOM_CLASS(g_gate_class, g_gate); +MODULE_VERSION(geom_gate, 0); Modified: head/sys/geom/geom_bsd.c ============================================================================== --- head/sys/geom/geom_bsd.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/geom_bsd.c Tue Apr 10 19:18:16 2018 (r332387) @@ -614,3 +614,4 @@ static struct g_class g_bsd_class = { }; DECLARE_GEOM_CLASS(g_bsd_class, g_bsd); +MODULE_VERSION(geom_bsd, 0); Modified: head/sys/geom/geom_ccd.c ============================================================================== --- head/sys/geom/geom_ccd.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/geom_ccd.c Tue Apr 10 19:18:16 2018 (r332387) @@ -936,3 +936,4 @@ static struct g_class g_ccd_class = { }; DECLARE_GEOM_CLASS(g_ccd_class, g_ccd); +MODULE_VERSION(geom_ccd, 0); Modified: head/sys/geom/geom_fox.c ============================================================================== --- head/sys/geom/geom_fox.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/geom_fox.c Tue Apr 10 19:18:16 2018 (r332387) @@ -485,3 +485,4 @@ static struct g_class g_fox_class = { }; DECLARE_GEOM_CLASS(g_fox_class, g_fox); +MODULE_VERSION(geom_fox, 0); Modified: head/sys/geom/geom_map.c ============================================================================== --- head/sys/geom/geom_map.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/geom_map.c Tue Apr 10 19:18:16 2018 (r332387) @@ -407,3 +407,4 @@ static struct g_class g_map_class = { .ctlreq = g_map_config, }; DECLARE_GEOM_CLASS(g_map_class, g_map); +MODULE_VERSION(geom_map, 0); Modified: head/sys/geom/geom_mbr.c ============================================================================== --- head/sys/geom/geom_mbr.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/geom_mbr.c Tue Apr 10 19:18:16 2018 (r332387) @@ -528,3 +528,4 @@ static struct g_class g_mbrext_class = { }; DECLARE_GEOM_CLASS(g_mbrext_class, g_mbrext); +MODULE_VERSION(geom_mbr, 0); Modified: head/sys/geom/geom_redboot.c ============================================================================== --- head/sys/geom/geom_redboot.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/geom_redboot.c Tue Apr 10 19:18:16 2018 (r332387) @@ -357,3 +357,4 @@ static struct g_class g_redboot_class = { .ioctl = g_redboot_ioctl, }; DECLARE_GEOM_CLASS(g_redboot_class, g_redboot); +MODULE_VERSION(geom_redboot, 0); Modified: head/sys/geom/geom_sunlabel.c ============================================================================== --- head/sys/geom/geom_sunlabel.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/geom_sunlabel.c Tue Apr 10 19:18:16 2018 (r332387) @@ -334,3 +334,4 @@ static struct g_class g_sunlabel_class = { }; DECLARE_GEOM_CLASS(g_sunlabel_class, g_sunlabel); +MODULE_VERSION(geom_sunlabel, 0); Modified: head/sys/geom/geom_vol_ffs.c ============================================================================== --- head/sys/geom/geom_vol_ffs.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/geom_vol_ffs.c Tue Apr 10 19:18:16 2018 (r332387) @@ -164,3 +164,4 @@ static struct g_class g_vol_ffs_class = { }; DECLARE_GEOM_CLASS(g_vol_ffs_class, g_vol_ffs); +MODULE_VERSION(geom_vol_ffs, 0); Modified: head/sys/geom/journal/g_journal_ufs.c ============================================================================== --- head/sys/geom/journal/g_journal_ufs.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/journal/g_journal_ufs.c Tue Apr 10 19:18:16 2018 (r332387) @@ -101,3 +101,4 @@ const struct g_journal_desc g_journal_ufs = { }; MODULE_DEPEND(g_journal, ufs, 1, 1, 1); +MODULE_VERSION(geom_journal, 0); Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/label/g_label.c Tue Apr 10 19:18:16 2018 (r332387) @@ -556,3 +556,4 @@ g_label_config(struct gctl_req *req, struct g_class *m } DECLARE_GEOM_CLASS(g_label_class, g_label); +MODULE_VERSION(geom_label, 0); Modified: head/sys/geom/linux_lvm/g_linux_lvm.c ============================================================================== --- head/sys/geom/linux_lvm/g_linux_lvm.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/linux_lvm/g_linux_lvm.c Tue Apr 10 19:18:16 2018 (r332387) @@ -1190,3 +1190,4 @@ static struct g_class g_llvm_class = { }; DECLARE_GEOM_CLASS(g_llvm_class, g_linux_lvm); +MODULE_VERSION(geom_linux_lvm, 0); Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/mirror/g_mirror.c Tue Apr 10 19:18:16 2018 (r332387) @@ -3492,3 +3492,4 @@ g_mirror_fini(struct g_class *mp) } DECLARE_GEOM_CLASS(g_mirror_class, g_mirror); +MODULE_VERSION(geom_mirror, 0); Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/mountver/g_mountver.c Tue Apr 10 19:18:16 2018 (r332387) @@ -660,3 +660,4 @@ g_mountver_fini(struct g_class *mp) } DECLARE_GEOM_CLASS(g_mountver_class, g_mountver); +MODULE_VERSION(geom_mountver, 0); Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/multipath/g_multipath.c Tue Apr 10 19:18:16 2018 (r332387) @@ -1532,3 +1532,4 @@ g_multipath_dumpconf(struct sbuf *sb, const char *inde } DECLARE_GEOM_CLASS(g_multipath_class, g_multipath); +MODULE_VERSION(geom_multipath, 0); Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/nop/g_nop.c Tue Apr 10 19:18:16 2018 (r332387) @@ -717,3 +717,4 @@ g_nop_dumpconf(struct sbuf *sb, const char *indent, st } DECLARE_GEOM_CLASS(g_nop_class, g_nop); +MODULE_VERSION(geom_nop, 0); Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/part/g_part_apm.c Tue Apr 10 19:18:16 2018 (r332387) @@ -107,6 +107,7 @@ static struct g_part_scheme g_part_apm_scheme = { .gps_maxent = 4096, }; G_PART_SCHEME_DECLARE(g_part_apm); +MODULE_VERSION(geom_part_apm, 0); static void swab(char *buf, size_t bufsz) Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/part/g_part_bsd.c Tue Apr 10 19:18:16 2018 (r332387) @@ -113,6 +113,7 @@ static struct g_part_scheme g_part_bsd_scheme = { .gps_bootcodesz = BBSIZE, }; G_PART_SCHEME_DECLARE(g_part_bsd); +MODULE_VERSION(geom_part_bsd, 0); static struct g_part_bsd_alias { uint8_t type; Modified: head/sys/geom/part/g_part_bsd64.c ============================================================================== --- head/sys/geom/part/g_part_bsd64.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/part/g_part_bsd64.c Tue Apr 10 19:18:16 2018 (r332387) @@ -165,6 +165,7 @@ static struct g_part_scheme g_part_bsd64_scheme = { .gps_maxent = MAXPARTITIONS64 }; G_PART_SCHEME_DECLARE(g_part_bsd64); +MODULE_VERSION(geom_part_bsd64, 0); #define EQUUID(a, b) (memcmp(a, b, sizeof(struct uuid)) == 0) static struct uuid bsd64_uuid_unused = GPT_ENT_TYPE_UNUSED; Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/part/g_part_ebr.c Tue Apr 10 19:18:16 2018 (r332387) @@ -128,6 +128,7 @@ static struct g_part_scheme g_part_ebr_scheme = { .gps_maxent = INT_MAX, }; G_PART_SCHEME_DECLARE(g_part_ebr); +MODULE_VERSION(geom_part_ebr, 0); static struct g_part_ebr_alias { u_char typ; Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/part/g_part_gpt.c Tue Apr 10 19:18:16 2018 (r332387) @@ -146,6 +146,7 @@ static struct g_part_scheme g_part_gpt_scheme = { .gps_bootcodesz = MBRSIZE, }; G_PART_SCHEME_DECLARE(g_part_gpt); +MODULE_VERSION(geom_part_gpt, 0); static struct uuid gpt_uuid_apple_apfs = GPT_ENT_TYPE_APPLE_APFS; static struct uuid gpt_uuid_apple_boot = GPT_ENT_TYPE_APPLE_BOOT; Modified: head/sys/geom/part/g_part_ldm.c ============================================================================== --- head/sys/geom/part/g_part_ldm.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/part/g_part_ldm.c Tue Apr 10 19:18:16 2018 (r332387) @@ -363,6 +363,7 @@ static struct g_part_scheme g_part_ldm_scheme = { .gps_entrysz = sizeof(struct g_part_ldm_entry) }; G_PART_SCHEME_DECLARE(g_part_ldm); +MODULE_VERSION(geom_part_ldm, 0); static struct g_part_ldm_alias { u_char typ; Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/part/g_part_mbr.c Tue Apr 10 19:18:16 2018 (r332387) @@ -121,6 +121,7 @@ static struct g_part_scheme g_part_mbr_scheme = { .gps_bootcodesz = MBRSIZE, }; G_PART_SCHEME_DECLARE(g_part_mbr); +MODULE_VERSION(geom_part_mbr, 0); static struct g_part_mbr_alias { u_char typ; Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/part/g_part_vtoc8.c Tue Apr 10 19:18:16 2018 (r332387) @@ -101,6 +101,7 @@ static struct g_part_scheme g_part_vtoc8_scheme = { .gps_maxent = VTOC8_NPARTS, }; G_PART_SCHEME_DECLARE(g_part_vtoc8); +MODULE_VERSION(geom_part_vtoc8, 0); static int vtoc8_parse_type(const char *type, uint16_t *tag) Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/raid3/g_raid3.c Tue Apr 10 19:18:16 2018 (r332387) @@ -3583,3 +3583,4 @@ g_raid3_fini(struct g_class *mp) } DECLARE_GEOM_CLASS(g_raid3_class, g_raid3); +MODULE_VERSION(geom_raid3, 0); Modified: head/sys/geom/shsec/g_shsec.c ============================================================================== --- head/sys/geom/shsec/g_shsec.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/shsec/g_shsec.c Tue Apr 10 19:18:16 2018 (r332387) @@ -836,3 +836,4 @@ g_shsec_dumpconf(struct sbuf *sb, const char *indent, } DECLARE_GEOM_CLASS(g_shsec_class, g_shsec); +MODULE_VERSION(geom_shsec, 0); Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/stripe/g_stripe.c Tue Apr 10 19:18:16 2018 (r332387) @@ -1270,3 +1270,4 @@ g_stripe_dumpconf(struct sbuf *sb, const char *indent, } DECLARE_GEOM_CLASS(g_stripe_class, g_stripe); +MODULE_VERSION(geom_stripe, 0); Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/uzip/g_uzip.c Tue Apr 10 19:18:16 2018 (r332387) @@ -922,3 +922,4 @@ static struct g_class g_uzip_class = { DECLARE_GEOM_CLASS(g_uzip_class, g_uzip); MODULE_DEPEND(g_uzip, zlib, 1, 1, 1); +MODULE_VERSION(geom_uzip, 0); Modified: head/sys/geom/vinum/geom_vinum.c ============================================================================== --- head/sys/geom/vinum/geom_vinum.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/vinum/geom_vinum.c Tue Apr 10 19:18:16 2018 (r332387) @@ -1048,3 +1048,4 @@ static struct g_class g_vinum_class = { }; DECLARE_GEOM_CLASS(g_vinum_class, g_vinum); +MODULE_VERSION(geom_vinum, 0); Modified: head/sys/geom/virstor/g_virstor.c ============================================================================== --- head/sys/geom/virstor/g_virstor.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/virstor/g_virstor.c Tue Apr 10 19:18:16 2018 (r332387) @@ -1891,3 +1891,4 @@ invalid_call(void) } DECLARE_GEOM_CLASS(g_virstor_class, g_virstor); /* Let there be light */ +MODULE_VERSION(geom_virstor, 0); Modified: head/sys/geom/zero/g_zero.c ============================================================================== --- head/sys/geom/zero/g_zero.c Tue Apr 10 18:39:20 2018 (r332386) +++ head/sys/geom/zero/g_zero.c Tue Apr 10 19:18:16 2018 (r332387) @@ -143,3 +143,4 @@ static struct g_class g_zero_class = { }; DECLARE_GEOM_CLASS(g_zero_class, g_zero); +MODULE_VERSION(geom_zero, 0); From owner-svn-src-all@freebsd.org Tue Apr 10 19:23:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A8E3F92241; Tue, 10 Apr 2018 19:23:05 +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 9CF0384D63; Tue, 10 Apr 2018 19:23:00 +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 w3AJMvUY024595; Tue, 10 Apr 2018 12:22:57 -0700 (PDT) (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 w3AJMvSL024594; Tue, 10 Apr 2018 12:22:57 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804101922.w3AJMvSL024594@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332386 - head/share/misc In-Reply-To: <201804101839.w3AIdKZk026212@repo.freebsd.org> To: Ram Kishore Vegesna Date: Tue, 10 Apr 2018 12:22:57 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 19:23:05 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: ram > Date: Tue Apr 10 18:39:20 2018 > New Revision: 332386 > URL: https://svnweb.freebsd.org/changeset/base/332386 > > Log: > Updated mentors information. > > Approved by: ken, mav > > Modified: > head/share/misc/committers-src.dot > > Modified: head/share/misc/committers-src.dot > ============================================================================== > --- head/share/misc/committers-src.dot Tue Apr 10 18:05:02 2018 (r332385) > +++ head/share/misc/committers-src.dot Tue Apr 10 18:39:20 2018 (r332386) > @@ -76,6 +76,7 @@ nate [label="Nate Willams\nnate@FreeBSD.org\n1993/06/1 > njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07\n2008/02/16"] > non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\n2000/06/19\n2007/03/06"] > onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/07/21\n2008/11/10"] > +ram [label="Ram Kishore Vegesna\nram@FreeBSD.org\n2018/04/04\n???/??/??"] ^^^^^^^^^ That should be removed, you only have a start date. Oh and Welcome ram to the project! > rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31\n2012/07/23"] > randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20\n2012/05/10"] > rink [label="Rink Springer\nrink@FreeBSD.org\n2006/01/16\n2010/11/04"] > @@ -629,6 +630,7 @@ kan -> kib > > ken -> asomers > ken -> chuck > +ken -> ram > ken -> slm > > kib -> ae > @@ -671,6 +673,7 @@ markm -> sheldonh > > mav -> ae > mav -> eugen > +mav -> ram > > mdf -> gleb > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Apr 10 19:27:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E578F92779; Tue, 10 Apr 2018 19:27:49 +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 EF125862CD; Tue, 10 Apr 2018 19:27:48 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id A51A11312F; Tue, 10 Apr 2018 19:27:48 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f54.google.com with SMTP id j68-v6so13312555lfg.13; Tue, 10 Apr 2018 12:27:48 -0700 (PDT) X-Gm-Message-State: ALQs6tCOSQWfagosaWPijb64XnYi9j9ZmRcp3kWb+w4Gmm2blLnJeq9f PPR+gIV+O3jO8Bx8SRD+DOZbDl1Ws+fSkDVvOTA= X-Google-Smtp-Source: AIpwx48oFqrxxL8SA2w57xUpv0/wrhIh5brP2Jls4Ho5F4DpI2tWct51q26w6dvVr0HOAbqso3hIrpCc0ry6JNlrx8Q= X-Received: by 2002:a19:9553:: with SMTP id x80-v6mr971331lfd.74.1523388467152; Tue, 10 Apr 2018 12:27:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Tue, 10 Apr 2018 12:27:26 -0700 (PDT) In-Reply-To: <201804101922.w3AJMvSL024594@pdx.rh.CN85.dnsmgr.net> References: <201804101839.w3AIdKZk026212@repo.freebsd.org> <201804101922.w3AJMvSL024594@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Tue, 10 Apr 2018 14:27:26 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332386 - head/share/misc To: "Rodney W. Grimes" Cc: Ram Kishore Vegesna , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 19:27:49 -0000 On Tue, Apr 10, 2018 at 2:22 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: ram >> Date: Tue Apr 10 18:39:20 2018 >> New Revision: 332386 >> URL: https://svnweb.freebsd.org/changeset/base/332386 >> >> Log: >> Updated mentors information. >> >> Approved by: ken, mav >> >> Modified: >> head/share/misc/committers-src.dot >> >> Modified: head/share/misc/committers-src.dot >> ============================================================================== >> --- head/share/misc/committers-src.dot Tue Apr 10 18:05:02 2018 (r332385) >> +++ head/share/misc/committers-src.dot Tue Apr 10 18:39:20 2018 (r332386) >> @@ -76,6 +76,7 @@ nate [label="Nate Willams\nnate@FreeBSD.org\n1993/06/1 >> njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07\n2008/02/16"] >> non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\n2000/06/19\n2007/03/06"] >> onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/07/21\n2008/11/10"] >> +ram [label="Ram Kishore Vegesna\nram@FreeBSD.org\n2018/04/04\n???/??/??"] > ^^^^^^^^^ > That should be removed, you only have a start date. > Oh and Welcome ram to the project! > The entry is also smack dab in the middle of the alumni section, rather than the later 'active' section. =) From owner-svn-src-all@freebsd.org Tue Apr 10 19:42:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 509A8F9390E; Tue, 10 Apr 2018 19:42:51 +0000 (UTC) (envelope-from shurd@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 0421B698D1; Tue, 10 Apr 2018 19:42:51 +0000 (UTC) (envelope-from shurd@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 DAB0E1208D; Tue, 10 Apr 2018 19:42:50 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AJgojE066101; Tue, 10 Apr 2018 19:42:50 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AJgoMF066098; Tue, 10 Apr 2018 19:42:50 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201804101942.w3AJgoMF066098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 10 Apr 2018 19:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332388 - in head/sys: kern net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in head/sys: kern net X-SVN-Commit-Revision: 332388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 19:42:51 -0000 Author: shurd Date: Tue Apr 10 19:42:50 2018 New Revision: 332388 URL: https://svnweb.freebsd.org/changeset/base/332388 Log: Make BPF global lock an SX This allows NIC drivers to sleep on polling config operations. Submitted by: Matthew Macy Reviewed by: shurd Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D14982 Modified: head/sys/kern/subr_witness.c head/sys/net/bpf.c head/sys/net/bpfdesc.h Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Apr 10 19:18:16 2018 (r332387) +++ head/sys/kern/subr_witness.c Tue Apr 10 19:42:50 2018 (r332388) @@ -569,7 +569,7 @@ static struct witness_order_list_entry order_lists[] = /* * BPF */ - { "bpf global lock", &lock_class_mtx_sleep }, + { "bpf global lock", &lock_class_sx }, { "bpf interface lock", &lock_class_rw }, { "bpf cdev lock", &lock_class_mtx_sleep }, { NULL, NULL }, Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Apr 10 19:18:16 2018 (r332387) +++ head/sys/net/bpf.c Tue Apr 10 19:42:50 2018 (r332388) @@ -159,6 +159,9 @@ struct bpf_dltlist32 { #define BIOCSETFNR32 _IOW('B', 130, struct bpf_program32) #endif +#define BPF_LOCK() sx_xlock(&bpf_sx) +#define BPF_UNLOCK() sx_xunlock(&bpf_sx) +#define BPF_LOCK_ASSERT() sx_assert(&bpf_sx, SA_XLOCKED) /* * bpf_iflist is a list of BPF interface structures, each corresponding to a * specific DLT. The same network interface might have several BPF interface @@ -166,7 +169,7 @@ struct bpf_dltlist32 { * frames, ethernet frames, etc). */ static LIST_HEAD(, bpf_if) bpf_iflist, bpf_freelist; -static struct mtx bpf_mtx; /* bpf global lock */ +static struct sx bpf_sx; /* bpf global lock */ static int bpf_bpfd_cnt; static void bpf_attachd(struct bpf_d *, struct bpf_if *); @@ -2821,7 +2824,7 @@ bpf_drvinit(void *unused) { struct cdev *dev; - mtx_init(&bpf_mtx, "bpf global lock", NULL, MTX_DEF); + sx_init(&bpf_sx, "bpf global lock"); LIST_INIT(&bpf_iflist); LIST_INIT(&bpf_freelist); Modified: head/sys/net/bpfdesc.h ============================================================================== --- head/sys/net/bpfdesc.h Tue Apr 10 19:18:16 2018 (r332387) +++ head/sys/net/bpfdesc.h Tue Apr 10 19:42:50 2018 (r332388) @@ -118,9 +118,6 @@ struct bpf_d { #define BPF_PID_REFRESH(bd, td) (bd)->bd_pid = (td)->td_proc->p_pid #define BPF_PID_REFRESH_CUR(bd) (bd)->bd_pid = curthread->td_proc->p_pid -#define BPF_LOCK() mtx_lock(&bpf_mtx) -#define BPF_UNLOCK() mtx_unlock(&bpf_mtx) -#define BPF_LOCK_ASSERT() mtx_assert(&bpf_mtx, MA_OWNED) /* * External representation of the bpf descriptor */ From owner-svn-src-all@freebsd.org Tue Apr 10 19:48:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29676F93E5E; Tue, 10 Apr 2018 19:48:25 +0000 (UTC) (envelope-from shurd@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 D17D36B657; Tue, 10 Apr 2018 19:48:24 +0000 (UTC) (envelope-from shurd@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 CB63A12097; Tue, 10 Apr 2018 19:48:24 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AJmOrO066565; Tue, 10 Apr 2018 19:48:24 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AJmOt2066564; Tue, 10 Apr 2018 19:48:24 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201804101948.w3AJmOt2066564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 10 Apr 2018 19:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332389 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 19:48:25 -0000 Author: shurd Date: Tue Apr 10 19:48:24 2018 New Revision: 332389 URL: https://svnweb.freebsd.org/changeset/base/332389 Log: Split out flag manipulation from general context manipulation in iflib To avoid blocking on the context lock in the swi thread and risk potential deadlocks, this change protects lighter weight updates that only need to be consistent with each other with their own lock. Submitted by: Matthew Macy Reviewed by: shurd Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D14967 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Apr 10 19:42:50 2018 (r332388) +++ head/sys/net/iflib.c Tue Apr 10 19:48:24 2018 (r332389) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2017, Matthew Macy + * Copyright (c) 2014-2018, Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -163,7 +163,8 @@ struct iflib_ctx { if_shared_ctx_t ifc_sctx; struct if_softc_ctx ifc_softc_ctx; - struct mtx ifc_mtx; + struct mtx ifc_ctx_mtx; + struct mtx ifc_state_mtx; uint16_t ifc_nhwtxqs; uint16_t ifc_nhwrxqs; @@ -318,8 +319,10 @@ typedef struct iflib_sw_tx_desc_array { #define IFC_INIT_DONE 0x020 #define IFC_PREFETCH 0x040 #define IFC_DO_RESET 0x080 -#define IFC_CHECK_HUNG 0x100 +#define IFC_DO_WATCHDOG 0x100 +#define IFC_CHECK_HUNG 0x200 + #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) @@ -535,13 +538,19 @@ rxd_info_zero(if_rxd_info_t ri) #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING)) -#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx lock", MTX_DEF) +#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_ctx_mtx, _name, "iflib ctx lock", MTX_DEF) +#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_ctx_mtx) +#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_ctx_mtx) +#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_ctx_mtx) -#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_mtx) -#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_mtx) -#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_mtx) +#define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, _name, "iflib state lock", MTX_DEF) +#define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx) +#define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx) +#define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) + + #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) #define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) @@ -2144,18 +2153,14 @@ iflib_timer(void *arg) if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); return; -hung: - CTX_LOCK(ctx); - if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); + hung: device_printf(ctx->ifc_dev, "TX(%d) desc avail = %d, pidx = %d\n", txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx); - - IFDI_WATCHDOG_RESET(ctx); - ctx->ifc_watchdog_events++; - - ctx->ifc_flags |= IFC_DO_RESET; + STATE_LOCK(ctx); + if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); + ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); iflib_admin_intr_deferred(ctx); - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); } static void @@ -2673,10 +2678,10 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) return true; return (iflib_rxd_avail(ctx, rxq, *cidxp, 1)); err: - CTX_LOCK(ctx); + STATE_LOCK(ctx); ctx->ifc_flags |= IFC_DO_RESET; iflib_admin_intr_deferred(ctx); - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); return (false); } @@ -3706,27 +3711,35 @@ _task_fn_admin(void *context) if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; iflib_txq_t txq; int i; + bool oactive, running, do_reset, do_watchdog; - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) { - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE)) { - return; - } - } + STATE_LOCK(ctx); + running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING); + oactive = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE); + do_reset = (ctx->ifc_flags & IFC_DO_RESET); + do_watchdog = (ctx->ifc_flags & IFC_DO_WATCHDOG); + ctx->ifc_flags &= ~(IFC_DO_RESET|IFC_DO_WATCHDOG); + STATE_UNLOCK(ctx); + if (!running & !oactive) + return; + CTX_LOCK(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) { CALLOUT_LOCK(txq); callout_stop(&txq->ift_timer); CALLOUT_UNLOCK(txq); } + if (do_watchdog) { + ctx->ifc_watchdog_events++; + IFDI_WATCHDOG_RESET(ctx); + } IFDI_UPDATE_ADMIN_STATUS(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); IFDI_LINK_INTR_ENABLE(ctx); - if (ctx->ifc_flags & IFC_DO_RESET) { - ctx->ifc_flags &= ~IFC_DO_RESET; + if (do_reset) iflib_if_init_locked(ctx); - } CTX_UNLOCK(ctx); if (LINK_ACTIVE(ctx) == 0) @@ -3870,15 +3883,15 @@ iflib_if_qflush(if_t ifp) iflib_txq_t txq = ctx->ifc_txqs; int i; - CTX_LOCK(ctx); + STATE_LOCK(ctx); ctx->ifc_flags |= IFC_QFLUSH; - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); for (i = 0; i < NTXQSETS(ctx); i++, txq++) while (!(ifmp_ring_is_idle(txq->ift_br) || ifmp_ring_is_stalled(txq->ift_br))) iflib_txq_check_drain(txq, 0); - CTX_LOCK(ctx); + STATE_LOCK(ctx); ctx->ifc_flags &= ~IFC_QFLUSH; - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); if_qflush(ifp); } @@ -3935,14 +3948,18 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) iflib_stop(ctx); if ((err = IFDI_MTU_SET(ctx, ifr->ifr_mtu)) == 0) { + STATE_LOCK(ctx); if (ifr->ifr_mtu > ctx->ifc_max_fl_buf_size) ctx->ifc_flags |= IFC_MULTISEG; else ctx->ifc_flags &= ~IFC_MULTISEG; + STATE_UNLOCK(ctx); err = if_setmtu(ifp, ifr->ifr_mtu); } iflib_init_locked(ctx); + STATE_LOCK(ctx); if_setdrvflags(ifp, bits); + STATE_UNLOCK(ctx); CTX_UNLOCK(ctx); break; case SIOCSIFFLAGS: @@ -4026,10 +4043,14 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) bits = if_getdrvflags(ifp); if (bits & IFF_DRV_RUNNING) iflib_stop(ctx); + STATE_LOCK(ctx); if_togglecapenable(ifp, setmask); + STATE_UNLOCK(ctx); if (bits & IFF_DRV_RUNNING) iflib_init_locked(ctx); + STATE_LOCK(ctx); if_setdrvflags(ifp, bits); + STATE_UNLOCK(ctx); CTX_UNLOCK(ctx); } break; @@ -5431,9 +5452,11 @@ iflib_link_state_change(if_ctx_t ctx, int link_state, iflib_txq_t txq = ctx->ifc_txqs; if_setbaudrate(ifp, baudrate); - if (baudrate >= IF_Gbps(10)) + if (baudrate >= IF_Gbps(10)) { + STATE_LOCK(ctx); ctx->ifc_flags |= IFC_PREFETCH; - + STATE_UNLOCK(ctx); + } /* If link down, disable watchdog */ if ((ctx->ifc_link_state == LINK_STATE_UP) && (link_state == LINK_STATE_DOWN)) { for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxqsets; i++, txq++) @@ -5492,7 +5515,7 @@ struct mtx * iflib_ctx_lock_get(if_ctx_t ctx) { - return (&ctx->ifc_mtx); + return (&ctx->ifc_ctx_mtx); } static int From owner-svn-src-all@freebsd.org Tue Apr 10 19:49:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78867F93F62; Tue, 10 Apr 2018 19:49:05 +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 25F096BD2A; Tue, 10 Apr 2018 19:49:05 +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 20FAB120A3; Tue, 10 Apr 2018 19:49:05 +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 w3AJn5FO066636; Tue, 10 Apr 2018 19:49:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AJn48R066632; Tue, 10 Apr 2018 19:49:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804101949.w3AJn48R066632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Apr 2018 19:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332390 - in head/release: amd64 arm64 i386 powerpc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/release: amd64 arm64 i386 powerpc X-SVN-Commit-Revision: 332390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 19:49:05 -0000 Author: emaste Date: Tue Apr 10 19:49:04 2018 New Revision: 332390 URL: https://svnweb.freebsd.org/changeset/base/332390 Log: make-memstick.sh: put partition args on separate lines This makes it easier to identify the individual partition types and facilitates comparisons across architectures. Reviewed by: gjb MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/release/amd64/make-memstick.sh head/release/arm64/make-memstick.sh head/release/i386/make-memstick.sh head/release/powerpc/make-memstick.sh Modified: head/release/amd64/make-memstick.sh ============================================================================== --- head/release/amd64/make-memstick.sh Tue Apr 10 19:48:24 2018 (r332389) +++ head/release/amd64/make-memstick.sh Tue Apr 10 19:49:04 2018 (r332390) @@ -36,6 +36,12 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt -b ${1}/boot/pmbr -p efi:=${1}/boot/boot1.efifat -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} +mkimg -s gpt \ + -b ${1}/boot/pmbr \ + -p efi:=${1}/boot/boot1.efifat \ + -p freebsd-boot:=${1}/boot/gptboot \ + -p freebsd-ufs:=${2}.part \ + -p freebsd-swap::1M \ + -o ${2} rm ${2}.part Modified: head/release/arm64/make-memstick.sh ============================================================================== --- head/release/arm64/make-memstick.sh Tue Apr 10 19:48:24 2018 (r332389) +++ head/release/arm64/make-memstick.sh Tue Apr 10 19:49:04 2018 (r332390) @@ -36,6 +36,9 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt -p efi:=${1}/boot/boot1.efifat -p freebsd:=${2}.part -o ${2} +mkimg -s gpt \ + -p efi:=${1}/boot/boot1.efifat \ + -p freebsd:=${2}.part \ + -o ${2} rm ${2}.part Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Tue Apr 10 19:48:24 2018 (r332389) +++ head/release/i386/make-memstick.sh Tue Apr 10 19:49:04 2018 (r332390) @@ -36,6 +36,11 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt -b ${1}/boot/pmbr -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} +mkimg -s gpt \ + -b ${1}/boot/pmbr \ + -p freebsd-boot:=${1}/boot/gptboot \ + -p freebsd-ufs:=${2}.part \ + -p freebsd-swap::1M \ + -o ${2} rm ${2}.part Modified: head/release/powerpc/make-memstick.sh ============================================================================== --- head/release/powerpc/make-memstick.sh Tue Apr 10 19:48:24 2018 (r332389) +++ head/release/powerpc/make-memstick.sh Tue Apr 10 19:49:04 2018 (r332390) @@ -41,7 +41,10 @@ makefs -B big -o version=2 ${tempfile} ${1} rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2} +mkimg -s apm \ + -p freebsd-boot:=${1}/boot/boot1.hfs \ + -p freebsd-ufs/FreeBSD_Install:=${tempfile} \ + -o ${2} rm -f ${tempfile} From owner-svn-src-all@freebsd.org Tue Apr 10 20:22:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B2FEF965C7; Tue, 10 Apr 2018 20:22:38 +0000 (UTC) (envelope-from cognet@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 3A67573A5E; Tue, 10 Apr 2018 20:22:38 +0000 (UTC) (envelope-from cognet@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 1AB8A12712; Tue, 10 Apr 2018 20:22:38 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AKMc1Q086457; Tue, 10 Apr 2018 20:22:38 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AKMa3m086438; Tue, 10 Apr 2018 20:22:36 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201804102022.w3AKMa3m086438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Tue, 10 Apr 2018 20:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332391 - in stable/11/sys: contrib/ck contrib/ck/include contrib/ck/include/gcc contrib/ck/include/gcc/sparcv9 contrib/ck/include/gcc/x86 contrib/ck/include/gcc/x86_64 contrib/ck/inclu... X-SVN-Group: stable-11 X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: in stable/11/sys: contrib/ck contrib/ck/include contrib/ck/include/gcc contrib/ck/include/gcc/sparcv9 contrib/ck/include/gcc/x86 contrib/ck/include/gcc/x86_64 contrib/ck/include/spinlock contrib/ck/sr... X-SVN-Commit-Revision: 332391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 20:22:38 -0000 Author: cognet Date: Tue Apr 10 20:22:36 2018 New Revision: 332391 URL: https://svnweb.freebsd.org/changeset/base/332391 Log: MFC r329388, r331441 and r331898, to bring the -CURRENT ck version. r329388: Define CK_MD_TSO for the relevant arches (i386, amd64 and sparc64). Defaulting to CK_MD_RMO has the unfortunate side effect of generating memory barriers that are useless on those arches, and the even more unfortunate side effect of generating lfence/sfence/mfence on i386, even if older CPUs don't support it. This should fix the panic reported when using IPFW on a Pentium 3. Note that mfence and sfence might still be used in a few case, but that shouldn't happen in FreeBSD right now, and should be fixed upstream first. r331441: In __sync_bool_compare_and_swap(), return true if the returned value is the same as the expected one, not the desired one. r331898: Import CK as of commit b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8 It should fix ck_pr_[load|store]_ptr on mips and riscv, make sure no *fence instructions are used on i386, as older cpus don't support it, and make sure we don't rely on gcc builtins that can lead to calls to libatomic when linked with -O0. Modified: stable/11/sys/contrib/ck/FREEBSD-Xlist stable/11/sys/contrib/ck/include/ck_cc.h stable/11/sys/contrib/ck/include/ck_hs.h stable/11/sys/contrib/ck/include/ck_md.h stable/11/sys/contrib/ck/include/ck_pr.h stable/11/sys/contrib/ck/include/ck_queue.h stable/11/sys/contrib/ck/include/ck_ring.h stable/11/sys/contrib/ck/include/gcc/ck_cc.h stable/11/sys/contrib/ck/include/gcc/ck_pr.h stable/11/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h stable/11/sys/contrib/ck/include/spinlock/dec.h stable/11/sys/contrib/ck/src/ck_hs.c stable/11/sys/contrib/ck/src/ck_ht.c stable/11/sys/contrib/ck/src/ck_ht_hash.h stable/11/sys/contrib/ck/src/ck_internal.h stable/11/sys/contrib/ck/src/ck_rhs.c stable/11/sys/mips/mips/stdatomic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/ck/FREEBSD-Xlist ============================================================================== --- stable/11/sys/contrib/ck/FREEBSD-Xlist Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/FREEBSD-Xlist Tue Apr 10 20:22:36 2018 (r332391) @@ -8,4 +8,5 @@ */regressions */tools */include/ck_md.h.in +*/include/freebsd/ck_md.h.in */src/Makefile.in Modified: stable/11/sys/contrib/ck/include/ck_cc.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_cc.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_cc.h Tue Apr 10 20:22:36 2018 (r332391) @@ -104,42 +104,36 @@ #define CK_CC_TYPEOF(X, DEFAULT) (DEFAULT) #endif +#define CK_F_CC_FFS_G(L, T) \ +CK_CC_INLINE static int \ +ck_cc_##L(T v) \ +{ \ + unsigned int i; \ + \ + if (v == 0) \ + return 0; \ + \ + for (i = 1; (v & 1) == 0; i++, v >>= 1); \ + return i; \ +} + #ifndef CK_F_CC_FFS #define CK_F_CC_FFS -CK_CC_INLINE static int -ck_cc_ffs(unsigned int x) -{ - unsigned int i; +CK_F_CC_FFS_G(ffs, unsigned int) +#endif /* CK_F_CC_FFS */ - if (x == 0) - return 0; +#ifndef CK_F_CC_FFSL +#define CK_F_CC_FFSL +CK_F_CC_FFS_G(ffsl, unsigned long) +#endif /* CK_F_CC_FFSL */ - for (i = 1; (x & 1) == 0; i++, x >>= 1); +#ifndef CK_F_CC_FFSLL +#define CK_F_CC_FFSLL +CK_F_CC_FFS_G(ffsll, unsigned long long) +#endif /* CK_F_CC_FFSLL */ - return i; -} -#endif +#undef CK_F_CC_FFS_G -#ifndef CK_F_CC_CLZ -#define CK_F_CC_CLZ -#include - -CK_CC_INLINE static int -ck_cc_clz(unsigned int x) -{ - unsigned int count, i; - - for (count = 0, i = sizeof(unsigned int) * CHAR_BIT; i > 0; count++) { - unsigned int bit = 1U << --i; - - if (x & bit) - break; - } - - return count; -} -#endif - #ifndef CK_F_CC_CTZ #define CK_F_CC_CTZ CK_CC_INLINE static int @@ -151,7 +145,6 @@ ck_cc_ctz(unsigned int x) return 0; for (i = 0; (x & 1) == 0; i++, x >>= 1); - return i; } #endif Modified: stable/11/sys/contrib/ck/include/ck_hs.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_hs.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_hs.h Tue Apr 10 20:22:36 2018 (r332391) @@ -100,10 +100,11 @@ struct ck_hs_stat { struct ck_hs_iterator { void **cursor; unsigned long offset; + struct ck_hs_map *map; }; typedef struct ck_hs_iterator ck_hs_iterator_t; -#define CK_HS_ITERATOR_INITIALIZER { NULL, 0 } +#define CK_HS_ITERATOR_INITIALIZER { NULL, 0, NULL } /* Convenience wrapper to table hash function. */ #define CK_HS_HASH(T, F, K) F((K), (T)->seed) @@ -112,6 +113,7 @@ typedef void *ck_hs_apply_fn_t(void *, void *); bool ck_hs_apply(ck_hs_t *, unsigned long, const void *, ck_hs_apply_fn_t *, void *); void ck_hs_iterator_init(ck_hs_iterator_t *); bool ck_hs_next(ck_hs_t *, ck_hs_iterator_t *, void **); +bool ck_hs_next_spmc(ck_hs_t *, ck_hs_iterator_t *, void **); bool ck_hs_move(ck_hs_t *, ck_hs_t *, ck_hs_hash_cb_t *, ck_hs_compare_cb_t *, struct ck_malloc *); bool ck_hs_init(ck_hs_t *, unsigned int, ck_hs_hash_cb_t *, Modified: stable/11/sys/contrib/ck/include/ck_md.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_md.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_md.h Tue Apr 10 20:22:36 2018 (r332391) @@ -1,5 +1,5 @@ /* - * Copyright 2011-2012 Samy Al Bahra. + * Copyright 2018 Samy Al Bahra. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,53 +23,112 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ + * $FreeBSD: head/sys/contrib/ck/include/ck_md.h 329388 2018-02-16 17:50:06Z cog +net $ */ +/* + * This header file is meant for use of Concurrency Kit in the FreeBSD kernel. + */ + #ifndef CK_MD_H #define CK_MD_H +#include + +#ifndef _KERNEL +#error This header file is meant for the FreeBSD kernel. +#endif /* _KERNEL */ + #ifndef CK_MD_CACHELINE +/* + * FreeBSD's CACHE_LINE macro is a compile-time maximum cache-line size for an + * architecture, defined to be 128 bytes by default on x86*. Even in presence + * of adjacent sector prefetch, this doesn't make sense from a modeling + * perspective. + */ +#if defined(__amd64__) || defined(__i386__) #define CK_MD_CACHELINE (64) -#endif +#else +#define CK_MD_CACHELINE (CACHE_LINE_SIZE) +#endif /* !__amd64__ && !__i386__ */ +#endif /* CK_MD_CACHELINE */ #ifndef CK_MD_PAGESIZE -#define CK_MD_PAGESIZE (4096) +#define CK_MD_PAGESIZE (PAGE_SIZE) #endif +/* + * Once FreeBSD has a mechanism to detect RTM, this can be enabled and RTM + * facilities can be called. These facilities refer to TSX. + */ #ifndef CK_MD_RTM_DISABLE #define CK_MD_RTM_DISABLE #endif /* CK_MD_RTM_DISABLE */ +/* + * Do not enable pointer-packing-related (VMA) optimizations in kernel-space. + */ #ifndef CK_MD_POINTER_PACK_DISABLE #define CK_MD_POINTER_PACK_DISABLE #endif /* CK_MD_POINTER_PACK_DISABLE */ -#ifndef CK_MD_VMA_BITS_UNKNOWN -#define CK_MD_VMA_BITS_UNKNOWN +/* + * The following would be used for pointer-packing tricks, disabled for the + * kernel. + */ +#ifndef CK_MD_VMA_BITS_UNKNOWN +#define CK_MD_VMA_BITS_UNKNOWN #endif /* CK_MD_VMA_BITS_UNKNOWN */ +/* + * Do not enable double operations in kernel-space. + */ #ifndef CK_PR_DISABLE_DOUBLE #define CK_PR_DISABLE_DOUBLE #endif /* CK_PR_DISABLE_DOUBLE */ -#ifndef CK_MD_RMO -#define CK_MD_RMO -#endif /* CK_MD_RMO */ +/* + * If building for a uni-processor target, then enable the uniprocessor + * feature flag. This, among other things, will remove the lock prefix. + */ +#ifndef SMP +#define CK_MD_UMP +#endif /* SMP */ -#define CK_VERSION "0.6.0" -#define CK_GIT_SHA "" +/* + * Disable the use of compiler builtin functions. + */ +#define CK_MD_CC_BUILTIN_DISABLE 1 /* * CK expects those, which are normally defined by the build system. */ #if defined(__i386__) && !defined(__x86__) #define __x86__ +/* + * If x86 becomes more relevant, we may want to consider importing in + * __mbk() to avoid potential issues around false sharing. + */ +#define CK_MD_TSO +#define CK_MD_SSE_DISABLE 1 +#elif defined(__amd64__) +#define CK_MD_TSO #elif defined(__sparc64__) && !defined(__sparcv9__) #define __sparcv9__ +#define CK_MD_TSO #elif defined(__powerpc64__) && !defined(__ppc64__) #define __ppc64__ #elif defined(__powerpc__) && !defined(__ppc__) #define __ppc__ #endif + +/* If no memory model has been defined, assume RMO. */ +#if !defined(CK_MD_RMO) && !defined(CK_MD_TSO) && !defined(CK_MD_PSO) +#define CK_MD_RMO +#endif + +#define CK_VERSION "0.7.0" +#define CK_GIT_SHA "db5db44" + #endif /* CK_MD_H */ Modified: stable/11/sys/contrib/ck/include/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_pr.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_pr.h Tue Apr 10 20:22:36 2018 (r332391) @@ -43,6 +43,8 @@ #include "gcc/sparcv9/ck_pr.h" #elif defined(__ppc64__) #include "gcc/ppc64/ck_pr.h" +#elif defined(__s390x__) +#include "gcc/s390x/ck_pr.h" #elif defined(__ppc__) #include "gcc/ppc/ck_pr.h" #elif defined(__arm__) Modified: stable/11/sys/contrib/ck/include/ck_queue.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_queue.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_queue.h Tue Apr 10 20:22:36 2018 (r332391) @@ -235,7 +235,7 @@ struct { \ * Singly-linked Tail queue functions. */ #define CK_STAILQ_CONCAT(head1, head2) do { \ - if ((head2)->stqh_first == NULL) { \ + if ((head2)->stqh_first != NULL) { \ ck_pr_store_ptr((head1)->stqh_last, (head2)->stqh_first); \ ck_pr_fence_store(); \ (head1)->stqh_last = (head2)->stqh_last; \ Modified: stable/11/sys/contrib/ck/include/ck_ring.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_ring.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/ck_ring.h Tue Apr 10 20:22:36 2018 (r332391) @@ -176,23 +176,54 @@ _ck_ring_enqueue_mp(struct ck_ring *ring, producer = ck_pr_load_uint(&ring->p_head); - do { + for (;;) { /* - * The snapshot of producer must be up to date with - * respect to consumer. + * The snapshot of producer must be up to date with respect to + * consumer. */ ck_pr_fence_load(); consumer = ck_pr_load_uint(&ring->c_head); delta = producer + 1; - if (CK_CC_UNLIKELY((delta & mask) == (consumer & mask))) { - r = false; - goto leave; + + /* + * Only try to CAS if the producer is not clearly stale (not + * less than consumer) and the buffer is definitely not full. + */ + if (CK_CC_LIKELY((producer - consumer) < mask)) { + if (ck_pr_cas_uint_value(&ring->p_head, + producer, delta, &producer) == true) { + break; + } + } else { + unsigned int new_producer; + + /* + * Slow path. Either the buffer is full or we have a + * stale snapshot of p_head. Execute a second read of + * p_read that must be ordered wrt the snapshot of + * c_head. + */ + ck_pr_fence_load(); + new_producer = ck_pr_load_uint(&ring->p_head); + + /* + * Only fail if we haven't made forward progress in + * production: the buffer must have been full when we + * read new_producer (or we wrapped around UINT_MAX + * during this iteration). + */ + if (producer == new_producer) { + r = false; + goto leave; + } + + /* + * p_head advanced during this iteration. Try again. + */ + producer = new_producer; } - } while (ck_pr_cas_uint_value(&ring->p_head, - producer, - delta, - &producer) == false); + } buffer = (char *)buffer + ts * (producer & mask); memcpy(buffer, entry, ts); Modified: stable/11/sys/contrib/ck/include/gcc/ck_cc.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/ck_cc.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/gcc/ck_cc.h Tue Apr 10 20:22:36 2018 (r332391) @@ -103,28 +103,26 @@ #define CK_CC_TYPEOF(X, DEFAULT) __typeof__(X) /* - * Portability wrappers for bitwise ops. + * Portability wrappers for bitwise operations. */ - +#ifndef CK_MD_CC_BUILTIN_DISABLE #define CK_F_CC_FFS -#define CK_F_CC_CLZ -#define CK_F_CC_CTZ -#define CK_F_CC_POPCOUNT - CK_CC_INLINE static int ck_cc_ffs(unsigned int x) { - return __builtin_ffs(x); + return __builtin_ffsl(x); } +#define CK_F_CC_FFSL CK_CC_INLINE static int -ck_cc_clz(unsigned int x) +ck_cc_ffsl(unsigned long x) { - return __builtin_clz(x); + return __builtin_ffsll(x); } +#define CK_F_CC_CTZ CK_CC_INLINE static int ck_cc_ctz(unsigned int x) { @@ -132,11 +130,12 @@ ck_cc_ctz(unsigned int x) return __builtin_ctz(x); } +#define CK_F_CC_POPCOUNT CK_CC_INLINE static int ck_cc_popcount(unsigned int x) { return __builtin_popcount(x); } - +#endif /* CK_MD_CC_BUILTIN_DISABLE */ #endif /* CK_GCC_CC_H */ Modified: stable/11/sys/contrib/ck/include/gcc/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/ck_pr.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/gcc/ck_pr.h Tue Apr 10 20:22:36 2018 (r332391) @@ -80,7 +80,7 @@ ck_pr_md_load_ptr(const void *target) void *r; ck_pr_barrier(); - r = CK_CC_DECONST_PTR(CK_PR_ACCESS(target)); + r = CK_CC_DECONST_PTR(*(volatile void *const*)(target)); ck_pr_barrier(); return r; @@ -91,7 +91,7 @@ ck_pr_md_store_ptr(void *target, const void *v) { ck_pr_barrier(); - CK_PR_ACCESS(target) = CK_CC_DECONST_PTR(v); + *(volatile void **)target = CK_CC_DECONST_PTR(v); ck_pr_barrier(); return; } Modified: stable/11/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/gcc/sparcv9/ck_pr.h Tue Apr 10 20:22:36 2018 (r332391) @@ -76,7 +76,7 @@ CK_PR_FENCE(store, "membar #StoreStore") CK_PR_FENCE(store_load, "membar #StoreLoad") CK_PR_FENCE(load, "membar #LoadLoad") CK_PR_FENCE(load_store, "membar #LoadStore") -CK_PR_FENCE(memory, "membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad") +CK_PR_FENCE(memory, "membar #MemIssue") CK_PR_FENCE(acquire, "membar #LoadLoad | #LoadStore") CK_PR_FENCE(release, "membar #LoadStore | #StoreStore") CK_PR_FENCE(acqrel, "membar #LoadLoad | #LoadStore | #StoreStore") Modified: stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h Tue Apr 10 20:22:36 2018 (r332391) @@ -45,15 +45,9 @@ /* Minimum requirements for the CK_PR interface are met. */ #define CK_F_PR -#ifdef CK_MD_UMP -#define CK_PR_LOCK_PREFIX -#else -#define CK_PR_LOCK_PREFIX "lock " -#endif - /* - * Prevent speculative execution in busy-wait loops (P4 <=) - * or "predefined delay". + * Prevent speculative execution in busy-wait loops (P4 <=) or "predefined + * delay". */ CK_CC_INLINE static void ck_pr_stall(void) @@ -62,28 +56,52 @@ ck_pr_stall(void) return; } +#ifdef CK_MD_UMP +#define CK_PR_LOCK_PREFIX #define CK_PR_FENCE(T, I) \ CK_CC_INLINE static void \ ck_pr_fence_strict_##T(void) \ { \ + __asm__ __volatile__("" ::: "memory"); \ + return; \ + } +#else +#define CK_PR_LOCK_PREFIX "lock " +#define CK_PR_FENCE(T, I) \ + CK_CC_INLINE static void \ + ck_pr_fence_strict_##T(void) \ + { \ __asm__ __volatile__(I ::: "memory"); \ + return; \ } +#endif /* CK_MD_UMP */ -CK_PR_FENCE(atomic, "sfence") -CK_PR_FENCE(atomic_store, "sfence") -CK_PR_FENCE(atomic_load, "mfence") -CK_PR_FENCE(store_atomic, "sfence") -CK_PR_FENCE(load_atomic, "mfence") -CK_PR_FENCE(load, "lfence") -CK_PR_FENCE(load_store, "mfence") -CK_PR_FENCE(store, "sfence") -CK_PR_FENCE(store_load, "mfence") -CK_PR_FENCE(memory, "mfence") -CK_PR_FENCE(release, "mfence") -CK_PR_FENCE(acquire, "mfence") -CK_PR_FENCE(acqrel, "mfence") -CK_PR_FENCE(lock, "mfence") -CK_PR_FENCE(unlock, "mfence") +#if defined(CK_MD_SSE_DISABLE) +/* If SSE is disabled, then use atomic operations for serialization. */ +#define CK_MD_X86_MFENCE "lock addl $0, (%%esp)" +#define CK_MD_X86_SFENCE CK_MD_X86_MFENCE +#define CK_MD_X86_LFENCE CK_MD_X86_MFENCE +#else +#define CK_MD_X86_SFENCE "sfence" +#define CK_MD_X86_LFENCE "lfence" +#define CK_MD_X86_MFENCE "mfence" +#endif /* !CK_MD_SSE_DISABLE */ + +CK_PR_FENCE(atomic, "") +CK_PR_FENCE(atomic_store, "") +CK_PR_FENCE(atomic_load, "") +CK_PR_FENCE(store_atomic, "") +CK_PR_FENCE(load_atomic, "") +CK_PR_FENCE(load, CK_MD_X86_LFENCE) +CK_PR_FENCE(load_store, CK_MD_X86_MFENCE) +CK_PR_FENCE(store, CK_MD_X86_SFENCE) +CK_PR_FENCE(store_load, CK_MD_X86_MFENCE) +CK_PR_FENCE(memory, CK_MD_X86_MFENCE) +CK_PR_FENCE(release, CK_MD_X86_MFENCE) +CK_PR_FENCE(acquire, CK_MD_X86_MFENCE) +CK_PR_FENCE(acqrel, CK_MD_X86_MFENCE) +CK_PR_FENCE(lock, CK_MD_X86_MFENCE) +CK_PR_FENCE(unlock, CK_MD_X86_MFENCE) #undef CK_PR_FENCE Modified: stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h Tue Apr 10 20:22:36 2018 (r332391) @@ -58,8 +58,8 @@ #endif /* - * Prevent speculative execution in busy-wait loops (P4 <=) - * or "predefined delay". + * Prevent speculative execution in busy-wait loops (P4 <=) or "predefined + * delay". */ CK_CC_INLINE static void ck_pr_stall(void) @@ -75,18 +75,39 @@ ck_pr_stall(void) __asm__ __volatile__(I ::: "memory"); \ } -CK_PR_FENCE(atomic, "sfence") -CK_PR_FENCE(atomic_store, "sfence") -CK_PR_FENCE(atomic_load, "mfence") -CK_PR_FENCE(store_atomic, "sfence") -CK_PR_FENCE(load_atomic, "mfence") +/* Atomic operations are always serializing. */ +CK_PR_FENCE(atomic, "") +CK_PR_FENCE(atomic_store, "") +CK_PR_FENCE(atomic_load, "") +CK_PR_FENCE(store_atomic, "") +CK_PR_FENCE(load_atomic, "") + +/* Traditional fence interface. */ CK_PR_FENCE(load, "lfence") CK_PR_FENCE(load_store, "mfence") CK_PR_FENCE(store, "sfence") CK_PR_FENCE(store_load, "mfence") CK_PR_FENCE(memory, "mfence") + +/* Below are stdatomic-style fences. */ + +/* + * Provides load-store and store-store ordering. However, Intel specifies that + * the WC memory model is relaxed. It is likely an sfence *is* sufficient (in + * particular, stores are not re-ordered with respect to prior loads and it is + * really just the stores that are subject to re-ordering). However, we take + * the conservative route as the manuals are too ambiguous for my taste. + */ CK_PR_FENCE(release, "mfence") + +/* + * Provides load-load and load-store ordering. The lfence instruction ensures + * all prior load operations are complete before any subsequent instructions + * actually begin execution. However, the manual also ends up going to describe + * WC memory as a relaxed model. + */ CK_PR_FENCE(acquire, "mfence") + CK_PR_FENCE(acqrel, "mfence") CK_PR_FENCE(lock, "mfence") CK_PR_FENCE(unlock, "mfence") Modified: stable/11/sys/contrib/ck/include/spinlock/dec.h ============================================================================== --- stable/11/sys/contrib/ck/include/spinlock/dec.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/include/spinlock/dec.h Tue Apr 10 20:22:36 2018 (r332391) @@ -111,7 +111,8 @@ ck_spinlock_dec_lock_eb(struct ck_spinlock_dec *lock) if (r == true) break; - ck_backoff_eb(&backoff); + while (ck_pr_load_uint(&lock->value) != 1) + ck_backoff_eb(&backoff); } ck_pr_fence_lock(); Modified: stable/11/sys/contrib/ck/src/ck_hs.c ============================================================================== --- stable/11/sys/contrib/ck/src/ck_hs.c Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/src/ck_hs.c Tue Apr 10 20:22:36 2018 (r332391) @@ -105,21 +105,10 @@ ck_hs_map_signal(struct ck_hs_map *map, unsigned long return; } -void -ck_hs_iterator_init(struct ck_hs_iterator *iterator) +static bool +_ck_hs_next(struct ck_hs *hs, struct ck_hs_map *map, struct ck_hs_iterator *i, void **key) { - - iterator->cursor = NULL; - iterator->offset = 0; - return; -} - -bool -ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) -{ - struct ck_hs_map *map = hs->map; void *value; - if (i->offset >= map->capacity) return false; @@ -129,6 +118,8 @@ ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, #ifdef CK_HS_PP if (hs->mode & CK_HS_MODE_OBJECT) value = CK_HS_VMA(value); +#else + (void)hs; /* Avoid unused parameter warning. */ #endif i->offset++; *key = value; @@ -140,6 +131,32 @@ ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, } void +ck_hs_iterator_init(struct ck_hs_iterator *iterator) +{ + + iterator->cursor = NULL; + iterator->offset = 0; + iterator->map = NULL; + return; +} + +bool +ck_hs_next(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) +{ + return _ck_hs_next(hs, hs->map, i, key); +} + +bool +ck_hs_next_spmc(struct ck_hs *hs, struct ck_hs_iterator *i, void **key) +{ + struct ck_hs_map *m = i->map; + if (m == NULL) { + m = i->map = ck_pr_load_ptr(&hs->map); + } + return _ck_hs_next(hs, m, i, key); +} + +void ck_hs_stat(struct ck_hs *hs, struct ck_hs_stat *st) { struct ck_hs_map *map = hs->map; @@ -206,7 +223,7 @@ ck_hs_map_create(struct ck_hs *hs, unsigned long entri map->probe_limit = (unsigned int)limit; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf(n_entries); + map->step = ck_cc_ffsl(n_entries); map->mask = n_entries - 1; map->n_entries = 0; Modified: stable/11/sys/contrib/ck/src/ck_ht.c ============================================================================== --- stable/11/sys/contrib/ck/src/ck_ht.c Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/src/ck_ht.c Tue Apr 10 20:22:36 2018 (r332391) @@ -171,7 +171,7 @@ ck_ht_map_create(struct ck_ht *table, CK_HT_TYPE entri map->deletions = 0; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf_64(map->capacity); + map->step = ck_cc_ffsll(map->capacity); map->mask = map->capacity - 1; map->n_entries = 0; map->entries = (struct ck_ht_entry *)(((uintptr_t)&map[1] + prefix + Modified: stable/11/sys/contrib/ck/src/ck_ht_hash.h ============================================================================== --- stable/11/sys/contrib/ck/src/ck_ht_hash.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/src/ck_ht_hash.h Tue Apr 10 20:22:36 2018 (r332391) @@ -88,7 +88,15 @@ static inline uint64_t rotl64 ( uint64_t x, int8_t r ) FORCE_INLINE static uint32_t getblock ( const uint32_t * p, int i ) { +#ifdef __s390x__ + uint32_t res; + + __asm__ (" lrv %0,%1\n" + : "=r" (res) : "Q" (p[i]) : "cc", "mem"); + return res; +#else return p[i]; +#endif /* !__s390x__ */ } //----------------------------------------------------------------------------- @@ -147,7 +155,9 @@ static inline void MurmurHash3_x86_32 ( const void * k switch(len & 3) { case 3: k1 ^= tail[2] << 16; + /* fall through */ case 2: k1 ^= tail[1] << 8; + /* fall through */ case 1: k1 ^= tail[0]; k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; }; @@ -196,11 +206,17 @@ static inline uint64_t MurmurHash64A ( const void * ke switch(len & 7) { case 7: h ^= (uint64_t)(data2[6]) << 48; + /* fall through */ case 6: h ^= (uint64_t)(data2[5]) << 40; + /* fall through */ case 5: h ^= (uint64_t)(data2[4]) << 32; + /* fall through */ case 4: h ^= (uint64_t)(data2[3]) << 24; + /* fall through */ case 3: h ^= (uint64_t)(data2[2]) << 16; + /* fall through */ case 2: h ^= (uint64_t)(data2[1]) << 8; + /* fall through */ case 1: h ^= (uint64_t)(data2[0]); h *= m; }; @@ -249,7 +265,9 @@ static inline uint64_t MurmurHash64B ( const void * ke switch(len) { case 3: h2 ^= ((const unsigned char*)data)[2] << 16; + /* fall through */ case 2: h2 ^= ((const unsigned char*)data)[1] << 8; + /* fall through */ case 1: h2 ^= ((const unsigned char*)data)[0]; h2 *= m; }; Modified: stable/11/sys/contrib/ck/src/ck_internal.h ============================================================================== --- stable/11/sys/contrib/ck/src/ck_internal.h Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/src/ck_internal.h Tue Apr 10 20:22:36 2018 (r332391) @@ -80,40 +80,3 @@ ck_internal_max_32(uint32_t x, uint32_t y) return x ^ ((x ^ y) & -(x < y)); } - -CK_CC_INLINE static unsigned long -ck_internal_bsf(unsigned long v) -{ -#if defined(__GNUC__) - return __builtin_ffs(v); -#else - unsigned int i; - const unsigned int s = sizeof(unsigned long) * 8 - 1; - - for (i = 0; i < s; i++) { - if (v & (1UL << (s - i))) - return sizeof(unsigned long) * 8 - i; - } - - return 1; -#endif /* !__GNUC__ */ -} - -CK_CC_INLINE static uint64_t -ck_internal_bsf_64(uint64_t v) -{ -#if defined(__GNUC__) - return __builtin_ffs(v); -#else - unsigned int i; - const unsigned int s = sizeof(unsigned long) * 8 - 1; - - for (i = 0; i < s; i++) { - if (v & (1ULL << (63U - i))) - return i; - } -#endif /* !__GNUC__ */ - - return 1; -} - Modified: stable/11/sys/contrib/ck/src/ck_rhs.c ============================================================================== --- stable/11/sys/contrib/ck/src/ck_rhs.c Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/contrib/ck/src/ck_rhs.c Tue Apr 10 20:22:36 2018 (r332391) @@ -366,7 +366,7 @@ ck_rhs_map_create(struct ck_rhs *hs, unsigned long ent map->probe_limit = (unsigned int)limit; map->probe_maximum = 0; map->capacity = n_entries; - map->step = ck_internal_bsf(n_entries); + map->step = ck_cc_ffsl(n_entries); map->mask = n_entries - 1; map->n_entries = 0; Modified: stable/11/sys/mips/mips/stdatomic.c ============================================================================== --- stable/11/sys/mips/mips/stdatomic.c Tue Apr 10 19:49:04 2018 (r332390) +++ stable/11/sys/mips/mips/stdatomic.c Tue Apr 10 20:22:36 2018 (r332391) @@ -325,7 +325,7 @@ __sync_bool_compare_and_swap_4(uint32_t *mem, uint32_t { return (do_compare_and_swap_4(mem, expected, desired) == - desired); + expected); } #define EMIT_FETCH_AND_OP_4(name, op) \ From owner-svn-src-all@freebsd.org Tue Apr 10 20:31:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5538FF96FA1; Tue, 10 Apr 2018 20:31:26 +0000 (UTC) (envelope-from gonzo@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 08B6975F4B; Tue, 10 Apr 2018 20:31:26 +0000 (UTC) (envelope-from gonzo@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 03BFE12889; Tue, 10 Apr 2018 20:31:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AKVPbn088766; Tue, 10 Apr 2018 20:31:25 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AKVPQk088753; Tue, 10 Apr 2018 20:31:25 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804102031.w3AKVPQk088753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 10 Apr 2018 20:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332392 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 332392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 20:31:26 -0000 Author: gonzo Date: Tue Apr 10 20:31:25 2018 New Revision: 332392 URL: https://svnweb.freebsd.org/changeset/base/332392 Log: [pi] Do not attach bcm2835_pwm if DTB node is not enabled Switch to standard FDT-base driver behavior and don't attach if node "status" property value nn DTS is not set to "okay" On RPi PWM by default is disabled, to enable it pwm.dtbo from official repo[1] should be copied to overlays directory on SD card FAT partition and "dtoverlay=pwm" line added to config.txt. For more details see pwm overlay documentation[2] sysutils/rpi-firmware port now includes overlays, so they can be installed as a part of release image build. [1] https://github.com/raspberrypi/firmware/tree/master/boot [2] https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README No objections from: phk@ Modified: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Tue Apr 10 20:22:36 2018 (r332391) +++ head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Tue Apr 10 20:31:25 2018 (r332392) @@ -276,12 +276,8 @@ static int bcm_pwm_probe(device_t dev) { -#if 0 - // XXX: default state is disabled in RPI3 DTB, assume for now - // XXX: that people want the PWM to work if the KLD this module. if (!ofw_bus_status_okay(dev)) return (ENXIO); -#endif if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); From owner-svn-src-all@freebsd.org Tue Apr 10 21:14:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 931B6F99F69; Tue, 10 Apr 2018 21:14:55 +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 3AB487F0CF; Tue, 10 Apr 2018 21:14:55 +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 35C4512F5B; Tue, 10 Apr 2018 21:14:55 +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 w3ALEtHD011735; Tue, 10 Apr 2018 21:14:55 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ALEtN0011734; Tue, 10 Apr 2018 21:14:55 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804102114.w3ALEtN0011734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 10 Apr 2018 21:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332393 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 332393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 21:14:55 -0000 Author: jhibbits Date: Tue Apr 10 21:14:54 2018 New Revision: 332393 URL: https://svnweb.freebsd.org/changeset/base/332393 Log: Reenter KDB on fault on powerpc, instead of panicking Most other architectures already re-enter KDB on faults, powerpc and mips are the only outliers. Correct this for powerpc, so that now bad addresses can be handled gracefully instead of panicking. Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Tue Apr 10 20:31:25 2018 (r332392) +++ head/sys/powerpc/powerpc/trap.c Tue Apr 10 21:14:54 2018 (r332393) @@ -208,6 +208,13 @@ trap(struct trapframe *frame) VM_CNT_INC(v_trap); +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return; + } +#endif + td = curthread; p = td->td_proc; From owner-svn-src-all@freebsd.org Tue Apr 10 22:32:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96A7BF9F356; Tue, 10 Apr 2018 22:32: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 4CBD47089B; Tue, 10 Apr 2018 22:32: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 45D5113C47; Tue, 10 Apr 2018 22:32:32 +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 w3AMWWeU051027; Tue, 10 Apr 2018 22:32:32 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AMWWDl051026; Tue, 10 Apr 2018 22:32:32 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804102232.w3AMWWDl051026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 10 Apr 2018 22:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332394 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 22:32:32 -0000 Author: mjg Date: Tue Apr 10 22:32:31 2018 New Revision: 332394 URL: https://svnweb.freebsd.org/changeset/base/332394 Log: rw: whack avoidable re-reads in try_upgrade Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Apr 10 21:14:54 2018 (r332393) +++ head/sys/kern/kern_rwlock.c Tue Apr 10 22:32:31 2018 (r332394) @@ -1204,7 +1204,7 @@ __rw_wunlock_hard(volatile uintptr_t *c, uintptr_t v L int __rw_try_upgrade_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF) { - uintptr_t v, x, tid; + uintptr_t v, setv, tid; struct turnstile *ts; int success; @@ -1224,12 +1224,12 @@ __rw_try_upgrade_int(struct rwlock *rw LOCK_FILE_LINE_ */ tid = (uintptr_t)curthread; success = 0; + v = RW_READ_VALUE(rw); for (;;) { - v = rw->rw_lock; if (RW_READERS(v) > 1) break; if (!(v & RW_LOCK_WAITERS)) { - success = atomic_cmpset_acq_ptr(&rw->rw_lock, v, tid); + success = atomic_fcmpset_acq_ptr(&rw->rw_lock, &v, tid); if (!success) continue; break; @@ -1239,7 +1239,8 @@ __rw_try_upgrade_int(struct rwlock *rw LOCK_FILE_LINE_ * Ok, we think we have waiters, so lock the turnstile. */ ts = turnstile_trywait(&rw->lock_object); - v = rw->rw_lock; + v = RW_READ_VALUE(rw); +retry_ts: if (RW_READERS(v) > 1) { turnstile_cancel(ts); break; @@ -1250,16 +1251,16 @@ __rw_try_upgrade_int(struct rwlock *rw LOCK_FILE_LINE_ * If we obtain the lock with the flags set, then claim * ownership of the turnstile. */ - x = rw->rw_lock & RW_LOCK_WAITERS; - success = atomic_cmpset_ptr(&rw->rw_lock, v, tid | x); + setv = tid | (v & RW_LOCK_WAITERS); + success = atomic_fcmpset_ptr(&rw->rw_lock, &v, setv); if (success) { - if (x) + if (v & RW_LOCK_WAITERS) turnstile_claim(ts); else turnstile_cancel(ts); break; } - turnstile_cancel(ts); + goto retry_ts; } LOCK_LOG_TRY("WUPGRADE", &rw->lock_object, 0, success, file, line); if (success) { From owner-svn-src-all@freebsd.org Tue Apr 10 22:57:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBA05FA11FC; Tue, 10 Apr 2018 22:57:56 +0000 (UTC) (envelope-from ian@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 8D4EB76D32; Tue, 10 Apr 2018 22:57:56 +0000 (UTC) (envelope-from ian@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 8731513F8D; Tue, 10 Apr 2018 22:57:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3AMvuXs061051; Tue, 10 Apr 2018 22:57:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3AMvuIF061050; Tue, 10 Apr 2018 22:57:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804102257.w3AMvuIF061050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 10 Apr 2018 22:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332395 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 22:57:57 -0000 Author: ian Date: Tue Apr 10 22:57:56 2018 New Revision: 332395 URL: https://svnweb.freebsd.org/changeset/base/332395 Log: Use explicit_bzero() when cleaning values out of the kernel environment. Sometimes the values contain geli passphrases being communicated from loader(8) to the kernel, and some day the compiler may decide to start eliding calls to memset() for a pointer which is not dereferenced again before being passed to free(). Modified: head/sys/kern/kern_environment.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Tue Apr 10 22:32:31 2018 (r332394) +++ head/sys/kern/kern_environment.c Tue Apr 10 22:57:56 2018 (r332395) @@ -289,7 +289,7 @@ init_dynamic_kenv(void *data __unused) if (i < KENV_SIZE) { kenvp[i] = malloc(len, M_KENV, M_WAITOK); strcpy(kenvp[i++], cp); - memset(cp, 0, strlen(cp)); + explicit_bzero(cp, strlen(cp)); } else printf( "WARNING: too many kenv strings, ignoring %s\n", @@ -308,7 +308,7 @@ freeenv(char *env) { if (dynamic_kenv && env != NULL) { - memset(env, 0, strlen(env)); + explicit_bzero(env, strlen(env)); free(env, M_KENV); } } @@ -486,7 +486,7 @@ kern_unsetenv(const char *name) kenvp[i++] = kenvp[j]; kenvp[i] = NULL; mtx_unlock(&kenv_lock); - memset(oldenv, 0, strlen(oldenv)); + explicit_bzero(oldenv, strlen(oldenv)); free(oldenv, M_KENV); return (0); } From owner-svn-src-all@freebsd.org Tue Apr 10 23:29:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48BA9FA337E; Tue, 10 Apr 2018 23:29:58 +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 EB5787D1D5; Tue, 10 Apr 2018 23:29:57 +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 E61DB144D6; Tue, 10 Apr 2018 23:29:57 +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 w3ANTviN075721; Tue, 10 Apr 2018 23:29:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ANTvqb075717; Tue, 10 Apr 2018 23:29:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804102329.w3ANTvqb075717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Apr 2018 23:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332396 - head/bin/setfacl X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/bin/setfacl X-SVN-Commit-Revision: 332396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 23:29:58 -0000 Author: emaste Date: Tue Apr 10 23:29:57 2018 New Revision: 332396 URL: https://svnweb.freebsd.org/changeset/base/332396 Log: setfacl: add recursive functionality Add a -R option to setfacl to operate recursively on directories, along with the accompanying flags -H, -L, and -P (whose behaviour mimics chmod). A patch was submitted with PR 155163, but this is a new implementation based on comments raised in the Phabricator review for that patch (review D9096). PR: 155163 Submitted by: Mitchell Horne Reviewed by: jilles MFC after: 2 weeks Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14934 Modified: head/bin/setfacl/setfacl.1 head/bin/setfacl/setfacl.c head/bin/setfacl/setfacl.h head/bin/setfacl/util.c Modified: head/bin/setfacl/setfacl.1 ============================================================================== --- head/bin/setfacl/setfacl.1 Tue Apr 10 22:57:56 2018 (r332395) +++ head/bin/setfacl/setfacl.1 Tue Apr 10 23:29:57 2018 (r332396) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2016 +.Dd April 10, 2018 .Dt SETFACL 1 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nd set ACL information .Sh SYNOPSIS .Nm +.Op Fl R Op Fl H | L | P .Op Fl bdhkn .Op Fl a Ar position entries .Op Fl m Ar entries @@ -83,6 +84,12 @@ default ACL's. This option is not applicable to NFSv4 .It Fl h If the target of the operation is a symbolic link, perform the operation on the symbolic link itself, rather than following the link. +.It Fl H +If the +.Fl R +option is specified, symbolic links on the command line are followed +and hence unaffected by the command. +(Symbolic links encountered during tree traversal are not followed.) .It Fl k Delete any default ACL entries on the specified files. It @@ -91,6 +98,10 @@ any default ACL entries. An error will be reported if any of the specified files cannot have a default entry (i.e.\& non-directories). This option is not applicable to NFSv4 ACLs. +.It Fl L +If the +.Fl R +option is specified, all symbolic links are followed. .It Fl m Ar entries Modify the ACL on the specified file. New entries will be added, and existing entries will be modified @@ -116,6 +127,13 @@ the input is taken from stdin. Do not recalculate the permissions associated with the ACL mask entry. This option is not applicable to NFSv4 ACLs. +.It Fl P +If the +.Fl R +option is specified, no symbolic links are followed. +This is the default. +.It Fl R +Perform the action recursively on any specified directories. .It Fl x Ar entries | position If .Ar entries Modified: head/bin/setfacl/setfacl.c ============================================================================== --- head/bin/setfacl/setfacl.c Tue Apr 10 22:57:56 2018 (r332395) +++ head/bin/setfacl/setfacl.c Tue Apr 10 23:29:57 2018 (r332396) @@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include #include #include @@ -59,41 +62,20 @@ struct sf_entry { }; static TAILQ_HEAD(, sf_entry) entrylist; -/* TAILQ entry for files */ -struct sf_file { - const char *filename; - TAILQ_ENTRY(sf_file) next; -}; -static TAILQ_HEAD(, sf_file) filelist; - uint have_mask; uint need_mask; uint have_stdin; uint n_flag; -static void add_filename(const char *filename); static void usage(void); static void -add_filename(const char *filename) -{ - struct sf_file *file; - - if (strlen(filename) > PATH_MAX - 1) { - warn("illegal filename"); - return; - } - file = zmalloc(sizeof(struct sf_file)); - file->filename = filename; - TAILQ_INSERT_TAIL(&filelist, file, next); -} - -static void usage(void) { - fprintf(stderr, "usage: setfacl [-bdhkn] [-a position entries] " - "[-m entries] [-M file] [-x entries] [-X file] [file ...]\n"); + fprintf(stderr, "usage: setfacl [-R [-H | -L | -P]] [-bdhkn] " + "[-a position entries] [-m entries] [-M file] " + "[-x entries] [-X file] [file ...]\n"); exit(1); } @@ -104,23 +86,32 @@ main(int argc, char *argv[]) acl_type_t acl_type; acl_entry_t unused_entry; char filename[PATH_MAX]; - int local_error, carried_error, ch, i, entry_number, ret; - int h_flag; - struct sf_file *file; + int local_error, carried_error, ch, entry_number, ret, fts_options; + bool h_flag, H_flag, L_flag, R_flag, follow_symlink; + size_t fl_count, i; + FTS *ftsp; + FTSENT *file; + char **files_list; struct sf_entry *entry; - const char *fn_dup; char *end; - struct stat sb; acl_type = ACL_TYPE_ACCESS; - carried_error = local_error = 0; - h_flag = have_mask = have_stdin = n_flag = need_mask = 0; + carried_error = local_error = fts_options = 0; + have_mask = have_stdin = n_flag = need_mask = 0; + h_flag = H_flag = L_flag = R_flag = false; TAILQ_INIT(&entrylist); - TAILQ_INIT(&filelist); - while ((ch = getopt(argc, argv, "M:X:a:bdhkm:nx:")) != -1) + while ((ch = getopt(argc, argv, "HLM:PRX:a:bdhkm:nx:")) != -1) switch(ch) { + case 'H': + H_flag = true; + L_flag = false; + break; + case 'L': + L_flag = true; + H_flag = false; + break; case 'M': entry = zmalloc(sizeof(struct sf_entry)); entry->acl = get_acl_from_file(optarg); @@ -129,6 +120,12 @@ main(int argc, char *argv[]) entry->op = OP_MERGE_ACL; TAILQ_INSERT_TAIL(&entrylist, entry, next); break; + case 'P': + H_flag = L_flag = false; + break; + case 'R': + R_flag = true; + break; case 'X': entry = zmalloc(sizeof(struct sf_entry)); entry->acl = get_acl_from_file(optarg); @@ -213,43 +210,93 @@ main(int argc, char *argv[]) err(1, "cannot have more than one stdin"); have_stdin = 1; bzero(&filename, sizeof(filename)); + i = 0; + /* Start with an array size sufficient for basic cases. */ + fl_count = 1024; + files_list = zmalloc(fl_count * sizeof(char *)); while (fgets(filename, (int)sizeof(filename), stdin)) { /* remove the \n */ filename[strlen(filename) - 1] = '\0'; - fn_dup = strdup(filename); - if (fn_dup == NULL) + files_list[i] = strdup(filename); + if (files_list[i] == NULL) err(1, "strdup() failed"); - add_filename(fn_dup); + /* Grow array if necessary. */ + if (++i == fl_count) { + fl_count <<= 1; + if (fl_count > SIZE_MAX / sizeof(char *)) + errx(1, "Too many input files"); + files_list = zrealloc(files_list, + fl_count * sizeof(char *)); + } } + + /* fts_open() requires the last array element to be NULL. */ + files_list[i] = NULL; } else - for (i = 0; i < argc; i++) - add_filename(argv[i]); + files_list = argv; - /* cycle through each file */ - TAILQ_FOREACH(file, &filelist, next) { - local_error = 0; + if (R_flag) { + if (h_flag) + errx(1, "the -R and -h options may not be " + "specified together."); + if (L_flag) { + fts_options = FTS_LOGICAL; + } else { + fts_options = FTS_PHYSICAL; - if (stat(file->filename, &sb) == -1) { - warn("%s: stat() failed", file->filename); - carried_error++; + if (H_flag) { + fts_options |= FTS_COMFOLLOW; + } + } + } else if (h_flag) { + fts_options = FTS_PHYSICAL; + } else { + fts_options = FTS_LOGICAL; + } + + /* Open all files. */ + if ((ftsp = fts_open(files_list, fts_options | FTS_NOSTAT, 0)) == NULL) + err(1, "fts_open"); + while ((file = fts_read(ftsp)) != NULL) { + switch (file->fts_info) { + case FTS_D: + /* Do not recurse if -R not specified. */ + if (!R_flag) + fts_set(ftsp, file, FTS_SKIP); + break; + case FTS_DP: + /* Skip the second visit to a directory. */ continue; + case FTS_DNR: + case FTS_ERR: + warnx("%s: %s", file->fts_path, + strerror(file->fts_errno)); + continue; + default: + break; } - if (acl_type == ACL_TYPE_DEFAULT && S_ISDIR(sb.st_mode) == 0) { - warnx("%s: default ACL may only be set on a directory", - file->filename); + if (acl_type == ACL_TYPE_DEFAULT && file->fts_info != FTS_D) { + warnx("%s: default ACL may only be set on " + "a directory", file->fts_path); carried_error++; continue; } - if (h_flag) - ret = lpathconf(file->filename, _PC_ACL_NFS4); + local_error = 0; + + follow_symlink = ((fts_options & FTS_LOGICAL) || + ((fts_options & FTS_COMFOLLOW) && + file->fts_level == FTS_ROOTLEVEL)); + + if (follow_symlink) + ret = pathconf(file->fts_accpath, _PC_ACL_NFS4); else - ret = pathconf(file->filename, _PC_ACL_NFS4); + ret = lpathconf(file->fts_accpath, _PC_ACL_NFS4); if (ret > 0) { if (acl_type == ACL_TYPE_DEFAULT) { warnx("%s: there are no default entries " - "in NFSv4 ACLs", file->filename); + "in NFSv4 ACLs", file->fts_path); carried_error++; continue; } @@ -259,20 +306,20 @@ main(int argc, char *argv[]) acl_type = ACL_TYPE_ACCESS; } else if (ret < 0 && errno != EINVAL) { warn("%s: pathconf(..., _PC_ACL_NFS4) failed", - file->filename); + file->fts_path); } - if (h_flag) - acl = acl_get_link_np(file->filename, acl_type); + if (follow_symlink) + acl = acl_get_file(file->fts_accpath, acl_type); else - acl = acl_get_file(file->filename, acl_type); + acl = acl_get_link_np(file->fts_accpath, acl_type); if (acl == NULL) { - if (h_flag) - warn("%s: acl_get_link_np() failed", - file->filename); - else + if (follow_symlink) warn("%s: acl_get_file() failed", - file->filename); + file->fts_path); + else + warn("%s: acl_get_link_np() failed", + file->fts_path); carried_error++; continue; } @@ -285,11 +332,12 @@ main(int argc, char *argv[]) switch(entry->op) { case OP_ADD_ACL: local_error += add_acl(entry->acl, - entry->entry_number, &acl, file->filename); + entry->entry_number, + &acl, file->fts_path); break; case OP_MERGE_ACL: local_error += merge_acl(entry->acl, &acl, - file->filename); + file->fts_path); need_mask = 1; break; case OP_REMOVE_EXT: @@ -301,37 +349,37 @@ main(int argc, char *argv[]) acl_get_entry(acl, ACL_FIRST_ENTRY, &unused_entry) == 0) { local_error += remove_default(&acl, - file->filename); + file->fts_path); break; } - remove_ext(&acl, file->filename); + remove_ext(&acl, file->fts_path); need_mask = 0; break; case OP_REMOVE_DEF: if (acl_type == ACL_TYPE_NFS4) { warnx("%s: there are no default entries in NFSv4 ACLs; " - "cannot remove", file->filename); + "cannot remove", file->fts_path); local_error++; break; } - if (acl_delete_def_file(file->filename) == -1) { + if (acl_delete_def_file(file->fts_accpath) == -1) { warn("%s: acl_delete_def_file() failed", - file->filename); + file->fts_path); local_error++; } if (acl_type == ACL_TYPE_DEFAULT) local_error += remove_default(&acl, - file->filename); + file->fts_path); need_mask = 0; break; case OP_REMOVE_ACL: local_error += remove_acl(entry->acl, &acl, - file->filename); + file->fts_path); need_mask = 1; break; case OP_REMOVE_BY_NUMBER: local_error += remove_by_number(entry->entry_number, - &acl, file->filename); + &acl, file->fts_path); need_mask = 1; break; } @@ -343,9 +391,9 @@ main(int argc, char *argv[]) */ if (acl_type == ACL_TYPE_DEFAULT && acl_get_entry(acl, ACL_FIRST_ENTRY, &unused_entry) == 0) { - if (acl_delete_def_file(file->filename) == -1) { + if (acl_delete_def_file(file->fts_accpath) == -1) { warn("%s: acl_delete_def_file() failed", - file->filename); + file->fts_path); carried_error++; } continue; @@ -358,22 +406,22 @@ main(int argc, char *argv[]) } if (acl_type != ACL_TYPE_NFS4 && need_mask && - set_acl_mask(&acl, file->filename) == -1) { - warnx("%s: failed to set ACL mask", file->filename); + set_acl_mask(&acl, file->fts_path) == -1) { + warnx("%s: failed to set ACL mask", file->fts_path); carried_error++; - } else if (h_flag) { - if (acl_set_link_np(file->filename, acl_type, + } else if (follow_symlink) { + if (acl_set_file(file->fts_accpath, acl_type, acl) == -1) { carried_error++; - warn("%s: acl_set_link_np() failed", - file->filename); + warn("%s: acl_set_file() failed", + file->fts_path); } } else { - if (acl_set_file(file->filename, acl_type, + if (acl_set_link_np(file->fts_accpath, acl_type, acl) == -1) { carried_error++; - warn("%s: acl_set_file() failed", - file->filename); + warn("%s: acl_set_link_np() failed", + file->fts_path); } } Modified: head/bin/setfacl/setfacl.h ============================================================================== --- head/bin/setfacl/setfacl.h Tue Apr 10 22:57:56 2018 (r332395) +++ head/bin/setfacl/setfacl.h Tue Apr 10 23:29:57 2018 (r332396) @@ -47,6 +47,7 @@ void remove_ext(acl_t *prev_acl, const char *filenam int set_acl_mask(acl_t *prev_acl, const char *filename); /* util.c */ void *zmalloc(size_t size); +void *zrealloc(void *ptr, size_t size); const char *brand_name(int brand); int branding_mismatch(int brand1, int brand2); Modified: head/bin/setfacl/util.c ============================================================================== --- head/bin/setfacl/util.c Tue Apr 10 22:57:56 2018 (r332395) +++ head/bin/setfacl/util.c Tue Apr 10 23:29:57 2018 (r332396) @@ -44,6 +44,17 @@ zmalloc(size_t size) return (ptr); } +void * +zrealloc(void *ptr, size_t size) +{ + void *newptr; + + newptr = realloc(ptr, size); + if (newptr == NULL) + err(1, "realloc() failed"); + return (newptr); +} + const char * brand_name(int brand) { From owner-svn-src-all@freebsd.org Tue Apr 10 23:38:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A84EFA3DA6; Tue, 10 Apr 2018 23:38:32 +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 1CBC07FE1E; Tue, 10 Apr 2018 23:38:32 +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 17BA714681; Tue, 10 Apr 2018 23:38:32 +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 w3ANcVg5080758; Tue, 10 Apr 2018 23:38:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ANcVrJ080757; Tue, 10 Apr 2018 23:38:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804102338.w3ANcVrJ080757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Apr 2018 23:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332397 - stable/11/contrib/bsnmp/lib X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/bsnmp/lib X-SVN-Commit-Revision: 332397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 23:38:32 -0000 Author: emaste Date: Tue Apr 10 23:38:31 2018 New Revision: 332397 URL: https://svnweb.freebsd.org/changeset/base/332397 Log: MFC r308490 by syrinx: Reply to a snmpEngineID discovery PDU with a Report PDU as per the requirements of RFC 3414 section 4. PR: 174974 Submitted by: pguyot@kallisys.net Modified: stable/11/contrib/bsnmp/lib/snmpagent.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/lib/snmpagent.c ============================================================================== --- stable/11/contrib/bsnmp/lib/snmpagent.c Tue Apr 10 23:29:57 2018 (r332396) +++ stable/11/contrib/bsnmp/lib/snmpagent.c Tue Apr 10 23:38:31 2018 (r332397) @@ -171,7 +171,10 @@ snmp_pdu_create_response(const struct snmp_pdu *pdu, s memset(resp, 0, sizeof(*resp)); strcpy(resp->community, pdu->community); resp->version = pdu->version; - resp->type = SNMP_PDU_RESPONSE; + if (pdu->flags & SNMP_MSG_AUTODISCOVER) + resp->type = SNMP_PDU_REPORT; /* RFC 3414.4 */ + else + resp->type = SNMP_PDU_RESPONSE; resp->request_id = pdu->request_id; resp->version = pdu->version; From owner-svn-src-all@freebsd.org Wed Apr 11 01:43:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B059F88597; Wed, 11 Apr 2018 01:43:30 +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 1B6DE7ECF2; Wed, 11 Apr 2018 01:43:30 +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 1655515BD5; Wed, 11 Apr 2018 01:43:30 +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 w3B1hTXo045077; Wed, 11 Apr 2018 01:43:29 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3B1hT5o045075; Wed, 11 Apr 2018 01:43:29 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804110143.w3B1hT5o045075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 11 Apr 2018 01:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332398 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 01:43:30 -0000 Author: mjg Date: Wed Apr 11 01:43:29 2018 New Revision: 332398 URL: https://svnweb.freebsd.org/changeset/base/332398 Log: locks: extend speculative spin waiting for readers to drain Now that 10 years have passed since the original limit of 10000 was committed, bump it a little bit. Spinning waiting for writers is semi-informed in the sense that we always know if the owner is running and base the decision to spin on that. However, no such information is provided for read-locking. In particular this means that it is possible for a write-spinner to completely waste cpu time waiting for the lock to be released, while the reader holding it was preempted and is now waiting for the spinner to go off cpu. Nonetheless, in majority of cases it is an improvement to spin instead of instantly giving up and going to sleep. The current approach is pretty simple: snatch the number of current readers and performs that many pauses before checking again. The total number of pauses to execute is limited to 10k. If the lock is still not free by that time, go to sleep. Given the previously noted problem of not knowing whether spinning makes any sense to begin with the new limit has to remain rather conservative. But at the very least it should also be related to the machine. Waiting for writers uses parameters selected based on the number of activated hardware threads. The upper limit of pause instructions to be executed in-between re-reads of the lock is typically 16384 or 32678. It was selected as the limit of total spins. The lower bound is set to already present 10000 as to not change it for smaller machines. Bumping the limit reduces system time by few % during benchmarks like buildworld, buildkernel and others. Tested on 2 and 4 socket machines (Broadwell, Skylake). Figuring out how to make a more informed decision while not pessimizing the fast path is left as an exercise for the reader. Modified: head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Apr 10 23:38:31 2018 (r332397) +++ head/sys/kern/kern_rwlock.c Wed Apr 11 01:43:29 2018 (r332398) @@ -95,8 +95,8 @@ struct lock_class lock_class_rw = { }; #ifdef ADAPTIVE_RWLOCKS -static int __read_frequently rowner_retries = 10; -static int __read_frequently rowner_loops = 10000; +static int __read_frequently rowner_retries; +static int __read_frequently rowner_loops; static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL, "rwlock debugging"); SYSCTL_INT(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, ""); @@ -109,7 +109,15 @@ SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_base, CTLFLA SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_max, CTLFLAG_RW, &rw_delay.max, 0, ""); -LOCK_DELAY_SYSINIT_DEFAULT(rw_delay); +static void +rw_lock_delay_init(void *arg __unused) +{ + + lock_delay_default_init(&rw_delay); + rowner_retries = 10; + rowner_loops = max(10000, rw_delay.max); +} +LOCK_DELAY_SYSINIT(rw_lock_delay_init); #endif /* Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Tue Apr 10 23:38:31 2018 (r332397) +++ head/sys/kern/kern_sx.c Wed Apr 11 01:43:29 2018 (r332398) @@ -145,8 +145,8 @@ struct lock_class lock_class_sx = { #endif #ifdef ADAPTIVE_SX -static __read_frequently u_int asx_retries = 10; -static __read_frequently u_int asx_loops = 10000; +static __read_frequently u_int asx_retries; +static __read_frequently u_int asx_loops; static SYSCTL_NODE(_debug, OID_AUTO, sx, CTLFLAG_RD, NULL, "sxlock debugging"); SYSCTL_UINT(_debug_sx, OID_AUTO, retries, CTLFLAG_RW, &asx_retries, 0, ""); SYSCTL_UINT(_debug_sx, OID_AUTO, loops, CTLFLAG_RW, &asx_loops, 0, ""); @@ -158,7 +158,15 @@ SYSCTL_INT(_debug_sx, OID_AUTO, delay_base, CTLFLAG_RW SYSCTL_INT(_debug_sx, OID_AUTO, delay_max, CTLFLAG_RW, &sx_delay.max, 0, ""); -LOCK_DELAY_SYSINIT_DEFAULT(sx_delay); +static void +sx_lock_delay_init(void *arg __unused) +{ + + lock_delay_default_init(&sx_delay); + asx_retries = 10; + asx_loops = max(10000, sx_delay.max); +} +LOCK_DELAY_SYSINIT(sx_lock_delay_init); #endif void From owner-svn-src-all@freebsd.org Wed Apr 11 04:52:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 178AFF9511A; Wed, 11 Apr 2018 04:52:07 +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 AB994871DE; Wed, 11 Apr 2018 04:52:06 +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 6948B146C0; Wed, 11 Apr 2018 04:52:00 +0000 (UTC) Subject: Re: svn commit: r332365 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804101356.w3ADu6Jr072766@repo.freebsd.org> From: Allan Jude Openpgp: preference=signencrypt Message-ID: <33ea9236-2442-10d6-95d0-9e4d33c4613e@freebsd.org> Date: Wed, 11 Apr 2018 00:51:55 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201804101356.w3ADu6Jr072766@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bv5MZTSXhBrZQG7Ah1pQNP4qbfe0jggFx" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 04:52:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Bv5MZTSXhBrZQG7Ah1pQNP4qbfe0jggFx Content-Type: multipart/mixed; boundary="NbJClafTHxD5uEnny03GpV5P87esparfL"; protected-headers="v1" From: Allan Jude To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <33ea9236-2442-10d6-95d0-9e4d33c4613e@freebsd.org> Subject: Re: svn commit: r332365 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201804101356.w3ADu6Jr072766@repo.freebsd.org> In-Reply-To: <201804101356.w3ADu6Jr072766@repo.freebsd.org> --NbJClafTHxD5uEnny03GpV5P87esparfL Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-04-10 09:56, Mark Johnston wrote: > Author: markj > Date: Tue Apr 10 13:56:06 2018 > New Revision: 332365 > URL: https://svnweb.freebsd.org/changeset/base/332365 >=20 > Log: > Set zfs_arc_free_target to v_free_target. > =20 > Page daemon output is now regulated by a PID controller with a setpoi= nt > of v_free_target. Moreover, the page daemon now wakes up regularly > rather than waiting for a wakeup from another thread. This means that= > the free page count is unlikely to drop below the old > zfs_arc_free_target value, and as a result the ARC was not readily > freeing pages under memory pressure. Address the immediate problem by= > updating zfs_arc_free_target to match the page daemon's new behaviour= =2E > =20 > Reported and tested by: truckman > Discussed with: jeff > X-MFC with: r329882 > Differential Revision: https://reviews.freebsd.org/D14994 >=20 On a somewhat unrelated note, can we rename this sysctl and change to be counted in bytes? When users are tuning ZFS, every other ZFS value is in bytes, not pages. Maybe keep the currently variable as it is, in pages, and adjust it by dividing the user set value by the page size. The current name is great, but I wouldn't want anyone to end up setting it to 4096x the value they actually want if we just changed it out from under them. --=20 Allan Jude --NbJClafTHxD5uEnny03GpV5P87esparfL-- --Bv5MZTSXhBrZQG7Ah1pQNP4qbfe0jggFx 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) iQIcBAEBAgAGBQJazZRvAAoJEBmVNT4SmAt+fDoQAOjY4MAP17oUWGUo0zgfqWww Yt2f2TUwzB5p61EscwIkhUo/4LalQWihnkm3EM0jF7piiaa+Kzei0aWX0Ky4Adv+ mcfU8CYbOakvqJ6PpxEBK0NZGkzTETCzLRxBA0RDtZnZJW4GddwuACp1D7LZHl5e TbFh0kWETs9kt/ADxPbjIMfyRUoxyh1bVnR4eeSTRHF/uuB2chmrVxTJBTG0kVU8 t2VpvefRee1X1XPJNKKIqOSsWLiN/VaEljEcwRmPTy/LDwLCxOnwkbMs0mFFOm71 OzZerSIMUI3e7irhQB9DDtyY5I98aybCKpEQqC8ctzRyaGVOhcNxuprLy5+w4UUO SvOkHMebMSOMxtgSjxJZYyy3b43CSggTXMtWQVVvdSI0++gz9RhtTy4diqF32oXq N9jOiWPn9J9cvjiKYai+SCwQoHrAFXPx+/SdVMuRu1+81nwFD8MAVzitlpxBK6XS mh6pBDIVOycqeGbiswMl2RT60n2AgazWHameR/mo27nWm0m5hqMV2MynjvIEVMOv YIdta3DYUVcdSTCt/jbr2HdsL+M34U/7q5A1MT5NoI1y6NGLk2JLEORa+EdljxHt 2M53vBZgW8712Jj5p34+z/+PPSzbkKDfpR6M6bD3fmqgC73/oHCDR/JkDB+oNAGc PO23nvJNRT89ukWXiw1q =X8iN -----END PGP SIGNATURE----- --Bv5MZTSXhBrZQG7Ah1pQNP4qbfe0jggFx-- From owner-svn-src-all@freebsd.org Wed Apr 11 05:04:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 834B3F95F49; Wed, 11 Apr 2018 05:04:59 +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 1F4376B88A; Wed, 11 Apr 2018 05:04:59 +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 6D3DA146E7; Wed, 11 Apr 2018 05:04:58 +0000 (UTC) Subject: Re: svn commit: r315449 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Allan Jude To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: Andriy Gapon , Josh Paetzel , Alexander Motin , Mark Johnston References: <201703171234.v2HCYvgd026429@repo.freebsd.org> <6bf452f9-fd55-1ea9-196a-1cfcf97d06f4@freebsd.org> Openpgp: preference=signencrypt Message-ID: <67b803af-3ec3-1bf4-68d9-8cfa19dde160@freebsd.org> Date: Wed, 11 Apr 2018 01:04:54 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <6bf452f9-fd55-1ea9-196a-1cfcf97d06f4@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FvKA9jmSEiZ4hcNv4wJsPdcs0VzkmlO1I" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 05:04:59 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FvKA9jmSEiZ4hcNv4wJsPdcs0VzkmlO1I Content-Type: multipart/mixed; boundary="RS1c8P4Ud5TSvJ9m7xo6RsK4RjtV0w1fT"; protected-headers="v1" From: Allan Jude To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: Andriy Gapon , Josh Paetzel , Alexander Motin , Mark Johnston Message-ID: <67b803af-3ec3-1bf4-68d9-8cfa19dde160@freebsd.org> Subject: Re: svn commit: r315449 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201703171234.v2HCYvgd026429@repo.freebsd.org> <6bf452f9-fd55-1ea9-196a-1cfcf97d06f4@freebsd.org> In-Reply-To: <6bf452f9-fd55-1ea9-196a-1cfcf97d06f4@freebsd.org> --RS1c8P4Ud5TSvJ9m7xo6RsK4RjtV0w1fT Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-02-25 22:56, Allan Jude wrote: > On 2017-03-17 08:34, Steven Hartland wrote: >> Author: smh >> Date: Fri Mar 17 12:34:57 2017 >> New Revision: 315449 >> URL: https://svnweb.freebsd.org/changeset/base/315449 >> >> Log: >> Reduce ARC fragmentation threshold >> =20 >> As ZFS can request up to SPA_MAXBLOCKSIZE memory block e.g. during z= fs recv, >> update the threshold at which we start agressive reclamation to use >> SPA_MAXBLOCKSIZE (16M) instead of the lower zfs_max_recordsize which= >> defaults to 1M. >> =20 >> PR: 194513 >> Reviewed by: avg, mav >> MFC after: 1 month >> Sponsored by: Multiplay >> Differential Revision: https://reviews.freebsd.org/D10012 >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.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/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Mar = 17 12:34:56 2017 (r315448) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Mar = 17 12:34:57 2017 (r315449) >> @@ -3978,7 +3978,7 @@ arc_available_memory(void) >> * Start aggressive reclamation if too little sequential KVA left. >> */ >> if (lowest > 0) { >> - n =3D (vmem_size(heap_arena, VMEM_MAXFREE) < zfs_max_recordsize) ? >> + n =3D (vmem_size(heap_arena, VMEM_MAXFREE) < SPA_MAXBLOCKSIZE) ? >> -((int64_t)vmem_size(heap_arena, VMEM_ALLOC) >> 4) : >> INT64_MAX; >> if (n < lowest) { >> >=20 > I have some users reporting excessive ARC shrinking in 11.1 vs 11.0 due= > to this change. >=20 > Memory seems quite fragmented, and this change makes it much more > sensitive to that, but the problem seems to be that is can get to > aggressive. >=20 > The most recent case, the machine has 128GB of ram, and no other major > processes running, just ZFS zvols being served over iSCIS by ctld. >=20 > arc_max set to 85GB, rather conservative. After running for a few days,= > fragmentation seems to trip this line, when there are no 16mb contiguou= s > blocks, and it shrinks the ARC by 1/16th of memory, but this does not > result in a 16mb contiguous chunk, so it shrinks the ARC by another > 1/16th, and again until it hits arc_min. Apparently eventually the ARC > does regrow, but then crashes again later. >=20 > You can see the ARC oscillating between arc_max and arc_min, with some > long periods pinned at arc_min: https://imgur.com/a/emztF >=20 >=20 > [root@ZFS-AF ~]# vmstat -z | tail +3 | awk -F '[:,] *' 'BEGIN { total=3D= 0; > cache=3D0; used=3D0 } {u =3D $2 * $4; c =3D $2 * $5; t =3D u + c; cache= +=3D c; used > +=3D u; total +=3D t; name=3D$1; gsub(" ", "_", name); print t, name, u= , c} > END { print total, "TOTAL", used, cache } ' | sort -n | perl -a -p -e > 'while (($j, $_) =3D each(@F)) { 1 while s/^(-?\d+)(\d{3})/$1,$2/; prin= t > $_, " "} print "\n"' | column -t | tail TOTAL NAME USED Cache > 1,723,367,424 zio_data_buf_49152 1,722,875,904 491,520 > 1,827,057,664 zio_buf_4096 1,826,848,768 208,896 > 2,289,459,200 zio_data_buf_40960 2,289,090,560 368,640 > 3,642,736,640 zio_data_buf_81920 3,642,408,960 327,680 > 6,713,180,160 zio_data_buf_98304 6,712,688,640 491,520 > 9,388,195,840 zio_buf_8192 9,388,064,768 131,072 > 11,170,152,448 zio_data_buf_114688 11,168,890,880 1,261,568 > 29,607,329,792 zio_data_buf_131072 29,606,674,432 655,360 > 32,944,750,592 zio_buf_65536 32,943,833,088 917,504 > 114,235,296,752 TOTAL 111,787,212,900 2,448,083,852 >=20 >=20 > [root@ZFS-AF ~]# vmstat -z | tail +3 | awk -F '[:,] *' 'BEGIN { total=3D= 0; > cache=3D0; used=3D0 } {u =3D $2 * $4; c =3D $2 * $5; t =3D u + c; cache= +=3D c; used > +=3D u; total +=3D t; name=3D$1; gsub(" ", "_", name); print t, name, u= , c} > END { print total, "TOTAL", used, cache } ' | sort -n +3 | perl -a -p -= e > 'while (($j, $_) =3D each(@F)) { 1 while s/^(-?\d+)(\d{3})/$1,$2/; prin= t > $_, " "} print "\n"' | column -t | tail Sorted by cache (waste) TOTAL NAME USED Cache > 71,565,312 cblk15 0 71,565,312 > 72,220,672 cblk16 0 72,220,672 > 72,351,744 cblk18 131,072 72,220,672 > 72,744,960 cblk3 0 72,744,960 > 75,497,472 cblk8 0 75,497,472 > 76,283,904 cblk22 0 76,283,904 > 403,696,384 128 286,225,792 117,470,592 > 229,519,360 mbuf_jumbo_page 67,043,328 162,476,032 > 1,196,795,160 arc_buf_hdr_t_l2only 601,620,624 595,174,536 > 114,220,354,544 TOTAL 111,778,349,508 2,442,005,036 >=20 >=20 > Maybe the right thing to do is call the new kmem_cache_reap_soon() or > other functions that might actually reduce fragmentation, or rate limit= > how quickly the ARC will shrink? >=20 > What kind of tools do we have to look at why memory is so fragmented > that ZFS feels the need to tank the ARC? >=20 >=20 >=20 > I know this block and the FMR_ZIO_FRAG reason have been removed from > -CURRENT as part of the NUMA work, but I am worried about addressing > this issue for the upcoming 11.2-RELEASE. >=20 >=20 >=20 Does anyone have any thoughts on this? The 11.2 code slush starts in 1 week, so we really need to decide what to do here. --=20 Allan Jude --RS1c8P4Ud5TSvJ9m7xo6RsK4RjtV0w1fT-- --FvKA9jmSEiZ4hcNv4wJsPdcs0VzkmlO1I 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) iQIcBAEBAgAGBQJazZd5AAoJEBmVNT4SmAt+YBIQAOuIMs21mhqgs3T+xJYtyIKL EvfE+wfe5N3SwO0TnUHb5vg6A6kX+9dJr9U2UH77x4gAxkrIyl/Gz0KDGg4SxfGR byMYUEkADbJ0aTR828Sw+bKnCRMvRSrZsWYkLM7AY+m5irCmhUXPgZcWECaj7GK9 rTqf6D8dFNFaP+SSnvypotwbv9lDi3RTOASXzrbQShwBGk1On5jNQBA2OqOGXJ2g 371iu+wpPzIQkxqHkQSDKu0vSGac7s03eGLqe7fqi+bUhTdi1pE8tY3F0mXlCwXP 3k8j+uTiPQk3eQg3KXVN2PYhljCV7/Ua+jXwlDQl0k61OB08xrQg5YUQ19WuFdpH 4AdlKzNyeDU1PyT4+cthFIudjHTlguC7CC/8hqELkIUWsHKJKXfUQyP6otG5tolZ vayx7x+w/ibUDdxMEGIdfJhHaOdbV/WJ8v+2cyxpveK6OeMAPpy726eARRNRe85Q PnE/Wp8neTUCpT4p5SsT8uSb3LHaTVDcB53tP3Xtw7LkoeS+CIzkksbayxJBU+g8 9I3ObAeL36VuNjA35UosztaVt6vqS0DdPN3rSItfckBdDzZSaQ2GvfFdErhotU3a nS3LhHP8Rowe5rv9RIk6onejzUV8agE+hXmyvsnVVfumHX904KPOdWbAZ2ruzRjF 9v0JdfThXOYnVnb82VP9 =egwp -----END PGP SIGNATURE----- --FvKA9jmSEiZ4hcNv4wJsPdcs0VzkmlO1I-- From owner-svn-src-all@freebsd.org Wed Apr 11 07:15:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3A51F9ECE4; Wed, 11 Apr 2018 07:15:30 +0000 (UTC) (envelope-from eadler@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 950F187C4C; Wed, 11 Apr 2018 07:15:30 +0000 (UTC) (envelope-from eadler@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 900FF190B5; Wed, 11 Apr 2018 07:15:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3B7FUgv009365; Wed, 11 Apr 2018 07:15:30 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3B7FUCo009364; Wed, 11 Apr 2018 07:15:30 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201804110715.w3B7FUCo009364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 11 Apr 2018 07:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332399 - head/tests/sys/acl X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/tests/sys/acl X-SVN-Commit-Revision: 332399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 07:15:31 -0000 Author: eadler Date: Wed Apr 11 07:15:30 2018 New Revision: 332399 URL: https://svnweb.freebsd.org/changeset/base/332399 Log: [tests] change tests/sys/acl/run to run on perl 5.26 Previously unescaped regex just resulted in a warning. Now it results in a failed test. Modified: head/tests/sys/acl/run Modified: head/tests/sys/acl/run ============================================================================== --- head/tests/sys/acl/run Wed Apr 11 01:43:29 2018 (r332398) +++ head/tests/sys/acl/run Wed Apr 11 07:15:30 2018 (r332399) @@ -70,7 +70,7 @@ for (;;) { if (defined $line) { # Substitute %VAR and %{VAR} with environment variables. $line =~ s[%(\w+)][$ENV{$1}]eg; - $line =~ s[%{(\w+)}][$ENV{$1}]eg; + $line =~ s[%\{(\w+)\}][$ENV{$1}]eg; } if (defined $line) { if ($line =~ s/^\s*< ?//) { From owner-svn-src-all@freebsd.org Wed Apr 11 10:24:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDF91F871BC; Wed, 11 Apr 2018 10:24:47 +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 909696A956; Wed, 11 Apr 2018 10:24:47 +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 8755F1AF7B; Wed, 11 Apr 2018 10:24:47 +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 w3BAOl9H004673; Wed, 11 Apr 2018 10:24:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BAOl1j004671; Wed, 11 Apr 2018 10:24:47 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804111024.w3BAOl1j004671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 11 Apr 2018 10:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332400 - stable/11/sbin/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sbin/ipfw X-SVN-Commit-Revision: 332400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 10:24:48 -0000 Author: ae Date: Wed Apr 11 10:24:47 2018 New Revision: 332400 URL: https://svnweb.freebsd.org/changeset/base/332400 Log: MFC r331668: Rework ipfw rules parsing and printing code. Introduce show_state structure to keep information about printed opcodes. Split show_static_rule() function into several smaller functions. Make parsing and printing opcodes into several passes. Each printed opcode is marked in show_state structure and will be skipped in next passes. Now show_static_rule() function is simple, it just prints each part of rule separately: action, modifiers, proto, src and dst addresses, options. The main goal of this change is avoiding occurrence of wrong result of `ifpw show` command, that can not be parsed by ipfw(8). Also now it is possible to make some simple static optimizations by reordering of opcodes in the rule. PR: 222705 Modified: stable/11/sbin/ipfw/ipfw2.c stable/11/sbin/ipfw/ipfw2.h stable/11/sbin/ipfw/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw2.c ============================================================================== --- stable/11/sbin/ipfw/ipfw2.c Wed Apr 11 07:15:30 2018 (r332399) +++ stable/11/sbin/ipfw/ipfw2.c Wed Apr 11 10:24:47 2018 (r332400) @@ -1176,7 +1176,7 @@ print_flags(struct buf_pr *bp, char const *name, ipfw_ * Print the ip address contained in a command. */ static void -print_ip(struct buf_pr *bp, struct format_opts *fo, ipfw_insn_ip *cmd, +print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd, char const *s) { struct hostent *he = NULL; @@ -1277,7 +1277,7 @@ print_ip(struct buf_pr *bp, struct format_opts *fo, ip * prints a MAC address/mask pair */ static void -print_mac(struct buf_pr *bp, uint8_t *addr, uint8_t *mask) +format_mac(struct buf_pr *bp, uint8_t *addr, uint8_t *mask) { int l = contigmask(mask, 48); @@ -1296,6 +1296,15 @@ print_mac(struct buf_pr *bp, uint8_t *addr, uint8_t *m } static void +print_mac(struct buf_pr *bp, ipfw_insn_mac *mac) +{ + + bprintf(bp, " MAC"); + format_mac(bp, mac->addr, mac->mask); + format_mac(bp, mac->addr + 6, mac->mask + 6); +} + +static void fill_icmptypes(ipfw_insn_u32 *cmd, char *av) { uint8_t type; @@ -1358,817 +1367,843 @@ print_dscp(struct buf_pr *bp, ipfw_insn_u32 *cmd) } } -/* - * show_ipfw() prints the body of an ipfw rule. - * Because the standard rule has at least proto src_ip dst_ip, we use - * a helper function to produce these entries if not provided explicitly. - * The first argument is the list of fields we have, the second is - * the list of fields we want to be printed. - * - * Special cases if we have provided a MAC header: - * + if the rule does not contain IP addresses/ports, do not print them; - * + if the rule does not contain an IP proto, print "all" instead of "ip"; - * - * Once we have 'have_options', IP header fields are printed as options. - */ +#define insntod(cmd, type) ((ipfw_insn_ ## type *)(cmd)) +struct show_state { + struct ip_fw_rule *rule; + const ipfw_insn *eaction; + uint8_t *printed; + int flags; #define HAVE_PROTO 0x0001 #define HAVE_SRCIP 0x0002 #define HAVE_DSTIP 0x0004 -#define HAVE_PROTO4 0x0008 -#define HAVE_PROTO6 0x0010 -#define HAVE_IP 0x0100 -#define HAVE_OPTIONS 0x8000 + int proto; + int or_block; +}; -static void -show_prerequisites(struct buf_pr *bp, int *flags, int want, int cmd) +static int +init_show_state(struct show_state *state, struct ip_fw_rule *rule) { - (void)cmd; /* UNUSED */ - if (co.comment_only) - return; - if ( (*flags & HAVE_IP) == HAVE_IP) - *flags |= HAVE_OPTIONS; - if ( !(*flags & HAVE_OPTIONS)) { - if ( !(*flags & HAVE_PROTO) && (want & HAVE_PROTO)) { - if ( (*flags & HAVE_PROTO4)) - bprintf(bp, " ip4"); - else if ( (*flags & HAVE_PROTO6)) - bprintf(bp, " ip6"); - else - bprintf(bp, " ip"); - } - if ( !(*flags & HAVE_SRCIP) && (want & HAVE_SRCIP)) - bprintf(bp, " from any"); - if ( !(*flags & HAVE_DSTIP) && (want & HAVE_DSTIP)) - bprintf(bp, " to any"); - } - *flags |= want; + state->printed = calloc(rule->cmd_len, sizeof(uint8_t)); + if (state->printed == NULL) + return (ENOMEM); + state->rule = rule; + state->eaction = NULL; + state->flags = 0; + state->proto = 0; + state->or_block = 0; + return (0); } static void -show_static_rule(struct cmdline_opts *co, struct format_opts *fo, - struct buf_pr *bp, struct ip_fw_rule *rule, struct ip_fw_bcounter *cntr) +free_show_state(struct show_state *state) { - static int twidth = 0; - int l; - ipfw_insn *cmd, *has_eaction = NULL, *tagptr = NULL; - const char *comment = NULL; /* ptr to comment if we have one */ - const char *ename; - int proto = 0; /* default */ - int flags = 0; /* prerequisites */ - ipfw_insn_log *logptr = NULL; /* set if we find an O_LOG */ - ipfw_insn_altq *altqptr = NULL; /* set if we find an O_ALTQ */ - int or_block = 0; /* we are in an or block */ - uint32_t uval; - if ((fo->set_mask & (1 << rule->set)) == 0) { - /* disabled mask */ - if (!co->show_sets) - return; - else - bprintf(bp, "# DISABLED "); - } - bprintf(bp, "%05u ", rule->rulenum); + free(state->printed); +} - /* Print counters if enabled */ - if (fo->pcwidth > 0 || fo->bcwidth > 0) { - pr_u64(bp, &cntr->pcnt, fo->pcwidth); - pr_u64(bp, &cntr->bcnt, fo->bcwidth); - } +static uint8_t +is_printed_opcode(struct show_state *state, const ipfw_insn *cmd) +{ - if (co->do_time == 2) - bprintf(bp, "%10u ", cntr->timestamp); - else if (co->do_time == 1) { - char timestr[30]; - time_t t = (time_t)0; + return (state->printed[cmd - state->rule->cmd]); +} - if (twidth == 0) { - strcpy(timestr, ctime(&t)); - *strchr(timestr, '\n') = '\0'; - twidth = strlen(timestr); - } - if (cntr->timestamp > 0) { - t = _long_to_time(cntr->timestamp); +static void +mark_printed(struct show_state *state, const ipfw_insn *cmd) +{ - strcpy(timestr, ctime(&t)); - *strchr(timestr, '\n') = '\0'; - bprintf(bp, "%s ", timestr); - } else { - bprintf(bp, "%*s", twidth, " "); - } - } + state->printed[cmd - state->rule->cmd] = 1; +} - if (co->show_sets) - bprintf(bp, "set %d ", rule->set); +static void +print_limit(struct buf_pr *bp, const ipfw_insn_limit *limit) +{ + struct _s_x *p = limit_masks; + char const *comma = " "; + uint8_t x; - /* - * print the optional "match probability" - */ - if (rule->cmd_len > 0) { - cmd = rule->cmd ; - if (cmd->opcode == O_PROB) { - ipfw_insn_u32 *p = (ipfw_insn_u32 *)cmd; - double d = 1.0 * p->d[0]; - - d = (d / 0x7fffffff); - bprintf(bp, "prob %f ", d); + bprintf(bp, " limit"); + for (x = limit->limit_mask; p->x != 0; p++) { + if ((x & p->x) == p->x) { + x &= ~p->x; + bprintf(bp, "%s%s", comma, p->s); + comma = ","; } } + bprint_uint_arg(bp, " ", limit->conn_limit); +} - /* - * first print actions - */ - for (l = rule->cmd_len - rule->act_ofs, cmd = ACTION_PTR(rule); - l > 0 ; l -= F_LEN(cmd), cmd += F_LEN(cmd)) { - switch(cmd->opcode) { - case O_CHECK_STATE: - bprintf(bp, "check-state"); - if (cmd->arg1 != 0) - ename = object_search_ctlv(fo->tstate, - cmd->arg1, IPFW_TLV_STATE_NAME); - else - ename = NULL; - bprintf(bp, " :%s", ename ? ename: "any"); - /* avoid printing anything else */ - flags = HAVE_PROTO | HAVE_SRCIP | - HAVE_DSTIP | HAVE_IP; - break; +static int +print_instruction(struct buf_pr *bp, const struct format_opts *fo, + struct show_state *state, ipfw_insn *cmd) +{ + struct protoent *pe; + struct passwd *pwd; + struct group *grp; + const char *s; + double d; - case O_ACCEPT: - bprintf(bp, "allow"); - break; + if (is_printed_opcode(state, cmd)) + return (0); + if ((cmd->len & F_OR) != 0 && state->or_block == 0) + bprintf(bp, " {"); + if (cmd->opcode != O_IN && (cmd->len & F_NOT) != 0) + bprintf(bp, " not"); - case O_COUNT: - bprintf(bp, "count"); + switch (cmd->opcode) { + case O_PROB: + d = 1.0 * insntod(cmd, u32)->d[0] / 0x7fffffff; + bprintf(bp, "prob %f ", d); + break; + case O_PROBE_STATE: /* no need to print anything here */ + break; + case O_IP_SRC: + case O_IP_SRC_LOOKUP: + case O_IP_SRC_MASK: + case O_IP_SRC_ME: + case O_IP_SRC_SET: + case O_IP_DST: + case O_IP_DST_LOOKUP: + case O_IP_DST_MASK: + case O_IP_DST_ME: + case O_IP_DST_SET: + print_ip(bp, fo, insntod(cmd, ip), ""); + break; + case O_IP6_SRC: + case O_IP6_SRC_MASK: + case O_IP6_SRC_ME: + case O_IP6_DST: + case O_IP6_DST_MASK: + case O_IP6_DST_ME: + print_ip6(bp, insntod(cmd, ip6), ""); + break; + case O_FLOW6ID: + print_flow6id(bp, insntod(cmd, u32)); + break; + case O_IP_DSTPORT: + case O_IP_SRCPORT: + print_newports(bp, insntod(cmd, u16), state->proto, + (state->flags & (HAVE_SRCIP | HAVE_DSTIP)) == + (HAVE_SRCIP | HAVE_DSTIP) ? cmd->opcode: 0); + break; + case O_PROTO: + pe = getprotobynumber(cmd->arg1); + if (state->flags & HAVE_PROTO) + bprintf(bp, " proto"); + if (pe != NULL) + bprintf(bp, " %s", pe->p_name); + else + bprintf(bp, " %u", cmd->arg1); + break; + case O_MACADDR2: + print_mac(bp, insntod(cmd, mac)); + break; + case O_MAC_TYPE: + print_newports(bp, insntod(cmd, u16), + IPPROTO_ETHERTYPE, cmd->opcode); + break; + case O_FRAG: + bprintf(bp, " frag"); + break; + case O_FIB: + bprintf(bp, " fib %u", cmd->arg1); + break; + case O_SOCKARG: + bprintf(bp, " sockarg"); + break; + case O_IN: + bprintf(bp, cmd->len & F_NOT ? " out" : " in"); + break; + case O_DIVERTED: + switch (cmd->arg1) { + case 3: + bprintf(bp, " diverted"); break; - - case O_DENY: - bprintf(bp, "deny"); + case 2: + bprintf(bp, " diverted-output"); break; - - case O_REJECT: - if (cmd->arg1 == ICMP_REJECT_RST) - bprintf(bp, "reset"); - else if (cmd->arg1 == ICMP_REJECT_ABORT) - bprintf(bp, "abort"); - else if (cmd->arg1 == ICMP_UNREACH_HOST) - bprintf(bp, "reject"); - else - print_reject_code(bp, cmd->arg1); + case 1: + bprintf(bp, " diverted-loopback"); break; - - case O_UNREACH6: - if (cmd->arg1 == ICMP6_UNREACH_RST) - bprintf(bp, "reset6"); - else if (cmd->arg1 == ICMP6_UNREACH_ABORT) - bprintf(bp, "abort6"); - else - print_unreach6_code(bp, cmd->arg1); + default: + bprintf(bp, " diverted-?<%u>", cmd->arg1); break; - - case O_SKIPTO: - bprint_uint_arg(bp, "skipto ", cmd->arg1); + } + break; + case O_LAYER2: + bprintf(bp, " layer2"); + break; + case O_XMIT: + case O_RECV: + case O_VIA: + if (cmd->opcode == O_XMIT) + s = "xmit"; + else if (cmd->opcode == O_RECV) + s = "recv"; + else /* if (cmd->opcode == O_VIA) */ + s = "via"; + switch (insntod(cmd, if)->name[0]) { + case '\0': + bprintf(bp, " %s %s", s, + inet_ntoa(insntod(cmd, if)->p.ip)); break; - - case O_PIPE: - bprint_uint_arg(bp, "pipe ", cmd->arg1); + case '\1': + bprintf(bp, " %s table(%s)", s, + table_search_ctlv(fo->tstate, + insntod(cmd, if)->p.kidx)); break; - - case O_QUEUE: - bprint_uint_arg(bp, "queue ", cmd->arg1); - break; - - case O_DIVERT: - bprint_uint_arg(bp, "divert ", cmd->arg1); - break; - - case O_TEE: - bprint_uint_arg(bp, "tee ", cmd->arg1); - break; - - case O_NETGRAPH: - bprint_uint_arg(bp, "netgraph ", cmd->arg1); - break; - - case O_NGTEE: - bprint_uint_arg(bp, "ngtee ", cmd->arg1); - break; - - case O_FORWARD_IP: - { - ipfw_insn_sa *s = (ipfw_insn_sa *)cmd; - - if (s->sa.sin_addr.s_addr == INADDR_ANY) { - bprintf(bp, "fwd tablearg"); - } else { - bprintf(bp, "fwd %s",inet_ntoa(s->sa.sin_addr)); - } - if (s->sa.sin_port) - bprintf(bp, ",%d", s->sa.sin_port); - } - break; - - case O_FORWARD_IP6: - { - char buf[INET6_ADDRSTRLEN + IF_NAMESIZE + 2]; - ipfw_insn_sa6 *s = (ipfw_insn_sa6 *)cmd; - - bprintf(bp, "fwd "); - if (getnameinfo((const struct sockaddr *)&s->sa, - sizeof(struct sockaddr_in6), buf, sizeof(buf), - NULL, 0, NI_NUMERICHOST) == 0) - bprintf(bp, "%s", buf); - if (s->sa.sin6_port) - bprintf(bp, ",%d", s->sa.sin6_port); - } - break; - - case O_LOG: /* O_LOG is printed last */ - logptr = (ipfw_insn_log *)cmd; - break; - - case O_ALTQ: /* O_ALTQ is printed after O_LOG */ - altqptr = (ipfw_insn_altq *)cmd; - break; - - case O_TAG: - tagptr = cmd; - break; - - case O_NAT: - if (cmd->arg1 != IP_FW_NAT44_GLOBAL) - bprint_uint_arg(bp, "nat ", cmd->arg1); - else - bprintf(bp, "nat global"); - break; - - case O_SETFIB: - if (cmd->arg1 == IP_FW_TARG) - bprint_uint_arg(bp, "setfib ", cmd->arg1); - else - bprintf(bp, "setfib %u", cmd->arg1 & 0x7FFF); - break; - - case O_EXTERNAL_ACTION: { - /* - * The external action can consists of two following - * each other opcodes - O_EXTERNAL_ACTION and - * O_EXTERNAL_INSTANCE. The first contains the ID of - * name of external action. The second contains the ID - * of name of external action instance. - * NOTE: in case when external action has no named - * instances support, the second opcode isn't needed. - */ - has_eaction = cmd; - ename = object_search_ctlv(fo->tstate, cmd->arg1, - IPFW_TLV_EACTION); - if (match_token(rule_eactions, ename) != -1) - bprintf(bp, "%s", ename); - else - bprintf(bp, "eaction %s", ename); - break; + default: + bprintf(bp, " %s %s", s, + insntod(cmd, if)->name); } - - case O_EXTERNAL_INSTANCE: { - if (has_eaction == NULL) + break; + case O_IP_FLOW_LOOKUP: + s = table_search_ctlv(fo->tstate, cmd->arg1); + bprintf(bp, " flow table(%s", s); + if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn_u32)) + bprintf(bp, ",%u", insntod(cmd, u32)->d[0]); + bprintf(bp, ")"); + break; + case O_IPID: + case O_IPTTL: + case O_IPLEN: + case O_TCPDATALEN: + case O_TCPWIN: + if (F_LEN(cmd) == 1) { + switch (cmd->opcode) { + case O_IPID: + s = "ipid"; break; - /* - * XXX: we need to teach ipfw(9) to rewrite opcodes - * in the user buffer on rule addition. When we add - * the rule, we specify zero TLV type for - * O_EXTERNAL_INSTANCE object. To show correct - * rule after `ipfw add` we need to search instance - * name with zero type. But when we do `ipfw show` - * we calculate TLV type using IPFW_TLV_EACTION_NAME() - * macro. - */ - ename = object_search_ctlv(fo->tstate, cmd->arg1, 0); - if (ename == NULL) - ename = object_search_ctlv(fo->tstate, - cmd->arg1, - IPFW_TLV_EACTION_NAME(has_eaction->arg1)); - bprintf(bp, " %s", ename); - break; - } - - case O_EXTERNAL_DATA: { - if (has_eaction == NULL) + case O_IPTTL: + s = "ipttl"; break; - /* - * Currently we support data formatting only for - * external data with datalen u16. For unknown data - * print its size in bytes. - */ - if (cmd->len == F_INSN_SIZE(ipfw_insn)) - bprintf(bp, " %u", cmd->arg1); - else - bprintf(bp, " %ubytes", - cmd->len * sizeof(uint32_t)); - break; - } - - case O_SETDSCP: - { - const char *code; - - if (cmd->arg1 == IP_FW_TARG) { - bprint_uint_arg(bp, "setdscp ", cmd->arg1); + case O_IPLEN: + s = "iplen"; break; + case O_TCPDATALEN: + s = "tcpdatalen"; + break; + case O_TCPWIN: + s = "tcpwin"; + break; } - uval = cmd->arg1 & 0x3F; - if ((code = match_value(f_ipdscp, uval)) != NULL) - bprintf(bp, "setdscp %s", code); - else - bprint_uint_arg(bp, "setdscp ", uval); - } - break; + bprintf(bp, " %s %u", s, cmd->arg1); + } else + print_newports(bp, insntod(cmd, u16), 0, + cmd->opcode); + break; + case O_IPVER: + bprintf(bp, " ipver %u", cmd->arg1); + break; + case O_IPPRECEDENCE: + bprintf(bp, " ipprecedence %u", cmd->arg1 >> 5); + break; + case O_DSCP: + print_dscp(bp, insntod(cmd, u32)); + break; + case O_IPOPT: + print_flags(bp, "ipoptions", cmd, f_ipopts); + break; + case O_IPTOS: + print_flags(bp, "iptos", cmd, f_iptos); + break; + case O_ICMPTYPE: + print_icmptypes(bp, insntod(cmd, u32)); + break; + case O_ESTAB: + bprintf(bp, " established"); + break; + case O_TCPFLAGS: + print_flags(bp, "tcpflags", cmd, f_tcpflags); + break; + case O_TCPOPTS: + print_flags(bp, "tcpoptions", cmd, f_tcpopts); + break; + case O_TCPACK: + bprintf(bp, " tcpack %d", + ntohl(insntod(cmd, u32)->d[0])); + break; + case O_TCPSEQ: + bprintf(bp, " tcpseq %d", + ntohl(insntod(cmd, u32)->d[0])); + break; + case O_UID: + pwd = getpwuid(insntod(cmd, u32)->d[0]); + if (pwd != NULL) + bprintf(bp, " uid %s", pwd->pw_name); + else + bprintf(bp, " uid %u", + insntod(cmd, u32)->d[0]); + break; + case O_GID: + grp = getgrgid(insntod(cmd, u32)->d[0]); + if (grp != NULL) + bprintf(bp, " gid %s", grp->gr_name); + else + bprintf(bp, " gid %u", + insntod(cmd, u32)->d[0]); + break; + case O_JAIL: + bprintf(bp, " jail %d", insntod(cmd, u32)->d[0]); + break; + case O_VERREVPATH: + bprintf(bp, " verrevpath"); + break; + case O_VERSRCREACH: + bprintf(bp, " versrcreach"); + break; + case O_ANTISPOOF: + bprintf(bp, " antispoof"); + break; + case O_IPSEC: + bprintf(bp, " ipsec"); + break; + case O_NOP: + bprintf(bp, " // %s", (char *)(cmd + 1)); + break; + case O_KEEP_STATE: + bprintf(bp, " keep-state"); + bprintf(bp, " :%s", + object_search_ctlv(fo->tstate, cmd->arg1, + IPFW_TLV_STATE_NAME)); + break; + case O_LIMIT: + print_limit(bp, insntod(cmd, limit)); + bprintf(bp, " :%s", + object_search_ctlv(fo->tstate, cmd->arg1, + IPFW_TLV_STATE_NAME)); + break; + case O_IP6: + bprintf(bp, " ip6"); + break; + case O_IP4: + bprintf(bp, " ip4"); + break; + case O_ICMP6TYPE: + print_icmp6types(bp, insntod(cmd, u32)); + break; + case O_EXT_HDR: + print_ext6hdr(bp, cmd); + break; + case O_TAGGED: + if (F_LEN(cmd) == 1) + bprint_uint_arg(bp, " tagged ", cmd->arg1); + else + print_newports(bp, insntod(cmd, u16), + 0, O_TAGGED); + break; + default: + bprintf(bp, " [opcode %d len %d]", cmd->opcode, + cmd->len); + } + if (cmd->len & F_OR) { + bprintf(bp, " or"); + state->or_block = 1; + } else if (state->or_block != 0) { + bprintf(bp, " }"); + state->or_block = 0; + } + mark_printed(state, cmd); - case O_REASS: - bprintf(bp, "reass"); - break; + return (1); +} - case O_CALLRETURN: - if (cmd->len & F_NOT) - bprintf(bp, "return"); - else - bprint_uint_arg(bp, "call ", cmd->arg1); - break; +static ipfw_insn * +print_opcode(struct buf_pr *bp, struct format_opts *fo, + struct show_state *state, uint8_t opcode) +{ + ipfw_insn *cmd; + int l; - default: - bprintf(bp, "** unrecognized action %d len %d ", - cmd->opcode, cmd->len); - } + for (l = state->rule->act_ofs, cmd = state->rule->cmd; + l > 0; l -= F_LEN(cmd), cmd += F_LEN(cmd)) { + /* We use zero opcode to print the rest of options */ + if (opcode != 0 && cmd->opcode != opcode) + continue; + /* + * Skip O_NOP, when we printing the rest + * of options, it will be handled separately. + */ + if (cmd->opcode == O_NOP && opcode != O_NOP) + continue; + if (!print_instruction(bp, fo, state, cmd)) + continue; + return (cmd); } - if (logptr) { - if (logptr->max_log > 0) - bprintf(bp, " log logamount %d", logptr->max_log); + return (NULL); +} + +static void +print_fwd(struct buf_pr *bp, const ipfw_insn *cmd) +{ + char buf[INET6_ADDRSTRLEN + IF_NAMESIZE + 2]; + ipfw_insn_sa6 *sa6; + ipfw_insn_sa *sa; + uint16_t port; + + if (cmd->opcode == O_FORWARD_IP) { + sa = insntod(cmd, sa); + port = sa->sa.sin_port; + if (sa->sa.sin_addr.s_addr == INADDR_ANY) + bprintf(bp, "fwd tablearg"); else - bprintf(bp, " log"); + bprintf(bp, "fwd %s", inet_ntoa(sa->sa.sin_addr)); + } else { + sa6 = insntod(cmd, sa6); + port = sa6->sa.sin6_port; + bprintf(bp, "fwd "); + if (getnameinfo((const struct sockaddr *)&sa6->sa, + sizeof(struct sockaddr_in6), buf, sizeof(buf), NULL, 0, + NI_NUMERICHOST) == 0) + bprintf(bp, "%s", buf); } + if (port != 0) + bprintf(bp, ",%u", port); +} + +static int +print_action_instruction(struct buf_pr *bp, const struct format_opts *fo, + struct show_state *state, const ipfw_insn *cmd) +{ + const char *s; + + if (is_printed_opcode(state, cmd)) + return (0); + switch (cmd->opcode) { + case O_CHECK_STATE: + bprintf(bp, "check-state"); + if (cmd->arg1 != 0) + s = object_search_ctlv(fo->tstate, cmd->arg1, + IPFW_TLV_STATE_NAME); + else + s = NULL; + bprintf(bp, " :%s", s ? s: "any"); + break; + case O_ACCEPT: + bprintf(bp, "allow"); + break; + case O_COUNT: + bprintf(bp, "count"); + break; + case O_DENY: + bprintf(bp, "deny"); + break; + case O_REJECT: + if (cmd->arg1 == ICMP_REJECT_RST) + bprintf(bp, "reset"); + else if (cmd->arg1 == ICMP_REJECT_ABORT) + bprintf(bp, "abort"); + else if (cmd->arg1 == ICMP_UNREACH_HOST) + bprintf(bp, "reject"); + else + print_reject_code(bp, cmd->arg1); + break; + case O_UNREACH6: + if (cmd->arg1 == ICMP6_UNREACH_RST) + bprintf(bp, "reset6"); + else if (cmd->arg1 == ICMP6_UNREACH_ABORT) + bprintf(bp, "abort6"); + else + print_unreach6_code(bp, cmd->arg1); + break; + case O_SKIPTO: + bprint_uint_arg(bp, "skipto ", cmd->arg1); + break; + case O_PIPE: + bprint_uint_arg(bp, "pipe ", cmd->arg1); + break; + case O_QUEUE: + bprint_uint_arg(bp, "queue ", cmd->arg1); + break; + case O_DIVERT: + bprint_uint_arg(bp, "divert ", cmd->arg1); + break; + case O_TEE: + bprint_uint_arg(bp, "tee ", cmd->arg1); + break; + case O_NETGRAPH: + bprint_uint_arg(bp, "netgraph ", cmd->arg1); + break; + case O_NGTEE: + bprint_uint_arg(bp, "ngtee ", cmd->arg1); + break; + case O_FORWARD_IP: + case O_FORWARD_IP6: + print_fwd(bp, cmd); + break; + case O_LOG: + if (insntod(cmd, log)->max_log > 0) + bprintf(bp, " log logamount %d", + insntod(cmd, log)->max_log); + else + bprintf(bp, " log"); + break; + case O_ALTQ: #ifndef NO_ALTQ - if (altqptr) { - print_altq_cmd(bp, altqptr); - } + print_altq_cmd(bp, insntod(cmd, altq)); #endif - if (tagptr) { - if (tagptr->len & F_NOT) - bprint_uint_arg(bp, " untag ", tagptr->arg1); + break; + case O_TAG: + bprint_uint_arg(bp, cmd->len & F_NOT ? " untag ": + " tag ", cmd->arg1); + break; + case O_NAT: + if (cmd->arg1 != IP_FW_NAT44_GLOBAL) + bprint_uint_arg(bp, "nat ", cmd->arg1); else - bprint_uint_arg(bp, " tag ", tagptr->arg1); - } - - /* - * then print the body. - */ - for (l = rule->act_ofs, cmd = rule->cmd; - l > 0 ; l -= F_LEN(cmd) , cmd += F_LEN(cmd)) { - if ((cmd->len & F_OR) || (cmd->len & F_NOT)) - continue; - if (cmd->opcode == O_IP4) { - flags |= HAVE_PROTO4; + bprintf(bp, "nat global"); + break; + case O_SETFIB: + if (cmd->arg1 == IP_FW_TARG) + bprint_uint_arg(bp, "setfib ", cmd->arg1); + else + bprintf(bp, "setfib %u", cmd->arg1 & 0x7FFF); + break; + case O_EXTERNAL_ACTION: + /* + * The external action can consists of two following + * each other opcodes - O_EXTERNAL_ACTION and + * O_EXTERNAL_INSTANCE. The first contains the ID of + * name of external action. The second contains the ID + * of name of external action instance. + * NOTE: in case when external action has no named + * instances support, the second opcode isn't needed. + */ + state->eaction = cmd; + s = object_search_ctlv(fo->tstate, cmd->arg1, + IPFW_TLV_EACTION); + if (match_token(rule_eactions, s) != -1) + bprintf(bp, "%s", s); + else + bprintf(bp, "eaction %s", s); + break; + case O_EXTERNAL_INSTANCE: + if (state->eaction == NULL) break; - } else if (cmd->opcode == O_IP6) { - flags |= HAVE_PROTO6; + /* + * XXX: we need to teach ipfw(9) to rewrite opcodes + * in the user buffer on rule addition. When we add + * the rule, we specify zero TLV type for + * O_EXTERNAL_INSTANCE object. To show correct + * rule after `ipfw add` we need to search instance + * name with zero type. But when we do `ipfw show` + * we calculate TLV type using IPFW_TLV_EACTION_NAME() + * macro. + */ + s = object_search_ctlv(fo->tstate, cmd->arg1, 0); + if (s == NULL) + s = object_search_ctlv(fo->tstate, + cmd->arg1, IPFW_TLV_EACTION_NAME( + state->eaction->arg1)); + bprintf(bp, " %s", s); + break; + case O_EXTERNAL_DATA: + if (state->eaction == NULL) break; + /* + * Currently we support data formatting only for + * external data with datalen u16. For unknown data + * print its size in bytes. + */ + if (cmd->len == F_INSN_SIZE(ipfw_insn)) + bprintf(bp, " %u", cmd->arg1); + else + bprintf(bp, " %ubytes", + cmd->len * sizeof(uint32_t)); + break; + case O_SETDSCP: + if (cmd->arg1 == IP_FW_TARG) { + bprintf(bp, "setdscp tablearg"); + break; } + s = match_value(f_ipdscp, cmd->arg1 & 0x3F); + if (s != NULL) + bprintf(bp, "setdscp %s", s); + else + bprintf(bp, "setdscp %s", cmd->arg1 & 0x3F); + break; + case O_REASS: + bprintf(bp, "reass"); + break; + case O_CALLRETURN: + if (cmd->len & F_NOT) + bprintf(bp, "return"); + else + bprint_uint_arg(bp, "call ", cmd->arg1); + break; + default: + bprintf(bp, "** unrecognized action %d len %d ", + cmd->opcode, cmd->len); } - if (rule->flags & IPFW_RULE_NOOPT) { /* empty rules before options */ - if (!co->do_compact) { - show_prerequisites(bp, &flags, HAVE_PROTO, 0); - bprintf(bp, " from any to any"); - } - flags |= HAVE_IP | HAVE_OPTIONS | HAVE_PROTO | - HAVE_SRCIP | HAVE_DSTIP; - } + mark_printed(state, cmd); - if (co->comment_only) - comment = "..."; + return (1); +} - for (l = rule->act_ofs, cmd = rule->cmd; - l > 0 ; l -= F_LEN(cmd) , cmd += F_LEN(cmd)) { - /* useful alias */ - ipfw_insn_u32 *cmd32 = (ipfw_insn_u32 *)cmd; - if (co->comment_only) { - if (cmd->opcode != O_NOP) - continue; - bprintf(bp, " // %s\n", (char *)(cmd + 1)); - return; - } +static ipfw_insn * +print_action(struct buf_pr *bp, struct format_opts *fo, + struct show_state *state, uint8_t opcode) +{ + ipfw_insn *cmd; + int l; - show_prerequisites(bp, &flags, 0, cmd->opcode); + for (l = state->rule->cmd_len - state->rule->act_ofs, + cmd = ACTION_PTR(state->rule); l > 0; + l -= F_LEN(cmd), cmd += F_LEN(cmd)) { + if (cmd->opcode != opcode) + continue; + if (!print_action_instruction(bp, fo, state, cmd)) + continue; + return (cmd); + } + return (NULL); +} - switch(cmd->opcode) { - case O_PROB: - break; /* done already */ +static void +print_proto(struct buf_pr *bp, struct format_opts *fo, + struct show_state *state) +{ + ipfw_insn *cmd; + int l, proto, ip4, ip6, tmp; - case O_PROBE_STATE: - break; /* no need to print anything here */ - - case O_IP_SRC: - case O_IP_SRC_LOOKUP: - case O_IP_SRC_MASK: - case O_IP_SRC_ME: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 11 10:36:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC550F8818D; Wed, 11 Apr 2018 10:36:21 +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 77E276E164; Wed, 11 Apr 2018 10:36:21 +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 6C4A01B12B; Wed, 11 Apr 2018 10:36:21 +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 w3BAaLBt009732; Wed, 11 Apr 2018 10:36:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BAaKmF009726; Wed, 11 Apr 2018 10:36:20 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804111036.w3BAaKmF009726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 11 Apr 2018 10:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332401 - in stable/11/sys: conf modules/ipfw netinet netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11/sys: conf modules/ipfw netinet netpfil/ipfw X-SVN-Commit-Revision: 332401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 10:36:22 -0000 Author: ae Date: Wed Apr 11 10:36:20 2018 New Revision: 332401 URL: https://svnweb.freebsd.org/changeset/base/332401 Log: MFC r328988,r328989: Rework ipfw dynamic states implementation to be lockless on fast path. o added struct ipfw_dyn_info that keeps all needed for ipfw_chk and for dynamic states implementation information; o added DYN_LOOKUP_NEEDED() macro that can be used to determine the need of new lookup of dynamic states; o ipfw_dyn_rule now becomes obsolete. Currently it used to pass information from kernel to userland only. o IPv4 and IPv6 states now described by different structures dyn_ipv4_state and dyn_ipv6_state; o IPv6 scope zones support is added; o ipfw(4) now depends from Concurrency Kit; o states are linked with "entry" field using CK_SLIST. This allows lockless lookup and protected by mutex modifications. o the "expired" SLIST field is used for states expiring. o struct dyn_data is used to keep generic information for both IPv4 and IPv6; o struct dyn_parent is used to keep O_LIMIT_PARENT information; o IPv4 and IPv6 states are stored in different hash tables; o O_LIMIT_PARENT states now are kept separately from O_LIMIT and O_KEEP_STATE states; o per-cpu dyn_hp pointers are used to implement hazard pointers and they prevent freeing states that are locklessly used by lookup threads; o mutexes to protect modification of lists in hash tables now kept in separate arrays. 65535 limit to maximum number of hash buckets now removed. o Separate lookup and install functions added for IPv4 and IPv6 states and for parent states. o By default now is used Jenkinks hash function. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D12685 Modified: stable/11/sys/conf/files stable/11/sys/modules/ipfw/Makefile stable/11/sys/netinet/ip_fw.h stable/11/sys/netpfil/ipfw/ip_fw2.c stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c stable/11/sys/netpfil/ipfw/ip_fw_private.h stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed Apr 11 10:24:47 2018 (r332400) +++ stable/11/sys/conf/files Wed Apr 11 10:36:20 2018 (r332401) @@ -4201,7 +4201,8 @@ netpfil/ipfw/ip_dn_io.c optional inet dummynet netpfil/ipfw/ip_dn_glue.c optional inet dummynet netpfil/ipfw/ip_fw2.c optional inet ipfirewall netpfil/ipfw/ip_fw_bpf.c optional inet ipfirewall -netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall +netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall \ + compile-with "${NORMAL_C} -I$S/contrib/ck/include" netpfil/ipfw/ip_fw_eaction.c optional inet ipfirewall netpfil/ipfw/ip_fw_log.c optional inet ipfirewall netpfil/ipfw/ip_fw_pfil.c optional inet ipfirewall Modified: stable/11/sys/modules/ipfw/Makefile ============================================================================== --- stable/11/sys/modules/ipfw/Makefile Wed Apr 11 10:24:47 2018 (r332400) +++ stable/11/sys/modules/ipfw/Makefile Wed Apr 11 10:36:20 2018 (r332401) @@ -9,7 +9,7 @@ SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo. SRCS+= ip_fw_table_value.c SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h -CFLAGS+= -DIPFIREWALL +CFLAGS+= -DIPFIREWALL -I${SRCTOP}/sys/contrib/ck/include # #If you want it verbose #CFLAGS+= -DIPFIREWALL_VERBOSE Modified: stable/11/sys/netinet/ip_fw.h ============================================================================== --- stable/11/sys/netinet/ip_fw.h Wed Apr 11 10:24:47 2018 (r332400) +++ stable/11/sys/netinet/ip_fw.h Wed Apr 11 10:36:20 2018 (r332401) @@ -669,7 +669,7 @@ struct ipfw_flow_id { uint32_t src_ip; uint16_t dst_port; uint16_t src_port; - uint8_t fib; + uint8_t fib; /* XXX: must be uint16_t */ uint8_t proto; uint8_t _flags; /* protocol-specific flags */ uint8_t addr_type; /* 4=ip4, 6=ip6, 1=ether ? */ @@ -680,6 +680,7 @@ struct ipfw_flow_id { }; #endif +#define IS_IP4_FLOW_ID(id) ((id)->addr_type == 4) #define IS_IP6_FLOW_ID(id) ((id)->addr_type == 6) /* Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Wed Apr 11 10:24:47 2018 (r332400) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Wed Apr 11 10:36:20 2018 (r332401) @@ -1385,8 +1385,7 @@ ipfw_chk(struct ip_fw_args *args) * MATCH_NONE when checked and not matched (q = NULL), * MATCH_FORWARD or MATCH_REVERSE otherwise (q != NULL) */ - int dyn_dir = MATCH_UNKNOWN; - uint16_t dyn_name = 0; + struct ipfw_dyn_info dyn_info; struct ip_fw *q = NULL; struct ip_fw_chain *chain = &V_layer3_chain; @@ -1418,6 +1417,7 @@ ipfw_chk(struct ip_fw_args *args) proto = args->f_id.proto = 0; /* mark f_id invalid */ /* XXX 0 is a valid proto: IP/IPv6 Hop-by-Hop Option */ + DYN_INFO_INIT(&dyn_info); /* * PULLUP_TO(len, p, T) makes sure that len + sizeof(T) is contiguous, * then it sets p to point at the offset "len" in the mbuf. WARNING: the @@ -2603,7 +2603,8 @@ do { \ case O_LIMIT: case O_KEEP_STATE: if (ipfw_dyn_install_state(chain, f, - (ipfw_insn_limit *)cmd, args, tablearg)) { + (ipfw_insn_limit *)cmd, args, ulp, + pktlen, &dyn_info, tablearg)) { /* error or limit violation */ retval = IP_FW_DENY; l = 0; /* exit inner loop */ @@ -2617,34 +2618,15 @@ do { \ /* * dynamic rules are checked at the first * keep-state or check-state occurrence, - * with the result being stored in dyn_dir - * and dyn_name. + * with the result being stored in dyn_info. * The compiler introduces a PROBE_STATE * instruction for us when we have a * KEEP_STATE (because PROBE_STATE needs * to be run first). - * - * (dyn_dir == MATCH_UNKNOWN) means this is - * first lookup for such f_id. Do lookup. - * - * (dyn_dir != MATCH_UNKNOWN && - * dyn_name != 0 && dyn_name != cmd->arg1) - * means previous lookup didn't find dynamic - * rule for specific state name and current - * lookup will search rule with another state - * name. Redo lookup. - * - * (dyn_dir != MATCH_UNKNOWN && dyn_name == 0) - * means previous lookup was for `any' name - * and it didn't find rule. No need to do - * lookup again. */ - if ((dyn_dir == MATCH_UNKNOWN || - (dyn_name != 0 && - dyn_name != cmd->arg1)) && - (q = ipfw_dyn_lookup_state(&args->f_id, - ulp, pktlen, &dyn_dir, - (dyn_name = cmd->arg1))) != NULL) { + if (DYN_LOOKUP_NEEDED(&dyn_info, cmd) && + (q = ipfw_dyn_lookup_state(args, ulp, + pktlen, cmd, &dyn_info)) != NULL) { /* * Found dynamic entry, jump to the * 'action' part of the parent rule @@ -2652,13 +2634,7 @@ do { \ * cmdlen. */ f = q; - /* XXX we would like to have f_pos - * readily accessible in the dynamic - * rule, instead of having to - * lookup q->rule. - */ - f_pos = ipfw_find_rule(chain, - f->rulenum, f->id); + f_pos = dyn_info.f_pos; cmd = ACTION_PTR(f); l = f->cmd_len - f->act_ofs; cmdlen = 0; @@ -2875,7 +2851,8 @@ do { \ case O_FORWARD_IP: if (args->eh) /* not valid on layer2 pkts */ break; - if (q != f || dyn_dir == MATCH_FORWARD) { + if (q != f || + dyn_info.direction == MATCH_FORWARD) { struct sockaddr_in *sa; sa = &(((ipfw_insn_sa *)cmd)->sa); @@ -2935,7 +2912,8 @@ do { \ case O_FORWARD_IP6: if (args->eh) /* not valid on layer2 pkts */ break; - if (q != f || dyn_dir == MATCH_FORWARD) { + if (q != f || + dyn_info.direction == MATCH_FORWARD) { struct sockaddr_in6 *sin6; sin6 = &(((ipfw_insn_sa6 *)cmd)->sa); @@ -3089,7 +3067,7 @@ do { \ * @args content, and it may be * used for new state lookup later. */ - dyn_dir = MATCH_UNKNOWN; + DYN_INFO_INIT(&dyn_info); } break; Modified: stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Apr 11 10:24:47 2018 (r332400) +++ stable/11/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Apr 11 10:36:20 2018 (r332401) @@ -1,4 +1,6 @@ /*- + * Copyright (c) 2017-2018 Yandex LLC + * Copyright (c) 2017-2018 Andrey V. Elsukov * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa * * Redistribution and use in source and binary forms, with or without @@ -26,32 +28,27 @@ #include __FBSDID("$FreeBSD$"); -#define DEB(x) -#define DDB(x) x - -/* - * Dynamic rule support for ipfw - */ - -#include "opt_ipfw.h" #include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_ipfw.h" #ifndef INET #error IPFIREWALL requires INET. #endif /* INET */ -#include "opt_inet6.h" #include #include -#include +#include #include #include -#include #include +#include +#include #include +#include #include #include #include -#include /* for ETHERTYPE_IP */ +#include #include #include #include @@ -59,7 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* ip_defttl */ +#include #include #include #include @@ -68,6 +65,7 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #include +#include #endif #include @@ -77,86 +75,261 @@ __FBSDID("$FreeBSD$"); #ifdef MAC #include #endif +#include /* - * Description of dynamic rules. + * Description of dynamic states. * - * Dynamic rules are stored in lists accessed through a hash table - * (ipfw_dyn_v) whose size is curr_dyn_buckets. This value can - * be modified through the sysctl variable dyn_buckets which is - * updated when the table becomes empty. + * Dynamic states are stored in lists accessed through a hash tables + * whose size is curr_dyn_buckets. This value can be modified through + * the sysctl variable dyn_buckets. * - * XXX currently there is only one list, ipfw_dyn. + * Currently there are four tables: dyn_ipv4, dyn_ipv6, dyn_ipv4_parent, + * and dyn_ipv6_parent. * - * When a packet is received, its address fields are first masked - * with the mask defined for the rule, then hashed, then matched - * against the entries in the corresponding list. - * Dynamic rules can be used for different purposes: + * When a packet is received, its address fields hashed, then matched + * against the entries in the corresponding list by addr_type. + * Dynamic states can be used for different purposes: * + stateful rules; * + enforcing limits on the number of sessions; * + in-kernel NAT (not implemented yet) * - * The lifetime of dynamic rules is regulated by dyn_*_lifetime, + * The lifetime of dynamic states is regulated by dyn_*_lifetime, * measured in seconds and depending on the flags. * - * The total number of dynamic rules is equal to UMA zone items count. - * The max number of dynamic rules is dyn_max. When we reach + * The total number of dynamic states is equal to UMA zone items count. + * The max number of dynamic states is dyn_max. When we reach * the maximum number of rules we do not create anymore. This is * done to avoid consuming too much memory, but also too much * time when searching on each packet (ideally, we should try instead * to put a limit on the length of the list on each bucket...). * - * Each dynamic rule holds a pointer to the parent ipfw rule so - * we know what action to perform. Dynamic rules are removed when - * the parent rule is deleted. This can be changed by dyn_keep_states - * sysctl. + * Each state holds a pointer to the parent ipfw rule so we know what + * action to perform. Dynamic rules are removed when the parent rule is + * deleted. * * There are some limitations with dynamic rules -- we do not * obey the 'randomized match', and we do not do multiple * passes through the firewall. XXX check the latter!!! */ -struct ipfw_dyn_bucket { - struct mtx mtx; /* Bucket protecting lock */ - ipfw_dyn_rule *head; /* Pointer to first rule */ +/* By default use jenkins hash function */ +#define IPFIREWALL_JENKINSHASH + +#define DYN_COUNTER_INC(d, dir, pktlen) do { \ + (d)->pcnt_ ## dir++; \ + (d)->bcnt_ ## dir += pktlen; \ + } while (0) + +struct dyn_data { + void *parent; /* pointer to parent rule */ + uint32_t chain_id; /* cached ruleset id */ + uint32_t f_pos; /* cached rule index */ + + uint32_t hashval; /* hash value used for hash resize */ + uint16_t fibnum; /* fib used to send keepalives */ + uint8_t _pad[3]; + uint8_t set; /* parent rule set number */ + uint16_t rulenum; /* parent rule number */ + uint32_t ruleid; /* parent rule id */ + + uint32_t state; /* TCP session state and flags */ + uint32_t ack_fwd; /* most recent ACKs in forward */ + uint32_t ack_rev; /* and reverse direction (used */ + /* to generate keepalives) */ + uint32_t sync; /* synchronization time */ + uint32_t expire; /* expire time */ + + uint64_t pcnt_fwd; /* bytes counter in forward */ + uint64_t bcnt_fwd; /* packets counter in forward */ + uint64_t pcnt_rev; /* bytes counter in reverse */ + uint64_t bcnt_rev; /* packets counter in reverse */ }; +#define DPARENT_COUNT_DEC(p) do { \ + MPASS(p->count > 0); \ + ck_pr_dec_32(&(p)->count); \ +} while (0) +#define DPARENT_COUNT_INC(p) ck_pr_inc_32(&(p)->count) +#define DPARENT_COUNT(p) ck_pr_load_32(&(p)->count) +struct dyn_parent { + void *parent; /* pointer to parent rule */ + uint32_t count; /* number of linked states */ + uint8_t _pad; + uint8_t set; /* parent rule set number */ + uint16_t rulenum; /* parent rule number */ + uint32_t ruleid; /* parent rule id */ + uint32_t hashval; /* hash value used for hash resize */ + uint32_t expire; /* expire time */ +}; + +struct dyn_ipv4_state { + uint8_t type; /* State type */ + uint8_t proto; /* UL Protocol */ + uint16_t kidx; /* named object index */ + uint16_t sport, dport; /* ULP source and destination ports */ + in_addr_t src, dst; /* IPv4 source and destination */ + + union { + struct dyn_data *data; + struct dyn_parent *limit; + }; + CK_SLIST_ENTRY(dyn_ipv4_state) entry; + SLIST_ENTRY(dyn_ipv4_state) expired; +}; +CK_SLIST_HEAD(dyn_ipv4ck_slist, dyn_ipv4_state); +static VNET_DEFINE(struct dyn_ipv4ck_slist *, dyn_ipv4); +static VNET_DEFINE(struct dyn_ipv4ck_slist *, dyn_ipv4_parent); + +SLIST_HEAD(dyn_ipv4_slist, dyn_ipv4_state); +static VNET_DEFINE(struct dyn_ipv4_slist, dyn_expired_ipv4); +#define V_dyn_ipv4 VNET(dyn_ipv4) +#define V_dyn_ipv4_parent VNET(dyn_ipv4_parent) +#define V_dyn_expired_ipv4 VNET(dyn_expired_ipv4) + +#ifdef INET6 +struct dyn_ipv6_state { + uint8_t type; /* State type */ + uint8_t proto; /* UL Protocol */ + uint16_t kidx; /* named object index */ + uint16_t sport, dport; /* ULP source and destination ports */ + struct in6_addr src, dst; /* IPv6 source and destination */ + uint32_t zoneid; /* IPv6 scope zone id */ + union { + struct dyn_data *data; + struct dyn_parent *limit; + }; + CK_SLIST_ENTRY(dyn_ipv6_state) entry; + SLIST_ENTRY(dyn_ipv6_state) expired; +}; +CK_SLIST_HEAD(dyn_ipv6ck_slist, dyn_ipv6_state); +static VNET_DEFINE(struct dyn_ipv6ck_slist *, dyn_ipv6); +static VNET_DEFINE(struct dyn_ipv6ck_slist *, dyn_ipv6_parent); + +SLIST_HEAD(dyn_ipv6_slist, dyn_ipv6_state); +static VNET_DEFINE(struct dyn_ipv6_slist, dyn_expired_ipv6); +#define V_dyn_ipv6 VNET(dyn_ipv6) +#define V_dyn_ipv6_parent VNET(dyn_ipv6_parent) +#define V_dyn_expired_ipv6 VNET(dyn_expired_ipv6) +#endif /* INET6 */ + /* - * Static variables followed by global ones + * Per-CPU pointer indicates that specified state is currently in use + * and must not be reclaimed by expiration callout. */ -static VNET_DEFINE(struct ipfw_dyn_bucket *, ipfw_dyn_v); -static VNET_DEFINE(u_int32_t, dyn_buckets_max); -static VNET_DEFINE(u_int32_t, curr_dyn_buckets); -static VNET_DEFINE(struct callout, ipfw_timeout); -#define V_ipfw_dyn_v VNET(ipfw_dyn_v) -#define V_dyn_buckets_max VNET(dyn_buckets_max) -#define V_curr_dyn_buckets VNET(curr_dyn_buckets) -#define V_ipfw_timeout VNET(ipfw_timeout) +static void **dyn_hp_cache; +static DPCPU_DEFINE(void *, dyn_hp); +#define DYNSTATE_GET(cpu) ck_pr_load_ptr(DPCPU_ID_PTR((cpu), dyn_hp)) +#define DYNSTATE_PROTECT(v) ck_pr_store_ptr(DPCPU_PTR(dyn_hp), (v)) +#define DYNSTATE_RELEASE() DYNSTATE_PROTECT(NULL) +#define DYNSTATE_CRITICAL_ENTER() critical_enter() +#define DYNSTATE_CRITICAL_EXIT() do { \ + DYNSTATE_RELEASE(); \ + critical_exit(); \ +} while (0); -static VNET_DEFINE(uma_zone_t, ipfw_dyn_rule_zone); -#define V_ipfw_dyn_rule_zone VNET(ipfw_dyn_rule_zone) +/* + * We keep two version numbers, one is updated when new entry added to + * the list. Second is updated when an entry deleted from the list. + * Versions are updated under bucket lock. + * + * Bucket "add" version number is used to know, that in the time between + * state lookup (i.e. ipfw_dyn_lookup_state()) and the followed state + * creation (i.e. ipfw_dyn_install_state()) another concurrent thread did + * not install some state in this bucket. Using this info we can avoid + * additional state lookup, because we are sure that we will not install + * the state twice. + * + * Also doing the tracking of bucket "del" version during lookup we can + * be sure, that state entry was not unlinked and freed in time between + * we read the state pointer and protect it with hazard pointer. + * + * An entry unlinked from CK list keeps unchanged until it is freed. + * Unlinked entries are linked into expired lists using "expired" field. + */ -#define IPFW_BUCK_LOCK_INIT(b) \ - mtx_init(&(b)->mtx, "IPFW dynamic bucket", NULL, MTX_DEF) -#define IPFW_BUCK_LOCK_DESTROY(b) \ - mtx_destroy(&(b)->mtx) -#define IPFW_BUCK_LOCK(i) mtx_lock(&V_ipfw_dyn_v[(i)].mtx) -#define IPFW_BUCK_UNLOCK(i) mtx_unlock(&V_ipfw_dyn_v[(i)].mtx) -#define IPFW_BUCK_ASSERT(i) mtx_assert(&V_ipfw_dyn_v[(i)].mtx, MA_OWNED) +/* + * dyn_expire_lock is used to protect access to dyn_expired_xxx lists. + * dyn_bucket_lock is used to get write access to lists in specific bucket. + * Currently one dyn_bucket_lock is used for all ipv4, ipv4_parent, ipv6, + * and ipv6_parent lists. + */ +static VNET_DEFINE(struct mtx, dyn_expire_lock); +static VNET_DEFINE(struct mtx *, dyn_bucket_lock); +#define V_dyn_expire_lock VNET(dyn_expire_lock) +#define V_dyn_bucket_lock VNET(dyn_bucket_lock) +/* + * Bucket's add/delete generation versions. + */ +static VNET_DEFINE(uint32_t *, dyn_ipv4_add); +static VNET_DEFINE(uint32_t *, dyn_ipv4_del); +static VNET_DEFINE(uint32_t *, dyn_ipv4_parent_add); +static VNET_DEFINE(uint32_t *, dyn_ipv4_parent_del); +#define V_dyn_ipv4_add VNET(dyn_ipv4_add) +#define V_dyn_ipv4_del VNET(dyn_ipv4_del) +#define V_dyn_ipv4_parent_add VNET(dyn_ipv4_parent_add) +#define V_dyn_ipv4_parent_del VNET(dyn_ipv4_parent_del) -static VNET_DEFINE(int, dyn_keep_states); -#define V_dyn_keep_states VNET(dyn_keep_states) +#ifdef INET6 +static VNET_DEFINE(uint32_t *, dyn_ipv6_add); +static VNET_DEFINE(uint32_t *, dyn_ipv6_del); +static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_add); +static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_del); +#define V_dyn_ipv6_add VNET(dyn_ipv6_add) +#define V_dyn_ipv6_del VNET(dyn_ipv6_del) +#define V_dyn_ipv6_parent_add VNET(dyn_ipv6_parent_add) +#define V_dyn_ipv6_parent_del VNET(dyn_ipv6_parent_del) +#endif /* INET6 */ +#define DYN_BUCKET(h, b) ((h) & (b - 1)) +#define DYN_BUCKET_VERSION(b, v) ck_pr_load_32(&V_dyn_ ## v[(b)]) +#define DYN_BUCKET_VERSION_BUMP(b, v) ck_pr_inc_32(&V_dyn_ ## v[(b)]) + +#define DYN_BUCKET_LOCK_INIT(lock, b) \ + mtx_init(&lock[(b)], "IPFW dynamic bucket", NULL, MTX_DEF) +#define DYN_BUCKET_LOCK_DESTROY(lock, b) mtx_destroy(&lock[(b)]) +#define DYN_BUCKET_LOCK(b) mtx_lock(&V_dyn_bucket_lock[(b)]) +#define DYN_BUCKET_UNLOCK(b) mtx_unlock(&V_dyn_bucket_lock[(b)]) +#define DYN_BUCKET_ASSERT(b) mtx_assert(&V_dyn_bucket_lock[(b)], MA_OWNED) + +#define DYN_EXPIRED_LOCK_INIT() \ + mtx_init(&V_dyn_expire_lock, "IPFW expired states list", NULL, MTX_DEF) +#define DYN_EXPIRED_LOCK_DESTROY() mtx_destroy(&V_dyn_expire_lock) +#define DYN_EXPIRED_LOCK() mtx_lock(&V_dyn_expire_lock) +#define DYN_EXPIRED_UNLOCK() mtx_unlock(&V_dyn_expire_lock) + +static VNET_DEFINE(uint32_t, dyn_buckets_max); +static VNET_DEFINE(uint32_t, curr_dyn_buckets); +static VNET_DEFINE(struct callout, dyn_timeout); +#define V_dyn_buckets_max VNET(dyn_buckets_max) +#define V_curr_dyn_buckets VNET(curr_dyn_buckets) +#define V_dyn_timeout VNET(dyn_timeout) + +/* Maximum length of states chain in a bucket */ +static VNET_DEFINE(uint32_t, curr_max_length); +#define V_curr_max_length VNET(curr_max_length) + +static VNET_DEFINE(uma_zone_t, dyn_data_zone); +static VNET_DEFINE(uma_zone_t, dyn_parent_zone); +static VNET_DEFINE(uma_zone_t, dyn_ipv4_zone); +#ifdef INET6 +static VNET_DEFINE(uma_zone_t, dyn_ipv6_zone); +#define V_dyn_ipv6_zone VNET(dyn_ipv6_zone) +#endif /* INET6 */ +#define V_dyn_data_zone VNET(dyn_data_zone) +#define V_dyn_parent_zone VNET(dyn_parent_zone) +#define V_dyn_ipv4_zone VNET(dyn_ipv4_zone) + /* * Timeouts for various events in handing dynamic rules. */ -static VNET_DEFINE(u_int32_t, dyn_ack_lifetime); -static VNET_DEFINE(u_int32_t, dyn_syn_lifetime); -static VNET_DEFINE(u_int32_t, dyn_fin_lifetime); -static VNET_DEFINE(u_int32_t, dyn_rst_lifetime); -static VNET_DEFINE(u_int32_t, dyn_udp_lifetime); -static VNET_DEFINE(u_int32_t, dyn_short_lifetime); +static VNET_DEFINE(uint32_t, dyn_ack_lifetime); +static VNET_DEFINE(uint32_t, dyn_syn_lifetime); +static VNET_DEFINE(uint32_t, dyn_fin_lifetime); +static VNET_DEFINE(uint32_t, dyn_rst_lifetime); +static VNET_DEFINE(uint32_t, dyn_udp_lifetime); +static VNET_DEFINE(uint32_t, dyn_short_lifetime); #define V_dyn_ack_lifetime VNET(dyn_ack_lifetime) #define V_dyn_syn_lifetime VNET(dyn_syn_lifetime) @@ -172,10 +345,10 @@ static VNET_DEFINE(u_int32_t, dyn_short_lifetime); * dyn_rst_lifetime and dyn_fin_lifetime should be strictly lower * than dyn_keepalive_period. */ - -static VNET_DEFINE(u_int32_t, dyn_keepalive_interval); -static VNET_DEFINE(u_int32_t, dyn_keepalive_period); -static VNET_DEFINE(u_int32_t, dyn_keepalive); +#define DYN_KEEPALIVE_MAXQ 512 +static VNET_DEFINE(uint32_t, dyn_keepalive_interval); +static VNET_DEFINE(uint32_t, dyn_keepalive_period); +static VNET_DEFINE(uint32_t, dyn_keepalive); static VNET_DEFINE(time_t, dyn_keepalive_last); #define V_dyn_keepalive_interval VNET(dyn_keepalive_interval) @@ -183,113 +356,208 @@ static VNET_DEFINE(time_t, dyn_keepalive_last); #define V_dyn_keepalive VNET(dyn_keepalive) #define V_dyn_keepalive_last VNET(dyn_keepalive_last) -static VNET_DEFINE(u_int32_t, dyn_max); /* max # of dynamic rules */ - -#define DYN_COUNT uma_zone_get_cur(V_ipfw_dyn_rule_zone) +static VNET_DEFINE(uint32_t, dyn_max); /* max # of dynamic states */ +static VNET_DEFINE(uint32_t, dyn_count); /* number of states */ +static VNET_DEFINE(uint32_t, dyn_parent_max); /* max # of parent states */ +static VNET_DEFINE(uint32_t, dyn_parent_count); /* number of parent states */ #define V_dyn_max VNET(dyn_max) +#define V_dyn_count VNET(dyn_count) +#define V_dyn_parent_max VNET(dyn_parent_max) +#define V_dyn_parent_count VNET(dyn_parent_count) -/* for userspace, we emulate the uma_zone_counter with ipfw_dyn_count */ -static int ipfw_dyn_count; /* number of objects */ +#define DYN_COUNT_DEC(name) do { \ + MPASS((V_ ## name) > 0); \ + ck_pr_dec_32(&(V_ ## name)); \ +} while (0) +#define DYN_COUNT_INC(name) ck_pr_inc_32(&(V_ ## name)) +#define DYN_COUNT(name) ck_pr_load_32(&(V_ ## name)) -#ifdef USERSPACE /* emulation of UMA object counters for userspace */ -#define uma_zone_get_cur(x) ipfw_dyn_count -#endif /* USERSPACE */ +static time_t last_log; /* Log ratelimiting */ -static int last_log; /* Log ratelimiting */ +/* + * Get/set maximum number of dynamic states in given VNET instance. + */ +static int +sysctl_dyn_max(SYSCTL_HANDLER_ARGS) +{ + uint32_t nstates; + int error; -static void ipfw_dyn_tick(void *vnetx); -static void check_dyn_rules(struct ip_fw_chain *, ipfw_range_tlv *, int, int); -#ifdef SYSCTL_NODE + nstates = V_dyn_max; + error = sysctl_handle_32(oidp, &nstates, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); -static int sysctl_ipfw_dyn_count(SYSCTL_HANDLER_ARGS); -static int sysctl_ipfw_dyn_max(SYSCTL_HANDLER_ARGS); + V_dyn_max = nstates; + uma_zone_set_max(V_dyn_data_zone, V_dyn_max); + return (0); +} -SYSBEGIN(f2) +static int +sysctl_dyn_parent_max(SYSCTL_HANDLER_ARGS) +{ + uint32_t nstates; + int error; + nstates = V_dyn_parent_max; + error = sysctl_handle_32(oidp, &nstates, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + + V_dyn_parent_max = nstates; + uma_zone_set_max(V_dyn_parent_zone, V_dyn_parent_max); + return (0); +} + +static int +sysctl_dyn_buckets(SYSCTL_HANDLER_ARGS) +{ + uint32_t nbuckets; + int error; + + nbuckets = V_dyn_buckets_max; + error = sysctl_handle_32(oidp, &nbuckets, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + + if (nbuckets > 256) + V_dyn_buckets_max = 1 << fls(nbuckets - 1); + else + return (EINVAL); + return (0); +} + SYSCTL_DECL(_net_inet_ip_fw); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_buckets, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_buckets_max), 0, - "Max number of dyn. buckets"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, + +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_count, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(dyn_count), 0, + "Current number of dynamic states."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_parent_count, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(dyn_parent_count), 0, + "Current number of parent states. "); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(curr_dyn_buckets), 0, - "Current Number of dyn. buckets"); -SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_count, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RD, 0, 0, sysctl_ipfw_dyn_count, "IU", - "Number of dyn. rules"); + "Current number of buckets for states hash table."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, curr_max_length, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(curr_max_length), 0, + "Current maximum length of states chains in hash buckets."); +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_buckets, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_buckets, + "IU", "Max number of buckets for dynamic states hash table."); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_max, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, 0, 0, sysctl_ipfw_dyn_max, "IU", - "Max number of dyn. rules"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_max, + "IU", "Max number of dynamic states."); +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_parent_max, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_parent_max, + "IU", "Max number of parent dynamic states."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_ack_lifetime), 0, - "Lifetime of dyn. rules for acks"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_syn_lifetime, + "Lifetime of dynamic states for TCP ACK."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_syn_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_syn_lifetime), 0, - "Lifetime of dyn. rules for syn"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_fin_lifetime, + "Lifetime of dynamic states for TCP SYN."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_fin_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_fin_lifetime), 0, - "Lifetime of dyn. rules for fin"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_rst_lifetime, + "Lifetime of dynamic states for TCP FIN."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_rst_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_rst_lifetime), 0, - "Lifetime of dyn. rules for rst"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_udp_lifetime, + "Lifetime of dynamic states for TCP RST."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_udp_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_udp_lifetime), 0, - "Lifetime of dyn. rules for UDP"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_short_lifetime, + "Lifetime of dynamic states for UDP."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_short_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_short_lifetime), 0, - "Lifetime of dyn. rules for other situations"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, + "Lifetime of dynamic states for other situations."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_keepalive), 0, - "Enable keepalives for dyn. rules"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keep_states, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_keep_states), 0, - "Do not flush dynamic states on rule deletion"); + "Enable keepalives for dynamic states."); -SYSEND +#ifdef IPFIREWALL_DYNDEBUG +#define DYN_DEBUG(fmt, ...) do { \ + printf("%s: " fmt "\n", __func__, __VA_ARGS__); \ +} while (0) +#else +#define DYN_DEBUG(fmt, ...) +#endif /* !IPFIREWALL_DYNDEBUG */ -#endif /* SYSCTL_NODE */ - - #ifdef INET6 -static __inline int -hash_packet6(const struct ipfw_flow_id *id) -{ - u_int32_t i; - i = (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[3]); - return ntohl(i); -} -#endif +/* Functions to work with IPv6 states */ +static struct dyn_ipv6_state *dyn_lookup_ipv6_state( + const struct ipfw_flow_id *, uint32_t, const void *, + struct ipfw_dyn_info *, int); +static int dyn_lookup_ipv6_state_locked(const struct ipfw_flow_id *, + uint32_t, const void *, int, const void *, uint32_t, uint16_t, uint32_t, + uint16_t); +static struct dyn_ipv6_state *dyn_alloc_ipv6_state( + const struct ipfw_flow_id *, uint32_t, uint16_t, uint8_t); +static int dyn_add_ipv6_state(void *, uint32_t, uint16_t, uint8_t, + const struct ipfw_flow_id *, uint32_t, const void *, int, uint32_t, + struct ipfw_dyn_info *, uint16_t, uint16_t, uint8_t); +static void dyn_export_ipv6_state(const struct dyn_ipv6_state *, + ipfw_dyn_rule *); -/* - * IMPORTANT: the hash function for dynamic rules must be commutative - * in source and destination (ip,port), because rules are bidirectional - * and we want to find both in the same bucket. - */ -static __inline int -hash_packet(const struct ipfw_flow_id *id, int buckets) -{ - u_int32_t i; +static uint32_t dyn_getscopeid(const struct ip_fw_args *); +static void dyn_make_keepalive_ipv6(struct mbuf *, const struct in6_addr *, + const struct in6_addr *, uint32_t, uint32_t, uint32_t, uint16_t, + uint16_t); +static void dyn_enqueue_keepalive_ipv6(struct mbufq *, + const struct dyn_ipv6_state *); +static void dyn_send_keepalive_ipv6(struct ip_fw_chain *); -#ifdef INET6 - if (IS_IP6_FLOW_ID(id)) - i = hash_packet6(id); - else +static struct dyn_ipv6_state *dyn_lookup_ipv6_parent( + const struct ipfw_flow_id *, uint32_t, const void *, uint32_t, uint16_t, + uint32_t); +static struct dyn_ipv6_state *dyn_lookup_ipv6_parent_locked( + const struct ipfw_flow_id *, uint32_t, const void *, uint32_t, uint16_t, + uint32_t); +static struct dyn_ipv6_state *dyn_add_ipv6_parent(void *, uint32_t, uint16_t, + uint8_t, const struct ipfw_flow_id *, uint32_t, uint32_t, uint32_t, + uint16_t); #endif /* INET6 */ - i = (id->dst_ip) ^ (id->src_ip); - i ^= (id->dst_port) ^ (id->src_port); - return (i & (buckets - 1)); -} -#if 0 -#define DYN_DEBUG(fmt, ...) do { \ - printf("%s: " fmt "\n", __func__, __VA_ARGS__); \ -} while (0) -#else -#define DYN_DEBUG(fmt, ...) -#endif +/* Functions to work with limit states */ +static void *dyn_get_parent_state(const struct ipfw_flow_id *, uint32_t, + struct ip_fw *, uint32_t, uint32_t, uint16_t); +static struct dyn_ipv4_state *dyn_lookup_ipv4_parent( + const struct ipfw_flow_id *, const void *, uint32_t, uint16_t, uint32_t); +static struct dyn_ipv4_state *dyn_lookup_ipv4_parent_locked( + const struct ipfw_flow_id *, const void *, uint32_t, uint16_t, uint32_t); +static struct dyn_parent *dyn_alloc_parent(void *, uint32_t, uint16_t, + uint8_t, uint32_t); +static struct dyn_ipv4_state *dyn_add_ipv4_parent(void *, uint32_t, uint16_t, + uint8_t, const struct ipfw_flow_id *, uint32_t, uint32_t, uint16_t); +static void dyn_tick(void *); +static void dyn_expire_states(struct ip_fw_chain *, ipfw_range_tlv *); +static void dyn_free_states(struct ip_fw_chain *); +static void dyn_export_parent(const struct dyn_parent *, uint16_t, + ipfw_dyn_rule *); +static void dyn_export_data(const struct dyn_data *, uint16_t, uint8_t, + ipfw_dyn_rule *); +static uint32_t dyn_update_tcp_state(struct dyn_data *, + const struct ipfw_flow_id *, const struct tcphdr *, int); +static void dyn_update_proto_state(struct dyn_data *, + const struct ipfw_flow_id *, const void *, int, int); + +/* Functions to work with IPv4 states */ +struct dyn_ipv4_state *dyn_lookup_ipv4_state(const struct ipfw_flow_id *, + const void *, struct ipfw_dyn_info *, int); +static int dyn_lookup_ipv4_state_locked(const struct ipfw_flow_id *, + const void *, int, const void *, uint32_t, uint16_t, uint32_t, uint16_t); +static struct dyn_ipv4_state *dyn_alloc_ipv4_state( + const struct ipfw_flow_id *, uint16_t, uint8_t); +static int dyn_add_ipv4_state(void *, uint32_t, uint16_t, uint8_t, + const struct ipfw_flow_id *, const void *, int, uint32_t, + struct ipfw_dyn_info *, uint16_t, uint16_t, uint8_t); +static void dyn_export_ipv4_state(const struct dyn_ipv4_state *, + ipfw_dyn_rule *); + +/* + * Named states support. + */ static char *default_state_name = "default"; struct dyn_state_obj { struct named_object no; @@ -436,7 +704,6 @@ dyn_destroy(struct ip_fw_chain *ch, struct named_objec KASSERT(no->refcnt == 1, ("Destroying object '%s' (type %u, idx %u) with refcnt %u", no->name, no->etlv, no->kidx, no->refcnt)); - DYN_DEBUG("kidx %d", no->kidx); obj = SRV_OBJECT(ch, no->kidx); SRV_OBJECT(ch, no->kidx) = NULL; @@ -472,7 +739,137 @@ static struct opcode_obj_rewrite dyn_opcodes[] = { dyn_create, dyn_destroy }, }; -/** + +/* + * IMPORTANT: the hash function for dynamic rules must be commutative + * in source and destination (ip,port), because rules are bidirectional + * and we want to find both in the same bucket. + */ +#ifndef IPFIREWALL_JENKINSHASH +static __inline uint32_t +hash_packet(const struct ipfw_flow_id *id) +{ + uint32_t i; + +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) + i = ntohl((id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ + (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ + (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ + (id->src_ip6.__u6_addr.__u6_addr32[3])); + else +#endif /* INET6 */ + i = (id->dst_ip) ^ (id->src_ip); + i ^= (id->dst_port) ^ (id->src_port); + return (i); +} + +static __inline uint32_t +hash_parent(const struct ipfw_flow_id *id, const void *rule) +{ + + return (hash_packet(id) ^ ((uintptr_t)rule)); +} + +#else /* IPFIREWALL_JENKINSHASH */ + +static VNET_DEFINE(uint32_t, dyn_hashseed); +#define V_dyn_hashseed VNET(dyn_hashseed) + +static __inline int +addrcmp4(const struct ipfw_flow_id *id) +{ + + if (id->src_ip < id->dst_ip) + return (0); + if (id->src_ip > id->dst_ip) + return (1); + if (id->src_port <= id->dst_port) + return (0); + return (1); +} + +#ifdef INET6 +static __inline int +addrcmp6(const struct ipfw_flow_id *id) +{ + int ret; + + ret = memcmp(&id->src_ip6, &id->dst_ip6, sizeof(struct in6_addr)); + if (ret < 0) + return (0); + if (ret > 0) + return (1); + if (id->src_port <= id->dst_port) + return (0); + return (1); +} + +static __inline uint32_t +hash_packet6(const struct ipfw_flow_id *id) +{ + struct tuple6 { + struct in6_addr addr[2]; + uint16_t port[2]; + } t6; + + if (addrcmp6(id) == 0) { + t6.addr[0] = id->src_ip6; + t6.addr[1] = id->dst_ip6; + t6.port[0] = id->src_port; + t6.port[1] = id->dst_port; + } else { + t6.addr[0] = id->dst_ip6; + t6.addr[1] = id->src_ip6; + t6.port[0] = id->dst_port; + t6.port[1] = id->src_port; + } + return (jenkins_hash32((const uint32_t *)&t6, + sizeof(t6) / sizeof(uint32_t), V_dyn_hashseed)); +} +#endif + +static __inline uint32_t +hash_packet(const struct ipfw_flow_id *id) +{ + struct tuple4 { + in_addr_t addr[2]; + uint16_t port[2]; + } t4; + + if (IS_IP4_FLOW_ID(id)) { + /* All fields are in host byte order */ + if (addrcmp4(id) == 0) { + t4.addr[0] = id->src_ip; + t4.addr[1] = id->dst_ip; + t4.port[0] = id->src_port; + t4.port[1] = id->dst_port; + } else { + t4.addr[0] = id->dst_ip; + t4.addr[1] = id->src_ip; + t4.port[0] = id->dst_port; + t4.port[1] = id->src_port; + } + return (jenkins_hash32((const uint32_t *)&t4, + sizeof(t4) / sizeof(uint32_t), V_dyn_hashseed)); + } else +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) + return (hash_packet6(id)); +#endif + return (0); +} + +static __inline uint32_t +hash_parent(const struct ipfw_flow_id *id, const void *rule) +{ + + return (jenkins_hash32((const uint32_t *)&rule, + sizeof(rule) / sizeof(uint32_t), hash_packet(id))); +} +#endif /* IPFIREWALL_JENKINSHASH */ + +/* * Print customizable flow id description via log(9) facility. */ static void @@ -500,904 +897,1809 @@ print_dyn_rule_flags(const struct ipfw_flow_id *id, in } log(log_flags, "ipfw: %s type %d %s %d -> %s %d, %d %s\n", prefix, dyn_type, src, id->src_port, dst, - id->dst_port, DYN_COUNT, postfix); + id->dst_port, V_dyn_count, postfix); } #define print_dyn_rule(id, dtype, prefix, postfix) \ print_dyn_rule_flags(id, dtype, LOG_DEBUG, prefix, postfix) -#define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) -#define TIME_LE(a,b) ((int)((a)-(b)) < 0) +#define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define TIME_LE(a,b) ((int)((a)-(b)) < 0) +#define _SEQ_GE(a,b) ((int)((a)-(b)) >= 0) +#define BOTH_SYN (TH_SYN | (TH_SYN << 8)) +#define BOTH_FIN (TH_FIN | (TH_FIN << 8)) +#define TCP_FLAGS (TH_FLAGS | (TH_FLAGS << 8)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 11 11:12:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59BF0F8AFFC; Wed, 11 Apr 2018 11:12:21 +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 07F7278FFF; Wed, 11 Apr 2018 11:12:21 +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 02D091B792; Wed, 11 Apr 2018 11:12:21 +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 w3BBCK0k028495; Wed, 11 Apr 2018 11:12:20 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BBCKj9028494; Wed, 11 Apr 2018 11:12:20 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201804111112.w3BBCKj9028494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Wed, 11 Apr 2018 11:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332402 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: oleg X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 332402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 11:12:21 -0000 Author: oleg Date: Wed Apr 11 11:12:20 2018 New Revision: 332402 URL: https://svnweb.freebsd.org/changeset/base/332402 Log: Fix ipfw table creation when net.inet.ip.fw.tables_sets = 0 and non zero set specified on table creation. This fixes following: # sysctl net.inet.ip.fw.tables_sets net.inet.ip.fw.tables_sets: 0 # ipfw table all info # ipfw set 1 table 1 create type addr # ipfw set 1 table 1 create type addr # ipfw add 10 set 1 count ip from table\(1\) to any 00010 count ip from table(1) to any # ipfw add 10 set 1 count ip from table\(1\) to any 00010 count ip from table(1) to any # ipfw table all info --- table(1), set(1) --- kindex: 4, type: addr references: 1, valtype: legacy algorithm: addr:radix items: 0, size: 296 --- table(1), set(1) --- kindex: 3, type: addr references: 1, valtype: legacy algorithm: addr:radix items: 0, size: 296 --- table(1), set(1) --- kindex: 2, type: addr references: 0, valtype: legacy algorithm: addr:radix items: 0, size: 296 --- table(1), set(1) --- kindex: 1, type: addr references: 0, valtype: legacy algorithm: addr:radix items: 0, size: 296 # MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Wed Apr 11 10:36:20 2018 (r332401) +++ head/sys/netpfil/ipfw/ip_fw_table.c Wed Apr 11 11:12:20 2018 (r332402) @@ -3171,7 +3171,7 @@ alloc_table_config(struct ip_fw_chain *ch, struct tid_ if (ntlv == NULL) return (NULL); name = ntlv->name; - set = ntlv->set; + set = (V_fw_tables_sets == 0) ? 0 : ntlv->set; } else { /* Compat part: convert number to string representation */ snprintf(bname, sizeof(bname), "%d", ti->uidx); From owner-svn-src-all@freebsd.org Wed Apr 11 11:17:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0177F8B563; Wed, 11 Apr 2018 11:17:57 +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 54F0B792D4; Wed, 11 Apr 2018 11:17:57 +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 4FD081B7A6; Wed, 11 Apr 2018 11:17:57 +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 w3BBHvxB029397; Wed, 11 Apr 2018 11:17:57 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BBHv4u029396; Wed, 11 Apr 2018 11:17:57 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201804111117.w3BBHv4u029396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Wed, 11 Apr 2018 11:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332403 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: oleg X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 332403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 11:17:57 -0000 Author: oleg Date: Wed Apr 11 11:17:57 2018 New Revision: 332403 URL: https://svnweb.freebsd.org/changeset/base/332403 Log: Fix typo. MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Apr 11 11:12:20 2018 (r332402) +++ head/sbin/ipfw/ipfw.8 Wed Apr 11 11:17:57 2018 (r332403) @@ -2233,7 +2233,7 @@ of the firewall and quickly (and atomically) switch be By default, tables from set 0 are referenced when adding rule with table opcodes regardless of rule set. This behavior can be changed by setting -.Va net.inet.ip.fw.tables_set +.Va net.inet.ip.fw.tables_sets variable to 1. Rule's set will then be used for table references. .Pp From owner-svn-src-all@freebsd.org Wed Apr 11 11:43:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC57CF8D1B7; Wed, 11 Apr 2018 11:43:12 +0000 (UTC) (envelope-from kp@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 80F3B7E285; Wed, 11 Apr 2018 11:43:12 +0000 (UTC) (envelope-from kp@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 7AEB31BC58; Wed, 11 Apr 2018 11:43:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BBhCVc044194; Wed, 11 Apr 2018 11:43:12 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BBhCL6044192; Wed, 11 Apr 2018 11:43:12 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804111143.w3BBhCL6044192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 11 Apr 2018 11:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332404 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 332404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 11:43:13 -0000 Author: kp Date: Wed Apr 11 11:43:12 2018 New Revision: 332404 URL: https://svnweb.freebsd.org/changeset/base/332404 Log: pf: limit ioctl to a reasonable and tuneable number of elements pf ioctls frequently take a variable number of elements as argument. This can potentially allow users to request very large allocations. These will fail, but even a failing M_NOWAIT might tie up resources and result in concurrent M_WAITOK allocations entering vm_wait and inducing reclamation of caches. Limit these ioctls to what should be a reasonable value, but allow users to tune it should they need to. Differential Revision: https://reviews.freebsd.org/D15018 Modified: head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Wed Apr 11 11:17:57 2018 (r332403) +++ head/sys/netpfil/pf/pf.c Wed Apr 11 11:43:12 2018 (r332404) @@ -369,11 +369,14 @@ u_long pf_hashmask; u_long pf_srchashmask; static u_long pf_hashsize; static u_long pf_srchashsize; +u_long pf_ioctl_maxcount = 65535; SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_RDTUN, &pf_hashsize, 0, "Size of pf(4) states hashtable"); SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN, &pf_srchashsize, 0, "Size of pf(4) source nodes hashtable"); +SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RDTUN, + &pf_ioctl_maxcount, 0, "Maximum number of tables, addresses, ... in a single ioctl() call"); VNET_DEFINE(void *, pf_swi_cookie); Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Wed Apr 11 11:17:57 2018 (r332403) +++ head/sys/netpfil/pf/pf_ioctl.c Wed Apr 11 11:43:12 2018 (r332404) @@ -89,8 +89,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#define PF_TABLES_MAX_REQUEST 65535 /* Maximum tables per request. */ - static struct pf_pool *pf_get_pool(char *, u_int32_t, u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t); @@ -218,6 +216,8 @@ pfsync_defer_t *pfsync_defer_ptr = NULL; /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; +extern u_long pf_ioctl_maxcount; + static void pfattach_vnet(void) { @@ -2533,7 +2533,8 @@ DIOCCHANGEADDR_error: break; } - if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { + if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_table))) { error = ENOMEM; break; } @@ -2564,7 +2565,8 @@ DIOCCHANGEADDR_error: break; } - if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { + if (io->pfrio_size < 0 || io->pfrio_size > pf_ioctl_maxcount || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_table))) { error = ENOMEM; break; } @@ -2741,6 +2743,7 @@ DIOCCHANGEADDR_error: break; } if (io->pfrio_size < 0 || + io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; break; @@ -2778,6 +2781,7 @@ DIOCCHANGEADDR_error: break; } if (io->pfrio_size < 0 || + io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; break; @@ -2819,7 +2823,8 @@ DIOCCHANGEADDR_error: break; } count = max(io->pfrio_size, io->pfrio_size2); - if (WOULD_OVERFLOW(count, sizeof(struct pfr_addr))) { + if (count > pf_ioctl_maxcount || + WOULD_OVERFLOW(count, sizeof(struct pfr_addr))) { error = EINVAL; break; } @@ -2857,6 +2862,7 @@ DIOCCHANGEADDR_error: break; } if (io->pfrio_size < 0 || + io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; break; @@ -2888,6 +2894,7 @@ DIOCCHANGEADDR_error: break; } if (io->pfrio_size < 0 || + io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_astats))) { error = EINVAL; break; @@ -2919,6 +2926,7 @@ DIOCCHANGEADDR_error: break; } if (io->pfrio_size < 0 || + io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; break; @@ -2956,6 +2964,7 @@ DIOCCHANGEADDR_error: break; } if (io->pfrio_size < 0 || + io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; break; @@ -2993,6 +3002,7 @@ DIOCCHANGEADDR_error: break; } if (io->pfrio_size < 0 || + io->pfrio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { error = EINVAL; break; @@ -3045,6 +3055,7 @@ DIOCCHANGEADDR_error: break; } if (io->size < 0 || + io->size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { error = EINVAL; break; @@ -3121,6 +3132,7 @@ DIOCCHANGEADDR_error: break; } if (io->size < 0 || + io->size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { error = EINVAL; break; @@ -3198,6 +3210,7 @@ DIOCCHANGEADDR_error: } if (io->size < 0 || + io->size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { error = EINVAL; break; @@ -3410,6 +3423,7 @@ DIOCCHANGEADDR_error: } if (io->pfiio_size < 0 || + io->pfiio_size > pf_ioctl_maxcount || WOULD_OVERFLOW(io->pfiio_size, sizeof(struct pfi_kif))) { error = EINVAL; break; From owner-svn-src-all@freebsd.org Wed Apr 11 13:33:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D62CF94EFA; Wed, 11 Apr 2018 13:33:13 +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 25F197756C; Wed, 11 Apr 2018 13:33:13 +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 20B871CDF5; Wed, 11 Apr 2018 13:33:13 +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 w3BDXDO6098472; Wed, 11 Apr 2018 13:33:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BDXDq0098471; Wed, 11 Apr 2018 13:33:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804111333.w3BDXDq0098471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Apr 2018 13:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332405 - head/bin/setfacl X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/bin/setfacl X-SVN-Commit-Revision: 332405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 13:33:13 -0000 Author: emaste Date: Wed Apr 11 13:33:12 2018 New Revision: 332405 URL: https://svnweb.freebsd.org/changeset/base/332405 Log: setfacl: minor man page edit to appease igor(1) Modified: head/bin/setfacl/setfacl.1 Modified: head/bin/setfacl/setfacl.1 ============================================================================== --- head/bin/setfacl/setfacl.1 Wed Apr 11 11:43:12 2018 (r332404) +++ head/bin/setfacl/setfacl.1 Wed Apr 11 13:33:12 2018 (r332405) @@ -80,7 +80,8 @@ entries of the current ACL. The operations apply to the default ACL entries instead of access ACL entries. Currently only directories may have -default ACL's. This option is not applicable to NFSv4 ACLs. +default ACL's. +This option is not applicable to NFSv4 ACLs. .It Fl h If the target of the operation is a symbolic link, perform the operation on the symbolic link itself, rather than following the link. @@ -96,8 +97,9 @@ It is not considered an error if the specified files do not have any default ACL entries. An error will be reported if any of -the specified files cannot have a default entry (i.e.\& -non-directories). This option is not applicable to NFSv4 ACLs. +the specified files cannot have a default entry (i.e., +non-directories). +This option is not applicable to NFSv4 ACLs. .It Fl L If the .Fl R From owner-svn-src-all@freebsd.org Wed Apr 11 13:37:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 494EDF953BC; Wed, 11 Apr 2018 13:37:55 +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 86E1A78A3A; Wed, 11 Apr 2018 13:37:54 +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 8C0D01045E64; Wed, 11 Apr 2018 23:37:46 +1000 (AEST) Date: Wed, 11 Apr 2018 23:37:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332395 - head/sys/kern In-Reply-To: <201804102257.w3AMvuIF061050@repo.freebsd.org> Message-ID: <20180411222028.W952@besplex.bde.org> References: <201804102257.w3AMvuIF061050@repo.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=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=MjzpdK5aTTREc79HclsA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 13:37:55 -0000 On Tue, 10 Apr 2018, Ian Lepore wrote: > URL: https://svnweb.freebsd.org/changeset/base/332395 > > Log: > Use explicit_bzero() when cleaning values out of the kernel environment. > > Sometimes the values contain geli passphrases being communicated from > loader(8) to the kernel, and some day the compiler may decide to start > eliding calls to memset() for a pointer which is not dereferenced again > before being passed to free(). Using memset() in the kernel is also a style bug. I used to police this in files that I used, and there were still only 37 instances of it in kern/*.c before this commit. There were 209 instances of using the BSD API bzero(). It is interesting that using memset() also asks for security holes. bzero() already has the correct semantics for avoiding security holes, so explicit_bzero() instead of just bzero() in the kernel is another style bug. There were only 6 instances of this style bug in kern/*.c (all in kern_shutdown.c). Most places where there is an obvious security bug just use bzero(). The most common bug was for copying out structs. Padding in the structs must be zeroed, and bzero() is a good way to do this. In this case, the compiler can't see where the copy is used, so even bzero() is safe. bzero() should not cause security bugs anywhere, since it is not a standard C function so C compilers cannot know what it does. However, it is a standard POSIX function so C compilers with POSIX extensions could know what it does. POSIX has a deficient specification of it in at least the 2001 version. It says that "The bzero() function shall place n zero-valued bytes in the area pointed to by s" and under APPLICATION USAGE it says "[bad advice on preferring memset() deleted. Now I quote its bad advice on portability:] for maximum portability, it is recommended to replace the function call to bzero [by] #define bzero(b,len) (memset((b), '\0', (len)), (void) 0). The C standard says much the same for memset(), but it is clearer that the "as if" rule applies to memset(), so compilers don't have to actually fill in the array as specified they can prove that no conforming program can tell the difference. Before POSIX standardized bzero() in 2001, compilers couldn't do the same opimization for bzero(), so the de-facto standard for it was to actually fill in the array and this is what should have been standardized. Similarly for memset() when it was standardized in the late 1980's. Not many people would have noticed and/or cared about the security problem then. It should have been better known in 2001. In the kernel, the compiler cannot know what even memset() does, since the kernel is built by freestanding compilers. However, bzero() was recently optimized to use __builtin_memset(). This is an invalid optimization, since it gives the security hole. bzero(9) is actually documented, but its documentation has the same deficiencies as POSIX's and FreeBSD's bzero(3) -- it is unobvious if the "as if" rule applies to these functions. (The "as if" rule probably applies to all APIs, but it is too difficult to determine and allow for operations not don;t exactly what their man page says they do.) Strangely, memset() in the kernel is not optimized using __builtin_memset(), although this optimization might be valid. (No one knows what memset() in the kernel does since it doesn't have even a fuzzy memset(9).). memset(9) is still correctly deprecated by not optimizing it like bzero(9). It is significantly pessimized only for a nonzero full byte -- then it uses a simple loop, with the loop bogusly optimized by inlining it. For a zero fill byte, it uses bzero() which often uses __builtin_memset(). clang and even gcc-4.2.1 have a builtin bzero, but this is not used. Its semantics are as unclear as bzero()'s. The simple loop for memset() in the nonzero fill-byte case is an older mistake. IIRC, it was originally only done for the inline memset() in libkern.h. However, due to bugs in builtins and possibly with -O0, memset() is need as an extern function too. So the loop occurs in the inline version where it is mostly a negative optimization for space, and in the extern version where it is good enough. Inlining the loop only clearly optimizes for security holes -- it allows the compiler to see what the function does, so the compiler can make it do nothing. However, in the freestanding case, it is still an invalid optimization to not zero things before they are freed. The compiler cannot know what free(9) does unless free() is inlined, and free() is too large to even be inlined. So explicit_bzero() is needed here even less than in most places. Bruce From owner-svn-src-all@freebsd.org Wed Apr 11 13:48:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FB9CF95EEE; Wed, 11 Apr 2018 13:48:27 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6EFC79106; Wed, 11 Apr 2018 13:48:26 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id y128so2414799iod.4; Wed, 11 Apr 2018 06:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mJuLtrgm1lAAZIhTL23pumvb5yVDEjH38a9NnYXGRbM=; b=I4mknSM13MoribB2T9YEEz2vwpzyu4Bk7AkYY4g2btdtblo0lS7shdbbEw844b4KgY NHzpZKQlOTzyTU5BuOiYREymD+oMk97KzEMYeKZgifdEQgIrAy9kaNKJKqPkoYtwHcjj TZn2cCEfGyF2FE0g1tw8dKHMahD7el2GJ04qvxtMztxBgvlmt2K/JzRPiDp8HPcTAw8O OuXQkxaGcg5h2bkQWFxI9vAUdYgh0LIgLVEBK2hAu16zCfvKomPOjtGzzlJxSBUbjTg0 Fy6wNf411ELePzfVE9SF43sNXxIa3Az2lRewujDEPrvNzLHtiI0riN7fdQd4YqBplQjy NW/Q== 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=mJuLtrgm1lAAZIhTL23pumvb5yVDEjH38a9NnYXGRbM=; b=Y1fgvMlVXbKi2aKoWvibKB6+cuTrJWMcKVDxw8Fp9n469kPvrfAxRbhl+vTZmgvHYB 3kAZmZX8kvpgHND1wYBRrVcYCBRiVDFEGx9+qkCaxYy3zfmnByTLukQKRDJCF7vdz9XE GT9I2OLoD31Wh6AjMlBi6kkK52e3iegDiPcAoClBqmpN2H7nUbvy20QK/A/QjD6woE4o W4rky4+QC/Wwdzgse69dWPOJmhfqGbFnx7HFd7A+L/2yzTgswsdvpX67IDaDj6xGEPbA 2mMbQcPQyiJLNY/5+48wWpqNbXJYRHGograJkDcDmTlt16S7+/1ZkH5+XKRirjSTsUgQ /KGQ== X-Gm-Message-State: ALQs6tC0IuwyxydJhOnRCoz8UhiSHeaL2rJfVKt3IF153hm/N9ii9I2R bAjgHOdhIMNcc4pl8VcYgxbrRg== X-Google-Smtp-Source: AIpwx4+fIvgstrJwPwBNrM+ByHOcpi2VZGq5MsCqi8eqvOsWj0hXYZW035KQc4KIlBN2SnyV9h6WAQ== X-Received: by 10.107.137.158 with SMTP id t30mr4619027ioi.230.1523454506131; Wed, 11 Apr 2018 06:48:26 -0700 (PDT) Received: from raichu (toroon0560w-lp130-04-184-145-252-74.dsl.bell.ca. [184.145.252.74]) by smtp.gmail.com with ESMTPSA id 72-v6sm708735itg.36.2018.04.11.06.48.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 06:48:25 -0700 (PDT) Sender: Mark Johnston Date: Wed, 11 Apr 2018 09:48:20 -0400 From: Mark Johnston To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332365 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20180411134820.GA43015@raichu> References: <201804101356.w3ADu6Jr072766@repo.freebsd.org> <33ea9236-2442-10d6-95d0-9e4d33c4613e@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33ea9236-2442-10d6-95d0-9e4d33c4613e@freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 13:48:27 -0000 On Wed, Apr 11, 2018 at 12:51:55AM -0400, Allan Jude wrote: > On 2018-04-10 09:56, Mark Johnston wrote: > > Author: markj > > Date: Tue Apr 10 13:56:06 2018 > > New Revision: 332365 > > URL: https://svnweb.freebsd.org/changeset/base/332365 > > > > Log: > > Set zfs_arc_free_target to v_free_target. > > > > Page daemon output is now regulated by a PID controller with a setpoint > > of v_free_target. Moreover, the page daemon now wakes up regularly > > rather than waiting for a wakeup from another thread. This means that > > the free page count is unlikely to drop below the old > > zfs_arc_free_target value, and as a result the ARC was not readily > > freeing pages under memory pressure. Address the immediate problem by > > updating zfs_arc_free_target to match the page daemon's new behaviour. > > > > Reported and tested by: truckman > > Discussed with: jeff > > X-MFC with: r329882 > > Differential Revision: https://reviews.freebsd.org/D14994 > > > > On a somewhat unrelated note, can we rename this sysctl and change to be > counted in bytes? When users are tuning ZFS, every other ZFS value is in > bytes, not pages. > > Maybe keep the currently variable as it is, in pages, and adjust it by > dividing the user set value by the page size. > > The current name is great, but I wouldn't want anyone to end up setting > it to 4096x the value they actually want if we just changed it out from > under them. Sure, any suggestions for what the new sysctl should be named? From owner-svn-src-all@freebsd.org Wed Apr 11 14:27:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBFDBF98A9A; Wed, 11 Apr 2018 14:27:29 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (mithlond.kdm.org [96.89.93.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mithlond.kdm.org", Issuer "mithlond.kdm.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ADFD8216E; Wed, 11 Apr 2018 14:27:29 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (localhost [127.0.0.1]) by mithlond.kdm.org (8.15.2/8.14.9) with ESMTPS id w3BERLGO057180 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 11 Apr 2018 10:27:21 -0400 (EDT) (envelope-from ken@mithlond.kdm.org) Received: (from ken@localhost) by mithlond.kdm.org (8.15.2/8.14.9/Submit) id w3BERLqU057179; Wed, 11 Apr 2018 10:27:21 -0400 (EDT) (envelope-from ken) Date: Wed, 11 Apr 2018 10:27:21 -0400 From: "Kenneth D. Merry" To: Kyle Evans , Ram Kishore Vegesna , ram.vegesna@broadcom.com Cc: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332386 - head/share/misc Message-ID: <20180411142720.GB36126@mithlond.kdm.org> References: <201804101839.w3AIdKZk026212@repo.freebsd.org> <201804101922.w3AJMvSL024594@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mithlond.kdm.org [127.0.0.1]); Wed, 11 Apr 2018 10:27:21 -0400 (EDT) X-Spam-Status: No, score=-2.6 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mithlond.kdm.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 14:27:29 -0000 On Tue, Apr 10, 2018 at 14:27:26 -0500, Kyle Evans wrote: > On Tue, Apr 10, 2018 at 2:22 PM, Rodney W. Grimes > wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> Author: ram > >> Date: Tue Apr 10 18:39:20 2018 > >> New Revision: 332386 > >> URL: https://svnweb.freebsd.org/changeset/base/332386 > >> > >> Log: > >> Updated mentors information. > >> > >> Approved by: ken, mav > >> > >> Modified: > >> head/share/misc/committers-src.dot > >> > >> Modified: head/share/misc/committers-src.dot > >> ============================================================================== > >> --- head/share/misc/committers-src.dot Tue Apr 10 18:05:02 2018 (r332385) > >> +++ head/share/misc/committers-src.dot Tue Apr 10 18:39:20 2018 (r332386) > >> @@ -76,6 +76,7 @@ nate [label="Nate Willams\nnate@FreeBSD.org\n1993/06/1 > >> njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07\n2008/02/16"] > >> non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\n2000/06/19\n2007/03/06"] > >> onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/07/21\n2008/11/10"] > >> +ram [label="Ram Kishore Vegesna\nram@FreeBSD.org\n2018/04/04\n???/??/??"] > > ^^^^^^^^^ > > That should be removed, you only have a start date. > > Oh and Welcome ram to the project! > > > > The entry is also smack dab in the middle of the alumni section, > rather than the later 'active' section. =) Oops. My fault for not paying attention. :( Pointy hat to: ken Ram, could you fix this and send me the diffs for approval before you commit it? Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@freebsd.org Wed Apr 11 15:15:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 909A6F9C757; Wed, 11 Apr 2018 15:15: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 3DF736FBF7; Wed, 11 Apr 2018 15:15: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 345131DE45; Wed, 11 Apr 2018 15:15:35 +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 w3BFFZcO051469; Wed, 11 Apr 2018 15:15:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BFFYCG051465; Wed, 11 Apr 2018 15:15:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804111515.w3BFFYCG051465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Apr 2018 15:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332409 - in head/sys/dev: bnxt e1000 ixgbe X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/dev: bnxt e1000 ixgbe X-SVN-Commit-Revision: 332409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 15:15:35 -0000 Author: markj Date: Wed Apr 11 15:15:34 2018 New Revision: 332409 URL: https://svnweb.freebsd.org/changeset/base/332409 Log: Use C99 initializers for iflib function tables. Reviewed by: sbruno MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15041 Modified: head/sys/dev/bnxt/bnxt_txrx.c head/sys/dev/e1000/em_txrx.c head/sys/dev/e1000/igb_txrx.c head/sys/dev/ixgbe/ix_txrx.c Modified: head/sys/dev/bnxt/bnxt_txrx.c ============================================================================== --- head/sys/dev/bnxt/bnxt_txrx.c Wed Apr 11 15:04:31 2018 (r332408) +++ head/sys/dev/bnxt/bnxt_txrx.c Wed Apr 11 15:15:34 2018 (r332409) @@ -66,14 +66,14 @@ static int bnxt_isc_rxd_pkt_get(void *sc, if_rxd_info_ static int bnxt_intr(void *sc); struct if_txrx bnxt_txrx = { - bnxt_isc_txd_encap, - bnxt_isc_txd_flush, - bnxt_isc_txd_credits_update, - bnxt_isc_rxd_available, - bnxt_isc_rxd_pkt_get, - bnxt_isc_rxd_refill, - bnxt_isc_rxd_flush, - bnxt_intr + .ift_txd_encap = bnxt_isc_txd_encap, + .ift_txd_flush = bnxt_isc_txd_flush, + .ift_txd_credits_update = bnxt_isc_txd_credits_update, + .ift_rxd_available = bnxt_isc_rxd_available, + .ift_rxd_pkt_get = bnxt_isc_rxd_pkt_get, + .ift_rxd_refill = bnxt_isc_rxd_refill, + .ift_rxd_flush = bnxt_isc_rxd_flush, + .ift_legacy_intr = bnxt_intr }; /* Modified: head/sys/dev/e1000/em_txrx.c ============================================================================== --- head/sys/dev/e1000/em_txrx.c Wed Apr 11 15:04:31 2018 (r332408) +++ head/sys/dev/e1000/em_txrx.c Wed Apr 11 15:15:34 2018 (r332409) @@ -68,25 +68,25 @@ static int em_determine_rsstype(u32 pkt_info); extern int em_intr(void *arg); struct if_txrx em_txrx = { - em_isc_txd_encap, - em_isc_txd_flush, - em_isc_txd_credits_update, - em_isc_rxd_available, - em_isc_rxd_pkt_get, - em_isc_rxd_refill, - em_isc_rxd_flush, - em_intr + .ift_txd_encap = em_isc_txd_encap, + .ift_txd_flush = em_isc_txd_flush, + .ift_txd_credits_update = em_isc_txd_credits_update, + .ift_rxd_available = em_isc_rxd_available, + .ift_rxd_pkt_get = em_isc_rxd_pkt_get, + .ift_rxd_refill = em_isc_rxd_refill, + .ift_rxd_flush = em_isc_rxd_flush, + .ift_legacy_intr = em_intr }; struct if_txrx lem_txrx = { - em_isc_txd_encap, - em_isc_txd_flush, - em_isc_txd_credits_update, - lem_isc_rxd_available, - lem_isc_rxd_pkt_get, - lem_isc_rxd_refill, - em_isc_rxd_flush, - em_intr + .ift_txd_encap = em_isc_txd_encap, + .ift_txd_flush = em_isc_txd_flush, + .ift_txd_credits_update = em_isc_txd_credits_update, + .ift_rxd_available = lem_isc_rxd_available, + .ift_rxd_pkt_get = lem_isc_rxd_pkt_get, + .ift_rxd_refill = lem_isc_rxd_refill, + .ift_rxd_flush = em_isc_rxd_flush, + .ift_legacy_intr = em_intr }; extern if_shared_ctx_t em_sctx; Modified: head/sys/dev/e1000/igb_txrx.c ============================================================================== --- head/sys/dev/e1000/igb_txrx.c Wed Apr 11 15:04:31 2018 (r332408) +++ head/sys/dev/e1000/igb_txrx.c Wed Apr 11 15:15:34 2018 (r332409) @@ -62,14 +62,14 @@ extern void igb_if_enable_intr(if_ctx_t ctx); extern int em_intr(void *arg); struct if_txrx igb_txrx = { - igb_isc_txd_encap, - igb_isc_txd_flush, - igb_isc_txd_credits_update, - igb_isc_rxd_available, - igb_isc_rxd_pkt_get, - igb_isc_rxd_refill, - igb_isc_rxd_flush, - em_intr + .ift_txd_encap = igb_isc_txd_encap, + .ift_txd_flush = igb_isc_txd_flush, + .ift_txd_credits_update = igb_isc_txd_credits_update, + .ift_rxd_available = igb_isc_rxd_available, + .ift_rxd_pkt_get = igb_isc_rxd_pkt_get, + .ift_rxd_refill = igb_isc_rxd_refill, + .ift_rxd_flush = igb_isc_rxd_flush, + .ift_legacy_intr = em_intr }; extern if_shared_ctx_t em_sctx; Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Wed Apr 11 15:04:31 2018 (r332408) +++ head/sys/dev/ixgbe/ix_txrx.c Wed Apr 11 15:15:34 2018 (r332409) @@ -62,14 +62,14 @@ extern void ixgbe_if_enable_intr(if_ctx_t ctx); static int ixgbe_determine_rsstype(u16 pkt_info); struct if_txrx ixgbe_txrx = { - ixgbe_isc_txd_encap, - ixgbe_isc_txd_flush, - ixgbe_isc_txd_credits_update, - ixgbe_isc_rxd_available, - ixgbe_isc_rxd_pkt_get, - ixgbe_isc_rxd_refill, - ixgbe_isc_rxd_flush, - NULL + .ift_txd_encap = ixgbe_isc_txd_encap, + .ift_txd_flush = ixgbe_isc_txd_flush, + .ift_txd_credits_update = ixgbe_isc_txd_credits_update, + .ift_rxd_available = ixgbe_isc_rxd_available, + .ift_rxd_pkt_get = ixgbe_isc_rxd_pkt_get, + .ift_rxd_refill = ixgbe_isc_rxd_refill, + .ift_rxd_flush = ixgbe_isc_rxd_flush, + .ift_legacy_intr = NULL }; extern if_shared_ctx_t ixgbe_sctx; From owner-svn-src-all@freebsd.org Wed Apr 11 17:18:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D19C2F808E5; Wed, 11 Apr 2018 17:18:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DA3C6A33F; Wed, 11 Apr 2018 17:18:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1F35310AFD4; Wed, 11 Apr 2018 13:18:39 -0400 (EDT) From: John Baldwin To: Slawa Olhovchenkov Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Date: Wed, 11 Apr 2018 08:52:08 -0700 Message-ID: <84716725.OOlTe33nR2@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180409162909.GF6612@zxy.spb.ru> References: <201804060925.w369P8c2019558@repo.freebsd.org> <20180409162909.GF6612@zxy.spb.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 11 Apr 2018 13:18:39 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:18:41 -0000 On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > Author: kib > > Date: Fri Apr 6 09:25:08 2018 > > New Revision: 332091 > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > Log: > > MFC r331760: > > Make vm_map_max/min/pmap KBI stable. > > > > Modified: > > stable/11/sys/vm/vm_map.c > > stable/11/sys/vm/vm_map.h > > Directory Properties: > > stable/11/ (props changed) > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > nvidia (build on 11.1-RELEASE) also don't work Yes, this only helps with the future KBI, it doesn't restore the existing one. However, r320889 which was committed earlier should have restored the KBI? -- John Baldwin From owner-svn-src-all@freebsd.org Wed Apr 11 17:18:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 035D1F80944; Wed, 11 Apr 2018 17:18:55 +0000 (UTC) (envelope-from gnn@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 A9EF26A5F6; Wed, 11 Apr 2018 17:18:54 +0000 (UTC) (envelope-from gnn@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 9EE8D1F120; Wed, 11 Apr 2018 17:18:54 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BHIsrS011066; Wed, 11 Apr 2018 17:18:54 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BHIs0h011065; Wed, 11 Apr 2018 17:18:54 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201804111718.w3BHIs0h011065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 11 Apr 2018 17:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r332410 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: gnn X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 332410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:18:55 -0000 Author: gnn Date: Wed Apr 11 17:18:54 2018 New Revision: 332410 URL: https://svnweb.freebsd.org/changeset/base/332410 Log: Temporarily suspend Bruce Simpson's commit bit. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed Apr 11 15:15:34 2018 (r332409) +++ svnadmin/conf/access Wed Apr 11 17:18:54 2018 (r332410) @@ -40,7 +40,6 @@ bapt bde bdrewery benno -bms br brd brooks From owner-svn-src-all@freebsd.org Wed Apr 11 17:19:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B478EF80993; Wed, 11 Apr 2018 17:19:11 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EFF36A8FF; Wed, 11 Apr 2018 17:19:10 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wm0-f49.google.com with SMTP id i3so5098956wmf.3; Wed, 11 Apr 2018 10:19:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=08vCITbl7YQtwje6mYNfBwFTZqyOKHbjRfe8cfAnNO4=; b=AAH6YD5pOrPIJ2fc+Q0+ZjlL7JDS2/n0ltyCyKIaCm2bPWJQYFVWqpGTqSp9zxhoBg 89HOgrgA+lIwDztUq6w4DkISb8uyZ6R+EevVeMXP2P1ippsy+Wlk0flxyprvhlMQ1F6T zICDoEYUUfTfP59bp72jE96oFeMHvnjNXdBkng+YWJTb9Tu6hzeb5QivaVyDqneoOfw0 EyiAL3Ex6+zgnOt9K9eDT2m8hAezQxrj5qccsCYEYdYmW/t6SDkOO19qKc7GVs7C49Dy fRkjMdL4RnzI5s5+pu5h1HOJezNMdsuWrSmf8Xm4VX1WxJVf/hiS24J0su2unweaPfbX su0A== X-Gm-Message-State: ALQs6tAC/85xXP/WIBxqfPV12QfD+e7Tg5f4jstk/emwTenEs4UUYctU mCBZ59xXyveRw//71rSib+KqS9wm X-Google-Smtp-Source: AIpwx48QlTFskSdC6diraXqjPfESsG7Z25641R1m4ViLqKGwH73HLTWuCFFosvpoadpLSeCF/bgEYw== X-Received: by 10.80.235.72 with SMTP id z8mr11141077edp.170.1523466776548; Wed, 11 Apr 2018 10:12:56 -0700 (PDT) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com. [74.125.82.51]) by smtp.gmail.com with ESMTPSA id y4sm1033779edi.4.2018.04.11.10.12.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 10:12:56 -0700 (PDT) Received: by mail-wm0-f51.google.com with SMTP id x4so5044617wmh.5; Wed, 11 Apr 2018 10:12:56 -0700 (PDT) X-Received: by 10.28.118.3 with SMTP id r3mr3256482wmc.90.1523466776178; Wed, 11 Apr 2018 10:12:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.199.203 with HTTP; Wed, 11 Apr 2018 10:12:55 -0700 (PDT) In-Reply-To: <201804101948.w3AJmOt2066564@repo.freebsd.org> References: <201804101948.w3AJmOt2066564@repo.freebsd.org> From: "Jonathan T. Looney" Date: Wed, 11 Apr 2018 13:12:55 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332389 - head/sys/net To: Stephen Hurd Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:19:12 -0000 It appears this is causing panics (see the emails on freebsd-current@). >From a brief glance, it appears that the new STATE_LOCK macros is used (and causes panics), but the STATE_LOCK_INIT macro is not used. Is it possible the code is missing an initialization call for the new mutex? Jonathan On Tue, Apr 10, 2018 at 3:48 PM, Stephen Hurd wrote: > Author: shurd > Date: Tue Apr 10 19:48:24 2018 > New Revision: 332389 > URL: https://svnweb.freebsd.org/changeset/base/332389 > > Log: > Split out flag manipulation from general context manipulation in iflib > > To avoid blocking on the context lock in the swi thread and risk > potential > deadlocks, this change protects lighter weight updates that only need to > be consistent with each other with their own lock. > > Submitted by: Matthew Macy > Reviewed by: shurd > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D14967 > > Modified: > head/sys/net/iflib.c > > Modified: head/sys/net/iflib.c > ============================================================ > ================== > --- head/sys/net/iflib.c Tue Apr 10 19:42:50 2018 (r332388) > +++ head/sys/net/iflib.c Tue Apr 10 19:48:24 2018 (r332389) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2014-2017, Matthew Macy > + * Copyright (c) 2014-2018, Matthew Macy > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -163,7 +163,8 @@ struct iflib_ctx { > if_shared_ctx_t ifc_sctx; > struct if_softc_ctx ifc_softc_ctx; > > - struct mtx ifc_mtx; > + struct mtx ifc_ctx_mtx; > + struct mtx ifc_state_mtx; > > uint16_t ifc_nhwtxqs; > uint16_t ifc_nhwrxqs; > @@ -318,8 +319,10 @@ typedef struct iflib_sw_tx_desc_array { > #define IFC_INIT_DONE 0x020 > #define IFC_PREFETCH 0x040 > #define IFC_DO_RESET 0x080 > -#define IFC_CHECK_HUNG 0x100 > +#define IFC_DO_WATCHDOG 0x100 > +#define IFC_CHECK_HUNG 0x200 > > + > #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ > CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ > CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) > @@ -535,13 +538,19 @@ rxd_info_zero(if_rxd_info_t ri) > > #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & > IFF_DRV_RUNNING)) > > -#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_mtx, _name, > "iflib ctx lock", MTX_DEF) > +#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_ctx_mtx, _name, > "iflib ctx lock", MTX_DEF) > +#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_ctx_mtx) > +#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_ctx_mtx) > +#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_ctx_mtx) > > -#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_mtx) > -#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_mtx) > -#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_mtx) > > +#define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, > _name, "iflib state lock", MTX_DEF) > +#define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx) > +#define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx) > +#define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) > > + > + > #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) > #define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) > > @@ -2144,18 +2153,14 @@ iflib_timer(void *arg) > if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) > callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, > txq->ift_timer.c_cpu); > return; > -hung: > - CTX_LOCK(ctx); > - if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); > + hung: > device_printf(ctx->ifc_dev, "TX(%d) desc avail = %d, pidx = %d\n", > txq->ift_id, TXQ_AVAIL(txq), > txq->ift_pidx); > - > - IFDI_WATCHDOG_RESET(ctx); > - ctx->ifc_watchdog_events++; > - > - ctx->ifc_flags |= IFC_DO_RESET; > + STATE_LOCK(ctx); > + if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); > + ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); > iflib_admin_intr_deferred(ctx); > - CTX_UNLOCK(ctx); > + STATE_UNLOCK(ctx); > } > > static void > @@ -2673,10 +2678,10 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) > return true; > return (iflib_rxd_avail(ctx, rxq, *cidxp, 1)); > err: > - CTX_LOCK(ctx); > + STATE_LOCK(ctx); > ctx->ifc_flags |= IFC_DO_RESET; > iflib_admin_intr_deferred(ctx); > - CTX_UNLOCK(ctx); > + STATE_UNLOCK(ctx); > return (false); > } > > @@ -3706,27 +3711,35 @@ _task_fn_admin(void *context) > if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; > iflib_txq_t txq; > int i; > + bool oactive, running, do_reset, do_watchdog; > > - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) { > - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE)) { > - return; > - } > - } > + STATE_LOCK(ctx); > + running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING); > + oactive = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE); > + do_reset = (ctx->ifc_flags & IFC_DO_RESET); > + do_watchdog = (ctx->ifc_flags & IFC_DO_WATCHDOG); > + ctx->ifc_flags &= ~(IFC_DO_RESET|IFC_DO_WATCHDOG); > + STATE_UNLOCK(ctx); > > + if (!running & !oactive) > + return; > + > CTX_LOCK(ctx); > for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, > txq++) { > CALLOUT_LOCK(txq); > callout_stop(&txq->ift_timer); > CALLOUT_UNLOCK(txq); > } > + if (do_watchdog) { > + ctx->ifc_watchdog_events++; > + IFDI_WATCHDOG_RESET(ctx); > + } > IFDI_UPDATE_ADMIN_STATUS(ctx); > for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, > txq++) > callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, > txq->ift_timer.c_cpu); > IFDI_LINK_INTR_ENABLE(ctx); > - if (ctx->ifc_flags & IFC_DO_RESET) { > - ctx->ifc_flags &= ~IFC_DO_RESET; > + if (do_reset) > iflib_if_init_locked(ctx); > - } > CTX_UNLOCK(ctx); > > if (LINK_ACTIVE(ctx) == 0) > @@ -3870,15 +3883,15 @@ iflib_if_qflush(if_t ifp) > iflib_txq_t txq = ctx->ifc_txqs; > int i; > > - CTX_LOCK(ctx); > + STATE_LOCK(ctx); > ctx->ifc_flags |= IFC_QFLUSH; > - CTX_UNLOCK(ctx); > + STATE_UNLOCK(ctx); > for (i = 0; i < NTXQSETS(ctx); i++, txq++) > while (!(ifmp_ring_is_idle(txq->ift_br) || > ifmp_ring_is_stalled(txq->ift_br))) > iflib_txq_check_drain(txq, 0); > - CTX_LOCK(ctx); > + STATE_LOCK(ctx); > ctx->ifc_flags &= ~IFC_QFLUSH; > - CTX_UNLOCK(ctx); > + STATE_UNLOCK(ctx); > > if_qflush(ifp); > } > @@ -3935,14 +3948,18 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t > data) > iflib_stop(ctx); > > if ((err = IFDI_MTU_SET(ctx, ifr->ifr_mtu)) == 0) { > + STATE_LOCK(ctx); > if (ifr->ifr_mtu > ctx->ifc_max_fl_buf_size) > ctx->ifc_flags |= IFC_MULTISEG; > else > ctx->ifc_flags &= ~IFC_MULTISEG; > + STATE_UNLOCK(ctx); > err = if_setmtu(ifp, ifr->ifr_mtu); > } > iflib_init_locked(ctx); > + STATE_LOCK(ctx); > if_setdrvflags(ifp, bits); > + STATE_UNLOCK(ctx); > CTX_UNLOCK(ctx); > break; > case SIOCSIFFLAGS: > @@ -4026,10 +4043,14 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t > data) > bits = if_getdrvflags(ifp); > if (bits & IFF_DRV_RUNNING) > iflib_stop(ctx); > + STATE_LOCK(ctx); > if_togglecapenable(ifp, setmask); > + STATE_UNLOCK(ctx); > if (bits & IFF_DRV_RUNNING) > iflib_init_locked(ctx); > + STATE_LOCK(ctx); > if_setdrvflags(ifp, bits); > + STATE_UNLOCK(ctx); > CTX_UNLOCK(ctx); > } > break; > @@ -5431,9 +5452,11 @@ iflib_link_state_change(if_ctx_t ctx, int > link_state, > iflib_txq_t txq = ctx->ifc_txqs; > > if_setbaudrate(ifp, baudrate); > - if (baudrate >= IF_Gbps(10)) > + if (baudrate >= IF_Gbps(10)) { > + STATE_LOCK(ctx); > ctx->ifc_flags |= IFC_PREFETCH; > - > + STATE_UNLOCK(ctx); > + } > /* If link down, disable watchdog */ > if ((ctx->ifc_link_state == LINK_STATE_UP) && (link_state == > LINK_STATE_DOWN)) { > for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxqsets; i++, > txq++) > @@ -5492,7 +5515,7 @@ struct mtx * > iflib_ctx_lock_get(if_ctx_t ctx) > { > > - return (&ctx->ifc_mtx); > + return (&ctx->ifc_ctx_mtx); > } > > static int > > From owner-svn-src-all@freebsd.org Wed Apr 11 17:26:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B80DF81519; Wed, 11 Apr 2018 17:26:54 +0000 (UTC) (envelope-from sbruno@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 3997C6BE4E; Wed, 11 Apr 2018 17:26:54 +0000 (UTC) (envelope-from sbruno@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 2FEF71F2AB; Wed, 11 Apr 2018 17:26:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BHQsB3015895; Wed, 11 Apr 2018 17:26:54 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BHQs1S015894; Wed, 11 Apr 2018 17:26:54 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201804111726.w3BHQs1S015894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 11 Apr 2018 17:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332411 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:26:54 -0000 Author: sbruno Date: Wed Apr 11 17:26:53 2018 New Revision: 332411 URL: https://svnweb.freebsd.org/changeset/base/332411 Log: Revert r332389 as it is causing panics for various users and we need to add some more test cases. Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Apr 11 17:18:54 2018 (r332410) +++ head/sys/net/iflib.c Wed Apr 11 17:26:53 2018 (r332411) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2018, Matthew Macy + * Copyright (c) 2014-2017, Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -163,8 +163,7 @@ struct iflib_ctx { if_shared_ctx_t ifc_sctx; struct if_softc_ctx ifc_softc_ctx; - struct mtx ifc_ctx_mtx; - struct mtx ifc_state_mtx; + struct mtx ifc_mtx; uint16_t ifc_nhwtxqs; uint16_t ifc_nhwrxqs; @@ -319,10 +318,8 @@ typedef struct iflib_sw_tx_desc_array { #define IFC_INIT_DONE 0x020 #define IFC_PREFETCH 0x040 #define IFC_DO_RESET 0x080 -#define IFC_DO_WATCHDOG 0x100 -#define IFC_CHECK_HUNG 0x200 +#define IFC_CHECK_HUNG 0x100 - #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) @@ -538,19 +535,13 @@ rxd_info_zero(if_rxd_info_t ri) #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING)) -#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_ctx_mtx, _name, "iflib ctx lock", MTX_DEF) -#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_ctx_mtx) -#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_ctx_mtx) -#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_ctx_mtx) +#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx lock", MTX_DEF) +#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_mtx) +#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_mtx) +#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_mtx) -#define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, _name, "iflib state lock", MTX_DEF) -#define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx) -#define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx) -#define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) - - #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) #define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) @@ -2153,14 +2144,18 @@ iflib_timer(void *arg) if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); return; - hung: +hung: + CTX_LOCK(ctx); + if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); device_printf(ctx->ifc_dev, "TX(%d) desc avail = %d, pidx = %d\n", txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx); - STATE_LOCK(ctx); - if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); - ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); + + IFDI_WATCHDOG_RESET(ctx); + ctx->ifc_watchdog_events++; + + ctx->ifc_flags |= IFC_DO_RESET; iflib_admin_intr_deferred(ctx); - STATE_UNLOCK(ctx); + CTX_UNLOCK(ctx); } static void @@ -2678,10 +2673,10 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) return true; return (iflib_rxd_avail(ctx, rxq, *cidxp, 1)); err: - STATE_LOCK(ctx); + CTX_LOCK(ctx); ctx->ifc_flags |= IFC_DO_RESET; iflib_admin_intr_deferred(ctx); - STATE_UNLOCK(ctx); + CTX_UNLOCK(ctx); return (false); } @@ -3711,35 +3706,27 @@ _task_fn_admin(void *context) if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; iflib_txq_t txq; int i; - bool oactive, running, do_reset, do_watchdog; - STATE_LOCK(ctx); - running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING); - oactive = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE); - do_reset = (ctx->ifc_flags & IFC_DO_RESET); - do_watchdog = (ctx->ifc_flags & IFC_DO_WATCHDOG); - ctx->ifc_flags &= ~(IFC_DO_RESET|IFC_DO_WATCHDOG); - STATE_UNLOCK(ctx); + if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) { + if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE)) { + return; + } + } - if (!running & !oactive) - return; - CTX_LOCK(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) { CALLOUT_LOCK(txq); callout_stop(&txq->ift_timer); CALLOUT_UNLOCK(txq); } - if (do_watchdog) { - ctx->ifc_watchdog_events++; - IFDI_WATCHDOG_RESET(ctx); - } IFDI_UPDATE_ADMIN_STATUS(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); IFDI_LINK_INTR_ENABLE(ctx); - if (do_reset) + if (ctx->ifc_flags & IFC_DO_RESET) { + ctx->ifc_flags &= ~IFC_DO_RESET; iflib_if_init_locked(ctx); + } CTX_UNLOCK(ctx); if (LINK_ACTIVE(ctx) == 0) @@ -3883,15 +3870,15 @@ iflib_if_qflush(if_t ifp) iflib_txq_t txq = ctx->ifc_txqs; int i; - STATE_LOCK(ctx); + CTX_LOCK(ctx); ctx->ifc_flags |= IFC_QFLUSH; - STATE_UNLOCK(ctx); + CTX_UNLOCK(ctx); for (i = 0; i < NTXQSETS(ctx); i++, txq++) while (!(ifmp_ring_is_idle(txq->ift_br) || ifmp_ring_is_stalled(txq->ift_br))) iflib_txq_check_drain(txq, 0); - STATE_LOCK(ctx); + CTX_LOCK(ctx); ctx->ifc_flags &= ~IFC_QFLUSH; - STATE_UNLOCK(ctx); + CTX_UNLOCK(ctx); if_qflush(ifp); } @@ -3948,18 +3935,14 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) iflib_stop(ctx); if ((err = IFDI_MTU_SET(ctx, ifr->ifr_mtu)) == 0) { - STATE_LOCK(ctx); if (ifr->ifr_mtu > ctx->ifc_max_fl_buf_size) ctx->ifc_flags |= IFC_MULTISEG; else ctx->ifc_flags &= ~IFC_MULTISEG; - STATE_UNLOCK(ctx); err = if_setmtu(ifp, ifr->ifr_mtu); } iflib_init_locked(ctx); - STATE_LOCK(ctx); if_setdrvflags(ifp, bits); - STATE_UNLOCK(ctx); CTX_UNLOCK(ctx); break; case SIOCSIFFLAGS: @@ -4043,14 +4026,10 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) bits = if_getdrvflags(ifp); if (bits & IFF_DRV_RUNNING) iflib_stop(ctx); - STATE_LOCK(ctx); if_togglecapenable(ifp, setmask); - STATE_UNLOCK(ctx); if (bits & IFF_DRV_RUNNING) iflib_init_locked(ctx); - STATE_LOCK(ctx); if_setdrvflags(ifp, bits); - STATE_UNLOCK(ctx); CTX_UNLOCK(ctx); } break; @@ -5452,11 +5431,9 @@ iflib_link_state_change(if_ctx_t ctx, int link_state, iflib_txq_t txq = ctx->ifc_txqs; if_setbaudrate(ifp, baudrate); - if (baudrate >= IF_Gbps(10)) { - STATE_LOCK(ctx); + if (baudrate >= IF_Gbps(10)) ctx->ifc_flags |= IFC_PREFETCH; - STATE_UNLOCK(ctx); - } + /* If link down, disable watchdog */ if ((ctx->ifc_link_state == LINK_STATE_UP) && (link_state == LINK_STATE_DOWN)) { for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxqsets; i++, txq++) @@ -5515,7 +5492,7 @@ struct mtx * iflib_ctx_lock_get(if_ctx_t ctx) { - return (&ctx->ifc_ctx_mtx); + return (&ctx->ifc_mtx); } static int From owner-svn-src-all@freebsd.org Wed Apr 11 17:28:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CC26F81733; Wed, 11 Apr 2018 17:28:27 +0000 (UTC) (envelope-from brooks@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 C48456C093; Wed, 11 Apr 2018 17:28:26 +0000 (UTC) (envelope-from brooks@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 BEFCB1F2AE; Wed, 11 Apr 2018 17:28:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BHSQU2016014; Wed, 11 Apr 2018 17:28:26 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BHSOvP015995; Wed, 11 Apr 2018 17:28:24 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804111728.w3BHSOvP015995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 11 Apr 2018 17:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332412 - in head: . lib/libifconfig sbin/etherswitchcfg sbin/ifconfig share/man/man4 sys/conf sys/dev/pdq sys/net sys/netinet sys/netinet6 sys/nfs X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . lib/libifconfig sbin/etherswitchcfg sbin/ifconfig share/man/man4 sys/conf sys/dev/pdq sys/net sys/netinet sys/netinet6 sys/nfs X-SVN-Commit-Revision: 332412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:28:27 -0000 Author: brooks Date: Wed Apr 11 17:28:24 2018 New Revision: 332412 URL: https://svnweb.freebsd.org/changeset/base/332412 Log: Remove support for FDDI networks. Defines in net/if_media.h remain in case code copied from ifconfig is in use elsewere (supporting non-existant media type is harmless). Reviewed by: kib, jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15017 Deleted: head/share/man/man4/fpa.4 head/sys/dev/pdq/if_fpa.c head/sys/dev/pdq/pdq.c head/sys/dev/pdq/pdq_freebsd.h head/sys/dev/pdq/pdq_ifsubr.c head/sys/dev/pdq/pdqreg.h head/sys/dev/pdq/pdqvar.h head/sys/net/fddi.h head/sys/net/if_fddisubr.c Modified: head/ObsoleteFiles.inc head/UPDATING head/lib/libifconfig/libifconfig_media.c head/sbin/etherswitchcfg/ifmedia.c head/sbin/ifconfig/ifmedia.c head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/net/if.c head/sys/net/if_bridge.c head/sys/net/if_media.c head/sys/netinet/if_ether.c head/sys/netinet/ip_carp.c head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/nfs/bootp_subr.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Apr 11 17:26:53 2018 (r332411) +++ head/ObsoleteFiles.inc Wed Apr 11 17:28:24 2018 (r332412) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180409: remove FDDI support +OLD_FILES+=usr/include/net/fddi.h # 20180319: remove /boot/overlays, replaced by /boot/dtb/overlays OLD_DIRS+=boot/overlays # 20180311: remove sys/sys/i386/include/pcaudioio.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Apr 11 17:26:53 2018 (r332411) +++ head/UPDATING Wed Apr 11 17:28:24 2018 (r332412) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180411: + Support for FDDI networks has been removed. If you have device + fddi or device fpa in your kernel config file they must be + removed. + 20180406: In addition to supporting RFC 3164 formatted messages, the syslogd(8) service is now capable of parsing RFC 5424 formatted Modified: head/lib/libifconfig/libifconfig_media.c ============================================================================== --- head/lib/libifconfig/libifconfig_media.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/lib/libifconfig/libifconfig_media.c Wed Apr 11 17:28:24 2018 (r332412) @@ -86,15 +86,6 @@ static struct ifmedia_description ifm_subtype_tokenrin static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_fddi_descriptions[] = - IFM_SUBTYPE_FDDI_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_fddi_aliases[] = - IFM_SUBTYPE_FDDI_ALIASES; - -static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; - static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -182,24 +173,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to { &ifm_shared_option_descriptions[0], 0 }, { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_tokenring_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_fddi_descriptions[0], 0 }, - { &ifm_subtype_fddi_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_fddi_option_descriptions[0], 0 }, { NULL, 0 }, }, { Modified: head/sbin/etherswitchcfg/ifmedia.c ============================================================================== --- head/sbin/etherswitchcfg/ifmedia.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sbin/etherswitchcfg/ifmedia.c Wed Apr 11 17:28:24 2018 (r332412) @@ -380,15 +380,6 @@ static struct ifmedia_description ifm_subtype_tokenrin static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_fddi_descriptions[] = - IFM_SUBTYPE_FDDI_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_fddi_aliases[] = - IFM_SUBTYPE_FDDI_ALIASES; - -static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; - static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -472,24 +463,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to { &ifm_shared_option_descriptions[0], 0 }, { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_tokenring_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_fddi_descriptions[0], 0 }, - { &ifm_subtype_fddi_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_fddi_option_descriptions[0], 0 }, { NULL, 0 }, }, { Modified: head/sbin/ifconfig/ifmedia.c ============================================================================== --- head/sbin/ifconfig/ifmedia.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sbin/ifconfig/ifmedia.c Wed Apr 11 17:28:24 2018 (r332412) @@ -397,15 +397,6 @@ static struct ifmedia_description ifm_subtype_tokenrin static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_fddi_descriptions[] = - IFM_SUBTYPE_FDDI_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_fddi_aliases[] = - IFM_SUBTYPE_FDDI_ALIASES; - -static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; - static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -489,24 +480,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to { &ifm_shared_option_descriptions[0], 0 }, { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_tokenring_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_fddi_descriptions[0], 0 }, - { &ifm_subtype_fddi_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_fddi_option_descriptions[0], 0 }, { NULL, 0 }, }, { Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Apr 11 17:26:53 2018 (r332411) +++ head/share/man/man4/Makefile Wed Apr 11 17:28:24 2018 (r332412) @@ -170,7 +170,6 @@ MAN= aac.4 \ ffclock.4 \ filemon.4 \ firewire.4 \ - fpa.4 \ full.4 \ fwe.4 \ fwip.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/conf/NOTES Wed Apr 11 17:28:24 2018 (r332412) @@ -845,9 +845,6 @@ device wlan_xauth device wlan_acl device wlan_amrr -# The `fddi' device provides generic code to support FDDI. -device fddi - # The `arcnet' device provides generic code to support Arcnet. device arcnet @@ -1972,7 +1969,6 @@ device xmphy # XaQti XMAC II # ex: Intel EtherExpress Pro/10 and other i82595-based adapters, # Olicom Ethernet PC Card devices. # fe: Fujitsu MB86960A/MB86965A Ethernet -# fpa: Support for the Digital DEFPA PCI FDDI. `device fddi' is also needed. # fxp: Intel EtherExpress Pro/100B # (hint of prefer_iomap can be done to prefer I/O instead of Mem mapping) # gem: Apple GMAC/Sun ERI/Sun GEM @@ -2149,9 +2145,6 @@ device ti # Alteon Networks Tigon I/II gigabit Ether device txp # 3Com 3cR990 (``Typhoon'') device vx # 3Com 3c590, 3c595 (``Vortex'') device vxge # Exar/Neterion XFrame 3100 10GbE - -# PCI FDDI NICs. -device fpa # PCI WAN adapters. device lmc Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/conf/files Wed Apr 11 17:28:24 2018 (r332412) @@ -2642,9 +2642,6 @@ dev/pci/pcib_if.m standard dev/pci/pcib_support.c standard dev/pci/vga_pci.c optional pci dev/pcn/if_pcn.c optional pcn pci -dev/pdq/if_fpa.c optional fpa pci -dev/pdq/pdq.c optional nowerror fpa pci -dev/pdq/pdq_ifsubr.c optional nowerror fpa pci dev/pms/freebsd/driver/ini/src/agtiapi.c optional pmspcv \ compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w" dev/pms/RefTisa/sallsdk/spc/sadisc.c optional pmspcv \ @@ -4130,7 +4127,6 @@ net/if_edsc.c optional edsc net/if_enc.c optional enc inet | enc inet6 net/if_epair.c optional epair net/if_ethersubr.c optional ether -net/if_fddisubr.c optional fddi net/if_fwsubr.c optional fwip net/if_gif.c optional gif inet | gif inet6 | \ netgraph_gif inet | netgraph_gif inet6 Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/net/if.c Wed Apr 11 17:28:24 2018 (r332412) @@ -3692,7 +3692,6 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, } switch (ifp->if_type) { case IFT_ETHER: - case IFT_FDDI: case IFT_XETHER: case IFT_L2VLAN: case IFT_BRIDGE: Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/net/if_bridge.c Wed Apr 11 17:28:24 2018 (r332412) @@ -72,8 +72,8 @@ * * - Currently only supports Ethernet-like interfaces (Ethernet, * 802.11, VLANs on Ethernet, etc.) Figure out a nice way - * to bridge other types of interfaces (FDDI-FDDI, and maybe - * consider heterogeneous bridges). + * to bridge other types of interfaces (maybe consider + * heterogeneous bridges). */ #include Modified: head/sys/net/if_media.c ============================================================================== --- head/sys/net/if_media.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/net/if_media.c Wed Apr 11 17:28:24 2018 (r332412) @@ -405,12 +405,6 @@ struct ifmedia_description ifm_subtype_tokenring_descr struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; -struct ifmedia_description ifm_subtype_fddi_descriptions[] = - IFM_SUBTYPE_FDDI_DESCRIPTIONS; - -struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; - struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -448,11 +442,6 @@ struct ifmedia_type_to_subtype ifmedia_types_to_subtyp { &ifm_subtype_tokenring_descriptions[0], &ifm_subtype_tokenring_option_descriptions[0], - NULL, - }, - { - &ifm_subtype_fddi_descriptions[0], - &ifm_subtype_fddi_option_descriptions[0], NULL, }, { Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/netinet/if_ether.c Wed Apr 11 17:28:24 2018 (r332412) @@ -694,10 +694,6 @@ arpintr(struct mbuf *m) hlen = ETHER_ADDR_LEN; /* RFC 826 */ layer = "ethernet"; break; - case ARPHRD_IEEE802: - hlen = 6; /* RFC 1390, FDDI_ADDR_LEN */ - layer = "fddi"; - break; case ARPHRD_ARCNET: hlen = 1; /* RFC 1201, ARC_ADDR_LEN */ layer = "arcnet"; Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/netinet/ip_carp.c Wed Apr 11 17:28:24 2018 (r332412) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -1526,18 +1525,6 @@ carp_output(struct ifnet *ifp, struct mbuf *m, const s eh->ether_shost[5] = sc->sc_vhid; } break; - case IFT_FDDI: { - struct fddi_header *fh; - - fh = mtod(m, struct fddi_header *); - fh->fddi_shost[0] = 0; - fh->fddi_shost[1] = 0; - fh->fddi_shost[2] = 0x5e; - fh->fddi_shost[3] = 0; - fh->fddi_shost[4] = 1; - fh->fddi_shost[5] = sc->sc_vhid; - } - break; default: printf("%s: carp is not supported for the %d interface type\n", ifp->if_xname, ifp->if_type); @@ -1719,7 +1706,6 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa case IFT_ETHER: case IFT_L2VLAN: case IFT_BRIDGE: - case IFT_FDDI: break; default: error = EOPNOTSUPP; Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/netinet6/in6.c Wed Apr 11 17:28:24 2018 (r332412) @@ -1972,8 +1972,6 @@ in6_if2idlen(struct ifnet *ifp) case IFT_BRIDGE: /* bridge(4) only does Ethernet-like links */ case IFT_INFINIBAND: return (64); - case IFT_FDDI: /* RFC2467 */ - return (64); case IFT_PPP: /* RFC2472 */ return (64); case IFT_ARCNET: /* RFC2497 */ Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/netinet6/in6_ifattach.c Wed Apr 11 17:28:24 2018 (r332412) @@ -274,7 +274,6 @@ found: case IFT_BRIDGE: case IFT_ETHER: case IFT_L2VLAN: - case IFT_FDDI: case IFT_ATM: case IFT_IEEE1394: /* IEEE802/EUI64 cases - what others? */ Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/netinet6/nd6.c Wed Apr 11 17:28:24 2018 (r332412) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -340,9 +339,6 @@ nd6_setmtu0(struct ifnet *ifp, struct nd_ifinfo *ndi) case IFT_ARCNET: ndi->maxmtu = MIN(ARC_PHDS_MAXMTU, ifp->if_mtu); /* RFC2497 */ break; - case IFT_FDDI: - ndi->maxmtu = MIN(FDDIIPMTU, ifp->if_mtu); /* RFC2467 */ - break; default: ndi->maxmtu = ifp->if_mtu; break; @@ -2272,7 +2268,6 @@ nd6_resolve(struct ifnet *ifp, int is_gw, struct mbuf if (m != NULL && m->m_flags & M_MCAST) { switch (ifp->if_type) { case IFT_ETHER: - case IFT_FDDI: case IFT_L2VLAN: case IFT_BRIDGE: ETHER_MAP_IPV6_MULTICAST(&dst6->sin6_addr, @@ -2524,7 +2519,7 @@ nd6_need_cache(struct ifnet *ifp) { /* * XXX: we currently do not make neighbor cache on any interface - * other than ARCnet, Ethernet, FDDI and GIF. + * other than ARCnet, Ethernet and GIF. * * RFC2893 says: * - unidirectional tunnels needs no ND @@ -2532,7 +2527,6 @@ nd6_need_cache(struct ifnet *ifp) switch (ifp->if_type) { case IFT_ARCNET: case IFT_ETHER: - case IFT_FDDI: case IFT_IEEE1394: case IFT_L2VLAN: case IFT_INFINIBAND: Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/netinet6/nd6_nbr.c Wed Apr 11 17:28:24 2018 (r332412) @@ -1092,7 +1092,6 @@ nd6_ifptomac(struct ifnet *ifp) switch (ifp->if_type) { case IFT_ARCNET: case IFT_ETHER: - case IFT_FDDI: case IFT_IEEE1394: case IFT_L2VLAN: case IFT_INFINIBAND: @@ -1466,7 +1465,6 @@ nd6_dad_duplicated(struct ifaddr *ifa, struct dadq *dp */ switch (ifp->if_type) { case IFT_ETHER: - case IFT_FDDI: case IFT_ATM: case IFT_IEEE1394: case IFT_INFINIBAND: Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Wed Apr 11 17:26:53 2018 (r332411) +++ head/sys/nfs/bootp_subr.c Wed Apr 11 17:28:24 2018 (r332412) @@ -1645,7 +1645,6 @@ bootpc_init(void) continue; switch (ifp->if_alloctype) { case IFT_ETHER: - case IFT_FDDI: break; default: continue; @@ -1675,7 +1674,6 @@ retry: continue; switch (ifp->if_alloctype) { case IFT_ETHER: - case IFT_FDDI: break; default: continue; From owner-svn-src-all@freebsd.org Wed Apr 11 17:30:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 128C5F81A69; Wed, 11 Apr 2018 17:30:18 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward3j.cmail.yandex.net (forward3j.cmail.yandex.net [IPv6:2a02:6b8:0:1630::16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC8C86C35D; Wed, 11 Apr 2018 17:30:17 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward3j.cmail.yandex.net (Yandex) with ESMTP id 4998C20694; Wed, 11 Apr 2018 20:30:14 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id v77o75vgbj-UCBGxZHO; Wed, 11 Apr 2018 20:30:13 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1523467813; bh=PxdzbADZXPI6RX+QNGvAEOcRb6rTK9WuPpoqQ24sids=; h=From:To:In-Reply-To:References:Subject:Message-Id:Date; b=RqukMMjb2fDy51ULoGDjvwcpKc3zFFGHEOpuieUBhYgkqNtcN3yd+L5b6F8NL/LCE mm4Na0wxNSfed73yTpKzTyCYiIpHc0ZpdPbi2x2kZ1UwhCvIYbR63W1UGwgCzG4T+G C1LA9z9dp03uRE+bXzLpceehz6ge1EU1i3Sy/qAU= Authentication-Results: mxback18j.mail.yandex.net; dkim=pass header.i=@ipfw.ru Received: by web41g.yandex.ru with HTTP; Wed, 11 Apr 2018 20:30:12 +0300 From: Alexander V. Chernikov To: Brooks Davis , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <201804111728.w3BHSOvP015995@repo.freebsd.org> References: <201804111728.w3BHSOvP015995@repo.freebsd.org> Subject: Re: svn commit: r332412 - in head: . lib/libifconfig sbin/etherswitchcfg sbin/ifconfig share/man/man4 sys/conf sys/dev/pdq sys/net sys/netinet sys/netinet6 sys/nfs MIME-Version: 1.0 Message-Id: <266041523467812@web41g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 11 Apr 2018 20:30:12 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:30:18 -0000 11.04.2018, 20:28, "Brooks Davis" : > Author: brooks > Date: Wed Apr 11 17:28:24 2018 > New Revision: 332412 > URL: https://svnweb.freebsd.org/changeset/base/332412 > > Log: >   Remove support for FDDI networks. Awesome! Thank you! > >   Defines in net/if_media.h remain in case code copied from ifconfig is in >   use elsewere (supporting non-existant media type is harmless). > >   Reviewed by: kib, jhb >   Sponsored by: DARPA, AFRL >   Differential Revision: https://reviews.freebsd.org/D15017 > > Deleted: >   head/share/man/man4/fpa.4 >   head/sys/dev/pdq/if_fpa.c >   head/sys/dev/pdq/pdq.c >   head/sys/dev/pdq/pdq_freebsd.h >   head/sys/dev/pdq/pdq_ifsubr.c >   head/sys/dev/pdq/pdqreg.h >   head/sys/dev/pdq/pdqvar.h >   head/sys/net/fddi.h >   head/sys/net/if_fddisubr.c > Modified: >   head/ObsoleteFiles.inc >   head/UPDATING >   head/lib/libifconfig/libifconfig_media.c >   head/sbin/etherswitchcfg/ifmedia.c >   head/sbin/ifconfig/ifmedia.c >   head/share/man/man4/Makefile >   head/sys/conf/NOTES >   head/sys/conf/files >   head/sys/net/if.c >   head/sys/net/if_bridge.c >   head/sys/net/if_media.c >   head/sys/netinet/if_ether.c >   head/sys/netinet/ip_carp.c >   head/sys/netinet6/in6.c >   head/sys/netinet6/in6_ifattach.c >   head/sys/netinet6/nd6.c >   head/sys/netinet6/nd6_nbr.c >   head/sys/nfs/bootp_subr.c > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Wed Apr 11 17:26:53 2018 (r332411) > +++ head/ObsoleteFiles.inc Wed Apr 11 17:28:24 2018 (r332412) > @@ -38,6 +38,8 @@ >  # xargs -n1 | sort | uniq -d; >  # done > > +# 20180409: remove FDDI support > +OLD_FILES+=usr/include/net/fddi.h >  # 20180319: remove /boot/overlays, replaced by /boot/dtb/overlays >  OLD_DIRS+=boot/overlays >  # 20180311: remove sys/sys/i386/include/pcaudioio.h > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Wed Apr 11 17:26:53 2018 (r332411) > +++ head/UPDATING Wed Apr 11 17:28:24 2018 (r332412) > @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > >  ****************************** SPECIAL WARNING: ****************************** > > +20180411: > + Support for FDDI networks has been removed. If you have device > + fddi or device fpa in your kernel config file they must be > + removed. > + >  20180406: >          In addition to supporting RFC 3164 formatted messages, the >          syslogd(8) service is now capable of parsing RFC 5424 formatted > > Modified: head/lib/libifconfig/libifconfig_media.c > ============================================================================== > --- head/lib/libifconfig/libifconfig_media.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/lib/libifconfig/libifconfig_media.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -86,15 +86,6 @@ static struct ifmedia_description ifm_subtype_tokenrin >  static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = >      IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; > > -static struct ifmedia_description ifm_subtype_fddi_descriptions[] = > - IFM_SUBTYPE_FDDI_DESCRIPTIONS; > - > -static struct ifmedia_description ifm_subtype_fddi_aliases[] = > - IFM_SUBTYPE_FDDI_ALIASES; > - > -static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = > - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; > - >  static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = >      IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; > > @@ -182,24 +173,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to >                          { &ifm_shared_option_descriptions[0], 0 }, >                          { &ifm_shared_option_aliases[0], 1 }, >                          { &ifm_subtype_tokenring_option_descriptions[0], 0 }, > - { NULL, 0 }, > - }, > - { > - { NULL, 0 }, > - }, > - }, > - { > - { > - { &ifm_subtype_shared_descriptions[0], 0 }, > - { &ifm_subtype_shared_aliases[0], 1 }, > - { &ifm_subtype_fddi_descriptions[0], 0 }, > - { &ifm_subtype_fddi_aliases[0], 1 }, > - { NULL, 0 }, > - }, > - { > - { &ifm_shared_option_descriptions[0], 0 }, > - { &ifm_shared_option_aliases[0], 1 }, > - { &ifm_subtype_fddi_option_descriptions[0], 0 }, >                          { NULL, 0 }, >                  }, >                  { > > Modified: head/sbin/etherswitchcfg/ifmedia.c > ============================================================================== > --- head/sbin/etherswitchcfg/ifmedia.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sbin/etherswitchcfg/ifmedia.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -380,15 +380,6 @@ static struct ifmedia_description ifm_subtype_tokenrin >  static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = >      IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; > > -static struct ifmedia_description ifm_subtype_fddi_descriptions[] = > - IFM_SUBTYPE_FDDI_DESCRIPTIONS; > - > -static struct ifmedia_description ifm_subtype_fddi_aliases[] = > - IFM_SUBTYPE_FDDI_ALIASES; > - > -static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = > - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; > - >  static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = >      IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; > > @@ -472,24 +463,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to >                          { &ifm_shared_option_descriptions[0], 0 }, >                          { &ifm_shared_option_aliases[0], 1 }, >                          { &ifm_subtype_tokenring_option_descriptions[0], 0 }, > - { NULL, 0 }, > - }, > - { > - { NULL, 0 }, > - }, > - }, > - { > - { > - { &ifm_subtype_shared_descriptions[0], 0 }, > - { &ifm_subtype_shared_aliases[0], 1 }, > - { &ifm_subtype_fddi_descriptions[0], 0 }, > - { &ifm_subtype_fddi_aliases[0], 1 }, > - { NULL, 0 }, > - }, > - { > - { &ifm_shared_option_descriptions[0], 0 }, > - { &ifm_shared_option_aliases[0], 1 }, > - { &ifm_subtype_fddi_option_descriptions[0], 0 }, >                          { NULL, 0 }, >                  }, >                  { > > Modified: head/sbin/ifconfig/ifmedia.c > ============================================================================== > --- head/sbin/ifconfig/ifmedia.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sbin/ifconfig/ifmedia.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -397,15 +397,6 @@ static struct ifmedia_description ifm_subtype_tokenrin >  static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = >      IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; > > -static struct ifmedia_description ifm_subtype_fddi_descriptions[] = > - IFM_SUBTYPE_FDDI_DESCRIPTIONS; > - > -static struct ifmedia_description ifm_subtype_fddi_aliases[] = > - IFM_SUBTYPE_FDDI_ALIASES; > - > -static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = > - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; > - >  static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = >      IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; > > @@ -489,24 +480,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to >                          { &ifm_shared_option_descriptions[0], 0 }, >                          { &ifm_shared_option_aliases[0], 1 }, >                          { &ifm_subtype_tokenring_option_descriptions[0], 0 }, > - { NULL, 0 }, > - }, > - { > - { NULL, 0 }, > - }, > - }, > - { > - { > - { &ifm_subtype_shared_descriptions[0], 0 }, > - { &ifm_subtype_shared_aliases[0], 1 }, > - { &ifm_subtype_fddi_descriptions[0], 0 }, > - { &ifm_subtype_fddi_aliases[0], 1 }, > - { NULL, 0 }, > - }, > - { > - { &ifm_shared_option_descriptions[0], 0 }, > - { &ifm_shared_option_aliases[0], 1 }, > - { &ifm_subtype_fddi_option_descriptions[0], 0 }, >                          { NULL, 0 }, >                  }, >                  { > > Modified: head/share/man/man4/Makefile > ============================================================================== > --- head/share/man/man4/Makefile Wed Apr 11 17:26:53 2018 (r332411) > +++ head/share/man/man4/Makefile Wed Apr 11 17:28:24 2018 (r332412) > @@ -170,7 +170,6 @@ MAN= aac.4 \ >          ffclock.4 \ >          filemon.4 \ >          firewire.4 \ > - fpa.4 \ >          full.4 \ >          fwe.4 \ >          fwip.4 \ > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/conf/NOTES Wed Apr 11 17:28:24 2018 (r332412) > @@ -845,9 +845,6 @@ device wlan_xauth >  device wlan_acl >  device wlan_amrr > > -# The `fddi' device provides generic code to support FDDI. > -device fddi > - >  # The `arcnet' device provides generic code to support Arcnet. >  device arcnet > > @@ -1972,7 +1969,6 @@ device xmphy # XaQti XMAC II >  # ex: Intel EtherExpress Pro/10 and other i82595-based adapters, >  # Olicom Ethernet PC Card devices. >  # fe: Fujitsu MB86960A/MB86965A Ethernet > -# fpa: Support for the Digital DEFPA PCI FDDI. `device fddi' is also needed. >  # fxp: Intel EtherExpress Pro/100B >  # (hint of prefer_iomap can be done to prefer I/O instead of Mem mapping) >  # gem: Apple GMAC/Sun ERI/Sun GEM > @@ -2149,9 +2145,6 @@ device ti # Alteon Networks Tigon I/II gigabit Ether >  device txp # 3Com 3cR990 (``Typhoon'') >  device vx # 3Com 3c590, 3c595 (``Vortex'') >  device vxge # Exar/Neterion XFrame 3100 10GbE > - > -# PCI FDDI NICs. > -device fpa > >  # PCI WAN adapters. >  device lmc > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/conf/files Wed Apr 11 17:28:24 2018 (r332412) > @@ -2642,9 +2642,6 @@ dev/pci/pcib_if.m standard >  dev/pci/pcib_support.c standard >  dev/pci/vga_pci.c optional pci >  dev/pcn/if_pcn.c optional pcn pci > -dev/pdq/if_fpa.c optional fpa pci > -dev/pdq/pdq.c optional nowerror fpa pci > -dev/pdq/pdq_ifsubr.c optional nowerror fpa pci >  dev/pms/freebsd/driver/ini/src/agtiapi.c optional pmspcv \ >          compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w" >  dev/pms/RefTisa/sallsdk/spc/sadisc.c optional pmspcv \ > @@ -4130,7 +4127,6 @@ net/if_edsc.c optional edsc >  net/if_enc.c optional enc inet | enc inet6 >  net/if_epair.c optional epair >  net/if_ethersubr.c optional ether > -net/if_fddisubr.c optional fddi >  net/if_fwsubr.c optional fwip >  net/if_gif.c optional gif inet | gif inet6 | \ >                                           netgraph_gif inet | netgraph_gif inet6 > > Modified: head/sys/net/if.c > ============================================================================== > --- head/sys/net/if.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/net/if.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -3692,7 +3692,6 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, >          } >          switch (ifp->if_type) { >          case IFT_ETHER: > - case IFT_FDDI: >          case IFT_XETHER: >          case IFT_L2VLAN: >          case IFT_BRIDGE: > > Modified: head/sys/net/if_bridge.c > ============================================================================== > --- head/sys/net/if_bridge.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/net/if_bridge.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -72,8 +72,8 @@ >   * >   * - Currently only supports Ethernet-like interfaces (Ethernet, >   * 802.11, VLANs on Ethernet, etc.) Figure out a nice way > - * to bridge other types of interfaces (FDDI-FDDI, and maybe > - * consider heterogeneous bridges). > + * to bridge other types of interfaces (maybe consider > + * heterogeneous bridges). >   */ > >  #include > > Modified: head/sys/net/if_media.c > ============================================================================== > --- head/sys/net/if_media.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/net/if_media.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -405,12 +405,6 @@ struct ifmedia_description ifm_subtype_tokenring_descr >  struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = >      IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; > > -struct ifmedia_description ifm_subtype_fddi_descriptions[] = > - IFM_SUBTYPE_FDDI_DESCRIPTIONS; > - > -struct ifmedia_description ifm_subtype_fddi_option_descriptions[] = > - IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS; > - >  struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = >      IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; > > @@ -448,11 +442,6 @@ struct ifmedia_type_to_subtype ifmedia_types_to_subtyp >          { >            &ifm_subtype_tokenring_descriptions[0], >            &ifm_subtype_tokenring_option_descriptions[0], > - NULL, > - }, > - { > - &ifm_subtype_fddi_descriptions[0], > - &ifm_subtype_fddi_option_descriptions[0], >            NULL, >          }, >          { > > Modified: head/sys/netinet/if_ether.c > ============================================================================== > --- head/sys/netinet/if_ether.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/netinet/if_ether.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -694,10 +694,6 @@ arpintr(struct mbuf *m) >                  hlen = ETHER_ADDR_LEN; /* RFC 826 */ >                  layer = "ethernet"; >                  break; > - case ARPHRD_IEEE802: > - hlen = 6; /* RFC 1390, FDDI_ADDR_LEN */ > - layer = "fddi"; > - break; >          case ARPHRD_ARCNET: >                  hlen = 1; /* RFC 1201, ARC_ADDR_LEN */ >                  layer = "arcnet"; > > Modified: head/sys/netinet/ip_carp.c > ============================================================================== > --- head/sys/netinet/ip_carp.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/netinet/ip_carp.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); >  #include > >  #include > -#include >  #include >  #include >  #include > @@ -1526,18 +1525,6 @@ carp_output(struct ifnet *ifp, struct mbuf *m, const s >                          eh->ether_shost[5] = sc->sc_vhid; >                  } >                  break; > - case IFT_FDDI: { > - struct fddi_header *fh; > - > - fh = mtod(m, struct fddi_header *); > - fh->fddi_shost[0] = 0; > - fh->fddi_shost[1] = 0; > - fh->fddi_shost[2] = 0x5e; > - fh->fddi_shost[3] = 0; > - fh->fddi_shost[4] = 1; > - fh->fddi_shost[5] = sc->sc_vhid; > - } > - break; >          default: >                  printf("%s: carp is not supported for the %d interface type\n", >                      ifp->if_xname, ifp->if_type); > @@ -1719,7 +1706,6 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa >          case IFT_ETHER: >          case IFT_L2VLAN: >          case IFT_BRIDGE: > - case IFT_FDDI: >                  break; >          default: >                  error = EOPNOTSUPP; > > Modified: head/sys/netinet6/in6.c > ============================================================================== > --- head/sys/netinet6/in6.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/netinet6/in6.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -1972,8 +1972,6 @@ in6_if2idlen(struct ifnet *ifp) >          case IFT_BRIDGE: /* bridge(4) only does Ethernet-like links */ >          case IFT_INFINIBAND: >                  return (64); > - case IFT_FDDI: /* RFC2467 */ > - return (64); >          case IFT_PPP: /* RFC2472 */ >                  return (64); >          case IFT_ARCNET: /* RFC2497 */ > > Modified: head/sys/netinet6/in6_ifattach.c > ============================================================================== > --- head/sys/netinet6/in6_ifattach.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/netinet6/in6_ifattach.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -274,7 +274,6 @@ found: >          case IFT_BRIDGE: >          case IFT_ETHER: >          case IFT_L2VLAN: > - case IFT_FDDI: >          case IFT_ATM: >          case IFT_IEEE1394: >                  /* IEEE802/EUI64 cases - what others? */ > > Modified: head/sys/netinet6/nd6.c > ============================================================================== > --- head/sys/netinet6/nd6.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/netinet6/nd6.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); >  #include >  #include >  #include > -#include >  #include >  #include > > @@ -340,9 +339,6 @@ nd6_setmtu0(struct ifnet *ifp, struct nd_ifinfo *ndi) >          case IFT_ARCNET: >                  ndi->maxmtu = MIN(ARC_PHDS_MAXMTU, ifp->if_mtu); /* RFC2497 */ >                  break; > - case IFT_FDDI: > - ndi->maxmtu = MIN(FDDIIPMTU, ifp->if_mtu); /* RFC2467 */ > - break; >          default: >                  ndi->maxmtu = ifp->if_mtu; >                  break; > @@ -2272,7 +2268,6 @@ nd6_resolve(struct ifnet *ifp, int is_gw, struct mbuf >          if (m != NULL && m->m_flags & M_MCAST) { >                  switch (ifp->if_type) { >                  case IFT_ETHER: > - case IFT_FDDI: >                  case IFT_L2VLAN: >                  case IFT_BRIDGE: >                          ETHER_MAP_IPV6_MULTICAST(&dst6->sin6_addr, > @@ -2524,7 +2519,7 @@ nd6_need_cache(struct ifnet *ifp) >  { >          /* >           * XXX: we currently do not make neighbor cache on any interface > - * other than ARCnet, Ethernet, FDDI and GIF. > + * other than ARCnet, Ethernet and GIF. >           * >           * RFC2893 says: >           * - unidirectional tunnels needs no ND > @@ -2532,7 +2527,6 @@ nd6_need_cache(struct ifnet *ifp) >          switch (ifp->if_type) { >          case IFT_ARCNET: >          case IFT_ETHER: > - case IFT_FDDI: >          case IFT_IEEE1394: >          case IFT_L2VLAN: >          case IFT_INFINIBAND: > > Modified: head/sys/netinet6/nd6_nbr.c > ============================================================================== > --- head/sys/netinet6/nd6_nbr.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/netinet6/nd6_nbr.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -1092,7 +1092,6 @@ nd6_ifptomac(struct ifnet *ifp) >          switch (ifp->if_type) { >          case IFT_ARCNET: >          case IFT_ETHER: > - case IFT_FDDI: >          case IFT_IEEE1394: >          case IFT_L2VLAN: >          case IFT_INFINIBAND: > @@ -1466,7 +1465,6 @@ nd6_dad_duplicated(struct ifaddr *ifa, struct dadq *dp >                   */ >                  switch (ifp->if_type) { >                  case IFT_ETHER: > - case IFT_FDDI: >                  case IFT_ATM: >                  case IFT_IEEE1394: >                  case IFT_INFINIBAND: > > Modified: head/sys/nfs/bootp_subr.c > ============================================================================== > --- head/sys/nfs/bootp_subr.c Wed Apr 11 17:26:53 2018 (r332411) > +++ head/sys/nfs/bootp_subr.c Wed Apr 11 17:28:24 2018 (r332412) > @@ -1645,7 +1645,6 @@ bootpc_init(void) >                          continue; >                  switch (ifp->if_alloctype) { >                          case IFT_ETHER: > - case IFT_FDDI: >                                  break; >                          default: >                                  continue; > @@ -1675,7 +1674,6 @@ retry: >                          continue; >                  switch (ifp->if_alloctype) { >                          case IFT_ETHER: > - case IFT_FDDI: >                                  break; >                          default: >                                  continue; From owner-svn-src-all@freebsd.org Wed Apr 11 17:44:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B539F82FF9; Wed, 11 Apr 2018 17:44:55 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-ot0-x22e.google.com (mail-ot0-x22e.google.com [IPv6:2607:f8b0:4003:c0f::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E20616FBBD; Wed, 11 Apr 2018 17:44:54 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-ot0-x22e.google.com with SMTP id v64-v6so2930662otb.13; Wed, 11 Apr 2018 10:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qevC9bhbDpWH0NvX8MZ/TXaBINoFBiE4uEKN0V6mDVE=; b=WME9EQL7572OO0rJvQT795WFlggbOuoqcXNnFLFQ3tRnFbYRoUEzuGOr1jPPF2PAyy a9XTi4GthOOw1UJ9Ykh3wP6bkJc3gIiwqs6F7VyXJFOIPqQDMBtHJ8PTAzk7mpzBmR2R 5+jZkpYzjxrqZ2kn/7NXD3qursAxCjutkMarEOKnn6UB75Rpxw1SnzteRjJGdB4AWv8S kZGIVGfbv1BhLwN7lBcJ8ZDZl2jBhRgfU4xfJIhA790ms95zQYK+s233BFrnLssC1yfh 5E20RuqztxaoXU0h+OwfDtDxSNxZOppKRKDTj1L5lSDqS54phn57VbuUv/6u0OC0KbkG IHUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=qevC9bhbDpWH0NvX8MZ/TXaBINoFBiE4uEKN0V6mDVE=; b=ZUkiZ0YAuXHNPnNHpzWksmGosJVjwD9xWi85jFFAeilI9wanK2tJ6YYSW+WfsGv05a M6nevYFFwqTRjW7u0QlnMeNms24SmZK1pDeKOAg6H8o6HnULv4+52CCTCNgEh5jVd7uP d8namyw254tLRPcQ9n8ERVyXZklrPVy2L6eDzg/a+OlMQSYceSE7IkaPPV85fXHAkox0 fwtJoeopcxh2jRl0IjUDjsKYzZaFyRbXVpOjGR4+fFTo+Hkkb8wn1o7kx/6f7bnkOmnM Y1uijyqVb01VWf2AkXF22px3Mlst0sngQJ9FYwGMh368gBt67VALYNVj6ycSP+YB1Xse 40+g== X-Gm-Message-State: ALQs6tDtZvvzQTskUAOwflvitIjGgQUU9RgvUK972vlzcx+bnwGxSWyn aA6ZWD8YpbX8ZqxIXZib6BLV/OriTN4gqYvrMBRByQ== X-Google-Smtp-Source: AIpwx49yHPCrYvqsHlBQbZtFBMoTbi/4XtczxorW4yXdaI4AeEQgYv5Co5SSD5aCJEPapFOMqwFv7pBSXfqZvaPVnrE= X-Received: by 2002:a9d:7388:: with SMTP id j8-v6mr3629887otk.29.1523468693811; Wed, 11 Apr 2018 10:44:53 -0700 (PDT) MIME-Version: 1.0 Sender: kmacybsd@gmail.com Received: by 2002:a9d:4782:0:0:0:0:0 with HTTP; Wed, 11 Apr 2018 10:44:53 -0700 (PDT) In-Reply-To: References: <201804101948.w3AJmOt2066564@repo.freebsd.org> From: "K. Macy" Date: Wed, 11 Apr 2018 10:44:53 -0700 X-Google-Sender-Auth: lC7z7--nIyxsWSiHqKjFdHu9qRg Message-ID: Subject: Re: svn commit: r332389 - head/sys/net To: "Jonathan T. Looney" Cc: Stephen Hurd , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:44:55 -0000 Yup. git<->phab patch update fail. Maybe some day we can move to git. -M On Wed, Apr 11, 2018 at 10:12 AM, Jonathan T. Looney wrote: > It appears this is causing panics (see the emails on freebsd-current@). > > From a brief glance, it appears that the new STATE_LOCK macros is used (and > causes panics), but the STATE_LOCK_INIT macro is not used. Is it possible > the code is missing an initialization call for the new mutex? > > Jonathan > > On Tue, Apr 10, 2018 at 3:48 PM, Stephen Hurd wrote: > >> Author: shurd >> Date: Tue Apr 10 19:48:24 2018 >> New Revision: 332389 >> URL: https://svnweb.freebsd.org/changeset/base/332389 >> >> Log: >> Split out flag manipulation from general context manipulation in iflib >> >> To avoid blocking on the context lock in the swi thread and risk >> potential >> deadlocks, this change protects lighter weight updates that only need to >> be consistent with each other with their own lock. >> >> Submitted by: Matthew Macy >> Reviewed by: shurd >> Sponsored by: Limelight Networks >> Differential Revision: https://reviews.freebsd.org/D14967 >> >> Modified: >> head/sys/net/iflib.c >> >> Modified: head/sys/net/iflib.c >> ============================================================ >> ================== >> --- head/sys/net/iflib.c Tue Apr 10 19:42:50 2018 (r332388) >> +++ head/sys/net/iflib.c Tue Apr 10 19:48:24 2018 (r332389) >> @@ -1,5 +1,5 @@ >> /*- >> - * Copyright (c) 2014-2017, Matthew Macy >> + * Copyright (c) 2014-2018, Matthew Macy >> * All rights reserved. >> * >> * Redistribution and use in source and binary forms, with or without >> @@ -163,7 +163,8 @@ struct iflib_ctx { >> if_shared_ctx_t ifc_sctx; >> struct if_softc_ctx ifc_softc_ctx; >> >> - struct mtx ifc_mtx; >> + struct mtx ifc_ctx_mtx; >> + struct mtx ifc_state_mtx; >> >> uint16_t ifc_nhwtxqs; >> uint16_t ifc_nhwrxqs; >> @@ -318,8 +319,10 @@ typedef struct iflib_sw_tx_desc_array { >> #define IFC_INIT_DONE 0x020 >> #define IFC_PREFETCH 0x040 >> #define IFC_DO_RESET 0x080 >> -#define IFC_CHECK_HUNG 0x100 >> +#define IFC_DO_WATCHDOG 0x100 >> +#define IFC_CHECK_HUNG 0x200 >> >> + >> #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ >> CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ >> CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) >> @@ -535,13 +538,19 @@ rxd_info_zero(if_rxd_info_t ri) >> >> #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & >> IFF_DRV_RUNNING)) >> >> -#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_mtx, _name, >> "iflib ctx lock", MTX_DEF) >> +#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_ctx_mtx, _name, >> "iflib ctx lock", MTX_DEF) >> +#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_ctx_mtx) >> +#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_ctx_mtx) >> +#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_ctx_mtx) >> >> -#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_mtx) >> -#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_mtx) >> -#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_mtx) >> >> +#define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, >> _name, "iflib state lock", MTX_DEF) >> +#define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx) >> +#define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx) >> +#define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) >> >> + >> + >> #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) >> #define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) >> >> @@ -2144,18 +2153,14 @@ iflib_timer(void *arg) >> if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) >> callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, >> txq->ift_timer.c_cpu); >> return; >> -hung: >> - CTX_LOCK(ctx); >> - if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); >> + hung: >> device_printf(ctx->ifc_dev, "TX(%d) desc avail = %d, pidx = %d\n", >> txq->ift_id, TXQ_AVAIL(txq), >> txq->ift_pidx); >> - >> - IFDI_WATCHDOG_RESET(ctx); >> - ctx->ifc_watchdog_events++; >> - >> - ctx->ifc_flags |= IFC_DO_RESET; >> + STATE_LOCK(ctx); >> + if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); >> + ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); >> iflib_admin_intr_deferred(ctx); >> - CTX_UNLOCK(ctx); >> + STATE_UNLOCK(ctx); >> } >> >> static void >> @@ -2673,10 +2678,10 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) >> return true; >> return (iflib_rxd_avail(ctx, rxq, *cidxp, 1)); >> err: >> - CTX_LOCK(ctx); >> + STATE_LOCK(ctx); >> ctx->ifc_flags |= IFC_DO_RESET; >> iflib_admin_intr_deferred(ctx); >> - CTX_UNLOCK(ctx); >> + STATE_UNLOCK(ctx); >> return (false); >> } >> >> @@ -3706,27 +3711,35 @@ _task_fn_admin(void *context) >> if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; >> iflib_txq_t txq; >> int i; >> + bool oactive, running, do_reset, do_watchdog; >> >> - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) { >> - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE)) { >> - return; >> - } >> - } >> + STATE_LOCK(ctx); >> + running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING); >> + oactive = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE); >> + do_reset = (ctx->ifc_flags & IFC_DO_RESET); >> + do_watchdog = (ctx->ifc_flags & IFC_DO_WATCHDOG); >> + ctx->ifc_flags &= ~(IFC_DO_RESET|IFC_DO_WATCHDOG); >> + STATE_UNLOCK(ctx); >> >> + if (!running & !oactive) >> + return; >> + >> CTX_LOCK(ctx); >> for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, >> txq++) { >> CALLOUT_LOCK(txq); >> callout_stop(&txq->ift_timer); >> CALLOUT_UNLOCK(txq); >> } >> + if (do_watchdog) { >> + ctx->ifc_watchdog_events++; >> + IFDI_WATCHDOG_RESET(ctx); >> + } >> IFDI_UPDATE_ADMIN_STATUS(ctx); >> for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, >> txq++) >> callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, >> txq->ift_timer.c_cpu); >> IFDI_LINK_INTR_ENABLE(ctx); >> - if (ctx->ifc_flags & IFC_DO_RESET) { >> - ctx->ifc_flags &= ~IFC_DO_RESET; >> + if (do_reset) >> iflib_if_init_locked(ctx); >> - } >> CTX_UNLOCK(ctx); >> >> if (LINK_ACTIVE(ctx) == 0) >> @@ -3870,15 +3883,15 @@ iflib_if_qflush(if_t ifp) >> iflib_txq_t txq = ctx->ifc_txqs; >> int i; >> >> - CTX_LOCK(ctx); >> + STATE_LOCK(ctx); >> ctx->ifc_flags |= IFC_QFLUSH; >> - CTX_UNLOCK(ctx); >> + STATE_UNLOCK(ctx); >> for (i = 0; i < NTXQSETS(ctx); i++, txq++) >> while (!(ifmp_ring_is_idle(txq->ift_br) || >> ifmp_ring_is_stalled(txq->ift_br))) >> iflib_txq_check_drain(txq, 0); >> - CTX_LOCK(ctx); >> + STATE_LOCK(ctx); >> ctx->ifc_flags &= ~IFC_QFLUSH; >> - CTX_UNLOCK(ctx); >> + STATE_UNLOCK(ctx); >> >> if_qflush(ifp); >> } >> @@ -3935,14 +3948,18 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t >> data) >> iflib_stop(ctx); >> >> if ((err = IFDI_MTU_SET(ctx, ifr->ifr_mtu)) == 0) { >> + STATE_LOCK(ctx); >> if (ifr->ifr_mtu > ctx->ifc_max_fl_buf_size) >> ctx->ifc_flags |= IFC_MULTISEG; >> else >> ctx->ifc_flags &= ~IFC_MULTISEG; >> + STATE_UNLOCK(ctx); >> err = if_setmtu(ifp, ifr->ifr_mtu); >> } >> iflib_init_locked(ctx); >> + STATE_LOCK(ctx); >> if_setdrvflags(ifp, bits); >> + STATE_UNLOCK(ctx); >> CTX_UNLOCK(ctx); >> break; >> case SIOCSIFFLAGS: >> @@ -4026,10 +4043,14 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t >> data) >> bits = if_getdrvflags(ifp); >> if (bits & IFF_DRV_RUNNING) >> iflib_stop(ctx); >> + STATE_LOCK(ctx); >> if_togglecapenable(ifp, setmask); >> + STATE_UNLOCK(ctx); >> if (bits & IFF_DRV_RUNNING) >> iflib_init_locked(ctx); >> + STATE_LOCK(ctx); >> if_setdrvflags(ifp, bits); >> + STATE_UNLOCK(ctx); >> CTX_UNLOCK(ctx); >> } >> break; >> @@ -5431,9 +5452,11 @@ iflib_link_state_change(if_ctx_t ctx, int >> link_state, >> iflib_txq_t txq = ctx->ifc_txqs; >> >> if_setbaudrate(ifp, baudrate); >> - if (baudrate >= IF_Gbps(10)) >> + if (baudrate >= IF_Gbps(10)) { >> + STATE_LOCK(ctx); >> ctx->ifc_flags |= IFC_PREFETCH; >> - >> + STATE_UNLOCK(ctx); >> + } >> /* If link down, disable watchdog */ >> if ((ctx->ifc_link_state == LINK_STATE_UP) && (link_state == >> LINK_STATE_DOWN)) { >> for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxqsets; i++, >> txq++) >> @@ -5492,7 +5515,7 @@ struct mtx * >> iflib_ctx_lock_get(if_ctx_t ctx) >> { >> >> - return (&ctx->ifc_mtx); >> + return (&ctx->ifc_ctx_mtx); >> } >> >> static int >> >> > _______________________________________________ > 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-all@freebsd.org Wed Apr 11 17:52:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF0ABF83923; Wed, 11 Apr 2018 17:52:13 +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 3F59572A91; Wed, 11 Apr 2018 17:52:10 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id DBF291B43C; Wed, 11 Apr 2018 17:52:09 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f50.google.com with SMTP id d20-v6so3863733lfe.3; Wed, 11 Apr 2018 10:52:09 -0700 (PDT) X-Gm-Message-State: ALQs6tCpR2865LvtBG9fRkDNHhzBMQ6URBGOf8tKzvksWuqJ0xOJjUYP sGNzp5FKPCvrAg1AN1adi83KJ+Y4J+PivgZaJJI= X-Google-Smtp-Source: AIpwx48tXCESipX6E+QVJTI1jwAoKo9Hsyjz46p8YlLUxqzdnUCgBC0+Vs9JI/q0I+A0dmyZoL1aC9QxeLp9KAIP29g= X-Received: by 2002:a19:c4c8:: with SMTP id u191-v6mr3634979lff.109.1523469128017; Wed, 11 Apr 2018 10:52:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Wed, 11 Apr 2018 10:51:47 -0700 (PDT) In-Reply-To: <201804081139.w38BdR0t047036@repo.freebsd.org> References: <201804081139.w38BdR0t047036@repo.freebsd.org> From: Kyle Evans Date: Wed, 11 Apr 2018 12:51:47 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332270 - head/stand/forth To: Toomas Soome Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:52:13 -0000 On Sun, Apr 8, 2018 at 6:39 AM, Toomas Soome wrote: > Author: tsoome > Date: Sun Apr 8 11:39:27 2018 > New Revision: 332270 > URL: https://svnweb.freebsd.org/changeset/base/332270 > > Log: > loader: include efi.4th only if we do have uefi > > Also simplify efi.4th. > > Modified: > head/stand/forth/efi.4th > head/stand/forth/loader.4th > head/stand/forth/loader.rc > > Modified: head/stand/forth/efi.4th > ============================================================================== > --- head/stand/forth/efi.4th Sun Apr 8 11:37:00 2018 (r332269) > +++ head/stand/forth/efi.4th Sun Apr 8 11:39:27 2018 (r332270) > @@ -26,16 +26,5 @@ > > only forth definitions > > -: efiboot? ( -- flag ) > - s" efi-version" getenv -1 <> dup if > - swap drop ( c-addr flag -- flag ) > - then > -; > - > -: maybe-efi-resizecons > - efiboot? if > - s" efi-autoresizecons" evaluate > - then > -; > - > +s" efi-autoresizecons" evaluate > .( EFI boot environment) cr > This was actually the wrong thing to do, here. efi-autoresizecons should *not* be executed before loader.conf is invoked, which is why this was done the way it was. From owner-svn-src-all@freebsd.org Wed Apr 11 17:58:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70C8CF83F46; Wed, 11 Apr 2018 17:58:46 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 071D174245; Wed, 11 Apr 2018 17:58:46 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1f6K16-0001Wc-PD; Wed, 11 Apr 2018 20:58:44 +0300 Date: Wed, 11 Apr 2018 20:58:44 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Message-ID: <20180411175844.GH6612@zxy.spb.ru> References: <201804060925.w369P8c2019558@repo.freebsd.org> <20180409162909.GF6612@zxy.spb.ru> <84716725.OOlTe33nR2@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84716725.OOlTe33nR2@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 17:58:46 -0000 On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote: > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > > > Author: kib > > > Date: Fri Apr 6 09:25:08 2018 > > > New Revision: 332091 > > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > > > Log: > > > MFC r331760: > > > Make vm_map_max/min/pmap KBI stable. > > > > > > Modified: > > > stable/11/sys/vm/vm_map.c > > > stable/11/sys/vm/vm_map.h > > > Directory Properties: > > > stable/11/ (props changed) > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > > nvidia (build on 11.1-RELEASE) also don't work > > Yes, this only helps with the future KBI, it doesn't restore the > existing one. However, r320889 which was committed earlier should > have restored the KBI? Sorry, miss you point. I am update to last stable/11, build and install kernel and check old modules. From owner-svn-src-all@freebsd.org Wed Apr 11 18:02:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FECDF84420; Wed, 11 Apr 2018 18:02:15 +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 B71AB74709; Wed, 11 Apr 2018 18:02:14 +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 97DA81F900; Wed, 11 Apr 2018 18:02:14 +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 w3BI2Ej9035382; Wed, 11 Apr 2018 18:02:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BI2Etc035378; Wed, 11 Apr 2018 18:02:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804111802.w3BI2Etc035378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 11 Apr 2018 18:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332413 - in head/stand: forth i386/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: forth i386/loader X-SVN-Commit-Revision: 332413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 18:02:15 -0000 Author: imp Date: Wed Apr 11 18:02:13 2018 New Revision: 332413 URL: https://svnweb.freebsd.org/changeset/base/332413 Log: Revert r332275, r332272, r332270 There's problems with them. The order of efi stuff isn't quite right, and there's various problems. Revert until thos problems can be fixed. Reviewed by: kevans@ Modified: head/stand/forth/efi.4th head/stand/forth/loader.4th head/stand/forth/loader.rc head/stand/i386/loader/loader.rc Modified: head/stand/forth/efi.4th ============================================================================== --- head/stand/forth/efi.4th Wed Apr 11 17:28:24 2018 (r332412) +++ head/stand/forth/efi.4th Wed Apr 11 18:02:13 2018 (r332413) @@ -26,5 +26,16 @@ only forth definitions -s" efi-autoresizecons" evaluate +: efiboot? ( -- flag ) + s" efi-version" getenv -1 <> dup if + swap drop ( c-addr flag -- flag ) + then +; + +: maybe-efi-resizecons + efiboot? if + s" efi-autoresizecons" evaluate + then +; + .( EFI boot environment) cr Modified: head/stand/forth/loader.4th ============================================================================== --- head/stand/forth/loader.4th Wed Apr 11 17:28:24 2018 (r332412) +++ head/stand/forth/loader.4th Wed Apr 11 18:02:13 2018 (r332413) @@ -46,9 +46,6 @@ include /boot/support.4th include /boot/color.4th include /boot/delay.4th include /boot/check-password.4th -s" efi-version" getenv? [if] - include /boot/efi.4th -[then] only forth definitions Modified: head/stand/forth/loader.rc ============================================================================== --- head/stand/forth/loader.rc Wed Apr 11 17:28:24 2018 (r332412) +++ head/stand/forth/loader.rc Wed Apr 11 18:02:13 2018 (r332413) @@ -6,11 +6,14 @@ \ \ Includes additional commands include /boot/loader.4th +include /boot/efi.4th try-include /boot/loader.rc.local \ Reads and processes loader.conf variables \ NOTE: Change to `initialize' if you enable the below boot menu start + +maybe-efi-resizecons \ Tests for password -- executes autoboot first if a password was defined check-password Modified: head/stand/i386/loader/loader.rc ============================================================================== --- head/stand/i386/loader/loader.rc Wed Apr 11 17:28:24 2018 (r332412) +++ head/stand/i386/loader/loader.rc Wed Apr 11 18:02:13 2018 (r332413) @@ -3,10 +3,13 @@ \ \ Includes additional commands include /boot/loader.4th +include /boot/efi.4th try-include /boot/loader.rc.local \ Reads and processes loader.conf variables initialize + +maybe-efi-resizecons \ Tests for password -- executes autoboot first if a password was defined check-password From owner-svn-src-all@freebsd.org Wed Apr 11 18:39:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F9F6F86EB3; Wed, 11 Apr 2018 18:39:48 +0000 (UTC) (envelope-from dim@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 2D69D7D28B; Wed, 11 Apr 2018 18:39:48 +0000 (UTC) (envelope-from dim@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 2421B1FDF6; Wed, 11 Apr 2018 18:39:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BIdl4t050519; Wed, 11 Apr 2018 18:39:47 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BIdlBb050518; Wed, 11 Apr 2018 18:39:47 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201804111839.w3BIdlBb050518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 11 Apr 2018 18:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332414 - head/usr.bin/clang/clang X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.bin/clang/clang X-SVN-Commit-Revision: 332414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 18:39:48 -0000 Author: dim Date: Wed Apr 11 18:39:47 2018 New Revision: 332414 URL: https://svnweb.freebsd.org/changeset/base/332414 Log: Regenerate clang man page after upstream change to document the possible values for the -std= option. Noticed by: Steve Kargl Obtained from: https://reviews.llvm.org/rL329827 MFC after: 3 days Modified: head/usr.bin/clang/clang/clang.1 Modified: head/usr.bin/clang/clang/clang.1 ============================================================================== --- head/usr.bin/clang/clang/clang.1 Wed Apr 11 18:02:13 2018 (r332413) +++ head/usr.bin/clang/clang/clang.1 Wed Apr 11 18:39:47 2018 (r332414) @@ -1,7 +1,7 @@ .\" $FreeBSD$ .\" Man page generated from reStructuredText. . -.TH "CLANG" "1" "Dec 24, 2017" "6" "Clang" +.TH "CLANG" "1" "Apr 11, 2018" "6" "Clang" .SH NAME clang \- the Clang C, C++, and Objective-C compiler . @@ -128,10 +128,265 @@ Treat subsequent input files as having type language. .UNINDENT .INDENT 0.0 .TP -.B \-std= +.B \-std= Specify the language standard to compile for. +.sp +Supported values for the C language are: +.INDENT 7.0 +.INDENT 3.5 +.nf +\fBc89\fP +\fBc90\fP +\fBiso9899:1990\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C 1990 .UNINDENT +.UNINDENT +.nf +\fBiso9899:199409\fP +.fi +.sp .INDENT 0.0 +.INDENT 3.5 +ISO C 1990 with amendment 1 +.UNINDENT +.UNINDENT +.nf +\fBgnu89\fP +\fBgnu90\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C 1990 with GNU extensions +.UNINDENT +.UNINDENT +.nf +\fBc99\fP +\fBiso9899:1999\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C 1999 +.UNINDENT +.UNINDENT +.nf +\fBgnu99\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C 1999 with GNU extensions +.UNINDENT +.UNINDENT +.nf +\fBc11\fP +\fBiso9899:2011\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C 2011 +.UNINDENT +.UNINDENT +.nf +\fBgnu11\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C 2011 with GNU extensions +.UNINDENT +.UNINDENT +.nf +\fBc17\fP +\fBiso9899:2017\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C 2017 +.UNINDENT +.UNINDENT +.nf +\fBgnu17\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C 2017 with GNU extensions +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.sp +The default C language standard is \fBgnu11\fP, except on PS4, where it is +\fBgnu99\fP\&. +.sp +Supported values for the C++ language are: +.INDENT 7.0 +.INDENT 3.5 +.nf +\fBc++98\fP +\fBc++03\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C++ 1998 with amendments +.UNINDENT +.UNINDENT +.nf +\fBgnu++98\fP +\fBgnu++03\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C++ 1998 with amendments and GNU extensions +.UNINDENT +.UNINDENT +.nf +\fBc++11\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C++ 2011 with amendments +.UNINDENT +.UNINDENT +.nf +\fBgnu++11\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C++ 2011 with amendments and GNU extensions +.UNINDENT +.UNINDENT +.nf +\fBc++14\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C++ 2014 with amendments +.UNINDENT +.UNINDENT +.nf +\fBgnu++14\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C++ 2014 with amendments and GNU extensions +.UNINDENT +.UNINDENT +.nf +\fBc++17\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C++ 2017 with amendments +.UNINDENT +.UNINDENT +.nf +\fBgnu++17\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +ISO C++ 2017 with amendments and GNU extensions +.UNINDENT +.UNINDENT +.nf +\fBc++2a\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +Working draft for ISO C++ 2020 +.UNINDENT +.UNINDENT +.nf +\fBgnu++2a\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +Working draft for ISO C++ 2020 with GNU extensions +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.sp +The default C++ language standard is \fBgnu++14\fP\&. +.sp +Supported values for the OpenCL language are: +.INDENT 7.0 +.INDENT 3.5 +.nf +\fBcl1.0\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +OpenCL 1.0 +.UNINDENT +.UNINDENT +.nf +\fBcl1.1\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +OpenCL 1.1 +.UNINDENT +.UNINDENT +.nf +\fBcl1.2\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +OpenCL 1.2 +.UNINDENT +.UNINDENT +.nf +\fBcl2.0\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +OpenCL 2.0 +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.sp +The default OpenCL language standard is \fBcl1.0\fP\&. +.sp +Supported values for the CUDA language are: +.INDENT 7.0 +.INDENT 3.5 +.nf +\fBcuda\fP +.fi +.sp +.INDENT 0.0 +.INDENT 3.5 +NVIDIA CUDA(tm) +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 .TP .B \-stdlib= Specify the C++ standard library to use; supported options are libstdc++ and @@ -602,6 +857,6 @@ output of the compiler, along with information to repr .SH AUTHOR Maintained by the Clang / LLVM Team () .SH COPYRIGHT -2007-2017, The Clang Team +2007-2018, The Clang Team .\" Generated by docutils manpage writer. . From owner-svn-src-all@freebsd.org Wed Apr 11 19:28:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A13F4F8A77D; Wed, 11 Apr 2018 19:28:55 +0000 (UTC) (envelope-from mckusick@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 4F24668047; Wed, 11 Apr 2018 19:28:55 +0000 (UTC) (envelope-from mckusick@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 462332064B; Wed, 11 Apr 2018 19:28:55 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BJStHo074691; Wed, 11 Apr 2018 19:28:55 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BJStVv074690; Wed, 11 Apr 2018 19:28:55 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804111928.w3BJStVv074690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 11 Apr 2018 19:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332415 - head/lib/libufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/lib/libufs X-SVN-Commit-Revision: 332415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 19:28:55 -0000 Author: mckusick Date: Wed Apr 11 19:28:54 2018 New Revision: 332415 URL: https://svnweb.freebsd.org/changeset/base/332415 Log: Fix potentially overflowing expression "fs->fs_ipg * fs->fs_ncg" by casting fs->fs_ipg to (ino_t). CID: 1388258 Modified: head/lib/libufs/inode.c Modified: head/lib/libufs/inode.c ============================================================================== --- head/lib/libufs/inode.c Wed Apr 11 18:39:47 2018 (r332414) +++ head/lib/libufs/inode.c Wed Apr 11 19:28:54 2018 (r332415) @@ -60,7 +60,7 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i ERROR(disk, NULL); fs = &disk->d_fs; - if (inode >= fs->fs_ipg * fs->fs_ncg) { + if (inode >= (ino_t)fs->fs_ipg * fs->fs_ncg) { ERROR(disk, "inode number out of range"); return (-1); } From owner-svn-src-all@freebsd.org Wed Apr 11 19:46:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B494F8C0CB; Wed, 11 Apr 2018 19:46:25 +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 4C02C6D5C3; Wed, 11 Apr 2018 19:46:25 +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 28B4C209E7; Wed, 11 Apr 2018 19:46:25 +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 w3BJkPwp088301; Wed, 11 Apr 2018 19:46:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BJkOYL088296; Wed, 11 Apr 2018 19:46:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804111946.w3BJkOYL088296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 11 Apr 2018 19:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332416 - in head/stand/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: include libefi loader X-SVN-Commit-Revision: 332416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 19:46:25 -0000 Author: imp Date: Wed Apr 11 19:46:24 2018 New Revision: 332416 URL: https://svnweb.freebsd.org/changeset/base/332416 Log: Refactor currdev setting Refactor the currdev setting to find the device we booted from. Limit searching when we don't already have a reasonable currdev from that to the same device only. Search a little harder for ZFS volumes as that's needed for loader.efi to live on an ESP. Sponsored by: Netflix Differential Review: https://reviews.freebsd.org/D13784 Modified: head/stand/efi/include/efilib.h head/stand/efi/include/efizfs.h head/stand/efi/libefi/efipart.c head/stand/efi/libefi/efizfs.c head/stand/efi/loader/main.c Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Wed Apr 11 19:28:54 2018 (r332415) +++ head/stand/efi/include/efilib.h Wed Apr 11 19:46:24 2018 (r332416) @@ -59,10 +59,13 @@ typedef struct pdinfo uint32_t pd_unit; /* unit number */ uint32_t pd_open; /* reference counter */ void *pd_bcache; /* buffer cache data */ + struct pdinfo *pd_parent; /* Linked items (eg partitions) */ + struct devsw *pd_devsw; /* Back pointer to devsw */ } pdinfo_t; pdinfo_list_t *efiblk_get_pdinfo_list(struct devsw *dev); pdinfo_t *efiblk_get_pdinfo(struct devdesc *dev); +pdinfo_t *efiblk_get_pdinfo_by_handle(EFI_HANDLE h); void *efi_get_table(EFI_GUID *tbl); Modified: head/stand/efi/include/efizfs.h ============================================================================== --- head/stand/efi/include/efizfs.h Wed Apr 11 19:28:54 2018 (r332415) +++ head/stand/efi/include/efizfs.h Wed Apr 11 19:46:24 2018 (r332416) @@ -48,6 +48,7 @@ extern void efi_zfs_probe(void); extern zfsinfo_list_t *efizfs_get_zfsinfo_list(void); extern bool efi_zfs_is_preferred(EFI_HANDLE *h); extern EFI_HANDLE efizfs_get_handle_by_guid(uint64_t); +extern bool efizfs_get_guid_by_handle(EFI_HANDLE, uint64_t *); #endif Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Wed Apr 11 19:28:54 2018 (r332415) +++ head/stand/efi/libefi/efipart.c Wed Apr 11 19:46:24 2018 (r332416) @@ -119,6 +119,7 @@ efiblk_get_pdinfo_list(struct devsw *dev) return (NULL); } +/* XXX this gets called way way too often, investigate */ pdinfo_t * efiblk_get_pdinfo(struct devdesc *dev) { @@ -136,6 +137,40 @@ efiblk_get_pdinfo(struct devdesc *dev) return (pd); } +static bool +same_handle(pdinfo_t *pd, EFI_HANDLE h) +{ + + return (pd->pd_handle == h || pd->pd_alias == h); +} + +pdinfo_t * +efiblk_get_pdinfo_by_handle(EFI_HANDLE h) +{ + pdinfo_t *dp, *pp; + + /* + * Check hard disks, then cd, then floppy + */ + STAILQ_FOREACH(dp, &hdinfo, pd_link) { + if (same_handle(dp, h)) + return (dp); + STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { + if (same_handle(pp, h)) + return (pp); + } + } + STAILQ_FOREACH(dp, &cdinfo, pd_link) { + if (same_handle(dp, h)) + return (dp); + } + STAILQ_FOREACH(dp, &fdinfo, pd_link) { + if (same_handle(dp, h)) + return (dp); + } + return (NULL); +} + static int efiblk_pdinfo_count(pdinfo_list_t *pdi) { @@ -294,6 +329,8 @@ efipart_fdinfo_add(EFI_HANDLE handle, uint32_t uid, EF fd->pd_unit = uid; fd->pd_handle = handle; fd->pd_devpath = devpath; + fd->pd_parent = NULL; + fd->pd_devsw = &efipart_fddev; STAILQ_INSERT_TAIL(&fdinfo, fd, pd_link); return (0); } @@ -364,6 +401,8 @@ efipart_cdinfo_add(EFI_HANDLE handle, EFI_HANDLE alias cd->pd_unit = unit; cd->pd_alias = alias; cd->pd_devpath = devpath; + cd->pd_parent = NULL; + cd->pd_devsw = &efipart_cddev; STAILQ_INSERT_TAIL(&cdinfo, cd, pd_link); return (0); } @@ -489,6 +528,8 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE pd->pd_handle = part_handle; pd->pd_unit = node->PartitionNumber; pd->pd_devpath = part_devpath; + pd->pd_parent = hd; + pd->pd_devsw = &efipart_hddev; STAILQ_INSERT_TAIL(&hd->pd_part, pd, pd_link); return (0); } @@ -505,6 +546,8 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE hd->pd_handle = disk_handle; hd->pd_unit = unit; hd->pd_devpath = disk_devpath; + hd->pd_parent = NULL; + hd->pd_devsw = &efipart_hddev; STAILQ_INSERT_TAIL(&hdinfo, hd, pd_link); if (part_devpath == NULL) @@ -521,6 +564,8 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE pd->pd_handle = part_handle; pd->pd_unit = node->PartitionNumber; pd->pd_devpath = part_devpath; + pd->pd_parent = hd; + pd->pd_devsw = &efipart_hddev; STAILQ_INSERT_TAIL(&hd->pd_part, pd, pd_link); return (0); @@ -579,6 +624,8 @@ efipart_hdinfo_add_filepath(EFI_HANDLE disk_handle) pd->pd_handle = disk_handle; pd->pd_unit = unit; pd->pd_devpath = devpath; + pd->pd_parent = NULL; + pd->pd_devsw = &efipart_hddev; STAILQ_INSERT_TAIL(&hdinfo, pd, pd_link); free(pathname); return (0); @@ -609,6 +656,8 @@ efipart_hdinfo_add_filepath(EFI_HANDLE disk_handle) pd->pd_handle = disk_handle; pd->pd_unit = unit; pd->pd_devpath = devpath; + pd->pd_parent = last; + pd->pd_devsw = &efipart_hddev; STAILQ_INSERT_TAIL(&last->pd_part, pd, pd_link); free(pathname); return (0); Modified: head/stand/efi/libefi/efizfs.c ============================================================================== --- head/stand/efi/libefi/efizfs.c Wed Apr 11 19:28:54 2018 (r332415) +++ head/stand/efi/libefi/efizfs.c Wed Apr 11 19:46:24 2018 (r332416) @@ -64,6 +64,22 @@ efizfs_get_handle_by_guid(uint64_t guid) return (NULL); } +bool +efizfs_get_guid_by_handle(EFI_HANDLE handle, uint64_t *guid) +{ + zfsinfo_t *zi; + + if (guid == NULL) + return (false); + STAILQ_FOREACH(zi, &zfsinfo, zi_link) { + if (zi->zi_handle == handle) { + *guid = zi->zi_pool_guid; + return (true); + } + } + return (false); +} + static void insert_zfs(EFI_HANDLE handle, uint64_t guid) { Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Wed Apr 11 19:28:54 2018 (r332415) +++ head/stand/efi/loader/main.c Wed Apr 11 19:46:24 2018 (r332416) @@ -78,6 +78,15 @@ EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; static EFI_LOADED_IMAGE *img; +/* + * Number of seconds to wait for a keystroke before exiting with failure + * in the event no currdev is found. -2 means always break, -1 means + * never break, 0 means poll once and then reboot, > 0 means wait for + * that many seconds. "fail_timeout" can be set in the environment as + * well. + */ +static int fail_timeout = 5; + #ifdef EFI_ZFS_BOOT bool efi_zfs_is_preferred(EFI_HANDLE *h) @@ -169,113 +178,183 @@ out: } static void -set_devdesc_currdev(struct devsw *dev, int unit) +set_currdev_devdesc(struct devdesc *currdev) { + const char *devname; + + devname = efi_fmtdev(currdev); + + printf("Setting currdev to %s\n", devname); + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, devname, env_noset, env_nounset); +} + +static void +set_currdev_devsw(struct devsw *dev, int unit) +{ struct devdesc currdev; - char *devname; currdev.d_dev = dev; currdev.d_unit = unit; + + set_currdev_devdesc(&currdev); +} + +static void +set_currdev_pdinfo(pdinfo_t *dp) +{ + + /* + * Disks are special: they have partitions. if the parent + * pointer is non-null, we're a partition not a full disk + * and we need to adjust currdev appropriately. + */ + if (dp->pd_devsw->dv_type == DEVT_DISK) { + struct disk_devdesc currdev; + + currdev.dd.d_dev = dp->pd_devsw; + if (dp->pd_parent == NULL) { + currdev.dd.d_unit = dp->pd_unit; + currdev.d_slice = -1; + currdev.d_partition = -1; + } else { + currdev.dd.d_unit = dp->pd_parent->pd_unit; + currdev.d_slice = dp->pd_unit; + currdev.d_partition = 255; /* Assumes GPT */ + } + set_currdev_devdesc((struct devdesc *)&currdev); + } else { + set_currdev_devsw(dp->pd_devsw, dp->pd_unit); + } +} + +static bool +sanity_check_currdev(void) +{ + struct stat st; + + return (stat("/boot/defaults/loader.conf", &st) == 0); +} + +#ifdef EFI_ZFS_BOOT +static bool +probe_zfs_currdev(uint64_t guid) +{ + char *devname; + struct zfs_devdesc currdev; + + currdev.dd.d_dev = &zfs_dev; + currdev.dd.d_unit = 0; + currdev.pool_guid = guid; + currdev.root_guid = 0; + set_currdev_devdesc((struct devdesc *)&currdev); devname = efi_fmtdev(&currdev); + init_zfs_bootenv(devname); - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, - env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, env_noset, env_nounset); + return (sanity_check_currdev()); } +#endif +static bool +try_as_currdev(pdinfo_t *hd, pdinfo_t *pp) +{ + uint64_t guid; + +#ifdef EFI_ZFS_BOOT + /* + * If there's a zpool on this device, try it as a ZFS + * filesystem, which has somewhat different setup than all + * other types of fs due to imperfect loader integration. + * This all stems from ZFS being both a device (zpool) and + * a filesystem, plus the boot env feature. + */ + if (efizfs_get_guid_by_handle(pp->pd_handle, &guid)) + return (probe_zfs_currdev(guid)); +#endif + /* + * All other filesystems just need the pdinfo + * initialized in the standard way. + */ + set_currdev_pdinfo(pp); + return (sanity_check_currdev()); +} + static int find_currdev(EFI_LOADED_IMAGE *img) { - pdinfo_list_t *pdi_list; pdinfo_t *dp, *pp; EFI_DEVICE_PATH *devpath, *copy; EFI_HANDLE h; - char *devname; + CHAR16 *text; struct devsw *dev; int unit; uint64_t extra; #ifdef EFI_ZFS_BOOT - /* Did efi_zfs_probe() detect the boot pool? */ + /* + * Did efi_zfs_probe() detect the boot pool? If so, use the zpool + * it found, if it's sane. ZFS is the only thing that looks for + * disks and pools to boot. This may change in the future, however, + * if we allow specifying which pool to boot from via UEFI variables + * rather than the bootenv stuff that FreeBSD uses today. + */ if (pool_guid != 0) { - struct zfs_devdesc currdev; - - currdev.dd.d_dev = &zfs_dev; - currdev.dd.d_unit = 0; - currdev.pool_guid = pool_guid; - currdev.root_guid = 0; - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, - env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, env_noset, - env_nounset); - init_zfs_bootenv(devname); - return (0); + printf("Trying ZFS pool\n"); + if (probe_zfs_currdev(pool_guid)) + return (0); } #endif /* EFI_ZFS_BOOT */ - /* We have device lists for hd, cd, fd, walk them all. */ - pdi_list = efiblk_get_pdinfo_list(&efipart_hddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - struct disk_devdesc currdev; - - currdev.dd.d_dev = &efipart_hddev; - currdev.dd.d_unit = dp->pd_unit; - currdev.d_slice = -1; - currdev.d_partition = -1; - - if (dp->pd_handle == img->DeviceHandle) { - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, - efi_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, - env_noset, env_nounset); - return (0); + /* + * Try to find the block device by its handle based on the + * image we're booting. If we can't find a sane partition, + * search all the other partitions of the disk. We do not + * search other disks because it's a violation of the UEFI + * boot protocol to do so. We fail and let UEFI go on to + * the next candidate. + */ + dp = efiblk_get_pdinfo_by_handle(img->DeviceHandle); + if (dp != NULL) { + text = efi_devpath_name(dp->pd_devpath); + if (text != NULL) { + printf("Trying ESP: %S\n", text); + efi_free_devpath_name(text); } - /* Assuming GPT partitioning. */ - STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { - if (pp->pd_handle == img->DeviceHandle) { - currdev.d_slice = pp->pd_unit; - currdev.d_partition = 255; - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, - efi_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, devname, - env_noset, env_nounset); - return (0); + set_currdev_pdinfo(dp); + if (sanity_check_currdev()) + return (0); + if (dp->pd_parent != NULL) { + dp = dp->pd_parent; + STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { + text = efi_devpath_name(pp->pd_devpath); + if (text != NULL) { + printf("And now the part: %S\n", text); + efi_free_devpath_name(text); + } + /* + * Roll up the ZFS special case + * for those partitions that have + * zpools on them + */ + if (try_as_currdev(dp, pp)) + return (0); } } + } else { + printf("Can't find device by handle\n"); } - pdi_list = efiblk_get_pdinfo_list(&efipart_cddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - if (dp->pd_handle == img->DeviceHandle || - dp->pd_alias == img->DeviceHandle) { - set_devdesc_currdev(&efipart_cddev, dp->pd_unit); - return (0); - } - } - - pdi_list = efiblk_get_pdinfo_list(&efipart_fddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - if (dp->pd_handle == img->DeviceHandle) { - set_devdesc_currdev(&efipart_fddev, dp->pd_unit); - return (0); - } - } - /* * Try the device handle from our loaded image first. If that * fails, use the device path from the loaded image and see if * any of the nodes in that path match one of the enumerated - * handles. + * handles. Currently, this handle list is only for netboot. */ if (efi_handle_lookup(img->DeviceHandle, &dev, &unit, &extra) == 0) { - set_devdesc_currdev(dev, unit); - return (0); + set_currdev_devsw(dev, unit); + if (sanity_check_currdev()) + return (0); } copy = NULL; @@ -289,8 +368,9 @@ find_currdev(EFI_LOADED_IMAGE *img) copy = NULL; if (efi_handle_lookup(h, &dev, &unit, &extra) == 0) { - set_devdesc_currdev(dev, unit); - return (0); + set_currdev_devsw(dev, unit); + if (sanity_check_currdev()) + return (0); } devpath = efi_lookup_devpath(h); @@ -304,6 +384,33 @@ find_currdev(EFI_LOADED_IMAGE *img) return (ENOENT); } +static bool +interactive_interrupt(const char *msg) +{ + time_t now, then, last; + + last = 0; + now = then = getsecs(); + printf("%s\n", msg); + if (fail_timeout == -2) /* Always break to OK */ + return (true); + if (fail_timeout == -1) /* Never break to OK */ + return (false); + do { + if (last != now) { + printf("press any key to interrupt reboot in %d seconds\r", + fail_timeout - (int)(now - then)); + last = now; + } + + /* XXX no pause or timeout wait for char */ + if (ischar()) + return (true); + now = getsecs(); + } while (now - then < fail_timeout); + return (false); +} + EFI_STATUS main(int argc, CHAR16 *argv[]) { @@ -312,12 +419,13 @@ main(int argc, CHAR16 *argv[]) int i, j, vargood, howto; UINTN k; int has_kbd; + char *s; + EFI_DEVICE_PATH *imgpath; CHAR16 *text; + EFI_STATUS status; UINT16 boot_current; size_t sz; UINT16 boot_order[100]; - EFI_DEVICE_PATH *imgpath; - EFI_STATUS status; #if !defined(__arm__) char buf[40]; #endif @@ -356,12 +464,15 @@ main(int argc, CHAR16 *argv[]) /* * Parse the args to set the console settings, etc * boot1.efi passes these in, if it can read /boot.config or /boot/config - * or iPXE may be setup to pass these in. + * or iPXE may be setup to pass these in. Or the optional argument in the + * boot environment was used to pass these arguments in (in which case + * neither /boot.config nor /boot/config are consulted). * * Loop through the args, and for each one that contains an '=' that is * not the first character, add it to the environment. This allows * loader and kernel env vars to be passed on the command line. Convert - * args from UCS-2 to ASCII (16 to 8 bit) as they are copied. + * args from UCS-2 to ASCII (16 to 8 bit) as they are copied (though this + * method is flawed for non-ASCII characters). */ howto = 0; for (i = 1; i < argc; i++) { @@ -441,6 +552,10 @@ main(int argc, CHAR16 *argv[]) for (i = 0; howto_names[i].ev != NULL; i++) if (howto & howto_names[i].mask) setenv(howto_names[i].ev, "YES", 1); + + /* + * XXX we need fallback to this stuff after looking at the ConIn, ConOut and ConErr variables + */ if (howto & RB_MULTIPLE) { if (howto & RB_SERIAL) setenv("console", "comconsole efi" , 1); @@ -448,13 +563,17 @@ main(int argc, CHAR16 *argv[]) setenv("console", "efi comconsole" , 1); } else if (howto & RB_SERIAL) { setenv("console", "comconsole" , 1); - } + } else + setenv("console", "efi", 1); if (efi_copy_init()) { printf("failed to allocate staging area\n"); return (EFI_BUFFER_TOO_SMALL); } + if ((s = getenv("fail_timeout")) != NULL) + fail_timeout = strtol(s, NULL, 10); + /* * Scan the BLOCK IO MEDIA handles then * march through the device switch probing for things. @@ -479,6 +598,7 @@ main(int argc, CHAR16 *argv[]) printf("\n%s", bootprog_info); + /* Determine the devpath of our image so we can prefer it. */ text = efi_devpath_name(img->FilePath); if (text != NULL) { printf(" Load Path: %S\n", text); @@ -520,8 +640,16 @@ main(int argc, CHAR16 *argv[]) */ BS->SetWatchdogTimer(0, 0, 0, NULL); + /* + * Try and find a good currdev based on the image that was booted. + * It might be desirable here to have a short pause to allow falling + * through to the boot loader instead of returning instantly to follow + * the boot protocol and also allow an escape hatch for users wishing + * to try something different. + */ if (find_currdev(img) != 0) - return (EFI_NOT_FOUND); + if (!interactive_interrupt("Failed to find bootable partition")) + return (EFI_NOT_FOUND); efi_init_environment(); setenv("LINES", "24", 1); /* optional */ From owner-svn-src-all@freebsd.org Wed Apr 11 19:49:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71BF7F8C435; Wed, 11 Apr 2018 19:49:36 +0000 (UTC) (envelope-from kib@freebsd.org) 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 C28366F35C; Wed, 11 Apr 2018 19:49:35 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w3BJnKRC042403 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 11 Apr 2018 22:49:23 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w3BJnKRC042403 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w3BJnKO5042402; Wed, 11 Apr 2018 22:49:20 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Wed, 11 Apr 2018 22:49:20 +0300 From: Konstantin Belousov To: John Baldwin Cc: Slawa Olhovchenkov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Message-ID: <20180411194920.GM1774@kib.kiev.ua> References: <201804060925.w369P8c2019558@repo.freebsd.org> <20180409162909.GF6612@zxy.spb.ru> <84716725.OOlTe33nR2@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84716725.OOlTe33nR2@ralph.baldwin.cx> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 19:49:36 -0000 On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote: > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > > > Author: kib > > > Date: Fri Apr 6 09:25:08 2018 > > > New Revision: 332091 > > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > > > Log: > > > MFC r331760: > > > Make vm_map_max/min/pmap KBI stable. > > > > > > Modified: > > > stable/11/sys/vm/vm_map.c > > > stable/11/sys/vm/vm_map.h > > > Directory Properties: > > > stable/11/ (props changed) > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > > nvidia (build on 11.1-RELEASE) also don't work > > Yes, this only helps with the future KBI, it doesn't restore the > existing one. However, r320889 which was committed earlier should > have restored the KBI? I am not sure. It might have, but there might be more breakage accumulated. My current opinion is that both vbox and nvidia (as well as in-tree and out of tree drm modules) must be marked as tied. The modules definitely depends on much more kernel interfaces than a typical HBA or network controller driver, for which the stability claim is actually intended to apply. From owner-svn-src-all@freebsd.org Wed Apr 11 21:28:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22936F9305B; Wed, 11 Apr 2018 21:28:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA7E4857E8; Wed, 11 Apr 2018 21:28:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 45D8910A87D; Wed, 11 Apr 2018 17:28:05 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: Slawa Olhovchenkov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Date: Wed, 11 Apr 2018 14:27:48 -0700 Message-ID: <2552898.N5SmTfmv87@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180411194920.GM1774@kib.kiev.ua> References: <201804060925.w369P8c2019558@repo.freebsd.org> <84716725.OOlTe33nR2@ralph.baldwin.cx> <20180411194920.GM1774@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 11 Apr 2018 17:28:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 21:28:07 -0000 On Wednesday, April 11, 2018 10:49:20 PM Konstantin Belousov wrote: > On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote: > > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > > > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > > > > > Author: kib > > > > Date: Fri Apr 6 09:25:08 2018 > > > > New Revision: 332091 > > > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > > > > > Log: > > > > MFC r331760: > > > > Make vm_map_max/min/pmap KBI stable. > > > > > > > > Modified: > > > > stable/11/sys/vm/vm_map.c > > > > stable/11/sys/vm/vm_map.h > > > > Directory Properties: > > > > stable/11/ (props changed) > > > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > > > nvidia (build on 11.1-RELEASE) also don't work > > > > Yes, this only helps with the future KBI, it doesn't restore the > > existing one. However, r320889 which was committed earlier should > > have restored the KBI? > > I am not sure. It might have, but there might be more breakage > accumulated. My current opinion is that both vbox and nvidia (as well as > in-tree and out of tree drm modules) must be marked as tied. The modules > definitely depends on much more kernel interfaces than a typical HBA or > network controller driver, for which the stability claim is actually > intended to apply. I do think virtualbox is probably too hard to make work, but I didn't think the nvidia driver was that bad. I think that for kmods in ports we should consider moving to a different model than we currently do where the port installs the source for the kernel module to a standard location and we could have a way to rebuild all of the modules as needed. This would permit us to provide PORTS_MODULES-type functionality via either ports or packages (and it is a bit more flexible as you wouldn't to deinstall/reinstall the package each time you just wanted to rebuild the kernel module). I would suggest something like /usr/local/src/modules/ and a 'LOCAL_MODULES' kernel option that is a list of ' ' to replace PORTS_MODULES. A package could still ship an initial module by default, but recompiling the module would either overwrite it, or if the module is built as part of the kernel (via LOCAL_MODULES) the new one would be installed with the kernel itself into /boot/kernel leaving the one from the package in /boot/modules. For tied modules we could simply build it with a strict MODULE_DEPEND line on the kernel so that the pre-built module won't load on newer kernels and then encourage the user to use LOCAL_MODULES in pkg-message. Using LOCAL_MODULES would be better than PORTS_MODULES as it would DTRT if you move kernel to kernel.old during an upgrade, etc. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Apr 11 21:42:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECA8BF93F4D; Wed, 11 Apr 2018 21:41:59 +0000 (UTC) (envelope-from shurd@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 9AEA469544; Wed, 11 Apr 2018 21:41:59 +0000 (UTC) (envelope-from shurd@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 95F6921C9F; Wed, 11 Apr 2018 21:41:59 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BLfxqw048322; Wed, 11 Apr 2018 21:41:59 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BLfxho048321; Wed, 11 Apr 2018 21:41:59 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201804112141.w3BLfxho048321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 11 Apr 2018 21:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332419 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 21:42:00 -0000 Author: shurd Date: Wed Apr 11 21:41:59 2018 New Revision: 332419 URL: https://svnweb.freebsd.org/changeset/base/332419 Log: Properly initialize ifc_nhwtxqs. Also, since ifc_nhwrxqs is only used in one place, remove it from the struct. This was preventing iflib_dma_free() from being called via iflib_device_detach(). Submitted by: Matthew Macy Reviewed by: shurd Sponsored by: Limelight Networks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Apr 11 20:04:06 2018 (r332418) +++ head/sys/net/iflib.c Wed Apr 11 21:41:59 2018 (r332419) @@ -166,7 +166,6 @@ struct iflib_ctx { struct mtx ifc_mtx; uint16_t ifc_nhwtxqs; - uint16_t ifc_nhwrxqs; iflib_txq_t ifc_txqs; iflib_rxq_t ifc_rxqs; @@ -2289,7 +2288,7 @@ iflib_stop(if_ctx_t ctx) for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { /* make sure all transmitters have completed before proceeding XXX */ - for (j = 0, di = txq->ift_ifdi; j < ctx->ifc_nhwrxqs; j++, di++) + for (j = 0, di = txq->ift_ifdi; j < rxq->ifr_nfl; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); /* also resets the free lists pidx/cidx */ for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) @@ -4198,6 +4197,7 @@ iflib_device_register(device_t dev, void *sc, if_share scctx = &ctx->ifc_softc_ctx; ifp = ctx->ifc_ifp; + ctx->ifc_nhwtxqs = sctx->isc_ntxqs; /* * XXX sanity check that ntxd & nrxd are a power of 2 From owner-svn-src-all@freebsd.org Wed Apr 11 21:49:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E5A8F94591; Wed, 11 Apr 2018 21:49:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 1E286699AF; Wed, 11 Apr 2018 21:49:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1f6NcV-0003yu-Vt; Thu, 12 Apr 2018 00:49:35 +0300 Date: Thu, 12 Apr 2018 00:49:35 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Message-ID: <20180411214935.GQ4305@zxy.spb.ru> References: <201804060925.w369P8c2019558@repo.freebsd.org> <84716725.OOlTe33nR2@ralph.baldwin.cx> <20180411194920.GM1774@kib.kiev.ua> <2552898.N5SmTfmv87@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2552898.N5SmTfmv87@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 21:49:39 -0000 On Wed, Apr 11, 2018 at 02:27:48PM -0700, John Baldwin wrote: > On Wednesday, April 11, 2018 10:49:20 PM Konstantin Belousov wrote: > > On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote: > > > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > > > > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > > > > > > > Author: kib > > > > > Date: Fri Apr 6 09:25:08 2018 > > > > > New Revision: 332091 > > > > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > > > > > > > Log: > > > > > MFC r331760: > > > > > Make vm_map_max/min/pmap KBI stable. > > > > > > > > > > Modified: > > > > > stable/11/sys/vm/vm_map.c > > > > > stable/11/sys/vm/vm_map.h > > > > > Directory Properties: > > > > > stable/11/ (props changed) > > > > > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > > > > nvidia (build on 11.1-RELEASE) also don't work > > > > > > Yes, this only helps with the future KBI, it doesn't restore the > > > existing one. However, r320889 which was committed earlier should > > > have restored the KBI? > > > > I am not sure. It might have, but there might be more breakage > > accumulated. My current opinion is that both vbox and nvidia (as well as > > in-tree and out of tree drm modules) must be marked as tied. The modules > > definitely depends on much more kernel interfaces than a typical HBA or > > network controller driver, for which the stability claim is actually > > intended to apply. > > I do think virtualbox is probably too hard to make work, but I didn't think > the nvidia driver was that bad. > > I think that for kmods in ports we should consider moving to a different model > than we currently do where the port installs the source for the kernel > module to a standard location and we could have a way to rebuild all of the > modules as needed. This would permit us to provide PORTS_MODULES-type > functionality via either ports or packages (and it is a bit more flexible as > you wouldn't to deinstall/reinstall the package each time you just wanted to > rebuild the kernel module). > > I would suggest something like /usr/local/src/modules/ and a > 'LOCAL_MODULES' kernel option that is a list of ' ' to replace > PORTS_MODULES. A package could still ship an initial module by default, but > recompiling the module would either overwrite it, or if the module is built as > part of the kernel (via LOCAL_MODULES) the new one would be installed with the > kernel itself into /boot/kernel leaving the one from the package in > /boot/modules. For tied modules we could simply build it with a strict > MODULE_DEPEND line on the kernel so that the pre-built module won't load on > newer kernels and then encourage the user to use LOCAL_MODULES in pkg-message. > Using LOCAL_MODULES would be better than PORTS_MODULES as it would DTRT if you > move kernel to kernel.old during an upgrade, etc. Hmm, what about packages? I am use nvidia driver as package. From owner-svn-src-all@freebsd.org Wed Apr 11 22:12:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D418F95ECA; Wed, 11 Apr 2018 22:12:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D95156E599; Wed, 11 Apr 2018 22:12:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w3BLgj2h018020 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 11 Apr 2018 14:42:45 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w3BLgjxa018019; Wed, 11 Apr 2018 14:42:45 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 11 Apr 2018 14:42:44 -0700 From: Gleb Smirnoff To: "Jonathan T. Looney" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332114 - head/sys/netinet Message-ID: <20180411214244.GD1069@FreeBSD.org> References: <201804061648.w36GmBkd046593@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804061648.w36GmBkd046593@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 22:12:40 -0000 On Fri, Apr 06, 2018 at 04:48:11PM +0000, Jonathan T. Looney wrote: J> Author: jtl J> Date: Fri Apr 6 16:48:11 2018 J> New Revision: 332114 J> URL: https://svnweb.freebsd.org/changeset/base/332114 J> J> Log: J> Check that in_pcbfree() is only called once for each PCB. If that J> assumption is violated, "bad things" could follow. J> J> I believe such an assert would have detected some of the problems jch@ J> was chasing in PR 203175 (see r307551). We also use it in our internal J> TCP development efforts. And, in case a bug does slip through to J> released code, this change silently ignores subsequent calls to J> in_pcbfree(). J> J> Reviewed by: rrs J> Sponsored by: Netflix, Inc. J> Differential Revision: https://reviews.freebsd.org/D14990 J> J> Modified: J> head/sys/netinet/in_pcb.c J> J> Modified: head/sys/netinet/in_pcb.c J> ============================================================================== J> --- head/sys/netinet/in_pcb.c Fri Apr 6 16:48:07 2018 (r332113) J> +++ head/sys/netinet/in_pcb.c Fri Apr 6 16:48:11 2018 (r332114) J> @@ -1288,6 +1288,13 @@ in_pcbfree(struct inpcb *inp) J> J> KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); J> J> + KASSERT((inp->inp_flags2 & INP_FREED) == 0, J> + ("%s: called twice for pcb %p", __func__, inp)); J> + if (inp->inp_flags2 & INP_FREED) { J> + INP_WUNLOCK(inp); J> + return; J> + } J> + This code will create Coverity report. IMHO, only KASSERT should be left. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Wed Apr 11 22:23:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62278F96975; Wed, 11 Apr 2018 22:23:23 +0000 (UTC) (envelope-from jhb@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 162AE710B8; Wed, 11 Apr 2018 22:23:23 +0000 (UTC) (envelope-from jhb@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 1122B22327; Wed, 11 Apr 2018 22:23:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3BMNMn4068851; Wed, 11 Apr 2018 22:23:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3BMNMmV068849; Wed, 11 Apr 2018 22:23:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804112223.w3BMNMmV068849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Apr 2018 22:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332420 - in stable/11: stand/common sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11: stand/common sys/kern X-SVN-Commit-Revision: 332420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2018 22:23:23 -0000 Author: jhb Date: Wed Apr 11 22:23:22 2018 New Revision: 332420 URL: https://svnweb.freebsd.org/changeset/base/332420 Log: MFC 328101,328911: Require SHF_ALLOC for kernel object module sections. 328101: Require the SHF_ALLOC flag for program sections from kernel object modules. ELF object files can contain program sections which are not supposed to be loaded into memory (e.g. .comment). Normally the static linker uses these flags to decide which sections are allocated to loadable program segments in ELF binaries and shared objects (including kernels on all architectures and kernel modules on architectures other than amd64). Mapping ELF object files (such as amd64 kernel modules) into memory directly is a bit of a grey area. ELF object files are intended to be used as inputs to the static linker. As a result, there is not a standardized definition for what the memory layout of an ELF object should be (none of the section headers have valid virtual memory addresses for example). The kernel and loader were not checking the SHF_ALLOC flag but loading any program sections with certain types such as SHT_PROGBITS. As a result, the kernel and loader would load into RAM some sections that weren't marked with SHF_ALLOC such as .comment that are not loaded into RAM for kernel modules on other architectures (which are implemented as ELF shared objects). Aside from possibly requiring slightly more RAM to hold a kernel module this does not affect runtime correctness as the kernel relocates symbols based on the layout it uses. Debuggers such as gdb and lldb do not extract symbol tables from a running process or kernel. Instead, they replicate the memory layout of ELF executables and shared objects and use that to construct their own symbol tables. For executables and shared objects this works fine. For ELF objects the current logic in kgdb (and probably lldb based on a simple reading) assumes that only sections with SHF_ALLOC are memory resident when constructing a memory layout. If the debugger constructs a different memory layout than the kernel, then it will compute different addresses for symbols causing symbols in the debugger to appear to have the wrong values (though the kernel itself is working fine). The current port of mdb does not check SHF_ALLOC as it replicates the kernel's logic in its existing kernel support. The bfd linker sorts the sections in ELF object files such that all of the allocated sections (sections with SHF_ALLOCATED) are placed first followed by unallocated sections. As a result, when kgdb composed a memory layout using only the allocated sections, this layout happened to match the layout used by the kernel and loader. The lld linker does not sort the sections in ELF object files and mixed allocated and unallocated sections. This resulted in kgdb composing a different memory layout than the kernel and loader. We could either patch kgdb (and possibly in the future lldb) to use custom handling when generating memory layouts for kernel modules that are ELF objects, or we could change the kernel and loader to check SHF_ALLOCATED. I chose the latter as I feel we shouldn't be loading things into RAM that the module won't use. This should mostly be a NOP when linking with bfd but will allow the existing kgdb to work with amd64 kernel modules linked with lld. Note that we only require SHF_ALLOC for "program" sections for types like SHT_PROGBITS and SHT_NOBITS. Other section types such as symbol tables, string tables, and relocations must also be loaded and are not marked with SHF_ALLOC. 328911: Ignore relocation tables for non-memory-resident sections. As a followup to r328101, ignore relocation tables for ELF object sections that are not memory resident. For modules loaded by the loader, ignore relocation tables whose associated section was not loaded by the loader (sh_addr is zero). For modules loaded at runtime via kldload(2), ignore relocation tables whose associated section is not marked with SHF_ALLOC. Modified: stable/11/stand/common/load_elf_obj.c stable/11/sys/kern/link_elf_obj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/load_elf_obj.c ============================================================================== --- stable/11/stand/common/load_elf_obj.c Wed Apr 11 21:41:59 2018 (r332419) +++ stable/11/stand/common/load_elf_obj.c Wed Apr 11 22:23:22 2018 (r332420) @@ -224,6 +224,8 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f #if defined(__i386__) || defined(__amd64__) case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; lastaddr = roundup(lastaddr, shdr[i].sh_addralign); shdr[i].sh_addr = (Elf_Addr)lastaddr; lastaddr += shdr[i].sh_size; @@ -280,6 +282,8 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f switch (shdr[i].sh_type) { case SHT_REL: case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; lastaddr = roundup(lastaddr, shdr[i].sh_addralign); shdr[i].sh_addr = (Elf_Addr)lastaddr; lastaddr += shdr[i].sh_size; Modified: stable/11/sys/kern/link_elf_obj.c ============================================================================== --- stable/11/sys/kern/link_elf_obj.c Wed Apr 11 21:41:59 2018 (r332419) +++ stable/11/sys/kern/link_elf_obj.c Wed Apr 11 22:23:22 2018 (r332420) @@ -260,6 +260,9 @@ link_elf_link_preload(linker_class_t cls, const char * #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + /* Ignore sections not loaded by the loader. */ + if (shdr[i].sh_addr == 0) + break; ef->nprogtab++; break; case SHT_SYMTAB: @@ -267,9 +270,17 @@ link_elf_link_preload(linker_class_t cls, const char * symstrindex = shdr[i].sh_link; break; case SHT_REL: + /* + * Ignore relocation tables for sections not + * loaded by the loader. + */ + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->nreltab++; break; case SHT_RELA: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->nrelatab++; break; } @@ -333,6 +344,8 @@ link_elf_link_preload(linker_class_t cls, const char * #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if (shdr[i].sh_addr == 0) + break; ef->progtab[pb].addr = (void *)shdr[i].sh_addr; if (shdr[i].sh_type == SHT_PROGBITS) ef->progtab[pb].name = "<>"; @@ -391,12 +404,16 @@ link_elf_link_preload(linker_class_t cls, const char * pb++; break; case SHT_REL: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->reltab[rl].rel = (Elf_Rel *)shdr[i].sh_addr; ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel); ef->reltab[rl].sec = shdr[i].sh_info; rl++; break; case SHT_RELA: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->relatab[ra].rela = (Elf_Rela *)shdr[i].sh_addr; ef->relatab[ra].nrela = shdr[i].sh_size / sizeof(Elf_Rela); @@ -599,6 +616,8 @@ link_elf_load_file(linker_class_t cls, const char *fil #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; ef->nprogtab++; break; case SHT_SYMTAB: @@ -607,9 +626,17 @@ link_elf_load_file(linker_class_t cls, const char *fil symstrindex = shdr[i].sh_link; break; case SHT_REL: + /* + * Ignore relocation tables for unallocated + * sections. + */ + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->nreltab++; break; case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->nrelatab++; break; case SHT_STRTAB: @@ -714,6 +741,8 @@ link_elf_load_file(linker_class_t cls, const char *fil #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; alignmask = shdr[i].sh_addralign - 1; mapsize += alignmask; mapsize &= ~alignmask; @@ -784,6 +813,8 @@ link_elf_load_file(linker_class_t cls, const char *fil #ifdef __amd64__ case SHT_X86_64_UNWIND: #endif + if ((shdr[i].sh_flags & SHF_ALLOC) == 0) + break; alignmask = shdr[i].sh_addralign - 1; mapbase += alignmask; mapbase &= ~alignmask; @@ -863,6 +894,8 @@ link_elf_load_file(linker_class_t cls, const char *fil pb++; break; case SHT_REL: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->reltab[rl].rel = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel); @@ -881,6 +914,8 @@ link_elf_load_file(linker_class_t cls, const char *fil rl++; break; case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->relatab[ra].rela = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); ef->relatab[ra].nrela = From owner-svn-src-all@freebsd.org Thu Apr 12 02:10:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A832EF81522; Thu, 12 Apr 2018 02:10:01 +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 571E582079; Thu, 12 Apr 2018 02:10:01 +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 51F472479E; Thu, 12 Apr 2018 02:10:01 +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 w3C2A1Bg078504; Thu, 12 Apr 2018 02:10:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3C2A1El078503; Thu, 12 Apr 2018 02:10:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804120210.w3C2A1El078503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Apr 2018 02:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332421 - head/sys/dev/vt/hw/vga X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/vt/hw/vga X-SVN-Commit-Revision: 332421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 02:10:01 -0000 Author: emaste Date: Thu Apr 12 02:10:01 2018 New Revision: 332421 URL: https://svnweb.freebsd.org/changeset/base/332421 Log: vt: add three more cp437 mappings for vga textmode In UTF-8 locales mandoc uses a number of characters outside of the Basic Latin group, e.g. from general punctuation or miscellaneous mathematical symbols, and these rendered as ? in text mode. This change adds (char, replacement, code point, description): – - U+2013 En Dash ⟨ < U+27E8 Mathematical Left Angle Bracket ⟩ > U+27E9 Mathematical Right Angle Bracket This change addresses some common cases; there are others that still need to be added after a more thorough review. PR: 227409 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/vga/vt_vga.c Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Wed Apr 11 22:23:22 2018 (r332420) +++ head/sys/dev/vt/hw/vga/vt_vga.c Thu Apr 12 02:10:01 2018 (r332421) @@ -237,6 +237,7 @@ static const struct unicp437 cp437table[] = { { 0x03c0, 0xe3, 0x00 }, { 0x03c3, 0xe5, 0x00 }, { 0x03c4, 0xe7, 0x00 }, { 0x03c6, 0xed, 0x00 }, { 0x03d5, 0xed, 0x00 }, { 0x2010, 0x2d, 0x00 }, + { 0x2013, 0x2d, 0x00 }, { 0x2014, 0x2d, 0x00 }, { 0x2018, 0x60, 0x00 }, { 0x2019, 0x27, 0x00 }, { 0x201c, 0x22, 0x00 }, { 0x201d, 0x22, 0x00 }, { 0x2022, 0x07, 0x00 }, @@ -285,7 +286,8 @@ static const struct unicp437 cp437table[] = { { 0x2640, 0x0c, 0x00 }, { 0x2642, 0x0b, 0x00 }, { 0x2660, 0x06, 0x00 }, { 0x2663, 0x05, 0x00 }, { 0x2665, 0x03, 0x01 }, { 0x266a, 0x0d, 0x00 }, - { 0x266c, 0x0e, 0x00 }, + { 0x266c, 0x0e, 0x00 }, { 0x27e8, 0x3c, 0x00 }, + { 0x27e9, 0x3e, 0x00 }, }; static uint8_t From owner-svn-src-all@freebsd.org Thu Apr 12 04:03:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8249CF8B975; Thu, 12 Apr 2018 04:03:19 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-ot0-x232.google.com (mail-ot0-x232.google.com [IPv6:2607:f8b0:4003:c0f::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA2997BDDE; Thu, 12 Apr 2018 04:03:18 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: by mail-ot0-x232.google.com with SMTP id o9-v6so4502258otj.5; Wed, 11 Apr 2018 21:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=jEpsVBpjOeHmHwJ9YqQlRhnN0o+haB2L+pada8eVKcw=; b=qQiMnLWrYIWUEF1hcODM6ceSGvaIOEqtHW6X7tcANWfJfb70Bpp/R5UJpXlEd5bUh3 BUNHNyvFNoO+Z9ChWM7/gfpOWHmaMpqUZ9/bNBuWG17QFVdYDAij09QDlpYQ2NbzQ+Cz u2dmK4ZgwBBxYNkodT0SqGXBxNS4eUjJbz1CQJ95IZ06klIyEJ9PJk7jgVPjsoLCPpuD ZsE+zz7MzsyiKmvnOr+nTnt3qux3L3GyqAZNLRm5Kr82BccHxMmOFpbPjJuxXBS4nHqn aOrvJiU/KMbf0h1VwocCJ+h0RZ3KqHAMr0XwMo8gyaJq4Jlqf1Qmz8em9/Dhqz2utksp jFpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=jEpsVBpjOeHmHwJ9YqQlRhnN0o+haB2L+pada8eVKcw=; b=Bdh4+x24+hTrY42WcD1w9VVXPjKpeOalOMJOgsxv/ELjd5RGVGO8OBYrNQhVf2d+8Z cEe6SG2NUfSledhwgYy+ov3koEYmzHOE4Il3BB6xkyX3t8YTFzEUX5pRgElyNmYcHJTU +v0HfNmicB9/xdVZGn6wX4xfCbaGHHRgd7WhkyiFWO+QmVQ3kKxirpZHZ6TaOYBPoIhV a7K1Sz9eji0uJkZP9C6xl1hizjANHGYdKlAcbkSmMhFsMGb20iKtE4nnY8qe+Ydz88pe cegnlSay8nQILpI8y8jHYhXZ+tcwu4Zc59JzkDVv+WUpVAkYX4EoYNfPLVr3qf1fH3dj zs3Q== X-Gm-Message-State: ALQs6tCruOkhuOxOxZs5EVjN6TqNsTLDKxS4lY2DUCEKqcEXMqENjNXZ vbA4YhZRxtrhwW+AJ3+CbLD37PRG0d39FswZmuUChG8k X-Google-Smtp-Source: AIpwx4+ZAWUOUvCacRFisvtGJy5WsDAG2c+tx/AhM20HwPxM7663JKoyWu0UedCIoLD0KVFOi0/Ow6eeiVoOY+1JUJQ= X-Received: by 2002:a9d:4082:: with SMTP id n2-v6mr4643162ote.150.1523505798141; Wed, 11 Apr 2018 21:03:18 -0700 (PDT) MIME-Version: 1.0 Sender: kmacybsd@gmail.com Received: by 2002:a9d:4782:0:0:0:0:0 with HTTP; Wed, 11 Apr 2018 21:03:17 -0700 (PDT) In-Reply-To: <201804112141.w3BLfxho048321@repo.freebsd.org> References: <201804112141.w3BLfxho048321@repo.freebsd.org> From: "K. Macy" Date: Wed, 11 Apr 2018 21:03:17 -0700 X-Google-Sender-Auth: _ukj_4ZZudNujFDhCPFbCpb6MCc Message-ID: Subject: Re: svn commit: r332419 - head/sys/net To: Stephen Hurd Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 04:03:19 -0000 There was a panic inducing merge error, please apply if you encounter problems: @ -2288,7 +2294,7 @@ iflib_stop(if_ctx_t ctx) for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { /* make sure all transmitters have completed before proceeding XXX */ - for (j = 0, di = txq->ift_ifdi; j < rxq->ifr_nfl; j++, di++) + for (j = 0, di = rxq->ifr_ifdi; j < rxq->ifr_nfl; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); /* also resets the free lists pidx/cidx */ for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) On Wed, Apr 11, 2018 at 2:41 PM, Stephen Hurd wrote: > Author: shurd > Date: Wed Apr 11 21:41:59 2018 > New Revision: 332419 > URL: https://svnweb.freebsd.org/changeset/base/332419 > > Log: > Properly initialize ifc_nhwtxqs. > > Also, since ifc_nhwrxqs is only used in one place, remove it from the struct. > This was preventing iflib_dma_free() from being called via > iflib_device_detach(). > > Submitted by: Matthew Macy > Reviewed by: shurd > Sponsored by: Limelight Networks > > Modified: > head/sys/net/iflib.c > > Modified: head/sys/net/iflib.c > ============================================================================== > --- head/sys/net/iflib.c Wed Apr 11 20:04:06 2018 (r332418) > +++ head/sys/net/iflib.c Wed Apr 11 21:41:59 2018 (r332419) > @@ -166,7 +166,6 @@ struct iflib_ctx { > struct mtx ifc_mtx; > > uint16_t ifc_nhwtxqs; > - uint16_t ifc_nhwrxqs; > > iflib_txq_t ifc_txqs; > iflib_rxq_t ifc_rxqs; > @@ -2289,7 +2288,7 @@ iflib_stop(if_ctx_t ctx) > for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { > /* make sure all transmitters have completed before proceeding XXX */ > > - for (j = 0, di = txq->ift_ifdi; j < ctx->ifc_nhwrxqs; j++, di++) > + for (j = 0, di = txq->ift_ifdi; j < rxq->ifr_nfl; j++, di++) > bzero((void *)di->idi_vaddr, di->idi_size); > /* also resets the free lists pidx/cidx */ > for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) > @@ -4198,6 +4197,7 @@ iflib_device_register(device_t dev, void *sc, if_share > > scctx = &ctx->ifc_softc_ctx; > ifp = ctx->ifc_ifp; > + ctx->ifc_nhwtxqs = sctx->isc_ntxqs; > > /* > * XXX sanity check that ntxd & nrxd are a power of 2 > _______________________________________________ > 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-all@freebsd.org Thu Apr 12 04:11:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C7C1F8C5B9; Thu, 12 Apr 2018 04:11:38 +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 B6B0B7E959; Thu, 12 Apr 2018 04:11:37 +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 B1CB125CED; Thu, 12 Apr 2018 04:11:37 +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 w3C4BbQ8038461; Thu, 12 Apr 2018 04:11:37 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3C4Bbd1038460; Thu, 12 Apr 2018 04:11:37 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804120411.w3C4Bbd1038460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 12 Apr 2018 04:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332422 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 04:11:38 -0000 Author: mjg Date: Thu Apr 12 04:11:37 2018 New Revision: 332422 URL: https://svnweb.freebsd.org/changeset/base/332422 Log: iflib: fix up a mismerge in r332419 Lead to crashes on boot while in ifconfig. Submitted by: Matthew Macy Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Apr 12 02:10:01 2018 (r332421) +++ head/sys/net/iflib.c Thu Apr 12 04:11:37 2018 (r332422) @@ -2288,7 +2288,7 @@ iflib_stop(if_ctx_t ctx) for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { /* make sure all transmitters have completed before proceeding XXX */ - for (j = 0, di = txq->ift_ifdi; j < rxq->ifr_nfl; j++, di++) + for (j = 0, di = rxq->ifr_ifdi; j < rxq->ifr_nfl; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); /* also resets the free lists pidx/cidx */ for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) From owner-svn-src-all@freebsd.org Thu Apr 12 07:20:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2489F9BCF1; Thu, 12 Apr 2018 07:20:51 +0000 (UTC) (envelope-from vmaffione@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 4249F6A77B; Thu, 12 Apr 2018 07:20:51 +0000 (UTC) (envelope-from vmaffione@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 3CF4227CA5; Thu, 12 Apr 2018 07:20:51 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3C7KpY3032122; Thu, 12 Apr 2018 07:20:51 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3C7Koe4032111; Thu, 12 Apr 2018 07:20:50 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201804120720.w3C7Koe4032111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 12 Apr 2018 07:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332423 - in head/sys: conf dev/cxgbe dev/ixgbe dev/ixl dev/netmap dev/re modules/netmap net sys X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys: conf dev/cxgbe dev/ixgbe dev/ixl dev/netmap dev/re modules/netmap net sys X-SVN-Commit-Revision: 332423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 07:20:52 -0000 Author: vmaffione Date: Thu Apr 12 07:20:50 2018 New Revision: 332423 URL: https://svnweb.freebsd.org/changeset/base/332423 Log: netmap: align codebase to the current upstream (commit id 3fb001303718146) Changelist: - Turn tx_rings and rx_rings arrays into arrays of pointers to kring structs. This patch includes fixes for ixv, ixl, ix, re, cxgbe, iflib, vtnet and ptnet drivers to cope with the change. - Generalize the nm_config() callback to accept a struct containing many parameters. - Introduce NKR_FAKERING to support buffers sharing (used for netmap pipes) - Improved API for external VALE modules. - Various bug fixes and improvements to the netmap memory allocator, including support for externally (userspace) allocated memory. - Refactoring of netmap pipes: now linked rings share the same netmap buffers, with a separate set of kring pointers (rhead, rcur, rtail). Buffer swapping does not need to happen anymore. - Large refactoring of the control API towards an extensible solution; the goal is to allow the addition of more commands and extension of existing ones (with new options) without the need of hacks or the risk of running out of configuration space. A new NIOCCTRL ioctl has been added to handle all the requests of the new control API, which cover all the functionalities so far supported. The netmap API bumps from 11 to 12 with this patch. Full backward compatibility is provided for the old control command (NIOCREGIF), by means of a new netmap_legacy module. Many parts of the old netmap.h header has now been moved to netmap_legacy.h (included by netmap.h). Approved by: hrs (mentor) Added: head/sys/dev/netmap/netmap_legacy.c (contents, props changed) head/sys/net/netmap_legacy.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixl/ixl_pf_main.c head/sys/dev/ixl/ixl_txrx.c head/sys/dev/netmap/if_ptnet.c head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/if_vtnet_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/netmap/netmap_mem2.h head/sys/dev/netmap/netmap_monitor.c head/sys/dev/netmap/netmap_pipe.c head/sys/dev/netmap/netmap_pt.c head/sys/dev/netmap/netmap_vale.c head/sys/dev/re/if_re.c head/sys/modules/netmap/Makefile head/sys/net/iflib.c head/sys/net/netmap.h head/sys/net/netmap_user.h head/sys/net/netmap_virt.h head/sys/sys/param.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Apr 12 04:11:37 2018 (r332422) +++ head/sys/conf/files Thu Apr 12 07:20:50 2018 (r332423) @@ -2535,6 +2535,7 @@ dev/netmap/netmap_offloadings.c optional netmap dev/netmap/netmap_pipe.c optional netmap dev/netmap/netmap_pt.c optional netmap dev/netmap/netmap_vale.c optional netmap +dev/netmap/netmap_legacy.c optional netmap # compile-with "${NORMAL_C} -Wconversion -Wextra" dev/nfsmb/nfsmb.c optional nfsmb pci dev/nge/if_nge.c optional nge Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Thu Apr 12 04:11:37 2018 (r332422) +++ head/sys/dev/cxgbe/t4_netmap.c Thu Apr 12 07:20:50 2018 (r332423) @@ -344,7 +344,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi for_each_nm_rxq(vi, i, nm_rxq) { struct irq *irq = &sc->irq[vi->first_intr + i]; - kring = &na->rx_rings[nm_rxq->nid]; + kring = na->rx_rings[nm_rxq->nid]; if (!nm_kring_pending_on(kring) || nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID) continue; @@ -375,7 +375,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi } for_each_nm_txq(vi, i, nm_txq) { - kring = &na->tx_rings[nm_txq->nid]; + kring = na->tx_rings[nm_txq->nid]; if (!nm_kring_pending_on(kring) || nm_txq->cntxt_id != INVALID_NM_TXQ_CNTXT_ID) continue; @@ -427,7 +427,7 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v for_each_nm_txq(vi, i, nm_txq) { struct sge_qstat *spg = (void *)&nm_txq->desc[nm_txq->sidx]; - kring = &na->tx_rings[nm_txq->nid]; + kring = na->tx_rings[nm_txq->nid]; if (!nm_kring_pending_off(kring) || nm_txq->cntxt_id == INVALID_NM_TXQ_CNTXT_ID) continue; @@ -445,7 +445,7 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v for_each_nm_rxq(vi, i, nm_rxq) { struct irq *irq = &sc->irq[vi->first_intr + i]; - kring = &na->rx_rings[nm_rxq->nid]; + kring = na->rx_rings[nm_rxq->nid]; if (!nm_kring_pending_off(kring) || nm_rxq->iq_cntxt_id == INVALID_NM_RXQ_CNTXT_ID) continue; @@ -933,7 +933,7 @@ t4_nm_intr(void *arg) struct adapter *sc = vi->pi->adapter; struct ifnet *ifp = vi->ifp; struct netmap_adapter *na = NA(ifp); - struct netmap_kring *kring = &na->rx_rings[nm_rxq->nid]; + struct netmap_kring *kring = na->rx_rings[nm_rxq->nid]; struct netmap_ring *ring = kring->ring; struct iq_desc *d = &nm_rxq->iq_desc[nm_rxq->iq_cidx]; const void *cpl; Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Thu Apr 12 04:11:37 2018 (r332422) +++ head/sys/dev/ixgbe/if_ixv.c Thu Apr 12 07:20:50 2018 (r332423) @@ -1450,7 +1450,7 @@ ixv_initialize_receive_units(if_ctx_t ctx) */ if (ifp->if_capenable & IFCAP_NETMAP) { struct netmap_adapter *na = NA(ifp); - struct netmap_kring *kring = &na->rx_rings[j]; + struct netmap_kring *kring = na->rx_rings[j]; int t = na->num_rx_desc - 1 - nm_kr_rxspace(kring); IXGBE_WRITE_REG(hw, IXGBE_VFRDT(rxr->me), t); Modified: head/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_main.c Thu Apr 12 04:11:37 2018 (r332422) +++ head/sys/dev/ixl/ixl_pf_main.c Thu Apr 12 07:20:50 2018 (r332423) @@ -2240,7 +2240,7 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) /* preserve queue */ if (vsi->ifp->if_capenable & IFCAP_NETMAP) { struct netmap_adapter *na = NA(vsi->ifp); - struct netmap_kring *kring = &na->rx_rings[i]; + struct netmap_kring *kring = na->rx_rings[i]; int t = na->num_rx_desc - 1 - nm_kr_rxspace(kring); wr32(vsi->hw, I40E_QRX_TAIL(que->me), t); } else Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Thu Apr 12 04:11:37 2018 (r332422) +++ head/sys/dev/ixl/ixl_txrx.c Thu Apr 12 07:20:50 2018 (r332423) @@ -547,7 +547,7 @@ ixl_init_tx_ring(struct ixl_queue *que) * netmap slot index, si */ if (slot) { - int si = netmap_idx_n2k(&na->tx_rings[que->me], i); + int si = netmap_idx_n2k(na->tx_rings[que->me], i); netmap_load_map(na, buf->tag, buf->map, NMB(na, slot + si)); } #endif /* DEV_NETMAP */ @@ -1214,7 +1214,7 @@ ixl_init_rx_ring(struct ixl_queue *que) * an mbuf, so end the block with a continue; */ if (slot) { - int sj = netmap_idx_n2k(&na->rx_rings[que->me], j); + int sj = netmap_idx_n2k(na->rx_rings[que->me], j); uint64_t paddr; void *addr; Modified: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- head/sys/dev/netmap/if_ptnet.c Thu Apr 12 04:11:37 2018 (r332422) +++ head/sys/dev/netmap/if_ptnet.c Thu Apr 12 07:20:50 2018 (r332423) @@ -210,8 +210,8 @@ static int ptnet_irqs_init(struct ptnet_softc *sc); static void ptnet_irqs_fini(struct ptnet_softc *sc); static uint32_t ptnet_nm_ptctl(if_t ifp, uint32_t cmd); -static int ptnet_nm_config(struct netmap_adapter *na, unsigned *txr, - unsigned *txd, unsigned *rxr, unsigned *rxd); +static int ptnet_nm_config(struct netmap_adapter *na, + struct nm_config_info *info); static void ptnet_update_vnet_hdr(struct ptnet_softc *sc); static int ptnet_nm_register(struct netmap_adapter *na, int onoff); static int ptnet_nm_txsync(struct netmap_kring *kring, int flags); @@ -1104,18 +1104,20 @@ ptnet_nm_ptctl(if_t ifp, uint32_t cmd) } static int -ptnet_nm_config(struct netmap_adapter *na, unsigned *txr, unsigned *txd, - unsigned *rxr, unsigned *rxd) +ptnet_nm_config(struct netmap_adapter *na, struct nm_config_info *info) { struct ptnet_softc *sc = if_getsoftc(na->ifp); - *txr = bus_read_4(sc->iomem, PTNET_IO_NUM_TX_RINGS); - *rxr = bus_read_4(sc->iomem, PTNET_IO_NUM_RX_RINGS); - *txd = bus_read_4(sc->iomem, PTNET_IO_NUM_TX_SLOTS); - *rxd = bus_read_4(sc->iomem, PTNET_IO_NUM_RX_SLOTS); + info->num_tx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_TX_RINGS); + info->num_rx_rings = bus_read_4(sc->iomem, PTNET_IO_NUM_RX_RINGS); + info->num_tx_descs = bus_read_4(sc->iomem, PTNET_IO_NUM_TX_SLOTS); + info->num_rx_descs = bus_read_4(sc->iomem, PTNET_IO_NUM_RX_SLOTS); + info->rx_buf_maxsize = NETMAP_BUF_SIZE(na); - device_printf(sc->dev, "txr %u, rxr %u, txd %u, rxd %u\n", - *txr, *rxr, *txd, *rxd); + device_printf(sc->dev, "txr %u, rxr %u, txd %u, rxd %u, rxbufsz %u\n", + info->num_tx_rings, info->num_rx_rings, + info->num_tx_descs, info->num_rx_descs, + info->rx_buf_maxsize); return 0; } @@ -1133,9 +1135,9 @@ ptnet_sync_from_csb(struct ptnet_softc *sc, struct net struct netmap_kring *kring; if (i < na->num_tx_rings) { - kring = na->tx_rings + i; + kring = na->tx_rings[i]; } else { - kring = na->rx_rings + i - na->num_tx_rings; + kring = na->rx_rings[i - na->num_tx_rings]; } kring->rhead = kring->ring->head = ptgh->head; kring->rcur = kring->ring->cur = ptgh->cur; @@ -1228,7 +1230,7 @@ ptnet_nm_register(struct netmap_adapter *na, int onoff if (native) { for_rx_tx(t) { for (i = 0; i <= nma_get_nrings(na, t); i++) { - struct netmap_kring *kring = &NMR(na, t)[i]; + struct netmap_kring *kring = NMR(na, t)[i]; if (nm_kring_pending_on(kring)) { kring->nr_mode = NKR_NETMAP_ON; @@ -1243,7 +1245,7 @@ ptnet_nm_register(struct netmap_adapter *na, int onoff nm_clear_native_flags(na); for_rx_tx(t) { for (i = 0; i <= nma_get_nrings(na, t); i++) { - struct netmap_kring *kring = &NMR(na, t)[i]; + struct netmap_kring *kring = NMR(na, t)[i]; if (nm_kring_pending_off(kring)) { kring->nr_mode = NKR_NETMAP_OFF; @@ -1758,7 +1760,7 @@ ptnet_drain_transmit_queue(struct ptnet_queue *pq, uns ptgh = pq->ptgh; pthg = pq->pthg; - kring = na->tx_rings + pq->kring_id; + kring = na->tx_rings[pq->kring_id]; ring = kring->ring; lim = kring->nkr_num_slots - 1; head = ring->head; @@ -2021,7 +2023,7 @@ ptnet_rx_eof(struct ptnet_queue *pq, unsigned int budg struct ptnet_csb_gh *ptgh = pq->ptgh; struct ptnet_csb_hg *pthg = pq->pthg; struct netmap_adapter *na = &sc->ptna->dr.up; - struct netmap_kring *kring = na->rx_rings + pq->kring_id; + struct netmap_kring *kring = na->rx_rings[pq->kring_id]; struct netmap_ring *ring = kring->ring; unsigned int const lim = kring->nkr_num_slots - 1; unsigned int batch_count = 0; Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Thu Apr 12 04:11:37 2018 (r332422) +++ head/sys/dev/netmap/if_re_netmap.h Thu Apr 12 07:20:50 2018 (r332423) @@ -304,7 +304,7 @@ re_netmap_tx_init(struct rl_softc *sc) /* l points in the netmap ring, i points in the NIC ring */ for (i = 0; i < n; i++) { uint64_t paddr; - int l = netmap_idx_n2k(&na->tx_rings[0], i); + int l = netmap_idx_n2k(na->tx_rings[0], i); void *addr = PNMB(na, slot + l, &paddr); desc[i].rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr)); @@ -330,11 +330,11 @@ re_netmap_rx_init(struct rl_softc *sc) * Do not release the slots owned by userspace, * and also keep one empty. */ - max_avail = n - 1 - nm_kr_rxspace(&na->rx_rings[0]); + max_avail = n - 1 - nm_kr_rxspace(na->rx_rings[0]); for (nic_i = 0; nic_i < n; nic_i++) { void *addr; uint64_t paddr; - uint32_t nm_i = netmap_idx_n2k(&na->rx_rings[0], nic_i); + uint32_t nm_i = netmap_idx_n2k(na->rx_rings[0], nic_i); addr = PNMB(na, slot + nm_i, &paddr); Modified: head/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- head/sys/dev/netmap/if_vtnet_netmap.h Thu Apr 12 04:11:37 2018 (r332422) +++ head/sys/dev/netmap/if_vtnet_netmap.h Thu Apr 12 07:20:50 2018 (r332423) @@ -383,7 +383,7 @@ vtnet_netmap_init_rx_buffers(struct SOFTC_T *sc) if (!nm_native_on(na)) return 0; for (r = 0; r < na->num_rx_rings; r++) { - struct netmap_kring *kring = &na->rx_rings[r]; + struct netmap_kring *kring = na->rx_rings[r]; struct vtnet_rxq *rxq = &sc->vtnet_rxqs[r]; struct virtqueue *vq = rxq->vtnrx_vq; struct netmap_slot* slot; @@ -407,29 +407,6 @@ vtnet_netmap_init_rx_buffers(struct SOFTC_T *sc) return 1; } -/* Update the virtio-net device configurations. Number of queues can - * change dinamically, by 'ethtool --set-channels $IFNAME combined $N'. - * This is actually the only way virtio-net can currently enable - * the multiqueue mode. - * XXX note that we seem to lose packets if the netmap ring has more - * slots than the queue - */ -static int -vtnet_netmap_config(struct netmap_adapter *na, u_int *txr, u_int *txd, - u_int *rxr, u_int *rxd) -{ - struct ifnet *ifp = na->ifp; - struct SOFTC_T *sc = ifp->if_softc; - - *txr = *rxr = sc->vtnet_max_vq_pairs; - *rxd = 512; // sc->vtnet_rx_nmbufs; - *txd = *rxd; // XXX - D("vtnet config txq=%d, txd=%d rxq=%d, rxd=%d", - *txr, *txd, *rxr, *rxd); - - return 0; -} - static void vtnet_netmap_attach(struct SOFTC_T *sc) { @@ -443,7 +420,6 @@ vtnet_netmap_attach(struct SOFTC_T *sc) na.nm_register = vtnet_netmap_reg; na.nm_txsync = vtnet_netmap_txsync; na.nm_rxsync = vtnet_netmap_rxsync; - na.nm_config = vtnet_netmap_config; na.nm_intr = vtnet_netmap_intr; na.num_tx_rings = na.num_rx_rings = sc->vtnet_max_vq_pairs; D("max rings %d", sc->vtnet_max_vq_pairs); Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Apr 12 04:11:37 2018 (r332422) +++ head/sys/dev/netmap/netmap.c Thu Apr 12 07:20:50 2018 (r332423) @@ -262,7 +262,7 @@ ports attached to the switch) * * Any network interface known to the system (including a persistent VALE * port) can be attached to a VALE switch by issuing the - * NETMAP_BDG_ATTACH subcommand. After the attachment, persistent VALE ports + * NETMAP_REQ_VALE_ATTACH command. After the attachment, persistent VALE ports * look exactly like ephemeral VALE ports (as created in step 2 above). The * attachment of other interfaces, instead, requires the creation of a * netmap_bwrap_adapter. Moreover, the attached interface must be put in @@ -591,9 +591,9 @@ void netmap_set_ring(struct netmap_adapter *na, u_int ring_id, enum txrx t, int stopped) { if (stopped) - netmap_disable_ring(NMR(na, t) + ring_id, stopped); + netmap_disable_ring(NMR(na, t)[ring_id], stopped); else - NMR(na, t)[ring_id].nkr_stopped = 0; + NMR(na, t)[ring_id]->nkr_stopped = 0; } @@ -745,39 +745,42 @@ nm_dump_buf(char *p, int len, int lim, char *dst) int netmap_update_config(struct netmap_adapter *na) { - u_int txr, txd, rxr, rxd; + struct nm_config_info info; - txr = txd = rxr = rxd = 0; + bzero(&info, sizeof(info)); if (na->nm_config == NULL || - na->nm_config(na, &txr, &txd, &rxr, &rxd)) - { + na->nm_config(na, &info)) { /* take whatever we had at init time */ - txr = na->num_tx_rings; - txd = na->num_tx_desc; - rxr = na->num_rx_rings; - rxd = na->num_rx_desc; + info.num_tx_rings = na->num_tx_rings; + info.num_tx_descs = na->num_tx_desc; + info.num_rx_rings = na->num_rx_rings; + info.num_rx_descs = na->num_rx_desc; + info.rx_buf_maxsize = na->rx_buf_maxsize; } - if (na->num_tx_rings == txr && na->num_tx_desc == txd && - na->num_rx_rings == rxr && na->num_rx_desc == rxd) + if (na->num_tx_rings == info.num_tx_rings && + na->num_tx_desc == info.num_tx_descs && + na->num_rx_rings == info.num_rx_rings && + na->num_rx_desc == info.num_rx_descs && + na->rx_buf_maxsize == info.rx_buf_maxsize) return 0; /* nothing changed */ - if (netmap_verbose || na->active_fds > 0) { - D("stored config %s: txring %d x %d, rxring %d x %d", - na->name, - na->num_tx_rings, na->num_tx_desc, - na->num_rx_rings, na->num_rx_desc); - D("new config %s: txring %d x %d, rxring %d x %d", - na->name, txr, txd, rxr, rxd); - } if (na->active_fds == 0) { - D("configuration changed (but fine)"); - na->num_tx_rings = txr; - na->num_tx_desc = txd; - na->num_rx_rings = rxr; - na->num_rx_desc = rxd; + D("configuration changed for %s: txring %d x %d, " + "rxring %d x %d, rxbufsz %d", + na->name, na->num_tx_rings, na->num_tx_desc, + na->num_rx_rings, na->num_rx_desc, na->rx_buf_maxsize); + na->num_tx_rings = info.num_tx_rings; + na->num_tx_desc = info.num_tx_descs; + na->num_rx_rings = info.num_rx_rings; + na->num_rx_desc = info.num_rx_descs; + na->rx_buf_maxsize = info.rx_buf_maxsize; return 0; } - D("configuration changed while active, this is bad..."); + D("WARNING: configuration changed for %s while active: " + "txring %d x %d, rxring %d x %d, rxbufsz %d", + na->name, info.num_tx_rings, info.num_tx_descs, + info.num_rx_rings, info.num_rx_descs, + info.rx_buf_maxsize); return 1; } @@ -827,7 +830,9 @@ netmap_krings_create(struct netmap_adapter *na, u_int n[NR_TX] = na->num_tx_rings + 1; n[NR_RX] = na->num_rx_rings + 1; - len = (n[NR_TX] + n[NR_RX]) * sizeof(struct netmap_kring) + tailroom; + len = (n[NR_TX] + n[NR_RX]) * + (sizeof(struct netmap_kring) + sizeof(struct netmap_kring *)) + + tailroom; na->tx_rings = nm_os_malloc((size_t)len); if (na->tx_rings == NULL) { @@ -835,6 +840,14 @@ netmap_krings_create(struct netmap_adapter *na, u_int return ENOMEM; } na->rx_rings = na->tx_rings + n[NR_TX]; + na->tailroom = na->rx_rings + n[NR_RX]; + + /* link the krings in the krings array */ + kring = (struct netmap_kring *)((char *)na->tailroom + tailroom); + for (i = 0; i < n[NR_TX] + n[NR_RX]; i++) { + na->tx_rings[i] = kring; + kring++; + } /* * All fields in krings are 0 except the one initialized below. @@ -843,9 +856,10 @@ netmap_krings_create(struct netmap_adapter *na, u_int for_rx_tx(t) { ndesc = nma_get_ndesc(na, t); for (i = 0; i < n[t]; i++) { - kring = &NMR(na, t)[i]; + kring = NMR(na, t)[i]; bzero(kring, sizeof(*kring)); kring->na = na; + kring->notify_na = na; kring->ring_id = i; kring->tx = t; kring->nkr_num_slots = ndesc; @@ -854,6 +868,8 @@ netmap_krings_create(struct netmap_adapter *na, u_int if (i < nma_get_nrings(na, t)) { kring->nm_sync = (t == NR_TX ? na->nm_txsync : na->nm_rxsync); } else { + if (!(na->na_flags & NAF_HOST_RINGS)) + kring->nr_kflags |= NKR_FAKERING; kring->nm_sync = (t == NR_TX ? netmap_txsync_to_host: netmap_rxsync_from_host); @@ -874,7 +890,6 @@ netmap_krings_create(struct netmap_adapter *na, u_int nm_os_selinfo_init(&na->si[t]); } - na->tailroom = na->rx_rings + n[NR_RX]; return 0; } @@ -885,7 +900,7 @@ netmap_krings_create(struct netmap_adapter *na, u_int void netmap_krings_delete(struct netmap_adapter *na) { - struct netmap_kring *kring = na->tx_rings; + struct netmap_kring **kring = na->tx_rings; enum txrx t; if (na->tx_rings == NULL) { @@ -898,8 +913,8 @@ netmap_krings_delete(struct netmap_adapter *na) /* we rely on the krings layout described above */ for ( ; kring != na->tailroom; kring++) { - mtx_destroy(&kring->q_lock); - nm_os_selinfo_uninit(&kring->si); + mtx_destroy(&(*kring)->q_lock); + nm_os_selinfo_uninit(&(*kring)->si); } nm_os_free(na->tx_rings); na->tx_rings = na->rx_rings = na->tailroom = NULL; @@ -915,7 +930,7 @@ netmap_krings_delete(struct netmap_adapter *na) void netmap_hw_krings_delete(struct netmap_adapter *na) { - struct mbq *q = &na->rx_rings[na->num_rx_rings].rx_queue; + struct mbq *q = &na->rx_rings[na->num_rx_rings]->rx_queue; ND("destroy sw mbq with len %d", mbq_len(q)); mbq_purge(q); @@ -1196,7 +1211,7 @@ nm_may_forward_down(struct netmap_kring *kring, int sy static u_int netmap_sw_to_nic(struct netmap_adapter *na) { - struct netmap_kring *kring = &na->rx_rings[na->num_rx_rings]; + struct netmap_kring *kring = na->rx_rings[na->num_rx_rings]; struct netmap_slot *rxslot = kring->ring->slot; u_int i, rxcur = kring->nr_hwcur; u_int const head = kring->rhead; @@ -1205,7 +1220,7 @@ netmap_sw_to_nic(struct netmap_adapter *na) /* scan rings to find space, then fill as much as possible */ for (i = 0; i < na->num_tx_rings; i++) { - struct netmap_kring *kdst = &na->tx_rings[i]; + struct netmap_kring *kdst = na->tx_rings[i]; struct netmap_ring *rdst = kdst->ring; u_int const dst_lim = kdst->nkr_num_slots - 1; @@ -1443,7 +1458,7 @@ assign_mem: * MUST BE CALLED UNDER NMG_LOCK() * * Get a refcounted reference to a netmap adapter attached - * to the interface specified by nmr. + * to the interface specified by req. * This is always called in the execution of an ioctl(). * * Return ENXIO if the interface specified by the request does @@ -1453,13 +1468,15 @@ assign_mem: * could not be allocated. * If successful, hold a reference to the netmap adapter. * - * If the interface specified by nmr is a system one, also keep + * If the interface specified by req is a system one, also keep * a reference to it and return a valid *ifp. */ int -netmap_get_na(struct nmreq *nmr, struct netmap_adapter **na, - struct ifnet **ifp, struct netmap_mem_d *nmd, int create) +netmap_get_na(struct nmreq_header *hdr, + struct netmap_adapter **na, struct ifnet **ifp, + struct netmap_mem_d *nmd, int create) { + struct nmreq_register *req = (struct nmreq_register *)hdr->nr_body; int error = 0; struct netmap_adapter *ret = NULL; int nmd_ref = 0; @@ -1467,13 +1484,24 @@ netmap_get_na(struct nmreq *nmr, struct netmap_adapter *na = NULL; /* default return value */ *ifp = NULL; + if (hdr->nr_reqtype != NETMAP_REQ_REGISTER) { + return EINVAL; + } + + if (req->nr_mode == NR_REG_PIPE_MASTER || + req->nr_mode == NR_REG_PIPE_SLAVE) { + /* Do not accept deprecated pipe modes. */ + D("Deprecated pipe nr_mode, use xx{yy or xx}yy syntax"); + return EINVAL; + } + NMG_LOCK_ASSERT(); /* if the request contain a memid, try to find the * corresponding memory region */ - if (nmd == NULL && nmr->nr_arg2) { - nmd = netmap_mem_find(nmr->nr_arg2); + if (nmd == NULL && req->nr_mem_id) { + nmd = netmap_mem_find(req->nr_mem_id); if (nmd == NULL) return EINVAL; /* keep the rereference */ @@ -1492,22 +1520,22 @@ netmap_get_na(struct nmreq *nmr, struct netmap_adapter */ /* try to see if this is a ptnetmap port */ - error = netmap_get_pt_host_na(nmr, na, nmd, create); + error = netmap_get_pt_host_na(hdr, na, nmd, create); if (error || *na != NULL) goto out; /* try to see if this is a monitor port */ - error = netmap_get_monitor_na(nmr, na, nmd, create); + error = netmap_get_monitor_na(hdr, na, nmd, create); if (error || *na != NULL) goto out; /* try to see if this is a pipe port */ - error = netmap_get_pipe_na(nmr, na, nmd, create); + error = netmap_get_pipe_na(hdr, na, nmd, create); if (error || *na != NULL) goto out; /* try to see if this is a bridge port */ - error = netmap_get_bdg_na(nmr, na, nmd, create); + error = netmap_get_bdg_na(hdr, na, nmd, create); if (error) goto out; @@ -1520,7 +1548,7 @@ netmap_get_na(struct nmreq *nmr, struct netmap_adapter * This may still be a tap, a veth/epair, or even a * persistent VALE port. */ - *ifp = ifunit_ref(nmr->nr_name); + *ifp = ifunit_ref(hdr->nr_name); if (*ifp == NULL) { error = ENXIO; goto out; @@ -1765,42 +1793,27 @@ netmap_ring_reinit(struct netmap_kring *kring) * */ int -netmap_interp_ringid(struct netmap_priv_d *priv, uint16_t ringid, uint32_t flags) +netmap_interp_ringid(struct netmap_priv_d *priv, uint32_t nr_mode, + uint16_t nr_ringid, uint64_t nr_flags) { struct netmap_adapter *na = priv->np_na; - u_int j, i = ringid & NETMAP_RING_MASK; - u_int reg = flags & NR_REG_MASK; int excluded_direction[] = { NR_TX_RINGS_ONLY, NR_RX_RINGS_ONLY }; enum txrx t; + u_int j; - if (reg == NR_REG_DEFAULT) { - /* convert from old ringid to flags */ - if (ringid & NETMAP_SW_RING) { - reg = NR_REG_SW; - } else if (ringid & NETMAP_HW_RING) { - reg = NR_REG_ONE_NIC; - } else { - reg = NR_REG_ALL_NIC; - } - D("deprecated API, old ringid 0x%x -> ringid %x reg %d", ringid, i, reg); - } - - if ((flags & NR_PTNETMAP_HOST) && ((reg != NR_REG_ALL_NIC && - reg != NR_REG_PIPE_MASTER && reg != NR_REG_PIPE_SLAVE) || - flags & (NR_RX_RINGS_ONLY|NR_TX_RINGS_ONLY))) { + if ((nr_flags & NR_PTNETMAP_HOST) && ((nr_mode != NR_REG_ALL_NIC) || + nr_flags & (NR_RX_RINGS_ONLY|NR_TX_RINGS_ONLY))) { D("Error: only NR_REG_ALL_NIC supported with netmap passthrough"); return EINVAL; } for_rx_tx(t) { - if (flags & excluded_direction[t]) { + if (nr_flags & excluded_direction[t]) { priv->np_qfirst[t] = priv->np_qlast[t] = 0; continue; } - switch (reg) { + switch (nr_mode) { case NR_REG_ALL_NIC: - case NR_REG_PIPE_MASTER: - case NR_REG_PIPE_SLAVE: priv->np_qfirst[t] = 0; priv->np_qlast[t] = nma_get_nrings(na, t); ND("ALL/PIPE: %s %d %d", nm_txrx2str(t), @@ -1812,20 +1825,21 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint1 D("host rings not supported"); return EINVAL; } - priv->np_qfirst[t] = (reg == NR_REG_SW ? + priv->np_qfirst[t] = (nr_mode == NR_REG_SW ? nma_get_nrings(na, t) : 0); priv->np_qlast[t] = nma_get_nrings(na, t) + 1; - ND("%s: %s %d %d", reg == NR_REG_SW ? "SW" : "NIC+SW", + ND("%s: %s %d %d", nr_mode == NR_REG_SW ? "SW" : "NIC+SW", nm_txrx2str(t), priv->np_qfirst[t], priv->np_qlast[t]); break; case NR_REG_ONE_NIC: - if (i >= na->num_tx_rings && i >= na->num_rx_rings) { - D("invalid ring id %d", i); + if (nr_ringid >= na->num_tx_rings && + nr_ringid >= na->num_rx_rings) { + D("invalid ring id %d", nr_ringid); return EINVAL; } /* if not enough rings, use the first one */ - j = i; + j = nr_ringid; if (j >= nma_get_nrings(na, t)) j = 0; priv->np_qfirst[t] = j; @@ -1834,11 +1848,11 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint1 priv->np_qfirst[t], priv->np_qlast[t]); break; default: - D("invalid regif type %d", reg); + D("invalid regif type %d", nr_mode); return EINVAL; } } - priv->np_flags = (flags & ~NR_REG_MASK) | reg; + priv->np_flags = nr_flags | nr_mode; // TODO /* Allow transparent forwarding mode in the host --> nic * direction only if all the TX hw rings have been opened. */ @@ -1854,7 +1868,7 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint1 priv->np_qlast[NR_TX], priv->np_qfirst[NR_RX], priv->np_qlast[NR_RX], - i); + nr_ringid); } return 0; } @@ -1865,18 +1879,19 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint1 * for all rings is the same as a single ring. */ static int -netmap_set_ringid(struct netmap_priv_d *priv, uint16_t ringid, uint32_t flags) +netmap_set_ringid(struct netmap_priv_d *priv, uint32_t nr_mode, + uint16_t nr_ringid, uint64_t nr_flags) { struct netmap_adapter *na = priv->np_na; int error; enum txrx t; - error = netmap_interp_ringid(priv, ringid, flags); + error = netmap_interp_ringid(priv, nr_mode, nr_ringid, nr_flags); if (error) { return error; } - priv->np_txpoll = (ringid & NETMAP_NO_TX_POLL) ? 0 : 1; + priv->np_txpoll = (nr_flags & NR_NO_TX_POLL) ? 0 : 1; /* optimization: count the users registered for more than * one ring, which are the ones sleeping on the global queue. @@ -1933,7 +1948,7 @@ netmap_krings_get(struct netmap_priv_d *priv) */ for_rx_tx(t) { for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { - kring = &NMR(na, t)[i]; + kring = NMR(na, t)[i]; if ((kring->nr_kflags & NKR_EXCLUSIVE) || (kring->users && excl)) { @@ -1948,7 +1963,7 @@ netmap_krings_get(struct netmap_priv_d *priv) */ for_rx_tx(t) { for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { - kring = &NMR(na, t)[i]; + kring = NMR(na, t)[i]; kring->users++; if (excl) kring->nr_kflags |= NKR_EXCLUSIVE; @@ -1979,10 +1994,9 @@ netmap_krings_put(struct netmap_priv_d *priv) priv->np_qfirst[NR_RX], priv->np_qlast[MR_RX]); - for_rx_tx(t) { for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { - kring = &NMR(na, t)[i]; + kring = NMR(na, t)[i]; if (excl) kring->nr_kflags &= ~NKR_EXCLUSIVE; kring->users--; @@ -1992,6 +2006,12 @@ netmap_krings_put(struct netmap_priv_d *priv) } } +static int +nm_priv_rx_enabled(struct netmap_priv_d *priv) +{ + return (priv->np_qfirst[NR_RX] != priv->np_qlast[NR_RX]); +} + /* * possibly move the interface to netmap-mode. * If success it returns a pointer to netmap_if, otherwise NULL. @@ -2064,16 +2084,14 @@ netmap_krings_put(struct netmap_priv_d *priv) */ int netmap_do_regif(struct netmap_priv_d *priv, struct netmap_adapter *na, - uint16_t ringid, uint32_t flags) + uint32_t nr_mode, uint16_t nr_ringid, uint64_t nr_flags) { struct netmap_if *nifp = NULL; int error; NMG_LOCK_ASSERT(); - /* ring configuration may have changed, fetch from the card */ - netmap_update_config(na); priv->np_na = na; /* store the reference */ - error = netmap_set_ringid(priv, ringid, flags); + error = netmap_set_ringid(priv, nr_mode, nr_ringid, nr_flags); if (error) goto err; error = netmap_mem_finalize(na->nm_mem, na); @@ -2081,27 +2099,38 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net goto err; if (na->active_fds == 0) { + + /* cache the allocator info in the na */ + error = netmap_mem_get_lut(na->nm_mem, &na->na_lut); + if (error) + goto err_drop_mem; + ND("lut %p bufs %u size %u", na->na_lut.lut, na->na_lut.objtotal, + na->na_lut.objsize); + + /* ring configuration may have changed, fetch from the card */ + netmap_update_config(na); + /* * If this is the first registration of the adapter, * perform sanity checks and create the in-kernel view * of the netmap rings (the netmap krings). */ - if (na->ifp) { + if (na->ifp && nm_priv_rx_enabled(priv)) { /* This netmap adapter is attached to an ifnet. */ unsigned nbs = netmap_mem_bufsize(na->nm_mem); unsigned mtu = nm_os_ifnet_mtu(na->ifp); - /* The maximum amount of bytes that a single - * receive or transmit NIC descriptor can hold. */ - unsigned hw_max_slot_len = 4096; - if (mtu <= hw_max_slot_len) { + ND("mtu %d rx_buf_maxsize %d netmap_buf_size %d", + mtu, na->rx_buf_maxsize, nbs); + + if (mtu <= na->rx_buf_maxsize) { /* The MTU fits a single NIC slot. We only * Need to check that netmap buffers are * large enough to hold an MTU. NS_MOREFRAG * cannot be used in this case. */ if (nbs < mtu) { nm_prerr("error: netmap buf size (%u) " - "< device MTU (%u)", nbs, mtu); + "< device MTU (%u)\n", nbs, mtu); error = EINVAL; goto err_drop_mem; } @@ -2114,22 +2143,22 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net if (!(na->na_flags & NAF_MOREFRAG)) { nm_prerr("error: large MTU (%d) needed " "but %s does not support " - "NS_MOREFRAG", mtu, + "NS_MOREFRAG\n", mtu, na->ifp->if_xname); error = EINVAL; goto err_drop_mem; - } else if (nbs < hw_max_slot_len) { + } else if (nbs < na->rx_buf_maxsize) { nm_prerr("error: using NS_MOREFRAG on " "%s requires netmap buf size " - ">= %u", na->ifp->if_xname, - hw_max_slot_len); + ">= %u\n", na->ifp->if_xname, + na->rx_buf_maxsize); error = EINVAL; goto err_drop_mem; } else { nm_prinf("info: netmap application on " "%s needs to support " "NS_MOREFRAG " - "(MTU=%u,netmap_buf_size=%u)", + "(MTU=%u,netmap_buf_size=%u)\n", na->ifp->if_xname, mtu, nbs); } } @@ -2141,7 +2170,7 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net */ error = na->nm_krings_create(na); if (error) - goto err_drop_mem; + goto err_put_lut; } @@ -2165,21 +2194,12 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net goto err_del_rings; } - if (na->active_fds == 0) { - /* cache the allocator info in the na */ - error = netmap_mem_get_lut(na->nm_mem, &na->na_lut); - if (error) - goto err_del_if; - ND("lut %p bufs %u size %u", na->na_lut.lut, na->na_lut.objtotal, - na->na_lut.objsize); - } - if (nm_kring_pending(priv)) { /* Some kring is switching mode, tell the adapter to * react on this. */ error = na->nm_register(na, 1); if (error) - goto err_put_lut; + goto err_del_if; } /* Commit the reference. */ @@ -2195,9 +2215,6 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net return 0; -err_put_lut: - if (na->active_fds == 0) - memset(&na->na_lut, 0, sizeof(na->na_lut)); err_del_if: netmap_mem_if_delete(na, nifp); err_del_rings: @@ -2207,6 +2224,9 @@ err_rel_excl: err_del_krings: if (na->active_fds == 0) na->nm_krings_delete(na); +err_put_lut: + if (na->active_fds == 0) + memset(&na->na_lut, 0, sizeof(na->na_lut)); err_drop_mem: netmap_mem_drop(na); err: @@ -2242,246 +2262,367 @@ ring_timestamp_set(struct netmap_ring *ring) } } +static int nmreq_copyin(struct nmreq_header *, int); +static int nmreq_copyout(struct nmreq_header *, int); +static int nmreq_checkoptions(struct nmreq_header *); /* * ioctl(2) support for the "netmap" device. * * Following a list of accepted commands: - * - NIOCGINFO + * - NIOCCTRL device control API + * - NIOCTXSYNC sync TX rings + * - NIOCRXSYNC sync RX rings * - SIOCGIFADDR just for convenience - * - NIOCREGIF - * - NIOCTXSYNC - * - NIOCRXSYNC + * - NIOCGINFO deprecated (legacy API) + * - NIOCREGIF deprecated (legacy API) * * Return 0 on success, errno otherwise. */ int -netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data, struct thread *td) +netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data, + struct thread *td, int nr_body_is_user) { struct mbq q; /* packets from RX hw queues to host stack */ - struct nmreq *nmr = (struct nmreq *) data; struct netmap_adapter *na = NULL; struct netmap_mem_d *nmd = NULL; struct ifnet *ifp = NULL; int error = 0; u_int i, qfirst, qlast; struct netmap_if *nifp; - struct netmap_kring *krings; + struct netmap_kring **krings; int sync_flags; enum txrx t; - if (cmd == NIOCGINFO || cmd == NIOCREGIF) { - /* truncate name */ - nmr->nr_name[sizeof(nmr->nr_name) - 1] = '\0'; - if (nmr->nr_version != NETMAP_API) { - D("API mismatch for %s got %d need %d", - nmr->nr_name, - nmr->nr_version, NETMAP_API); - nmr->nr_version = NETMAP_API; + switch (cmd) { + case NIOCCTRL: { + struct nmreq_header *hdr = (struct nmreq_header *)data; + + if (hdr->nr_version != NETMAP_API) { + D("API mismatch for reqtype %d: got %d need %d", + hdr->nr_version, + hdr->nr_version, NETMAP_API); + hdr->nr_version = NETMAP_API; } - if (nmr->nr_version < NETMAP_MIN_API || - nmr->nr_version > NETMAP_MAX_API) { + if (hdr->nr_version < NETMAP_MIN_API || + hdr->nr_version > NETMAP_MAX_API) { return EINVAL; } - } - switch (cmd) { - case NIOCGINFO: /* return capabilities etc */ - if (nmr->nr_cmd == NETMAP_BDG_LIST) { - error = netmap_bdg_ctl(nmr, NULL); - break; + /* Make a kernel-space copy of the user-space nr_body. + * For convenince, the nr_body pointer and the pointers + * in the options list will be replaced with their + * kernel-space counterparts. The original pointers are + * saved internally and later restored by nmreq_copyout + */ + error = nmreq_copyin(hdr, nr_body_is_user); + if (error) { + return error; } - NMG_LOCK(); - do { - /* memsize is always valid */ - u_int memflags; - uint64_t memsize; + /* Sanitize hdr->nr_name. */ + hdr->nr_name[sizeof(hdr->nr_name) - 1] = '\0'; - if (nmr->nr_name[0] != '\0') { + switch (hdr->nr_reqtype) { + case NETMAP_REQ_REGISTER: { + struct nmreq_register *req = + (struct nmreq_register *)hdr->nr_body; + /* Protect access to priv from concurrent requests. */ + NMG_LOCK(); + do { + u_int memflags; +#ifdef WITH_EXTMEM + struct nmreq_option *opt; +#endif /* WITH_EXTMEM */ - /* get a refcount */ - error = netmap_get_na(nmr, &na, &ifp, NULL, 1 /* create */); + if (priv->np_nifp != NULL) { /* thread already registered */ + error = EBUSY; + break; + } + +#ifdef WITH_EXTMEM + opt = nmreq_findoption((struct nmreq_option *)hdr->nr_options, + NETMAP_REQ_OPT_EXTMEM); + if (opt != NULL) { + struct nmreq_opt_extmem *e = + (struct nmreq_opt_extmem *)opt; + + error = nmreq_checkduplicate(opt); + if (error) { + opt->nro_status = error; + break; + } + nmd = netmap_mem_ext_create(e->nro_usrptr, + &e->nro_info, &error); + opt->nro_status = error; + if (nmd == NULL) + break; + } +#endif /* WITH_EXTMEM */ + + if (nmd == NULL && req->nr_mem_id) { + /* find the allocator and get a reference */ + nmd = netmap_mem_find(req->nr_mem_id); + if (nmd == NULL) { + error = EINVAL; + break; + } + } + /* find the interface and a reference */ + error = netmap_get_na(hdr, &na, &ifp, nmd, + 1 /* create */); /* keep reference */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Apr 12 07:25:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98AC4F9C341; Thu, 12 Apr 2018 07:25:37 +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 4B4896AF4B; Thu, 12 Apr 2018 07:25:37 +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 448CC27E1F; Thu, 12 Apr 2018 07:25:37 +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 w3C7PbaL037263; Thu, 12 Apr 2018 07:25:37 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3C7PboR037262; Thu, 12 Apr 2018 07:25:37 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201804120725.w3C7PboR037262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Thu, 12 Apr 2018 07:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332424 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 332424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 07:25:37 -0000 Author: thj Date: Thu Apr 12 07:25:36 2018 New Revision: 332424 URL: https://svnweb.freebsd.org/changeset/base/332424 Log: Add myself to committers-src.dot Approved by: jtl (mentor) Differential Revision: https://reviews.freebsd.org/D15042 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Apr 12 07:20:50 2018 (r332423) +++ head/share/misc/committers-src.dot Thu Apr 12 07:25:36 2018 (r332424) @@ -328,6 +328,7 @@ suz [label="SUZUKI Shinsuke\nsuz@FreeBSD.org\n2002/03/ syrinx [label="Shteryana Shopova\nsyrinx@FreeBSD.org\n2006/10/07"] takawata [label="Takanori Watanabe\ntakawata@FreeBSD.org\n2000/07/06"] theraven [label="David Chisnall\ntheraven@FreeBSD.org\n2011/11/11"] +thj [label="Tom Jones\nthj@FreeBSD.org\n2018/04/07"] thompsa [label="Andrew Thompson\nthompsa@FreeBSD.org\n2005/05/25"] ticso [label="Bernd Walter\nticso@FreeBSD.org\n2002/01/31"] tijl [label="Tijl Coosemans\ntijl@FreeBSD.org\n2010/07/16"] @@ -618,6 +619,8 @@ joerg -> jmg joerg -> le joerg -> netchild joerg -> schweikh + +jtl -> thj julian -> glebius julian -> davidxu From owner-svn-src-all@freebsd.org Thu Apr 12 07:39:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D31AF9D8C5; Thu, 12 Apr 2018 07:39:25 +0000 (UTC) (envelope-from maxim@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 40AAD6F561; Thu, 12 Apr 2018 07:39:25 +0000 (UTC) (envelope-from maxim@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 3BAB427FF0; Thu, 12 Apr 2018 07:39:25 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3C7dPkZ042379; Thu, 12 Apr 2018 07:39:25 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3C7dPQs042378; Thu, 12 Apr 2018 07:39:25 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201804120739.w3C7dPQs042378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Thu, 12 Apr 2018 07:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332425 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: maxim X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 332425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 07:39:25 -0000 Author: maxim Date: Thu Apr 12 07:39:24 2018 New Revision: 332425 URL: https://svnweb.freebsd.org/changeset/base/332425 Log: o OpenBSD 6.3 and DragonFly BSD 5.2.0 releases added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Thu Apr 12 07:25:36 2018 (r332424) +++ head/share/misc/bsd-family-tree Thu Apr 12 07:39:24 2018 (r332425) @@ -367,6 +367,8 @@ FreeBSD 5.2 | | | | | | | | | | | | | | NetBSD 7.1.2 | | | | | | | | | + | | | | | OpenBSD 6.3 | + | | | | | | DragonFly 5.2.0 | | | | v | | | v | | | | | | | | | @@ -739,6 +741,8 @@ DragonFly 5.0.1 2017-11-06 [DFB] DragonFly 5.0.2 2017-12-04 [DFB] NetBSD 7.1.1 2017-12-22 [NBD] NetBSD 7.1.2 2018-03-15 [NBD] +OpenBSD 6.3 2018-04-02 [OBD] +DragonFly 5.2.0 2018-04-10 [DFB] Bibliography ------------------------ From owner-svn-src-all@freebsd.org Thu Apr 12 10:37:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 746A9F87BB9; Thu, 12 Apr 2018 10:37:27 +0000 (UTC) (envelope-from avg@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 1B8917A649; Thu, 12 Apr 2018 10:37:27 +0000 (UTC) (envelope-from avg@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 143621E5F; Thu, 12 Apr 2018 10:37:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CAbRJi033434; Thu, 12 Apr 2018 10:37:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CAbQca033427; Thu, 12 Apr 2018 10:37:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804121037.w3CAbQca033427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 12 Apr 2018 10:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332426 - in head: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs s... X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolar... X-SVN-Commit-Revision: 332426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 10:37:27 -0000 Author: avg Date: Thu Apr 12 10:37:26 2018 New Revision: 332426 URL: https://svnweb.freebsd.org/changeset/base/332426 Log: allow ZFS pool to have temporary name for duration of current import The change adds -t option to zpool create and -t option to zpool import in its form with an old name and a new name. This allows to import (or create) a pool under a name that's different from its real, permanent name without affecting that name. This is useful when working with VM images or images of other physical systems if they happen to have a ZFS pool with the same name as the host system. The changes come from ZoL with some small tweaks. The porting has been done by julian. The change is being submitted to OpenZFS: https://github.com/openzfs/openzfs/pull/600 Submitted by: julian Reviewed by: smh MFC after: 2 weeks Sponsored by: Panzura (porting) Differential Revision: https://reviews.freebsd.org/D14972 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Apr 12 07:39:24 2018 (r332425) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Apr 12 10:37:26 2018 (r332426) @@ -62,6 +62,7 @@ .Ar ... .Op Fl m Ar mountpoint .Op Fl R Ar root +.Op Fl t Ar tempname .Ar pool vdev ... .Nm .Cm destroy @@ -115,6 +116,7 @@ .Op Fl m .Op Fl N .Op Fl R Ar root +.Op Fl t .Op Fl F Op Fl n .Ar pool | id .Op Ar newpool @@ -961,6 +963,7 @@ do not actually discard any transactions. .Ar ... .Op Fl m Ar mountpoint .Op Fl R Ar root +.Op Fl t Ar tempname .Ar pool vdev ... .Xc .Pp @@ -1062,6 +1065,18 @@ or .Qq Cm none . For more information on dataset mount points, see .Xr zfs 8 . +.It Fl t Ar tempname +Sets the in-core pool name to +.Pa tempname +while the on-disk name will be the name specified as the pool name +.Pa pool . +This will set the default +.Sy cachefile +property to +.Sy none . +This is intended to handle name space collisions when creating pools +for other systems, such as virtual machines or physical machines +whose pools live on network block devices. .El .It Xo .Nm @@ -1316,6 +1331,7 @@ Searches for and imports all pools found. .Op Fl m .Op Fl N .Op Fl R Ar root +.Op Fl t .Op Fl F Op Fl n .Ar pool | id .Op Ar newpool @@ -1375,6 +1391,20 @@ Import the pool without mounting any file systems. .It Fl R Ar root Equivalent to .Qq Fl o Cm cachefile=none,altroot= Ns Pa root +.It Fl t +Used with +.Ar newpool . +Specifies that +.Ar newpool +is temporary. +Temporary pool names last until export. +Ensures that the original pool name will be used in all label updates and +therefore is retained upon export. +Will also set +.Sy cachefile +property to +.Sy none +when not explicitly specified. .It Fl F Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Apr 12 07:39:24 2018 (r332425) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Apr 12 10:37:26 2018 (r332426) @@ -220,8 +220,9 @@ get_usage(zpool_help_t idx) case HELP_CREATE: return (gettext("\tcreate [-fnd] [-B] " "[-o property=value] ... \n" - "\t [-O file-system-property=value] ... \n" - "\t [-m mountpoint] [-R root] ...\n")); + "\t [-O file-system-property=value] ...\n" + "\t [-m mountpoint] [-R root] [-t tempname] " + " ...\n")); case HELP_CHECKPOINT: return (gettext("\tcheckpoint [--discard] ...\n")); case HELP_DESTROY: @@ -239,7 +240,7 @@ get_usage(zpool_help_t idx) "[-R root] [-F [-n]] -a\n" "\timport [-o mntopts] [-o property=value] ... \n" "\t [-d dir | -c cachefile] [-D] [-f] [-m] [-N] " - "[-R root] [-F [-n]]\n" + "[-R root] [-F [-n]] [-t]\n" "\t [--rewind-to-checkpoint] [newpool]\n")); case HELP_IOSTAT: return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval " @@ -489,6 +490,21 @@ add_prop_list(const char *propname, char *propval, nvl } /* + * Set a default property pair (name, string-value) in a property nvlist + */ +static int +add_prop_list_default(const char *propname, char *propval, nvlist_t **props, + boolean_t poolprop) +{ + char *pval; + + if (nvlist_lookup_string(*props, propname, &pval) == 0) + return (0); + + return (add_prop_list(propname, propval, props, poolprop)); +} + +/* * zpool add [-fn] ... * * -f Force addition of devices, even if they appear in use @@ -850,15 +866,16 @@ errout: /* * zpool create [-fnd] [-B] [-o property=value] ... * [-O file-system-property=value] ... - * [-R root] [-m mountpoint] ... + * [-R root] [-m mountpoint] [-t tempname] ... * * -B Create boot partition. * -f Force creation, even if devices appear in use * -n Do not create the pool, but display the resulting layout if it * were to be created. - * -R Create a pool under an alternate root - * -m Set default mountpoint for the root dataset. By default it's + * -R Create a pool under an alternate root + * -m Set default mountpoint for the root dataset. By default it's * '/' + * -t Use the temporary name until the pool is exported. * -o Set property=value. * -d Don't automatically enable all supported pool features * (individual features can be enabled with -o). @@ -882,6 +899,7 @@ zpool_do_create(int argc, char **argv) int c; nvlist_t *nvroot = NULL; char *poolname; + char *tname = NULL; int ret = 1; char *altroot = NULL; char *mountpoint = NULL; @@ -890,7 +908,7 @@ zpool_do_create(int argc, char **argv) char *propval; /* check options */ - while ((c = getopt(argc, argv, ":fndBR:m:o:O:")) != -1) { + while ((c = getopt(argc, argv, ":fndBR:m:o:O:t:")) != -1) { switch (c) { case 'f': force = B_TRUE; @@ -922,11 +940,7 @@ zpool_do_create(int argc, char **argv) if (add_prop_list(zpool_prop_to_name( ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE)) goto errout; - if (nvlist_lookup_string(props, - zpool_prop_to_name(ZPOOL_PROP_CACHEFILE), - &propval) == 0) - break; - if (add_prop_list(zpool_prop_to_name( + if (add_prop_list_default(zpool_prop_to_name( ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) goto errout; break; @@ -999,6 +1013,27 @@ zpool_do_create(int argc, char **argv) goto errout; } break; + case 't': + /* + * Sanity check temporary pool name. + */ + if (strchr(optarg, '/') != NULL) { + (void) fprintf(stderr, gettext("cannot create " + "'%s': invalid character '/' in temporary " + "name\n"), optarg); + (void) fprintf(stderr, gettext("use 'zfs " + "create' to create a dataset\n")); + goto errout; + } + + if (add_prop_list(zpool_prop_to_name( + ZPOOL_PROP_TNAME), optarg, &props, B_TRUE)) + goto errout; + if (add_prop_list_default(zpool_prop_to_name( + ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + goto errout; + tname = optarg; + break; case ':': (void) fprintf(stderr, gettext("missing argument for " "'%c' option\n"), optopt); @@ -1205,8 +1240,8 @@ zpool_do_create(int argc, char **argv) ret = 1; if (zpool_create(g_zfs, poolname, nvroot, props, fsprops) == 0) { - zfs_handle_t *pool = zfs_open(g_zfs, poolname, - ZFS_TYPE_FILESYSTEM); + zfs_handle_t *pool = zfs_open(g_zfs, + tname ? tname : poolname, ZFS_TYPE_FILESYSTEM); if (pool != NULL) { if (zfs_mount(pool, NULL, 0) == 0) ret = zfs_shareall(pool); @@ -2162,7 +2197,8 @@ zpool_do_checkpoint(int argc, char **argv) * import [-o mntopts] [-o prop=value] ... [-R root] [-D] * [-d dir | -c cachefile] [-f] -a * import [-o mntopts] [-o prop=value] ... [-R root] [-D] - * [-d dir | -c cachefile] [-f] [-n] [-F] [newpool] + * [-d dir | -c cachefile] [-f] [-n] [-F] [-t] + * [newpool] * * -c Read pool information from a cachefile instead of searching * devices. @@ -2191,6 +2227,9 @@ zpool_do_checkpoint(int argc, char **argv) * * -N Import the pool but don't mount datasets. * + * -t Use newpool as a temporary pool name instead of renaming + * the pool. + * * -T Specify a starting txg to use for import. This option is * intentionally undocumented option for testing purposes. * @@ -2241,7 +2280,7 @@ zpool_do_import(int argc, char **argv) }; /* check options */ - while ((c = getopt_long(argc, argv, ":aCc:d:DEfFmnNo:rR:T:VX", + while ((c = getopt_long(argc, argv, ":aCc:d:DEfFmnNo:rR:tT:VX", long_options, NULL)) != -1) { switch (c) { case 'a': @@ -2296,14 +2335,16 @@ zpool_do_import(int argc, char **argv) if (add_prop_list(zpool_prop_to_name( ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE)) goto error; - if (nvlist_lookup_string(props, - zpool_prop_to_name(ZPOOL_PROP_CACHEFILE), - &propval) == 0) - break; - if (add_prop_list(zpool_prop_to_name( + if (add_prop_list_default(zpool_prop_to_name( ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) goto error; break; + case 't': + flags |= ZFS_IMPORT_TEMP_NAME; + if (add_prop_list_default(zpool_prop_to_name( + ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + goto error; + break; case 'T': errno = 0; txg = strtoull(optarg, &endptr, 0); @@ -2439,9 +2480,9 @@ zpool_do_import(int argc, char **argv) (void) fprintf(stderr, gettext("cannot import '%s': " "a pool with that name already exists\n"), argv[0]); - (void) fprintf(stderr, gettext("use the form '%s " - " ' to give it a new name\n"), - "zpool import"); + (void) fprintf(stderr, gettext("use the form 'zpool import " + "[-t] ' to give it a new temporary " + "or permanent name\n")); err = 1; } else if (pools == NULL && idata.exists) { (void) fprintf(stderr, gettext("cannot import '%s': " Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Apr 12 07:39:24 2018 (r332425) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Apr 12 10:37:26 2018 (r332426) @@ -644,11 +644,22 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char goto error; } break; + case ZPOOL_PROP_READONLY: if (!flags.import) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "property '%s' can only be set at " "import time"), propname); + (void) zfs_error(hdl, EZFS_BADPROP, errbuf); + goto error; + } + break; + + case ZPOOL_PROP_TNAME: + if (!flags.create) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "property '%s' can only be set at " + "creation time"), propname); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; } Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Thu Apr 12 07:39:24 2018 (r332425) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Thu Apr 12 10:37:26 2018 (r332426) @@ -136,6 +136,8 @@ zpool_prop_init(void) PROP_READONLY, ZFS_TYPE_POOL, "NAME"); zprop_register_hidden(ZPOOL_PROP_MAXBLOCKSIZE, "maxblocksize", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_POOL, "MAXBLOCKSIZE"); + zprop_register_hidden(ZPOOL_PROP_TNAME, "tname", PROP_TYPE_STRING, + PROP_ONETIME, ZFS_TYPE_POOL, "TNAME"); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Apr 12 07:39:24 2018 (r332425) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Apr 12 10:37:26 2018 (r332426) @@ -4666,12 +4666,18 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_ uint_t nspares, nl2cache; uint64_t version, obj; boolean_t has_features; + char *poolname; + nvlist_t *nvl; + if (nvlist_lookup_string(props, + zpool_prop_to_name(ZPOOL_PROP_TNAME), &poolname) != 0) + poolname = (char *)pool; + /* * If this pool already exists, return failure. */ mutex_enter(&spa_namespace_lock); - if (spa_lookup(pool) != NULL) { + if (spa_lookup(poolname) != NULL) { mutex_exit(&spa_namespace_lock); return (SET_ERROR(EEXIST)); } @@ -4679,9 +4685,12 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_ /* * Allocate a new spa_t structure. */ + nvl = fnvlist_alloc(); + fnvlist_add_string(nvl, ZPOOL_CONFIG_POOL_NAME, pool); (void) nvlist_lookup_string(props, zpool_prop_to_name(ZPOOL_PROP_ALTROOT), &altroot); - spa = spa_add(pool, NULL, altroot); + spa = spa_add(poolname, nvl, altroot); + fnvlist_free(nvl); spa_activate(spa, spa_mode_global); if (props && (error = spa_prop_validate(spa, props))) { @@ -4690,6 +4699,12 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_ mutex_exit(&spa_namespace_lock); return (error); } + + /* + * Temporary pool names should never be written to disk. + */ + if (poolname != pool) + spa->spa_import_flags |= ZFS_IMPORT_TEMP_NAME; has_features = B_FALSE; for (nvpair_t *elem = nvlist_next_nvpair(props, NULL); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Thu Apr 12 07:39:24 2018 (r332425) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Thu Apr 12 10:37:26 2018 (r332426) @@ -226,6 +226,7 @@ spa_write_cachefile(spa_t *target, boolean_t removing, nvlist_t *nvl; boolean_t ccw_failure; int error; + char *pool_name; ASSERT(MUTEX_HELD(&spa_namespace_lock)); @@ -274,11 +275,18 @@ spa_write_cachefile(spa_t *target, boolean_t removing, if (nvl == NULL) nvl = fnvlist_alloc(); - fnvlist_add_nvlist(nvl, spa->spa_name, + if (spa->spa_import_flags & ZFS_IMPORT_TEMP_NAME) { + pool_name = fnvlist_lookup_string(spa->spa_config, + ZPOOL_CONFIG_POOL_NAME); + } else { + pool_name = spa_name(spa); + } + + fnvlist_add_nvlist(nvl, pool_name, spa->spa_config); mutex_exit(&spa->spa_props_lock); - if (nvlist_lookup_nvlist(nvl, spa->spa_name, &nvroot) == 0) + if (nvlist_lookup_nvlist(nvl, pool_name, &nvroot) == 0) spa_config_clean(nvroot); } @@ -382,6 +390,7 @@ spa_config_generate(spa_t *spa, vdev_t *vd, uint64_t t unsigned long hostid = 0; boolean_t locked = B_FALSE; uint64_t split_guid; + char *pool_name; if (vd == NULL) { vd = rvd; @@ -398,10 +407,27 @@ spa_config_generate(spa_t *spa, vdev_t *vd, uint64_t t if (txg == -1ULL) txg = spa->spa_config_txg; + /* + * Originally, users had to handle spa namespace collisions by either + * exporting the already imported pool or by specifying a new name for + * the pool with a conflicting name. In the case of root pools from + * virtual guests, neither approach to collision resolution is + * reasonable. This is addressed by extending the new name syntax with + * an option to specify that the new name is temporary. When specified, + * ZFS_IMPORT_TEMP_NAME will be set in spa->spa_import_flags to tell us + * to use the previous name, which we do below. + */ + if (spa->spa_import_flags & ZFS_IMPORT_TEMP_NAME) { + pool_name = fnvlist_lookup_string(spa->spa_config, + ZPOOL_CONFIG_POOL_NAME); + } else { + pool_name = spa_name(spa); + } + config = fnvlist_alloc(); fnvlist_add_uint64(config, ZPOOL_CONFIG_VERSION, spa_version(spa)); - fnvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, spa_name(spa)); + fnvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, pool_name); fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE, spa_state(spa)); fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG, txg); fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID, spa_guid(spa)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu Apr 12 07:39:24 2018 (r332425) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu Apr 12 10:37:26 2018 (r332426) @@ -214,6 +214,7 @@ typedef enum { ZPOOL_PROP_MAXBLOCKSIZE, ZPOOL_PROP_BOOTSIZE, ZPOOL_PROP_CHECKPOINT, + ZPOOL_PROP_TNAME, ZPOOL_NUM_PROPS } zpool_prop_t; @@ -1047,6 +1048,7 @@ typedef enum { #define ZFS_IMPORT_MISSING_LOG 0x4 #define ZFS_IMPORT_ONLY 0x8 #define ZFS_IMPORT_CHECKPOINT 0x10 +#define ZFS_IMPORT_TEMP_NAME 0x20 /* * Channel program argument/return nvlist keys and defaults. From owner-svn-src-all@freebsd.org Thu Apr 12 10:50:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E547F89265 for ; Thu, 12 Apr 2018 10:50:56 +0000 (UTC) (envelope-from ram.vegesna@broadcom.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD767E9A0 for ; Thu, 12 Apr 2018 10:50:56 +0000 (UTC) (envelope-from ram.vegesna@broadcom.com) Received: by mail-lf0-x22c.google.com with SMTP id x70-v6so7022456lfa.0 for ; Thu, 12 Apr 2018 03:50:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pXGCaCfGA+Ommy5ZGatqT/F2lTqllrIrZODeXim7588=; b=Ftdhc0bXuYhLxt5QpWOEp8XBZMnJS7NzrB+icw8ZMVk1NUvdE85TNV6F3KV4z9kyCr kv5f3tfE2LugH/HzeKF6mQOAjVEFswBejzQrxCRKpEi1BQBg4OO1XUpp7UtfGDopDN54 Ff3K9Y+iBBVb6d/R0wAVWtrpd6e9CIMdKTgoGlJYjPtjW9p8qPLV99jMMWf8ZqsVnmu+ TT6056gIOUp4vfrCg5aAGigltbfYYmN0XmqoU5Pw/mUPHDjTvb8GXjLBDtcZkxYUOvT0 M7UTBbptXYjvccqlEz3VJywPBy4wNhKuyBlU4qhOMQ7iZBFJMK7/afF03y5/DZYbEz23 oHGQ== X-Gm-Message-State: ALQs6tCSQpvA4A8UYXYCdqHwjvCFBYt/gUd31FgTURyyaoltCR6gQVex 1+3GcNTQV6lt8tA39DTiDSgCtuHkNb2YZ++Y3wEG2Q== X-Google-Smtp-Source: AIpwx48T7GnngMiYJC7jtjcgluajZL3KkjnprlR8yqiG49OPTnO99kw+zLlzIeJRbDd3adZkOtSF9wquM0gWbW3v344= X-Received: by 10.46.108.3 with SMTP id h3mr335121ljc.30.1523530254395; Thu, 12 Apr 2018 03:50:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.134.205 with HTTP; Thu, 12 Apr 2018 03:50:53 -0700 (PDT) In-Reply-To: <20180411142720.GB36126@mithlond.kdm.org> References: <201804101839.w3AIdKZk026212@repo.freebsd.org> <201804101922.w3AJMvSL024594@pdx.rh.CN85.dnsmgr.net> <20180411142720.GB36126@mithlond.kdm.org> From: Ram Kishore Vegesna Date: Thu, 12 Apr 2018 16:20:53 +0530 Message-ID: Subject: Re: svn commit: r332386 - head/share/misc To: "Kenneth D. Merry" Cc: Kyle Evans , Ram Kishore Vegesna , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 10:50:57 -0000 oho, my bad added to the wrong section. Will fix and update. Ken, I will send you the patch. Thanks, Ram On Wed, Apr 11, 2018 at 7:57 PM, Kenneth D. Merry wrote: > On Tue, Apr 10, 2018 at 14:27:26 -0500, Kyle Evans wrote: > > On Tue, Apr 10, 2018 at 2:22 PM, Rodney W. Grimes > > wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > >> Author: ram > > >> Date: Tue Apr 10 18:39:20 2018 > > >> New Revision: 332386 > > >> URL: https://svnweb.freebsd.org/changeset/base/332386 > > >> > > >> Log: > > >> Updated mentors information. > > >> > > >> Approved by: ken, mav > > >> > > >> Modified: > > >> head/share/misc/committers-src.dot > > >> > > >> Modified: head/share/misc/committers-src.dot > > >> ============================================================ > ================== > > >> --- head/share/misc/committers-src.dot Tue Apr 10 18:05:02 > 2018 (r332385) > > >> +++ head/share/misc/committers-src.dot Tue Apr 10 18:39:20 > 2018 (r332386) > > >> @@ -76,6 +76,7 @@ nate [label="Nate Willams\nnate@FreeBSD.org\ > n1993/06/1 > > >> njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07\n2008/02/16"] > > >> non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\ > n2000/06/19\n2007/03/06"] > > >> onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/ > 07/21\n2008/11/10"] > > >> +ram [label="Ram Kishore Vegesna\nram@FreeBSD.org\ > n2018/04/04\n???/??/??"] > > > > ^^^^^^^^^ > > > That should be removed, you only have a start date. > > > Oh and Welcome ram to the project! > > > > > > > The entry is also smack dab in the middle of the alumni section, > > rather than the later 'active' section. =) > > Oops. My fault for not paying attention. :( > > Pointy hat to: ken > > Ram, could you fix this and send me the diffs for approval before you > commit it? > > Thanks, > > Ken > -- > Kenneth Merry > ken@FreeBSD.ORG > From owner-svn-src-all@freebsd.org Thu Apr 12 13:39:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B853F960FE; Thu, 12 Apr 2018 13:39: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 BD03368BBA; Thu, 12 Apr 2018 13:39:01 +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 B67BC4041; Thu, 12 Apr 2018 13:39:01 +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 w3CDd1El024273; Thu, 12 Apr 2018 13:39:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CDd1r9024272; Thu, 12 Apr 2018 13:39:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804121339.w3CDd1r9024272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Apr 2018 13:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332427 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 332427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 13:39:02 -0000 Author: kib Date: Thu Apr 12 13:39:01 2018 New Revision: 332427 URL: https://svnweb.freebsd.org/changeset/base/332427 Log: MFC r332060: Make the INTO instruction operational in 32bit mode. Modified: stable/11/sys/amd64/amd64/machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/machdep.c Thu Apr 12 10:37:26 2018 (r332426) +++ stable/11/sys/amd64/amd64/machdep.c Thu Apr 12 13:39:01 2018 (r332427) @@ -1644,7 +1644,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) setidt(IDT_BP, pti ? &IDTVEC(bpt_pti) : &IDTVEC(bpt), SDT_SYSIGT, SEL_UPL, 0); setidt(IDT_OF, pti ? &IDTVEC(ofl_pti) : &IDTVEC(ofl), SDT_SYSIGT, - SEL_KPL, 0); + SEL_UPL, 0); setidt(IDT_BR, pti ? &IDTVEC(bnd_pti) : &IDTVEC(bnd), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_UD, pti ? &IDTVEC(ill_pti) : &IDTVEC(ill), SDT_SYSIGT, From owner-svn-src-all@freebsd.org Thu Apr 12 13:40:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84554F96247; Thu, 12 Apr 2018 13:40:03 +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 36FA669375; Thu, 12 Apr 2018 13:40:03 +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 321554047; Thu, 12 Apr 2018 13:40:03 +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 w3CDe32w024467; Thu, 12 Apr 2018 13:40:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CDe3IR024466; Thu, 12 Apr 2018 13:40:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804121340.w3CDe3IR024466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Apr 2018 13:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332428 - stable/11/sys/amd64/ia32 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/ia32 X-SVN-Commit-Revision: 332428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 13:40:03 -0000 Author: kib Date: Thu Apr 12 13:40:02 2018 New Revision: 332428 URL: https://svnweb.freebsd.org/changeset/base/332428 Log: MFC r332061: Fix ERESTART for lcall $7,$0 syscalls. Modified: stable/11/sys/amd64/ia32/ia32_syscall.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/11/sys/amd64/ia32/ia32_syscall.c Thu Apr 12 13:39:01 2018 (r332427) +++ stable/11/sys/amd64/ia32/ia32_syscall.c Thu Apr 12 13:40:02 2018 (r332428) @@ -144,6 +144,7 @@ ia32_fetch_syscall_args(struct thread *td) frame->tf_rip = eip; frame->tf_cs = cs; frame->tf_rsp += 2 * sizeof(u_int32_t); + frame->tf_err = 7; /* size of lcall $7,$0 */ } #endif From owner-svn-src-all@freebsd.org Thu Apr 12 13:52:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40C6CF972E2; Thu, 12 Apr 2018 13:52:56 +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 E903F6C7CB; Thu, 12 Apr 2018 13:52:55 +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 E3C8F439A; Thu, 12 Apr 2018 13:52:55 +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 w3CDqtPi034494; Thu, 12 Apr 2018 13:52:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CDqtMS034493; Thu, 12 Apr 2018 13:52:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804121352.w3CDqtMS034493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Apr 2018 13:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332429 - head/usr.sbin/cron/cron X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/cron/cron X-SVN-Commit-Revision: 332429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 13:52:56 -0000 Author: kevans Date: Thu Apr 12 13:52:55 2018 New Revision: 332429 URL: https://svnweb.freebsd.org/changeset/base/332429 Log: cron(8): Reload database if an existing job in cron.d changed as well Directory mtime will only change if a file is added or removed, not modified. For /var/cron/tabs, this is fine because of how crontab(1) manages it using temp files so all crontab(1) changes will trigger a reload of the database. For /etc/cron.d and /usr/local/etc/cron.d, this is not necessarily the case. Instead of checking their mtime, we should descend into them and check mtime on all jobs also. Reported by: des Reviewed by: bapt MFC after: 1 week Modified: head/usr.sbin/cron/cron/database.c Modified: head/usr.sbin/cron/cron/database.c ============================================================================== --- head/usr.sbin/cron/cron/database.c Thu Apr 12 13:40:02 2018 (r332428) +++ head/usr.sbin/cron/cron/database.c Thu Apr 12 13:52:55 2018 (r332429) @@ -56,7 +56,7 @@ load_database(old_db) { SYSCRONTABS }, { LOCALSYSCRONTABS } }; - int i; + int i, ret; Debug(DLOAD, ("[%d] load_database()\n", getpid())) @@ -79,6 +79,18 @@ load_database(old_db) for (i = 0; i < nitems(syscrontabs); i++) { if (stat(syscrontabs[i].name, &syscrontabs[i].st) != -1) { maxmtime = TMAX(syscrontabs[i].st.st_mtime, maxmtime); + /* Traverse into directory */ + if (!(dir = opendir(syscrontabs[i].name))) + continue; + while (NULL != (dp = readdir(dir))) { + if (dp->d_name[0] == '.') + continue; + ret = fstatat(dirfd(dir), dp->d_name, &st, 0); + if (ret == 0 && !S_ISREG(st.st_mode)) + continue; + maxmtime = TMAX(st.st_mtime, maxmtime); + } + closedir(dir); } else { syscrontabs[i].st.st_mtime = 0; } From owner-svn-src-all@freebsd.org Thu Apr 12 14:05:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DE11F97F8C; Thu, 12 Apr 2018 14:05:28 +0000 (UTC) (envelope-from ram@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 1B6726F6ED; Thu, 12 Apr 2018 14:05:28 +0000 (UTC) (envelope-from ram@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 167B8452A; Thu, 12 Apr 2018 14:05:28 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CE5Rpe039653; Thu, 12 Apr 2018 14:05:27 GMT (envelope-from ram@FreeBSD.org) Received: (from ram@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CE5RgP039652; Thu, 12 Apr 2018 14:05:27 GMT (envelope-from ram@FreeBSD.org) Message-Id: <201804121405.w3CE5RgP039652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ram set sender to ram@FreeBSD.org using -f From: Ram Kishore Vegesna Date: Thu, 12 Apr 2018 14:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332430 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: ram X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 332430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 14:05:28 -0000 Author: ram Date: Thu Apr 12 14:05:27 2018 New Revision: 332430 URL: https://svnweb.freebsd.org/changeset/base/332430 Log: Added entry in the correct section. Reported by: Rodney,kevans Approved by: ken Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Apr 12 13:52:55 2018 (r332429) +++ head/share/misc/committers-src.dot Thu Apr 12 14:05:27 2018 (r332430) @@ -76,7 +76,6 @@ nate [label="Nate Willams\nnate@FreeBSD.org\n1993/06/1 njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07\n2008/02/16"] non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\n2000/06/19\n2007/03/06"] onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/07/21\n2008/11/10"] -ram [label="Ram Kishore Vegesna\nram@FreeBSD.org\n2018/04/04\n???/??/??"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31\n2012/07/23"] randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20\n2012/05/10"] rink [label="Rink Springer\nrink@FreeBSD.org\n2006/01/16\n2010/11/04"] @@ -283,6 +282,7 @@ pkelsey [label="Patrick Kelsey\pkelsey@FreeBSD.org\n20 pluknet [label="Sergey Kandaurov\npluknet@FreeBSD.org\n2010/10/05"] ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"] qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"] +ram [label="Ram Kishore Vegesna\nram@FreeBSD.org\n2018/04/04"] ray [label="Aleksandr Rybalko\nray@FreeBSD.org\n2011/05/25"] rdivacky [label="Roman Divacky\nrdivacky@FreeBSD.org\n2008/03/13"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"] From owner-svn-src-all@freebsd.org Thu Apr 12 14:32:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35799F99CD8; Thu, 12 Apr 2018 14:32:27 +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 DB60D7500A; Thu, 12 Apr 2018 14:32:26 +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 D5D3F49DB; Thu, 12 Apr 2018 14:32:26 +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 w3CEWQMs054116; Thu, 12 Apr 2018 14:32:26 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CEWQek054115; Thu, 12 Apr 2018 14:32:26 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804121432.w3CEWQek054115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 12 Apr 2018 14:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332431 - head/usr.sbin/cron/cron X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/cron/cron X-SVN-Commit-Revision: 332431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 14:32:27 -0000 Author: kevans Date: Thu Apr 12 14:32:26 2018 New Revision: 332431 URL: https://svnweb.freebsd.org/changeset/base/332431 Log: cron(8): Correct test sense We're about to use the result of fstat(2) either way, so don't do that if it fails... X-MFC-With: r332429 Modified: head/usr.sbin/cron/cron/database.c Modified: head/usr.sbin/cron/cron/database.c ============================================================================== --- head/usr.sbin/cron/cron/database.c Thu Apr 12 14:05:27 2018 (r332430) +++ head/usr.sbin/cron/cron/database.c Thu Apr 12 14:32:26 2018 (r332431) @@ -86,7 +86,7 @@ load_database(old_db) if (dp->d_name[0] == '.') continue; ret = fstatat(dirfd(dir), dp->d_name, &st, 0); - if (ret == 0 && !S_ISREG(st.st_mode)) + if (ret != 0 || !S_ISREG(st.st_mode)) continue; maxmtime = TMAX(st.st_mtime, maxmtime); } From owner-svn-src-all@freebsd.org Thu Apr 12 14:35:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2824DF99FC5; Thu, 12 Apr 2018 14:35:38 +0000 (UTC) (envelope-from sbruno@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 D245375539; Thu, 12 Apr 2018 14:35:37 +0000 (UTC) (envelope-from sbruno@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 CD3AB49EB; Thu, 12 Apr 2018 14:35:37 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CEZbVq054304; Thu, 12 Apr 2018 14:35:37 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CEZbCx054303; Thu, 12 Apr 2018 14:35:37 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201804121435.w3CEZbCx054303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 12 Apr 2018 14:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332432 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 14:35:38 -0000 Author: sbruno Date: Thu Apr 12 14:35:37 2018 New Revision: 332432 URL: https://svnweb.freebsd.org/changeset/base/332432 Log: Restore r332389 after resolution of locking fixes. Add one extra lock initialization to iflib_register() that was missed in the git<->phab conversion. Split out flag manipulation from general context manipulation in iflib To avoid blocking on the context lock in the swi thread and risk potential deadlocks, this change protects lighter weight updates that only need to be consistent with each other with their own lock. Submitted by: Matthew Macy Reviewed by: shurd Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D14967 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Apr 12 14:32:26 2018 (r332431) +++ head/sys/net/iflib.c Thu Apr 12 14:35:37 2018 (r332432) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2017, Matthew Macy + * Copyright (c) 2014-2018, Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -163,7 +163,8 @@ struct iflib_ctx { if_shared_ctx_t ifc_sctx; struct if_softc_ctx ifc_softc_ctx; - struct mtx ifc_mtx; + struct mtx ifc_ctx_mtx; + struct mtx ifc_state_mtx; uint16_t ifc_nhwtxqs; @@ -317,8 +318,10 @@ typedef struct iflib_sw_tx_desc_array { #define IFC_INIT_DONE 0x020 #define IFC_PREFETCH 0x040 #define IFC_DO_RESET 0x080 -#define IFC_CHECK_HUNG 0x100 +#define IFC_DO_WATCHDOG 0x100 +#define IFC_CHECK_HUNG 0x200 + #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) @@ -534,13 +537,19 @@ rxd_info_zero(if_rxd_info_t ri) #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING)) -#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx lock", MTX_DEF) +#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_ctx_mtx, _name, "iflib ctx lock", MTX_DEF) +#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_ctx_mtx) +#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_ctx_mtx) +#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_ctx_mtx) -#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_mtx) -#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_mtx) -#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_mtx) +#define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, _name, "iflib state lock", MTX_DEF) +#define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx) +#define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx) +#define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) + + #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) #define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) @@ -2143,18 +2152,14 @@ iflib_timer(void *arg) if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); return; -hung: - CTX_LOCK(ctx); - if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); + hung: device_printf(ctx->ifc_dev, "TX(%d) desc avail = %d, pidx = %d\n", txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx); - - IFDI_WATCHDOG_RESET(ctx); - ctx->ifc_watchdog_events++; - - ctx->ifc_flags |= IFC_DO_RESET; + STATE_LOCK(ctx); + if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); + ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); iflib_admin_intr_deferred(ctx); - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); } static void @@ -2672,10 +2677,10 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) return true; return (iflib_rxd_avail(ctx, rxq, *cidxp, 1)); err: - CTX_LOCK(ctx); + STATE_LOCK(ctx); ctx->ifc_flags |= IFC_DO_RESET; iflib_admin_intr_deferred(ctx); - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); return (false); } @@ -3705,27 +3710,35 @@ _task_fn_admin(void *context) if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; iflib_txq_t txq; int i; + bool oactive, running, do_reset, do_watchdog; - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) { - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE)) { - return; - } - } + STATE_LOCK(ctx); + running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING); + oactive = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE); + do_reset = (ctx->ifc_flags & IFC_DO_RESET); + do_watchdog = (ctx->ifc_flags & IFC_DO_WATCHDOG); + ctx->ifc_flags &= ~(IFC_DO_RESET|IFC_DO_WATCHDOG); + STATE_UNLOCK(ctx); + if (!running & !oactive) + return; + CTX_LOCK(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) { CALLOUT_LOCK(txq); callout_stop(&txq->ift_timer); CALLOUT_UNLOCK(txq); } + if (do_watchdog) { + ctx->ifc_watchdog_events++; + IFDI_WATCHDOG_RESET(ctx); + } IFDI_UPDATE_ADMIN_STATUS(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); IFDI_LINK_INTR_ENABLE(ctx); - if (ctx->ifc_flags & IFC_DO_RESET) { - ctx->ifc_flags &= ~IFC_DO_RESET; + if (do_reset) iflib_if_init_locked(ctx); - } CTX_UNLOCK(ctx); if (LINK_ACTIVE(ctx) == 0) @@ -3869,15 +3882,15 @@ iflib_if_qflush(if_t ifp) iflib_txq_t txq = ctx->ifc_txqs; int i; - CTX_LOCK(ctx); + STATE_LOCK(ctx); ctx->ifc_flags |= IFC_QFLUSH; - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); for (i = 0; i < NTXQSETS(ctx); i++, txq++) while (!(ifmp_ring_is_idle(txq->ift_br) || ifmp_ring_is_stalled(txq->ift_br))) iflib_txq_check_drain(txq, 0); - CTX_LOCK(ctx); + STATE_LOCK(ctx); ctx->ifc_flags &= ~IFC_QFLUSH; - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); if_qflush(ifp); } @@ -3934,14 +3947,18 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) iflib_stop(ctx); if ((err = IFDI_MTU_SET(ctx, ifr->ifr_mtu)) == 0) { + STATE_LOCK(ctx); if (ifr->ifr_mtu > ctx->ifc_max_fl_buf_size) ctx->ifc_flags |= IFC_MULTISEG; else ctx->ifc_flags &= ~IFC_MULTISEG; + STATE_UNLOCK(ctx); err = if_setmtu(ifp, ifr->ifr_mtu); } iflib_init_locked(ctx); + STATE_LOCK(ctx); if_setdrvflags(ifp, bits); + STATE_UNLOCK(ctx); CTX_UNLOCK(ctx); break; case SIOCSIFFLAGS: @@ -4025,10 +4042,14 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) bits = if_getdrvflags(ifp); if (bits & IFF_DRV_RUNNING) iflib_stop(ctx); + STATE_LOCK(ctx); if_togglecapenable(ifp, setmask); + STATE_UNLOCK(ctx); if (bits & IFF_DRV_RUNNING) iflib_init_locked(ctx); + STATE_LOCK(ctx); if_setdrvflags(ifp, bits); + STATE_UNLOCK(ctx); CTX_UNLOCK(ctx); } break; @@ -4683,6 +4704,7 @@ iflib_register(if_ctx_t ctx) CTX_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); + STATE_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); ifp = ctx->ifc_ifp = if_gethandle(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "can not allocate ifnet structure\n"); @@ -5431,9 +5453,11 @@ iflib_link_state_change(if_ctx_t ctx, int link_state, iflib_txq_t txq = ctx->ifc_txqs; if_setbaudrate(ifp, baudrate); - if (baudrate >= IF_Gbps(10)) + if (baudrate >= IF_Gbps(10)) { + STATE_LOCK(ctx); ctx->ifc_flags |= IFC_PREFETCH; - + STATE_UNLOCK(ctx); + } /* If link down, disable watchdog */ if ((ctx->ifc_link_state == LINK_STATE_UP) && (link_state == LINK_STATE_DOWN)) { for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxqsets; i++, txq++) @@ -5492,7 +5516,7 @@ struct mtx * iflib_ctx_lock_get(if_ctx_t ctx) { - return (&ctx->ifc_mtx); + return (&ctx->ifc_ctx_mtx); } static int From owner-svn-src-all@freebsd.org Thu Apr 12 14:57:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1626CF9B6F3; Thu, 12 Apr 2018 14:57:49 +0000 (UTC) (envelope-from bz@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 BB9497B2E0; Thu, 12 Apr 2018 14:57:48 +0000 (UTC) (envelope-from bz@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 B1F0A4D17; Thu, 12 Apr 2018 14:57:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CEvmSO064473; Thu, 12 Apr 2018 14:57:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CEvmR6064472; Thu, 12 Apr 2018 14:57:48 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201804121457.w3CEvmR6064472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 12 Apr 2018 14:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332433 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 332433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 14:57:49 -0000 Author: bz Date: Thu Apr 12 14:57:48 2018 New Revision: 332433 URL: https://svnweb.freebsd.org/changeset/base/332433 Log: Fix a typo. Sponsored by: iXsystems, Inc. Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Apr 12 14:35:37 2018 (r332432) +++ head/sys/sys/proc.h Thu Apr 12 14:57:48 2018 (r332433) @@ -668,7 +668,7 @@ struct proc { struct racct *p_racct; /* (b) Resource accounting. */ int p_throttled; /* (c) Flag for racct pcpu throttling */ /* - * An orphan is the child that has beed re-parented to the + * An orphan is the child that has been re-parented to the * debugger as a result of attaching to it. Need to keep * track of them for parent to be able to collect the exit * status of what used to be children. From owner-svn-src-all@freebsd.org Thu Apr 12 15:12:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AE3CF9C890; Thu, 12 Apr 2018 15:12:41 +0000 (UTC) (envelope-from br@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 BC1FD7E3D6; Thu, 12 Apr 2018 15:12:40 +0000 (UTC) (envelope-from br@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 B6E905041; Thu, 12 Apr 2018 15:12:40 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CFCeGj074172; Thu, 12 Apr 2018 15:12:40 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CFCeHD074171; Thu, 12 Apr 2018 15:12:40 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804121512.w3CFCeHD074171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 12 Apr 2018 15:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332434 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 332434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 15:12:41 -0000 Author: br Date: Thu Apr 12 15:12:40 2018 New Revision: 332434 URL: https://svnweb.freebsd.org/changeset/base/332434 Log: Add ld emulation types for hard-float mipses. Sponsored by: DARPA, AFRL Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Apr 12 14:57:48 2018 (r332433) +++ head/sys/conf/kern.mk Thu Apr 12 15:12:40 2018 (r332434) @@ -276,9 +276,13 @@ LD_EMULATION_armv6=armelf_fbsd LD_EMULATION_armv7=armelf_fbsd LD_EMULATION_i386=elf_i386_fbsd LD_EMULATION_mips= elf32btsmip_fbsd +LD_EMULATION_mipshf= elf32btsmip_fbsd LD_EMULATION_mips64= elf64btsmip_fbsd +LD_EMULATION_mips64hf= elf64btsmip_fbsd LD_EMULATION_mipsel= elf32ltsmip_fbsd +LD_EMULATION_mipselhf= elf32ltsmip_fbsd LD_EMULATION_mips64el= elf64ltsmip_fbsd +LD_EMULATION_mips64elhf= elf64ltsmip_fbsd LD_EMULATION_mipsn32= elf32btsmipn32_fbsd LD_EMULATION_mipsn32el= elf32btsmipn32_fbsd # I don't think this is a thing that works LD_EMULATION_powerpc= elf32ppc_fbsd From owner-svn-src-all@freebsd.org Thu Apr 12 15:36:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8B53F9E46C; Thu, 12 Apr 2018 15:36:25 +0000 (UTC) (envelope-from br@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 7873183749; Thu, 12 Apr 2018 15:36:25 +0000 (UTC) (envelope-from br@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 6ABA85371; Thu, 12 Apr 2018 15:36:25 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CFaPSI084195; Thu, 12 Apr 2018 15:36:25 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CFaOUo084189; Thu, 12 Apr 2018 15:36:24 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804121536.w3CFaOUo084189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 12 Apr 2018 15:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332435 - in head/sys: conf dev/xdma mips/ingenic X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/xdma mips/ingenic X-SVN-Commit-Revision: 332435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 15:36:26 -0000 Author: br Date: Thu Apr 12 15:36:24 2018 New Revision: 332435 URL: https://svnweb.freebsd.org/changeset/base/332435 Log: Tune xDMA interface slightly: o Move descriptors allocation to DMA engine driver o Add generic xdma_request() routine o Add less-generic scatter-gather application based on xdma interface Typical operation flow in peripheral device driver is: 1. Get xDMA controller sc->xdma_tx = xdma_ofw_get(sc->dev, "tx"); 2. Allocate virtual channel sc->xchan_tx = xdma_channel_alloc(sc->xdma_tx, caps); 3. Setup transfer status callback xdma_setup_intr(sc->xchan_tx, my_tx_intr, sc, &sc->ih_tx); 4. Request a transfer(s) ret = xdma_request(sc->xchan_tx, &req); 5. Free the channel xdma_channel_free(sc->xdma_tx); 6. Free the controller xdma_put(sc->xdma_tx); Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14971 Added: head/sys/dev/xdma/xdma_bank.c (contents, props changed) head/sys/dev/xdma/xdma_bio.c (contents, props changed) head/sys/dev/xdma/xdma_mbuf.c (contents, props changed) head/sys/dev/xdma/xdma_queue.c (contents, props changed) head/sys/dev/xdma/xdma_sg.c (contents, props changed) head/sys/dev/xdma/xdma_sglist.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/xdma/xdma.c head/sys/dev/xdma/xdma.h head/sys/dev/xdma/xdma_fdt_test.c head/sys/dev/xdma/xdma_if.m head/sys/mips/ingenic/jz4780_aic.c head/sys/mips/ingenic/jz4780_pdma.c head/sys/mips/ingenic/jz4780_pdma.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Apr 12 15:12:40 2018 (r332434) +++ head/sys/conf/files Thu Apr 12 15:36:24 2018 (r332435) @@ -3511,8 +3511,14 @@ wpi.fw optional wpifw \ no-obj no-implicit-rule \ clean "wpi.fw" dev/xdma/xdma.c optional xdma -dev/xdma/xdma_if.m optional xdma +dev/xdma/xdma_bank.c optional xdma +dev/xdma/xdma_bio.c optional xdma dev/xdma/xdma_fdt_test.c optional xdma xdma_test fdt +dev/xdma/xdma_if.m optional xdma +dev/xdma/xdma_mbuf.c optional xdma +dev/xdma/xdma_queue.c optional xdma +dev/xdma/xdma_sg.c optional xdma +dev/xdma/xdma_sglist.c optional xdma dev/xe/if_xe.c optional xe dev/xe/if_xe_pccard.c optional xe pccard dev/xen/balloon/balloon.c optional xenhvm Modified: head/sys/dev/xdma/xdma.c ============================================================================== --- head/sys/dev/xdma/xdma.c Thu Apr 12 15:12:40 2018 (r332434) +++ head/sys/dev/xdma/xdma.c Thu Apr 12 15:36:24 2018 (r332435) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Ruslan Bukin + * Copyright (c) 2016-2018 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -58,40 +57,28 @@ __FBSDID("$FreeBSD$"); #include -MALLOC_DEFINE(M_XDMA, "xdma", "xDMA framework"); - /* * Multiple xDMA controllers may work with single DMA device, * so we have global lock for physical channel management. */ -static struct mtx xdma_mtx; -#define XDMA_LOCK() mtx_lock(&xdma_mtx) -#define XDMA_UNLOCK() mtx_unlock(&xdma_mtx) -#define XDMA_ASSERT_LOCKED() mtx_assert(&xdma_mtx, MA_OWNED) +static struct sx xdma_sx; -/* - * Per channel locks. - */ -#define XCHAN_LOCK(xchan) mtx_lock(&(xchan)->mtx_lock) -#define XCHAN_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_lock) -#define XCHAN_ASSERT_LOCKED(xchan) mtx_assert(&(xchan)->mtx_lock, MA_OWNED) +#define XDMA_LOCK() sx_xlock(&xdma_sx) +#define XDMA_UNLOCK() sx_xunlock(&xdma_sx) +#define XDMA_ASSERT_LOCKED() sx_xassert(&xdma_sx, MA_OWNED) /* * Allocate virtual xDMA channel. */ xdma_channel_t * -xdma_channel_alloc(xdma_controller_t *xdma) +xdma_channel_alloc(xdma_controller_t *xdma, uint32_t caps) { xdma_channel_t *xchan; int ret; xchan = malloc(sizeof(xdma_channel_t), M_XDMA, M_WAITOK | M_ZERO); - if (xchan == NULL) { - device_printf(xdma->dev, - "%s: Can't allocate memory for channel.\n", __func__); - return (NULL); - } xchan->xdma = xdma; + xchan->caps = caps; XDMA_LOCK(); @@ -107,8 +94,18 @@ xdma_channel_alloc(xdma_controller_t *xdma) } TAILQ_INIT(&xchan->ie_handlers); - mtx_init(&xchan->mtx_lock, "xDMA", NULL, MTX_DEF); + sx_init(&xchan->sx_lock, "xDMA chan"); + sx_init(&xchan->sx_qin_lock, "xDMA qin"); + sx_init(&xchan->sx_qout_lock, "xDMA qout"); + sx_init(&xchan->sx_bank_lock, "xDMA bank"); + sx_init(&xchan->sx_proc_lock, "xDMA proc"); + + TAILQ_INIT(&xchan->bank); + TAILQ_INIT(&xchan->queue_in); + TAILQ_INIT(&xchan->queue_out); + TAILQ_INIT(&xchan->processing); + TAILQ_INSERT_TAIL(&xdma->channels, xchan, xchan_next); XDMA_UNLOCK(); @@ -123,6 +120,7 @@ xdma_channel_free(xdma_channel_t *xchan) int err; xdma = xchan->xdma; + KASSERT(xdma != NULL, ("xdma is NULL")); XDMA_LOCK(); @@ -135,13 +133,17 @@ xdma_channel_free(xdma_channel_t *xchan) return (-1); } + if (xchan->flags & XCHAN_TYPE_SG) + xdma_channel_free_sg(xchan); + xdma_teardown_all_intr(xchan); - /* Deallocate descriptors, if any. */ - xdma_desc_free(xchan); + sx_destroy(&xchan->sx_lock); + sx_destroy(&xchan->sx_qin_lock); + sx_destroy(&xchan->sx_qout_lock); + sx_destroy(&xchan->sx_bank_lock); + sx_destroy(&xchan->sx_proc_lock); - mtx_destroy(&xchan->mtx_lock); - TAILQ_REMOVE(&xdma->channels, xchan, xchan_next); free(xchan, M_XDMA); @@ -152,8 +154,9 @@ xdma_channel_free(xdma_channel_t *xchan) } int -xdma_setup_intr(xdma_channel_t *xchan, int (*cb)(void *), void *arg, - void **ihandler) +xdma_setup_intr(xdma_channel_t *xchan, + int (*cb)(void *, xdma_transfer_status_t *), + void *arg, void **ihandler) { struct xdma_intr_handler *ih; xdma_controller_t *xdma; @@ -172,22 +175,15 @@ xdma_setup_intr(xdma_channel_t *xchan, int (*cb)(void ih = malloc(sizeof(struct xdma_intr_handler), M_XDMA, M_WAITOK | M_ZERO); - if (ih == NULL) { - device_printf(xdma->dev, - "%s: Can't allocate memory for interrupt handler.\n", - __func__); - - return (-1); - } - ih->cb = cb; ih->cb_user = arg; + XCHAN_LOCK(xchan); TAILQ_INSERT_TAIL(&xchan->ie_handlers, ih, ih_next); + XCHAN_UNLOCK(xchan); - if (ihandler != NULL) { + if (ihandler != NULL) *ihandler = ih; - } return (0); } @@ -231,326 +227,67 @@ xdma_teardown_all_intr(xdma_channel_t *xchan) return (0); } -static void -xdma_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) -{ - xdma_channel_t *xchan; - int i; - - xchan = (xdma_channel_t *)arg; - KASSERT(xchan != NULL, ("xchan is NULL")); - - if (err) { - xchan->map_err = 1; - return; - } - - for (i = 0; i < nseg; i++) { - xchan->descs_phys[i].ds_addr = segs[i].ds_addr; - xchan->descs_phys[i].ds_len = segs[i].ds_len; - } -} - -static int -xdma_desc_alloc_bus_dma(xdma_channel_t *xchan, uint32_t desc_size, - uint32_t align) -{ - xdma_controller_t *xdma; - bus_size_t all_desc_sz; - xdma_config_t *conf; - int nsegments; - int err; - - xdma = xchan->xdma; - conf = &xchan->conf; - - nsegments = conf->block_num; - all_desc_sz = (nsegments * desc_size); - - err = bus_dma_tag_create( - bus_get_dma_tag(xdma->dev), - align, desc_size, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - all_desc_sz, nsegments, /* maxsize, nsegments*/ - desc_size, 0, /* maxsegsize, flags */ - NULL, NULL, /* lockfunc, lockarg */ - &xchan->dma_tag); - if (err) { - device_printf(xdma->dev, - "%s: Can't create bus_dma tag.\n", __func__); - return (-1); - } - - err = bus_dmamem_alloc(xchan->dma_tag, (void **)&xchan->descs, - BUS_DMA_WAITOK | BUS_DMA_COHERENT, &xchan->dma_map); - if (err) { - device_printf(xdma->dev, - "%s: Can't allocate memory for descriptors.\n", __func__); - return (-1); - } - - xchan->descs_phys = malloc(nsegments * sizeof(xdma_descriptor_t), M_XDMA, - (M_WAITOK | M_ZERO)); - - xchan->map_err = 0; - err = bus_dmamap_load(xchan->dma_tag, xchan->dma_map, xchan->descs, - all_desc_sz, xdma_dmamap_cb, xchan, BUS_DMA_WAITOK); - if (err) { - device_printf(xdma->dev, - "%s: Can't load DMA map.\n", __func__); - return (-1); - } - - if (xchan->map_err != 0) { - device_printf(xdma->dev, - "%s: Can't load DMA map.\n", __func__); - return (-1); - } - - return (0); -} - -/* - * This function called by DMA controller driver. - */ int -xdma_desc_alloc(xdma_channel_t *xchan, uint32_t desc_size, uint32_t align) +xdma_request(xdma_channel_t *xchan, struct xdma_request *req) { xdma_controller_t *xdma; - xdma_config_t *conf; int ret; - XCHAN_ASSERT_LOCKED(xchan); - xdma = xchan->xdma; - if (xdma == NULL) { - device_printf(xdma->dev, - "%s: Channel was not allocated properly.\n", __func__); - return (-1); - } - if (xchan->flags & XCHAN_DESC_ALLOCATED) { - device_printf(xdma->dev, - "%s: Descriptors already allocated.\n", __func__); - return (-1); - } - - if ((xchan->flags & XCHAN_CONFIGURED) == 0) { - device_printf(xdma->dev, - "%s: Channel has no configuration.\n", __func__); - return (-1); - } - - conf = &xchan->conf; - - XCHAN_UNLOCK(xchan); - ret = xdma_desc_alloc_bus_dma(xchan, desc_size, align); - XCHAN_LOCK(xchan); - if (ret != 0) { - device_printf(xdma->dev, - "%s: Can't allocate memory for descriptors.\n", - __func__); - return (-1); - } - - xchan->flags |= XCHAN_DESC_ALLOCATED; - - /* We are going to write to descriptors. */ - bus_dmamap_sync(xchan->dma_tag, xchan->dma_map, BUS_DMASYNC_PREWRITE); - - return (0); -} - -int -xdma_desc_free(xdma_channel_t *xchan) -{ - - if ((xchan->flags & XCHAN_DESC_ALLOCATED) == 0) { - /* No descriptors allocated. */ - return (-1); - } - - bus_dmamap_unload(xchan->dma_tag, xchan->dma_map); - bus_dmamem_free(xchan->dma_tag, xchan->descs, xchan->dma_map); - bus_dma_tag_destroy(xchan->dma_tag); - free(xchan->descs_phys, M_XDMA); - - xchan->flags &= ~(XCHAN_DESC_ALLOCATED); - - return (0); -} - -int -xdma_prep_memcpy(xdma_channel_t *xchan, uintptr_t src_addr, - uintptr_t dst_addr, size_t len) -{ - xdma_controller_t *xdma; - xdma_config_t *conf; - int ret; - - xdma = xchan->xdma; KASSERT(xdma != NULL, ("xdma is NULL")); - conf = &xchan->conf; - conf->direction = XDMA_MEM_TO_MEM; - conf->src_addr = src_addr; - conf->dst_addr = dst_addr; - conf->block_len = len; - conf->block_num = 1; - - xchan->flags |= (XCHAN_CONFIGURED | XCHAN_TYPE_MEMCPY); - XCHAN_LOCK(xchan); - - /* Deallocate old descriptors, if any. */ - xdma_desc_free(xchan); - - ret = XDMA_CHANNEL_PREP_MEMCPY(xdma->dma_dev, xchan); + ret = XDMA_CHANNEL_REQUEST(xdma->dma_dev, xchan, req); if (ret != 0) { device_printf(xdma->dev, - "%s: Can't prepare memcpy transfer.\n", __func__); + "%s: Can't request a transfer.\n", __func__); XCHAN_UNLOCK(xchan); return (-1); } - - if (xchan->flags & XCHAN_DESC_ALLOCATED) { - /* Driver created xDMA descriptors. */ - bus_dmamap_sync(xchan->dma_tag, xchan->dma_map, - BUS_DMASYNC_POSTWRITE); - } - XCHAN_UNLOCK(xchan); return (0); } int -xdma_prep_cyclic(xdma_channel_t *xchan, enum xdma_direction dir, - uintptr_t src_addr, uintptr_t dst_addr, int block_len, - int block_num, int src_width, int dst_width) +xdma_control(xdma_channel_t *xchan, enum xdma_command cmd) { xdma_controller_t *xdma; - xdma_config_t *conf; int ret; xdma = xchan->xdma; KASSERT(xdma != NULL, ("xdma is NULL")); - conf = &xchan->conf; - conf->direction = dir; - conf->src_addr = src_addr; - conf->dst_addr = dst_addr; - conf->block_len = block_len; - conf->block_num = block_num; - conf->src_width = src_width; - conf->dst_width = dst_width; - - xchan->flags |= (XCHAN_CONFIGURED | XCHAN_TYPE_CYCLIC); - - XCHAN_LOCK(xchan); - - /* Deallocate old descriptors, if any. */ - xdma_desc_free(xchan); - - ret = XDMA_CHANNEL_PREP_CYCLIC(xdma->dma_dev, xchan); + ret = XDMA_CHANNEL_CONTROL(xdma->dma_dev, xchan, cmd); if (ret != 0) { device_printf(xdma->dev, - "%s: Can't prepare cyclic transfer.\n", __func__); - XCHAN_UNLOCK(xchan); - + "%s: Can't process command.\n", __func__); return (-1); } - if (xchan->flags & XCHAN_DESC_ALLOCATED) { - /* Driver has created xDMA descriptors. */ - bus_dmamap_sync(xchan->dma_tag, xchan->dma_map, - BUS_DMASYNC_POSTWRITE); - } - - XCHAN_UNLOCK(xchan); - return (0); } -int -xdma_begin(xdma_channel_t *xchan) +void +xdma_callback(xdma_channel_t *xchan, xdma_transfer_status_t *status) { + struct xdma_intr_handler *ih_tmp; + struct xdma_intr_handler *ih; xdma_controller_t *xdma; - int ret; xdma = xchan->xdma; + KASSERT(xdma != NULL, ("xdma is NULL")); - ret = XDMA_CHANNEL_CONTROL(xdma->dma_dev, xchan, XDMA_CMD_BEGIN); - if (ret != 0) { - device_printf(xdma->dev, - "%s: Can't begin the channel operation.\n", __func__); - return (-1); - } + TAILQ_FOREACH_SAFE(ih, &xchan->ie_handlers, ih_next, ih_tmp) + if (ih->cb != NULL) + ih->cb(ih->cb_user, status); - return (0); + if (xchan->flags & XCHAN_TYPE_SG) + xdma_queue_submit(xchan); } -int -xdma_terminate(xdma_channel_t *xchan) -{ - xdma_controller_t *xdma; - int ret; - - xdma = xchan->xdma; - - ret = XDMA_CHANNEL_CONTROL(xdma->dma_dev, xchan, XDMA_CMD_TERMINATE); - if (ret != 0) { - device_printf(xdma->dev, - "%s: Can't terminate the channel operation.\n", __func__); - return (-1); - } - - return (0); -} - -int -xdma_pause(xdma_channel_t *xchan) -{ - xdma_controller_t *xdma; - int ret; - - xdma = xchan->xdma; - - ret = XDMA_CHANNEL_CONTROL(xdma->dma_dev, xchan, XDMA_CMD_PAUSE); - if (ret != 0) { - device_printf(xdma->dev, - "%s: Can't pause the channel operation.\n", __func__); - return (-1); - } - - return (ret); -} - -int -xdma_callback(xdma_channel_t *xchan) -{ - struct xdma_intr_handler *ih_tmp; - struct xdma_intr_handler *ih; - - TAILQ_FOREACH_SAFE(ih, &xchan->ie_handlers, ih_next, ih_tmp) { - if (ih->cb != NULL) { - ih->cb(ih->cb_user); - } - } - - return (0); -} - -void -xdma_assert_locked(void) -{ - - XDMA_ASSERT_LOCKED(); -} - #ifdef FDT /* * Notify the DMA driver we have machine-dependent data in FDT. @@ -560,7 +297,8 @@ xdma_ofw_md_data(xdma_controller_t *xdma, pcell_t *cel { uint32_t ret; - ret = XDMA_OFW_MD_DATA(xdma->dma_dev, cells, ncells, (void **)&xdma->data); + ret = XDMA_OFW_MD_DATA(xdma->dma_dev, + cells, ncells, (void **)&xdma->data); return (ret); } @@ -581,10 +319,9 @@ xdma_ofw_get(device_t dev, const char *prop) int idx; node = ofw_bus_get_node(dev); - if (node <= 0) { + if (node <= 0) device_printf(dev, "%s called on not ofw based device.\n", __func__); - } error = ofw_bus_parse_xref_list_get_length(node, "dmas", "#dma-cells", &ndmas); @@ -622,12 +359,8 @@ xdma_ofw_get(device_t dev, const char *prop) return (NULL); } - xdma = malloc(sizeof(struct xdma_controller), M_XDMA, M_WAITOK | M_ZERO); - if (xdma == NULL) { - device_printf(dev, - "%s can't allocate memory for xdma.\n", __func__); - return (NULL); - } + xdma = malloc(sizeof(struct xdma_controller), + M_XDMA, M_WAITOK | M_ZERO); xdma->dev = dev; xdma->dma_dev = dma_dev; @@ -667,7 +400,7 @@ static void xdma_init(void) { - mtx_init(&xdma_mtx, "xDMA", NULL, MTX_DEF); + sx_init(&xdma_sx, "xDMA"); } SYSINIT(xdma, SI_SUB_DRIVERS, SI_ORDER_FIRST, xdma_init, NULL); Modified: head/sys/dev/xdma/xdma.h ============================================================================== --- head/sys/dev/xdma/xdma.h Thu Apr 12 15:12:40 2018 (r332434) +++ head/sys/dev/xdma/xdma.h Thu Apr 12 15:36:24 2018 (r332435) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Ruslan Bukin + * Copyright (c) 2016-2018 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -30,9 +30,11 @@ * $FreeBSD$ */ -#ifndef _DEV_EXTRES_XDMA_H_ -#define _DEV_EXTRES_XDMA_H_ +#ifndef _DEV_XDMA_XDMA_H_ +#define _DEV_XDMA_XDMA_H_ +#include + enum xdma_direction { XDMA_MEM_TO_MEM, XDMA_MEM_TO_DEV, @@ -42,17 +44,31 @@ enum xdma_direction { enum xdma_operation_type { XDMA_MEMCPY, - XDMA_SG, XDMA_CYCLIC, + XDMA_FIFO, + XDMA_SG, }; +enum xdma_request_type { + XR_TYPE_PHYS, + XR_TYPE_VIRT, + XR_TYPE_MBUF, + XR_TYPE_BIO, +}; + enum xdma_command { XDMA_CMD_BEGIN, XDMA_CMD_PAUSE, XDMA_CMD_TERMINATE, - XDMA_CMD_TERMINATE_ALL, }; +struct xdma_transfer_status { + uint32_t transferred; + int error; +}; + +typedef struct xdma_transfer_status xdma_transfer_status_t; + struct xdma_controller { device_t dev; /* DMA consumer device_t. */ device_t dma_dev; /* A real DMA device_t. */ @@ -64,85 +80,185 @@ struct xdma_controller { typedef struct xdma_controller xdma_controller_t; -struct xdma_channel_config { - enum xdma_direction direction; - uintptr_t src_addr; /* Physical address. */ - uintptr_t dst_addr; /* Physical address. */ - int block_len; /* In bytes. */ - int block_num; /* Count of blocks. */ - int src_width; /* In bytes. */ - int dst_width; /* In bytes. */ +struct xchan_buf { + bus_dmamap_t map; + uint32_t nsegs; + uint32_t nsegs_left; + void *cbuf; }; -typedef struct xdma_channel_config xdma_config_t; +struct xdma_request { + struct mbuf *m; + struct bio *bp; + enum xdma_operation_type operation; + enum xdma_request_type req_type; + enum xdma_direction direction; + bus_addr_t src_addr; + bus_addr_t dst_addr; + uint8_t src_width; + uint8_t dst_width; + bus_size_t block_num; + bus_size_t block_len; + xdma_transfer_status_t status; + void *user; + TAILQ_ENTRY(xdma_request) xr_next; + struct xchan_buf buf; +}; -struct xdma_descriptor { - bus_addr_t ds_addr; - bus_size_t ds_len; +struct xdma_sglist { + bus_addr_t src_addr; + bus_addr_t dst_addr; + size_t len; + uint8_t src_width; + uint8_t dst_width; + enum xdma_direction direction; + bool first; + bool last; }; -typedef struct xdma_descriptor xdma_descriptor_t; - struct xdma_channel { xdma_controller_t *xdma; - xdma_config_t conf; - uint8_t flags; -#define XCHAN_DESC_ALLOCATED (1 << 0) -#define XCHAN_CONFIGURED (1 << 1) -#define XCHAN_TYPE_CYCLIC (1 << 2) -#define XCHAN_TYPE_MEMCPY (1 << 3) + uint32_t flags; +#define XCHAN_BUFS_ALLOCATED (1 << 0) +#define XCHAN_SGLIST_ALLOCATED (1 << 1) +#define XCHAN_CONFIGURED (1 << 2) +#define XCHAN_TYPE_CYCLIC (1 << 3) +#define XCHAN_TYPE_MEMCPY (1 << 4) +#define XCHAN_TYPE_FIFO (1 << 5) +#define XCHAN_TYPE_SG (1 << 6) + uint32_t caps; +#define XCHAN_CAP_BUSDMA (1 << 0) +#define XCHAN_CAP_BUSDMA_NOSEG (1 << 1) + /* A real hardware driver channel. */ void *chan; /* Interrupt handlers. */ TAILQ_HEAD(, xdma_intr_handler) ie_handlers; + TAILQ_ENTRY(xdma_channel) xchan_next; - /* Descriptors. */ - bus_dma_tag_t dma_tag; - bus_dmamap_t dma_map; - void *descs; - xdma_descriptor_t *descs_phys; - uint8_t map_err; + struct sx sx_lock; + struct sx sx_qin_lock; + struct sx sx_qout_lock; + struct sx sx_bank_lock; + struct sx sx_proc_lock; - struct mtx mtx_lock; + /* Request queue. */ + bus_dma_tag_t dma_tag_bufs; + struct xdma_request *xr_mem; + uint32_t xr_num; - TAILQ_ENTRY(xdma_channel) xchan_next; + /* Bus dma tag options. */ + bus_size_t maxsegsize; + bus_size_t maxnsegs; + bus_size_t alignment; + bus_addr_t boundary; + bus_addr_t lowaddr; + bus_addr_t highaddr; + + struct xdma_sglist *sg; + + TAILQ_HEAD(, xdma_request) bank; + TAILQ_HEAD(, xdma_request) queue_in; + TAILQ_HEAD(, xdma_request) queue_out; + TAILQ_HEAD(, xdma_request) processing; }; typedef struct xdma_channel xdma_channel_t; -/* xDMA controller alloc/free */ +struct xdma_intr_handler { + int (*cb)(void *cb_user, xdma_transfer_status_t *status); + void *cb_user; + TAILQ_ENTRY(xdma_intr_handler) ih_next; +}; + +static MALLOC_DEFINE(M_XDMA, "xdma", "xDMA framework"); + +#define XCHAN_LOCK(xchan) sx_xlock(&(xchan)->sx_lock) +#define XCHAN_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_lock) +#define XCHAN_ASSERT_LOCKED(xchan) \ + sx_assert(&(xchan)->sx_lock, SX_XLOCKED) + +#define QUEUE_IN_LOCK(xchan) sx_xlock(&(xchan)->sx_qin_lock) +#define QUEUE_IN_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_qin_lock) +#define QUEUE_IN_ASSERT_LOCKED(xchan) \ + sx_assert(&(xchan)->sx_qin_lock, SX_XLOCKED) + +#define QUEUE_OUT_LOCK(xchan) sx_xlock(&(xchan)->sx_qout_lock) +#define QUEUE_OUT_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_qout_lock) +#define QUEUE_OUT_ASSERT_LOCKED(xchan) \ + sx_assert(&(xchan)->sx_qout_lock, SX_XLOCKED) + +#define QUEUE_BANK_LOCK(xchan) sx_xlock(&(xchan)->sx_bank_lock) +#define QUEUE_BANK_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_bank_lock) +#define QUEUE_BANK_ASSERT_LOCKED(xchan) \ + sx_assert(&(xchan)->sx_bank_lock, SX_XLOCKED) + +#define QUEUE_PROC_LOCK(xchan) sx_xlock(&(xchan)->sx_proc_lock) +#define QUEUE_PROC_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_proc_lock) +#define QUEUE_PROC_ASSERT_LOCKED(xchan) \ + sx_assert(&(xchan)->sx_proc_lock, SX_XLOCKED) + +#define XDMA_SGLIST_MAXLEN 2048 +#define XDMA_MAX_SEG 128 + +/* xDMA controller ops */ xdma_controller_t *xdma_ofw_get(device_t dev, const char *prop); int xdma_put(xdma_controller_t *xdma); -xdma_channel_t * xdma_channel_alloc(xdma_controller_t *); +/* xDMA channel ops */ +xdma_channel_t * xdma_channel_alloc(xdma_controller_t *, uint32_t caps); int xdma_channel_free(xdma_channel_t *); +int xdma_request(xdma_channel_t *xchan, struct xdma_request *r); -int xdma_prep_cyclic(xdma_channel_t *, enum xdma_direction, - uintptr_t, uintptr_t, int, int, int, int); -int xdma_prep_memcpy(xdma_channel_t *, uintptr_t, uintptr_t, size_t len); -int xdma_desc_alloc(xdma_channel_t *, uint32_t, uint32_t); -int xdma_desc_free(xdma_channel_t *xchan); +/* SG interface */ +int xdma_prep_sg(xdma_channel_t *, uint32_t, + bus_size_t, bus_size_t, bus_size_t, bus_addr_t, bus_addr_t, bus_addr_t); +void xdma_channel_free_sg(xdma_channel_t *xchan); +int xdma_queue_submit_sg(xdma_channel_t *xchan); +void xchan_seg_done(xdma_channel_t *xchan, xdma_transfer_status_t *); +/* Queue operations */ +int xdma_dequeue_mbuf(xdma_channel_t *xchan, struct mbuf **m, + xdma_transfer_status_t *); +int xdma_enqueue_mbuf(xdma_channel_t *xchan, struct mbuf **m, uintptr_t addr, + uint8_t, uint8_t, enum xdma_direction dir); +int xdma_dequeue_bio(xdma_channel_t *xchan, struct bio **bp, + xdma_transfer_status_t *status); +int xdma_enqueue_bio(xdma_channel_t *xchan, struct bio **bp, bus_addr_t addr, + uint8_t, uint8_t, enum xdma_direction dir); +int xdma_dequeue(xdma_channel_t *xchan, void **user, + xdma_transfer_status_t *status); +int xdma_enqueue(xdma_channel_t *xchan, uintptr_t src, uintptr_t dst, + uint8_t, uint8_t, bus_size_t, enum xdma_direction dir, void *); +int xdma_queue_submit(xdma_channel_t *xchan); + +/* Mbuf operations */ +uint32_t xdma_mbuf_defrag(xdma_channel_t *xchan, struct xdma_request *xr); +uint32_t xdma_mbuf_chain_count(struct mbuf *m0); + /* Channel Control */ -int xdma_begin(xdma_channel_t *xchan); -int xdma_pause(xdma_channel_t *xchan); -int xdma_terminate(xdma_channel_t *xchan); +int xdma_control(xdma_channel_t *xchan, enum xdma_command cmd); /* Interrupt callback */ -int xdma_setup_intr(xdma_channel_t *xchan, int (*cb)(void *), void *arg, void **); +int xdma_setup_intr(xdma_channel_t *xchan, int (*cb)(void *, + xdma_transfer_status_t *), void *arg, void **); int xdma_teardown_intr(xdma_channel_t *xchan, struct xdma_intr_handler *ih); int xdma_teardown_all_intr(xdma_channel_t *xchan); -int xdma_callback(struct xdma_channel *xchan); -void xdma_assert_locked(void); +void xdma_callback(struct xdma_channel *xchan, xdma_transfer_status_t *status); -struct xdma_intr_handler { - int (*cb)(void *); - void *cb_user; - struct mtx ih_lock; - TAILQ_ENTRY(xdma_intr_handler) ih_next; -}; +/* Sglist */ +int xchan_sglist_alloc(xdma_channel_t *xchan); +void xchan_sglist_free(xdma_channel_t *xchan); +int xdma_sglist_add(struct xdma_sglist *sg, struct bus_dma_segment *seg, + uint32_t nsegs, struct xdma_request *xr); -#endif /* !_DEV_EXTRES_XDMA_H_ */ +/* Requests bank */ +void xchan_bank_init(xdma_channel_t *xchan); +int xchan_bank_free(xdma_channel_t *xchan); +struct xdma_request * xchan_bank_get(xdma_channel_t *xchan); +int xchan_bank_put(xdma_channel_t *xchan, struct xdma_request *xr); + +#endif /* !_DEV_XDMA_XDMA_H_ */ Added: head/sys/dev/xdma/xdma_bank.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xdma/xdma_bank.c Thu Apr 12 15:36:24 2018 (r332435) @@ -0,0 +1,99 @@ +/*- + * Copyright (c) 2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 "opt_platform.h" +#include +#include +#include +#include +#include +#include + +#include + +#include + +void +xchan_bank_init(xdma_channel_t *xchan) +{ + struct xdma_request *xr; + xdma_controller_t *xdma; + int i; + + xdma = xchan->xdma; + KASSERT(xdma != NULL, ("xdma is NULL")); + + xchan->xr_mem = malloc(sizeof(struct xdma_request) * xchan->xr_num, + M_XDMA, M_WAITOK | M_ZERO); + + for (i = 0; i < xchan->xr_num; i++) { + xr = &xchan->xr_mem[i]; + TAILQ_INSERT_TAIL(&xchan->bank, xr, xr_next); + } +} + +int +xchan_bank_free(xdma_channel_t *xchan) +{ + + free(xchan->xr_mem, M_XDMA); + + return (0); +} + +struct xdma_request * +xchan_bank_get(xdma_channel_t *xchan) +{ + struct xdma_request *xr; + struct xdma_request *xr_tmp; + + QUEUE_BANK_LOCK(xchan); + TAILQ_FOREACH_SAFE(xr, &xchan->bank, xr_next, xr_tmp) { + TAILQ_REMOVE(&xchan->bank, xr, xr_next); + break; + } + QUEUE_BANK_UNLOCK(xchan); + + return (xr); +} + +int +xchan_bank_put(xdma_channel_t *xchan, struct xdma_request *xr) +{ + + QUEUE_BANK_LOCK(xchan); + TAILQ_INSERT_TAIL(&xchan->bank, xr, xr_next); + QUEUE_BANK_UNLOCK(xchan); + + return (0); +} Added: head/sys/dev/xdma/xdma_bio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xdma/xdma_bio.c Thu Apr 12 15:36:24 2018 (r332435) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2017-2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 "opt_platform.h" +#include +#include +#include +#include +#include +#include + +#include + +#include + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Apr 12 15:47:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 312B4F9F12F; Thu, 12 Apr 2018 15:47:48 +0000 (UTC) (envelope-from benno@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 D834485EB8; Thu, 12 Apr 2018 15:47:47 +0000 (UTC) (envelope-from benno@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 D3127552C; Thu, 12 Apr 2018 15:47:47 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CFllPp089097; Thu, 12 Apr 2018 15:47:47 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CFllRY089095; Thu, 12 Apr 2018 15:47:47 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804121547.w3CFllRY089095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 12 Apr 2018 15:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332436 - head/usr.bin/mkimg X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/usr.bin/mkimg X-SVN-Commit-Revision: 332436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 15:47:48 -0000 Author: benno Date: Thu Apr 12 15:47:47 2018 New Revision: 332436 URL: https://svnweb.freebsd.org/changeset/base/332436 Log: Add the ability to specify absolute and relative offsets to size partitions. To create hybrid boot media we want to specify a partition at a known location. This extends the syntax of size partitions to include an optional offset that can be absolute or relative. It also introduces validation to make sure that this hasn't resulted in overlapping partitions. I haven't added this to the file and process partition specifications yet but the mechanics are designed such that if someone comes up with a good way of specifying the offset it will be fairly easy to add in. Reviewed by: imp Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14916 Modified: head/usr.bin/mkimg/mkimg.c head/usr.bin/mkimg/scheme.h Modified: head/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Thu Apr 12 15:36:24 2018 (r332435) +++ head/usr.bin/mkimg/mkimg.c Thu Apr 12 15:47:47 2018 (r332436) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -170,13 +171,14 @@ usage(const char *why) print_schemes(1); fputc('\n', stderr); fprintf(stderr, " partition specification:\n"); - fprintf(stderr, "\t[/]::\t- empty partition of given " - "size\n"); - fprintf(stderr, "\t[/]:=\t- partition content and size " - "are determined\n\t\t\t\t by the named file\n"); - fprintf(stderr, "\t[/]:-\t- partition content and size " - "are taken from\n\t\t\t\t the output of the command to run\n"); - fprintf(stderr, "\t-\t\t\t- unused partition entry\n"); + fprintf(stderr, "\t[/]::[:[+]]\t- " + "empty partition of given size and\n\t\t\t\t\t" + " optional relative or absolute offset\n"); + fprintf(stderr, "\t[/]:=\t\t- partition content and size " + "are\n\t\t\t\t\t determined by the named file\n"); + fprintf(stderr, "\t[/]:-\t\t- partition content and size " + "are taken\n\t\t\t\t\t from the output of the command to run\n"); + fprintf(stderr, "\t-\t\t\t\t- unused partition entry\n"); fprintf(stderr, "\t where:\n"); fprintf(stderr, "\t\t\t- scheme neutral partition type\n"); fprintf(stderr, "\t\t\t- optional scheme-dependent partition " @@ -397,12 +399,48 @@ capacity_resize(lba_t end) } static void +mkimg_validate(void) +{ + struct part *part, *part2; + lba_t start, end, start2, end2; + int i, j; + + i = 0; + + TAILQ_FOREACH(part, &partlist, link) { + start = part->block; + end = part->block + part->size; + j = i + 1; + part2 = TAILQ_NEXT(part, link); + if (part2 == NULL) + break; + + TAILQ_FOREACH_FROM(part2, &partlist, link) { + start2 = part2->block; + end2 = part2->block + part2->size; + + if ((start >= start2 && start < end2) || + (end > start2 && end <= end2)) { + errx(1, "partition %d overlaps partition %d", + i, j); + } + + j++; + } + + i++; + } +} + +static void mkimg(void) { FILE *fp; struct part *part; - lba_t block; - off_t bytesize; + lba_t block, blkoffset; + off_t bytesize, byteoffset; + char *size, *offset; + bool abs_offset; int error, fd; /* First check partition information */ @@ -413,17 +451,46 @@ mkimg(void) } block = scheme_metadata(SCHEME_META_IMG_START, 0); + abs_offset = false; TAILQ_FOREACH(part, &partlist, link) { - block = scheme_metadata(SCHEME_META_PART_BEFORE, block); - if (verbose) - fprintf(stderr, "partition %d: starting block %llu " - "... ", part->index + 1, (long long)block); - part->block = block; + byteoffset = blkoffset = 0; + abs_offset = false; + + /* Look for an offset. Set size too if we can. */ switch (part->kind) { case PART_KIND_SIZE: - if (expand_number(part->contents, &bytesize) == -1) + offset = part->contents; + size = strsep(&offset, ":"); + if (expand_number(size, &bytesize) == -1) error = errno; + if (offset != NULL) { + if (*offset != '+') { + abs_offset = true; + offset++; + } + if (expand_number(offset, &byteoffset) == -1) + error = errno; + } break; + } + + /* Work out exactly where the partition starts. */ + blkoffset = (byteoffset + secsz - 1) / secsz; + if (abs_offset) { + part->block = scheme_metadata(SCHEME_META_PART_ABSOLUTE, + blkoffset); + } else { + block = scheme_metadata(SCHEME_META_PART_BEFORE, + block + blkoffset); + part->block = block; + } + + if (verbose) + fprintf(stderr, "partition %d: starting block %llu " + "... ", part->index + 1, (long long)part->block); + + /* Pull in partition contents, set size if we haven't yet. */ + switch (part->kind) { case PART_KIND_FILE: fd = open(part->contents, O_RDONLY, 0); if (fd != -1) { @@ -449,10 +516,25 @@ mkimg(void) bytesize = part->size * secsz; fprintf(stderr, "size %llu bytes (%llu blocks)\n", (long long)bytesize, (long long)part->size); + if (abs_offset) { + fprintf(stderr, + " location %llu bytes (%llu blocks)\n", + (long long)byteoffset, + (long long)blkoffset); + } else if (blkoffset > 0) { + fprintf(stderr, + " offset %llu bytes (%llu blocks)\n", + (long long)byteoffset, + (long long)blkoffset); + } } - block = scheme_metadata(SCHEME_META_PART_AFTER, - part->block + part->size); + if (!abs_offset) { + block = scheme_metadata(SCHEME_META_PART_AFTER, + part->block + part->size); + } } + + mkimg_validate(); block = scheme_metadata(SCHEME_META_IMG_END, block); error = image_set_size(block); Modified: head/usr.bin/mkimg/scheme.h ============================================================================== --- head/usr.bin/mkimg/scheme.h Thu Apr 12 15:36:24 2018 (r332435) +++ head/usr.bin/mkimg/scheme.h Thu Apr 12 15:47:47 2018 (r332436) @@ -65,10 +65,11 @@ struct mkimg_scheme { const char *description; struct mkimg_alias *aliases; lba_t (*metadata)(u_int, lba_t); -#define SCHEME_META_IMG_START 1 -#define SCHEME_META_IMG_END 2 -#define SCHEME_META_PART_BEFORE 3 -#define SCHEME_META_PART_AFTER 4 +#define SCHEME_META_IMG_START 1 +#define SCHEME_META_IMG_END 2 +#define SCHEME_META_PART_BEFORE 3 +#define SCHEME_META_PART_AFTER 4 +#define SCHEME_META_PART_ABSOLUTE 5 int (*write)(lba_t, void *); u_int nparts; u_int labellen; From owner-svn-src-all@freebsd.org Thu Apr 12 15:50:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84AF9F9F43D; Thu, 12 Apr 2018 15:50:20 +0000 (UTC) (envelope-from benno@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 37745860EE; Thu, 12 Apr 2018 15:50:20 +0000 (UTC) (envelope-from benno@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 3264A5536; Thu, 12 Apr 2018 15:50:20 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CFoJ1p089243; Thu, 12 Apr 2018 15:50:19 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CFoJsE089242; Thu, 12 Apr 2018 15:50:19 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804121550.w3CFoJsE089242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 12 Apr 2018 15:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332437 - head/usr.bin/etdump X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/usr.bin/etdump X-SVN-Commit-Revision: 332437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 15:50:20 -0000 Author: benno Date: Thu Apr 12 15:50:19 2018 New Revision: 332437 URL: https://svnweb.freebsd.org/changeset/base/332437 Log: Check the return value of fseek. Reported by: Coverity CID: 1388267 Sponsored by: iXsystems, Inc. Modified: head/usr.bin/etdump/etdump.c Modified: head/usr.bin/etdump/etdump.c ============================================================================== --- head/usr.bin/etdump/etdump.c Thu Apr 12 15:47:47 2018 (r332436) +++ head/usr.bin/etdump/etdump.c Thu Apr 12 15:50:19 2018 (r332437) @@ -80,7 +80,9 @@ static int read_sector(FILE *iso, daddr_t sector, char *buffer) { - fseek(iso, sector * ISO_DEFAULT_BLOCK_SIZE, SEEK_SET); + if (fseek(iso, sector * ISO_DEFAULT_BLOCK_SIZE, SEEK_SET) != 0) { + return (errno); + } if (fread(buffer, ISO_DEFAULT_BLOCK_SIZE, 1, iso) != 1) { return (errno); } From owner-svn-src-all@freebsd.org Thu Apr 12 16:44:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 433DEFA3132; Thu, 12 Apr 2018 16:44:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB99C71289; Thu, 12 Apr 2018 16:44:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 394A810AFCD; Thu, 12 Apr 2018 12:44:19 -0400 (EDT) From: John Baldwin To: Slawa Olhovchenkov Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332091 - stable/11/sys/vm Date: Thu, 12 Apr 2018 09:24:15 -0700 Message-ID: <2836835.6EQUElDheF@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180411214935.GQ4305@zxy.spb.ru> References: <201804060925.w369P8c2019558@repo.freebsd.org> <2552898.N5SmTfmv87@ralph.baldwin.cx> <20180411214935.GQ4305@zxy.spb.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 12 Apr 2018 12:44:19 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 16:44:20 -0000 On Thursday, April 12, 2018 12:49:35 AM Slawa Olhovchenkov wrote: > On Wed, Apr 11, 2018 at 02:27:48PM -0700, John Baldwin wrote: > > > On Wednesday, April 11, 2018 10:49:20 PM Konstantin Belousov wrote: > > > On Wed, Apr 11, 2018 at 08:52:08AM -0700, John Baldwin wrote: > > > > On Monday, April 09, 2018 07:29:09 PM Slawa Olhovchenkov wrote: > > > > > On Fri, Apr 06, 2018 at 09:25:08AM +0000, Konstantin Belousov wrote: > > > > > > > > > > > Author: kib > > > > > > Date: Fri Apr 6 09:25:08 2018 > > > > > > New Revision: 332091 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/332091 > > > > > > > > > > > > Log: > > > > > > MFC r331760: > > > > > > Make vm_map_max/min/pmap KBI stable. > > > > > > > > > > > > Modified: > > > > > > stable/11/sys/vm/vm_map.c > > > > > > stable/11/sys/vm/vm_map.h > > > > > > Directory Properties: > > > > > > stable/11/ (props changed) > > > > > > > > > > -STABLE still crashed after load vboxnet build on 11.1-RELEASE > > > > > nvidia (build on 11.1-RELEASE) also don't work > > > > > > > > Yes, this only helps with the future KBI, it doesn't restore the > > > > existing one. However, r320889 which was committed earlier should > > > > have restored the KBI? > > > > > > I am not sure. It might have, but there might be more breakage > > > accumulated. My current opinion is that both vbox and nvidia (as well as > > > in-tree and out of tree drm modules) must be marked as tied. The modules > > > definitely depends on much more kernel interfaces than a typical HBA or > > > network controller driver, for which the stability claim is actually > > > intended to apply. > > > > I do think virtualbox is probably too hard to make work, but I didn't think > > the nvidia driver was that bad. > > > > I think that for kmods in ports we should consider moving to a different model > > than we currently do where the port installs the source for the kernel > > module to a standard location and we could have a way to rebuild all of the > > modules as needed. This would permit us to provide PORTS_MODULES-type > > functionality via either ports or packages (and it is a bit more flexible as > > you wouldn't to deinstall/reinstall the package each time you just wanted to > > rebuild the kernel module). > > > > I would suggest something like /usr/local/src/modules/ and a > > 'LOCAL_MODULES' kernel option that is a list of ' ' to replace > > PORTS_MODULES. A package could still ship an initial module by default, but > > recompiling the module would either overwrite it, or if the module is built as > > part of the kernel (via LOCAL_MODULES) the new one would be installed with the > > kernel itself into /boot/kernel leaving the one from the package in > > /boot/modules. For tied modules we could simply build it with a strict > > MODULE_DEPEND line on the kernel so that the pre-built module won't load on > > newer kernels and then encourage the user to use LOCAL_MODULES in pkg-message. > > Using LOCAL_MODULES would be better than PORTS_MODULES as it would DTRT if you > > move kernel to kernel.old during an upgrade, etc. > > Hmm, what about packages? I am use nvidia driver as package. Yes, in this model, the package would include the necessary sources to rebuild the kernel module as part of the package, installed to /usr/local/src/modules/nvidia-driver or some such. The package could still install a pre-built module to /boot/modules/nvidia-driver.ko, but if you had 'options LOCAL_MODULES="nivida-driver" in your kernel config, then each time you built a kernel it would build an nvidia-driver.ko from /usr/local/src/modules/nvidia-driver that would be installed to /boot/kernel and would thus take precedence over the version in /boot/modules. For kernel modules that really need to be tied to the current kernel we would recommend using LOCAL_MODULES when using custom kernels in the pkg-message. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Apr 12 16:55:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDEBCFA3BFD; Thu, 12 Apr 2018 16:55:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57B6074412; Thu, 12 Apr 2018 16:55:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id A158B10AFD2; Thu, 12 Apr 2018 12:55:31 -0400 (EDT) From: John Baldwin To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332434 - head/sys/conf Date: Thu, 12 Apr 2018 09:48:10 -0700 Message-ID: <1777044.OCjZ8thPIn@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201804121512.w3CFCeHD074171@repo.freebsd.org> References: <201804121512.w3CFCeHD074171@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 12 Apr 2018 12:55:31 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 16:55:32 -0000 On Thursday, April 12, 2018 03:12:40 PM Ruslan Bukin wrote: > Author: br > Date: Thu Apr 12 15:12:40 2018 > New Revision: 332434 > URL: https://svnweb.freebsd.org/changeset/base/332434 > > Log: > Add ld emulation types for hard-float mipses. > > Sponsored by: DARPA, AFRL We actually shouldn't need hf kernels anymore. HAVE_FPU has been removed and any mips kernel works fine with either hard or soft float userlands. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Apr 12 17:00:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 012D5FA410E; Thu, 12 Apr 2018 17:00:37 +0000 (UTC) (envelope-from benno@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 AB7AA764E6; Thu, 12 Apr 2018 17:00:36 +0000 (UTC) (envelope-from benno@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 A679C60A1; Thu, 12 Apr 2018 17:00:36 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CH0aGd024977; Thu, 12 Apr 2018 17:00:36 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CH0aDk024976; Thu, 12 Apr 2018 17:00:36 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804121700.w3CH0aDk024976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 12 Apr 2018 17:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332438 - head/usr.bin/etdump X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/usr.bin/etdump X-SVN-Commit-Revision: 332438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 17:00:37 -0000 Author: benno Date: Thu Apr 12 17:00:36 2018 New Revision: 332438 URL: https://svnweb.freebsd.org/changeset/base/332438 Log: Remove a debugging printf that crept in. Sponsored by: iXsystems, Inc. Modified: head/usr.bin/etdump/etdump.c Modified: head/usr.bin/etdump/etdump.c ============================================================================== --- head/usr.bin/etdump/etdump.c Thu Apr 12 15:50:19 2018 (r332437) +++ head/usr.bin/etdump/etdump.c Thu Apr 12 17:00:36 2018 (r332438) @@ -257,7 +257,6 @@ main(int argc, char **argv) argv += optind; for (i = 0; i < argc; i++) { - printf("%d %s\n", optind, argv[i]); if (strcmp(argv[i], "-") == 0) { iso = stdin; } else { From owner-svn-src-all@freebsd.org Thu Apr 12 17:05:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B16D6FA46DF; Thu, 12 Apr 2018 17:05:28 +0000 (UTC) (envelope-from gonzo@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 6271A76C4B; Thu, 12 Apr 2018 17:05:28 +0000 (UTC) (envelope-from gonzo@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 5B94F6226; Thu, 12 Apr 2018 17:05:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CH5SEA029717; Thu, 12 Apr 2018 17:05:28 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CH5S8H029716; Thu, 12 Apr 2018 17:05:28 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804121705.w3CH5S8H029716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 12 Apr 2018 17:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332439 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 332439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 17:05:28 -0000 Author: gonzo Date: Thu Apr 12 17:05:27 2018 New Revision: 332439 URL: https://svnweb.freebsd.org/changeset/base/332439 Log: Fix quotes in the example code in syslog(3) BUGS section mdoc treats verbatim quotes in .Dl as a string delimiter and does not pass them to the rendered output. Use special char \*q to specify double quote PR: 216755 MFC after: 3 days Modified: head/lib/libc/gen/syslog.3 Modified: head/lib/libc/gen/syslog.3 ============================================================================== --- head/lib/libc/gen/syslog.3 Thu Apr 12 17:00:36 2018 (r332438) +++ head/lib/libc/gen/syslog.3 Thu Apr 12 17:05:27 2018 (r332439) @@ -295,4 +295,4 @@ for later interpolation by .Pp Always use the proper secure idiom: .Pp -.Dl syslog(priority, "%s", string); +.Dl syslog(priority, \*q%s\*q, string); From owner-svn-src-all@freebsd.org Thu Apr 12 17:16:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 288B4FA51B0; Thu, 12 Apr 2018 17:16:14 +0000 (UTC) (envelope-from benno@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 CC8957A0DA; Thu, 12 Apr 2018 17:16:13 +0000 (UTC) (envelope-from benno@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 C529063B9; Thu, 12 Apr 2018 17:16:13 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CHGD2r034588; Thu, 12 Apr 2018 17:16:13 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CHGDcC034587; Thu, 12 Apr 2018 17:16:13 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804121716.w3CHGDcC034587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Thu, 12 Apr 2018 17:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332440 - head/usr.bin/mkimg X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/usr.bin/mkimg X-SVN-Commit-Revision: 332440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 17:16:14 -0000 Author: benno Date: Thu Apr 12 17:16:13 2018 New Revision: 332440 URL: https://svnweb.freebsd.org/changeset/base/332440 Log: Fix a conditional that got mucked up. Sponsored by: iXsystems, Inc. Modified: head/usr.bin/mkimg/mkimg.c Modified: head/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Thu Apr 12 17:05:27 2018 (r332439) +++ head/usr.bin/mkimg/mkimg.c Thu Apr 12 17:16:13 2018 (r332440) @@ -464,10 +464,10 @@ mkimg(void) if (expand_number(size, &bytesize) == -1) error = errno; if (offset != NULL) { - if (*offset != '+') { + if (*offset != '+') abs_offset = true; + else offset++; - } if (expand_number(offset, &byteoffset) == -1) error = errno; } From owner-svn-src-all@freebsd.org Thu Apr 12 17:43:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E401F8116A; Thu, 12 Apr 2018 17:43:21 +0000 (UTC) (envelope-from br@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 C88BA824C9; Thu, 12 Apr 2018 17:43:20 +0000 (UTC) (envelope-from br@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 AAFAC689A; Thu, 12 Apr 2018 17:43:20 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CHhKoh050021; Thu, 12 Apr 2018 17:43:20 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CHhJnu050013; Thu, 12 Apr 2018 17:43:19 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804121743.w3CHhJnu050013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 12 Apr 2018 17:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332441 - in head/sys: conf mips/beri mips/include mips/mips X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf mips/beri mips/include mips/mips X-SVN-Commit-Revision: 332441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 17:43:21 -0000 Author: br Date: Thu Apr 12 17:43:19 2018 New Revision: 332441 URL: https://svnweb.freebsd.org/changeset/base/332441 Log: Add SMP support for BERI CPU. Obtained from: CheriBSD Sponsored by: DARPA, AFRL Added: head/sys/mips/beri/beri_mp.c (contents, props changed) head/sys/mips/beri/beri_mp.h (contents, props changed) Modified: head/sys/conf/options.mips head/sys/mips/beri/files.beri head/sys/mips/beri/std.beri head/sys/mips/include/cpufunc.h head/sys/mips/include/hwfunc.h head/sys/mips/mips/mp_machdep.c Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Thu Apr 12 17:16:13 2018 (r332440) +++ head/sys/conf/options.mips Thu Apr 12 17:43:19 2018 (r332441) @@ -99,6 +99,7 @@ OCTEON_BOARD_CAPK_0100ND opt_cvmx.h # Options specific to the BERI platform. # BERI_LARGE_TLB opt_global.h +PLATFORM_INIT_SECONDARY opt_global.h # # Options that control the NetFPGA-10G Embedded CPU Ethernet Core. Added: head/sys/mips/beri/beri_mp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/beri/beri_mp.c Thu Apr 12 17:43:19 2018 (r332441) @@ -0,0 +1,309 @@ +/*- + * Copyright (c) 2017 Ruslan Bukin + * Copyright (c) 2012-2015 Robert N. M. Watson + * Copyright (c) 2013 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 + +struct spin_entry { + uint64_t entry_addr; + uint64_t a0; + uint32_t rsvd1; + uint32_t pir; + uint64_t rsvd2; +}; + +static phandle_t cpu_of_nodes[MAXCPU]; +static device_t picmap[MAXCPU]; + +int +platform_processor_id(void) +{ + int cpu; + + cpu = beri_get_cpu(); + + return (cpu); +} + +void +platform_cpu_mask(cpuset_t *mask) +{ + int ncores, ncpus, nthreads; + phandle_t cpus, cpu; + pcell_t reg; + char prop[16]; + struct spin_entry *se; + + ncores = beri_get_ncores(); + nthreads = beri_get_nthreads(); + KASSERT(ncores <= 0x10000, ("%s: too many cores %d", __func__, ncores)); + KASSERT(nthreads <= 0x10000, ("%s: too many threads %d", __func__, + nthreads)); + KASSERT(ncores < 0xffff || nthreads < 0xffff, + ("%s: cores x thread (%d x %d) would overflow", __func__, ncores, + nthreads)); + ncpus = ncores * nthreads; + if (MAXCPU > 1 && ncpus > MAXCPU) + printf("%s: Hardware supports more CPUs (%d) than kernel (%d)\n", + __func__, ncpus, MAXCPU); + printf("%s: hardware has %d cores with %d threads each\n", __func__, + ncores, nthreads); + + if ((cpus = OF_finddevice("/cpus")) <= 0) { + printf("%s: no \"/cpus\" device found in FDT\n", __func__); + goto error; + } + if ((cpu = OF_child(cpus)) <= 0) { + printf("%s: no children of \"/cpus\" found in FDT\n", __func__); + goto error; + } + CPU_ZERO(mask); + do { + if (OF_getprop(cpu, "reg", ®, sizeof(reg)) <= 0) { + printf("%s: cpu device with no reg property\n", + __func__); + goto error; + } + if (reg > MAXCPU) { + printf("%s: cpu ID too large (%d > %d)\n", __func__, + reg, MAXCPU); + continue; + } + cpu_of_nodes[reg] = cpu; + + if (reg != 0) { + if (OF_getprop(cpu, "enable-method", &prop, + sizeof(prop)) <= 0 && OF_getprop(OF_parent(cpu), + "enable-method", &prop, sizeof(prop)) <= 0) { + printf("%s: CPU %d has no enable-method " + "property\n", __func__, reg); + continue; + } + if (strcmp("spin-table", prop) != 0) { + printf("%s: CPU %d enable-method is '%s' not " + "'spin-table'\n", __func__, reg, prop); + continue; + } + + if (OF_getprop(cpu, "cpu-release-addr", &se, + sizeof(se)) <= 0) { + printf("%s: CPU %d has missing or invalid " + "cpu-release-addr\n", __func__, reg); + continue; + } + if (se->entry_addr != 1) { + printf("%s: CPU %d has uninitalized spin " + "entry\n", __func__, reg); + continue; + } + } + + CPU_SET(reg, mask); + } while ((cpu = OF_peer(cpu)) > 0); + return; + +error: + /* + * If we run into any problems determining the CPU layout, + * fall back to UP. + * + * XXX: panic instead? + */ + CPU_ZERO(mask); + CPU_SET(0, mask); +} + +void +platform_init_secondary(int cpuid) +{ + device_t ic; + int ipi; + + ipi = platform_ipi_hardintr_num(); + + ic = devclass_get_device(devclass_find("beripic"), cpuid); + picmap[cpuid] = ic; + beripic_setup_ipi(ic, cpuid, ipi); + + /* Unmask the interrupt */ + if (cpuid != 0) { + mips_wr_status(mips_rd_status() | (((1 << ipi) << 8) << 2)); + } +} + + +void +platform_ipi_send(int cpuid) +{ + + mips_sync(); /* Ordering, liveness. */ + + beripic_send_ipi(picmap[cpuid], cpuid); +} + +void +platform_ipi_clear(void) +{ + int cpuid; + + cpuid = platform_processor_id(); + + beripic_clear_ipi(picmap[cpuid], cpuid); +} + +/* + * XXXBED: Set via FDT? + */ +int +platform_ipi_hardintr_num(void) +{ + + return (4); +} + +int +platform_ipi_softintr_num(void) +{ + + return (-1); +} + +/* + * XXXBED: Fine for MT, will need something better for multi-core. + */ +struct cpu_group * +platform_smp_topo(void) +{ + + return (smp_topo_none()); +} + +void +platform_init_ap(int cpuid) +{ + uint32_t status; + u_int clock_int_mask; + + KASSERT(cpuid < MAXCPU, ("%s: invalid CPU id %d", __func__, cpuid)); + + /* Make sure coprocessors are enabled. */ + status = mips_rd_status(); + status |= (MIPS_SR_COP_0_BIT | MIPS_SR_COP_1_BIT); +#if defined(CPU_CHERI) + status |= MIPS_SR_COP_2_BIT; +#endif + mips_wr_status(status); + +#if 0 + register_t hwrena; + /* Enable HDWRD instruction in userspace. Also enables statcounters. */ + hwrena = mips_rd_hwrena(); + hwrena |= (MIPS_HWRENA_CC | MIPS_HWRENA_CCRES | MIPS_HWRENA_CPUNUM | + MIPS_HWRENA_BERI_STATCOUNTERS_MASK); + mips_wr_hwrena(hwrena); +#endif + + /* + * Enable per-thread timer. + */ + clock_int_mask = hard_int_mask(5); + set_intr_mask(clock_int_mask); +} + +/* + * BERI startup conforms to the spin-table start method defined in the + * ePAPR 1.0 spec. The initial spin waiting for an address is started + * by the CPU firmware. + */ +int +platform_start_ap(int cpuid) +{ + phandle_t cpu; + char prop[16]; + struct spin_entry *se; + + KASSERT(cpuid != 0, ("%s: can't start CPU 0!\n", __func__)); + KASSERT((cpuid > 0 && cpuid < MAXCPU), + ("%s: invalid CPU id %d", __func__, cpuid)); + + cpu = cpu_of_nodes[cpuid]; + if (OF_getprop(cpu, "status", &prop, sizeof(prop)) <= 0) { + if (bootverbose) + printf("%s: CPU %d has no status property, " + "trying parent\n", __func__, cpuid); + if (OF_getprop(OF_parent(cpu), "status", &prop, + sizeof(prop)) <= 0) + panic("%s: CPU %d has no status property", __func__, + cpuid); + } + if (strcmp("disabled", prop) != 0) + panic("%s: CPU %d status is '%s' not 'disabled'", + __func__, cpuid, prop); + + if (OF_getprop(cpu, "enable-method", &prop, sizeof(prop)) <= 0) { + if (bootverbose) + printf("%s: CPU %d has no enable-method, " + "trying parent\n", __func__, cpuid); + if (OF_getprop(OF_parent(cpu), "enable-method", &prop, + sizeof(prop)) <= 0) + panic("%s: CPU %d has no enable-method property", + __func__, cpuid); + } + if (strcmp("spin-table", prop) != 0) + panic("%s: CPU %d enable-method is '%s' not " + "'spin-table'", __func__, cpuid, prop); + + if (OF_getprop(cpu, "cpu-release-addr", &se, sizeof(se)) <= 0) + panic("%s: CPU %d has missing or invalid cpu-release-addr", + __func__, cpuid); + se->pir = cpuid; + if (bootverbose) + printf("%s: writing %p to %p\n", __func__, mpentry, + &se->entry_addr); + + mips_sync(); /* Ordering. */ + se->entry_addr = (intptr_t)mpentry; + mips_sync(); /* Liveness. */ + + return (0); +} Added: head/sys/mips/beri/beri_mp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/beri/beri_mp.h Thu Apr 12 17:43:19 2018 (r332441) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 2014 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-11-C-0249) + * ("MRC2"), as part of the DARPA MRC research programme. + * + * 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$ + */ + +static inline int +beri_get_core(void) +{ + uint32_t cinfo; + + cinfo = mips_rd_cinfo(); + return (cinfo & 0xffff); +} + +static inline int +beri_get_ncores(void) +{ + uint32_t cinfo; + + cinfo = mips_rd_cinfo(); + return ((cinfo >> 16) + 1); +} + +static inline int +beri_get_thread(void) +{ + uint32_t tinfo; + + tinfo = mips_rd_tinfo(); + return (tinfo & 0xffff); +} + +static inline int +beri_get_nthreads(void) +{ + uint32_t tinfo; + + tinfo = mips_rd_tinfo(); + return ((tinfo >> 16) + 1); +} + +static inline int +beri_get_cpu(void) +{ + + return ((beri_get_core() * beri_get_nthreads()) + beri_get_thread()); +} + +static inline int +beri_get_ncpus(void) +{ + + return(beri_get_ncores() * beri_get_nthreads()); +} + +void beripic_setup_ipi(device_t dev, u_int tid, u_int ipi_irq); +void beripic_send_ipi(device_t dev, u_int tid); +void beripic_clear_ipi(device_t dev, u_int tid); Modified: head/sys/mips/beri/files.beri ============================================================================== --- head/sys/mips/beri/files.beri Thu Apr 12 17:16:13 2018 (r332440) +++ head/sys/mips/beri/files.beri Thu Apr 12 17:43:19 2018 (r332441) @@ -21,5 +21,6 @@ dev/terasic/mtl/terasic_mtl_syscons.c optional terasic dev/terasic/mtl/terasic_mtl_text.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_vt.c optional terasic_mtl vt mips/beri/beri_machdep.c standard +mips/beri/beri_mp.c optional smp mips/beri/beri_pic.c optional fdt mips/mips/tick.c standard Modified: head/sys/mips/beri/std.beri ============================================================================== --- head/sys/mips/beri/std.beri Thu Apr 12 17:16:13 2018 (r332440) +++ head/sys/mips/beri/std.beri Thu Apr 12 17:43:19 2018 (r332441) @@ -4,3 +4,4 @@ files "../beri/files.beri" cpu CPU_MIPS4KC options BERI_LARGE_TLB +options PLATFORM_INIT_SECONDARY Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Thu Apr 12 17:16:13 2018 (r332440) +++ head/sys/mips/include/cpufunc.h Thu Apr 12 17:43:19 2018 (r332441) @@ -279,6 +279,8 @@ MIPS_RW32_COP0(entrylo0, MIPS_COP_0_TLB_LO0); MIPS_RW32_COP0(entrylo1, MIPS_COP_0_TLB_LO1); #endif MIPS_RW32_COP0(prid, MIPS_COP_0_PRID); +MIPS_RW32_COP0_SEL(cinfo, MIPS_COP_0_PRID, 6); +MIPS_RW32_COP0_SEL(tinfo, MIPS_COP_0_PRID, 7); /* XXX 64-bit? */ MIPS_RW32_COP0_SEL(ebase, MIPS_COP_0_PRID, 1); Modified: head/sys/mips/include/hwfunc.h ============================================================================== --- head/sys/mips/include/hwfunc.h Thu Apr 12 17:16:13 2018 (r332440) +++ head/sys/mips/include/hwfunc.h Thu Apr 12 17:43:19 2018 (r332441) @@ -72,6 +72,13 @@ void platform_init_ap(int processor_id); int platform_ipi_hardintr_num(void); int platform_ipi_softintr_num(void); +#ifdef PLATFORM_INIT_SECONDARY +/* + * Set up IPIs for this CPU. + */ +void platform_init_secondary(int cpuid); +#endif + /* * Trigger a IPI interrupt on 'cpuid'. */ Modified: head/sys/mips/mips/mp_machdep.c ============================================================================== --- head/sys/mips/mips/mp_machdep.c Thu Apr 12 17:16:13 2018 (r332440) +++ head/sys/mips/mips/mp_machdep.c Thu Apr 12 17:43:19 2018 (r332441) @@ -304,6 +304,10 @@ smp_init_secondary(u_int32_t cpuid) while (!aps_ready) ; +#ifdef PLATFORM_INIT_SECONDARY + platform_init_secondary(cpuid); +#endif + /* Initialize curthread. */ KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread")); PCPU_SET(curthread, PCPU_GET(idlethread)); @@ -343,6 +347,10 @@ release_aps(void *dummy __unused) if (mp_ncpus == 1) return; + +#ifdef PLATFORM_INIT_SECONDARY + platform_init_secondary(0); +#endif /* * IPI handler From owner-svn-src-all@freebsd.org Thu Apr 12 17:47:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F409BF816F8; Thu, 12 Apr 2018 17:47:36 +0000 (UTC) (envelope-from gonzo@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 A703682941; Thu, 12 Apr 2018 17:47:36 +0000 (UTC) (envelope-from gonzo@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 A1AAE68A6; Thu, 12 Apr 2018 17:47:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CHlaNm050332; Thu, 12 Apr 2018 17:47:36 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CHla7Q050331; Thu, 12 Apr 2018 17:47:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804121747.w3CHla7Q050331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 12 Apr 2018 17:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332442 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 332442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 17:47:37 -0000 Author: gonzo Date: Thu Apr 12 17:47:36 2018 New Revision: 332442 URL: https://svnweb.freebsd.org/changeset/base/332442 Log: Bump .Dd value (forgot to do this in r332439) MFC after: 3 days X-MFC-With: 332439 Modified: head/lib/libc/gen/syslog.3 Modified: head/lib/libc/gen/syslog.3 ============================================================================== --- head/lib/libc/gen/syslog.3 Thu Apr 12 17:43:19 2018 (r332441) +++ head/lib/libc/gen/syslog.3 Thu Apr 12 17:47:36 2018 (r332442) @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 6, 2018 +.Dd April 12, 2018 .Dt SYSLOG 3 .Os .Sh NAME From owner-svn-src-all@freebsd.org Thu Apr 12 17:51:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A98ACF81CFD; Thu, 12 Apr 2018 17:51:03 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) (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 4985B833D9; Thu, 12 Apr 2018 17:51:03 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:12413) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1f6gN6-00085K-fI (Exim 4.89_2) (return-path ); Thu, 12 Apr 2018 18:50:56 +0100 Date: Thu, 12 Apr 2018 18:41:37 +0100 From: Ruslan Bukin To: John Baldwin Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332434 - head/sys/conf Message-ID: <20180412174137.GA41515@bsdpad.com> References: <201804121512.w3CFCeHD074171@repo.freebsd.org> <1777044.OCjZ8thPIn@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1777044.OCjZ8thPIn@ralph.baldwin.cx> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 17:51:03 -0000 On Thu, Apr 12, 2018 at 09:48:10AM -0700, John Baldwin wrote: > On Thursday, April 12, 2018 03:12:40 PM Ruslan Bukin wrote: > > Author: br > > Date: Thu Apr 12 15:12:40 2018 > > New Revision: 332434 > > URL: https://svnweb.freebsd.org/changeset/base/332434 > > > > Log: > > Add ld emulation types for hard-float mipses. > > > > Sponsored by: DARPA, AFRL > > We actually shouldn't need hf kernels anymore. HAVE_FPU has been removed > and any mips kernel works fine with either hard or soft float userlands. > Ok I will work on removing hf targets. This should be kept I think until we remove them. Thanks Ruslan From owner-svn-src-all@freebsd.org Thu Apr 12 17:55:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0CDBF821BD; Thu, 12 Apr 2018 17:55:25 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) (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 34BC985B18; Thu, 12 Apr 2018 17:55:25 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:48337) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1f6gRP-000Avn-ft (Exim 4.89_2) (return-path ); Thu, 12 Apr 2018 18:55:24 +0100 Date: Thu, 12 Apr 2018 18:46:04 +0100 From: Ruslan Bukin To: John Baldwin Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332434 - head/sys/conf Message-ID: <20180412174604.GA41648@bsdpad.com> References: <201804121512.w3CFCeHD074171@repo.freebsd.org> <1777044.OCjZ8thPIn@ralph.baldwin.cx> <20180412174137.GA41515@bsdpad.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180412174137.GA41515@bsdpad.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 17:55:25 -0000 On Thu, Apr 12, 2018 at 06:41:37PM +0100, Ruslan Bukin wrote: > On Thu, Apr 12, 2018 at 09:48:10AM -0700, John Baldwin wrote: > > On Thursday, April 12, 2018 03:12:40 PM Ruslan Bukin wrote: > > > Author: br > > > Date: Thu Apr 12 15:12:40 2018 > > > New Revision: 332434 > > > URL: https://svnweb.freebsd.org/changeset/base/332434 > > > > > > Log: > > > Add ld emulation types for hard-float mipses. > > > > > > Sponsored by: DARPA, AFRL > > > > We actually shouldn't need hf kernels anymore. HAVE_FPU has been removed > > and any mips kernel works fine with either hard or soft float userlands. > > > > Ok I will work on removing hf targets. This should be kept I think until we remove them. > Oh sorry this is for kernels only. Ok I will revert this then. Ruslan From owner-svn-src-all@freebsd.org Thu Apr 12 18:23:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6205F842F6; Thu, 12 Apr 2018 18:23:16 +0000 (UTC) (envelope-from brooks@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 636A36BC35; Thu, 12 Apr 2018 18:23:16 +0000 (UTC) (envelope-from brooks@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 5E4156F01; Thu, 12 Apr 2018 18:23:16 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CINGwt070667; Thu, 12 Apr 2018 18:23:16 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CINEHl070653; Thu, 12 Apr 2018 18:23:14 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804121823.w3CINEHl070653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 12 Apr 2018 18:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332443 - in head/lib/libc: amd64 amd64/sys gen i386 i386/sys mips/sys powerpc powerpc/sys powerpc64 powerpc64/sys sparc64 sparc64/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/lib/libc: amd64 amd64/sys gen i386 i386/sys mips/sys powerpc powerpc/sys powerpc64 powerpc64/sys sparc64 sparc64/sys X-SVN-Commit-Revision: 332443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 18:23:17 -0000 Author: brooks Date: Thu Apr 12 18:23:14 2018 New Revision: 332443 URL: https://svnweb.freebsd.org/changeset/base/332443 Log: Replace MD assembly exect() with a portable version. Originally, on the VAX exect() enable tracing once the new executable image was loaded. This was possible because tracing was controllable through user space code by setting the PSL_T flag. The following instruction is a system call that activated tracing (as all instructions do) by copying PSL_T to PSL_TP (trace pending). The first instruction of the new executable image would trigger a trace fault. This is not portable to all platforms and the behavior was replaced with ptrace(PT_TRACE_ME, ...) since FreeBSD forked off of the CSRG repository. Platforms either incorrectly call execve(), trigger trace faults inside the original executable, or do contain an implementation of this function. The exect() interfaces is deprecated or removed on NetBSD and OpenBSD. Submitted by: Ali Mashtizadeh Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D14989 Added: head/lib/libc/gen/exect.c (contents, props changed) Deleted: head/lib/libc/amd64/sys/exect.S head/lib/libc/i386/sys/exect.S head/lib/libc/mips/sys/exect.S head/lib/libc/powerpc/sys/exect.S head/lib/libc/powerpc64/sys/exect.S head/lib/libc/sparc64/sys/exect.S Modified: head/lib/libc/amd64/Symbol.map head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/i386/Symbol.map head/lib/libc/i386/sys/Makefile.inc head/lib/libc/mips/sys/Makefile.inc head/lib/libc/powerpc/Symbol.map head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/powerpc64/Symbol.map head/lib/libc/powerpc64/sys/Makefile.inc head/lib/libc/sparc64/Symbol.map head/lib/libc/sparc64/sys/Makefile.inc Modified: head/lib/libc/amd64/Symbol.map ============================================================================== --- head/lib/libc/amd64/Symbol.map Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/amd64/Symbol.map Thu Apr 12 18:23:14 2018 (r332443) @@ -40,7 +40,6 @@ FBSD_1.0 { amd64_set_fsbase; amd64_set_gsbase; brk; - exect; sbrk; vfork; }; Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/amd64/sys/Makefile.inc Thu Apr 12 18:23:14 2018 (r332443) @@ -8,8 +8,7 @@ SRCS+= \ amd64_set_fsbase.c \ amd64_set_gsbase.c -MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S +MDASM= vfork.S brk.S cerror.S getcontext.S sbrk.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/gen/Makefile.inc Thu Apr 12 18:23:14 2018 (r332443) @@ -41,6 +41,7 @@ SRCS+= __getosreldate.c \ errlst.c \ errno.c \ exec.c \ + exect.c \ fdevname.c \ feature_present.c \ fmtcheck.c \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/gen/Symbol.map Thu Apr 12 18:23:14 2018 (r332443) @@ -105,6 +105,7 @@ FBSD_1.0 { sys_errlist; sys_nerr; errno; + exect; execl; execle; execlp; Added: head/lib/libc/gen/exect.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/exect.c Thu Apr 12 18:23:14 2018 (r332443) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2018 Ali Mashtizadeh + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include + +int +exect(const char *path, char *const argv[], char *const envp[]) +{ + + if (ptrace(PT_TRACE_ME, 0, 0, 0) != 0) { + if (errno != EBUSY) + return (-1); + } + + return (execve(path, argv, envp)); +} Modified: head/lib/libc/i386/Symbol.map ============================================================================== --- head/lib/libc/i386/Symbol.map Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/i386/Symbol.map Thu Apr 12 18:23:14 2018 (r332443) @@ -31,7 +31,6 @@ FBSD_1.0 { ntohs; vfork; brk; - exect; i386_clr_watch; i386_get_fsbase; i386_get_gsbase; Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/i386/sys/Makefile.inc Thu Apr 12 18:23:14 2018 (r332443) @@ -7,8 +7,7 @@ SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c -MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S syscall.S +MDASM= Ovfork.S brk.S cerror.S getcontext.S sbrk.S syscall.S NOASM+= vfork.o Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/mips/sys/Makefile.inc Thu Apr 12 18:23:14 2018 (r332443) @@ -2,8 +2,7 @@ SRCS+= trivial-vdso_tc.c -MDASM= Ovfork.S brk.S cerror.S exect.S \ - sbrk.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM+= vfork.o Modified: head/lib/libc/powerpc/Symbol.map ============================================================================== --- head/lib/libc/powerpc/Symbol.map Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/powerpc/Symbol.map Thu Apr 12 18:23:14 2018 (r332443) @@ -33,7 +33,6 @@ FBSD_1.0 { ntohl; ntohs; brk; - exect; sbrk; vfork; }; Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/powerpc/sys/Makefile.inc Thu Apr 12 18:23:14 2018 (r332443) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S +MDASM+= brk.S cerror.S sbrk.S Modified: head/lib/libc/powerpc64/Symbol.map ============================================================================== --- head/lib/libc/powerpc64/Symbol.map Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/powerpc64/Symbol.map Thu Apr 12 18:23:14 2018 (r332443) @@ -33,7 +33,6 @@ FBSD_1.0 { ntohl; ntohs; brk; - exect; sbrk; vfork; }; Modified: head/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/powerpc64/sys/Makefile.inc Thu Apr 12 18:23:14 2018 (r332443) @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S +MDASM+= brk.S cerror.S sbrk.S Modified: head/lib/libc/sparc64/Symbol.map ============================================================================== --- head/lib/libc/sparc64/Symbol.map Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/sparc64/Symbol.map Thu Apr 12 18:23:14 2018 (r332443) @@ -33,7 +33,6 @@ FBSD_1.0 { ntohl; ntohs; brk; - exect; sbrk; vfork; @@ -82,8 +81,6 @@ FBSDprivate_1.0 { __siglongjmp; __sys_brk; _brk; - __sys_exect; - _exect; _end; __sys_sbrk; _sbrk; Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Thu Apr 12 17:47:36 2018 (r332442) +++ head/lib/libc/sparc64/sys/Makefile.inc Thu Apr 12 18:23:14 2018 (r332443) @@ -12,4 +12,4 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S sbrk.S sigaction1.S +MDASM+= brk.S cerror.S sbrk.S sigaction1.S From owner-svn-src-all@freebsd.org Thu Apr 12 18:24:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C0D1F843CC; Thu, 12 Apr 2018 18:24:01 +0000 (UTC) (envelope-from brooks@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 9B38C6BDD6; Thu, 12 Apr 2018 18:24:00 +0000 (UTC) (envelope-from brooks@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 9630D6F0B; Thu, 12 Apr 2018 18:24:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CIO0DX070738; Thu, 12 Apr 2018 18:24:00 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CIO0GD070737; Thu, 12 Apr 2018 18:24:00 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804121824.w3CIO0GD070737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 12 Apr 2018 18:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332444 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 332444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 18:24:01 -0000 Author: brooks Date: Thu Apr 12 18:24:00 2018 New Revision: 332444 URL: https://svnweb.freebsd.org/changeset/base/332444 Log: Allow -DNO_CLEAN builds across r332443. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 12 18:23:14 2018 (r332443) +++ head/Makefile.inc1 Thu Apr 12 18:24:00 2018 (r332444) @@ -808,7 +808,8 @@ _cleanobj_fast_depend_hack: .PHONY # 20180404 r332048 sigreturn # 20180405 r332080 shmat # 20180406 r332119 setlogin -.for f in fstat fstatat fstatfs getdirentries getfsstat setlogin shmat sigreturn statfs +# 20170411 r332443 exect +.for f in exect fstat fstatat fstatfs getdirentries getfsstat setlogin shmat sigreturn statfs .if exists(${OBJTOP}/lib/libc/.depend.${f}.o) @if egrep -qw '${f}\.[sS]' \ ${OBJTOP}/lib/libc/.depend.${f}.o; then \ From owner-svn-src-all@freebsd.org Thu Apr 12 18:25:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8438F846C1; Thu, 12 Apr 2018 18:25:53 +0000 (UTC) (envelope-from brooks@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 878A76C509; Thu, 12 Apr 2018 18:25:53 +0000 (UTC) (envelope-from brooks@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 7EEFB6F13; Thu, 12 Apr 2018 18:25:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CIPr1Z070845; Thu, 12 Apr 2018 18:25:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CIPriX070844; Thu, 12 Apr 2018 18:25:53 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804121825.w3CIPriX070844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 12 Apr 2018 18:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332445 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 332445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 18:25:54 -0000 Author: brooks Date: Thu Apr 12 18:25:53 2018 New Revision: 332445 URL: https://svnweb.freebsd.org/changeset/base/332445 Log: Add fpa.4.gz missing in the removal of FDDI in r332412. Reported by: trasz Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Apr 12 18:24:00 2018 (r332444) +++ head/ObsoleteFiles.inc Thu Apr 12 18:25:53 2018 (r332445) @@ -40,6 +40,7 @@ # 20180409: remove FDDI support OLD_FILES+=usr/include/net/fddi.h +OLD_FILES+=usr/share/man/man4/fpa.4.gz # 20180319: remove /boot/overlays, replaced by /boot/dtb/overlays OLD_DIRS+=boot/overlays # 20180311: remove sys/sys/i386/include/pcaudioio.h From owner-svn-src-all@freebsd.org Thu Apr 12 19:00:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A55C2F87421; Thu, 12 Apr 2018 19:00:22 +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 5C26375F86; Thu, 12 Apr 2018 19:00:22 +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 55DFD743D; Thu, 12 Apr 2018 19:00:22 +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 w3CJ0MbC087568; Thu, 12 Apr 2018 19:00:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CJ0MLL087567; Thu, 12 Apr 2018 19:00:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804121900.w3CJ0MLL087567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Apr 2018 19:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332446 - head/release/i386 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/release/i386 X-SVN-Commit-Revision: 332446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 19:00:22 -0000 Author: emaste Date: Thu Apr 12 19:00:22 2018 New Revision: 332446 URL: https://svnweb.freebsd.org/changeset/base/332446 Log: switch i386 memstick installer images to MBR Some BIOSes have trouble booting from GPT in non-UEFI mode. This is commonly reported with Lenovo laptops, including my x220. As we do not currently support booting FreeBSD/i386 via UEFI there's no reason to prefer GPT. The "vestigial swap partition" was added in r265017 to work around an issue with loader's GPT support, so we should not need it when using MBR. We may want to make the same change to amd64, although the issue there is mitigated by such systems booting via UEFI in the common case. PR: 227422 Reviewed by: gjb MFC after: 3 weeks Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: head/release/i386/make-memstick.sh Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Thu Apr 12 18:25:53 2018 (r332445) +++ head/release/i386/make-memstick.sh Thu Apr 12 19:00:22 2018 (r332446) @@ -36,11 +36,9 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt \ - -b ${1}/boot/pmbr \ - -p freebsd-boot:=${1}/boot/gptboot \ - -p freebsd-ufs:=${2}.part \ - -p freebsd-swap::1M \ +mkimg -s mbr \ + -b ${1}/boot/mbr \ + -p freebsd:-"mkimg -s bsd -b ${1}/boot/boot -p freebsd-ufs:=${2}.part" \ -o ${2} rm ${2}.part From owner-svn-src-all@freebsd.org Thu Apr 12 19:06:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8F9BF87C6B; Thu, 12 Apr 2018 19:06:15 +0000 (UTC) (envelope-from shurd@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 8C01076557; Thu, 12 Apr 2018 19:06:15 +0000 (UTC) (envelope-from shurd@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 86DCA75DD; Thu, 12 Apr 2018 19:06:15 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CJ6Fb8092139; Thu, 12 Apr 2018 19:06:15 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CJ6FZo092138; Thu, 12 Apr 2018 19:06:15 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201804121906.w3CJ6FZo092138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 12 Apr 2018 19:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332447 - stable/11/sys/dev/ixgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/11/sys/dev/ixgbe X-SVN-Commit-Revision: 332447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 19:06:16 -0000 Author: shurd Date: Thu Apr 12 19:06:15 2018 New Revision: 332447 URL: https://svnweb.freebsd.org/changeset/base/332447 Log: Work around netmap issue with ixgbe After multiple start/stop of netmap, ixgbe will get into a bad state requiring a reboot to recover. Adding a delay before stopping the interface appears to work around the issue. The -CURRENT driver has diverged too far from -STABLE for an MFC. PR: 221317 Submitted by: Sylvain Galliano Reported by: Cassiano Peixoto Sponsored by: Limelight Networks Modified: stable/11/sys/dev/ixgbe/if_ix.c Modified: stable/11/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_ix.c Thu Apr 12 19:00:22 2018 (r332446) +++ stable/11/sys/dev/ixgbe/if_ix.c Thu Apr 12 19:06:15 2018 (r332447) @@ -3567,6 +3567,8 @@ ixgbe_stop(void *arg) mtx_assert(&adapter->core_mtx, MA_OWNED); + msec_delay(1000); + INIT_DEBUGOUT("ixgbe_stop: begin\n"); ixgbe_disable_intr(adapter); callout_stop(&adapter->timer); From owner-svn-src-all@freebsd.org Thu Apr 12 19:34:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7CF3F89F94; Thu, 12 Apr 2018 19:34:35 +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 6A44E7EB67; Thu, 12 Apr 2018 19:34:35 +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 64E917A98; Thu, 12 Apr 2018 19:34:35 +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 w3CJYZRM007063; Thu, 12 Apr 2018 19:34:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CJYZrQ007062; Thu, 12 Apr 2018 19:34:35 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804121934.w3CJYZrQ007062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Apr 2018 19:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332448 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 332448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 19:34:35 -0000 Author: ae Date: Thu Apr 12 19:34:35 2018 New Revision: 332448 URL: https://svnweb.freebsd.org/changeset/base/332448 Log: Remove printing of "not" keyword from print_ip() function. After r331668 handling of F_NOT flag done in one place by print_instruction() function. MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Thu Apr 12 19:06:15 2018 (r332447) +++ head/sbin/ipfw/ipfw2.c Thu Apr 12 19:34:35 2018 (r332448) @@ -1192,11 +1192,10 @@ print_ip(struct buf_pr *bp, const struct format_opts * if (d < sizeof(lookup_key)/sizeof(lookup_key[0])) arg = match_value(rule_options, lookup_key[d]); t = table_search_ctlv(fo->tstate, ((ipfw_insn *)cmd)->arg1); - bprintf(bp, "%s lookup %s %s", cmd->o.len & F_NOT ? " not": "", - arg, t); + bprintf(bp, " lookup %s %s", arg, t); return; } - bprintf(bp, "%s%s ", cmd->o.len & F_NOT ? " not": "", s); + bprintf(bp, "%s ", s); if (cmd->o.opcode == O_IP_SRC_ME || cmd->o.opcode == O_IP_DST_ME) { bprintf(bp, "me"); From owner-svn-src-all@freebsd.org Thu Apr 12 19:44:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C968CF8AA80; Thu, 12 Apr 2018 19:44:05 +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 7B8217F40F; Thu, 12 Apr 2018 19:44:05 +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 5C59F7C2B; Thu, 12 Apr 2018 19:44:05 +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 w3CJi5l0011909; Thu, 12 Apr 2018 19:44:05 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CJi5jX011906; Thu, 12 Apr 2018 19:44:05 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804121944.w3CJi5jX011906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Apr 2018 19:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332449 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 332449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 19:44:06 -0000 Author: ae Date: Thu Apr 12 19:44:04 2018 New Revision: 332449 URL: https://svnweb.freebsd.org/changeset/base/332449 Log: Remove printing of "not" keyword from print_ip6() function. After r331668 handling of F_NOT flag done in one place by print_instruction() function. Also remove unused argument from print_ip[6]() functions. MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sbin/ipfw/ipv6.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Thu Apr 12 19:34:35 2018 (r332448) +++ head/sbin/ipfw/ipfw2.c Thu Apr 12 19:44:04 2018 (r332449) @@ -1176,8 +1176,7 @@ print_flags(struct buf_pr *bp, char const *name, ipfw_ * Print the ip address contained in a command. */ static void -print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd, - char const *s) +print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd) { struct hostent *he = NULL; struct in_addr *ia; @@ -1185,6 +1184,7 @@ print_ip(struct buf_pr *bp, const struct format_opts * uint32_t *a = ((ipfw_insn_u32 *)cmd)->d; char *t; + bprintf(bp, " "); if (cmd->o.opcode == O_IP_DST_LOOKUP && len > F_INSN_SIZE(ipfw_insn_u32)) { uint32_t d = a[1]; const char *arg = ""; @@ -1192,11 +1192,9 @@ print_ip(struct buf_pr *bp, const struct format_opts * if (d < sizeof(lookup_key)/sizeof(lookup_key[0])) arg = match_value(rule_options, lookup_key[d]); t = table_search_ctlv(fo->tstate, ((ipfw_insn *)cmd)->arg1); - bprintf(bp, " lookup %s %s", arg, t); + bprintf(bp, "lookup %s %s", arg, t); return; } - bprintf(bp, "%s ", s); - if (cmd->o.opcode == O_IP_SRC_ME || cmd->o.opcode == O_IP_DST_ME) { bprintf(bp, "me"); return; @@ -1467,7 +1465,7 @@ print_instruction(struct buf_pr *bp, const struct form case O_IP_DST_MASK: case O_IP_DST_ME: case O_IP_DST_SET: - print_ip(bp, fo, insntod(cmd, ip), ""); + print_ip(bp, fo, insntod(cmd, ip)); break; case O_IP6_SRC: case O_IP6_SRC_MASK: @@ -1475,7 +1473,7 @@ print_instruction(struct buf_pr *bp, const struct form case O_IP6_DST: case O_IP6_DST_MASK: case O_IP6_DST_ME: - print_ip6(bp, insntod(cmd, ip6), ""); + print_ip6(bp, insntod(cmd, ip6)); break; case O_FLOW6ID: print_flow6id(bp, insntod(cmd, u32)); Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Thu Apr 12 19:34:35 2018 (r332448) +++ head/sbin/ipfw/ipfw2.h Thu Apr 12 19:44:04 2018 (r332449) @@ -401,7 +401,7 @@ int ipfw_delete_pipe(int pipe_or_queue, int n); /* ipv6.c */ void print_unreach6_code(struct buf_pr *bp, uint16_t code); -void print_ip6(struct buf_pr *bp, struct _ipfw_insn_ip6 *cmd, char const *s); +void print_ip6(struct buf_pr *bp, struct _ipfw_insn_ip6 *cmd); void print_flow6id(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd); void print_icmp6types(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd); void print_ext6hdr(struct buf_pr *bp, struct _ipfw_insn *cmd ); Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Thu Apr 12 19:34:35 2018 (r332448) +++ head/sbin/ipfw/ipv6.c Thu Apr 12 19:44:04 2018 (r332449) @@ -85,17 +85,15 @@ print_unreach6_code(struct buf_pr *bp, uint16_t code) * Print the ip address contained in a command. */ void -print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd, char const *s) +print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd) { struct hostent *he = NULL; int len = F_LEN((ipfw_insn *) cmd) - 1; struct in6_addr *a = &(cmd->addr6); char trad[255]; - bprintf(bp, "%s%s ", cmd->o.len & F_NOT ? " not": "", s); - if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) { - bprintf(bp, "me6"); + bprintf(bp, " me6"); return; } if (cmd->o.opcode == O_IP6) { @@ -108,7 +106,7 @@ print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd, char * addr/mask pairs have len = (2n+1). We convert len to n so we * use that to count the number of entries. */ - + bprintf(bp, " "); for (len = len / 4; len > 0; len -= 2, a += 2) { int mb = /* mask length */ (cmd->o.opcode == O_IP6_SRC || cmd->o.opcode == O_IP6_DST) ? From owner-svn-src-all@freebsd.org Thu Apr 12 19:59:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A657F8B9BF; Thu, 12 Apr 2018 19:59:37 +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 08FE38232C; Thu, 12 Apr 2018 19:59:37 +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 F40897DC1; Thu, 12 Apr 2018 19:59: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 w3CJxaZQ017452; Thu, 12 Apr 2018 19:59:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CJxa1E017451; Thu, 12 Apr 2018 19:59:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804121959.w3CJxa1E017451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Apr 2018 19:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332450 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 332450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 19:59:37 -0000 Author: kib Date: Thu Apr 12 19:59:36 2018 New Revision: 332450 URL: https://svnweb.freebsd.org/changeset/base/332450 Log: Optimize context switch for PTI on PCID pmap. In pti-enabled pmap, the PCID allocation scheme assigns temporal id for the kernel page table, and user page table twin PCID is calculating by setting high bit in the kernel PCID. So the kernel AS is mapped with per-vmspace PCID, and we must completely shut down all mappings in KVA when switching contexts, so that newly switched thread would see all changes in KVA occured while it was not executing. After all, KVA is same between all threads. Currently the pti context switch for the user part of the page table gets its TLB entries flushed too. It is excessive. The same PCID flushing algorithm that is used for non-pti pmap, correctly works for the UVA mappings. The only shared TLB entries are the pages from KVA accessed by the kernel entry trampoline. All of them are static except per-thread TSS and LDT. For TSS and LDT, the lifetime of newly allocated entries is the whole thread life, so it is fine as well. If not fine, then explicit shutdowns for current pmap of the newly allocated LDT and TSS pages would be enough. Also restore the constant value for the pm_pcid for the kernel_pmap. Before, for PTI pmap, pm_pcid was erronously rolled same as user pmap's pm_pcid, but it was not used. Reviewed by: markj (previous version) Discussed with: alc Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D14961 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Apr 12 19:44:04 2018 (r332449) +++ head/sys/amd64/amd64/pmap.c Thu Apr 12 19:59:36 2018 (r332450) @@ -7330,8 +7330,9 @@ pmap_pcid_alloc(pmap_t pmap, u_int cpuid) CRITICAL_ASSERT(curthread); gen = PCPU_GET(pcid_gen); - if (!pti && (pmap->pm_pcids[cpuid].pm_pcid == PMAP_PCID_KERN || - pmap->pm_pcids[cpuid].pm_gen == gen)) + if (pmap->pm_pcids[cpuid].pm_pcid == PMAP_PCID_KERN) + return (pti ? 0 : CR3_PCID_SAVE); + if (pmap->pm_pcids[cpuid].pm_gen == gen) return (CR3_PCID_SAVE); pcid_next = PCPU_GET(pcid_next); KASSERT((!pti && pcid_next <= PMAP_PCID_OVERMAX) || @@ -7358,7 +7359,7 @@ pmap_activate_sw(struct thread *td) { pmap_t oldpmap, pmap; struct invpcid_descr d; - uint64_t cached, cr3, kcr3, ucr3; + uint64_t cached, cr3, kcr3, kern_pti_cached, ucr3; register_t rflags; u_int cpuid; @@ -7407,11 +7408,10 @@ pmap_activate_sw(struct thread *td) if (!invpcid_works) rflags = intr_disable(); - if (!cached || (cr3 & ~CR3_PCID_MASK) != pmap->pm_cr3) { + kern_pti_cached = pti ? 0 : cached; + if (!kern_pti_cached || (cr3 & ~CR3_PCID_MASK) != pmap->pm_cr3) { load_cr3(pmap->pm_cr3 | pmap->pm_pcids[cpuid].pm_pcid | - cached); - if (cached) - PCPU_INC(pm_save_cnt); + kern_pti_cached); } PCPU_SET(curpmap, pmap); if (pti) { @@ -7419,13 +7419,13 @@ pmap_activate_sw(struct thread *td) ucr3 = pmap->pm_ucr3 | pmap->pm_pcids[cpuid].pm_pcid | PMAP_PCID_USER_PT; - /* - * Manually invalidate translations cached - * from the user page table, which are not - * flushed by reload of cr3 with the kernel - * page table pointer above. - */ - if (pmap->pm_ucr3 != PMAP_NO_CR3) { + if (!cached && pmap->pm_ucr3 != PMAP_NO_CR3) { + /* + * Manually invalidate translations cached + * from the user page table. They are not + * flushed by reload of cr3 with the kernel + * page table pointer above. + */ if (invpcid_works) { d.pcid = PMAP_PCID_USER_PT | pmap->pm_pcids[cpuid].pm_pcid; @@ -7442,6 +7442,8 @@ pmap_activate_sw(struct thread *td) } if (!invpcid_works) intr_restore(rflags); + if (cached) + PCPU_INC(pm_save_cnt); } else if (cr3 != pmap->pm_cr3) { load_cr3(pmap->pm_cr3); PCPU_SET(curpmap, pmap); From owner-svn-src-all@freebsd.org Thu Apr 12 20:01:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9041F8BE49; Thu, 12 Apr 2018 20:01:22 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-yw0-x243.google.com (mail-yw0-x243.google.com [IPv6:2607:f8b0:4002:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31F4382CBA; Thu, 12 Apr 2018 20:01:22 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-yw0-x243.google.com with SMTP id y64so2557860ywa.3; Thu, 12 Apr 2018 13:01:22 -0700 (PDT) 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=JBGwRErUzD8UGzo3fo25U9FYL9DYfAcdhDA4Z0U6MJI=; b=hjB6UXTs0vleIsKdVPd5XL00ix5YGFSM872J99A/oRS60jc8npVmIaX+jxLaZ0lW1s GTpBAFqrhlrs5dXjGhv27/m1pGDdLxkFIBhr38bt4Qrb6zz/34/eAbGI3Dzg6z0Apyw2 Ah1H2UvQVi8xNoEtlR06qKtUwACfnc/bxwuZUh7fjn8+vhrw5V9RH5fu6E7GOSZh5xDo L6dcEFIOoOgCP2U8WxN73gUPdv+3i11smMi2hytYwiCTfLIF6XvypXklZYUk9sefvFlF /MLFmHjmeSgfJzVPzwUOqiffHBozKIeYi2qXV2NJMlcVVAuWaJyiaM5TWtIAbxYG6BD9 MilA== 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=JBGwRErUzD8UGzo3fo25U9FYL9DYfAcdhDA4Z0U6MJI=; b=c/MT9OoX/Fo8Wn3iefIgz3mMKB+aotPgAvsKw7SuC/OXXJsbDoXthdVCvEzq7OycR1 NwONVgJ4stEtaWrT28W61NS6Gc5GKppaW6sUvRW6iYvmyihx2FQPoK09PLMTQ6yUokAR +wLA96t7ttTuPbcvg+ES5ooKZUnQoNyU5y0jDpASkvNw8rh+EgP4L3xIdkutdEGIApZc nzWHrvgdV71F9F5Hha36nc+l7wZW9U+M9K16llXqpyiZXxJkNcnCJ9yCNRgFol9UQUOh XJ8k8HyoK84I8r4wv03DtGSmAmvprmA1hpsWisJAHM29jdtFuLLZCqz9BDfEGC9FkY0x t7gg== X-Gm-Message-State: ALQs6tC+U81dQOZcVGeu2lv+8UKwnoi2jMpzdzMXqDAKZJUYdgh4044I rUk8to5vyQACbLbh0qWnxoYZVIUNDMhn2jLhi+o= X-Google-Smtp-Source: AIpwx486N1Dr2JTFTuGSPnb8p24D1PDJvg4Bb2EVCXBJqulHyH8sS2FLJtBrYWpFz0wKzhTj776Q0khTbrkuVc7Xun8= X-Received: by 10.129.117.70 with SMTP id q67mr1521383ywc.84.1523563281127; Thu, 12 Apr 2018 13:01:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.81.207 with HTTP; Thu, 12 Apr 2018 13:01:20 -0700 (PDT) In-Reply-To: <201804121906.w3CJ6FZo092138@repo.freebsd.org> References: <201804121906.w3CJ6FZo092138@repo.freebsd.org> From: Ryan Stone Date: Thu, 12 Apr 2018 16:01:20 -0400 Message-ID: Subject: Re: svn commit: r332447 - stable/11/sys/dev/ixgbe To: Stephen Hurd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 20:01:23 -0000 Spinning in the kernel for a full second is a really bad idea. At minimum this is going to hold off all callouts from one of the callout threads for up to a full second as ixgbe_local_timer() waits for the core mutex. That chews up two CPU cores doing busy-wait loops (the ixgbe_stop() thread busy-waits in msec_delay and the callout thread adaptively spins waiting for the mutex). If any other thread tries to acquire the core lock they also adaptively spin on the mutex chewing up yet more cores. This includes any threads trying to fetch interface status (e.g. ifconfig), various interrupt handlers, etc. From owner-svn-src-all@freebsd.org Thu Apr 12 20:05:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 062B1F8C64A; Thu, 12 Apr 2018 20:05:26 +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 963678407B; Thu, 12 Apr 2018 20:05:26 +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 8D2057F52; Thu, 12 Apr 2018 20:05:26 +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 w3CK5QF3022085; Thu, 12 Apr 2018 20:05:26 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CK5Q92022084; Thu, 12 Apr 2018 20:05:26 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804122005.w3CK5Q92022084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Apr 2018 20:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332451 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 332451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 20:05:27 -0000 Author: ae Date: Thu Apr 12 20:05:26 2018 New Revision: 332451 URL: https://svnweb.freebsd.org/changeset/base/332451 Log: Fix indenting in ipv6.c file, use tabs instead of mixing tabs and spaces. MFC after: 1 week Modified: head/sbin/ipfw/ipv6.c Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Thu Apr 12 19:59:36 2018 (r332450) +++ head/sbin/ipfw/ipv6.c Thu Apr 12 20:05:26 2018 (r332451) @@ -48,11 +48,11 @@ } while (0) static struct _s_x icmp6codes[] = { - { "no-route", ICMP6_DST_UNREACH_NOROUTE }, - { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, - { "address", ICMP6_DST_UNREACH_ADDR }, - { "port", ICMP6_DST_UNREACH_NOPORT }, - { NULL, 0 } + { "no-route", ICMP6_DST_UNREACH_NOROUTE }, + { "admin-prohib", ICMP6_DST_UNREACH_ADMIN }, + { "address", ICMP6_DST_UNREACH_ADDR }, + { "port", ICMP6_DST_UNREACH_NOPORT }, + { NULL, 0 } }; void @@ -87,50 +87,54 @@ print_unreach6_code(struct buf_pr *bp, uint16_t code) void print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd) { - struct hostent *he = NULL; - int len = F_LEN((ipfw_insn *) cmd) - 1; - struct in6_addr *a = &(cmd->addr6); - char trad[255]; + char trad[255]; + struct hostent *he = NULL; + struct in6_addr *a = &(cmd->addr6); + int len, mb; - if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) { - bprintf(bp, " me6"); - return; - } - if (cmd->o.opcode == O_IP6) { - bprintf(bp, " ip6"); - return; - } + len = F_LEN((ipfw_insn *) cmd) - 1; + if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) { + bprintf(bp, " me6"); + return; + } + if (cmd->o.opcode == O_IP6) { + bprintf(bp, " ip6"); + return; + } - /* - * len == 4 indicates a single IP, whereas lists of 1 or more - * addr/mask pairs have len = (2n+1). We convert len to n so we - * use that to count the number of entries. - */ + /* + * len == 4 indicates a single IP, whereas lists of 1 or more + * addr/mask pairs have len = (2n+1). We convert len to n so we + * use that to count the number of entries. + */ bprintf(bp, " "); - for (len = len / 4; len > 0; len -= 2, a += 2) { - int mb = /* mask length */ - (cmd->o.opcode == O_IP6_SRC || cmd->o.opcode == O_IP6_DST) ? - 128 : contigmask((uint8_t *)&(a[1]), 128); + for (len = len / 4; len > 0; len -= 2, a += 2) { + /* mask length */ + mb = (cmd->o.opcode == O_IP6_SRC || + cmd->o.opcode == O_IP6_DST) ? 128: + contigmask((uint8_t *)&(a[1]), 128); - if (mb == 128 && co.do_resolv) - he = gethostbyaddr((char *)a, sizeof(*a), AF_INET6); - if (he != NULL) /* resolved to name */ - bprintf(bp, "%s", he->h_name); - else if (mb == 0) /* any */ - bprintf(bp, "any"); - else { /* numeric IP followed by some kind of mask */ - if (inet_ntop(AF_INET6, a, trad, sizeof( trad ) ) == NULL) - bprintf(bp, "Error ntop in print_ip6\n"); - bprintf(bp, "%s", trad ); - if (mb < 0) /* mask not contiguous */ - bprintf(bp, "/%s", - inet_ntop(AF_INET6, &a[1], trad, sizeof(trad))); - else if (mb < 128) - bprintf(bp, "/%d", mb); - } - if (len > 2) - bprintf(bp, ","); - } + if (mb == 128 && co.do_resolv) + he = gethostbyaddr((char *)a, sizeof(*a), AF_INET6); + + if (he != NULL) /* resolved to name */ + bprintf(bp, "%s", he->h_name); + else if (mb == 0) /* any */ + bprintf(bp, "any"); + else { /* numeric IP followed by some kind of mask */ + if (inet_ntop(AF_INET6, a, trad, + sizeof(trad)) == NULL) + bprintf(bp, "Error ntop in print_ip6\n"); + bprintf(bp, "%s", trad ); + if (mb < 0) /* mask not contiguous */ + bprintf(bp, "/%s", inet_ntop(AF_INET6, &a[1], + trad, sizeof(trad))); + else if (mb < 128) + bprintf(bp, "/%d", mb); + } + if (len > 2) + bprintf(bp, ","); + } } void @@ -142,163 +146,154 @@ fill_icmp6types(ipfw_insn_icmp6 *cmd, char *av, int cb bzero(cmd, sizeof(*cmd)); while (*av) { - if (*av == ',') - av++; - type = strtoul(av, &av, 0); - if (*av != ',' && *av != '\0') - errx(EX_DATAERR, "invalid ICMP6 type"); - /* - * XXX: shouldn't this be 0xFF? I can't see any reason why - * we shouldn't be able to filter all possiable values - * regardless of the ability of the rest of the kernel to do - * anything useful with them. - */ - if (type > ICMP6_MAXTYPE) - errx(EX_DATAERR, "ICMP6 type out of range"); - cmd->d[type / 32] |= ( 1 << (type % 32)); + if (*av == ',') + av++; + type = strtoul(av, &av, 0); + if (*av != ',' && *av != '\0') + errx(EX_DATAERR, "invalid ICMP6 type"); + /* + * XXX: shouldn't this be 0xFF? I can't see any reason why + * we shouldn't be able to filter all possiable values + * regardless of the ability of the rest of the kernel to do + * anything useful with them. + */ + if (type > ICMP6_MAXTYPE) + errx(EX_DATAERR, "ICMP6 type out of range"); + cmd->d[type / 32] |= ( 1 << (type % 32)); } cmd->o.opcode = O_ICMP6TYPE; cmd->o.len |= F_INSN_SIZE(ipfw_insn_icmp6); } - void print_icmp6types(struct buf_pr *bp, ipfw_insn_u32 *cmd) { - int i, j; - char sep= ' '; + int i, j; + char sep= ' '; - bprintf(bp, " ip6 icmp6types"); - for (i = 0; i < 7; i++) - for (j=0; j < 32; ++j) { - if ( (cmd->d[i] & (1 << (j))) == 0) - continue; - bprintf(bp, "%c%d", sep, (i*32 + j)); - sep = ','; - } + bprintf(bp, " ip6 icmp6types"); + for (i = 0; i < 7; i++) + for (j=0; j < 32; ++j) { + if ( (cmd->d[i] & (1 << (j))) == 0) + continue; + bprintf(bp, "%c%d", sep, (i*32 + j)); + sep = ','; + } } void print_flow6id(struct buf_pr *bp, ipfw_insn_u32 *cmd) { - uint16_t i, limit = cmd->o.arg1; - char sep = ','; + uint16_t i, limit = cmd->o.arg1; + char sep = ','; - bprintf(bp, " flow-id "); - for( i=0; i < limit; ++i) { - if (i == limit - 1) - sep = ' '; - bprintf(bp, "%d%c", cmd->d[i], sep); - } + bprintf(bp, " flow-id "); + for( i=0; i < limit; ++i) { + if (i == limit - 1) + sep = ' '; + bprintf(bp, "%d%c", cmd->d[i], sep); + } } /* structure and define for the extension header in ipv6 */ static struct _s_x ext6hdrcodes[] = { - { "frag", EXT_FRAGMENT }, - { "hopopt", EXT_HOPOPTS }, - { "route", EXT_ROUTING }, - { "dstopt", EXT_DSTOPTS }, - { "ah", EXT_AH }, - { "esp", EXT_ESP }, - { "rthdr0", EXT_RTHDR0 }, - { "rthdr2", EXT_RTHDR2 }, - { NULL, 0 } + { "frag", EXT_FRAGMENT }, + { "hopopt", EXT_HOPOPTS }, + { "route", EXT_ROUTING }, + { "dstopt", EXT_DSTOPTS }, + { "ah", EXT_AH }, + { "esp", EXT_ESP }, + { "rthdr0", EXT_RTHDR0 }, + { "rthdr2", EXT_RTHDR2 }, + { NULL, 0 } }; /* fills command for the extension header filtering */ int fill_ext6hdr( ipfw_insn *cmd, char *av) { - int tok; - char *s = av; + int tok; + char *s = av; - cmd->arg1 = 0; - - while(s) { - av = strsep( &s, ",") ; - tok = match_token(ext6hdrcodes, av); - switch (tok) { - case EXT_FRAGMENT: - cmd->arg1 |= EXT_FRAGMENT; - break; - - case EXT_HOPOPTS: - cmd->arg1 |= EXT_HOPOPTS; - break; - - case EXT_ROUTING: - cmd->arg1 |= EXT_ROUTING; - break; - - case EXT_DSTOPTS: - cmd->arg1 |= EXT_DSTOPTS; - break; - - case EXT_AH: - cmd->arg1 |= EXT_AH; - break; - - case EXT_ESP: - cmd->arg1 |= EXT_ESP; - break; - - case EXT_RTHDR0: - cmd->arg1 |= EXT_RTHDR0; - break; - - case EXT_RTHDR2: - cmd->arg1 |= EXT_RTHDR2; - break; - - default: - errx( EX_DATAERR, "invalid option for ipv6 exten header" ); - break; - } - } - if (cmd->arg1 == 0 ) - return 0; - cmd->opcode = O_EXT_HDR; - cmd->len |= F_INSN_SIZE( ipfw_insn ); - return 1; + cmd->arg1 = 0; + while(s) { + av = strsep( &s, ",") ; + tok = match_token(ext6hdrcodes, av); + switch (tok) { + case EXT_FRAGMENT: + cmd->arg1 |= EXT_FRAGMENT; + break; + case EXT_HOPOPTS: + cmd->arg1 |= EXT_HOPOPTS; + break; + case EXT_ROUTING: + cmd->arg1 |= EXT_ROUTING; + break; + case EXT_DSTOPTS: + cmd->arg1 |= EXT_DSTOPTS; + break; + case EXT_AH: + cmd->arg1 |= EXT_AH; + break; + case EXT_ESP: + cmd->arg1 |= EXT_ESP; + break; + case EXT_RTHDR0: + cmd->arg1 |= EXT_RTHDR0; + break; + case EXT_RTHDR2: + cmd->arg1 |= EXT_RTHDR2; + break; + default: + errx(EX_DATAERR, + "invalid option for ipv6 exten header"); + break; + } + } + if (cmd->arg1 == 0) + return (0); + cmd->opcode = O_EXT_HDR; + cmd->len |= F_INSN_SIZE(ipfw_insn); + return (1); } void print_ext6hdr(struct buf_pr *bp, ipfw_insn *cmd ) { - char sep = ' '; + char sep = ' '; - bprintf(bp, " extension header:"); - if (cmd->arg1 & EXT_FRAGMENT ) { - bprintf(bp, "%cfragmentation", sep); - sep = ','; - } - if (cmd->arg1 & EXT_HOPOPTS ) { - bprintf(bp, "%chop options", sep); - sep = ','; - } - if (cmd->arg1 & EXT_ROUTING ) { - bprintf(bp, "%crouting options", sep); - sep = ','; - } - if (cmd->arg1 & EXT_RTHDR0 ) { - bprintf(bp, "%crthdr0", sep); - sep = ','; - } - if (cmd->arg1 & EXT_RTHDR2 ) { - bprintf(bp, "%crthdr2", sep); - sep = ','; - } - if (cmd->arg1 & EXT_DSTOPTS ) { - bprintf(bp, "%cdestination options", sep); - sep = ','; - } - if (cmd->arg1 & EXT_AH ) { - bprintf(bp, "%cauthentication header", sep); - sep = ','; - } - if (cmd->arg1 & EXT_ESP ) { - bprintf(bp, "%cencapsulated security payload", sep); - } + bprintf(bp, " extension header:"); + if (cmd->arg1 & EXT_FRAGMENT) { + bprintf(bp, "%cfragmentation", sep); + sep = ','; + } + if (cmd->arg1 & EXT_HOPOPTS) { + bprintf(bp, "%chop options", sep); + sep = ','; + } + if (cmd->arg1 & EXT_ROUTING) { + bprintf(bp, "%crouting options", sep); + sep = ','; + } + if (cmd->arg1 & EXT_RTHDR0) { + bprintf(bp, "%crthdr0", sep); + sep = ','; + } + if (cmd->arg1 & EXT_RTHDR2) { + bprintf(bp, "%crthdr2", sep); + sep = ','; + } + if (cmd->arg1 & EXT_DSTOPTS) { + bprintf(bp, "%cdestination options", sep); + sep = ','; + } + if (cmd->arg1 & EXT_AH) { + bprintf(bp, "%cauthentication header", sep); + sep = ','; + } + if (cmd->arg1 & EXT_ESP) { + bprintf(bp, "%cencapsulated security payload", sep); + } } /* Try to find ipv6 address by hostname */ @@ -312,7 +307,7 @@ lookup_host6 (char *host, struct in6_addr *ip6addr) return(-1); memcpy(ip6addr, he->h_addr_list[0], sizeof( struct in6_addr)); } - return(0); + return (0); } From owner-svn-src-all@freebsd.org Thu Apr 12 20:21:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD96FF8D86C; Thu, 12 Apr 2018 20:21:04 +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 6F4A468466; Thu, 12 Apr 2018 20:21:04 +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 515DC10123; Thu, 12 Apr 2018 20:21:04 +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 w3CKL45E028822; Thu, 12 Apr 2018 20:21:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CKL4oa028821; Thu, 12 Apr 2018 20:21:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804122021.w3CKL4oa028821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Apr 2018 20:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332452 - head/sys/dev/vt/font X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/vt/font X-SVN-Commit-Revision: 332452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 20:21:05 -0000 Author: emaste Date: Thu Apr 12 20:21:04 2018 New Revision: 332452 URL: https://svnweb.freebsd.org/changeset/base/332452 Log: Update vt(4) "Terminus BSD Console" font to v4.46 "Terminus BSD Console" is a derivative of Terminus that is provided by Mr. Dimitar Zhekov under the 2-clause BSD license for use by the FreeBSD vt(4) console and other BSDs. PR: 227409 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/font/vt_font_default.c Modified: head/sys/dev/vt/font/vt_font_default.c ============================================================================== --- head/sys/dev/vt/font/vt_font_default.c Thu Apr 12 20:05:26 2018 (r332451) +++ head/sys/dev/vt/font/vt_font_default.c Thu Apr 12 20:21:04 2018 (r332452) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include -static uint8_t font_bytes[1477 * 16] = { +static uint8_t font_bytes[2224 * 16] = { 0x00, 0x00, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, @@ -188,9 +188,9 @@ static uint8_t font_bytes[1477 * 16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x7c, - 0x10, 0x10, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x08, - 0x10, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x04, 0x18, 0x04, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x04, + 0x08, 0x10, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x04, 0x18, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x7a, 0x40, 0x40, 0x40, 0x00, @@ -198,7 +198,7 @@ static uint8_t font_bytes[1477 * 16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, - 0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x48, 0x24, 0x12, 0x24, 0x48, 0x90, 0x00, 0x00, 0x00, 0x00, @@ -340,7 +340,7 @@ static uint8_t font_bytes[1477 * 16] = { 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x40, 0x40, 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xff, 0x42, 0x42, 0x7e, 0x42, - 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf8, + 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf0, 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x58, 0x00, 0x30, 0x10, 0x10, @@ -496,222 +496,258 @@ static uint8_t font_bytes[1477 * 16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x03, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, - 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x3c, 0x42, - 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x7e, 0x40, 0x40, 0x40, 0x78, 0x40, - 0x40, 0x40, 0x40, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x42, 0x42, - 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, - 0x40, 0x80, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, - 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0x82, - 0x82, 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x40, 0x80, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x24, 0x24, 0x66, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x48, 0x48, 0x00, 0x30, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x44, 0x82, 0x82, 0xfe, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x5a, 0x42, - 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, - 0x28, 0x28, 0x44, 0x44, 0x44, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x7e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, - 0x20, 0x10, 0x08, 0x08, 0x10, 0x20, 0x40, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x7c, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7c, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, + 0x18, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x40, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x10, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x7e, + 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x80, 0x7e, 0x40, 0x40, 0x40, 0x78, 0x40, 0x40, 0x40, 0x40, 0x7e, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x42, + 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x38, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x80, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0x82, 0x82, 0x44, 0x44, 0x28, + 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x24, 0x24, 0x66, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x10, 0x00, 0x3a, 0x46, 0x44, 0x44, 0x44, 0x46, 0x3a, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x3c, 0x42, 0x40, - 0x38, 0x40, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, - 0x00, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x02, 0x02, 0x02, 0x00, - 0x00, 0x00, 0x08, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0c, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x24, 0x00, 0x42, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x10, 0x48, 0x48, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, + 0x28, 0x28, 0x44, 0x44, 0x44, 0x82, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x5a, 0x42, 0x42, 0x42, 0x42, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, + 0x44, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, + 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x20, 0x10, 0x08, 0x08, + 0x10, 0x20, 0x40, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x7c, + 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7c, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7c, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, + 0x42, 0x24, 0x24, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x3a, 0x46, 0x44, 0x44, 0x44, 0x46, 0x3a, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x44, 0x44, 0x48, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x7c, - 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x44, - 0x44, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x3e, 0x10, - 0x08, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x40, 0x40, 0x3c, - 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x7c, 0x44, + 0x00, 0x00, 0x08, 0x10, 0x00, 0x3c, 0x42, 0x40, 0x38, 0x40, 0x42, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x7c, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x42, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x08, 0x10, + 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x10, 0x00, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x46, 0x44, + 0x44, 0x44, 0x46, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, + 0x44, 0x48, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x7c, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, + 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x3e, 0x10, 0x08, 0x3c, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x04, + 0x08, 0x10, 0x20, 0x40, 0x40, 0x40, 0x40, 0x3c, 0x02, 0x02, 0x04, 0x00, + 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, 0x44, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, + 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3e, 0x40, 0x40, 0x40, 0x3c, 0x40, 0x40, 0x40, 0x40, 0x3c, + 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7c, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x40, 0x40, 0x40, 0x40, 0x3c, + 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfe, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x92, 0x92, + 0x92, 0x92, 0x92, 0x7c, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x42, 0x42, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7c, + 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x82, 0x92, + 0x92, 0x92, 0x92, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x48, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x20, 0x20, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x40, 0x40, 0x3c, 0x40, - 0x40, 0x40, 0x40, 0x3c, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x24, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x42, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, + 0x00, 0x44, 0x82, 0x92, 0x92, 0x92, 0x92, 0x6c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x3e, 0x04, 0xc4, 0x44, 0x44, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x7c, 0x92, 0x92, + 0x92, 0x92, 0x92, 0x7c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc2, 0x24, 0x18, 0x10, 0x30, 0x48, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7c, - 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x40, - 0x40, 0x40, 0x40, 0x3c, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3e, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, + 0x40, 0x40, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x4c, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7c, 0x10, 0x10, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x24, - 0x24, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x7c, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x44, 0x82, 0x92, 0x92, 0x92, 0x92, 0x6c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x48, 0x48, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x42, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, - 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x10, 0x00, 0x44, 0x82, 0x92, 0x92, 0x92, 0x92, 0x6c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x7e, 0x42, - 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x20, - 0x20, 0x3c, 0x22, 0x22, 0x22, 0x22, 0x22, 0x24, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x10, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x40, 0x40, 0x78, 0x40, - 0x40, 0x40, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x50, - 0x90, 0x9c, 0x92, 0x92, 0x92, 0x92, 0x92, 0x9c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x90, 0x90, 0x90, 0x9c, 0xf2, 0x92, 0x92, 0x92, 0x92, 0x9c, + 0x00, 0x1e, 0x20, 0x40, 0x7c, 0x40, 0x20, 0x1e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x04, 0x02, 0x3e, 0x02, 0x04, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x20, 0x20, 0x3c, 0x22, 0x22, - 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x42, 0x44, - 0x48, 0x50, 0x60, 0x60, 0x50, 0x48, 0x44, 0x42, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x08, 0x42, 0x42, 0x42, 0x46, 0x4a, 0x52, 0x62, 0x42, 0x42, 0x42, - 0x00, 0x00, 0x00, 0x00, 0x24, 0x18, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3e, - 0x02, 0x02, 0x02, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0x40, 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x44, 0x44, 0x44, 0x44, 0x44, - 0x44, 0x44, 0x44, 0xfe, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, - 0x92, 0x54, 0x38, 0x54, 0x92, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x42, 0x42, 0x42, 0x46, 0x4a, 0x52, 0x62, 0x42, 0x42, 0x42, - 0x00, 0x00, 0x00, 0x00, 0x24, 0x18, 0x42, 0x42, 0x42, 0x46, 0x4a, 0x52, - 0x62, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x12, - 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x42, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x7c, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x7c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3f, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x02, + 0x22, 0x22, 0x22, 0x24, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x7e, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x42, 0x40, 0x40, 0x78, 0x40, 0x40, 0x40, 0x42, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x50, 0x90, 0x9c, 0x92, 0x92, + 0x92, 0x92, 0x92, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90, + 0x90, 0x9c, 0xf2, 0x92, 0x92, 0x92, 0x92, 0x9c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf8, 0x20, 0x20, 0x3c, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x42, 0x44, 0x48, 0x50, 0x60, 0x60, + 0x50, 0x48, 0x44, 0x42, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x42, 0x42, + 0x42, 0x46, 0x4a, 0x52, 0x62, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x18, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x40, + 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0xfe, + 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0x54, 0x38, 0x54, + 0x92, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, + 0x42, 0x46, 0x4a, 0x52, 0x62, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x18, 0x42, 0x42, 0x42, 0x46, 0x4a, 0x52, 0x62, 0x42, 0x42, 0x42, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x12, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x7c, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7c, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x3f, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7f, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x00, 0xc0, 0x40, 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x82, 0xf2, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, - 0x02, 0x02, 0x1e, 0x02, 0x02, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x8c, 0x92, 0x92, 0x92, 0x92, 0xf2, 0x92, 0x92, 0x92, 0x8c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x42, 0x42, 0x42, 0x42, 0x3e, - 0x0a, 0x12, 0x22, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x40, + 0x92, 0x92, 0x92, 0x7f, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x44, 0x44, 0x48, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x7c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, + 0x00, 0x00, 0x82, 0x82, 0x82, 0xf2, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0xf2, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x02, 0x02, 0x1e, 0x02, + 0x02, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x92, + 0x92, 0x92, 0x92, 0xf2, 0x92, 0x92, 0x92, 0x8c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3e, 0x42, 0x42, 0x42, 0x42, 0x3e, 0x0a, 0x12, 0x22, 0x42, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x40, 0x40, 0x7c, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, + 0x44, 0x48, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x54, + 0x38, 0x54, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x42, 0x02, 0x1c, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x22, 0x22, 0x22, 0x22, 0x22, 0x42, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0xc6, 0xaa, + 0x92, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x3f, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, + 0x92, 0x92, 0x92, 0x7f, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x60, 0x20, 0x3c, 0x22, 0x22, 0x22, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0xf2, 0x8a, 0x8a, 0x8a, 0xf2, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x78, + 0x44, 0x44, 0x44, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x42, 0x02, 0x1e, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x92, 0x92, 0xf2, 0x92, 0x92, 0x8c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x42, 0x42, + 0x3e, 0x12, 0x22, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf0, + 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x02, 0x02, 0x0c, 0x00, + 0x00, 0x00, 0x08, 0x10, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x40, + 0x78, 0x40, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0x90, 0x9c, 0x92, 0x92, 0x92, 0x9c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90, 0x9c, 0xf2, 0x92, 0x92, 0x9c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x42, 0x44, 0x48, + 0x70, 0x48, 0x44, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x18, + 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x3c, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7e, + 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf0, 0x40, 0x7c, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, + 0x78, 0x20, 0x20, 0x3c, 0x22, 0x22, 0x22, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x82, 0x44, 0x28, 0x38, 0x54, 0x92, 0x92, 0x92, 0x92, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x44, 0x28, + 0x38, 0x54, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x7e, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x02, 0x7e, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, 0x40, 0xf8, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x92, 0x92, 0x54, 0x38, 0x54, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x02, 0x1c, 0x02, 0x42, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x22, 0x22, - 0x22, 0x22, 0x22, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x82, 0xc6, 0xaa, 0x92, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x7c, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7c, 0x10, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3f, + 0x00, 0x7e, 0x40, 0x40, 0xf8, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, + 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, + 0x78, 0x44, 0x44, 0x44, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, + 0x92, 0x54, 0x38, 0x54, 0x92, 0x92, 0x92, 0x93, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x54, 0x38, 0x54, 0x92, 0x93, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x02, 0x1c, 0x02, + 0x02, 0x42, 0x42, 0x3c, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x42, 0x02, 0x1c, 0x02, 0x42, 0x3c, 0x10, 0x10, 0x10, 0x00, + 0x00, 0x00, 0x42, 0x44, 0x48, 0x50, 0x60, 0x60, 0x50, 0x48, 0x44, 0x43, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x44, 0x48, + 0x70, 0x48, 0x44, 0x43, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, + 0x54, 0x58, 0x70, 0x70, 0x58, 0x54, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x54, 0x58, 0x70, 0x58, 0x54, 0x42, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x44, 0x48, 0x50, 0x60, 0x60, + 0x50, 0x48, 0x44, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc2, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x43, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, - 0x3e, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x7f, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x3c, - 0x22, 0x22, 0x22, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x82, 0x82, 0xf2, 0x8a, 0x8a, 0x8a, 0xf2, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x78, 0x44, 0x44, 0x44, 0x78, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x02, - 0x1e, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x8c, 0x92, 0x92, 0xf2, 0x92, 0x92, 0x8c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x42, 0x42, 0x3e, 0x12, 0x22, 0x42, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf8, 0x40, 0x7c, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x42, 0x02, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x08, 0x10, - 0x00, 0x7e, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x40, 0x78, 0x40, 0x42, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x90, 0x9c, - 0x92, 0x92, 0x92, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x90, 0x90, 0x9c, 0xf2, 0x92, 0x92, 0x9c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x08, 0x10, 0x00, 0x42, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x18, 0x00, 0x42, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x18, 0x18, 0x00, 0x00, - 0x02, 0x02, 0x7e, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x7e, 0x40, 0x40, - 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, - 0x40, 0x40, 0xf8, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, 0xf8, 0x40, 0x40, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x40, 0x7c, - 0x42, 0x42, 0x42, 0x42, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7e, 0x40, 0x40, 0x78, 0x44, 0x44, 0x44, 0x04, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x92, 0x92, 0x92, 0x54, 0x38, 0x54, 0x92, 0x92, 0x92, 0x93, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x92, 0x54, - 0x38, 0x54, 0x92, 0x93, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, - 0x42, 0x02, 0x1c, 0x02, 0x02, 0x42, 0x42, 0x3c, 0x10, 0x10, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x02, 0x1c, 0x02, 0x42, 0x3c, - 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x42, 0x44, 0x48, 0x50, 0x60, 0x60, - 0x50, 0x48, 0x44, 0x43, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x42, 0x44, 0x48, 0x70, 0x48, 0x44, 0x43, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x42, 0x42, 0x54, 0x58, 0x70, 0x70, 0x58, 0x54, 0x42, 0x42, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x54, 0x58, - 0x70, 0x58, 0x54, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x44, - 0x48, 0x50, 0x60, 0x60, 0x50, 0x48, 0x44, 0x42, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x42, - 0x42, 0x42, 0x42, 0x43, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x43, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x47, 0x44, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, 0x44, 0x44, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x44, 0x44, - 0x7c, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, - 0x42, 0x40, 0x40, 0x40, 0x40, 0x42, 0x42, 0x3c, 0x10, 0x10, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x40, 0x40, 0x40, 0x42, 0x3c, - 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x82, 0x82, 0x44, 0x44, 0x28, 0x10, - 0x7c, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, 0x7c, 0x10, 0x10, 0x00, - 0x00, 0x00, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x42, 0x43, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x24, - 0x18, 0x24, 0x42, 0x43, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x03, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x03, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x4a, 0x4a, 0x3e, - 0x0a, 0x0a, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x42, 0x4a, 0x4a, 0x3e, 0x0a, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x7c, - 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x3c, - 0x42, 0x02, 0x02, 0x7e, 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x24, 0x24, 0x00, 0x3c, 0x02, 0x02, 0x7e, 0x42, 0x42, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x00, 0x92, 0x92, 0x92, 0x54, 0x38, - 0x54, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, + 0x7e, 0x42, 0x42, 0x43, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x47, 0x44, + 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x40, 0x40, 0x40, + 0x40, 0x42, 0x42, 0x3c, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x42, 0x40, 0x40, 0x40, 0x42, 0x3c, 0x10, 0x10, 0x10, 0x00, + 0x00, 0x00, 0x82, 0x82, 0x44, 0x44, 0x28, 0x10, 0x7c, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x44, + 0x44, 0x28, 0x28, 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x42, 0x42, + 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x42, 0x43, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x24, 0x18, 0x24, 0x42, 0x43, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3e, + 0x02, 0x02, 0x02, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x03, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x42, 0x42, 0x42, 0x4a, 0x4a, 0x3e, 0x0a, 0x0a, 0x02, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x4a, 0x4a, + 0x3e, 0x0a, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, + 0x40, 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x7c, 0x42, 0x42, 0x42, 0x42, + 0x00, 0x00, 0x00, 0x00, 0x24, 0x18, 0x00, 0x92, 0x92, 0x92, 0x54, 0x38, + 0x54, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x18, 0x00, 0x92, 0x92, 0x54, 0x38, 0x54, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, - 0x24, 0x24, 0x00, 0x3c, 0x42, 0x42, 0x02, 0x1c, 0x02, 0x42, 0x42, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x3c, 0x42, 0x02, - 0x1c, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x42, 0x42, - 0x42, 0x46, 0x4a, 0x52, 0x62, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, - 0x24, 0x24, 0x00, 0x42, 0x42, 0x42, 0x46, 0x4a, 0x52, 0x62, 0x42, 0x42, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, + 0x24, 0x24, 0x00, 0x3c, 0x42, 0x02, 0x02, 0x7e, 0x42, 0x42, 0x42, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x3c, 0x02, 0x02, + 0x7e, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x00, 0x92, + 0x92, 0x92, 0x54, 0x38, 0x54, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x44, 0x44, 0x00, 0x92, 0x92, 0x54, 0x38, 0x54, 0x92, 0x92, + 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x3c, 0x42, 0x42, 0x02, 0x1c, + 0x02, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, + 0x00, 0x3c, 0x42, 0x02, 0x1c, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x00, 0x42, 0x42, 0x42, 0x46, 0x4a, 0x52, 0x62, 0x42, 0x42, 0x42, + 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x42, 0x42, 0x42, 0x46, 0x4a, + 0x52, 0x62, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x24, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x3c, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x3c, - 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x24, 0x24, 0x00, 0x3c, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x3c, 0x42, 0x02, 0x02, 0x1e, - 0x02, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, - 0x00, 0x3c, 0x42, 0x02, 0x1e, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x3c, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x3e, - 0x02, 0x02, 0x02, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x12, 0x24, 0x00, 0x42, + 0x42, 0x02, 0x02, 0x1e, 0x02, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x24, 0x24, 0x00, 0x3c, 0x42, 0x02, 0x1e, 0x02, 0x42, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3e, + 0x02, 0x02, 0x02, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x12, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3e, - 0x02, 0x02, 0x3c, 0x00, 0x24, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x3e, - 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, - 0x00, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x48, 0x48, 0x00, 0x82, 0x82, 0x82, 0xf2, 0x8a, 0x8a, 0x8a, 0x8a, 0xf2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x48, 0x00, 0x82, 0x82, 0xf2, - 0x8a, 0x8a, 0x8a, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x44, + 0x12, 0x24, 0x00, 0x42, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x3c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x24, 0x00, 0x42, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x3c, 0x00, 0x24, 0x24, 0x00, 0x42, + 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x24, 0x24, 0x00, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x48, 0x48, 0x00, 0x82, 0x82, 0x82, 0xf2, 0x8a, + 0x8a, 0x8a, 0x8a, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x48, + 0x00, 0x82, 0x82, 0xf2, 0x8a, 0x8a, 0x8a, 0xf2, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x78, 0x44, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x44, 0x78, + 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x3e, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x3e, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x42, 0x44, 0x48, 0x50, 0x60, 0x60, 0x50, 0x48, 0x44, 0x42, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x42, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, - 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x78, 0x40, + 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x7e, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x30, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x10, 0x10, 0x00, + 0x10, 0x10, 0x82, 0xc6, 0xaa, 0x92, 0x92, 0x82, 0x82, 0x82, 0x82, 0x82, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0xfc, 0x92, 0x92, + 0x92, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0xc6, + 0xaa, 0x92, 0x92, 0x82, 0x82, 0x82, 0x82, 0x82, 0x00, 0x10, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, + 0x00, 0x10, 0x10, 0x00, 0x10, 0x10, 0x42, 0x42, 0x42, 0x62, 0x52, 0x4a, + 0x46, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, + 0x00, 0x7c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x42, 0x42, 0x42, 0x62, 0x52, 0x4a, 0x46, 0x42, 0x42, 0x42, + 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x42, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0xfe, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, + 0x00, 0x00, 0x10, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0e, + 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x78, 0x40, 0x40, 0x40, 0x40, 0x7e, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x7e, 0x40, 0x40, 0x3c, 0x00, 0x10, 0x10, 0x00, 0x32, 0x4c, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x78, 0x40, 0x40, 0x40, 0x7e, @@ -755,26 +791,90 @@ static uint8_t font_bytes[1477 * 16] = { 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x00, 0x24, 0x24, - 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x24, 0x24, - 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xf0, 0x88, 0x88, 0x88, 0xf4, 0x84, 0x8e, 0x84, 0x84, 0x82, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x22, 0x40, 0xf8, 0x40, - 0xf8, 0x40, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x10, - 0x10, 0x1c, 0x70, 0x1c, 0x70, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, + 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x0c, 0x14, 0x3e, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x04, 0x04, 0x38, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x20, 0x38, + 0x24, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x04, 0x08, 0x08, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, + 0x1c, 0x04, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, + 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x10, 0x10, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x08, 0x08, 0x08, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x24, + 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, + 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x24, 0x04, 0x08, 0x10, 0x3c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x18, 0x04, 0x04, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x0c, 0x14, 0x3e, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x38, 0x20, 0x38, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x20, 0x38, 0x24, 0x24, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, + 0x04, 0x08, 0x08, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x24, 0x18, 0x24, 0x24, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x1c, 0x04, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x7c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, + 0x10, 0x10, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x08, 0x08, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x04, 0x1c, 0x24, + 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x24, 0x3c, 0x20, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, + 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x38, 0x04, 0x3c, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x20, 0x20, 0x38, 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x24, 0x28, 0x30, 0x28, + 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x24, 0x24, 0x24, + 0x38, 0x20, 0x20, 0x00, 0x00, 0x00, 0xf0, 0x88, 0x88, 0x88, 0xf4, 0x84, + 0x8e, 0x84, 0x84, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, + 0x22, 0x40, 0xf8, 0x40, 0xf8, 0x40, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x10, 0x10, 0x1c, 0x70, 0x1c, 0x70, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x52, 0x52, 0x50, 0x50, 0x50, + 0x50, 0x52, 0x52, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, + 0x62, 0x52, 0x6a, 0x56, 0x4a, 0x46, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x96, 0x96, 0xd0, 0xf0, 0xf0, 0xb0, 0x96, 0x90, 0x96, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x55, 0x55, 0x51, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x20, 0x40, 0xfe, 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0xfe, - 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x54, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x42, 0xff, 0x42, 0x24, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x52, 0x52, 0x52, 0x52, 0x52, + 0x52, 0x52, 0x5a, 0x3c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xa4, + 0xa4, 0xa4, 0xa4, 0xb8, 0xa8, 0xb4, 0xaa, 0xe6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfb, 0x55, 0x55, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x02, 0x06, 0x0a, 0x14, 0x28, + 0x50, 0x60, 0x40, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, + 0x22, 0x22, 0x34, 0x58, 0x88, 0x88, 0x84, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0xfe, 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, - 0x10, 0x54, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, + 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x04, 0xfe, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x54, 0x38, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x42, 0xff, + 0x42, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, + 0x54, 0x10, 0x10, 0x10, 0x10, 0x54, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x42, 0xfe, 0x42, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x84, 0xfe, + 0x84, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x54, 0x38, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x22, 0x42, 0xfe, 0x40, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x30, 0x50, 0x92, 0x82, + 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x40, 0xfe, 0x00, 0xfe, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0xfe, 0x00, 0xfe, 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x7e, 0xc0, 0x7e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, @@ -783,34 +883,90 @@ static uint8_t font_bytes[1477 * 16] = { 0x28, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x7e, 0xc3, 0x7e, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x28, 0x28, 0x28, 0x28, 0x6c, 0x38, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x02, 0x02, 0x02, 0x7e, - 0x02, 0x02, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, - 0x7c, 0x8a, 0x92, 0x92, 0xa2, 0x7c, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x82, 0x7c, 0x44, 0x44, + 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, + 0x02, 0x02, 0x02, 0x7e, 0x02, 0x02, 0x02, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x7e, 0x0a, 0x0a, 0x12, 0x7e, 0x12, 0x22, 0x22, 0x7e, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x7c, 0x8a, 0x92, 0x92, + 0xa2, 0x7c, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x82, + 0x82, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x20, 0x40, 0x40, 0x7e, 0x40, 0x40, 0x20, 0x1e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x20, 0x40, 0x7e, - 0x40, 0x20, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x06, 0x04, 0x04, 0x04, 0x04, 0x44, 0x44, 0x44, 0x24, 0x14, 0x0c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x92, 0x92, - 0x92, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x44, 0x44, - 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x4c, 0x00, - 0x32, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x7e, 0x08, 0x10, 0x7e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x10, - 0x08, 0x04, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x44, 0x82, 0x82, 0x82, 0x82, 0xfe, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, - 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1e, 0x24, 0x44, 0x48, 0x7e, + 0x48, 0x50, 0x30, 0x3e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1e, 0x20, 0x40, 0x7e, 0x40, 0x20, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x78, 0x04, 0x02, 0x02, 0x7e, 0x02, 0x02, 0x04, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x78, 0x24, 0x22, 0x12, 0x7e, + 0x12, 0x0a, 0x0c, 0x7c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x78, 0x04, 0x02, 0x7e, 0x02, 0x04, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x10, 0x10, 0x7c, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x10, + 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x04, + 0x04, 0x04, 0x44, 0x44, 0x44, 0x24, 0x14, 0x0c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x92, 0x92, 0x92, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, + 0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x32, 0x4c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x7e, 0x08, 0x10, + 0x7e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, 0x3e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x08, + 0x10, 0x20, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, + 0x12, 0x24, 0x48, 0x90, 0x48, 0x24, 0x12, 0x09, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x90, 0x48, 0x24, 0x12, 0x09, 0x12, 0x24, 0x48, 0x90, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7c, 0x02, 0x02, 0x02, 0x02, 0x02, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3e, 0x40, 0x40, 0x40, 0x40, 0x40, 0x3e, 0x00, 0x7e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x7c, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x44, 0x82, + 0x82, 0x82, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, + 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x12, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x90, 0x90, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x10, 0x20, 0x20, 0x20, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x20, 0x20, + 0x10, 0x10, 0x08, 0x04, 0x40, 0x20, 0x10, 0x10, 0x08, 0x08, 0x08, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, + 0x10, 0x10, 0x20, 0x40, 0x7c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7c, + 0x7c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x7c, 0x0e, 0x10, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xc0, 0xc0, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x0e, 0xe0, 0x10, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x06, 0x06, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0xe0, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -825,236 +981,584 @@ static uint8_t font_bytes[1477 * 16] = { 0x00, 0x70, 0x88, 0x80, 0x80, 0x88, 0x70, 0x00, 0x1e, 0x11, 0x11, 0x1e, 0x12, 0x11, 0x00, 0x00, 0x00, 0x88, 0xc8, 0xa8, 0x98, 0x88, 0x88, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, - 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, - 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, - 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, - 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, + 0x10, 0x10, 0x10, 0x00, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, + 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xf8, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, - 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0, + 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf8, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, + 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, - 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x1f, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, + 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, - 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x1f, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0xf0, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf8, - 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x10, 0x10, 0x10, 0x10, + 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x1f, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, + 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0, 0xf0, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, + 0xf8, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xf8, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x18, 0x18, 0x18, + 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0xf0, 0x00, 0x00, 0x00, + 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, - 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, - 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0xff, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0x1f, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x1f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, - 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x1f, 0x10, 0x10, 0x10, + 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xff, 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, - 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0xff, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0xff, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, - 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0xff, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x1f, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0xf0, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, + 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xff, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, - 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x10, - 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x3f, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x2f, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, - 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xf8, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x08, 0xe8, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x10, - 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x2f, 0x20, 0x3f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0, 0x10, - 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xe8, 0x08, 0xf8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f, 0x10, - 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x2f, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x2f, 0x20, 0x2f, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0, 0x10, - 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0xe8, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xe8, 0x08, 0xe8, 0x28, 0x28, 0x28, + 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xff, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0xf8, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, + 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1f, 0x10, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x28, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, + 0x2f, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x10, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x28, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x08, + 0xe8, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x1f, 0x10, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x2f, 0x20, + 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0xf0, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xf8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xe8, 0x08, + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x1f, 0x10, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x2f, 0x28, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x2f, 0x20, + 0x2f, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0xf0, 0x10, 0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xe8, 0x28, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xe8, 0x08, + 0xe8, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, - 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xef, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0x00, - 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xef, 0x00, 0xff, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0x10, - 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0xff, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xef, 0x00, 0xef, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, - 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x07, + 0xef, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xef, 0x00, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0xff, 0x10, 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xff, 0x28, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xef, 0x00, + 0xef, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, + 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, + 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01, 0x81, 0x81, 0x42, 0x42, + 0x24, 0x24, 0x18, 0x18, 0x18, 0x18, 0x24, 0x24, 0x42, 0x42, 0x81, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Apr 12 20:27:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB31FF8E2CF; Thu, 12 Apr 2018 20:27:58 +0000 (UTC) (envelope-from bdrewery@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 5DB806A215; Thu, 12 Apr 2018 20:27:58 +0000 (UTC) (envelope-from bdrewery@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 587E310291; Thu, 12 Apr 2018 20:27:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CKRwes032156; Thu, 12 Apr 2018 20:27:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CKRwVX032153; Thu, 12 Apr 2018 20:27:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201804122027.w3CKRwVX032153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Apr 2018 20:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332453 - in head: share/mk sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: share/mk sys/conf X-SVN-Commit-Revision: 332453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 20:27:58 -0000 Author: bdrewery Date: Thu Apr 12 20:27:57 2018 New Revision: 332453 URL: https://svnweb.freebsd.org/changeset/base/332453 Log: Fix using wrong SYSDIR after r331683. This was inadvertently overriding the first found SYSDIR with the last of /usr/src which could result in the wrong headers being used if not building from /usr/src. SYSDIR?= is not used here to avoid evaluating the exists() when unneeded. Reported by: rgrimes, sjg, Mark Millard Pointyhat to: bdrewery Sponsored by: Dell EMC Modified: head/share/mk/bsd.dtb.mk head/share/mk/bsd.kmod.mk head/sys/conf/kmod.mk Modified: head/share/mk/bsd.dtb.mk ============================================================================== --- head/share/mk/bsd.dtb.mk Thu Apr 12 20:21:04 2018 (r332452) +++ head/share/mk/bsd.dtb.mk Thu Apr 12 20:27:57 2018 (r332453) @@ -5,7 +5,7 @@ .if !defined(SYSDIR) .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ ${.CURDIR}/../../../../.. /sys /usr/src/sys -.if exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) +.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) SYSDIR= ${_dir} .endif .endfor Modified: head/share/mk/bsd.kmod.mk ============================================================================== --- head/share/mk/bsd.kmod.mk Thu Apr 12 20:21:04 2018 (r332452) +++ head/share/mk/bsd.kmod.mk Thu Apr 12 20:27:57 2018 (r332453) @@ -5,7 +5,7 @@ .if !defined(SYSDIR) .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ ${.CURDIR}/../../../../.. /sys /usr/src/sys -.if exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) +.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) SYSDIR= ${_dir:tA} .endif .endfor Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Apr 12 20:21:04 2018 (r332452) +++ head/sys/conf/kmod.mk Thu Apr 12 20:27:57 2018 (r332453) @@ -84,7 +84,7 @@ OBJCOPY?= objcopy .if empty(KERNBUILDDIR) .if !defined(SYSDIR) .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys -.if exists(${_dir}/kern/) +.if !defined(SYSDIR) && exists(${_dir}/kern/) SYSDIR= ${_dir:tA} .endif .endfor From owner-svn-src-all@freebsd.org Thu Apr 12 20:43:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7221AF8F6BF; Thu, 12 Apr 2018 20:43:40 +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 2495B6DBC0; Thu, 12 Apr 2018 20:43:40 +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 1E9B0105CA; Thu, 12 Apr 2018 20:43:40 +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 w3CKhdr9041950; Thu, 12 Apr 2018 20:43:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CKhdFF041945; Thu, 12 Apr 2018 20:43:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804122043.w3CKhdFF041945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Apr 2018 20:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332454 - in head/sys: amd64/amd64 amd64/ia32 amd64/linux amd64/linux32 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/ia32 amd64/linux amd64/linux32 i386/i386 X-SVN-Commit-Revision: 332454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 20:43:40 -0000 Author: kib Date: Thu Apr 12 20:43:39 2018 New Revision: 332454 URL: https://svnweb.freebsd.org/changeset/base/332454 Log: Fix PSL_T inheritance on exec for x86. The miscellaneous x86 sysent->sv_setregs() implementations tried to migrate PSL_T from the previous program to the new executed one, but they evaluated regs->tf_eflags after the whole regs structure was bzeroed. Make this functional by saving PSL_T value before zeroing. Note that if the debugger is not attached, executing the first instruction in the new program with PSL_T set results in SIGTRAP, and since all intercepted signals are reset to default dispostion on exec(2), this means that non-debugged process gets killed immediately if PSL_T is inherited. In particular, since suid images drop P_TRACED, attempt to set PSL_T for execution of such program would kill the process. Another issue with userspace PSL_T handling is that it is reset by trap(). It is reasonable to clear PSL_T when entering SIGTRAP handler, to allow the signal to be handled without recursion or delivery of blocked fault. But it is not reasonable to return back to the normal flow with PSL_T cleared. This is too late to change, I think. Discussed with: bde, Ali Mashtizadeh Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D14995 Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Apr 12 20:27:57 2018 (r332453) +++ head/sys/amd64/amd64/machdep.c Thu Apr 12 20:43:39 2018 (r332454) @@ -581,9 +581,13 @@ freebsd4_sigreturn(struct thread *td, struct freebsd4_ void exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) { - struct trapframe *regs = td->td_frame; - struct pcb *pcb = td->td_pcb; + struct trapframe *regs; + struct pcb *pcb; + register_t saved_rflags; + regs = td->td_frame; + pcb = td->td_pcb; + if (td->td_proc->p_md.md_ldt != NULL) user_ldt_free(td); @@ -593,11 +597,12 @@ exec_setregs(struct thread *td, struct image_params *i clear_pcb_flags(pcb, PCB_32BIT); pcb->pcb_initial_fpucw = __INITIAL_FPUCW__; + saved_rflags = regs->tf_rflags & PSL_T; bzero((char *)regs, sizeof(struct trapframe)); regs->tf_rip = imgp->entry_addr; regs->tf_rsp = ((stack - 8) & ~0xFul) + 8; regs->tf_rdi = stack; /* argv */ - regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); + regs->tf_rflags = PSL_USER | saved_rflags; regs->tf_ss = _udatasel; regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Thu Apr 12 20:27:57 2018 (r332453) +++ head/sys/amd64/ia32/ia32_signal.c Thu Apr 12 20:43:39 2018 (r332454) @@ -936,9 +936,13 @@ freebsd32_sigreturn(td, uap) void ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack) { - struct trapframe *regs = td->td_frame; - struct pcb *pcb = td->td_pcb; + struct trapframe *regs; + struct pcb *pcb; + register_t saved_rflags; + regs = td->td_frame; + pcb = td->td_pcb; + if (td->td_proc->p_md.md_ldt != NULL) user_ldt_free(td); #ifdef COMPAT_43 @@ -949,10 +953,11 @@ ia32_setregs(struct thread *td, struct image_params *i pcb->pcb_gsbase = 0; pcb->pcb_initial_fpucw = __INITIAL_FPUCW_I386__; + saved_rflags = regs->tf_rflags & PSL_T; bzero((char *)regs, sizeof(struct trapframe)); regs->tf_rip = imgp->entry_addr; regs->tf_rsp = stack; - regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); + regs->tf_rflags = PSL_USER | saved_rflags; regs->tf_ss = _udatasel; regs->tf_cs = _ucode32sel; regs->tf_rbx = imgp->ps_strings; Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Thu Apr 12 20:27:57 2018 (r332453) +++ head/sys/amd64/linux/linux_sysvec.c Thu Apr 12 20:43:39 2018 (r332454) @@ -404,9 +404,13 @@ linux_copyout_strings(struct image_params *imgp) static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) { - struct trapframe *regs = td->td_frame; - struct pcb *pcb = td->td_pcb; + struct trapframe *regs; + struct pcb *pcb; + register_t saved_rflags; + regs = td->td_frame; + pcb = td->td_pcb; + if (td->td_proc->p_md.md_ldt != NULL) user_ldt_free(td); @@ -416,10 +420,11 @@ linux_exec_setregs(struct thread *td, struct image_par pcb->pcb_initial_fpucw = __LINUX_NPXCW__; set_pcb_flags(pcb, PCB_FULL_IRET); + saved_rflags = regs->tf_rflags & PSL_T; bzero((char *)regs, sizeof(struct trapframe)); regs->tf_rip = imgp->entry_addr; regs->tf_rsp = stack; - regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); + regs->tf_rflags = PSL_USER | saved_rflags; regs->tf_ss = _udatasel; regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Thu Apr 12 20:27:57 2018 (r332453) +++ head/sys/amd64/linux32/linux32_sysvec.c Thu Apr 12 20:43:39 2018 (r332454) @@ -719,7 +719,11 @@ linux_exec_setregs(struct thread *td, struct image_par { struct trapframe *regs = td->td_frame; struct pcb *pcb = td->td_pcb; + register_t saved_rflags; + regs = td->td_frame; + pcb = td->td_pcb; + if (td->td_proc->p_md.md_ldt != NULL) user_ldt_free(td); @@ -731,10 +735,11 @@ linux_exec_setregs(struct thread *td, struct image_par critical_exit(); pcb->pcb_initial_fpucw = __LINUX_NPXCW__; + saved_rflags = regs->tf_rflags & PSL_T; bzero((char *)regs, sizeof(struct trapframe)); regs->tf_rip = imgp->entry_addr; regs->tf_rsp = stack; - regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); + regs->tf_rflags = PSL_USER | saved_rflags; regs->tf_gs = _ugssel; regs->tf_fs = _ufssel; regs->tf_es = _udatasel; Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu Apr 12 20:27:57 2018 (r332453) +++ head/sys/i386/i386/machdep.c Thu Apr 12 20:43:39 2018 (r332454) @@ -1104,9 +1104,13 @@ sys_sigreturn(td, uap) void exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) { - struct trapframe *regs = td->td_frame; - struct pcb *pcb = td->td_pcb; + struct trapframe *regs; + struct pcb *pcb; + register_t saved_eflags; + regs = td->td_frame; + pcb = td->td_pcb; + /* Reset pc->pcb_gs and %gs before possibly invalidating it. */ pcb->pcb_gs = _udatasel; load_gs(_udatasel); @@ -1127,10 +1131,11 @@ exec_setregs(struct thread *td, struct image_params *i set_gsbase(td, 0); /* Make sure edx is 0x0 on entry. Linux binaries depend on it. */ + saved_eflags = regs->tf_eflags & PSL_T; bzero((char *)regs, sizeof(struct trapframe)); regs->tf_eip = imgp->entry_addr; regs->tf_esp = stack; - regs->tf_eflags = PSL_USER | (regs->tf_eflags & PSL_T); + regs->tf_eflags = PSL_USER | saved_eflags; regs->tf_ss = _udatasel; regs->tf_ds = _udatasel; regs->tf_es = _udatasel; From owner-svn-src-all@freebsd.org Thu Apr 12 20:48:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B3EFF8FB2F; Thu, 12 Apr 2018 20:48:18 +0000 (UTC) (envelope-from bdrewery@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 C10346F84E; Thu, 12 Apr 2018 20:48:17 +0000 (UTC) (envelope-from bdrewery@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 B73B9105D7; Thu, 12 Apr 2018 20:48:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CKmHSE042159; Thu, 12 Apr 2018 20:48:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CKmHUC042156; Thu, 12 Apr 2018 20:48:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201804122048.w3CKmHUC042156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Apr 2018 20:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332455 - in head: share/mk sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: share/mk sys/conf X-SVN-Commit-Revision: 332455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 20:48:18 -0000 Author: bdrewery Date: Thu Apr 12 20:48:17 2018 New Revision: 332455 URL: https://svnweb.freebsd.org/changeset/base/332455 Log: Use known SRCTOP if possible to determine SYSDIR. Suggested by: sjg Sponsored by: Dell EMC Modified: head/share/mk/bsd.dtb.mk head/share/mk/bsd.kmod.mk head/sys/conf/kmod.mk Modified: head/share/mk/bsd.dtb.mk ============================================================================== --- head/share/mk/bsd.dtb.mk Thu Apr 12 20:43:39 2018 (r332454) +++ head/share/mk/bsd.dtb.mk Thu Apr 12 20:48:17 2018 (r332455) @@ -3,7 +3,8 @@ # Search for kernel source tree in standard places. .if empty(KERNBUILDDIR) .if !defined(SYSDIR) -.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ +.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ + ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ ${.CURDIR}/../../../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) SYSDIR= ${_dir} Modified: head/share/mk/bsd.kmod.mk ============================================================================== --- head/share/mk/bsd.kmod.mk Thu Apr 12 20:43:39 2018 (r332454) +++ head/share/mk/bsd.kmod.mk Thu Apr 12 20:48:17 2018 (r332455) @@ -3,7 +3,8 @@ # Search for kernel source tree in standard places. .if empty(KERNBUILDDIR) .if !defined(SYSDIR) -.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ +.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ + ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ ${.CURDIR}/../../../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) SYSDIR= ${_dir:tA} Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Apr 12 20:43:39 2018 (r332454) +++ head/sys/conf/kmod.mk Thu Apr 12 20:48:17 2018 (r332455) @@ -83,7 +83,8 @@ OBJCOPY?= objcopy # Search for kernel source tree in standard places. .if empty(KERNBUILDDIR) .if !defined(SYSDIR) -.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys +.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ + ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys .if !defined(SYSDIR) && exists(${_dir}/kern/) SYSDIR= ${_dir:tA} .endif From owner-svn-src-all@freebsd.org Thu Apr 12 21:05:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4FBF90F08; Thu, 12 Apr 2018 21:05:21 +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 5C82D7126A; Thu, 12 Apr 2018 21:05:21 +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 52BFD108F0; Thu, 12 Apr 2018 21:05:21 +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 w3CL5L3g051931; Thu, 12 Apr 2018 21:05:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CL5Lcq051929; Thu, 12 Apr 2018 21:05:21 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804122105.w3CL5Lcq051929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Apr 2018 21:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332456 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 332456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 21:05:22 -0000 Author: ae Date: Thu Apr 12 21:05:20 2018 New Revision: 332456 URL: https://svnweb.freebsd.org/changeset/base/332456 Log: Migrate NAT64 to FIB KPI. Obtained from: Yandex LLC MFC after: 1 week Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c head/sys/netpfil/ipfw/nat64/nat64_translate.h Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64_translate.c Thu Apr 12 20:48:17 2018 (r332455) +++ head/sys/netpfil/ipfw/nat64/nat64_translate.c Thu Apr 12 21:05:20 2018 (r332456) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -60,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -76,11 +78,12 @@ nat64_log(struct pfloghdr *logdata, struct mbuf *m, sa logdata->af = family; ipfw_bpf_mtap2(logdata, PFLOG_HDRLEN, m); } + #ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT -static NAT64NOINLINE struct sockaddr* nat64_find_route4(struct route *ro, - in_addr_t dest, struct mbuf *m); -static NAT64NOINLINE struct sockaddr* nat64_find_route6(struct route_in6 *ro, - struct in6_addr *dest, struct mbuf *m); +static NAT64NOINLINE int nat64_find_route4(struct nhop4_basic *, + struct sockaddr_in *, struct mbuf *); +static NAT64NOINLINE int nat64_find_route6(struct nhop6_basic *, + struct sockaddr_in6 *, struct mbuf *); static NAT64NOINLINE int nat64_output(struct ifnet *ifp, struct mbuf *m, @@ -100,28 +103,38 @@ nat64_output(struct ifnet *ifp, struct mbuf *m, static NAT64NOINLINE int nat64_output_one(struct mbuf *m, nat64_stats_block *stats, void *logdata) { - struct route_in6 ro6; - struct route ro4, *ro; + struct nhop6_basic nh6; + struct nhop4_basic nh4; + struct sockaddr_in6 dst6; + struct sockaddr_in dst4; struct sockaddr *dst; - struct ifnet *ifp; struct ip6_hdr *ip6; struct ip *ip4; + struct ifnet *ifp; int error; ip4 = mtod(m, struct ip *); switch (ip4->ip_v) { case IPVERSION: - ro = &ro4; - dst = nat64_find_route4(&ro4, ip4->ip_dst.s_addr, m); - if (dst == NULL) + dst4.sin_addr = ip4->ip_dst; + error = nat64_find_route4(&nh4, &dst4, m); + if (error != 0) NAT64STAT_INC(stats, noroute4); + else { + ifp = nh4.nh_ifp; + dst = (struct sockaddr *)&dst4; + } break; case (IPV6_VERSION >> 4): - ip6 = (struct ip6_hdr *)ip4; - ro = (struct route *)&ro6; - dst = nat64_find_route6(&ro6, &ip6->ip6_dst, m); - if (dst == NULL) + ip6 = mtod(m, struct ip6_hdr *); + dst6.sin6_addr = ip6->ip6_dst; + error = nat64_find_route6(&nh6, &dst6, m); + if (error != 0) NAT64STAT_INC(stats, noroute6); + else { + ifp = nh6.nh_ifp; + dst = (struct sockaddr *)&dst6; + } break; default: m_freem(m); @@ -129,18 +142,15 @@ nat64_output_one(struct mbuf *m, nat64_stats_block *st DPRINTF(DP_DROPS, "dropped due to unknown IP version"); return (EAFNOSUPPORT); } - if (dst == NULL) { - FREE_ROUTE(ro); + if (error != 0) { m_freem(m); return (EHOSTUNREACH); } if (logdata != NULL) nat64_log(logdata, m, dst->sa_family); - ifp = ro->ro_rt->rt_ifp; - error = (*ifp->if_output)(ifp, m, dst, ro); + error = (*ifp->if_output)(ifp, m, dst, NULL); if (error != 0) NAT64STAT_INC(stats, oerrors); - FREE_ROUTE(ro); return (error); } #else /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */ @@ -470,36 +480,31 @@ fail: return (ENOMEM); } -#if __FreeBSD_version < 1100000 -#define rt_expire rt_rmx.rmx_expire -#define rt_mtu rt_rmx.rmx_mtu -#endif -static NAT64NOINLINE struct sockaddr* -nat64_find_route6(struct route_in6 *ro, struct in6_addr *dest, struct mbuf *m) +static NAT64NOINLINE int +nat64_find_route6(struct nhop6_basic *pnh, struct sockaddr_in6 *dst, + struct mbuf *m) { - struct sockaddr_in6 *dst; - struct rtentry *rt; - bzero(ro, sizeof(*ro)); - dst = (struct sockaddr_in6 *)&ro->ro_dst; + if (fib6_lookup_nh_basic(M_GETFIB(m), &dst->sin6_addr, 0, 0, 0, + pnh) != 0) + return (EHOSTUNREACH); + if (pnh->nh_flags & (NHF_BLACKHOLE | NHF_REJECT)) + return (EHOSTUNREACH); + /* + * XXX: we need to use destination address with embedded scope + * zone id, because LLTABLE uses such form of addresses for lookup. + */ dst->sin6_family = AF_INET6; dst->sin6_len = sizeof(*dst); - dst->sin6_addr = *dest; - IN6_LOOKUP_ROUTE(ro, M_GETFIB(m)); - rt = ro->ro_rt; - if (rt && (rt->rt_flags & RTF_UP) && - (rt->rt_ifp->if_flags & IFF_UP) && - (rt->rt_ifp->if_drv_flags & IFF_DRV_RUNNING)) { - if (rt->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in6 *)rt->rt_gateway; - } else - return (NULL); - if (((rt->rt_flags & RTF_REJECT) && - (rt->rt_expire == 0 || - time_uptime < rt->rt_expire)) || - rt->rt_ifp->if_link_state == LINK_STATE_DOWN) - return (NULL); - return ((struct sockaddr *)dst); + dst->sin6_addr = pnh->nh_addr; + if (IN6_IS_SCOPE_LINKLOCAL(&dst->sin6_addr)) + dst->sin6_addr.s6_addr16[1] = + htons(pnh->nh_ifp->if_index & 0xffff); + dst->sin6_port = 0; + dst->sin6_scope_id = 0; + dst->sin6_flowinfo = 0; + + return (0); } #define NAT64_ICMP6_PLEN 64 @@ -600,32 +605,21 @@ freeit: m_freem(m); } -static NAT64NOINLINE struct sockaddr* -nat64_find_route4(struct route *ro, in_addr_t dest, struct mbuf *m) +static NAT64NOINLINE int +nat64_find_route4(struct nhop4_basic *pnh, struct sockaddr_in *dst, + struct mbuf *m) { - struct sockaddr_in *dst; - struct rtentry *rt; - bzero(ro, sizeof(*ro)); - dst = (struct sockaddr_in *)&ro->ro_dst; + if (fib4_lookup_nh_basic(M_GETFIB(m), dst->sin_addr, 0, 0, pnh) != 0) + return (EHOSTUNREACH); + if (pnh->nh_flags & (NHF_BLACKHOLE | NHF_BROADCAST | NHF_REJECT)) + return (EHOSTUNREACH); + dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); - dst->sin_addr.s_addr = dest; - IN_LOOKUP_ROUTE(ro, M_GETFIB(m)); - rt = ro->ro_rt; - if (rt && (rt->rt_flags & RTF_UP) && - (rt->rt_ifp->if_flags & IFF_UP) && - (rt->rt_ifp->if_drv_flags & IFF_DRV_RUNNING)) { - if (rt->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)rt->rt_gateway; - } else - return (NULL); - if (((rt->rt_flags & RTF_REJECT) && - (rt->rt_expire == 0 || - time_uptime < rt->rt_expire)) || - rt->rt_ifp->if_link_state == LINK_STATE_DOWN) - return (NULL); - return ((struct sockaddr *)dst); + dst->sin_addr = pnh->nh_addr; + dst->sin_port = 0; + return (0); } #define NAT64_ICMP_PLEN 64 @@ -1066,13 +1060,11 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s struct in6_addr *daddr, uint16_t lport, nat64_stats_block *stats, void *logdata) { - struct route_in6 ro; + struct nhop6_basic nh; struct ip6_hdr ip6; - struct ifnet *ifp; + struct sockaddr_in6 dst; struct ip *ip; struct mbufq mq; - struct sockaddr *dst; - uint32_t mtu; uint16_t ip_id, ip_off; uint16_t *csum; int plen, hlen; @@ -1110,23 +1102,17 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s return (NAT64MFREE); } - dst = nat64_find_route6(&ro, &ip6.ip6_dst, m); - if (dst == NULL) { - FREE_ROUTE(&ro); + dst.sin6_addr = ip6.ip6_dst; + if (nat64_find_route6(&nh, &dst, m) != 0) { NAT64STAT_INC(stats, noroute6); nat64_icmp_reflect(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, stats, logdata); return (NAT64RETURN); } - ifp = ro.ro_rt->rt_ifp; - if (ro.ro_rt->rt_mtu != 0) - mtu = min(ro.ro_rt->rt_mtu, ifp->if_mtu); - else - mtu = ifp->if_mtu; - if (mtu < plen + sizeof(ip6) && (ip->ip_off & htons(IP_DF)) != 0) { - FREE_ROUTE(&ro); + if (nh.nh_mtu < plen + sizeof(ip6) && + (ip->ip_off & htons(IP_DF)) != 0) { nat64_icmp_reflect(m, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, - FRAGSZ(mtu) + sizeof(struct ip), stats, logdata); + FRAGSZ(nh.nh_mtu) + sizeof(struct ip), stats, logdata); return (NAT64RETURN); } @@ -1162,24 +1148,20 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s break; case IPPROTO_ICMP: m = nat64_icmp_translate(m, &ip6, lport, hlen, stats); - if (m == NULL) { - FREE_ROUTE(&ro); - /* stats already accounted */ + if (m == NULL) /* stats already accounted */ return (NAT64RETURN); - } } m_adj(m, hlen); mbufq_init(&mq, 255); - nat64_fragment6(stats, &ip6, &mq, m, mtu, ip_id, ip_off); + nat64_fragment6(stats, &ip6, &mq, m, nh.nh_mtu, ip_id, ip_off); while ((m = mbufq_dequeue(&mq)) != NULL) { - if (nat64_output(ifp, m, dst, (struct route *)&ro, stats, - logdata) != 0) + if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, + NULL, stats, logdata) != 0) break; NAT64STAT_INC(stats, opcnt46); } mbufq_drain(&mq); - FREE_ROUTE(&ro); return (NAT64RETURN); } @@ -1406,15 +1388,13 @@ int nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, uint16_t aport, nat64_stats_block *stats, void *logdata) { - struct route ro; struct ip ip; - struct ifnet *ifp; + struct nhop4_basic nh; + struct sockaddr_in dst; struct ip6_frag *frag; struct ip6_hdr *ip6; struct icmp6_hdr *icmp6; - struct sockaddr *dst; uint16_t *csum; - uint32_t mtu; int plen, hlen, proto; /* @@ -1501,24 +1481,16 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui return (nat64_handle_icmp6(m, hlen, aaddr, aport, stats, logdata)); } - dst = nat64_find_route4(&ro, ip.ip_dst.s_addr, m); - if (dst == NULL) { - FREE_ROUTE(&ro); + dst.sin_addr.s_addr = ip.ip_dst.s_addr; + if (nat64_find_route4(&nh, &dst, m) != 0) { NAT64STAT_INC(stats, noroute4); nat64_icmp6_reflect(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOROUTE, 0, stats, logdata); return (NAT64RETURN); } - - ifp = ro.ro_rt->rt_ifp; - if (ro.ro_rt->rt_mtu != 0) - mtu = min(ro.ro_rt->rt_mtu, ifp->if_mtu); - else - mtu = ifp->if_mtu; - if (mtu < plen + sizeof(ip)) { - FREE_ROUTE(&ro); - nat64_icmp6_reflect(m, ICMP6_PACKET_TOO_BIG, 0, mtu, stats, - logdata); + if (nh.nh_mtu < plen + sizeof(ip)) { + nat64_icmp6_reflect(m, ICMP6_PACKET_TOO_BIG, 0, nh.nh_mtu, + stats, logdata); return (NAT64RETURN); } nat64_init_ip4hdr(ip6, frag, plen, proto, &ip); @@ -1548,12 +1520,13 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui *csum = cksum_add(*csum, in6_cksum_pseudo(ip6, plen, IPPROTO_ICMPV6, 0)); /* Convert ICMPv6 types to ICMP */ - mtu = *(uint16_t *)icmp6; /* save old word for cksum_adjust */ + proto = *(uint16_t *)icmp6; /* save old word for cksum_adjust */ if (icmp6->icmp6_type == ICMP6_ECHO_REQUEST) icmp6->icmp6_type = ICMP_ECHO; else /* ICMP6_ECHO_REPLY */ icmp6->icmp6_type = ICMP_ECHOREPLY; - *csum = cksum_adjust(*csum, (uint16_t)mtu, *(uint16_t *)icmp6); + *csum = cksum_adjust(*csum, (uint16_t)proto, + *(uint16_t *)icmp6); if (aport != 0) { uint16_t old_id = icmp6->icmp6_id; icmp6->icmp6_id = aport; @@ -1564,9 +1537,9 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui m_adj(m, hlen - sizeof(ip)); bcopy(&ip, mtod(m, void *), sizeof(ip)); - if (nat64_output(ifp, m, dst, &ro, stats, logdata) == 0) + if (nat64_output(nh.nh_ifp, m, (struct sockaddr *)&dst, NULL, + stats, logdata) == 0) NAT64STAT_INC(stats, opcnt64); - FREE_ROUTE(&ro); return (NAT64RETURN); } Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.h ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64_translate.h Thu Apr 12 20:48:17 2018 (r332455) +++ head/sys/netpfil/ipfw/nat64/nat64_translate.h Thu Apr 12 21:05:20 2018 (r332456) @@ -30,16 +30,6 @@ #ifndef _IP_FW_NAT64_TRANSLATE_H_ #define _IP_FW_NAT64_TRANSLATE_H_ -#ifdef RTALLOC_NOLOCK -#define IN_LOOKUP_ROUTE(ro, fib) rtalloc_fib_nolock((ro), 0, (fib)) -#define IN6_LOOKUP_ROUTE(ro, fib) in6_rtalloc_nolock((ro), (fib)) -#define FREE_ROUTE(ro) -#else -#define IN_LOOKUP_ROUTE(ro, fib) rtalloc_ign_fib((ro), 0, (fib)) -#define IN6_LOOKUP_ROUTE(ro, fib) in6_rtalloc((ro), (fib)) -#define FREE_ROUTE(ro) RO_RTFREE((ro)) -#endif - static inline int nat64_check_ip6(struct in6_addr *addr) { From owner-svn-src-all@freebsd.org Thu Apr 12 21:13:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB9FBF91B5E; Thu, 12 Apr 2018 21:13:31 +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 6DC8B73FD9; Thu, 12 Apr 2018 21:13:31 +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 6597010A86; Thu, 12 Apr 2018 21:13:31 +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 w3CLDV1I057020; Thu, 12 Apr 2018 21:13:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CLDVuT057017; Thu, 12 Apr 2018 21:13:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804122113.w3CLDVuT057017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Apr 2018 21:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332457 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 332457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 21:13:32 -0000 Author: ae Date: Thu Apr 12 21:13:30 2018 New Revision: 332457 URL: https://svnweb.freebsd.org/changeset/base/332457 Log: Use cfg->nomatch_verdict as return value from NAT64LSN handler when given mbuf is considered as not matched. If mbuf was consumed or freed during handling, we must return IP_FW_DENY, since ipfw's pfil handler ipfw_check_packet() expects IP_FW_DENY when mbuf pointer is NULL. This fixes KASSERT panics when NAT64 is used with INVARIANTS. Also remove unused nomatch_final field from struct nat64lsn_cfg. Reported by: Justin Holcomb Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.c head/sys/netpfil/ipfw/nat64/nat64lsn.h head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64lsn.c Thu Apr 12 21:05:20 2018 (r332456) +++ head/sys/netpfil/ipfw/nat64/nat64lsn.c Thu Apr 12 21:13:30 2018 (r332457) @@ -351,10 +351,11 @@ nat64lsn_translate4(struct nat64lsn_cfg *cfg, const st if (nat_proto == NAT_PROTO_ICMP) { ret = inspect_icmp_mbuf(pm, &nat_proto, &addr, &port); if (ret != 0) { - if (ret == ENOMEM) + if (ret == ENOMEM) { NAT64STAT_INC(&cfg->stats, nomem); - else - NAT64STAT_INC(&cfg->stats, noproto); + return (IP_FW_DENY); + } + NAT64STAT_INC(&cfg->stats, noproto); return (cfg->nomatch_verdict); } /* XXX: Check addr for validity */ @@ -416,7 +417,7 @@ nat64lsn_translate4(struct nat64lsn_cfg *cfg, const st &cfg->stats, logdata); if (ret == NAT64SKIP) - return (IP_FW_PASS); + return (cfg->nomatch_verdict); if (ret == NAT64MFREE) m_freem(*pm); *pm = NULL; @@ -1362,7 +1363,7 @@ nat64lsn_request_host(struct nat64lsn_cfg *cfg, NAT64STAT_INC(&cfg->stats, jhostsreq); } - return (IP_FW_PASS); + return (IP_FW_DENY); } static NAT64NOINLINE int @@ -1391,7 +1392,7 @@ nat64lsn_request_portgroup(struct nat64lsn_cfg *cfg, NAT64STAT_INC(&cfg->stats, jportreq); } - return (IP_FW_PASS); + return (IP_FW_DENY); } static NAT64NOINLINE struct nat64lsn_state * @@ -1595,7 +1596,7 @@ nat64lsn_translate6(struct nat64lsn_cfg *cfg, struct i action = nat64_do_handle_ip6(*pm, aaddr, aport, &cfg->stats, logdata); if (action == NAT64SKIP) - return (IP_FW_PASS); + return (cfg->nomatch_verdict); if (action == NAT64MFREE) m_freem(*pm); *pm = NULL; /* mark mbuf as consumed */ @@ -1631,7 +1632,7 @@ ipfw_nat64lsn(struct ip_fw_chain *ch, struct ip_fw_arg ret = nat64lsn_translate6(cfg, &args->f_id, &args->m); break; default: - return (0); + return (cfg->nomatch_verdict); } return (ret); } Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.h ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64lsn.h Thu Apr 12 21:05:20 2018 (r332456) +++ head/sys/netpfil/ipfw/nat64/nat64lsn.h Thu Apr 12 21:13:30 2018 (r332457) @@ -199,7 +199,6 @@ struct nat64lsn_cfg { uint8_t plen4; uint8_t plen6; uint8_t nomatch_verdict;/* What to return to ipfw on no-match */ - uint8_t nomatch_final; /* Exit outer loop? */ struct in6_addr prefix6; /* IPv6 prefix to embed IPv4 hosts */ uint32_t ihcount; /* Number of items in host hash */ Modified: head/sys/netpfil/ipfw/nat64/nat64lsn_control.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Thu Apr 12 21:05:20 2018 (r332456) +++ head/sys/netpfil/ipfw/nat64/nat64lsn_control.c Thu Apr 12 21:13:30 2018 (r332457) @@ -190,7 +190,6 @@ nat64lsn_create(struct ip_fw_chain *ch, ip_fw3_opheade cfg->st_icmp_ttl = uc->st_icmp_ttl; cfg->nomatch_verdict = IP_FW_DENY; - cfg->nomatch_final = 1; /* Exit outer loop by default */ IPFW_UH_WLOCK(ch); From owner-svn-src-all@freebsd.org Thu Apr 12 21:16:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2F19F91EB6; Thu, 12 Apr 2018 21:16:36 +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 4F37974D05; Thu, 12 Apr 2018 21:16:35 +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 w3CLGXg3034313; Thu, 12 Apr 2018 14:16:33 -0700 (PDT) (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 w3CLGXeG034312; Thu, 12 Apr 2018 14:16:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804122116.w3CLGXeG034312@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r332453 - in head: share/mk sys/conf In-Reply-To: <201804122027.w3CKRwVX032153@repo.freebsd.org> To: Bryan Drewery Date: Thu, 12 Apr 2018 14:16:33 -0700 (PDT) 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 21:16:37 -0000 > Author: bdrewery > Date: Thu Apr 12 20:27:57 2018 > New Revision: 332453 > URL: https://svnweb.freebsd.org/changeset/base/332453 > > Log: > Fix using wrong SYSDIR after r331683. > > This was inadvertently overriding the first found SYSDIR with the last > of /usr/src which could result in the wrong headers being used if not > building from /usr/src. > > SYSDIR?= is not used here to avoid evaluating the exists() when unneeded. > > Reported by: rgrimes, sjg, Mark Millard > Pointyhat to: bdrewery > Sponsored by: Dell EMC > Thank you for following through with a fix! > Modified: > head/share/mk/bsd.dtb.mk > head/share/mk/bsd.kmod.mk > head/sys/conf/kmod.mk ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Apr 12 21:21:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43BF0F92384; Thu, 12 Apr 2018 21:21:19 +0000 (UTC) (envelope-from ken@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 E9C0876BF8; Thu, 12 Apr 2018 21:21:18 +0000 (UTC) (envelope-from ken@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 E4C1C10AC8; Thu, 12 Apr 2018 21:21:18 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CLLIB8058789; Thu, 12 Apr 2018 21:21:18 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CLLIVl058788; Thu, 12 Apr 2018 21:21:18 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201804122121.w3CLLIVl058788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 12 Apr 2018 21:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332458 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 332458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 21:21:19 -0000 Author: ken Date: Thu Apr 12 21:21:18 2018 New Revision: 332458 URL: https://svnweb.freebsd.org/changeset/base/332458 Log: Handle Programmable Early Warning for control commands in sa(4). When the tape position is inside the Early Warning area, the tape drive will return a sense key of NO SENSE, and an ASC/ASCQ of 0x00,0x02, which means: End-of-partition/medium detected". If this was in response to a control command like WRITE FILEMARKS, we correctly translate this as informational status and return 0 from saerror(). Programmable Early Warning should be handled the same way, but we weren't handling it that way. As a result, if a PEW status (sense key of NO SENSE, ASC/ASCQ of 0x00,0x07, "Programmable early warning detected") came back in response to a WRITE FILEMARKS, we returned an error. The impact of this was that if an application was writing to a sa(4) device, and a PEW area was set (in the Device Configuration Extension subpage -- mode page 0x10, subpage 1), and a filemark needed to be written on close, we could wind up returning an error to the user on close because of a "failure" to write the filemarks. It actually isn't a failure, but rather just a status report from the drive, and shouldn't be treated as a failure. sys/cam/scsi/scsi_sa.c: For control commands in saerror(), treat asc/ascq 0x00,0x07 the same as 0x00,{0-5} -- not an error. Return 0, since the command actually did succeed. Reported by: Dr. Andreas Haakh Tested by: Dr. Andreas Haakh Sponsored by: Spectra Logic MFC after: 3 days Modified: head/sys/cam/scsi/scsi_sa.c Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Thu Apr 12 21:13:30 2018 (r332457) +++ head/sys/cam/scsi/scsi_sa.c Thu Apr 12 21:21:18 2018 (r332458) @@ -3453,12 +3453,13 @@ saerror(union ccb *ccb, u_int32_t cflgs, u_int32_t sfl break; } /* - * If this was just EOM/EOP, Filemark, Setmark or ILI detected - * on a non read/write command, we assume it's not an error - * and propagate the residule and return. + * If this was just EOM/EOP, Filemark, Setmark, ILI or + * PEW detected on a non read/write command, we assume + * it's not an error and propagate the residual and return. */ - if ((aqvalid && asc == 0 && ascq > 0 && ascq <= 5) || - (aqvalid == 0 && sense_key == SSD_KEY_NO_SENSE)) { + if ((aqvalid && asc == 0 && ((ascq > 0 && ascq <= 5) + || (ascq == 0x07))) + || (aqvalid == 0 && sense_key == SSD_KEY_NO_SENSE)) { csio->resid = resid; QFRLS(ccb); return (0); From owner-svn-src-all@freebsd.org Thu Apr 12 21:29:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF6C0F92B1F; Thu, 12 Apr 2018 21:29:41 +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 6E74079745; Thu, 12 Apr 2018 21:29:41 +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 64D4610C31; Thu, 12 Apr 2018 21:29:41 +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 w3CLTfva061963; Thu, 12 Apr 2018 21:29:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CLTfVM061961; Thu, 12 Apr 2018 21:29:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804122129.w3CLTfVM061961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Apr 2018 21:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332459 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 332459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 21:29:41 -0000 Author: ae Date: Thu Apr 12 21:29:40 2018 New Revision: 332459 URL: https://svnweb.freebsd.org/changeset/base/332459 Log: Fix integer types mismatch for flags field in nat64stl_cfg structure. Also preserve internal flags on NAT64STL reconfiguration. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/nat64/nat64stl.h head/sys/netpfil/ipfw/nat64/nat64stl_control.c Modified: head/sys/netpfil/ipfw/nat64/nat64stl.h ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64stl.h Thu Apr 12 21:21:18 2018 (r332458) +++ head/sys/netpfil/ipfw/nat64/nat64stl.h Thu Apr 12 21:29:40 2018 (r332459) @@ -38,7 +38,7 @@ struct nat64stl_cfg { struct in6_addr prefix6;/* IPv6 prefix */ uint8_t plen6; /* prefix length */ - uint8_t flags; /* flags for internal use */ + uint32_t flags; /* flags for internal use */ #define NAT64STL_KIDX 0x0100 #define NAT64STL_46T 0x0200 #define NAT64STL_64T 0x0400 Modified: head/sys/netpfil/ipfw/nat64/nat64stl_control.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64stl_control.c Thu Apr 12 21:21:18 2018 (r332458) +++ head/sys/netpfil/ipfw/nat64/nat64stl_control.c Thu Apr 12 21:29:40 2018 (r332459) @@ -289,8 +289,8 @@ nat64stl_config(struct ip_fw_chain *ch, ip_fw3_opheade * For now allow to change only following values: * flags. */ - - cfg->flags = uc->flags & NAT64STL_FLAGSMASK; + cfg->flags &= ~NAT64STL_FLAGSMASK; + cfg->flags |= uc->flags & NAT64STL_FLAGSMASK; IPFW_UH_WUNLOCK(ch); return (0); } From owner-svn-src-all@freebsd.org Fri Apr 13 00:25:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC755F9D8C7; Fri, 13 Apr 2018 00:25:53 +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 997DA7EDAC; Fri, 13 Apr 2018 00:25:53 +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 943B6128AB; Fri, 13 Apr 2018 00:25:53 +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 w3D0Prmq050613; Fri, 13 Apr 2018 00:25:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D0PrhA050612; Fri, 13 Apr 2018 00:25:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804130025.w3D0PrhA050612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Apr 2018 00:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332460 - stable/11/usr.sbin/makefs X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.sbin/makefs X-SVN-Commit-Revision: 332460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 00:25:54 -0000 Author: emaste Date: Fri Apr 13 00:25:53 2018 New Revision: 332460 URL: https://svnweb.freebsd.org/changeset/base/332460 Log: MFC r331758: makefs: sync fragment and block size with newfs r222319 in newfs raised the default blocksize for UFS/FFS filesystems from 16K to 32K and the default fragment size from 2K to 4K, with a rationale that most disks were now running with 4K sectors. Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.sbin/makefs/ffs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/ffs.c ============================================================================== --- stable/11/usr.sbin/makefs/ffs.c Thu Apr 12 21:29:40 2018 (r332459) +++ stable/11/usr.sbin/makefs/ffs.c Fri Apr 13 00:25:53 2018 (r332460) @@ -108,8 +108,8 @@ __FBSDID("$FreeBSD$"); /* * Various file system defaults (cribbed from newfs(8)). */ -#define DFL_FRAGSIZE 1024 /* fragment size */ -#define DFL_BLKSIZE 8192 /* block size */ +#define DFL_FRAGSIZE 4096 /* fragment size */ +#define DFL_BLKSIZE 32768 /* block size */ #define DFL_SECSIZE 512 /* sector size */ #define DFL_CYLSPERGROUP 65536 /* cylinders per group */ #define DFL_FRAGSPERINODE 4 /* fragments per inode */ From owner-svn-src-all@freebsd.org Fri Apr 13 00:29:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21C26F9DE51; Fri, 13 Apr 2018 00:29:43 +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 C76BA7F080; Fri, 13 Apr 2018 00:29:42 +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 BDD17128AD; Fri, 13 Apr 2018 00:29:42 +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 w3D0Tgww050787; Fri, 13 Apr 2018 00:29:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D0Tgpe050785; Fri, 13 Apr 2018 00:29:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201804130029.w3D0Tgpe050785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Apr 2018 00:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332461 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 332461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 00:29:43 -0000 Author: mav Date: Fri Apr 13 00:29:42 2018 New Revision: 332461 URL: https://svnweb.freebsd.org/changeset/base/332461 Log: MFC r332145: Do not fail devices just for errors in descriptor format. Sponsored by: iXsystems, Inc. Modified: stable/11/sys/cam/scsi/scsi_cd.c stable/11/sys/cam/scsi/scsi_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_cd.c Fri Apr 13 00:25:53 2018 (r332460) +++ stable/11/sys/cam/scsi/scsi_cd.c Fri Apr 13 00:29:42 2018 (r332461) @@ -1129,7 +1129,8 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) * supported" (0x25) error. */ if ((have_sense) && (asc != 0x25) - && (error_code == SSD_CURRENT_ERROR)) { + && (error_code == SSD_CURRENT_ERROR + || error_code == SSD_DESC_CURRENT_ERROR)) { const char *sense_key_desc; const char *asc_desc; Modified: stable/11/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_da.c Fri Apr 13 00:25:53 2018 (r332460) +++ stable/11/sys/cam/scsi/scsi_da.c Fri Apr 13 00:29:42 2018 (r332461) @@ -4468,7 +4468,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) || ((have_sense) && - (error_code == SSD_CURRENT_ERROR) && + (error_code == SSD_CURRENT_ERROR || + error_code == SSD_DESC_CURRENT_ERROR) && (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { softc->flags &= ~DA_FLAG_CAN_RC16; free(rdcap, M_SCSIDA); @@ -4485,7 +4486,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) * unit not supported" (0x25) error. */ if ((have_sense) && (asc != 0x25) - && (error_code == SSD_CURRENT_ERROR)) { + && (error_code == SSD_CURRENT_ERROR + || error_code == SSD_DESC_CURRENT_ERROR)) { const char *sense_key_desc; const char *asc_desc; From owner-svn-src-all@freebsd.org Fri Apr 13 02:40:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328F4F8273D; Fri, 13 Apr 2018 02:40:11 +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 D9876784D2; Fri, 13 Apr 2018 02:40:10 +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 D04DB13D39; Fri, 13 Apr 2018 02:40:10 +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 w3D2eAYZ015093; Fri, 13 Apr 2018 02:40:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D2eA1K015091; Fri, 13 Apr 2018 02:40:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804130240.w3D2eA1K015091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Apr 2018 02:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332462 - stable/11/usr.bin/locate/locate X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.bin/locate/locate X-SVN-Commit-Revision: 332462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 02:40:11 -0000 Author: kevans Date: Fri Apr 13 02:40:10 2018 New Revision: 332462 URL: https://svnweb.freebsd.org/changeset/base/332462 Log: MFC r306758 (emaste): locate: ANSIfy Modified: stable/11/usr.bin/locate/locate/locate.c stable/11/usr.bin/locate/locate/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/locate/locate/locate.c ============================================================================== --- stable/11/usr.bin/locate/locate/locate.c Fri Apr 13 00:29:42 2018 (r332461) +++ stable/11/usr.bin/locate/locate/locate.c Fri Apr 13 02:40:10 2018 (r332462) @@ -134,9 +134,7 @@ extern int check_bigram_char(int); extern char *patprep(char *); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register int ch; char **dbv = NULL; @@ -225,10 +223,13 @@ main(argc, argv) } +/* + * Arguments: + * db database + * s search strings + */ void -search_fopen(db, s) - char *db; /* database */ - char **s; /* search strings */ +search_fopen(char *db, char **s) { FILE *fp; #ifdef DEBUG @@ -275,10 +276,13 @@ search_fopen(db, s) } #ifdef MMAP +/* + * Arguments: + * db database + * s search strings + */ void -search_mmap(db, s) - char *db; /* database */ - char **s; /* search strings */ +search_mmap(char *db, char **s) { struct stat sb; int fd; Modified: stable/11/usr.bin/locate/locate/util.c ============================================================================== --- stable/11/usr.bin/locate/locate/util.c Fri Apr 13 00:29:42 2018 (r332461) +++ stable/11/usr.bin/locate/locate/util.c Fri Apr 13 02:40:10 2018 (r332462) @@ -83,10 +83,7 @@ check_bigram_char(ch) * */ char ** -colon(dbv, path, dot) - char **dbv; - char *path; - char *dot; /* default for single ':' */ +colon(char **dbv, char *path, char *dot) { int vlen, slen; char *c, *ch, *p; From owner-svn-src-all@freebsd.org Fri Apr 13 03:30:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A648EF86176; Fri, 13 Apr 2018 03:30:11 +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 5A40983F07; Fri, 13 Apr 2018 03:30:11 +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 55110145B1; Fri, 13 Apr 2018 03:30:11 +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 w3D3UB1s040691; Fri, 13 Apr 2018 03:30:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D3UAdv040682; Fri, 13 Apr 2018 03:30:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804130330.w3D3UAdv040682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Apr 2018 03:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332463 - in stable/11: bin/echo bin/sleep usr.bin/basename usr.bin/dc usr.bin/dirname usr.bin/getopt usr.bin/locate/bigram usr.bin/logname usr.bin/printenv usr.bin/yes X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: bin/echo bin/sleep usr.bin/basename usr.bin/dc usr.bin/dirname usr.bin/getopt usr.bin/locate/bigram usr.bin/logname usr.bin/printenv usr.bin/yes X-SVN-Commit-Revision: 332463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 03:30:12 -0000 Author: kevans Date: Fri Apr 13 03:30:10 2018 New Revision: 332463 URL: https://svnweb.freebsd.org/changeset/base/332463 Log: MFC r308432, r308657: Capsicumize some trivial stdio programs r308432: Capsicumize some trivial stdio programs Trivially capsicumize some simple programs that just interact with stdio. This list of programs uses 'pledge("stdio")' in OpenBSD. r308657: fold(1): Revert incorrect r308432 As Jean-Sébastien notes, fold(1) requires handling argv-supplied files. That will require a slightly more sophisticated approach. Modified: stable/11/bin/echo/echo.c stable/11/bin/sleep/sleep.c stable/11/usr.bin/basename/basename.c stable/11/usr.bin/dc/dc.c stable/11/usr.bin/dirname/dirname.c stable/11/usr.bin/getopt/getopt.c stable/11/usr.bin/locate/bigram/locate.bigram.c stable/11/usr.bin/logname/logname.c stable/11/usr.bin/printenv/printenv.c stable/11/usr.bin/yes/yes.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/echo/echo.c ============================================================================== --- stable/11/bin/echo/echo.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/bin/echo/echo.c Fri Apr 13 03:30:10 2018 (r332463) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -77,6 +79,9 @@ main(int argc, char *argv[]) char space[] = " "; char newline[] = "\n"; char *progname = argv[0]; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); /* This utility may NOT do getopt(3) option parsing. */ if (*++argv && !strcmp(*argv, "-n")) { Modified: stable/11/bin/sleep/sleep.c ============================================================================== --- stable/11/bin/sleep/sleep.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/bin/sleep/sleep.c Fri Apr 13 03:30:10 2018 (r332463) @@ -41,6 +41,7 @@ static char sccsid[] = "@(#)sleep.c 8.3 (Berkeley) 4/2 #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -68,6 +69,9 @@ main(int argc, char *argv[]) double d; time_t original; char buf[2]; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); if (argc != 2) usage(); Modified: stable/11/usr.bin/basename/basename.c ============================================================================== --- stable/11/usr.bin/basename/basename.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/basename/basename.c Fri Apr 13 03:30:10 2018 (r332463) @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)basename.c 8.4 (Berkeley) #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -63,6 +64,9 @@ main(int argc, char **argv) int aflag, ch; setlocale(LC_ALL, ""); + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); aflag = 0; suffix = NULL; Modified: stable/11/usr.bin/dc/dc.c ============================================================================== --- stable/11/usr.bin/dc/dc.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/dc/dc.c Fri Apr 13 03:30:10 2018 (r332463) @@ -22,9 +22,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include +#include #include #include #include @@ -58,11 +60,11 @@ usage(void) } static void -procfile(char *fname) { +procfd(int fd, char *fname) { struct stat st; FILE *file; - file = fopen(fname, "r"); + file = fdopen(fd, "r"); if (file == NULL) err(1, "cannot open file %s", fname); if (fstat(fileno(file), &st) == -1) @@ -80,7 +82,7 @@ procfile(char *fname) { int main(int argc, char *argv[]) { - int ch; + int ch, fd; bool extended_regs = false, preproc_done = false; /* accept and ignore a single dash to be 4.4BSD dc(1) compatible */ @@ -97,7 +99,10 @@ main(int argc, char *argv[]) case 'f': if (!preproc_done) init_bmachine(extended_regs); - procfile(optarg); + fd = open(optarg, O_RDONLY); + if (fd < 0) + err(1, "cannot open file %s", optarg); + procfd(fd, optarg); preproc_done = true; break; case 'x': @@ -126,12 +131,23 @@ main(int argc, char *argv[]) if (argc > 1) usage(); if (argc == 1) { - procfile(argv[0]); + fd = open(argv[0], O_RDONLY); + if (fd < 0) + err(1, "cannot open file %s", argv[0]); + + if (caph_limit_stream(fd, CAPH_READ) < 0 || + caph_limit_stdio() < 0 || + (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + + procfd(fd, argv[0]); preproc_done = true; } if (preproc_done) return (0); + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); src_setstream(&src, stdin); reset_bmachine(&src); eval(); Modified: stable/11/usr.bin/dirname/dirname.c ============================================================================== --- stable/11/usr.bin/dirname/dirname.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/dirname/dirname.c Fri Apr 13 03:30:10 2018 (r332463) @@ -39,6 +39,7 @@ static const char sccsid[] = "@(#)dirname.c 8.4 (Berke #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -52,6 +53,9 @@ main(int argc, char **argv) { char *p; int ch; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); while ((ch = getopt(argc, argv, "")) != -1) switch(ch) { Modified: stable/11/usr.bin/getopt/getopt.c ============================================================================== --- stable/11/usr.bin/getopt/getopt.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/getopt/getopt.c Fri Apr 13 03:30:10 2018 (r332463) @@ -6,6 +6,9 @@ __FBSDID("$FreeBSD$"); * into the public domain and is thus not subject to any copyright. */ +#include +#include +#include #include #include #include @@ -15,6 +18,9 @@ main(int argc, char *argv[]) { int c; int status = 0; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); optind = 2; /* Past the program name and the option letters. */ while ((c = getopt(argc, argv, argv[1])) != -1) Modified: stable/11/usr.bin/locate/bigram/locate.bigram.c ============================================================================== --- stable/11/usr.bin/locate/bigram/locate.bigram.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/locate/bigram/locate.bigram.c Fri Apr 13 03:30:10 2018 (r332463) @@ -57,6 +57,9 @@ static char sccsid[] = "@(#)locate.bigram.c 8.1 (Berke * Use 'code' to encode a file using this output. */ +#include +#include +#include #include #include #include /* for MAXPATHLEN */ @@ -72,6 +75,9 @@ main(void) u_char *cp; u_char *oldpath = buf1, *path = buf2; u_int i, j; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); while (fgets(path, sizeof(buf2), stdin) != NULL) { Modified: stable/11/usr.bin/logname/logname.c ============================================================================== --- stable/11/usr.bin/logname/logname.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/logname/logname.c Fri Apr 13 03:30:10 2018 (r332463) @@ -39,6 +39,7 @@ static const char sccsid[] = "@(#)logname.c 8.2 (Berke #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -50,6 +51,9 @@ int main(int argc, char *argv[] __unused) { char *p; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); if (argc != 1) usage(); Modified: stable/11/usr.bin/printenv/printenv.c ============================================================================== --- stable/11/usr.bin/printenv/printenv.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/printenv/printenv.c Fri Apr 13 03:30:10 2018 (r332463) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include #include @@ -64,6 +66,9 @@ main(int argc, char *argv[]) char *cp, **ep; size_t len; int ch; + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); while ((ch = getopt(argc, argv, "")) != -1) switch(ch) { Modified: stable/11/usr.bin/yes/yes.c ============================================================================== --- stable/11/usr.bin/yes/yes.c Fri Apr 13 02:40:10 2018 (r332462) +++ stable/11/usr.bin/yes/yes.c Fri Apr 13 03:30:10 2018 (r332463) @@ -41,12 +41,17 @@ static const char rcsid[] = "$FreeBSD$"; #endif #endif /* not lint */ +#include #include #include int main(int argc, char **argv) { + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + if (argc > 1) while (puts(argv[1]) != EOF) ; From owner-svn-src-all@freebsd.org Fri Apr 13 03:32:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A379F864DC; Fri, 13 Apr 2018 03:32:19 +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 0CA0E8429F; Fri, 13 Apr 2018 03:32:19 +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 079081472B; Fri, 13 Apr 2018 03:32:19 +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 w3D3WIYr044671; Fri, 13 Apr 2018 03:32:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D3WITY044670; Fri, 13 Apr 2018 03:32:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804130332.w3D3WITY044670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Apr 2018 03:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332464 - stable/11/usr.bin/yes X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.bin/yes X-SVN-Commit-Revision: 332464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 03:32:19 -0000 Author: kevans Date: Fri Apr 13 03:32:18 2018 New Revision: 332464 URL: https://svnweb.freebsd.org/changeset/base/332464 Log: MFC r319897-r319898, r319904: Improve yes' throughput r319897: Improve yes' throughput On my system, this brings up the throughput from ~20 to ~600 MiB/s. Inspired by: https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/ r319898: Handle partial writes r319904: style(9) fixes. Modified: stable/11/usr.bin/yes/yes.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/yes/yes.c ============================================================================== --- stable/11/usr.bin/yes/yes.c Fri Apr 13 03:30:10 2018 (r332463) +++ stable/11/usr.bin/yes/yes.c Fri Apr 13 03:32:18 2018 (r332464) @@ -44,20 +44,43 @@ static const char rcsid[] = "$FreeBSD$"; #include #include #include +#include +#include int main(int argc, char **argv) { + char buf[8192]; + char y[2] = { 'y', '\n' }; + char * exp = y; + size_t buflen = 0; + size_t explen = sizeof(y); + size_t more; + ssize_t ret; if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) err(1, "capsicum"); - if (argc > 1) - while (puts(argv[1]) != EOF) - ; - else - while (puts("y") != EOF) - ; + if (argc > 1) { + exp = argv[1]; + explen = strlen(exp) + 1; + exp[explen - 1] = '\n'; + } + + if (explen <= sizeof(buf)) { + while (buflen < sizeof(buf) - explen) { + memcpy(buf + buflen, exp, explen); + buflen += explen; + } + exp = buf; + explen = buflen; + } + + more = explen; + while ((ret = write(STDOUT_FILENO, exp + (explen - more), more)) > 0) + if ((more -= ret) == 0) + more = explen; + err(1, "stdout"); /*NOTREACHED*/ } From owner-svn-src-all@freebsd.org Fri Apr 13 03:47:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A49EF8758A; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@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 05CEB87286; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@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 009A5148FC; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D3lfG7050580; Fri, 13 Apr 2018 03:47:41 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D3lfTx050579; Fri, 13 Apr 2018 03:47:41 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201804130347.w3D3lfTx050579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 13 Apr 2018 03:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332465 - in stable: 10/sbin/reboot 11/sbin/reboot X-SVN-Group: stable-10 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 10/sbin/reboot 11/sbin/reboot X-SVN-Commit-Revision: 332465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 03:47:42 -0000 Author: rgrimes Date: Fri Apr 13 03:47:41 2018 New Revision: 332465 URL: https://svnweb.freebsd.org/changeset/base/332465 Log: MFC: r332075 Exit with usage when extra arguments are on command line preventing mistakes such as "halt 0p" for "halt -p". Approved by: bde (mentor, implicit), phk (mentor,implicit) MFC after: 1 week Modified: stable/10/sbin/reboot/reboot.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sbin/reboot/reboot.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sbin/reboot/reboot.c ============================================================================== --- stable/10/sbin/reboot/reboot.c Fri Apr 13 03:32:18 2018 (r332464) +++ stable/10/sbin/reboot/reboot.c Fri Apr 13 03:47:41 2018 (r332465) @@ -111,6 +111,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; + if (argc != 0) + usage(); if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); From owner-svn-src-all@freebsd.org Fri Apr 13 03:47:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 871B2F8758B; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@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 3A89D87287; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@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 355E8148FD; Fri, 13 Apr 2018 03:47:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D3lgNj050586; Fri, 13 Apr 2018 03:47:42 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D3lg3t050585; Fri, 13 Apr 2018 03:47:42 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201804130347.w3D3lg3t050585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 13 Apr 2018 03:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332465 - in stable: 10/sbin/reboot 11/sbin/reboot X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 10/sbin/reboot 11/sbin/reboot X-SVN-Commit-Revision: 332465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 03:47:42 -0000 Author: rgrimes Date: Fri Apr 13 03:47:41 2018 New Revision: 332465 URL: https://svnweb.freebsd.org/changeset/base/332465 Log: MFC: r332075 Exit with usage when extra arguments are on command line preventing mistakes such as "halt 0p" for "halt -p". Approved by: bde (mentor, implicit), phk (mentor,implicit) MFC after: 1 week Modified: stable/11/sbin/reboot/reboot.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/reboot/reboot.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sbin/reboot/reboot.c ============================================================================== --- stable/11/sbin/reboot/reboot.c Fri Apr 13 03:32:18 2018 (r332464) +++ stable/11/sbin/reboot/reboot.c Fri Apr 13 03:47:41 2018 (r332465) @@ -111,6 +111,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; + if (argc != 0) + usage(); if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); From owner-svn-src-all@freebsd.org Fri Apr 13 09:04:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02976F9C986; Fri, 13 Apr 2018 09:04:32 +0000 (UTC) (envelope-from bapt@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 A7AA481C46; Fri, 13 Apr 2018 09:04:31 +0000 (UTC) (envelope-from bapt@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 A1FBA17B92; Fri, 13 Apr 2018 09:04:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3D94VdR008907; Fri, 13 Apr 2018 09:04:31 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3D94V1p008905; Fri, 13 Apr 2018 09:04:31 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201804130904.w3D94V1p008905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Apr 2018 09:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332466 - in head: . usr.bin/mandoc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: . usr.bin/mandoc X-SVN-Commit-Revision: 332466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 09:04:32 -0000 Author: bapt Date: Fri Apr 13 09:04:31 2018 New Revision: 332466 URL: https://svnweb.freebsd.org/changeset/base/332466 Log: reinstall the roff(7) manpage When we had both groff and mandoc in base, we decided to keep the roff(7) manpage from groff. when remoing groff, we forgot to install the mandoc version instead. This fixes it. Reported by: trasz MFC after: 1 week Modified: head/ObsoleteFiles.inc head/usr.bin/mandoc/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Apr 13 03:47:41 2018 (r332465) +++ head/ObsoleteFiles.inc Fri Apr 13 09:04:31 2018 (r332466) @@ -1070,7 +1070,6 @@ OLD_FILES+=usr/share/man/man7/mm.7.gz OLD_FILES+=usr/share/man/man7/mmse.7.gz OLD_FILES+=usr/share/man/man7/ms.7.gz OLD_FILES+=usr/share/man/man7/orig_me.7.gz -OLD_FILES+=usr/share/man/man7/roff.7.gz OLD_FILES+=usr/share/me/acm.me OLD_FILES+=usr/share/me/chars.me OLD_FILES+=usr/share/me/deltext.me Modified: head/usr.bin/mandoc/Makefile ============================================================================== --- head/usr.bin/mandoc/Makefile Fri Apr 13 03:47:41 2018 (r332465) +++ head/usr.bin/mandoc/Makefile Fri Apr 13 09:04:31 2018 (r332466) @@ -6,7 +6,7 @@ MDOCMLDIR= ${SRCTOP}/contrib/mdocml .PATH: ${MDOCMLDIR} PROG= mandoc -MAN= mandoc.1 eqn.7 mandoc_char.7 tbl.7 man.7 mdoc.7 # roff.7 +MAN= mandoc.1 eqn.7 mandoc_char.7 tbl.7 man.7 mdoc.7 roff.7 MLINKS= mandoc.1 mdocml.1 .if ${MK_MAN_UTILS} != no MAN+= apropos.1 makewhatis.8 From owner-svn-src-all@freebsd.org Fri Apr 13 10:03:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD48FFA0EA6; Fri, 13 Apr 2018 10:03:30 +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 7FBBA6FA1E; Fri, 13 Apr 2018 10:03:30 +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 7AAC31853D; Fri, 13 Apr 2018 10:03:30 +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 w3DA3UCD040395; Fri, 13 Apr 2018 10:03:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DA3ULq040394; Fri, 13 Apr 2018 10:03:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804131003.w3DA3ULq040394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 13 Apr 2018 10:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332467 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 332467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 10:03:31 -0000 Author: ae Date: Fri Apr 13 10:03:30 2018 New Revision: 332467 URL: https://svnweb.freebsd.org/changeset/base/332467 Log: To avoid possible deadlock do not acquire JQUEUE_LOCK before callout_drain. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.c Modified: head/sys/netpfil/ipfw/nat64/nat64lsn.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64lsn.c Fri Apr 13 09:04:31 2018 (r332466) +++ head/sys/netpfil/ipfw/nat64/nat64lsn.c Fri Apr 13 10:03:30 2018 (r332467) @@ -1755,10 +1755,7 @@ nat64lsn_destroy_instance(struct nat64lsn_cfg *cfg) { struct nat64lsn_host *nh, *tmp; - JQUEUE_LOCK(); callout_drain(&cfg->jcallout); - JQUEUE_UNLOCK(); - callout_drain(&cfg->periodic); I6HASH_FOREACH_SAFE(cfg, nh, tmp, nat64lsn_destroy_host, cfg); DPRINTF(DP_OBJ, "instance %s: hosts %d", cfg->name, cfg->ihcount); From owner-svn-src-all@freebsd.org Fri Apr 13 12:41:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C0EAF85B52; Fri, 13 Apr 2018 12:41:52 +0000 (UTC) (envelope-from br@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 D10F375A43; Fri, 13 Apr 2018 12:41:51 +0000 (UTC) (envelope-from br@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 CC13919E5A; Fri, 13 Apr 2018 12:41:51 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DCfpEc019615; Fri, 13 Apr 2018 12:41:51 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DCfpa0019612; Fri, 13 Apr 2018 12:41:51 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804131241.w3DCfpa0019612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Apr 2018 12:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332468 - head/sys/dev/xdma X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/xdma X-SVN-Commit-Revision: 332468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 12:41:52 -0000 Author: br Date: Fri Apr 13 12:41:51 2018 New Revision: 332468 URL: https://svnweb.freebsd.org/changeset/base/332468 Log: Don't include sys/bus_dma.h directly, use machine/bus.h instead. Sponsored by: DARPA, AFRL Modified: head/sys/dev/xdma/xdma_queue.c head/sys/dev/xdma/xdma_sg.c head/sys/dev/xdma/xdma_sglist.c Modified: head/sys/dev/xdma/xdma_queue.c ============================================================================== --- head/sys/dev/xdma/xdma_queue.c Fri Apr 13 10:03:30 2018 (r332467) +++ head/sys/dev/xdma/xdma_queue.c Fri Apr 13 12:41:51 2018 (r332468) @@ -37,8 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include + +#include #include Modified: head/sys/dev/xdma/xdma_sg.c ============================================================================== --- head/sys/dev/xdma/xdma_sg.c Fri Apr 13 10:03:30 2018 (r332467) +++ head/sys/dev/xdma/xdma_sg.c Fri Apr 13 12:41:51 2018 (r332468) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/xdma/xdma_sglist.c ============================================================================== --- head/sys/dev/xdma/xdma_sglist.c Fri Apr 13 10:03:30 2018 (r332467) +++ head/sys/dev/xdma/xdma_sglist.c Fri Apr 13 12:41:51 2018 (r332468) @@ -37,7 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + +#include #include From owner-svn-src-all@freebsd.org Fri Apr 13 12:43:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1851EF85DBF; Fri, 13 Apr 2018 12:43:55 +0000 (UTC) (envelope-from br@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 C1A9375C94; Fri, 13 Apr 2018 12:43:54 +0000 (UTC) (envelope-from br@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 BC5E919E8F; Fri, 13 Apr 2018 12:43:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DChso6019722; Fri, 13 Apr 2018 12:43:54 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DChsQU019719; Fri, 13 Apr 2018 12:43:54 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804131243.w3DChsQU019719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Apr 2018 12:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332469 - in head/sys: conf dev/xdma/controller X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/xdma/controller X-SVN-Commit-Revision: 332469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 12:43:55 -0000 Author: br Date: Fri Apr 13 12:43:54 2018 New Revision: 332469 URL: https://svnweb.freebsd.org/changeset/base/332469 Log: Add driver for ARM PrimeCell PL330 DMA engine. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10201 Added: head/sys/dev/xdma/controller/ head/sys/dev/xdma/controller/pl330.c (contents, props changed) head/sys/dev/xdma/controller/pl330.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Apr 13 12:41:51 2018 (r332468) +++ head/sys/conf/files Fri Apr 13 12:43:54 2018 (r332469) @@ -3510,6 +3510,7 @@ wpi.fw optional wpifw \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "wpi.fw" +dev/xdma/controller/pl330.c optional xdma pl330 dev/xdma/xdma.c optional xdma dev/xdma/xdma_bank.c optional xdma dev/xdma/xdma_bio.c optional xdma Added: head/sys/dev/xdma/controller/pl330.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xdma/controller/pl330.c Fri Apr 13 12:43:54 2018 (r332469) @@ -0,0 +1,663 @@ +/*- + * Copyright (c) 2017-2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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. + */ + +/* ARM PrimeCell DMA Controller (PL330) driver. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#ifdef FDT +#include +#include +#include +#endif + +#include +#include + +#include "xdma_if.h" + +#define PL330_DEBUG +#undef PL330_DEBUG + +#ifdef PL330_DEBUG +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif + +#define READ4(_sc, _reg) \ + bus_read_4(_sc->res[0], _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_write_4(_sc->res[0], _reg, _val) + +#define PL330_NCHANNELS 32 +#define PL330_MAXLOAD 2048 + +struct pl330_channel { + struct pl330_softc *sc; + xdma_channel_t *xchan; + int used; + int index; + uint8_t *ibuf; + bus_addr_t ibuf_phys; + uint32_t enqueued; + uint32_t capacity; +}; + +struct pl330_fdt_data { + uint32_t periph_id; +}; + +struct pl330_softc { + device_t dev; + struct resource *res[PL330_NCHANNELS + 1]; + void *ih[PL330_NCHANNELS]; + struct pl330_channel channels[PL330_NCHANNELS]; +}; + +static struct resource_spec pl330_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 1, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 2, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 3, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 4, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 5, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 6, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 7, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 8, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 9, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 10, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 11, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 12, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 13, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 14, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 15, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 16, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 17, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 18, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 19, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 20, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 21, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 22, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 23, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 24, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 25, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 26, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 27, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 28, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 29, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 30, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 31, RF_ACTIVE | RF_OPTIONAL }, + { -1, 0 } +}; + +#define HWTYPE_NONE 0 +#define HWTYPE_STD 1 + +static struct ofw_compat_data compat_data[] = { + { "arm,pl330", HWTYPE_STD }, + { NULL, HWTYPE_NONE }, +}; + +static void +pl330_intr(void *arg) +{ + xdma_transfer_status_t status; + struct xdma_transfer_status st; + struct pl330_channel *chan; + struct xdma_channel *xchan; + struct pl330_softc *sc; + uint32_t pending; + int i; + int c; + + sc = arg; + + pending = READ4(sc, INTMIS); + + dprintf("%s: 0x%x, LC0 %x, SAR %x DAR %x\n", + __func__, pending, READ4(sc, LC0(0)), + READ4(sc, SAR(0)), READ4(sc, DAR(0))); + + WRITE4(sc, INTCLR, pending); + + for (c = 0; c < PL330_NCHANNELS; c++) { + if ((pending & (1 << c)) == 0) { + continue; + } + chan = &sc->channels[c]; + xchan = chan->xchan; + st.error = 0; + st.transferred = 0; + for (i = 0; i < chan->enqueued; i++) { + xchan_seg_done(xchan, &st); + } + + /* Accept new requests. */ + chan->capacity = PL330_MAXLOAD; + + /* Finish operation */ + status.error = 0; + status.transferred = 0; + xdma_callback(chan->xchan, &status); + } +} + +static uint32_t +emit_mov(uint8_t *buf, uint32_t reg, uint32_t val) +{ + + buf[0] = DMAMOV; + buf[1] = reg; + buf[2] = val; + buf[3] = val >> 8; + buf[4] = val >> 16; + buf[5] = val >> 24; + + return (6); +} + +static uint32_t +emit_lp(uint8_t *buf, uint8_t idx, uint32_t iter) +{ + + if (idx > 1) + return (0); /* We have two loops only. */ + + buf[0] = DMALP; + buf[0] |= (idx << 1); + buf[1] = (iter - 1) & 0xff; + + return (2); +} + +static uint32_t +emit_lpend(uint8_t *buf, uint8_t idx, + uint8_t burst, uint8_t jump_addr_relative) +{ + + buf[0] = DMALPEND; + buf[0] |= DMALPEND_NF; + buf[0] |= (idx << 2); + if (burst) + buf[0] |= (1 << 1) | (1 << 0); + else + buf[0] |= (0 << 1) | (1 << 0); + buf[1] = jump_addr_relative; + + return (2); +} + +static uint32_t +emit_ld(uint8_t *buf, uint8_t burst) +{ + + buf[0] = DMALD; + if (burst) + buf[0] |= (1 << 1) | (1 << 0); + else + buf[0] |= (0 << 1) | (1 << 0); + + return (1); +} + +static uint32_t +emit_st(uint8_t *buf, uint8_t burst) +{ + + buf[0] = DMAST; + if (burst) + buf[0] |= (1 << 1) | (1 << 0); + else + buf[0] |= (0 << 1) | (1 << 0); + + return (1); +} + +static uint32_t +emit_end(uint8_t *buf) +{ + + buf[0] = DMAEND; + + return (1); +} + +static uint32_t +emit_sev(uint8_t *buf, uint32_t ev) +{ + + buf[0] = DMASEV; + buf[1] = (ev << 3); + + return (2); +} + +static uint32_t +emit_wfp(uint8_t *buf, uint32_t p_id) +{ + + buf[0] = DMAWFP; + buf[0] |= (1 << 0); + buf[1] = (p_id << 3); + + return (2); +} + +static uint32_t +emit_go(uint8_t *buf, uint32_t chan_id, + uint32_t addr, uint8_t non_secure) +{ + + buf[0] = DMAGO; + buf[0] |= (non_secure << 1); + + buf[1] = chan_id; + buf[2] = addr; + buf[3] = addr >> 8; + buf[4] = addr >> 16; + buf[5] = addr >> 24; + + return (6); +} + +static int +pl330_probe(device_t dev) +{ + int hwtype; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (hwtype == HWTYPE_NONE) + return (ENXIO); + + device_set_desc(dev, "ARM PrimeCell DMA Controller (PL330)"); + + return (BUS_PROBE_DEFAULT); +} + +static int +pl330_attach(device_t dev) +{ + struct pl330_softc *sc; + phandle_t xref, node; + int err; + int i; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, pl330_spec, sc->res)) { + device_printf(dev, "could not allocate resources for device\n"); + return (ENXIO); + } + + /* Setup interrupt handler */ + for (i = 0; i < PL330_NCHANNELS; i++) { + if (sc->res[i + 1] == NULL) + break; + err = bus_setup_intr(dev, sc->res[i + 1], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, pl330_intr, sc, sc->ih[i]); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + } + + node = ofw_bus_get_node(dev); + xref = OF_xref_from_node(node); + OF_device_register_xref(xref, dev); + + return (0); +} + +static int +pl330_detach(device_t dev) +{ + struct pl330_softc *sc; + + sc = device_get_softc(dev); + + return (0); +} + +static int +pl330_channel_alloc(device_t dev, struct xdma_channel *xchan) +{ + struct pl330_channel *chan; + struct pl330_softc *sc; + int i; + + sc = device_get_softc(dev); + + for (i = 0; i < PL330_NCHANNELS; i++) { + chan = &sc->channels[i]; + if (chan->used == 0) { + chan->xchan = xchan; + xchan->chan = (void *)chan; + xchan->caps |= XCHAN_CAP_BUSDMA; + chan->index = i; + chan->sc = sc; + chan->used = 1; + + chan->ibuf = (void *)kmem_alloc_contig(kernel_arena, + PAGE_SIZE*8, M_ZERO, 0, ~0, PAGE_SIZE, 0, + VM_MEMATTR_UNCACHEABLE); + chan->ibuf_phys = vtophys(chan->ibuf); + + return (0); + } + } + + return (-1); +} + +static int +pl330_channel_free(device_t dev, struct xdma_channel *xchan) +{ + struct pl330_channel *chan; + struct pl330_softc *sc; + + sc = device_get_softc(dev); + + chan = (struct pl330_channel *)xchan->chan; + chan->used = 0; + + return (0); +} + +static int +pl330_channel_capacity(device_t dev, xdma_channel_t *xchan, + uint32_t *capacity) +{ + struct pl330_channel *chan; + + chan = (struct pl330_channel *)xchan->chan; + + *capacity = chan->capacity; + + return (0); +} + +static int +pl330_ccr_port_width(struct xdma_sglist *sg, uint32_t *addr) +{ + uint32_t reg; + + reg = 0; + + switch (sg->src_width) { + case 1: + reg |= CCR_SRC_BURST_SIZE_1; + break; + case 2: + reg |= CCR_SRC_BURST_SIZE_2; + break; + case 4: + reg |= CCR_SRC_BURST_SIZE_4; + break; + default: + return (-1); + } + + switch (sg->dst_width) { + case 1: + reg |= CCR_DST_BURST_SIZE_1; + break; + case 2: + reg |= CCR_DST_BURST_SIZE_2; + break; + case 4: + reg |= CCR_DST_BURST_SIZE_4; + break; + default: + return (-1); + } + + *addr |= reg; + + return (0); +} + +static int +pl330_channel_submit_sg(device_t dev, struct xdma_channel *xchan, + struct xdma_sglist *sg, uint32_t sg_n) +{ + struct pl330_fdt_data *data; + xdma_controller_t *xdma; + struct pl330_channel *chan; + struct pl330_softc *sc; + uint32_t src_addr_lo; + uint32_t dst_addr_lo; + uint32_t len; + uint32_t reg; + uint32_t offs; + uint32_t cnt; + uint8_t *ibuf; + uint8_t dbuf[6]; + uint8_t offs0, offs1; + int err; + int i; + + sc = device_get_softc(dev); + + xdma = xchan->xdma; + data = (struct pl330_fdt_data *)xdma->data; + + chan = (struct pl330_channel *)xchan->chan; + ibuf = chan->ibuf; + + dprintf("%s: chan->index %d\n", __func__, chan->index); + + offs = 0; + + for (i = 0; i < sg_n; i++) { + if (sg[i].direction == XDMA_DEV_TO_MEM) + reg = CCR_DST_INC; + else { + reg = CCR_SRC_INC; + reg |= (CCR_DST_PROT_PRIV); + } + + err = pl330_ccr_port_width(&sg[i], ®); + if (err != 0) + return (err); + + offs += emit_mov(&chan->ibuf[offs], R_CCR, reg); + + src_addr_lo = (uint32_t)sg[i].src_addr; + dst_addr_lo = (uint32_t)sg[i].dst_addr; + len = (uint32_t)sg[i].len; + + dprintf("%s: src %x dst %x len %d periph_id %d\n", __func__, + src_addr_lo, dst_addr_lo, len, data->periph_id); + + offs += emit_mov(&ibuf[offs], R_SAR, src_addr_lo); + offs += emit_mov(&ibuf[offs], R_DAR, dst_addr_lo); + + if (sg[i].src_width != sg[i].dst_width) + return (-1); /* Not supported. */ + + cnt = (len / sg[i].src_width); + if (cnt > 128) { + offs += emit_lp(&ibuf[offs], 0, cnt / 128); + offs0 = offs; + offs += emit_lp(&ibuf[offs], 1, 128); + offs1 = offs; + } else { + offs += emit_lp(&ibuf[offs], 0, cnt); + offs0 = offs; + } + offs += emit_wfp(&ibuf[offs], data->periph_id); + offs += emit_ld(&ibuf[offs], 1); + offs += emit_st(&ibuf[offs], 1); + + if (cnt > 128) + offs += emit_lpend(&ibuf[offs], 1, 1, (offs - offs1)); + + offs += emit_lpend(&ibuf[offs], 0, 1, (offs - offs0)); + } + + offs += emit_sev(&ibuf[offs], chan->index); + offs += emit_end(&ibuf[offs]); + + emit_go(dbuf, chan->index, chan->ibuf_phys, 0); + + reg = (dbuf[1] << 24) | (dbuf[0] << 16); + WRITE4(sc, DBGINST0, reg); + reg = (dbuf[5] << 24) | (dbuf[4] << 16) | (dbuf[3] << 8) | dbuf[2]; + WRITE4(sc, DBGINST1, reg); + + WRITE4(sc, INTCLR, 0xffffffff); + WRITE4(sc, INTEN, (1 << chan->index)); + + chan->enqueued = sg_n; + chan->capacity = 0; + + /* Start operation */ + WRITE4(sc, DBGCMD, 0); + + return (0); +} + +static int +pl330_channel_prep_sg(device_t dev, struct xdma_channel *xchan) +{ + struct pl330_channel *chan; + struct pl330_softc *sc; + + sc = device_get_softc(dev); + + dprintf("%s(%d)\n", __func__, device_get_unit(dev)); + + chan = (struct pl330_channel *)xchan->chan; + chan->capacity = PL330_MAXLOAD; + + return (0); +} + +static int +pl330_channel_control(device_t dev, xdma_channel_t *xchan, int cmd) +{ + struct pl330_channel *chan; + struct pl330_softc *sc; + + sc = device_get_softc(dev); + + chan = (struct pl330_channel *)xchan->chan; + + switch (cmd) { + case XDMA_CMD_BEGIN: + case XDMA_CMD_TERMINATE: + case XDMA_CMD_PAUSE: + /* TODO: implement me */ + return (-1); + } + + return (0); +} + +#ifdef FDT +static int +pl330_ofw_md_data(device_t dev, pcell_t *cells, int ncells, void **ptr) +{ + struct pl330_fdt_data *data; + + if (ncells != 1) + return (-1); + + data = malloc(sizeof(struct pl330_fdt_data), + M_DEVBUF, (M_WAITOK | M_ZERO)); + data->periph_id = cells[0]; + + *ptr = data; + + return (0); +} +#endif + +static device_method_t pl330_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, pl330_probe), + DEVMETHOD(device_attach, pl330_attach), + DEVMETHOD(device_detach, pl330_detach), + + /* xDMA Interface */ + DEVMETHOD(xdma_channel_alloc, pl330_channel_alloc), + DEVMETHOD(xdma_channel_free, pl330_channel_free), + DEVMETHOD(xdma_channel_control, pl330_channel_control), + + /* xDMA SG Interface */ + DEVMETHOD(xdma_channel_capacity, pl330_channel_capacity), + DEVMETHOD(xdma_channel_prep_sg, pl330_channel_prep_sg), + DEVMETHOD(xdma_channel_submit_sg, pl330_channel_submit_sg), + +#ifdef FDT + DEVMETHOD(xdma_ofw_md_data, pl330_ofw_md_data), +#endif + + DEVMETHOD_END +}; + +static driver_t pl330_driver = { + "pl330", + pl330_methods, + sizeof(struct pl330_softc), +}; + +static devclass_t pl330_devclass; + +EARLY_DRIVER_MODULE(pl330, simplebus, pl330_driver, pl330_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); Added: head/sys/dev/xdma/controller/pl330.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xdma/controller/pl330.h Fri Apr 13 12:43:54 2018 (r332469) @@ -0,0 +1,115 @@ +/*- + * Copyright (c) 2017-2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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_XDMA_CONTROLLER_PL330_H_ +#define _DEV_XDMA_CONTROLLER_PL330_H_ + +/* pl330 registers */ +#define DSR 0x000 /* DMA Manager Status */ +#define DPC 0x004 /* DMA Program Counter */ +#define INTEN 0x020 /* Interrupt Enable */ +#define INT_EVENT_RIS 0x024 /* Event-Interrupt Raw Status */ +#define INTMIS 0x028 /* Interrupt Status */ +#define INTCLR 0x02C /* Interrupt Clear */ +#define FSRD 0x030 /* Fault Status DMA Manager */ +#define FSRC 0x034 /* Fault Status DMA Channel */ +#define FTRD 0x038 /* Fault Type DMA Manager */ +#define FTR(n) (0x040 + 0x04 * (n)) /* Fault type for DMA channel n */ +#define CSR(n) (0x100 + 0x08 * (n)) /* Channel status for DMA channel n */ +#define CPC(n) (0x104 + 0x08 * (n)) /* Channel PC for DMA channel n */ +#define SAR(n) (0x400 + 0x20 * (n)) /* Source address for DMA channel n */ +#define DAR(n) (0x404 + 0x20 * (n)) /* Destination address for DMA channel n */ +#define CCR(n) (0x408 + 0x20 * (n)) /* Channel control for DMA channel n */ +#define CCR_DST_BURST_SIZE_S 15 +#define CCR_DST_BURST_SIZE_1 (0 << CCR_DST_BURST_SIZE_S) +#define CCR_DST_BURST_SIZE_2 (1 << CCR_DST_BURST_SIZE_S) +#define CCR_DST_BURST_SIZE_4 (2 << CCR_DST_BURST_SIZE_S) +#define CCR_SRC_BURST_SIZE_S 1 +#define CCR_SRC_BURST_SIZE_1 (0 << CCR_SRC_BURST_SIZE_S) +#define CCR_SRC_BURST_SIZE_2 (1 << CCR_SRC_BURST_SIZE_S) +#define CCR_SRC_BURST_SIZE_4 (2 << CCR_SRC_BURST_SIZE_S) +#define CCR_DST_INC (1 << 14) +#define CCR_SRC_INC (1 << 0) +#define CCR_DST_PROT_CTRL_S 22 +#define CCR_DST_PROT_PRIV (1 << CCR_DST_PROT_CTRL_S) +#define LC0(n) (0x40C + 0x20 * (n)) /* Loop counter 0 for DMA channel n */ +#define LC1(n) (0x410 + 0x20 * (n)) /* Loop counter 1 for DMA channel n */ + +#define DBGSTATUS 0xD00 /* Debug Status */ +#define DBGCMD 0xD04 /* Debug Command */ +#define DBGINST0 0xD08 /* Debug Instruction-0 */ +#define DBGINST1 0xD0C /* Debug Instruction-1 */ +#define CR0 0xE00 /* Configuration Register 0 */ +#define CR1 0xE04 /* Configuration Register 1 */ +#define CR2 0xE08 /* Configuration Register 2 */ +#define CR3 0xE0C /* Configuration Register 3 */ +#define CR4 0xE10 /* Configuration Register 4 */ +#define CRD 0xE14 /* DMA Configuration */ +#define WD 0xE80 /* Watchdog Register */ + +#define R_SAR 0 +#define R_CCR 1 +#define R_DAR 2 + +/* + * 0xFE0- 0xFEC periph_id_n RO Configuration-dependent Peripheral Identification Registers + * 0xFF0- 0xFFC pcell_id_n RO Configuration-dependent Component Identification Registers + */ + +/* pl330 ISA */ +#define DMAADDH 0x54 +#define DMAADNH 0x5c +#define DMAEND 0x00 +#define DMAFLUSHP 0x35 +#define DMAGO 0xa0 +#define DMAKILL 0x01 +#define DMALD 0x04 +#define DMALDP 0x25 +#define DMALP 0x20 +#define DMALPEND 0x28 +#define DMALPEND_NF (1 << 4) /* DMALP started the loop */ +/* + * TODO: documentation miss opcode for infinite loop + * #define DMALPFE 0 + */ +#define DMAMOV 0xbc +#define DMANOP 0x18 +#define DMARMB 0x12 +#define DMASEV 0x34 +#define DMAST 0x08 +#define DMASTP 0x29 +#define DMASTZ 0x0c +#define DMAWFE 0x36 +#define DMAWFP 0x30 +#define DMAWMB 0x13 + +#endif /* !_DEV_XDMA_CONTROLLER_PL330_H_ */ From owner-svn-src-all@freebsd.org Fri Apr 13 13:23:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 154CBF88AE3; Fri, 13 Apr 2018 13:23:32 +0000 (UTC) (envelope-from br@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 B7BEC7FCD4; Fri, 13 Apr 2018 13:23:31 +0000 (UTC) (envelope-from br@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 B29B61A4E8; Fri, 13 Apr 2018 13:23:31 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DDNVOf040000; Fri, 13 Apr 2018 13:23:31 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DDNVlB039997; Fri, 13 Apr 2018 13:23:31 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804131323.w3DDNVlB039997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Apr 2018 13:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332470 - in head/sys: conf dev/altera/msgdma X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/altera/msgdma X-SVN-Commit-Revision: 332470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 13:23:32 -0000 Author: br Date: Fri Apr 13 13:23:31 2018 New Revision: 332470 URL: https://svnweb.freebsd.org/changeset/base/332470 Log: Add driver for Altera modular Scatter-Gather DMA engine (mSGDMA). Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9619 Added: head/sys/dev/altera/msgdma/ head/sys/dev/altera/msgdma/msgdma.c (contents, props changed) head/sys/dev/altera/msgdma/msgdma.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Apr 13 12:43:54 2018 (r332469) +++ head/sys/conf/files Fri Apr 13 13:23:31 2018 (r332470) @@ -831,6 +831,7 @@ dev/alpm/alpm.c optional alpm pci dev/altera/avgen/altera_avgen.c optional altera_avgen dev/altera/avgen/altera_avgen_fdt.c optional altera_avgen fdt dev/altera/avgen/altera_avgen_nexus.c optional altera_avgen +dev/altera/msgdma/msgdma.c optional altera_msgdma xdma dev/altera/sdcard/altera_sdcard.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_disk.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard Added: head/sys/dev/altera/msgdma/msgdma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/msgdma/msgdma.c Fri Apr 13 13:23:31 2018 (r332470) @@ -0,0 +1,641 @@ +/*- + * Copyright (c) 2016-2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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. + */ + +/* Altera mSGDMA driver. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +#include +#include "xdma_if.h" + +#include + +#define MSGDMA_DEBUG +#undef MSGDMA_DEBUG + +#ifdef MSGDMA_DEBUG +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif + +#define MSGDMA_NCHANNELS 1 + +struct msgdma_channel { + struct msgdma_softc *sc; + struct mtx mtx; + xdma_channel_t *xchan; + struct proc *p; + int used; + int index; + int idx_head; + int idx_tail; + + struct msgdma_desc **descs; + bus_dma_segment_t *descs_phys; + uint32_t descs_num; + bus_dma_tag_t dma_tag; + bus_dmamap_t *dma_map; + uint32_t map_descr; + uint8_t map_err; + uint32_t descs_used_count; +}; + +struct msgdma_softc { + device_t dev; + struct resource *res[3]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + bus_space_tag_t bst_d; + bus_space_handle_t bsh_d; + void *ih; + struct msgdma_desc desc; + struct msgdma_channel channels[MSGDMA_NCHANNELS]; +}; + +static struct resource_spec msgdma_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +#define HWTYPE_NONE 0 +#define HWTYPE_STD 1 + +static struct ofw_compat_data compat_data[] = { + { "altr,msgdma-16.0", HWTYPE_STD }, + { "altr,msgdma-1.0", HWTYPE_STD }, + { NULL, HWTYPE_NONE }, +}; + +static int msgdma_probe(device_t dev); +static int msgdma_attach(device_t dev); +static int msgdma_detach(device_t dev); + +static inline uint32_t +msgdma_next_desc(struct msgdma_channel *chan, uint32_t curidx) +{ + + return ((curidx + 1) % chan->descs_num); +} + +static void +msgdma_intr(void *arg) +{ + xdma_transfer_status_t status; + struct xdma_transfer_status st; + struct msgdma_desc *desc; + struct msgdma_channel *chan; + struct xdma_channel *xchan; + struct msgdma_softc *sc; + uint32_t tot_copied; + + sc = arg; + chan = &sc->channels[0]; + xchan = chan->xchan; + + dprintf("%s(%d): status 0x%08x next_descr 0x%08x, control 0x%08x\n", + __func__, device_get_unit(sc->dev), + READ4_DESC(sc, PF_STATUS), + READ4_DESC(sc, PF_NEXT_LO), + READ4_DESC(sc, PF_CONTROL)); + + tot_copied = 0; + + while (chan->idx_tail != chan->idx_head) { + dprintf("%s: idx_tail %d idx_head %d\n", __func__, + chan->idx_tail, chan->idx_head); + bus_dmamap_sync(chan->dma_tag, chan->dma_map[chan->idx_tail], + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + desc = chan->descs[chan->idx_tail]; + if ((le32toh(desc->control) & CONTROL_OWN) != 0) { + break; + } + + tot_copied += le32toh(desc->transferred); + st.error = 0; + st.transferred = le32toh(desc->transferred); + xchan_seg_done(xchan, &st); + + chan->idx_tail = msgdma_next_desc(chan, chan->idx_tail); + atomic_subtract_int(&chan->descs_used_count, 1); + } + + WRITE4_DESC(sc, PF_STATUS, PF_STATUS_IRQ); + + /* Finish operation */ + status.error = 0; + status.transferred = tot_copied; + xdma_callback(chan->xchan, &status); +} + +static int +msgdma_reset(struct msgdma_softc *sc) +{ + int timeout; + + dprintf("%s: read status: %x\n", __func__, READ4(sc, 0x00)); + dprintf("%s: read control: %x\n", __func__, READ4(sc, 0x04)); + dprintf("%s: read 1: %x\n", __func__, READ4(sc, 0x08)); + dprintf("%s: read 2: %x\n", __func__, READ4(sc, 0x0C)); + + WRITE4(sc, DMA_CONTROL, CONTROL_RESET); + + timeout = 100; + do { + if ((READ4(sc, DMA_STATUS) & STATUS_RESETTING) == 0) + break; + } while (timeout--); + + dprintf("timeout %d\n", timeout); + + if (timeout == 0) + return (-1); + + dprintf("%s: read control after reset: %x\n", + __func__, READ4(sc, DMA_CONTROL)); + + return (0); +} + +static int +msgdma_probe(device_t dev) +{ + int hwtype; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (hwtype == HWTYPE_NONE) + return (ENXIO); + + device_set_desc(dev, "Altera mSGDMA"); + + return (BUS_PROBE_DEFAULT); +} + +static int +msgdma_attach(device_t dev) +{ + struct msgdma_softc *sc; + phandle_t xref, node; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, msgdma_spec, sc->res)) { + device_printf(dev, "could not allocate resources for device\n"); + return (ENXIO); + } + + /* CSR memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* Descriptor memory interface */ + sc->bst_d = rman_get_bustag(sc->res[1]); + sc->bsh_d = rman_get_bushandle(sc->res[1]); + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[2], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, msgdma_intr, sc, &sc->ih); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + node = ofw_bus_get_node(dev); + xref = OF_xref_from_node(node); + OF_device_register_xref(xref, dev); + + if (msgdma_reset(sc) != 0) + return (-1); + + WRITE4(sc, DMA_CONTROL, CONTROL_GIEM); + + return (0); +} + +static int +msgdma_detach(device_t dev) +{ + struct msgdma_softc *sc; + + sc = device_get_softc(dev); + + return (0); +} + +static void +msgdma_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) +{ + struct msgdma_channel *chan; + + chan = (struct msgdma_channel *)arg; + KASSERT(chan != NULL, ("xchan is NULL")); + + if (err) { + chan->map_err = 1; + return; + } + + chan->descs_phys[chan->map_descr].ds_addr = segs[0].ds_addr; + chan->descs_phys[chan->map_descr].ds_len = segs[0].ds_len; + + dprintf("map desc %d: descs phys %lx len %ld\n", + chan->map_descr, segs[0].ds_addr, segs[0].ds_len); +} + +static int +msgdma_desc_free(struct msgdma_softc *sc, struct msgdma_channel *chan) +{ + struct msgdma_desc *desc; + int nsegments; + int i; + + nsegments = chan->descs_num; + + for (i = 0; i < nsegments; i++) { + desc = chan->descs[i]; + bus_dmamap_unload(chan->dma_tag, chan->dma_map[i]); + bus_dmamem_free(chan->dma_tag, desc, chan->dma_map[i]); + } + + bus_dma_tag_destroy(chan->dma_tag); + free(chan->descs, M_DEVBUF); + free(chan->dma_map, M_DEVBUF); + free(chan->descs_phys, M_DEVBUF); + + return (0); +} + +static int +msgdma_desc_alloc(struct msgdma_softc *sc, struct msgdma_channel *chan, + uint32_t desc_size, uint32_t align) +{ + int nsegments; + int err; + int i; + + nsegments = chan->descs_num; + + dprintf("%s: nseg %d\n", __func__, nsegments); + + err = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), + align, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + desc_size, 1, /* maxsize, nsegments*/ + desc_size, 0, /* maxsegsize, flags */ + NULL, NULL, /* lockfunc, lockarg */ + &chan->dma_tag); + if (err) { + device_printf(sc->dev, + "%s: Can't create bus_dma tag.\n", __func__); + return (-1); + } + + /* Descriptors. */ + chan->descs = malloc(nsegments * sizeof(struct msgdma_desc *), + M_DEVBUF, (M_WAITOK | M_ZERO)); + if (chan->descs == NULL) { + device_printf(sc->dev, + "%s: Can't allocate memory.\n", __func__); + return (-1); + } + chan->dma_map = malloc(nsegments * sizeof(bus_dmamap_t), + M_DEVBUF, (M_WAITOK | M_ZERO)); + chan->descs_phys = malloc(nsegments * sizeof(bus_dma_segment_t), + M_DEVBUF, (M_WAITOK | M_ZERO)); + + /* Allocate bus_dma memory for each descriptor. */ + for (i = 0; i < nsegments; i++) { + err = bus_dmamem_alloc(chan->dma_tag, (void **)&chan->descs[i], + BUS_DMA_WAITOK | BUS_DMA_ZERO, &chan->dma_map[i]); + if (err) { + device_printf(sc->dev, + "%s: Can't allocate memory for descriptors.\n", + __func__); + return (-1); + } + + chan->map_err = 0; + chan->map_descr = i; + err = bus_dmamap_load(chan->dma_tag, chan->dma_map[i], chan->descs[i], + desc_size, msgdma_dmamap_cb, chan, BUS_DMA_WAITOK); + if (err) { + device_printf(sc->dev, + "%s: Can't load DMA map.\n", __func__); + return (-1); + } + + if (chan->map_err != 0) { + device_printf(sc->dev, + "%s: Can't load DMA map.\n", __func__); + return (-1); + } + } + + return (0); +} + + +static int +msgdma_channel_alloc(device_t dev, struct xdma_channel *xchan) +{ + struct msgdma_channel *chan; + struct msgdma_softc *sc; + int i; + + sc = device_get_softc(dev); + + for (i = 0; i < MSGDMA_NCHANNELS; i++) { + chan = &sc->channels[i]; + if (chan->used == 0) { + chan->xchan = xchan; + xchan->chan = (void *)chan; + xchan->caps |= XCHAN_CAP_BUSDMA; + chan->index = i; + chan->sc = sc; + chan->used = 1; + chan->idx_head = 0; + chan->idx_tail = 0; + chan->descs_used_count = 0; + chan->descs_num = 1024; + + return (0); + } + } + + return (-1); +} + +static int +msgdma_channel_free(device_t dev, struct xdma_channel *xchan) +{ + struct msgdma_channel *chan; + struct msgdma_softc *sc; + + sc = device_get_softc(dev); + + chan = (struct msgdma_channel *)xchan->chan; + + msgdma_desc_free(sc, chan); + + chan->used = 0; + + return (0); +} + +static int +msgdma_channel_capacity(device_t dev, xdma_channel_t *xchan, + uint32_t *capacity) +{ + struct msgdma_channel *chan; + uint32_t c; + + chan = (struct msgdma_channel *)xchan->chan; + + /* At least one descriptor must be left empty. */ + c = (chan->descs_num - chan->descs_used_count - 1); + + *capacity = c; + + return (0); +} + +static int +msgdma_channel_submit_sg(device_t dev, struct xdma_channel *xchan, + struct xdma_sglist *sg, uint32_t sg_n) +{ + struct msgdma_channel *chan; + struct msgdma_desc *desc; + struct msgdma_softc *sc; + uint32_t src_addr_lo; + uint32_t dst_addr_lo; + uint32_t len; + uint32_t tmp; + int i; + + sc = device_get_softc(dev); + + chan = (struct msgdma_channel *)xchan->chan; + + for (i = 0; i < sg_n; i++) { + src_addr_lo = (uint32_t)sg[i].src_addr; + dst_addr_lo = (uint32_t)sg[i].dst_addr; + len = (uint32_t)sg[i].len; + + dprintf("%s: src %x dst %x len %d\n", __func__, + src_addr_lo, dst_addr_lo, len); + + desc = chan->descs[chan->idx_head]; + desc->read_lo = htole32(src_addr_lo); + desc->write_lo = htole32(dst_addr_lo); + desc->length = htole32(len); + desc->transferred = 0; + desc->status = 0; + desc->reserved = 0; + desc->control = 0; + + if (sg[i].direction == XDMA_MEM_TO_DEV) { + if (sg[i].first == 1) { + desc->control |= htole32(CONTROL_GEN_SOP); + } + + if (sg[i].last == 1) { + desc->control |= htole32(CONTROL_GEN_EOP); + desc->control |= htole32(CONTROL_TC_IRQ_EN | + CONTROL_ET_IRQ_EN | CONTROL_ERR_M); + } + } else { + desc->control |= htole32(CONTROL_END_ON_EOP | (1 << 13)); + desc->control |= htole32(CONTROL_TC_IRQ_EN | + CONTROL_ET_IRQ_EN | CONTROL_ERR_M); + } + + tmp = chan->idx_head; + + atomic_add_int(&chan->descs_used_count, 1); + chan->idx_head = msgdma_next_desc(chan, chan->idx_head); + + desc->control |= htole32(CONTROL_OWN | CONTROL_GO); + + bus_dmamap_sync(chan->dma_tag, chan->dma_map[tmp], + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } + + return (0); +} + +static int +msgdma_channel_prep_sg(device_t dev, struct xdma_channel *xchan) +{ + struct msgdma_channel *chan; + struct msgdma_desc *desc; + struct msgdma_softc *sc; + uint32_t addr; + uint32_t reg; + int ret; + int i; + + sc = device_get_softc(dev); + + dprintf("%s(%d)\n", __func__, device_get_unit(dev)); + + chan = (struct msgdma_channel *)xchan->chan; + + ret = msgdma_desc_alloc(sc, chan, sizeof(struct msgdma_desc), 16); + if (ret != 0) { + device_printf(sc->dev, + "%s: Can't allocate descriptors.\n", __func__); + return (-1); + } + + for (i = 0; i < chan->descs_num; i++) { + desc = chan->descs[i]; + + if (i == (chan->descs_num - 1)) { + desc->next = htole32(chan->descs_phys[0].ds_addr); + } else { + desc->next = htole32(chan->descs_phys[i+1].ds_addr); + } + + dprintf("%s(%d): desc %d vaddr %lx next paddr %x\n", __func__, + device_get_unit(dev), i, (uint64_t)desc, le32toh(desc->next)); + } + + addr = chan->descs_phys[0].ds_addr; + WRITE4_DESC(sc, PF_NEXT_LO, addr); + WRITE4_DESC(sc, PF_NEXT_HI, 0); + WRITE4_DESC(sc, PF_POLL_FREQ, 1000); + + reg = (PF_CONTROL_GIEM | PF_CONTROL_DESC_POLL_EN); + reg |= PF_CONTROL_RUN; + WRITE4_DESC(sc, PF_CONTROL, reg); + + return (0); +} + +static int +msgdma_channel_control(device_t dev, xdma_channel_t *xchan, int cmd) +{ + struct msgdma_channel *chan; + struct msgdma_softc *sc; + + sc = device_get_softc(dev); + + chan = (struct msgdma_channel *)xchan->chan; + + switch (cmd) { + case XDMA_CMD_BEGIN: + case XDMA_CMD_TERMINATE: + case XDMA_CMD_PAUSE: + /* TODO: implement me */ + return (-1); + } + + return (0); +} + +#ifdef FDT +static int +msgdma_ofw_md_data(device_t dev, pcell_t *cells, int ncells, void **ptr) +{ + + return (0); +} +#endif + +static device_method_t msgdma_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, msgdma_probe), + DEVMETHOD(device_attach, msgdma_attach), + DEVMETHOD(device_detach, msgdma_detach), + + /* xDMA Interface */ + DEVMETHOD(xdma_channel_alloc, msgdma_channel_alloc), + DEVMETHOD(xdma_channel_free, msgdma_channel_free), + DEVMETHOD(xdma_channel_control, msgdma_channel_control), + + /* xDMA SG Interface */ + DEVMETHOD(xdma_channel_capacity, msgdma_channel_capacity), + DEVMETHOD(xdma_channel_prep_sg, msgdma_channel_prep_sg), + DEVMETHOD(xdma_channel_submit_sg, msgdma_channel_submit_sg), + +#ifdef FDT + DEVMETHOD(xdma_ofw_md_data, msgdma_ofw_md_data), +#endif + + DEVMETHOD_END +}; + +static driver_t msgdma_driver = { + "msgdma", + msgdma_methods, + sizeof(struct msgdma_softc), +}; + +static devclass_t msgdma_devclass; + +EARLY_DRIVER_MODULE(msgdma, simplebus, msgdma_driver, msgdma_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); Added: head/sys/dev/altera/msgdma/msgdma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/msgdma/msgdma.h Fri Apr 13 13:23:31 2018 (r332470) @@ -0,0 +1,96 @@ +/*- + * Copyright (c) 2017-2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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$ + */ + +/* Altera mSGDMA registers. */ +#define DMA_STATUS 0x00 +#define STATUS_RESETTING (1 << 6) +#define DMA_CONTROL 0x04 +#define CONTROL_GIEM (1 << 4) /* Global Interrupt Enable Mask */ +#define CONTROL_RESET (1 << 1) /* Reset Dispatcher */ + +/* Descriptor fields. */ +#define CONTROL_GO (1 << 31) /* Commit all the descriptor info */ +#define CONTROL_OWN (1 << 30) /* Owned by hardware (prefetcher-enabled only) */ +#define CONTROL_EDE (1 << 24) /* Early done enable */ +#define CONTROL_ERR_S 16 /* Transmit Error, Error IRQ Enable */ +#define CONTROL_ERR_M (0xff << CONTROL_ERR_S) +#define CONTROL_ET_IRQ_EN (1 << 15) /* Early Termination IRQ Enable */ +#define CONTROL_TC_IRQ_EN (1 << 14) /* Transfer Complete IRQ Enable */ +#define CONTROL_END_ON_EOP (1 << 12) /* End on EOP */ +#define CONTROL_PARK_WR (1 << 11) /* Park Writes */ +#define CONTROL_PARK_RD (1 << 10) /* Park Reads */ +#define CONTROL_GEN_EOP (1 << 9) /* Generate EOP */ +#define CONTROL_GEN_SOP (1 << 8) /* Generate SOP */ +#define CONTROL_TX_CHANNEL_S 0 /* Transmit Channel */ +#define CONTROL_TX_CHANNEL_M (0xff << CONTROL_TRANSMIT_CH_S) + +/* Prefetcher */ +#define PF_CONTROL 0x00 +#define PF_CONTROL_GIEM (1 << 3) +#define PF_CONTROL_RESET (1 << 2) +#define PF_CONTROL_DESC_POLL_EN (1 << 1) +#define PF_CONTROL_RUN (1 << 0) +#define PF_NEXT_LO 0x04 +#define PF_NEXT_HI 0x08 +#define PF_POLL_FREQ 0x0C +#define PF_STATUS 0x10 +#define PF_STATUS_IRQ (1 << 0) + +#define READ4(_sc, _reg) \ + le32toh(bus_space_read_4(_sc->bst, _sc->bsh, _reg)) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, htole32(_val)) + +#define READ4_DESC(_sc, _reg) \ + le32toh(bus_space_read_4(_sc->bst_d, _sc->bsh_d, _reg)) +#define WRITE4_DESC(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst_d, _sc->bsh_d, _reg, htole32(_val)) + +/* Prefetcher-disabled descriptor format. */ +struct msgdma_desc_nonpf { + uint32_t src_addr; + uint32_t dst_addr; + uint32_t length; + uint32_t control; +}; + +/* Prefetcher-enabled descriptor format. */ +struct msgdma_desc { + uint32_t read_lo; + uint32_t write_lo; + uint32_t length; + uint32_t next; + uint32_t transferred; + uint32_t status; + uint32_t reserved; + uint32_t control; +}; From owner-svn-src-all@freebsd.org Fri Apr 13 13:31:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66373F89512; Fri, 13 Apr 2018 13:31:22 +0000 (UTC) (envelope-from ram@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 27737806AE; Fri, 13 Apr 2018 13:31:21 +0000 (UTC) (envelope-from ram@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 124091A52A; Fri, 13 Apr 2018 13:31:21 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DDVK3X044087; Fri, 13 Apr 2018 13:31:20 GMT (envelope-from ram@FreeBSD.org) Received: (from ram@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DDVKod044086; Fri, 13 Apr 2018 13:31:20 GMT (envelope-from ram@FreeBSD.org) Message-Id: <201804131331.w3DDVKod044086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ram set sender to ram@FreeBSD.org using -f From: Ram Kishore Vegesna Date: Fri, 13 Apr 2018 13:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332471 - head/sys/dev/ocs_fc X-SVN-Group: head X-SVN-Commit-Author: ram X-SVN-Commit-Paths: head/sys/dev/ocs_fc X-SVN-Commit-Revision: 332471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 13:31:22 -0000 Author: ram Date: Fri Apr 13 13:31:20 2018 New Revision: 332471 URL: https://svnweb.freebsd.org/changeset/base/332471 Log: Check if STACK is defined before using the stack(9). PR: 227446 Reported by: emaste Approved by: ken Modified: head/sys/dev/ocs_fc/ocs_os.c Modified: head/sys/dev/ocs_fc/ocs_os.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_os.c Fri Apr 13 13:23:31 2018 (r332470) +++ head/sys/dev/ocs_fc/ocs_os.c Fri Apr 13 13:31:20 2018 (r332471) @@ -37,6 +37,7 @@ */ #include "ocs.h" +#include "opt_stack.h" #include #include #include /* for debug of memory allocations */ @@ -855,11 +856,13 @@ void ocs_intr_enable(ocs_os_handle_t os) void ocs_print_stack(void) { +#if defined(STACK) struct stack st; stack_zero(&st); stack_save(&st); stack_print(&st); +#endif } void ocs_abort(void) From owner-svn-src-all@freebsd.org Fri Apr 13 14:18:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AE27F8C623; Fri, 13 Apr 2018 14:18:05 +0000 (UTC) (envelope-from br@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 081F86BAF7; Fri, 13 Apr 2018 14:18:05 +0000 (UTC) (envelope-from br@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 E51D91AD49; Fri, 13 Apr 2018 14:18:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DEI4p8064837; Fri, 13 Apr 2018 14:18:04 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DEI4Cm064833; Fri, 13 Apr 2018 14:18:04 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804131418.w3DEI4Cm064833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Apr 2018 14:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332472 - in head/sys: conf dev/altera/atse dev/altera/softdma X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/altera/atse dev/altera/softdma X-SVN-Commit-Revision: 332472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 14:18:05 -0000 Author: br Date: Fri Apr 13 14:18:04 2018 New Revision: 332472 URL: https://svnweb.freebsd.org/changeset/base/332472 Log: Add driver for Altera SoftDMA® device. SoftDMA is a software implementation of DMA engine built using Altera FIFO component. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9620 Added: head/sys/dev/altera/softdma/ head/sys/dev/altera/softdma/a_api.h - copied unchanged from r332471, head/sys/dev/altera/atse/a_api.h head/sys/dev/altera/softdma/softdma.c (contents, props changed) Deleted: head/sys/dev/altera/atse/a_api.h Modified: head/sys/conf/files head/sys/dev/altera/atse/if_atse.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Apr 13 13:31:20 2018 (r332471) +++ head/sys/conf/files Fri Apr 13 14:18:04 2018 (r332472) @@ -837,6 +837,7 @@ dev/altera/sdcard/altera_sdcard_disk.c optional altera dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_fdt.c optional altera_sdcard fdt dev/altera/sdcard/altera_sdcard_nexus.c optional altera_sdcard +dev/altera/softdma/softdma.c optional altera_softdma xdma fdt dev/altera/pio/pio.c optional altera_pio dev/altera/pio/pio_if.m optional altera_pio dev/amdpm/amdpm.c optional amdpm pci | nfpm pci Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Fri Apr 13 13:31:20 2018 (r332471) +++ head/sys/dev/altera/atse/if_atse.c Fri Apr 13 14:18:04 2018 (r332472) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include MODULE_DEPEND(atse, ether, 1, 1, 1); MODULE_DEPEND(atse, miibus, 1, 1, 1); Copied: head/sys/dev/altera/softdma/a_api.h (from r332471, head/sys/dev/altera/atse/a_api.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/softdma/a_api.h Fri Apr 13 14:18:04 2018 (r332472, copy of r332471, head/sys/dev/altera/atse/a_api.h) @@ -0,0 +1,100 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2012 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-11-C-0249) + * ("MRC2"), as part of the DARPA MRC research programme. + * + * 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$ + */ +/* + * Altera, Embedded Peripherals IP, User Guide, v. 11.0, June 2011. + * UG-01085-11.0. + */ + +#ifndef _A_API_H +#define _A_API_H + +/* Table 16-1. Memory Map. */ +#define A_ONCHIP_FIFO_MEM_CORE_DATA 0x00 +#define A_ONCHIP_FIFO_MEM_CORE_METADATA 0x04 + +#define A_ONCHIP_FIFO_MEM_CORE_SOP (1<<0) +#define A_ONCHIP_FIFO_MEM_CORE_EOP (1<<1) +#define A_ONCHIP_FIFO_MEM_CORE_EMPTY_MASK 0x000000f7 +#define A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT 2 + /* Reserved (1<<7) */ +#define A_ONCHIP_FIFO_MEM_CORE_CHANNEL_MASK 0x0000ff00 +#define A_ONCHIP_FIFO_MEM_CORE_CHANNEL_SHIFT 8 +#define A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK 0x00ff0000 +#define A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT 16 + /* Reserved 0xff000000 */ + +/* Table 16-3. FIFO Status Register Memory Map. */ +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_FILL_LEVEL 0x00 +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_I_STATUS 0x04 +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT 0x08 +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE 0x0c +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_ALMOSTFULL 0x10 +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_ALMOSTEMPTY 0x14 + +/* Table 16-5. Status Bit Field Descriptions. */ +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_FULL (1<<0) +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_EMPTY (1<<1) +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_ALMOSTFULL (1<<2) +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_ALMOSTEMPTY (1<<3) +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_OVERFLOW (1<<4) +#define A_ONCHIP_FIFO_MEM_CORE_STATUS_UNDERFLOW (1<<5) + +/* Table 16-6. Event Bit Field Descriptions. */ +/* XXX Datasheet has incorrect bit fields. Validate. */ +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_FULL (1<<0) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY (1<<1) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTFULL (1<<2) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTEMPTY (1<<3) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW (1<<4) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW (1<<5) + +/* Table 16-7. InterruptEnable Bit Field Descriptions. */ +/* XXX Datasheet has incorrect bit fields. Validate. */ +#define A_ONCHIP_FIFO_MEM_CORE_INTR_FULL (1<<0) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_EMPTY (1<<1) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTFULL (1<<2) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTEMPTY (1<<3) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW (1<<4) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW (1<<5) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALL \ + (A_ONCHIP_FIFO_MEM_CORE_INTR_EMPTY| \ + A_ONCHIP_FIFO_MEM_CORE_INTR_FULL| \ + A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTEMPTY| \ + A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTFULL| \ + A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW| \ + A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW) + +#endif /* _A_API_H */ + +/* end */ Added: head/sys/dev/altera/softdma/softdma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/softdma/softdma.c Fri Apr 13 14:18:04 2018 (r332472) @@ -0,0 +1,864 @@ +/*- + * Copyright (c) 2017-2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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. + */ + +/* This is driver for SoftDMA device built using Altera FIFO component. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef FDT +#include +#include +#include +#endif + +#include + +#include +#include "xdma_if.h" + +#define SOFTDMA_DEBUG +#undef SOFTDMA_DEBUG + +#ifdef SOFTDMA_DEBUG +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif + +#define AVALON_FIFO_TX_BASIC_OPTS_DEPTH 16 +#define SOFTDMA_NCHANNELS 1 +#define CONTROL_GEN_SOP (1 << 0) +#define CONTROL_GEN_EOP (1 << 1) +#define CONTROL_OWN (1 << 31) + +#define SOFTDMA_RX_EVENTS \ + (A_ONCHIP_FIFO_MEM_CORE_INTR_FULL | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW) +#define SOFTDMA_TX_EVENTS \ + (A_ONCHIP_FIFO_MEM_CORE_INTR_EMPTY | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW) + +struct softdma_channel { + struct softdma_softc *sc; + struct mtx mtx; + xdma_channel_t *xchan; + struct proc *p; + int used; + int index; + int run; + uint32_t idx_tail; + uint32_t idx_head; + struct softdma_desc *descs; + + uint32_t descs_num; + uint32_t descs_used_count; +}; + +struct softdma_desc { + uint64_t src_addr; + uint64_t dst_addr; + uint32_t len; + uint32_t access_width; + uint32_t count; + uint16_t src_incr; + uint16_t dst_incr; + uint32_t direction; + struct softdma_desc *next; + uint32_t transfered; + uint32_t status; + uint32_t reserved; + uint32_t control; +}; + +struct softdma_softc { + device_t dev; + struct resource *res[3]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + bus_space_tag_t bst_c; + bus_space_handle_t bsh_c; + void *ih; + struct softdma_channel channels[SOFTDMA_NCHANNELS]; +}; + +static struct resource_spec softdma_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* fifo */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* core */ + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int softdma_probe(device_t dev); +static int softdma_attach(device_t dev); +static int softdma_detach(device_t dev); + +static inline uint32_t +softdma_next_desc(struct softdma_channel *chan, uint32_t curidx) +{ + + return ((curidx + 1) % chan->descs_num); +} + +static void +softdma_mem_write(struct softdma_softc *sc, uint32_t reg, uint32_t val) +{ + + bus_write_4(sc->res[0], reg, htole32(val)); +} + +static uint32_t +softdma_mem_read(struct softdma_softc *sc, uint32_t reg) +{ + uint32_t val; + + val = bus_read_4(sc->res[0], reg); + + return (le32toh(val)); +} + +static void +softdma_memc_write(struct softdma_softc *sc, uint32_t reg, uint32_t val) +{ + + bus_write_4(sc->res[1], reg, htole32(val)); +} + +static uint32_t +softdma_memc_read(struct softdma_softc *sc, uint32_t reg) +{ + uint32_t val; + + val = bus_read_4(sc->res[1], reg); + + return (le32toh(val)); +} + +static uint32_t +softdma_fill_level(struct softdma_softc *sc) +{ + uint32_t val; + + val = softdma_memc_read(sc, + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_FILL_LEVEL); + + return (val); +} + +static void +softdma_intr(void *arg) +{ + struct softdma_channel *chan; + struct softdma_softc *sc; + int reg; + int err; + + sc = arg; + + chan = &sc->channels[0]; + + reg = softdma_memc_read(sc, A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT); + + if (reg & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW | + A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { + /* Errors */ + err = (((reg & A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> \ + A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); + } + + if (reg != 0) { + softdma_memc_write(sc, + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT, reg); + chan->run = 1; + wakeup(chan); + } +} + +static int +softdma_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "altr,softdma")) + return (ENXIO); + + device_set_desc(dev, "SoftDMA"); + + return (BUS_PROBE_DEFAULT); +} + +static int +softdma_attach(device_t dev) +{ + struct softdma_softc *sc; + phandle_t xref, node; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, softdma_spec, sc->res)) { + device_printf(dev, + "could not allocate resources for device\n"); + return (ENXIO); + } + + /* FIFO memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* FIFO control memory interface */ + sc->bst_c = rman_get_bustag(sc->res[1]); + sc->bsh_c = rman_get_bushandle(sc->res[1]); + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[2], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, softdma_intr, sc, &sc->ih); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + node = ofw_bus_get_node(dev); + xref = OF_xref_from_node(node); + OF_device_register_xref(xref, dev); + + return (0); +} + +static int +softdma_detach(device_t dev) +{ + struct softdma_softc *sc; + + sc = device_get_softc(dev); + + return (0); +} + +static int +softdma_process_tx(struct softdma_channel *chan, struct softdma_desc *desc) +{ + struct softdma_softc *sc; + uint32_t src_offs, dst_offs; + uint32_t reg; + uint32_t fill_level; + uint32_t leftm; + uint32_t tmp; + uint32_t val; + uint32_t c; + + sc = chan->sc; + + fill_level = softdma_fill_level(sc); + while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) + fill_level = softdma_fill_level(sc); + + /* Set start of packet. */ + if (desc->control & CONTROL_GEN_SOP) { + reg = 0; + reg |= A_ONCHIP_FIFO_MEM_CORE_SOP; + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); + } + + src_offs = dst_offs = 0; + c = 0; + while ((desc->len - c) >= 4) { + val = *(uint32_t *)(desc->src_addr + src_offs); + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, val); + if (desc->src_incr) + src_offs += 4; + if (desc->dst_incr) + dst_offs += 4; + fill_level += 1; + + while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) { + fill_level = softdma_fill_level(sc); + } + c += 4; + } + + val = 0; + leftm = (desc->len - c); + + switch (leftm) { + case 1: + val = *(uint8_t *)(desc->src_addr + src_offs); + val <<= 24; + src_offs += 1; + break; + case 2: + case 3: + val = *(uint16_t *)(desc->src_addr + src_offs); + val <<= 16; + src_offs += 2; + + if (leftm == 3) { + tmp = *(uint8_t *)(desc->src_addr + src_offs); + val |= (tmp << 8); + src_offs += 1; + } + break; + case 0: + default: + break; + } + + /* Set end of packet. */ + reg = 0; + if (desc->control & CONTROL_GEN_EOP) + reg |= A_ONCHIP_FIFO_MEM_CORE_EOP; + reg |= ((4 - leftm) << A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT); + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); + + /* Ensure there is a FIFO entry available. */ + fill_level = softdma_fill_level(sc); + while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) + fill_level = softdma_fill_level(sc); + + /* Final write */ + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, val); + + return (dst_offs); +} + +static int +softdma_process_rx(struct softdma_channel *chan, struct softdma_desc *desc) +{ + uint32_t src_offs, dst_offs; + struct softdma_softc *sc; + uint32_t fill_level; + uint32_t empty; + uint32_t meta; + uint32_t data; + int sop_rcvd; + int timeout; + size_t len; + int error; + + sc = chan->sc; + empty = 0; + src_offs = dst_offs = 0; + error = 0; + + fill_level = softdma_fill_level(sc); + if (fill_level == 0) { + /* Nothing to receive. */ + return (0); + } + + len = desc->len; + + sop_rcvd = 0; + while (fill_level) { + empty = 0; + data = bus_read_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA); + meta = softdma_mem_read(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA); + + if (meta & A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) { + error = 1; + break; + } + + if ((meta & A_ONCHIP_FIFO_MEM_CORE_CHANNEL_MASK) != 0) { + error = 1; + break; + } + + if (meta & A_ONCHIP_FIFO_MEM_CORE_SOP) { + sop_rcvd = 1; + } + + if (meta & A_ONCHIP_FIFO_MEM_CORE_EOP) { + empty = (meta & A_ONCHIP_FIFO_MEM_CORE_EMPTY_MASK) >> + A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT; + } + + if (sop_rcvd == 0) { + error = 1; + break; + } + + if (empty == 0) { + *(uint32_t *)(desc->dst_addr + dst_offs) = data; + dst_offs += 4; + } else if (empty == 1) { + *(uint16_t *)(desc->dst_addr + dst_offs) = + ((data >> 16) & 0xffff); + dst_offs += 2; + + *(uint8_t *)(desc->dst_addr + dst_offs) = + ((data >> 8) & 0xff); + dst_offs += 1; + } else { + panic("empty %d\n", empty); + } + + if (meta & A_ONCHIP_FIFO_MEM_CORE_EOP) + break; + + fill_level = softdma_fill_level(sc); + timeout = 100; + while (fill_level == 0 && timeout--) + fill_level = softdma_fill_level(sc); + if (timeout == 0) { + /* No EOP received. Broken packet. */ + error = 1; + break; + } + } + + if (error) { + return (-1); + } + + return (dst_offs); +} + +static uint32_t +softdma_process_descriptors(struct softdma_channel *chan, + xdma_transfer_status_t *status) +{ + struct xdma_channel *xchan; + struct softdma_desc *desc; + struct softdma_softc *sc; + xdma_transfer_status_t st; + int ret; + + sc = chan->sc; + + xchan = chan->xchan; + + desc = &chan->descs[chan->idx_tail]; + + while (desc != NULL) { + + if ((desc->control & CONTROL_OWN) == 0) { + break; + } + + if (desc->direction == XDMA_MEM_TO_DEV) { + ret = softdma_process_tx(chan, desc); + } else { + ret = softdma_process_rx(chan, desc); + if (ret == 0) { + /* No new data available. */ + break; + } + } + + /* Descriptor processed. */ + desc->control = 0; + + if (ret >= 0) { + st.error = 0; + st.transferred = ret; + } else { + st.error = ret; + st.transferred = 0; + } + + xchan_seg_done(xchan, &st); + atomic_subtract_int(&chan->descs_used_count, 1); + + if (ret >= 0) { + status->transferred += ret; + } else { + status->error = 1; + break; + } + + chan->idx_tail = softdma_next_desc(chan, chan->idx_tail); + + /* Process next descriptor, if any. */ + desc = desc->next; + } + + return (0); +} + +static void +softdma_worker(void *arg) +{ + xdma_transfer_status_t status; + struct softdma_channel *chan; + struct softdma_softc *sc; + + chan = arg; + + sc = chan->sc; + + while (1) { + mtx_lock(&chan->mtx); + + do { + mtx_sleep(chan, &chan->mtx, 0, "softdma_wait", hz / 2); + } while (chan->run == 0); + + status.error = 0; + status.transferred = 0; + + softdma_process_descriptors(chan, &status); + + /* Finish operation */ + chan->run = 0; + xdma_callback(chan->xchan, &status); + + mtx_unlock(&chan->mtx); + } + +} + +static int +softdma_proc_create(struct softdma_channel *chan) +{ + struct softdma_softc *sc; + + sc = chan->sc; + + if (chan->p != NULL) { + /* Already created */ + return (0); + } + + mtx_init(&chan->mtx, "SoftDMA", NULL, MTX_DEF); + + if (kproc_create(softdma_worker, (void *)chan, &chan->p, 0, 0, + "softdma_worker") != 0) { + device_printf(sc->dev, + "%s: Failed to create worker thread.\n", __func__); + return (-1); + } + + return (0); +} + +static int +softdma_channel_alloc(device_t dev, struct xdma_channel *xchan) +{ + struct softdma_channel *chan; + struct softdma_softc *sc; + int i; + + sc = device_get_softc(dev); + + for (i = 0; i < SOFTDMA_NCHANNELS; i++) { + chan = &sc->channels[i]; + if (chan->used == 0) { + chan->xchan = xchan; + xchan->chan = (void *)chan; + chan->index = i; + chan->idx_head = 0; + chan->idx_tail = 0; + chan->descs_used_count = 0; + chan->descs_num = 1024; + chan->sc = sc; + + if (softdma_proc_create(chan) != 0) { + return (-1); + } + + chan->used = 1; + + return (0); + } + } + + return (-1); +} + +static int +softdma_channel_free(device_t dev, struct xdma_channel *xchan) +{ + struct softdma_channel *chan; + struct softdma_softc *sc; + + sc = device_get_softc(dev); + + chan = (struct softdma_channel *)xchan->chan; + + if (chan->descs != NULL) { + free(chan->descs, M_DEVBUF); + } + + chan->used = 0; + + return (0); +} + +static int +softdma_desc_alloc(struct xdma_channel *xchan) +{ + struct softdma_channel *chan; + uint32_t nsegments; + + chan = (struct softdma_channel *)xchan->chan; + + nsegments = chan->descs_num; + + chan->descs = malloc(nsegments * sizeof(struct softdma_desc), + M_DEVBUF, (M_WAITOK | M_ZERO)); + + return (0); +} + +static int +softdma_channel_prep_sg(device_t dev, struct xdma_channel *xchan) +{ + struct softdma_channel *chan; + struct softdma_desc *desc; + struct softdma_softc *sc; + int ret; + int i; + + sc = device_get_softc(dev); + + chan = (struct softdma_channel *)xchan->chan; + + ret = softdma_desc_alloc(xchan); + if (ret != 0) { + device_printf(sc->dev, + "%s: Can't allocate descriptors.\n", __func__); + return (-1); + } + + for (i = 0; i < chan->descs_num; i++) { + desc = &chan->descs[i]; + + if (i == (chan->descs_num - 1)) { + desc->next = &chan->descs[0]; + } else { + desc->next = &chan->descs[i+1]; + } + } + + return (0); +} + +static int +softdma_channel_capacity(device_t dev, xdma_channel_t *xchan, + uint32_t *capacity) +{ + struct softdma_channel *chan; + uint32_t c; + + chan = (struct softdma_channel *)xchan->chan; + + /* At least one descriptor must be left empty. */ + c = (chan->descs_num - chan->descs_used_count - 1); + + *capacity = c; + + return (0); +} + +static int +softdma_channel_submit_sg(device_t dev, struct xdma_channel *xchan, + struct xdma_sglist *sg, uint32_t sg_n) +{ + struct softdma_channel *chan; + struct softdma_desc *desc; + struct softdma_softc *sc; + uint32_t enqueued; + uint32_t saved_dir; + uint32_t tmp; + uint32_t len; + int i; + + sc = device_get_softc(dev); + + chan = (struct softdma_channel *)xchan->chan; + + enqueued = 0; + + for (i = 0; i < sg_n; i++) { + len = (uint32_t)sg[i].len; + + desc = &chan->descs[chan->idx_head]; + desc->src_addr = sg[i].src_addr; + desc->dst_addr = sg[i].dst_addr; + if (sg[i].direction == XDMA_MEM_TO_DEV) { + desc->src_incr = 1; + desc->dst_incr = 0; + } else { + desc->src_incr = 0; + desc->dst_incr = 1; + } + desc->direction = sg[i].direction; + saved_dir = sg[i].direction; + desc->len = len; + desc->transfered = 0; + desc->status = 0; + desc->reserved = 0; + desc->control = 0; + + if (sg[i].first == 1) + desc->control |= CONTROL_GEN_SOP; + if (sg[i].last == 1) + desc->control |= CONTROL_GEN_EOP; + + tmp = chan->idx_head; + chan->idx_head = softdma_next_desc(chan, chan->idx_head); + atomic_add_int(&chan->descs_used_count, 1); + desc->control |= CONTROL_OWN; + enqueued += 1; + } + + if (enqueued == 0) + return (0); + + if (saved_dir == XDMA_MEM_TO_DEV) { + chan->run = 1; + wakeup(chan); + } else + softdma_memc_write(sc, + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, + SOFTDMA_RX_EVENTS); + + return (0); +} + +static int +softdma_channel_request(device_t dev, struct xdma_channel *xchan, + struct xdma_request *req) +{ + struct softdma_channel *chan; + struct softdma_desc *desc; + struct softdma_softc *sc; + int ret; + + sc = device_get_softc(dev); + + chan = (struct softdma_channel *)xchan->chan; + + ret = softdma_desc_alloc(xchan); + if (ret != 0) { + device_printf(sc->dev, + "%s: Can't allocate descriptors.\n", __func__); + return (-1); + } + + desc = &chan->descs[0]; + + desc->src_addr = req->src_addr; + desc->dst_addr = req->dst_addr; + desc->len = req->block_len; + desc->src_incr = 1; + desc->dst_incr = 1; + desc->next = NULL; + + return (0); +} + +static int +softdma_channel_control(device_t dev, xdma_channel_t *xchan, int cmd) +{ + struct softdma_channel *chan; + struct softdma_softc *sc; + + sc = device_get_softc(dev); + + chan = (struct softdma_channel *)xchan->chan; + + switch (cmd) { + case XDMA_CMD_BEGIN: + case XDMA_CMD_TERMINATE: + case XDMA_CMD_PAUSE: + /* TODO: implement me */ + return (-1); + } + + return (0); +} + +#ifdef FDT +static int +softdma_ofw_md_data(device_t dev, pcell_t *cells, + int ncells, void **ptr) +{ + + return (0); +} +#endif + +static device_method_t softdma_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, softdma_probe), + DEVMETHOD(device_attach, softdma_attach), + DEVMETHOD(device_detach, softdma_detach), + + /* xDMA Interface */ + DEVMETHOD(xdma_channel_alloc, softdma_channel_alloc), + DEVMETHOD(xdma_channel_free, softdma_channel_free), + DEVMETHOD(xdma_channel_request, softdma_channel_request), + DEVMETHOD(xdma_channel_control, softdma_channel_control), + + /* xDMA SG Interface */ + DEVMETHOD(xdma_channel_prep_sg, softdma_channel_prep_sg), + DEVMETHOD(xdma_channel_submit_sg, softdma_channel_submit_sg), + DEVMETHOD(xdma_channel_capacity, softdma_channel_capacity), + +#ifdef FDT + DEVMETHOD(xdma_ofw_md_data, softdma_ofw_md_data), +#endif + + DEVMETHOD_END +}; + +static driver_t softdma_driver = { + "softdma", + softdma_methods, + sizeof(struct softdma_softc), +}; + +static devclass_t softdma_devclass; + +EARLY_DRIVER_MODULE(softdma, simplebus, softdma_driver, softdma_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); From owner-svn-src-all@freebsd.org Fri Apr 13 15:18:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 820D9F90755; Fri, 13 Apr 2018 15:18:07 +0000 (UTC) (envelope-from br@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 33A7D79F17; Fri, 13 Apr 2018 15:18:07 +0000 (UTC) (envelope-from br@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 2E9B61B6AC; Fri, 13 Apr 2018 15:18:07 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DFI7GL094675; Fri, 13 Apr 2018 15:18:07 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DFI7XC094674; Fri, 13 Apr 2018 15:18:07 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804131518.w3DFI7XC094674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Apr 2018 15:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332473 - head/sys/dts/mips X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dts/mips X-SVN-Commit-Revision: 332473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 15:18:07 -0000 Author: br Date: Fri Apr 13 15:18:06 2018 New Revision: 332473 URL: https://svnweb.freebsd.org/changeset/base/332473 Log: Add beripic1, msgdma and softdma instances. Sponsored by: DARPA, AFRL Modified: head/sys/dts/mips/beripad-de4.dts Modified: head/sys/dts/mips/beripad-de4.dts ============================================================================== --- head/sys/dts/mips/beripad-de4.dts Fri Apr 13 14:18:04 2018 (r332472) +++ head/sys/dts/mips/beripad-de4.dts Fri Apr 13 15:18:06 2018 (r332473) @@ -107,6 +107,23 @@ interrupt-parent = <&cpuintc>; }; +/* + beripic1: beripic@7f808000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x7f808000 0x400 + 0x7f80a000 0x10 + 0x7f80a080 0x10 + 0x7f80a100 0x10>; + interrupts = < 2 3 4 5 6 >; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + interrupt-parent = <&cpuintc>; + }; +*/ + soc { #address-cells = <1>; #size-cells = <1>; @@ -190,6 +207,62 @@ reg = <0x3fe0000 0x20000>; label = "boot"; }; + }; + + msgdma0: msgdma@80004080 { + compatible = "altr,msgdma-16.0", "altr,msgdma-1.0"; + reg = <0x80004080 0x00000020>, + <0x800040a0 0x00000020>; + reg-names = "csr", "descriptor_slave"; + interrupts = <14>; + interrupt-parent = <&beripic0>; + #dma-cells = <3>; + }; + + msgdma1: msgdma@80004000 { + compatible = "altr,msgdma-16.0", "altr,msgdma-1.0"; + reg = <0x80004000 0x00000020>, + <0x80004020 0x00000020>; + reg-names = "csr", "descriptor_slave"; + interrupts = <13>; + interrupt-parent = <&beripic0>; + #dma-cells = <3>; + }; + + softdma0: softdma@7f007400 { + compatible = "altr,softdma"; + reg = < 0x7f007400 0x8 /* tx */ + 0x7f007420 0x20 >; /* txc */ + interrupts = <2>; + interrupt-parent = <&beripic0>; + #dma-cells = <3>; + }; + + softdma1: softdma@7f007500 { + compatible = "altr,softdma"; + reg = < 0x7f007500 0x8 /* rx */ + 0x7f007520 0x20 >; /* rxc */ + interrupts = <1>; + interrupt-parent = <&beripic0>; + #dma-cells = <3>; + }; + + softdma2: softdma@7f005400 { + compatible = "altr,softdma"; + reg = < 0x7f005400 0x8 /* tx */ + 0x7f005420 0x20 >; /* txc */ + interrupts = <12>; + interrupt-parent = <&beripic0>; + #dma-cells = <3>; + }; + + softdma3: softdma@7f005500 { + compatible = "altr,softdma"; + reg = < 0x7f005500 0x8 /* rx */ + 0x7f005520 0x20 >; /* rxc */ + interrupts = <11>; + interrupt-parent = <&beripic0>; + #dma-cells = <3>; }; ethernet@7f007000 { From owner-svn-src-all@freebsd.org Fri Apr 13 15:59:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0BA3F93096; Fri, 13 Apr 2018 15:59:25 +0000 (UTC) (envelope-from br@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 4E52A8371C; Fri, 13 Apr 2018 15:59:25 +0000 (UTC) (envelope-from br@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 4678F1BCF5; Fri, 13 Apr 2018 15:59:25 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DFxPGv014743; Fri, 13 Apr 2018 15:59:25 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DFxPFl014741; Fri, 13 Apr 2018 15:59:25 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804131559.w3DFxPFl014741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Apr 2018 15:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332474 - in head/sys: dev/altera/atse dts/mips mips/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/altera/atse dts/mips mips/conf X-SVN-Commit-Revision: 332474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 15:59:26 -0000 Author: br Date: Fri Apr 13 15:59:24 2018 New Revision: 332474 URL: https://svnweb.freebsd.org/changeset/base/332474 Log: Convert atse(4) driver for Altera Triple-Speed Ethernet MegaCore to use xdma(4) interface. This allows us to switch between Altera mSGDMA or SoftDMA engines used by atse(4) device. This also makes atse(4) driver become 25% smaller. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9618 Modified: head/sys/dev/altera/atse/if_atse.c head/sys/dev/altera/atse/if_atse_fdt.c head/sys/dev/altera/atse/if_atse_nexus.c head/sys/dev/altera/atse/if_atsereg.h head/sys/dts/mips/beripad-de4.dts head/sys/mips/conf/BERI_DE4_BASE Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Fri Apr 13 15:18:06 2018 (r332473) +++ head/sys/dev/altera/atse/if_atse.c Fri Apr 13 15:59:24 2018 (r332474) @@ -3,6 +3,7 @@ * * Copyright (c) 2012, 2013 Bjoern A. Zeeb * Copyright (c) 2014 Robert N. M. Watson + * Copyright (c) 2016-2017 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -88,29 +89,21 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include -MODULE_DEPEND(atse, ether, 1, 1, 1); -MODULE_DEPEND(atse, miibus, 1, 1, 1); +#define RX_QUEUE_SIZE 4096 +#define TX_QUEUE_SIZE 4096 +#define NUM_RX_MBUF 512 +#define BUFRING_SIZE 8192 +#include -#define ATSE_WATCHDOG_TIME 5 - -#ifdef DEVICE_POLLING -static poll_handler_t atse_poll; -#endif - /* XXX once we'd do parallel attach, we need a global lock for this. */ #define ATSE_ETHERNET_OPTION_BITS_UNDEF 0 #define ATSE_ETHERNET_OPTION_BITS_READ 1 static int atse_ethernet_option_bits_flag = ATSE_ETHERNET_OPTION_BITS_UNDEF; static uint8_t atse_ethernet_option_bits[ALTERA_ETHERNET_OPTION_BITS_LEN]; -static int atse_intr_debug_enable = 0; -SYSCTL_INT(_debug, OID_AUTO, atse_intr_debug_enable, CTLFLAG_RW, - &atse_intr_debug_enable, 0, - "Extra debugging output for atse interrupts"); - /* * Softc and critical resource locking. */ @@ -118,155 +111,15 @@ SYSCTL_INT(_debug, OID_AUTO, atse_intr_debug_enable, C #define ATSE_UNLOCK(_sc) mtx_unlock(&(_sc)->atse_mtx) #define ATSE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->atse_mtx, MA_OWNED) -#define ATSE_TX_PENDING(sc) (sc->atse_tx_m != NULL || \ - !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) +#define ATSE_DEBUG +#undef ATSE_DEBUG -#ifdef DEBUG +#ifdef ATSE_DEBUG #define DPRINTF(format, ...) printf(format, __VA_ARGS__) #else #define DPRINTF(format, ...) #endif -/* a_api.c functions; factor out? */ -static inline void -a_onchip_fifo_mem_core_write(struct resource *res, uint32_t off, - uint32_t val4, const char *desc, const char *f, const int l) -{ - - val4 = htole32(val4); - DPRINTF("[%s:%d] FIFOW %s 0x%08x = 0x%08x\n", f, l, desc, off, val4); - bus_write_4(res, off, val4); -} - -static inline uint32_t -a_onchip_fifo_mem_core_read(struct resource *res, uint32_t off, - const char *desc, const char *f, const int l) -{ - uint32_t val4; - - val4 = le32toh(bus_read_4(res, off)); - DPRINTF("[%s:%d] FIFOR %s 0x%08x = 0x%08x\n", f, l, desc, off, val4); - - return (val4); -} - -/* The FIFO does an endian conversion, so we must not do it as well. */ -/* XXX-BZ in fact we should do a htobe32 so le would be fine as well? */ -#define ATSE_TX_DATA_WRITE(sc, val4) \ - bus_write_4((sc)->atse_tx_mem_res, A_ONCHIP_FIFO_MEM_CORE_DATA, val4) - -#define ATSE_TX_META_WRITE(sc, val4) \ - a_onchip_fifo_mem_core_write((sc)->atse_tx_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_METADATA, \ - (val4), "TXM", __func__, __LINE__) -#define ATSE_TX_META_READ(sc) \ - a_onchip_fifo_mem_core_read((sc)->atse_tx_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_METADATA, \ - "TXM", __func__, __LINE__) - -#define ATSE_TX_READ_FILL_LEVEL(sc) \ - a_onchip_fifo_mem_core_read((sc)->atse_txc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_FILL_LEVEL, \ - "TX_FILL", __func__, __LINE__) -#define ATSE_RX_READ_FILL_LEVEL(sc) \ - a_onchip_fifo_mem_core_read((sc)->atse_rxc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_FILL_LEVEL, \ - "RX_FILL", __func__, __LINE__) - -/* The FIFO does an endian conversion, so we must not do it as well. */ -/* XXX-BZ in fact we should do a htobe32 so le would be fine as well? */ -#define ATSE_RX_DATA_READ(sc) \ - bus_read_4((sc)->atse_rx_mem_res, A_ONCHIP_FIFO_MEM_CORE_DATA) -#define ATSE_RX_META_READ(sc) \ - a_onchip_fifo_mem_core_read((sc)->atse_rx_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_METADATA, \ - "RXM", __func__, __LINE__) - -#define ATSE_RX_STATUS_READ(sc) \ - a_onchip_fifo_mem_core_read((sc)->atse_rxc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_I_STATUS, \ - "RX_EVENT", __func__, __LINE__) - -#define ATSE_TX_STATUS_READ(sc) \ - a_onchip_fifo_mem_core_read((sc)->atse_txc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_I_STATUS, \ - "TX_EVENT", __func__, __LINE__) - -#define ATSE_RX_EVENT_READ(sc) \ - a_onchip_fifo_mem_core_read((sc)->atse_rxc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT, \ - "RX_EVENT", __func__, __LINE__) - -#define ATSE_TX_EVENT_READ(sc) \ - a_onchip_fifo_mem_core_read((sc)->atse_txc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT, \ - "TX_EVENT", __func__, __LINE__) - -#define ATSE_RX_EVENT_CLEAR(sc) \ - do { \ - uint32_t val4; \ - \ - val4 = a_onchip_fifo_mem_core_read( \ - (sc)->atse_rxc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT, \ - "RX_EVENT", __func__, __LINE__); \ - if (val4 != 0x00) \ - a_onchip_fifo_mem_core_write( \ - (sc)->atse_rxc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT, \ - val4, "RX_EVENT", __func__, __LINE__); \ - } while(0) -#define ATSE_TX_EVENT_CLEAR(sc) \ - do { \ - uint32_t val4; \ - \ - val4 = a_onchip_fifo_mem_core_read( \ - (sc)->atse_txc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT, \ - "TX_EVENT", __func__, __LINE__); \ - if (val4 != 0x00) \ - a_onchip_fifo_mem_core_write( \ - (sc)->atse_txc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT, \ - val4, "TX_EVENT", __func__, __LINE__); \ - } while(0) - -#define ATSE_RX_EVENTS (A_ONCHIP_FIFO_MEM_CORE_INTR_FULL | \ - A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW | \ - A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW) -#define ATSE_RX_INTR_ENABLE(sc) \ - a_onchip_fifo_mem_core_write((sc)->atse_rxc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ - ATSE_RX_EVENTS, \ - "RX_INTR", __func__, __LINE__) /* XXX-BZ review later. */ -#define ATSE_RX_INTR_DISABLE(sc) \ - a_onchip_fifo_mem_core_write((sc)->atse_rxc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, 0, \ - "RX_INTR", __func__, __LINE__) -#define ATSE_RX_INTR_READ(sc) \ - a_onchip_fifo_mem_core_read((sc)->atse_rxc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ - "RX_INTR", __func__, __LINE__) - -#define ATSE_TX_EVENTS (A_ONCHIP_FIFO_MEM_CORE_INTR_EMPTY | \ - A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW | \ - A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW) -#define ATSE_TX_INTR_ENABLE(sc) \ - a_onchip_fifo_mem_core_write((sc)->atse_txc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ - ATSE_TX_EVENTS, \ - "TX_INTR", __func__, __LINE__) /* XXX-BZ review later. */ -#define ATSE_TX_INTR_DISABLE(sc) \ - a_onchip_fifo_mem_core_write((sc)->atse_txc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, 0, \ - "TX_INTR", __func__, __LINE__) -#define ATSE_TX_INTR_READ(sc) \ - a_onchip_fifo_mem_core_read((sc)->atse_txc_mem_res, \ - A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ - "TX_INTR", __func__, __LINE__) - -static int atse_rx_locked(struct atse_softc *sc); - /* * Register space access macros. */ @@ -345,146 +198,194 @@ static int atse_detach(device_t); devclass_t atse_devclass; static int -atse_tx_locked(struct atse_softc *sc, int *sent) +atse_rx_enqueue(struct atse_softc *sc, uint32_t n) { struct mbuf *m; - uint32_t val4, fill_level; - int leftm; - int c; + int i; - ATSE_LOCK_ASSERT(sc); + for (i = 0; i < n; i++) { + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) { + device_printf(sc->dev, + "%s: Can't alloc rx mbuf\n", __func__); + return (-1); + } - m = sc->atse_tx_m; - KASSERT(m != NULL, ("%s: m is null: sc=%p", __func__, sc)); - KASSERT(m->m_flags & M_PKTHDR, ("%s: not a pkthdr: m=%p", __func__, m)); - - /* - * Copy to buffer to minimize our pain as we can only store - * double words which, after the first mbuf gets out of alignment - * quite quickly. - */ - if (sc->atse_tx_m_offset == 0) { - m_copydata(m, 0, m->m_pkthdr.len, sc->atse_tx_buf); - sc->atse_tx_buf_len = m->m_pkthdr.len; + m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; + xdma_enqueue_mbuf(sc->xchan_rx, &m, 0, 4, 4, XDMA_DEV_TO_MEM); } - fill_level = ATSE_TX_READ_FILL_LEVEL(sc); -#if 0 /* Returns 0xdeadc0de. */ - val4 = ATSE_TX_META_READ(sc); -#endif - if (sc->atse_tx_m_offset == 0) { - /* Write start of packet. */ - val4 = A_ONCHIP_FIFO_MEM_CORE_SOP; - val4 &= ~A_ONCHIP_FIFO_MEM_CORE_EOP; - ATSE_TX_META_WRITE(sc, val4); + return (0); +} + +static int +atse_xdma_tx_intr(void *arg, xdma_transfer_status_t *status) +{ + xdma_transfer_status_t st; + struct atse_softc *sc; + struct ifnet *ifp; + struct mbuf *m; + int err; + + sc = arg; + + ATSE_LOCK(sc); + + ifp = sc->atse_ifp; + + for (;;) { + err = xdma_dequeue_mbuf(sc->xchan_tx, &m, &st); + if (err != 0) { + break; + } + + if (st.error != 0) { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + } + + m_freem(m); + sc->txcount--; } - /* TX FIFO is single clock mode, so we have the full FIFO. */ - c = 0; - while ((sc->atse_tx_buf_len - sc->atse_tx_m_offset) > 4 && - fill_level < AVALON_FIFO_TX_BASIC_OPTS_DEPTH) { + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - bcopy(&sc->atse_tx_buf[sc->atse_tx_m_offset], &val4, - sizeof(val4)); - ATSE_TX_DATA_WRITE(sc, val4); - sc->atse_tx_m_offset += sizeof(val4); - c += sizeof(val4); + ATSE_UNLOCK(sc); - fill_level++; - if (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) - fill_level = ATSE_TX_READ_FILL_LEVEL(sc); + return (0); +} + +static int +atse_xdma_rx_intr(void *arg, xdma_transfer_status_t *status) +{ + xdma_transfer_status_t st; + struct atse_softc *sc; + struct ifnet *ifp; + struct mbuf *m; + int err; + uint32_t cnt_processed; + + sc = arg; + + ATSE_LOCK(sc); + + ifp = sc->atse_ifp; + + cnt_processed = 0; + for (;;) { + err = xdma_dequeue_mbuf(sc->xchan_rx, &m, &st); + if (err != 0) { + break; + } + cnt_processed++; + + if (st.error != 0) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + m_freem(m); + continue; + } + + m->m_pkthdr.len = m->m_len = st.transferred; + m->m_pkthdr.rcvif = ifp; + m_adj(m, ETHER_ALIGN); + ATSE_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + ATSE_LOCK(sc); } - if (sent != NULL) - *sent += c; - /* Set EOP *before* writing the last symbol. */ - if (sc->atse_tx_m_offset >= (sc->atse_tx_buf_len - 4) && - fill_level < AVALON_FIFO_TX_BASIC_OPTS_DEPTH) { + atse_rx_enqueue(sc, cnt_processed); - /* Set EndOfPacket. */ - val4 = A_ONCHIP_FIFO_MEM_CORE_EOP; + ATSE_UNLOCK(sc); - /* Set EMPTY. */ - leftm = sc->atse_tx_buf_len - sc->atse_tx_m_offset; - val4 |= ((4 - leftm) << A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT); - ATSE_TX_META_WRITE(sc, val4); + return (0); +} - /* Write last symbol. */ - val4 = 0; - bcopy(sc->atse_tx_buf + sc->atse_tx_m_offset, &val4, leftm); - ATSE_TX_DATA_WRITE(sc, val4); +static int +atse_transmit_locked(struct ifnet *ifp) +{ + struct atse_softc *sc; + struct mbuf *m; + struct buf_ring *br; + int error; + int enq; - if (sent != NULL) - *sent += leftm; + sc = ifp->if_softc; + br = sc->br; - /* OK, the packet is gone. */ - sc->atse_tx_m = NULL; - sc->atse_tx_m_offset = 0; + enq = 0; + while ((m = drbr_peek(ifp, br)) != NULL) { + error = xdma_enqueue_mbuf(sc->xchan_tx, &m, 0, 4, 4, XDMA_MEM_TO_DEV); + if (error != 0) { + /* No space in request queue available yet. */ + drbr_putback(ifp, br, m); + break; + } + + drbr_advance(ifp, br); + + sc->txcount++; + enq++; + /* If anyone is interested give them a copy. */ - BPF_MTAP(sc->atse_ifp, m); + ETHER_BPF_MTAP(ifp, m); + } - m_freem(m); - return (0); - } + if (enq > 0) + xdma_queue_submit(sc->xchan_tx); - return (EBUSY); + return (0); } -static void -atse_start_locked(struct ifnet *ifp) +static int +atse_transmit(struct ifnet *ifp, struct mbuf *m) { struct atse_softc *sc; - int error, sent; + struct buf_ring *br; + int error; sc = ifp->if_softc; - ATSE_LOCK_ASSERT(sc); + br = sc->br; - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || (sc->atse_flags & ATSE_FLAGS_LINK) == 0) - return; + ATSE_LOCK(sc); -#if 1 - /* - * Disable the watchdog while sending, we are batching packets. - * Though we should never reach 5 seconds, and are holding the lock, - * but who knows. - */ - sc->atse_watchdog_timer = 0; -#endif + mtx_lock(&sc->br_mtx); - if (sc->atse_tx_m != NULL) { - error = atse_tx_locked(sc, &sent); - if (error != 0) - goto done; + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { + error = drbr_enqueue(ifp, sc->br, m); + mtx_unlock(&sc->br_mtx); + ATSE_UNLOCK(sc); + return (error); } - /* We have more space to send so continue ... */ - for (; !IFQ_DRV_IS_EMPTY(&ifp->if_snd); ) { - IFQ_DRV_DEQUEUE(&ifp->if_snd, sc->atse_tx_m); - sc->atse_tx_m_offset = 0; - if (sc->atse_tx_m == NULL) - break; - error = atse_tx_locked(sc, &sent); - if (error != 0) - goto done; + if ((sc->atse_flags & ATSE_FLAGS_LINK) == 0) { + error = drbr_enqueue(ifp, sc->br, m); + mtx_unlock(&sc->br_mtx); + ATSE_UNLOCK(sc); + return (error); } -done: - /* If the IP core walks into Nekromanteion try to bail out. */ - if (sent > 0) - sc->atse_watchdog_timer = ATSE_WATCHDOG_TIME; + error = drbr_enqueue(ifp, br, m); + if (error) { + mtx_unlock(&sc->br_mtx); + ATSE_UNLOCK(sc); + return (error); + } + error = atse_transmit_locked(ifp); + + mtx_unlock(&sc->br_mtx); + ATSE_UNLOCK(sc); + + return (error); } static void -atse_start(struct ifnet *ifp) +atse_qflush(struct ifnet *ifp) { struct atse_softc *sc; sc = ifp->if_softc; - ATSE_LOCK(sc); - atse_start_locked(ifp); - ATSE_UNLOCK(sc); + + printf("%s\n", __func__); } static int @@ -496,36 +397,33 @@ atse_stop_locked(struct atse_softc *sc) ATSE_LOCK_ASSERT(sc); - sc->atse_watchdog_timer = 0; callout_stop(&sc->atse_tick); ifp = sc->atse_ifp; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - ATSE_RX_INTR_DISABLE(sc); - ATSE_TX_INTR_DISABLE(sc); - ATSE_RX_EVENT_CLEAR(sc); - ATSE_TX_EVENT_CLEAR(sc); /* Disable MAC transmit and receive datapath. */ mask = BASE_CFG_COMMAND_CONFIG_TX_ENA|BASE_CFG_COMMAND_CONFIG_RX_ENA; val4 = CSR_READ_4(sc, BASE_CFG_COMMAND_CONFIG); val4 &= ~mask; CSR_WRITE_4(sc, BASE_CFG_COMMAND_CONFIG, val4); + /* Wait for bits to be cleared; i=100 is excessive. */ for (i = 0; i < 100; i++) { val4 = CSR_READ_4(sc, BASE_CFG_COMMAND_CONFIG); - if ((val4 & mask) == 0) + if ((val4 & mask) == 0) { break; + } DELAY(10); } - if ((val4 & mask) != 0) + + if ((val4 & mask) != 0) { device_printf(sc->atse_dev, "Disabling MAC TX/RX timed out.\n"); /* Punt. */ + } sc->atse_flags &= ~ATSE_FLAGS_LINK; - /* XXX-BZ free the RX/TX rings. */ - return (0); } @@ -561,10 +459,11 @@ atse_rxfilter_locked(struct atse_softc *sc) val4 &= ~BASE_CFG_COMMAND_CONFIG_MHASH_SEL; ifp = sc->atse_ifp; - if (ifp->if_flags & IFF_PROMISC) + if (ifp->if_flags & IFF_PROMISC) { val4 |= BASE_CFG_COMMAND_CONFIG_PROMIS_EN; - else + } else { val4 &= ~BASE_CFG_COMMAND_CONFIG_PROMIS_EN; + } CSR_WRITE_4(sc, BASE_CFG_COMMAND_CONFIG, val4); @@ -587,16 +486,18 @@ atse_rxfilter_locked(struct atse_softc *sc) */ if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) + if (ifma->ifma_addr->sa_family != AF_LINK) { continue; + } h |= (1 << atse_mchash(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr))); } if_maddr_runlock(ifp); - for (i = 0; i <= MHASH_LEN; i++) + for (i = 0; i <= MHASH_LEN; i++) { CSR_WRITE_4(sc, MHASH_START + i, (h & (1 << i)) ? 0x01 : 0x00); + } } return (0); @@ -609,22 +510,26 @@ atse_ethernet_option_bits_read_fdt(device_t dev) device_t fdev; int i, rid; - if (atse_ethernet_option_bits_flag & ATSE_ETHERNET_OPTION_BITS_READ) + if (atse_ethernet_option_bits_flag & ATSE_ETHERNET_OPTION_BITS_READ) { return (0); + } fdev = device_find_child(device_get_parent(dev), "cfi", 0); - if (fdev == NULL) + if (fdev == NULL) { return (ENOENT); + } rid = 0; res = bus_alloc_resource_any(fdev, SYS_RES_MEMORY, &rid, RF_ACTIVE | RF_SHAREABLE); - if (res == NULL) + if (res == NULL) { return (ENXIO); + } - for (i = 0; i < ALTERA_ETHERNET_OPTION_BITS_LEN; i++) + for (i = 0; i < ALTERA_ETHERNET_OPTION_BITS_LEN; i++) { atse_ethernet_option_bits[i] = bus_read_1(res, ALTERA_ETHERNET_OPTION_BITS_OFF + i); + } bus_release_resource(fdev, SYS_RES_MEMORY, rid, res); atse_ethernet_option_bits_flag |= ATSE_ETHERNET_OPTION_BITS_READ; @@ -658,12 +563,14 @@ atse_get_eth_address(struct atse_softc *sc) * possibly change our ethernet address, which is not good at all. */ if (sc->atse_eth_addr[0] != 0x00 || sc->atse_eth_addr[1] != 0x00 || - sc->atse_eth_addr[2] != 0x00) + sc->atse_eth_addr[2] != 0x00) { return (0); + } if ((atse_ethernet_option_bits_flag & - ATSE_ETHERNET_OPTION_BITS_READ) == 0) + ATSE_ETHERNET_OPTION_BITS_READ) == 0) { goto get_random; + } val4 = atse_ethernet_option_bits[0] << 24; val4 |= atse_ethernet_option_bits[1] << 16; @@ -718,8 +625,9 @@ atse_get_eth_address(struct atse_softc *sc) * Ethernet, go to random. */ unit = device_get_unit(sc->atse_dev); - if (unit == 0x00) + if (unit == 0x00) { return (0); + } if (unit > 0x0f) { device_printf(sc->atse_dev, "We do not support Ethernet " @@ -831,8 +739,9 @@ atse_reset(struct atse_softc *sc) /* Wait for reset bit to clear; i=100 is excessive. */ for (i = 0; i < 100; i++) { val = PCS_READ_2(sc, PCS_CONTROL); - if ((val & PCS_CONTROL_RESET) == 0) + if ((val & PCS_CONTROL_RESET) == 0) { break; + } DELAY(10); } @@ -851,8 +760,9 @@ atse_reset(struct atse_softc *sc) /* Wait for bits to be cleared; i=100 is excessive. */ for (i = 0; i < 100; i++) { val4 = CSR_READ_4(sc, BASE_CFG_COMMAND_CONFIG); - if ((val4 & mask) == 0) + if ((val4 & mask) == 0) { break; + } DELAY(10); } if ((val4 & mask) != 0) { @@ -926,8 +836,10 @@ atse_reset(struct atse_softc *sc) val4 = CSR_READ_4(sc, TX_CMD_STAT); val4 &= ~(TX_CMD_STAT_OMIT_CRC|TX_CMD_STAT_TX_SHIFT16); CSR_WRITE_4(sc, TX_CMD_STAT, val4); + val4 = CSR_READ_4(sc, RX_CMD_STAT); val4 &= ~RX_CMD_STAT_RX_SHIFT16; + val4 |= RX_CMD_STAT_RX_SHIFT16; CSR_WRITE_4(sc, RX_CMD_STAT, val4); /* e. Reset MAC. */ @@ -937,8 +849,9 @@ atse_reset(struct atse_softc *sc) /* Wait for bits to be cleared; i=100 is excessive. */ for (i = 0; i < 100; i++) { val4 = CSR_READ_4(sc, BASE_CFG_COMMAND_CONFIG); - if ((val4 & BASE_CFG_COMMAND_CONFIG_SW_RESET) == 0) + if ((val4 & BASE_CFG_COMMAND_CONFIG_SW_RESET) == 0) { break; + } DELAY(10); } if ((val4 & BASE_CFG_COMMAND_CONFIG_SW_RESET) != 0) { @@ -954,8 +867,9 @@ atse_reset(struct atse_softc *sc) /* Wait for bits to be cleared; i=100 is excessive. */ for (i = 0; i < 100; i++) { val4 = CSR_READ_4(sc, BASE_CFG_COMMAND_CONFIG); - if ((val4 & mask) == mask) + if ((val4 & mask) == mask) { break; + } DELAY(10); } if ((val4 & mask) != mask) { @@ -976,8 +890,9 @@ atse_init_locked(struct atse_softc *sc) ATSE_LOCK_ASSERT(sc); ifp = sc->atse_ifp; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { return; + } /* * Must update the ether address if changed. Given we do not handle @@ -989,31 +904,14 @@ atse_init_locked(struct atse_softc *sc) /* Make things frind to halt, cleanup, ... */ atse_stop_locked(sc); - /* ... reset, ... */ + atse_reset(sc); /* ... and fire up the engine again. */ atse_rxfilter_locked(sc); - /* Memory rings? DMA engine? */ - - sc->atse_rx_buf_len = 0; sc->atse_flags &= ATSE_FLAGS_LINK; /* Preserve. */ -#ifdef DEVICE_POLLING - /* Only enable interrupts if we are not polling. */ - if (ifp->if_capenable & IFCAP_POLLING) { - ATSE_RX_INTR_DISABLE(sc); - ATSE_TX_INTR_DISABLE(sc); - ATSE_RX_EVENT_CLEAR(sc); - ATSE_TX_EVENT_CLEAR(sc); - } else -#endif - { - ATSE_RX_INTR_ENABLE(sc); - ATSE_TX_INTR_ENABLE(sc); - } - mii = device_get_softc(sc->atse_miibus); sc->atse_flags &= ~ATSE_FLAGS_LINK; @@ -1070,39 +968,6 @@ atse_ioctl(struct ifnet *ifp, u_long command, caddr_t case SIOCSIFCAP: ATSE_LOCK(sc); mask = ifr->ifr_reqcap ^ ifp->if_capenable; -#ifdef DEVICE_POLLING - if ((mask & IFCAP_POLLING) != 0 && - (IFCAP_POLLING & ifp->if_capabilities) != 0) { - ifp->if_capenable ^= IFCAP_POLLING; - if ((IFCAP_POLLING & ifp->if_capenable) != 0) { - - error = ether_poll_register(atse_poll, ifp); - if (error != 0) { - ATSE_UNLOCK(sc); - break; - } - /* Disable interrupts. */ - ATSE_RX_INTR_DISABLE(sc); - ATSE_TX_INTR_DISABLE(sc); - ATSE_RX_EVENT_CLEAR(sc); - ATSE_TX_EVENT_CLEAR(sc); - - /* - * Do not allow disabling of polling if we do - * not have interrupts. - */ - } else if (sc->atse_rx_irq_res != NULL || - sc->atse_tx_irq_res != NULL) { - error = ether_poll_deregister(ifp); - /* Enable interrupts. */ - ATSE_RX_INTR_ENABLE(sc); - ATSE_TX_INTR_ENABLE(sc); - } else { - ifp->if_capenable ^= IFCAP_POLLING; - error = EINVAL; - } - } -#endif /* DEVICE_POLLING */ ATSE_UNLOCK(sc); break; case SIOCADDMULTI: @@ -1131,55 +996,6 @@ atse_ioctl(struct ifnet *ifp, u_long command, caddr_t } static void -atse_intr_debug(struct atse_softc *sc, const char *intrname) -{ - uint32_t rxs, rxe, rxi, rxf, txs, txe, txi, txf; - - if (!atse_intr_debug_enable) - return; - - rxs = ATSE_RX_STATUS_READ(sc); - rxe = ATSE_RX_EVENT_READ(sc); - rxi = ATSE_RX_INTR_READ(sc); - rxf = ATSE_RX_READ_FILL_LEVEL(sc); - - txs = ATSE_TX_STATUS_READ(sc); - txe = ATSE_TX_EVENT_READ(sc); - txi = ATSE_TX_INTR_READ(sc); - txf = ATSE_TX_READ_FILL_LEVEL(sc); - - printf( - "%s - %s: " - "rxs 0x%x rxe 0x%x rxi 0x%x rxf 0x%x " - "txs 0x%x txe 0x%x txi 0x%x txf 0x%x\n", - __func__, intrname, - rxs, rxe, rxi, rxf, - txs, txe, txi, txf); -} - -static void -atse_watchdog(struct atse_softc *sc) -{ - - ATSE_LOCK_ASSERT(sc); - - if (sc->atse_watchdog_timer == 0 || --sc->atse_watchdog_timer > 0) - return; - - device_printf(sc->atse_dev, "watchdog timeout\n"); - if_inc_counter(sc->atse_ifp, IFCOUNTER_OERRORS, 1); - - atse_intr_debug(sc, "poll"); - - sc->atse_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - atse_init_locked(sc); - - atse_rx_locked(sc); - if (!IFQ_DRV_IS_EMPTY(&sc->atse_ifp->if_snd)) - atse_start_locked(sc->atse_ifp); -} - -static void atse_tick(void *xsc) { struct atse_softc *sc; @@ -1192,9 +1008,10 @@ atse_tick(void *xsc) mii = device_get_softc(sc->atse_miibus); mii_tick(mii); - atse_watchdog(sc); - if ((sc->atse_flags & ATSE_FLAGS_LINK) == 0) + if ((sc->atse_flags & ATSE_FLAGS_LINK) == 0) { atse_miibus_statchg(sc->atse_dev); + } + callout_reset(&sc->atse_tick, hz, atse_tick, sc); } @@ -1213,171 +1030,15 @@ atse_ifmedia_upd(struct ifnet *ifp) ATSE_LOCK(sc); mii = device_get_softc(sc->atse_miibus); - LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { PHY_RESET(miisc); + } error = mii_mediachg(mii); ATSE_UNLOCK(sc); return (error); } -static void -atse_update_rx_err(struct atse_softc *sc, uint32_t mask) -{ - int i; - - /* RX error are 6 bits, we only know 4 of them. */ - for (i = 0; i < ATSE_RX_ERR_MAX; i++) - if ((mask & (1 << i)) != 0) - sc->atse_rx_err[i]++; -} - -static int -atse_rx_locked(struct atse_softc *sc) -{ - uint32_t fill, i, j; - uint32_t data, meta; - struct ifnet *ifp; - struct mbuf *m; - int rx_npkts; - - ATSE_LOCK_ASSERT(sc); - - ifp = sc->atse_ifp; - rx_npkts = 0; - j = 0; - meta = 0; - do { -outer: - if (sc->atse_rx_m == NULL) { - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); - if (m == NULL) - return (rx_npkts); - m->m_len = m->m_pkthdr.len = MCLBYTES; - /* Make sure upper layers will be aligned. */ - m_adj(m, ETHER_ALIGN); - sc->atse_rx_m = m; - } - - fill = ATSE_RX_READ_FILL_LEVEL(sc); - for (i = 0; i < fill; i++) { - /* - * XXX-BZ for whatever reason the FIFO requires the - * the data read before we can access the meta data. - */ - data = ATSE_RX_DATA_READ(sc); - meta = ATSE_RX_META_READ(sc); - if (meta & A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) { - /* XXX-BZ evaluate error. */ - atse_update_rx_err(sc, ((meta & - A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> - A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - sc->atse_rx_buf_len = 0; - /* - * Should still read till EOP or next SOP. - * - * XXX-BZ might also depend on - * BASE_CFG_COMMAND_CONFIG_RX_ERR_DISC - */ - sc->atse_flags |= ATSE_FLAGS_ERROR; - return (rx_npkts); - } - if ((meta & A_ONCHIP_FIFO_MEM_CORE_CHANNEL_MASK) != 0) - device_printf(sc->atse_dev, "%s: unexpected " - "channel %u\n", __func__, (meta & - A_ONCHIP_FIFO_MEM_CORE_CHANNEL_MASK) >> - A_ONCHIP_FIFO_MEM_CORE_CHANNEL_SHIFT); - - if (meta & A_ONCHIP_FIFO_MEM_CORE_SOP) { - /* - * There is no need to clear SOP between 1st - * and subsequent packet data junks. - */ - if (sc->atse_rx_buf_len != 0 && - (sc->atse_flags & ATSE_FLAGS_SOP_SEEN) == 0) - { - device_printf(sc->atse_dev, "%s: SOP " - "without empty buffer: %u\n", - __func__, sc->atse_rx_buf_len); - /* XXX-BZ any better counter? */ - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - } - - if ((sc->atse_flags & ATSE_FLAGS_SOP_SEEN) == 0) - { - sc->atse_flags |= ATSE_FLAGS_SOP_SEEN; - sc->atse_rx_buf_len = 0; - } - } -#if 0 /* We had to read the data before we could access meta data. See above. */ - data = ATSE_RX_DATA_READ(sc); -#endif - /* Make sure to not overflow the mbuf data size. */ - if (sc->atse_rx_buf_len >= sc->atse_rx_m->m_len - - sizeof(data)) { - /* - * XXX-BZ Error. We need more mbufs and are - * not setup for this yet. - */ - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - sc->atse_flags |= ATSE_FLAGS_ERROR; - } - if ((sc->atse_flags & ATSE_FLAGS_ERROR) == 0) - /* - * MUST keep this bcopy as m_data after m_adj - * for IP header aligment is on half-word - * and not word alignment. - */ - bcopy(&data, (uint8_t *)(sc->atse_rx_m->m_data + - sc->atse_rx_buf_len), sizeof(data)); - if (meta & A_ONCHIP_FIFO_MEM_CORE_EOP) { - uint8_t empty; - - empty = (meta & - A_ONCHIP_FIFO_MEM_CORE_EMPTY_MASK) >> - A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT; - sc->atse_rx_buf_len += (4 - empty); - - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - rx_npkts++; - - m = sc->atse_rx_m; - m->m_pkthdr.len = m->m_len = - sc->atse_rx_buf_len; - sc->atse_rx_m = NULL; - - sc->atse_rx_buf_len = 0; - sc->atse_flags &= ~ATSE_FLAGS_SOP_SEEN; - if (sc->atse_flags & ATSE_FLAGS_ERROR) { - sc->atse_flags &= ~ATSE_FLAGS_ERROR; - m_freem(m); - } else { - m->m_pkthdr.rcvif = ifp; - ATSE_UNLOCK(sc); - (*ifp->if_input)(ifp, m); - ATSE_LOCK(sc); - } -#ifdef DEVICE_POLLING - if (ifp->if_capenable & IFCAP_POLLING) { - if (sc->atse_rx_cycles <= 0) - return (rx_npkts); - sc->atse_rx_cycles--; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 13 16:13:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4531F9411F; Fri, 13 Apr 2018 16:13:59 +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 5EC7E86E87; Fri, 13 Apr 2018 16:13:59 +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 566CE1C025; Fri, 13 Apr 2018 16:13:59 +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 w3DGDxQn024584; Fri, 13 Apr 2018 16:13:59 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DGDxtE024583; Fri, 13 Apr 2018 16:13:59 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804131613.w3DGDxtE024583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 13 Apr 2018 16:13:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332475 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 332475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 16:13:59 -0000 Author: ae Date: Fri Apr 13 16:13:59 2018 New Revision: 332475 URL: https://svnweb.freebsd.org/changeset/base/332475 Log: Add check that mbuf had not multicast layer2 address. Such packets should be handled by ip6_mforward(). Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netinet6/ip6_fastfwd.c Modified: head/sys/netinet6/ip6_fastfwd.c ============================================================================== --- head/sys/netinet6/ip6_fastfwd.c Fri Apr 13 15:59:24 2018 (r332474) +++ head/sys/netinet6/ip6_fastfwd.c Fri Apr 13 16:13:59 2018 (r332475) @@ -97,7 +97,8 @@ ip6_tryforward(struct mbuf *m) * Fallback conditions to ip6_input for slow path processing. */ ip6 = mtod(m, struct ip6_hdr *); - if (ip6->ip6_nxt == IPPROTO_HOPOPTS || + if ((m->m_flags & (M_BCAST | M_MCAST)) != 0 || + ip6->ip6_nxt == IPPROTO_HOPOPTS || IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_dst) || IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src) || From owner-svn-src-all@freebsd.org Fri Apr 13 16:45:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0499F96040; Fri, 13 Apr 2018 16:45:36 +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 4D74D6E170; Fri, 13 Apr 2018 16:45:36 +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 445821C4C6; Fri, 13 Apr 2018 16:45:36 +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 w3DGjatO039450; Fri, 13 Apr 2018 16:45:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DGjawS039449; Fri, 13 Apr 2018 16:45:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804131645.w3DGjawS039449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 13 Apr 2018 16:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332476 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 332476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 16:45:36 -0000 Author: imp Date: Fri Apr 13 16:45:35 2018 New Revision: 332476 URL: https://svnweb.freebsd.org/changeset/base/332476 Log: Just assert that the lock is held here, rather than taking it out and dropping it. Sponsored by: Netflix Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Apr 13 16:13:59 2018 (r332475) +++ head/sys/cam/scsi/scsi_da.c Fri Apr 13 16:45:35 2018 (r332476) @@ -4652,9 +4652,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) (error_code == SSD_CURRENT_ERROR || error_code == SSD_DESC_CURRENT_ERROR) && (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { - cam_periph_lock(periph); + cam_periph_assert(periph, MA_OWNED); softc->flags &= ~DA_FLAG_CAN_RC16; - cam_periph_unlock(periph); free(rdcap, M_SCSIDA); xpt_release_ccb(done_ccb); softc->state = DA_STATE_PROBE_RC; From owner-svn-src-all@freebsd.org Fri Apr 13 16:54:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82C24F969AF; Fri, 13 Apr 2018 16:54: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 357F770F33; Fri, 13 Apr 2018 16:54: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 3028B1C675; Fri, 13 Apr 2018 16:54: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 w3DGsoVC044780; Fri, 13 Apr 2018 16:54:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DGsn6V044778; Fri, 13 Apr 2018 16:54:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804131654.w3DGsn6V044778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Apr 2018 16:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332478 - head/share/vt/fonts X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/vt/fonts X-SVN-Commit-Revision: 332478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 16:54:50 -0000 Author: emaste Date: Fri Apr 13 16:54:49 2018 New Revision: 332478 URL: https://svnweb.freebsd.org/changeset/base/332478 Log: Add tom-thumb, a tiny (4x6) vt font Obtained from: https://robey.lag.net/2010/01/23/tiny-monospace-font.html MFC after: 2 weeks Added: head/share/vt/fonts/tom-thumb.hex (contents, props changed) Modified: head/share/vt/fonts/Makefile Modified: head/share/vt/fonts/Makefile ============================================================================== --- head/share/vt/fonts/Makefile Fri Apr 13 16:50:16 2018 (r332477) +++ head/share/vt/fonts/Makefile Fri Apr 13 16:54:49 2018 (r332478) @@ -2,6 +2,7 @@ FILES= gallant.fnt \ terminus-b32.fnt \ + tom-thumb.fnt \ vgarom-8x8.fnt \ vgarom-8x14.fnt \ vgarom-8x16.fnt \ Added: head/share/vt/fonts/tom-thumb.hex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/tom-thumb.hex Fri Apr 13 16:54:49 2018 (r332478) @@ -0,0 +1,212 @@ +# $FreeBSD$ +# tom-thumb by Brian Swetland and Robey Pointer +# +# To the extent possible under law, the person who associated CC0 with +# tom-thumb has waived all copyright and related or neighboring rights +# to tom-thumb. +# +# You should have received a copy of the CC0 legalcode along with this +# work. If not, see . +# +# Height: 6 +# Width: 4 +0020:000000000000 +0021:404040004000 +0022:A0A000000000 +0023:A0E0A0E0A000 +0024:60C060C04000 +0025:802040802000 +0026:C0C0E0A06000 +0027:404000000000 +0028:408080804000 +0029:804040408000 +002A:00A040A00000 +002B:0040E0400000 +002C:000000408000 +002D:0000E0000000 +002E:000000004000 +002F:202040808000 +0030:60A0A0A0C000 +0031:40C040404000 +0032:C0204080E000 +0033:C0204020C000 +0034:A0A0E0202000 +0035:E080C020C000 +0036:6080E0A0E000 +0037:E02040808000 +0038:E0A0E0A0E000 +0039:E0A0E020C000 +003A:004000400000 +003B:004000408000 +003C:204080402000 +003D:00E000E00000 +003E:804020408000 +003F:E02040004000 +0040:40A0E0806000 +0041:40A0E0A0A000 +0042:C0A0C0A0C000 +0043:608080806000 +0044:C0A0A0A0C000 +0045:E080E080E000 +0046:E080E0808000 +0047:6080E0A06000 +0048:A0A0E0A0A000 +0049:E0404040E000 +004A:202020A04000 +004B:A0A0C0A0A000 +004C:80808080E000 +004D:A0E0E0A0A000 +004E:A0E0E0E0A000 +004F:40A0A0A04000 +0050:C0A0C0808000 +0051:40A0A0E06000 +0052:C0A0E0C0A000 +0053:60804020C000 +0054:E04040404000 +0055:A0A0A0A06000 +0056:A0A0A0404000 +0057:A0A0E0E0A000 +0058:A0A040A0A000 +0059:A0A040404000 +005A:E0204080E000 +005B:E0808080E000 +005C:008040200000 +005D:E0202020E000 +005E:40A000000000 +005F:00000000E000 +0060:804000000000 +0061:00C060A0E000 +0062:80C0A0A0C000 +0063:006080806000 +0064:2060A0A06000 +0065:0060A0C06000 +0066:2040E0404000 +0067:0060A0E02040 +0068:80C0A0A0A000 +0069:400040404000 +006A:20002020A040 +006B:80A0C0C0A000 +006C:C0404040E000 +006D:00E0E0E0A000 +006E:00C0A0A0A000 +006F:0040A0A04000 +0070:00C0A0A0C080 +0071:0060A0A06020 +0072:006080808000 +0073:0060C060C000 +0074:40E040406000 +0075:00A0A0A06000 +0076:00A0A0E04000 +0077:00A0E0E0E000 +0078:00A04040A000 +0079:00A0A0602040 +007A:00E060C0E000 +007B:604080406000 +007C:404000404000 +007D:C0402040C000 +007E:60C000000000 +00A1:800080808000 +00A2:40E080E04000 +00A3:6040E040E000 +00A4:A040E040A000 +00A5:A0A040E04000 +00A6:808000808000 +00A7:6040A040C000 +00A8:A00000000000 +00A9:608060000000 +00AA:60A0E000E000 +00AB:408040000000 +00AC:E02000000000 +00AD:C00000000000 +00AE:C0C0A0000000 +00AF:E00000000000 +00B0:40A040000000 +00B1:40E04000E000 +00B2:C04060000000 +00B3:E060E0000000 +00B4:408000000000 +00B5:A0A0A0C08000 +00B6:60A060606000 +00B7:E0E0E0000000 +00B8:4020C0000000 +00B9:808080000000 +00BA:40A04000E000 +00BB:804080000000 +00BC:808000602000 +00BD:808000C06000 +00BE:C0C000602000 +00BF:40004080E000 +00C0:402040E0A000 +00C1:408040E0A000 +00C2:E00040E0A000 +00C3:60C040E0A000 +00C4:A040A0E0A000 +00C5:C0C0A0E0A000 +00C6:60C0E0C0E000 +00C7:608080602040 +00C8:4020E0C0E000 +00C9:4080E0C0E000 +00CA:E000E0C0E000 +00CB:A000E0C0E000 +00CC:4020E040E000 +00CD:4080E040E000 +00CE:E000E040E000 +00CF:A000E040E000 +00D0:C0A0E0A0C000 +00D1:C060A0E0A000 +00D2:4020E0A0E000 +00D3:4080E0A0E000 +00D4:E000E0A0E000 +00D5:C060E0A0E000 +00D6:A000E0A0E000 +00D7:A040A0000000 +00D8:60A0E0A0C000 +00D9:8040A0A0E000 +00DA:2040A0A0E000 +00DB:E000A0A0E000 +00DC:A000A0A0E000 +00DD:2040A0E04000 +00DE:80E0A0E08000 +00DF:60A0C0A0C080 +00E0:402060A0E000 +00E1:408060A0E000 +00E2:E00060A0E000 +00E3:60C060A0E000 +00E4:A00060A0E000 +00E5:606060A0E000 +00E6:60E0E0C00000 +00E7:608060204000 +00E8:402060E06000 +00E9:408060E06000 +00EA:E00060E06000 +00EB:A00060E06000 +00EC:804080808000 +00ED:408040404000 +00EE:E00040404000 +00EF:A00040404000 +00F0:60C060A06000 +00F1:C060C0A0A000 +00F2:402040A04000 +00F3:408040A04000 +00F4:E00040A04000 +00F5:C06040A04000 +00F6:A00040A04000 +00F7:4000E0004000 +00F8:60E0A0C00000 +00F9:8040A0A06000 +00FA:2040A0A06000 +00FB:E000A0A06000 +00FC:A000A0A06000 +00FD:2040A0602040 +00FE:80C0A0C08000 +00FF:A000A0602040 +0152:60C0E0C06000 +0153:60E0C0E00000 +0160:A060C060C000 +0161:A060C060C000 +0178:A000A0404000 +017D:A0E060C0E000 +017E:A0E060C0E000 +2022:800000000000 +2026:A00000000000 +20AC:60E0E0C06000 From owner-svn-src-all@freebsd.org Fri Apr 13 17:23:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15562F98981; Fri, 13 Apr 2018 17:23:06 +0000 (UTC) (envelope-from tychon@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 BE08375F65; Fri, 13 Apr 2018 17:23:05 +0000 (UTC) (envelope-from tychon@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 B8ECF1CB40; Fri, 13 Apr 2018 17:23:05 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DHN5pG059696; Fri, 13 Apr 2018 17:23:05 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DHN5qi059693; Fri, 13 Apr 2018 17:23:05 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201804131723.w3DHN5qi059693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Fri, 13 Apr 2018 17:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332479 - in head/sys/amd64: include vmm vmm/intel X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head/sys/amd64: include vmm vmm/intel X-SVN-Commit-Revision: 332479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 17:23:06 -0000 Author: tychon Date: Fri Apr 13 17:23:05 2018 New Revision: 332479 URL: https://svnweb.freebsd.org/changeset/base/332479 Log: Add SDT probes to vmexit on Intel. Submitted by: domagoj.stolfa_gmail.com Reviewed by: grehan, tychon Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D14656 Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Fri Apr 13 16:54:49 2018 (r332478) +++ head/sys/amd64/include/vmm.h Fri Apr 13 17:23:05 2018 (r332479) @@ -31,7 +31,12 @@ #ifndef _VMM_H_ #define _VMM_H_ +#include #include + +#ifdef _KERNEL +SDT_PROVIDER_DECLARE(vmm); +#endif enum vm_suspend_how { VM_SUSPEND_NONE, Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Apr 13 16:54:49 2018 (r332478) +++ head/sys/amd64/vmm/intel/vmx.c Fri Apr 13 17:23:05 2018 (r332479) @@ -188,6 +188,82 @@ SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_alloc_failed, &vpid_alloc_failed, 0, NULL); /* + * The definitions of SDT probes for VMX. + */ + +SDT_PROBE_DEFINE3(vmm, vmx, exit, entry, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, taskswitch, + "struct vmx *", "int", "struct vm_exit *", "struct vm_task_switch *"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, craccess, + "struct vmx *", "int", "struct vm_exit *", "uint64_t"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, rdmsr, + "struct vmx *", "int", "struct vm_exit *", "uint32_t"); + +SDT_PROBE_DEFINE5(vmm, vmx, exit, wrmsr, + "struct vmx *", "int", "struct vm_exit *", "uint32_t", "uint64_t"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, halt, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, mtrap, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, pause, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, intrwindow, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, interrupt, + "struct vmx *", "int", "struct vm_exit *", "uint32_t"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, nmiwindow, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, inout, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, cpuid, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE5(vmm, vmx, exit, exception, + "struct vmx *", "int", "struct vm_exit *", "uint32_t", "int"); + +SDT_PROBE_DEFINE5(vmm, vmx, exit, nestedfault, + "struct vmx *", "int", "struct vm_exit *", "uint64_t", "uint64_t"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, mmiofault, + "struct vmx *", "int", "struct vm_exit *", "uint64_t"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, eoi, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, apicaccess, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, apicwrite, + "struct vmx *", "int", "struct vm_exit *", "struct vlapic *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, xsetbv, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, monitor, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, mwait, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, unknown, + "struct vmx *", "int", "struct vm_exit *", "uint32_t"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, return, + "struct vmx *", "int", "struct vm_exit *", "int"); + +/* * Use the last page below 4GB as the APIC access address. This address is * occupied by the boot firmware so it is guaranteed that it will not conflict * with a page in system memory. @@ -2118,6 +2194,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ vmexit->exitcode = VM_EXITCODE_BOGUS; vmm_stat_incr(vmx->vm, vcpu, VMEXIT_COUNT, 1); + SDT_PROBE3(vmm, vmx, exit, entry, vmx, vcpu, vmexit); /* * VM-entry failures during or after loading guest state. @@ -2220,6 +2297,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ } } vmexit->exitcode = VM_EXITCODE_TASK_SWITCH; + SDT_PROBE4(vmm, vmx, exit, taskswitch, vmx, vcpu, vmexit, ts); VCPU_CTR4(vmx->vm, vcpu, "task switch reason %d, tss 0x%04x, " "%s errcode 0x%016lx", ts->reason, ts->tsssel, ts->ext ? "external" : "internal", @@ -2227,6 +2305,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ break; case EXIT_REASON_CR_ACCESS: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_CR_ACCESS, 1); + SDT_PROBE4(vmm, vmx, exit, craccess, vmx, vcpu, vmexit, qual); switch (qual & 0xf) { case 0: handled = vmx_emulate_cr0_access(vmx, vcpu, qual); @@ -2244,6 +2323,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ retu = false; ecx = vmxctx->guest_rcx; VCPU_CTR1(vmx->vm, vcpu, "rdmsr 0x%08x", ecx); + SDT_PROBE4(vmm, vmx, exit, rdmsr, vmx, vcpu, vmexit, ecx); error = emulate_rdmsr(vmx, vcpu, ecx, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_RDMSR; @@ -2264,6 +2344,8 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ edx = vmxctx->guest_rdx; VCPU_CTR2(vmx->vm, vcpu, "wrmsr 0x%08x value 0x%016lx", ecx, (uint64_t)edx << 32 | eax); + SDT_PROBE5(vmm, vmx, exit, wrmsr, vmx, vmexit, vcpu, ecx, + (uint64_t)edx << 32 | eax); error = emulate_wrmsr(vmx, vcpu, ecx, (uint64_t)edx << 32 | eax, &retu); if (error) { @@ -2280,6 +2362,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ break; case EXIT_REASON_HLT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1); + SDT_PROBE3(vmm, vmx, exit, halt, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_HLT; vmexit->u.hlt.rflags = vmcs_read(VMCS_GUEST_RFLAGS); if (virtual_interrupt_delivery) @@ -2290,15 +2373,18 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ break; case EXIT_REASON_MTF: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_MTRAP, 1); + SDT_PROBE3(vmm, vmx, exit, mtrap, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_MTRAP; vmexit->inst_length = 0; break; case EXIT_REASON_PAUSE: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_PAUSE, 1); + SDT_PROBE3(vmm, vmx, exit, pause, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_PAUSE; break; case EXIT_REASON_INTR_WINDOW: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INTR_WINDOW, 1); + SDT_PROBE3(vmm, vmx, exit, intrwindow, vmx, vcpu, vmexit); vmx_clear_int_window_exiting(vmx, vcpu); return (1); case EXIT_REASON_EXT_INTR: @@ -2312,6 +2398,8 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ * this virtual interrupt during the subsequent VM enter. */ intr_info = vmcs_read(VMCS_EXIT_INTR_INFO); + SDT_PROBE4(vmm, vmx, exit, interrupt, + vmx, vcpu, vmexit, intr_info); /* * XXX: Ignore this exit if VMCS_INTR_VALID is not set. @@ -2331,6 +2419,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ vmm_stat_incr(vmx->vm, vcpu, VMEXIT_EXTINT, 1); return (1); case EXIT_REASON_NMI_WINDOW: + SDT_PROBE3(vmm, vmx, exit, nmiwindow, vmx, vcpu, vmexit); /* Exit to allow the pending virtual NMI to be injected */ if (vm_nmi_pending(vmx->vm, vcpu)) vmx_inject_nmi(vmx, vcpu); @@ -2358,9 +2447,11 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ vis->addrsize = inout_str_addrsize(inst_info); inout_str_seginfo(vmx, vcpu, inst_info, in, vis); } + SDT_PROBE3(vmm, vmx, exit, inout, vmx, vcpu, vmexit); break; case EXIT_REASON_CPUID: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_CPUID, 1); + SDT_PROBE3(vmm, vmx, exit, cpuid, vmx, vcpu, vmexit); handled = vmx_handle_cpuid(vmx->vm, vcpu, vmxctx); break; case EXIT_REASON_EXCEPTION: @@ -2425,6 +2516,8 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ } VCPU_CTR2(vmx->vm, vcpu, "Reflecting exception %d/%#x into " "the guest", intr_vec, errcode); + SDT_PROBE5(vmm, vmx, exit, exception, + vmx, vcpu, vmexit, intr_vec, errcode); error = vm_inject_exception(vmx->vm, vcpu, intr_vec, errcode_valid, errcode, 0); KASSERT(error == 0, ("%s: vm_inject_exception error %d", @@ -2445,9 +2538,13 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ vmexit->u.paging.gpa = gpa; vmexit->u.paging.fault_type = ept_fault_type(qual); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NESTED_FAULT, 1); + SDT_PROBE5(vmm, vmx, exit, nestedfault, + vmx, vcpu, vmexit, gpa, qual); } else if (ept_emulation_fault(qual)) { vmexit_inst_emul(vmexit, gpa, vmcs_gla()); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INST_EMUL, 1); + SDT_PROBE4(vmm, vmx, exit, mmiofault, + vmx, vcpu, vmexit, gpa); } /* * If Virtual NMIs control is 1 and the VM-exit is due to an @@ -2464,9 +2561,11 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ case EXIT_REASON_VIRTUALIZED_EOI: vmexit->exitcode = VM_EXITCODE_IOAPIC_EOI; vmexit->u.ioapic_eoi.vector = qual & 0xFF; + SDT_PROBE3(vmm, vmx, exit, eoi, vmx, vcpu, vmexit); vmexit->inst_length = 0; /* trap-like */ break; case EXIT_REASON_APIC_ACCESS: + SDT_PROBE3(vmm, vmx, exit, apicaccess, vmx, vcpu, vmexit); handled = vmx_handle_apic_access(vmx, vcpu, vmexit); break; case EXIT_REASON_APIC_WRITE: @@ -2476,18 +2575,25 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ */ vmexit->inst_length = 0; vlapic = vm_lapic(vmx->vm, vcpu); + SDT_PROBE4(vmm, vmx, exit, apicwrite, + vmx, vcpu, vmexit, vlapic); handled = vmx_handle_apic_write(vmx, vcpu, vlapic, qual); break; case EXIT_REASON_XSETBV: + SDT_PROBE3(vmm, vmx, exit, xsetbv, vmx, vcpu, vmexit); handled = vmx_emulate_xsetbv(vmx, vcpu, vmexit); break; case EXIT_REASON_MONITOR: + SDT_PROBE3(vmm, vmx, exit, monitor, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_MONITOR; break; case EXIT_REASON_MWAIT: + SDT_PROBE3(vmm, vmx, exit, mwait, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_MWAIT; break; default: + SDT_PROBE4(vmm, vmx, exit, unknown, + vmx, vcpu, vmexit, reason); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_UNKNOWN, 1); break; } @@ -2523,6 +2629,9 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ */ } } + + SDT_PROBE4(vmm, vmx, exit, return, + vmx, vcpu, vmexit, handled); return (handled); } Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Fri Apr 13 16:54:49 2018 (r332478) +++ head/sys/amd64/vmm/vmm.c Fri Apr 13 17:23:05 2018 (r332479) @@ -208,6 +208,8 @@ static struct vmm_ops *ops; #define fpu_start_emulating() load_cr0(rcr0() | CR0_TS) #define fpu_stop_emulating() clts() +SDT_PROVIDER_DEFINE(vmm); + static MALLOC_DEFINE(M_VM, "vm", "vm"); /* statistics */ From owner-svn-src-all@freebsd.org Fri Apr 13 17:31:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6420F9913B for ; Fri, 13 Apr 2018 17:31:14 +0000 (UTC) (envelope-from shurd@llnw.com) Received: from mail-lf0-x234.google.com (mail-lf0-x234.google.com [IPv6:2a00:1450:4010:c07::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A87E77A62 for ; Fri, 13 Apr 2018 17:31:14 +0000 (UTC) (envelope-from shurd@llnw.com) Received: by mail-lf0-x234.google.com with SMTP id m14-v6so1665000lfc.0 for ; Fri, 13 Apr 2018 10:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=llnw.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=75yGyqpLDd5ulEq7wTi62uV6uOCZ4Vdj8lRwptVnnQ8=; b=FrLUdvZXCNfwok1hXtltXPI29IMNdt38AUmI6XMmLrVcyT0+S64xMg79r/m0DqOzlU E+ANZb2p29jwW2Dxi/9QuIxEDl2mADioHSNZCoBGU8s1bqNzJmLlrehBxmc7A5hgzeHZ mQh0CRzIYxzLVmi4GEfXWHsrSYeZF+onFhuHtXT7JCkvaJrXp37uWtz+pVgDniqqDtV5 ENC4ujSpQn9iTAvT/EnkDdvMV4vNoUaj3tbhyY66prqjFen8SERDc5XGBz/GweECDt/2 1E0jKu91UB4QENV+QbEPegsVbhZNXGqrxjFdzh9DppfSiijUUtEPBWoVYzcOzgaJfrEm YjPA== 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=75yGyqpLDd5ulEq7wTi62uV6uOCZ4Vdj8lRwptVnnQ8=; b=AOXnwb7vmj75iBibdEjZwUO9I2gICeUhJ3WnHXoKNwyi8pV9/uZ08Sxwzqv/O/+y9o H3CjqbYfg8MR5/QoCjsas+wNNI8vE8GjrE68UFLTxbTMZhxDTs1DoaU5wTcALAjMqggH dCpmWWBNcxLBjG9xMxP/I16xUcezOxWmpor/t0BBK6Tw6wZC2UIja6P+09fzrMVcENjH IvASKhdPmfY8eX9ShrPAyi3ZBrca34n2ow0424cVkEOi7NnS/ZukfHh/RGhRssAGq8Nf nLs5MUbTZzeGYJqcPqyBvgRpysE9DyoWhoXQ9V7P0IfPos4VOyhjixpQKjdDPi27ap3G ddGg== X-Gm-Message-State: ALQs6tDhp7P6OAdCcGT4FD/dznZgN5OLV4XduAySoPH34fxrPCZx3oTw 4RPj1Zbq0ngVfvHofRNS4Pz4ncODzRw24/fqG0mg5w== X-Google-Smtp-Source: AIpwx4+luufNHF9BKEKkO9AjiDo2Pu/sJUo/xvWyXpCf5td9V08OywhckyKxqrLHNtV+owWlqixYX9h6j3xQ4z7ITx4= X-Received: by 2002:a19:a60a:: with SMTP id p10-v6mr9139646lfe.41.1523640671913; Fri, 13 Apr 2018 10:31:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.134.140 with HTTP; Fri, 13 Apr 2018 10:31:11 -0700 (PDT) In-Reply-To: References: <201804121906.w3CJ6FZo092138@repo.freebsd.org> From: Stephen Hurd Date: Fri, 13 Apr 2018 13:31:11 -0400 Message-ID: Subject: Re: svn commit: r332447 - stable/11/sys/dev/ixgbe To: Ryan Stone Cc: Stephen Hurd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 17:31:15 -0000 Yeah, I'm looking at the changes that caused this now. Hopefully I'll have this updated today. On Thu, Apr 12, 2018 at 4:01 PM, Ryan Stone wrote: > Spinning in the kernel for a full second is a really bad idea. At > minimum this is going to hold off all callouts from one of the callout > threads for up to a full second as ixgbe_local_timer() waits for the > core mutex. That chews up two CPU cores doing busy-wait loops (the > ixgbe_stop() thread busy-waits in msec_delay and the callout thread > adaptively spins waiting for the mutex). If any other thread tries to > acquire the core lock they also adaptively spin on the mutex chewing > up yet more cores. This includes any threads trying to fetch > interface status (e.g. ifconfig), various interrupt handlers, etc. > -- [image: Limelight Networks] Stephen Hurd* Principal Engineer* EXPERIENCE FIRST. +1 616 848 0643 <+1+616+848+0643> www.limelight.com [image: Facebook] [image: LinkedIn] [image: Twitter] From owner-svn-src-all@freebsd.org Fri Apr 13 17:36:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F01E9F9976A; Fri, 13 Apr 2018 17:36:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8992079D72; Fri, 13 Apr 2018 17:36:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 7234610AFD2; Fri, 13 Apr 2018 13:36:45 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332454 - in head/sys: amd64/amd64 amd64/ia32 amd64/linux amd64/linux32 i386/i386 Date: Fri, 13 Apr 2018 10:30:39 -0700 Message-ID: <6635699.GyEHu4i8EZ@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201804122043.w3CKhdFF041945@repo.freebsd.org> References: <201804122043.w3CKhdFF041945@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 13 Apr 2018 13:36:45 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 17:36:47 -0000 On Thursday, April 12, 2018 08:43:39 PM Konstantin Belousov wrote: > Author: kib > Date: Thu Apr 12 20:43:39 2018 > New Revision: 332454 > URL: https://svnweb.freebsd.org/changeset/base/332454 > > Log: > Fix PSL_T inheritance on exec for x86. > > The miscellaneous x86 sysent->sv_setregs() implementations tried to > migrate PSL_T from the previous program to the new executed one, but > they evaluated regs->tf_eflags after the whole regs structure was > bzeroed. Make this functional by saving PSL_T value before zeroing. > > Note that if the debugger is not attached, executing the first > instruction in the new program with PSL_T set results in SIGTRAP, and > since all intercepted signals are reset to default dispostion on > exec(2), this means that non-debugged process gets killed immediately > if PSL_T is inherited. In particular, since suid images drop > P_TRACED, attempt to set PSL_T for execution of such program would > kill the process. > > Another issue with userspace PSL_T handling is that it is reset by > trap(). It is reasonable to clear PSL_T when entering SIGTRAP > handler, to allow the signal to be handled without recursion or > delivery of blocked fault. But it is not reasonable to return back to > the normal flow with PSL_T cleared. This is too late to change, I > think. Hmm, I had wanted to write an explicit test for this in ptrace_test.c so that we could ensure other architectures that support hardware stepping (like aarch64) use matching semantics. It wasn't clear to me if clearing PSL_T on exec() isn't actually more correct. Exec will report a PL_FLAG_EXEC ptrace stop and the debugger can PT_STEP from that stop if it wants to continue stepping post-exec. The trap() case is indeed interesting, but I think the concern you raise is largely mitigated by having the debugger simple re-enable stepping after resuming from the event reported from trapsignal(). OTOH, we explicitly clear PSL_T in sendsig() so that signal handlers don't step. I feel like we probably should not do this for traced processes as this fix single stepping in a debugger to properly report a step for the start of a signal handler. FWIW, Linux single steps into signal handlers instead of over them as we currently do. (I have even some thoughts on how to fix stepping for architectures like MIPS that do software stepping by letting the debugger enable a "report a step for first signal instruction" mode while it is stepping a thread and then reporting an explicit SIGTRAP ptracestop() during sendsig.) -- John Baldwin From owner-svn-src-all@freebsd.org Fri Apr 13 17:37:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F33BF998AD; Fri, 13 Apr 2018 17:37: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 B242179EEF; Fri, 13 Apr 2018 17:37: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 AC5F71CD1D; Fri, 13 Apr 2018 17:37: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 w3DHbdNj064572; Fri, 13 Apr 2018 17:37:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DHbdNZ064571; Fri, 13 Apr 2018 17:37:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804131737.w3DHbdNZ064571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Apr 2018 17:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332480 - head/share/vt/fonts X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/vt/fonts X-SVN-Commit-Revision: 332480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 17:37:40 -0000 Author: emaste Date: Fri Apr 13 17:37:39 2018 New Revision: 332480 URL: https://svnweb.freebsd.org/changeset/base/332480 Log: Correct tom-thumb vt font glyphs A few glyphs were converted incorrectly: U+00A6 broken bar - center U+2022 bullet - center U+2026 horizontal ellipsis - move to bottom of character cell Modified: head/share/vt/fonts/tom-thumb.hex Modified: head/share/vt/fonts/tom-thumb.hex ============================================================================== --- head/share/vt/fonts/tom-thumb.hex Fri Apr 13 17:23:05 2018 (r332479) +++ head/share/vt/fonts/tom-thumb.hex Fri Apr 13 17:37:39 2018 (r332480) @@ -110,7 +110,7 @@ 00A3:6040E040E000 00A4:A040E040A000 00A5:A0A040E04000 -00A6:808000808000 +00A6:404000404000 00A7:6040A040C000 00A8:A00000000000 00A9:608060000000 @@ -207,6 +207,6 @@ 0178:A000A0404000 017D:A0E060C0E000 017E:A0E060C0E000 -2022:800000000000 -2026:A00000000000 +2022:000040000000 +2026:00000000A000 20AC:60E0E0C06000 From owner-svn-src-all@freebsd.org Fri Apr 13 17:45:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE05FF9A14B; Fri, 13 Apr 2018 17:45:05 +0000 (UTC) (envelope-from kib@freebsd.org) 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 4B1947A48A; Fri, 13 Apr 2018 17:45:05 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w3DHimxw058714 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 13 Apr 2018 20:44:51 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w3DHimxw058714 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w3DHimj3058713; Fri, 13 Apr 2018 20:44:48 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Fri, 13 Apr 2018 20:44:48 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332454 - in head/sys: amd64/amd64 amd64/ia32 amd64/linux amd64/linux32 i386/i386 Message-ID: <20180413174448.GA1774@kib.kiev.ua> References: <201804122043.w3CKhdFF041945@repo.freebsd.org> <6635699.GyEHu4i8EZ@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6635699.GyEHu4i8EZ@ralph.baldwin.cx> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 17:45:06 -0000 On Fri, Apr 13, 2018 at 10:30:39AM -0700, John Baldwin wrote: > On Thursday, April 12, 2018 08:43:39 PM Konstantin Belousov wrote: > > Author: kib > > Date: Thu Apr 12 20:43:39 2018 > > New Revision: 332454 > > URL: https://svnweb.freebsd.org/changeset/base/332454 > > > > Log: > > Fix PSL_T inheritance on exec for x86. > > > > The miscellaneous x86 sysent->sv_setregs() implementations tried to > > migrate PSL_T from the previous program to the new executed one, but > > they evaluated regs->tf_eflags after the whole regs structure was > > bzeroed. Make this functional by saving PSL_T value before zeroing. > > > > Note that if the debugger is not attached, executing the first > > instruction in the new program with PSL_T set results in SIGTRAP, and > > since all intercepted signals are reset to default dispostion on > > exec(2), this means that non-debugged process gets killed immediately > > if PSL_T is inherited. In particular, since suid images drop > > P_TRACED, attempt to set PSL_T for execution of such program would > > kill the process. > > > > Another issue with userspace PSL_T handling is that it is reset by > > trap(). It is reasonable to clear PSL_T when entering SIGTRAP > > handler, to allow the signal to be handled without recursion or > > delivery of blocked fault. But it is not reasonable to return back to > > the normal flow with PSL_T cleared. This is too late to change, I > > think. > > Hmm, I had wanted to write an explicit test for this in ptrace_test.c so that > we could ensure other architectures that support hardware stepping (like > aarch64) use matching semantics. It wasn't clear to me if clearing PSL_T on > exec() isn't actually more correct. Exec will report a PL_FLAG_EXEC ptrace > stop and the debugger can PT_STEP from that stop if it wants to continue > stepping post-exec. > > The trap() case is indeed interesting, but I think the concern you raise is > largely mitigated by having the debugger simple re-enable stepping after > resuming from the event reported from trapsignal(). OTOH, we explicitly > clear PSL_T in sendsig() so that signal handlers don't step. I feel like we > probably should not do this for traced processes as this fix single stepping > in a debugger to properly report a step for the start of a signal handler. > FWIW, Linux single steps into signal handlers instead of over them as we > currently do. (I have even some thoughts on how to fix stepping for > architectures like MIPS that do software stepping by letting the debugger > enable a "report a step for first signal instruction" mode while it is > stepping a thread and then reporting an explicit SIGTRAP ptracestop() > during sendsig.) There is https://reviews.freebsd.org/D15054 where I added you as reviewer. If you consider it the right thing to do, I can easily add a quirk to stop clearing PSL_T in sendsig()s. From owner-svn-src-all@freebsd.org Fri Apr 13 17:45:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC5B5F9A2C5; Fri, 13 Apr 2018 17:45:54 +0000 (UTC) (envelope-from shurd@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 A1A607AAB6; Fri, 13 Apr 2018 17:45:54 +0000 (UTC) (envelope-from shurd@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 96A401CEAB; Fri, 13 Apr 2018 17:45:54 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DHjsBG069351; Fri, 13 Apr 2018 17:45:54 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DHjsTR069349; Fri, 13 Apr 2018 17:45:54 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201804131745.w3DHjsTR069349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Fri, 13 Apr 2018 17:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332481 - stable/11/sys/dev/ixgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/11/sys/dev/ixgbe X-SVN-Commit-Revision: 332481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 17:45:55 -0000 Author: shurd Date: Fri Apr 13 17:45:54 2018 New Revision: 332481 URL: https://svnweb.freebsd.org/changeset/base/332481 Log: Move 1-second spin into ixgbe_netmap_reg() This should still work around the netmap issue, but should not impact other calls to ixgbe_stop(). PR: 221317 Sponsored by: Limelight Networks Modified: stable/11/sys/dev/ixgbe/if_ix.c stable/11/sys/dev/ixgbe/ixgbe_netmap.c Modified: stable/11/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_ix.c Fri Apr 13 17:37:39 2018 (r332480) +++ stable/11/sys/dev/ixgbe/if_ix.c Fri Apr 13 17:45:54 2018 (r332481) @@ -3567,8 +3567,6 @@ ixgbe_stop(void *arg) mtx_assert(&adapter->core_mtx, MA_OWNED); - msec_delay(1000); - INIT_DEBUGOUT("ixgbe_stop: begin\n"); ixgbe_disable_intr(adapter); callout_stop(&adapter->timer); Modified: stable/11/sys/dev/ixgbe/ixgbe_netmap.c ============================================================================== --- stable/11/sys/dev/ixgbe/ixgbe_netmap.c Fri Apr 13 17:37:39 2018 (r332480) +++ stable/11/sys/dev/ixgbe/ixgbe_netmap.c Fri Apr 13 17:45:54 2018 (r332481) @@ -151,6 +151,7 @@ ixgbe_netmap_reg(struct netmap_adapter *na, int onoff) struct adapter *adapter = ifp->if_softc; IXGBE_CORE_LOCK(adapter); + msec_delay(1000); adapter->stop_locked(adapter); set_crcstrip(&adapter->hw, onoff); From owner-svn-src-all@freebsd.org Fri Apr 13 17:57:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68DDFF9B1AD; Fri, 13 Apr 2018 17:57:01 +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 1A39B7D524; Fri, 13 Apr 2018 17:57:01 +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 151051D089; Fri, 13 Apr 2018 17:57:01 +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 w3DHv0DU074549; Fri, 13 Apr 2018 17:57:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DHv0Fs074545; Fri, 13 Apr 2018 17:57:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804131757.w3DHv0Fs074545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Apr 2018 17:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332482 - in stable/11/usr.bin: head tail X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/usr.bin: head tail X-SVN-Commit-Revision: 332482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 17:57:01 -0000 Author: kevans Date: Fri Apr 13 17:57:00 2018 New Revision: 332482 URL: https://svnweb.freebsd.org/changeset/base/332482 Log: MFC r332372-r332374: tail(1)/head(1) compatibility long options r332372: tail(1): Add some long options Add --blocks, --bytes, and --lines long options for -b, -c, and -n respectively. This improves tail(1)'s compatibility with its GNU counterpart in a straightforward way. r332373: tail(1): Address mandoc concern (space before punctuation after macro) r332374: head(1): Provide long options Provide long options --bytes and --lines to match -c and -n respectively. This improves head(1)'s compatibility with its GNU counterpart in a sensible way. Modified: stable/11/usr.bin/head/head.1 stable/11/usr.bin/head/head.c stable/11/usr.bin/tail/tail.1 stable/11/usr.bin/tail/tail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/head/head.1 ============================================================================== --- stable/11/usr.bin/head/head.1 Fri Apr 13 17:45:54 2018 (r332481) +++ stable/11/usr.bin/head/head.1 Fri Apr 13 17:57:00 2018 (r332482) @@ -28,7 +28,7 @@ .\" @(#)head.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 16, 2013 +.Dd April 10, 2018 .Dt HEAD 1 .Os .Sh NAME @@ -48,6 +48,18 @@ files are specified. If .Ar count is omitted it defaults to 10. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl c Ar bytes , Fl -bytes Ns = Ns Ar bytes +Print +.Ar bytes +of each of the specified files. +.It Fl n Ar count , Fl -lines Ns = Ns Ar count +Print +.Ar count +lines of each of the specified files. +.El .Pp If more than a single file is specified, each file is preceded by a header consisting of the string Modified: stable/11/usr.bin/head/head.c ============================================================================== --- stable/11/usr.bin/head/head.c Fri Apr 13 17:45:54 2018 (r332481) +++ stable/11/usr.bin/head/head.c Fri Apr 13 17:57:00 2018 (r332482) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -62,6 +63,13 @@ static void head_bytes(FILE *, off_t); static void obsolete(char *[]); static void usage(void); +static const struct option long_opts[] = +{ + {"bytes", required_argument, NULL, 'c'}, + {"lines", required_argument, NULL, 'n'}, + {NULL, no_argument, NULL, 0} +}; + int main(int argc, char *argv[]) { @@ -72,7 +80,7 @@ main(int argc, char *argv[]) char *ep; obsolete(argv); - while ((ch = getopt(argc, argv, "n:c:")) != -1) + while ((ch = getopt_long(argc, argv, "+n:c:", long_opts, NULL)) != -1) switch(ch) { case 'c': bytecnt = strtoimax(optarg, &ep, 10); Modified: stable/11/usr.bin/tail/tail.1 ============================================================================== --- stable/11/usr.bin/tail/tail.1 Fri Apr 13 17:45:54 2018 (r332481) +++ stable/11/usr.bin/tail/tail.1 Fri Apr 13 17:57:00 2018 (r332482) @@ -31,7 +31,7 @@ .\" @(#)tail.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 16, 2013 +.Dd April 10, 2018 .Dt TAIL 1 .Os .Sh NAME @@ -73,11 +73,11 @@ or the last 10 lines of the input. .Pp The options are as follows: .Bl -tag -width indent -.It Fl b Ar number +.It Fl b Ar number , Fl -blocks Ns = Ns Ar number The location is .Ar number 512-byte blocks. -.It Fl c Ar number +.It Fl c Ar number , Fl -bytes Ns = Ns Ar number The location is .Ar number bytes. @@ -112,7 +112,7 @@ The option is the same as the .Fl f option if reading from standard input rather than a file. -.It Fl n Ar number +.It Fl n Ar number , Fl -lines Ns = Ns Ar number The location is .Ar number lines. Modified: stable/11/usr.bin/tail/tail.c ============================================================================== --- stable/11/usr.bin/tail/tail.c Fri Apr 13 17:45:54 2018 (r332481) +++ stable/11/usr.bin/tail/tail.c Fri Apr 13 17:57:00 2018 (r332482) @@ -49,6 +49,7 @@ static const char sccsid[] = "@(#)tail.c 8.1 (Berkeley #include #include +#include #include #include #include @@ -63,6 +64,14 @@ static file_info_t *files; static void obsolete(char **); static void usage(void); +static const struct option long_opts[] = +{ + {"blocks", required_argument, NULL, 'b'}, + {"bytes", required_argument, NULL, 'c'}, + {"lines", required_argument, NULL, 'n'}, + {NULL, no_argument, NULL, 0} +}; + int main(int argc, char *argv[]) { @@ -111,7 +120,8 @@ main(int argc, char *argv[]) obsolete(argv); style = NOTSET; off = 0; - while ((ch = getopt(argc, argv, "Fb:c:fn:qr")) != -1) + while ((ch = getopt_long(argc, argv, "+Fb:c:fn:qr", long_opts, NULL)) != + -1) switch(ch) { case 'F': /* -F is superset of (and implies) -f */ Fflag = fflag = 1; From owner-svn-src-all@freebsd.org Fri Apr 13 18:04:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37D4DF9BB96; Fri, 13 Apr 2018 18:04:52 +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 E211B80064; Fri, 13 Apr 2018 18:04:51 +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 DD08C1D21E; Fri, 13 Apr 2018 18:04:51 +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 w3DI4pjL079428; Fri, 13 Apr 2018 18:04:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DI4pd6079424; Fri, 13 Apr 2018 18:04:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804131804.w3DI4pd6079424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 13 Apr 2018 18:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332483 - head/usr.bin/dtc X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/dtc X-SVN-Commit-Revision: 332483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 18:04:52 -0000 Author: kevans Date: Fri Apr 13 18:04:51 2018 New Revision: 332483 URL: https://svnweb.freebsd.org/changeset/base/332483 Log: dtc(1): Update to upstream 006664a Highlights: - Passing "-" to -o will now cause output to go to stdout - Path-based syntactic sugar for overlays is now accepted. This looks like: /dts-v1/; /plugin/; &{/soc} { sid: eeprom@1c14000 { compatible = "allwinner,sun8i-h3-sid"; reg = <0x1c14000 0x400>; status = "okay"; }; }; MFC after: 3 days Modified: head/usr.bin/dtc/dtc.1 head/usr.bin/dtc/dtc.cc head/usr.bin/dtc/fdt.cc head/usr.bin/dtc/fdt.hh Modified: head/usr.bin/dtc/dtc.1 ============================================================================== --- head/usr.bin/dtc/dtc.1 Fri Apr 13 17:57:00 2018 (r332482) +++ head/usr.bin/dtc/dtc.1 Fri Apr 13 18:04:51 2018 (r332483) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd January 17, 2018 +.Dd April 7, 2018 .Dt DTC 1 .Os .Sh NAME @@ -275,7 +275,7 @@ tree when the overlay is applied. .Pp Much simpler syntactic sugar was later invented to simplify generating overlays. Instead of creating targetted fragments manually, one can instead create a root -node that targets a label in the base node using the +node that targets a label in the base FDT using the .Va &label syntax supported in conventional DTS. This will indicate that a fragment should be generated for the node, with the @@ -283,6 +283,19 @@ given .Va label being the target, and the properties and child nodes will be used as the __overlay__. +.Pp +Additionally, a path-based version of this syntactic sugar is supported. +A root node may target a path in the base FDT using a name of the form +.Va &{/path} . +A fragment will be generated for the node as it is in the +.Va &label +case, except the +.Va target-path +property will be set to +.Va /path +and no +.Va target +will be set. .Pp Both conventional overlays and the later-added syntactic sugar are supported. .Pp Modified: head/usr.bin/dtc/dtc.cc ============================================================================== --- head/usr.bin/dtc/dtc.cc Fri Apr 13 17:57:00 2018 (r332482) +++ head/usr.bin/dtc/dtc.cc Fri Apr 13 18:04:51 2018 (r332483) @@ -171,11 +171,14 @@ main(int argc, char **argv) case 'o': { outfile_name = optarg; - outfile = open(optarg, O_CREAT | O_TRUNC | O_WRONLY, 0666); - if (outfile == -1) + if (strcmp(outfile_name, "-") != 0) { - perror("Unable to open output file"); - return EXIT_FAILURE; + outfile = open(optarg, O_CREAT | O_TRUNC | O_WRONLY, 0666); + if (outfile == -1) + { + perror("Unable to open output file"); + return EXIT_FAILURE; + } } break; } Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Fri Apr 13 17:57:00 2018 (r332482) +++ head/usr.bin/dtc/fdt.cc Fri Apr 13 18:04:51 2018 (r332483) @@ -727,14 +727,32 @@ node::parse_name(text_input_buffer &input, bool &is_pr return n; } -void -node::visit(std::function fn) +node::visit_behavior +node::visit(std::function fn, node *parent) { - fn(*this); - for (auto &&c : children) + visit_behavior behavior; + behavior = fn(*this, parent); + if (behavior == VISIT_BREAK) { - c->visit(fn); + return VISIT_BREAK; } + else if (behavior != VISIT_CONTINUE) + { + for (auto &&c : children) + { + behavior = c->visit(fn, this); + // Any status other than VISIT_RECURSE stops our execution and + // bubbles up to our caller. The caller may then either continue + // visiting nodes that are siblings to this one or completely halt + // visiting. + if (behavior != VISIT_RECURSE) + { + return behavior; + } + } + } + // Continue recursion by default + return VISIT_RECURSE; } node::node(input_buffer &structs, input_buffer &strings) : valid(true) @@ -1319,7 +1337,7 @@ device_tree::resolve_cross_references(uint32_t &phandl phandle_set.insert({&i.val, i}); } std::vector> sorted_phandles; - root->visit([&](node &n) { + root->visit([&](node &n, node *parent) { for (auto &p : n.properties()) { for (auto &v : *p) @@ -1331,7 +1349,9 @@ device_tree::resolve_cross_references(uint32_t &phandl } } } - }); + // Allow recursion + return node::VISIT_RECURSE; + }, nullptr); assert(sorted_phandles.size() == fixups.size()); for (auto &i : sorted_phandles) @@ -1471,9 +1491,24 @@ device_tree::parse_file(text_input_buffer &input, else if (input.consume('&')) { input.next_token(); - string name = input.parse_node_name(); + string name; + bool name_is_path_reference = false; + // This is to deal with names intended as path references, e.g. &{/path}. + // While it may make sense in a non-plugin context, we don't support such + // usage at this time. + if (input.consume('{') && is_plugin) + { + name = input.parse_to('}'); + input.consume('}'); + name_is_path_reference = true; + } + else + { + name = input.parse_node_name(); + } input.next_token(); n = node::parse(input, std::move(name), string_set(), string(), &defines); + n->name_is_path_reference = name_is_path_reference; } else { @@ -1702,11 +1737,21 @@ device_tree::create_fragment_wrapper(node_ptr &node, i node_ptr newroot = node::create_special_node("", symbols); node_ptr wrapper = node::create_special_node("__overlay__", symbols); - // Generate the fragment with target = <&name> + // Generate the fragment with $propname = <&name> property_value v; + std::string propname; v.string_data = node->name; - v.type = property_value::PHANDLE; - auto prop = std::make_shared(std::string("target")); + if (!node->name_is_path_reference) + { + propname = "target"; + v.type = property_value::PHANDLE; + } + else + { + propname = "target-path"; + v.type = property_value::STRING; + } + auto prop = std::make_shared(std::string(propname)); prop->add_value(v); symbols.push_back(prop); Modified: head/usr.bin/dtc/fdt.hh ============================================================================== --- head/usr.bin/dtc/fdt.hh Fri Apr 13 17:57:00 2018 (r332482) +++ head/usr.bin/dtc/fdt.hh Fri Apr 13 18:04:51 2018 (r332483) @@ -409,6 +409,10 @@ class node */ std::string name; /** + * The name of the node is a path reference. + */ + bool name_is_path_reference = false; + /** * The unit address of the node, which is optionally written after the * name followed by an at symbol. */ @@ -421,6 +425,25 @@ class node * Iterator type for child nodes. */ typedef std::vector::iterator child_iterator; + /** + * Recursion behavior to be observed for visiting + */ + enum visit_behavior + { + /** + * Recurse as normal through the rest of the tree. + */ + VISIT_RECURSE, + /** + * Continue recursing through the device tree, but do not + * recurse through this branch of the tree any further. + */ + VISIT_CONTINUE, + /** + * Immediately halt the visit. No further nodes will be visited. + */ + VISIT_BREAK + }; private: /** * Adaptor to use children in range-based for loops. @@ -635,9 +658,13 @@ class node */ void write_dts(FILE *file, int indent); /** - * Recursively visit this node and then its children. + * Recursively visit this node and then its children based on the + * callable's return value. The callable may return VISIT_BREAK + * immediately halt all recursion and end the visit, VISIT_CONTINUE to + * not recurse into the current node's children, or VISIT_RECURSE to recurse + * through children as expected. parent will be passed to the callable. */ - void visit(std::function); + visit_behavior visit(std::function, node *parent); }; /** From owner-svn-src-all@freebsd.org Fri Apr 13 18:25:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F38AF9CFF2; Fri, 13 Apr 2018 18:25:01 +0000 (UTC) (envelope-from bapt@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 E8E9883554; Fri, 13 Apr 2018 18:25:00 +0000 (UTC) (envelope-from bapt@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 DB49A1D55A; Fri, 13 Apr 2018 18:25:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DIP01o089010; Fri, 13 Apr 2018 18:25:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DIP07v089009; Fri, 13 Apr 2018 18:25:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201804131825.w3DIP07v089009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 13 Apr 2018 18:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332484 - head/usr.sbin/pkg X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/pkg X-SVN-Commit-Revision: 332484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 18:25:01 -0000 Author: bapt Date: Fri Apr 13 18:25:00 2018 New Revision: 332484 URL: https://svnweb.freebsd.org/changeset/base/332484 Log: pkg: accept -y and --yes from arguments By popular demand, pkg now walks thought the arguments passed and if it finds -y or --yes it does accept those as equivalent of ASSUME_ALWAYS_YES env var. Requested by: many MFC after: 1 week Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Fri Apr 13 18:04:51 2018 (r332483) +++ head/usr.sbin/pkg/pkg.c Fri Apr 13 18:25:00 2018 (r332484) @@ -1032,6 +1032,7 @@ main(int argc, char *argv[]) { char pkgpath[MAXPATHLEN]; const char *pkgarg; + int i; bool bootstrap_only, force, yes; bootstrap_only = false; @@ -1083,6 +1084,15 @@ main(int argc, char *argv[]) * tucked in there already. */ config_bool(ASSUME_ALWAYS_YES, &yes); + if (!yes) { + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-y") == 0 || + strcmp(argv[i], "--yes") == 0) { + yes = true; + break; + } + } + } if (!yes) { if (!isatty(fileno(stdin))) { fprintf(stderr, non_interactive_message); From owner-svn-src-all@freebsd.org Fri Apr 13 19:15:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF7CCFA0569; Fri, 13 Apr 2018 19:15:32 +0000 (UTC) (envelope-from ian@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 5FF0B6ED7B; Fri, 13 Apr 2018 19:15:32 +0000 (UTC) (envelope-from ian@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 55E8D1DD64; Fri, 13 Apr 2018 19:15:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DJFWm6013998; Fri, 13 Apr 2018 19:15:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DJFWDb013997; Fri, 13 Apr 2018 19:15:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804131915.w3DJFWDb013997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 13 Apr 2018 19:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332485 - stable/11/gnu/usr.bin X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/11/gnu/usr.bin X-SVN-Commit-Revision: 332485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 19:15:32 -0000 Author: ian Date: Fri Apr 13 19:15:31 2018 New Revision: 332485 URL: https://svnweb.freebsd.org/changeset/base/332485 Log: Remove .info debugging output that accidentally got left in for MFC commit. This was just an artifact of my testing to ensure the option had the desired effect on freebsd 11, both when enabled and when disabled. Reported by: Thomas Mueller Point hat: ian@ Modified: stable/11/gnu/usr.bin/Makefile Modified: stable/11/gnu/usr.bin/Makefile ============================================================================== --- stable/11/gnu/usr.bin/Makefile Fri Apr 13 18:25:00 2018 (r332484) +++ stable/11/gnu/usr.bin/Makefile Fri Apr 13 19:15:31 2018 (r332485) @@ -22,8 +22,6 @@ SUBDIR.${MK_GPL_DTC}+= dtc SUBDIR.${MK_RCS}+= rcs SUBDIR.${MK_TESTS}+= tests -.info MK_GNU_DIFF=${MK_GNU_DIFF} - SUBDIR_PARALLEL= .include From owner-svn-src-all@freebsd.org Fri Apr 13 19:23:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3C8CFA105B; Fri, 13 Apr 2018 19:23:01 +0000 (UTC) (envelope-from kp@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 7EECC719BA; Fri, 13 Apr 2018 19:23:01 +0000 (UTC) (envelope-from kp@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 79E0B1DF02; Fri, 13 Apr 2018 19:23:01 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DJN15a018896; Fri, 13 Apr 2018 19:23:01 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DJN1WL018895; Fri, 13 Apr 2018 19:23:01 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804131923.w3DJN1WL018895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 19:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332486 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 332486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 19:23:02 -0000 Author: kp Date: Fri Apr 13 19:23:01 2018 New Revision: 332486 URL: https://svnweb.freebsd.org/changeset/base/332486 Log: MFC r332101: pf: Improve ioctl validation for DIOCRADDTABLES and DIOCRDELTABLES The DIOCRADDTABLES and DIOCRDELTABLES ioctls can process a number of tables at a time, and as such try to allocate * sizeof(struct pfr_table). This multiplication can overflow. Thanks to mallocarray() this is not exploitable, but an overflow does panic the system. Arbitrarily limit this to 65535 tables. pfctl only ever processes one table at a time, so it presents no issues there. Modified: stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 19:15:31 2018 (r332485) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 19:23:01 2018 (r332486) @@ -87,6 +87,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#define PF_TABLES_MAX_REQUEST 65535 /* Maximum tables per request. */ + static struct pf_pool *pf_get_pool(char *, u_int32_t, u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t); @@ -2523,13 +2525,15 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + + if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { error = ENOMEM; break; } + + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); @@ -2552,13 +2556,15 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + + if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { error = ENOMEM; break; } + + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); From owner-svn-src-all@freebsd.org Fri Apr 13 19:23:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D822FA10AD; Fri, 13 Apr 2018 19:23:10 +0000 (UTC) (envelope-from kp@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 1C41971A47; Fri, 13 Apr 2018 19:23:06 +0000 (UTC) (envelope-from kp@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 6E4F61DF03; Fri, 13 Apr 2018 19:23:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DJN67t018944; Fri, 13 Apr 2018 19:23:06 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DJN6JZ018943; Fri, 13 Apr 2018 19:23:06 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804131923.w3DJN6JZ018943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 19:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332487 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/10/sys/netpfil/pf X-SVN-Commit-Revision: 332487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 19:23:10 -0000 Author: kp Date: Fri Apr 13 19:23:06 2018 New Revision: 332487 URL: https://svnweb.freebsd.org/changeset/base/332487 Log: MFC r332101: pf: Improve ioctl validation for DIOCRADDTABLES and DIOCRDELTABLES The DIOCRADDTABLES and DIOCRDELTABLES ioctls can process a number of tables at a time, and as such try to allocate * sizeof(struct pfr_table). This multiplication can overflow. Thanks to mallocarray() this is not exploitable, but an overflow does panic the system. Arbitrarily limit this to 65535 tables. pfctl only ever processes one table at a time, so it presents no issues there. Modified: stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 19:23:01 2018 (r332486) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 19:23:06 2018 (r332487) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#define PF_TABLES_MAX_REQUEST 65535 /* Maximum tables per request. */ + static int pfattach(void); static struct pf_pool *pf_get_pool(char *, u_int32_t, u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t); @@ -2513,13 +2515,15 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + + if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { error = ENOMEM; break; } + + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); @@ -2542,13 +2546,15 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } - totlen = io->pfrio_size * sizeof(struct pfr_table); - pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + + if (io->pfrio_size < 0 || io->pfrio_size > PF_TABLES_MAX_REQUEST) { error = ENOMEM; break; } + + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), + M_TEMP, M_WAITOK); error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); From owner-svn-src-all@freebsd.org Fri Apr 13 19:43:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED3ECFA247E; Fri, 13 Apr 2018 19:43:23 +0000 (UTC) (envelope-from brooks@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 A10CF767AD; Fri, 13 Apr 2018 19:43:23 +0000 (UTC) (envelope-from brooks@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 9BA321E227; Fri, 13 Apr 2018 19:43:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DJhN8s028883; Fri, 13 Apr 2018 19:43:23 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DJhNOb028882; Fri, 13 Apr 2018 19:43:23 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804131943.w3DJhNOb028882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 13 Apr 2018 19:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332488 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 332488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 19:43:24 -0000 Author: brooks Date: Fri Apr 13 19:43:23 2018 New Revision: 332488 URL: https://svnweb.freebsd.org/changeset/base/332488 Log: Fix build on 32-bit systems. Modified: head/sys/dev/netmap/netmap_freebsd.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Fri Apr 13 19:23:06 2018 (r332487) +++ head/sys/dev/netmap/netmap_freebsd.c Fri Apr 13 19:43:23 2018 (r332488) @@ -632,7 +632,7 @@ struct nm_os_extmem { void nm_os_extmem_delete(struct nm_os_extmem *e) { - D("freeing %lx bytes", e->size); + D("freeing %zx bytes", (size_t)e->size); vm_map_remove(kernel_map, e->kva, e->kva + e->size); nm_os_free(e); } @@ -701,7 +701,7 @@ nm_os_extmem_create(unsigned long p, struct nmreq_pool VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE, 0); if (rv != KERN_SUCCESS) { - D("vm_map_find(%lx) failed", e->size); + D("vm_map_find(%zx) failed", (size_t)e->size); goto out_rel; } rv = vm_map_wire(kernel_map, e->kva, e->kva + e->size, From owner-svn-src-all@freebsd.org Fri Apr 13 20:30:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96823FA4FC4; Fri, 13 Apr 2018 20:30:51 +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 45A4D7F491; Fri, 13 Apr 2018 20:30:51 +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 405221E8B9; Fri, 13 Apr 2018 20:30:51 +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 w3DKUpbV050168; Fri, 13 Apr 2018 20:30:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DKUnFn050153; Fri, 13 Apr 2018 20:30:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804132030.w3DKUnFn050153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Apr 2018 20:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332489 - in head: gnu/usr.bin/gdb/kgdb sys/conf sys/dev/dcons sys/dev/hyperv/vmbus/i386 sys/dev/ppc sys/dev/syscons sys/i386/conf sys/i386/i386 sys/i386/include sys/i386/include/pc sys... X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: gnu/usr.bin/gdb/kgdb sys/conf sys/dev/dcons sys/dev/hyperv/vmbus/i386 sys/dev/ppc sys/dev/syscons sys/i386/conf sys/i386/i386 sys/i386/include sys/i386/include/pc sys/kern sys/x86/acpica sys/... X-SVN-Commit-Revision: 332489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 20:30:52 -0000 Author: kib Date: Fri Apr 13 20:30:49 2018 New Revision: 332489 URL: https://svnweb.freebsd.org/changeset/base/332489 Log: i386 4/4G split. The change makes the user and kernel address spaces on i386 independent, giving each almost the full 4G of usable virtual addresses except for one PDE at top used for trampoline and per-CPU trampoline stacks, and system structures that must be always mapped, namely IDT, GDT, common TSS and LDT, and process-private TSS and LDT if allocated. By using 1:1 mapping for the kernel text and data, it appeared possible to eliminate assembler part of the locore.S which bootstraps initial page table and KPTmap. The code is rewritten in C and moved into the pmap_cold(). The comment in vmparam.h explains the KVA layout. There is no PCID mechanism available in protected mode, so each kernel/user switch forth and back completely flushes the TLB, except for the trampoline PTD region. The TLB invalidations for userspace becomes trivial, because IPI handlers switch page tables. On the other hand, context switches no longer need to reload %cr3. copyout(9) was rewritten to use vm_fault_quick_hold(). An issue for new copyout(9) is compatibility with wiring user buffers around sysctl handlers. This explains two kind of locks for copyout ptes and accounting of the vslock() calls. The vm_fault_quick_hold() AKA slow path, is only tried after the 'fast path' failed, which temporary changes mapping to the userspace and copies the data to/from small per-cpu buffer in the trampoline. If a page fault occurs during the copy, it is short-circuit by exception.s to not even reach C code. The change was motivated by the need to implement the Meltdown mitigation, but instead of KPTI the full split is done. The i386 architecture already shows the sizing problems, in particular, it is impossible to link clang and lld with debugging. I expect that the issues due to the virtual address space limits would only exaggerate and the split gives more liveness to the platform. Tested by: pho Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D14633 Added: head/sys/i386/i386/copyout.c (contents, props changed) head/sys/i386/i386/copyout_fast.s - copied, changed from r332488, head/sys/i386/i386/support.s Modified: head/gnu/usr.bin/gdb/kgdb/trgt_i386.c head/sys/conf/files.i386 head/sys/conf/ldscript.i386 head/sys/dev/dcons/dcons_crom.c head/sys/dev/dcons/dcons_os.c head/sys/dev/hyperv/vmbus/i386/vmbus_vector.S head/sys/dev/ppc/ppc.c head/sys/dev/syscons/syscons.c head/sys/i386/conf/NOTES head/sys/i386/i386/apic_vector.s head/sys/i386/i386/atpic_vector.s head/sys/i386/i386/bios.c head/sys/i386/i386/db_interface.c head/sys/i386/i386/db_trace.c head/sys/i386/i386/elf_machdep.c head/sys/i386/i386/exception.s head/sys/i386/i386/genassym.c head/sys/i386/i386/locore.s head/sys/i386/i386/machdep.c head/sys/i386/i386/mem.c head/sys/i386/i386/minidump_machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/mpboot.s head/sys/i386/i386/pmap.c head/sys/i386/i386/sigtramp.s head/sys/i386/i386/support.s head/sys/i386/i386/swtch.s head/sys/i386/i386/sys_machdep.c head/sys/i386/i386/trap.c head/sys/i386/i386/vm86.c head/sys/i386/i386/vm86bios.s head/sys/i386/i386/vm_machdep.c head/sys/i386/include/asmacros.h head/sys/i386/include/frame.h head/sys/i386/include/md_var.h head/sys/i386/include/param.h head/sys/i386/include/pc/bios.h head/sys/i386/include/pcpu.h head/sys/i386/include/pmap.h head/sys/i386/include/segments.h head/sys/i386/include/vmparam.h head/sys/kern/imgact_aout.c head/sys/kern/subr_witness.c head/sys/x86/acpica/acpi_wakeup.c head/sys/x86/x86/local_apic.c head/sys/x86/x86/mp_x86.c head/sys/x86/x86/mptable.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_i386.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_i386.c Fri Apr 13 19:43:23 2018 (r332488) +++ head/gnu/usr.bin/gdb/kgdb/trgt_i386.c Fri Apr 13 20:30:49 2018 (r332489) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -279,12 +281,26 @@ kgdb_trgt_frame_cache(struct frame_info *next_frame, v char buf[MAX_REGISTER_SIZE]; struct kgdb_frame_cache *cache; char *pname; + CORE_ADDR pcx; + uintptr_t addr, setidt_disp; cache = *this_cache; if (cache == NULL) { cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache); *this_cache = cache; - cache->pc = frame_func_unwind(next_frame); + pcx = frame_pc_unwind(next_frame); + if (pcx >= PMAP_TRM_MIN_ADDRESS) { + addr = kgdb_lookup("setidt_disp"); + if (addr != 0) { + if (kvm_read(kvm, addr, &setidt_disp, + sizeof(setidt_disp)) != + sizeof(setidt_disp)) + warnx("kvm_read: %s", kvm_geterr(kvm)); + else + pcx -= setidt_disp; + } + } + cache->pc = pcx; find_pc_partial_function(cache->pc, &pname, NULL, NULL); if (pname[0] != 'X') cache->frame_type = FT_NORMAL; @@ -373,6 +389,8 @@ kgdb_trgt_trapframe_sniffer(struct frame_info *next_fr CORE_ADDR pc; pc = frame_pc_unwind(next_frame); + if (pc >= PMAP_TRM_MIN_ADDRESS) + return (&kgdb_trgt_trapframe_unwind); pname = NULL; find_pc_partial_function(pc, &pname, NULL, NULL); if (pname == NULL) Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/conf/files.i386 Fri Apr 13 20:30:49 2018 (r332489) @@ -483,6 +483,7 @@ i386/i386/atomic.c standard \ i386/i386/bios.c standard i386/i386/bioscall.s standard i386/i386/bpf_jit_machdep.c optional bpf_jitter +i386/i386/copyout.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb Modified: head/sys/conf/ldscript.i386 ============================================================================== --- head/sys/conf/ldscript.i386 Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/conf/ldscript.i386 Fri Apr 13 20:30:49 2018 (r332489) @@ -6,7 +6,7 @@ SEARCH_DIR(/usr/lib); SECTIONS { /* Read-only sections, merged into text segment: */ - . = kernbase + kernload + SIZEOF_HEADERS; + . = kernbase + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } Modified: head/sys/dev/dcons/dcons_crom.c ============================================================================== --- head/sys/dev/dcons/dcons_crom.c Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/dev/dcons/dcons_crom.c Fri Apr 13 20:30:49 2018 (r332489) @@ -109,7 +109,11 @@ dcons_crom_expose_idt(struct dcons_crom_softc *sc) static off_t idt_paddr; /* XXX */ +#ifdef __amd64__ idt_paddr = (char *)idt - (char *)KERNBASE; +#else /* __i386__ */ + idt_paddr = (off_t)pmap_kextract((vm_offset_t)idt); +#endif crom_add_entry(&sc->unit, DCONS_CSR_KEY_RESET_HI, ADDR_HI(idt_paddr)); crom_add_entry(&sc->unit, DCONS_CSR_KEY_RESET_LO, ADDR_LO(idt_paddr)); Modified: head/sys/dev/dcons/dcons_os.c ============================================================================== --- head/sys/dev/dcons/dcons_os.c Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/dev/dcons/dcons_os.c Fri Apr 13 20:30:49 2018 (r332489) @@ -309,11 +309,16 @@ dcons_drv_init(int stage) * Allow read/write access to dcons buffer. */ for (pa = trunc_page(addr); pa < addr + size; pa += PAGE_SIZE) - *vtopte(KERNBASE + pa) |= PG_RW; + *vtopte(PMAP_MAP_LOW + pa) |= PG_RW; invltlb(); #endif /* XXX P to V */ +#ifdef __amd64__ dg.buf = (struct dcons_buf *)(vm_offset_t)(KERNBASE + addr); +#else /* __i386__ */ + dg.buf = (struct dcons_buf *)((vm_offset_t)PMAP_MAP_LOW + + addr); +#endif dg.size = size; if (dcons_load_buffer(dg.buf, dg.size, sc) < 0) dg.buf = NULL; Modified: head/sys/dev/hyperv/vmbus/i386/vmbus_vector.S ============================================================================== --- head/sys/dev/hyperv/vmbus/i386/vmbus_vector.S Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/dev/hyperv/vmbus/i386/vmbus_vector.S Fri Apr 13 20:30:49 2018 (r332489) @@ -26,11 +26,12 @@ * $FreeBSD$ */ +#include "assym.inc" + +#include #include #include -#include "assym.inc" - /* * This is the Hyper-V vmbus channel direct callback interrupt. * Only used when it is running on Hyper-V. @@ -42,6 +43,7 @@ IDTVEC(vmbus_isr) PUSH_FRAME SET_KERNEL_SREGS cld + KENTER FAKE_MCOUNT(TF_EIP(%esp)) pushl %esp call vmbus_handle_intr Modified: head/sys/dev/ppc/ppc.c ============================================================================== --- head/sys/dev/ppc/ppc.c Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/dev/ppc/ppc.c Fri Apr 13 20:30:49 2018 (r332489) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #endif #include @@ -121,7 +122,7 @@ static char *ppc_epp_protocol[] = { " (EPP 1.9)", " (E * BIOS printer list - used by BIOS probe. */ #define BIOS_PPC_PORTS 0x408 -#define BIOS_PORTS (short *)(KERNBASE+BIOS_PPC_PORTS) +#define BIOS_PORTS ((short *)BIOS_PADDRTOVADDR(BIOS_PPC_PORTS)) #define BIOS_MAX_PPC 4 #endif Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/dev/syscons/syscons.c Fri Apr 13 20:30:49 2018 (r332489) @@ -288,7 +288,11 @@ ec_putc(int c) * This is enough for ec_putc() to work very early on x86 * if the kernel starts in normal color text mode. */ +#ifdef __amd64__ fb = KERNBASE + 0xb8000; +#else /* __i386__ */ + fb = PMAP_MAP_LOW + 0xb8000; +#endif xsize = 80; ysize = 25; #endif Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/i386/conf/NOTES Fri Apr 13 20:30:49 2018 (r332489) @@ -895,19 +895,6 @@ options ENABLE_ALART # Control alarm on Intel intpm options PMAP_SHPGPERPROC=201 # -# Change the size of the kernel virtual address space. Due to -# constraints in loader(8) on i386, this must be a multiple of 4. -# 256 = 1 GB of kernel address space. Increasing this also causes -# a reduction of the address space in user processes. 512 splits -# the 4GB cpu address space in half (2GB user, 2GB kernel). For PAE -# kernels, the value will need to be double non-PAE. A value of 1024 -# for PAE kernels is necessary to split the address space in half. -# This will likely need to be increased to handle memory sizes >4GB. -# PAE kernels default to a value of 512. -# -options KVA_PAGES=260 - -# # Number of initial kernel page table pages used for early bootstrap. # This number should include enough pages to map the kernel, any # modules or other data loaded with the kernel by the loader, and data @@ -950,22 +937,6 @@ device ndis ##################################################################### # VM OPTIONS - -# Disable the 4 MByte page PSE CPU feature. The PSE feature allows the -# kernel to use 4 MByte pages to map the kernel instead of 4k pages. -# This saves on the amount of memory needed for page tables needed to -# map the kernel. You should only disable this feature as a temporary -# workaround if you are having problems with it enabled. -# -#options DISABLE_PSE - -# Disable the global pages PGE CPU feature. The PGE feature allows pages -# to be marked with the PG_G bit. TLB entries for these pages are not -# flushed from the cache when %cr3 is reloaded. This can make context -# switches less expensive. You should only disable this feature as a -# temporary workaround if you are having problems with it enabled. -# -#options DISABLE_PG_G # KSTACK_PAGES is the number of memory pages to assign to the kernel # stack of each thread. Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/i386/i386/apic_vector.s Fri Apr 13 20:30:49 2018 (r332489) @@ -39,6 +39,7 @@ #include "opt_smp.h" #include +#include #include #include @@ -67,34 +68,39 @@ as_lapic_eoi: * translates that into a vector, and passes the vector to the * lapic_handle_intr() function. */ -#define ISR_VEC(index, vec_name) \ - .text ; \ - SUPERALIGN_TEXT ; \ -IDTVEC(vec_name ## _pti) ; \ -IDTVEC(vec_name) ; \ - PUSH_FRAME ; \ - SET_KERNEL_SREGS ; \ - cld ; \ - FAKE_MCOUNT(TF_EIP(%esp)) ; \ - cmpl $0,x2apic_mode ; \ - je 1f ; \ - movl $(MSR_APIC_ISR0 + index),%ecx ; \ - rdmsr ; \ - jmp 2f ; \ -1: ; \ - movl lapic_map, %edx ;/* pointer to local APIC */ \ - movl LA_ISR + 16 * (index)(%edx), %eax ; /* load ISR */ \ -2: ; \ - bsrl %eax, %eax ; /* index of highest set bit in ISR */ \ - jz 3f ; \ - addl $(32 * index),%eax ; \ - pushl %esp ; \ - pushl %eax ; /* pass the IRQ */ \ - call lapic_handle_intr ; \ - addl $8, %esp ; /* discard parameter */ \ -3: ; \ - MEXITCOUNT ; \ + .macro ISR_VEC index, vec_name + .text + SUPERALIGN_TEXT + .globl X\()\vec_name\()_pti, X\()\vec_name + +X\()\vec_name\()_pti: +X\()\vec_name: + PUSH_FRAME + SET_KERNEL_SREGS + cld + KENTER + FAKE_MCOUNT(TF_EIP(%esp)) + cmpl $0,x2apic_mode + je 2f + movl $(MSR_APIC_ISR0 + \index),%ecx + rdmsr + jmp 3f +2: + movl lapic_map, %edx /* pointer to local APIC */ + movl LA_ISR + 16 * \index(%edx), %eax /* load ISR */ +3: + bsrl %eax, %eax /* index of highest set bit in ISR */ + jz 4f + addl $(32 * \index),%eax + pushl %esp + pushl %eax /* pass the IRQ */ + movl $lapic_handle_intr, %eax + call *%eax + addl $8, %esp /* discard parameter */ +4: + MEXITCOUNT jmp doreti + .endm /* * Handle "spurious INTerrupts". @@ -111,13 +117,13 @@ IDTVEC(spuriousint) iret - ISR_VEC(1, apic_isr1) - ISR_VEC(2, apic_isr2) - ISR_VEC(3, apic_isr3) - ISR_VEC(4, apic_isr4) - ISR_VEC(5, apic_isr5) - ISR_VEC(6, apic_isr6) - ISR_VEC(7, apic_isr7) + ISR_VEC 1, apic_isr1 + ISR_VEC 2, apic_isr2 + ISR_VEC 3, apic_isr3 + ISR_VEC 4, apic_isr4 + ISR_VEC 5, apic_isr5 + ISR_VEC 6, apic_isr6 + ISR_VEC 7, apic_isr7 /* * Local APIC periodic timer handler. @@ -129,9 +135,11 @@ IDTVEC(timerint) PUSH_FRAME SET_KERNEL_SREGS cld + KENTER FAKE_MCOUNT(TF_EIP(%esp)) pushl %esp - call lapic_handle_timer + movl $lapic_handle_timer, %eax + call *%eax add $4, %esp MEXITCOUNT jmp doreti @@ -146,8 +154,10 @@ IDTVEC(cmcint) PUSH_FRAME SET_KERNEL_SREGS cld + KENTER FAKE_MCOUNT(TF_EIP(%esp)) - call lapic_handle_cmc + movl $lapic_handle_cmc, %eax + call *%eax MEXITCOUNT jmp doreti @@ -161,8 +171,10 @@ IDTVEC(errorint) PUSH_FRAME SET_KERNEL_SREGS cld + KENTER FAKE_MCOUNT(TF_EIP(%esp)) - call lapic_handle_error + movl $lapic_handle_error, %eax + call *%eax MEXITCOUNT jmp doreti @@ -177,9 +189,11 @@ IDTVEC(xen_intr_upcall) PUSH_FRAME SET_KERNEL_SREGS cld + KENTER FAKE_MCOUNT(TF_EIP(%esp)) pushl %esp - call xen_intr_handle_upcall + movl $xen_intr_handle_upcall, %eax + call *%eax add $4, %esp MEXITCOUNT jmp doreti @@ -200,9 +214,9 @@ IDTVEC(invltlb) PUSH_FRAME SET_KERNEL_SREGS cld - - call invltlb_handler - + KENTER + movl $invltlb_handler, %eax + call *%eax jmp invltlb_ret /* @@ -214,9 +228,9 @@ IDTVEC(invlpg) PUSH_FRAME SET_KERNEL_SREGS cld - - call invlpg_handler - + KENTER + movl $invlpg_handler, %eax + call *%eax jmp invltlb_ret /* @@ -228,9 +242,9 @@ IDTVEC(invlrng) PUSH_FRAME SET_KERNEL_SREGS cld - - call invlrng_handler - + KENTER + movl $invlrng_handler, %eax + call *%eax jmp invltlb_ret /* @@ -242,9 +256,9 @@ IDTVEC(invlcache) PUSH_FRAME SET_KERNEL_SREGS cld - - call invlcache_handler - + KENTER + movl $invlcache_handler, %eax + call *%eax jmp invltlb_ret /* @@ -256,12 +270,11 @@ IDTVEC(ipi_intr_bitmap_handler) PUSH_FRAME SET_KERNEL_SREGS cld - + KENTER call as_lapic_eoi - FAKE_MCOUNT(TF_EIP(%esp)) - - call ipi_bitmap_handler + movl $ipi_bitmap_handler, %eax + call *%eax MEXITCOUNT jmp doreti @@ -274,9 +287,10 @@ IDTVEC(cpustop) PUSH_FRAME SET_KERNEL_SREGS cld - + KENTER call as_lapic_eoi - call cpustop_handler + movl $cpustop_handler, %eax + call *%eax jmp doreti /* @@ -288,9 +302,10 @@ IDTVEC(cpususpend) PUSH_FRAME SET_KERNEL_SREGS cld - + KENTER call as_lapic_eoi - call cpususpend_handler + movl $cpususpend_handler, %eax + call *%eax jmp doreti /* @@ -304,14 +319,14 @@ IDTVEC(rendezvous) PUSH_FRAME SET_KERNEL_SREGS cld - + KENTER #ifdef COUNT_IPIS movl PCPU(CPUID), %eax movl ipi_rendezvous_counts(,%eax,4), %eax incl (%eax) #endif - call smp_rendezvous_action - + movl $smp_rendezvous_action, %eax + call *%eax call as_lapic_eoi jmp doreti Modified: head/sys/i386/i386/atpic_vector.s ============================================================================== --- head/sys/i386/i386/atpic_vector.s Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/i386/i386/atpic_vector.s Fri Apr 13 20:30:49 2018 (r332489) @@ -36,6 +36,7 @@ * master and slave interrupt controllers. */ +#include #include #include "assym.inc" @@ -43,37 +44,41 @@ /* * Macros for interrupt entry, call to handler, and exit. */ -#define INTR(irq_num, vec_name) \ - .text ; \ - SUPERALIGN_TEXT ; \ -IDTVEC(vec_name ##_pti) ; \ -IDTVEC(vec_name) ; \ - PUSH_FRAME ; \ - SET_KERNEL_SREGS ; \ - cld ; \ -; \ - FAKE_MCOUNT(TF_EIP(%esp)) ; \ - pushl %esp ; \ - pushl $irq_num; /* pass the IRQ */ \ - call atpic_handle_intr ; \ - addl $8, %esp ; /* discard the parameters */ \ -; \ - MEXITCOUNT ; \ + .macro INTR irq_num, vec_name + .text + SUPERALIGN_TEXT + .globl X\()\vec_name\()_pti, X\()\vec_name + +X\()\vec_name\()_pti: +X\()\vec_name: + PUSH_FRAME + SET_KERNEL_SREGS + cld + KENTER + FAKE_MCOUNT(TF_EIP(%esp)) + pushl %esp + pushl $\irq_num /* pass the IRQ */ + movl $atpic_handle_intr, %eax + call *%eax + addl $8, %esp /* discard the parameters */ + + MEXITCOUNT jmp doreti + .endm - INTR(0, atpic_intr0) - INTR(1, atpic_intr1) - INTR(2, atpic_intr2) - INTR(3, atpic_intr3) - INTR(4, atpic_intr4) - INTR(5, atpic_intr5) - INTR(6, atpic_intr6) - INTR(7, atpic_intr7) - INTR(8, atpic_intr8) - INTR(9, atpic_intr9) - INTR(10, atpic_intr10) - INTR(11, atpic_intr11) - INTR(12, atpic_intr12) - INTR(13, atpic_intr13) - INTR(14, atpic_intr14) - INTR(15, atpic_intr15) + INTR 0, atpic_intr0 + INTR 1, atpic_intr1 + INTR 2, atpic_intr2 + INTR 3, atpic_intr3 + INTR 4, atpic_intr4 + INTR 5, atpic_intr5 + INTR 6, atpic_intr6 + INTR 7, atpic_intr7 + INTR 8, atpic_intr8 + INTR 9, atpic_intr9 + INTR 10, atpic_intr10 + INTR 11, atpic_intr11 + INTR 12, atpic_intr12 + INTR 13, atpic_intr13 + INTR 14, atpic_intr14 + INTR 15, atpic_intr15 Modified: head/sys/i386/i386/bios.c ============================================================================== --- head/sys/i386/i386/bios.c Fri Apr 13 19:43:23 2018 (r332488) +++ head/sys/i386/i386/bios.c Fri Apr 13 20:30:49 2018 (r332489) @@ -305,6 +305,7 @@ set_bios_selectors(struct bios_segments *seg, int flag } extern int vm86pa; +extern u_long vm86phystk; extern void bios16_jmp(void); /* @@ -329,7 +330,7 @@ bios16(struct bios_args *args, char *fmt, ...) int flags = BIOSCODE_FLAG | BIOSDATA_FLAG; u_int i, arg_start, arg_end; pt_entry_t *pte; - pd_entry_t *ptd; + pd_entry_t *ptd, orig_ptd; arg_start = 0xffffffff; arg_end = 0; @@ -390,27 +391,14 @@ bios16(struct bios_args *args, char *fmt, ...) args->seg.code32.base = (u_int)&bios16_jmp & PG_FRAME; args->seg.code32.limit = 0xffff; - ptd = (pd_entry_t *)rcr3(); -#if defined(PAE) || defined(PAE_TABLES) - if (ptd == IdlePDPT) -#else - if (ptd == IdlePTD) -#endif - { - /* - * no page table, so create one and install it. - */ - pte = (pt_entry_t *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK); - ptd = (pd_entry_t *)((u_int)IdlePTD + KERNBASE); - *pte = (vm86pa - PAGE_SIZE) | PG_RW | PG_V; - *ptd = vtophys(pte) | PG_RW | PG_V; - } else { - /* - * this is a user-level page table - */ - pte = PTmap; - *pte = (vm86pa - PAGE_SIZE) | PG_RW | PG_V; - } + /* + * no page table, so create one and install it. + */ + pte = (pt_entry_t *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK); + ptd = IdlePTD; + *pte = vm86phystk | PG_RW | PG_V; + orig_ptd = *ptd; + *ptd = vtophys(pte) | PG_RW | PG_V; pmap_invalidate_all(kernel_pmap); /* XXX insurance for now */ stack_top = stack; @@ -464,20 +452,12 @@ bios16(struct bios_args *args, char *fmt, ...) i = bios16_call(&args->r, stack_top); - if (pte == PTmap) { - *pte = 0; /* remove entry */ - /* - * XXX only needs to be invlpg(0) but that doesn't work on the 386 - */ - pmap_invalidate_all(kernel_pmap); - } else { - *ptd = 0; /* remove page table */ - /* - * XXX only needs to be invlpg(0) but that doesn't work on the 386 - */ - pmap_invalidate_all(kernel_pmap); - free(pte, M_TEMP); /* ... and free it */ - } + *ptd = orig_ptd; /* remove page table */ + /* + * XXX only needs to be invlpg(0) but that doesn't work on the 386 + */ + pmap_invalidate_all(kernel_pmap); + free(pte, M_TEMP); /* ... and free it */ return (i); } Added: head/sys/i386/i386/copyout.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/i386/copyout.c Fri Apr 13 20:30:49 2018 (r332489) @@ -0,0 +1,489 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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 +#include +#include +#include +#include +#include +#include + +#if defined(PAE) || defined(PAE_TABLES) +#define KCR3 ((u_int)IdlePDPT) +#else +#define KCR3 ((u_int)IdlePTD) +#endif + +int copyin_fast(const void *udaddr, void *kaddr, size_t len, u_int); +static int (*copyin_fast_tramp)(const void *, void *, size_t, u_int); +int copyout_fast(const void *kaddr, void *udaddr, size_t len, u_int); +static int (*copyout_fast_tramp)(const void *, void *, size_t, u_int); +int fubyte_fast(volatile const void *base, u_int kcr3); +static int (*fubyte_fast_tramp)(volatile const void *, u_int); +int fuword16_fast(volatile const void *base, u_int kcr3); +static int (*fuword16_fast_tramp)(volatile const void *, u_int); +int fueword_fast(volatile const void *base, long *val, u_int kcr3); +static int (*fueword_fast_tramp)(volatile const void *, long *, u_int); +int subyte_fast(volatile void *base, int val, u_int kcr3); +static int (*subyte_fast_tramp)(volatile void *, int, u_int); +int suword16_fast(volatile void *base, int val, u_int kcr3); +static int (*suword16_fast_tramp)(volatile void *, int, u_int); +int suword_fast(volatile void *base, long val, u_int kcr3); +static int (*suword_fast_tramp)(volatile void *, long, u_int); + +static int fast_copyout = 1; +SYSCTL_INT(_machdep, OID_AUTO, fast_copyout, CTLFLAG_RWTUN, + &fast_copyout, 0, + ""); + +void +copyout_init_tramp(void) +{ + + copyin_fast_tramp = (int (*)(const void *, void *, size_t, u_int))( + (uintptr_t)copyin_fast + setidt_disp); + copyout_fast_tramp = (int (*)(const void *, void *, size_t, u_int))( + (uintptr_t)copyout_fast + setidt_disp); + fubyte_fast_tramp = (int (*)(volatile const void *, u_int))( + (uintptr_t)fubyte_fast + setidt_disp); + fuword16_fast_tramp = (int (*)(volatile const void *, u_int))( + (uintptr_t)fuword16_fast + setidt_disp); + fueword_fast_tramp = (int (*)(volatile const void *, long *, u_int))( + (uintptr_t)fueword_fast + setidt_disp); + subyte_fast_tramp = (int (*)(volatile void *, int, u_int))( + (uintptr_t)subyte_fast + setidt_disp); + suword16_fast_tramp = (int (*)(volatile void *, int, u_int))( + (uintptr_t)suword16_fast + setidt_disp); + suword_fast_tramp = (int (*)(volatile void *, long, u_int))( + (uintptr_t)suword_fast + setidt_disp); +} + +static int +cp_slow0(vm_offset_t uva, size_t len, bool write, + void (*f)(vm_offset_t, void *), void *arg) +{ + struct pcpu *pc; + vm_page_t m[2]; + pt_entry_t *pte; + vm_offset_t kaddr; + int error, i, plen; + bool sleepable; + + plen = howmany(uva - trunc_page(uva) + len, PAGE_SIZE); + MPASS(plen <= nitems(m)); + error = 0; + i = vm_fault_quick_hold_pages(&curproc->p_vmspace->vm_map, uva, len, + (write ? VM_PROT_WRITE : VM_PROT_READ) | VM_PROT_QUICK_NOFAULT, + m, nitems(m)); + if (i != plen) + return (EFAULT); + sched_pin(); + pc = get_pcpu(); + if (!THREAD_CAN_SLEEP() || curthread->td_vslock_sz > 0 || + (curthread->td_pflags & TDP_NOFAULTING) != 0) { + sleepable = false; + mtx_lock(&pc->pc_copyout_mlock); + kaddr = pc->pc_copyout_maddr; + } else { + sleepable = true; + sx_xlock(&pc->pc_copyout_slock); + kaddr = pc->pc_copyout_saddr; + } + for (i = 0, pte = vtopte(kaddr); i < plen; i++, pte++) { + *pte = PG_V | PG_RW | PG_A | PG_M | VM_PAGE_TO_PHYS(m[i]) | + pmap_cache_bits(pmap_page_get_memattr(m[i]), FALSE); + invlpg(kaddr + ptoa(i)); + } + kaddr += uva - trunc_page(uva); + f(kaddr, arg); + sched_unpin(); + if (sleepable) + sx_xunlock(&pc->pc_copyout_slock); + else + mtx_unlock(&pc->pc_copyout_mlock); + for (i = 0; i < plen; i++) { + vm_page_lock(m[i]); + vm_page_unhold(m[i]); + vm_page_unlock(m[i]); + } + return (error); +} + +struct copyinstr_arg0 { + vm_offset_t kc; + size_t len; + size_t alen; + bool end; +}; + +static void +copyinstr_slow0(vm_offset_t kva, void *arg) +{ + struct copyinstr_arg0 *ca; + char c; + + ca = arg; + MPASS(ca->alen == 0 && ca->len > 0 && !ca->end); + while (ca->alen < ca->len && !ca->end) { + c = *(char *)(kva + ca->alen); + *(char *)ca->kc = c; + ca->alen++; + ca->kc++; + if (c == '\0') + ca->end = true; + } +} + +int +copyinstr(const void *udaddr, void *kaddr, size_t maxlen, size_t *lencopied) +{ + struct copyinstr_arg0 ca; + vm_offset_t uc; + size_t plen; + int error; + + error = 0; + ca.end = false; + for (plen = 0, uc = (vm_offset_t)udaddr, ca.kc = (vm_offset_t)kaddr; + plen < maxlen && !ca.end; uc += ca.alen, plen += ca.alen) { + ca.len = round_page(uc) - uc; + if (ca.len == 0) + ca.len = PAGE_SIZE; + if (plen + ca.len > maxlen) + ca.len = maxlen - plen; + ca.alen = 0; + if (cp_slow0(uc, ca.len, false, copyinstr_slow0, &ca) != 0) { + error = EFAULT; + break; + } + } + if (!ca.end && plen == maxlen && error == 0) + error = ENAMETOOLONG; + if (lencopied != NULL) + *lencopied = plen; + return (error); +} + +struct copyin_arg0 { + vm_offset_t kc; + size_t len; +}; + +static void +copyin_slow0(vm_offset_t kva, void *arg) +{ + struct copyin_arg0 *ca; + + ca = arg; + bcopy((void *)kva, (void *)ca->kc, ca->len); +} + +int +copyin(const void *udaddr, void *kaddr, size_t len) +{ + struct copyin_arg0 ca; + vm_offset_t uc; + size_t plen; + + if ((uintptr_t)udaddr + len < (uintptr_t)udaddr || + (uintptr_t)udaddr + len > VM_MAXUSER_ADDRESS) + return (-1); + if (len == 0 || (fast_copyout && len <= TRAMP_COPYOUT_SZ && + copyin_fast_tramp(udaddr, kaddr, len, KCR3) == 0)) + return (0); + for (plen = 0, uc = (vm_offset_t)udaddr, ca.kc = (vm_offset_t)kaddr; + plen < len; uc += ca.len, ca.kc += ca.len, plen += ca.len) { + ca.len = round_page(uc) - uc; + if (ca.len == 0) + ca.len = PAGE_SIZE; + if (plen + ca.len > len) + ca.len = len - plen; + if (cp_slow0(uc, ca.len, false, copyin_slow0, &ca) != 0) + return (EFAULT); + } + return (0); +} + +static void +copyout_slow0(vm_offset_t kva, void *arg) +{ + struct copyin_arg0 *ca; + + ca = arg; + bcopy((void *)ca->kc, (void *)kva, ca->len); +} + +int +copyout(const void *kaddr, void *udaddr, size_t len) +{ + struct copyin_arg0 ca; + vm_offset_t uc; + size_t plen; + + if ((uintptr_t)udaddr + len < (uintptr_t)udaddr || + (uintptr_t)udaddr + len > VM_MAXUSER_ADDRESS) + return (-1); + if (len == 0 || (fast_copyout && len <= TRAMP_COPYOUT_SZ && + copyout_fast_tramp(kaddr, udaddr, len, KCR3) == 0)) + return (0); + for (plen = 0, uc = (vm_offset_t)udaddr, ca.kc = (vm_offset_t)kaddr; + plen < len; uc += ca.len, ca.kc += ca.len, plen += ca.len) { + ca.len = round_page(uc) - uc; + if (ca.len == 0) + ca.len = PAGE_SIZE; + if (plen + ca.len > len) + ca.len = len - plen; + if (cp_slow0(uc, ca.len, true, copyout_slow0, &ca) != 0) + return (EFAULT); + } + return (0); +} + +/* + * Fetch (load) a 32-bit word, a 16-bit word, or an 8-bit byte from user + * memory. + */ + +static void +fubyte_slow0(vm_offset_t kva, void *arg) +{ + + *(int *)arg = *(u_char *)kva; +} + +int +fubyte(volatile const void *base) +{ + int res; + + if ((uintptr_t)base + sizeof(uint8_t) < (uintptr_t)base || + (uintptr_t)base + sizeof(uint8_t) > VM_MAXUSER_ADDRESS) + return (-1); + if (fast_copyout) { + res = fubyte_fast_tramp(base, KCR3); + if (res != -1) + return (res); + } + if (cp_slow0((vm_offset_t)base, sizeof(char), false, fubyte_slow0, + &res) != 0) + return (-1); + return (res); +} + +static void +fuword16_slow0(vm_offset_t kva, void *arg) +{ + + *(int *)arg = *(uint16_t *)kva; +} + +int +fuword16(volatile const void *base) +{ + int res; + + if ((uintptr_t)base + sizeof(uint16_t) < (uintptr_t)base || + (uintptr_t)base + sizeof(uint16_t) > VM_MAXUSER_ADDRESS) + return (-1); + if (fast_copyout) { + res = fuword16_fast_tramp(base, KCR3); + if (res != -1) + return (res); + } + if (cp_slow0((vm_offset_t)base, sizeof(uint16_t), false, + fuword16_slow0, &res) != 0) + return (-1); + return (res); +} + +static void +fueword_slow0(vm_offset_t kva, void *arg) +{ + + *(uint32_t *)arg = *(uint32_t *)kva; +} + +int +fueword(volatile const void *base, long *val) +{ + uint32_t res; + + if ((uintptr_t)base + sizeof(*val) < (uintptr_t)base || + (uintptr_t)base + sizeof(*val) > VM_MAXUSER_ADDRESS) + return (-1); + if (fast_copyout) { + if (fueword_fast_tramp(base, val, KCR3) == 0) + return (0); + } + if (cp_slow0((vm_offset_t)base, sizeof(long), false, fueword_slow0, + &res) != 0) + return (-1); + *val = res; + return (0); +} + +int +fueword32(volatile const void *base, int32_t *val) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 13 20:42:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20F86FA5B7E; Fri, 13 Apr 2018 20:42:24 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A3A3822D5; Fri, 13 Apr 2018 20:42:23 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x241.google.com with SMTP id m200-v6so14319752lfm.4; Fri, 13 Apr 2018 13:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PumMV9+NU4/r2PfosSqZudAzRik9KDLWdHTSA47JWjQ=; b=ttItOq+r8s3GpIA/SnuKhTq5KTuuxcPy9HYGOmgEswilmbP7ckndenjzCwihG+b54g KEn1Aw6AgMge/4d1bl6B0cOhU6b1Wl4cjyZSmQ3Aa8SJ/sBhTQqEt2uu6QXW8wmSr603 6sowjE+ch0bulwkFMznusO7S9nA1AyAZydjkMSCpfNQXqnyiFAZkrnLOt+RLAo5KS+yQ n0d+a4UxRR4tF3N/DWcD0FX5aiLuT8ut2H1N1m6NPEKOiWPEdQM03ISPSCS1Cqhq9wA3 /lf86kw69ygTa6h0vVWC1RLNFTYqcKAOorASpWsZHYKXL0YRzeg+2iJN3EKaOBkYtN5c Wt7Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alumni-cwru-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PumMV9+NU4/r2PfosSqZudAzRik9KDLWdHTSA47JWjQ=; b=xB/PYZqHcSEYn1eCThuwgoO6jT7sFTLgXJ2MVDJGp5q7mlBk3XubHgoot1zqdjGXdS t2t2B3jXnd8C6AxN2H1cZH32+ubCPeEWvUXvLvZWHdnwVPxO/LAHIdJ+oF2/e2Gji+wb N5sQ8aHKOQc4mcNc04zeRY45jH/MECsOZqXRy1fKS8Ep0ABEnIMEI9Au70iATrLAw6Gf rHat9ePFOSvxz5LGeLyI+P1k/P2TyDum0SBVSgFocj+e0ocsrEzEFJaFthT8DA0Sp4oI gHUT0gDZSAZh6iU1r2VXsBAagarQzfwPtWfSbApg4OYE1107BZAXMcJ0wWUZAKdGULwF WLWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PumMV9+NU4/r2PfosSqZudAzRik9KDLWdHTSA47JWjQ=; b=R71tTxzyQrnQ5P6wkLltguP8S6V3Luw/AoSocP/EAnOSpxLoNPrakoLWpK/r0bbk6i q9hOWXct2evxqQAh/SAYzlZe/e0l9X//iVizdpUir0pJhSclq3dHLNUTTaI+X5ZjsZL1 U2FXdJgDAOV0NiempmhT4KU1Vo/NpkszcWN+pd6AwUF7D/mzn6tEGOOMw18vUoa1EcmY wYeSXWRR/1lj7jfxRuo+i58s9s68XoD4bwEqk1VShb6zK2ynfBAQBX0UvvkEDt60IHmZ xNcCFme1H9Unj0+LRsTMiuqn6AAEgm8pMtv3ULNKHrEiIAnqqZOsPiRqqc2MjwOz0pBd CvaA== X-Gm-Message-State: ALQs6tBi6K/BKncTX3qF8SU7LfcKoB0Khnh8lKWlsvOjOGTdh6mcZX99 1t6V87IDofHf2BcpoOieaEH+7l9O8mL4vNlnD67hug== X-Google-Smtp-Source: AIpwx49AwjJIDvfqmbooi+yj+IRqjT+705Choq3k0x9JyDjvIiJd7RWWhB0gsqkVgzvTQAhI26G+95nm45MP6S8ujeE= X-Received: by 10.46.17.23 with SMTP id f23mr4117227lje.43.1523652141365; Fri, 13 Apr 2018 13:42:21 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.46.104.15 with HTTP; Fri, 13 Apr 2018 13:42:20 -0700 (PDT) In-Reply-To: <201804120720.w3C7Koe4032111@repo.freebsd.org> References: <201804120720.w3C7Koe4032111@repo.freebsd.org> From: Justin Hibbits Date: Fri, 13 Apr 2018 15:42:20 -0500 X-Google-Sender-Auth: B3hTYHI3BfyWrWj2mYwshD-cx04 Message-ID: Subject: Re: svn commit: r332423 - in head/sys: conf dev/cxgbe dev/ixgbe dev/ixl dev/netmap dev/re modules/netmap net sys To: Vincenzo Maffione Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 20:42:24 -0000 On Thu, Apr 12, 2018 at 2:20 AM, Vincenzo Maffione wrote: > Author: vmaffione > Date: Thu Apr 12 07:20:50 2018 > New Revision: 332423 > URL: https://svnweb.freebsd.org/changeset/base/332423 > > Log: > netmap: align codebase to the current upstream (commit id 3fb001303718146) > > Changelist: > - Turn tx_rings and rx_rings arrays into arrays of pointers to kring > structs. This patch includes fixes for ixv, ixl, ix, re, cxgbe, iflib, > vtnet and ptnet drivers to cope with the change. > - Generalize the nm_config() callback to accept a struct containing many > parameters. > - Introduce NKR_FAKERING to support buffers sharing (used for netmap > pipes) > - Improved API for external VALE modules. > - Various bug fixes and improvements to the netmap memory allocator, > including support for externally (userspace) allocated memory. > - Refactoring of netmap pipes: now linked rings share the same netmap > buffers, with a separate set of kring pointers (rhead, rcur, rtail). > Buffer swapping does not need to happen anymore. > - Large refactoring of the control API towards an extensible solution; > the goal is to allow the addition of more commands and extension of > existing ones (with new options) without the need of hacks or the > risk of running out of configuration space. > A new NIOCCTRL ioctl has been added to handle all the requests of the > new control API, which cover all the functionalities so far supported. > The netmap API bumps from 11 to 12 with this patch. Full backward > compatibility is provided for the old control command (NIOCREGIF), by > means of a new netmap_legacy module. Many parts of the old netmap.h > header has now been moved to netmap_legacy.h (included by netmap.h). > > Approved by: hrs (mentor) > > Added: > head/sys/dev/netmap/netmap_legacy.c (contents, props changed) > head/sys/net/netmap_legacy.h (contents, props changed) > Modified: > head/sys/conf/files > head/sys/dev/cxgbe/t4_netmap.c > head/sys/dev/ixgbe/if_ixv.c > head/sys/dev/ixl/ixl_pf_main.c > head/sys/dev/ixl/ixl_txrx.c > head/sys/dev/netmap/if_ptnet.c > head/sys/dev/netmap/if_re_netmap.h > head/sys/dev/netmap/if_vtnet_netmap.h > head/sys/dev/netmap/netmap.c > head/sys/dev/netmap/netmap_freebsd.c > head/sys/dev/netmap/netmap_generic.c > head/sys/dev/netmap/netmap_kern.h > head/sys/dev/netmap/netmap_mem2.c > head/sys/dev/netmap/netmap_mem2.h > head/sys/dev/netmap/netmap_monitor.c > head/sys/dev/netmap/netmap_pipe.c > head/sys/dev/netmap/netmap_pt.c > head/sys/dev/netmap/netmap_vale.c > head/sys/dev/re/if_re.c > head/sys/modules/netmap/Makefile > head/sys/net/iflib.c > head/sys/net/netmap.h > head/sys/net/netmap_user.h > head/sys/net/netmap_virt.h > head/sys/sys/param.h This breaks 32-bit powerpc LINT, with errors of: /usr/src/sys/dev/netmap/netmap.c: In function 'netmap_get_na': /usr/src/sys/dev/netmap/netmap.c:1479: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /usr/src/sys/dev/netmap/netmap.c: In function 'netmap_ioctl': /usr/src/sys/dev/netmap/netmap.c:2329: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /usr/src/sys/dev/netmap/netmap.c:2344: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /usr/src/sys/dev/netmap/netmap.c:2447: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /usr/src/sys/dev/netmap/netmap.c:2466: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] among others. struct nmreq_header->nr_body is a uint64_t, casting to 32-bit pointers needs to go through uintptr_t. - Justin From owner-svn-src-all@freebsd.org Fri Apr 13 20:48:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1445F80163; Fri, 13 Apr 2018 20:48:30 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com [IPv6:2607:f8b0:400d:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAEE482AD9; Fri, 13 Apr 2018 20:48:29 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: by mail-qk0-x233.google.com with SMTP id f9so2569401qkm.12; Fri, 13 Apr 2018 13:48:28 -0700 (PDT) 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=nA0b5mXSxOgmDf72BK8ehqXhjQ/Ov34qEPtp6zw85gk=; b=LIlS475Aoja6TTUh4v6u8OgMOOCRghAZds4yNFgziPAIl+AXV+zcrS2LYa1Cup73tD OhxdlMFl1rnUyGlBvLJeKAS7XU+Ix0tFZbEHr3DxRz0HjvtwGQFbW6zARG912U/f04D9 F5sEcYvWohSNiXwZ40hZh3z5XxTI294qxpGa3rqGq/YkeskZXBZN6oQ8l8+U9+15fkjN gGlq8WuUCCOn/blREq6p4MGfYj9pyTjv45k6pB+WLYL1WWQ7H9JQNSzSrsHdzyTIdgyN mFicc9fHfjiV0IIEwAxSDVZfVWh/J0vjzDaXVIbrxabsfnLq3jTF2TE7/lAkOLxRFiY4 9eKw== 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=nA0b5mXSxOgmDf72BK8ehqXhjQ/Ov34qEPtp6zw85gk=; b=R2uSJMbqaEm9KEIfuJ6krordG7lx9CwdhR0wNSMkzj3SdiFL9iQOTaQo0gWCCpB92F UhdHydFcwPClo/lnjWYiXaUV/trFWIBrPsr5EW0OcE2Sn8MzGzYPaHRyyvny6TWSIa0B 5LrIH5SE0BBYvrxcqdqOokgpzUuCWLZAZA6jbnE4aM8H6fM2a13PtnC3em/75hv8k+b7 CL+qshGis161RkNTx0McfY8a3nrWhHl1yWvTe3d1pUTkpP6l5F92eLpy5Oz1TeXBiTYy oh4zgWk8HJwJdXaXWn546I8qDT4kK1b3a1osIfRxotC3uqWErJ7L/M7EQkADVeO2je3k tYDg== X-Gm-Message-State: ALQs6tCSASGqXLrE3WQLVdk0RLrxLmp2ELQA9bHmdEKg/UYuGF0XMmt2 QOXjkyKN1m3CwjbZS2OJHJ2gTv6pA3/Wc5qnChg= X-Google-Smtp-Source: AIpwx4+OqN6v+SXATa5S8cU7yNwpdWYRikZT5ClamirP94ZxkV2cm4u68d/UQBOmo4wZKF+ErFSD/fMx2ObodOKycsE= X-Received: by 10.233.235.2 with SMTP id b2mr6148541qkg.27.1523652508366; Fri, 13 Apr 2018 13:48:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.190.132 with HTTP; Fri, 13 Apr 2018 13:48:27 -0700 (PDT) In-Reply-To: References: <201804120720.w3C7Koe4032111@repo.freebsd.org> From: Vincenzo Maffione Date: Fri, 13 Apr 2018 22:48:27 +0200 Message-ID: Subject: Re: svn commit: r332423 - in head/sys: conf dev/cxgbe dev/ixgbe dev/ixl dev/netmap dev/re modules/netmap net sys To: Justin Hibbits Cc: Vincenzo Maffione , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 20:48:31 -0000 Right, sorry for that. The fix is actually already in the upstream github, I'm preparing a commit to import that. Cheers, Vincenzo 2018-04-13 22:42 GMT+02:00 Justin Hibbits : > On Thu, Apr 12, 2018 at 2:20 AM, Vincenzo Maffione > wrote: > > Author: vmaffione > > Date: Thu Apr 12 07:20:50 2018 > > New Revision: 332423 > > URL: https://svnweb.freebsd.org/changeset/base/332423 > > > > Log: > > netmap: align codebase to the current upstream (commit id > 3fb001303718146) > > > > Changelist: > > - Turn tx_rings and rx_rings arrays into arrays of pointers to > kring > > structs. This patch includes fixes for ixv, ixl, ix, re, cxgbe, > iflib, > > vtnet and ptnet drivers to cope with the change. > > - Generalize the nm_config() callback to accept a struct > containing many > > parameters. > > - Introduce NKR_FAKERING to support buffers sharing (used for > netmap > > pipes) > > - Improved API for external VALE modules. > > - Various bug fixes and improvements to the netmap memory > allocator, > > including support for externally (userspace) allocated memory. > > - Refactoring of netmap pipes: now linked rings share the same > netmap > > buffers, with a separate set of kring pointers (rhead, rcur, > rtail). > > Buffer swapping does not need to happen anymore. > > - Large refactoring of the control API towards an extensible > solution; > > the goal is to allow the addition of more commands and extension > of > > existing ones (with new options) without the need of hacks or the > > risk of running out of configuration space. > > A new NIOCCTRL ioctl has been added to handle all the requests > of the > > new control API, which cover all the functionalities so far > supported. > > The netmap API bumps from 11 to 12 with this patch. Full backward > > compatibility is provided for the old control command > (NIOCREGIF), by > > means of a new netmap_legacy module. Many parts of the old > netmap.h > > header has now been moved to netmap_legacy.h (included by > netmap.h). > > > > Approved by: hrs (mentor) > > > > Added: > > head/sys/dev/netmap/netmap_legacy.c (contents, props changed) > > head/sys/net/netmap_legacy.h (contents, props changed) > > Modified: > > head/sys/conf/files > > head/sys/dev/cxgbe/t4_netmap.c > > head/sys/dev/ixgbe/if_ixv.c > > head/sys/dev/ixl/ixl_pf_main.c > > head/sys/dev/ixl/ixl_txrx.c > > head/sys/dev/netmap/if_ptnet.c > > head/sys/dev/netmap/if_re_netmap.h > > head/sys/dev/netmap/if_vtnet_netmap.h > > head/sys/dev/netmap/netmap.c > > head/sys/dev/netmap/netmap_freebsd.c > > head/sys/dev/netmap/netmap_generic.c > > head/sys/dev/netmap/netmap_kern.h > > head/sys/dev/netmap/netmap_mem2.c > > head/sys/dev/netmap/netmap_mem2.h > > head/sys/dev/netmap/netmap_monitor.c > > head/sys/dev/netmap/netmap_pipe.c > > head/sys/dev/netmap/netmap_pt.c > > head/sys/dev/netmap/netmap_vale.c > > head/sys/dev/re/if_re.c > > head/sys/modules/netmap/Makefile > > head/sys/net/iflib.c > > head/sys/net/netmap.h > > head/sys/net/netmap_user.h > > head/sys/net/netmap_virt.h > > head/sys/sys/param.h > > This breaks 32-bit powerpc LINT, with errors of: > > /usr/src/sys/dev/netmap/netmap.c: In function 'netmap_get_na': > /usr/src/sys/dev/netmap/netmap.c:1479: warning: cast to pointer from > integer of different size [-Wint-to-pointer-cast] > /usr/src/sys/dev/netmap/netmap.c: In function 'netmap_ioctl': > /usr/src/sys/dev/netmap/netmap.c:2329: warning: cast to pointer from > integer of different size [-Wint-to-pointer-cast] > /usr/src/sys/dev/netmap/netmap.c:2344: warning: cast to pointer from > integer of different size [-Wint-to-pointer-cast] > /usr/src/sys/dev/netmap/netmap.c:2447: warning: cast to pointer from > integer of different size [-Wint-to-pointer-cast] > /usr/src/sys/dev/netmap/netmap.c:2466: warning: cast from pointer to > integer of different size [-Wpointer-to-int-cast] > > among others. > > struct nmreq_header->nr_body is a uint64_t, casting to 32-bit pointers > needs to go through uintptr_t. > > - Justin > -- Vincenzo Maffione From owner-svn-src-all@freebsd.org Fri Apr 13 21:18:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6063CF82541; Fri, 13 Apr 2018 21:18:07 +0000 (UTC) (envelope-from brooks@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 105D86ACCB; Fri, 13 Apr 2018 21:18:07 +0000 (UTC) (envelope-from brooks@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 096121F0B3; Fri, 13 Apr 2018 21:18:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DLI6hl079128; Fri, 13 Apr 2018 21:18:06 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DLI5YW079110; Fri, 13 Apr 2018 21:18:05 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804132118.w3DLI5YW079110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 13 Apr 2018 21:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332490 - in head: . contrib/bsnmp/snmp_mibII lib/libc/net share/man/man4 stand/i386/libi386 sys/conf sys/dev/cm sys/modules sys/modules/arcnet sys/modules/cm sys/net sys/netinet sys/ne... X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . contrib/bsnmp/snmp_mibII lib/libc/net share/man/man4 stand/i386/libi386 sys/conf sys/dev/cm sys/modules sys/modules/arcnet sys/modules/cm sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 332490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 21:18:07 -0000 Author: brooks Date: Fri Apr 13 21:18:04 2018 New Revision: 332490 URL: https://svnweb.freebsd.org/changeset/base/332490 Log: Remove support for the Arcnet protocol. While Arcnet has some continued deployment in industrial controls, the lack of drivers for any of the PCI, USB, or PCIe NICs on the market suggests such users aren't running FreeBSD. Evidence in the PR database suggests that the cm(4) driver (our sole Arcnet NIC) was broken in 5.0 and has not worked since. PR: 182297 Reviewed by: jhibbits, vangyzen Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15057 Deleted: head/share/man/man4/cm.4 head/sys/dev/cm/if_cm_isa.c head/sys/dev/cm/smc90cx6.c head/sys/dev/cm/smc90cx6reg.h head/sys/dev/cm/smc90cx6var.h head/sys/modules/arcnet/Makefile head/sys/modules/cm/Makefile head/sys/net/if_arc.h head/sys/net/if_arcsubr.c Modified: head/ObsoleteFiles.inc head/UPDATING head/contrib/bsnmp/snmp_mibII/mibII.c head/lib/libc/net/getnameinfo.c head/share/man/man4/Makefile head/stand/i386/libi386/pxe.h head/sys/conf/NOTES head/sys/conf/files head/sys/conf/files.i386 head/sys/modules/Makefile head/sys/net/if.c head/sys/net/if_arp.h head/sys/netinet/if_ether.c head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Apr 13 20:30:49 2018 (r332489) +++ head/ObsoleteFiles.inc Fri Apr 13 21:18:04 2018 (r332490) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20180413: remove Arcnet support +OLD_FILES+=usr/include/net/if_arc.h +OLD_FILES+=usr/share/man/man4/cm.4 # 20180409: remove FDDI support OLD_FILES+=usr/include/net/fddi.h OLD_FILES+=usr/share/man/man4/fpa.4.gz Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 13 20:30:49 2018 (r332489) +++ head/UPDATING Fri Apr 13 21:18:04 2018 (r332490) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180413: + Support for Arcnet networks has been removed. If you have device + arcnet or device cm in your kernel config file they must be + removed. + 20180411: Support for FDDI networks has been removed. If you have device fddi or device fpa in your kernel config file they must be Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Fri Apr 13 20:30:49 2018 (r332489) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Fri Apr 13 21:18:04 2018 (r332490) @@ -846,7 +846,6 @@ static void check_llbcast(struct mibif *ifp) { static u_char ether_bcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - static u_char arcnet_bcast = 0; struct mibrcvaddr *rcv; if (!(ifp->mib.ifmd_flags & IFF_BROADCAST)) @@ -860,12 +859,6 @@ check_llbcast(struct mibif *ifp) case IFT_L2VLAN: if (mib_find_rcvaddr(ifp->index, ether_bcast, 6) == NULL && (rcv = mib_rcvaddr_create(ifp, ether_bcast, 6)) != NULL) - rcv->flags |= MIBRCVADDR_BCAST; - break; - - case IFT_ARCNET: - if (mib_find_rcvaddr(ifp->index, &arcnet_bcast, 1) == NULL && - (rcv = mib_rcvaddr_create(ifp, &arcnet_bcast, 1)) != NULL) rcv->flags |= MIBRCVADDR_BCAST; break; } Modified: head/lib/libc/net/getnameinfo.c ============================================================================== --- head/lib/libc/net/getnameinfo.c Fri Apr 13 20:30:49 2018 (r332489) +++ head/lib/libc/net/getnameinfo.c Fri Apr 13 21:18:04 2018 (r332490) @@ -481,7 +481,6 @@ getnameinfo_link(const struct afd *afd, * IFT_OTHER (netinet/ip_ipip.c) */ /* default below is believed correct for all these. */ - case IFT_ARCNET: case IFT_ETHER: case IFT_FDDI: case IFT_HIPPI: Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Apr 13 20:30:49 2018 (r332489) +++ head/share/man/man4/Makefile Fri Apr 13 21:18:04 2018 (r332490) @@ -120,7 +120,6 @@ MAN= aac.4 \ chromebook_platform.4 \ ciss.4 \ cloudabi.4 \ - cm.4 \ cmx.4 \ ${_coretemp.4} \ ${_cpuctl.4} \ Modified: head/stand/i386/libi386/pxe.h ============================================================================== --- head/stand/i386/libi386/pxe.h Fri Apr 13 20:30:49 2018 (r332489) +++ head/stand/i386/libi386/pxe.h Fri Apr 13 21:18:04 2018 (r332490) @@ -245,7 +245,6 @@ typedef struct { # define ETHER_TYPE 1 # define EXP_ETHER_TYPE 2 # define IEEE_TYPE 6 -# define ARCNET_TYPE 7 uint16_t HwAddrLen; /* Length of hardware address */ MAC_ADDR CurrentNodeAddress; /* Current hardware address */ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/conf/NOTES Fri Apr 13 21:18:04 2018 (r332490) @@ -845,9 +845,6 @@ device wlan_xauth device wlan_acl device wlan_amrr -# The `arcnet' device provides generic code to support Arcnet. -device arcnet - # The `sppp' device serves a similar role for certain types # of synchronous PPP links (like `cx', `ar'). device sppp Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/conf/files Fri Apr 13 21:18:04 2018 (r332490) @@ -1362,7 +1362,6 @@ dev/cfi/cfi_dev.c optional cfi dev/cfi/cfi_disk.c optional cfid dev/chromebook_platform/chromebook_platform.c optional chromebook_platform dev/ciss/ciss.c optional ciss -dev/cm/smc90cx6.c optional cm dev/cmx/cmx.c optional cmx dev/cmx/cmx_pccard.c optional cmx pccard dev/cpufreq/ichss.c optional cpufreq pci @@ -4127,7 +4126,6 @@ net/bridgestp.c optional bridge | if_bridge net/flowtable.c optional flowtable inet | flowtable inet6 net/ieee8023ad_lacp.c optional lagg net/if.c standard -net/if_arcsubr.c optional arcnet net/if_bridge.c optional bridge inet | if_bridge inet net/if_clone.c standard net/if_dead.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/conf/files.i386 Fri Apr 13 21:18:04 2018 (r332490) @@ -185,7 +185,6 @@ dev/ce/ceddk.c optional ce dev/ce/if_ce.c optional ce dev/ce/tau32-ddk.c optional ce \ compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" -dev/cm/if_cm_isa.c optional cm isa dev/coretemp/coretemp.c optional coretemp dev/cp/cpddk.c optional cp dev/cp/if_cp.c optional cp Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/modules/Makefile Fri Apr 13 21:18:04 2018 (r332490) @@ -42,7 +42,6 @@ SUBDIR= \ ${_aout} \ ${_apm} \ ${_arcmsr} \ - ${_arcnet} \ ${_armv8crypto} \ ${_asmc} \ ata \ @@ -92,7 +91,6 @@ SUBDIR= \ cloudabi \ ${_cloudabi32} \ ${_cloudabi64} \ - ${_cm} \ ${_cmx} \ ${_coff} \ ${_coretemp} \ @@ -744,7 +742,6 @@ _3dfx= 3dfx _3dfx_linux= 3dfx_linux _aic= aic _apm= apm -_arcnet= arcnet .if ${MK_SOURCELESS_UCODE} != "no" _ce= ce .endif @@ -763,7 +760,6 @@ _pcfclock= pcfclock _pst= pst _sbni= sbni _stg= stg -_cm= cm .if ${MK_SOURCELESS_UCODE} != "no" _ctau= ctau .endif Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/net/if.c Fri Apr 13 21:18:04 2018 (r332490) @@ -3695,7 +3695,6 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, case IFT_XETHER: case IFT_L2VLAN: case IFT_BRIDGE: - case IFT_ARCNET: case IFT_IEEE8023ADLAG: bcopy(lladdr, LLADDR(sdl), len); ifa_free(ifa); Modified: head/sys/net/if_arp.h ============================================================================== --- head/sys/net/if_arp.h Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/net/if_arp.h Fri Apr 13 21:18:04 2018 (r332490) @@ -49,7 +49,6 @@ struct arphdr { u_short ar_hrd; /* format of hardware address */ #define ARPHRD_ETHER 1 /* ethernet hardware format */ #define ARPHRD_IEEE802 6 /* token-ring hardware format */ -#define ARPHRD_ARCNET 7 /* arcnet hardware format */ #define ARPHRD_FRELAY 15 /* frame relay hardware format */ #define ARPHRD_IEEE1394 24 /* firewire hardware format */ #define ARPHRD_INFINIBAND 32 /* infiniband hardware format */ Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/netinet/if_ether.c Fri Apr 13 21:18:04 2018 (r332490) @@ -694,10 +694,6 @@ arpintr(struct mbuf *m) hlen = ETHER_ADDR_LEN; /* RFC 826 */ layer = "ethernet"; break; - case ARPHRD_ARCNET: - hlen = 1; /* RFC 1201, ARC_ADDR_LEN */ - layer = "arcnet"; - break; case ARPHRD_INFINIBAND: hlen = 20; /* RFC 4391, INFINIBAND_ALEN */ layer = "infiniband"; Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/netinet6/in6.c Fri Apr 13 21:18:04 2018 (r332490) @@ -1974,8 +1974,6 @@ in6_if2idlen(struct ifnet *ifp) return (64); case IFT_PPP: /* RFC2472 */ return (64); - case IFT_ARCNET: /* RFC2497 */ - return (64); case IFT_FRELAY: /* RFC2590 */ return (64); case IFT_IEEE1394: /* RFC3146 */ Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/netinet6/in6_ifattach.c Fri Apr 13 21:18:04 2018 (r332490) @@ -316,26 +316,6 @@ found: } break; - case IFT_ARCNET: - if (addrlen != 1) { - IF_ADDR_RUNLOCK(ifp); - return -1; - } - if (!addr[0]) { - IF_ADDR_RUNLOCK(ifp); - return -1; - } - - bzero(&in6->s6_addr[8], 8); - in6->s6_addr[15] = addr[0]; - - /* - * due to insufficient bitwidth, we mark it local. - */ - in6->s6_addr[8] &= ~EUI64_GBIT; /* g bit to "individual" */ - in6->s6_addr[8] |= EUI64_UBIT; /* u bit to "local" */ - break; - case IFT_GIF: case IFT_STF: /* Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/netinet6/nd6.c Fri Apr 13 21:18:04 2018 (r332490) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -334,16 +333,8 @@ nd6_setmtu0(struct ifnet *ifp, struct nd_ifinfo *ndi) u_int32_t omaxmtu; omaxmtu = ndi->maxmtu; + ndi->maxmtu = ifp->if_mtu; - switch (ifp->if_type) { - case IFT_ARCNET: - ndi->maxmtu = MIN(ARC_PHDS_MAXMTU, ifp->if_mtu); /* RFC2497 */ - break; - default: - ndi->maxmtu = ifp->if_mtu; - break; - } - /* * Decreasing the interface MTU under IPV6 minimum MTU may cause * undesirable situation. We thus notify the operator of the change @@ -2519,13 +2510,12 @@ nd6_need_cache(struct ifnet *ifp) { /* * XXX: we currently do not make neighbor cache on any interface - * other than ARCnet, Ethernet and GIF. + * other than Ethernet and GIF. * * RFC2893 says: * - unidirectional tunnels needs no ND */ switch (ifp->if_type) { - case IFT_ARCNET: case IFT_ETHER: case IFT_IEEE1394: case IFT_L2VLAN: Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Fri Apr 13 20:30:49 2018 (r332489) +++ head/sys/netinet6/nd6_nbr.c Fri Apr 13 21:18:04 2018 (r332490) @@ -1090,7 +1090,6 @@ caddr_t nd6_ifptomac(struct ifnet *ifp) { switch (ifp->if_type) { - case IFT_ARCNET: case IFT_ETHER: case IFT_IEEE1394: case IFT_L2VLAN: From owner-svn-src-all@freebsd.org Fri Apr 13 21:19:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1C55F8266F; Fri, 13 Apr 2018 21:19:03 +0000 (UTC) (envelope-from kp@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 574266B636; Fri, 13 Apr 2018 21:19:03 +0000 (UTC) (envelope-from kp@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 5172D1F0C2; Fri, 13 Apr 2018 21:19:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DLJ3aF079215; Fri, 13 Apr 2018 21:19:03 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DLJ3Ze079214; Fri, 13 Apr 2018 21:19:03 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804132119.w3DLJ3Ze079214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 21:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332491 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 332491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 21:19:03 -0000 Author: kp Date: Fri Apr 13 21:19:03 2018 New Revision: 332491 URL: https://svnweb.freebsd.org/changeset/base/332491 Log: MFC r332136: pf: Improve ioctl validation for DIOCIGETIFACES and DIOCXCOMMIT These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow. There's no obvious limit to the request size for these, so we limit the requests to something which won't overflow. Change the memory allocation to M_NOWAIT so excessive requests will fail rather than stall forever. Modified: stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 21:18:04 2018 (r332490) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 21:19:03 2018 (r332491) @@ -3115,10 +3115,17 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } + totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); - if (! ioes) { + M_TEMP, M_NOWAIT); + if (ioes == NULL) { error = ENOMEM; break; } @@ -3321,13 +3328,20 @@ DIOCCHANGEADDR_error: break; } + if (io->pfiio_size < 0 || + WOULD_OVERFLOW(io->pfiio_size, sizeof(struct pfi_kif))) { + error = EINVAL; + break; + } + bufsiz = io->pfiio_size * sizeof(struct pfi_kif); ifstore = mallocarray(io->pfiio_size, sizeof(struct pfi_kif), - M_TEMP, M_WAITOK); - if (! ifstore) { + M_TEMP, M_NOWAIT); + if (ifstore == NULL) { error = ENOMEM; break; } + PF_RULES_RLOCK(); pfi_get_ifaces(io->pfiio_name, ifstore, &io->pfiio_size); PF_RULES_RUNLOCK(); From owner-svn-src-all@freebsd.org Fri Apr 13 21:19:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E044F826B8; Fri, 13 Apr 2018 21:19:07 +0000 (UTC) (envelope-from kp@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 EDB906B6D8; Fri, 13 Apr 2018 21:19:06 +0000 (UTC) (envelope-from kp@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 DD0A21F0C3; Fri, 13 Apr 2018 21:19:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DLJ6TI079264; Fri, 13 Apr 2018 21:19:06 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DLJ6fU079263; Fri, 13 Apr 2018 21:19:06 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804132119.w3DLJ6fU079263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 21:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332492 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/10/sys/netpfil/pf X-SVN-Commit-Revision: 332492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 21:19:07 -0000 Author: kp Date: Fri Apr 13 21:19:06 2018 New Revision: 332492 URL: https://svnweb.freebsd.org/changeset/base/332492 Log: MFC r332136: pf: Improve ioctl validation for DIOCIGETIFACES and DIOCXCOMMIT These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow. There's no obvious limit to the request size for these, so we limit the requests to something which won't overflow. Change the memory allocation to M_NOWAIT so excessive requests will fail rather than stall forever. Modified: stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 21:19:03 2018 (r332491) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 21:19:06 2018 (r332492) @@ -3105,10 +3105,17 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } + totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); - if (! ioes) { + M_TEMP, M_NOWAIT); + if (ioes == NULL) { error = ENOMEM; break; } @@ -3311,13 +3318,20 @@ DIOCCHANGEADDR_error: break; } + if (io->pfiio_size < 0 || + WOULD_OVERFLOW(io->pfiio_size, sizeof(struct pfi_kif))) { + error = EINVAL; + break; + } + bufsiz = io->pfiio_size * sizeof(struct pfi_kif); ifstore = mallocarray(io->pfiio_size, sizeof(struct pfi_kif), - M_TEMP, M_WAITOK); - if (! ifstore) { + M_TEMP, M_NOWAIT); + if (ifstore == NULL) { error = ENOMEM; break; } + PF_RULES_RLOCK(); pfi_get_ifaces(io->pfiio_name, ifstore, &io->pfiio_size); PF_RULES_RUNLOCK(); From owner-svn-src-all@freebsd.org Fri Apr 13 22:02:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DB9FF85ABF for ; Fri, 13 Apr 2018 22:02:23 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x233.google.com (mail-yb0-x233.google.com [IPv6:2607:f8b0:4002:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3025574E5C for ; Fri, 13 Apr 2018 22:02:23 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x233.google.com with SMTP id c1-v6so4991232ybm.2 for ; Fri, 13 Apr 2018 15:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cwGbEJpYwaKCDfQxhqw542eLJ0q4oImNPiPyEcP20iI=; b=eJQ7sCmH36qdSpSPzDz1Ds/9iC6MxWZH4AbiZbK60aUHtXN+QJyb6uQpHu8cOlyUpf UlqFnvT3+kWvi+V53gCzXnQW14PCAuQruzKOL29PKpHUqZQojyq/cLCNHC2wbpOC5wyY KuRzpRDFVHZLrCoTtFR727sgV6ZyHWO9oLL0LqTwoIcE7rVqwIJvdbeTmLy40LtWgmGd ELrqAlyW+wBcp/wo/gMAOrbdgk89wbPsBzvbp6ctdBvxNL/jSW6hMRhay5YiSaTueJ3F WPN5khj1JKLqkt0x0qTpmQNBvVFCLsiH+FVfOT9dYxQie7LJDXvmrPSdsyBYglpHUpuD CYMw== 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=cwGbEJpYwaKCDfQxhqw542eLJ0q4oImNPiPyEcP20iI=; b=pGBOjaB1bJYDNXrI+DKs94kVVNfA7OEW6obW4lsEnVDeks5H2SVOdY9YTB5lYd6LyZ pbK75T7b9tNQxXG7xFyiIW2Xe+/DlJ/sP3kCusWEUxbpR+WcnWeaVqA7Gh7FycpNN38W Hzanl5EpcL1qSEvDJGICvmmW/GfJOdtsajAX9WtkvMbkwcchaXO7on/r0dFR+FkB6x8n yricXoSz5pXvn3vL1/s/GDZgyiPq/HkD14Nu4Z8/nQJOMObZxzCJH2GCe8rrjOoLGln3 2WddL8hscdWbowneMhw3dVJa+bdroRw8VaiGYYR6+CRhG78Ook3u4NU8IsnpXlkKuJ++ MeEQ== X-Gm-Message-State: ALQs6tAhT5KHAig52u6P0PeYVh6SeVwJ2hfTvceGKI+dLRw1n04RVuY5 hemyKmII8hOPL86Q6u6dbDwN52uL1y3Z+vlKEKd9pA== X-Google-Smtp-Source: AIpwx4/hrptT2lpnLZKvWTXjNUMrlg2/k12cB8CfW9aD1T8Mlj9qclyPO7vB7xfkTZlafSG5oM6aQS0qiHzkStH4an0= X-Received: by 2002:a25:dc53:: with SMTP id y80-v6mr6233123ybe.331.1523656942694; Fri, 13 Apr 2018 15:02:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ae64:0:0:0:0:0 with HTTP; Fri, 13 Apr 2018 15:02:22 -0700 (PDT) In-Reply-To: <201804131331.w3DDVKod044086@repo.freebsd.org> References: <201804131331.w3DDVKod044086@repo.freebsd.org> From: Oliver Pinter Date: Sat, 14 Apr 2018 00:02:22 +0200 Message-ID: Subject: Re: svn commit: r332471 - head/sys/dev/ocs_fc To: Ram Kishore Vegesna Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Bruce Evans Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 22:02:23 -0000 On Friday, April 13, 2018, Ram Kishore Vegesna wrote: > Author: ram > Date: Fri Apr 13 13:31:20 2018 > New Revision: 332471 > URL: https://svnweb.freebsd.org/changeset/base/332471 > > Log: > Check if STACK is defined before using the stack(9). > > PR: 227446 > Reported by: emaste > Approved by: ken > > Modified: > head/sys/dev/ocs_fc/ocs_os.c > > Modified: head/sys/dev/ocs_fc/ocs_os.c > ============================================================ > ================== > --- head/sys/dev/ocs_fc/ocs_os.c Fri Apr 13 13:23:31 2018 > (r332470) > +++ head/sys/dev/ocs_fc/ocs_os.c Fri Apr 13 13:31:20 2018 > (r332471) > @@ -37,6 +37,7 @@ > */ > > #include "ocs.h" > +#include "opt_stack.h" These types of includes - where you includes opts - should go before any other includes. > #include > #include > #include /* for debug of memory allocations > */ > @@ -855,11 +856,13 @@ void ocs_intr_enable(ocs_os_handle_t os) > > void ocs_print_stack(void) > { > +#if defined(STACK) > struct stack st; > > stack_zero(&st); > stack_save(&st); > stack_print(&st); > +#endif > } > > void ocs_abort(void) > _______________________________________________ > 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-all@freebsd.org Fri Apr 13 22:32:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39BADF87B81; Fri, 13 Apr 2018 22:32:29 +0000 (UTC) (envelope-from brooks@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 E04A17C0E7; Fri, 13 Apr 2018 22:32:28 +0000 (UTC) (envelope-from brooks@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 DAB201FD5F; Fri, 13 Apr 2018 22:32:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DMWSGk019258; Fri, 13 Apr 2018 22:32:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DMWSmI019256; Fri, 13 Apr 2018 22:32:28 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804132232.w3DMWSmI019256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 13 Apr 2018 22:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332493 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 332493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 22:32:29 -0000 Author: brooks Date: Fri Apr 13 22:32:28 2018 New Revision: 332493 URL: https://svnweb.freebsd.org/changeset/base/332493 Log: MFC r332088: Add 32-bit compat for ioctls that take struct ifgroupreq. Use an accessor to access ifgr_group and ifgr_groups. Use an macro CASE_IOC_IFGROUPREQ(cmd) in place of case statements such as "case SIOCAIFGROUP:". This avoids poluting the switch statements with large numbers of #ifdefs. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14960 Modified: stable/11/sys/net/if.c stable/11/sys/net/if.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Fri Apr 13 21:19:06 2018 (r332492) +++ stable/11/sys/net/if.c Fri Apr 13 22:32:28 2018 (r332493) @@ -133,8 +133,25 @@ struct ifreq32 { CTASSERT(sizeof(struct ifreq) == sizeof(struct ifreq32)); CTASSERT(__offsetof(struct ifreq, ifr_ifru) == __offsetof(struct ifreq32, ifr_ifru)); -#endif +struct ifgroupreq32 { + char ifgr_name[IFNAMSIZ]; + u_int ifgr_len; + union { + char ifgru_group[IFNAMSIZ]; + uint32_t ifgru_groups; + } ifgr_ifgru; +}; +#define _CASE_IOC_IFGROUPREQ_32(cmd) \ + case _IOC_NEWTYPE((cmd), struct ifgroupreq32): +#else +#define _CASE_IOC_IFGROUPREQ_32(cmd) +#endif /* COMPAT_FREEBSD32 */ + +#define CASE_IOC_IFGROUPREQ(cmd) \ + _CASE_IOC_IFGROUPREQ_32(cmd) \ + case (cmd) + union ifreq_union { struct ifreq ifr; #ifdef COMPAT_FREEBSD32 @@ -142,6 +159,13 @@ union ifreq_union { #endif }; +union ifgroupreq_union { + struct ifgroupreq ifgr; +#ifdef COMPAT_FREEBSD32 + struct ifgroupreq32 ifgr32; +#endif +}; + SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); @@ -1490,17 +1514,42 @@ if_delgroups(struct ifnet *ifp) IFNET_WUNLOCK(); } +static char * +ifgr_group_get(void *ifgrp) +{ + union ifgroupreq_union *ifgrup; + + ifgrup = ifgrp; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return (&ifgrup->ifgr32.ifgr_ifgru.ifgru_group[0]); +#endif + return (&ifgrup->ifgr.ifgr_ifgru.ifgru_group[0]); +} + +static struct ifg_req * +ifgr_groups_get(void *ifgrp) +{ + union ifgroupreq_union *ifgrup; + + ifgrup = ifgrp; +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return ((struct ifg_req *)(uintptr_t) + ifgrup->ifgr32.ifgr_ifgru.ifgru_groups); +#endif + return (ifgrup->ifgr.ifgr_ifgru.ifgru_groups); +} + /* - * Stores all groups from an interface in memory pointed - * to by data + * Stores all groups from an interface in memory pointed to by ifgr. */ static int -if_getgroup(struct ifgroupreq *data, struct ifnet *ifp) +if_getgroup(struct ifgroupreq *ifgr, struct ifnet *ifp) { int len, error; struct ifg_list *ifgl; struct ifg_req ifgrq, *ifgp; - struct ifgroupreq *ifgr = data; if (ifgr->ifgr_len == 0) { IF_ADDR_RLOCK(ifp); @@ -1511,7 +1560,7 @@ if_getgroup(struct ifgroupreq *data, struct ifnet *ifp } len = ifgr->ifgr_len; - ifgp = ifgr->ifgr_groups; + ifgp = ifgr_groups_get(ifgr); /* XXX: wire */ IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) { @@ -1535,12 +1584,11 @@ if_getgroup(struct ifgroupreq *data, struct ifnet *ifp } /* - * Stores all members of a group in memory pointed to by data + * Stores all members of a group in memory pointed to by igfr */ static int -if_getgroupmembers(struct ifgroupreq *data) +if_getgroupmembers(struct ifgroupreq *ifgr) { - struct ifgroupreq *ifgr = data; struct ifg_group *ifg; struct ifg_member *ifgm; struct ifg_req ifgrq, *ifgp; @@ -1563,7 +1611,7 @@ if_getgroupmembers(struct ifgroupreq *data) } len = ifgr->ifgr_len; - ifgp = ifgr->ifgr_groups; + ifgp = ifgr_groups_get(ifgr); TAILQ_FOREACH(ifgm, &ifg->ifg_members, ifgm_next) { if (len < sizeof(ifgrq)) { IFNET_RUNLOCK(); @@ -2793,34 +2841,28 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, error = if_gethwaddr(ifp, ifr); break; - case SIOCAIFGROUP: - { - struct ifgroupreq *ifgr = (struct ifgroupreq *)ifr; - + CASE_IOC_IFGROUPREQ(SIOCAIFGROUP): error = priv_check(td, PRIV_NET_ADDIFGROUP); if (error) return (error); - if ((error = if_addgroup(ifp, ifgr->ifgr_group))) + if ((error = if_addgroup(ifp, + ifgr_group_get((struct ifgroupreq *)data)))) return (error); break; - } - case SIOCGIFGROUP: - if ((error = if_getgroup((struct ifgroupreq *)ifr, ifp))) + CASE_IOC_IFGROUPREQ(SIOCGIFGROUP): + if ((error = if_getgroup((struct ifgroupreq *)data, ifp))) return (error); break; - case SIOCDIFGROUP: - { - struct ifgroupreq *ifgr = (struct ifgroupreq *)ifr; - + CASE_IOC_IFGROUPREQ(SIOCDIFGROUP): error = priv_check(td, PRIV_NET_DELIFGROUP); if (error) return (error); - if ((error = if_delgroup(ifp, ifgr->ifgr_group))) + if ((error = if_delgroup(ifp, + ifgr_group_get((struct ifgroupreq *)data)))) return (error); break; - } default: error = ENOIOCTL; @@ -2926,7 +2968,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s error = if_clone_list((struct if_clonereq *)data); CURVNET_RESTORE(); return (error); - case SIOCGIFGMEMB: + CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB): error = if_getgroupmembers((struct ifgroupreq *)data); CURVNET_RESTORE(); return (error); Modified: stable/11/sys/net/if.h ============================================================================== --- stable/11/sys/net/if.h Fri Apr 13 21:19:06 2018 (r332492) +++ stable/11/sys/net/if.h Fri Apr 13 22:32:28 2018 (r332493) @@ -512,8 +512,10 @@ struct ifgroupreq { char ifgru_group[IFNAMSIZ]; struct ifg_req *ifgru_groups; } ifgr_ifgru; +#ifndef _KERNEL #define ifgr_group ifgr_ifgru.ifgru_group #define ifgr_groups ifgr_ifgru.ifgru_groups +#endif }; /* From owner-svn-src-all@freebsd.org Fri Apr 13 22:33:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01B43F87C6D; Fri, 13 Apr 2018 22:33:19 +0000 (UTC) (envelope-from kp@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 AB52F7C8FB; Fri, 13 Apr 2018 22:33:18 +0000 (UTC) (envelope-from kp@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 A65011FD65; Fri, 13 Apr 2018 22:33:18 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DMXIr1019364; Fri, 13 Apr 2018 22:33:18 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DMXIEW019361; Fri, 13 Apr 2018 22:33:18 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804132233.w3DMXIEW019361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 22:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332494 - in stable/10/sys: net netpfil/pf X-SVN-Group: stable-10 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/10/sys: net netpfil/pf X-SVN-Commit-Revision: 332494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 22:33:19 -0000 Author: kp Date: Fri Apr 13 22:33:18 2018 New Revision: 332494 URL: https://svnweb.freebsd.org/changeset/base/332494 Log: MFC r332107: pf: Improve ioctl validation for DIOCRGETTABLES, DIOCRGETTSTATS, DIOCRCLRTSTATS and DIOCRSETTFLAGS These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow. Limit the allocation to required size (or the user allocation, if that's smaller). That does mean we need to do the allocation with the rules lock held (so the number doesn't change while we're doing this), so it can't M_WAITOK. Modified: stable/10/sys/net/pfvar.h stable/10/sys/netpfil/pf/pf_ioctl.c stable/10/sys/netpfil/pf/pf_table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/pfvar.h ============================================================================== --- stable/10/sys/net/pfvar.h Fri Apr 13 22:32:28 2018 (r332493) +++ stable/10/sys/net/pfvar.h Fri Apr 13 22:33:18 2018 (r332494) @@ -1627,6 +1627,7 @@ void pfr_detach_table(struct pfr_ktable *); int pfr_clr_tables(struct pfr_table *, int *, int); int pfr_add_tables(struct pfr_table *, int, int *, int); int pfr_del_tables(struct pfr_table *, int, int *, int); +int pfr_table_count(struct pfr_table *, int); int pfr_get_tables(struct pfr_table *, struct pfr_table *, int *, int); int pfr_get_tstats(struct pfr_table *, struct pfr_tstats *, int *, int); int pfr_clr_tstats(struct pfr_table *, int, int *, int); Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 22:32:28 2018 (r332493) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 22:33:18 2018 (r332494) @@ -2571,20 +2571,25 @@ DIOCCHANGEADDR_error: case DIOCRGETTABLES: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + PF_RULES_RLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_RUNLOCK(); break; } - PF_RULES_RLOCK(); error = pfr_get_tables(&io->pfrio_table, pfrts, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_RUNLOCK(); @@ -2597,20 +2602,24 @@ DIOCCHANGEADDR_error: case DIOCRGETTSTATS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_tstats *pfrtstats; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_tstats)) { error = ENODEV; break; } + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_tstats); pfrtstats = mallocarray(io->pfrio_size, - sizeof(struct pfr_tstats), M_TEMP, M_WAITOK); - if (! pfrtstats) { + sizeof(struct pfr_tstats), M_TEMP, M_NOWAIT); + if (pfrtstats == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_get_tstats(&io->pfrio_table, pfrtstats, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_WUNLOCK(); @@ -2623,25 +2632,31 @@ DIOCCHANGEADDR_error: case DIOCRCLRTSTATS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_clr_tstats(pfrts, io->pfrio_size, &io->pfrio_nzero, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_WUNLOCK(); @@ -2652,25 +2667,31 @@ DIOCCHANGEADDR_error: case DIOCRSETTFLAGS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_set_tflags(pfrts, io->pfrio_size, io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange, &io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL); Modified: stable/10/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_table.c Fri Apr 13 22:32:28 2018 (r332493) +++ stable/10/sys/netpfil/pf/pf_table.c Fri Apr 13 22:33:18 2018 (r332494) @@ -174,7 +174,6 @@ static struct pfr_ktable *pfr_lookup_table(struct pfr_table *); static void pfr_clean_node_mask(struct pfr_ktable *, struct pfr_kentryworkq *); -static int pfr_table_count(struct pfr_table *, int); static int pfr_skip_table(struct pfr_table *, struct pfr_ktable *, int); static struct pfr_kentry @@ -1680,7 +1679,7 @@ pfr_fix_anchor(char *anchor) return (0); } -static int +int pfr_table_count(struct pfr_table *filter, int flags) { struct pf_ruleset *rs; From owner-svn-src-all@freebsd.org Fri Apr 13 22:33:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B5E1F87D5C; Fri, 13 Apr 2018 22:33:51 +0000 (UTC) (envelope-from kp@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 F30F97CEA0; Fri, 13 Apr 2018 22:33:50 +0000 (UTC) (envelope-from kp@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 EDF0D1FD66; Fri, 13 Apr 2018 22:33:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3DMXof0019436; Fri, 13 Apr 2018 22:33:50 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3DMXoOh019433; Fri, 13 Apr 2018 22:33:50 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804132233.w3DMXoOh019433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Apr 2018 22:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332495 - in stable/11/sys: net netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/11/sys: net netpfil/pf X-SVN-Commit-Revision: 332495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 22:33:51 -0000 Author: kp Date: Fri Apr 13 22:33:50 2018 New Revision: 332495 URL: https://svnweb.freebsd.org/changeset/base/332495 Log: MFC r332107: pf: Improve ioctl validation for DIOCRGETTABLES, DIOCRGETTSTATS, DIOCRCLRTSTATS and DIOCRSETTFLAGS These ioctls can process a number of items at a time, which puts us at risk of overflow in mallocarray() and of impossibly large allocations even if we don't overflow. Limit the allocation to required size (or the user allocation, if that's smaller). That does mean we need to do the allocation with the rules lock held (so the number doesn't change while we're doing this), so it can't M_WAITOK. Modified: stable/11/sys/net/pfvar.h stable/11/sys/netpfil/pf/pf_ioctl.c stable/11/sys/netpfil/pf/pf_table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/pfvar.h ============================================================================== --- stable/11/sys/net/pfvar.h Fri Apr 13 22:33:18 2018 (r332494) +++ stable/11/sys/net/pfvar.h Fri Apr 13 22:33:50 2018 (r332495) @@ -1633,6 +1633,7 @@ void pfr_detach_table(struct pfr_ktable *); int pfr_clr_tables(struct pfr_table *, int *, int); int pfr_add_tables(struct pfr_table *, int, int *, int); int pfr_del_tables(struct pfr_table *, int, int *, int); +int pfr_table_count(struct pfr_table *, int); int pfr_get_tables(struct pfr_table *, struct pfr_table *, int *, int); int pfr_get_tstats(struct pfr_table *, struct pfr_tstats *, int *, int); int pfr_clr_tstats(struct pfr_table *, int, int *, int); Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 22:33:18 2018 (r332494) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 22:33:50 2018 (r332495) @@ -2581,20 +2581,25 @@ DIOCCHANGEADDR_error: case DIOCRGETTABLES: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + PF_RULES_RLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); + pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_RUNLOCK(); break; } - PF_RULES_RLOCK(); error = pfr_get_tables(&io->pfrio_table, pfrts, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_RUNLOCK(); @@ -2607,20 +2612,24 @@ DIOCCHANGEADDR_error: case DIOCRGETTSTATS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_tstats *pfrtstats; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_tstats)) { error = ENODEV; break; } + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_tstats); pfrtstats = mallocarray(io->pfrio_size, - sizeof(struct pfr_tstats), M_TEMP, M_WAITOK); - if (! pfrtstats) { + sizeof(struct pfr_tstats), M_TEMP, M_NOWAIT); + if (pfrtstats == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_get_tstats(&io->pfrio_table, pfrtstats, &io->pfrio_size, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_WUNLOCK(); @@ -2633,25 +2642,31 @@ DIOCCHANGEADDR_error: case DIOCRCLRTSTATS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_clr_tstats(pfrts, io->pfrio_size, &io->pfrio_nzero, io->pfrio_flags | PFR_FLAG_USERIOCTL); PF_RULES_WUNLOCK(); @@ -2662,25 +2677,31 @@ DIOCCHANGEADDR_error: case DIOCRSETTFLAGS: { struct pfioc_table *io = (struct pfioc_table *)addr; struct pfr_table *pfrts; - size_t totlen; + size_t totlen, n; if (io->pfrio_esize != sizeof(struct pfr_table)) { error = ENODEV; break; } + + PF_RULES_WLOCK(); + n = pfr_table_count(&io->pfrio_table, io->pfrio_flags); + io->pfrio_size = min(io->pfrio_size, n); + totlen = io->pfrio_size * sizeof(struct pfr_table); pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table), - M_TEMP, M_WAITOK); - if (! pfrts) { + M_TEMP, M_NOWAIT); + if (pfrts == NULL) { error = ENOMEM; + PF_RULES_WUNLOCK(); break; } error = copyin(io->pfrio_buffer, pfrts, totlen); if (error) { free(pfrts, M_TEMP); + PF_RULES_WUNLOCK(); break; } - PF_RULES_WLOCK(); error = pfr_set_tflags(pfrts, io->pfrio_size, io->pfrio_setflag, io->pfrio_clrflag, &io->pfrio_nchange, &io->pfrio_ndel, io->pfrio_flags | PFR_FLAG_USERIOCTL); Modified: stable/11/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_table.c Fri Apr 13 22:33:18 2018 (r332494) +++ stable/11/sys/netpfil/pf/pf_table.c Fri Apr 13 22:33:50 2018 (r332495) @@ -175,7 +175,6 @@ static struct pfr_ktable *pfr_lookup_table(struct pfr_table *); static void pfr_clean_node_mask(struct pfr_ktable *, struct pfr_kentryworkq *); -static int pfr_table_count(struct pfr_table *, int); static int pfr_skip_table(struct pfr_table *, struct pfr_ktable *, int); static struct pfr_kentry @@ -1681,7 +1680,7 @@ pfr_fix_anchor(char *anchor) return (0); } -static int +int pfr_table_count(struct pfr_table *filter, int flags) { struct pf_ruleset *rs; From owner-svn-src-all@freebsd.org Sat Apr 14 00:12:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A62F8E807; Sat, 14 Apr 2018 00:12:17 +0000 (UTC) (envelope-from kp@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 1CBEB70BBF; Sat, 14 Apr 2018 00:12:17 +0000 (UTC) (envelope-from kp@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 F1AB420D0F; Sat, 14 Apr 2018 00:12:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3E0CGIU068408; Sat, 14 Apr 2018 00:12:16 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3E0CGLo068407; Sat, 14 Apr 2018 00:12:16 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804140012.w3E0CGLo068407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 14 Apr 2018 00:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332496 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 332496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 00:12:17 -0000 Author: kp Date: Sat Apr 14 00:12:16 2018 New Revision: 332496 URL: https://svnweb.freebsd.org/changeset/base/332496 Log: MFC r332142: pf: Improve ioctl validation Ensure that multiplications for memory allocations cannot overflow, and that we'll not try to allocate M_WAITOK for potentially overly large allocations. Modified: stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Fri Apr 13 22:33:50 2018 (r332495) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Sat Apr 14 00:12:16 2018 (r332496) @@ -2733,9 +2733,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2765,9 +2770,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2797,10 +2807,18 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || io->pfrio_size2 < 0) { + error = EINVAL; + break; + } count = max(io->pfrio_size, io->pfrio_size2); + if (WOULD_OVERFLOW(count, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = count * sizeof(struct pfr_addr); pfras = mallocarray(count, sizeof(struct pfr_addr), M_TEMP, - M_WAITOK); + M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2831,9 +2849,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2857,9 +2880,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_astats))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_astats); pfrastats = mallocarray(io->pfrio_size, - sizeof(struct pfr_astats), M_TEMP, M_WAITOK); + sizeof(struct pfr_astats), M_TEMP, M_NOWAIT); if (! pfrastats) { error = ENOMEM; break; @@ -2883,9 +2911,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2915,9 +2948,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2947,9 +2985,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2994,9 +3037,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! ioes) { error = ENOMEM; break; @@ -3065,9 +3113,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! ioes) { error = ENOMEM; break; From owner-svn-src-all@freebsd.org Sat Apr 14 00:20:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36C07F8F015; Sat, 14 Apr 2018 00:20:48 +0000 (UTC) (envelope-from kp@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 D78AA736CF; Sat, 14 Apr 2018 00:20:47 +0000 (UTC) (envelope-from kp@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 D26E920D49; Sat, 14 Apr 2018 00:20:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3E0KlKu069549; Sat, 14 Apr 2018 00:20:47 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3E0KlCv069548; Sat, 14 Apr 2018 00:20:47 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804140020.w3E0KlCv069548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 14 Apr 2018 00:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332497 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/10/sys/netpfil/pf X-SVN-Commit-Revision: 332497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 00:20:48 -0000 Author: kp Date: Sat Apr 14 00:20:47 2018 New Revision: 332497 URL: https://svnweb.freebsd.org/changeset/base/332497 Log: MFC r332142: pf: Improve ioctl validation Ensure that multiplications for memory allocations cannot overflow, and that we'll not try to allocate M_WAITOK for potentially overly large allocations. Modified: stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Sat Apr 14 00:12:16 2018 (r332496) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Sat Apr 14 00:20:47 2018 (r332497) @@ -2723,9 +2723,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2755,9 +2760,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2787,10 +2797,18 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || io->pfrio_size2 < 0) { + error = EINVAL; + break; + } count = max(io->pfrio_size, io->pfrio_size2); + if (WOULD_OVERFLOW(count, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = count * sizeof(struct pfr_addr); pfras = mallocarray(count, sizeof(struct pfr_addr), M_TEMP, - M_WAITOK); + M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2821,9 +2839,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2847,9 +2870,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_astats))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_astats); pfrastats = mallocarray(io->pfrio_size, - sizeof(struct pfr_astats), M_TEMP, M_WAITOK); + sizeof(struct pfr_astats), M_TEMP, M_NOWAIT); if (! pfrastats) { error = ENOMEM; break; @@ -2873,9 +2901,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2905,9 +2938,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2937,9 +2975,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->pfrio_size < 0 || + WOULD_OVERFLOW(io->pfrio_size, sizeof(struct pfr_addr))) { + error = EINVAL; + break; + } totlen = io->pfrio_size * sizeof(struct pfr_addr); pfras = mallocarray(io->pfrio_size, sizeof(struct pfr_addr), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! pfras) { error = ENOMEM; break; @@ -2984,9 +3027,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! ioes) { error = ENOMEM; break; @@ -3055,9 +3103,14 @@ DIOCCHANGEADDR_error: error = ENODEV; break; } + if (io->size < 0 || + WOULD_OVERFLOW(io->size, sizeof(struct pfioc_trans_e))) { + error = EINVAL; + break; + } totlen = sizeof(struct pfioc_trans_e) * io->size; ioes = mallocarray(io->size, sizeof(struct pfioc_trans_e), - M_TEMP, M_WAITOK); + M_TEMP, M_NOWAIT); if (! ioes) { error = ENOMEM; break; From owner-svn-src-all@freebsd.org Sat Apr 14 03:15:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 534DFF9B7DB; Sat, 14 Apr 2018 03:15:06 +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 EA2957810E; Sat, 14 Apr 2018 03:15:05 +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 E1CCC22BAC; Sat, 14 Apr 2018 03:15:05 +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 w3E3F5TY058803; Sat, 14 Apr 2018 03:15:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3E3F5Id058802; Sat, 14 Apr 2018 03:15:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804140315.w3E3F5Id058802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 14 Apr 2018 03:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332498 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 332498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 03:15:06 -0000 Author: cem Date: Sat Apr 14 03:15:05 2018 New Revision: 332498 URL: https://svnweb.freebsd.org/changeset/base/332498 Log: cpufreq: Remove error-prone table terminators in favor of automatic sizing PR: 227388 Reported by: Vladimir Machulsky Sponsored by: Dell EMC Isilon Modified: head/sys/x86/cpufreq/est.c Modified: head/sys/x86/cpufreq/est.c ============================================================================== --- head/sys/x86/cpufreq/est.c Sat Apr 14 00:20:47 2018 (r332497) +++ head/sys/x86/cpufreq/est.c Sat Apr 14 03:15:05 2018 (r332498) @@ -71,6 +71,7 @@ typedef struct { const u_int vendor_id; uint32_t id32; freq_info *freqtab; + size_t tablen; } cpu_info; struct est_softc { @@ -78,6 +79,7 @@ struct est_softc { int acpi_settings; int msr_settings; freq_info *freq_list; + size_t flist_len; }; /* Convert MHz and mV into IDs for passing to the MSR. */ @@ -92,9 +94,9 @@ struct est_softc { #define FREQ_INFO(MHz, mV, bus_clk) \ FREQ_INFO_PWR(MHz, mV, bus_clk, CPUFREQ_VAL_UNKNOWN) #define INTEL(tab, zhi, vhi, zlo, vlo, bus_clk) \ - { CPU_VENDOR_INTEL, ID32(zhi, vhi, zlo, vlo, bus_clk), tab } + { CPU_VENDOR_INTEL, ID32(zhi, vhi, zlo, vlo, bus_clk), tab, nitems(tab) } #define CENTAUR(tab, zhi, vhi, zlo, vlo, bus_clk) \ - { CPU_VENDOR_CENTAUR, ID32(zhi, vhi, zlo, vlo, bus_clk), tab } + { CPU_VENDOR_CENTAUR, ID32(zhi, vhi, zlo, vlo, bus_clk), tab, nitems(tab) } static int msr_info_enabled = 0; TUNABLE_INT("hw.est.msr_info", &msr_info_enabled); @@ -131,7 +133,6 @@ static freq_info PM17_130[] = { FREQ_INFO(1000, 1116, INTEL_BUS_CLK), FREQ_INFO( 800, 1004, INTEL_BUS_CLK), FREQ_INFO( 600, 956, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM16_130[] = { /* 130nm 1.60GHz Pentium M */ @@ -141,7 +142,6 @@ static freq_info PM16_130[] = { FREQ_INFO(1000, 1164, INTEL_BUS_CLK), FREQ_INFO( 800, 1036, INTEL_BUS_CLK), FREQ_INFO( 600, 956, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM15_130[] = { /* 130nm 1.50GHz Pentium M */ @@ -151,7 +151,6 @@ static freq_info PM15_130[] = { FREQ_INFO(1000, 1228, INTEL_BUS_CLK), FREQ_INFO( 800, 1116, INTEL_BUS_CLK), FREQ_INFO( 600, 956, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM14_130[] = { /* 130nm 1.40GHz Pentium M */ @@ -160,7 +159,6 @@ static freq_info PM14_130[] = { FREQ_INFO(1000, 1308, INTEL_BUS_CLK), FREQ_INFO( 800, 1180, INTEL_BUS_CLK), FREQ_INFO( 600, 956, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM13_130[] = { /* 130nm 1.30GHz Pentium M */ @@ -169,7 +167,6 @@ static freq_info PM13_130[] = { FREQ_INFO(1000, 1292, INTEL_BUS_CLK), FREQ_INFO( 800, 1260, INTEL_BUS_CLK), FREQ_INFO( 600, 956, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM13_LV_130[] = { /* 130nm 1.30GHz Low Voltage Pentium M */ @@ -180,7 +177,6 @@ static freq_info PM13_LV_130[] = { FREQ_INFO( 900, 1004, INTEL_BUS_CLK), FREQ_INFO( 800, 988, INTEL_BUS_CLK), FREQ_INFO( 600, 956, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM12_LV_130[] = { /* 130 nm 1.20GHz Low Voltage Pentium M */ @@ -190,7 +186,6 @@ static freq_info PM12_LV_130[] = { FREQ_INFO( 900, 1020, INTEL_BUS_CLK), FREQ_INFO( 800, 1004, INTEL_BUS_CLK), FREQ_INFO( 600, 956, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM11_LV_130[] = { /* 130 nm 1.10GHz Low Voltage Pentium M */ @@ -199,7 +194,6 @@ static freq_info PM11_LV_130[] = { FREQ_INFO( 900, 1100, INTEL_BUS_CLK), FREQ_INFO( 800, 1020, INTEL_BUS_CLK), FREQ_INFO( 600, 956, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM11_ULV_130[] = { /* 130 nm 1.10GHz Ultra Low Voltage Pentium M */ @@ -208,7 +202,6 @@ static freq_info PM11_ULV_130[] = { FREQ_INFO( 900, 972, INTEL_BUS_CLK), FREQ_INFO( 800, 956, INTEL_BUS_CLK), FREQ_INFO( 600, 844, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM10_ULV_130[] = { /* 130 nm 1.00GHz Ultra Low Voltage Pentium M */ @@ -216,7 +209,6 @@ static freq_info PM10_ULV_130[] = { FREQ_INFO( 900, 988, INTEL_BUS_CLK), FREQ_INFO( 800, 972, INTEL_BUS_CLK), FREQ_INFO( 600, 844, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; /* @@ -233,7 +225,6 @@ static freq_info PM_765A_90[] = { FREQ_INFO(1000, 1084, INTEL_BUS_CLK), FREQ_INFO( 800, 1036, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_765B_90[] = { /* 90 nm 2.10GHz Pentium M, VID #B */ @@ -245,7 +236,6 @@ static freq_info PM_765B_90[] = { FREQ_INFO(1000, 1084, INTEL_BUS_CLK), FREQ_INFO( 800, 1036, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_765C_90[] = { /* 90 nm 2.10GHz Pentium M, VID #C */ @@ -257,7 +247,6 @@ static freq_info PM_765C_90[] = { FREQ_INFO(1000, 1084, INTEL_BUS_CLK), FREQ_INFO( 800, 1036, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_765E_90[] = { /* 90 nm 2.10GHz Pentium M, VID #E */ @@ -269,7 +258,6 @@ static freq_info PM_765E_90[] = { FREQ_INFO(1000, 1100, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_755A_90[] = { /* 90 nm 2.00GHz Pentium M, VID #A */ @@ -281,7 +269,6 @@ static freq_info PM_755A_90[] = { FREQ_INFO(1000, 1100, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_755B_90[] = { /* 90 nm 2.00GHz Pentium M, VID #B */ @@ -293,7 +280,6 @@ static freq_info PM_755B_90[] = { FREQ_INFO(1000, 1084, INTEL_BUS_CLK), FREQ_INFO( 800, 1036, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_755C_90[] = { /* 90 nm 2.00GHz Pentium M, VID #C */ @@ -305,7 +291,6 @@ static freq_info PM_755C_90[] = { FREQ_INFO(1000, 1084, INTEL_BUS_CLK), FREQ_INFO( 800, 1036, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_755D_90[] = { /* 90 nm 2.00GHz Pentium M, VID #D */ @@ -317,7 +302,6 @@ static freq_info PM_755D_90[] = { FREQ_INFO(1000, 1084, INTEL_BUS_CLK), FREQ_INFO( 800, 1036, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_745A_90[] = { /* 90 nm 1.80GHz Pentium M, VID #A */ @@ -328,7 +312,6 @@ static freq_info PM_745A_90[] = { FREQ_INFO(1000, 1116, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_745B_90[] = { /* 90 nm 1.80GHz Pentium M, VID #B */ @@ -339,7 +322,6 @@ static freq_info PM_745B_90[] = { FREQ_INFO(1000, 1116, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_745C_90[] = { /* 90 nm 1.80GHz Pentium M, VID #C */ @@ -350,7 +332,6 @@ static freq_info PM_745C_90[] = { FREQ_INFO(1000, 1100, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_745D_90[] = { /* 90 nm 1.80GHz Pentium M, VID #D */ @@ -361,7 +342,6 @@ static freq_info PM_745D_90[] = { FREQ_INFO(1000, 1084, INTEL_BUS_CLK), FREQ_INFO( 800, 1036, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_735A_90[] = { /* 90 nm 1.70GHz Pentium M, VID #A */ @@ -371,7 +351,6 @@ static freq_info PM_735A_90[] = { FREQ_INFO(1000, 1116, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_735B_90[] = { /* 90 nm 1.70GHz Pentium M, VID #B */ @@ -381,7 +360,6 @@ static freq_info PM_735B_90[] = { FREQ_INFO(1000, 1116, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_735C_90[] = { /* 90 nm 1.70GHz Pentium M, VID #C */ @@ -391,7 +369,6 @@ static freq_info PM_735C_90[] = { FREQ_INFO(1000, 1116, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_735D_90[] = { /* 90 nm 1.70GHz Pentium M, VID #D */ @@ -401,7 +378,6 @@ static freq_info PM_735D_90[] = { FREQ_INFO(1000, 1100, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_725A_90[] = { /* 90 nm 1.60GHz Pentium M, VID #A */ @@ -411,7 +387,6 @@ static freq_info PM_725A_90[] = { FREQ_INFO(1000, 1132, INTEL_BUS_CLK), FREQ_INFO( 800, 1068, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_725B_90[] = { /* 90 nm 1.60GHz Pentium M, VID #B */ @@ -421,7 +396,6 @@ static freq_info PM_725B_90[] = { FREQ_INFO(1000, 1132, INTEL_BUS_CLK), FREQ_INFO( 800, 1068, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_725C_90[] = { /* 90 nm 1.60GHz Pentium M, VID #C */ @@ -431,7 +405,6 @@ static freq_info PM_725C_90[] = { FREQ_INFO(1000, 1116, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_725D_90[] = { /* 90 nm 1.60GHz Pentium M, VID #D */ @@ -441,7 +414,6 @@ static freq_info PM_725D_90[] = { FREQ_INFO(1000, 1116, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_715A_90[] = { /* 90 nm 1.50GHz Pentium M, VID #A */ @@ -450,7 +422,6 @@ static freq_info PM_715A_90[] = { FREQ_INFO(1000, 1148, INTEL_BUS_CLK), FREQ_INFO( 800, 1068, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_715B_90[] = { /* 90 nm 1.50GHz Pentium M, VID #B */ @@ -459,7 +430,6 @@ static freq_info PM_715B_90[] = { FREQ_INFO(1000, 1148, INTEL_BUS_CLK), FREQ_INFO( 800, 1068, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_715C_90[] = { /* 90 nm 1.50GHz Pentium M, VID #C */ @@ -468,7 +438,6 @@ static freq_info PM_715C_90[] = { FREQ_INFO(1000, 1132, INTEL_BUS_CLK), FREQ_INFO( 800, 1068, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_715D_90[] = { /* 90 nm 1.50GHz Pentium M, VID #D */ @@ -477,7 +446,6 @@ static freq_info PM_715D_90[] = { FREQ_INFO(1000, 1116, INTEL_BUS_CLK), FREQ_INFO( 800, 1052, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_778_90[] = { /* 90 nm 1.60GHz Low Voltage Pentium M */ @@ -491,7 +459,6 @@ static freq_info PM_778_90[] = { FREQ_INFO( 900, 1036, INTEL_BUS_CLK), FREQ_INFO( 800, 1020, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_758_90[] = { /* 90 nm 1.50GHz Low Voltage Pentium M */ @@ -504,7 +471,6 @@ static freq_info PM_758_90[] = { FREQ_INFO( 900, 1036, INTEL_BUS_CLK), FREQ_INFO( 800, 1020, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_738_90[] = { /* 90 nm 1.40GHz Low Voltage Pentium M */ @@ -516,7 +482,6 @@ static freq_info PM_738_90[] = { FREQ_INFO( 900, 1036, INTEL_BUS_CLK), FREQ_INFO( 800, 1020, INTEL_BUS_CLK), FREQ_INFO( 600, 988, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_773G_90[] = { /* 90 nm 1.30GHz Ultra Low Voltage Pentium M, VID #G */ @@ -688,7 +653,6 @@ static freq_info PM_733_90[] = { FREQ_INFO( 900, 892, INTEL_BUS_CLK), FREQ_INFO( 800, 876, INTEL_BUS_CLK), FREQ_INFO( 600, 812, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; static freq_info PM_723_90[] = { /* 90 nm 1.00GHz Ultra Low Voltage Pentium M */ @@ -696,7 +660,6 @@ static freq_info PM_723_90[] = { FREQ_INFO( 900, 908, INTEL_BUS_CLK), FREQ_INFO( 800, 876, INTEL_BUS_CLK), FREQ_INFO( 600, 812, INTEL_BUS_CLK), - FREQ_INFO( 0, 0, 1), }; /* @@ -713,7 +676,6 @@ static freq_info C7M_795[] = { FREQ_INFO_PWR( 800, 844, 133, 7000), FREQ_INFO_PWR( 667, 844, 133, 6000), FREQ_INFO_PWR( 533, 844, 133, 5000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_785[] = { /* 1.80GHz Centaur C7-M 533 Mhz FSB */ @@ -724,7 +686,6 @@ static freq_info C7M_785[] = { FREQ_INFO_PWR( 800, 844, 133, 7000), FREQ_INFO_PWR( 667, 844, 133, 6000), FREQ_INFO_PWR( 533, 844, 133, 5000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_765[] = { /* 1.60GHz Centaur C7-M 533 Mhz FSB */ @@ -734,7 +695,6 @@ static freq_info C7M_765[] = { FREQ_INFO_PWR( 800, 844, 133, 7000), FREQ_INFO_PWR( 667, 844, 133, 6000), FREQ_INFO_PWR( 533, 844, 133, 5000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_794[] = { @@ -747,7 +707,6 @@ static freq_info C7M_794[] = { FREQ_INFO_PWR( 800, 844, 100, 7000), FREQ_INFO_PWR( 600, 844, 100, 6000), FREQ_INFO_PWR( 400, 844, 100, 5000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_784[] = { /* 1.80GHz Centaur C7-M 400 Mhz FSB */ @@ -758,7 +717,6 @@ static freq_info C7M_784[] = { FREQ_INFO_PWR( 800, 844, 100, 7000), FREQ_INFO_PWR( 600, 844, 100, 6000), FREQ_INFO_PWR( 400, 844, 100, 5000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_764[] = { /* 1.60GHz Centaur C7-M 400 Mhz FSB */ @@ -768,7 +726,6 @@ static freq_info C7M_764[] = { FREQ_INFO_PWR( 800, 844, 100, 7000), FREQ_INFO_PWR( 600, 844, 100, 6000), FREQ_INFO_PWR( 400, 844, 100, 5000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_754[] = { /* 1.50GHz Centaur C7-M 400 Mhz FSB */ @@ -778,7 +735,6 @@ static freq_info C7M_754[] = { FREQ_INFO_PWR( 800, 844, 100, 7000), FREQ_INFO_PWR( 600, 844, 100, 6000), FREQ_INFO_PWR( 400, 844, 100, 5000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_771[] = { /* 1.20GHz Centaur C7-M 400 Mhz FSB */ @@ -787,7 +743,6 @@ static freq_info C7M_771[] = { FREQ_INFO_PWR( 800, 844, 100, 5500), FREQ_INFO_PWR( 600, 844, 100, 5000), FREQ_INFO_PWR( 400, 844, 100, 4000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_775_ULV[] = { @@ -798,7 +753,6 @@ static freq_info C7M_775_ULV[] = { FREQ_INFO_PWR( 800, 828, 100, 2800), FREQ_INFO_PWR( 600, 796, 100, 2500), FREQ_INFO_PWR( 400, 796, 100, 2000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_772_ULV[] = { /* 1.20GHz Centaur C7-M ULV */ @@ -807,7 +761,6 @@ static freq_info C7M_772_ULV[] = { FREQ_INFO_PWR( 800, 828, 100, 2800), FREQ_INFO_PWR( 600, 796, 100, 2500), FREQ_INFO_PWR( 400, 796, 100, 2000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_779_ULV[] = { /* 1.00GHz Centaur C7-M ULV */ @@ -815,7 +768,6 @@ static freq_info C7M_779_ULV[] = { FREQ_INFO_PWR( 800, 796, 100, 2800), FREQ_INFO_PWR( 600, 796, 100, 2500), FREQ_INFO_PWR( 400, 796, 100, 2000), - FREQ_INFO(0, 0, 1), }; static freq_info C7M_770_ULV[] = { /* 1.00GHz Centaur C7-M ULV */ @@ -823,7 +775,6 @@ static freq_info C7M_770_ULV[] = { FREQ_INFO_PWR( 800, 796, 100, 2800), FREQ_INFO_PWR( 600, 796, 100, 2500), FREQ_INFO_PWR( 400, 796, 100, 2000), - FREQ_INFO(0, 0, 1), }; static cpu_info ESTprocs[] = { @@ -906,10 +857,13 @@ static int est_probe(device_t parent); static int est_attach(device_t parent); static int est_detach(device_t parent); static int est_get_info(device_t dev); -static int est_acpi_info(device_t dev, freq_info **freqs); -static int est_table_info(device_t dev, uint64_t msr, freq_info **freqs); -static int est_msr_info(device_t dev, uint64_t msr, freq_info **freqs); -static freq_info *est_get_current(freq_info *freq_list); +static int est_acpi_info(device_t dev, freq_info **freqs, + size_t *freqslen); +static int est_table_info(device_t dev, uint64_t msr, freq_info **freqs, + size_t *freqslen); +static int est_msr_info(device_t dev, uint64_t msr, freq_info **freqs, + size_t *freqslen); +static freq_info *est_get_current(freq_info *freq_list, size_t tablen); static int est_settings(device_t dev, struct cf_setting *sets, int *count); static int est_set(device_t dev, const struct cf_setting *set); static int est_get(device_t dev, struct cf_setting *set); @@ -1077,11 +1031,11 @@ est_get_info(device_t dev) sc = device_get_softc(dev); msr = rdmsr(MSR_PERF_STATUS); - error = est_table_info(dev, msr, &sc->freq_list); + error = est_table_info(dev, msr, &sc->freq_list, &sc->flist_len); if (error) - error = est_acpi_info(dev, &sc->freq_list); + error = est_acpi_info(dev, &sc->freq_list, &sc->flist_len); if (error) - error = est_msr_info(dev, msr, &sc->freq_list); + error = est_msr_info(dev, msr, &sc->freq_list, &sc->flist_len); if (error) { printf( @@ -1094,7 +1048,7 @@ est_get_info(device_t dev) } static int -est_acpi_info(device_t dev, freq_info **freqs) +est_acpi_info(device_t dev, freq_info **freqs, size_t *freqslen) { struct est_softc *sc; struct cf_setting *sets; @@ -1119,7 +1073,7 @@ est_acpi_info(device_t dev, freq_info **freqs) goto out; /* Parse settings into our local table format. */ - table = malloc((count + 1) * sizeof(freq_info), M_DEVBUF, M_NOWAIT); + table = malloc(count * sizeof(*table), M_DEVBUF, M_NOWAIT); if (table == NULL) { error = ENOMEM; goto out; @@ -1147,11 +1101,9 @@ est_acpi_info(device_t dev, freq_info **freqs) /* restore saved setting */ est_set_id16(dev, saved_id16, 0); - /* Mark end of table with a terminator. */ - bzero(&table[j], sizeof(freq_info)); - sc->acpi_settings = TRUE; *freqs = table; + *freqslen = j; error = 0; out: @@ -1163,7 +1115,7 @@ out: } static int -est_table_info(device_t dev, uint64_t msr, freq_info **freqs) +est_table_info(device_t dev, uint64_t msr, freq_info **freqs, size_t *freqslen) { cpu_info *p; uint32_t id; @@ -1178,12 +1130,13 @@ est_table_info(device_t dev, uint64_t msr, freq_info * return (EOPNOTSUPP); /* Make sure the current setpoint is valid. */ - if (est_get_current(p->freqtab) == NULL) { + if (est_get_current(p->freqtab, p->tablen) == NULL) { device_printf(dev, "current setting not found in table\n"); return (EOPNOTSUPP); } *freqs = p->freqtab; + *freqslen = p->tablen; return (0); } @@ -1206,7 +1159,7 @@ bus_speed_ok(int bus) * based on the current clock speed and the upper 32 bits of the MSR. */ static int -est_msr_info(device_t dev, uint64_t msr, freq_info **freqs) +est_msr_info(device_t dev, uint64_t msr, freq_info **freqs, size_t *freqslen) { struct est_softc *sc; freq_info *fp; @@ -1236,7 +1189,7 @@ est_msr_info(device_t dev, uint64_t msr, freq_info **f /* Fill out a new freq table containing just the high and low freqs. */ sc = device_get_softc(dev); - fp = malloc(sizeof(freq_info) * 3, M_DEVBUF, M_WAITOK | M_ZERO); + fp = malloc(sizeof(freq_info) * 2, M_DEVBUF, M_WAITOK | M_ZERO); /* First, the high frequency. */ volts = id & 0xff; @@ -1269,6 +1222,7 @@ est_msr_info(device_t dev, uint64_t msr, freq_info **f /* Table is already terminated due to M_ZERO. */ sc->msr_settings = TRUE; *freqs = fp; + *freqslen = 2; return (0); } @@ -1305,7 +1259,7 @@ est_set_id16(device_t dev, uint16_t id16, int need_che } static freq_info * -est_get_current(freq_info *freq_list) +est_get_current(freq_info *freq_list, size_t tablen) { freq_info *f; int i; @@ -1318,7 +1272,7 @@ est_get_current(freq_info *freq_list) */ for (i = 0; i < 5; i++) { est_get_id16(&id16); - for (f = freq_list; f->id16 != 0; f++) { + for (f = freq_list; f < freq_list + tablen; f++) { if (f->id16 == id16) return (f); } @@ -1339,7 +1293,7 @@ est_settings(device_t dev, struct cf_setting *sets, in return (E2BIG); i = 0; - for (f = sc->freq_list; f->freq != 0; f++, i++) { + for (f = sc->freq_list; f < sc->freq_list + sc->flist_len; f++, i++) { sets[i].freq = f->freq; sets[i].volts = f->volts; sets[i].power = f->power; @@ -1359,7 +1313,7 @@ est_set(device_t dev, const struct cf_setting *set) /* Find the setting matching the requested one. */ sc = device_get_softc(dev); - for (f = sc->freq_list; f->freq != 0; f++) { + for (f = sc->freq_list; f < sc->freq_list + sc->flist_len; f++) { if (f->freq == set->freq) break; } @@ -1379,7 +1333,7 @@ est_get(device_t dev, struct cf_setting *set) freq_info *f; sc = device_get_softc(dev); - f = est_get_current(sc->freq_list); + f = est_get_current(sc->freq_list, sc->flist_len); if (f == NULL) return (ENXIO); From owner-svn-src-all@freebsd.org Sat Apr 14 04:35:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 438AFFA2411; Sat, 14 Apr 2018 04:35:11 +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 EAC658785F; Sat, 14 Apr 2018 04:35:10 +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 E5D1A238F7; Sat, 14 Apr 2018 04:35:10 +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 w3E4ZApx098698; Sat, 14 Apr 2018 04:35:10 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3E4ZAiI098697; Sat, 14 Apr 2018 04:35:10 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804140435.w3E4ZAiI098697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 14 Apr 2018 04:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332499 - head/bin/expr X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/bin/expr X-SVN-Commit-Revision: 332499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 04:35:11 -0000 Author: cem Date: Sat Apr 14 04:35:10 2018 New Revision: 332499 URL: https://svnweb.freebsd.org/changeset/base/332499 Log: expr(1): Fix overflow detection when operand is INTMAX_MIN PR: 227329 Submitted by: Tobias Stoeckmann Modified: head/bin/expr/expr.y Modified: head/bin/expr/expr.y ============================================================================== --- head/bin/expr/expr.y Sat Apr 14 03:15:05 2018 (r332498) +++ head/bin/expr/expr.y Sat Apr 14 04:35:10 2018 (r332499) @@ -422,11 +422,9 @@ op_plus(struct val *a, struct val *b) void assert_minus(intmax_t a, intmax_t b, intmax_t r) { - /* special case subtraction of INTMAX_MIN */ - if (b == INTMAX_MIN && a < 0) + if ((a >= 0 && b < 0 && r <= 0) || + (a < 0 && b > 0 && r >= 0)) errx(ERR_EXIT, "overflow"); - /* check addition of negative subtrahend */ - assert_plus(a, -b, r); } struct val * From owner-svn-src-all@freebsd.org Sat Apr 14 08:05:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B296AF896E1; Sat, 14 Apr 2018 08:05:42 +0000 (UTC) (envelope-from eadler@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 642CF73433; Sat, 14 Apr 2018 08:05:42 +0000 (UTC) (envelope-from eadler@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 5D48B25A4F; Sat, 14 Apr 2018 08:05:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3E85gkO002967; Sat, 14 Apr 2018 08:05:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3E85gYT002966; Sat, 14 Apr 2018 08:05:42 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201804140805.w3E85gYT002966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 14 Apr 2018 08:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332500 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 332500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 08:05:42 -0000 Author: eadler Date: Sat Apr 14 08:05:42 2018 New Revision: 332500 URL: https://svnweb.freebsd.org/changeset/base/332500 Log: sys: remove 'cm' from notes Followup to r332490 MFC After: never PR: 182297 Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Apr 14 04:35:10 2018 (r332499) +++ head/sys/conf/NOTES Sat Apr 14 08:05:42 2018 (r332500) @@ -1942,8 +1942,6 @@ device xmphy # XaQti XMAC II # bwi: Broadcom BCM430* and BCM431* family of wireless adapters. # bwn: Broadcom BCM43xx family of wireless adapters. # cas: Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn -# cm: Arcnet SMC COM90c26 / SMC COM90c56 -# (and SMC COM90c66 in '56 compatibility mode) adapters. # cxgb: Chelsio T3 based 1GbE/10GbE PCIe Ethernet adapters. # cxgbe:Chelsio T4, T5, and T6-based 1/10/25/40/100GbE PCIe Ethernet # adapters. From owner-svn-src-all@freebsd.org Sat Apr 14 11:31:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31B5EF97150 for ; Sat, 14 Apr 2018 11:31:31 +0000 (UTC) (envelope-from bmr@ringman.ch) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A21E80D43 for ; Sat, 14 Apr 2018 11:31:30 +0000 (UTC) (envelope-from bmr@ringman.ch) Received: by mail-yw0-x232.google.com with SMTP id i187so5137296ywd.10 for ; Sat, 14 Apr 2018 04:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ringman-ch.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=rVE5xTGKHQ6ThJSUHSBmxAqnCyHp7YtzXYQ/Frd2gWc=; b=iy6cvgQOcLa12gJHMyNmDTKXzWOpHs/qCWaffHPRtEFPfgTkQXZKMOSJZHGYDeUn3q uDoQV0EkzZUqtCMGK58ayOdzB1sNSDfhpWXNvB1r3fKb6pioaw0xfTGIYxlzXK6D5jp/ nnbsXdjeyZdZNPB/6v8yA8+RfoaclqSt2uZaDcQ//inxw3Ikb5W6u0/vFgGOWgI5xcwg nTV4vYpJWmtDpFmorels48x3C/T2DBIWQUfbCZOBj8BbQ/2oF4Sx8MNfh2xdI7+BZ8sD 0IVApt+oI4XL7ZV5JBzVA2aSv3WGqFOQ8mUEqA3hHFzqEFWBbMR336ebIzwYcr7jwUw+ fOIQ== 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:content-transfer-encoding; bh=rVE5xTGKHQ6ThJSUHSBmxAqnCyHp7YtzXYQ/Frd2gWc=; b=IVQ7zLIFFNUN80Bs5k9eV9NGB7Rgyd3xtufTDitHajys97VOxHCez9MaMqDZBgoYB7 xIKmKK7IR7Jzi+jAhHgaycxjTguVFk3SMsEmdI7EeLRDdSTMuG8egSLQRQlppv2tSSnM 0AHc94OcTgT9MFXhzkmn1Aw58aO4w489miPim3Mq6foy82a/Lqcau8FI14eYS/oXCjrh U4dI7a4TOZl6W/kkVidY4ABZMUCnEMer2t4kA2/UyTH83qBVloiiWeiYW7SVTB9UNXXO XCLm3mgbAOjqzm9uJYImb7Ubccu1qrADVC+iM59Ux75PxutRcQ3HkRnhWmg00miCoD/a z9rQ== X-Gm-Message-State: ALQs6tBBCC7x9sH4PmRwt78uKOTCvS0pAEsS20ksUa+vBb2jwwcsWi76 uXrR7bvZ9PKiR9Y1rRpg5SzTo8Y6Yosqss03UHLObA== X-Google-Smtp-Source: AIpwx4/RMtENk43wCV86liDfiiB4UHwM2a8/KXocq75tdJ8i8qLQDFb9OCSWi6kZ9oX3LA6jrupwz1okg5weoGVDOkM= X-Received: by 10.129.51.196 with SMTP id z187mr561409ywz.512.1523705489355; Sat, 14 Apr 2018 04:31:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.128.133 with HTTP; Sat, 14 Apr 2018 04:31:28 -0700 (PDT) In-Reply-To: <201804132232.w3DMWSmI019256@repo.freebsd.org> References: <201804132232.w3DMWSmI019256@repo.freebsd.org> From: Magnus Ringman Date: Sat, 14 Apr 2018 13:31:28 +0200 Message-ID: Subject: Re: svn commit: r332493 - stable/11/sys/net To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, freebsd-stable@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 11:31:31 -0000 Hi Brooks, this MFC missed your r331077 (https://reviews.freebsd.org/D14706) thus stable buildkernel currently breaks on missing those two macros. (_IOC_NEWLEN and _IOC_NEWTYPE for searchability) Sk=C3=A5l, Magnus On Sat, Apr 14, 2018 at 12:32 AM, Brooks Davis wrote: > Author: brooks > Date: Fri Apr 13 22:32:28 2018 > New Revision: 332493 > URL: https://svnweb.freebsd.org/changeset/base/332493 > > Log: > MFC r332088: > > Add 32-bit compat for ioctls that take struct ifgroupreq. > > Use an accessor to access ifgr_group and ifgr_groups. > > Use an macro CASE_IOC_IFGROUPREQ(cmd) in place of case statements such > as "case SIOCAIFGROUP:". This avoids poluting the switch statements > with large numbers of #ifdefs. > > Reviewed by: kib > Obtained from: CheriBSD > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D14960 > > Modified: > stable/11/sys/net/if.c > stable/11/sys/net/if.h > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sys/net/if.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 > --- stable/11/sys/net/if.c Fri Apr 13 21:19:06 2018 (r332492) > +++ stable/11/sys/net/if.c Fri Apr 13 22:32:28 2018 (r332493) > @@ -133,8 +133,25 @@ struct ifreq32 { > CTASSERT(sizeof(struct ifreq) =3D=3D sizeof(struct ifreq32)); > CTASSERT(__offsetof(struct ifreq, ifr_ifru) =3D=3D > __offsetof(struct ifreq32, ifr_ifru)); > -#endif > > +struct ifgroupreq32 { > + char ifgr_name[IFNAMSIZ]; > + u_int ifgr_len; > + union { > + char ifgru_group[IFNAMSIZ]; > + uint32_t ifgru_groups; > + } ifgr_ifgru; > +}; > +#define _CASE_IOC_IFGROUPREQ_32(cmd) \ > + case _IOC_NEWTYPE((cmd), struct ifgroupreq32): > +#else > +#define _CASE_IOC_IFGROUPREQ_32(cmd) > +#endif /* COMPAT_FREEBSD32 */ > + > +#define CASE_IOC_IFGROUPREQ(cmd) \ > + _CASE_IOC_IFGROUPREQ_32(cmd) \ > + case (cmd) > + > union ifreq_union { > struct ifreq ifr; > #ifdef COMPAT_FREEBSD32 > @@ -142,6 +159,13 @@ union ifreq_union { > #endif > }; > > +union ifgroupreq_union { > + struct ifgroupreq ifgr; > +#ifdef COMPAT_FREEBSD32 > + struct ifgroupreq32 ifgr32; > +#endif > +}; > + > SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); > SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-manageme= nt"); > > @@ -1490,17 +1514,42 @@ if_delgroups(struct ifnet *ifp) > IFNET_WUNLOCK(); > } > > +static char * > +ifgr_group_get(void *ifgrp) > +{ > + union ifgroupreq_union *ifgrup; > + > + ifgrup =3D ifgrp; > +#ifdef COMPAT_FREEBSD32 > + if (SV_CURPROC_FLAG(SV_ILP32)) > + return (&ifgrup->ifgr32.ifgr_ifgru.ifgru_group[0]); > +#endif > + return (&ifgrup->ifgr.ifgr_ifgru.ifgru_group[0]); > +} > + > +static struct ifg_req * > +ifgr_groups_get(void *ifgrp) > +{ > + union ifgroupreq_union *ifgrup; > + > + ifgrup =3D ifgrp; > +#ifdef COMPAT_FREEBSD32 > + if (SV_CURPROC_FLAG(SV_ILP32)) > + return ((struct ifg_req *)(uintptr_t) > + ifgrup->ifgr32.ifgr_ifgru.ifgru_groups); > +#endif > + return (ifgrup->ifgr.ifgr_ifgru.ifgru_groups); > +} > + > /* > - * Stores all groups from an interface in memory pointed > - * to by data > + * Stores all groups from an interface in memory pointed to by ifgr. > */ > static int > -if_getgroup(struct ifgroupreq *data, struct ifnet *ifp) > +if_getgroup(struct ifgroupreq *ifgr, struct ifnet *ifp) > { > int len, error; > struct ifg_list *ifgl; > struct ifg_req ifgrq, *ifgp; > - struct ifgroupreq *ifgr =3D data; > > if (ifgr->ifgr_len =3D=3D 0) { > IF_ADDR_RLOCK(ifp); > @@ -1511,7 +1560,7 @@ if_getgroup(struct ifgroupreq *data, struct ifnet *= ifp > } > > len =3D ifgr->ifgr_len; > - ifgp =3D ifgr->ifgr_groups; > + ifgp =3D ifgr_groups_get(ifgr); > /* XXX: wire */ > IF_ADDR_RLOCK(ifp); > TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) { > @@ -1535,12 +1584,11 @@ if_getgroup(struct ifgroupreq *data, struct ifnet= *ifp > } > > /* > - * Stores all members of a group in memory pointed to by data > + * Stores all members of a group in memory pointed to by igfr > */ > static int > -if_getgroupmembers(struct ifgroupreq *data) > +if_getgroupmembers(struct ifgroupreq *ifgr) > { > - struct ifgroupreq *ifgr =3D data; > struct ifg_group *ifg; > struct ifg_member *ifgm; > struct ifg_req ifgrq, *ifgp; > @@ -1563,7 +1611,7 @@ if_getgroupmembers(struct ifgroupreq *data) > } > > len =3D ifgr->ifgr_len; > - ifgp =3D ifgr->ifgr_groups; > + ifgp =3D ifgr_groups_get(ifgr); > TAILQ_FOREACH(ifgm, &ifg->ifg_members, ifgm_next) { > if (len < sizeof(ifgrq)) { > IFNET_RUNLOCK(); > @@ -2793,34 +2841,28 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t = data, > error =3D if_gethwaddr(ifp, ifr); > break; > > - case SIOCAIFGROUP: > - { > - struct ifgroupreq *ifgr =3D (struct ifgroupreq *)ifr; > - > + CASE_IOC_IFGROUPREQ(SIOCAIFGROUP): > error =3D priv_check(td, PRIV_NET_ADDIFGROUP); > if (error) > return (error); > - if ((error =3D if_addgroup(ifp, ifgr->ifgr_group))) > + if ((error =3D if_addgroup(ifp, > + ifgr_group_get((struct ifgroupreq *)data)))) > return (error); > break; > - } > > - case SIOCGIFGROUP: > - if ((error =3D if_getgroup((struct ifgroupreq *)ifr, ifp)= )) > + CASE_IOC_IFGROUPREQ(SIOCGIFGROUP): > + if ((error =3D if_getgroup((struct ifgroupreq *)data, ifp= ))) > return (error); > break; > > - case SIOCDIFGROUP: > - { > - struct ifgroupreq *ifgr =3D (struct ifgroupreq *)ifr; > - > + CASE_IOC_IFGROUPREQ(SIOCDIFGROUP): > error =3D priv_check(td, PRIV_NET_DELIFGROUP); > if (error) > return (error); > - if ((error =3D if_delgroup(ifp, ifgr->ifgr_group))) > + if ((error =3D if_delgroup(ifp, > + ifgr_group_get((struct ifgroupreq *)data)))) > return (error); > break; > - } > > default: > error =3D ENOIOCTL; > @@ -2926,7 +2968,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data= , s > error =3D if_clone_list((struct if_clonereq *)data); > CURVNET_RESTORE(); > return (error); > - case SIOCGIFGMEMB: > + CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB): > error =3D if_getgroupmembers((struct ifgroupreq *)data); > CURVNET_RESTORE(); > return (error); > > Modified: stable/11/sys/net/if.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 > --- stable/11/sys/net/if.h Fri Apr 13 21:19:06 2018 (r332492) > +++ stable/11/sys/net/if.h Fri Apr 13 22:32:28 2018 (r332493) > @@ -512,8 +512,10 @@ struct ifgroupreq { > char ifgru_group[IFNAMSIZ]; > struct ifg_req *ifgru_groups; > } ifgr_ifgru; > +#ifndef _KERNEL > #define ifgr_group ifgr_ifgru.ifgru_group > #define ifgr_groups ifgr_ifgru.ifgru_groups > +#endif > }; > > /* > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Sat Apr 14 11:37:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51229F9789D; Sat, 14 Apr 2018 11:37:47 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [198.144.209.73]) (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 911B7826F4; Sat, 14 Apr 2018 11:37:45 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id w3EBbiNf089599; Sat, 14 Apr 2018 11:37:44 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id w3EBbi0U089598; Sat, 14 Apr 2018 04:37:44 -0700 (PDT) (envelope-from david) Date: Sat, 14 Apr 2018 04:37:43 -0700 From: David Wolfskill To: Magnus Ringman Cc: Brooks Davis , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r332493 - stable/11/sys/net Message-ID: <20180414113743.GR63353@albert.catwhisker.org> Mail-Followup-To: David Wolfskill , Magnus Ringman , Brooks Davis , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201804132232.w3DMWSmI019256@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="E6EZ4qVJn/rWPYaj" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 11:37:47 -0000 --E6EZ4qVJn/rWPYaj Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 14, 2018 at 01:31:28PM +0200, Magnus Ringman wrote: > Hi Brooks, this MFC missed your r331077 > (https://reviews.freebsd.org/D14706) thus stable buildkernel currently > breaks on missing those two macros. >=20 > (_IOC_NEWLEN and _IOC_NEWTYPE for searchability) >=20 > Sk=E5l, > Magnus > .... Aye; looks as if that would explain the kernel build failures I had this morning in stable/11, trying to update from r332465 -> r332496. Peace, david --=20 David H. Wolfskill david@catwhisker.org Donald Trump's criticism of others comes across as psychological projection. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --E6EZ4qVJn/rWPYaj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEzLfO+ReoAfQwZNd7FTnMQKBJ7hcFAlrR6AdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEND QjdDRUY5MTdBODAxRjQzMDY0RDc3QjE1MzlDQzQwQTA0OUVFMTcACgkQFTnMQKBJ 7hf0PwgA0kLh0HJ7t3RBon/xPvwzgOnZsvfzYtWlT55yXEdkPD91wx8FpNldiZiD T5Vu4G8KUnGAyB2uAlmWesk6r3FikQEEszvCVnCF91ej0ems9naRaJdSEsRaIpyG sO51YaQQ8tDh4Ww/jve9dVVIuBYYEBaPVNzomZS6NP9onD85et6AT4MHdXZsQtY+ hMyoTFryA3AFQq1+OpPyvTUabVCqEqmVSUX5zVX/P+XKrhFMPdCTuFYdkK4+pCAI flfNzhvJqPniCRMCMjKULlpY078gvIUV+QiT3mMBdkPprYotpNxuaFq9NM9VgrXD aHwjasY6eKEmuVSR6fyFj7rVOjqwJg== =Jyh+ -----END PGP SIGNATURE----- --E6EZ4qVJn/rWPYaj-- From owner-svn-src-all@freebsd.org Sat Apr 14 12:07:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61BF9F9A5F0; Sat, 14 Apr 2018 12:07:07 +0000 (UTC) (envelope-from dim@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 0E4426A12C; Sat, 14 Apr 2018 12:07:07 +0000 (UTC) (envelope-from dim@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 08A1328065; Sat, 14 Apr 2018 12:07:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3EC76dQ023630; Sat, 14 Apr 2018 12:07:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3EC75cj023620; Sat, 14 Apr 2018 12:07:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201804141207.w3EC75cj023620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Apr 2018 12:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332501 - in head: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang/Driver contrib/llvm/tool... X-SVN-Commit-Revision: 332501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 12:07:07 -0000 Author: dim Date: Sat Apr 14 12:07:05 2018 New Revision: 332501 URL: https://svnweb.freebsd.org/changeset/base/332501 Log: Pull in r325446 from upstream clang trunk (by me): [X86] Add 'sahf' CPU feature to frontend Summary: Make clang accept `-msahf` (and `-mno-sahf`) flags to activate the `+sahf` feature for the backend, for bug 36028 (Incorrect use of pushf/popf enables/disables interrupts on amd64 kernels). This was originally submitted in bug 36037 by Jonathan Looney . As described there, GCC also uses `-msahf` for this feature, and the backend already recognizes the `+sahf` feature. All that is needed is to teach clang to pass this on to the backend. The mapping of feature support onto CPUs may not be complete; rather, it was chosen to match LLVM's idea of which CPUs support this feature (see lib/Target/X86/X86.td). I also updated the affected test case (CodeGen/attr-target-x86.c) to match the emitted output. Reviewers: craig.topper, coby, efriedma, rsmith Reviewed By: craig.topper Subscribers: emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D43394 Pull in r328944 from upstream llvm trunk (by Chandler Carruth): [x86] Expose more of the condition conversion routines in the public API for X86's instruction information. I've now got a second patch under review that needs these same APIs. This bit is nicely orthogonal and obvious, so landing it. NFC. Pull in r329414 from upstream llvm trunk (by Craig Topper): [X86] Merge itineraries for CLC, CMC, and STC. These are very simple flag setting instructions that appear to only be a single uop. They're unlikely to need this separation. Pull in r329657 from upstream llvm trunk (by Chandler Carruth): [x86] Introduce a pass to begin more systematically fixing PR36028 and similar issues. The key idea is to lower COPY nodes populating EFLAGS by scanning the uses of EFLAGS and introducing dedicated code to preserve the necessary state in a GPR. In the vast majority of cases, these uses are cmovCC and jCC instructions. For such cases, we can very easily save and restore the necessary information by simply inserting a setCC into a GPR where the original flags are live, and then testing that GPR directly to feed the cmov or conditional branch. However, things are a bit more tricky if arithmetic is using the flags. This patch handles the vast majority of cases that seem to come up in practice: adc, adcx, adox, rcl, and rcr; all without taking advantage of partially preserved EFLAGS as LLVM doesn't currently model that at all. There are a large number of operations that techinaclly observe EFLAGS currently but shouldn't in this case -- they typically are using DF. Currently, they will not be handled by this approach. However, I have never seen this issue come up in practice. It is already pretty rare to have these patterns come up in practical code with LLVM. I had to resort to writing MIR tests to cover most of the logic in this pass already. I suspect even with its current amount of coverage of arithmetic users of EFLAGS it will be a significant improvement over the current use of pushf/popf. It will also produce substantially faster code in most of the common patterns. This patch also removes all of the old lowering for EFLAGS copies, and the hack that forced us to use a frame pointer when EFLAGS copies were found anywhere in a function so that the dynamic stack adjustment wasn't a problem. None of this is needed as we now lower all of these copies directly in MI and without require stack adjustments. Lots of thanks to Reid who came up with several aspects of this approach, and Craig who helped me work out a couple of things tripping me up while working on this. Differential Revision: https://reviews.llvm.org/D45146 Pull in r329673 from upstream llvm trunk (by Chandler Carruth): [x86] Model the direction flag (DF) separately from the rest of EFLAGS. This cleans up a number of operations that only claimed te use EFLAGS due to using DF. But no instructions which we think of us setting EFLAGS actually modify DF (other than things like popf) and so this needlessly creates uses of EFLAGS that aren't really there. In fact, DF is so restrictive it is pretty easy to model. Only STD, CLD, and the whole-flags writes (WRFLAGS and POPF) need to model this. I've also somewhat cleaned up some of the flag management instruction definitions to be in the correct .td file. Adding this extra register also uncovered a failure to use the correct datatype to hold X86 registers, and I've corrected that as necessary here. Differential Revision: https://reviews.llvm.org/D45154 Together, these should ensure clang does not use pushf/popf sequences to save and restore flags, avoiding problems with unrelated flags (such as the interrupt flag) being restored unexpectedly. Requested by: jtl PR: 225330 MFC after: 1 week Added: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp (contents, props changed) Modified: head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp head/contrib/llvm/lib/Target/X86/X86.h head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrSystem.td head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td head/contrib/llvm/lib/Target/X86/X86Schedule.td head/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h head/lib/clang/freebsd_cc_version.h head/lib/clang/libllvm/Makefile Modified: head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Sat Apr 14 08:05:42 2018 (r332500) +++ head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Sat Apr 14 12:07:05 2018 (r332501) @@ -449,6 +449,13 @@ class MachineBasicBlock (public) /// Replace successor OLD with NEW and update probability info. void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New); + /// Copy a successor (and any probability info) from original block to this + /// block's. Uses an iterator into the original blocks successors. + /// + /// This is useful when doing a partial clone of successors. Afterward, the + /// probabilities may need to be normalized. + void copySuccessor(MachineBasicBlock *Orig, succ_iterator I); + /// Transfers all the successors from MBB to this machine basic block (i.e., /// copies all the successors FromMBB and remove all the successors from /// FromMBB). Modified: head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Sat Apr 14 08:05:42 2018 (r332500) +++ head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Sat Apr 14 12:07:05 2018 (r332501) @@ -646,6 +646,14 @@ void MachineBasicBlock::replaceSuccessor(MachineBasicB removeSuccessor(OldI); } +void MachineBasicBlock::copySuccessor(MachineBasicBlock *Orig, + succ_iterator I) { + if (Orig->Probs.empty()) + addSuccessor(*I, Orig->getSuccProbability(I)); + else + addSuccessorWithoutProb(*I); +} + void MachineBasicBlock::addPredecessor(MachineBasicBlock *Pred) { Predecessors.push_back(Pred); } Modified: head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp Sat Apr 14 08:05:42 2018 (r332500) +++ head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp Sat Apr 14 12:07:05 2018 (r332501) @@ -265,13 +265,10 @@ MCDisassembler::DecodeStatus X86GenericDisassembler::g /// @param reg - The Reg to append. static void translateRegister(MCInst &mcInst, Reg reg) { #define ENTRY(x) X86::x, - uint8_t llvmRegnums[] = { - ALL_REGS - 0 - }; + static constexpr MCPhysReg llvmRegnums[] = {ALL_REGS}; #undef ENTRY - uint8_t llvmRegnum = llvmRegnums[reg]; + MCPhysReg llvmRegnum = llvmRegnums[reg]; mcInst.addOperand(MCOperand::createReg(llvmRegnum)); } Modified: head/contrib/llvm/lib/Target/X86/X86.h ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86.h Sat Apr 14 08:05:42 2018 (r332500) +++ head/contrib/llvm/lib/Target/X86/X86.h Sat Apr 14 12:07:05 2018 (r332501) @@ -66,6 +66,9 @@ FunctionPass *createX86OptimizeLEAs(); /// Return a pass that transforms setcc + movzx pairs into xor + setcc. FunctionPass *createX86FixupSetCC(); +/// Return a pass that lowers EFLAGS copy pseudo instructions. +FunctionPass *createX86FlagsCopyLoweringPass(); + /// Return a pass that expands WinAlloca pseudo-instructions. FunctionPass *createX86WinAllocaExpander(); Added: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Sat Apr 14 12:07:05 2018 (r332501) @@ -0,0 +1,734 @@ +//====- X86FlagsCopyLowering.cpp - Lowers COPY nodes of EFLAGS ------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// \file +/// +/// Lowers COPY nodes of EFLAGS by directly extracting and preserving individual +/// flag bits. +/// +/// We have to do this by carefully analyzing and rewriting the usage of the +/// copied EFLAGS register because there is no general way to rematerialize the +/// entire EFLAGS register safely and efficiently. Using `popf` both forces +/// dynamic stack adjustment and can create correctness issues due to IF, TF, +/// and other non-status flags being overwritten. Using sequences involving +/// SAHF don't work on all x86 processors and are often quite slow compared to +/// directly testing a single status preserved in its own GPR. +/// +//===----------------------------------------------------------------------===// + +#include "X86.h" +#include "X86InstrBuilder.h" +#include "X86InstrInfo.h" +#include "X86Subtarget.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/ScopeExit.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/SparseBitVector.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/MachineConstantPool.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/CodeGen/MachineInstr.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/CodeGen/MachineOperand.h" +#include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineSSAUpdater.h" +#include "llvm/CodeGen/TargetInstrInfo.h" +#include "llvm/CodeGen/TargetRegisterInfo.h" +#include "llvm/CodeGen/TargetSchedule.h" +#include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/IR/DebugLoc.h" +#include "llvm/MC/MCSchedule.h" +#include "llvm/Pass.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/raw_ostream.h" +#include +#include +#include +#include + +using namespace llvm; + +#define PASS_KEY "x86-flags-copy-lowering" +#define DEBUG_TYPE PASS_KEY + +STATISTIC(NumCopiesEliminated, "Number of copies of EFLAGS eliminated"); +STATISTIC(NumSetCCsInserted, "Number of setCC instructions inserted"); +STATISTIC(NumTestsInserted, "Number of test instructions inserted"); +STATISTIC(NumAddsInserted, "Number of adds instructions inserted"); + +namespace llvm { + +void initializeX86FlagsCopyLoweringPassPass(PassRegistry &); + +} // end namespace llvm + +namespace { + +// Convenient array type for storing registers associated with each condition. +using CondRegArray = std::array; + +class X86FlagsCopyLoweringPass : public MachineFunctionPass { +public: + X86FlagsCopyLoweringPass() : MachineFunctionPass(ID) { + initializeX86FlagsCopyLoweringPassPass(*PassRegistry::getPassRegistry()); + } + + StringRef getPassName() const override { return "X86 EFLAGS copy lowering"; } + bool runOnMachineFunction(MachineFunction &MF) override; + void getAnalysisUsage(AnalysisUsage &AU) const override; + + /// Pass identification, replacement for typeid. + static char ID; + +private: + MachineRegisterInfo *MRI; + const X86InstrInfo *TII; + const TargetRegisterInfo *TRI; + const TargetRegisterClass *PromoteRC; + + CondRegArray collectCondsInRegs(MachineBasicBlock &MBB, + MachineInstr &CopyDefI); + + unsigned promoteCondToReg(MachineBasicBlock &MBB, + MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, X86::CondCode Cond); + std::pair + getCondOrInverseInReg(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, DebugLoc TestLoc, + X86::CondCode Cond, CondRegArray &CondRegs); + void insertTest(MachineBasicBlock &MBB, MachineBasicBlock::iterator Pos, + DebugLoc Loc, unsigned Reg); + + void rewriteArithmetic(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, DebugLoc TestLoc, + MachineInstr &MI, MachineOperand &FlagUse, + CondRegArray &CondRegs); + void rewriteCMov(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, DebugLoc TestLoc, + MachineInstr &CMovI, MachineOperand &FlagUse, + CondRegArray &CondRegs); + void rewriteCondJmp(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, DebugLoc TestLoc, + MachineInstr &JmpI, CondRegArray &CondRegs); + void rewriteCopy(MachineInstr &MI, MachineOperand &FlagUse, + MachineInstr &CopyDefI); + void rewriteSetCC(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, DebugLoc TestLoc, + MachineInstr &SetCCI, MachineOperand &FlagUse, + CondRegArray &CondRegs); +}; + +} // end anonymous namespace + +INITIALIZE_PASS_BEGIN(X86FlagsCopyLoweringPass, DEBUG_TYPE, + "X86 EFLAGS copy lowering", false, false) +INITIALIZE_PASS_END(X86FlagsCopyLoweringPass, DEBUG_TYPE, + "X86 EFLAGS copy lowering", false, false) + +FunctionPass *llvm::createX86FlagsCopyLoweringPass() { + return new X86FlagsCopyLoweringPass(); +} + +char X86FlagsCopyLoweringPass::ID = 0; + +void X86FlagsCopyLoweringPass::getAnalysisUsage(AnalysisUsage &AU) const { + MachineFunctionPass::getAnalysisUsage(AU); +} + +namespace { +/// An enumeration of the arithmetic instruction mnemonics which have +/// interesting flag semantics. +/// +/// We can map instruction opcodes into these mnemonics to make it easy to +/// dispatch with specific functionality. +enum class FlagArithMnemonic { + ADC, + ADCX, + ADOX, + RCL, + RCR, + SBB, +}; +} // namespace + +static FlagArithMnemonic getMnemonicFromOpcode(unsigned Opcode) { + switch (Opcode) { + default: + report_fatal_error("No support for lowering a copy into EFLAGS when used " + "by this instruction!"); + +#define LLVM_EXPAND_INSTR_SIZES(MNEMONIC, SUFFIX) \ + case X86::MNEMONIC##8##SUFFIX: \ + case X86::MNEMONIC##16##SUFFIX: \ + case X86::MNEMONIC##32##SUFFIX: \ + case X86::MNEMONIC##64##SUFFIX: + +#define LLVM_EXPAND_ADC_SBB_INSTR(MNEMONIC) \ + LLVM_EXPAND_INSTR_SIZES(MNEMONIC, rr) \ + LLVM_EXPAND_INSTR_SIZES(MNEMONIC, rr_REV) \ + LLVM_EXPAND_INSTR_SIZES(MNEMONIC, rm) \ + LLVM_EXPAND_INSTR_SIZES(MNEMONIC, mr) \ + case X86::MNEMONIC##8ri: \ + case X86::MNEMONIC##16ri8: \ + case X86::MNEMONIC##32ri8: \ + case X86::MNEMONIC##64ri8: \ + case X86::MNEMONIC##16ri: \ + case X86::MNEMONIC##32ri: \ + case X86::MNEMONIC##64ri32: \ + case X86::MNEMONIC##8mi: \ + case X86::MNEMONIC##16mi8: \ + case X86::MNEMONIC##32mi8: \ + case X86::MNEMONIC##64mi8: \ + case X86::MNEMONIC##16mi: \ + case X86::MNEMONIC##32mi: \ + case X86::MNEMONIC##64mi32: \ + case X86::MNEMONIC##8i8: \ + case X86::MNEMONIC##16i16: \ + case X86::MNEMONIC##32i32: \ + case X86::MNEMONIC##64i32: + + LLVM_EXPAND_ADC_SBB_INSTR(ADC) + return FlagArithMnemonic::ADC; + + LLVM_EXPAND_ADC_SBB_INSTR(SBB) + return FlagArithMnemonic::SBB; + +#undef LLVM_EXPAND_ADC_SBB_INSTR + + LLVM_EXPAND_INSTR_SIZES(RCL, rCL) + LLVM_EXPAND_INSTR_SIZES(RCL, r1) + LLVM_EXPAND_INSTR_SIZES(RCL, ri) + return FlagArithMnemonic::RCL; + + LLVM_EXPAND_INSTR_SIZES(RCR, rCL) + LLVM_EXPAND_INSTR_SIZES(RCR, r1) + LLVM_EXPAND_INSTR_SIZES(RCR, ri) + return FlagArithMnemonic::RCR; + +#undef LLVM_EXPAND_INSTR_SIZES + + case X86::ADCX32rr: + case X86::ADCX64rr: + case X86::ADCX32rm: + case X86::ADCX64rm: + return FlagArithMnemonic::ADCX; + + case X86::ADOX32rr: + case X86::ADOX64rr: + case X86::ADOX32rm: + case X86::ADOX64rm: + return FlagArithMnemonic::ADOX; + } +} + +static MachineBasicBlock &splitBlock(MachineBasicBlock &MBB, + MachineInstr &SplitI, + const X86InstrInfo &TII) { + MachineFunction &MF = *MBB.getParent(); + + assert(SplitI.getParent() == &MBB && + "Split instruction must be in the split block!"); + assert(SplitI.isBranch() && + "Only designed to split a tail of branch instructions!"); + assert(X86::getCondFromBranchOpc(SplitI.getOpcode()) != X86::COND_INVALID && + "Must split on an actual jCC instruction!"); + + // Dig out the previous instruction to the split point. + MachineInstr &PrevI = *std::prev(SplitI.getIterator()); + assert(PrevI.isBranch() && "Must split after a branch!"); + assert(X86::getCondFromBranchOpc(PrevI.getOpcode()) != X86::COND_INVALID && + "Must split after an actual jCC instruction!"); + assert(!std::prev(PrevI.getIterator())->isTerminator() && + "Must only have this one terminator prior to the split!"); + + // Grab the one successor edge that will stay in `MBB`. + MachineBasicBlock &UnsplitSucc = *PrevI.getOperand(0).getMBB(); + + // Analyze the original block to see if we are actually splitting an edge + // into two edges. This can happen when we have multiple conditional jumps to + // the same successor. + bool IsEdgeSplit = + std::any_of(SplitI.getIterator(), MBB.instr_end(), + [&](MachineInstr &MI) { + assert(MI.isTerminator() && + "Should only have spliced terminators!"); + return llvm::any_of( + MI.operands(), [&](MachineOperand &MOp) { + return MOp.isMBB() && MOp.getMBB() == &UnsplitSucc; + }); + }) || + MBB.getFallThrough() == &UnsplitSucc; + + MachineBasicBlock &NewMBB = *MF.CreateMachineBasicBlock(); + + // Insert the new block immediately after the current one. Any existing + // fallthrough will be sunk into this new block anyways. + MF.insert(std::next(MachineFunction::iterator(&MBB)), &NewMBB); + + // Splice the tail of instructions into the new block. + NewMBB.splice(NewMBB.end(), &MBB, SplitI.getIterator(), MBB.end()); + + // Copy the necessary succesors (and their probability info) into the new + // block. + for (auto SI = MBB.succ_begin(), SE = MBB.succ_end(); SI != SE; ++SI) + if (IsEdgeSplit || *SI != &UnsplitSucc) + NewMBB.copySuccessor(&MBB, SI); + // Normalize the probabilities if we didn't end up splitting the edge. + if (!IsEdgeSplit) + NewMBB.normalizeSuccProbs(); + + // Now replace all of the moved successors in the original block with the new + // block. This will merge their probabilities. + for (MachineBasicBlock *Succ : NewMBB.successors()) + if (Succ != &UnsplitSucc) + MBB.replaceSuccessor(Succ, &NewMBB); + + // We should always end up replacing at least one successor. + assert(MBB.isSuccessor(&NewMBB) && + "Failed to make the new block a successor!"); + + // Now update all the PHIs. + for (MachineBasicBlock *Succ : NewMBB.successors()) { + for (MachineInstr &MI : *Succ) { + if (!MI.isPHI()) + break; + + for (int OpIdx = 1, NumOps = MI.getNumOperands(); OpIdx < NumOps; + OpIdx += 2) { + MachineOperand &OpV = MI.getOperand(OpIdx); + MachineOperand &OpMBB = MI.getOperand(OpIdx + 1); + assert(OpMBB.isMBB() && "Block operand to a PHI is not a block!"); + if (OpMBB.getMBB() != &MBB) + continue; + + // Replace the operand for unsplit successors + if (!IsEdgeSplit || Succ != &UnsplitSucc) { + OpMBB.setMBB(&NewMBB); + + // We have to continue scanning as there may be multiple entries in + // the PHI. + continue; + } + + // When we have split the edge append a new successor. + MI.addOperand(MF, OpV); + MI.addOperand(MF, MachineOperand::CreateMBB(&NewMBB)); + break; + } + } + } + + return NewMBB; +} + +bool X86FlagsCopyLoweringPass::runOnMachineFunction(MachineFunction &MF) { + DEBUG(dbgs() << "********** " << getPassName() << " : " << MF.getName() + << " **********\n"); + + auto &Subtarget = MF.getSubtarget(); + MRI = &MF.getRegInfo(); + TII = Subtarget.getInstrInfo(); + TRI = Subtarget.getRegisterInfo(); + PromoteRC = &X86::GR8RegClass; + + if (MF.begin() == MF.end()) + // Nothing to do for a degenerate empty function... + return false; + + SmallVector Copies; + for (MachineBasicBlock &MBB : MF) + for (MachineInstr &MI : MBB) + if (MI.getOpcode() == TargetOpcode::COPY && + MI.getOperand(0).getReg() == X86::EFLAGS) + Copies.push_back(&MI); + + for (MachineInstr *CopyI : Copies) { + MachineBasicBlock &MBB = *CopyI->getParent(); + + MachineOperand &VOp = CopyI->getOperand(1); + assert(VOp.isReg() && + "The input to the copy for EFLAGS should always be a register!"); + MachineInstr &CopyDefI = *MRI->getVRegDef(VOp.getReg()); + if (CopyDefI.getOpcode() != TargetOpcode::COPY) { + // FIXME: The big likely candidate here are PHI nodes. We could in theory + // handle PHI nodes, but it gets really, really hard. Insanely hard. Hard + // enough that it is probably better to change every other part of LLVM + // to avoid creating them. The issue is that once we have PHIs we won't + // know which original EFLAGS value we need to capture with our setCCs + // below. The end result will be computing a complete set of setCCs that + // we *might* want, computing them in every place where we copy *out* of + // EFLAGS and then doing SSA formation on all of them to insert necessary + // PHI nodes and consume those here. Then hoping that somehow we DCE the + // unnecessary ones. This DCE seems very unlikely to be successful and so + // we will almost certainly end up with a glut of dead setCC + // instructions. Until we have a motivating test case and fail to avoid + // it by changing other parts of LLVM's lowering, we refuse to handle + // this complex case here. + DEBUG(dbgs() << "ERROR: Encountered unexpected def of an eflags copy: "; + CopyDefI.dump()); + report_fatal_error( + "Cannot lower EFLAGS copy unless it is defined in turn by a copy!"); + } + + auto Cleanup = make_scope_exit([&] { + // All uses of the EFLAGS copy are now rewritten, kill the copy into + // eflags and if dead the copy from. + CopyI->eraseFromParent(); + if (MRI->use_empty(CopyDefI.getOperand(0).getReg())) + CopyDefI.eraseFromParent(); + ++NumCopiesEliminated; + }); + + MachineOperand &DOp = CopyI->getOperand(0); + assert(DOp.isDef() && "Expected register def!"); + assert(DOp.getReg() == X86::EFLAGS && "Unexpected copy def register!"); + if (DOp.isDead()) + continue; + + MachineBasicBlock &TestMBB = *CopyDefI.getParent(); + auto TestPos = CopyDefI.getIterator(); + DebugLoc TestLoc = CopyDefI.getDebugLoc(); + + DEBUG(dbgs() << "Rewriting copy: "; CopyI->dump()); + + // Scan for usage of newly set EFLAGS so we can rewrite them. We just buffer + // jumps because their usage is very constrained. + bool FlagsKilled = false; + SmallVector JmpIs; + + // Gather the condition flags that have already been preserved in + // registers. We do this from scratch each time as we expect there to be + // very few of them and we expect to not revisit the same copy definition + // many times. If either of those change sufficiently we could build a map + // of these up front instead. + CondRegArray CondRegs = collectCondsInRegs(TestMBB, CopyDefI); + + for (auto MII = std::next(CopyI->getIterator()), MIE = MBB.instr_end(); + MII != MIE;) { + MachineInstr &MI = *MII++; + MachineOperand *FlagUse = MI.findRegisterUseOperand(X86::EFLAGS); + if (!FlagUse) { + if (MI.findRegisterDefOperand(X86::EFLAGS)) { + // If EFLAGS are defined, it's as-if they were killed. We can stop + // scanning here. + // + // NB!!! Many instructions only modify some flags. LLVM currently + // models this as clobbering all flags, but if that ever changes this + // will need to be carefully updated to handle that more complex + // logic. + FlagsKilled = true; + break; + } + continue; + } + + DEBUG(dbgs() << " Rewriting use: "; MI.dump()); + + // Check the kill flag before we rewrite as that may change it. + if (FlagUse->isKill()) + FlagsKilled = true; + + // Once we encounter a branch, the rest of the instructions must also be + // branches. We can't rewrite in place here, so we handle them below. + // + // Note that we don't have to handle tail calls here, even conditional + // tail calls, as those are not introduced into the X86 MI until post-RA + // branch folding or black placement. As a consequence, we get to deal + // with the simpler formulation of conditional branches followed by tail + // calls. + if (X86::getCondFromBranchOpc(MI.getOpcode()) != X86::COND_INVALID) { + auto JmpIt = MI.getIterator(); + do { + JmpIs.push_back(&*JmpIt); + ++JmpIt; + } while (JmpIt != MBB.instr_end() && + X86::getCondFromBranchOpc(JmpIt->getOpcode()) != + X86::COND_INVALID); + break; + } + + // Otherwise we can just rewrite in-place. + if (X86::getCondFromCMovOpc(MI.getOpcode()) != X86::COND_INVALID) { + rewriteCMov(TestMBB, TestPos, TestLoc, MI, *FlagUse, CondRegs); + } else if (X86::getCondFromSETOpc(MI.getOpcode()) != X86::COND_INVALID) { + rewriteSetCC(TestMBB, TestPos, TestLoc, MI, *FlagUse, CondRegs); + } else if (MI.getOpcode() == TargetOpcode::COPY) { + rewriteCopy(MI, *FlagUse, CopyDefI); + } else { + // We assume that arithmetic instructions that use flags also def them. + assert(MI.findRegisterDefOperand(X86::EFLAGS) && + "Expected a def of EFLAGS for this instruction!"); + + // NB!!! Several arithmetic instructions only *partially* update + // flags. Theoretically, we could generate MI code sequences that + // would rely on this fact and observe different flags independently. + // But currently LLVM models all of these instructions as clobbering + // all the flags in an undef way. We rely on that to simplify the + // logic. + FlagsKilled = true; + + rewriteArithmetic(TestMBB, TestPos, TestLoc, MI, *FlagUse, CondRegs); + break; + } + + // If this was the last use of the flags, we're done. + if (FlagsKilled) + break; + } + + // If we didn't find a kill (or equivalent) check that the flags don't + // live-out of the basic block. Currently we don't support lowering copies + // of flags that live out in this fashion. + if (!FlagsKilled && + llvm::any_of(MBB.successors(), [](MachineBasicBlock *SuccMBB) { + return SuccMBB->isLiveIn(X86::EFLAGS); + })) { + DEBUG({ + dbgs() << "ERROR: Found a copied EFLAGS live-out from basic block:\n" + << "----\n"; + MBB.dump(); + dbgs() << "----\n" + << "ERROR: Cannot lower this EFLAGS copy!\n"; + }); + report_fatal_error( + "Cannot lower EFLAGS copy that lives out of a basic block!"); + } + + // Now rewrite the jumps that use the flags. These we handle specially + // because if there are multiple jumps we'll have to do surgery on the CFG. + for (MachineInstr *JmpI : JmpIs) { + // Past the first jump we need to split the blocks apart. + if (JmpI != JmpIs.front()) + splitBlock(*JmpI->getParent(), *JmpI, *TII); + + rewriteCondJmp(TestMBB, TestPos, TestLoc, *JmpI, CondRegs); + } + + // FIXME: Mark the last use of EFLAGS before the copy's def as a kill if + // the copy's def operand is itself a kill. + } + +#ifndef NDEBUG + for (MachineBasicBlock &MBB : MF) + for (MachineInstr &MI : MBB) + if (MI.getOpcode() == TargetOpcode::COPY && + (MI.getOperand(0).getReg() == X86::EFLAGS || + MI.getOperand(1).getReg() == X86::EFLAGS)) { + DEBUG(dbgs() << "ERROR: Found a COPY involving EFLAGS: "; MI.dump()); + llvm_unreachable("Unlowered EFLAGS copy!"); + } +#endif + + return true; +} + +/// Collect any conditions that have already been set in registers so that we +/// can re-use them rather than adding duplicates. +CondRegArray +X86FlagsCopyLoweringPass::collectCondsInRegs(MachineBasicBlock &MBB, + MachineInstr &CopyDefI) { + CondRegArray CondRegs = {}; + + // Scan backwards across the range of instructions with live EFLAGS. + for (MachineInstr &MI : llvm::reverse( + llvm::make_range(MBB.instr_begin(), CopyDefI.getIterator()))) { + X86::CondCode Cond = X86::getCondFromSETOpc(MI.getOpcode()); + if (Cond != X86::COND_INVALID && MI.getOperand(0).isReg() && + TRI->isVirtualRegister(MI.getOperand(0).getReg())) + CondRegs[Cond] = MI.getOperand(0).getReg(); + + // Stop scanning when we see the first definition of the EFLAGS as prior to + // this we would potentially capture the wrong flag state. + if (MI.findRegisterDefOperand(X86::EFLAGS)) + break; + } + return CondRegs; +} + +unsigned X86FlagsCopyLoweringPass::promoteCondToReg( + MachineBasicBlock &TestMBB, MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, X86::CondCode Cond) { + unsigned Reg = MRI->createVirtualRegister(PromoteRC); + auto SetI = BuildMI(TestMBB, TestPos, TestLoc, + TII->get(X86::getSETFromCond(Cond)), Reg); + (void)SetI; + DEBUG(dbgs() << " save cond: "; SetI->dump()); + ++NumSetCCsInserted; + return Reg; +} + +std::pair X86FlagsCopyLoweringPass::getCondOrInverseInReg( + MachineBasicBlock &TestMBB, MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, X86::CondCode Cond, CondRegArray &CondRegs) { + unsigned &CondReg = CondRegs[Cond]; + unsigned &InvCondReg = CondRegs[X86::GetOppositeBranchCondition(Cond)]; + if (!CondReg && !InvCondReg) + CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc, Cond); + + if (CondReg) + return {CondReg, false}; + else + return {InvCondReg, true}; +} + +void X86FlagsCopyLoweringPass::insertTest(MachineBasicBlock &MBB, + MachineBasicBlock::iterator Pos, + DebugLoc Loc, unsigned Reg) { + // We emit test instructions as register/immediate test against -1. This + // allows register allocation to fold a memory operand if needed (that will + // happen often due to the places this code is emitted). But hopefully will + // also allow us to select a shorter encoding of `testb %reg, %reg` when that + // would be equivalent. + auto TestI = + BuildMI(MBB, Pos, Loc, TII->get(X86::TEST8ri)).addReg(Reg).addImm(-1); + (void)TestI; + DEBUG(dbgs() << " test cond: "; TestI->dump()); + ++NumTestsInserted; +} + +void X86FlagsCopyLoweringPass::rewriteArithmetic( + MachineBasicBlock &TestMBB, MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, MachineInstr &MI, MachineOperand &FlagUse, + CondRegArray &CondRegs) { + // Arithmetic is either reading CF or OF. Figure out which condition we need + // to preserve in a register. + X86::CondCode Cond; + + // The addend to use to reset CF or OF when added to the flag value. + int Addend; + + switch (getMnemonicFromOpcode(MI.getOpcode())) { + case FlagArithMnemonic::ADC: + case FlagArithMnemonic::ADCX: + case FlagArithMnemonic::RCL: + case FlagArithMnemonic::RCR: + case FlagArithMnemonic::SBB: + Cond = X86::COND_B; // CF == 1 + // Set up an addend that when one is added will need a carry due to not + // having a higher bit available. + Addend = 255; + break; + + case FlagArithMnemonic::ADOX: + Cond = X86::COND_O; // OF == 1 + // Set up an addend that when one is added will turn from positive to + // negative and thus overflow in the signed domain. + Addend = 127; + break; + } + + // Now get a register that contains the value of the flag input to the + // arithmetic. We require exactly this flag to simplify the arithmetic + // required to materialize it back into the flag. + unsigned &CondReg = CondRegs[Cond]; + if (!CondReg) + CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc, Cond); + + MachineBasicBlock &MBB = *MI.getParent(); + + // Insert an instruction that will set the flag back to the desired value. + unsigned TmpReg = MRI->createVirtualRegister(PromoteRC); + auto AddI = + BuildMI(MBB, MI.getIterator(), MI.getDebugLoc(), TII->get(X86::ADD8ri)) + .addDef(TmpReg, RegState::Dead) + .addReg(CondReg) + .addImm(Addend); + (void)AddI; + DEBUG(dbgs() << " add cond: "; AddI->dump()); + ++NumAddsInserted; + FlagUse.setIsKill(true); +} + +void X86FlagsCopyLoweringPass::rewriteCMov(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, + MachineInstr &CMovI, + MachineOperand &FlagUse, + CondRegArray &CondRegs) { + // First get the register containing this specific condition. + X86::CondCode Cond = X86::getCondFromCMovOpc(CMovI.getOpcode()); + unsigned CondReg; + bool Inverted; + std::tie(CondReg, Inverted) = + getCondOrInverseInReg(TestMBB, TestPos, TestLoc, Cond, CondRegs); + + MachineBasicBlock &MBB = *CMovI.getParent(); + + // Insert a direct test of the saved register. + insertTest(MBB, CMovI.getIterator(), CMovI.getDebugLoc(), CondReg); + + // Rewrite the CMov to use the !ZF flag from the test (but match register + // size and memory operand), and then kill its use of the flags afterward. + auto &CMovRC = *MRI->getRegClass(CMovI.getOperand(0).getReg()); + CMovI.setDesc(TII->get(X86::getCMovFromCond( + Inverted ? X86::COND_E : X86::COND_NE, TRI->getRegSizeInBits(CMovRC) / 8, + !CMovI.memoperands_empty()))); + FlagUse.setIsKill(true); + DEBUG(dbgs() << " fixed cmov: "; CMovI.dump()); +} + +void X86FlagsCopyLoweringPass::rewriteCondJmp( + MachineBasicBlock &TestMBB, MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, MachineInstr &JmpI, CondRegArray &CondRegs) { + // First get the register containing this specific condition. + X86::CondCode Cond = X86::getCondFromBranchOpc(JmpI.getOpcode()); + unsigned CondReg; + bool Inverted; + std::tie(CondReg, Inverted) = + getCondOrInverseInReg(TestMBB, TestPos, TestLoc, Cond, CondRegs); + + MachineBasicBlock &JmpMBB = *JmpI.getParent(); + + // Insert a direct test of the saved register. + insertTest(JmpMBB, JmpI.getIterator(), JmpI.getDebugLoc(), CondReg); + + // Rewrite the jump to use the !ZF flag from the test, and kill its use of + // flags afterward. + JmpI.setDesc(TII->get( + X86::GetCondBranchFromCond(Inverted ? X86::COND_E : X86::COND_NE))); + const int ImplicitEFLAGSOpIdx = 1; + JmpI.getOperand(ImplicitEFLAGSOpIdx).setIsKill(true); + DEBUG(dbgs() << " fixed jCC: "; JmpI.dump()); +} + +void X86FlagsCopyLoweringPass::rewriteCopy(MachineInstr &MI, + MachineOperand &FlagUse, + MachineInstr &CopyDefI) { + // Just replace this copy with the the original copy def. + MRI->replaceRegWith(MI.getOperand(0).getReg(), + CopyDefI.getOperand(0).getReg()); + MI.eraseFromParent(); +} + +void X86FlagsCopyLoweringPass::rewriteSetCC(MachineBasicBlock &TestMBB, + MachineBasicBlock::iterator TestPos, + DebugLoc TestLoc, + MachineInstr &SetCCI, + MachineOperand &FlagUse, + CondRegArray &CondRegs) { + X86::CondCode Cond = X86::getCondFromSETOpc(SetCCI.getOpcode()); + // Note that we can't usefully rewrite this to the inverse without complex + // analysis of the users of the setCC. Largely we rely on duplicates which + // could have been avoided already being avoided here. + unsigned &CondReg = CondRegs[Cond]; + if (!CondReg) + CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc, Cond); + + // Rewriting this is trivial: we just replace the register and remove the + // setcc. + MRI->replaceRegWith(SetCCI.getOperand(0).getReg(), CondReg); + SetCCI.eraseFromParent(); +} Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sat Apr 14 08:05:42 2018 (r332500) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sat Apr 14 12:07:05 2018 (r332501) @@ -27781,11 +27781,16 @@ X86TargetLowering::EmitInstrWithCustomInserter(Machine MI.getOpcode() == X86::RDFLAGS32 ? X86::PUSHF32 : X86::PUSHF64; unsigned Pop = MI.getOpcode() == X86::RDFLAGS32 ? X86::POP32r : X86::POP64r; MachineInstr *Push = BuildMI(*BB, MI, DL, TII->get(PushF)); - // Permit reads of the FLAGS register without it being defined. + // Permit reads of the EFLAGS and DF registers without them being defined. // This intrinsic exists to read external processor state in flags, such as // the trap flag, interrupt flag, and direction flag, none of which are // modeled by the backend. + assert(Push->getOperand(2).getReg() == X86::EFLAGS && + "Unexpected register in operand!"); Push->getOperand(2).setIsUndef(); + assert(Push->getOperand(3).getReg() == X86::DF && + "Unexpected register in operand!"); + Push->getOperand(3).setIsUndef(); BuildMI(*BB, MI, DL, TII->get(Pop), MI.getOperand(0).getReg()); MI.eraseFromParent(); // The pseudo is gone now. @@ -37827,25 +37832,6 @@ bool X86TargetLowering::isTypeDesirableForOp(unsigned case ISD::XOR: return false; } -} - -/// This function checks if any of the users of EFLAGS copies the EFLAGS. We -/// know that the code that lowers COPY of EFLAGS has to use the stack, and if -/// we don't adjust the stack we clobber the first frame index. -/// See X86InstrInfo::copyPhysReg. -static bool hasCopyImplyingStackAdjustment(const MachineFunction &MF) { - const MachineRegisterInfo &MRI = MF.getRegInfo(); - return any_of(MRI.reg_instructions(X86::EFLAGS), - [](const MachineInstr &RI) { return RI.isCopy(); }); -} - -void X86TargetLowering::finalizeLowering(MachineFunction &MF) const { - if (hasCopyImplyingStackAdjustment(MF)) { - MachineFrameInfo &MFI = MF.getFrameInfo(); - MFI.setHasCopyImplyingStackAdjustment(true); - } - - TargetLoweringBase::finalizeLowering(MF); } /// This method query the target whether it is beneficial for dag combiner to Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.h ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.h Sat Apr 14 08:05:42 2018 (r332500) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.h Sat Apr 14 12:07:05 2018 (r332501) @@ -1100,8 +1100,6 @@ namespace llvm { unsigned Factor) const override; - void finalizeLowering(MachineFunction &MF) const override; - protected: std::pair findRepresentativeClass(const TargetRegisterInfo *TRI, Modified: head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Sat Apr 14 08:05:42 2018 (r332500) +++ head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Sat Apr 14 12:07:05 2018 (r332501) @@ -473,7 +473,7 @@ let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], + XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS, DF], usesCustomInserter = 1, Uses = [ESP, SSP] in { def TLS_addr32 : I<0, Pseudo, (outs), (ins i32mem:$sym), "# TLS_addr32", @@ -493,7 +493,7 @@ let Defs = [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], + XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS, DF], usesCustomInserter = 1, Uses = [RSP, SSP] in { def TLS_addr64 : I<0, Pseudo, (outs), (ins i64mem:$sym), "# TLS_addr64", @@ -509,7 +509,7 @@ def TLS_base_addr64 : I<0, Pseudo, (outs), (ins i64mem // For i386, the address of the thunk is passed on the stack, on return the // address of the variable is in %eax. %ecx is trashed during the function // call. All other registers are preserved. -let Defs = [EAX, ECX, EFLAGS], +let Defs = [EAX, ECX, EFLAGS, DF], Uses = [ESP, SSP], usesCustomInserter = 1 in def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym), @@ -522,7 +522,7 @@ def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym // %rdi. The lowering will do the right thing with RDI. // On return the address of the variable is in %rax. All other // registers are preserved. -let Defs = [RAX, EFLAGS], +let Defs = [RAX, EFLAGS, DF], Uses = [RSP, SSP], usesCustomInserter = 1 in def TLSCall_64 : I<0, Pseudo, (outs), (ins i64mem:$sym), Modified: head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Sat Apr 14 08:05:42 2018 (r332500) +++ head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Sat Apr 14 12:07:05 2018 (r332501) @@ -5782,7 +5782,7 @@ bool X86InstrInfo::findCommutedOpIndices(MachineInstr return false; } -static X86::CondCode getCondFromBranchOpc(unsigned BrOpc) { +X86::CondCode X86::getCondFromBranchOpc(unsigned BrOpc) { switch (BrOpc) { default: return X86::COND_INVALID; case X86::JE_1: return X86::COND_E; @@ -5805,7 +5805,7 @@ static X86::CondCode getCondFromBranchOpc(unsigned BrO } /// Return condition code of a SET opcode. -static X86::CondCode getCondFromSETOpc(unsigned Opc) { +X86::CondCode X86::getCondFromSETOpc(unsigned Opc) { switch (Opc) { default: return X86::COND_INVALID; case X86::SETAr: case X86::SETAm: return X86::COND_A; @@ -6130,7 +6130,7 @@ void X86InstrInfo::replaceBranchWithTailCall( if (!I->isBranch()) assert(0 && "Can't find the branch to replace!"); - X86::CondCode CC = getCondFromBranchOpc(I->getOpcode()); + X86::CondCode CC = X86::getCondFromBranchOpc(I->getOpcode()); assert(BranchCond.size() == 1); if (CC != BranchCond[0].getImm()) continue; @@ -6237,7 +6237,7 @@ bool X86InstrInfo::AnalyzeBranchImpl( } // Handle conditional branches. - X86::CondCode BranchCode = getCondFromBranchOpc(I->getOpcode()); + X86::CondCode BranchCode = X86::getCondFromBranchOpc(I->getOpcode()); if (BranchCode == X86::COND_INVALID) return true; // Can't handle indirect branch. @@ -6433,7 +6433,7 @@ unsigned X86InstrInfo::removeBranch(MachineBasicBlock if (I->isDebugValue()) continue; if (I->getOpcode() != X86::JMP_1 && - getCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID) + X86::getCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID) break; // Remove the branch. I->eraseFromParent(); @@ -6710,102 +6710,12 @@ void X86InstrInfo::copyPhysReg(MachineBasicBlock &MBB, return; } - bool FromEFLAGS = SrcReg == X86::EFLAGS; - bool ToEFLAGS = DestReg == X86::EFLAGS; - int Reg = FromEFLAGS ? DestReg : SrcReg; - bool is32 = X86::GR32RegClass.contains(Reg); - bool is64 = X86::GR64RegClass.contains(Reg); - - if ((FromEFLAGS || ToEFLAGS) && (is32 || is64)) { - int Mov = is64 ? X86::MOV64rr : X86::MOV32rr; - int Push = is64 ? X86::PUSH64r : X86::PUSH32r; - int PushF = is64 ? X86::PUSHF64 : X86::PUSHF32; - int Pop = is64 ? X86::POP64r : X86::POP32r; - int PopF = is64 ? X86::POPF64 : X86::POPF32; - int AX = is64 ? X86::RAX : X86::EAX; - - if (!Subtarget.hasLAHFSAHF()) { - assert(Subtarget.is64Bit() && - "Not having LAHF/SAHF only happens on 64-bit."); - // Moving EFLAGS to / from another register requires a push and a pop. - // Notice that we have to adjust the stack if we don't want to clobber the - // first frame index. See X86FrameLowering.cpp - usesTheStack. - if (FromEFLAGS) { - BuildMI(MBB, MI, DL, get(PushF)); - BuildMI(MBB, MI, DL, get(Pop), DestReg); - } - if (ToEFLAGS) { - BuildMI(MBB, MI, DL, get(Push)) - .addReg(SrcReg, getKillRegState(KillSrc)); - BuildMI(MBB, MI, DL, get(PopF)); - } - return; - } - - // The flags need to be saved, but saving EFLAGS with PUSHF/POPF is - // inefficient. Instead: - // - Save the overflow flag OF into AL using SETO, and restore it using a - // signed 8-bit addition of AL and INT8_MAX. - // - Save/restore the bottom 8 EFLAGS bits (CF, PF, AF, ZF, SF) to/from AH - // using LAHF/SAHF. - // - When RAX/EAX is live and isn't the destination register, make sure it - // isn't clobbered by PUSH/POP'ing it before and after saving/restoring - // the flags. - // This approach is ~2.25x faster than using PUSHF/POPF. - // - // This is still somewhat inefficient because we don't know which flags are - // actually live inside EFLAGS. Were we able to do a single SETcc instead of - // SETO+LAHF / ADDB+SAHF the code could be 1.02x faster. - // - // PUSHF/POPF is also potentially incorrect because it affects other flags - // such as TF/IF/DF, which LLVM doesn't model. - // - // Notice that we have to adjust the stack if we don't want to clobber the - // first frame index. - // See X86ISelLowering.cpp - X86::hasCopyImplyingStackAdjustment. - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Apr 14 12:14:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2B25F9AF92 for ; Sat, 14 Apr 2018 12:14:37 +0000 (UTC) (envelope-from bmr@ringman.ch) Received: from mail-yw0-x243.google.com (mail-yw0-x243.google.com [IPv6:2607:f8b0:4002:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77A706A808 for ; Sat, 14 Apr 2018 12:14:37 +0000 (UTC) (envelope-from bmr@ringman.ch) Received: by mail-yw0-x243.google.com with SMTP id g9so4039752ywb.12 for ; Sat, 14 Apr 2018 05:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ringman-ch.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=rY6N3rQI39mrJcyNm9PLXqd1kPsZf4ikha0NChDHXQU=; b=pRdrYG16nWQVvWOv+SJdESkPpC1sdZdKDUYnrNPQya6f2cbgxOusGXawXpxUm5Qg5k AEXJis8zmF0cVKVAxUU00Q6//thF2ODp0yKpDjUm3FvD+K9nCLFnj7oxPzneypNorKv5 J1zMghvXmdsFbapqNP6vzmWhOVVYiM77JLd9Fd/iN/s9XJf72MgM+71LCg6EGBSo0a4+ rAhMfFUGjKwykDsiUGBpl6ndG0s0TUXgyIvcbTa+ES3Yeice4YlLFH5nTQLsfMeTIglz eHruIVgRejPrM5xaHwAgo3E7TNjikeEaTQfqtqr/chpQd6b3slLk1U5Ou2p1zGwOEJPf H8kQ== 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:content-transfer-encoding; bh=rY6N3rQI39mrJcyNm9PLXqd1kPsZf4ikha0NChDHXQU=; b=kZClebBJaBNmdr2RxtrJiDNjm0qZE1j3aims7d/rHLPuRJsSRs+FGCjOc1BINltrmv sO9tqfueCapxcwwCh8EiP+7lQdAjrYSnzP609Sx8rNVrjt5Llr+PfwA6MizmeqCErEB3 SpgD469SEYvdO5CB1zYna8kMaPe4uAWTTSLocV7X/ir/+Gax0hfTXK3XDIWNLjm5pT2u vHvL1ibUVnZHwND+Mda1sIqvbt8KMryj5L4Kbw66c+I6MqoSfGISIiE6LPNYa3eYDN9m +q+2dxHVe8pYK/xj9dkFwkGHPbGvG9Po29hZcfFQMfF4tYSTLt3DfoKP92LO9/O65FIu oUSA== X-Gm-Message-State: ALQs6tD91aQpnY+BHt7va2AO00DgGo+aE36wRFu8u12a9kKV+G0kqwVG D+ziK5mbM62NF3g78Q+YDa8ocP8tec83AYFN43TPkw== X-Google-Smtp-Source: AIpwx486PB2fs0L7nZJXd9KvdV81b76W2uah4fEenlwFBtrzwNK2pvnCINlyS5EkZN+VEQHBgk2n1WClPyvXzKihX38= X-Received: by 10.13.216.205 with SMTP id a196mr6787707ywe.442.1523708076965; Sat, 14 Apr 2018 05:14:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.128.133 with HTTP; Sat, 14 Apr 2018 05:14:36 -0700 (PDT) In-Reply-To: <20180414113743.GR63353@albert.catwhisker.org> References: <201804132232.w3DMWSmI019256@repo.freebsd.org> <20180414113743.GR63353@albert.catwhisker.org> From: Magnus Ringman Date: Sat, 14 Apr 2018 14:14:36 +0200 Message-ID: Subject: Re: svn commit: r332493 - stable/11/sys/net To: David Wolfskill , Magnus Ringman , Brooks Davis , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 12:14:38 -0000 I don't think anyone has committed a fix yet (I'm not eligible, just lurking here.) Just manually integrate the missing change. At the top of your src tree: patch -p1 << __EOT --- head/sys/sys/ioccom.h 2017/11/20 19:43:44 326023 +++ head/sys/sys/ioccom.h 2018/03/16 22:23:04 331077 @@ -61,6 +61,10 @@ #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) /* this should be _IORW, but stdio got there first */ #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) +/* Replace length/type in an ioctl command. */ +#define _IOC_NEWLEN(ioc, len) \ + (((~(IOCPARM_MASK << 16)) & (ioc)) | (((len) & IOCPARM_MASK) << 16)) +#define _IOC_NEWTYPE(ioc, type) _IOC_NEWLEN((ioc), sizeof(type)) #ifdef _KERNEL __EOT On Sat, Apr 14, 2018 at 1:37 PM, David Wolfskill wro= te: > On Sat, Apr 14, 2018 at 01:31:28PM +0200, Magnus Ringman wrote: >> Hi Brooks, this MFC missed your r331077 >> (https://reviews.freebsd.org/D14706) thus stable buildkernel currently >> breaks on missing those two macros. >> >> (_IOC_NEWLEN and _IOC_NEWTYPE for searchability) >> >> Sk=C3=A5l, >> Magnus >> .... > > Aye; looks as if that would explain the kernel build failures I had this > morning in stable/11, trying to update from r332465 -> r332496. > > Peace, > david > -- > David H. Wolfskill david@catwhisker.org > Donald Trump's criticism of others comes across as psychological projecti= on. > > See http://www.catwhisker.org/~david/publickey.gpg for my public key. From owner-svn-src-all@freebsd.org Sat Apr 14 12:52:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39F1FF9E03C; Sat, 14 Apr 2018 12:52:35 +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 DBC70749F4; Sat, 14 Apr 2018 12:52:34 +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 D6D8B2884F; Sat, 14 Apr 2018 12:52:34 +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 w3ECqYXI048337; Sat, 14 Apr 2018 12:52:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ECqYnd048336; Sat, 14 Apr 2018 12:52:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804141252.w3ECqYnd048336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 14 Apr 2018 12:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332502 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 332502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 12:52:35 -0000 Author: emaste Date: Sat Apr 14 12:52:34 2018 New Revision: 332502 URL: https://svnweb.freebsd.org/changeset/base/332502 Log: MFC r331077 (brooks): Add _IOC_NEWLEN() and _IOC_NEWTYPE() macros. These macros take an existing ioctl(2) command and replace the length with the specified length or length of the specified type respectively. These can be used to define commands for 32-bit compatibility with fewer opportunities for cut-and-paste errors then a whole new definition. Obtained from: CheriBSD Sponsored by: DARPA, AFRL Modified: stable/11/sys/sys/ioccom.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/ioccom.h ============================================================================== --- stable/11/sys/sys/ioccom.h Sat Apr 14 12:07:05 2018 (r332501) +++ stable/11/sys/sys/ioccom.h Sat Apr 14 12:52:34 2018 (r332502) @@ -59,6 +59,10 @@ #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) /* this should be _IORW, but stdio got there first */ #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) +/* Replace length/type in an ioctl command. */ +#define _IOC_NEWLEN(ioc, len) \ + (((~(IOCPARM_MASK << 16)) & (ioc)) | (((len) & IOCPARM_MASK) << 16)) +#define _IOC_NEWTYPE(ioc, type) _IOC_NEWLEN((ioc), sizeof(type)) #ifdef _KERNEL From owner-svn-src-all@freebsd.org Sat Apr 14 12:54:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B089CF9E332; Sat, 14 Apr 2018 12:54:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33FBA74BA4; Sat, 14 Apr 2018 12:54:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22d.google.com with SMTP id d7so13123285ioc.11; Sat, 14 Apr 2018 05:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HkybOt/pAPEQgxgxjTGZ43QknkXp0iHi6l785MPm6w0=; b=Uz0ZJ7YBBAFkwmzZO22QVOYY2idvDzcoFhfMVtMSvFRlhnpoK6WKuXnuaqNDVboZAN kh7X7DHrDQ6vat/Wi4y5kf8qHJQuxGMCrqoMi44ATEgSPGSqvOWXwnOl5pmW5p17dRtt WpP5qIEgYKQFbfWGkOw5A1P/lEbx2zq3VkwVEp1qP5td6164NtayivtZL/b/x9PM/7rc TkQmJl+CJbNi2uc6hUsK7ibyO9L2maSOjsNuDuIWloasc4ffWKP/4Uv7fpVthad55Poa 2PgMdXIgKEVb0sBzSvVrhWlPkBTsHeZn3RrYWQUHxC8KajmNpUSf0mYuWHHHJhZNlGlZ d4Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HkybOt/pAPEQgxgxjTGZ43QknkXp0iHi6l785MPm6w0=; b=GVsmI8FNun3oOIj7Cmp2AmwMmjmS1gEJBHt6ZftRD7v5Vi0pxCQYzNIngJ2LWyTjFE IiCnjuL3kZvWygPjw+dkff0GN9xjn/RDOpvo+QyIDM2nPj6GhHNNOs8exqNvPCJ3Vi/L HD0q4L56NbZ8o8PQV5b3BGijjEYvIvQnkXKGC3O77HTMYw2ffa+Vzxsa8kjTJ3rpDk0R uHIpS/t5EFxY0x/AuvpLdCroBSdkCp83hKSuSD6p7KCHUx2YhradffQeQ/PB2PsDHpzn wY6sLSthHrHiN0igrTw038LNaYiCsF6nQsEPsnhSQPUhb3k2RIjBoHp0opAtZRCpIVjU eX0Q== X-Gm-Message-State: ALQs6tAnF9xNOCGZgEG11u45MFh/H1gXQBOQbv9/6tQhtr/XgyjRpsQY LWRlOG2xvX1yng+upxRSK7IPp8S1O4wnatB9fpQvtNiV X-Google-Smtp-Source: AIpwx49L1ajIl970yOcgRDuOb3sucGnQrwW26r+EAFOIT08hb8nXDeXl04Jnne0wd2m2BD7usRtfnNFDBF4xiBhZ4ug= X-Received: by 10.107.134.85 with SMTP id i82mr16437337iod.210.1523710475693; Sat, 14 Apr 2018 05:54:35 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.197 with HTTP; Sat, 14 Apr 2018 05:54:15 -0700 (PDT) In-Reply-To: References: <201804132232.w3DMWSmI019256@repo.freebsd.org> From: Ed Maste Date: Sat, 14 Apr 2018 08:54:15 -0400 X-Google-Sender-Auth: N8Gjb2HEZ4WxU3xgarqYqg383Lk Message-ID: Subject: Re: svn commit: r332493 - stable/11/sys/net To: Magnus Ringman Cc: Brooks Davis , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, freebsd-stable stable Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 12:54:36 -0000 On 14 April 2018 at 07:31, Magnus Ringman wrote: > Hi Brooks, this MFC missed your r331077 > (https://reviews.freebsd.org/D14706) thus stable buildkernel currently > breaks on missing those two macros. Thanks for identifying the missing commit Magnus. I've now merged it in r332502. From owner-svn-src-all@freebsd.org Sat Apr 14 14:44:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FF97FA5150; Sat, 14 Apr 2018 14:44:45 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EDEB6D8AD; Sat, 14 Apr 2018 14:44:44 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wr0-f177.google.com with SMTP id s18so14848823wrg.9; Sat, 14 Apr 2018 07:44:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6wB24ARf9KZSam9zpqNrWQr7lf9/vKxb0vxdY+uAa2U=; b=ndDJI0iNqttOwuPPBltXeNgprCBLXDdmzW+GxVfVajxCt6eZJiIAq5QXHoJS0IUQnc 8eZPbpCnwqmYDCWA1iclI7XF0iFtBV51tMjv0StfL1n5JVBUKnjeP+kzJtVFitaqg1En a7O9jnBN3RC0KJ6UbQfpmoa8o1+dKmFbWiM2v0CREsdnRRwaJwqqvnzJ15PR3i77AaY/ lqeXJR2YAdvOpWdayZH37JxfpTN/dN/HzGF+Ba9D+00B9YnvBHzRRNo8ikrQuT237FJ/ fsq43RxXze88XqlARY7onNSjvpCSrkrxAdUC6qaC3QaaXO2Sln17if0AFnC91ZGQ0Ngz H37A== X-Gm-Message-State: ALQs6tAX2mrsyOxRq2YBZVkTbZNz9rzlxzBq1yL+cyG/9TMuRq42/pc0 vX2azCjZ2yY9KrAu6Ky0/w6prWSO X-Google-Smtp-Source: AIpwx4/47aeOXYpZR56yv8XZRZFDP/myKl3vCBLKYIdYr4pacEBZZ8sNZ0LaC54OEYG9uEG4GJ/Dsg== X-Received: by 10.80.143.164 with SMTP id y33mr4991594edy.135.1523717078323; Sat, 14 Apr 2018 07:44:38 -0700 (PDT) Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com. [209.85.128.180]) by smtp.gmail.com with ESMTPSA id h33sm4781576edh.1.2018.04.14.07.44.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Apr 2018 07:44:37 -0700 (PDT) Received: by mail-wr0-f180.google.com with SMTP id q6so2774884wrd.6; Sat, 14 Apr 2018 07:44:37 -0700 (PDT) X-Received: by 10.28.85.137 with SMTP id j131mr6602154wmb.94.1523717077204; Sat, 14 Apr 2018 07:44:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.199.203 with HTTP; Sat, 14 Apr 2018 07:44:36 -0700 (PDT) In-Reply-To: <201804141207.w3EC75cj023620@repo.freebsd.org> References: <201804141207.w3EC75cj023620@repo.freebsd.org> From: "Jonathan T. Looney" Date: Sat, 14 Apr 2018 10:44:36 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332501 - in head: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang... To: Dimitry Andric Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 14:44:45 -0000 On Sat, Apr 14, 2018 at 8:07 AM, Dimitry Andric wrote: > Author: dim > Date: Sat Apr 14 12:07:05 2018 > New Revision: 332501 > URL: https://svnweb.freebsd.org/changeset/base/332501 > > Log: > Pull in r325446 from upstream clang trunk (by me): > > [X86] Add 'sahf' CPU feature to frontend > > Pull in r328944 from upstream llvm trunk (by Chandler Carruth): > > [x86] Expose more of the condition conversion routines in the public > API for X86's instruction information. I've now got a second patch > under review that needs these same APIs. This bit is nicely > orthogonal and obvious, so landing it. NFC. > > Pull in r329414 from upstream llvm trunk (by Craig Topper): > > [X86] Merge itineraries for CLC, CMC, and STC. > > Pull in r329673 from upstream llvm trunk (by Chandler Carruth): > > [x86] Model the direction flag (DF) separately from the rest of > EFLAGS. > > Thanks so much for doing this! Jonathan From owner-svn-src-all@freebsd.org Sat Apr 14 14:57:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A5B8FA5E8C; Sat, 14 Apr 2018 14:57:35 +0000 (UTC) (envelope-from dim@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 D09086EBF8; Sat, 14 Apr 2018 14:57:34 +0000 (UTC) (envelope-from dim@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 C8D8E29B34; Sat, 14 Apr 2018 14:57:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3EEvYrF009716; Sat, 14 Apr 2018 14:57:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3EEvWPr009695; Sat, 14 Apr 2018 14:57:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201804141457.w3EEvWPr009695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Apr 2018 14:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332503 - in head: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang/Driver contrib/llvm/tool... X-SVN-Commit-Revision: 332503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 14:57:35 -0000 Author: dim Date: Sat Apr 14 14:57:32 2018 New Revision: 332503 URL: https://svnweb.freebsd.org/changeset/base/332503 Log: Revert r332501 for now, as it can cause build failures on i386. Reported upstream as . Reported by: emaste, ci.freebsd.org PR: 225330 Deleted: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Modified: head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp head/contrib/llvm/lib/Target/X86/X86.h head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrSystem.td head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td head/contrib/llvm/lib/Target/X86/X86Schedule.td head/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h head/lib/clang/freebsd_cc_version.h head/lib/clang/libllvm/Makefile Modified: head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Sat Apr 14 14:57:32 2018 (r332503) @@ -449,13 +449,6 @@ class MachineBasicBlock (public) /// Replace successor OLD with NEW and update probability info. void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New); - /// Copy a successor (and any probability info) from original block to this - /// block's. Uses an iterator into the original blocks successors. - /// - /// This is useful when doing a partial clone of successors. Afterward, the - /// probabilities may need to be normalized. - void copySuccessor(MachineBasicBlock *Orig, succ_iterator I); - /// Transfers all the successors from MBB to this machine basic block (i.e., /// copies all the successors FromMBB and remove all the successors from /// FromMBB). Modified: head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Sat Apr 14 14:57:32 2018 (r332503) @@ -646,14 +646,6 @@ void MachineBasicBlock::replaceSuccessor(MachineBasicB removeSuccessor(OldI); } -void MachineBasicBlock::copySuccessor(MachineBasicBlock *Orig, - succ_iterator I) { - if (Orig->Probs.empty()) - addSuccessor(*I, Orig->getSuccProbability(I)); - else - addSuccessorWithoutProb(*I); -} - void MachineBasicBlock::addPredecessor(MachineBasicBlock *Pred) { Predecessors.push_back(Pred); } Modified: head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp Sat Apr 14 14:57:32 2018 (r332503) @@ -265,10 +265,13 @@ MCDisassembler::DecodeStatus X86GenericDisassembler::g /// @param reg - The Reg to append. static void translateRegister(MCInst &mcInst, Reg reg) { #define ENTRY(x) X86::x, - static constexpr MCPhysReg llvmRegnums[] = {ALL_REGS}; + uint8_t llvmRegnums[] = { + ALL_REGS + 0 + }; #undef ENTRY - MCPhysReg llvmRegnum = llvmRegnums[reg]; + uint8_t llvmRegnum = llvmRegnums[reg]; mcInst.addOperand(MCOperand::createReg(llvmRegnum)); } Modified: head/contrib/llvm/lib/Target/X86/X86.h ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86.h Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86.h Sat Apr 14 14:57:32 2018 (r332503) @@ -66,9 +66,6 @@ FunctionPass *createX86OptimizeLEAs(); /// Return a pass that transforms setcc + movzx pairs into xor + setcc. FunctionPass *createX86FixupSetCC(); -/// Return a pass that lowers EFLAGS copy pseudo instructions. -FunctionPass *createX86FlagsCopyLoweringPass(); - /// Return a pass that expands WinAlloca pseudo-instructions. FunctionPass *createX86WinAllocaExpander(); Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sat Apr 14 14:57:32 2018 (r332503) @@ -27781,16 +27781,11 @@ X86TargetLowering::EmitInstrWithCustomInserter(Machine MI.getOpcode() == X86::RDFLAGS32 ? X86::PUSHF32 : X86::PUSHF64; unsigned Pop = MI.getOpcode() == X86::RDFLAGS32 ? X86::POP32r : X86::POP64r; MachineInstr *Push = BuildMI(*BB, MI, DL, TII->get(PushF)); - // Permit reads of the EFLAGS and DF registers without them being defined. + // Permit reads of the FLAGS register without it being defined. // This intrinsic exists to read external processor state in flags, such as // the trap flag, interrupt flag, and direction flag, none of which are // modeled by the backend. - assert(Push->getOperand(2).getReg() == X86::EFLAGS && - "Unexpected register in operand!"); Push->getOperand(2).setIsUndef(); - assert(Push->getOperand(3).getReg() == X86::DF && - "Unexpected register in operand!"); - Push->getOperand(3).setIsUndef(); BuildMI(*BB, MI, DL, TII->get(Pop), MI.getOperand(0).getReg()); MI.eraseFromParent(); // The pseudo is gone now. @@ -37832,6 +37827,25 @@ bool X86TargetLowering::isTypeDesirableForOp(unsigned case ISD::XOR: return false; } +} + +/// This function checks if any of the users of EFLAGS copies the EFLAGS. We +/// know that the code that lowers COPY of EFLAGS has to use the stack, and if +/// we don't adjust the stack we clobber the first frame index. +/// See X86InstrInfo::copyPhysReg. +static bool hasCopyImplyingStackAdjustment(const MachineFunction &MF) { + const MachineRegisterInfo &MRI = MF.getRegInfo(); + return any_of(MRI.reg_instructions(X86::EFLAGS), + [](const MachineInstr &RI) { return RI.isCopy(); }); +} + +void X86TargetLowering::finalizeLowering(MachineFunction &MF) const { + if (hasCopyImplyingStackAdjustment(MF)) { + MachineFrameInfo &MFI = MF.getFrameInfo(); + MFI.setHasCopyImplyingStackAdjustment(true); + } + + TargetLoweringBase::finalizeLowering(MF); } /// This method query the target whether it is beneficial for dag combiner to Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.h ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.h Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.h Sat Apr 14 14:57:32 2018 (r332503) @@ -1100,6 +1100,8 @@ namespace llvm { unsigned Factor) const override; + void finalizeLowering(MachineFunction &MF) const override; + protected: std::pair findRepresentativeClass(const TargetRegisterInfo *TRI, Modified: head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Sat Apr 14 14:57:32 2018 (r332503) @@ -473,7 +473,7 @@ let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS, DF], + XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], usesCustomInserter = 1, Uses = [ESP, SSP] in { def TLS_addr32 : I<0, Pseudo, (outs), (ins i32mem:$sym), "# TLS_addr32", @@ -493,7 +493,7 @@ let Defs = [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS, DF], + XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], usesCustomInserter = 1, Uses = [RSP, SSP] in { def TLS_addr64 : I<0, Pseudo, (outs), (ins i64mem:$sym), "# TLS_addr64", @@ -509,7 +509,7 @@ def TLS_base_addr64 : I<0, Pseudo, (outs), (ins i64mem // For i386, the address of the thunk is passed on the stack, on return the // address of the variable is in %eax. %ecx is trashed during the function // call. All other registers are preserved. -let Defs = [EAX, ECX, EFLAGS, DF], +let Defs = [EAX, ECX, EFLAGS], Uses = [ESP, SSP], usesCustomInserter = 1 in def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym), @@ -522,7 +522,7 @@ def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym // %rdi. The lowering will do the right thing with RDI. // On return the address of the variable is in %rax. All other // registers are preserved. -let Defs = [RAX, EFLAGS, DF], +let Defs = [RAX, EFLAGS], Uses = [RSP, SSP], usesCustomInserter = 1 in def TLSCall_64 : I<0, Pseudo, (outs), (ins i64mem:$sym), Modified: head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Sat Apr 14 14:57:32 2018 (r332503) @@ -5782,7 +5782,7 @@ bool X86InstrInfo::findCommutedOpIndices(MachineInstr return false; } -X86::CondCode X86::getCondFromBranchOpc(unsigned BrOpc) { +static X86::CondCode getCondFromBranchOpc(unsigned BrOpc) { switch (BrOpc) { default: return X86::COND_INVALID; case X86::JE_1: return X86::COND_E; @@ -5805,7 +5805,7 @@ X86::CondCode X86::getCondFromBranchOpc(unsigned BrOpc } /// Return condition code of a SET opcode. -X86::CondCode X86::getCondFromSETOpc(unsigned Opc) { +static X86::CondCode getCondFromSETOpc(unsigned Opc) { switch (Opc) { default: return X86::COND_INVALID; case X86::SETAr: case X86::SETAm: return X86::COND_A; @@ -6130,7 +6130,7 @@ void X86InstrInfo::replaceBranchWithTailCall( if (!I->isBranch()) assert(0 && "Can't find the branch to replace!"); - X86::CondCode CC = X86::getCondFromBranchOpc(I->getOpcode()); + X86::CondCode CC = getCondFromBranchOpc(I->getOpcode()); assert(BranchCond.size() == 1); if (CC != BranchCond[0].getImm()) continue; @@ -6237,7 +6237,7 @@ bool X86InstrInfo::AnalyzeBranchImpl( } // Handle conditional branches. - X86::CondCode BranchCode = X86::getCondFromBranchOpc(I->getOpcode()); + X86::CondCode BranchCode = getCondFromBranchOpc(I->getOpcode()); if (BranchCode == X86::COND_INVALID) return true; // Can't handle indirect branch. @@ -6433,7 +6433,7 @@ unsigned X86InstrInfo::removeBranch(MachineBasicBlock if (I->isDebugValue()) continue; if (I->getOpcode() != X86::JMP_1 && - X86::getCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID) + getCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID) break; // Remove the branch. I->eraseFromParent(); @@ -6710,12 +6710,102 @@ void X86InstrInfo::copyPhysReg(MachineBasicBlock &MBB, return; } - if (SrcReg == X86::EFLAGS || DestReg == X86::EFLAGS) { - // FIXME: We use a fatal error here because historically LLVM has tried - // lower some of these physreg copies and we want to ensure we get - // reasonable bug reports if someone encounters a case no other testing - // found. This path should be removed after the LLVM 7 release. - report_fatal_error("Unable to copy EFLAGS physical register!"); + bool FromEFLAGS = SrcReg == X86::EFLAGS; + bool ToEFLAGS = DestReg == X86::EFLAGS; + int Reg = FromEFLAGS ? DestReg : SrcReg; + bool is32 = X86::GR32RegClass.contains(Reg); + bool is64 = X86::GR64RegClass.contains(Reg); + + if ((FromEFLAGS || ToEFLAGS) && (is32 || is64)) { + int Mov = is64 ? X86::MOV64rr : X86::MOV32rr; + int Push = is64 ? X86::PUSH64r : X86::PUSH32r; + int PushF = is64 ? X86::PUSHF64 : X86::PUSHF32; + int Pop = is64 ? X86::POP64r : X86::POP32r; + int PopF = is64 ? X86::POPF64 : X86::POPF32; + int AX = is64 ? X86::RAX : X86::EAX; + + if (!Subtarget.hasLAHFSAHF()) { + assert(Subtarget.is64Bit() && + "Not having LAHF/SAHF only happens on 64-bit."); + // Moving EFLAGS to / from another register requires a push and a pop. + // Notice that we have to adjust the stack if we don't want to clobber the + // first frame index. See X86FrameLowering.cpp - usesTheStack. + if (FromEFLAGS) { + BuildMI(MBB, MI, DL, get(PushF)); + BuildMI(MBB, MI, DL, get(Pop), DestReg); + } + if (ToEFLAGS) { + BuildMI(MBB, MI, DL, get(Push)) + .addReg(SrcReg, getKillRegState(KillSrc)); + BuildMI(MBB, MI, DL, get(PopF)); + } + return; + } + + // The flags need to be saved, but saving EFLAGS with PUSHF/POPF is + // inefficient. Instead: + // - Save the overflow flag OF into AL using SETO, and restore it using a + // signed 8-bit addition of AL and INT8_MAX. + // - Save/restore the bottom 8 EFLAGS bits (CF, PF, AF, ZF, SF) to/from AH + // using LAHF/SAHF. + // - When RAX/EAX is live and isn't the destination register, make sure it + // isn't clobbered by PUSH/POP'ing it before and after saving/restoring + // the flags. + // This approach is ~2.25x faster than using PUSHF/POPF. + // + // This is still somewhat inefficient because we don't know which flags are + // actually live inside EFLAGS. Were we able to do a single SETcc instead of + // SETO+LAHF / ADDB+SAHF the code could be 1.02x faster. + // + // PUSHF/POPF is also potentially incorrect because it affects other flags + // such as TF/IF/DF, which LLVM doesn't model. + // + // Notice that we have to adjust the stack if we don't want to clobber the + // first frame index. + // See X86ISelLowering.cpp - X86::hasCopyImplyingStackAdjustment. + + const TargetRegisterInfo &TRI = getRegisterInfo(); + MachineBasicBlock::LivenessQueryResult LQR = + MBB.computeRegisterLiveness(&TRI, AX, MI); + // We do not want to save and restore AX if we do not have to. + // Moreover, if we do so whereas AX is dead, we would need to set + // an undef flag on the use of AX, otherwise the verifier will + // complain that we read an undef value. + // We do not want to change the behavior of the machine verifier + // as this is usually wrong to read an undef value. + if (MachineBasicBlock::LQR_Unknown == LQR) { + LivePhysRegs LPR(TRI); + LPR.addLiveOuts(MBB); + MachineBasicBlock::iterator I = MBB.end(); + while (I != MI) { + --I; + LPR.stepBackward(*I); + } + // AX contains the top most register in the aliasing hierarchy. + // It may not be live, but one of its aliases may be. + for (MCRegAliasIterator AI(AX, &TRI, true); + AI.isValid() && LQR != MachineBasicBlock::LQR_Live; ++AI) + LQR = LPR.contains(*AI) ? MachineBasicBlock::LQR_Live + : MachineBasicBlock::LQR_Dead; + } + bool AXDead = (Reg == AX) || (MachineBasicBlock::LQR_Dead == LQR); + if (!AXDead) + BuildMI(MBB, MI, DL, get(Push)).addReg(AX, getKillRegState(true)); + if (FromEFLAGS) { + BuildMI(MBB, MI, DL, get(X86::SETOr), X86::AL); + BuildMI(MBB, MI, DL, get(X86::LAHF)); + BuildMI(MBB, MI, DL, get(Mov), Reg).addReg(AX); + } + if (ToEFLAGS) { + BuildMI(MBB, MI, DL, get(Mov), AX).addReg(Reg, getKillRegState(KillSrc)); + BuildMI(MBB, MI, DL, get(X86::ADD8ri), X86::AL) + .addReg(X86::AL) + .addImm(INT8_MAX); + BuildMI(MBB, MI, DL, get(X86::SAHF)); + } + if (!AXDead) + BuildMI(MBB, MI, DL, get(Pop), AX); + return; } DEBUG(dbgs() << "Cannot copy " << RI.getName(SrcReg) @@ -7375,9 +7465,9 @@ bool X86InstrInfo::optimizeCompareInstr(MachineInstr & if (IsCmpZero || IsSwapped) { // We decode the condition code from opcode. if (Instr.isBranch()) - OldCC = X86::getCondFromBranchOpc(Instr.getOpcode()); + OldCC = getCondFromBranchOpc(Instr.getOpcode()); else { - OldCC = X86::getCondFromSETOpc(Instr.getOpcode()); + OldCC = getCondFromSETOpc(Instr.getOpcode()); if (OldCC != X86::COND_INVALID) OpcIsSET = true; else @@ -9323,9 +9413,8 @@ bool X86InstrInfo:: isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const { // FIXME: Return false for x87 stack register classes for now. We can't // allow any loads of these registers before FpGet_ST0_80. - return !(RC == &X86::CCRRegClass || RC == &X86::DFCCRRegClass || - RC == &X86::RFP32RegClass || RC == &X86::RFP64RegClass || - RC == &X86::RFP80RegClass); + return !(RC == &X86::CCRRegClass || RC == &X86::RFP32RegClass || + RC == &X86::RFP64RegClass || RC == &X86::RFP80RegClass); } /// Return a virtual register initialized with the Modified: head/contrib/llvm/lib/Target/X86/X86InstrInfo.h ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrInfo.h Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86InstrInfo.h Sat Apr 14 14:57:32 2018 (r332503) @@ -77,12 +77,6 @@ unsigned getSETFromCond(CondCode CC, bool HasMemoryOpe unsigned getCMovFromCond(CondCode CC, unsigned RegBytes, bool HasMemoryOperand = false); -// Turn jCC opcode into condition code. -CondCode getCondFromBranchOpc(unsigned Opc); - -// Turn setCC opcode into condition code. -CondCode getCondFromSETOpc(unsigned Opc); - // Turn CMov opcode into condition code. CondCode getCondFromCMovOpc(unsigned Opc); Modified: head/contrib/llvm/lib/Target/X86/X86InstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrInfo.td Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86InstrInfo.td Sat Apr 14 14:57:32 2018 (r332503) @@ -1235,18 +1235,18 @@ let mayLoad = 1, mayStore = 1, usesCustomInserter = 1, let mayLoad = 1, mayStore = 1, usesCustomInserter = 1, SchedRW = [WriteRMW] in { - let Defs = [ESP, EFLAGS, DF], Uses = [ESP] in + let Defs = [ESP, EFLAGS], Uses = [ESP] in def WRFLAGS32 : PseudoI<(outs), (ins GR32:$src), [(int_x86_flags_write_u32 GR32:$src)]>, Requires<[Not64BitMode]>; - let Defs = [RSP, EFLAGS, DF], Uses = [RSP] in + let Defs = [RSP, EFLAGS], Uses = [RSP] in def WRFLAGS64 : PseudoI<(outs), (ins GR64:$src), [(int_x86_flags_write_u64 GR64:$src)]>, Requires<[In64BitMode]>; } -let Defs = [ESP, EFLAGS, DF], Uses = [ESP], mayLoad = 1, hasSideEffects=0, +let Defs = [ESP, EFLAGS], Uses = [ESP], mayLoad = 1, hasSideEffects=0, SchedRW = [WriteLoad] in { def POPF16 : I<0x9D, RawFrm, (outs), (ins), "popf{w}", [], IIC_POP_F>, OpSize16; @@ -1254,7 +1254,7 @@ def POPF32 : I<0x9D, RawFrm, (outs), (ins), "popf{l| OpSize32, Requires<[Not64BitMode]>; } -let Defs = [ESP], Uses = [ESP, EFLAGS, DF], mayStore = 1, hasSideEffects=0, +let Defs = [ESP], Uses = [ESP, EFLAGS], mayStore = 1, hasSideEffects=0, SchedRW = [WriteStore] in { def PUSHF16 : I<0x9C, RawFrm, (outs), (ins), "pushf{w}", [], IIC_PUSH_F>, OpSize16; @@ -1294,10 +1294,10 @@ def PUSH64i32 : Ii32S<0x68, RawFrm, (outs), (ins i64i Requires<[In64BitMode]>; } -let Defs = [RSP, EFLAGS, DF], Uses = [RSP], mayLoad = 1, hasSideEffects=0 in +let Defs = [RSP, EFLAGS], Uses = [RSP], mayLoad = 1, hasSideEffects=0 in def POPF64 : I<0x9D, RawFrm, (outs), (ins), "popfq", [], IIC_POP_FD>, OpSize32, Requires<[In64BitMode]>, Sched<[WriteLoad]>; -let Defs = [RSP], Uses = [RSP, EFLAGS, DF], mayStore = 1, hasSideEffects=0 in +let Defs = [RSP], Uses = [RSP, EFLAGS], mayStore = 1, hasSideEffects=0 in def PUSHF64 : I<0x9C, RawFrm, (outs), (ins), "pushfq", [], IIC_PUSH_F>, OpSize32, Requires<[In64BitMode]>, Sched<[WriteStore]>; @@ -1382,7 +1382,8 @@ def BSR64rm : RI<0xBD, MRMSrcMem, (outs GR64:$dst), ( } // Defs = [EFLAGS] let SchedRW = [WriteMicrocoded] in { -let Defs = [EDI,ESI], Uses = [EDI,ESI,DF] in { +// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI +let Defs = [EDI,ESI], Uses = [EDI,ESI,EFLAGS] in { def MOVSB : I<0xA4, RawFrmDstSrc, (outs), (ins dstidx8:$dst, srcidx8:$src), "movsb\t{$src, $dst|$dst, $src}", [], IIC_MOVS>; def MOVSW : I<0xA5, RawFrmDstSrc, (outs), (ins dstidx16:$dst, srcidx16:$src), @@ -1393,33 +1394,36 @@ def MOVSQ : RI<0xA5, RawFrmDstSrc, (outs), (ins dstidx "movsq\t{$src, $dst|$dst, $src}", [], IIC_MOVS>; } -let Defs = [EDI], Uses = [AL,EDI,DF] in +// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI +let Defs = [EDI], Uses = [AL,EDI,EFLAGS] in def STOSB : I<0xAA, RawFrmDst, (outs), (ins dstidx8:$dst), "stosb\t{%al, $dst|$dst, al}", [], IIC_STOS>; -let Defs = [EDI], Uses = [AX,EDI,DF] in +let Defs = [EDI], Uses = [AX,EDI,EFLAGS] in def STOSW : I<0xAB, RawFrmDst, (outs), (ins dstidx16:$dst), "stosw\t{%ax, $dst|$dst, ax}", [], IIC_STOS>, OpSize16; -let Defs = [EDI], Uses = [EAX,EDI,DF] in +let Defs = [EDI], Uses = [EAX,EDI,EFLAGS] in def STOSL : I<0xAB, RawFrmDst, (outs), (ins dstidx32:$dst), "stos{l|d}\t{%eax, $dst|$dst, eax}", [], IIC_STOS>, OpSize32; -let Defs = [RDI], Uses = [RAX,RDI,DF] in +let Defs = [RDI], Uses = [RAX,RDI,EFLAGS] in def STOSQ : RI<0xAB, RawFrmDst, (outs), (ins dstidx64:$dst), "stosq\t{%rax, $dst|$dst, rax}", [], IIC_STOS>; -let Defs = [EDI,EFLAGS], Uses = [AL,EDI,DF] in +// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI +let Defs = [EDI,EFLAGS], Uses = [AL,EDI,EFLAGS] in def SCASB : I<0xAE, RawFrmDst, (outs), (ins dstidx8:$dst), "scasb\t{$dst, %al|al, $dst}", [], IIC_SCAS>; -let Defs = [EDI,EFLAGS], Uses = [AX,EDI,DF] in +let Defs = [EDI,EFLAGS], Uses = [AX,EDI,EFLAGS] in def SCASW : I<0xAF, RawFrmDst, (outs), (ins dstidx16:$dst), "scasw\t{$dst, %ax|ax, $dst}", [], IIC_SCAS>, OpSize16; -let Defs = [EDI,EFLAGS], Uses = [EAX,EDI,DF] in +let Defs = [EDI,EFLAGS], Uses = [EAX,EDI,EFLAGS] in def SCASL : I<0xAF, RawFrmDst, (outs), (ins dstidx32:$dst), "scas{l|d}\t{$dst, %eax|eax, $dst}", [], IIC_SCAS>, OpSize32; -let Defs = [EDI,EFLAGS], Uses = [RAX,EDI,DF] in +let Defs = [EDI,EFLAGS], Uses = [RAX,EDI,EFLAGS] in def SCASQ : RI<0xAF, RawFrmDst, (outs), (ins dstidx64:$dst), "scasq\t{$dst, %rax|rax, $dst}", [], IIC_SCAS>; -let Defs = [EDI,ESI,EFLAGS], Uses = [EDI,ESI,DF] in { +// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI +let Defs = [EDI,ESI,EFLAGS], Uses = [EDI,ESI,EFLAGS] in { def CMPSB : I<0xA6, RawFrmDstSrc, (outs), (ins dstidx8:$dst, srcidx8:$src), "cmpsb\t{$dst, $src|$src, $dst}", [], IIC_CMPS>; def CMPSW : I<0xA7, RawFrmDstSrc, (outs), (ins dstidx16:$dst, srcidx16:$src), @@ -2066,7 +2070,8 @@ def DATA32_PREFIX : I<0x66, RawFrm, (outs), (ins), "d } // SchedRW // Repeat string operation instruction prefixes -let Defs = [ECX], Uses = [ECX,DF], SchedRW = [WriteMicrocoded] in { +// These use the DF flag in the EFLAGS register to inc or dec ECX +let Defs = [ECX], Uses = [ECX,EFLAGS], SchedRW = [WriteMicrocoded] in { // Repeat (used with INS, OUTS, MOVS, LODS and STOS) def REP_PREFIX : I<0xF3, RawFrm, (outs), (ins), "rep", []>; // Repeat while not equal (used with CMPS and SCAS) @@ -2075,22 +2080,24 @@ def REPNE_PREFIX : I<0xF2, RawFrm, (outs), (ins), "re // String manipulation instructions let SchedRW = [WriteMicrocoded] in { -let Defs = [AL,ESI], Uses = [ESI,DF] in +// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI +let Defs = [AL,ESI], Uses = [ESI,EFLAGS] in def LODSB : I<0xAC, RawFrmSrc, (outs), (ins srcidx8:$src), "lodsb\t{$src, %al|al, $src}", [], IIC_LODS>; -let Defs = [AX,ESI], Uses = [ESI,DF] in +let Defs = [AX,ESI], Uses = [ESI,EFLAGS] in def LODSW : I<0xAD, RawFrmSrc, (outs), (ins srcidx16:$src), "lodsw\t{$src, %ax|ax, $src}", [], IIC_LODS>, OpSize16; -let Defs = [EAX,ESI], Uses = [ESI,DF] in +let Defs = [EAX,ESI], Uses = [ESI,EFLAGS] in def LODSL : I<0xAD, RawFrmSrc, (outs), (ins srcidx32:$src), "lods{l|d}\t{$src, %eax|eax, $src}", [], IIC_LODS>, OpSize32; -let Defs = [RAX,ESI], Uses = [ESI,DF] in +let Defs = [RAX,ESI], Uses = [ESI,EFLAGS] in def LODSQ : RI<0xAD, RawFrmSrc, (outs), (ins srcidx64:$src), "lodsq\t{$src, %rax|rax, $src}", [], IIC_LODS>; } let SchedRW = [WriteSystem] in { -let Defs = [ESI], Uses = [DX,ESI,DF] in { +// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI +let Defs = [ESI], Uses = [DX,ESI,EFLAGS] in { def OUTSB : I<0x6E, RawFrmSrc, (outs), (ins srcidx8:$src), "outsb\t{$src, %dx|dx, $src}", [], IIC_OUTS>; def OUTSW : I<0x6F, RawFrmSrc, (outs), (ins srcidx16:$src), @@ -2099,7 +2106,8 @@ def OUTSL : I<0x6F, RawFrmSrc, (outs), (ins srcidx32:$ "outs{l|d}\t{$src, %dx|dx, $src}", [], IIC_OUTS>, OpSize32; } -let Defs = [EDI], Uses = [DX,EDI,DF] in { +// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI +let Defs = [EDI], Uses = [DX,EDI,EFLAGS] in { def INSB : I<0x6C, RawFrmDst, (outs), (ins dstidx8:$dst), "insb\t{%dx, $dst|$dst, dx}", [], IIC_INS>; def INSW : I<0x6D, RawFrmDst, (outs), (ins dstidx16:$dst), @@ -2109,21 +2117,18 @@ def INSL : I<0x6D, RawFrmDst, (outs), (ins dstidx32:$d } } -// EFLAGS management instructions. -let SchedRW = [WriteALU], Defs = [EFLAGS], Uses = [EFLAGS] in { -def CLC : I<0xF8, RawFrm, (outs), (ins), "clc", [], IIC_CLC_CMC_STC>; -def STC : I<0xF9, RawFrm, (outs), (ins), "stc", [], IIC_CLC_CMC_STC>; -def CMC : I<0xF5, RawFrm, (outs), (ins), "cmc", [], IIC_CLC_CMC_STC>; -} - -// DF management instructions. -// FIXME: These are a bit more expensive than CLC and STC. We should consider -// adjusting their schedule bucket. -let SchedRW = [WriteALU], Defs = [DF] in { +// Flag instructions +let SchedRW = [WriteALU] in { +def CLC : I<0xF8, RawFrm, (outs), (ins), "clc", [], IIC_CLC>; +def STC : I<0xF9, RawFrm, (outs), (ins), "stc", [], IIC_STC>; +def CLI : I<0xFA, RawFrm, (outs), (ins), "cli", [], IIC_CLI>; +def STI : I<0xFB, RawFrm, (outs), (ins), "sti", [], IIC_STI>; def CLD : I<0xFC, RawFrm, (outs), (ins), "cld", [], IIC_CLD>; def STD : I<0xFD, RawFrm, (outs), (ins), "std", [], IIC_STD>; -} +def CMC : I<0xF5, RawFrm, (outs), (ins), "cmc", [], IIC_CMC>; +def CLTS : I<0x06, RawFrm, (outs), (ins), "clts", [], IIC_CLTS>, TB; +} // Table lookup instructions let Uses = [AL,EBX], Defs = [AL], hasSideEffects = 0, mayLoad = 1 in Modified: head/contrib/llvm/lib/Target/X86/X86InstrSystem.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrSystem.td Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86InstrSystem.td Sat Apr 14 14:57:32 2018 (r332503) @@ -693,19 +693,6 @@ let Uses = [RAX, RBX, RCX, RDX], Defs = [RAX, RBX, RCX } // SchedRW //===----------------------------------------------------------------------===// -// TS flag control instruction. -let SchedRW = [WriteSystem] in { -def CLTS : I<0x06, RawFrm, (outs), (ins), "clts", [], IIC_CLTS>, TB; -} - -//===----------------------------------------------------------------------===// -// IF (inside EFLAGS) management instructions. -let SchedRW = [WriteSystem], Uses = [EFLAGS], Defs = [EFLAGS] in { -def CLI : I<0xFA, RawFrm, (outs), (ins), "cli", [], IIC_CLI>; -def STI : I<0xFB, RawFrm, (outs), (ins), "sti", [], IIC_STI>; -} - -//===----------------------------------------------------------------------===// // RDPID Instruction let SchedRW = [WriteSystem] in { def RDPID32 : I<0xC7, MRM7r, (outs GR32:$src), (ins), Modified: head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td Sat Apr 14 14:57:32 2018 (r332503) @@ -251,19 +251,9 @@ def ST7 : X86Reg<"st(7)", 7>, DwarfRegNum<[40, 19, 18] // Floating-point status word def FPSW : X86Reg<"fpsw", 0>; -// Status flags register. -// -// Note that some flags that are commonly thought of as part of the status -// flags register are modeled separately. Typically this is due to instructions -// reading and updating those flags independently of all the others. We don't -// want to create false dependencies between these instructions and so we use -// a separate register to model them. +// Status flags register def EFLAGS : X86Reg<"flags", 0>; -// The direction flag. -def DF : X86Reg<"DF", 0>; - - // Segment registers def CS : X86Reg<"cs", 1>; def DS : X86Reg<"ds", 3>; @@ -504,10 +494,6 @@ def CCR : RegisterClass<"X86", [i32], 32, (add EFLAGS) let isAllocatable = 0; } def FPCCR : RegisterClass<"X86", [i16], 16, (add FPSW)> { - let CopyCost = -1; // Don't allow copying of status registers. - let isAllocatable = 0; -} -def DFCCR : RegisterClass<"X86", [i32], 32, (add DF)> { let CopyCost = -1; // Don't allow copying of status registers. let isAllocatable = 0; } Modified: head/contrib/llvm/lib/Target/X86/X86Schedule.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86Schedule.td Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86Schedule.td Sat Apr 14 14:57:32 2018 (r332503) @@ -608,10 +608,12 @@ def IIC_CMPXCHG_8B : InstrItinClass; def IIC_CMPXCHG_16B : InstrItinClass; def IIC_LODS : InstrItinClass; def IIC_OUTS : InstrItinClass; -def IIC_CLC_CMC_STC : InstrItinClass; +def IIC_CLC : InstrItinClass; def IIC_CLD : InstrItinClass; def IIC_CLI : InstrItinClass; +def IIC_CMC : InstrItinClass; def IIC_CLTS : InstrItinClass; +def IIC_STC : InstrItinClass; def IIC_STI : InstrItinClass; def IIC_STD : InstrItinClass; def IIC_XLAT : InstrItinClass; Modified: head/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td Sat Apr 14 14:57:32 2018 (r332503) @@ -514,10 +514,12 @@ def AtomItineraries : ProcessorItineraries< InstrItinData] >, InstrItinData] >, InstrItinData] >, - InstrItinData] >, + InstrItinData] >, InstrItinData] >, InstrItinData] >, + InstrItinData] >, InstrItinData] >, + InstrItinData] >, InstrItinData] >, InstrItinData] >, InstrItinData] >, Modified: head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp Sat Apr 14 14:57:32 2018 (r332503) @@ -62,7 +62,6 @@ void initializeX86CallFrameOptimizationPass(PassRegist void initializeX86CmovConverterPassPass(PassRegistry &); void initializeX86ExecutionDepsFixPass(PassRegistry &); void initializeX86DomainReassignmentPass(PassRegistry &); -void initializeX86FlagsCopyLoweringPassPass(PassRegistry &); } // end namespace llvm @@ -81,7 +80,6 @@ extern "C" void LLVMInitializeX86Target() { initializeX86CmovConverterPassPass(PR); initializeX86ExecutionDepsFixPass(PR); initializeX86DomainReassignmentPass(PR); - initializeX86FlagsCopyLoweringPassPass(PR); } static std::unique_ptr createTLOF(const Triple &TT) { @@ -417,7 +415,6 @@ void X86PassConfig::addPreRegAlloc() { addPass(createX86CallFrameOptimization()); } - addPass(createX86FlagsCopyLoweringPass()); addPass(createX86WinAllocaExpander()); } void X86PassConfig::addMachineSSAOptimization() { Modified: head/contrib/llvm/tools/clang/include/clang/Driver/Options.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Driver/Options.td Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/tools/clang/include/clang/Driver/Options.td Sat Apr 14 14:57:32 2018 (r332503) @@ -2559,8 +2559,6 @@ def mrtm : Flag<["-"], "mrtm">, Group, Group; def mrdseed : Flag<["-"], "mrdseed">, Group; def mno_rdseed : Flag<["-"], "mno-rdseed">, Group; -def msahf : Flag<["-"], "msahf">, Group; -def mno_sahf : Flag<["-"], "mno-sahf">, Group; def msgx : Flag<["-"], "msgx">, Group; def mno_sgx : Flag<["-"], "mno-sgx">, Group; def msha : Flag<["-"], "msha">, Group; Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp Sat Apr 14 14:57:32 2018 (r332503) @@ -198,7 +198,6 @@ bool X86TargetInfo::initFeatureMap( LLVM_FALLTHROUGH; case CK_Core2: setFeatureEnabledImpl(Features, "ssse3", true); - setFeatureEnabledImpl(Features, "sahf", true); LLVM_FALLTHROUGH; case CK_Yonah: case CK_Prescott: @@ -240,7 +239,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "ssse3", true); setFeatureEnabledImpl(Features, "fxsr", true); setFeatureEnabledImpl(Features, "cx16", true); - setFeatureEnabledImpl(Features, "sahf", true); break; case CK_KNM: @@ -271,7 +269,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "xsaveopt", true); setFeatureEnabledImpl(Features, "xsave", true); setFeatureEnabledImpl(Features, "movbe", true); - setFeatureEnabledImpl(Features, "sahf", true); break; case CK_K6_2: @@ -285,7 +282,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "sse4a", true); setFeatureEnabledImpl(Features, "lzcnt", true); setFeatureEnabledImpl(Features, "popcnt", true); - setFeatureEnabledImpl(Features, "sahf", true); LLVM_FALLTHROUGH; case CK_K8SSE3: setFeatureEnabledImpl(Features, "sse3", true); @@ -319,7 +315,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "prfchw", true); setFeatureEnabledImpl(Features, "cx16", true); setFeatureEnabledImpl(Features, "fxsr", true); - setFeatureEnabledImpl(Features, "sahf", true); break; case CK_ZNVER1: @@ -343,7 +338,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "prfchw", true); setFeatureEnabledImpl(Features, "rdrnd", true); setFeatureEnabledImpl(Features, "rdseed", true); - setFeatureEnabledImpl(Features, "sahf", true); setFeatureEnabledImpl(Features, "sha", true); setFeatureEnabledImpl(Features, "sse4a", true); setFeatureEnabledImpl(Features, "xsave", true); @@ -378,7 +372,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "cx16", true); setFeatureEnabledImpl(Features, "fxsr", true); setFeatureEnabledImpl(Features, "xsave", true); - setFeatureEnabledImpl(Features, "sahf", true); break; } if (!TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec)) @@ -775,8 +768,6 @@ bool X86TargetInfo::handleTargetFeatures(std::vector(Feature) @@ -1249,7 +1240,6 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) .Case("rdrnd", true) .Case("rdseed", true) .Case("rtm", true) - .Case("sahf", true) .Case("sgx", true) .Case("sha", true) .Case("shstk", true) @@ -1323,7 +1313,6 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons .Case("retpoline", HasRetpoline) .Case("retpoline-external-thunk", HasRetpolineExternalThunk) .Case("rtm", HasRTM) - .Case("sahf", HasLAHFSAHF) .Case("sgx", HasSGX) .Case("sha", HasSHA) .Case("shstk", HasSHSTK) Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h Sat Apr 14 12:52:34 2018 (r332502) +++ head/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h Sat Apr 14 14:57:32 2018 (r332503) @@ -98,7 +98,6 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T bool HasPREFETCHWT1 = false; bool HasRetpoline = false; bool HasRetpolineExternalThunk = false; - bool HasLAHFSAHF = false; /// \brief Enumeration of all of the X86 CPUs supported by Clang. /// Modified: head/lib/clang/freebsd_cc_version.h ============================================================================== --- head/lib/clang/freebsd_cc_version.h Sat Apr 14 12:52:34 2018 (r332502) +++ head/lib/clang/freebsd_cc_version.h Sat Apr 14 14:57:32 2018 (r332503) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200012 +#define FREEBSD_CC_VERSION 1200013 Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Sat Apr 14 12:52:34 2018 (r332502) +++ head/lib/clang/libllvm/Makefile Sat Apr 14 14:57:32 2018 (r332503) @@ -1042,7 +1042,6 @@ SRCS_MIN+= Target/X86/X86FastISel.cpp SRCS_MIN+= Target/X86/X86FixupBWInsts.cpp SRCS_MIN+= Target/X86/X86FixupLEAs.cpp SRCS_MIN+= Target/X86/X86FixupSetCC.cpp -SRCS_MIN+= Target/X86/X86FlagsCopyLowering.cpp SRCS_MIN+= Target/X86/X86FloatingPoint.cpp SRCS_MIN+= Target/X86/X86FrameLowering.cpp SRCS_MIN+= Target/X86/X86ISelDAGToDAG.cpp From owner-svn-src-all@freebsd.org Sat Apr 14 15:10:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7DA0F80D04; Sat, 14 Apr 2018 15:10:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7138D71C44; Sat, 14 Apr 2018 15:10:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A6AD551082; Sat, 14 Apr 2018 17:03:15 +0200 (CEST) From: Dimitry Andric Message-Id: <90F6B862-D4D3-41CB-85C3-7FA40D83465C@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_9DCC695B-34DC-4001-9395-BF31D97C775B"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r332501 - in head: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang... Date: Sat, 14 Apr 2018 17:03:14 +0200 In-Reply-To: Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: "Jonathan T. Looney" References: <201804141207.w3EC75cj023620@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 15:10:42 -0000 --Apple-Mail=_9DCC695B-34DC-4001-9395-BF31D97C775B Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 14 Apr 2018, at 16:44, Jonathan T. Looney wrote: > > On Sat, Apr 14, 2018 at 8:07 AM, Dimitry Andric wrote: > Author: dim > Date: Sat Apr 14 12:07:05 2018 > New Revision: 332501 > URL: https://svnweb.freebsd.org/changeset/base/332501 > > Log: > Pull in r325446 from upstream clang trunk (by me): > > [X86] Add 'sahf' CPU feature to frontend > > Pull in r328944 from upstream llvm trunk (by Chandler Carruth): > > [x86] Expose more of the condition conversion routines in the public > API for X86's instruction information. I've now got a second patch > under review that needs these same APIs. This bit is nicely > orthogonal and obvious, so landing it. NFC. > > Pull in r329414 from upstream llvm trunk (by Craig Topper): > > [X86] Merge itineraries for CLC, CMC, and STC. > > Pull in r329673 from upstream llvm trunk (by Chandler Carruth): > > [x86] Model the direction flag (DF) separately from the rest of > EFLAGS. > > > > > Thanks so much for doing this! Unfortunately I had to revert it, as it caused buildworld failures on i386. :-/ It has been reported upstream for further investigation. -Dimitry --Apple-Mail=_9DCC695B-34DC-4001-9395-BF31D97C775B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWtIYMgAKCRCwXqMKLiCW o8heAKCk5XrRSoOsqJE40M1wvb4oHxTunwCgnEk5FrWUF4jBupc5sO9ZImMtRZQ= =WGIo -----END PGP SIGNATURE----- --Apple-Mail=_9DCC695B-34DC-4001-9395-BF31D97C775B-- From owner-svn-src-all@freebsd.org Sat Apr 14 17:33:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B480AF8B98C; Sat, 14 Apr 2018 17:33:17 +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 657528EF4A; Sat, 14 Apr 2018 17:33:17 +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 5FEF32B46E; Sat, 14 Apr 2018 17:33:17 +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 w3EHXH0D090267; Sat, 14 Apr 2018 17:33:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3EHXHNd090266; Sat, 14 Apr 2018 17:33:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804141733.w3EHXHNd090266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Apr 2018 17:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332504 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 332504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 17:33:17 -0000 Author: kib Date: Sat Apr 14 17:33:16 2018 New Revision: 332504 URL: https://svnweb.freebsd.org/changeset/base/332504 Log: Set PG_G global mapping bit on the trampoline ptes. Trampoline mappings are better treated as global since they are valid in all address spaces, even for PTI. pmap_invalidate_range() must work on global mappings for pti since kernel_pmap invalidations are really same as for non-PTI. Reviewed by: alc, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D15052 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Apr 14 14:57:32 2018 (r332503) +++ head/sys/amd64/amd64/pmap.c Sat Apr 14 17:33:16 2018 (r332504) @@ -8000,7 +8000,7 @@ pmap_pti_add_kva_locked(vm_offset_t sva, vm_offset_t e for (; sva < eva; sva += PAGE_SIZE) { pte = pmap_pti_pte(sva, &unwire_pde); pa = pmap_kextract(sva); - ptev = pa | X86_PG_RW | X86_PG_V | X86_PG_A | + ptev = pa | X86_PG_RW | X86_PG_V | X86_PG_A | X86_PG_G | (exec ? 0 : pg_nx) | pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, FALSE); if (*pte == 0) { From owner-svn-src-all@freebsd.org Sat Apr 14 17:38:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1A0DF8BF07; Sat, 14 Apr 2018 17:38:50 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com [209.85.128.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D4FD690AC; Sat, 14 Apr 2018 17:38:50 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wr0-f170.google.com with SMTP id q6so3418641wrd.6; Sat, 14 Apr 2018 10:38:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fGCUmt8PU6f4Yz6zfuAqm0cUhDtBYGD62lB2DzR+j3w=; b=VnB4BBcNPu/BnzQGe7G96UMuS02qs/MgIBlc2jvTgzThh0uy8W9cMaD/FehnB+Fm5w eIwf04EAFdi5ODTKUwGQF7urFCUmLw4Qqdcu5tKyPnI+i6YLHu2vycOboIvibEW5aygF 2W68jjnLye7dP+PSdG46HGTYKs9fvkRGm21lFKqLuCXP5UOzu+chNtpwE8/MaGRZ61eo dK50ecGS/Qou0ZVaFT1OZLY8KMPi8ajGElebdYWc1x52gejxlPT6qABEHjCE02fzUYse q4X4pSbOFDwy3niGdp9Kkm4SNmLIbCe/eRJ7bhzHk9rnB39vYAKa5Cu/LSSYltRpYX0l E1HQ== X-Gm-Message-State: ALQs6tBrs078lZEWhOqmu0M2w3u5rbHQcZ82iwL9cK13LQSZIkD/asKi Jsnsnr6bKl37itNy9f5cBNUiIGbp X-Google-Smtp-Source: AIpwx495ufcLJfTwfM0+YuseptfwtwGKWYiRWX8W1DNHOFEIlH+XcLowUEem3hGNVDfWXsQZqCIIWQ== X-Received: by 10.80.135.68 with SMTP id 4mr25434843edv.11.1523727528872; Sat, 14 Apr 2018 10:38:48 -0700 (PDT) Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com. [209.85.128.176]) by smtp.gmail.com with ESMTPSA id i8sm4617590edj.3.2018.04.14.10.38.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Apr 2018 10:38:48 -0700 (PDT) Received: by mail-wr0-f176.google.com with SMTP id d19so15501771wre.1; Sat, 14 Apr 2018 10:38:48 -0700 (PDT) X-Received: by 10.28.141.138 with SMTP id p132mr6870736wmd.51.1523727528541; Sat, 14 Apr 2018 10:38:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.199.203 with HTTP; Sat, 14 Apr 2018 10:38:48 -0700 (PDT) In-Reply-To: <90F6B862-D4D3-41CB-85C3-7FA40D83465C@FreeBSD.org> References: <201804141207.w3EC75cj023620@repo.freebsd.org> <90F6B862-D4D3-41CB-85C3-7FA40D83465C@FreeBSD.org> From: "Jonathan T. Looney" Date: Sat, 14 Apr 2018 13:38:48 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332501 - in head: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang... To: Dimitry Andric Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 17:38:51 -0000 On Sat, Apr 14, 2018 at 11:03 AM, Dimitry Andric wrote: > > Unfortunately I had to revert it, as it caused buildworld failures on > i386. :-/ It has been reported upstream for further investigation. :-( Any chance we can at least get r325446 (-msahf), since that gives us a way to workaround the problem? I'm sorry about the extra work... Jonathan From owner-svn-src-all@freebsd.org Sat Apr 14 17:41:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 913D0F8C46D; Sat, 14 Apr 2018 17:41:55 +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 45D1C69D7B; Sat, 14 Apr 2018 17:41:55 +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 40DAE2B5E9; Sat, 14 Apr 2018 17:41: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 w3EHftiR093680; Sat, 14 Apr 2018 17:41:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3EHfsY9093677; Sat, 14 Apr 2018 17:41:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804141741.w3EHfsY9093677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 14 Apr 2018 17:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332505 - in stable/11/sys: amd64/amd64 vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 vm X-SVN-Commit-Revision: 332505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 17:41:55 -0000 Author: kib Date: Sat Apr 14 17:41:54 2018 New Revision: 332505 URL: https://svnweb.freebsd.org/changeset/base/332505 Log: MFC r332182: Handle Skylake-X errata SKZ63. Modified: stable/11/sys/amd64/amd64/pmap.c stable/11/sys/vm/vm_page.c stable/11/sys/vm/vm_page.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Sat Apr 14 17:33:16 2018 (r332504) +++ stable/11/sys/amd64/amd64/pmap.c Sat Apr 14 17:41:54 2018 (r332505) @@ -1224,7 +1224,35 @@ pmap_init(void) struct pmap_preinit_mapping *ppim; vm_page_t mpte; vm_size_t s; - int error, i, pv_npg; + int error, i, pv_npg, ret, skz63; + + /* Detect bare-metal Skylake Server and Skylake-X. */ + if (vm_guest == VM_GUEST_NO && cpu_vendor_id == CPU_VENDOR_INTEL && + CPUID_TO_FAMILY(cpu_id) == 0x6 && CPUID_TO_MODEL(cpu_id) == 0x55) { + /* + * Skylake-X errata SKZ63. Processor May Hang When + * Executing Code In an HLE Transaction Region between + * 40000000H and 403FFFFFH. + * + * Mark the pages in the range as preallocated. It + * seems to be impossible to distinguish between + * Skylake Server and Skylake X. + */ + skz63 = 1; + TUNABLE_INT_FETCH("hw.skz63_enable", &skz63); + if (skz63 != 0) { + if (bootverbose) + printf("SKZ63: skipping 4M RAM starting " + "at physical 1G\n"); + for (i = 0; i < atop(0x400000); i++) { + ret = vm_page_blacklist_add(0x40000000 + + ptoa(i), FALSE); + if (!ret && bootverbose) + printf("page at %#lx already used\n", + 0x40000000 + ptoa(i)); + } + } + } /* * Initialize the vm page array entries for the kernel pmap's Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Sat Apr 14 17:33:16 2018 (r332504) +++ stable/11/sys/vm/vm_page.c Sat Apr 14 17:41:54 2018 (r332505) @@ -292,6 +292,27 @@ vm_page_blacklist_next(char **list, char *end) return (0); } +bool +vm_page_blacklist_add(vm_paddr_t pa, bool verbose) +{ + vm_page_t m; + int ret; + + m = vm_phys_paddr_to_vm_page(pa); + if (m == NULL) + return (true); /* page does not exist, no failure */ + + mtx_lock(&vm_page_queue_free_mtx); + ret = vm_phys_unfree_page(m); + mtx_unlock(&vm_page_queue_free_mtx); + if (ret) { + TAILQ_INSERT_TAIL(&blacklist_head, m, listq); + if (verbose) + printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa); + } + return (ret); +} + /* * vm_page_blacklist_check: * @@ -303,26 +324,13 @@ static void vm_page_blacklist_check(char *list, char *end) { vm_paddr_t pa; - vm_page_t m; char *next; - int ret; next = list; while (next != NULL) { if ((pa = vm_page_blacklist_next(&next, end)) == 0) continue; - m = vm_phys_paddr_to_vm_page(pa); - if (m == NULL) - continue; - mtx_lock(&vm_page_queue_free_mtx); - ret = vm_phys_unfree_page(m); - mtx_unlock(&vm_page_queue_free_mtx); - if (ret == TRUE) { - TAILQ_INSERT_TAIL(&blacklist_head, m, listq); - if (bootverbose) - printf("Skipping page with pa 0x%jx\n", - (uintmax_t)pa); - } + vm_page_blacklist_add(pa, bootverbose); } } Modified: stable/11/sys/vm/vm_page.h ============================================================================== --- stable/11/sys/vm/vm_page.h Sat Apr 14 17:33:16 2018 (r332504) +++ stable/11/sys/vm/vm_page.h Sat Apr 14 17:41:54 2018 (r332505) @@ -474,6 +474,7 @@ vm_page_t vm_page_alloc_contig(vm_object_t object, vm_ u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); vm_page_t vm_page_alloc_freelist(int, int); +bool vm_page_blacklist_add(vm_paddr_t pa, bool verbose); void vm_page_change_lock(vm_page_t m, struct mtx **mtx); vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, From owner-svn-src-all@freebsd.org Sat Apr 14 19:07:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0C4FF920AD; Sat, 14 Apr 2018 19:07:57 +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 7F9F17CDB1; Sat, 14 Apr 2018 19:07:57 +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 6D42C2C2A8; Sat, 14 Apr 2018 19:07:57 +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 w3EJ7v1V035133; Sat, 14 Apr 2018 19:07:57 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3EJ7uO4035120; Sat, 14 Apr 2018 19:07:56 GMT (envelope-from np@FreeBSD.org) Message-Id: <201804141907.w3EJ7uO4035120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Apr 2018 19:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332506 - in head: sys/dev/cxgbe sys/dev/cxgbe/tom usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: sys/dev/cxgbe sys/dev/cxgbe/tom usr.sbin/cxgbetool X-SVN-Commit-Revision: 332506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 19:07:58 -0000 Author: np Date: Sat Apr 14 19:07:56 2018 New Revision: 332506 URL: https://svnweb.freebsd.org/changeset/base/332506 Log: cxgbe(4): Add support for Connection Offload Policy (aka COP). COP allows fine-grained control on whether to offload a TCP connection using t4_tom, and what settings to apply to a connection selected for offload. t4_tom must still be loaded and IFCAP_TOE must still be enabled for full TCP offload to take place on an interface. The difference is that IFCAP_TOE used to be the only knob and would enable TOE for all new connections on the inteface, but now the driver will also consult the COP, if any, before offloading to the hardware TOE. A policy is a plain text file with any number of rules, one per line. Each rule has a "match" part consisting of a socket-type (L = listen, A = active open, P = passive open, D = don't care) and a pcap-filter(7) expression, and a "settings" part that specifies whether to offload the connection or not and the parameters to use if so. The general format of a rule is: [socket-type] expr => settings Example. See cxgbetool(8) for more information. [L] ip && port http => offload [L] port 443 => !offload [L] port ssh => offload [P] src net 192.168/16 && dst port ssh => offload !nagle !timestamp cong newreno [P] dst port ssh => offload !nagle ecn cong tahoe [P] dst port http => offload [A] dst port 443 => offload tls [A] dst net 192.168/16 => offload !timestamp cong highspeed The driver processes the rules for each new listen, active open, or passive open and stops at the first match. There is an implicit rule at the end of every policy that prohibits offload when no rule in the policy matches: [D] all => !offload This is a reworked and expanded version of a patch submitted by Krishnamraju Eraparaju @ Chelsio. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_ioctl.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h head/usr.sbin/cxgbetool/Makefile head/usr.sbin/cxgbetool/cxgbetool.8 head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Apr 14 17:41:54 2018 (r332505) +++ head/sys/dev/cxgbe/adapter.h Sat Apr 14 19:07:56 2018 (r332506) @@ -804,8 +804,11 @@ struct adapter { void *tom_softc; /* (struct tom_data *) */ struct tom_tunables tt; - struct iw_tunables iwt; + struct t4_offload_policy *policy; + struct rwlock policy_lock; + void *iwarp_softc; /* (struct c4iw_dev *) */ + struct iw_tunables iwt; void *iscsi_ulp_softc; /* (struct cxgbei_data *) */ void *ccr_softc; /* (struct ccr_softc *) */ struct l2t_data *l2t; /* L2 table */ Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Sat Apr 14 17:41:54 2018 (r332505) +++ head/sys/dev/cxgbe/offload.h Sat Apr 14 19:07:56 2018 (r332506) @@ -156,6 +156,7 @@ struct tom_tunables { int num_tls_rx_ports; int tx_align; int tx_zcopy; + int cop_managed_offloading; }; /* iWARP driver tunables */ struct iw_tunables { Modified: head/sys/dev/cxgbe/t4_ioctl.h ============================================================================== --- head/sys/dev/cxgbe/t4_ioctl.h Sat Apr 14 17:41:54 2018 (r332505) +++ head/sys/dev/cxgbe/t4_ioctl.h Sat Apr 14 19:07:56 2018 (r332506) @@ -35,6 +35,7 @@ #include #include +#include /* * Ioctl commands specific to this driver. @@ -344,6 +345,44 @@ struct t4_cudbg_dump { uint8_t *data; }; +enum { + OPEN_TYPE_LISTEN = 'L', + OPEN_TYPE_ACTIVE = 'A', + OPEN_TYPE_PASSIVE = 'P', + OPEN_TYPE_DONTCARE = 'D', +}; + +struct offload_settings { + int8_t offload; + int8_t rx_coalesce; + int8_t cong_algo; + int8_t sched_class; + int8_t tstamp; + int8_t sack; + int8_t nagle; + int8_t ecn; + int8_t ddp; + int8_t tls; + int16_t txq; + int16_t rxq; + int16_t mss; +}; + +struct offload_rule { + char open_type; + struct offload_settings settings; + struct bpf_program bpf_prog; /* compiled program/filter */ +}; + +/* + * An offload policy consists of a set of rules matched in sequence. The + * settings of the first rule that matches are applied to that connection. + */ +struct t4_offload_policy { + uint32_t nrules; + struct offload_rule *rule; +}; + #define CHELSIO_T4_GETREG _IOWR('f', T4_GETREG, struct t4_reg) #define CHELSIO_T4_SETREG _IOW('f', T4_SETREG, struct t4_reg) #define CHELSIO_T4_REGDUMP _IOWR('f', T4_REGDUMP, struct t4_regdump) @@ -368,4 +407,5 @@ struct t4_cudbg_dump { #define CHELSIO_T4_LOAD_BOOT _IOW('f', T4_LOAD_BOOT, struct t4_bootrom) #define CHELSIO_T4_LOAD_BOOTCFG _IOW('f', T4_LOAD_BOOTCFG, struct t4_data) #define CHELSIO_T4_CUDBG_DUMP _IOWR('f', T4_CUDBG_DUMP, struct t4_cudbg_dump) +#define CHELSIO_T4_SET_OFLD_POLICY _IOW('f', T4_SET_OFLD_POLICY, struct t4_offload_policy) #endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Apr 14 17:41:54 2018 (r332505) +++ head/sys/dev/cxgbe/t4_main.c Sat Apr 14 19:07:56 2018 (r332506) @@ -470,6 +470,14 @@ static int pcie_relaxed_ordering = -1; TUNABLE_INT("hw.cxgbe.pcie_relaxed_ordering", &pcie_relaxed_ordering); +#ifdef TCP_OFFLOAD +/* + * TOE tunables. + */ +static int t4_cop_managed_offloading = 0; +TUNABLE_INT("hw.cxgbe.cop_managed_offloading", &t4_cop_managed_offloading); +#endif + /* Functions used by VIs to obtain unique MAC addresses for each VI. */ static int vi_mac_funcs[] = { FW_VI_FUNC_ETH, @@ -617,6 +625,8 @@ static int load_cfg(struct adapter *, struct t4_data * static int load_boot(struct adapter *, struct t4_bootrom *); static int load_bootcfg(struct adapter *, struct t4_data *); static int cudbg_dump(struct adapter *, struct t4_cudbg_dump *); +static void free_offload_policy(struct t4_offload_policy *); +static int set_offload_policy(struct adapter *, struct t4_offload_policy *); static int read_card_mem(struct adapter *, int, struct t4_mem_range *); static int read_i2c(struct adapter *, struct t4_i2c_data *); #ifdef TCP_OFFLOAD @@ -897,6 +907,9 @@ t4_attach(device_t dev) mtx_init(&sc->reg_lock, "indirect register access", 0, MTX_DEF); + sc->policy = NULL; + rw_init(&sc->policy_lock, "connection offload policy"); + rc = t4_map_bars_0_and_4(sc); if (rc != 0) goto done; /* error message displayed already */ @@ -1405,6 +1418,14 @@ t4_detach_common(device_t dev) if (mtx_initialized(&sc->reg_lock)) mtx_destroy(&sc->reg_lock); + if (rw_initialized(&sc->policy_lock)) { + rw_destroy(&sc->policy_lock); +#ifdef TCP_OFFLOAD + if (sc->policy != NULL) + free_offload_policy(sc->policy); +#endif + } + for (i = 0; i < NUM_MEMWIN; i++) { struct memwin *mw = &sc->memwin[i]; @@ -5440,6 +5461,12 @@ t4_sysctls(struct adapter *sc) CTLFLAG_RW, &sc->tt.tx_zcopy, 0, "Enable zero-copy aio_write(2)"); + sc->tt.cop_managed_offloading = !!t4_cop_managed_offloading; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "cop_managed_offloading", CTLFLAG_RW, + &sc->tt.cop_managed_offloading, 0, + "COP (Connection Offload Policy) controls all TOE offload"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timer_tick", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tp_tick, "A", "TP timer tick (us)"); @@ -9385,6 +9412,113 @@ done: return (rc); } +static void +free_offload_policy(struct t4_offload_policy *op) +{ + struct offload_rule *r; + int i; + + if (op == NULL) + return; + + r = &op->rule[0]; + for (i = 0; i < op->nrules; i++, r++) { + free(r->bpf_prog.bf_insns, M_CXGBE); + } + free(op->rule, M_CXGBE); + free(op, M_CXGBE); +} + +static int +set_offload_policy(struct adapter *sc, struct t4_offload_policy *uop) +{ + int i, rc, len; + struct t4_offload_policy *op, *old; + struct bpf_program *bf; + const struct offload_settings *s; + struct offload_rule *r; + void *u; + + if (!is_offload(sc)) + return (ENODEV); + + if (uop->nrules == 0) { + /* Delete installed policies. */ + op = NULL; + goto set_policy; + } if (uop->nrules > 256) { /* arbitrary */ + return (E2BIG); + } + + /* Copy userspace offload policy to kernel */ + op = malloc(sizeof(*op), M_CXGBE, M_ZERO | M_WAITOK); + op->nrules = uop->nrules; + len = op->nrules * sizeof(struct offload_rule); + op->rule = malloc(len, M_CXGBE, M_ZERO | M_WAITOK); + rc = copyin(uop->rule, op->rule, len); + if (rc) { + free(op->rule, M_CXGBE); + free(op, M_CXGBE); + return (rc); + } + + r = &op->rule[0]; + for (i = 0; i < op->nrules; i++, r++) { + + /* Validate open_type */ + if (r->open_type != OPEN_TYPE_LISTEN && + r->open_type != OPEN_TYPE_ACTIVE && + r->open_type != OPEN_TYPE_PASSIVE && + r->open_type != OPEN_TYPE_DONTCARE) { +error: + /* + * Rules 0 to i have malloc'd filters that need to be + * freed. Rules i+1 to nrules have userspace pointers + * and should be left alone. + */ + op->nrules = i; + free_offload_policy(op); + return (rc); + } + + /* Validate settings */ + s = &r->settings; + if ((s->offload != 0 && s->offload != 1) || + s->cong_algo < -1 || s->cong_algo > CONG_ALG_HIGHSPEED || + s->sched_class < -1 || + s->sched_class >= sc->chip_params->nsched_cls) { + rc = EINVAL; + goto error; + } + + bf = &r->bpf_prog; + u = bf->bf_insns; /* userspace ptr */ + bf->bf_insns = NULL; + if (bf->bf_len == 0) { + /* legal, matches everything */ + continue; + } + len = bf->bf_len * sizeof(*bf->bf_insns); + bf->bf_insns = malloc(len, M_CXGBE, M_ZERO | M_WAITOK); + rc = copyin(u, bf->bf_insns, len); + if (rc != 0) + goto error; + + if (!bpf_validate(bf->bf_insns, bf->bf_len)) { + rc = EINVAL; + goto error; + } + } +set_policy: + rw_wlock(&sc->policy_lock); + old = sc->policy; + sc->policy = op; + rw_wunlock(&sc->policy_lock); + free_offload_policy(old); + + return (0); +} + #define MAX_READ_BUF_SIZE (128 * 1024) static int read_card_mem(struct adapter *sc, int win, struct t4_mem_range *mr) @@ -9742,6 +9876,9 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t break; case CHELSIO_T4_CUDBG_DUMP: rc = cudbg_dump(sc, (struct t4_cudbg_dump *)data); + break; + case CHELSIO_T4_SET_OFLD_POLICY: + rc = set_offload_policy(sc, (struct t4_offload_policy *)data); break; default: rc = ENOTTY; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Apr 14 17:41:54 2018 (r332505) +++ head/sys/dev/cxgbe/t4_sge.c Sat Apr 14 19:07:56 2018 (r332506) @@ -963,8 +963,10 @@ mtu_to_max_payload(struct adapter *sc, int mtu, const #ifdef TCP_OFFLOAD if (toe) { - payload = sc->tt.rx_coalesce ? - G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2)) : mtu; + int rxcs = G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2)); + + /* Note that COP can set rx_coalesce on/off per connection. */ + payload = max(mtu, rxcs); } else { #endif /* large enough even when hw VLAN extraction is disabled */ Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Sat Apr 14 17:41:54 2018 (r332505) +++ head/sys/dev/cxgbe/tom/t4_connect.c Sat Apr 14 19:07:56 2018 (r332506) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -55,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "common/common.h" #include "common/t4_msg.h" @@ -233,47 +235,85 @@ do_act_open_rpl(struct sge_iq *iq, const struct rss_he * Options2 for active open. */ static uint32_t -calc_opt2a(struct socket *so, struct toepcb *toep) +calc_opt2a(struct socket *so, struct toepcb *toep, + const struct offload_settings *s) { struct tcpcb *tp = so_sototcpcb(so); struct port_info *pi = toep->vi->pi; struct adapter *sc = pi->adapter; - uint32_t opt2; + uint32_t opt2 = 0; - opt2 = V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]) | - F_RSS_QUEUE_VALID | V_RSS_QUEUE(toep->ofld_rxq->iq.abs_id); + /* + * rx flow control, rx coalesce, congestion control, and tx pace are all + * explicitly set by the driver. On T5+ the ISS is also set by the + * driver to the value picked by the kernel. + */ + if (is_t4(sc)) { + opt2 |= F_RX_FC_VALID | F_RX_COALESCE_VALID; + opt2 |= F_CONG_CNTRL_VALID | F_PACE_VALID; + } else { + opt2 |= F_T5_OPT_2_VALID; /* all 4 valid */ + opt2 |= F_T5_ISS; /* ISS provided in CPL */ + } - if (tp->t_flags & TF_SACK_PERMIT) + if (s->sack > 0 || (s->sack < 0 && (tp->t_flags & TF_SACK_PERMIT))) opt2 |= F_SACK_EN; - if (tp->t_flags & TF_REQ_TSTMP) + if (s->tstamp > 0 || (s->tstamp < 0 && (tp->t_flags & TF_REQ_TSTMP))) opt2 |= F_TSTAMPS_EN; if (tp->t_flags & TF_REQ_SCALE) opt2 |= F_WND_SCALE_EN; - if (V_tcp_do_ecn) + if (s->ecn > 0 || (s->ecn < 0 && V_tcp_do_ecn == 1)) opt2 |= F_CCTRL_ECN; - /* RX_COALESCE is always a valid value (M_RX_COALESCE). */ - if (is_t4(sc)) - opt2 |= F_RX_COALESCE_VALID; + /* XXX: F_RX_CHANNEL for multiple rx c-chan support goes here. */ + + opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); + + /* These defaults are subject to ULP specific fixups later. */ + opt2 |= V_RX_FC_DDP(0) | V_RX_FC_DISABLE(0); + + opt2 |= V_PACE(0); + + if (s->cong_algo >= 0) + opt2 |= V_CONG_CNTRL(s->cong_algo); + else if (sc->tt.cong_algorithm >= 0) + opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); else { - opt2 |= F_T5_OPT_2_VALID; - opt2 |= F_T5_ISS; + struct cc_algo *cc = CC_ALGO(tp); + + if (strcasecmp(cc->name, "reno") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_RENO); + else if (strcasecmp(cc->name, "tahoe") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); + if (strcasecmp(cc->name, "newreno") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); + if (strcasecmp(cc->name, "highspeed") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_HIGHSPEED); + else { + /* + * Use newreno in case the algorithm selected by the + * host stack is not supported by the hardware. + */ + opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); + } } - if (sc->tt.rx_coalesce) + + if (s->rx_coalesce > 0 || (s->rx_coalesce < 0 && sc->tt.rx_coalesce)) opt2 |= V_RX_COALESCE(M_RX_COALESCE); - if (sc->tt.cong_algorithm != -1) - opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); + /* Note that ofld_rxq is already set according to s->rxq. */ + opt2 |= F_RSS_QUEUE_VALID; + opt2 |= V_RSS_QUEUE(toep->ofld_rxq->iq.abs_id); #ifdef USE_DDP_RX_FLOW_CONTROL if (toep->ulp_mode == ULP_MODE_TCPDDP) - opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; + opt2 |= F_RX_FC_DDP; #endif + if (toep->ulp_mode == ULP_MODE_TLS) { - opt2 |= F_RX_FC_VALID; opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); opt2 |= F_RX_FC_DISABLE; } @@ -348,10 +388,12 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct wrqe *wr = NULL; struct ifnet *rt_ifp = rt->rt_ifp; struct vi_info *vi; - int mtu_idx, rscale, qid_atid, rc, isipv6; + int mtu_idx, rscale, qid_atid, rc, isipv6, txqid, rxqid; struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); int reason; + struct offload_settings settings; + uint16_t vid = 0xffff; INP_WLOCK_ASSERT(inp); KASSERT(nam->sa_family == AF_INET || nam->sa_family == AF_INET6, @@ -363,12 +405,30 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct ifnet *ifp = VLAN_COOKIE(rt_ifp); vi = ifp->if_softc; + VLAN_TAG(ifp, &vid); } else if (rt_ifp->if_type == IFT_IEEE8023ADLAG) DONT_OFFLOAD_ACTIVE_OPEN(ENOSYS); /* XXX: implement lagg+TOE */ else DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); - toep = alloc_toepcb(vi, -1, -1, M_NOWAIT | M_ZERO); + rw_rlock(&sc->policy_lock); + settings = *lookup_offload_policy(sc, OPEN_TYPE_ACTIVE, NULL, vid, inp); + rw_runlock(&sc->policy_lock); + if (!settings.offload) + DONT_OFFLOAD_ACTIVE_OPEN(EPERM); + + if (settings.txq >= 0 && settings.txq < vi->nofldtxq) + txqid = settings.txq; + else + txqid = arc4random() % vi->nofldtxq; + txqid += vi->first_ofld_txq; + if (settings.rxq >= 0 && settings.rxq < vi->nofldrxq) + rxqid = settings.rxq; + else + rxqid = arc4random() % vi->nofldrxq; + rxqid += vi->first_ofld_rxq; + + toep = alloc_toepcb(vi, txqid, rxqid, M_NOWAIT | M_ZERO); if (toep == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); @@ -387,7 +447,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); toep->vnet = so->so_vnet; - set_ulp_mode(toep, select_ulp_mode(so, sc)); + set_ulp_mode(toep, select_ulp_mode(so, sc, &settings)); SOCKBUF_LOCK(&so->so_rcv); /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ toep->rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); @@ -402,7 +462,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru rscale = tp->request_r_scale = select_rcv_wscale(); else rscale = 0; - mtu_idx = find_best_mtu_idx(sc, &inp->inp_inc, 0); + mtu_idx = find_best_mtu_idx(sc, &inp->inp_inc, &settings); qid_atid = (toep->ofld_rxq->iq.abs_id << 14) | toep->tid; if (isipv6) { @@ -443,8 +503,8 @@ t4_connect(struct toedev *tod, struct socket *so, stru cpl->peer_ip_hi = *(uint64_t *)&inp->in6p_faddr.s6_addr[0]; cpl->peer_ip_lo = *(uint64_t *)&inp->in6p_faddr.s6_addr[8]; cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->rx_credits, toep->ulp_mode); - cpl->opt2 = calc_opt2a(so, toep); + toep->rx_credits, toep->ulp_mode, &settings); + cpl->opt2 = calc_opt2a(so, toep, &settings); } else { struct cpl_act_open_req *cpl = wrtod(wr); struct cpl_t5_act_open_req *cpl5 = (void *)cpl; @@ -472,8 +532,8 @@ t4_connect(struct toedev *tod, struct socket *so, stru inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, &cpl->peer_ip, &cpl->peer_port); cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->rx_credits, toep->ulp_mode); - cpl->opt2 = calc_opt2a(so, toep); + toep->rx_credits, toep->ulp_mode, &settings); + cpl->opt2 = calc_opt2a(so, toep, &settings); } CTR5(KTR_CXGBE, "%s: atid %u (%s), toep %p, inp %p", __func__, Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Apr 14 17:41:54 2018 (r332505) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Apr 14 19:07:56 2018 (r332506) @@ -121,6 +121,11 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par nparams++; if (toep->tls.fcplenmax != 0) nparams++; + if (toep->tc_idx != -1) { + MPASS(toep->tc_idx >= 0 && + toep->tc_idx < sc->chip_params->nsched_cls); + nparams++; + } flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); @@ -172,6 +177,8 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par FLOWC_PARAM(ULP_MODE, toep->ulp_mode); if (toep->tls.fcplenmax != 0) FLOWC_PARAM(TXDATAPLEN_MAX, toep->tls.fcplenmax); + if (toep->tc_idx != -1) + FLOWC_PARAM(SCHEDCLASS, toep->tc_idx); #undef FLOWC_PARAM KASSERT(paramidx == nparams, ("nparams mismatch")); @@ -333,18 +340,18 @@ assign_rxopt(struct tcpcb *tp, unsigned int opt) n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); else n = sizeof(struct ip) + sizeof(struct tcphdr); - if (V_tcp_do_rfc1323) - n += TCPOLEN_TSTAMP_APPA; tp->t_maxseg = sc->params.mtus[G_TCPOPT_MSS(opt)] - n; - CTR4(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u)", __func__, toep->tid, - G_TCPOPT_MSS(opt), sc->params.mtus[G_TCPOPT_MSS(opt)]); - if (G_TCPOPT_TSTAMP(opt)) { tp->t_flags |= TF_RCVD_TSTMP; /* timestamps ok */ tp->ts_recent = 0; /* hmmm */ tp->ts_recent_age = tcp_ts_getticks(); + tp->t_maxseg -= TCPOLEN_TSTAMP_APPA; } + + CTR5(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u), mss %u", __func__, + toep->tid, G_TCPOPT_MSS(opt), sc->params.mtus[G_TCPOPT_MSS(opt)], + tp->t_maxseg); if (G_TCPOPT_SACK(opt)) tp->t_flags |= TF_SACK_PERMIT; /* should already be set */ Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Sat Apr 14 17:41:54 2018 (r332505) +++ head/sys/dev/cxgbe/tom/t4_listen.c Sat Apr 14 19:07:56 2018 (r332506) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "common/common.h" #include "common/t4_msg.h" @@ -84,7 +86,8 @@ static struct listen_ctx *listen_hash_find(struct adap static struct listen_ctx *listen_hash_del(struct adapter *, struct inpcb *); static struct inpcb *release_lctx(struct adapter *, struct listen_ctx *); -static inline void save_qids_in_mbuf(struct mbuf *, struct vi_info *); +static inline void save_qids_in_mbuf(struct mbuf *, struct vi_info *, + struct offload_settings *); static inline void get_qids_from_mbuf(struct mbuf *m, int *, int *); static void send_reset_synqe(struct toedev *, struct synq_entry *); @@ -513,9 +516,17 @@ t4_listen_start(struct toedev *tod, struct tcpcb *tp) struct inpcb *inp = tp->t_inpcb; struct listen_ctx *lctx; int i, rc, v; + struct offload_settings settings; INP_WLOCK_ASSERT(inp); + rw_rlock(&sc->policy_lock); + settings = *lookup_offload_policy(sc, OPEN_TYPE_LISTEN, NULL, 0xffff, + inp); + rw_runlock(&sc->policy_lock); + if (!settings.offload) + return (0); + /* Don't start a hardware listener for any loopback address. */ if (inp->inp_vflag & INP_IPV6 && IN6_IS_ADDR_LOOPBACK(&inp->in6p_laddr)) return (0); @@ -948,13 +959,23 @@ t4_offload_socket(struct toedev *tod, void *arg, struc } static inline void -save_qids_in_mbuf(struct mbuf *m, struct vi_info *vi) +save_qids_in_mbuf(struct mbuf *m, struct vi_info *vi, + struct offload_settings *s) { uint32_t txqid, rxqid; - txqid = (arc4random() % vi->nofldtxq) + vi->first_ofld_txq; - rxqid = (arc4random() % vi->nofldrxq) + vi->first_ofld_rxq; + if (s->txq >= 0 && s->txq < vi->nofldtxq) + txqid = s->txq; + else + txqid = arc4random() % vi->nofldtxq; + txqid += vi->first_ofld_txq; + if (s->rxq >= 0 && s->rxq < vi->nofldrxq) + rxqid = s->rxq; + else + rxqid = arc4random() % vi->nofldrxq; + rxqid += vi->first_ofld_rxq; + m->m_pkthdr.flowid = (txqid << 16) | (rxqid & 0xffff); } @@ -1019,50 +1040,88 @@ t4opt_to_tcpopt(const struct tcp_options *t4opt, struc */ static uint32_t calc_opt2p(struct adapter *sc, struct port_info *pi, int rxqid, - const struct tcp_options *tcpopt, struct tcphdr *th, int ulp_mode) + const struct tcp_options *tcpopt, struct tcphdr *th, int ulp_mode, + struct cc_algo *cc, const struct offload_settings *s) { struct sge_ofld_rxq *ofld_rxq = &sc->sge.ofld_rxq[rxqid]; - uint32_t opt2; + uint32_t opt2 = 0; - opt2 = V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]) | - F_RSS_QUEUE_VALID | V_RSS_QUEUE(ofld_rxq->iq.abs_id); - - if (V_tcp_do_rfc1323) { - if (tcpopt->tstamp) - opt2 |= F_TSTAMPS_EN; - if (tcpopt->sack) - opt2 |= F_SACK_EN; - if (tcpopt->wsf <= 14) - opt2 |= F_WND_SCALE_EN; + /* + * rx flow control, rx coalesce, congestion control, and tx pace are all + * explicitly set by the driver. On T5+ the ISS is also set by the + * driver to the value picked by the kernel. + */ + if (is_t4(sc)) { + opt2 |= F_RX_FC_VALID | F_RX_COALESCE_VALID; + opt2 |= F_CONG_CNTRL_VALID | F_PACE_VALID; + } else { + opt2 |= F_T5_OPT_2_VALID; /* all 4 valid */ + opt2 |= F_T5_ISS; /* ISS provided in CPL */ } - if (V_tcp_do_ecn && th->th_flags & (TH_ECE | TH_CWR)) + if (tcpopt->sack && (s->sack > 0 || (s->sack < 0 && V_tcp_do_rfc1323))) + opt2 |= F_SACK_EN; + + if (tcpopt->tstamp && + (s->tstamp > 0 || (s->tstamp < 0 && V_tcp_do_rfc1323))) + opt2 |= F_TSTAMPS_EN; + + if (tcpopt->wsf < 15 && V_tcp_do_rfc1323) + opt2 |= F_WND_SCALE_EN; + + if (th->th_flags & (TH_ECE | TH_CWR) && + (s->ecn > 0 || (s->ecn < 0 && V_tcp_do_ecn))) opt2 |= F_CCTRL_ECN; - /* RX_COALESCE is always a valid value (0 or M_RX_COALESCE). */ - if (is_t4(sc)) - opt2 |= F_RX_COALESCE_VALID; + /* XXX: F_RX_CHANNEL for multiple rx c-chan support goes here. */ + + opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); + + /* These defaults are subject to ULP specific fixups later. */ + opt2 |= V_RX_FC_DDP(0) | V_RX_FC_DISABLE(0); + + opt2 |= V_PACE(0); + + if (s->cong_algo >= 0) + opt2 |= V_CONG_CNTRL(s->cong_algo); + else if (sc->tt.cong_algorithm >= 0) + opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); else { - opt2 |= F_T5_OPT_2_VALID; - opt2 |= F_T5_ISS; + if (strcasecmp(cc->name, "reno") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_RENO); + else if (strcasecmp(cc->name, "tahoe") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); + if (strcasecmp(cc->name, "newreno") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); + if (strcasecmp(cc->name, "highspeed") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_HIGHSPEED); + else { + /* + * Use newreno in case the algorithm selected by the + * host stack is not supported by the hardware. + */ + opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); + } } - if (sc->tt.rx_coalesce) + + if (s->rx_coalesce > 0 || (s->rx_coalesce < 0 && sc->tt.rx_coalesce)) opt2 |= V_RX_COALESCE(M_RX_COALESCE); - if (sc->tt.cong_algorithm != -1) - opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); + /* Note that ofld_rxq is already set according to s->rxq. */ + opt2 |= F_RSS_QUEUE_VALID; + opt2 |= V_RSS_QUEUE(ofld_rxq->iq.abs_id); #ifdef USE_DDP_RX_FLOW_CONTROL if (ulp_mode == ULP_MODE_TCPDDP) - opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; + opt2 |= F_RX_FC_DDP; #endif + if (ulp_mode == ULP_MODE_TLS) { - opt2 |= F_RX_FC_VALID; opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); opt2 |= F_RX_FC_DISABLE; } - return htobe32(opt2); + return (htobe32(opt2)); } static void @@ -1199,6 +1258,7 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif + struct offload_settings settings; KASSERT(opcode == CPL_PASS_ACCEPT_REQ, ("%s: unexpected opcode 0x%x", __func__, opcode)); @@ -1334,15 +1394,23 @@ found: REJECT_PASS_ACCEPT(); } so = inp->inp_socket; + rw_rlock(&sc->policy_lock); + settings = *lookup_offload_policy(sc, OPEN_TYPE_PASSIVE, m, 0xffff, inp); + rw_runlock(&sc->policy_lock); + if (!settings.offload) { + INP_WUNLOCK(inp); + free(wr, M_CXGBE); + REJECT_PASS_ACCEPT(); + } - mtu_idx = find_best_mtu_idx(sc, &inc, be16toh(cpl->tcpopt.mss)); + mtu_idx = find_best_mtu_idx(sc, &inc, &settings); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ wnd = max(so->sol_sbrcv_hiwat, MIN_RCV_WND); wnd = min(wnd, MAX_RCV_WND); rx_credits = min(wnd >> 10, M_RCV_BUFSIZ); - save_qids_in_mbuf(m, vi); + save_qids_in_mbuf(m, vi, &settings); get_qids_from_mbuf(m, NULL, &rxqid); if (is_t4(sc)) @@ -1352,7 +1420,7 @@ found: INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); } - ulp_mode = select_ulp_mode(so, sc); + ulp_mode = select_ulp_mode(so, sc, &settings); switch (ulp_mode) { case ULP_MODE_TCPDDP: synqe->flags |= TPF_SYNQE_TCPDDP; @@ -1361,8 +1429,10 @@ found: synqe->flags |= TPF_SYNQE_TLS; break; } - rpl->opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, ulp_mode); - rpl->opt2 = calc_opt2p(sc, pi, rxqid, &cpl->tcpopt, &th, ulp_mode); + rpl->opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, ulp_mode, + &settings); + rpl->opt2 = calc_opt2p(sc, pi, rxqid, &cpl->tcpopt, &th, ulp_mode, + CC_ALGO(intotcpcb(inp)), &settings); synqe->tid = tid; synqe->lctx = lctx; Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Sat Apr 14 17:41:54 2018 (r332505) +++ head/sys/dev/cxgbe/tom/t4_tom.c Sat Apr 14 19:07:56 2018 (r332506) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -137,15 +139,11 @@ alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, txsd_total = tx_credits / howmany(sizeof(struct fw_ofld_tx_data_wr) + 1, 16); - if (txqid < 0) - txqid = (arc4random() % vi->nofldtxq) + vi->first_ofld_txq; KASSERT(txqid >= vi->first_ofld_txq && txqid < vi->first_ofld_txq + vi->nofldtxq, ("%s: txqid %d for vi %p (first %d, n %d)", __func__, txqid, vi, vi->first_ofld_txq, vi->nofldtxq)); - if (rxqid < 0) - rxqid = (arc4random() % vi->nofldrxq) + vi->first_ofld_rxq; KASSERT(rxqid >= vi->first_ofld_rxq && rxqid < vi->first_ofld_rxq + vi->nofldrxq, ("%s: rxqid %d for vi %p (first %d, n %d)", __func__, rxqid, vi, @@ -569,27 +567,28 @@ queue_tid_release(struct adapter *sc, int tid) } /* - * What mtu_idx to use, given a 4-tuple and/or an MSS cap + * What mtu_idx to use, given a 4-tuple. Note that both s->mss and tcp_mssopt + * have the MSS that we should advertise in our SYN. Advertised MSS doesn't + * account for any TCP options so the effective MSS (only payload, no headers or + * options) could be different. We fill up tp->t_maxseg with the effective MSS + * at the end of the 3-way handshake. */ int -find_best_mtu_idx(struct adapter *sc, struct in_conninfo *inc, int pmss) +find_best_mtu_idx(struct adapter *sc, struct in_conninfo *inc, + struct offload_settings *s) { unsigned short *mtus = &sc->params.mtus[0]; - int i, mss, n; + int i, mss, mtu; - KASSERT(inc != NULL || pmss > 0, - ("%s: at least one of inc/pmss must be specified", __func__)); + MPASS(inc != NULL); - mss = inc ? tcp_mssopt(inc) : pmss; - if (pmss > 0 && mss > pmss) - mss = pmss; - + mss = s->mss > 0 ? s->mss : tcp_mssopt(inc); if (inc->inc_flags & INC_ISIPV6) - n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + mtu = mss + sizeof(struct ip6_hdr) + sizeof(struct tcphdr); else - n = sizeof(struct ip) + sizeof(struct tcphdr); + mtu = mss + sizeof(struct ip) + sizeof(struct tcphdr); - for (i = 0; i < NMTUS - 1 && mtus[i + 1] <= mss + n; i++) + for (i = 0; i < NMTUS - 1 && mtus[i + 1] <= mtu; i++) continue; return (i); @@ -632,34 +631,33 @@ select_rcv_wscale(void) */ uint64_t calc_opt0(struct socket *so, struct vi_info *vi, struct l2t_entry *e, - int mtu_idx, int rscale, int rx_credits, int ulp_mode) + int mtu_idx, int rscale, int rx_credits, int ulp_mode, + struct offload_settings *s) { + int keepalive; uint64_t opt0; + MPASS(so != NULL); + MPASS(vi != NULL); KASSERT(rx_credits <= M_RCV_BUFSIZ, ("%s: rcv_bufsiz too high", __func__)); opt0 = F_TCAM_BYPASS | V_WND_SCALE(rscale) | V_MSS_IDX(mtu_idx) | - V_ULP_MODE(ulp_mode) | V_RCV_BUFSIZ(rx_credits); + V_ULP_MODE(ulp_mode) | V_RCV_BUFSIZ(rx_credits) | + V_L2T_IDX(e->idx) | V_SMAC_SEL(vi->smt_idx) | + V_TX_CHAN(vi->pi->tx_chan); - if (so != NULL) { + keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; + opt0 |= V_KEEP_ALIVE(keepalive != 0); + + if (s->nagle < 0) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = tcp_always_keepalive || - so_options_get(so) & SO_KEEPALIVE; opt0 |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); - opt0 |= V_KEEP_ALIVE(keepalive != 0); - } + } else + opt0 |= V_NAGLE(s->nagle != 0); - if (e != NULL) - opt0 |= V_L2T_IDX(e->idx); - - if (vi != NULL) { - opt0 |= V_SMAC_SEL(vi->smt_idx); - opt0 |= V_TX_CHAN(vi->pi->tx_chan); - } - return htobe64(opt0); } @@ -720,12 +718,15 @@ is_tls_sock(struct socket *so, struct adapter *sc) } int -select_ulp_mode(struct socket *so, struct adapter *sc) +select_ulp_mode(struct socket *so, struct adapter *sc, + struct offload_settings *s) { - if (can_tls_offload(sc) && is_tls_sock(so, sc)) + if (can_tls_offload(sc) && + (s->tls > 0 || (s->tls < 0 && is_tls_sock(so, sc)))) return (ULP_MODE_TLS); - else if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) + else if (s->ddp > 0 || + (s->ddp < 0 && sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0)) return (ULP_MODE_TCPDDP); else return (ULP_MODE_NONE); @@ -1091,6 +1092,181 @@ free_tom_data(struct adapter *sc, struct tom_data *td) free_tid_tabs(&sc->tids); free(td, M_CXGBE); +} + +static char * +prepare_pkt(int open_type, uint16_t vtag, struct inpcb *inp, int *pktlen, + int *buflen) +{ + char *pkt; + struct tcphdr *th; + int ipv6, len; + const int maxlen = + max(sizeof(struct ether_header), sizeof(struct ether_vlan_header)) + + max(sizeof(struct ip), sizeof(struct ip6_hdr)) + + sizeof(struct tcphdr); + + MPASS(open_type == OPEN_TYPE_ACTIVE || open_type == OPEN_TYPE_LISTEN); + + pkt = malloc(maxlen, M_CXGBE, M_ZERO | M_NOWAIT); + if (pkt == NULL) + return (NULL); + + ipv6 = inp->inp_vflag & INP_IPV6; + len = 0; + + if (vtag == 0xffff) { + struct ether_header *eh = (void *)pkt; + + if (ipv6) + eh->ether_type = htons(ETHERTYPE_IPV6); + else + eh->ether_type = htons(ETHERTYPE_IP); + + len += sizeof(*eh); + } else { + struct ether_vlan_header *evh = (void *)pkt; + + evh->evl_encap_proto = htons(ETHERTYPE_VLAN); + evh->evl_tag = htons(vtag); + if (ipv6) + evh->evl_proto = htons(ETHERTYPE_IPV6); + else + evh->evl_proto = htons(ETHERTYPE_IP); + + len += sizeof(*evh); + } + + if (ipv6) { + struct ip6_hdr *ip6 = (void *)&pkt[len]; + + ip6->ip6_vfc = IPV6_VERSION; + ip6->ip6_plen = htons(sizeof(struct tcphdr)); + ip6->ip6_nxt = IPPROTO_TCP; + if (open_type == OPEN_TYPE_ACTIVE) { + ip6->ip6_src = inp->in6p_laddr; + ip6->ip6_dst = inp->in6p_faddr; + } else if (open_type == OPEN_TYPE_LISTEN) { + ip6->ip6_src = inp->in6p_laddr; + ip6->ip6_dst = ip6->ip6_src; + } + + len += sizeof(*ip6); + } else { + struct ip *ip = (void *)&pkt[len]; + + ip->ip_v = IPVERSION; + ip->ip_hl = sizeof(*ip) >> 2; + ip->ip_tos = inp->inp_ip_tos; + ip->ip_len = htons(sizeof(struct ip) + sizeof(struct tcphdr)); + ip->ip_ttl = inp->inp_ip_ttl; + ip->ip_p = IPPROTO_TCP; + if (open_type == OPEN_TYPE_ACTIVE) { + ip->ip_src = inp->inp_laddr; + ip->ip_dst = inp->inp_faddr; + } else if (open_type == OPEN_TYPE_LISTEN) { + ip->ip_src = inp->inp_laddr; + ip->ip_dst = ip->ip_src; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Apr 14 20:49:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E541FF98DF5; Sat, 14 Apr 2018 20:49:38 +0000 (UTC) (envelope-from gonzo@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 9676173097; Sat, 14 Apr 2018 20:49:38 +0000 (UTC) (envelope-from gonzo@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 8D9A02D264; Sat, 14 Apr 2018 20:49:38 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3EKncP2084425; Sat, 14 Apr 2018 20:49:38 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3EKncPY084424; Sat, 14 Apr 2018 20:49:38 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201804142049.w3EKncPY084424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 14 Apr 2018 20:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332507 - stable/11/sys/modules X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/modules X-SVN-Commit-Revision: 332507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 20:49:39 -0000 Author: gonzo Date: Sat Apr 14 20:49:38 2018 New Revision: 332507 URL: https://svnweb.freebsd.org/changeset/base/332507 Log: Fix mis-merge of r329507 in r331501 sus/modules/Makefile part of r329507 just removed ffec while r331501 also added conditional clause for bcm283x_clkman and bcm283x_pwm. Since they're part of another revision, remove mi-merged chunk Modified: stable/11/sys/modules/Makefile Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Sat Apr 14 19:07:56 2018 (r332506) +++ stable/11/sys/modules/Makefile Sat Apr 14 20:49:38 2018 (r332507) @@ -826,11 +826,6 @@ _cloudabi64= cloudabi64 .endif -.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64" -_bcm283x_clkman= bcm283x_clkman -_bcm283x_pwm= bcm283x_pwm -.endif - SUBDIR+=${MODULES_EXTRA} .for reject in ${WITHOUT_MODULES} From owner-svn-src-all@freebsd.org Sat Apr 14 21:54:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71DF5F9D2ED; Sat, 14 Apr 2018 21:54:23 +0000 (UTC) (envelope-from eadler@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 273B07F76C; Sat, 14 Apr 2018 21:54:23 +0000 (UTC) (envelope-from eadler@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 1DC922DD76; Sat, 14 Apr 2018 21:54:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ELsMGw018629; Sat, 14 Apr 2018 21:54:22 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ELsM4a018627; Sat, 14 Apr 2018 21:54:22 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201804142154.w3ELsM4a018627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 14 Apr 2018 21:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332508 - in head/contrib/amd: . amd X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head/contrib/amd: . amd X-SVN-Commit-Revision: 332508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 21:54:23 -0000 Author: eadler Date: Sat Apr 14 21:54:22 2018 New Revision: 332508 URL: https://svnweb.freebsd.org/changeset/base/332508 Log: amd: correct formatting of 'SEE ALSO' Modified: head/contrib/amd/FREEBSD-upgrade head/contrib/amd/amd/amd.8 Modified: head/contrib/amd/FREEBSD-upgrade ============================================================================== --- head/contrib/amd/FREEBSD-upgrade Sat Apr 14 20:49:38 2018 (r332507) +++ head/contrib/amd/FREEBSD-upgrade Sat Apr 14 21:54:22 2018 (r332508) @@ -32,6 +32,7 @@ https://bugzilla.am-utils.org for inclusion in the nex Local changes: amd/amd.8 + - corrected formatting of SEE ALSO r1.17 Uniformly refer to a file system as "file system" r1.16 Add the am-utils homepage to SEE ALSO r1.15 s/BSD/.Bx/ where appropriate Modified: head/contrib/amd/amd/amd.8 ============================================================================== --- head/contrib/amd/amd/amd.8 Sat Apr 14 20:49:38 2018 (r332507) +++ head/contrib/amd/amd/amd.8 Sat Apr 14 21:54:22 2018 (r332508) @@ -362,15 +362,15 @@ number of process context switches. A weird imagination is most useful to gain full advantage of all the features. .Sh SEE ALSO -.Xr domainname 1, -.Xr hostname 1, -.Xr syslog 3. -.Xr amd.conf 5, -.Xr mtab 5, -.Xr amq 8, -.Xr automount 8, -.Xr mount 8, -.Xr umount 8, +.Xr domainname 1 , +.Xr hostname 1 , +.Xr syslog 3 , +.Xr amd.conf 5 , +.Xr mtab 5 , +.Xr amq 8 , +.Xr automount 8 , +.Xr mount 8 , +.Xr umount 8 .Pp .Dq am-utils .Xr info 1 From owner-svn-src-all@freebsd.org Sat Apr 14 22:14:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37F12F9E7FA; Sat, 14 Apr 2018 22:14:19 +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 E0C79827BE; Sat, 14 Apr 2018 22:14:18 +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 D53972E0A0; Sat, 14 Apr 2018 22:14:18 +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 w3EMEIN8028632; Sat, 14 Apr 2018 22:14:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3EMEIRu028631; Sat, 14 Apr 2018 22:14:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804142214.w3EMEIRu028631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 14 Apr 2018 22:14:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332509 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 332509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 22:14:19 -0000 Author: imp Date: Sat Apr 14 22:14:18 2018 New Revision: 332509 URL: https://svnweb.freebsd.org/changeset/base/332509 Log: Make first a 'bool' instead of a 'boolean_t'. 'bool' is preferred to 'boolean_t'. We only get the boolean_t definition by header pollution (though the same is true for bool). Since we use both, switch entirely to bool. Note: We still have TRUE/FALSE instead of true/false in heavy use in the rest of the file. These are with ints of various flavors, so that's appropriate, even though we should eventually migrate to bool and true/false (though the tables they are in are nicely packed with short and wouldn't be so nicely packed with bool, another reason to leave it alone for now). Modified: head/sys/i386/i386/db_disasm.c Modified: head/sys/i386/i386/db_disasm.c ============================================================================== --- head/sys/i386/i386/db_disasm.c Sat Apr 14 21:54:22 2018 (r332508) +++ head/sys/i386/i386/db_disasm.c Sat Apr 14 22:14:18 2018 (r332509) @@ -1166,7 +1166,7 @@ db_disasm(db_addr_t loc, bool altfmt) int i_size; int i_mode; int regmodrm = 0; - boolean_t first; + bool first; int displ; int prefix; int rep; @@ -1338,9 +1338,9 @@ db_disasm(db_addr_t loc, bool altfmt) } } db_printf("\t"); - for (first = TRUE; + for (first = true; i_mode != 0; - i_mode >>= 8, first = FALSE) + i_mode >>= 8, first = false) { if (!first) db_printf(",");