From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 00:30:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EC8DF72; Sun, 8 Mar 2015 00:30:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 ED80FAC4; Sun, 8 Mar 2015 00:30:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t280UrXs063887; Sun, 8 Mar 2015 00:30:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t280UrIe063885; Sun, 8 Mar 2015 00:30:53 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503080030.t280UrIe063885@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 8 Mar 2015 00:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279760 - head/lib/libnv/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 00:30:54 -0000 Author: dim Date: Sun Mar 8 00:30:52 2015 New Revision: 279760 URL: https://svnweb.freebsd.org/changeset/base/279760 Log: Fix lib/libnv tests compilation with -std=c++11, by adding appropriate casts for NULL to invocations of the ATF_REQUIER_EQ() macro. Reviewed by: rstone, jmmv Differential Revision: https://reviews.freebsd.org/D2027 Modified: head/lib/libnv/tests/dnv_tests.cc head/lib/libnv/tests/nv_tests.cc Modified: head/lib/libnv/tests/dnv_tests.cc ============================================================================== --- head/lib/libnv/tests/dnv_tests.cc Sat Mar 7 23:01:27 2015 (r279759) +++ head/lib/libnv/tests/dnv_tests.cc Sun Mar 8 00:30:52 2015 (r279760) @@ -450,7 +450,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_nvlist__ nvl = nvlist_create(0); actual_val = dnvlist_take_nvlist(nvl, "123", NULL); - ATF_REQUIRE_EQ(actual_val, NULL); + ATF_REQUIRE_EQ(actual_val, static_cast(NULL)); free(actual_val); nvlist_destroy(nvl); Modified: head/lib/libnv/tests/nv_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_tests.cc Sat Mar 7 23:01:27 2015 (r279759) +++ head/lib/libnv/tests/nv_tests.cc Sun Mar 8 00:30:52 2015 (r279760) @@ -54,7 +54,7 @@ ATF_TEST_CASE_BODY(nvlist_create__is_emp ATF_REQUIRE(nvlist_empty(nvl)); it = NULL; - ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), static_cast(NULL)); nvlist_destroy(nvl); } @@ -85,7 +85,7 @@ ATF_TEST_CASE_BODY(nvlist_add_null__sing it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_NULL); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(nvl); } @@ -118,7 +118,7 @@ ATF_TEST_CASE_BODY(nvlist_add_bool__sing it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_BOOL); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(nvl); } @@ -153,7 +153,7 @@ ATF_TEST_CASE_BODY(nvlist_add_number__si it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(nvl); } @@ -191,7 +191,7 @@ ATF_TEST_CASE_BODY(nvlist_add_string__si it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_STRING); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(nvl); } @@ -237,7 +237,7 @@ ATF_TEST_CASE_BODY(nvlist_add_nvlist__si it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(sublist); nvlist_destroy(nvl); @@ -303,7 +303,7 @@ ATF_TEST_CASE_BODY(nvlist_add_binary__si it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_BINARY); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type,&it), static_cast(NULL)); nvlist_destroy(nvl); free(value); @@ -352,7 +352,7 @@ ATF_TEST_CASE_BODY(nvlist_clone__nonempt it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(clone, &type, &it), key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_NUMBER); - ATF_REQUIRE_EQ(nvlist_next(clone, &type, &it), NULL); + ATF_REQUIRE_EQ(nvlist_next(clone, &type, &it), static_cast(NULL)); nvlist_destroy(clone); nvlist_destroy(nvl); @@ -400,13 +400,13 @@ verify_test_nvlist(const nvlist_t *nvl) ATF_REQUIRE_EQ(strcmp(nvlist_next(value, &type, &it), test_string_key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_STRING); - ATF_REQUIRE_EQ(nvlist_next(value, &type, &it), NULL); + ATF_REQUIRE_EQ(nvlist_next(value, &type, &it), static_cast(NULL)); it = NULL; ATF_REQUIRE_EQ(strcmp(nvlist_next(nvl, &type, &it), test_subnvlist_key), 0); ATF_REQUIRE_EQ(type, NV_TYPE_NVLIST); - ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), NULL); + ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), static_cast(NULL)); } ATF_TEST_CASE_WITHOUT_HEAD(nvlist_clone__nested_nvlist); From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 00:32:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC16C24B; Sun, 8 Mar 2015 00:32:22 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 7203EBBD; Sun, 8 Mar 2015 00:32:22 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t280WDFF044102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Mar 2015 02:32:13 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t280WDFF044102 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t280WDno044101; Sun, 8 Mar 2015 02:32:13 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 Mar 2015 02:32:13 +0200 From: Konstantin Belousov To: Adrian Chadd Subject: Re: svn commit: r279406 - in head/sys: amd64/amd64 i386/i386 Message-ID: <20150308003213.GB2379@kib.kiev.ua> References: <201502282037.t1SKbdTI072217@svn.freebsd.org> 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-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 00:32:23 -0000 On Sat, Mar 07, 2015 at 08:17:19AM -0800, Adrian Chadd wrote: > Ugh, sorry to bring this up again, but I just updated to -HEAD and it > started hanging again at the same spot. :( Sorry to ask banal questions, but there is no useful information in the message at all. Does disabling x2APIC allow machine to boot ? Show the verbose dmesg of the successfull boot from the version of kernel which you use now. Apply the debugging patch I provided to you, and show me either a screenshot or _exact_ copy of the last messages. From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 00:47:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2140C8E4; Sun, 8 Mar 2015 00:47:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 0A9A7CCD; Sun, 8 Mar 2015 00:47:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t280lrMT070721; Sun, 8 Mar 2015 00:47:53 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t280lonI070705; Sun, 8 Mar 2015 00:47:50 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503080047.t280lonI070705@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 8 Mar 2015 00:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279761 - in head: lib/libgpio sys/dev/gpio sys/sys usr.sbin/gpioctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 00:47:54 -0000 Author: loos Date: Sun Mar 8 00:47:50 2015 New Revision: 279761 URL: https://svnweb.freebsd.org/changeset/base/279761 Log: Add a new ioctl to allow the setting of GPIO pin names. When a gpiobus child is added, use its name to identify the mapped pin names. Make the respective changes to libgpio. Add a new '-n' flag to gpioctl(8) to set the pin name. Differential Revision: https://reviews.freebsd.org/D2002 Reviewed by: rpaulo Requested by: many Modified: head/lib/libgpio/gpio.3 head/lib/libgpio/gpio.c head/lib/libgpio/libgpio.h head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobus_if.m head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/gpioc.c head/sys/dev/gpio/ofw_gpiobus.c head/sys/sys/gpio.h head/usr.sbin/gpioctl/gpioctl.8 head/usr.sbin/gpioctl/gpioctl.c Modified: head/lib/libgpio/gpio.3 ============================================================================== --- head/lib/libgpio/gpio.3 Sun Mar 8 00:30:52 2015 (r279760) +++ head/lib/libgpio/gpio.3 Sun Mar 8 00:47:50 2015 (r279761) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2014 +.Dd March 7, 2015 .Dt GPIO 3 .Os .Sh NAME @@ -45,7 +45,9 @@ .Ft int .Fn gpio_pin_list "gpio_handle_t handle, gpio_config_t **pcfgs" .Ft int -.Fn gpio_pin_config "gpio_handle_t handle, gpio_config *cfg" +.Fn gpio_pin_config "gpio_handle_t handle, gpio_config_t *cfg" +.Ft int +.Fn gpio_pin_set_name "gpio_handle_t handle, gpio_pin_t pin, char *name" .Ft int .Fn gpio_pin_set_flags "gpio_handle_t handle, gpio_config_t *cfg" .Ft gpio_value_t @@ -111,6 +113,10 @@ variable which is part of the structure. .Pp The function +.Fn gpio_pin_set_name +sets the name used to describe a pin. +.Pp +The function .Fn gpio_pin_set_flags configures a pin with the flags passed in by the .Ft gpio_config_t Modified: head/lib/libgpio/gpio.c ============================================================================== --- head/lib/libgpio/gpio.c Sun Mar 8 00:30:52 2015 (r279760) +++ head/lib/libgpio/gpio.c Sun Mar 8 00:47:50 2015 (r279761) @@ -119,6 +119,22 @@ gpio_pin_config(gpio_handle_t handle, gp } int +gpio_pin_set_name(gpio_handle_t handle, gpio_pin_t pin, char *name) +{ + struct gpio_pin gppin; + + if (name == NULL) + return (-1); + bzero(&gppin, sizeof(gppin)); + gppin.gp_pin = pin; + strlcpy(gppin.gp_name, name, GPIOMAXNAME); + if (ioctl(handle, GPIOSETNAME, &gppin) < 0) + return (-1); + + return (0); +} + +int gpio_pin_set_flags(gpio_handle_t handle, gpio_config_t *cfg) { struct gpio_pin gppin; Modified: head/lib/libgpio/libgpio.h ============================================================================== --- head/lib/libgpio/libgpio.h Sun Mar 8 00:30:52 2015 (r279760) +++ head/lib/libgpio/libgpio.h Sun Mar 8 00:47:50 2015 (r279761) @@ -71,6 +71,11 @@ int gpio_pin_list(gpio_handle_t, gpio_c */ int gpio_pin_config(gpio_handle_t, gpio_config_t *); /* + * Sets the GPIO pin name. The pin number and pin name to be set are passed + * as parameters. + */ +int gpio_pin_set_name(gpio_handle_t, gpio_pin_t, char *); +/* * Sets the GPIO flags on a specific GPIO pin. The pin number and the flags * to be set are passed through the gpio_config_t structure. */ Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Sun Mar 8 00:30:52 2015 (r279760) +++ head/sys/dev/gpio/gpiobus.c Sun Mar 8 00:47:50 2015 (r279761) @@ -185,9 +185,9 @@ gpiobus_init_softc(device_t dev) /* Pins = GPIO_PIN_MAX() + 1 */ sc->sc_npins++; - sc->sc_pins_mapped = malloc(sizeof(int) * sc->sc_npins, M_DEVBUF, + sc->sc_pins = malloc(sizeof(*sc->sc_pins) * sc->sc_npins, M_DEVBUF, M_NOWAIT | M_ZERO); - if (sc->sc_pins_mapped == NULL) + if (sc->sc_pins == NULL) return (ENOMEM); /* Initialize the bus lock. */ @@ -242,11 +242,11 @@ gpiobus_map_pin(device_t bus, uint32_t p return (-1); } /* Mark pin as mapped and give warning if it's already mapped. */ - if (sc->sc_pins_mapped[pin]) { + if (sc->sc_pins[pin].mapped) { device_printf(bus, "warning: pin %d is already mapped\n", pin); return (-1); } - sc->sc_pins_mapped[pin] = 1; + sc->sc_pins[pin].mapped = 1; return (0); } @@ -281,6 +281,9 @@ gpiobus_parse_pins(struct gpiobus_softc return (EINVAL); } devi->pins[npins++] = i; + /* Use the child name as pin name. */ + GPIOBUS_PIN_SETNAME(sc->sc_busdev, i, + device_get_nameunit(child)); } return (0); @@ -340,10 +343,14 @@ gpiobus_detach(device_t dev) gpiobus_free_ivars(devi); } free(devlist, M_TEMP); - - if (sc->sc_pins_mapped) { - free(sc->sc_pins_mapped, M_DEVBUF); - sc->sc_pins_mapped = NULL; + if (sc->sc_pins) { + for (i = 0; i < sc->sc_npins; i++) { + if (sc->sc_pins[i].name != NULL) + free(sc->sc_pins[i].name, M_DEVBUF); + sc->sc_pins[i].name = NULL; + } + free(sc->sc_pins, M_DEVBUF); + sc->sc_pins = NULL; } return (0); @@ -664,6 +671,43 @@ gpiobus_pin_toggle(device_t dev, device_ return GPIO_PIN_TOGGLE(sc->sc_dev, devi->pins[pin]); } +static int +gpiobus_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct gpiobus_softc *sc; + + sc = GPIOBUS_SOFTC(dev); + if (pin > sc->sc_npins) + return (EINVAL); + /* Did we have a name for this pin ? */ + if (sc->sc_pins[pin].name != NULL) { + memcpy(name, sc->sc_pins[pin].name, GPIOMAXNAME); + return (0); + } + + /* Return the default pin name. */ + return (GPIO_PIN_GETNAME(device_get_parent(dev), pin, name)); +} + +static int +gpiobus_pin_setname(device_t dev, uint32_t pin, const char *name) +{ + struct gpiobus_softc *sc; + + sc = GPIOBUS_SOFTC(dev); + if (pin > sc->sc_npins) + return (EINVAL); + if (name == NULL) + return (EINVAL); + /* Save the pin name. */ + if (sc->sc_pins[pin].name == NULL) + sc->sc_pins[pin].name = malloc(GPIOMAXNAME, M_DEVBUF, + M_WAITOK | M_ZERO); + strlcpy(sc->sc_pins[pin].name, name, GPIOMAXNAME); + + return (0); +} + static device_method_t gpiobus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, gpiobus_probe), @@ -699,6 +743,8 @@ static device_method_t gpiobus_methods[] DEVMETHOD(gpiobus_pin_get, gpiobus_pin_get), DEVMETHOD(gpiobus_pin_set, gpiobus_pin_set), DEVMETHOD(gpiobus_pin_toggle, gpiobus_pin_toggle), + DEVMETHOD(gpiobus_pin_getname, gpiobus_pin_getname), + DEVMETHOD(gpiobus_pin_setname, gpiobus_pin_setname), DEVMETHOD_END }; Modified: head/sys/dev/gpio/gpiobus_if.m ============================================================================== --- head/sys/dev/gpio/gpiobus_if.m Sun Mar 8 00:30:52 2015 (r279760) +++ head/sys/dev/gpio/gpiobus_if.m Sun Mar 8 00:47:50 2015 (r279761) @@ -106,3 +106,21 @@ METHOD int pin_setflags { uint32_t pin_num; uint32_t flags; }; + +# +# Get the pin name +# +METHOD int pin_getname { + device_t dev; + uint32_t pin_num; + char *name; +}; + +# +# Set the pin name +# +METHOD int pin_setname { + device_t dev; + uint32_t pin_num; + const char *name; +}; Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Sun Mar 8 00:30:52 2015 (r279760) +++ head/sys/dev/gpio/gpiobusvar.h Sun Mar 8 00:47:50 2015 (r279761) @@ -60,6 +60,12 @@ #define GPIOBUS_WAIT 1 #define GPIOBUS_DONTWAIT 2 +struct gpiobus_pin_data +{ + int mapped; /* pin is mapped/reserved. */ + char *name; /* pin name. */ +}; + struct gpiobus_softc { struct mtx sc_mtx; /* bus mutex */ @@ -68,7 +74,7 @@ struct gpiobus_softc device_t sc_owner; /* bus owner */ device_t sc_dev; /* driver device */ int sc_npins; /* total pins on bus */ - int *sc_pins_mapped; /* mark mapped pins */ + struct gpiobus_pin_data *sc_pins; /* pin data */ }; struct gpiobus_pin Modified: head/sys/dev/gpio/gpioc.c ============================================================================== --- head/sys/dev/gpio/gpioc.c Sun Mar 8 00:30:52 2015 (r279760) +++ head/sys/dev/gpio/gpioc.c Sun Mar 8 00:47:50 2015 (r279761) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include "gpio_if.h" +#include "gpiobus_if.h" #undef GPIOC_DEBUG #ifdef GPIOC_DEBUG @@ -112,12 +113,16 @@ static int gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, struct thread *td) { + device_t bus; int max_pin, res; struct gpioc_softc *sc = cdev->si_drv1; struct gpio_pin pin; struct gpio_req req; uint32_t caps; + bus = GPIO_GET_BUS(sc->sc_pdev); + if (bus == NULL) + return (EINVAL); switch (cmd) { case GPIOMAXPIN: max_pin = -1; @@ -133,7 +138,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cm if (res) break; GPIO_PIN_GETCAPS(sc->sc_pdev, pin.gp_pin, &pin.gp_caps); - GPIO_PIN_GETNAME(sc->sc_pdev, pin.gp_pin, pin.gp_name); + GPIOBUS_PIN_GETNAME(bus, pin.gp_pin, pin.gp_name); bcopy(&pin, arg, sizeof(pin)); break; case GPIOSETCONFIG: @@ -167,6 +172,12 @@ gpioc_ioctl(struct cdev *cdev, u_long cm req.gp_pin); res = GPIO_PIN_TOGGLE(sc->sc_pdev, req.gp_pin); break; + case GPIOSETNAME: + bcopy(arg, &pin, sizeof(pin)); + dprintf("set name on pin %d\n", pin.gp_pin); + res = GPIOBUS_PIN_SETNAME(bus, pin.gp_pin, + pin.gp_name); + break; default: return (ENOTTY); break; Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Sun Mar 8 00:30:52 2015 (r279760) +++ head/sys/dev/gpio/ofw_gpiobus.c Sun Mar 8 00:47:50 2015 (r279761) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "gpiobus_if.h" + static struct ofw_gpiobus_devinfo *ofw_gpiobus_setup_devinfo(device_t, device_t, phandle_t); static void ofw_gpiobus_destroy_devinfo(device_t, struct ofw_gpiobus_devinfo *); @@ -49,6 +51,8 @@ device_t ofw_gpiobus_add_fdt_child(device_t bus, const char *drvname, phandle_t child) { device_t childdev; + int i; + struct gpiobus_ivar *devi; struct ofw_gpiobus_devinfo *dinfo; /* @@ -67,6 +71,11 @@ ofw_gpiobus_add_fdt_child(device_t bus, device_delete_child(bus, childdev); return (NULL); } + /* Use the child name as pin name. */ + devi = &dinfo->opd_dinfo; + for (i = 0; i < devi->npins; i++) + GPIOBUS_PIN_SETNAME(bus, devi->pins[i], + device_get_nameunit(childdev)); return (childdev); } @@ -159,7 +168,7 @@ ofw_gpiobus_destroy_devinfo(device_t bus for (i = 0; i < devi->npins; i++) { if (devi->pins[i] > sc->sc_npins) continue; - sc->sc_pins_mapped[devi->pins[i]] = 0; + sc->sc_pins[devi->pins[i]].mapped = 0; } gpiobus_free_ivars(devi); resource_list_free(&dinfo->opd_dinfo.rl); Modified: head/sys/sys/gpio.h ============================================================================== --- head/sys/sys/gpio.h Sun Mar 8 00:30:52 2015 (r279760) +++ head/sys/sys/gpio.h Sun Mar 8 00:47:50 2015 (r279761) @@ -93,5 +93,6 @@ struct gpio_req { #define GPIOGET _IOWR('G', 3, struct gpio_req) #define GPIOSET _IOW('G', 4, struct gpio_req) #define GPIOTOGGLE _IOWR('G', 5, struct gpio_req) +#define GPIOSETNAME _IOW('G', 6, struct gpio_pin) #endif /* __GPIO_H__ */ Modified: head/usr.sbin/gpioctl/gpioctl.8 ============================================================================== --- head/usr.sbin/gpioctl/gpioctl.8 Sun Mar 8 00:30:52 2015 (r279760) +++ head/usr.sbin/gpioctl/gpioctl.8 Sun Mar 8 00:47:50 2015 (r279761) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2013 +.Dd March 7, 2015 .Dt GPIOCTL 1 .Os .Sh NAME @@ -35,20 +35,25 @@ .Nd GPIO control utility .Sh SYNOPSIS .Nm -.Cm -l .Op Fl f Ar ctldev +.Cm -l .Op Fl v .Nm -.Cm -t .Op Fl f Ar ctldev +.Cm -t .Ar pin .Nm -.Cm -c .Op Fl f Ar ctldev +.Cm -c .Ar pin .Ar flag .Op flag ... .Nm +.Op Fl f Ar ctldev +.Cm -n +.Ar pin +.Ar pin-name +.Nm .Op Cm -f Ar ctldev .Ar pin .Ar [0|1] @@ -87,6 +92,8 @@ If not specified, defaults to .Pa /dev/gpioc0 .It Fl l list available pins +.It Fl n Ar pin Ar pin-name +set the name used to describe the pin .It Fl t Ar pin toggle value of provided pin number .It Fl v Modified: head/usr.sbin/gpioctl/gpioctl.c ============================================================================== --- head/usr.sbin/gpioctl/gpioctl.c Sun Mar 8 00:30:52 2015 (r279760) +++ head/usr.sbin/gpioctl/gpioctl.c Sun Mar 8 00:47:50 2015 (r279761) @@ -68,6 +68,7 @@ usage(void) fprintf(stderr, "\tgpioctl [-f ctldev] -l [-v]\n"); fprintf(stderr, "\tgpioctl [-f ctldev] -t pin\n"); fprintf(stderr, "\tgpioctl [-f ctldev] -c pin flag ...\n"); + fprintf(stderr, "\tgpioctl [-f ctldev] -n pin pin-name\n"); fprintf(stderr, "\tgpioctl [-f ctldev] pin [0|1]\n"); exit(1); } @@ -182,11 +183,11 @@ main(int argc, char **argv) char *ctlfile = NULL; int pinn, pinv, ch; int flags, flag, ok; - int config, toggle, verbose, list; + int config, list, name, toggle, verbose; - config = toggle = verbose = list = pinn = 0; + config = toggle = verbose = list = name = pinn = 0; - while ((ch = getopt(argc, argv, "c:f:lt:v")) != -1) { + while ((ch = getopt(argc, argv, "c:f:ln:t:v")) != -1) { switch (ch) { case 'c': config = 1; @@ -200,6 +201,12 @@ main(int argc, char **argv) case 'l': list = 1; break; + case 'n': + name = 1; + pinn = str2int(optarg, &ok); + if (!ok) + fail("Invalid pin number: %s\n", optarg); + break; case 't': toggle = 1; pinn = str2int(optarg, &ok); @@ -225,6 +232,19 @@ main(int argc, char **argv) exit(1); } + /* Set the pin name. */ + if (name) { + if (argc == 0) { + usage(); + exit(1); + } + if (gpio_pin_set_name(handle, pinn, argv[0]) < 0) { + perror("gpio_pin_set_name"); + exit(1); + } + exit(0); + } + if (list) { dump_pins(handle, verbose); gpio_close(handle); From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 01:12:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 668A4B6E; Sun, 8 Mar 2015 01:12:30 +0000 (UTC) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::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 2811FF1D; Sun, 8 Mar 2015 01:12:30 +0000 (UTC) Received: by igdh15 with SMTP id h15so12841235igd.3; Sat, 07 Mar 2015 17:12:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=2b+hYJdX+VcsrDdJTxK26ONDsjXtZ8BxWCLczJMmtM8=; b=ChUvtvH03c65a+IajzyHTKo+0jEABSfJWPA2ZFrATc8wNoWWDR3f5y5wx9/jt7TIp3 6X50Oq5r1nKitg9z+AwXb+qxSXGEBbETrx5ZxRvXVfbwNZkyR8VVAcGxzvopFJ1deJGW 5ZBSBNJU2mj0cI2UVeLZZ8i0KCYmG+Kqnaoycz/F0N9nHFDxm0iBO0gSYfnxVB9CUefb WUGUJ7HaSTKOmp3lxjAodWYwgZDexS84PIWeq6EKQ5WY1f8X3GAGSeZ9VJ1x3rQHkfn5 RDSG7/XqPXpE+ltr6VkXO8WTqcceaQvglbDtrNvuX/KBFQs44QW+vU+I7KLbjjYYSceU VcMg== MIME-Version: 1.0 X-Received: by 10.107.155.13 with SMTP id d13mr37187375ioe.29.1425777149549; Sat, 07 Mar 2015 17:12:29 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.66 with HTTP; Sat, 7 Mar 2015 17:12:29 -0800 (PST) In-Reply-To: <20150308003213.GB2379@kib.kiev.ua> References: <201502282037.t1SKbdTI072217@svn.freebsd.org> <20150308003213.GB2379@kib.kiev.ua> Date: Sat, 7 Mar 2015 17:12:29 -0800 X-Google-Sender-Auth: vOAeMTfQP40fhmW3D9DVVFcBBuE Message-ID: Subject: Re: svn commit: r279406 - in head/sys: amd64/amd64 i386/i386 From: Adrian Chadd To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 01:12:30 -0000 On 7 March 2015 at 16:32, Konstantin Belousov wrote: > On Sat, Mar 07, 2015 at 08:17:19AM -0800, Adrian Chadd wrote: >> Ugh, sorry to bring this up again, but I just updated to -HEAD and it >> started hanging again at the same spot. :( > Sorry to ask banal questions, but there is no useful information in the > message at all. Does disabling x2APIC allow machine to boot ? Yup, same as before. > Show the verbose dmesg of the successfull boot from the version of kernel > which you use now. Apply the debugging patch I provided to you, and > show me either a screenshot or _exact_ copy of the last messages. Ok, I'll do that later. Thanks! -a From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 01:44:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A715E157; Sun, 8 Mar 2015 01:44:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 7923A24F; Sun, 8 Mar 2015 01:44:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t281iwF5098403; Sun, 8 Mar 2015 01:44:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t281iwMv098402; Sun, 8 Mar 2015 01:44:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503080144.t281iwMv098402@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Mar 2015 01:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279762 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 01:44:58 -0000 Author: adrian Date: Sun Mar 8 01:44:57 2015 New Revision: 279762 URL: https://svnweb.freebsd.org/changeset/base/279762 Log: Use the correct mac addresses when initialising things. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun Mar 8 00:47:50 2015 (r279761) +++ head/sys/dev/wpi/if_wpi.c Sun Mar 8 01:44:57 2015 (r279762) @@ -2926,7 +2926,7 @@ wpi_add_node(struct wpi_softc *sc, struc return EINVAL; memset(&node, 0, sizeof node); - IEEE80211_ADDR_COPY(node.macaddr, ni->ni_bssid); + IEEE80211_ADDR_COPY(node.macaddr, ni->ni_macaddr); node.id = wn->id; node.plcp = (ic->ic_curmode == IEEE80211_MODE_11A) ? wpi_ridx_to_plcp[WPI_RIDX_OFDM6] : wpi_ridx_to_plcp[WPI_RIDX_CCK1]; @@ -2993,7 +2993,7 @@ wpi_del_node(struct wpi_softc *sc, struc } memset(&node, 0, sizeof node); - IEEE80211_ADDR_COPY(node.macaddr, ni->ni_bssid); + IEEE80211_ADDR_COPY(node.macaddr, ni->ni_macaddr); node.count = 1; error = wpi_cmd(sc, WPI_CMD_DEL_NODE, &node, sizeof node, 1); @@ -3404,6 +3404,7 @@ wpi_config(struct wpi_softc *sc) { struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); uint32_t flags; int error; @@ -3425,7 +3426,7 @@ wpi_config(struct wpi_softc *sc) /* Configure adapter. */ memset(&sc->rxon, 0, sizeof (struct wpi_rxon)); - IEEE80211_ADDR_COPY(sc->rxon.myaddr, IF_LLADDR(ifp)); + IEEE80211_ADDR_COPY(sc->rxon.myaddr, vap->iv_myaddr); /* Set default channel. */ sc->rxon.chan = ieee80211_chan2ieee(ic, ic->ic_curchan); @@ -3559,6 +3560,7 @@ wpi_scan(struct wpi_softc *sc, struct ie struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_scan_state *ss = ic->ic_scan; + struct ieee80211vap *vap = ss->ss_vap; struct wpi_scan_hdr *hdr; struct wpi_cmd_data *tx; struct wpi_scan_essid *essids; @@ -3645,7 +3647,7 @@ wpi_scan(struct wpi_softc *sc, struct ie IEEE80211_FC0_SUBTYPE_PROBE_REQ; wh->i_fc[1] = IEEE80211_FC1_DIR_NODS; IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr); - IEEE80211_ADDR_COPY(wh->i_addr2, IF_LLADDR(ifp)); + IEEE80211_ADDR_COPY(wh->i_addr2, vap->iv_myaddr); IEEE80211_ADDR_COPY(wh->i_addr3, ifp->if_broadcastaddr); *(uint16_t *)&wh->i_dur[0] = 0; /* filled by h/w */ *(uint16_t *)&wh->i_seq[0] = 0; /* filled by h/w */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 01:47:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06DF2311; Sun, 8 Mar 2015 01:47:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 E678E264; Sun, 8 Mar 2015 01:47:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t281lAdt098781; Sun, 8 Mar 2015 01:47:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t281lA7o098780; Sun, 8 Mar 2015 01:47:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503080147.t281lA7o098780@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Mar 2015 01:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279763 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 01:47:11 -0000 Author: adrian Date: Sun Mar 8 01:47:10 2015 New Revision: 279763 URL: https://svnweb.freebsd.org/changeset/base/279763 Log: Undo some issues from the previous big patch - there's no padding on RX, so remove DATAPAD and re-do the padding in the TX path manually. PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun Mar 8 01:44:57 2015 (r279762) +++ head/sys/dev/wpi/if_wpi.c Sun Mar 8 01:47:10 2015 (r279763) @@ -447,8 +447,6 @@ wpi_attach(device_t dev) ic->ic_cryptocaps = IEEE80211_CRYPTO_AES_CCM; - ic->ic_flags |= IEEE80211_F_DATAPAD; - /* * Read in the eeprom and also setup the channels for * net80211. We don't set the rates as net80211 does this for us @@ -2224,8 +2222,6 @@ done: static int wpi_cmd2(struct wpi_softc *sc, struct wpi_buf *buf) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_frame *wh; struct wpi_tx_cmd *cmd; struct wpi_tx_data *data; @@ -2233,16 +2229,22 @@ wpi_cmd2(struct wpi_softc *sc, struct wp struct wpi_tx_ring *ring; struct mbuf *m1; bus_dma_segment_t *seg, segs[WPI_MAX_SCATTER]; - int error, i, hdrspace, nsegs, totlen; + int error, i, hdrlen, nsegs, totlen, pad; WPI_LOCK_ASSERT(sc); DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); wh = mtod(buf->m, struct ieee80211_frame *); - hdrspace = ieee80211_anyhdrspace(ic, wh); + hdrlen = ieee80211_anyhdrsize(wh); totlen = buf->m->m_pkthdr.len; + if (hdrlen & 3) { + /* First segment length must be a multiple of 4. */ + pad = 4 - (hdrlen & 3); + } else + pad = 0; + ring = &sc->txq[buf->ac]; desc = &ring->desc[ring->cur]; data = &ring->data[ring->cur]; @@ -2257,8 +2259,8 @@ wpi_cmd2(struct wpi_softc *sc, struct wp memcpy(cmd->data, buf->data, buf->size); /* Save and trim IEEE802.11 header. */ - memcpy((uint8_t *)(cmd->data + buf->size), wh, hdrspace); - m_adj(buf->m, hdrspace); + memcpy((uint8_t *)(cmd->data + buf->size), wh, hdrlen); + m_adj(buf->m, hdrlen); error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, buf->m, segs, &nsegs, BUS_DMA_NOWAIT); @@ -2296,10 +2298,10 @@ wpi_cmd2(struct wpi_softc *sc, struct wp __func__, ring->qid, ring->cur, totlen, nsegs); /* Fill TX descriptor. */ - desc->nsegs = WPI_PAD32(totlen) << 4 | (1 + nsegs); + desc->nsegs = WPI_PAD32(totlen + pad) << 4 | (1 + nsegs); /* First DMA segment is used by the TX command. */ desc->segs[0].addr = htole32(data->cmd_paddr); - desc->segs[0].len = htole32(4 + buf->size + hdrspace); + desc->segs[0].len = htole32(4 + buf->size + hdrlen + pad); /* Other DMA segments are for data payload. */ seg = &segs[0]; for (i = 1; i <= nsegs; i++) { @@ -2345,10 +2347,9 @@ wpi_tx_data(struct wpi_softc *sc, struct uint32_t flags; uint16_t qos; uint8_t tid, type; - int ac, error, rate, ismcast, hdrlen, totlen; + int ac, error, rate, ismcast, totlen; wh = mtod(m, struct ieee80211_frame *); - hdrlen = ieee80211_anyhdrsize(wh); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); @@ -2392,12 +2393,12 @@ wpi_tx_data(struct wpi_softc *sc, struct /* 802.11 header may have moved. */ wh = mtod(m, struct ieee80211_frame *); } - totlen = m->m_pkthdr.len - (hdrlen & 3); + totlen = m->m_pkthdr.len; if (ieee80211_radiotap_active_vap(vap)) { struct wpi_tx_radiotap_header *tap = &sc->sc_txtap; - tap->wt_flags = IEEE80211_RADIOTAP_F_DATAPAD; + tap->wt_flags = 0; tap->wt_rate = rate; if (k != NULL) tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; @@ -2514,12 +2515,11 @@ wpi_tx_data_raw(struct wpi_softc *sc, st struct wpi_buf tx_data; uint32_t flags; uint8_t type; - int ac, rate, hdrlen, totlen; + int ac, rate, totlen; wh = mtod(m, struct ieee80211_frame *); - hdrlen = ieee80211_anyhdrsize(wh); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; - totlen = m->m_pkthdr.len - (hdrlen & 3); + totlen = m->m_pkthdr.len; ac = params->ibp_pri & 3; @@ -2541,8 +2541,6 @@ wpi_tx_data_raw(struct wpi_softc *sc, st tap->wt_flags = 0; tap->wt_rate = rate; - if (params->ibp_flags & IEEE80211_BPF_DATAPAD) - tap->wt_flags |= IEEE80211_RADIOTAP_F_DATAPAD; ieee80211_radiotap_tx(vap, m); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 02:13:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5E1B6E1; Sun, 8 Mar 2015 02:13:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 C1A2E6E3; Sun, 8 Mar 2015 02:13:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t282Dl0V012468; Sun, 8 Mar 2015 02:13:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t282DlXj012465; Sun, 8 Mar 2015 02:13:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503080213.t282DlXj012465@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 8 Mar 2015 02:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279764 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 02:13:48 -0000 Author: kib Date: Sun Mar 8 02:13:46 2015 New Revision: 279764 URL: https://svnweb.freebsd.org/changeset/base/279764 Log: Fix function name in the panic message. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sun Mar 8 01:47:10 2015 (r279763) +++ head/sys/vm/vm_reserv.c Sun Mar 8 02:13:46 2015 (r279764) @@ -428,7 +428,7 @@ vm_reserv_alloc_contig(vm_object_t objec msucc = TAILQ_FIRST(&object->memq); if (msucc != NULL) { KASSERT(msucc->pindex > pindex, - ("vm_reserv_alloc_page: pindex already allocated")); + ("vm_reserv_alloc_contig: pindex already allocated")); rv = vm_reserv_from_page(msucc); if (rv->object == object && vm_reserv_has_pindex(rv, pindex)) goto found; From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 02:47:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71413AC7; Sun, 8 Mar 2015 02:47:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 5CEE4A32; Sun, 8 Mar 2015 02:47:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t282ldJu028579; Sun, 8 Mar 2015 02:47:39 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t282ldw8028578; Sun, 8 Mar 2015 02:47:39 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201503080247.t282ldw8028578@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sun, 8 Mar 2015 02:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279765 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 02:47:39 -0000 Author: gnn Date: Sun Mar 8 02:47:38 2015 New Revision: 279765 URL: https://svnweb.freebsd.org/changeset/base/279765 Log: Summary: Remove the pid printing which does not currently work. Modified: head/share/dtrace/tcpstate Modified: head/share/dtrace/tcpstate ============================================================================== --- head/share/dtrace/tcpstate Sun Mar 8 02:13:46 2015 (r279764) +++ head/share/dtrace/tcpstate Sun Mar 8 02:47:38 2015 (r279765) @@ -41,6 +41,6 @@ tcp:kernel::state-change { newstate = args[3]->tcps_state; oldstate = args[5]->tcps_state; - printf("%d %s\t\t%s\n", args[1]->pid, tcp_state_string[oldstate], + printf("%s\t\t%s\n", tcp_state_string[oldstate], tcp_state_string[newstate]); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 03:34:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CF4050D; Sun, 8 Mar 2015 03:34:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 88AEEFC6; Sun, 8 Mar 2015 03:34:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t283Y7Oc052864; Sun, 8 Mar 2015 03:34:07 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t283Y7Do052863; Sun, 8 Mar 2015 03:34:07 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503080334.t283Y7Do052863@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Mar 2015 03:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279766 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 03:34:07 -0000 Author: ian Date: Sun Mar 8 03:34:06 2015 New Revision: 279766 URL: https://svnweb.freebsd.org/changeset/base/279766 Log: Fix spurious interrupts on arm am335x (beaglebone), by doing the EOI in both the post-filter and post-thread callbacks. Also eliminate a completely unecessary write to INTC_ISR_CLEAR register, which clears a software-generated interrupt that can only happen with a write to INTC_ISR_SET (which nothing does). Modified: head/sys/arm/ti/aintc.c Modified: head/sys/arm/ti/aintc.c ============================================================================== --- head/sys/arm/ti/aintc.c Sun Mar 8 02:47:38 2015 (r279765) +++ head/sys/arm/ti/aintc.c Sun Mar 8 03:34:06 2015 (r279766) @@ -78,6 +78,14 @@ static struct ti_aintc_softc *ti_aintc_s bus_space_write_4((_sc)->aintc_bst, (_sc)->aintc_bsh, (reg), (val)) +static void +aintc_post_filter(void *arg) +{ + + arm_irq_memory_barrier(0); + aintc_write_4(ti_aintc_sc, INTC_CONTROL, 1); /* EOI */ +} + static int ti_aintc_probe(device_t dev) { @@ -124,6 +132,8 @@ ti_aintc_attach(device_t dev) /*Set Priority Threshold */ aintc_write_4(sc, INTC_THRESHOLD, 0xFF); + arm_post_filter = aintc_post_filter; + return (0); } @@ -149,12 +159,6 @@ arm_get_next_irq(int last_irq) struct ti_aintc_softc *sc = ti_aintc_sc; uint32_t active_irq; - if (last_irq != -1) { - aintc_write_4(sc, INTC_ISR_CLEAR(last_irq >> 5), - 1UL << (last_irq & 0x1F)); - aintc_write_4(sc, INTC_CONTROL, 1); - } - /* Get the next active interrupt */ active_irq = aintc_read_4(sc, INTC_SIR_IRQ); @@ -178,6 +182,7 @@ arm_mask_irq(uintptr_t nb) struct ti_aintc_softc *sc = ti_aintc_sc; aintc_write_4(sc, INTC_MIR_SET(nb >> 5), (1UL << (nb & 0x1F))); + aintc_write_4(sc, INTC_CONTROL, 1); /* EOI */ } void From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 03:53:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A77D795; Sun, 8 Mar 2015 03:53:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 E8B791F5; Sun, 8 Mar 2015 03:53:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t283rc2V062057; Sun, 8 Mar 2015 03:53:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t283rbe1062051; Sun, 8 Mar 2015 03:53:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503080353.t283rbe1062051@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Mar 2015 03:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279767 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 03:53:39 -0000 Author: adrian Date: Sun Mar 8 03:53:36 2015 New Revision: 279767 URL: https://svnweb.freebsd.org/changeset/base/279767 Log: Fix up support for the AR8327. * Even though I got the registers around "right", it seems I'm not tickling the MDIO access correctly for the internal PHY bus. Some of the switches are fine poking at the external PHY registers; others aren't. So, enable direct PHY bus access for the AR8327, and leave the existing code in place for the others. * Go and shuffle the register access around. Whilst here, restore the 2ms delay if changing page. * Comment out some of the stub printf()s; there's some upcoming work to add port VLAN support. Tested: * AP135 development board * Carambola2 - AR9331 SoC Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitch_phy.c head/sys/dev/etherswitch/arswitch/arswitch_phy.h head/sys/dev/etherswitch/arswitch/arswitch_reg.c head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Sun Mar 8 03:34:06 2015 (r279766) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Sun Mar 8 03:53:36 2015 (r279767) @@ -149,8 +149,10 @@ done: DPRINTF(dev, "chipname=%s, id=%08x\n", chipname, id); if (chipname != NULL) { snprintf(desc, sizeof(desc), - "Atheros %s Ethernet Switch", - chipname); + "Atheros %s Ethernet Switch (ver %d rev %d)", + chipname, + sc->chip_ver, + sc->chip_rev); device_set_desc_copy(dev, desc); return (BUS_PROBE_DEFAULT); } @@ -177,9 +179,11 @@ arswitch_attach_phys(struct arswitch_sof err = mii_attach(sc->sc_dev, &sc->miibus[phy], sc->ifp[phy], arswitch_ifmedia_upd, arswitch_ifmedia_sts, \ BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); +#if 0 DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", device_get_nameunit(sc->miibus[phy]), sc->ifp[phy]->if_xname); +#endif if (err != 0) { device_printf(sc->sc_dev, "attaching PHY %d failed\n", @@ -304,6 +308,8 @@ arswitch_attach(device_t dev) sc->hal.arswitch_vlan_get_pvid = ar8xxx_get_pvid; sc->hal.arswitch_vlan_set_pvid = ar8xxx_set_pvid; sc->hal.arswitch_atu_flush = ar8xxx_atu_flush; + sc->hal.arswitch_phy_read = arswitch_readphy_internal; + sc->hal.arswitch_phy_write = arswitch_writephy_internal; /* * Attach switch related functions @@ -320,8 +326,10 @@ arswitch_attach(device_t dev) ar8316_attach(sc); else if (AR8X16_IS_SWITCH(sc, AR8327)) ar8327_attach(sc); - else + else { + DPRINTF(dev, "%s: unknown switch (%d)?\n", __func__, sc->sc_switchtype); return (ENXIO); + } /* Common defaults. */ sc->info.es_nports = 5; /* XXX technically 6, but 6th not used */ @@ -348,14 +356,18 @@ arswitch_attach(device_t dev) sc->numphys = AR8X16_NUM_PHYS; /* Reset the switch. */ - if (arswitch_reset(dev)) + if (arswitch_reset(dev)) { + DPRINTF(dev, "%s: arswitch_reset: failed\n", __func__); return (ENXIO); + } err = sc->hal.arswitch_hw_setup(sc); + DPRINTF(dev, "%s: hw_setup: err=%d\n", __func__, err); if (err != 0) return (err); err = sc->hal.arswitch_hw_global_setup(sc); + DPRINTF(dev, "%s: hw_global_setup: err=%d\n", __func__, err); if (err != 0) return (err); @@ -368,17 +380,20 @@ arswitch_attach(device_t dev) * Attach the PHYs and complete the bus enumeration. */ err = arswitch_attach_phys(sc); + DPRINTF(dev, "%s: attach_phys: err=%d\n", __func__, err); if (err != 0) return (err); /* Default to ingress filters off. */ err = arswitch_set_vlan_mode(sc, 0); + DPRINTF(dev, "%s: set_vlan_mode: err=%d\n", __func__, err); if (err != 0) return (err); bus_generic_probe(dev); bus_enumerate_hinted_children(dev); err = bus_generic_attach(dev); + DPRINTF(dev, "%s: bus_generic_attach: err=%d\n", __func__, err); if (err != 0) return (err); @@ -803,6 +818,22 @@ arswitch_setvgroup(device_t dev, ethersw return (sc->hal.arswitch_vlan_setvgroup(sc, e)); } +static int +arswitch_readphy(device_t dev, int phy, int reg) +{ + struct arswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.arswitch_phy_read(dev, phy, reg)); +} + +static int +arswitch_writephy(device_t dev, int phy, int reg, int val) +{ + struct arswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.arswitch_phy_write(dev, phy, reg, val)); +} + static device_method_t arswitch_methods[] = { /* Device interface */ DEVMETHOD(device_probe, arswitch_probe), Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 8 03:34:06 2015 (r279766) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 8 03:53:36 2015 (r279767) @@ -57,6 +57,9 @@ #include #include #include +#include +#include + #include #include "mdio_if.h" @@ -290,7 +293,7 @@ ar8327_fetch_pdata_port(struct arswitch_ sbuf, &val) == 0) pcfg->rxpause = val; -#if 0 +#if 1 device_printf(sc->sc_dev, "%s: port %d: speed=%d, duplex=%d, txpause=%d, rxpause=%d\n", __func__, @@ -562,6 +565,7 @@ ar8327_init_pdata(struct arswitch_softc /* SGMII config */ bzero(&scfg, sizeof(scfg)); if (ar8327_fetch_pdata_sgmii(sc, &scfg)) { + device_printf(sc->sc_dev, "%s: SGMII cfg?\n", __func__); t = scfg.sgmii_ctrl; if (sc->chip_rev == 1) t |= AR8327_SGMII_CTRL_EN_PLL | @@ -657,12 +661,16 @@ ar8327_hw_global_setup(struct arswitch_s } /* - * Port setup. + * Port setup. Called at attach time. */ static void ar8327_port_init(struct arswitch_softc *sc, int port) { uint32_t t; + int ports; + + /* For now, port can see all other ports */ + ports = 0x7f; if (port == AR8X16_PORT_CPU) t = sc->ar8327.port0_status; @@ -696,7 +704,7 @@ ar8327_port_init(struct arswitch_softc * t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; /* So this allows traffic to any port except ourselves */ - t |= (0x7f & ~(1 << port)); + t |= (ports & ~(1 << port)); arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(port), t); } @@ -705,16 +713,18 @@ ar8327_port_vlan_setup(struct arswitch_s { /* XXX stub for now */ - device_printf(sc->sc_dev, "%s: called\n", __func__); +// device_printf(sc->sc_dev, "%s: called\n", __func__); return (0); } +/* + * Get the port VLAN configuration. + */ static int ar8327_port_vlan_get(struct arswitch_softc *sc, etherswitch_port_t *p) { - /* XXX stub for now */ - device_printf(sc->sc_dev, "%s: called\n", __func__); +// device_printf(sc->sc_dev, "%s: called\n", __func__); return (0); } @@ -723,6 +733,13 @@ ar8327_reset_vlans(struct arswitch_softc { int i; uint32_t mode, t; + int ports; + + ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + ARSWITCH_LOCK(sc); + + /* Clear the existing VLAN configuration */ + memset(sc->vid, 0, sizeof(sc->vid)); /* * Disable mirroring. @@ -732,10 +749,21 @@ ar8327_reset_vlans(struct arswitch_softc (0xF << AR8327_FWD_CTRL0_MIRROR_PORT_S)); /* + * XXX TODO: disable any Q-in-Q port configuration, + * tagging, egress filters, etc. + */ + + /* * For now, let's default to one portgroup, just so traffic - * flows. All ports can see other ports. + * flows. All ports can see other ports. There are two CPU GMACs + * (GMAC0, GMAC6), GMAC1..GMAC5 are external PHYs. + * + * (ETHERSWITCH_VLAN_PORT) */ + ports = 0x7f; + for (i = 0; i < AR8327_NUM_PORTS; i++) { + /* set pvid = 1; there's only one vlangroup */ t = 1 << AR8327_PORT_VLAN0_DEF_SVID_S; t |= 1 << AR8327_PORT_VLAN0_DEF_CVID_S; @@ -749,7 +777,7 @@ ar8327_reset_vlans(struct arswitch_softc arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN1(i), t); /* Ports can see other ports */ - t = (0x7f & ~(1 << i)); /* all ports besides us */ + t = (ports & ~(1 << i)); /* all ports besides us */ t |= AR8327_PORT_LOOKUP_LEARN; /* in_port_only, forward */ @@ -769,12 +797,20 @@ ar8327_reset_vlans(struct arswitch_softc AR8327_PORT_HOL_CTRL1_EG_MIRROR_EN, 0); } + + ARSWITCH_UNLOCK(sc); } static int ar8327_vlan_getvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) { - device_printf(sc->sc_dev, "%s: called\n", __func__); + +#if 0 + /* XXX for now, no dot1q vlans */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) + return (EINVAL); + return (ar8xxx_getvgroup(sc, vg)); +#endif return (0); } @@ -782,7 +818,12 @@ static int ar8327_vlan_setvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) { - device_printf(sc->sc_dev, "%s: called\n", __func__); +#if 0 + /* XXX for now, no dot1q vlans */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) + return (EINVAL); + return (ar8xxx_setvgroup(sc, vg)); +#endif return (0); } @@ -832,17 +873,29 @@ ar8327_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_global_setup = ar8327_hw_global_setup; sc->hal.arswitch_port_init = ar8327_port_init; + + sc->hal.arswitch_vlan_getvgroup = ar8327_vlan_getvgroup; + sc->hal.arswitch_vlan_setvgroup = ar8327_vlan_setvgroup; sc->hal.arswitch_port_vlan_setup = ar8327_port_vlan_setup; sc->hal.arswitch_port_vlan_get = ar8327_port_vlan_get; sc->hal.arswitch_vlan_init_hw = ar8327_reset_vlans; - sc->hal.arswitch_vlan_getvgroup = ar8327_vlan_getvgroup; - sc->hal.arswitch_vlan_setvgroup = ar8327_vlan_setvgroup; sc->hal.arswitch_vlan_get_pvid = ar8327_get_pvid; sc->hal.arswitch_vlan_set_pvid = ar8327_set_pvid; sc->hal.arswitch_atu_flush = ar8327_atu_flush; + /* + * Reading the PHY via the MDIO interface currently doesn't + * work correctly. + * + * So for now, just go direct to the PHY registers themselves. + * This has always worked on external devices, but not internal + * devices (AR934x, AR724x, AR933x.) + */ + sc->hal.arswitch_phy_read = arswitch_readphy_external; + sc->hal.arswitch_phy_write = arswitch_writephy_external; + /* Set the switch vlan capabilities. */ sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOUBLE_TAG; Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_phy.c Sun Mar 8 03:34:06 2015 (r279766) +++ head/sys/dev/etherswitch/arswitch/arswitch_phy.c Sun Mar 8 03:53:36 2015 (r279767) @@ -67,11 +67,46 @@ static SYSCTL_NODE(_debug, OID_AUTO, ars #endif /* - * access PHYs integrated into the switch chip through the switch's MDIO + * Access PHYs integrated into the switch by going direct + * to the PHY space itself, rather than through the switch + * MDIO register. + */ +int +arswitch_readphy_external(device_t dev, int phy, int reg) +{ + int ret; + struct arswitch_softc *sc; + + sc = device_get_softc(dev); + + ARSWITCH_LOCK(sc); + ret = (MDIO_READREG(device_get_parent(dev), phy, reg)); + ARSWITCH_UNLOCK(sc); + + return (ret); +} + +int +arswitch_writephy_external(device_t dev, int phy, int reg, int data) +{ + struct arswitch_softc *sc; + + sc = device_get_softc(dev); + + ARSWITCH_LOCK(sc); + (void) MDIO_WRITEREG(device_get_parent(dev), phy, + reg, data); + ARSWITCH_UNLOCK(sc); + + return (0); +} + +/* + * Access PHYs integrated into the switch chip through the switch's MDIO * control register. */ int -arswitch_readphy(device_t dev, int phy, int reg) +arswitch_readphy_internal(device_t dev, int phy, int reg) { struct arswitch_softc *sc; uint32_t data = 0, ctrl; @@ -105,8 +140,10 @@ arswitch_readphy(device_t dev, int phy, if ((ctrl & AR8X16_MDIO_CTRL_BUSY) == 0) break; } - if (timeout < 0) + if (timeout < 0) { + DPRINTF(dev, "arswitch_readphy(): phy=%d.%02x; timeout=%d\n", phy, reg, timeout); goto fail; + } data = arswitch_readreg_lsb(dev, a) & AR8X16_MDIO_CTRL_DATA_MASK; ARSWITCH_UNLOCK(sc); @@ -118,7 +155,7 @@ fail: } int -arswitch_writephy(device_t dev, int phy, int reg, int data) +arswitch_writephy_internal(device_t dev, int phy, int reg, int data) { struct arswitch_softc *sc; uint32_t ctrl; Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_phy.h Sun Mar 8 03:34:06 2015 (r279766) +++ head/sys/dev/etherswitch/arswitch/arswitch_phy.h Sun Mar 8 03:53:36 2015 (r279767) @@ -28,7 +28,10 @@ #ifndef __ARSWITCH_PHY_H__ #define __ARSWITCH_PHY_H__ -extern int arswitch_readphy(device_t dev, int phy, int reg); -extern int arswitch_writephy(device_t dev, int phy, int reg, int data); +extern int arswitch_readphy_external(device_t dev, int phy, int reg); +extern int arswitch_writephy_external(device_t dev, int phy, int reg, int data); + +extern int arswitch_readphy_internal(device_t dev, int phy, int reg); +extern int arswitch_writephy_internal(device_t dev, int phy, int reg, int data); #endif /* __ARSWITCH_PHY_H__ */ Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Sun Mar 8 03:34:06 2015 (r279766) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Sun Mar 8 03:53:36 2015 (r279767) @@ -68,12 +68,13 @@ arswitch_split_setpage(device_t dev, uin struct arswitch_softc *sc = device_get_softc(dev); uint16_t page; - page = ((addr) >> 9) & 0xffff; - *phy = (((addr) >> 6) & 0x07) | 0x10; - *reg = ((addr) >> 1) & 0x1f; + page = (addr >> 9) & 0x1ff; + *phy = (addr >> 6) & 0x7; + *reg = (addr >> 1) & 0x1f; if (sc->page != page) { MDIO_WRITEREG(device_get_parent(dev), 0x18, 0, page); + DELAY(2000); sc->page = page; } } @@ -87,9 +88,21 @@ static inline int arswitch_readreg16(device_t dev, int addr) { uint16_t phy, reg; - + arswitch_split_setpage(dev, addr, &phy, ®); - return (MDIO_READREG(device_get_parent(dev), phy, reg)); + return (MDIO_READREG(device_get_parent(dev), 0x10 | phy, reg)); +} + +/* + * Write half a register. See above! + */ +static inline int +arswitch_writereg16(device_t dev, int addr, int data) +{ + uint16_t phy, reg; + + arswitch_split_setpage(dev, addr, &phy, ®); + return (MDIO_WRITEREG(device_get_parent(dev), 0x10 | phy, reg, data)); } /* @@ -121,93 +134,123 @@ arswitch_writemmd(device_t dev, int phy, MII_ATH_MMD_DATA, dbg_data); } -/* - * Write half a register - */ -static inline int -arswitch_writereg16(device_t dev, int addr, int data) +static uint32_t +arswitch_reg_read32(device_t dev, int phy, int reg) { - uint16_t phy, reg; - - arswitch_split_setpage(dev, addr, &phy, ®); - return (MDIO_WRITEREG(device_get_parent(dev), phy, reg, data)); + uint16_t lo, hi; + lo = MDIO_READREG(device_get_parent(dev), phy, reg); + hi = MDIO_READREG(device_get_parent(dev), phy, reg + 1); + + return (hi << 16) | lo; } -int -arswitch_readreg_lsb(device_t dev, int addr) +static int +arswitch_reg_write32(device_t dev, int phy, int reg, uint32_t value) { + struct arswitch_softc *sc; + int r; + uint16_t lo, hi; - return (arswitch_readreg16(dev, addr)); + sc = device_get_softc(dev); + lo = value & 0xffff; + hi = (uint16_t) (value >> 16); + + if (sc->mii_lo_first) { + r = MDIO_WRITEREG(device_get_parent(dev), + phy, reg, lo); + r |= MDIO_WRITEREG(device_get_parent(dev), + phy, reg + 1, hi); + } else { + r = MDIO_WRITEREG(device_get_parent(dev), + phy, reg + 1, hi); + r |= MDIO_WRITEREG(device_get_parent(dev), + phy, reg, lo); + } + + return r; } int -arswitch_readreg_msb(device_t dev, int addr) +arswitch_readreg(device_t dev, int addr) { + uint16_t phy, reg; - return (arswitch_readreg16(dev, addr + 2) << 16); + arswitch_split_setpage(dev, addr, &phy, ®); + return arswitch_reg_read32(dev, 0x10 | phy, reg); } int -arswitch_writereg_lsb(device_t dev, int addr, int data) +arswitch_writereg(device_t dev, int addr, int value) { + struct arswitch_softc *sc; + uint16_t phy, reg; - return (arswitch_writereg16(dev, addr, data & 0xffff)); + sc = device_get_softc(dev); + + arswitch_split_setpage(dev, addr, &phy, ®); + return (arswitch_reg_write32(dev, 0x10 | phy, reg, value)); } +/* + * Read/write 16 bit values in the switch register space. + * + * Some of the registers are control registers (eg the MDIO + * data versus control space) and so need to be treated + * differently. + */ int -arswitch_writereg_msb(device_t dev, int addr, int data) +arswitch_readreg_lsb(device_t dev, int addr) { - return (arswitch_writereg16(dev, addr + 2, (data >> 16) & 0xffff)); + return (arswitch_readreg16(dev, addr)); } int -arswitch_readreg(device_t dev, int addr) +arswitch_readreg_msb(device_t dev, int addr) { - return (arswitch_readreg_lsb(dev, addr) | - arswitch_readreg_msb(dev, addr)); + return (arswitch_readreg16(dev, addr + 2) << 16); } int -arswitch_writereg(device_t dev, int addr, int value) +arswitch_writereg_lsb(device_t dev, int addr, int data) { - struct arswitch_softc *sc; - int r; - sc = device_get_softc(dev); + return (arswitch_writereg16(dev, addr, data & 0xffff)); +} - /* XXX Check the first write too? */ - if (sc->mii_lo_first) { - r = arswitch_writereg_lsb(dev, addr, value); - r |= arswitch_writereg_msb(dev, addr, value); - } else { - r = arswitch_writereg_msb(dev, addr, value); - r |= arswitch_writereg_lsb(dev, addr, value); - } +int +arswitch_writereg_msb(device_t dev, int addr, int data) +{ - return r; + return (arswitch_writereg16(dev, addr + 2, (data >> 16) & 0xffff)); } int arswitch_modifyreg(device_t dev, int addr, int mask, int set) { int value; - - value = arswitch_readreg(dev, addr); + uint16_t phy, reg; + + arswitch_split_setpage(dev, addr, &phy, ®); + + value = arswitch_reg_read32(dev, 0x10 | phy, reg); value &= ~mask; value |= set; - return (arswitch_writereg(dev, addr, value)); + return (arswitch_reg_write32(dev, 0x10 | phy, reg, value)); } int arswitch_waitreg(device_t dev, int addr, int mask, int val, int timeout) { int err, v; + uint16_t phy, reg; + + arswitch_split_setpage(dev, addr, &phy, ®); err = -1; while (1) { - v = arswitch_readreg(dev, addr); + v = arswitch_reg_read32(dev, 0x10 | phy, reg); v &= mask; if (v == val) { err = 0; Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Sun Mar 8 03:34:06 2015 (r279766) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Sun Mar 8 03:53:36 2015 (r279767) @@ -60,7 +60,7 @@ struct arswitch_softc { int is_internal_switch; int chip_ver; int chip_rev; - int mii_lo_first; + int mii_lo_first; /* Send low data DWORD before high */ ar8x16_switch_type sc_switchtype; /* should be the max of both pre-AR8327 and AR8327 ports */ char *ifname[ARSWITCH_NUM_PHYS]; @@ -98,6 +98,10 @@ struct arswitch_softc { int *); int (* arswitch_vlan_set_pvid) (struct arswitch_softc *, int, int); + + /* PHY functions */ + int (* arswitch_phy_read) (device_t, int, int); + int (* arswitch_phy_write) (device_t, int, int, int); } hal; struct { From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 04:29:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA515B05; Sun, 8 Mar 2015 04:29:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 BB37D69C; Sun, 8 Mar 2015 04:29:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t284TgeW076772; Sun, 8 Mar 2015 04:29:42 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t284Tgx0076770; Sun, 8 Mar 2015 04:29:42 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201503080429.t284Tgx0076770@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sun, 8 Mar 2015 04:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279768 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 04:29:43 -0000 Author: gnn Date: Sun Mar 8 04:29:41 2015 New Revision: 279768 URL: https://svnweb.freebsd.org/changeset/base/279768 Log: udp track shows UDP data as it arrives and leaves the system Added: head/share/dtrace/udptrack (contents, props changed) Modified: head/share/dtrace/Makefile Modified: head/share/dtrace/Makefile ============================================================================== --- head/share/dtrace/Makefile Sun Mar 8 03:53:36 2015 (r279767) +++ head/share/dtrace/Makefile Sun Mar 8 04:29:41 2015 (r279768) @@ -16,9 +16,10 @@ SCRIPTS= disklatency \ disklatencycmd \ hotopen \ nfsclienttime \ + udptrack \ tcpstate \ tcptrack \ - tcpconn + tcpconn SCRIPTSDIR= ${SHAREDIR}/dtrace Added: head/share/dtrace/udptrack ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/udptrack Sun Mar 8 04:29:41 2015 (r279768) @@ -0,0 +1,54 @@ +#!/usr/sbin/dtrace -s +/* + * Copyright (c) 2015 George V. Neville-Neil + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + * The udptrack D script shows various information about UDP + * data that are sent and received on the host. + * + * Usage: udptrack + */ + +#pragma D option quiet +udp:kernel::receive +{ + printf("Received %d bytes of data from %s:%d\n", + args[4]->udp_length, + args[2]->ip_daddr, + args[3]->udps_rport); + tracemem(args[4]->udp_hdr, 64); + +} + +udp:kernel::send +{ + printf("Sent %d bytes of data to %s:%d\n", + args[4]->udp_length, + args[2]->ip_daddr, + args[3]->udps_rport); + tracemem(args[4]->udp_hdr, 64); +} + From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 04:33:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFC03C9C; Sun, 8 Mar 2015 04:33:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 BB8887AF; Sun, 8 Mar 2015 04:33:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t284XscI080800; Sun, 8 Mar 2015 04:33:54 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t284Xs83080799; Sun, 8 Mar 2015 04:33:54 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201503080433.t284Xs83080799@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sun, 8 Mar 2015 04:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279769 - head/share/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 04:33:54 -0000 Author: gnn Date: Sun Mar 8 04:33:53 2015 New Revision: 279769 URL: https://svnweb.freebsd.org/changeset/base/279769 Log: Summary: Update the ports to read from the packet rather than the socket structure Modified: head/share/dtrace/udptrack Modified: head/share/dtrace/udptrack ============================================================================== --- head/share/dtrace/udptrack Sun Mar 8 04:29:41 2015 (r279768) +++ head/share/dtrace/udptrack Sun Mar 8 04:33:53 2015 (r279769) @@ -37,10 +37,9 @@ udp:kernel::receive { printf("Received %d bytes of data from %s:%d\n", args[4]->udp_length, - args[2]->ip_daddr, - args[3]->udps_rport); + args[2]->ip_saddr, + args[4]->udp_sport); tracemem(args[4]->udp_hdr, 64); - } udp:kernel::send @@ -48,7 +47,7 @@ udp:kernel::send printf("Sent %d bytes of data to %s:%d\n", args[4]->udp_length, args[2]->ip_daddr, - args[3]->udps_rport); + args[4]->udp_dport); tracemem(args[4]->udp_hdr, 64); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 08:34:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3727A304; Sun, 8 Mar 2015 08:34:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 21AF5E55; Sun, 8 Mar 2015 08:34:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t288YniZ091683; Sun, 8 Mar 2015 08:34:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t288Ynds091682; Sun, 8 Mar 2015 08:34:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503080834.t288Ynds091682@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 8 Mar 2015 08:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279773 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 08:34:50 -0000 Author: hselasky Date: Sun Mar 8 08:34:49 2015 New Revision: 279773 URL: https://svnweb.freebsd.org/changeset/base/279773 Log: Switch polarity of PPS events. PR: 196897 Submitted by: ian @ MFC after: 1 week Modified: head/sys/dev/usb/serial/usb_serial.c Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Sun Mar 8 07:40:40 2015 (r279772) +++ head/sys/dev/usb/serial/usb_serial.c Sun Mar 8 08:34:49 2015 (r279773) @@ -1102,14 +1102,19 @@ ucom_cfg_status_change(struct usb_proc_m sc->sc_msr = new_msr; sc->sc_lsr = new_lsr; - /* time pulse counting support */ + /* + * Time pulse counting support. Note that both CTS and DCD are + * active-low signals. The status bit is high to indicate that + * the signal on the line is low, which corresponds to a PPS + * clear event. + */ switch(ucom_pps_mode) { case 1: if ((sc->sc_pps.ppsparam.mode & PPS_CAPTUREBOTH) && (msr_delta & SER_CTS)) { pps_capture(&sc->sc_pps); pps_event(&sc->sc_pps, (sc->sc_msr & SER_CTS) ? - PPS_CAPTUREASSERT : PPS_CAPTURECLEAR); + PPS_CAPTURECLEAR : PPS_CAPTUREASSERT); } break; case 2: @@ -1117,7 +1122,7 @@ ucom_cfg_status_change(struct usb_proc_m (msr_delta & SER_DCD)) { pps_capture(&sc->sc_pps); pps_event(&sc->sc_pps, (sc->sc_msr & SER_DCD) ? - PPS_CAPTUREASSERT : PPS_CAPTURECLEAR); + PPS_CAPTURECLEAR : PPS_CAPTUREASSERT); } break; default: From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 08:44:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C6AD4AD; Sun, 8 Mar 2015 08:44:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 074A6F1F; Sun, 8 Mar 2015 08:44:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t288i4iK096278; Sun, 8 Mar 2015 08:44:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t288i4d4096277; Sun, 8 Mar 2015 08:44:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503080844.t288i4d4096277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 8 Mar 2015 08:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279774 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 08:44:05 -0000 Author: hselasky Date: Sun Mar 8 08:44:04 2015 New Revision: 279774 URL: https://svnweb.freebsd.org/changeset/base/279774 Log: Build the videomode kernel module by default. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Mar 8 08:34:49 2015 (r279773) +++ head/sys/modules/Makefile Sun Mar 8 08:44:04 2015 (r279774) @@ -353,6 +353,7 @@ SUBDIR= \ ${_virtio} \ vge \ ${_viawd} \ + videomode \ vkbd \ ${_vmm} \ ${_vmware} \ From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 10:52:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E11A904; Sun, 8 Mar 2015 10:52:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 692F9DEE; Sun, 8 Mar 2015 10:52:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28AqBMm061148; Sun, 8 Mar 2015 10:52:11 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28AqBKt061147; Sun, 8 Mar 2015 10:52:11 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201503081052.t28AqBKt061147@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 8 Mar 2015 10:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279776 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 10:52:11 -0000 Author: dchagin Date: Sun Mar 8 10:52:10 2015 New Revision: 279776 URL: https://svnweb.freebsd.org/changeset/base/279776 Log: Finish r194601. Add a cred parameter to the VOP_VPTOCNP(9) manpage. While here fix igor warning about new line. Reviewed by: kib MFC after: 1 Week Modified: head/share/man/man9/VOP_VPTOCNP.9 Modified: head/share/man/man9/VOP_VPTOCNP.9 ============================================================================== --- head/share/man/man9/VOP_VPTOCNP.9 Sun Mar 8 08:47:09 2015 (r279775) +++ head/share/man/man9/VOP_VPTOCNP.9 Sun Mar 8 10:52:10 2015 (r279776) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 19, 2011 +.Dd March 8, 2015 .Dt VOP_VPTOCNP 9 .Os .Sh NAME @@ -36,9 +36,10 @@ .Nd translate a vnode to its component name .Sh SYNOPSIS .In sys/param.h +.In sys/ucred.h .In sys/vnode.h .Ft int -.Fn VOP_VPTOCNP "struct vnode *vp" "struct vnode **dvp" "char *buf" "int *buflen" +.Fn VOP_VPTOCNP "struct vnode *vp" "struct vnode **dvp" "struct ucred *cred" "char *buf" "int *buflen" .Sh DESCRIPTION This translates a vnode into its component name, and writes that name to the head of the buffer specified by @@ -49,6 +50,8 @@ The vnode to translate. .It Fa dvp The vnode of the parent directory of .Fa vp . +.It Fa cred +The caller credentials. .It Fa buf The buffer into which to prepend the component name. .It Fa buflen @@ -59,7 +62,8 @@ The default implementation of .Nm scans through .Fa vp Ns 's -parent directory looking for a dirent with a matching file number. If +parent directory looking for a dirent with a matching file number. +If .Fa vp is not a directory, then .Nm From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 13:38:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C046118; Sun, 8 Mar 2015 13:38:32 +0000 (UTC) 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 C1A10ED3; Sun, 8 Mar 2015 13:38:31 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YUbPR-000L6x-GR; Sun, 08 Mar 2015 16:38:21 +0300 Date: Sun, 8 Mar 2015 16:38:21 +0300 From: Slawa Olhovchenkov To: Benjamin Kaduk Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh Message-ID: <20150308133821.GF48476@zxy.spb.ru> References: <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> <20150305141334.GX48476@zxy.spb.ru> <63BD8258-D2C9-4C94-8A54-63AA104871D9@FreeBSD.org> <20150305144056.GY48476@zxy.spb.ru> <20150305151732.GA48476@zxy.spb.ru> 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-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 Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 13:38:32 -0000 On Thu, Mar 05, 2015 at 08:14:59PM -0500, Benjamin Kaduk wrote: > On Thu, 5 Mar 2015, Slawa Olhovchenkov wrote: > > > On Thu, Mar 05, 2015 at 10:11:43AM -0500, Benjamin Kaduk wrote: > > > > > On Thu, Mar 5, 2015 at 9:40 AM, Slawa Olhovchenkov wrote: > > > > > > Speaking as an upstream maintainer: don't use kerberized telnet. > > > > I am use this for test kerberos setup (check all setup correctly). > > I use ssh to test kerberos setups (I think sshd has better error message, > for one). I don't see any error message from ssh (about kerberos), ssh just ask password if any problem. What a problem? Silent. For debug ssh+kerberos I need stop sshd and run sshd with -D and -d. And in this case debug messages very stranges for me. Also, telnet use less dependes and less restrictions. This is good for step-to-step debug. > The problem with using telnet to test the kerberos setup is that if your > kerberos setup works with telnet, you have the DES enctypes (weak > cryptography) enabled. This means that the whole setup, even things > other What you talk about DES? I don't see nothing about AES/DES/etc in krb5.conf. > than telnet, are suffering from the vulnerabilities of weak crypto. > Kerberos distributions have disabled DES by default for many years, now -- > Apple has even completely removed the code for them from recent releases > of OS X! Please see RFC 6649. I don't enable DES. And I have working kerberized telnet. What you talk about? > > > I use kerberized ssh all the time; please tell me more about how it is > > > broken (a new thread would be best). > > > > kerberized ssh broken in SSO mode: you can't do ssh login to > > I have a very different idea of what "SSO mode" means: I run kinit on my > local machine and then use kerberos to authenticate to remote > services. I SSO (for me) is from Windows world: you login in desktop and don't need to enter password anymore. > should never type my password at something which is not a trusted local > binary. As I know, you can't use kerberos outside controled perimeter (with working NTP sync, revers DNS and etc). I.e. from random [network] place you can't run kinit on local machine [notebook] and use kerberos to ssh login. For may case this is requirement. And for untrusted binary -- why don't use kerberos with OTP? > > kerberized host (from outside world), input kerberos password and use > > kerberos ticket. > > "input kerberos password and use kerberos ticket" doesn't make sense -- > you are not using your kerberos ticket; you are using your password. > PAM I am use kerberos ticket for passwordless login to internal hosts (after using password for login to gateway host). > is going off and getting a ticket, sure (and hopefully validating it > against the host keytab to avoid the Zanarotti attack!), but it is > starting with your password. That is completely at odds with how Kerberos > is intended to be used. Sorry, I don't understand you. Can explain? > > This is issuse between PAM and ssh thread emulation. > > It does seem likely that this sort of thing would be an issue with PAM, > yes. I am not particularly motivated to look into it, though. > I do recall some issue where sshd in capsicum mode was not allowed to read > the keytab in order to verify the supplied Kerberos credentials, which > required using UsePrivilegeSeparation=yes instead of the default value > (sandbox). Perhaps that would affect the password mode of operation as > well. Currently, sshd for PAM (and kerberos PAM) fork child. Got ticket in this child. And try to save ticket in parent (unsuccessful, of course). As result -- I don't have valid ticket after ssh login. From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 13:52:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBDA83D4; Sun, 8 Mar 2015 13:52:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 CCD05C4; Sun, 8 Mar 2015 13:52:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28Dq9vO045531; Sun, 8 Mar 2015 13:52:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28Dq84T045524; Sun, 8 Mar 2015 13:52:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503081352.t28Dq84T045524@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 8 Mar 2015 13:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279778 - in head/sys: arm/broadcom/bcm2835 dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 13:52:10 -0000 Author: andrew Date: Sun Mar 8 13:52:07 2015 New Revision: 279778 URL: https://svnweb.freebsd.org/changeset/base/279778 Log: Add support for enabling the USB on the Raspberry Pi boards when it hasn't been done by U-Boot. This allows the USB to work when we load the kernel directly. No dma sync is performed after these operations as the data we read/write is not used by the cpu after the calls to the maimbox driver. Differential Revision: https://reviews.freebsd.org/D1940 Reviewed by: imp, Michal Meloun (meloun AT miracle.cz) MFC after: 1 Week Sponsored by: ABT Systems Ltd Added: head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c (contents, props changed) head/sys/dev/usb/controller/dwc_otg_fdt.h (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/dev/usb/controller/dwc_otg_fdt.c Added: head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c Sun Mar 8 13:52:07 2015 (r279778) @@ -0,0 +1,176 @@ +/* + * Copyright 2015 Andrew Turner. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "mbox_if.h" + +static device_probe_t bcm283x_dwc_otg_probe; +static device_attach_t bcm283x_dwc_otg_attach; + +static int +bcm283x_dwc_otg_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-usb")) + return (ENXIO); + + device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (bcm283x)"); + + return (BUS_PROBE_VENDOR); +} + +static void +bcm283x_dwc_otg_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) +{ + bus_addr_t *addr; + + if (err) + return; + addr = (bus_addr_t *)arg; + *addr = PHYS_TO_VCBUS(segs[0].ds_addr); +} + +static int +bcm283x_dwc_otg_attach(device_t dev) +{ + struct msg_set_power_state *msg; + bus_dma_tag_t msg_tag; + bus_dmamap_t msg_map; + bus_addr_t msg_phys; + void *msg_buf; + uint32_t reg; + device_t mbox; + int err; + + /* get mbox device */ + mbox = devclass_get_device(devclass_find("mbox"), 0); + if (mbox == NULL) { + device_printf(dev, "can't find mbox\n"); + return (ENXIO); + } + + err = bus_dma_tag_create(bus_get_dma_tag(dev), 16, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + sizeof(struct msg_set_power_state), 1, + sizeof(struct msg_set_power_state), 0, + NULL, NULL, &msg_tag); + if (err != 0) { + device_printf(dev, "can't create DMA tag\n"); + return (ENXIO); + } + + err = bus_dmamem_alloc(msg_tag, (void **)&msg_buf, 0, &msg_map); + if (err != 0) { + bus_dma_tag_destroy(msg_tag); + device_printf(dev, "can't allocate dmamem\n"); + return (ENXIO); + } + + err = bus_dmamap_load(msg_tag, msg_map, msg_buf, + sizeof(struct msg_set_power_state), bcm283x_dwc_otg_cb, + &msg_phys, 0); + if (err != 0) { + bus_dmamem_free(msg_tag, msg_buf, msg_map); + bus_dma_tag_destroy(msg_tag); + device_printf(dev, "can't load DMA map\n"); + return (ENXIO); + } + + msg = msg_buf; + + memset(msg, 0, sizeof(*msg)); + msg->hdr.buf_size = sizeof(*msg); + msg->hdr.code = BCM2835_MBOX_CODE_REQ; + msg->tag_hdr.tag = BCM2835_MBOX_TAG_SET_POWER_STATE; + msg->tag_hdr.val_buf_size = sizeof(msg->body); + msg->tag_hdr.val_len = sizeof(msg->body.req); + msg->body.req.device_id = BCM2835_MBOX_POWER_ID_USB_HCD; + msg->body.req.state = BCM2835_MBOX_POWER_ON | BCM2835_MBOX_POWER_WAIT; + msg->end_tag = 0; + + bus_dmamap_sync(msg_tag, msg_map, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + + MBOX_WRITE(mbox, BCM2835_MBOX_CHAN_PROP, (uint32_t)msg_phys); + MBOX_READ(mbox, BCM2835_MBOX_CHAN_PROP, ®); + + bus_dmamap_unload(msg_tag, msg_map); + bus_dmamem_free(msg_tag, msg_buf, msg_map); + bus_dma_tag_destroy(msg_tag); + + return (dwc_otg_attach(dev)); +} + +static device_method_t bcm283x_dwc_otg_methods[] = { + /* bus interface */ + DEVMETHOD(device_probe, bcm283x_dwc_otg_probe), + DEVMETHOD(device_attach, bcm283x_dwc_otg_attach), + + DEVMETHOD_END +}; + +static devclass_t bcm283x_dwc_otg_devclass; + +DEFINE_CLASS_1(bcm283x_dwcotg, bcm283x_dwc_otg_driver, bcm283x_dwc_otg_methods, + sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver); +DRIVER_MODULE(bcm283x_dwcotg, simplebus, bcm283x_dwc_otg_driver, + bcm283x_dwc_otg_devclass, 0, 0); +MODULE_DEPEND(bcm283x_dwcotg, usb, 1, 1, 1); Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Sun Mar 8 11:19:41 2015 (r279777) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Sun Mar 8 13:52:07 2015 (r279778) @@ -15,6 +15,8 @@ arm/broadcom/bcm2835/bcm2835_spi.c opti arm/broadcom/bcm2835/bcm2835_systimer.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard +arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt + arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/arm/bus_space_asm_generic.S standard Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg_fdt.c Sun Mar 8 11:19:41 2015 (r279777) +++ head/sys/dev/usb/controller/dwc_otg_fdt.c Sun Mar 8 13:52:07 2015 (r279778) @@ -53,15 +53,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include static device_probe_t dwc_otg_probe; -static device_attach_t dwc_otg_attach; static device_detach_t dwc_otg_detach; -struct dwc_otg_super_softc { - struct dwc_otg_softc sc_otg; /* must be first */ -}; - static int dwc_otg_probe(device_t dev) { @@ -74,13 +70,13 @@ dwc_otg_probe(device_t dev) device_set_desc(dev, "DWC OTG 2.0 integrated USB controller"); - return (0); + return (BUS_PROBE_DEFAULT); } -static int +int dwc_otg_attach(device_t dev) { - struct dwc_otg_super_softc *sc = device_get_softc(dev); + struct dwc_otg_fdt_softc *sc = device_get_softc(dev); char usb_mode[24]; int err; int rid; @@ -161,7 +157,7 @@ error: static int dwc_otg_detach(device_t dev) { - struct dwc_otg_super_softc *sc = device_get_softc(dev); + struct dwc_otg_fdt_softc *sc = device_get_softc(dev); device_t bdev; int err; @@ -212,10 +208,10 @@ static device_method_t dwc_otg_methods[] DEVMETHOD_END }; -static driver_t dwc_otg_driver = { +driver_t dwc_otg_driver = { .name = "dwcotg", .methods = dwc_otg_methods, - .size = sizeof(struct dwc_otg_super_softc), + .size = sizeof(struct dwc_otg_fdt_softc), }; static devclass_t dwc_otg_devclass; Added: head/sys/dev/usb/controller/dwc_otg_fdt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/dwc_otg_fdt.h Sun Mar 8 13:52:07 2015 (r279778) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2012 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DWC_OTG_FDT_H_ +#define _DWC_OTG_FDT_H_ + +struct dwc_otg_fdt_softc { + struct dwc_otg_softc sc_otg; /* must be first */ +}; + +extern driver_t dwc_otg_driver; + +device_attach_t dwc_otg_attach; + +#endif From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 14:12:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FD7A7B2; Sun, 8 Mar 2015 14:12:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 80F662B1; Sun, 8 Mar 2015 14:12:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28ECjWZ054940; Sun, 8 Mar 2015 14:12:45 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28ECidf054935; Sun, 8 Mar 2015 14:12:44 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201503081412.t28ECidf054935@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 8 Mar 2015 14:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279779 - in head: tools/regression/usr.bin/env usr.bin/env X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 14:12:45 -0000 Author: jilles Date: Sun Mar 8 14:12:43 2015 New Revision: 279779 URL: https://svnweb.freebsd.org/changeset/base/279779 Log: env: Fix crash when -S string is not empty but no operand follows. split_spaces() set argc in main() incorrectly, which caused trouble for getopt(). Examples: env -S '\c' env -S -i PR: 197769 MFC after: 1 week Modified: head/tools/regression/usr.bin/env/regress-env.rgdata head/tools/regression/usr.bin/env/regress-sb.rb head/usr.bin/env/envopts.c Modified: head/tools/regression/usr.bin/env/regress-env.rgdata ============================================================================== --- head/tools/regression/usr.bin/env/regress-env.rgdata Sun Mar 8 13:52:07 2015 (r279778) +++ head/tools/regression/usr.bin/env/regress-env.rgdata Sun Mar 8 14:12:43 2015 (r279779) @@ -382,3 +382,36 @@ gblenv=OUTSIDEVAR=OutsideValue setenv:D=D_ThisisAlongstring_D1 stdout:A_ThisisAlongstring_A1 B_ThisisAlongstring_B1 C_ThisisAlongstring_C1 D_ThisisAlongstring_D1 ScriptName: [%-script.pathname-%] [run] + +[test] + sb_args:sh + script:[%-testpgm.pathname-%] -S '\c' >/dev/null +[run] +[test] + sb_args:sh + script:[%-testpgm.pathname-%] -S'\c' >/dev/null +[run] +[test] + sb_args:sh + script:[%-testpgm.pathname-%] -u foo -S '\c' >/dev/null +[run] +[test] + sb_args:sh + script:[%-testpgm.pathname-%] -u foo -S'\c' >/dev/null +[run] +[test] + sb_args:sh + script:[%-testpgm.pathname-%] -S '-u bar \c' >/dev/null +[run] +[test] + sb_args:sh + script:[%-testpgm.pathname-%] -S'-u bar \c' >/dev/null +[run] +[test] + sb_args:sh + script:[%-testpgm.pathname-%] -u foo -S '-u bar \c' >/dev/null +[run] +[test] + sb_args:sh + script:[%-testpgm.pathname-%] -u foo -S'-u bar \c' >/dev/null +[run] Modified: head/tools/regression/usr.bin/env/regress-sb.rb ============================================================================== --- head/tools/regression/usr.bin/env/regress-sb.rb Sun Mar 8 13:52:07 2015 (r279778) +++ head/tools/regression/usr.bin/env/regress-sb.rb Sun Mar 8 14:12:43 2015 (r279779) @@ -346,6 +346,7 @@ class RGTestOptions # "just anything" that matches the general pattern. There are # no blanks in the recognized values, but I use an x-tended # regexp and then add blanks to make it more readable. + optval.gsub!(/\[%- testpgm\.pathname -%\]/x, $testpgm) optval.gsub!(/\[%- testpgm\.basename -%\]/x, File.basename($testpgm)) optval.gsub!(/\[%- script\.pathname -%\]/x, $scriptfile) Modified: head/usr.bin/env/envopts.c ============================================================================== --- head/usr.bin/env/envopts.c Sun Mar 8 13:52:07 2015 (r279778) +++ head/usr.bin/env/envopts.c Sun Mar 8 14:12:43 2015 (r279779) @@ -372,9 +372,9 @@ str_done: *nextarg = NULL; /* Update optind/argc/argv in the calling routine */ - *origind = 1; - *origc += addcount; + *origc += addcount - *origind + 1; *origv = newargv; + *origind = 1; } /** From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 14:15:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 322F7961; Sun, 8 Mar 2015 14:15:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 1DE832E4; Sun, 8 Mar 2015 14:15:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28EFwVb055452; Sun, 8 Mar 2015 14:15:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28EFwFR055450; Sun, 8 Mar 2015 14:15:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503081415.t28EFwFR055450@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 8 Mar 2015 14:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279780 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 14:15:59 -0000 Author: andrew Date: Sun Mar 8 14:15:57 2015 New Revision: 279780 URL: https://svnweb.freebsd.org/changeset/base/279780 Log: Call config_intrhook_disestablish on failure of the bcm2835 fb and fbd intr hooks. With this we can get through the boot even if these functions fail. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sun Mar 8 14:12:43 2015 (r279779) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sun Mar 8 14:15:57 2015 (r279780) @@ -240,7 +240,6 @@ bcm_fb_init(void *arg) } else { device_printf(sc->dev, "Failed to set framebuffer info\n"); - return; } config_intrhook_disestablish(&sc->init_hook); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sun Mar 8 14:12:43 2015 (r279779) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sun Mar 8 14:15:57 2015 (r279780) @@ -186,17 +186,12 @@ bcm_fb_init(void *arg) fbd = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev)); - if (fbd == NULL) { + if (fbd == NULL) device_printf(sc->dev, "Failed to add fbd child\n"); - return; - } - if (device_probe_and_attach(fbd) != 0) { + else if (device_probe_and_attach(fbd) != 0) device_printf(sc->dev, "Failed to attach fbd device\n"); - return; - } } else { device_printf(sc->dev, "Failed to set framebuffer info\n"); - return; } config_intrhook_disestablish(&sc->init_hook); From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 16:50:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 321B0ECE; Sun, 8 Mar 2015 16:50:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 1CBC9280; Sun, 8 Mar 2015 16:50:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28GokPk027219; Sun, 8 Mar 2015 16:50:46 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28Goknk027218; Sun, 8 Mar 2015 16:50:46 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503081650.t28Goknk027218@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 8 Mar 2015 16:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279782 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 16:50:47 -0000 Author: nwhitehorn Date: Sun Mar 8 16:50:45 2015 New Revision: 279782 URL: https://svnweb.freebsd.org/changeset/base/279782 Log: Provide $FreeBSD$ in the standard way. This fixes the build with clang 3.6. Modified: head/sys/powerpc/powerpc/syncicache.c Modified: head/sys/powerpc/powerpc/syncicache.c ============================================================================== --- head/sys/powerpc/powerpc/syncicache.c Sun Mar 8 15:03:38 2015 (r279781) +++ head/sys/powerpc/powerpc/syncicache.c Sun Mar 8 16:50:45 2015 (r279782) @@ -31,10 +31,8 @@ * $NetBSD: syncicache.c,v 1.2 1999/05/05 12:36:40 tsubai Exp $ */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); #include #if defined(_KERNEL) || defined(_STANDALONE) From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 17:34:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D4F9AAA; Sun, 8 Mar 2015 17:34:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6881D937; Sun, 8 Mar 2015 17:34:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28HY7AV049589; Sun, 8 Mar 2015 17:34:07 GMT (envelope-from marck@FreeBSD.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28HY7pG049588; Sun, 8 Mar 2015 17:34:07 GMT (envelope-from marck@FreeBSD.org) Message-Id: <201503081734.t28HY7pG049588@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marck set sender to marck@FreeBSD.org using -f From: Dmitry Morozovsky Date: Sun, 8 Mar 2015 17:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279783 - head/usr.bin/ctlstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 17:34:07 -0000 Author: marck (doc committer) Date: Sun Mar 8 17:34:06 2015 New Revision: 279783 URL: https://svnweb.freebsd.org/changeset/base/279783 Log: Correct wordings a bit. MFC after: 1 week Modified: head/usr.bin/ctlstat/ctlstat.8 Modified: head/usr.bin/ctlstat/ctlstat.8 ============================================================================== --- head/usr.bin/ctlstat/ctlstat.8 Sun Mar 8 16:50:45 2015 (r279782) +++ head/usr.bin/ctlstat/ctlstat.8 Sun Mar 8 17:34:06 2015 (r279783) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.bin/ctlstat/ctlstat.8#2 $ .\" $FreeBSD$ .\" -.Dd March 6, 2013 +.Dd March 8, 2015 .Dt CTLSTAT 8 .Os .Sh NAME @@ -69,7 +69,7 @@ and a combined total column that also in .It Fl c Ar count Display statistics this many times. .It Fl C -Disable display of CPU statistics. +Disable CPU statistics. .It Fl d Display DMA operation time (latency) instead of overall I/O time (latency). .It Fl D From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 19:37:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA5FB25B; Sun, 8 Mar 2015 19:37:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 D4052A76; Sun, 8 Mar 2015 19:37:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28JbAjn009191; Sun, 8 Mar 2015 19:37:10 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28Jb923009184; Sun, 8 Mar 2015 19:37:09 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503081937.t28Jb923009184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 8 Mar 2015 19:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279784 - in head/lib/libc: powerpc/gen powerpc64/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 19:37:11 -0000 Author: nwhitehorn Date: Sun Mar 8 19:37:08 2015 New Revision: 279784 URL: https://svnweb.freebsd.org/changeset/base/279784 Log: Save and restore non-volatile floating-point registers during longjmp(). This should also save and restore non-volatile Altivec registers, but that needs to wait on solving two problems: 1. Adding the nonvolatile vector registers means we need 5 more than _JBLEN entries in jmp_buf on 32-bit targets (64-bit is OK). 2. Need to figure out how to determine if saving/restoring vector regs is supported on the current CPU from userland. MFC after: 1 month Modified: head/lib/libc/powerpc/gen/_setjmp.S head/lib/libc/powerpc/gen/setjmp.S head/lib/libc/powerpc/gen/sigsetjmp.S head/lib/libc/powerpc64/gen/_setjmp.S head/lib/libc/powerpc64/gen/setjmp.S head/lib/libc/powerpc64/gen/sigsetjmp.S Modified: head/lib/libc/powerpc/gen/_setjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/_setjmp.S Sun Mar 8 17:34:06 2015 (r279783) +++ head/lib/libc/powerpc/gen/_setjmp.S Sun Mar 8 19:37:08 2015 (r279784) @@ -56,12 +56,54 @@ ENTRY(_setjmp) mr %r10,%r1 mr %r9,%r2 stmw %r9,20(%r3) + + /* FPRs */ + stfd %f14,92+0*8(%r3) + stfd %f15,92+1*8(%r3) + stfd %f16,92+2*8(%r3) + stfd %f17,92+3*8(%r3) + stfd %f18,92+4*8(%r3) + stfd %f19,92+5*8(%r3) + stfd %f20,92+6*8(%r3) + stfd %f21,92+7*8(%r3) + stfd %f22,92+8*8(%r3) + stfd %f23,92+9*8(%r3) + stfd %f24,92+10*8(%r3) + stfd %f25,92+11*8(%r3) + stfd %f26,92+12*8(%r3) + stfd %f27,92+13*8(%r3) + stfd %f28,93+13*8(%r3) + stfd %f29,93+14*8(%r3) + stfd %f30,93+15*8(%r3) + stfd %f31,93+16*8(%r3) + li %r3,0 blr END(_setjmp) ENTRY(_longjmp) lmw %r9,20(%r3) + + /* FPRs */ + lfd %f14,92+0*8(%r3) + lfd %f15,92+1*8(%r3) + lfd %f16,92+2*8(%r3) + lfd %f17,92+3*8(%r3) + lfd %f18,92+4*8(%r3) + lfd %f19,92+5*8(%r3) + lfd %f20,92+6*8(%r3) + lfd %f21,92+7*8(%r3) + lfd %f22,92+8*8(%r3) + lfd %f23,92+9*8(%r3) + lfd %f24,92+10*8(%r3) + lfd %f25,92+11*8(%r3) + lfd %f26,92+12*8(%r3) + lfd %f27,92+13*8(%r3) + lfd %f28,93+13*8(%r3) + lfd %f29,93+14*8(%r3) + lfd %f30,93+15*8(%r3) + lfd %f31,93+16*8(%r3) + mtlr %r11 mtcr %r12 mr %r1,%r10 Modified: head/lib/libc/powerpc/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/setjmp.S Sun Mar 8 17:34:06 2015 (r279783) +++ head/lib/libc/powerpc/gen/setjmp.S Sun Mar 8 19:37:08 2015 (r279784) @@ -66,6 +66,27 @@ ENTRY(setjmp) mr %r10,%r1 /* r10 <- stackptr */ mr %r9,%r2 /* r9 <- global ptr */ stmw %r9,20(%r6) + + /* FPRs */ + stfd %f14,92+0*8(%r6) + stfd %f15,92+1*8(%r6) + stfd %f16,92+2*8(%r6) + stfd %f17,92+3*8(%r6) + stfd %f18,92+4*8(%r6) + stfd %f19,92+5*8(%r6) + stfd %f20,92+6*8(%r6) + stfd %f21,92+7*8(%r6) + stfd %f22,92+8*8(%r6) + stfd %f23,92+9*8(%r6) + stfd %f24,92+10*8(%r6) + stfd %f25,92+11*8(%r6) + stfd %f26,92+12*8(%r6) + stfd %f27,92+13*8(%r6) + stfd %f28,93+13*8(%r6) + stfd %f29,93+14*8(%r6) + stfd %f30,93+15*8(%r6) + stfd %f31,93+16*8(%r6) + li %r3,0 /* return (0) */ blr END(setjmp) @@ -73,6 +94,27 @@ END(setjmp) WEAK_REFERENCE(CNAME(__longjmp), longjmp) ENTRY(__longjmp) lmw %r9,20(%r3) /* restore regs */ + + /* FPRs */ + lfd %f14,92+0*8(%r3) + lfd %f15,92+1*8(%r3) + lfd %f16,92+2*8(%r3) + lfd %f17,92+3*8(%r3) + lfd %f18,92+4*8(%r3) + lfd %f19,92+5*8(%r3) + lfd %f20,92+6*8(%r3) + lfd %f21,92+7*8(%r3) + lfd %f22,92+8*8(%r3) + lfd %f23,92+9*8(%r3) + lfd %f24,92+10*8(%r3) + lfd %f25,92+11*8(%r3) + lfd %f26,92+12*8(%r3) + lfd %f27,92+13*8(%r3) + lfd %f28,93+13*8(%r3) + lfd %f29,93+14*8(%r3) + lfd %f30,93+15*8(%r3) + lfd %f31,93+16*8(%r3) + mr %r6,%r4 /* save val param */ mtlr %r11 /* r11 -> link reg */ mtcr %r12 /* r12 -> condition reg */ Modified: head/lib/libc/powerpc/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/sigsetjmp.S Sun Mar 8 17:34:06 2015 (r279783) +++ head/lib/libc/powerpc/gen/sigsetjmp.S Sun Mar 8 19:37:08 2015 (r279784) @@ -71,12 +71,54 @@ ENTRY(sigsetjmp) mr %r10,%r1 mr %r9,%r2 stmw %r9,20(%r6) + + /* FPRs */ + stfd %f14,92+0*8(%r6) + stfd %f15,92+1*8(%r6) + stfd %f16,92+2*8(%r6) + stfd %f17,92+3*8(%r6) + stfd %f18,92+4*8(%r6) + stfd %f19,92+5*8(%r6) + stfd %f20,92+6*8(%r6) + stfd %f21,92+7*8(%r6) + stfd %f22,92+8*8(%r6) + stfd %f23,92+9*8(%r6) + stfd %f24,92+10*8(%r6) + stfd %f25,92+11*8(%r6) + stfd %f26,92+12*8(%r6) + stfd %f27,92+13*8(%r6) + stfd %f28,93+13*8(%r6) + stfd %f29,93+14*8(%r6) + stfd %f30,93+15*8(%r6) + stfd %f31,93+16*8(%r6) + li %r3,0 blr END(sigsetjmp) ENTRY(siglongjmp) lmw %r9,20(%r3) + + /* FPRs */ + lfd %f14,92+0*8(%r3) + lfd %f15,92+1*8(%r3) + lfd %f16,92+2*8(%r3) + lfd %f17,92+3*8(%r3) + lfd %f18,92+4*8(%r3) + lfd %f19,92+5*8(%r3) + lfd %f20,92+6*8(%r3) + lfd %f21,92+7*8(%r3) + lfd %f22,92+8*8(%r3) + lfd %f23,92+9*8(%r3) + lfd %f24,92+10*8(%r3) + lfd %f25,92+11*8(%r3) + lfd %f26,92+12*8(%r3) + lfd %f27,92+13*8(%r3) + lfd %f28,93+13*8(%r3) + lfd %f29,93+14*8(%r3) + lfd %f30,93+15*8(%r3) + lfd %f31,93+16*8(%r3) + lwz %r7,0(%r3) mr %r6,%r4 mtlr %r11 Modified: head/lib/libc/powerpc64/gen/_setjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/_setjmp.S Sun Mar 8 17:34:06 2015 (r279783) +++ head/lib/libc/powerpc64/gen/_setjmp.S Sun Mar 8 19:37:08 2015 (r279784) @@ -56,23 +56,41 @@ ENTRY(_setjmp) mr %r10,%r1 mr %r9,%r2 std %r9,40 + 0*8(%r3) + stfd %f14,40 + 23*8(%r3) std %r10,40 + 1*8(%r3) + stfd %f15,40 + 24*8(%r3) std %r11,40 + 2*8(%r3) + stfd %f16,40 + 25*8(%r3) std %r12,40 + 3*8(%r3) + stfd %f17,40 + 26*8(%r3) std %r13,40 + 4*8(%r3) + stfd %f18,40 + 27*8(%r3) std %r14,40 + 5*8(%r3) + stfd %f19,40 + 28*8(%r3) std %r15,40 + 6*8(%r3) + stfd %f20,40 + 29*8(%r3) std %r16,40 + 7*8(%r3) + stfd %f21,40 + 30*8(%r3) std %r17,40 + 8*8(%r3) + stfd %f22,40 + 31*8(%r3) std %r18,40 + 9*8(%r3) + stfd %f23,40 + 32*8(%r3) std %r19,40 + 10*8(%r3) + stfd %f24,40 + 33*8(%r3) std %r20,40 + 11*8(%r3) + stfd %f25,40 + 34*8(%r3) std %r21,40 + 12*8(%r3) + stfd %f26,40 + 35*8(%r3) std %r22,40 + 13*8(%r3) + stfd %f27,40 + 36*8(%r3) std %r23,40 + 14*8(%r3) + stfd %f28,40 + 37*8(%r3) std %r24,40 + 15*8(%r3) + stfd %f29,40 + 38*8(%r3) std %r25,40 + 16*8(%r3) + stfd %f30,40 + 39*8(%r3) std %r26,40 + 17*8(%r3) + stfd %f31,40 + 40*8(%r3) std %r27,40 + 18*8(%r3) std %r28,40 + 19*8(%r3) std %r29,40 + 20*8(%r3) @@ -84,23 +102,41 @@ END(_setjmp) ENTRY(_longjmp) ld %r9,40 + 0*8(%r3) + lfd %f14,40 + 23*8(%r3) ld %r10,40 + 1*8(%r3) + lfd %f15,40 + 24*8(%r3) ld %r11,40 + 2*8(%r3) + lfd %f16,40 + 25*8(%r3) ld %r12,40 + 3*8(%r3) + lfd %f17,40 + 26*8(%r3) ld %r14,40 + 5*8(%r3) + lfd %f18,40 + 27*8(%r3) ld %r15,40 + 6*8(%r3) + lfd %f19,40 + 28*8(%r3) ld %r16,40 + 7*8(%r3) + lfd %f20,40 + 29*8(%r3) ld %r17,40 + 8*8(%r3) + lfd %f21,40 + 30*8(%r3) ld %r18,40 + 9*8(%r3) + lfd %f22,40 + 31*8(%r3) ld %r19,40 + 10*8(%r3) + lfd %f23,40 + 32*8(%r3) ld %r20,40 + 11*8(%r3) + lfd %f24,40 + 33*8(%r3) ld %r21,40 + 12*8(%r3) + lfd %f25,40 + 34*8(%r3) ld %r22,40 + 13*8(%r3) + lfd %f26,40 + 35*8(%r3) ld %r23,40 + 14*8(%r3) + lfd %f27,40 + 36*8(%r3) ld %r24,40 + 15*8(%r3) + lfd %f28,40 + 37*8(%r3) ld %r25,40 + 16*8(%r3) + lfd %f29,40 + 38*8(%r3) ld %r26,40 + 17*8(%r3) + lfd %f30,40 + 39*8(%r3) ld %r27,40 + 18*8(%r3) + lfd %f31,40 + 40*8(%r3) ld %r28,40 + 19*8(%r3) ld %r29,40 + 20*8(%r3) ld %r30,40 + 21*8(%r3) Modified: head/lib/libc/powerpc64/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/setjmp.S Sun Mar 8 17:34:06 2015 (r279783) +++ head/lib/libc/powerpc64/gen/setjmp.S Sun Mar 8 19:37:08 2015 (r279784) @@ -67,29 +67,49 @@ ENTRY(setjmp) mr %r9,%r2 /* r9 <- global ptr */ std %r9,40 + 0*8(%r6) + stfd %f14,40 + 23*8(%r6) std %r10,40 + 1*8(%r6) + stfd %f15,40 + 24*8(%r6) std %r11,40 + 2*8(%r6) + stfd %f16,40 + 25*8(%r6) std %r12,40 + 3*8(%r6) + stfd %f17,40 + 26*8(%r6) std %r13,40 + 4*8(%r6) + stfd %f18,40 + 27*8(%r6) std %r14,40 + 5*8(%r6) + stfd %f19,40 + 28*8(%r6) std %r15,40 + 6*8(%r6) + stfd %f20,40 + 29*8(%r6) std %r16,40 + 7*8(%r6) + stfd %f21,40 + 30*8(%r6) std %r17,40 + 8*8(%r6) + stfd %f22,40 + 31*8(%r6) std %r18,40 + 9*8(%r6) + stfd %f23,40 + 32*8(%r6) std %r19,40 + 10*8(%r6) + stfd %f24,40 + 33*8(%r6) std %r20,40 + 11*8(%r6) + stfd %f25,40 + 34*8(%r6) std %r21,40 + 12*8(%r6) + stfd %f26,40 + 35*8(%r6) std %r22,40 + 13*8(%r6) + stfd %f27,40 + 36*8(%r6) std %r23,40 + 14*8(%r6) + stfd %f28,40 + 37*8(%r6) std %r24,40 + 15*8(%r6) + stfd %f29,40 + 38*8(%r6) std %r25,40 + 16*8(%r6) + stfd %f30,40 + 39*8(%r6) std %r26,40 + 17*8(%r6) + stfd %f31,40 + 40*8(%r6) std %r27,40 + 18*8(%r6) std %r28,40 + 19*8(%r6) std %r29,40 + 20*8(%r6) std %r30,40 + 21*8(%r6) std %r31,40 + 22*8(%r6) + /* XXX Altivec regs */ + li %r3,0 /* return (0) */ blr END(setjmp) @@ -97,23 +117,41 @@ END(setjmp) WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) ld %r9,40 + 0*8(%r3) + lfd %f14,40 + 23*8(%r3) ld %r10,40 + 1*8(%r3) + lfd %f15,40 + 24*8(%r3) ld %r11,40 + 2*8(%r3) + lfd %f16,40 + 25*8(%r3) ld %r12,40 + 3*8(%r3) + lfd %f17,40 + 26*8(%r3) ld %r14,40 + 5*8(%r3) + lfd %f18,40 + 27*8(%r3) ld %r15,40 + 6*8(%r3) + lfd %f19,40 + 28*8(%r3) ld %r16,40 + 7*8(%r3) + lfd %f20,40 + 29*8(%r3) ld %r17,40 + 8*8(%r3) + lfd %f21,40 + 30*8(%r3) ld %r18,40 + 9*8(%r3) + lfd %f22,40 + 31*8(%r3) ld %r19,40 + 10*8(%r3) + lfd %f23,40 + 32*8(%r3) ld %r20,40 + 11*8(%r3) + lfd %f24,40 + 33*8(%r3) ld %r21,40 + 12*8(%r3) + lfd %f25,40 + 34*8(%r3) ld %r22,40 + 13*8(%r3) + lfd %f26,40 + 35*8(%r3) ld %r23,40 + 14*8(%r3) + lfd %f27,40 + 36*8(%r3) ld %r24,40 + 15*8(%r3) + lfd %f28,40 + 37*8(%r3) ld %r25,40 + 16*8(%r3) + lfd %f29,40 + 38*8(%r3) ld %r26,40 + 17*8(%r3) + lfd %f30,40 + 39*8(%r3) ld %r27,40 + 18*8(%r3) + lfd %f31,40 + 40*8(%r3) ld %r28,40 + 19*8(%r3) ld %r29,40 + 20*8(%r3) ld %r30,40 + 21*8(%r3) Modified: head/lib/libc/powerpc64/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/sigsetjmp.S Sun Mar 8 17:34:06 2015 (r279783) +++ head/lib/libc/powerpc64/gen/sigsetjmp.S Sun Mar 8 19:37:08 2015 (r279784) @@ -72,23 +72,41 @@ ENTRY(sigsetjmp) mr %r9,%r2 std %r9,40 + 0*8(%r6) + stfd %f14,40 + 23*8(%r6) std %r10,40 + 1*8(%r6) + stfd %f15,40 + 24*8(%r6) std %r11,40 + 2*8(%r6) + stfd %f16,40 + 25*8(%r6) std %r12,40 + 3*8(%r6) + stfd %f17,40 + 26*8(%r6) std %r13,40 + 4*8(%r6) + stfd %f18,40 + 27*8(%r6) std %r14,40 + 5*8(%r6) + stfd %f19,40 + 28*8(%r6) std %r15,40 + 6*8(%r6) + stfd %f20,40 + 29*8(%r6) std %r16,40 + 7*8(%r6) + stfd %f21,40 + 30*8(%r6) std %r17,40 + 8*8(%r6) + stfd %f22,40 + 31*8(%r6) std %r18,40 + 9*8(%r6) + stfd %f23,40 + 32*8(%r6) std %r19,40 + 10*8(%r6) + stfd %f24,40 + 33*8(%r6) std %r20,40 + 11*8(%r6) + stfd %f25,40 + 34*8(%r6) std %r21,40 + 12*8(%r6) + stfd %f26,40 + 35*8(%r6) std %r22,40 + 13*8(%r6) + stfd %f27,40 + 36*8(%r6) std %r23,40 + 14*8(%r6) + stfd %f28,40 + 37*8(%r6) std %r24,40 + 15*8(%r6) + stfd %f29,40 + 38*8(%r6) std %r25,40 + 16*8(%r6) + stfd %f30,40 + 39*8(%r6) std %r26,40 + 17*8(%r6) + stfd %f31,40 + 40*8(%r6) std %r27,40 + 18*8(%r6) std %r28,40 + 19*8(%r6) std %r29,40 + 20*8(%r6) @@ -101,23 +119,41 @@ END(sigsetjmp) ENTRY(siglongjmp) ld %r9,40 + 0*8(%r3) + lfd %f14,40 + 23*8(%r3) ld %r10,40 + 1*8(%r3) + lfd %f15,40 + 24*8(%r3) ld %r11,40 + 2*8(%r3) + lfd %f16,40 + 25*8(%r3) ld %r12,40 + 3*8(%r3) + lfd %f17,40 + 26*8(%r3) ld %r14,40 + 5*8(%r3) + lfd %f18,40 + 27*8(%r3) ld %r15,40 + 6*8(%r3) + lfd %f19,40 + 28*8(%r3) ld %r16,40 + 7*8(%r3) + lfd %f20,40 + 29*8(%r3) ld %r17,40 + 8*8(%r3) + lfd %f21,40 + 30*8(%r3) ld %r18,40 + 9*8(%r3) + lfd %f22,40 + 31*8(%r3) ld %r19,40 + 10*8(%r3) + lfd %f23,40 + 32*8(%r3) ld %r20,40 + 11*8(%r3) + lfd %f24,40 + 33*8(%r3) ld %r21,40 + 12*8(%r3) + lfd %f25,40 + 34*8(%r3) ld %r22,40 + 13*8(%r3) + lfd %f26,40 + 35*8(%r3) ld %r23,40 + 14*8(%r3) + lfd %f27,40 + 36*8(%r3) ld %r24,40 + 15*8(%r3) + lfd %f28,40 + 37*8(%r3) ld %r25,40 + 16*8(%r3) + lfd %f29,40 + 38*8(%r3) ld %r26,40 + 17*8(%r3) + lfd %f30,40 + 39*8(%r3) ld %r27,40 + 18*8(%r3) + lfd %f31,40 + 40*8(%r3) ld %r28,40 + 19*8(%r3) ld %r29,40 + 20*8(%r3) ld %r30,40 + 21*8(%r3) From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 19:50:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A544711; Sun, 8 Mar 2015 19:50:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 25323C07; Sun, 8 Mar 2015 19:50:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28JoVeA015180; Sun, 8 Mar 2015 19:50:31 GMT (envelope-from marck@FreeBSD.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28JoVHU015178; Sun, 8 Mar 2015 19:50:31 GMT (envelope-from marck@FreeBSD.org) Message-Id: <201503081950.t28JoVHU015178@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marck set sender to marck@FreeBSD.org using -f From: Dmitry Morozovsky Date: Sun, 8 Mar 2015 19:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279785 - head/usr.bin/ctlstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 19:50:31 -0000 Author: marck (doc committer) Date: Sun Mar 8 19:50:30 2015 New Revision: 279785 URL: https://svnweb.freebsd.org/changeset/base/279785 Log: Ouch, I've misread the original text. Still reword phrase a bit, hopefully in a bit less misleading form than before. MFC after: 1 week X-MFC-With: r279783 Pointy Hat to: marck Modified: head/usr.bin/ctlstat/ctlstat.8 Modified: head/usr.bin/ctlstat/ctlstat.8 ============================================================================== --- head/usr.bin/ctlstat/ctlstat.8 Sun Mar 8 19:37:08 2015 (r279784) +++ head/usr.bin/ctlstat/ctlstat.8 Sun Mar 8 19:50:30 2015 (r279785) @@ -69,7 +69,7 @@ and a combined total column that also in .It Fl c Ar count Display statistics this many times. .It Fl C -Disable CPU statistics. +Disable CPU statistics display. .It Fl d Display DMA operation time (latency) instead of overall I/O time (latency). .It Fl D From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 19:55:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8BED922; Sun, 8 Mar 2015 19:55:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 D383DCDD; Sun, 8 Mar 2015 19:55:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28JtlGV018635; Sun, 8 Mar 2015 19:55:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28JtlmV018634; Sun, 8 Mar 2015 19:55:47 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503081955.t28JtlmV018634@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 8 Mar 2015 19:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279786 - head/sys/dev/bge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 19:55:48 -0000 Author: pfg Date: Sun Mar 8 19:55:46 2015 New Revision: 279786 URL: https://svnweb.freebsd.org/changeset/base/279786 Log: bge(4): Small memory leak CID: 1229985 Reviewed by: marcel Differential Review: https://reviews.freebsd.org/D2024 Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Mar 8 19:50:30 2015 (r279785) +++ head/sys/dev/bge/if_bge.c Sun Mar 8 19:55:46 2015 (r279786) @@ -1637,6 +1637,7 @@ bge_setmulti(struct bge_softc *sc) if (if_getflags(ifp) & IFF_ALLMULTI || if_getflags(ifp) & IFF_PROMISC) { for (i = 0; i < 4; i++) CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), 0xFFFFFFFF); + free(mta, M_DEVBUF); return; } From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 21:11:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E8E8F8A; Sun, 8 Mar 2015 21:11:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 29A688D0; Sun, 8 Mar 2015 21:11:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28LB9BC055450; Sun, 8 Mar 2015 21:11:09 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28LB9mZ055449; Sun, 8 Mar 2015 21:11:09 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503082111.t28LB9mZ055449@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 8 Mar 2015 21:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279787 - head/usr.sbin/gpioctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 21:11:09 -0000 Author: loos Date: Sun Mar 8 21:11:08 2015 New Revision: 279787 URL: https://svnweb.freebsd.org/changeset/base/279787 Log: Put the new sentence on a new line. Found with igor. Modified: head/usr.sbin/gpioctl/gpioctl.8 Modified: head/usr.sbin/gpioctl/gpioctl.8 ============================================================================== --- head/usr.sbin/gpioctl/gpioctl.8 Sun Mar 8 19:55:46 2015 (r279786) +++ head/usr.sbin/gpioctl/gpioctl.8 Sun Mar 8 21:11:08 2015 (r279787) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2015 +.Dd March 8, 2015 .Dt GPIOCTL 1 .Os .Sh NAME @@ -65,7 +65,8 @@ utility could be used to manage GPIO pin The options are as follows: .Bl -tag -width ".Fl f Ar ctldev" .It Fl c Ar pin Ar flag Op flag ... -Configure pin by setting provided flags. The following flags are currently defined: +Configure pin by setting provided flags. +The following flags are currently defined: .Bl -tag -offset indent -width ".Cm PULSE" .It Cm IN Input pin From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 21:17:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72A8F352; Sun, 8 Mar 2015 21:17:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 5D090922; Sun, 8 Mar 2015 21:17:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28LHvcF057383; Sun, 8 Mar 2015 21:17:57 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28LHvwn057382; Sun, 8 Mar 2015 21:17:57 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503082117.t28LHvwn057382@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 8 Mar 2015 21:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279788 - head/lib/libgpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 21:17:57 -0000 Author: loos Date: Sun Mar 8 21:17:56 2015 New Revision: 279788 URL: https://svnweb.freebsd.org/changeset/base/279788 Log: Fix contraction and unnecessary commas in function arguments. Found with mandoc and igor. Modified: head/lib/libgpio/gpio.3 Modified: head/lib/libgpio/gpio.3 ============================================================================== --- head/lib/libgpio/gpio.3 Sun Mar 8 21:11:08 2015 (r279787) +++ head/lib/libgpio/gpio.3 Sun Mar 8 21:17:56 2015 (r279788) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2015 +.Dd March 8, 2015 .Dt GPIO 3 .Os .Sh NAME @@ -43,43 +43,43 @@ .Ft void .Fn gpio_close "gpio_handle_t handle" .Ft int -.Fn gpio_pin_list "gpio_handle_t handle, gpio_config_t **pcfgs" +.Fn gpio_pin_list "gpio_handle_t handle" "gpio_config_t **pcfgs" .Ft int -.Fn gpio_pin_config "gpio_handle_t handle, gpio_config_t *cfg" +.Fn gpio_pin_config "gpio_handle_t handle" "gpio_config_t *cfg" .Ft int -.Fn gpio_pin_set_name "gpio_handle_t handle, gpio_pin_t pin, char *name" +.Fn gpio_pin_set_name "gpio_handle_t handle" "gpio_pin_t pin" "char *name" .Ft int -.Fn gpio_pin_set_flags "gpio_handle_t handle, gpio_config_t *cfg" +.Fn gpio_pin_set_flags "gpio_handle_t handle" "gpio_config_t *cfg" .Ft gpio_value_t -.Fn gpio_pin_get "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_get "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_set "gpio_handle_t handle, gpio_pin_t pin, gpio_value_t value" +.Fn gpio_pin_set "gpio_handle_t handle" "gpio_pin_t pin" "gpio_value_t value" .Ft int -.Fn gpio_pin_toggle "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_toggle "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_low "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_low "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_high "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_high "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_input "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_input "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_output "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_output "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_opendrain "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_opendrain "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_pushpull "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_pushpull "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_tristate "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_tristate "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_pullup "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_pullup "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_pulldown "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_pulldown "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_invin "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_invin "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_invout "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_invout "gpio_handle_t handle" "gpio_pin_t pin" .Ft int -.Fn gpio_pin_pulsate "gpio_handle_t handle, gpio_pin_t pin" +.Fn gpio_pin_pulsate "gpio_handle_t handle" "gpio_pin_t pin" .Sh DESCRIPTION The .Nm libgpio @@ -101,7 +101,7 @@ This function takes a pointer to a which is dynamically allocated. This pointer should be freed with .Xr free 3 -when it's no longer necessary. +when it is no longer necessary. .Pp The function .Fn gpio_pin_config From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 21:51:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FC65DF; Sun, 8 Mar 2015 21:51:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 7AD7ACB5; Sun, 8 Mar 2015 21:51:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28LpcJj075056; Sun, 8 Mar 2015 21:51:38 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28Lpc6Y075055; Sun, 8 Mar 2015 21:51:38 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201503082151.t28Lpc6Y075055@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sun, 8 Mar 2015 21:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279789 - head/cddl/contrib/dtracetoolkit/Proc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 21:51:38 -0000 Author: gnn Date: Sun Mar 8 21:51:37 2015 New Revision: 279789 URL: https://svnweb.freebsd.org/changeset/base/279789 Log: Summary: Remove the need for `mpid which is Illumos/Solaris specific. Modified: head/cddl/contrib/dtracetoolkit/Proc/pidpersec.d Modified: head/cddl/contrib/dtracetoolkit/Proc/pidpersec.d ============================================================================== --- head/cddl/contrib/dtracetoolkit/Proc/pidpersec.d Sun Mar 8 21:17:56 2015 (r279788) +++ head/cddl/contrib/dtracetoolkit/Proc/pidpersec.d Sun Mar 8 21:51:37 2015 (r279789) @@ -41,7 +41,7 @@ dtrace:::BEGIN { - printf("%-22s %8s %6s\n", "TIME", "LASTPID", "PID/s"); + printf("%-22s %6s\n", "TIME", "PID/s"); pids = 0; } @@ -52,6 +52,6 @@ proc:::exec-success profile:::tick-1sec { - printf("%-22Y %8d %6d\n", walltimestamp, `mpid, pids); + printf("%-22Y %6d\n", walltimestamp, pids); pids = 0; } From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 21:59:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 958B826F; Sun, 8 Mar 2015 21:59:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 75DE0CE8; Sun, 8 Mar 2015 21:59:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28Lx58f076605; Sun, 8 Mar 2015 21:59:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28Lx3MT076594; Sun, 8 Mar 2015 21:59:03 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503082159.t28Lx3MT076594@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Mar 2015 21:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279790 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 21:59:05 -0000 Author: adrian Date: Sun Mar 8 21:59:03 2015 New Revision: 279790 URL: https://svnweb.freebsd.org/changeset/base/279790 Log: Add per-port vlan support for the AR8327. All the per-port support is really doing is applying a port visibility mask to each of the switchports. Everything still look like a single portgroup (vlan id 1), but the per-port visibility mask is modified. Whilst I'm here, also add some initial dot1q support - the pvid stuff is doing the right thing, but it's not useful without the rest of the VLAN table programming. It's enough for me to be able to use the LAN/WAN port distinction on the AP135, where there isn't (for now!) a dedicated PHY for the "WAN" port. Tested: * AP135, QCA9558 SoC + AR8327 switch Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.h head/sys/dev/etherswitch/arswitch/arswitchreg.h head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Sun Mar 8 21:51:37 2015 (r279789) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Sun Mar 8 21:59:03 2015 (r279790) @@ -303,14 +303,24 @@ arswitch_attach(device_t dev) sc->hal.arswitch_port_vlan_setup = ar8xxx_port_vlan_setup; sc->hal.arswitch_port_vlan_get = ar8xxx_port_vlan_get; sc->hal.arswitch_vlan_init_hw = ar8xxx_reset_vlans; + sc->hal.arswitch_vlan_getvgroup = ar8xxx_getvgroup; sc->hal.arswitch_vlan_setvgroup = ar8xxx_setvgroup; + sc->hal.arswitch_vlan_get_pvid = ar8xxx_get_pvid; sc->hal.arswitch_vlan_set_pvid = ar8xxx_set_pvid; + + sc->hal.arswitch_get_dot1q_vlan = ar8xxx_get_dot1q_vlan; + sc->hal.arswitch_set_dot1q_vlan = ar8xxx_set_dot1q_vlan; + sc->hal.arswitch_get_port_vlan = ar8xxx_get_port_vlan; + sc->hal.arswitch_set_port_vlan = ar8xxx_set_port_vlan; + sc->hal.arswitch_atu_flush = ar8xxx_atu_flush; + sc->hal.arswitch_phy_read = arswitch_readphy_internal; sc->hal.arswitch_phy_write = arswitch_writephy_internal; + /* * Attach switch related functions */ @@ -627,6 +637,15 @@ ar8xxx_port_vlan_get(struct arswitch_sof } static int +arswitch_is_cpuport(struct arswitch_softc *sc, int port) +{ + + return ((port == AR8X16_PORT_CPU) || + ((AR8X16_IS_SWITCH(sc, AR8327) && + port == AR8327_PORT_GMAC6))); +} + +static int arswitch_getport(device_t dev, etherswitch_port_t *p) { struct arswitch_softc *sc; @@ -635,7 +654,8 @@ arswitch_getport(device_t dev, etherswit int err; sc = device_get_softc(dev); - if (p->es_port < 0 || p->es_port > sc->numphys) + /* XXX +1 is for AR8327; should make this configurable! */ + if (p->es_port < 0 || p->es_port > sc->info.es_nports) return (ENXIO); err = sc->hal.arswitch_port_vlan_get(sc, p); @@ -643,7 +663,7 @@ arswitch_getport(device_t dev, etherswit return (err); mii = arswitch_miiforport(sc, p->es_port); - if (p->es_port == AR8X16_PORT_CPU) { + if (arswitch_is_cpuport(sc, p->es_port)) { /* fill in fixed values for CPU port */ /* XXX is this valid in all cases? */ p->es_flags |= ETHERSWITCH_PORT_CPU; @@ -712,7 +732,7 @@ arswitch_setport(device_t dev, etherswit struct ifnet *ifp; sc = device_get_softc(dev); - if (p->es_port < 0 || p->es_port > sc->numphys) + if (p->es_port < 0 || p->es_port > sc->info.es_nports) return (ENXIO); /* Port flags. */ @@ -723,7 +743,7 @@ arswitch_setport(device_t dev, etherswit } /* Do not allow media changes on CPU port. */ - if (p->es_port == AR8X16_PORT_CPU) + if (arswitch_is_cpuport(sc, p->es_port)) return (0); mii = arswitch_miiforport(sc, p->es_port); Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 8 21:51:37 2015 (r279789) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 8 21:59:03 2015 (r279790) @@ -655,7 +655,8 @@ ar8327_hw_global_setup(struct arswitch_s arswitch_writereg(sc->sc_dev, AR8327_REG_EEE_CTRL, t); /* Set the right number of ports */ - sc->info.es_nports = 6; + /* GMAC0 (CPU), GMAC1..5 (PHYs), GMAC6 (CPU) */ + sc->info.es_nports = 7; return (0); } @@ -712,8 +713,20 @@ static int ar8327_port_vlan_setup(struct arswitch_softc *sc, etherswitch_port_t *p) { - /* XXX stub for now */ -// device_printf(sc->sc_dev, "%s: called\n", __func__); + /* Check: ADDTAG/STRIPTAG - exclusive */ + + ARSWITCH_LOCK(sc); + + /* Set the PVID. */ + if (p->es_pvid != 0) + sc->hal.arswitch_vlan_set_pvid(sc, p->es_port, p->es_pvid); + + /* + * DOUBLE_TAG + * VLAN_MODE_ADD + * VLAN_MODE_STRIP + */ + ARSWITCH_UNLOCK(sc); return (0); } @@ -723,8 +736,20 @@ ar8327_port_vlan_setup(struct arswitch_s static int ar8327_port_vlan_get(struct arswitch_softc *sc, etherswitch_port_t *p) { - /* XXX stub for now */ -// device_printf(sc->sc_dev, "%s: called\n", __func__); + + ARSWITCH_LOCK(sc); + + /* Retrieve the PVID */ + sc->hal.arswitch_vlan_get_pvid(sc, p->es_port, &p->es_pvid); + + /* Retrieve the current port configuration */ + /* + * DOUBLE_TAG + * VLAN_MODE_ADD + * VLAN_MODE_STRIP + */ + + ARSWITCH_UNLOCK(sc); return (0); } @@ -764,7 +789,10 @@ ar8327_reset_vlans(struct arswitch_softc for (i = 0; i < AR8327_NUM_PORTS; i++) { - /* set pvid = 1; there's only one vlangroup */ + if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) + sc->vid[i] = i | ETHERSWITCH_VID_VALID; + + /* set pvid = 1; there's only one vlangroup to start with */ t = 1 << AR8327_PORT_VLAN0_DEF_SVID_S; t |= 1 << AR8327_PORT_VLAN0_DEF_CVID_S; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN0(i), t); @@ -802,44 +830,90 @@ ar8327_reset_vlans(struct arswitch_softc } static int +ar8327_vlan_get_port(struct arswitch_softc *sc, uint32_t *ports, int vid) +{ + int port; + uint32_t reg; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + + /* For port based vlans the vlanid is the same as the port index. */ + port = vid & ETHERSWITCH_VID_MASK; + reg = arswitch_readreg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(port)); + *ports = reg & 0x7f; + return (0); +} + +static int +ar8327_vlan_set_port(struct arswitch_softc *sc, uint32_t ports, int vid) +{ + int err, port; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + + /* For port based vlans the vlanid is the same as the port index. */ + port = vid & ETHERSWITCH_VID_MASK; + + err = arswitch_modifyreg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(port), + 0x7f, /* vlan membership mask */ + (ports & 0x7f)); + + if (err) + return (err); + return (0); +} + +static int ar8327_vlan_getvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) { -#if 0 /* XXX for now, no dot1q vlans */ if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) return (EINVAL); return (ar8xxx_getvgroup(sc, vg)); -#endif - return (0); } static int ar8327_vlan_setvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) { -#if 0 /* XXX for now, no dot1q vlans */ if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) return (EINVAL); return (ar8xxx_setvgroup(sc, vg)); -#endif - return (0); } static int ar8327_get_pvid(struct arswitch_softc *sc, int port, int *pvid) { + uint32_t reg; + + ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); + + /* + * XXX for now, assuming it's CVID; likely very wrong! + */ + port = port & ETHERSWITCH_VID_MASK; + reg = arswitch_readreg(sc->sc_dev, AR8327_REG_PORT_VLAN0(port)); + reg = reg >> AR8327_PORT_VLAN0_DEF_CVID_S; + reg = reg & 0xfff; - device_printf(sc->sc_dev, "%s: called\n", __func__); + *pvid = reg; return (0); } static int ar8327_set_pvid(struct arswitch_softc *sc, int port, int pvid) { + uint32_t t; + + /* Limit pvid to valid values */ + pvid &= 0x7f; + + t = pvid << AR8327_PORT_VLAN0_DEF_SVID_S; + t |= pvid << AR8327_PORT_VLAN0_DEF_CVID_S; + arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN0(port), t); - device_printf(sc->sc_dev, "%s: called\n", __func__); return (0); } @@ -883,6 +957,9 @@ ar8327_attach(struct arswitch_softc *sc) sc->hal.arswitch_vlan_get_pvid = ar8327_get_pvid; sc->hal.arswitch_vlan_set_pvid = ar8327_set_pvid; + sc->hal.arswitch_get_port_vlan = ar8327_vlan_get_port; + sc->hal.arswitch_set_port_vlan = ar8327_vlan_set_port; + sc->hal.arswitch_atu_flush = ar8327_atu_flush; /* Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Sun Mar 8 21:51:37 2015 (r279789) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Sun Mar 8 21:59:03 2015 (r279790) @@ -103,8 +103,8 @@ arswitch_purge_dot1q_vlan(struct arswitc return (arswitch_vlan_op(sc, AR8X16_VLAN_OP_PURGE, vid, 0)); } -static int -arswitch_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) +int +ar8xxx_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) { uint32_t reg; int err; @@ -124,8 +124,8 @@ arswitch_get_dot1q_vlan(struct arswitch_ return (0); } -static int -arswitch_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) +int +ar8xxx_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) { int err; @@ -136,8 +136,8 @@ arswitch_set_dot1q_vlan(struct arswitch_ return (0); } -static int -arswitch_get_port_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) +int +ar8xxx_get_port_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) { int port; uint32_t reg; @@ -151,8 +151,8 @@ arswitch_get_port_vlan(struct arswitch_s return (0); } -static int -arswitch_set_port_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) +int +ar8xxx_set_port_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) { int err, port; @@ -224,7 +224,7 @@ ar8xxx_reset_vlans(struct arswitch_softc ports = 0; for (i = 0; i <= sc->numphys; i++) ports |= (1 << i); - arswitch_set_dot1q_vlan(sc, ports, sc->vid[0]); + sc->hal.arswitch_set_dot1q_vlan(sc, ports, sc->vid[0]); sc->vid[0] |= ETHERSWITCH_VID_VALID; } else if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { /* Initialize the port based vlans. */ @@ -286,11 +286,11 @@ ar8xxx_getvgroup(struct arswitch_softc * /* Member Ports. */ switch (sc->vlan_mode) { case ETHERSWITCH_VLAN_DOT1Q: - err = arswitch_get_dot1q_vlan(sc, &vg->es_member_ports, + err = sc->hal.arswitch_get_dot1q_vlan(sc, &vg->es_member_ports, vg->es_vid); break; case ETHERSWITCH_VLAN_PORT: - err = arswitch_get_port_vlan(sc, &vg->es_member_ports, + err = sc->hal.arswitch_get_port_vlan(sc, &vg->es_member_ports, vg->es_vid); break; default: @@ -345,10 +345,10 @@ ar8xxx_setvgroup(struct arswitch_softc * /* Member Ports. */ switch (sc->vlan_mode) { case ETHERSWITCH_VLAN_DOT1Q: - err = arswitch_set_dot1q_vlan(sc, vg->es_member_ports, vid); + err = sc->hal.arswitch_set_dot1q_vlan(sc, vg->es_member_ports, vid); break; case ETHERSWITCH_VLAN_PORT: - err = arswitch_set_port_vlan(sc, vg->es_member_ports, vid); + err = sc->hal.arswitch_set_port_vlan(sc, vg->es_member_ports, vid); break; default: err = -1; Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Sun Mar 8 21:51:37 2015 (r279789) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Sun Mar 8 21:59:03 2015 (r279790) @@ -35,4 +35,9 @@ int ar8xxx_setvgroup(struct arswitch_sof int ar8xxx_get_pvid(struct arswitch_softc *, int, int *); int ar8xxx_set_pvid(struct arswitch_softc *, int, int); +int ar8xxx_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid); +int ar8xxx_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, int vid); +int ar8xxx_get_port_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid); +int ar8xxx_set_port_vlan(struct arswitch_softc *sc, uint32_t ports, int vid); + #endif /* __ARSWITCH_VLANS_H__ */ Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Sun Mar 8 21:51:37 2015 (r279789) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Sun Mar 8 21:59:03 2015 (r279790) @@ -370,6 +370,9 @@ #define AR8327_NUM_PHYS 5 #define AR8327_PORTS_ALL 0x7f +#define AR8327_PORT_GMAC0 0 +#define AR8327_PORT_GMAC6 6 + #define AR8327_REG_MASK 0x000 #define AR8327_REG_PAD0_MODE 0x004 Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Sun Mar 8 21:51:37 2015 (r279789) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Sun Mar 8 21:59:03 2015 (r279790) @@ -99,6 +99,15 @@ struct arswitch_softc { int (* arswitch_vlan_set_pvid) (struct arswitch_softc *, int, int); + int (* arswitch_get_dot1q_vlan) (struct arswitch_softc *, + uint32_t *ports, int vid); + int (* arswitch_set_dot1q_vlan) (struct arswitch_softc *sc, + uint32_t ports, int vid); + int (* arswitch_get_port_vlan) (struct arswitch_softc *sc, + uint32_t *ports, int vid); + int (* arswitch_set_port_vlan) (struct arswitch_softc *sc, + uint32_t ports, int vid); + /* PHY functions */ int (* arswitch_phy_read) (device_t, int, int); int (* arswitch_phy_write) (device_t, int, int, int); From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 22:03:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6988942D; Sun, 8 Mar 2015 22:03:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 54808D98; Sun, 8 Mar 2015 22:03:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28M3tCB080766; Sun, 8 Mar 2015 22:03:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28M3tYh080765; Sun, 8 Mar 2015 22:03:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503082203.t28M3tYh080765@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Mar 2015 22:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279791 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 22:03:55 -0000 Author: adrian Date: Sun Mar 8 22:03:54 2015 New Revision: 279791 URL: https://svnweb.freebsd.org/changeset/base/279791 Log: Modify the if_arge code to use a /fixed/ media mode when it's configured. Otherwise, the initial media speed would change if a PHY is hooked up, sending PHY speed notifications. For the AP135 at least, the RGMII PHY has a static speed/duplex configured and if the PHY plumbing attaches the PHY to the if_arge interface, the first link speed change from 1000/full will set the MAC to something that isn't useful. This shouldn't affect any other platforms - everything I looked at is using hard-coded speed/duplex as static, as they're facing a switch with no PHY attached. Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Sun Mar 8 21:59:03 2015 (r279790) +++ head/sys/mips/atheros/if_arge.c Sun Mar 8 22:03:54 2015 (r279791) @@ -304,6 +304,8 @@ arge_reset_mac(struct arge_softc *sc) uint32_t reg; uint32_t reset_reg; + ARGEDEBUG(sc, ARGE_DBG_RESET, "%s called\n", __func__); + /* Step 1. Soft-reset MAC */ ARGE_SET_BITS(sc, AR71XX_MAC_CFG1, MAC_CFG1_SOFT_RESET); DELAY(20); @@ -649,8 +651,7 @@ arge_attach(device_t dev) } /* - * Get default media & duplex mode, by default its Base100T - * and full duplex + * Get default/hard-coded media & duplex mode. */ if (resource_int_value(device_get_name(dev), device_get_unit(dev), "media", &hint) != 0) @@ -658,8 +659,12 @@ arge_attach(device_t dev) if (hint == 1000) sc->arge_media_type = IFM_1000_T; - else + else if (hint == 100) sc->arge_media_type = IFM_100_TX; + else if (hint == 10) + sc->arge_media_type = IFM_10_T; + else + sc->arge_media_type = 0; if (resource_int_value(device_get_name(dev), device_get_unit(dev), "fduplex", &hint) != 0) @@ -847,9 +852,10 @@ arge_attach(device_t dev) } } } + if (sc->arge_miibus == NULL) { /* no PHY, so use hard-coded values */ - ifmedia_init(&sc->arge_ifmedia, 0, + ifmedia_init(&sc->arge_ifmedia, 0, arge_multiphy_mediachange, arge_multiphy_mediastatus); ifmedia_add(&sc->arge_ifmedia, @@ -1071,6 +1077,25 @@ arge_update_link_locked(struct arge_soft return; } + /* + * If we have a static media type configured, then + * use that. Some PHY configurations (eg QCA955x -> AR8327) + * use a static speed/duplex between the SoC and switch, + * even though the front-facing PHY speed changes. + */ + if (sc->arge_media_type != 0) { + ARGEDEBUG(sc, ARGE_DBG_MII, "%s: fixed; media=%d, duplex=%d\n", + __func__, + sc->arge_media_type, + sc->arge_duplex_mode); + if (mii->mii_media_status & IFM_ACTIVE) { + sc->arge_link_status = 1; + } else { + sc->arge_link_status = 0; + } + arge_set_pll(sc, sc->arge_media_type, sc->arge_duplex_mode); + } + if (mii->mii_media_status & IFM_ACTIVE) { media = IFM_SUBTYPE(mii->mii_media_active); @@ -1095,6 +1120,12 @@ arge_set_pll(struct arge_softc *sc, int uint32_t fifo_tx, pll; int if_speed; + /* + * XXX Verify - is this valid for all chips? + * QCA955x (and likely some of the earlier chips!) define + * this as nibble mode and byte mode, and those have to do + * with the interface type (MII/SMII versus GMII/RGMII.) + */ ARGEDEBUG(sc, ARGE_DBG_PLL, "set_pll(%04x, %s)\n", media, duplex == IFM_FDX ? "full" : "half"); cfg = ARGE_READ(sc, AR71XX_MAC_CFG2); @@ -1199,6 +1230,9 @@ arge_set_pll(struct arge_softc *sc, int static void arge_reset_dma(struct arge_softc *sc) { + + ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: called\n", __func__); + ARGE_WRITE(sc, AR71XX_DMA_RX_CONTROL, 0); ARGE_WRITE(sc, AR71XX_DMA_TX_CONTROL, 0); @@ -1230,8 +1264,6 @@ arge_reset_dma(struct arge_softc *sc) arge_flush_ddr(sc); } - - static void arge_init(void *xsc) { From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 22:07:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6171E6AC; Sun, 8 Mar 2015 22:07:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 4C42FDC6; Sun, 8 Mar 2015 22:07:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28M7XgW081402; Sun, 8 Mar 2015 22:07:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28M7Xqu081401; Sun, 8 Mar 2015 22:07:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503082207.t28M7Xqu081401@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Mar 2015 22:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279792 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 22:07:33 -0000 Author: adrian Date: Sun Mar 8 22:07:32 2015 New Revision: 279792 URL: https://svnweb.freebsd.org/changeset/base/279792 Log: Now that if_arge.c handles actual 'locked' media settings, enable the WAN port to look like it has its own PHY on PHY4 (port5). Modified: head/sys/mips/conf/AP135.hints Modified: head/sys/mips/conf/AP135.hints ============================================================================== --- head/sys/mips/conf/AP135.hints Sun Mar 8 22:03:54 2015 (r279791) +++ head/sys/mips/conf/AP135.hints Sun Mar 8 22:07:32 2015 (r279792) @@ -83,7 +83,11 @@ hint.arswitch.0.port.6.txpause=1 hint.arswitch.0.port.6.rxpause=1 # arge0 - hooked up to AR8327 GMAC6, RGMII -hint.arge.0.phymask=0x0 +# set at 1000/full to the switch. +# so, lock both sides of this connect up to 1000/full; +# if_arge thus wont change the PLL configuration +# upon a link status change. +hint.arge.0.phymask=0x10 hint.arge.0.miimode=3 # RGMII hint.arge.0.media=1000 hint.arge.0.fduplex=1 From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 22:49:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90C4B1FD; Sun, 8 Mar 2015 22:49:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 7BCCE206; Sun, 8 Mar 2015 22:49:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28MnZoT000791; Sun, 8 Mar 2015 22:49:35 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28MnZBQ000790; Sun, 8 Mar 2015 22:49:35 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201503082249.t28MnZBQ000790@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 8 Mar 2015 22:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279795 - head/usr.bin/touch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 22:49:35 -0000 Author: jilles Date: Sun Mar 8 22:49:34 2015 New Revision: 279795 URL: https://svnweb.freebsd.org/changeset/base/279795 Log: touch(1): Xref utimensat(2) instead of utimes(2). Modified: head/usr.bin/touch/touch.1 Modified: head/usr.bin/touch/touch.1 ============================================================================== --- head/usr.bin/touch/touch.1 Sun Mar 8 22:39:19 2015 (r279794) +++ head/usr.bin/touch/touch.1 Sun Mar 8 22:49:34 2015 (r279795) @@ -31,7 +31,7 @@ .\" @(#)touch.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd June 10, 2012 +.Dd March 8, 2015 .Dt TOUCH 1 .Os .Sh NAME @@ -238,7 +238,7 @@ If the letter pair is in the range 39 to 99, the year is set to 1939 to 1999, otherwise, the year is set in the 21st century. .Sh SEE ALSO -.Xr utimes 2 +.Xr utimensat 2 .Sh STANDARDS The .Nm From owner-svn-src-head@FreeBSD.ORG Sun Mar 8 23:02:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E99F565E; Sun, 8 Mar 2015 23:02:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 CA3003B2; Sun, 8 Mar 2015 23:02:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t28N2HPa009453; Sun, 8 Mar 2015 23:02:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t28N2GgG009449; Sun, 8 Mar 2015 23:02:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503082302.t28N2GgG009449@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 8 Mar 2015 23:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279797 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2015 23:02:18 -0000 Author: adrian Date: Sun Mar 8 23:02:15 2015 New Revision: 279797 URL: https://svnweb.freebsd.org/changeset/base/279797 Log: Methodise a couple more of the VLAN methods. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.h head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Sun Mar 8 22:50:45 2015 (r279796) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Sun Mar 8 23:02:15 2015 (r279797) @@ -312,6 +312,8 @@ arswitch_attach(device_t dev) sc->hal.arswitch_get_dot1q_vlan = ar8xxx_get_dot1q_vlan; sc->hal.arswitch_set_dot1q_vlan = ar8xxx_set_dot1q_vlan; + sc->hal.arswitch_flush_dot1q_vlan = ar8xxx_flush_dot1q_vlan; + sc->hal.arswitch_purge_dot1q_vlan = ar8xxx_purge_dot1q_vlan; sc->hal.arswitch_get_port_vlan = ar8xxx_get_port_vlan; sc->hal.arswitch_set_port_vlan = ar8xxx_set_port_vlan; Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Sun Mar 8 22:50:45 2015 (r279796) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Sun Mar 8 23:02:15 2015 (r279797) @@ -53,11 +53,10 @@ /* * XXX TODO: teach about the AR933x SoC switch * XXX TODO: teach about the AR934x SoC switch - * XXX TODO: teach about the AR8327 external switch */ static int -arswitch_vlan_op(struct arswitch_softc *sc, uint32_t op, uint32_t vid, +ar8xxx_vlan_op(struct arswitch_softc *sc, uint32_t op, uint32_t vid, uint32_t data) { int err; @@ -87,20 +86,20 @@ arswitch_vlan_op(struct arswitch_softc * return (0); } -static int -arswitch_flush_dot1q_vlan(struct arswitch_softc *sc) +int +ar8xxx_flush_dot1q_vlan(struct arswitch_softc *sc) { ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); - return (arswitch_vlan_op(sc, AR8X16_VLAN_OP_FLUSH, 0, 0)); + return (ar8xxx_vlan_op(sc, AR8X16_VLAN_OP_FLUSH, 0, 0)); } -static int -arswitch_purge_dot1q_vlan(struct arswitch_softc *sc, int vid) +int +ar8xxx_purge_dot1q_vlan(struct arswitch_softc *sc, int vid) { ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); - return (arswitch_vlan_op(sc, AR8X16_VLAN_OP_PURGE, vid, 0)); + return (ar8xxx_vlan_op(sc, AR8X16_VLAN_OP_PURGE, vid, 0)); } int @@ -110,7 +109,7 @@ ar8xxx_get_dot1q_vlan(struct arswitch_so int err; ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); - err = arswitch_vlan_op(sc, AR8X16_VLAN_OP_GET, vid, 0); + err = ar8xxx_vlan_op(sc, AR8X16_VLAN_OP_GET, vid, 0); if (err) return (err); @@ -130,7 +129,7 @@ ar8xxx_set_dot1q_vlan(struct arswitch_so int err; ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); - err = arswitch_vlan_op(sc, AR8X16_VLAN_OP_LOAD, vid, ports); + err = ar8xxx_vlan_op(sc, AR8X16_VLAN_OP_LOAD, vid, ports); if (err) return (err); return (0); @@ -193,7 +192,7 @@ ar8xxx_reset_vlans(struct arswitch_softc } } - if (arswitch_flush_dot1q_vlan(sc)) { + if (sc->hal.arswitch_flush_dot1q_vlan(sc)) { ARSWITCH_UNLOCK(sc); return; } @@ -323,7 +322,7 @@ ar8xxx_setvgroup(struct arswitch_softc * (vid & ETHERSWITCH_VID_VALID) != 0 && (vid & ETHERSWITCH_VID_MASK) != (vg->es_vid & ETHERSWITCH_VID_MASK)) { - err = arswitch_purge_dot1q_vlan(sc, vid); + err = sc->hal.arswitch_purge_dot1q_vlan(sc, vid); if (err) { ARSWITCH_UNLOCK(sc); return (err); Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Sun Mar 8 22:50:45 2015 (r279796) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Sun Mar 8 23:02:15 2015 (r279797) @@ -35,6 +35,8 @@ int ar8xxx_setvgroup(struct arswitch_sof int ar8xxx_get_pvid(struct arswitch_softc *, int, int *); int ar8xxx_set_pvid(struct arswitch_softc *, int, int); +int ar8xxx_flush_dot1q_vlan(struct arswitch_softc *sc); +int ar8xxx_purge_dot1q_vlan(struct arswitch_softc *sc, int vid); int ar8xxx_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid); int ar8xxx_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, int vid); int ar8xxx_get_port_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid); Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Sun Mar 8 22:50:45 2015 (r279796) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Sun Mar 8 23:02:15 2015 (r279797) @@ -99,6 +99,9 @@ struct arswitch_softc { int (* arswitch_vlan_set_pvid) (struct arswitch_softc *, int, int); + int (* arswitch_flush_dot1q_vlan) (struct arswitch_softc *sc); + int (* arswitch_purge_dot1q_vlan) (struct arswitch_softc *sc, + int vid); int (* arswitch_get_dot1q_vlan) (struct arswitch_softc *, uint32_t *ports, int vid); int (* arswitch_set_dot1q_vlan) (struct arswitch_softc *sc, From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 02:19:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB2DCD1A; Mon, 9 Mar 2015 02:19:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 C447A9EA; Mon, 9 Mar 2015 02:19:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t292JjIV001723; Mon, 9 Mar 2015 02:19:45 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t292Ji6Y001713; Mon, 9 Mar 2015 02:19:44 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503090219.t292Ji6Y001713@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 9 Mar 2015 02:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279798 - in head: lib/libstand lib/libstand/powerpc sys/boot/libstand32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 02:19:46 -0000 Author: nwhitehorn Date: Mon Mar 9 02:19:44 2015 New Revision: 279798 URL: https://svnweb.freebsd.org/changeset/base/279798 Log: Fix loader on PowerPC following r279784. It turns out that, due to .PATH confusion, the _setjmp.S in libstand was never being used and was instead being shadowed by the libc version. Since the libc version now uses FPRs, it caused loader to crash. Added: head/lib/libstand/powerpc/syncicache.c - copied unchanged from r279797, head/lib/libc/powerpc/gen/syncicache.c Modified: head/lib/libstand/Makefile head/lib/libstand/powerpc/_setjmp.S head/sys/boot/libstand32/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Sun Mar 8 23:02:15 2015 (r279797) +++ head/lib/libstand/Makefile Mon Mar 9 02:19:44 2015 (r279798) @@ -80,7 +80,6 @@ SRCS+= aeabi_memcmp.S aeabi_memcpy.S aea .if ${MACHINE_CPUARCH} == "powerpc" .PATH: ${.CURDIR}/../libc/quad SRCS+= ashldi3.c ashrdi3.c -.PATH: ${.CURDIR}/../libc/powerpc/gen SRCS+= syncicache.c .endif @@ -89,11 +88,7 @@ SRCS+= syncicache.c SRCS+= uuid_equal.c uuid_is_nil.c # _setjmp/_longjmp -.if ${MACHINE_ARCH} == "powerpc64" -.PATH: ${.CURDIR}/powerpc -.else .PATH: ${.CURDIR}/${MACHINE_CPUARCH} -.endif SRCS+= _setjmp.S # decompression functionality from libbz2 Modified: head/lib/libstand/powerpc/_setjmp.S ============================================================================== --- head/lib/libstand/powerpc/_setjmp.S Sun Mar 8 23:02:15 2015 (r279797) +++ head/lib/libstand/powerpc/_setjmp.S Mon Mar 9 02:19:44 2015 (r279798) @@ -42,7 +42,7 @@ #define JMP_xer 24*REGWIDTH #define JMP_sig 25*REGWIDTH -ASENTRY_NOPROF(setjmp) +ASENTRY_NOPROF(_setjmp) ST_REG 31, JMP_r31(3) /* r1, r2, r14-r30 */ ST_REG 1, JMP_r1 (3) @@ -79,7 +79,7 @@ ASENTRY_NOPROF(setjmp) .extern sigsetmask -ASENTRY_NOPROF(longjmp) +ASENTRY_NOPROF(_longjmp) LD_REG 31, JMP_r31(3) /* r1, r2, r14-r30 */ LD_REG 1, JMP_r1 (3) Copied: head/lib/libstand/powerpc/syncicache.c (from r279797, head/lib/libc/powerpc/gen/syncicache.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libstand/powerpc/syncicache.c Mon Mar 9 02:19:44 2015 (r279798, copy of r279797, head/lib/libc/powerpc/gen/syncicache.c) @@ -0,0 +1,103 @@ +/*- + * Copyright (C) 1995-1997, 1999 Wolfgang Solfrank. + * Copyright (C) 1995-1997, 1999 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. + * + * $NetBSD: syncicache.c,v 1.2 1999/05/05 12:36:40 tsubai Exp $ + */ + +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif /* not lint */ + +#include +#if defined(_KERNEL) || defined(_STANDALONE) +#include +#include +#include +#endif +#include + +#include +#include + +#ifdef _STANDALONE +int cacheline_size = 32; +#endif + +#if !defined(_KERNEL) && !defined(_STANDALONE) +#include + +int cacheline_size = 0; + +static void getcachelinesize(void); + +static void +getcachelinesize() +{ + static int cachemib[] = { CTL_MACHDEP, CPU_CACHELINE }; + int clen; + + clen = sizeof(cacheline_size); + + if (sysctl(cachemib, sizeof(cachemib) / sizeof(cachemib[0]), + &cacheline_size, &clen, NULL, 0) < 0 || !cacheline_size) { + abort(); + } +} +#endif + +void +__syncicache(void *from, int len) +{ + int l, off; + char *p; + +#if !defined(_KERNEL) && !defined(_STANDALONE) + if (!cacheline_size) + getcachelinesize(); +#endif + + off = (u_int)from & (cacheline_size - 1); + l = len += off; + p = (char *)from - off; + + do { + __asm __volatile ("dcbst 0,%0" :: "r"(p)); + p += cacheline_size; + } while ((l -= cacheline_size) > 0); + __asm __volatile ("sync"); + p = (char *)from - off; + do { + __asm __volatile ("icbi 0,%0" :: "r"(p)); + p += cacheline_size; + } while ((len -= cacheline_size) > 0); + __asm __volatile ("sync; isync"); +} + Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Sun Mar 8 23:02:15 2015 (r279797) +++ head/sys/boot/libstand32/Makefile Mon Mar 9 02:19:44 2015 (r279798) @@ -83,7 +83,6 @@ SRCS+= aeabi_memcmp.S aeabi_memcpy.S aea .if ${MACHINE_CPUARCH} == "powerpc" .PATH: ${LIBC}/quad SRCS+= ashldi3.c ashrdi3.c -.PATH: ${LIBC}/powerpc/gen SRCS+= syncicache.c .endif @@ -94,8 +93,6 @@ SRCS+= uuid_equal.c uuid_is_nil.c # _setjmp/_longjmp .if ${MACHINE_CPUARCH} == "amd64" .PATH: ${S}/i386 -.elif ${MACHINE_ARCH} == "powerpc64" -.PATH: ${S}/powerpc .else .PATH: ${S}/${MACHINE_CPUARCH} .endif From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 02:57:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E08124C; Mon, 9 Mar 2015 02:57:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 66A25D8C; Mon, 9 Mar 2015 02:57:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t292vbbM019836; Mon, 9 Mar 2015 02:57:37 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t292vZfn019820; Mon, 9 Mar 2015 02:57:35 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503090257.t292vZfn019820@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 9 Mar 2015 02:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279799 - in head/sys/boot: ofw/common ofw/libofw powerpc/ofw sparc64/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 02:57:37 -0000 Author: nwhitehorn Date: Mon Mar 9 02:57:34 2015 New Revision: 279799 URL: https://svnweb.freebsd.org/changeset/base/279799 Log: Provide a shim layer in loader to condense the Open Firmware device tree to an FDT. This is how Linux and OS X boot and can avoid some issues with using Open Firmware at runtime. The code is highly experimental and disabled by default; it can be turned on by setting the loader environment variable "usefdt" to a non-NULL value. Added: head/sys/boot/powerpc/ofw/ofwfdt.c (contents, props changed) Modified: head/sys/boot/ofw/common/main.c head/sys/boot/ofw/libofw/elf_freebsd.c head/sys/boot/ofw/libofw/openfirm.c head/sys/boot/ofw/libofw/openfirm.h head/sys/boot/ofw/libofw/ppc64_elf_freebsd.c head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ofw/metadata.c head/sys/boot/sparc64/loader/metadata.c Modified: head/sys/boot/ofw/common/main.c ============================================================================== --- head/sys/boot/ofw/common/main.c Mon Mar 9 02:19:44 2015 (r279798) +++ head/sys/boot/ofw/common/main.c Mon Mar 9 02:57:34 2015 (r279799) @@ -45,7 +45,7 @@ u_int32_t acells, scells; static char bootargs[128]; -#define HEAP_SIZE 0x80000 +#define HEAP_SIZE 0x100000 #define OF_puts(fd, text) OF_write(fd, text, strlen(text)) Modified: head/sys/boot/ofw/libofw/elf_freebsd.c ============================================================================== --- head/sys/boot/ofw/libofw/elf_freebsd.c Mon Mar 9 02:19:44 2015 (r279798) +++ head/sys/boot/ofw/libofw/elf_freebsd.c Mon Mar 9 02:57:34 2015 (r279799) @@ -67,7 +67,7 @@ int __elfN(ofw_exec)(struct preloaded_file *fp) { struct file_metadata *fmp; - vm_offset_t mdp; + vm_offset_t mdp, dtbp; Elf_Ehdr *e; int error; intptr_t entry; @@ -78,15 +78,21 @@ __elfN(ofw_exec)(struct preloaded_file * e = (Elf_Ehdr *)&fmp->md_data; entry = e->e_entry; - if ((error = md_load(fp->f_args, &mdp)) != 0) + if ((error = md_load(fp->f_args, &mdp, &dtbp)) != 0) return (error); printf("Kernel entry at 0x%lx ...\n", e->e_entry); dev_cleanup(); ofw_release_heap(); - OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, - (void *)mdp, sizeof(mdp)); + if (dtbp != 0) { + OF_quiesce(); + ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, 0, 0, + mdp, sizeof(mdp)); + } else { + OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, + (void *)mdp, sizeof(mdp)); + } panic("exec returned"); } Modified: head/sys/boot/ofw/libofw/openfirm.c ============================================================================== --- head/sys/boot/ofw/libofw/openfirm.c Mon Mar 9 02:19:44 2015 (r279798) +++ head/sys/boot/ofw/libofw/openfirm.c Mon Mar 9 02:57:34 2015 (r279799) @@ -729,6 +729,20 @@ OF_exit() ; } +void +OF_quiesce() +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + } args = { + (cell_t)"quiesce", + }; + + openfirmware(&args); +} + /* Free bytes starting at , then call with . */ #if 0 void Modified: head/sys/boot/ofw/libofw/openfirm.h ============================================================================== --- head/sys/boot/ofw/libofw/openfirm.h Mon Mar 9 02:19:44 2015 (r279798) +++ head/sys/boot/ofw/libofw/openfirm.h Mon Mar 9 02:57:34 2015 (r279799) @@ -82,6 +82,7 @@ void OF_init(int (*openfirm)(void *)); /* Generic functions */ int OF_test(char *); +void OF_quiesce(); /* Disable firmware */ /* Device tree functions */ phandle_t OF_peer(phandle_t); Modified: head/sys/boot/ofw/libofw/ppc64_elf_freebsd.c ============================================================================== --- head/sys/boot/ofw/libofw/ppc64_elf_freebsd.c Mon Mar 9 02:19:44 2015 (r279798) +++ head/sys/boot/ofw/libofw/ppc64_elf_freebsd.c Mon Mar 9 02:57:34 2015 (r279799) @@ -67,7 +67,7 @@ int ppc64_ofw_elf_exec(struct preloaded_file *fp) { struct file_metadata *fmp; - vm_offset_t mdp; + vm_offset_t mdp, dtbp; Elf_Ehdr *e; int error; intptr_t entry; @@ -80,7 +80,7 @@ ppc64_ofw_elf_exec(struct preloaded_file /* Handle function descriptor */ entry = *(uint64_t *)e->e_entry; - if ((error = md_load64(fp->f_args, &mdp)) != 0) + if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0) return (error); printf("Kernel entry at 0x%lx ...\n", entry); @@ -88,8 +88,14 @@ ppc64_ofw_elf_exec(struct preloaded_file dev_cleanup(); ofw_release_heap(); - OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, - (void *)mdp, sizeof(mdp)); + if (dtbp != 0) { + OF_quiesce(); + ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, 0, 0, + mdp, sizeof(mdp)); + } else { + OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, + (void *)mdp, sizeof(mdp)); + } panic("exec returned"); } Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Mon Mar 9 02:19:44 2015 (r279798) +++ head/sys/boot/powerpc/ofw/Makefile Mon Mar 9 02:57:34 2015 (r279799) @@ -21,6 +21,7 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no +LOADER_FDT_SUPPORT?= yes .if ${LOADER_DISK_SUPPORT} == "yes" CFLAGS+= -DLOADER_DISK_SUPPORT @@ -49,6 +50,14 @@ CFLAGS+= -DLOADER_NFS_SUPPORT .if ${LOADER_TFTP_SUPPORT} == "yes" CFLAGS+= -DLOADER_TFTP_SUPPORT .endif +.if ${LOADER_FDT_SUPPORT} == "yes" +SRCS+= ofwfdt.c +CFLAGS+= -I${.CURDIR}/../../fdt +CFLAGS+= -I${.OBJDIR}/../../fdt +CFLAGS+= -I${.CURDIR}/../../../contrib/libfdt +CFLAGS+= -DLOADER_FDT_SUPPORT +LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a +.endif .if ${MK_FORTH} != "no" # Enable BootForth @@ -89,13 +98,13 @@ CFLAGS+= -I${.CURDIR}/../../ofw/libofw LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} -loader.help: help.common help.ofw +loader.help: help.common help.ofw ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: head/sys/boot/powerpc/ofw/metadata.c ============================================================================== --- head/sys/boot/powerpc/ofw/metadata.c Mon Mar 9 02:19:44 2015 (r279798) +++ head/sys/boot/powerpc/ofw/metadata.c Mon Mar 9 02:57:34 2015 (r279799) @@ -34,11 +34,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "bootstrap.h" -#include "libofw.h" int md_getboothowto(char *kargs) @@ -243,7 +243,7 @@ md_copymodules(vm_offset_t addr, int ker * - Module metadata are formatted and placed in kernel space. */ int -md_load_dual(char *args, vm_offset_t *modulep, int kern64) +md_load_dual(char *args, vm_offset_t *modulep, vm_offset_t *dtb, int kern64) { struct preloaded_file *kfp; struct preloaded_file *xp; @@ -251,6 +251,7 @@ md_load_dual(char *args, vm_offset_t *mo vm_offset_t kernend; vm_offset_t addr; vm_offset_t envp; + vm_offset_t fdtp; vm_offset_t size; uint64_t scratch64; char *rootdevname; @@ -286,6 +287,14 @@ md_load_dual(char *args, vm_offset_t *mo /* pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); + /* Copy out FDT */ + *dtb = fdtp = 0; + if (getenv("usefdt") != NULL) { + size = fdt_copy(addr); + *dtb = fdtp = addr; + addr = roundup(addr + size, PAGE_SIZE); + } + kernend = 0; kfp = file_findfile(NULL, kern64 ? "elf64 kernel" : "elf32 kernel"); if (kfp == NULL) @@ -296,10 +305,16 @@ md_load_dual(char *args, vm_offset_t *mo if (kern64) { scratch64 = envp; file_addmetadata(kfp, MODINFOMD_ENVP, sizeof scratch64, &scratch64); + if (fdtp != 0) { + scratch64 = fdtp; + file_addmetadata(kfp, MODINFOMD_DTBP, sizeof scratch64, &scratch64); + } scratch64 = kernend; file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof scratch64, &scratch64); } else { file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); + if (fdtp != 0) + file_addmetadata(kfp, MODINFOMD_DTBP, sizeof fdtp, &fdtp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); } @@ -321,14 +336,14 @@ md_load_dual(char *args, vm_offset_t *mo } int -md_load(char *args, vm_offset_t *modulep) +md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb) { - return (md_load_dual(args, modulep, 0)); + return (md_load_dual(args, modulep, dtb, 0)); } int -md_load64(char *args, vm_offset_t *modulep) +md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb) { - return (md_load_dual(args, modulep, 1)); + return (md_load_dual(args, modulep, dtb, 1)); } Added: head/sys/boot/powerpc/ofw/ofwfdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/powerpc/ofw/ofwfdt.c Mon Mar 9 02:57:34 2015 (r279799) @@ -0,0 +1,202 @@ +/*- + * Copyright (C) 2014-2015 Nathan Whitehorn + * 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 TOOLS GMBH 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 "bootstrap.h" + +static int +OF_hasprop(phandle_t node, const char *prop) +{ + return (OF_getproplen(node, prop) > 0); +} + +static void +add_node_to_fdt(void *buffer, phandle_t node, int fdt_offset) +{ + int i, child_offset, error; + char name[2048], *lastprop, *subname; + void *propbuf; + size_t proplen; + + lastprop = NULL; + while (OF_nextprop(node, lastprop, name) > 0) { + proplen = OF_getproplen(node, name); + propbuf = malloc(proplen); + OF_getprop(node, name, propbuf, proplen); + error = fdt_setprop(buffer, fdt_offset, name, propbuf, proplen); + free(propbuf); + lastprop = name; + if (error) + printf("Error %d adding property %s to " + "node %d\n", error, name, fdt_offset); + } + + if (!OF_hasprop(node, "phandle") && !OF_hasprop(node, "linux,phandle") + && !OF_hasprop(node, "ibm,phandle")) + fdt_setprop(buffer, fdt_offset, "phandle", &node, sizeof(node)); + + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + OF_package_to_path(node, name, sizeof(name)); + subname = strrchr(name, '/'); + subname++; + child_offset = fdt_add_subnode(buffer, fdt_offset, subname); + if (child_offset < 0) { + printf("Error %d adding node %s (%s), skipping\n", + child_offset, name, subname); + continue; + } + + add_node_to_fdt(buffer, node, child_offset); + } +} + +static void +ofwfdt_fixups(void *fdtp) +{ + int offset, len, i; + phandle_t node; + ihandle_t rtas; + const void *prop; + + /* + * Instantiate and add reservations for RTAS state if present + */ + + offset = fdt_path_offset(fdtp, "/rtas"); + if (offset > 0) { + uint32_t base; + void *rtasmem; + char path[255]; + + node = OF_finddevice("/rtas"); + OF_package_to_path(node, path, sizeof(path)); + OF_getprop(node, "rtas-size", &len, sizeof(len)); + + /* Allocate memory */ + rtasmem = OF_claim(0, len, 4096); + + /* Instantiate RTAS */ + rtas = OF_open(path); + base = 0; + OF_call_method("instantiate-rtas", rtas, 1, 1, (cell_t)rtas, + &base); + + /* Store info to FDT using Linux convention */ + base = cpu_to_fdt32(base); + fdt_setprop(fdtp, offset, "linux,rtas-entry", &base, + sizeof(base)); + base = cpu_to_fdt32((uint32_t)rtasmem); + offset = fdt_path_offset(fdtp, "/rtas"); + fdt_setprop(fdtp, offset, "linux,rtas-base", &base, + sizeof(base)); + + /* Mark RTAS private data area reserved */ + fdt_add_mem_rsv(fdtp, base, len); + } else { + /* + * Remove /memory/available properties, which reflect long-gone OF + * state. Note that this doesn't work if we need RTAS still, since + * that's part of the firmware. + */ + + offset = fdt_path_offset(fdtp, "/memory@0"); + if (offset > 0) + fdt_delprop(fdtp, offset, "available"); + } + + /* + + /* + * Convert stored ihandles under /chosen to xref phandles + */ + offset = fdt_path_offset(fdtp, "/chosen"); + if (offset > 0) { + const char *chosenprops[] = {"stdout", "stdin", "mmu", "cpu", + NULL}; + const uint32_t *ihand; + for (i = 0; chosenprops[i] != NULL; i++) { + ihand = fdt_getprop(fdtp, offset, chosenprops[i], &len); + if (ihand != NULL && len == sizeof(*ihand)) { + node = OF_instance_to_package( + fdt32_to_cpu(*ihand)); + if (OF_hasprop(node, "phandle")) + OF_getprop(node, "phandle", &node, + sizeof(node)); + else if (OF_hasprop(node, "linux,phandle")) + OF_getprop(node, "linux,phandle", &node, + sizeof(node)); + else if (OF_hasprop(node, "ibm,phandle")) + OF_getprop(node, "ibm,phandle", &node, + sizeof(node)); + node = cpu_to_fdt32(node); + fdt_setprop(fdtp, offset, chosenprops[i], &node, sizeof(node)); + } + + /* Refind node in case it moved */ + offset = fdt_path_offset(fdtp, "/chosen"); + } + } +} + +int +fdt_platform_load_dtb(void) +{ + void *buffer; + size_t buflen = 409600; + + buffer = malloc(buflen); + fdt_create_empty_tree(buffer, buflen); + add_node_to_fdt(buffer, OF_peer(0), fdt_path_offset(buffer, "/")); + ofwfdt_fixups(buffer); + fdt_pack(buffer); + + fdt_load_dtb_addr(buffer); + free(buffer); + + return (0); +} + +void +fdt_platform_fixups(void) +{ + +} + +static int +command_fdt(int argc, char *argv[]) +{ + + return (command_fdt_internal(argc, argv)); +} + +COMMAND_SET(fdt, "fdt", "flattened device tree handling", command_fdt); + Modified: head/sys/boot/sparc64/loader/metadata.c ============================================================================== --- head/sys/boot/sparc64/loader/metadata.c Mon Mar 9 02:19:44 2015 (r279798) +++ head/sys/boot/sparc64/loader/metadata.c Mon Mar 9 02:57:34 2015 (r279799) @@ -276,7 +276,7 @@ md_copymodules(vm_offset_t addr) * - Module metadata are formatted and placed in kernel space. */ int -md_load(char *args, vm_offset_t *modulep) +md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtbp) { struct preloaded_file *kfp; struct preloaded_file *xp; @@ -289,6 +289,7 @@ md_load(char *args, vm_offset_t *modulep int howto; howto = md_getboothowto(args); + *dtbp = 0; /* * Allow the environment variable 'rootdev' to override the supplied device From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 03:31:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49ECD874; Mon, 9 Mar 2015 03:31:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 360E21DD; Mon, 9 Mar 2015 03:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t293VRcI038748; Mon, 9 Mar 2015 03:31:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t293VRHI038747; Mon, 9 Mar 2015 03:31:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201503090331.t293VRHI038747@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Mar 2015 03:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279800 - head/usr.bin/w X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 03:31:28 -0000 Author: markj Date: Mon Mar 9 03:31:26 2015 New Revision: 279800 URL: https://svnweb.freebsd.org/changeset/base/279800 Log: Call xo_finish(3) before exiting in usage(). Modified: head/usr.bin/w/w.c Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Mon Mar 9 02:57:34 2015 (r279799) +++ head/usr.bin/w/w.c Mon Mar 9 03:31:26 2015 (r279800) @@ -554,5 +554,6 @@ usage(int wcmd) xo_error("usage: w [-dhin] [-M core] [-N system] [user ...]\n"); else xo_error("usage: uptime\n"); + xo_finish(); exit(1); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 03:50:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0C3AB08; Mon, 9 Mar 2015 03:50:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 99DA13B1; Mon, 9 Mar 2015 03:50:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t293otqu046390; Mon, 9 Mar 2015 03:50:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t293osVX046383; Mon, 9 Mar 2015 03:50:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201503090350.t293osVX046383@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Mar 2015 03:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279801 - in head: share/man/man5 sys/conf sys/kern sys/net sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 03:50:55 -0000 Author: markj Date: Mon Mar 9 03:50:53 2015 New Revision: 279801 URL: https://svnweb.freebsd.org/changeset/base/279801 Log: Reimplement support for userland core dump compression using a new interface in kern_gzio.c. The old gzio interface was somewhat inflexible and has not worked properly since r272535: currently, the gzio functions are called with a range lock held on the output vnode, but kern_gzio.c does not pass the IO_RANGELOCKED flag to vn_rdwr() calls, resulting in deadlock when vn_rdwr() attempts to reacquire the range lock. Moreover, the new gzio interface can be used to implement kernel core compression. This change also modifies the kernel configuration options needed to enable userland core dump compression support: gzio is now an option rather than a device, and the COMPRESS_USER_CORES option is removed. Core dump compression is enabled using the kern.compress_user_cores sysctl/tunable. Differential Revision: https://reviews.freebsd.org/D1832 Reviewed by: rpaulo Discussed with: kib Added: head/sys/sys/gzio.h (contents, props changed) Modified: head/share/man/man5/core.5 head/sys/conf/NOTES head/sys/conf/options head/sys/kern/imgact_elf.c head/sys/kern/kern_gzio.c head/sys/kern/kern_sig.c head/sys/net/zlib.h Modified: head/share/man/man5/core.5 ============================================================================== --- head/share/man/man5/core.5 Mon Mar 9 03:31:26 2015 (r279800) +++ head/share/man/man5/core.5 Mon Mar 9 03:50:53 2015 (r279801) @@ -28,7 +28,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd November 22, 2012 +.Dd March 8, 2015 .Dt CORE 5 .Os .Sh NAME @@ -101,25 +101,23 @@ variable .Va kern.sugid_coredump to 1. .Pp -Corefiles can be compressed by the kernel if the following items -are included in the kernel configuration file: +Corefiles can be compressed by the kernel if the following item +is included in the kernel configuration file: .Bl -tag -width "1234567890" -compact -offset "12345" .It options -COMPRESS_USER_CORES -.It devices -gzio +GZIO .El .Pp -When COMPRESS_USER_CORES is included the following sysctls can control -if core files will be compressed: +When the GZIO option is included, the following sysctls control whether core +files will be compressed: .Bl -tag -width "kern.compress_user_cores_gzlevel" -compact -offset "12345" .It Em kern.compress_user_cores_gzlevel Gzip compression level. -Defaults to -1. +Defaults to 6. .It Em kern.compress_user_cores Actually compress user cores. -Core files will have the suffix -.Em .gz +Compressed core files will have a suffix of +.Ql .gz appended to them. .El .Sh EXAMPLES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Mar 9 03:31:26 2015 (r279800) +++ head/sys/conf/NOTES Mon Mar 9 03:50:53 2015 (r279801) @@ -2889,11 +2889,6 @@ options SHMMNI=33 # a single process at one time. options SHMSEG=9 -# Compress user core dumps. -options COMPRESS_USER_CORES -# required to compress file output from kernel for COMPRESS_USER_CORES. -device gzio - # Set the amount of time (in seconds) the system will wait before # rebooting automatically when a kernel panic occurs. If set to (-1), # the system will wait indefinitely until a key is pressed on the @@ -2983,3 +2978,7 @@ options RANDOM_DEBUG # Debugging messag # Module to enable execution of application via emulators like QEMU options IMAGACT_BINMISC + +# zlib I/O stream support +# This enables support for compressed core dumps. +options GZIO Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Mar 9 03:31:26 2015 (r279800) +++ head/sys/conf/options Mon Mar 9 03:50:53 2015 (r279801) @@ -87,13 +87,13 @@ COMPAT_FREEBSD9 opt_compat.h COMPAT_FREEBSD10 opt_compat.h COMPAT_LINUXAPI opt_compat.h COMPILING_LINT opt_global.h -COMPRESS_USER_CORES opt_core.h CY_PCI_FASTINTR DEADLKRES opt_watchdog.h DIRECTIO FILEMON opt_dontuse.h FFCLOCK FULL_PREEMPTION opt_sched.h +GZIO opt_gzio.h IMAGACT_BINMISC opt_dontuse.h IPI_PREEMPTION opt_sched.h GEOM_AES opt_geom.h Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Mar 9 03:31:26 2015 (r279800) +++ head/sys/kern/imgact_elf.c Mon Mar 9 03:50:53 2015 (r279801) @@ -33,12 +33,13 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" #include "opt_compat.h" -#include "opt_core.h" +#include "opt_gzio.h" #include #include #include #include +#include #include #include #include @@ -69,8 +70,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include @@ -105,11 +104,7 @@ static Elf_Word __elfN(untrans_prot)(vm_ SYSCTL_NODE(_kern, OID_AUTO, __CONCAT(elf, __ELF_WORD_SIZE), CTLFLAG_RW, 0, ""); -#ifdef COMPRESS_USER_CORES -static int compress_core(gzFile, char *, char *, unsigned int, - struct thread * td); -#endif -#define CORE_BUF_SIZE (16 * 1024) +#define CORE_BUF_SIZE (16 * 1024) int __elfN(fallback_brand) = -1; SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, @@ -1067,11 +1062,23 @@ struct note_info { TAILQ_HEAD(note_info_list, note_info); +/* Coredump output parameters. */ +struct coredump_params { + off_t offset; + struct ucred *active_cred; + struct ucred *file_cred; + struct thread *td; + struct vnode *vp; + struct gzio_stream *gzs; +}; + static void cb_put_phdr(vm_map_entry_t, void *); static void cb_size_segment(vm_map_entry_t, void *); +static int core_write(struct coredump_params *, void *, size_t, off_t, + enum uio_seg); static void each_writable_segment(struct thread *, segment_callback, void *); -static int __elfN(corehdr)(struct thread *, struct vnode *, struct ucred *, - int, void *, size_t, struct note_info_list *, size_t, gzFile); +static int __elfN(corehdr)(struct coredump_params *, int, void *, size_t, + struct note_info_list *, size_t); static void __elfN(prepare_notes)(struct thread *, struct note_info_list *, size_t *); static void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t); @@ -1095,42 +1102,60 @@ static void note_procstat_rlimit(void *, static void note_procstat_umask(void *, struct sbuf *, size_t *); static void note_procstat_vmmap(void *, struct sbuf *, size_t *); -#ifdef COMPRESS_USER_CORES -extern int compress_user_cores; +#ifdef GZIO extern int compress_user_cores_gzlevel; -#endif +/* + * Write out a core segment to the compression stream. + */ static int -core_output(struct vnode *vp, void *base, size_t len, off_t offset, - struct ucred *active_cred, struct ucred *file_cred, - struct thread *td, char *core_buf, gzFile gzfile) { - +compress_chunk(struct coredump_params *p, char *base, char *buf, u_int len) +{ + u_int chunk_len; int error; - if (gzfile) { -#ifdef COMPRESS_USER_CORES - error = compress_core(gzfile, base, core_buf, len, td); -#else - panic("shouldn't be here"); -#endif - } else { - error = vn_rdwr_inchunks(UIO_WRITE, vp, base, len, offset, - UIO_USERSPACE, IO_UNIT | IO_DIRECT | IO_RANGELOCKED, - active_cred, file_cred, NULL, td); + + while (len > 0) { + chunk_len = MIN(len, CORE_BUF_SIZE); + copyin(base, buf, chunk_len); + error = gzio_write(p->gzs, buf, chunk_len); + if (error != 0) + break; + base += chunk_len; + len -= chunk_len; } return (error); } -/* Coredump output parameters for sbuf drain routine. */ -struct sbuf_drain_core_params { - off_t offset; - struct ucred *active_cred; - struct ucred *file_cred; - struct thread *td; - struct vnode *vp; -#ifdef COMPRESS_USER_CORES - gzFile gzfile; +static int +core_gz_write(void *base, size_t len, off_t offset, void *arg) +{ + + return (core_write((struct coredump_params *)arg, base, len, offset, + UIO_SYSSPACE)); +} +#endif /* GZIO */ + +static int +core_write(struct coredump_params *p, void *base, size_t len, off_t offset, + enum uio_seg seg) +{ + + return (vn_rdwr_inchunks(UIO_WRITE, p->vp, base, len, offset, + seg, IO_UNIT | IO_DIRECT | IO_RANGELOCKED, + p->active_cred, p->file_cred, NULL, p->td)); +} + +static int +core_output(void *base, size_t len, off_t offset, struct coredump_params *p, + void *tmpbuf) +{ + +#ifdef GZIO + if (p->gzs != NULL) + return (compress_chunk(p, base, tmpbuf, len)); #endif -}; + return (core_write(p, base, len, offset, UIO_USERSPACE)); +} /* * Drain into a core file. @@ -1138,10 +1163,10 @@ struct sbuf_drain_core_params { static int sbuf_drain_core_output(void *arg, const char *data, int len) { - struct sbuf_drain_core_params *p; + struct coredump_params *p; int error, locked; - p = (struct sbuf_drain_core_params *)arg; + p = (struct coredump_params *)arg; /* * Some kern_proc out routines that print to this sbuf may @@ -1154,16 +1179,13 @@ sbuf_drain_core_output(void *arg, const locked = PROC_LOCKED(p->td->td_proc); if (locked) PROC_UNLOCK(p->td->td_proc); -#ifdef COMPRESS_USER_CORES - if (p->gzfile != Z_NULL) - error = compress_core(p->gzfile, NULL, __DECONST(char *, data), - len, p->td); +#ifdef GZIO + if (p->gzs != NULL) + error = gzio_write(p->gzs, __DECONST(char *, data), len); else #endif - error = vn_rdwr_inchunks(UIO_WRITE, p->vp, - __DECONST(void *, data), len, p->offset, UIO_SYSSPACE, - IO_UNIT | IO_DIRECT | IO_RANGELOCKED, p->active_cred, - p->file_cred, NULL, p->td); + error = core_write(p, __DECONST(void *, data), len, p->offset, + UIO_SYSSPACE); if (locked) PROC_LOCK(p->td->td_proc); if (error != 0) @@ -1192,42 +1214,16 @@ __elfN(coredump)(struct thread *td, stru int error = 0; struct sseg_closure seginfo; struct note_info_list notelst; + struct coredump_params params; struct note_info *ninfo; - void *hdr; + void *hdr, *tmpbuf; size_t hdrsize, notesz, coresize; + boolean_t compress; - gzFile gzfile = Z_NULL; - char *core_buf = NULL; -#ifdef COMPRESS_USER_CORES - char gzopen_flags[8]; - char *p; - int doing_compress = flags & IMGACT_CORE_COMPRESS; -#endif - + compress = (flags & IMGACT_CORE_COMPRESS) != 0; hdr = NULL; TAILQ_INIT(¬elst); -#ifdef COMPRESS_USER_CORES - if (doing_compress) { - p = gzopen_flags; - *p++ = 'w'; - if (compress_user_cores_gzlevel >= 0 && - compress_user_cores_gzlevel <= 9) - *p++ = '0' + compress_user_cores_gzlevel; - *p = 0; - gzfile = gz_open("", gzopen_flags, vp); - if (gzfile == Z_NULL) { - error = EFAULT; - goto done; - } - core_buf = malloc(CORE_BUF_SIZE, M_TEMP, M_WAITOK | M_ZERO); - if (!core_buf) { - error = ENOMEM; - goto done; - } - } -#endif - /* Size the program segments. */ seginfo.count = 0; seginfo.size = 0; @@ -1254,6 +1250,28 @@ __elfN(coredump)(struct thread *td, stru goto done; } + /* Set up core dump parameters. */ + params.offset = 0; + params.active_cred = cred; + params.file_cred = NOCRED; + params.td = td; + params.vp = vp; + params.gzs = NULL; + + tmpbuf = NULL; +#ifdef GZIO + /* Create a compression stream if necessary. */ + if (compress) { + params.gzs = gzio_init(core_gz_write, GZIO_DEFLATE, + CORE_BUF_SIZE, compress_user_cores_gzlevel, ¶ms); + if (params.gzs == NULL) { + error = EFAULT; + goto done; + } + tmpbuf = malloc(CORE_BUF_SIZE, M_TEMP, M_WAITOK | M_ZERO); + } +#endif + /* * Allocate memory for building the header, fill it up, * and write it out following the notes. @@ -1263,8 +1281,8 @@ __elfN(coredump)(struct thread *td, stru error = EINVAL; goto done; } - error = __elfN(corehdr)(td, vp, cred, seginfo.count, hdr, hdrsize, - ¬elst, notesz, gzfile); + error = __elfN(corehdr)(¶ms, seginfo.count, hdr, hdrsize, ¬elst, + notesz); /* Write the contents of all of the writable segments. */ if (error == 0) { @@ -1275,13 +1293,17 @@ __elfN(coredump)(struct thread *td, stru php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; offset = round_page(hdrsize + notesz); for (i = 0; i < seginfo.count; i++) { - error = core_output(vp, (caddr_t)(uintptr_t)php->p_vaddr, - php->p_filesz, offset, cred, NOCRED, curthread, core_buf, gzfile); + error = core_output((caddr_t)(uintptr_t)php->p_vaddr, + php->p_filesz, offset, ¶ms, tmpbuf); if (error != 0) break; offset += php->p_filesz; php++; } +#ifdef GZIO + if (error == 0 && compress) + error = gzio_flush(params.gzs); +#endif } if (error) { log(LOG_WARNING, @@ -1290,11 +1312,11 @@ __elfN(coredump)(struct thread *td, stru } done: -#ifdef COMPRESS_USER_CORES - if (core_buf) - free(core_buf, M_TEMP); - if (gzfile) - gzclose(gzfile); +#ifdef GZIO + if (compress) { + free(tmpbuf, M_TEMP); + gzio_fini(params.gzs); + } #endif while ((ninfo = TAILQ_FIRST(¬elst)) != NULL) { TAILQ_REMOVE(¬elst, ninfo, link); @@ -1419,29 +1441,19 @@ each_writable_segment(td, func, closure) * the page boundary. */ static int -__elfN(corehdr)(struct thread *td, struct vnode *vp, struct ucred *cred, - int numsegs, void *hdr, size_t hdrsize, struct note_info_list *notelst, - size_t notesz, gzFile gzfile) +__elfN(corehdr)(struct coredump_params *p, int numsegs, void *hdr, + size_t hdrsize, struct note_info_list *notelst, size_t notesz) { - struct sbuf_drain_core_params params; struct note_info *ninfo; struct sbuf *sb; int error; /* Fill in the header. */ bzero(hdr, hdrsize); - __elfN(puthdr)(td, hdr, hdrsize, numsegs, notesz); + __elfN(puthdr)(p->td, hdr, hdrsize, numsegs, notesz); - params.offset = 0; - params.active_cred = cred; - params.file_cred = NOCRED; - params.td = td; - params.vp = vp; -#ifdef COMPRESS_USER_CORES - params.gzfile = gzfile; -#endif sb = sbuf_new(NULL, NULL, CORE_BUF_SIZE, SBUF_FIXEDLEN); - sbuf_set_drain(sb, sbuf_drain_core_output, ¶ms); + sbuf_set_drain(sb, sbuf_drain_core_output, p); sbuf_start_section(sb, NULL); sbuf_bcat(sb, hdr, hdrsize); TAILQ_FOREACH(ninfo, notelst, link) @@ -2108,58 +2120,6 @@ static struct execsw __elfN(execsw) = { }; EXEC_SET(__CONCAT(elf, __ELF_WORD_SIZE), __elfN(execsw)); -#ifdef COMPRESS_USER_CORES -/* - * Compress and write out a core segment for a user process. - * - * 'inbuf' is the starting address of a VM segment in the process' address - * space that is to be compressed and written out to the core file. 'dest_buf' - * is a buffer in the kernel's address space. The segment is copied from - * 'inbuf' to 'dest_buf' first before being processed by the compression - * routine gzwrite(). This copying is necessary because the content of the VM - * segment may change between the compression pass and the crc-computation pass - * in gzwrite(). This is because realtime threads may preempt the UNIX kernel. - * - * If inbuf is NULL it is assumed that data is already copied to 'dest_buf'. - */ -static int -compress_core (gzFile file, char *inbuf, char *dest_buf, unsigned int len, - struct thread *td) -{ - int len_compressed; - int error = 0; - unsigned int chunk_len; - - while (len) { - if (inbuf != NULL) { - chunk_len = (len > CORE_BUF_SIZE) ? CORE_BUF_SIZE : len; - copyin(inbuf, dest_buf, chunk_len); - inbuf += chunk_len; - } else { - chunk_len = len; - } - len_compressed = gzwrite(file, dest_buf, chunk_len); - - EVENTHANDLER_INVOKE(app_coredump_progress, td, len_compressed); - - if ((unsigned int)len_compressed != chunk_len) { - log(LOG_WARNING, - "compress_core: length mismatch (0x%x returned, " - "0x%x expected)\n", len_compressed, chunk_len); - EVENTHANDLER_INVOKE(app_coredump_error, td, - "compress_core: length mismatch %x -> %x", - chunk_len, len_compressed); - error = EFAULT; - break; - } - len -= chunk_len; - maybe_yield(); - } - - return (error); -} -#endif /* COMPRESS_USER_CORES */ - static vm_prot_t __elfN(trans_prot)(Elf_Word flags) { Modified: head/sys/kern/kern_gzio.c ============================================================================== --- head/sys/kern/kern_gzio.c Mon Mar 9 03:31:26 2015 (r279800) +++ head/sys/kern/kern_gzio.c Mon Mar 9 03:50:53 2015 (r279801) @@ -1,400 +1,223 @@ -/* - * $Id: kern_gzio.c,v 1.6 2008-10-18 22:54:45 lbazinet Exp $ +/*- + * Copyright (c) 2014 Mark Johnston * - * core_gzip.c -- gzip routines used in compressing user process cores + * 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 file is derived from src/lib/libz/gzio.c in FreeBSD. + * 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. */ -/* gzio.c -- IO on .gz files - * Copyright (C) 1995-1998 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - * - */ - -/* @(#) $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); #include -#include + +#include +#include #include -#include -#include -#include + #include -#include -#include -#include +#define KERN_GZ_HDRLEN 10 /* gzip header length */ +#define KERN_GZ_TRAILERLEN 8 /* gzip trailer length */ +#define KERN_GZ_MAGIC1 0x1f /* first magic byte */ +#define KERN_GZ_MAGIC2 0x8b /* second magic byte */ -#define GZ_HEADER_LEN 10 +MALLOC_DEFINE(M_GZIO, "gzio", "zlib state"); -#ifndef Z_BUFSIZE -# ifdef MAXSEG_64K -# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */ -# else -# define Z_BUFSIZE 16384 -# endif -#endif -#ifndef Z_PRINTF_BUFSIZE -# define Z_PRINTF_BUFSIZE 4096 -#endif - -#define ALLOC(size) malloc(size, M_TEMP, M_WAITOK | M_ZERO) -#define TRYFREE(p) {if (p) free(p, M_TEMP);} - -static int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ - -/* gzip flag byte */ -#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ -#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ -#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ -#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ -#define COMMENT 0x10 /* bit 4 set: file comment present */ -#define RESERVED 0xE0 /* bits 5..7: reserved */ - -typedef struct gz_stream { - z_stream stream; - int z_err; /* error code for last stream operation */ - int z_eof; /* set if end of input file */ - struct vnode *file; /* vnode pointer of .gz file */ - Byte *inbuf; /* input buffer */ - Byte *outbuf; /* output buffer */ - uLong crc; /* crc32 of uncompressed data */ - char *msg; /* error message */ - char *path; /* path name for debugging only */ - int transparent; /* 1 if input file is not a .gz file */ - char mode; /* 'w' or 'r' */ - long startpos; /* start of compressed data in file (header skipped) */ - off_t outoff; /* current offset in output file */ - int flags; -} gz_stream; - - -local int do_flush OF((gzFile file, int flush)); -local int destroy OF((gz_stream *s)); -local void putU32 OF((gz_stream *file, uint32_t x)); -local void *gz_alloc OF((void *notused, u_int items, u_int size)); -local void gz_free OF((void *notused, void *ptr)); - -/* =========================================================================== - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb"). The file is given either by file descriptor - or path name (if fd == -1). - gz_open return NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). -*/ -gzFile gz_open (path, mode, vp) - const char *path; - const char *mode; - struct vnode *vp; -{ - int err; - int level = Z_DEFAULT_COMPRESSION; /* compression level */ - int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */ - const char *p = mode; - gz_stream *s; - char fmode[80]; /* copy of mode, without the compression level */ - char *m = fmode; - ssize_t resid; - int error; - char buf[GZ_HEADER_LEN + 1]; - - if (!path || !mode) return Z_NULL; - - s = (gz_stream *)ALLOC(sizeof(gz_stream)); - if (!s) return Z_NULL; - - s->stream.zalloc = (alloc_func)gz_alloc; - s->stream.zfree = (free_func)gz_free; - s->stream.opaque = (voidpf)0; - s->stream.next_in = s->inbuf = Z_NULL; - s->stream.next_out = s->outbuf = Z_NULL; - s->stream.avail_in = s->stream.avail_out = 0; - s->file = NULL; - s->z_err = Z_OK; - s->z_eof = 0; - s->crc = 0; - s->msg = NULL; - s->transparent = 0; - s->outoff = 0; - s->flags = 0; - - s->path = (char*)ALLOC(strlen(path)+1); - if (s->path == NULL) { - return destroy(s), (gzFile)Z_NULL; - } - strcpy(s->path, path); /* do this early for debugging */ - - s->mode = '\0'; - do { - if (*p == 'r') s->mode = 'r'; - if (*p == 'w' || *p == 'a') s->mode = 'w'; - if (*p >= '0' && *p <= '9') { - level = *p - '0'; - } else if (*p == 'f') { - strategy = Z_FILTERED; - } else if (*p == 'h') { - strategy = Z_HUFFMAN_ONLY; - } else { - *m++ = *p; /* copy the mode */ - } - } while (*p++ && m != fmode + sizeof(fmode)); - - if (s->mode != 'w') { - log(LOG_ERR, "gz_open: mode is not w (%c)\n", s->mode); - return destroy(s), (gzFile)Z_NULL; - } - - err = deflateInit2(&(s->stream), level, - Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy); - /* windowBits is passed < 0 to suppress zlib header */ - - s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); - if (err != Z_OK || s->outbuf == Z_NULL) { - return destroy(s), (gzFile)Z_NULL; - } - - s->stream.avail_out = Z_BUFSIZE; - s->file = vp; - - /* Write a very simple .gz header: - */ - snprintf(buf, sizeof(buf), "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], - gz_magic[1], Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, - 0 /*xflags*/, OS_CODE); - - if ((error = vn_rdwr(UIO_WRITE, s->file, buf, GZ_HEADER_LEN, s->outoff, - UIO_SYSSPACE, IO_UNIT, curproc->p_ucred, - NOCRED, &resid, curthread))) { - s->outoff += GZ_HEADER_LEN - resid; - return destroy(s), (gzFile)Z_NULL; - } - s->outoff += GZ_HEADER_LEN; - s->startpos = 10L; - - return (gzFile)s; -} +struct gzio_stream { + uint8_t * gz_buffer; /* output buffer */ + size_t gz_bufsz; /* total buffer size */ + off_t gz_off; /* offset into the output stream */ + enum gzio_mode gz_mode; /* stream mode */ + uint32_t gz_crc; /* stream CRC32 */ + gzio_cb gz_cb; /* output callback */ + void * gz_arg; /* private callback arg */ + z_stream gz_stream; /* zlib state */ +}; +static void * gz_alloc(void *, u_int, u_int); +static void gz_free(void *, void *); +static int gz_write(struct gzio_stream *, void *, u_int, int); - /* =========================================================================== - * Cleanup then free the given gz_stream. Return a zlib error code. - Try freeing in the reverse order of allocations. - */ -local int destroy (s) - gz_stream *s; +struct gzio_stream * +gzio_init(gzio_cb cb, enum gzio_mode mode, size_t bufsz, int level, void *arg) { - int err = Z_OK; - - if (!s) return Z_STREAM_ERROR; + struct gzio_stream *s; + uint8_t *hdr; + int error; - TRYFREE(s->msg); - - if (s->stream.state != NULL) { - if (s->mode == 'w') { - err = deflateEnd(&(s->stream)); - } - } - if (s->z_err < 0) err = s->z_err; - - TRYFREE(s->inbuf); - TRYFREE(s->outbuf); - TRYFREE(s->path); - TRYFREE(s); - return err; -} + if (bufsz < KERN_GZ_HDRLEN) + return (NULL); + if (mode != GZIO_DEFLATE) + return (NULL); + s = gz_alloc(NULL, 1, sizeof(*s)); + s->gz_bufsz = bufsz; + s->gz_buffer = gz_alloc(NULL, 1, s->gz_bufsz); + s->gz_mode = mode; + s->gz_crc = ~0U; + s->gz_cb = cb; + s->gz_arg = arg; -/* =========================================================================== - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of bytes actually written (0 in case of error). -*/ -int ZEXPORT gzwrite (file, buf, len) - gzFile file; - const voidp buf; - unsigned len; -{ - gz_stream *s = (gz_stream*)file; - off_t curoff; - size_t resid; - int error; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - s->stream.next_in = (Bytef*)buf; - s->stream.avail_in = len; - - curoff = s->outoff; - while (s->stream.avail_in != 0) { - - if (s->stream.avail_out == 0) { - - s->stream.next_out = s->outbuf; - error = vn_rdwr_inchunks(UIO_WRITE, s->file, s->outbuf, Z_BUFSIZE, - curoff, UIO_SYSSPACE, IO_UNIT, - curproc->p_ucred, NOCRED, &resid, curthread); - if (error) { - log(LOG_ERR, "gzwrite: vn_rdwr return %d\n", error); - curoff += Z_BUFSIZE - resid; - s->z_err = Z_ERRNO; - break; - } - curoff += Z_BUFSIZE; - s->stream.avail_out = Z_BUFSIZE; - } - s->z_err = deflate(&(s->stream), Z_NO_FLUSH); - if (s->z_err != Z_OK) { - log(LOG_ERR, - "gzwrite: deflate returned error %d\n", s->z_err); - break; - } - } + s->gz_stream.zalloc = gz_alloc; + s->gz_stream.zfree = gz_free; + s->gz_stream.opaque = NULL; + s->gz_stream.next_in = Z_NULL; + s->gz_stream.avail_in = 0; - s->crc = ~crc32_raw(buf, len, ~s->crc); - s->outoff = curoff; + error = deflateInit2(&s->gz_stream, level, Z_DEFLATED, -MAX_WBITS, + DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + if (error != 0) + goto fail; - return (int)(len - s->stream.avail_in); -} + s->gz_stream.avail_out = s->gz_bufsz; + s->gz_stream.next_out = s->gz_buffer; + /* Write the gzip header to the output buffer. */ + hdr = s->gz_buffer; + memset(hdr, 0, KERN_GZ_HDRLEN); + hdr[0] = KERN_GZ_MAGIC1; + hdr[1] = KERN_GZ_MAGIC2; + hdr[2] = Z_DEFLATED; + hdr[9] = OS_CODE; + s->gz_stream.next_out += KERN_GZ_HDRLEN; + s->gz_stream.avail_out -= KERN_GZ_HDRLEN; -/* =========================================================================== - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. -*/ -local int do_flush (file, flush) - gzFile file; - int flush; -{ - uInt len; - int done = 0; - gz_stream *s = (gz_stream*)file; - off_t curoff = s->outoff; - size_t resid; - int error; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - if (s->stream.avail_in) { - log(LOG_WARNING, "do_flush: avail_in non-zero on entry\n"); - } - - s->stream.avail_in = 0; /* should be zero already anyway */ - - for (;;) { - len = Z_BUFSIZE - s->stream.avail_out; - - if (len != 0) { - error = vn_rdwr_inchunks(UIO_WRITE, s->file, s->outbuf, len, curoff, - UIO_SYSSPACE, IO_UNIT, curproc->p_ucred, - NOCRED, &resid, curthread); - if (error) { - s->z_err = Z_ERRNO; - s->outoff = curoff + len - resid; - return Z_ERRNO; - } - s->stream.next_out = s->outbuf; - s->stream.avail_out = Z_BUFSIZE; - curoff += len; - } - if (done) break; - s->z_err = deflate(&(s->stream), flush); - - /* Ignore the second of two consecutive flushes: */ - if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK; - - /* deflate has finished flushing only when it hasn't used up - * all the available space in the output buffer: - */ - done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END); - - if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break; - } - s->outoff = curoff; + return (s); - return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; +fail: + gz_free(NULL, s->gz_buffer); + gz_free(NULL, s); + return (NULL); } -int ZEXPORT gzflush (file, flush) - gzFile file; - int flush; +int +gzio_write(struct gzio_stream *s, void *data, u_int len) { - gz_stream *s = (gz_stream*)file; - int err = do_flush (file, flush); - if (err) return err; - return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; + return (gz_write(s, data, len, Z_NO_FLUSH)); } - -/* =========================================================================== - Outputs a long in LSB order to the given file -*/ -local void putU32 (s, x) - gz_stream *s; - uint32_t x; +int +gzio_flush(struct gzio_stream *s) { - uint32_t xx; - off_t curoff = s->outoff; - ssize_t resid; - -#if BYTE_ORDER == BIG_ENDIAN - xx = bswap32(x); -#else - xx = x; -#endif - vn_rdwr(UIO_WRITE, s->file, (caddr_t)&xx, sizeof(xx), curoff, - UIO_SYSSPACE, IO_UNIT, curproc->p_ucred, - NOCRED, &resid, curthread); - s->outoff += sizeof(xx) - resid; -} + return (gz_write(s, NULL, 0, Z_FINISH)); +} -/* =========================================================================== - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. -*/ -int ZEXPORT gzclose (file) - gzFile file; +void +gzio_fini(struct gzio_stream *s) { - int err; - gz_stream *s = (gz_stream*)file; - - if (s == NULL) return Z_STREAM_ERROR; - if (s->mode == 'w') { - err = do_flush (file, Z_FINISH); - if (err != Z_OK) { - log(LOG_ERR, "gzclose: do_flush failed (err %d)\n", err); - return destroy((gz_stream*)file); - } -#if 0 - printf("gzclose: putting crc: %lld total: %lld\n", - (long long)s->crc, (long long)s->stream.total_in); - printf("sizeof uLong = %d\n", (int)sizeof(uLong)); -#endif - putU32 (s, s->crc); - putU32 (s, (uint32_t) s->stream.total_in); - } - return destroy((gz_stream*)file); + (void)deflateEnd(&s->gz_stream); + gz_free(NULL, s->gz_buffer); + gz_free(NULL, s); } -/* - * Space allocation and freeing routines for use by zlib routines when called - * from gzip modules. - */ static void * -gz_alloc(void *notused __unused, u_int items, u_int size) +gz_alloc(void *arg __unused, u_int n, u_int sz) { - void *ptr; - MALLOC(ptr, void *, items * size, M_TEMP, M_NOWAIT | M_ZERO); - return ptr; + /* + * Memory for zlib state is allocated using M_NODUMP since it may be + * used to compress a kernel dump, and we don't want zlib to attempt to + * compress its own state. + */ + return (malloc(n * sz, M_GZIO, M_WAITOK | M_ZERO | M_NODUMP)); } - + static void -gz_free(void *opaque __unused, void *ptr) +gz_free(void *arg __unused, void *ptr) { - FREE(ptr, M_TEMP); + + free(ptr, M_GZIO); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 04:00:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40E04F15; Mon, 9 Mar 2015 04:00:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 12393689; Mon, 9 Mar 2015 04:00:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2940kbs051488; Mon, 9 Mar 2015 04:00:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2940kYc051487; Mon, 9 Mar 2015 04:00:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201503090400.t2940kYc051487@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Mar 2015 04:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279802 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 04:00:47 -0000 Author: markj Date: Mon Mar 9 04:00:46 2015 New Revision: 279802 URL: https://svnweb.freebsd.org/changeset/base/279802 Log: Don't specify a function name in the example SDT(9) probe. As with the module component, it is a bug that the SDT(9) KPI allows one to specify the function component of an SDT probe. Currently, the module component is filled in automatically if left unset; this is not yet true for the function component, but will be addressed by some ongoing work. MFC after: 3 days Modified: head/share/man/man9/SDT.9 Modified: head/share/man/man9/SDT.9 ============================================================================== --- head/share/man/man9/SDT.9 Mon Mar 9 03:50:53 2015 (r279801) +++ head/share/man/man9/SDT.9 Mon Mar 9 04:00:46 2015 (r279802) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2014 +.Dd March 8, 2015 .Dt SDT 9 .Os .Sh NAME @@ -196,13 +196,13 @@ They are meant to be added to executable code in which they are called. .Sh EXAMPLES The following probe definition will create a DTrace probe called -.Ql icmp::unreach:pkt-receive , +.Ql icmp:::receive-unreachable , which would hypothetically be triggered when the kernel receives an ICMP packet of type Destination Unreachable: .Bd -literal -offset indent SDT_PROVIDER_DECLARE(icmp); -SDT_PROBE_DEFINE1(icmp, , unreach, pkt__receive, +SDT_PROBE_DEFINE1(icmp, , , receive__unreachable, "struct icmp *"); .Ed @@ -286,10 +286,10 @@ This manual page was written by .Sh BUGS The .Nm -macros allow the module name of a probe to be specified as part of a probe -definition. -However, the DTrace framework uses the module name of probes to determine -which probes should be destroyed when a kernel module is unloaded, so the module +macros allow the module and function names of a probe to be specified as part of +a probe definition. +The DTrace framework uses the module name of probes to determine which probes +should be destroyed when a kernel module is unloaded, so the module name of a probe should match the name of the module in which its defined. .Nm will set the module name properly if it is left unspecified in the probe From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 08:22:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 021A2B64; Mon, 9 Mar 2015 08:22:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 C81E2243; Mon, 9 Mar 2015 08:22:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t298MBFf073896; Mon, 9 Mar 2015 08:22:11 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t298MBpV073895; Mon, 9 Mar 2015 08:22:11 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201503090822.t298MBpV073895@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 9 Mar 2015 08:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279803 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 08:22:12 -0000 Author: araujo (ports committer) Date: Mon Mar 9 08:22:11 2015 New Revision: 279803 URL: https://svnweb.freebsd.org/changeset/base/279803 Log: Fix the media detected for copper cables NIC based on chipset X540T. Phabric: D811 Reviewed by: jfvogel Approved by: jfvogel Sponsored by: QNAP Systems Inc. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Mar 9 04:00:46 2015 (r279802) +++ head/sys/dev/ixgbe/ixgbe.c Mon Mar 9 08:22:11 2015 (r279803) @@ -1699,6 +1699,7 @@ static void ixgbe_media_status(struct ifnet * ifp, struct ifmediareq * ifmr) { struct adapter *adapter = ifp->if_softc; + struct ixgbe_hw *hw = &adapter->hw; INIT_DEBUGOUT("ixgbe_media_status: begin"); IXGBE_CORE_LOCK(adapter); @@ -1714,17 +1715,29 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_status |= IFM_ACTIVE; - switch (adapter->link_speed) { - case IXGBE_LINK_SPEED_100_FULL: - ifmr->ifm_active |= IFM_100_TX | IFM_FDX; - break; - case IXGBE_LINK_SPEED_1GB_FULL: - ifmr->ifm_active |= IFM_1000_SX | IFM_FDX; - break; - case IXGBE_LINK_SPEED_10GB_FULL: - ifmr->ifm_active |= adapter->optics | IFM_FDX; - break; - } + /* + * Not all NIC are 1000baseSX as an example X540T. + * We must set properly the media based on NIC model. + */ + switch (hw->device_id) { + case IXGBE_DEV_ID_X540T: + if (adapter->link_speed == IXGBE_LINK_SPEED_100_FULL) + ifmr->ifm_active |= IFM_100_TX | IFM_FDX; + else if (adapter->link_speed == IXGBE_LINK_SPEED_1GB_FULL) + ifmr->ifm_active |= IFM_1000_T | IFM_FDX; + else if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL) + ifmr->ifm_active |= adapter->optics | IFM_FDX; + break; + default: + if (adapter->link_speed == IXGBE_LINK_SPEED_100_FULL) + ifmr->ifm_active |= IFM_100_TX | IFM_FDX; + else if (adapter->link_speed == IXGBE_LINK_SPEED_1GB_FULL) + ifmr->ifm_active |= IFM_1000_SX | IFM_FDX; + else if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL) + ifmr->ifm_active |= adapter->optics | IFM_FDX; + break; + } + IXGBE_CORE_UNLOCK(adapter); From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 08:43:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD8A0E36; Mon, 9 Mar 2015 08:43:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 A991A657; Mon, 9 Mar 2015 08:43:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t298hS4i083221; Mon, 9 Mar 2015 08:43:28 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t298hS7F083220; Mon, 9 Mar 2015 08:43:28 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201503090843.t298hS7F083220@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 9 Mar 2015 08:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279804 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 08:43:28 -0000 Author: araujo (ports committer) Date: Mon Mar 9 08:43:27 2015 New Revision: 279804 URL: https://svnweb.freebsd.org/changeset/base/279804 Log: Now ifconfig(8) can set the media option as 10Gbase-T for ixgbe(4). Differential Revision: D823 Reviewed by: jfvogel Approved by: jfvogel Sponsored by: QNAP Systems Inc. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Mar 9 08:22:11 2015 (r279803) +++ head/sys/dev/ixgbe/ixgbe.c Mon Mar 9 08:43:27 2015 (r279804) @@ -1764,6 +1764,7 @@ ixgbe_media_change(struct ifnet * ifp) return (EINVAL); switch (IFM_SUBTYPE(ifm->ifm_media)) { + case IFM_10G_T: case IFM_AUTO: adapter->hw.phy.autoneg_advertised = IXGBE_LINK_SPEED_100_FULL | From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 10:29:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9550BFD3; Mon, 9 Mar 2015 10:29:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 76B401C3; Mon, 9 Mar 2015 10:29:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29ATFpB030892; Mon, 9 Mar 2015 10:29:15 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29ATFVB030890; Mon, 9 Mar 2015 10:29:15 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201503091029.t29ATFVB030890@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 9 Mar 2015 10:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279805 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 10:29:16 -0000 Author: araujo (ports committer) Date: Mon Mar 9 10:29:15 2015 New Revision: 279805 URL: https://svnweb.freebsd.org/changeset/base/279805 Log: Fix style(9) from my previous commit r279803. Spotted by: kevlo Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Mar 9 08:43:27 2015 (r279804) +++ head/sys/dev/ixgbe/ixgbe.c Mon Mar 9 10:29:15 2015 (r279805) @@ -1699,7 +1699,7 @@ static void ixgbe_media_status(struct ifnet * ifp, struct ifmediareq * ifmr) { struct adapter *adapter = ifp->if_softc; - struct ixgbe_hw *hw = &adapter->hw; + struct ixgbe_hw *hw = &adapter->hw; INIT_DEBUGOUT("ixgbe_media_status: begin"); IXGBE_CORE_LOCK(adapter); @@ -1715,29 +1715,28 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_status |= IFM_ACTIVE; - /* - * Not all NIC are 1000baseSX as an example X540T. - * We must set properly the media based on NIC model. - */ - switch (hw->device_id) { - case IXGBE_DEV_ID_X540T: - if (adapter->link_speed == IXGBE_LINK_SPEED_100_FULL) - ifmr->ifm_active |= IFM_100_TX | IFM_FDX; - else if (adapter->link_speed == IXGBE_LINK_SPEED_1GB_FULL) - ifmr->ifm_active |= IFM_1000_T | IFM_FDX; - else if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL) - ifmr->ifm_active |= adapter->optics | IFM_FDX; - break; - default: - if (adapter->link_speed == IXGBE_LINK_SPEED_100_FULL) - ifmr->ifm_active |= IFM_100_TX | IFM_FDX; - else if (adapter->link_speed == IXGBE_LINK_SPEED_1GB_FULL) - ifmr->ifm_active |= IFM_1000_SX | IFM_FDX; - else if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL) - ifmr->ifm_active |= adapter->optics | IFM_FDX; - break; - } - + /* + * Not all NIC are 1000baseSX as an example X540T. + * We must set properly the media based on NIC model. + */ + switch (hw->device_id) { + case IXGBE_DEV_ID_X540T: + if (adapter->link_speed == IXGBE_LINK_SPEED_100_FULL) + ifmr->ifm_active |= IFM_100_TX | IFM_FDX; + else if (adapter->link_speed == IXGBE_LINK_SPEED_1GB_FULL) + ifmr->ifm_active |= IFM_1000_T | IFM_FDX; + else if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL) + ifmr->ifm_active |= adapter->optics | IFM_FDX; + break; + default: + if (adapter->link_speed == IXGBE_LINK_SPEED_100_FULL) + ifmr->ifm_active |= IFM_100_TX | IFM_FDX; + else if (adapter->link_speed == IXGBE_LINK_SPEED_1GB_FULL) + ifmr->ifm_active |= IFM_1000_SX | IFM_FDX; + else if (adapter->link_speed == IXGBE_LINK_SPEED_10GB_FULL) + ifmr->ifm_active |= adapter->optics | IFM_FDX; + break; + } IXGBE_CORE_UNLOCK(adapter); From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 11:59:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9107C85; Mon, 9 Mar 2015 11:59:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 C470FCFC; Mon, 9 Mar 2015 11:59:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29BxxN2072360; Mon, 9 Mar 2015 11:59:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29Bxxfu072359; Mon, 9 Mar 2015 11:59:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503091159.t29Bxxfu072359@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Mar 2015 11:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279806 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 12:00:00 -0000 Author: trasz Date: Mon Mar 9 11:59:58 2015 New Revision: 279806 URL: https://svnweb.freebsd.org/changeset/base/279806 Log: Minor optimization/cleanup in node_path(); no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Mon Mar 9 10:29:15 2015 (r279805) +++ head/usr.sbin/autofs/common.c Mon Mar 9 11:59:58 2015 (r279806) @@ -561,7 +561,6 @@ static char * node_path_x(const struct node *n, char *x) { char *path; - size_t len; if (n->n_parent == NULL) return (x); @@ -580,14 +579,6 @@ node_path_x(const struct node *n, char * path = separated_concat(n->n_key, x, '/'); free(x); - /* - * Strip trailing slash. - */ - len = strlen(path); - assert(len > 0); - if (path[len - 1] == '/') - path[len - 1] = '\0'; - return (node_path_x(n->n_parent, path)); } @@ -598,8 +589,19 @@ node_path_x(const struct node *n, char * char * node_path(const struct node *n) { + char *path; + size_t len; + + path = node_path_x(n, checked_strdup("")); + + /* + * Strip trailing slash, unless the whole path is "/". + */ + len = strlen(path); + if (len > 1 && path[len - 1] == '/') + path[len - 1] = '\0'; - return (node_path_x(n, checked_strdup(""))); + return (path); } static char * From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 13:01:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9E3DB48; Mon, 9 Mar 2015 13:01:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 B53763BB; Mon, 9 Mar 2015 13:01:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29D10Cr002317; Mon, 9 Mar 2015 13:01:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29D10Fk002316; Mon, 9 Mar 2015 13:01:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503091301.t29D10Fk002316@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Mar 2015 13:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279807 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 13:01:00 -0000 Author: trasz Date: Mon Mar 9 13:00:59 2015 New Revision: 279807 URL: https://svnweb.freebsd.org/changeset/base/279807 Log: Improve separated_concat() to properly handle the case of concatenating "/" and "/foo". MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Mon Mar 9 11:59:58 2015 (r279806) +++ head/usr.sbin/autofs/common.c Mon Mar 9 13:00:59 2015 (r279807) @@ -136,8 +136,14 @@ separated_concat(const char *s1, const c assert(s1 != NULL); assert(s2 != NULL); - if (s1[0] == '\0' || s2[0] == '\0' || - s1[strlen(s1) - 1] == separator || s2[0] == separator) { + /* + * If s2 starts with separator - skip it; otherwise concatenating + * "/" and "/foo" would end up returning "//foo". + */ + if (s2[0] == separator) + s2++; + + if (s1[0] == '\0' || s2[0] == '\0' || s1[strlen(s1) - 1] == separator) { ret = asprintf(&result, "%s%s", s1, s2); } else { ret = asprintf(&result, "%s%c%s", s1, separator, s2); From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 13:21:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5ED426F; Mon, 9 Mar 2015 13:21:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 49A3380B; Mon, 9 Mar 2015 13:21:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29DL03A011593; Mon, 9 Mar 2015 13:21:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29DL04a011591; Mon, 9 Mar 2015 13:21:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503091321.t29DL04a011591@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Mar 2015 13:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279808 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 13:21:01 -0000 Author: trasz Date: Mon Mar 9 13:21:00 2015 New Revision: 279808 URL: https://svnweb.freebsd.org/changeset/base/279808 Log: Fix memory leak. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Mon Mar 9 13:00:59 2015 (r279807) +++ head/usr.sbin/autofs/common.c Mon Mar 9 13:21:00 2015 (r279808) @@ -615,9 +615,11 @@ node_options_x(const struct node *n, cha { char *options; + if (n == NULL) + return (x); + options = separated_concat(x, n->n_options, ','); - if (n->n_parent == NULL) - return (options); + free(x); return (node_options_x(n->n_parent, options)); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 14:42:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF41960B; Mon, 9 Mar 2015 14:42:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 AAD83208; Mon, 9 Mar 2015 14:42:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29EgQGV051907; Mon, 9 Mar 2015 14:42:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29EgQlq051906; Mon, 9 Mar 2015 14:42:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503091442.t29EgQlq051906@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Mar 2015 14:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279810 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 14:42:26 -0000 Author: ian Date: Mon Mar 9 14:42:25 2015 New Revision: 279810 URL: https://svnweb.freebsd.org/changeset/base/279810 Log: Clean data cache before instruction cache in armv7_icache_sync_range(). Also ensure dsb precedes isb in all icache maintenance routines (first do a data sync, then stall the instruction stream until it finishes). Submitted by: Michal Meloun Modified: head/sys/arm/arm/cpufunc_asm_armv7.S Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Mon Mar 9 14:01:35 2015 (r279809) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Mon Mar 9 14:42:25 2015 (r279810) @@ -247,8 +247,8 @@ ENTRY(armv7_idcache_wbinv_range) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_id_wbinv_next - isb /* instruction synchronization barrier */ dsb /* data synchronization barrier */ + isb /* instruction synchronization barrier */ RET END(armv7_idcache_wbinv_range) @@ -258,8 +258,8 @@ ENTRY_NP(armv7_icache_sync_all) #else mcr CP15_ICIALLU #endif - isb /* instruction synchronization barrier */ dsb /* data synchronization barrier */ + isb /* instruction synchronization barrier */ RET END(armv7_icache_sync_all) @@ -267,13 +267,13 @@ ENTRY_NP(armv7_icache_sync_range) ldr ip, .Larmv7_icache_line_size ldr ip, [ip] .Larmv7_sync_next: - mcr CP15_ICIMVAU(r0) mcr CP15_DCCMVAC(r0) + mcr CP15_ICIMVAU(r0) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_sync_next - isb /* instruction synchronization barrier */ dsb /* data synchronization barrier */ + isb /* instruction synchronization barrier */ RET END(armv7_icache_sync_range) From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 14:46:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C7F6790; Mon, 9 Mar 2015 14:46:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 3CFC9230; Mon, 9 Mar 2015 14:46:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29EkCWm052444; Mon, 9 Mar 2015 14:46:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29EkBp3052438; Mon, 9 Mar 2015 14:46:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503091446.t29EkBp3052438@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Mar 2015 14:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279811 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 14:46:12 -0000 Author: ian Date: Mon Mar 9 14:46:10 2015 New Revision: 279811 URL: https://svnweb.freebsd.org/changeset/base/279811 Log: Add minimum cache line sizes to struct cpuinfo, use them in the new cache maintenance routines. Also add a routine to invalidate the branch cache. Submitted by: Michal Meloun Modified: head/sys/arm/arm/cpuinfo.c head/sys/arm/arm/genassym.c head/sys/arm/include/cpu-v6.h head/sys/arm/include/cpuinfo.h Modified: head/sys/arm/arm/cpuinfo.c ============================================================================== --- head/sys/arm/arm/cpuinfo.c Mon Mar 9 14:42:25 2015 (r279810) +++ head/sys/arm/arm/cpuinfo.c Mon Mar 9 14:46:10 2015 (r279811) @@ -34,7 +34,14 @@ __FBSDID("$FreeBSD$"); #include #include -struct cpuinfo cpuinfo; +struct cpuinfo cpuinfo = +{ + /* Use safe defaults for start */ + .dcache_line_size = 32, + .dcache_line_mask = 31, + .icache_line_size = 32, + .icache_line_mask = 31, +}; /* Read and parse CPU id scheme */ void @@ -122,4 +129,10 @@ cpuinfo_init(void) cpuinfo.generic_timer_ext = (cpuinfo.id_pfr1 >> 16) & 0xF; cpuinfo.virtualization_ext = (cpuinfo.id_pfr1 >> 12) & 0xF; cpuinfo.security_ext = (cpuinfo.id_pfr1 >> 4) & 0xF; + + /* L1 Cache sizes */ + cpuinfo.dcache_line_size = 1 << (CPU_CT_DMINLINE(cpuinfo.ctr ) + 2); + cpuinfo.dcache_line_mask = cpuinfo.dcache_line_size - 1; + cpuinfo.icache_line_size= 1 << (CPU_CT_IMINLINE(cpuinfo.ctr ) + 2); + cpuinfo.icache_line_mask = cpuinfo.icache_line_size - 1; } Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Mon Mar 9 14:42:25 2015 (r279810) +++ head/sys/arm/arm/genassym.c Mon Mar 9 14:46:10 2015 (r279811) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -146,3 +147,8 @@ ASSYM(MAXCOMLEN, MAXCOMLEN); ASSYM(MAXCPU, MAXCPU); ASSYM(NIRQ, NIRQ); ASSYM(PCPU_SIZE, sizeof(struct pcpu)); + +ASSYM(DCACHE_LINE_SIZE, offsetof(struct cpuinfo, dcache_line_size)); +ASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask)); +ASSYM(ICACHE_LINE_SIZE, offsetof(struct cpuinfo, icache_line_size)); +ASSYM(ICACHE_LINE_MASK, offsetof(struct cpuinfo, icache_line_mask)); Modified: head/sys/arm/include/cpu-v6.h ============================================================================== --- head/sys/arm/include/cpu-v6.h Mon Mar 9 14:42:25 2015 (r279810) +++ head/sys/arm/include/cpu-v6.h Mon Mar 9 14:46:10 2015 (r279811) @@ -37,6 +37,9 @@ #define CPU_ASID_KERNEL 0 +vm_offset_t dcache_wb_pou_checked(vm_offset_t, vm_size_t); +vm_offset_t icache_inv_pou_checked(vm_offset_t, vm_size_t); + /* * Macros to generate CP15 (system control processor) read/write functions. */ @@ -302,7 +305,7 @@ icache_sync(vm_offset_t sva, vm_size_t s vm_offset_t eva = sva + size; dsb(); - for (va = sva; va < eva; va += arm_dcache_align) { + for (va = sva; va < eva; va += cpuinfo.dcache_line_size) { #if __ARM_ARCH >= 7 && defined SMP _CP15_DCCMVAU(va); #else @@ -332,6 +335,19 @@ icache_inv_all(void) isb(); } +/* Invalidate branch predictor buffer */ +static __inline void +bpb_inv_all(void) +{ +#if __ARM_ARCH >= 7 && defined SMP + _CP15_BPIALLIS(); +#else + _CP15_BPIALL(); +#endif + dsb(); + isb(); +} + /* Write back D-cache to PoU */ static __inline void dcache_wb_pou(vm_offset_t sva, vm_size_t size) @@ -340,7 +356,7 @@ dcache_wb_pou(vm_offset_t sva, vm_size_t vm_offset_t eva = sva + size; dsb(); - for (va = sva; va < eva; va += arm_dcache_align) { + for (va = sva; va < eva; va += cpuinfo.dcache_line_size) { #if __ARM_ARCH >= 7 && defined SMP _CP15_DCCMVAU(va); #else @@ -358,7 +374,7 @@ dcache_inv_poc(vm_offset_t sva, vm_paddr vm_offset_t eva = sva + size; /* invalidate L1 first */ - for (va = sva; va < eva; va += arm_dcache_align) { + for (va = sva; va < eva; va += cpuinfo.dcache_line_size) { _CP15_DCIMVAC(va); } dsb(); @@ -368,7 +384,7 @@ dcache_inv_poc(vm_offset_t sva, vm_paddr dsb(); /* then L1 again */ - for (va = sva; va < eva; va += arm_dcache_align) { + for (va = sva; va < eva; va += cpuinfo.dcache_line_size) { _CP15_DCIMVAC(va); } dsb(); @@ -383,7 +399,7 @@ dcache_wb_poc(vm_offset_t sva, vm_paddr_ dsb(); - for (va = sva; va < eva; va += arm_dcache_align) { + for (va = sva; va < eva; va += cpuinfo.dcache_line_size) { _CP15_DCCMVAC(va); } dsb(); @@ -401,7 +417,7 @@ dcache_wbinv_poc(vm_offset_t sva, vm_pad dsb(); /* write back L1 first */ - for (va = sva; va < eva; va += arm_dcache_align) { + for (va = sva; va < eva; va += cpuinfo.dcache_line_size) { _CP15_DCCMVAC(va); } dsb(); @@ -410,7 +426,7 @@ dcache_wbinv_poc(vm_offset_t sva, vm_pad cpu_l2cache_wbinv_range(pa, size); /* then invalidate L1 */ - for (va = sva; va < eva; va += arm_dcache_align) { + for (va = sva; va < eva; va += cpuinfo.dcache_line_size) { _CP15_DCIMVAC(va); } dsb(); Modified: head/sys/arm/include/cpuinfo.h ============================================================================== --- head/sys/arm/include/cpuinfo.h Mon Mar 9 14:42:25 2015 (r279810) +++ head/sys/arm/include/cpuinfo.h Mon Mar 9 14:46:10 2015 (r279811) @@ -82,6 +82,12 @@ struct cpuinfo { int generic_timer_ext; int virtualization_ext; int security_ext; + + /* L1 cache info */ + int dcache_line_size; + int dcache_line_mask; + int icache_line_size; + int icache_line_mask; }; extern struct cpuinfo cpuinfo; From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 15:20:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFF29594; Mon, 9 Mar 2015 15:20:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 D0EF3865; Mon, 9 Mar 2015 15:20:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29FKD0e069697; Mon, 9 Mar 2015 15:20:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29FKDrG069695; Mon, 9 Mar 2015 15:20:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503091520.t29FKDrG069695@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Mar 2015 15:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279812 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 15:20:14 -0000 Author: trasz Date: Mon Mar 9 15:20:12 2015 New Revision: 279812 URL: https://svnweb.freebsd.org/changeset/base/279812 Log: Remove some particularly bad code; no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/auto_master.5 head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/auto_master.5 ============================================================================== --- head/usr.sbin/autofs/auto_master.5 Mon Mar 9 14:46:10 2015 (r279811) +++ head/usr.sbin/autofs/auto_master.5 Mon Mar 9 15:20:12 2015 (r279812) @@ -260,6 +260,11 @@ when they are automatically created. .It Li -media Query devices that are not yet mounted, but contain valid filesystems. Generally used to access files on removable media. +.It Li -noauto +Mount filesystems configured in +.Xr fstab 5 +as "noauto". +This needs to be set up as a direct map. .It Li -null Prevent .Xr automountd 8 Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Mon Mar 9 14:46:10 2015 (r279811) +++ head/usr.sbin/autofs/common.c Mon Mar 9 15:20:12 2015 (r279812) @@ -86,46 +86,7 @@ checked_strdup(const char *s) } /* - * Take two pointers to strings, concatenate the contents with "/" in the - * middle, make the first pointer point to the result, the second pointer - * to NULL, and free the old strings. - * - * Concatenate pathnames, basically. - */ -static void -concat(char **p1, char **p2) -{ - int ret; - char *path; - - assert(p1 != NULL); - assert(p2 != NULL); - - if (*p1 == NULL) - *p1 = checked_strdup(""); - - if (*p2 == NULL) - *p2 = checked_strdup(""); - - ret = asprintf(&path, "%s/%s", *p1, *p2); - if (ret < 0) - log_err(1, "asprintf"); - - /* - * XXX - */ - //free(*p1); - //free(*p2); - - *p1 = path; - *p2 = NULL; -} - -/* * Concatenate two strings, inserting separator between them, unless not needed. - * - * This function is very convenient to use when you do not care about freeing - * memory - which is okay here, because we are a short running process. */ char * separated_concat(const char *s1, const char *s2, char separator) @@ -151,7 +112,7 @@ separated_concat(const char *s1, const c if (ret < 0) log_err(1, "asprintf"); - //log_debugx("separated_concat: got %s and %s, returning %s", s1, s2, result); + //log_debugx("%s: got %s and %s, returning %s", __func__, s1, s2, result); return (result); } @@ -159,7 +120,7 @@ separated_concat(const char *s1, const c void create_directory(const char *path) { - char *component, *copy, *tofree, *partial; + char *component, *copy, *tofree, *partial, *tmp; int error; assert(path[0] == '/'); @@ -169,12 +130,14 @@ create_directory(const char *path) */ copy = tofree = checked_strdup(path + 1); - partial = NULL; + partial = checked_strdup(""); for (;;) { component = strsep(©, "/"); if (component == NULL) break; - concat(&partial, &component); + tmp = separated_concat(partial, component, '/'); + free(partial); + partial = tmp; //log_debugx("creating \"%s\"", partial); error = mkdir(partial, 0755); if (error != 0 && errno != EEXIST) { From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 15:31:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2F6B796; Mon, 9 Mar 2015 15:31:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 940849F1; Mon, 9 Mar 2015 15:31:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29FVZll075618; Mon, 9 Mar 2015 15:31:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29FVYDi075609; Mon, 9 Mar 2015 15:31:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503091531.t29FVYDi075609@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Mar 2015 15:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279813 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 15:31:35 -0000 Author: trasz Date: Mon Mar 9 15:31:33 2015 New Revision: 279813 URL: https://svnweb.freebsd.org/changeset/base/279813 Log: Make things more readable; no functional changes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automount.c head/usr.sbin/autofs/automountd.c head/usr.sbin/autofs/common.c head/usr.sbin/autofs/common.h head/usr.sbin/autofs/popen.c Modified: head/usr.sbin/autofs/automount.c ============================================================================== --- head/usr.sbin/autofs/automount.c Mon Mar 9 15:20:12 2015 (r279812) +++ head/usr.sbin/autofs/automount.c Mon Mar 9 15:31:33 2015 (r279813) @@ -349,8 +349,7 @@ main_automount(int argc, char **argv) if (options == NULL) { options = checked_strdup(optarg); } else { - options = - separated_concat(options, optarg, ','); + options = concat(options, ',', optarg); } break; case 'u': @@ -388,8 +387,7 @@ main_automount(int argc, char **argv) if (show_maps) { if (options != NULL) { - root->n_options = separated_concat(options, - root->n_options, ','); + root->n_options = concat(options, ',', root->n_options); } if (show_maps > 1) { node_expand_indirect_maps(root); Modified: head/usr.sbin/autofs/automountd.c ============================================================================== --- head/usr.sbin/autofs/automountd.c Mon Mar 9 15:20:12 2015 (r279812) +++ head/usr.sbin/autofs/automountd.c Mon Mar 9 15:31:33 2015 (r279813) @@ -241,8 +241,7 @@ handle_request(const struct autofs_daemo * Prepend options passed via automountd(8) command line. */ if (cmdline_options != NULL) { - options = - separated_concat(cmdline_options, options, ','); + options = concat(cmdline_options, ',', options); } nobrowse = pick_option("nobrowse", &options); @@ -268,8 +267,7 @@ handle_request(const struct autofs_daemo * We still need to create the single subdirectory * user is trying to access. */ - tmp = separated_concat(adr->adr_path, - adr->adr_key, '/'); + tmp = concat(adr->adr_path, '/', adr->adr_key); node = node_find(root, tmp); if (node != NULL) create_subtree(node, false); @@ -301,12 +299,12 @@ handle_request(const struct autofs_daemo * Prepend options passed via automountd(8) command line. */ if (cmdline_options != NULL) - options = separated_concat(cmdline_options, options, ','); + options = concat(cmdline_options, ',', options); /* * Append "automounted". */ - options = separated_concat(options, "automounted", ','); + options = concat(options, ',', "automounted"); /* * Remove "nobrowse", mount(8) doesn't understand it. @@ -334,11 +332,10 @@ handle_request(const struct autofs_daemo if (retrycnt == NULL) { log_debugx("retrycnt not specified in options; " "defaulting to 1"); - options = separated_concat(options, - separated_concat("retrycnt", "1", '='), ','); + options = concat(options, ',', "retrycnt=1"); } else { - options = separated_concat(options, - separated_concat("retrycnt", retrycnt, '='), ','); + options = concat(options, ',', + concat("retrycnt", '=', retrycnt)); } } @@ -465,8 +462,7 @@ main_automountd(int argc, char **argv) if (options == NULL) { options = checked_strdup(optarg); } else { - options = - separated_concat(options, optarg, ','); + options = concat(options, ',', optarg); } break; case 'v': Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Mon Mar 9 15:20:12 2015 (r279812) +++ head/usr.sbin/autofs/common.c Mon Mar 9 15:31:33 2015 (r279813) @@ -89,7 +89,7 @@ checked_strdup(const char *s) * Concatenate two strings, inserting separator between them, unless not needed. */ char * -separated_concat(const char *s1, const char *s2, char separator) +concat(const char *s1, char separator, const char *s2) { char *result; int ret; @@ -135,7 +135,7 @@ create_directory(const char *path) component = strsep(©, "/"); if (component == NULL) break; - tmp = separated_concat(partial, component, '/'); + tmp = concat(partial, '/', component); free(partial); partial = tmp; //log_debugx("creating \"%s\"", partial); @@ -545,7 +545,7 @@ node_path_x(const struct node *n, char * } assert(n->n_key[0] != '\0'); - path = separated_concat(n->n_key, x, '/'); + path = concat(n->n_key, '/', x); free(x); return (node_path_x(n->n_parent, path)); @@ -581,7 +581,7 @@ node_options_x(const struct node *n, cha if (n == NULL) return (x); - options = separated_concat(x, n->n_options, ','); + options = concat(x, ',', n->n_options); free(x); return (node_options_x(n->n_parent, options)); Modified: head/usr.sbin/autofs/common.h ============================================================================== --- head/usr.sbin/autofs/common.h Mon Mar 9 15:20:12 2015 (r279812) +++ head/usr.sbin/autofs/common.h Mon Mar 9 15:31:33 2015 (r279813) @@ -70,7 +70,7 @@ void log_warnx(const char *, ...) __prin void log_debugx(const char *, ...) __printf0like(1, 2); char *checked_strdup(const char *); -char *separated_concat(const char *s1, const char *s2, char separator); +char *concat(const char *s1, char separator, const char *s2); void create_directory(const char *path); struct node *node_new_root(void); Modified: head/usr.sbin/autofs/popen.c ============================================================================== --- head/usr.sbin/autofs/popen.c Mon Mar 9 15:20:12 2015 (r279812) +++ head/usr.sbin/autofs/popen.c Mon Mar 9 15:31:33 2015 (r279813) @@ -104,7 +104,7 @@ auto_popen(const char *argv0, ...) if (arg == NULL) break; - command = separated_concat(command, arg, ' '); + command = concat(command, ' ', arg); } va_end(ap); From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 15:43:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95B92D7E; Mon, 9 Mar 2015 15:43:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 81871B6B; Mon, 9 Mar 2015 15:43:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29FhYBF081002; Mon, 9 Mar 2015 15:43:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29FhYVu081001; Mon, 9 Mar 2015 15:43:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503091543.t29FhYVu081001@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Mar 2015 15:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279814 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 15:43:34 -0000 Author: imp Date: Mon Mar 9 15:43:33 2015 New Revision: 279814 URL: https://svnweb.freebsd.org/changeset/base/279814 Log: Add the DTrace modules to the build, rather than only build the dtrace modules. Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Mon Mar 9 15:31:33 2015 (r279813) +++ head/sys/arm/conf/BEAGLEBONE Mon Mar 9 15:43:33 2015 (r279814) @@ -31,7 +31,7 @@ makeoptions WITHOUT_MODULES="ahc" options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # all architectures - kernel ELF linker loads CTF data makeoptions WITH_CTF=1 -makeoptions MODULES_OVERRIDE="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt" +makeoptions MODULES_EXTRA="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt" options HZ=100 options SCHED_4BSD # 4BSD scheduler From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 15:44:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE205F5E; Mon, 9 Mar 2015 15:44:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 99AE0B84; Mon, 9 Mar 2015 15:44:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29Fib0e081203; Mon, 9 Mar 2015 15:44:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29Fibcu081201; Mon, 9 Mar 2015 15:44:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503091544.t29Fibcu081201@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Mar 2015 15:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279815 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 15:44:37 -0000 Author: trasz Date: Mon Mar 9 15:44:36 2015 New Revision: 279815 URL: https://svnweb.freebsd.org/changeset/base/279815 Log: Erm, revert chunk committed by mistake. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/auto_master.5 Modified: head/usr.sbin/autofs/auto_master.5 ============================================================================== --- head/usr.sbin/autofs/auto_master.5 Mon Mar 9 15:43:33 2015 (r279814) +++ head/usr.sbin/autofs/auto_master.5 Mon Mar 9 15:44:36 2015 (r279815) @@ -260,11 +260,6 @@ when they are automatically created. .It Li -media Query devices that are not yet mounted, but contain valid filesystems. Generally used to access files on removable media. -.It Li -noauto -Mount filesystems configured in -.Xr fstab 5 -as "noauto". -This needs to be set up as a direct map. .It Li -null Prevent .Xr automountd 8 From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 15:54:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32AC8344; Mon, 9 Mar 2015 15:54:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 1E44DC94; Mon, 9 Mar 2015 15:54:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29FsE0d086102; Mon, 9 Mar 2015 15:54:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29FsERa086101; Mon, 9 Mar 2015 15:54:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503091554.t29FsERa086101@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Mar 2015 15:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279816 - head/sys/arm/ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 15:54:15 -0000 Author: ian Date: Mon Mar 9 15:54:14 2015 New Revision: 279816 URL: https://svnweb.freebsd.org/changeset/base/279816 Log: Attach the prcm clock driver early, so it can set the mpcore timer frequency. Submitted by: Svatopluk Kraus Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Mon Mar 9 15:44:36 2015 (r279815) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Mon Mar 9 15:54:14 2015 (r279816) @@ -1423,5 +1423,6 @@ static driver_t omap4_prcm_driver = { static devclass_t omap4_prcm_devclass; -DRIVER_MODULE(omap4_prcm, simplebus, omap4_prcm_driver, omap4_prcm_devclass, 0, 0); +EARLY_DRIVER_MODULE(omap4_prcm, simplebus, omap4_prcm_driver, + omap4_prcm_devclass, 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_EARLY); MODULE_VERSION(omap4_prcm, 1); From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 15:58:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD1DA619; Mon, 9 Mar 2015 15:58:45 +0000 (UTC) Received: from pmta2.delivery8.ore.mailhop.org (pmta2.delivery8.ore.mailhop.org [54.148.222.11]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3B5CE1; Mon, 9 Mar 2015 15:58:45 +0000 (UTC) Received: from smtp1.ore.mailhop.org (172.31.18.134) by pmta2.delivery1.ore.mailhop.org id hvn1la216h0j; Mon, 9 Mar 2015 15:59:09 +0000 (envelope-from ) Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp1.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YV04j-0000rK-W2; Mon, 09 Mar 2015 15:58:38 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t29FwaBB007414; Mon, 9 Mar 2015 09:58:36 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19nXy9QCMqd969DpJh+Hgn+ Message-ID: <1425916716.73796.28.camel@freebsd.org> Subject: Re: svn commit: r279814 - head/sys/arm/conf From: Ian Lepore To: Warner Losh Date: Mon, 09 Mar 2015 09:58:36 -0600 In-Reply-To: <201503091543.t29FhYVu081001@svn.freebsd.org> References: <201503091543.t29FhYVu081001@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 15:58:45 -0000 On Mon, 2015-03-09 at 15:43 +0000, Warner Losh wrote: > Author: imp > Date: Mon Mar 9 15:43:33 2015 > New Revision: 279814 > URL: https://svnweb.freebsd.org/changeset/base/279814 > > Log: > Add the DTrace modules to the build, rather than only build the dtrace > modules. > > Modified: > head/sys/arm/conf/BEAGLEBONE > > Modified: head/sys/arm/conf/BEAGLEBONE > ============================================================================== > --- head/sys/arm/conf/BEAGLEBONE Mon Mar 9 15:31:33 2015 (r279813) > +++ head/sys/arm/conf/BEAGLEBONE Mon Mar 9 15:43:33 2015 (r279814) > @@ -31,7 +31,7 @@ makeoptions WITHOUT_MODULES="ahc" > options KDTRACE_HOOKS # Kernel DTrace hooks > options DDB_CTF # all architectures - kernel ELF linker loads CTF data > makeoptions WITH_CTF=1 > -makeoptions MODULES_OVERRIDE="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt" > +makeoptions MODULES_EXTRA="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt" > > options HZ=100 > options SCHED_4BSD # 4BSD scheduler > > Can we not do this, and instead just build all modules? I'm not sure why we eliminate or override modules on some armv6 socs and not on others, but I think it's a concept that's past it's sell-by date now. If there are a few specific modules that aren't good for arm, we should be fixing that in the modules makefiles. I've got some WIP along these lines for beaglebone that's about ready to commit, so I'm asking your opinion, not for you to do all the work. -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 17:24:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48020BA1; Mon, 9 Mar 2015 17:24:23 +0000 (UTC) Received: from bigwig.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 18C1FA91; Mon, 9 Mar 2015 17:24:23 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 29ABFB97F; Mon, 9 Mar 2015 13:24:22 -0400 (EDT) From: John Baldwin To: Sergey Kandaurov Subject: Re: svn commit: r279699 - in head/sys: amd64/amd64 i386/i386 Date: Mon, 09 Mar 2015 11:30:41 -0400 Message-ID: <3050157.0anzMatu84@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: References: <201503062034.t26KYSP2063973@svn.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.2.7 (bigwig.baldwin.cx); Mon, 09 Mar 2015 13:24:22 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Roger Pau =?ISO-8859-1?Q?Monn=E9?= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 17:24:23 -0000 On Saturday, March 07, 2015 12:55:06 AM Sergey Kandaurov wrote: > On 6 March 2015 at 23:34, John Baldwin wrote: > > Author: jhb > > Date: Fri Mar 6 20:34:28 2015 > > New Revision: 279699 > > URL: https://svnweb.freebsd.org/changeset/base/279699 > > > > Log: > > Only schedule interrupts on a single hyperthread of a modern Intel CPU > > core > > by default. Previously we used a single hyperthread on Pentium4-era > > cores but used both hyperthreads on more recent CPUs. > > > > MFC after: 2 weeks > > > > Modified: > > head/sys/amd64/amd64/mp_machdep.c > > head/sys/i386/i386/mp_machdep.c > > > > Modified: head/sys/amd64/amd64/mp_machdep.c > > ========================================================================== > > ==== --- head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 16:43:54 2015 > > (r279698) +++ head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 20:34:28 > > 2015 (r279699) @@ -828,8 +828,8 @@ set_interrupt_apic_ids(void) > > > > continue; > > > > /* Don't let hyperthreads service interrupts. */ > > > > - if (hyperthreading_cpus > 1 && > > - apic_id % hyperthreading_cpus != 0) > > + if (cpu_logical > 1 && > > + apic_id % cpu_logical != 0) > > > > continue; > > > > intr_add_cpu(i); > > > > Modified: head/sys/i386/i386/mp_machdep.c > > ========================================================================== > > ==== --- head/sys/i386/i386/mp_machdep.c Fri Mar 6 16:43:54 2015 > > (r279698) +++ head/sys/i386/i386/mp_machdep.c Fri Mar 6 20:34:28 > > 2015 (r279699) @@ -842,8 +842,8 @@ set_interrupt_apic_ids(void) > > > > continue; > > > > /* Don't let hyperthreads service interrupts. */ > > > > - if (hyperthreading_cpus > 1 && > > - apic_id % hyperthreading_cpus != 0) > > + if (cpu_logical > 1 && > > + apic_id % cpu_logical != 0) > > > > continue; > > > > intr_add_cpu(i); > > There are another two similar cases at sys/i386/xen/mp_machdep.c > Both look like a no-op: static global never gets written data, > the condition is never satisfied. > I guess these variables can be safely reduced for clarity there: > hyperthreading_cpus, hyperthreading_cpus_mask under i386/xen. Yes, that file is rotted a bit. I think it is for a mode of Xen that Xen doesn't intend to support in the future and that it will be dropped from our tree altogether at some point? Roger probably has a better feel on this? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 17:43:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D14C2C7; Mon, 9 Mar 2015 17:43:03 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 C1BE0D07; Mon, 9 Mar 2015 17:43:02 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t29HgqQb063968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Mar 2015 19:42:52 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t29HgqQb063968 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t29HgqDu063967; Mon, 9 Mar 2015 19:42:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 9 Mar 2015 19:42:52 +0200 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r279699 - in head/sys: amd64/amd64 i386/i386 Message-ID: <20150309174252.GO2379@kib.kiev.ua> References: <201503062034.t26KYSP2063973@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503062034.t26KYSP2063973@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 17:43:03 -0000 On Fri, Mar 06, 2015 at 08:34:28PM +0000, John Baldwin wrote: > Author: jhb > Date: Fri Mar 6 20:34:28 2015 > New Revision: 279699 > URL: https://svnweb.freebsd.org/changeset/base/279699 > > Log: > Only schedule interrupts on a single hyperthread of a modern Intel CPU core > by default. Previously we used a single hyperthread on Pentium4-era > cores but used both hyperthreads on more recent CPUs. > > MFC after: 2 weeks > > Modified: > head/sys/amd64/amd64/mp_machdep.c > head/sys/i386/i386/mp_machdep.c > > Modified: head/sys/amd64/amd64/mp_machdep.c > ============================================================================== > --- head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 16:43:54 2015 (r279698) > +++ head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 20:34:28 2015 (r279699) > @@ -828,8 +828,8 @@ set_interrupt_apic_ids(void) > continue; > > /* Don't let hyperthreads service interrupts. */ > - if (hyperthreading_cpus > 1 && > - apic_id % hyperthreading_cpus != 0) > + if (cpu_logical > 1 && > + apic_id % cpu_logical != 0) > continue; > > intr_add_cpu(i); > > Modified: head/sys/i386/i386/mp_machdep.c > ============================================================================== > --- head/sys/i386/i386/mp_machdep.c Fri Mar 6 16:43:54 2015 (r279698) > +++ head/sys/i386/i386/mp_machdep.c Fri Mar 6 20:34:28 2015 (r279699) > @@ -842,8 +842,8 @@ set_interrupt_apic_ids(void) > continue; > > /* Don't let hyperthreads service interrupts. */ > - if (hyperthreading_cpus > 1 && > - apic_id % hyperthreading_cpus != 0) > + if (cpu_logical > 1 && > + apic_id % cpu_logical != 0) > continue; > > intr_add_cpu(i); BTW, this sounds somewhat backward from the intention of the HTT/SMT. The feature was aimed to reduce latency of memory or device registers reads by allowing several contexts to stuck on the cache line fill or waiting for the device response to read request. Since typical interrupt handler just EOIs the source or does nothing at all to the source, what is the reasoning behind the change ? From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 19:47:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3FA85C5 for ; Mon, 9 Mar 2015 19:47:18 +0000 (UTC) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) (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 A0218FAD for ; Mon, 9 Mar 2015 19:47:18 +0000 (UTC) Received: by paceu11 with SMTP id eu11so61087627pac.1 for ; Mon, 09 Mar 2015 12:47:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=k34mnwJHG337gSpicutax9enVjMvEtHUo4ehxubXark=; b=P9gF1ej6Fh3IXVW4G6tHkKIVLOb7Q9ey+MouA6JGIzdYlA2pvj8h4SeLLx9omR7x7n 4+KqAkUMY9ebXwmu0W6tHBwYJNEMErw2Fw6YJYq50XdrYtiJs9doVAQXkMDm1hQA10Uq yxesH/c5BYPy0qVhdgFhE7EO1vbNZ92+6KbmiHgXeSK3Ws2orU53Iu01vma4spFrIa1n 0i8R1eiBUlDDxNeBngpdFRbmlD9dR1E2k+w0qQkQvRYXomH6ZsmUoRaV2jk7z3jHU0cE eAK/bsd4wYh38emrX5+snUD9qouXR7llppzrbA12tZPrL6u16T+IUjhUGCXJjkpv2etQ TNcg== X-Gm-Message-State: ALoCoQlxq+2xu+JmM06+t0OsVT0KiCrd1z4tI5A/519ahrGCYRr9GDZ56gKnvpMx+kQoB9Kicblb X-Received: by 10.70.48.5 with SMTP id h5mr19325884pdn.58.1425930432418; Mon, 09 Mar 2015 12:47:12 -0700 (PDT) Received: from [10.64.24.161] ([69.53.236.236]) by mx.google.com with ESMTPSA id qj3sm20621501pac.31.2015.03.09.12.47.10 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Mar 2015 12:47:11 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r279814 - head/sys/arm/conf Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_6EC83F93-77FB-4469-9166-138DED173343"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b5 From: Warner Losh In-Reply-To: <1425916716.73796.28.camel@freebsd.org> Date: Mon, 9 Mar 2015 13:47:08 -0600 Message-Id: References: <201503091543.t29FhYVu081001@svn.freebsd.org> <1425916716.73796.28.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 19:47:18 -0000 --Apple-Mail=_6EC83F93-77FB-4469-9166-138DED173343 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 9, 2015, at 9:58 AM, Ian Lepore wrote: >=20 > On Mon, 2015-03-09 at 15:43 +0000, Warner Losh wrote: >> Author: imp >> Date: Mon Mar 9 15:43:33 2015 >> New Revision: 279814 >> URL: https://svnweb.freebsd.org/changeset/base/279814 >>=20 >> Log: >> Add the DTrace modules to the build, rather than only build the = dtrace >> modules. >>=20 >> Modified: >> head/sys/arm/conf/BEAGLEBONE >>=20 >> Modified: head/sys/arm/conf/BEAGLEBONE >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/arm/conf/BEAGLEBONE Mon Mar 9 15:31:33 2015 = (r279813) >> +++ head/sys/arm/conf/BEAGLEBONE Mon Mar 9 15:43:33 2015 = (r279814) >> @@ -31,7 +31,7 @@ makeoptions WITHOUT_MODULES=3D"ahc" >> options KDTRACE_HOOKS # Kernel DTrace hooks >> options DDB_CTF # all architectures - kernel ELF = linker loads CTF data >> makeoptions WITH_CTF=3D1 >> -makeoptions MODULES_OVERRIDE=3D"opensolaris dtrace dtrace/lockstat = dtrace/profile dtrace/fbt" >> +makeoptions MODULES_EXTRA=3D"opensolaris dtrace dtrace/lockstat = dtrace/profile dtrace/fbt" >>=20 >> options HZ=3D100 >> options SCHED_4BSD # 4BSD scheduler >>=20 >>=20 >=20 > Can we not do this, and instead just build all modules? I'm not sure > why we eliminate or override modules on some armv6 socs and not on > others, but I think it's a concept that's past it's sell-by date now. > If there are a few specific modules that aren't good for arm, we = should > be fixing that in the modules makefiles. I assumed that this was here to give the folks working on Dtrace a = bigger audience without breaking everybody if they are wrong. The prior change to the config file introduced MODULES_OVERRIDE, and it should have used MODULES_EXTRA because that=E2=80=99s what it is doing. I assume = that this line will be eliminated when the sys/modules stuff turns on dtrace for arm. > I've got some WIP along these lines for beaglebone that's about ready = to > commit, so I'm asking your opinion, not for you to do all the work. As for MODULES_OVERRIDE elimination, I=E2=80=99m all for it. I have some early WiP to filter modules in a smarter way (e.g. never compile USB = modules if there can be no USB, ditto PCI). But that=E2=80=99s still some months = away from coming to fruition. As we talked about on IRC, I=E2=80=99m cool with = eliminating the MODULES_OVERRIDE for all armv6 config files. Warner --Apple-Mail=_6EC83F93-77FB-4469-9166-138DED173343 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJU/fi9AAoJEGwc0Sh9sBEAnr0QAM5HA85MwjTQvCE4Zoylsyx1 vFAZQ7yRL5fz6WB0WVBf8Xybtn12XEpOmixqQ6Tkjng3P4yMOFjdbYEW1GJSGa/F t5VQbrn+WdraTIucpAhzTFbjNTfbPDxLYTuXSQiyJJCs5ECGOt0qVIn83PSxZ7Z6 bTcyWK/Vz5DlIe5gQ2VvgDuxzeFWHCrE+PA7nA66/p3jlUt7s1CSjbKomVJ2XKk8 K1YHLcGatciOXlp99zno0EUZw2/pa/y+GTJy4HMRTgCYjIXP3o/qQq5TlYYJcGEG 7eJ5SorUsxkwSFuTntbuQy51lUTX0b9yDBQvBOwo2eD6yJE2JsvA/uoTJR28PoSA Sbnt8a7wcD+41g3XguVKRIHacN4sZfe3kbS6AY8li++sqmQvj+8ufF1ns46ai795 qTK5dRgv1ZgDojn03g2eJHKoGYKs60lIXnX/lxCJzrXDEs1XOQwBBjiLxuKpLEPe hjlyJsWUDipat+tCIpxbR6JqrXuhFHnn0Z/glZUQR6G9XXXZpD4xgJ7dBgl01LtA uE6aYJl86o7PXb2tsIhTV0HMsjxqMuSl+fUgB0pzlbY00HlbSsz/oFg9mSJQGBW0 fyNSgAZmGoAwzMAFt7jIIZoY8cvs9WapEP8SaZzlzlaV8zafiZlIYxrmMoOKcfCx A3WP2UbdP91TvBJDtA4a =vxM7 -----END PGP SIGNATURE----- --Apple-Mail=_6EC83F93-77FB-4469-9166-138DED173343-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 20:11:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EB38B2C; Mon, 9 Mar 2015 20:11:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 295DD36D; Mon, 9 Mar 2015 20:11:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29KBHmU014046; Mon, 9 Mar 2015 20:11:17 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29KBH89014045; Mon, 9 Mar 2015 20:11:17 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201503092011.t29KBH89014045@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Mar 2015 20:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279819 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 20:11:17 -0000 Author: delphij Date: Mon Mar 9 20:11:16 2015 New Revision: 279819 URL: https://svnweb.freebsd.org/changeset/base/279819 Log: Fix CARP when in use in a HyperV environment: - Bump link state when stopping or starting the interface; - Don't handle SIOCGIFADDR specially, similar to r277103. This change is based on a previous revision from Andy Zhang (Microsoft) who did the diagnostic work and many thanks to them for their help in supporting the HyperV work. PR: kern/187203 MFC after: 2 weeks Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Mar 9 18:24:29 2015 (r279818) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Mar 9 20:11:16 2015 (r279819) @@ -736,7 +736,14 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, switch(cmd) { case SIOCSIFADDR: - case SIOCGIFADDR: +#ifdef INET + if (ifa->ifa_addr->sa_family == AF_INET) { + ifp->if_flags |= IFF_UP; + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + hn_ifinit(sc); + arp_ifinit(ifp, ifa); + } else +#endif error = ether_ioctl(ifp, cmd, data); break; case SIOCSIFMTU: @@ -900,6 +907,7 @@ hn_stop(hn_softc_t *sc) printf(" Closing Device ...\n"); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + if_link_state_change(ifp, LINK_STATE_DOWN); sc->hn_initdone = 0; ret = hv_rf_on_close(device_ctx); @@ -949,6 +957,7 @@ hn_ifinit_locked(hn_softc_t *sc) } ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if_link_state_change(ifp, LINK_STATE_UP); } /* From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 20:26:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2ECA2248; Mon, 9 Mar 2015 20:26:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 19F35768; Mon, 9 Mar 2015 20:26:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29KQhOk020707; Mon, 9 Mar 2015 20:26:43 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29KQhBh020706; Mon, 9 Mar 2015 20:26:43 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201503092026.t29KQhBh020706@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 9 Mar 2015 20:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279820 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 20:26:44 -0000 Author: jkim Date: Mon Mar 9 20:26:42 2015 New Revision: 279820 URL: https://svnweb.freebsd.org/changeset/base/279820 Log: Fix a typo in comment and explain the reason. Modified: head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Mar 9 20:11:16 2015 (r279819) +++ head/lib/libthr/thread/thr_private.h Mon Mar 9 20:26:42 2015 (r279820) @@ -337,7 +337,7 @@ struct pthread_key { /* * lwpid_t is 32bit but kernel thr API exports tid as long type - * in very earily date. + * to preserve the ABI for M:N model in very early date (r131431). */ #define TID(thread) ((uint32_t) ((thread)->tid)) From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 20:29:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C8E0400; Mon, 9 Mar 2015 20:29:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 77A28795; Mon, 9 Mar 2015 20:29:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29KTHnB021184; Mon, 9 Mar 2015 20:29:17 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29KTHRV021183; Mon, 9 Mar 2015 20:29:17 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201503092029.t29KTHRV021183@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Mon, 9 Mar 2015 20:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279821 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 20:29:17 -0000 Author: jch Date: Mon Mar 9 20:29:16 2015 New Revision: 279821 URL: https://svnweb.freebsd.org/changeset/base/279821 Log: In TCP, connect() can return incorrect error code EINVAL instead of EADDRINUSE or ECONNREFUSED PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196035 Differential Revision: https://reviews.freebsd.org/D1982 Reported by: Mark Nunberg Submitted by: Harrison Grundy Reviewed by: adrian, jch, glebius, gnn Approved by: jhb MFC after: 2 weeks Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Mon Mar 9 20:26:42 2015 (r279820) +++ head/sys/netinet/tcp_usrreq.c Mon Mar 9 20:29:16 2015 (r279821) @@ -476,8 +476,12 @@ tcp_usr_connect(struct socket *so, struc inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_connect: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { - error = EINVAL; + if (inp->inp_flags & INP_TIMEWAIT) { + error = EADDRINUSE; + goto out; + } + if (inp->inp_flags & INP_DROPPED) { + error = ECONNREFUSED; goto out; } tp = intotcpcb(inp); @@ -523,8 +527,12 @@ tcp6_usr_connect(struct socket *so, stru inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp6_usr_connect: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { - error = EINVAL; + if (inp->inp_flags & INP_TIMEWAIT) { + error = EADDRINUSE; + goto out; + } + if (inp->inp_flags & INP_DROPPED) { + error = ECONNREFUSED; goto out; } tp = intotcpcb(inp); From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 21:50:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C4F6463; Mon, 9 Mar 2015 21:50:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 769A12C7; Mon, 9 Mar 2015 21:50:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29LoBY6063741; Mon, 9 Mar 2015 21:50:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29LoATD063739; Mon, 9 Mar 2015 21:50:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503092150.t29LoATD063739@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Mar 2015 21:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279824 - in head/sys/modules: . dtb/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 21:50:11 -0000 Author: ian Date: Mon Mar 9 21:50:10 2015 New Revision: 279824 URL: https://svnweb.freebsd.org/changeset/base/279824 Log: Add a dtb module for AM335x systems (just Beaglebone right now). Added: head/sys/modules/dtb/am335x/ head/sys/modules/dtb/am335x/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Mar 9 21:31:37 2015 (r279823) +++ head/sys/modules/Makefile Mon Mar 9 21:50:10 2015 (r279824) @@ -686,7 +686,13 @@ _snc= snc .if ${MACHINE_CPUARCH} == "arm" _cfi= cfi _cpsw= cpsw +.if ${MK_CDDL} != "no" || defined(ALL_MODULES) +_dtrace= dtrace +.endif _sound= sound +.if ${MK_CDDL} != "no" || defined(ALL_MODULES) +_opensolaris= opensolaris +.endif .endif .if ${MACHINE_CPUARCH} == "powerpc" Added: head/sys/modules/dtb/am335x/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/dtb/am335x/Makefile Mon Mar 9 21:50:10 2015 (r279824) @@ -0,0 +1,7 @@ +# $FreeBSD$ +# All the dts files for am335x systems we support. +DTS= \ + beaglebone.dts \ + beaglebone-black.dts + +.include From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 21:54:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F8FB61D; Mon, 9 Mar 2015 21:54:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 79F3C38E; Mon, 9 Mar 2015 21:54:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29LsS3D067431; Mon, 9 Mar 2015 21:54:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29LsSRC067430; Mon, 9 Mar 2015 21:54:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503092154.t29LsSRC067430@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Mar 2015 21:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279825 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 21:54:28 -0000 Author: ian Date: Mon Mar 9 21:54:27 2015 New Revision: 279825 URL: https://svnweb.freebsd.org/changeset/base/279825 Log: Remove the static DTB config and instead build modules/dtb/am335x. Also, remove WITHOUT_MODULES="ahc" which was added long ago to work around build problems that have long since been fixed correctly. PR: 198460 Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Mon Mar 9 21:50:10 2015 (r279824) +++ head/sys/arm/conf/BEAGLEBONE Mon Mar 9 21:54:27 2015 (r279825) @@ -25,13 +25,13 @@ ident BEAGLEBONE include "../ti/am335x/std.am335x" -makeoptions WITHOUT_MODULES="ahc" +makeoptions MODULES_EXTRA="dtb/am335x" # DTrace support options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # all architectures - kernel ELF linker loads CTF data makeoptions WITH_CTF=1 -makeoptions MODULES_EXTRA="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt" +makeoptions MODULES_EXTRA+="opensolaris dtrace dtrace/lockstat dtrace/profile dtrace/fbt" options HZ=100 options SCHED_4BSD # 4BSD scheduler @@ -165,5 +165,3 @@ device usfs # Flattened Device Tree options FDT # Configure using FDT/DTB data -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=beaglebone.dts From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 21:58:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD47B7B5; Mon, 9 Mar 2015 21:58:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 A799E3D4; Mon, 9 Mar 2015 21:58:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29LwgQS068208; Mon, 9 Mar 2015 21:58:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29Lwg6j068207; Mon, 9 Mar 2015 21:58:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503092158.t29Lwg6j068207@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Mar 2015 21:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279826 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 21:58:42 -0000 Author: ian Date: Mon Mar 9 21:58:41 2015 New Revision: 279826 URL: https://svnweb.freebsd.org/changeset/base/279826 Log: Change the name of the dmtimer pps device from /dev/ppsN to /dev/dmtppsN. ntpd is hard-coded to use /dev/ppsN, and typically when multiple PPS sources are available the sysadmin will symlink the right one(s) to /dev/ppsN, so it's best to not usurp those names directly. Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Mon Mar 9 21:54:27 2015 (r279825) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Mon Mar 9 21:58:41 2015 (r279826) @@ -200,7 +200,7 @@ am335x_dmtimer_et_write_4(struct am335x_ */ #ifdef PPS_SYNC -#define PPS_CDEV_NAME "pps" +#define PPS_CDEV_NAME "dmtpps" static void am335x_dmtimer_set_capture_mode(struct am335x_dmtimer_softc *sc, bool force_off) From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 22:01:58 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DC3F946; Mon, 9 Mar 2015 22:01:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 68482664; Mon, 9 Mar 2015 22:01:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29M1wlL072356; Mon, 9 Mar 2015 22:01:58 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29M1whD072355; Mon, 9 Mar 2015 22:01:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503092201.t29M1whD072355@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Mar 2015 22:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279827 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 22:01:58 -0000 Author: ian Date: Mon Mar 9 22:01:57 2015 New Revision: 279827 URL: https://svnweb.freebsd.org/changeset/base/279827 Log: Revert accidentally commited file from r279824. We're not quite ready to enable dtrace module building on all arm platforms yet. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Mar 9 21:58:41 2015 (r279826) +++ head/sys/modules/Makefile Mon Mar 9 22:01:57 2015 (r279827) @@ -686,13 +686,7 @@ _snc= snc .if ${MACHINE_CPUARCH} == "arm" _cfi= cfi _cpsw= cpsw -.if ${MK_CDDL} != "no" || defined(ALL_MODULES) -_dtrace= dtrace -.endif _sound= sound -.if ${MK_CDDL} != "no" || defined(ALL_MODULES) -_opensolaris= opensolaris -.endif .endif .if ${MACHINE_CPUARCH} == "powerpc" From owner-svn-src-head@FreeBSD.ORG Mon Mar 9 22:39:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85883874; Mon, 9 Mar 2015 22:39:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6EFABD1E; Mon, 9 Mar 2015 22:39:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29Mdx3j089385; Mon, 9 Mar 2015 22:39:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29MdxUo089384; Mon, 9 Mar 2015 22:39:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503092239.t29MdxUo089384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 9 Mar 2015 22:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279828 - head/sys/dev/cadence X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 22:39:59 -0000 Author: ian Date: Mon Mar 9 22:39:58 2015 New Revision: 279828 URL: https://svnweb.freebsd.org/changeset/base/279828 Log: Use the new ifnet API. Also, allocate bus_dma_maps as needed instead of pre-allocating them all at start-up. Also fix a bug in cgem_stop(); before, it wasn't properly unloading dma maps due to a cut-and-paste error. Modified: head/sys/dev/cadence/if_cgem.c Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Mon Mar 9 22:01:57 2015 (r279827) +++ head/sys/dev/cadence/if_cgem.c Mon Mar 9 22:39:58 2015 (r279828) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -98,7 +97,7 @@ __FBSDID("$FreeBSD$"); CSUM_TCP_IPV6 | CSUM_UDP_IPV6) struct cgem_softc { - struct ifnet *ifp; + if_t ifp; struct mtx sc_mtx; device_t dev; device_t miibus; @@ -298,9 +297,10 @@ cgem_mac_hash(u_char eaddr[]) static void cgem_rx_filter(struct cgem_softc *sc) { - struct ifnet *ifp = sc->ifp; - struct ifmultiaddr *ifma; - int index; + if_t ifp = sc->ifp; + u_char *mta; + + int index, i, mcnt; uint32_t hash_hi, hash_lo; uint32_t net_cfg; @@ -313,28 +313,34 @@ cgem_rx_filter(struct cgem_softc *sc) CGEM_NET_CFG_NO_BCAST | CGEM_NET_CFG_COPY_ALL); - if ((ifp->if_flags & IFF_PROMISC) != 0) + if ((if_getflags(ifp) & IFF_PROMISC) != 0) net_cfg |= CGEM_NET_CFG_COPY_ALL; else { - if ((ifp->if_flags & IFF_BROADCAST) == 0) + if ((if_getflags(ifp) & IFF_BROADCAST) == 0) net_cfg |= CGEM_NET_CFG_NO_BCAST; - if ((ifp->if_flags & IFF_ALLMULTI) != 0) { + if ((if_getflags(ifp) & IFF_ALLMULTI) != 0) { hash_hi = 0xffffffff; hash_lo = 0xffffffff; } else { - if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; + mcnt = if_multiaddr_count(ifp, -1); + mta = malloc(ETHER_ADDR_LEN * mcnt, M_DEVBUF, + M_NOWAIT); + if (mta == NULL) { + device_printf(sc->dev, + "failed to allocate temp mcast list\n"); + return; + } + if_multiaddr_array(ifp, mta, &mcnt, mcnt); + for (i = 0; i < mcnt; i++) { index = cgem_mac_hash( LLADDR((struct sockaddr_dl *) - ifma->ifma_addr)); + (mta + (i * ETHER_ADDR_LEN)))); if (index > 31) - hash_hi |= (1<<(index-32)); + hash_hi |= (1 << (index - 32)); else - hash_lo |= (1<rxring[i].addr = CGEM_RXDESC_OWN; sc->rxring[i].ctl = 0; sc->rxring_m[i] = NULL; - err = bus_dmamap_create(sc->mbuf_dma_tag, 0, - &sc->rxring_m_dmamap[i]); - if (err) - return (err); + sc->rxring_m_dmamap[i] = NULL; } sc->rxring[CGEM_NUM_RX_DESCS - 1].addr |= CGEM_RXDESC_WRAP; @@ -451,10 +454,7 @@ cgem_setup_descs(struct cgem_softc *sc) sc->txring[i].addr = 0; sc->txring[i].ctl = CGEM_TXDESC_USED; sc->txring_m[i] = NULL; - err = bus_dmamap_create(sc->mbuf_dma_tag, 0, - &sc->txring_m_dmamap[i]); - if (err) - return (err); + sc->txring_m_dmamap[i] = NULL; } sc->txring[CGEM_NUM_TX_DESCS - 1].ctl |= CGEM_TXDESC_WRAP; @@ -486,10 +486,19 @@ cgem_fill_rqueue(struct cgem_softc *sc) m->m_pkthdr.rcvif = sc->ifp; /* Load map and plug in physical address. */ + if (bus_dmamap_create(sc->mbuf_dma_tag, 0, + &sc->rxring_m_dmamap[sc->rxring_hd_ptr])) { + sc->rxdmamapfails++; + m_free(m); + break; + } if (bus_dmamap_load_mbuf_sg(sc->mbuf_dma_tag, sc->rxring_m_dmamap[sc->rxring_hd_ptr], m, segs, &nsegs, BUS_DMA_NOWAIT)) { sc->rxdmamapfails++; + bus_dmamap_destroy(sc->mbuf_dma_tag, + sc->rxring_m_dmamap[sc->rxring_hd_ptr]); + sc->rxring_m_dmamap[sc->rxring_hd_ptr] = NULL; m_free(m); break; } @@ -517,7 +526,7 @@ cgem_fill_rqueue(struct cgem_softc *sc) static void cgem_recv(struct cgem_softc *sc) { - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; struct mbuf *m, *m_hd, **m_tl; uint32_t ctl; @@ -540,9 +549,12 @@ cgem_recv(struct cgem_softc *sc) sc->rxring_m_dmamap[sc->rxring_tl_ptr], BUS_DMASYNC_POSTREAD); - /* Unload dmamap. */ + /* Unload and destroy dmamap. */ bus_dmamap_unload(sc->mbuf_dma_tag, sc->rxring_m_dmamap[sc->rxring_tl_ptr]); + bus_dmamap_destroy(sc->mbuf_dma_tag, + sc->rxring_m_dmamap[sc->rxring_tl_ptr]); + sc->rxring_m_dmamap[sc->rxring_tl_ptr] = NULL; /* Increment tail pointer. */ if (++sc->rxring_tl_ptr == CGEM_NUM_RX_DESCS) @@ -571,7 +583,7 @@ cgem_recv(struct cgem_softc *sc) /* Are we using hardware checksumming? Check the * status in the receive descriptor. */ - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) { + if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0) { /* TCP or UDP checks out, IP checks out too. */ if ((ctl & CGEM_RXDESC_CKSUM_STAT_MASK) == CGEM_RXDESC_CKSUM_STAT_TCP_GOOD || @@ -605,7 +617,7 @@ cgem_recv(struct cgem_softc *sc) m_hd = m_hd->m_next; m->m_next = NULL; if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - (*ifp->if_input)(ifp, m); + if_input(ifp, m); } CGEM_LOCK(sc); } @@ -624,14 +636,17 @@ cgem_clean_tx(struct cgem_softc *sc) ((ctl = sc->txring[sc->txring_tl_ptr].ctl) & CGEM_TXDESC_USED) != 0) { - /* Sync cache. nop? */ + /* Sync cache. */ bus_dmamap_sync(sc->mbuf_dma_tag, sc->txring_m_dmamap[sc->txring_tl_ptr], BUS_DMASYNC_POSTWRITE); - /* Unload DMA map. */ + /* Unload and destroy DMA map. */ bus_dmamap_unload(sc->mbuf_dma_tag, sc->txring_m_dmamap[sc->txring_tl_ptr]); + bus_dmamap_destroy(sc->mbuf_dma_tag, + sc->txring_m_dmamap[sc->txring_tl_ptr]); + sc->txring_m_dmamap[sc->txring_tl_ptr] = NULL; /* Free up the mbuf. */ m = sc->txring_m[sc->txring_tl_ptr]; @@ -674,15 +689,15 @@ cgem_clean_tx(struct cgem_softc *sc) sc->txring_tl_ptr++; sc->txring_queued--; - sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if_setdrvflagbits(sc->ifp, 0, IFF_DRV_OACTIVE); } } /* Start transmits. */ static void -cgem_start_locked(struct ifnet *ifp) +cgem_start_locked(if_t ifp) { - struct cgem_softc *sc = (struct cgem_softc *) ifp->if_softc; + struct cgem_softc *sc = (struct cgem_softc *) if_getsoftc(ifp); struct mbuf *m; bus_dma_segment_t segs[TX_MAX_DMA_SEGS]; uint32_t ctl; @@ -690,7 +705,7 @@ cgem_start_locked(struct ifnet *ifp) CGEM_ASSERT_LOCKED(sc); - if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) + if ((if_getdrvflags(ifp) & IFF_DRV_OACTIVE) != 0) return; for (;;) { @@ -704,18 +719,24 @@ cgem_start_locked(struct ifnet *ifp) /* Still no room? */ if (sc->txring_queued >= CGEM_NUM_TX_DESCS - TX_MAX_DMA_SEGS * 2) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); sc->txfull++; break; } } /* Grab next transmit packet. */ - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + m = if_dequeue(ifp); if (m == NULL) break; - /* Load DMA map. */ + /* Create and load DMA map. */ + if (bus_dmamap_create(sc->mbuf_dma_tag, 0, + &sc->txring_m_dmamap[sc->txring_hd_ptr])) { + m_freem(m); + sc->txdmamapfails++; + continue; + } err = bus_dmamap_load_mbuf_sg(sc->mbuf_dma_tag, sc->txring_m_dmamap[sc->txring_hd_ptr], m, segs, &nsegs, BUS_DMA_NOWAIT); @@ -726,6 +747,9 @@ cgem_start_locked(struct ifnet *ifp) if (m2 == NULL) { sc->txdefragfails++; m_freem(m); + bus_dmamap_destroy(sc->mbuf_dma_tag, + sc->txring_m_dmamap[sc->txring_hd_ptr]); + sc->txring_m_dmamap[sc->txring_hd_ptr] = NULL; continue; } m = m2; @@ -737,6 +761,9 @@ cgem_start_locked(struct ifnet *ifp) if (err) { /* Give up. */ m_freem(m); + bus_dmamap_destroy(sc->mbuf_dma_tag, + sc->txring_m_dmamap[sc->txring_hd_ptr]); + sc->txring_m_dmamap[sc->txring_hd_ptr] = NULL; sc->txdmamapfails++; continue; } @@ -788,9 +815,9 @@ cgem_start_locked(struct ifnet *ifp) } static void -cgem_start(struct ifnet *ifp) +cgem_start(if_t ifp) { - struct cgem_softc *sc = (struct cgem_softc *) ifp->if_softc; + struct cgem_softc *sc = (struct cgem_softc *) if_getsoftc(ifp); CGEM_LOCK(sc); cgem_start_locked(ifp); @@ -902,11 +929,12 @@ static void cgem_intr(void *arg) { struct cgem_softc *sc = (struct cgem_softc *)arg; + if_t ifp = sc->ifp; uint32_t istatus; CGEM_LOCK(sc); - if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) { CGEM_UNLOCK(sc); return; } @@ -945,8 +973,8 @@ cgem_intr(void *arg) } /* Restart transmitter if needed. */ - if (!IFQ_DRV_IS_EMPTY(&sc->ifp->if_snd)) - cgem_start_locked(sc->ifp); + if (!if_sendq_empty(ifp)) + cgem_start_locked(ifp); CGEM_UNLOCK(sc); } @@ -982,9 +1010,10 @@ cgem_reset(struct cgem_softc *sc) static void cgem_config(struct cgem_softc *sc) { + if_t ifp = sc->ifp; uint32_t net_cfg; uint32_t dma_cfg; - u_char *eaddr = IF_LLADDR(sc->ifp); + u_char *eaddr = if_getlladdr(ifp); CGEM_ASSERT_LOCKED(sc); @@ -999,7 +1028,7 @@ cgem_config(struct cgem_softc *sc) CGEM_NET_CFG_SPEED100; /* Enable receive checksum offloading? */ - if ((sc->ifp->if_capenable & IFCAP_RXCSUM) != 0) + if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0) net_cfg |= CGEM_NET_CFG_RX_CHKSUM_OFFLD_EN; WR4(sc, CGEM_NET_CFG, net_cfg); @@ -1012,7 +1041,7 @@ cgem_config(struct cgem_softc *sc) CGEM_DMA_CFG_DISC_WHEN_NO_AHB; /* Enable transmit checksum offloading? */ - if ((sc->ifp->if_capenable & IFCAP_TXCSUM) != 0) + if ((if_getcapenable(ifp) & IFCAP_TXCSUM) != 0) dma_cfg |= CGEM_DMA_CFG_CHKSUM_GEN_OFFLOAD_EN; WR4(sc, CGEM_DMA_CFG, dma_cfg); @@ -1045,14 +1074,13 @@ cgem_init_locked(struct cgem_softc *sc) CGEM_ASSERT_LOCKED(sc); - if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) != 0) return; cgem_config(sc); cgem_fill_rqueue(sc); - sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; - sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if_setdrvflagbits(sc->ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); mii = device_get_softc(sc->miibus); mii_mediachg(mii); @@ -1088,8 +1116,12 @@ cgem_stop(struct cgem_softc *sc) sc->txring[i].ctl = CGEM_TXDESC_USED; sc->txring[i].addr = 0; if (sc->txring_m[i]) { + /* Unload and destroy dmamap. */ bus_dmamap_unload(sc->mbuf_dma_tag, sc->txring_m_dmamap[i]); + bus_dmamap_destroy(sc->mbuf_dma_tag, + sc->txring_m_dmamap[i]); + sc->txring_m_dmamap[i] = NULL; m_freem(sc->txring_m[i]); sc->txring_m[i] = NULL; } @@ -1105,9 +1137,12 @@ cgem_stop(struct cgem_softc *sc) sc->rxring[i].addr = CGEM_RXDESC_OWN; sc->rxring[i].ctl = 0; if (sc->rxring_m[i]) { - /* Unload dmamap. */ + /* Unload and destroy dmamap. */ bus_dmamap_unload(sc->mbuf_dma_tag, - sc->rxring_m_dmamap[sc->rxring_tl_ptr]); + sc->rxring_m_dmamap[i]); + bus_dmamap_destroy(sc->mbuf_dma_tag, + sc->rxring_m_dmamap[i]); + sc->rxring_m_dmamap[i] = NULL; m_freem(sc->rxring_m[i]); sc->rxring_m[i] = NULL; @@ -1125,9 +1160,9 @@ cgem_stop(struct cgem_softc *sc) static int -cgem_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +cgem_ioctl(if_t ifp, u_long cmd, caddr_t data) { - struct cgem_softc *sc = ifp->if_softc; + struct cgem_softc *sc = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *)data; struct mii_data *mii; int error = 0, mask; @@ -1135,27 +1170,27 @@ cgem_ioctl(struct ifnet *ifp, u_long cmd switch (cmd) { case SIOCSIFFLAGS: CGEM_LOCK(sc); - if ((ifp->if_flags & IFF_UP) != 0) { - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { - if (((ifp->if_flags ^ sc->if_old_flags) & + if ((if_getflags(ifp) & IFF_UP) != 0) { + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { + if (((if_getflags(ifp) ^ sc->if_old_flags) & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { cgem_rx_filter(sc); } } else { cgem_init_locked(sc); } - } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + } else if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); cgem_stop(sc); } - sc->if_old_flags = ifp->if_flags; + sc->if_old_flags = if_getflags(ifp); CGEM_UNLOCK(sc); break; case SIOCADDMULTI: case SIOCDELMULTI: /* Set up multi-cast filters. */ - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { CGEM_LOCK(sc); cgem_rx_filter(sc); CGEM_UNLOCK(sc); @@ -1170,23 +1205,23 @@ cgem_ioctl(struct ifnet *ifp, u_long cmd case SIOCSIFCAP: CGEM_LOCK(sc); - mask = ifp->if_capenable ^ ifr->ifr_reqcap; + mask = if_getcapenable(ifp) ^ ifr->ifr_reqcap; if ((mask & IFCAP_TXCSUM) != 0) { if ((ifr->ifr_reqcap & IFCAP_TXCSUM) != 0) { /* Turn on TX checksumming. */ - ifp->if_capenable |= (IFCAP_TXCSUM | - IFCAP_TXCSUM_IPV6); - ifp->if_hwassist |= CGEM_CKSUM_ASSIST; + if_setcapenablebit(ifp, IFCAP_TXCSUM | + IFCAP_TXCSUM_IPV6, 0); + if_sethwassistbits(ifp, CGEM_CKSUM_ASSIST, 0); WR4(sc, CGEM_DMA_CFG, RD4(sc, CGEM_DMA_CFG) | CGEM_DMA_CFG_CHKSUM_GEN_OFFLOAD_EN); } else { /* Turn off TX checksumming. */ - ifp->if_capenable &= ~(IFCAP_TXCSUM | - IFCAP_TXCSUM_IPV6); - ifp->if_hwassist &= ~CGEM_CKSUM_ASSIST; + if_setcapenablebit(ifp, 0, IFCAP_TXCSUM | + IFCAP_TXCSUM_IPV6); + if_sethwassistbits(ifp, 0, CGEM_CKSUM_ASSIST); WR4(sc, CGEM_DMA_CFG, RD4(sc, CGEM_DMA_CFG) & @@ -1196,25 +1231,25 @@ cgem_ioctl(struct ifnet *ifp, u_long cmd if ((mask & IFCAP_RXCSUM) != 0) { if ((ifr->ifr_reqcap & IFCAP_RXCSUM) != 0) { /* Turn on RX checksumming. */ - ifp->if_capenable |= (IFCAP_RXCSUM | - IFCAP_RXCSUM_IPV6); + if_setcapenablebit(ifp, IFCAP_RXCSUM | + IFCAP_RXCSUM_IPV6, 0); WR4(sc, CGEM_NET_CFG, RD4(sc, CGEM_NET_CFG) | CGEM_NET_CFG_RX_CHKSUM_OFFLD_EN); } else { /* Turn off RX checksumming. */ - ifp->if_capenable &= ~(IFCAP_RXCSUM | - IFCAP_RXCSUM_IPV6); + if_setcapenablebit(ifp, 0, IFCAP_RXCSUM | + IFCAP_RXCSUM_IPV6); WR4(sc, CGEM_NET_CFG, RD4(sc, CGEM_NET_CFG) & ~CGEM_NET_CFG_RX_CHKSUM_OFFLD_EN); } } - if ((ifp->if_capenable & (IFCAP_RXCSUM | IFCAP_TXCSUM)) == + if ((if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_TXCSUM)) == (IFCAP_RXCSUM | IFCAP_TXCSUM)) - ifp->if_capenable |= IFCAP_VLAN_HWCSUM; + if_setcapenablebit(ifp, IFCAP_VLAN_HWCSUM, 0); else - ifp->if_capenable &= ~IFCAP_VLAN_HWCSUM; + if_setcapenablebit(ifp, 0, IFCAP_VLAN_HWCSUM); CGEM_UNLOCK(sc); break; @@ -1238,16 +1273,16 @@ cgem_child_detached(device_t dev, device } static int -cgem_ifmedia_upd(struct ifnet *ifp) +cgem_ifmedia_upd(if_t ifp) { - struct cgem_softc *sc = (struct cgem_softc *) ifp->if_softc; + struct cgem_softc *sc = (struct cgem_softc *) if_getsoftc(ifp); struct mii_data *mii; struct mii_softc *miisc; int error = 0; mii = device_get_softc(sc->miibus); CGEM_LOCK(sc); - if ((ifp->if_flags & IFF_UP) != 0) { + if ((if_getflags(ifp) & IFF_UP) != 0) { LIST_FOREACH(miisc, &mii->mii_phys, mii_list) PHY_RESET(miisc); error = mii_mediachg(mii); @@ -1258,9 +1293,9 @@ cgem_ifmedia_upd(struct ifnet *ifp) } static void -cgem_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +cgem_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) { - struct cgem_softc *sc = (struct cgem_softc *) ifp->if_softc; + struct cgem_softc *sc = (struct cgem_softc *) if_getsoftc(ifp); struct mii_data *mii; mii = device_get_softc(sc->miibus); @@ -1606,7 +1641,7 @@ static int cgem_attach(device_t dev) { struct cgem_softc *sc = device_get_softc(dev); - struct ifnet *ifp = NULL; + if_t ifp = NULL; phandle_t node; pcell_t cell; int rid, err; @@ -1647,23 +1682,23 @@ cgem_attach(device_t dev) cgem_detach(dev); return (ENOMEM); } - ifp->if_softc = sc; + if_setsoftc(ifp, sc); if_initname(ifp, IF_CGEM_NAME, device_get_unit(dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_start = cgem_start; - ifp->if_ioctl = cgem_ioctl; - ifp->if_init = cgem_init; - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | - IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM; + if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); + if_setinitfn(ifp, cgem_init); + if_setioctlfn(ifp, cgem_ioctl); + if_setstartfn(ifp, cgem_start); + if_setcapabilitiesbit(ifp, IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | + IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM, 0); + if_setsendqlen(ifp, CGEM_NUM_TX_DESCS); + if_setsendqready(ifp); + /* Disable hardware checksumming by default. */ - ifp->if_hwassist = 0; - ifp->if_capenable = ifp->if_capabilities & - ~(IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | IFCAP_VLAN_HWCSUM); - ifp->if_snd.ifq_drv_maxlen = CGEM_NUM_TX_DESCS; - IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); - IFQ_SET_READY(&ifp->if_snd); + if_sethwassist(ifp, 0); + if_setcapenable(ifp, if_getcapabilities(ifp) & + ~(IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | IFCAP_VLAN_HWCSUM)); - sc->if_old_flags = ifp->if_flags; + sc->if_old_flags = if_getflags(ifp); sc->rxbufs = DEFAULT_NUM_RX_BUFS; sc->rxhangwar = 1; @@ -1726,7 +1761,7 @@ cgem_detach(device_t dev) cgem_stop(sc); CGEM_UNLOCK(sc); callout_drain(&sc->tick_ch); - sc->ifp->if_flags &= ~IFF_UP; + if_setflagbits(sc->ifp, 0, IFF_UP); ether_ifdetach(sc->ifp); } @@ -1752,7 +1787,8 @@ cgem_detach(device_t dev) /* Release DMA resources. */ if (sc->rxring != NULL) { if (sc->rxring_physaddr != 0) { - bus_dmamap_unload(sc->desc_dma_tag, sc->rxring_dma_map); + bus_dmamap_unload(sc->desc_dma_tag, + sc->rxring_dma_map); sc->rxring_physaddr = 0; } bus_dmamem_free(sc->desc_dma_tag, sc->rxring, @@ -1767,7 +1803,8 @@ cgem_detach(device_t dev) } if (sc->txring != NULL) { if (sc->txring_physaddr != 0) { - bus_dmamap_unload(sc->desc_dma_tag, sc->txring_dma_map); + bus_dmamap_unload(sc->desc_dma_tag, + sc->txring_dma_map); sc->txring_physaddr = 0; } bus_dmamem_free(sc->desc_dma_tag, sc->txring, From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 01:22:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4474D53D; Tue, 10 Mar 2015 01:22:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 2D0BCFF; Tue, 10 Mar 2015 01:22:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A1MiWC076054; Tue, 10 Mar 2015 01:22:44 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A1MhHY076051; Tue, 10 Mar 2015 01:22:43 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503100122.t2A1MhHY076051@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 10 Mar 2015 01:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279829 - head/lib/libpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 01:22:44 -0000 Author: rstone Date: Tue Mar 10 01:22:43 2015 New Revision: 279829 URL: https://svnweb.freebsd.org/changeset/base/279829 Log: Add manpage for Haswell Xeon pmc implementation Differential Revision: https://reviews.freebsd.org/D1584 Reviewed by: gnn MFC After: 1 month Sponsored by: Sandvine Inc Added: head/lib/libpmc/pmc.haswellxeon.3 (contents, props changed) Modified: head/lib/libpmc/pmc.3 Modified: head/lib/libpmc/pmc.3 ============================================================================== --- head/lib/libpmc/pmc.3 Mon Mar 9 22:39:58 2015 (r279828) +++ head/lib/libpmc/pmc.3 Tue Mar 10 01:22:43 2015 (r279829) @@ -527,6 +527,7 @@ API is .Xr pmc.core2 3 , .Xr pmc.haswell 3 , .Xr pmc.haswelluc 3 , +.Xr pmc.haswellxeon 3 , .Xr pmc.iaf 3 , .Xr pmc.ivybridge 3 , .Xr pmc.ivybridgexeon 3 , Added: head/lib/libpmc/pmc.haswellxeon.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpmc/pmc.haswellxeon.3 Tue Mar 10 01:22:43 2015 (r279829) @@ -0,0 +1,975 @@ +.\" +.\" Copyright (c) 2013 Hiren Panchasara +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd 21 November, 2014 +.Dt PMC.HASWELLXEON 3 +.Os +.Sh NAME +.Nm pmc.haswellxeon +.Nd measurement events for +.Tn Intel +.Tn Haswell Xeon +family CPUs +.Sh LIBRARY +.Lb libpmc +.Sh SYNOPSIS +.In pmc.h +.Sh DESCRIPTION +.Tn Intel +.Tn "Haswell" +CPUs contain PMCs conforming to version 2 of the +.Tn Intel +performance measurement architecture. +These CPUs may contain up to two classes of PMCs: +.Bl -tag -width "Li PMC_CLASS_IAP" +.It Li PMC_CLASS_IAF +Fixed-function counters that count only one hardware event per counter. +.It Li PMC_CLASS_IAP +Programmable counters that may be configured to count one of a defined +set of hardware events. +.El +.Pp +The number of PMCs available in each class and their widths need to be +determined at run time by calling +.Xr pmc_cpuinfo 3 . +.Pp +Intel Haswell Xeon PMCs are documented in +.Rs +.%B "Intel(R) 64 and IA-32 Architectures Software Developer's Manual" +.%T "Combined Volumes: 1, 2A, 2B, 2C, 3A, 3B and 3C" +.%N "Order Number: 325462-052US" +.%D September 2014 +.%Q "Intel Corporation" +.Re +.Ss HASWELL FIXED FUNCTION PMCS +These PMCs and their supported events are documented in +.Xr pmc.iaf 3 . +.Ss HASWELL PROGRAMMABLE PMCS +The programmable PMCs support the following capabilities: +.Bl -column "PMC_CAP_INTERRUPT" "Support" +.It Em Capability Ta Em Support +.It PMC_CAP_CASCADE Ta \&No +.It PMC_CAP_EDGE Ta Yes +.It PMC_CAP_INTERRUPT Ta Yes +.It PMC_CAP_INVERT Ta Yes +.It PMC_CAP_READ Ta Yes +.It PMC_CAP_PRECISE Ta \&No +.It PMC_CAP_SYSTEM Ta Yes +.It PMC_CAP_TAGGING Ta \&No +.It PMC_CAP_THRESHOLD Ta Yes +.It PMC_CAP_USER Ta Yes +.It PMC_CAP_WRITE Ta Yes +.El +.Ss Event Qualifiers +Event specifiers for these PMCs support the following common +qualifiers: +.Bl -tag -width indent +.It Li rsp= Ns Ar value +Configure the Off-core Response bits. +.Bl -tag -width indent +.It Li DMND_DATA_RD +Counts the number of demand and DCU prefetch data reads of full +and partial cachelines as well as demand data page table entry +cacheline reads. Does not count L2 data read prefetches or +instruction fetches. +.It Li REQ_DMND_RFO +Counts the number of demand and DCU prefetch reads for ownership (RFO) +requests generated by a write to data cacheline. Does not count L2 RFO +prefetches. +.It Li REQ_DMND_IFETCH +Counts the number of demand and DCU prefetch instruction cacheline reads. +Does not count L2 code read prefetches. +.It Li REQ_WB +Counts the number of writeback (modified to exclusive) transactions. +.It Li REQ_PF_DATA_RD +Counts the number of data cacheline reads generated by L2 prefetchers. +.It Li REQ_PF_RFO +Counts the number of RFO requests generated by L2 prefetchers. +.It Li REQ_PF_IFETCH +Counts the number of code reads generated by L2 prefetchers. +.It Li REQ_PF_LLC_DATA_RD +L2 prefetcher to L3 for loads. +.It Li REQ_PF_LLC_RFO +RFO requests generated by L2 prefetcher +.It Li REQ_PF_LLC_IFETCH +L2 prefetcher to L3 for instruction fetches. +.It Li REQ_BUS_LOCKS +Bus lock and split lock requests. +.It Li REQ_STRM_ST +Streaming store requests. +.It Li REQ_OTHER +Any other request that crosses IDI, including I/O. +.It Li RES_ANY +Catch all value for any response types. +.It Li RES_SUPPLIER_NO_SUPP +No Supplier Information available. +.It Li RES_SUPPLIER_LLC_HITM +M-state initial lookup stat in L3. +.It Li RES_SUPPLIER_LLC_HITE +E-state. +.It Li RES_SUPPLIER_LLC_HITS +S-state. +.It Li RES_SUPPLIER_LLC_HITF +F-state. +.It Li RES_SUPPLIER_LOCAL +Local DRAM Controller. +.It Li RES_SNOOP_SNP_NONE +No details on snoop-related information. +.It Li RES_SNOOP_SNP_NO_NEEDED +No snoop was needed to satisfy the request. +.It Li RES_SNOOP_SNP_MISS +A snoop was needed and it missed all snooped caches: +-For LLC Hit, ReslHitl was returned by all cores +-For LLC Miss, Rspl was returned by all sockets and data was returned from +DRAM. +.It Li RES_SNOOP_HIT_NO_FWD +A snoop was needed and it hits in at least one snooped cache. Hit denotes a +cache-line was valid before snoop effect. This includes: +-Snoop Hit w/ Invalidation (LLC Hit, RFO) +-Snoop Hit, Left Shared (LLC Hit/Miss, IFetch/Data_RD) +-Snoop Hit w/ Invalidation and No Forward (LLC Miss, RFO Hit S) +In the LLC Miss case, data is returned from DRAM. +.It Li RES_SNOOP_HIT_FWD +A snoop was needed and data was forwarded from a remote socket. +This includes: +-Snoop Forward Clean, Left Shared (LLC Hit/Miss, IFetch/Data_RD/RFT). +.It Li RES_SNOOP_HITM +A snoop was needed and it HitM-ed in local or remote cache. HitM denotes a +cache-line was in modified state before effect as a results of snoop. This +includes: +-Snoop HitM w/ WB (LLC miss, IFetch/Data_RD) +-Snoop Forward Modified w/ Invalidation (LLC Hit/Miss, RFO) +-Snoop MtoS (LLC Hit, IFetch/Data_RD). +.It Li RES_NON_DRAM +Target was non-DRAM system address. This includes MMIO transactions. +.El +.It Li cmask= Ns Ar value +Configure the PMC to increment only if the number of configured +events measured in a cycle is greater than or equal to +.Ar value . +.It Li edge +Configure the PMC to count the number of de-asserted to asserted +transitions of the conditions expressed by the other qualifiers. +If specified, the counter will increment only once whenever a +condition becomes true, irrespective of the number of clocks during +which the condition remains true. +.It Li inv +Invert the sense of comparison when the +.Dq Li cmask +qualifier is present, making the counter increment when the number of +events per cycle is less than the value specified by the +.Dq Li cmask +qualifier. +.It Li os +Configure the PMC to count events happening at processor privilege +level 0. +.It Li usr +Configure the PMC to count events occurring at privilege levels 1, 2 +or 3. +.El +.Pp +If neither of the +.Dq Li os +or +.Dq Li usr +qualifiers are specified, the default is to enable both. +.Ss Event Specifiers (Programmable PMCs) +Haswell programmable PMCs support the following events: +.Bl -tag -width indent +.It Li LD_BLOCKS.STORE_FORWARD +.Pq Event 03H , Umask 02H +Loads blocked by overlapping with store buffer that +cannot be forwarded. +.It Li MISALIGN_MEM_REF.LOADS +.Pq Event 05H , Umask 01H +Speculative cache-line split load uops dispatched to +L1D. +.It Li MISALIGN_MEM_REF.STORES +.Pq Event 05H , Umask 02H +Speculative cache-line split Store-address uops +dispatched to L1D. +.It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS +.Pq Event 07H , Umask 01H +False dependencies in MOB due to partial compare +on address. +.It Li DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK +.Pq Event 08H , Umask 01H +Misses in all TLB levels that cause a page walk of any +page size. +.It Li DTLB_LOAD_MISSES.WALK_COMPLETED_4K +.Pq Event 08H , Umask 02H +Completed page walks due to demand load misses +that caused 4K page walks in any TLB levels. +.It Li DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4K +.Pq Event 08H , Umask 02H +Completed page walks due to demand load misses +that caused 2M/4M page walks in any TLB levels. +.It Li DTLB_LOAD_MISSES.WALK_COMPLETED +.Pq Event 08H , Umask 0EH +Completed page walks in any TLB of any page size +due to demand load misses +.It Li DTLB_LOAD_MISSES.WALK_DURATION +.Pq Event 08H , Umask 10H +Cycle PMH is busy with a walk. +.It Li DTLB_LOAD_MISSES.STLB_HIT_4K +.Pq Event 08H , Umask 20H +Load misses that missed DTLB but hit STLB (4K). +.It Li DTLB_LOAD_MISSES.STLB_HIT_2M +.Pq Event 08H , Umask 40H +Load misses that missed DTLB but hit STLB (2M). +.It Li DTLB_LOAD_MISSES.STLB_HIT +.Pq Event 08H , Umask 60H +Number of cache load STLB hits. No page walk. +.It Li DTLB_LOAD_MISSES.PDE_CACHE_MISS +.Pq Event 08H , Umask 80H +DTLB demand load misses with low part of linear-to- +physical address translation missed +.It Li INT_MISC.RECOVERY_CYCLES +.Pq Event 0DH , Umask 03H +Cycles waiting to recover after Machine Clears +except JEClear. Set Cmask= 1. +.It Li UOPS_ISSUED.ANY +.Pq Event 0EH , Umask 01H +ncrements each cycle the # of Uops issued by the +RAT to RS. +Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles +of this core. +.It Li UOPS_ISSUED.FLAGS_MERGE +.Pq Event 0EH , Umask 10H +Number of flags-merge uops allocated. Such uops +adds delay. +.It Li UOPS_ISSUED.SLOW_LEA +.Pq Event 0EH , Umask 20H +Number of slow LEA or similar uops allocated. Such +uop has 3 sources (e.g. 2 sources + immediate) +regardless if as a result of LEA instruction or not. +.It Li UOPS_ISSUED.SiNGLE_MUL +.Pq Event 0EH , Umask 40H +Number of multiply packed/scalar single precision +uops allocated. +.It Li L2_RQSTS.DEMAND_DATA_RD_MISS +.Pq Event 24H , Umask 21H +Demand Data Read requests that missed L2, no +rejects. +.It Li L2_RQSTS.DEMAND_DATA_RD_HIT +.Pq Event 24H , Umask 41H +Demand Data Read requests that hit L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_DATA_RD +.Pq Event 24H , Umask E1H +Counts any demand and L1 HW prefetch data load +requests to L2. +.It Li L2_RQSTS.RFO_HIT +.Pq Event 24H , Umask 42H +Counts the number of store RFO requests that hit +the L2 cache. +.It Li L2_RQSTS.RFO_MISS +.Pq Event 24H , Umask 22H +Counts the number of store RFO requests that miss +the L2 cache. +.It Li L2_RQSTS.ALL_RFO +.Pq Event 24H , Umask E2H +Counts all L2 store RFO requests. +.It Li L2_RQSTS.CODE_RD_HIT +.Pq Event 24H , Umask 44H +Number of instruction fetches that hit the L2 cache. +.It Li L2_RQSTS.CODE_RD_MISS +.Pq Event 24H , Umask 24H +Number of instruction fetches that missed the L2 +cache. +.It Li L2_RQSTS.ALL_DEMAND_MISS +.Pq Event 24H , Umask 27H +Demand requests that miss L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_REFERENCES +.Pq Event 24H , Umask E7H +Demand requests to L2 cache. +.It Li L2_RQSTS.ALL_CODE_RD +.Pq Event 24H , Umask E4H +Counts all L2 code requests. +.It Li L2_RQSTS.L2_PF_HIT +.Pq Event 24H , Umask 50H +Counts all L2 HW prefetcher requests that hit L2. +.It Li L2_RQSTS.L2_PF_MISS +.Pq Event 24H , Umask 30H +Counts all L2 HW prefetcher requests that missed +L2. +.It Li L2_RQSTS.ALL_PF +.Pq Event 24H , Umask F8H +Counts all L2 HW prefetcher requests. +.It Li L2_RQSTS.MISS +.Pq Event 24H , Umask 3FH +All requests that missed L2. +.It Li L2_RQSTS.REFERENCES +.Pq Event 24H , Umask FFH +All requests to L2 cache. +.It Li L2_DEMAND_RQSTS.WB_HIT +.Pq Event 27H , Umask 50H +Not rejected writebacks that hit L2 cache +.It Li LONGEST_LAT_CACHE.REFERENCE +.Pq Event 2EH , Umask 4FH +This event counts requests originating from the core +that reference a cache line in the last level cache. +.It Li LONGEST_LAT_CACHE.MISS +.Pq Event 2EH , Umask 41H +This event counts each cache miss condition for +references to the last level cache. +.It Li CPU_CLK_UNHALTED.THREAD_P +.Pq Event 3CH , Umask 00H +Counts the number of thread cycles while the thread +is not in a halt state. The thread enters the halt state +when it is running the HLT instruction. The core +frequency may change from time to time due to +power or thermal throttling. +.It Li CPU_CLK_THREAD_UNHALTED.REF_XCLK +.Pq Event 3CH , Umask 01H +Increments at the frequency of XCLK (100 MHz) +when not halted. +.It Li L1D_PEND_MISS.PENDING +.Pq Event 48H , Umask 01H +Increments the number of outstanding L1D misses +every cycle. Set Cmaks = 1 and Edge =1 to count +occurrences. +.It Li DTLB_STORE_MISSES.MISS_CAUSES_A_WALK +.Pq Event 49H , Umask 01H +Miss in all TLB levels causes an page walk of any +page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_COMPLETED_4K +.Pq Event 49H , Umask 02H +Completed page walks due to store misses in one or +more TLB levels of 4K page structure. +.It Li DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M +.Pq Event 49H , Umask 04H +Completed page walks due to store misses in one or +more TLB levels of 2M/4M page structure. +.It Li DTLB_STORE_MISSES.WALK_COMPLETED +.Pq Event 49H , Umask 0EH +Completed page walks due to store miss in any TLB +levels of any page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_DURATION +.Pq Event 49H , Umask 10H +Cycles PMH is busy with this walk. +.It Li DTLB_STORE_MISSES.STLB_HIT_4K +.Pq Event 49H , Umask 20H +Store misses that missed DTLB but hit STLB (4K). +.It Li DTLB_STORE_MISSES.STLB_HIT_2M +.Pq Event 49H , Umask 40H +Store misses that missed DTLB but hit STLB (2M). +.It Li DTLB_STORE_MISSES.STLB_HIT +.Pq Event 49H , Umask 60H +Store operations that miss the first TLB level but hit +the second and do not cause page walks. +.It Li DTLB_STORE_MISSES.PDE_CACHE_MISS +.Pq Event 49H , Umask 80H +DTLB store misses with low part of linear-to-physical +address translation missed. +.It Li LOAD_HIT_PRE.SW_PF +.Pq Event 4CH , Umask 01H +Non-SW-prefetch load dispatches that hit fill buffer +allocated for S/W prefetch. +.It Li LOAD_HIT_PRE.HW_PF +.Pq Event 4CH , Umask 02H +Non-SW-prefetch load dispatches that hit fill buffer +allocated for H/W prefetch. +.It Li L1D.REPLACEMENT +.Pq Event 51H , Umask 01H +Counts the number of lines brought into the L1 data +cache. +.It Li MOVE_ELIMINATION.INT_NOT_ELIMINATED +.Pq Event 58H , Umask 04H +Number of integer Move Elimination candidate uops +that were not eliminated. +.It Li MOVE_ELIMINATION.SMID_NOT_ELIMINATED +.Pq Event 58H , Umask 08H +Number of SIMD Move Elimination candidate uops +that were not eliminated. +.It Li MOVE_ELIMINATION.INT_ELIMINATED +.Pq Event 58H , Umask 01H +Unhalted core cycles when the thread is in ring 0. +.It Li MOVE_ELIMINATION.SMID_ELIMINATED +.Pq Event 58H , Umask 02H +Number of SIMD Move Elimination candidate uops +that were eliminated. +.It Li CPL_CYCLES.RING0 +.Pq Event 5CH , Umask 02H +Unhalted core cycles when the thread is in ring 0. +.It Li CPL_CYCLES.RING123 +.Pq Event 5CH , Umask 01H +Unhalted core cycles when the thread is not in ring 0. +.It Li RS_EVENTS.EMPTY_CYCLES +.Pq Event 5EH , Umask 01H +Cycles the RS is empty for the thread. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +.Pq Event 60H , Umask 01H +Offcore outstanding Demand Data Read transactions +in SQ to uncore. Set Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CORE_RD +.Pq Event 60H , Umask 02H +Offcore outstanding Demand code Read transactions +in SQ to uncore. Set Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.Pq Event 60H , Umask 04H +Offcore outstanding RFO store transactions in SQ to +uncore. Set Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.Pq Event 60H , Umask 08H +Offcore outstanding cacheable data read +transactions in SQ to uncore. Set Cmask=1 to count +cycles. +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.Pq Event 63H , Umask 01H +Cycles in which the L1D and L2 are locked, due to a +UC lock or split lock. +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.Pq Event 63H , Umask 02H +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY +.Pq Event 79H , Umask 02H +Counts cycles the IDQ is empty. +.It Li IDQ.MITE_UOPS +.Pq Event 79H , Umask 04H +Increment each cycle # of uops delivered to IDQ from +MITE path. +Set Cmask = 1 to count cycles. +.It Li IDQ.DSB_UOPS +.Pq Event 79H , Umask 08H +Increment each cycle. # of uops delivered to IDQ +from DSB path. +Set Cmask = 1 to count cycles. +.It Li IDQ.MS_DSB_UOPS +.Pq Event 79H , Umask 10H +Increment each cycle # of uops delivered to IDQ +when MS_busy by DSB. Set Cmask = 1 to count +cycles. Add Edge=1 to count # of delivery. +.It Li IDQ.MS_MITE_UOPS +.Pq Event 79H , Umask 20H +ncrement each cycle # of uops delivered to IDQ +when MS_busy by MITE. Set Cmask = 1 to count +cycles. +.It Li IDQ.MS_UOPS +.Pq Event 79H , Umask 30H +Increment each cycle # of uops delivered to IDQ from +MS by either DSB or MITE. Set Cmask = 1 to count +cycles. +.It Li IDQ.ALL_DSB_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered at least one uops. Set +Cmask = 1. +.It Li IDQ.ALL_DSB_CYCLES_4_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered four uops. Set Cmask +=4. +.It Li IDQ.ALL_MITE_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered at least one uops. Set +Cmask = 1. +.It Li IDQ.ALL_MITE_CYCLES_4_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered four uops. Set Cmask +=4. +.It Li IDQ.MITE_ALL_UOPS +.Pq Event 79H , Umask 3CH +# of uops delivered to IDQ from any path. +.It Li ICACHE.MISSES +.Pq Event 80H , Umask 02H +Number of Instruction Cache, Streaming Buffer and +Victim Cache Misses. Includes UC accesses. +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.Pq Event 85H , Umask 01H +Misses in ITLB that causes a page walk of any page +size. +.It Li ITLB_MISSES.WALK_COMPLETED_4K +.Pq Event 85H , Umask 02H +Completed page walks due to misses in ITLB 4K page +entries. +.It Li TLB_MISSES.WALK_COMPLETED_2M_4M +.Pq Event 85H , Umask 04H +Completed page walks due to misses in ITLB 2M/4M +page entries. +.It Li ITLB_MISSES.WALK_COMPLETED +.Pq Event 85H , Umask 0EH +Completed page walks in ITLB of any page size. +.It Li ITLB_MISSES.WALK_DURATION +.Pq Event 85H , Umask 10H +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT_4K +.Pq Event 85H , Umask 20H +ITLB misses that hit STLB (4K). +.It Li ITLB_MISSES.STLB_HIT_2M +.Pq Event 85H , Umask 40H +ITLB misses that hit STLB (2K). +.It Li ITLB_MISSES.STLB_HIT +.Pq Event 85H , Umask 60H +TLB misses that hit STLB. No page walk. +.It Li ILD_STALL.LCP +.Pq Event 87H , Umask 01H +Stalls caused by changing prefix length of the +instruction. +.It Li ILD_STALL.IQ_FULL +.Pq Event 87H , Umask 04H +Stall cycles due to IQ is full. +.It Li BR_INST_EXEC.COND +.Pq Event 88H , Umask 01H +Qualify conditional near branch instructions +executed, but not necessarily retired. +.It Li BR_INST_EXEC.DIRECT_JMP +.Pq Event 88H , Umask 02H +Qualify all unconditional near branch instructions +excluding calls and indirect branches. +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 88H , Umask 04H +Qualify executed indirect near branch instructions +that are not calls nor returns. +.It Li BR_INST_EXEC.RETURN_NEAR +.Pq Event 88H , Umask 08H +Qualify indirect near branches that have a return +mnemonic. +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.Pq Event 88H , Umask 10H +Qualify unconditional near call branch instructions, +excluding non call branch, executed. +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.Pq Event 88H , Umask 20H +Qualify indirect near calls, including both register and +memory indirect, executed. +.It Li BR_INST_EXEC.NONTAKEN +.Pq Event 88H , Umask 40H +Qualify non-taken near branches executed. +.It Li BR_INST_EXEC.TAKEN +.Pq Event 88H , Umask 80H +Qualify taken near branches executed. Must combine +with 01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_INST_EXEC.ALL_BRANCHES +.Pq Event 88H , Umask FFH +Counts all near executed branches (not necessarily +retired). +.It Li BR_MISP_EXEC.COND +.Pq Event 89H , Umask 01H +Qualify conditional near branch instructions +mispredicted. +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 89H , Umask 04H +Qualify mispredicted indirect near branch +instructions that are not calls nor returns. +.It Li BR_MISP_EXEC.RETURN_NEAR +.Pq Event 89H , Umask 08H +Qualify mispredicted indirect near branches that +have a return mnemonic. +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.Pq Event 89H , Umask 10H +Qualify mispredicted unconditional near call branch +instructions, excluding non call branch, executed. +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.Pq Event 89H , Umask 20H +Qualify mispredicted indirect near calls, including +both register and memory indirect, executed. +.It Li BR_MISP_EXEC.NONTAKEN +.Pq Event 89H , Umask 40H +Qualify mispredicted non-taken near branches +executed. +.It Li BR_MISP_EXEC.TAKEN +.Pq Event 89H , Umask 80H +Qualify mispredicted taken near branches executed. +Must combine with 01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_MISP_EXEC.ALL_BRANCHES +.Pq Event 89H , Umask FFH +Counts all near executed branches (not necessarily +retired). +.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.Pq Event 9CH , Umask 01H +Count number of non-delivered uops to RAT per +thread. +.It Li UOPS_EXECUTED_PORT.PORT_0 +.Pq Event A1H , Umask 01H +Cycles which a Uop is dispatched on port 0 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_1 +.Pq Event A1H , Umask 02H +Cycles which a Uop is dispatched on port 1 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_2 +.Pq Event A1H , Umask 04H +Cycles which a Uop is dispatched on port 2 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_3 +.Pq Event A1H , Umask 08H +Cycles which a Uop is dispatched on port 3 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_4 +.Pq Event A1H , Umask 10H +Cycles which a Uop is dispatched on port 4 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_5 +.Pq Event A1H , Umask 20H +Cycles which a Uop is dispatched on port 5 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_6 +.Pq Event A1H , Umask 40H +Cycles which a Uop is dispatched on port 6 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_7 +.Pq Event A1H , Umask 80H +Cycles which a Uop is dispatched on port 7 in this +thread. +.It Li RESOURCE_STALLS.ANY +.Pq Event A2H , Umask 01H +Cycles Allocation is stalled due to Resource Related +reason. +.It Li RESOURCE_STALLS.RS +.Pq Event A2H , Umask 04H +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB +.Pq Event A2H , Umask 08H +Cycles stalled due to no store buffers available (not +including draining form sync). +.It Li RESOURCE_STALLS.ROB +.Pq Event A2H , Umask 10H +Cycles stalled due to re-order buffer full. +.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING +.Pq Event A3H , Umask 01H +Cycles with pending L2 miss loads. Set Cmask=2 to +count cycle. +.It Li CYCLE_ACTIVITY.CYCLES_LDM_PENDING +.Pq Event A3H , Umask 02H +Cycles with pending memory loads. Set Cmask=2 to +count cycle. +.It Li CYCLE_ACTIVITY.STALLS_L2_PENDING +.Pq Event A3H , Umask 05H +Number of loads missed L2. +.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING +.Pq Event A3H , Umask 08H +Cycles with pending L1 cache miss loads. Set +Cmask=8 to count cycle. +.It Li ITLB.ITLB_FLUSH +.Pq Event AEH , Umask 01H +Counts the number of ITLB flushes, includes +4k/2M/4M pages. +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.Pq Event B0H , Umask 01H +Demand data read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_CODE_RD +.Pq Event B0H , Umask 02H +Demand code read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_RFO +.Pq Event B0H , Umask 04H +Demand RFO read requests sent to uncore, including +regular RFOs, locks, ItoM. +.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.Pq Event B0H , Umask 08H +Data read requests sent to uncore (demand and +prefetch). +.It Li UOPS_EXECUTED.CORE +.Pq Event B1H , Umask 02H +Counts total number of uops to be executed per-core +each cycle. +.It Li OFF_CORE_RESPONSE_0 +.Pq Event B7H , Umask 01H +Requires MSR 01A6H +.It Li OFF_CORE_RESPONSE_1 +.Pq Event BBH , Umask 01H +Requires MSR 01A7H +.It Li PAGE_WALKER_LOADS.DTLB_L1 +.Pq Event BCH , Umask 11H +Number of DTLB page walker loads that hit in the +L1+FB. +.It Li PAGE_WALKER_LOADS.ITLB_L1 +.Pq Event BCH , Umask 21H +Number of ITLB page walker loads that hit in the +L1+FB. +.It Li PAGE_WALKER_LOADS.DTLB_L2 +.Pq Event BCH , Umask 12H +Number of DTLB page walker loads that hit in the L2. +.It Li PAGE_WALKER_LOADS.ITLB_L2 +.Pq Event BCH , Umask 22H +Number of ITLB page walker loads that hit in the L2. +.It Li PAGE_WALKER_LOADS.DTLB_L3 +.Pq Event BCH , Umask 14H +Number of DTLB page walker loads that hit in the L3. +.It Li PAGE_WALKER_LOADS.ITLB_L3 +.Pq Event BCH , Umask 24H +Number of ITLB page walker loads that hit in the L3. +.It Li PAGE_WALKER_LOADS.DTLB_MEMORY +.Pq Event BCH , Umask 18H +Number of DTLB page walker loads from memory. +.It Li PAGE_WALKER_LOADS.ITLB_MEMORY +.Pq Event BCH , Umask 28H +Number of ITLB page walker loads from memory. +.It Li TLB_FLUSH.DTLB_THREAD +.Pq Event BDH , Umask 01H +DTLB flush attempts of the thread-specific entries. +.It Li TLB_FLUSH.STLB_ANY +.Pq Event BDH , Umask 20H +Count number of STLB flush attempts. +.It Li INST_RETIRED.ANY_P +.Pq Event C0H , Umask 00H +Number of instructions at retirement. +.It Li INST_RETIRED.ALL +.Pq Event C0H , Umask 01H +Precise instruction retired event with HW to reduce +effect of PEBS shadow in IP distribution. +.It Li OTHER_ASSISTS.AVX_TO_SSE +.Pq Event C1H , Umask 08H +Number of transitions from AVX-256 to legacy SSE +when penalty applicable. +.It Li OTHER_ASSISTS.SSE_TO_AVX +.Pq Event C1H , Umask 10H +Number of transitions from SSE to AVX-256 when +penalty applicable. +.It Li OTHER_ASSISTS.ANY_WB_ASSIST +.Pq Event C1H , Umask 40H +Number of microcode assists invoked by HW upon +uop writeback. +.It Li UOPS_RETIRED.ALL +.Pq Event C2H , Umask 01H +Counts the number of micro-ops retired, Use +cmask=1 and invert to count active cycles or stalled +cycles. +.It Li UOPS_RETIRED.RETIRE_SLOTS +.Pq Event C2H , Umask 02H +Counts the number of retirement slots used each +cycle. +.It Li MACHINE_CLEARS.MEMORY_ORDERING +.Pq Event C3H , Umask 02H +Counts the number of machine clears due to memory +order conflicts. +.It Li MACHINE_CLEARS.SMC +.Pq Event C3H , Umask 04H +Number of self-modifying-code machine clears +detected. +.It Li MACHINE_CLEARS.MASKMOV +.Pq Event C3H , Umask 20H +Counts the number of executed AVX masked load +operations that refer to an illegal address range with +the mask bits set to 0. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 00H +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL +.Pq Event C4H , Umask 01H +Counts the number of conditional branch instructions Supports PEBS +retired. +.It Li BR_INST_RETIRED.NEAR_CALL +.Pq Event C4H , Umask 02H +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 04H +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN +.Pq Event C4H , Umask 08H +Counts the number of near return instructions +retired. +.It Li BR_INST_RETIRED.NOT_TAKEN +.Pq Event C4H , Umask 10H +Counts the number of not taken branch instructions +retired. + It Li BR_INST_RETIRED.NEAR_TAKEN +.Pq Event C4H , Umask 20H +Number of near taken branches retired. +.It Li BR_INST_RETIRED.FAR_BRANCH +.Pq Event C4H , Umask 40H +Number of far branches retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 00H +Mispredicted branch instructions at retirement +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 01H +Mispredicted conditional branch instructions retired. +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 04H +Mispredicted macro branch instructions retired. +.It Li FP_ASSIST.X87_OUTPUT +.Pq Event CAH , Umask 02H +Number of X87 FP assists due to Output values. +.It Li FP_ASSIST.X87_INPUT +.Pq Event CAH , Umask 04H +Number of X87 FP assists due to input values. +.It Li FP_ASSIST.SIMD_OUTPUT +.Pq Event CAH , Umask 08H +Number of SIMD FP assists due to Output values. +.It Li FP_ASSIST.SIMD_INPUT +.Pq Event CAH , Umask 10H +Number of SIMD FP assists due to input values. +.It Li FP_ASSIST.ANY +.Pq Event CAH , Umask 1EH +Cycles with any input/output SSE* or FP assists. +.It Li ROB_MISC_EVENTS.LBR_INSERTS +.Pq Event CCH , Umask 20H +Count cases of saving new LBR records by hardware. +.It Li MEM_TRANS_RETIRED.LOAD_LATENCY +.Pq Event CDH , Umask 01H +Randomly sampled loads whose latency is above a +user defined threshold. A small fraction of the overall +loads are sampled due to randomization. +.It Li MEM_UOP_RETIRED.LOADS +.Pq Event D0H , Umask 01H +Qualify retired memory uops that are loads. Combine Supports PEBS and +with umask 10H, 20H, 40H, 80H. +.It Li MEM_UOP_RETIRED.STORES +.Pq Event D0H , Umask 02H +Qualify retired memory uops that are stores. +Combine with umask 10H, 20H, 40H, 80H. +.It Li MEM_UOP_RETIRED.STLB_MISS +.Pq Event D0H , Umask 10H +Qualify retired memory uops with STLB miss. Must +combine with umask 01H, 02H, to produce counts. +.It Li MEM_UOP_RETIRED.LOCK +.Pq Event D0H , Umask 20H +Qualify retired memory uops with lock. Must combine Supports PEBS and +with umask 01H, 02H, to produce counts. +.It Li MEM_UOP_RETIRED.SPLIT +.Pq Event D0H , Umask 40H +Qualify retired memory uops with line split. Must +combine with umask 01H, 02H, to produce counts. +.It Li MEM_UOP_RETIRED.ALL +.Pq Event D0H , Umask 80H +Qualify any retired memory uops. Must combine with Supports PEBS and +umask 01H, 02H, to produce counts. +.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT +.Pq Event D1H , Umask 01H +Retired load uops with L1 cache hits as data sources. +.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT +.Pq Event D1H , Umask 02H +Retired load uops with L2 cache hits as data sources. +.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT +.Pq Event D1H , Umask 04H +Retired load uops with LLC cache hits as data +sources. +.It Li MEM_LOAD_UOPS_RETIRED.L2_MISS +.Pq Event D1H , Umask 10H +Retired load uops missed L2. Unknown data source +excluded. +.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB +.Pq Event D1H , Umask 40H +Retired load uops which data sources were load uops +missed L1 but hit FB due to preceding miss to the +same cache line with data not ready. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS +.Pq Event D2H , Umask 01H +Retired load uops which data sources were LLC hit +and cross-core snoop missed in on-pkg core cache. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT +.Pq Event D2H , Umask 02H +Retired load uops which data sources were LLC and +cross-core snoop hits in on-pkg core cache. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM +.Pq Event D2H , Umask 04H +Retired load uops which data sources were HitM +responses from shared LLC. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE +.Pq Event D2H , Umask 08H +Retired load uops which data sources were hits in +LLC without snoops required. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM +.Pq Event D3H , Umask 01H +Retired load uops which data sources missed LLC but +serviced from local dram. +.It Li BACLEARS.ANY +.Pq Event E6H , Umask 1FH +Number of front end re-steers due to BPU +misprediction. +.It Li L2_TRANS.DEMAND_DATA_RD +.Pq Event F0H , Umask 01H +Demand Data Read requests that access L2 cache. +.It Li L2_TRANS.RFO +.Pq Event F0H , Umask 02H +RFO requests that access L2 cache. +.It Li L2_TRANS.CODE_RD +.Pq Event F0H , Umask 04H +L2 cache accesses when fetching instructions. +.It Li L2_TRANS.ALL_PF +.Pq Event F0H , Umask 08H +Any MLC or LLC HW prefetch accessing L2, including +rejects. +.It Li L2_TRANS.L1D_WB +.Pq Event F0H , Umask 10H +L1D writebacks that access L2 cache. +.It Li L2_TRANS.L2_FILL +.Pq Event F0H , Umask 20H +L2 fill requests that access L2 cache. +.It Li L2_TRANS.L2_WB +.Pq Event F0H , Umask 40H +L2 writebacks that access L2 cache. +.It Li L2_TRANS.ALL_REQUESTS +.Pq Event F0H , Umask 80H +Transactions accessing L2 pipe. +.It Li L2_LINES_IN.I +.Pq Event F1H , Umask 01H +L2 cache lines in I state filling L2. +.It Li L2_LINES_IN.S +.Pq Event F1H , Umask 02H +L2 cache lines in S state filling L2. +.It Li L2_LINES_IN.E +.Pq Event F1H , Umask 04H +L2 cache lines in E state filling L2. +.It Li L2_LINES_IN.ALL +.Pq Event F1H , Umask 07H +L2 cache lines filling L2. +.It Li L2_LINES_OUT.DEMAND_CLEAN +.Pq Event F2H , Umask 05H +Clean L2 cache lines evicted by demand. +.It Li L2_LINES_OUT.DEMAND_DIRTY +.Pq Event F2H , Umask 06H +Dirty L2 cache lines evicted by demand. +.El +.Sh SEE ALSO +.Xr pmc 3 , +.Xr pmc.atom 3 , +.Xr pmc.core 3 , +.Xr pmc.iaf 3 , +.Xr pmc.ucf 3 , +.Xr pmc.k7 3 , +.Xr pmc.k8 3 , +.Xr pmc.p4 3 , +.Xr pmc.p5 3 , +.Xr pmc.p6 3 , +.Xr pmc.corei7 3 , +.Xr pmc.corei7uc 3 , +.Xr pmc.haswell 3 , +.Xr pmc.haswelluc 3 , +.Xr pmc.ivybridge 3 , +.Xr pmc.ivybridgexeon 3 , +.Xr pmc.sandybridge 3 , +.Xr pmc.sandybridgeuc 3 , +.Xr pmc.sandybridgexeon 3 , +.Xr pmc.westmere 3 , +.Xr pmc.westmereuc 3 , +.Xr pmc.soft 3 , +.Xr pmc.tsc 3 , +.Xr pmc_cpuinfo 3 , +.Xr pmclog 3 , +.Xr hwpmc 4 +.Sh HISTORY +Support for the Haswell Xeon microarchitecture first appeared in +.Fx 10.2 . +.Sh AUTHORS +The +.Lb libpmc +library was written by +.An "Joseph Koshy" +.Aq jkoshy@FreeBSD.org . +The support for the Haswell Xeon +microarchitecture was written by +.An "Randall Stewart" +.Aq rrs@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 01:23:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A16C67A; Tue, 10 Mar 2015 01:23:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 5AA54105; Tue, 10 Mar 2015 01:23:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A1NZ85076245; Tue, 10 Mar 2015 01:23:35 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A1NZSA076244; Tue, 10 Mar 2015 01:23:35 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503100123.t2A1NZSA076244@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 10 Mar 2015 01:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279830 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 01:23:35 -0000 Author: rstone Date: Tue Mar 10 01:23:34 2015 New Revision: 279830 URL: https://svnweb.freebsd.org/changeset/base/279830 Log: Fix various bugs in Haswell counter definitions 1) The "WALK_COMPLETED_2M_4M" event incorrectly referenced 4K pages. 2) The umask for RING0 and RING123 events was reversed. Differential Revision: https://reviews.freebsd.org/D1585 MFC after: 1 month Sponsored by: Sandvine Inc Modified: head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Tue Mar 10 01:22:43 2015 (r279829) +++ head/sys/dev/hwpmc/pmc_events.h Tue Mar 10 01:23:34 2015 (r279830) @@ -2585,7 +2585,7 @@ __PMC_EV_ALIAS("MISALIGN_MEM_REF.STORES" __PMC_EV_ALIAS("LD_BLOCKS_PARTIAL.ADDRESS_ALIAS", IAP_EVENT_07H_01H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_08H_01H)\ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_4K", IAP_EVENT_08H_02H) \ -__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4K", \ +__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M", \ IAP_EVENT_08H_04H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED", IAP_EVENT_08H_0EH) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_DURATION", IAP_EVENT_08H_10H) \ @@ -2641,8 +2641,8 @@ __PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_NO IAP_EVENT_58H_08H) \ __PMC_EV_ALIAS("MOVE_ELIMINATION.INT_ELIMINATED", IAP_EVENT_58H_01H) \ __PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_ELIMINATED", IAP_EVENT_58H_02H) \ -__PMC_EV_ALIAS("CPL_CYCLES.RING0", IAP_EVENT_5CH_02H) \ -__PMC_EV_ALIAS("CPL_CYCLES.RING123", IAP_EVENT_5CH_01H) \ +__PMC_EV_ALIAS("CPL_CYCLES.RING0", IAP_EVENT_5CH_01H) \ +__PMC_EV_ALIAS("CPL_CYCLES.RING123", IAP_EVENT_5CH_02H) \ __PMC_EV_ALIAS("RS_EVENTS.EMPTY_CYCLES", IAP_EVENT_5EH_01H) \ __PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD", \ IAP_EVENT_60H_01H) \ @@ -2814,7 +2814,7 @@ __PMC_EV_ALIAS("MISALIGN_MEM_REF.STORES" __PMC_EV_ALIAS("LD_BLOCKS_PARTIAL.ADDRESS_ALIAS", IAP_EVENT_07H_01H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_08H_01H)\ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_4K", IAP_EVENT_08H_02H) \ -__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4K", \ +__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M", \ IAP_EVENT_08H_04H) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED", IAP_EVENT_08H_0EH) \ __PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_DURATION", IAP_EVENT_08H_10H) \ @@ -2870,8 +2870,8 @@ __PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_NO IAP_EVENT_58H_08H) \ __PMC_EV_ALIAS("MOVE_ELIMINATION.INT_ELIMINATED", IAP_EVENT_58H_01H) \ __PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_ELIMINATED", IAP_EVENT_58H_02H) \ -__PMC_EV_ALIAS("CPL_CYCLES.RING0", IAP_EVENT_5CH_02H) \ -__PMC_EV_ALIAS("CPL_CYCLES.RING123", IAP_EVENT_5CH_01H) \ +__PMC_EV_ALIAS("CPL_CYCLES.RING0", IAP_EVENT_5CH_01H) \ +__PMC_EV_ALIAS("CPL_CYCLES.RING123", IAP_EVENT_5CH_02H) \ __PMC_EV_ALIAS("RS_EVENTS.EMPTY_CYCLES", IAP_EVENT_5EH_01H) \ __PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD", \ IAP_EVENT_60H_01H) \ From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 01:23:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6D0B7BF; Tue, 10 Mar 2015 01:23:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 D201510C; Tue, 10 Mar 2015 01:23:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A1NfX4076310; Tue, 10 Mar 2015 01:23:41 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A1NfZc076309; Tue, 10 Mar 2015 01:23:41 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503100123.t2A1NfZc076309@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 10 Mar 2015 01:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279831 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 01:23:42 -0000 Author: rstone Date: Tue Mar 10 01:23:40 2015 New Revision: 279831 URL: https://svnweb.freebsd.org/changeset/base/279831 Log: Fix pmc unit restrictions to match documentation A couple of pmc counters did not work because there were being restricted to the wrong PMC unit. I've verified that these counters now work and match the documented restrictions. Differential Revision: https://reviews.freebsd.org/D1586 MFC after: 1 month Sponsored by: Sandvine Inc Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 10 01:23:34 2015 (r279830) +++ head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 10 01:23:40 2015 (r279831) @@ -1965,15 +1965,15 @@ iap_event_sb_sbx_ib_ibx_ok_on_counter(en break; /* Events valid only on counter 1. */ case PMC_EV_IAP_EVENT_C0H_01H: - mask = 0x1; + mask = 0x2; break; /* Events valid only on counter 2. */ case PMC_EV_IAP_EVENT_48H_01H: case PMC_EV_IAP_EVENT_A2H_02H: + case PMC_EV_IAP_EVENT_A3H_08H: mask = 0x4; break; /* Events valid only on counter 3. */ - case PMC_EV_IAP_EVENT_A3H_08H: case PMC_EV_IAP_EVENT_BBH_01H: case PMC_EV_IAP_EVENT_CDH_01H: case PMC_EV_IAP_EVENT_CDH_02H: From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 01:23:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D6B68FC; Tue, 10 Mar 2015 01:23:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 85AC6114; Tue, 10 Mar 2015 01:23:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A1NoW9076392; Tue, 10 Mar 2015 01:23:50 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A1Nmcq076381; Tue, 10 Mar 2015 01:23:48 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503100123.t2A1Nmcq076381@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 10 Mar 2015 01:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279832 - in head: lib/libpmc sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 01:23:50 -0000 Author: rstone Date: Tue Mar 10 01:23:47 2015 New Revision: 279832 URL: https://svnweb.freebsd.org/changeset/base/279832 Log: Fix Sandy Bridge+ hwpmc branch counters On Sandy Bridge and later, to count branch-related events you have to or together a mask indicating the type of branch instruction to count (e.g. direct jump, branch, etc) and a bits indicating whether to count taken and not-taken branches. The current counter definitions where defining this bits individually, so the counters never worked and always just counted 0. Fix the counter definitions to instead contain the proper combination of masks. Also update the man pages to reflect the new counters. Differential Revision: https://reviews.freebsd.org/D1587 MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libpmc/pmc.haswell.3 head/lib/libpmc/pmc.haswellxeon.3 head/lib/libpmc/pmc.ivybridge.3 head/lib/libpmc/pmc.ivybridgexeon.3 head/lib/libpmc/pmc.sandybridge.3 head/lib/libpmc/pmc.sandybridgexeon.3 head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/pmc_events.h Modified: head/lib/libpmc/pmc.haswell.3 ============================================================================== --- head/lib/libpmc/pmc.haswell.3 Tue Mar 10 01:23:40 2015 (r279831) +++ head/lib/libpmc/pmc.haswell.3 Tue Mar 10 01:23:47 2015 (r279832) @@ -529,73 +529,60 @@ instruction. .It Li ILD_STALL.IQ_FULL .Pq Event 87H , Umask 04H Stall cycles due to IQ is full. -.It Li BR_INST_EXEC.COND -.Pq Event 88H , Umask 01H -Qualify conditional near branch instructions -executed, but not necessarily retired. +.It Li BR_INST_EXEC.NONTAKEN_COND +.Pq Event 88H , Umask 41H +Count conditional near branch instructions that were executed (but not +necessarily retired) and not taken. +.It Li BR_INST_EXEC.TAKEN_COND +.Pq Event 88H , Umask 81H +Count conditional near branch instructions that were executed (but not +necessarily retired) and taken. .It Li BR_INST_EXEC.DIRECT_JMP -.Pq Event 88H , Umask 02H -Qualify all unconditional near branch instructions -excluding calls and indirect branches. +.Pq Event 88H , Umask 82H +Count all unconditional near branch instructions excluding calls and +indirect branches. .It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 88H , Umask 04H -Qualify executed indirect near branch instructions -that are not calls nor returns. +.Pq Event 88H , Umask 84H +Count executed indirect near branch instructions that are not calls nor +returns. .It Li BR_INST_EXEC.RETURN_NEAR -.Pq Event 88H , Umask 08H -Qualify indirect near branches that have a return -mnemonic. +.Pq Event 88H , Umask 88H +Count indirect near branches that have a return mnemonic. .It Li BR_INST_EXEC.DIRECT_NEAR_CALL -.Pq Event 88H , Umask 10H -Qualify unconditional near call branch instructions, -excluding non call branch, executed. +.Pq Event 88H , Umask 90H +Count unconditional near call branch instructions, excluding non call +branch, executed. .It Li BR_INST_EXEC.INDIRECT_NEAR_CALL -.Pq Event 88H , Umask 20H -Qualify indirect near calls, including both register and -memory indirect, executed. -.It Li BR_INST_EXEC.NONTAKEN -.Pq Event 88H , Umask 40H -Qualify non-taken near branches executed. -.It Li BR_INST_EXEC.TAKEN -.Pq Event 88H , Umask 80H -Qualify taken near branches executed. Must combine -with 01H,02H, 04H, 08H, 10H, 20H. +.Pq Event 88H , Umask A0H +Count indirect near calls, including both register and memory indirect, +executed. .It Li BR_INST_EXEC.ALL_BRANCHES .Pq Event 88H , Umask FFH -Counts all near executed branches (not necessarily -retired). -.It Li BR_MISP_EXEC.COND -.Pq Event 89H , Umask 01H -Qualify conditional near branch instructions -mispredicted. +Counts all near executed branches (not necessarily retired). +.It Li BR_MISP_EXEC.NONTAKEN_COND +.Pq Event 89H , Umask 41H +Count conditional near branch instructions mispredicted as nontaken. +.It Li BR_MISP_EXEC.TAKEN_COND +.Pq Event 89H , Umask 81H +Count conditional near branch instructions mispredicted as taken. .It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 89H , Umask 04H -Qualify mispredicted indirect near branch -instructions that are not calls nor returns. +.Pq Event 89H , Umask 84H +Count mispredicted indirect near branch instructions that are not calls +nor returns. .It Li BR_MISP_EXEC.RETURN_NEAR -.Pq Event 89H , Umask 08H -Qualify mispredicted indirect near branches that -have a return mnemonic. +.Pq Event 89H , Umask 88H +Count mispredicted indirect near branches that have a return mnemonic. .It Li BR_MISP_EXEC.DIRECT_NEAR_CALL -.Pq Event 89H , Umask 10H -Qualify mispredicted unconditional near call branch -instructions, excluding non call branch, executed. +.Pq Event 89H , Umask 90H +Count mispredicted unconditional near call branch instructions, excluding +non call branch, executed. .It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL -.Pq Event 89H , Umask 20H -Qualify mispredicted indirect near calls, including -both register and memory indirect, executed. -.It Li BR_MISP_EXEC.NONTAKEN -.Pq Event 89H , Umask 40H -Qualify mispredicted non-taken near branches -executed. -.It Li BR_MISP_EXEC.TAKEN -.Pq Event 89H , Umask 80H -Qualify mispredicted taken near branches executed. -Must combine with 01H,02H, 04H, 08H, 10H, 20H. +.Pq Event 89H , Umask A0H +Count mispredicted indirect near calls, including both register and memory +indirect, executed. .It Li BR_MISP_EXEC.ALL_BRANCHES .Pq Event 89H , Umask FFH -Counts all near executed branches (not necessarily -retired). +Counts all mispredicted near executed branches (not necessarily retired). .It Li IDQ_UOPS_NOT_DELIVERED.CORE .Pq Event 9CH , Umask 01H Count number of non-delivered uops to RAT per Modified: head/lib/libpmc/pmc.haswellxeon.3 ============================================================================== --- head/lib/libpmc/pmc.haswellxeon.3 Tue Mar 10 01:23:40 2015 (r279831) +++ head/lib/libpmc/pmc.haswellxeon.3 Tue Mar 10 01:23:47 2015 (r279832) @@ -530,73 +530,60 @@ instruction. .It Li ILD_STALL.IQ_FULL .Pq Event 87H , Umask 04H Stall cycles due to IQ is full. -.It Li BR_INST_EXEC.COND -.Pq Event 88H , Umask 01H -Qualify conditional near branch instructions -executed, but not necessarily retired. +.It Li BR_INST_EXEC.NONTAKEN_COND +.Pq Event 88H , Umask 41H +Count conditional near branch instructions that were executed (but not +necessarily retired) and not taken. +.It Li BR_INST_EXEC.TAKEN_COND +.Pq Event 88H , Umask 81H +Count conditional near branch instructions that were executed (but not +necessarily retired) and taken. .It Li BR_INST_EXEC.DIRECT_JMP -.Pq Event 88H , Umask 02H -Qualify all unconditional near branch instructions -excluding calls and indirect branches. +.Pq Event 88H , Umask 82H +Count all unconditional near branch instructions excluding calls and +indirect branches. .It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 88H , Umask 04H -Qualify executed indirect near branch instructions -that are not calls nor returns. +.Pq Event 88H , Umask 84H +Count executed indirect near branch instructions that are not calls nor +returns. .It Li BR_INST_EXEC.RETURN_NEAR -.Pq Event 88H , Umask 08H -Qualify indirect near branches that have a return -mnemonic. +.Pq Event 88H , Umask 88H +Count indirect near branches that have a return mnemonic. .It Li BR_INST_EXEC.DIRECT_NEAR_CALL -.Pq Event 88H , Umask 10H -Qualify unconditional near call branch instructions, -excluding non call branch, executed. +.Pq Event 88H , Umask 90H +Count unconditional near call branch instructions, excluding non call +branch, executed. .It Li BR_INST_EXEC.INDIRECT_NEAR_CALL -.Pq Event 88H , Umask 20H -Qualify indirect near calls, including both register and -memory indirect, executed. -.It Li BR_INST_EXEC.NONTAKEN -.Pq Event 88H , Umask 40H -Qualify non-taken near branches executed. -.It Li BR_INST_EXEC.TAKEN -.Pq Event 88H , Umask 80H -Qualify taken near branches executed. Must combine -with 01H,02H, 04H, 08H, 10H, 20H. +.Pq Event 88H , Umask A0H +Count indirect near calls, including both register and memory indirect, +executed. .It Li BR_INST_EXEC.ALL_BRANCHES .Pq Event 88H , Umask FFH -Counts all near executed branches (not necessarily -retired). -.It Li BR_MISP_EXEC.COND -.Pq Event 89H , Umask 01H -Qualify conditional near branch instructions -mispredicted. +Counts all near executed branches (not necessarily retired). +.It Li BR_MISP_EXEC.NONTAKEN_COND +.Pq Event 89H , Umask 41H +Count conditional near branch instructions mispredicted as nontaken. +.It Li BR_MISP_EXEC.TAKEN_COND +.Pq Event 89H , Umask 81H +Count conditional near branch instructions mispredicted as taken. .It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 89H , Umask 04H -Qualify mispredicted indirect near branch -instructions that are not calls nor returns. +.Pq Event 89H , Umask 84H +Count mispredicted indirect near branch instructions that are not calls +nor returns. .It Li BR_MISP_EXEC.RETURN_NEAR -.Pq Event 89H , Umask 08H -Qualify mispredicted indirect near branches that -have a return mnemonic. +.Pq Event 89H , Umask 88H +Count mispredicted indirect near branches that have a return mnemonic. .It Li BR_MISP_EXEC.DIRECT_NEAR_CALL -.Pq Event 89H , Umask 10H -Qualify mispredicted unconditional near call branch -instructions, excluding non call branch, executed. +.Pq Event 89H , Umask 90H +Count mispredicted unconditional near call branch instructions, excluding +non call branch, executed. .It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL -.Pq Event 89H , Umask 20H -Qualify mispredicted indirect near calls, including -both register and memory indirect, executed. -.It Li BR_MISP_EXEC.NONTAKEN -.Pq Event 89H , Umask 40H -Qualify mispredicted non-taken near branches -executed. -.It Li BR_MISP_EXEC.TAKEN -.Pq Event 89H , Umask 80H -Qualify mispredicted taken near branches executed. -Must combine with 01H,02H, 04H, 08H, 10H, 20H. +.Pq Event 89H , Umask A0H +Count mispredicted indirect near calls, including both register and memory +indirect, executed. .It Li BR_MISP_EXEC.ALL_BRANCHES .Pq Event 89H , Umask FFH -Counts all near executed branches (not necessarily -retired). +Counts all mispredicted near executed branches (not necessarily retired). .It Li IDQ_UOPS_NOT_DELIVERED.CORE .Pq Event 9CH , Umask 01H Count number of non-delivered uops to RAT per Modified: head/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- head/lib/libpmc/pmc.ivybridge.3 Tue Mar 10 01:23:40 2015 (r279831) +++ head/lib/libpmc/pmc.ivybridge.3 Tue Mar 10 01:23:47 2015 (r279832) @@ -449,80 +449,60 @@ Stalls caused by changing prefix length .It Li ILD_STALL.IQ_FULL .Pq Event 87H , Umask 04H Stall cycles due to IQ is full. -.It Li BR_INST_EXEC.COND -.Pq Event 88H , Umask 01H -Qualify conditional near branch instructions executed, but not necessarily -retired. -Must combine with umask 40H, 80H. +.It Li BR_INST_EXEC.NONTAKEN_COND +.Pq Event 88H , Umask 41H +Count conditional near branch instructions that were executed (but not +necessarily retired) and not taken. +.It Li BR_INST_EXEC.TAKEN_COND +.Pq Event 88H , Umask 81H +Count conditional near branch instructions that were executed (but not +necessarily retired) and taken. .It Li BR_INST_EXEC.DIRECT_JMP -.Pq Event 88H , Umask 02H -Qualify all unconditional near branch instructions excluding calls and +.Pq Event 88H , Umask 82H +Count all unconditional near branch instructions excluding calls and indirect branches. -Must combine with umask 80H. .It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 88H , Umask 04H -Qualify executed indirect near branch instructions that are not calls nor +.Pq Event 88H , Umask 84H +Count executed indirect near branch instructions that are not calls nor returns. -Must combine with umask 80H. .It Li BR_INST_EXEC.RETURN_NEAR -.Pq Event 88H , Umask 08H -Qualify indirect near branches that have a return mnemonic. -Must combine with umask 80H. +.Pq Event 88H , Umask 88H +Count indirect near branches that have a return mnemonic. .It Li BR_INST_EXEC.DIRECT_NEAR_CALL -.Pq Event 88H , Umask 10H -Qualify unconditional near call branch instructions, excluding non call +.Pq Event 88H , Umask 90H +Count unconditional near call branch instructions, excluding non call branch, executed. -Must combine with umask 80H. .It Li BR_INST_EXEC.INDIRECT_NEAR_CALL -.Pq Event 88H , Umask 20H -Qualify indirect near calls, including both register and memory indirect, +.Pq Event 88H , Umask A0H +Count indirect near calls, including both register and memory indirect, executed. -Must combine with umask 80H. -.It Li BR_INST_EXEC.NONTAKEN -.Pq Event 88H , Umask 40H -Qualify non-taken near branches executed. -Applicable to umask 01H only. -.It Li BR_INST_EXEC.TAKEN -.Pq Event 88H , Umask 80H -Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H, -10H, 20H. .It Li BR_INST_EXEC.ALL_BRANCHES .Pq Event 88H , Umask FFH Counts all near executed branches (not necessarily retired). -.It Li BR_MISP_EXEC.COND -.Pq Event 89H , Umask 01H -Qualify conditional near branch instructions mispredicted. -Must combine with umask 40H, 80H. +.It Li BR_MISP_EXEC.NONTAKEN_COND +.Pq Event 89H , Umask 41H +Count conditional near branch instructions mispredicted as nontaken. +.It Li BR_MISP_EXEC.TAKEN_COND +.Pq Event 89H , Umask 81H +Count conditional near branch instructions mispredicted as taken. .It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 89H , Umask 04H -Qualify mispredicted indirect near branch instructions that are not calls +.Pq Event 89H , Umask 84H +Count mispredicted indirect near branch instructions that are not calls nor returns. -Must combine with umask 80H. .It Li BR_MISP_EXEC.RETURN_NEAR -.Pq Event 89H , Umask 08H -Qualify mispredicted indirect near branches that have a return mnemonic. -Must combine with umask 80H. +.Pq Event 89H , Umask 88H +Count mispredicted indirect near branches that have a return mnemonic. .It Li BR_MISP_EXEC.DIRECT_NEAR_CALL -.Pq Event 89H , Umask 10H -Qualify mispredicted unconditional near call branch instructions, excluding +.Pq Event 89H , Umask 90H +Count mispredicted unconditional near call branch instructions, excluding non call branch, executed. -Must combine with umask 80H. .It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL -.Pq Event 89H , Umask 20H -Qualify mispredicted indirect near calls, including both register and memory +.Pq Event 89H , Umask A0H +Count mispredicted indirect near calls, including both register and memory indirect, executed. -Must combine with umask 80H. -.It Li BR_MISP_EXEC.NONTAKEN -.Pq Event 89H , Umask 40H -Qualify mispredicted non-taken near branches executed. -Applicable to umask 01H only. -.It Li BR_MISP_EXEC.TAKEN -.Pq Event 89H , Umask 80H -Qualify mispredicted taken near branches executed. Must combine with -01H,02H, 04H, 08H, 10H, 20H. .It Li BR_MISP_EXEC.ALL_BRANCHES .Pq Event 89H , Umask FFH -Counts all near executed branches (not necessarily retired). +Counts all mispredicted near executed branches (not necessarily retired). .It Li IDQ_UOPS_NOT_DELIVERED.CORE .Pq Event 9CH , Umask 01H Count number of non-delivered uops to RAT per thread. Modified: head/lib/libpmc/pmc.ivybridgexeon.3 ============================================================================== --- head/lib/libpmc/pmc.ivybridgexeon.3 Tue Mar 10 01:23:40 2015 (r279831) +++ head/lib/libpmc/pmc.ivybridgexeon.3 Tue Mar 10 01:23:47 2015 (r279832) @@ -449,80 +449,60 @@ Stalls caused by changing prefix length .It Li ILD_STALL.IQ_FULL .Pq Event 87H , Umask 04H Stall cycles due to IQ is full. -.It Li BR_INST_EXEC.COND -.Pq Event 88H , Umask 01H -Qualify conditional near branch instructions executed, but not necessarily -retired. -Must combine with umask 40H, 80H. +.It Li BR_INST_EXEC.NONTAKEN_COND +.Pq Event 88H , Umask 41H +Count conditional near branch instructions that were executed (but not +necessarily retired) and not taken. +.It Li BR_INST_EXEC.TAKEN_COND +.Pq Event 88H , Umask 81H +Count conditional near branch instructions that were executed (but not +necessarily retired) and taken. .It Li BR_INST_EXEC.DIRECT_JMP -.Pq Event 88H , Umask 02H -Qualify all unconditional near branch instructions excluding calls and +.Pq Event 88H , Umask 82H +Count all unconditional near branch instructions excluding calls and indirect branches. -Must combine with umask 80H. .It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 88H , Umask 04H -Qualify executed indirect near branch instructions that are not calls nor +.Pq Event 88H , Umask 84H +Count executed indirect near branch instructions that are not calls nor returns. -Must combine with umask 80H. .It Li BR_INST_EXEC.RETURN_NEAR -.Pq Event 88H , Umask 08H -Qualify indirect near branches that have a return mnemonic. -Must combine with umask 80H. +.Pq Event 88H , Umask 88H +Count indirect near branches that have a return mnemonic. .It Li BR_INST_EXEC.DIRECT_NEAR_CALL -.Pq Event 88H , Umask 10H -Qualify unconditional near call branch instructions, excluding non call +.Pq Event 88H , Umask 90H +Count unconditional near call branch instructions, excluding non call branch, executed. -Must combine with umask 80H. .It Li BR_INST_EXEC.INDIRECT_NEAR_CALL -.Pq Event 88H , Umask 20H -Qualify indirect near calls, including both register and memory indirect, +.Pq Event 88H , Umask A0H +Count indirect near calls, including both register and memory indirect, executed. -Must combine with umask 80H. -.It Li BR_INST_EXEC.NONTAKEN -.Pq Event 88H , Umask 40H -Qualify non-taken near branches executed. -Applicable to umask 01H only. -.It Li BR_INST_EXEC.TAKEN -.Pq Event 88H , Umask 80H -Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H, -10H, 20H. .It Li BR_INST_EXEC.ALL_BRANCHES .Pq Event 88H , Umask FFH Counts all near executed branches (not necessarily retired). -.It Li BR_MISP_EXEC.COND -.Pq Event 89H , Umask 01H -Qualify conditional near branch instructions mispredicted. -Must combine with umask 40H, 80H. +.It Li BR_MISP_EXEC.NONTAKEN_COND +.Pq Event 89H , Umask 41H +Count conditional near branch instructions mispredicted as nontaken. +.It Li BR_MISP_EXEC.TAKEN_COND +.Pq Event 89H , Umask 81H +Count conditional near branch instructions mispredicted as taken. .It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 89H , Umask 04H -Qualify mispredicted indirect near branch instructions that are not calls +.Pq Event 89H , Umask 84H +Count mispredicted indirect near branch instructions that are not calls nor returns. -Must combine with umask 80H. .It Li BR_MISP_EXEC.RETURN_NEAR -.Pq Event 89H , Umask 08H -Qualify mispredicted indirect near branches that have a return mnemonic. -Must combine with umask 80H. +.Pq Event 89H , Umask 88H +Count mispredicted indirect near branches that have a return mnemonic. .It Li BR_MISP_EXEC.DIRECT_NEAR_CALL -.Pq Event 89H , Umask 10H -Qualify mispredicted unconditional near call branch instructions, excluding +.Pq Event 89H , Umask 90H +Count mispredicted unconditional near call branch instructions, excluding non call branch, executed. -Must combine with umask 80H. .It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL -.Pq Event 89H , Umask 20H -Qualify mispredicted indirect near calls, including both register and memory +.Pq Event 89H , Umask A0H +Count mispredicted indirect near calls, including both register and memory indirect, executed. -Must combine with umask 80H. -.It Li BR_MISP_EXEC.NONTAKEN -.Pq Event 89H , Umask 40H -Qualify mispredicted non-taken near branches executed. -Applicable to umask 01H only. -.It Li BR_MISP_EXEC.TAKEN -.Pq Event 89H , Umask 80H -Qualify mispredicted taken near branches executed. Must combine with -01H,02H, 04H, 08H, 10H, 20H. .It Li BR_MISP_EXEC.ALL_BRANCHES .Pq Event 89H , Umask FFH -Counts all near executed branches (not necessarily retired). +Counts all mispredicted near executed branches (not necessarily retired). .It Li IDQ_UOPS_NOT_DELIVERED.CORE .Pq Event 9CH , Umask 01H Count number of non-delivered uops to RAT per thread. Modified: head/lib/libpmc/pmc.sandybridge.3 ============================================================================== --- head/lib/libpmc/pmc.sandybridge.3 Tue Mar 10 01:23:40 2015 (r279831) +++ head/lib/libpmc/pmc.sandybridge.3 Tue Mar 10 01:23:47 2015 (r279832) @@ -497,80 +497,60 @@ Stalls caused by changing prefix length .It Li ILD_STALL.IQ_FULL .Pq Event 87H, Umask 04H Stall cycles due to IQ is full. -.It Li BR_INST_EXEC.COND -.Pq Event 88H, Umask 01H -Qualify conditional near branch instructions executed, but not necessarily -retired. -Must combine with umask 40H, 80H +.It Li BR_INST_EXEC.NONTAKEN_COND +.Pq Event 88H , Umask 41H +Count conditional near branch instructions that were executed (but not +necessarily retired) and not taken. +.It Li BR_INST_EXEC.TAKEN_COND +.Pq Event 88H , Umask 81H +Count conditional near branch instructions that were executed (but not +necessarily retired) and taken. .It Li BR_INST_EXEC.DIRECT_JMP -.Pq Event 88H, Umask 02H -Qualify all unconditional near branch instructions excluding calls and indirect -branches. -Must combine with umask 80H +.Pq Event 88H , Umask 82H +Count all unconditional near branch instructions excluding calls and +indirect branches. .It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 88H, Umask 04H -Qualify executed indirect near branch instructions that are not calls nor +.Pq Event 88H , Umask 84H +Count executed indirect near branch instructions that are not calls nor returns. -Must combine with umask 80H .It Li BR_INST_EXEC.RETURN_NEAR -.Pq Event 88H, Umask 08H -Qualify indirect near branches that have a return mnemonic. -Must combine with umask 80H +.Pq Event 88H , Umask 88H +Count indirect near branches that have a return mnemonic. .It Li BR_INST_EXEC.DIRECT_NEAR_CALL -.Pq Event 88H, Umask 10H -Qualify unconditional near call branch instructions, excluding non call branch, -executed. -Must combine with umask 80H +.Pq Event 88H , Umask 90H +Count unconditional near call branch instructions, excluding non call +branch, executed. .It Li BR_INST_EXEC.INDIRECT_NEAR_CALL -.Pq Event 88H, Umask 20H -Qualify indirect near calls, including both register and memory indirect, +.Pq Event 88H , Umask A0H +Count indirect near calls, including both register and memory indirect, executed. -Must combine with umask 80H -.It Li BR_INST_EXEC.NONTAKEN -.Pq Event 88H, Umask 40H -Qualify non-taken near branches executed. -Applicable to umask 01H only -.It Li BR_INST_EXEC.TAKEN -.Pq Event 88H, Umask 80H -Qualify taken near branches executed. -Must combine with 01H,02H, 04H, 08H, 10H, 20H -.It Li BR_INST_EXE.ALL_BRANCHES -.Pq Event 88H, Umask FFH +.It Li BR_INST_EXEC.ALL_BRANCHES +.Pq Event 88H , Umask FFH Counts all near executed branches (not necessarily retired). -.It Li BR_MISP_EXEC.COND -.Pq Event 89H, Umask 01H -Qualify conditional near branch instructions mispredicted. -Must combine with umask 40H, 80H +.It Li BR_MISP_EXEC.NONTAKEN_COND +.Pq Event 89H , Umask 41H +Count conditional near branch instructions mispredicted as nontaken. +.It Li BR_MISP_EXEC.TAKEN_COND +.Pq Event 89H , Umask 81H +Count conditional near branch instructions mispredicted as taken. .It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 89H, Umask 04H -Qualify mispredicted indirect near branch instructions that are not calls nor -returns. -Must combine with umask 80H +.Pq Event 89H , Umask 84H +Count mispredicted indirect near branch instructions that are not calls +nor returns. .It Li BR_MISP_EXEC.RETURN_NEAR -.Pq Event 89H, Umask 08H -Qualify mispredicted indirect near branches that have a return mnemonic. -Must combine with umask 80H +.Pq Event 89H , Umask 88H +Count mispredicted indirect near branches that have a return mnemonic. .It Li BR_MISP_EXEC.DIRECT_NEAR_CALL -.Pq Event 89H, Umask 10H -Qualify mispredicted unconditional near call branch instructions, excluding non -call branch, executed. -Must combine with umask 80H +.Pq Event 89H , Umask 90H +Count mispredicted unconditional near call branch instructions, excluding +non call branch, executed. .It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL -.Pq Event 89H, Umask 20H -Qualify mispredicted indirect near calls, including both register and memory +.Pq Event 89H , Umask A0H +Count mispredicted indirect near calls, including both register and memory indirect, executed. -Must combine with umask 80H -.It Li BR_MISP_EXEC.NONTAKEN -.Pq Event 89H, Umask 40H -Qualify mispredicted non-taken near branches executed. -Applicable to umask 01H only -.It Li BR_MISP_EXEC.TAKEN -.Pq Event 89H, Umask 80H -Qualify mispredicted taken near branches executed. -Must combine with 01H,02H, 04H, 08H, 10H, 20H .It Li BR_MISP_EXEC.ALL_BRANCHES -.Pq Event 89H, Umask FFH -Counts all near executed branches (not necessarily retired). +.Pq Event 89H , Umask FFH +Counts all mispredicted near executed branches (not necessarily retired). .It Li IDQ_UOPS_NOT_DELIVERED.CORE .Pq Event 9CH, Umask 01H Count number of non-delivered uops to RAT per thread. Modified: head/lib/libpmc/pmc.sandybridgexeon.3 ============================================================================== --- head/lib/libpmc/pmc.sandybridgexeon.3 Tue Mar 10 01:23:40 2015 (r279831) +++ head/lib/libpmc/pmc.sandybridgexeon.3 Tue Mar 10 01:23:47 2015 (r279832) @@ -543,73 +543,60 @@ instruction. .It Li ILD_STALL.IQ_FULL .Pq Event 87H , Umask 04H Stall cycles due to IQ is full. -.It Li BR_INST_EXEC.COND -.Pq Event 88H , Umask 01H -Qualify conditional near branch instructions -executed, but not necessarily retired. +.It Li BR_INST_EXEC.NONTAKEN_COND +.Pq Event 88H , Umask 41H +Count conditional near branch instructions that were executed (but not +necessarily retired) and not taken. +.It Li BR_INST_EXEC.TAKEN_COND +.Pq Event 88H , Umask 81H +Count conditional near branch instructions that were executed (but not +necessarily retired) and taken. .It Li BR_INST_EXEC.DIRECT_JMP -.Pq Event 88H , Umask 02H -Qualify all unconditional near branch instructions -excluding calls and indirect branches. +.Pq Event 88H , Umask 82H +Count all unconditional near branch instructions excluding calls and +indirect branches. .It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 88H , Umask 04H -Qualify executed indirect near branch instructions -that are not calls nor returns. +.Pq Event 88H , Umask 84H +Count executed indirect near branch instructions that are not calls nor +returns. .It Li BR_INST_EXEC.RETURN_NEAR -.Pq Event 88H , Umask 08H -Qualify indirect near branches that have a return -mnemonic. +.Pq Event 88H , Umask 88H +Count indirect near branches that have a return mnemonic. .It Li BR_INST_EXEC.DIRECT_NEAR_CALL -.Pq Event 88H , Umask 10H -Qualify unconditional near call branch instructions, -excluding non call branch, executed. +.Pq Event 88H , Umask 90H +Count unconditional near call branch instructions, excluding non call +branch, executed. .It Li BR_INST_EXEC.INDIRECT_NEAR_CALL -.Pq Event 88H , Umask 20H -Qualify indirect near calls, including both register -and memory indirect, executed. -.It Li BR_INST_EXEC.NONTAKEN -.Pq Event 88H , Umask 40H -Qualify non-taken near branches executed. -.It Li BR_INST_EXEC.TAKEN -.Pq Event 88H , Umask 80H -Qualify taken near branches executed. Must -combine with 01H,02H, 04H, 08H, 10H, 20H. -.It Li BR_INST_EXE.ALL_BRANCHES +.Pq Event 88H , Umask A0H +Count indirect near calls, including both register and memory indirect, +executed. +.It Li BR_INST_EXEC.ALL_BRANCHES .Pq Event 88H , Umask FFH -Counts all near executed branches (not necessarily -retired). -.It Li BR_MISP_EXEC.COND -.Pq Event 89H , Umask 01H -Qualify conditional near branch instructions -mispredicted. +Counts all near executed branches (not necessarily retired). +.It Li BR_MISP_EXEC.NONTAKEN_COND +.Pq Event 89H , Umask 41H +Count conditional near branch instructions mispredicted as nontaken. +.It Li BR_MISP_EXEC.TAKEN_COND +.Pq Event 89H , Umask 81H +Count conditional near branch instructions mispredicted as taken. .It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET -.Pq Event 89H , Umask 04H -Qualify mispredicted indirect near branch -instructions that are not calls nor returns. +.Pq Event 89H , Umask 84H +Count mispredicted indirect near branch instructions that are not calls +nor returns. .It Li BR_MISP_EXEC.RETURN_NEAR -.Pq Event 89H , Umask 08H -Qualify mispredicted indirect near branches that -have a return mnemonic. +.Pq Event 89H , Umask 88H +Count mispredicted indirect near branches that have a return mnemonic. .It Li BR_MISP_EXEC.DIRECT_NEAR_CALL -.Pq Event 89H , Umask 10H -Qualify mispredicted unconditional near call branch -instructions, excluding non call branch, executed. +.Pq Event 89H , Umask 90H +Count mispredicted unconditional near call branch instructions, excluding +non call branch, executed. .It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL -.Pq Event 89H , Umask 20H -Qualify mispredicted indirect near calls, including -both register and memory indirect, executed. -.It Li BR_MISP_EXEC.NONTAKEN -.Pq Event 89H , Umask 40H -Qualify mispredicted non-taken near branches -executed,. -.It Li BR_MISP_EXEC.TAKEN -.Pq Event 89H , Umask 80H -Qualify mispredicted taken near branches executed. -Must combine with 01H,02H, 04H, 08H, 10H, 20H +.Pq Event 89H , Umask A0H +Count mispredicted indirect near calls, including both register and memory +indirect, executed. .It Li BR_MISP_EXEC.ALL_BRANCHES .Pq Event 89H , Umask FFH -Counts all near executed branches (not necessarily -retired). +Counts all mispredicted near executed branches (not necessarily retired). .It Li IDQ_UOPS_NOT_DELIVERED.CORE .Pq Event 9CH , Umask 01H Count number of non-delivered uops to RAT per Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 10 01:23:40 2015 (r279831) +++ head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 10 01:23:47 2015 (r279832) @@ -1188,46 +1188,57 @@ static struct iap_event_descr iap_events IAPDESCR(87H_0FH, 0x87, 0x0F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(88H_00H, 0x88, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), - IAPDESCR(88H_01H, 0x88, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(88H_02H, 0x88, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(88H_04H, 0x88, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(88H_01H, 0x88, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(88H_02H, 0x88, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(88H_04H, 0x88, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(88H_07H, 0x88, 0x07, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(88H_08H, 0x88, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(88H_10H, 0x88, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(88H_20H, 0x88, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(88H_08H, 0x88, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(88H_10H, 0x88, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(88H_20H, 0x88, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(88H_30H, 0x88, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(88H_40H, 0x88, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(88H_40H, 0x88, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(88H_7FH, 0x88, 0x7F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(88H_80H, 0x88, 0x80, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAPDESCR(88H_41H, 0x88, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(88H_81H, 0x88, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(88H_82H, 0x88, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(88H_84H, 0x88, 0x84, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(88H_88H, 0x88, 0x88, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(88H_90H, 0x88, 0x90, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(88H_A0H, 0x88, 0xA0, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_FFH, 0x88, 0xFF, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_00H, 0x89, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), - IAPDESCR(89H_01H, 0x89, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(89H_01H, 0x89, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(89H_02H, 0x89, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(89H_04H, 0x89, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(89H_04H, 0x89, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(89H_07H, 0x89, 0x07, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(89H_08H, 0x89, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(89H_10H, 0x89, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(89H_20H, 0x89, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(89H_08H, 0x89, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(89H_10H, 0x89, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(89H_20H, 0x89, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(89H_30H, 0x89, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(89H_40H, 0x89, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(89H_40H, 0x89, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(89H_7FH, 0x89, 0x7F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(89H_80H, 0x89, 0x80, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAPDESCR(89H_41H, 0x89, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(89H_81H, 0x89, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(89H_82H, 0x89, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(89H_84H, 0x89, 0x84, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(89H_88H, 0x89, 0x88, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(89H_90H, 0x89, 0x90, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(89H_A0H, 0x89, 0xA0, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_FFH, 0x89, 0xFF, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Tue Mar 10 01:23:40 2015 (r279831) +++ head/sys/dev/hwpmc/pmc_events.h Tue Mar 10 01:23:47 2015 (r279832) @@ -856,7 +856,14 @@ __PMC_EV(IAP, EVENT_88H_10H) \ __PMC_EV(IAP, EVENT_88H_20H) \ __PMC_EV(IAP, EVENT_88H_30H) \ __PMC_EV(IAP, EVENT_88H_40H) \ +__PMC_EV(IAP, EVENT_88H_41H) \ __PMC_EV(IAP, EVENT_88H_80H) \ +__PMC_EV(IAP, EVENT_88H_81H) \ +__PMC_EV(IAP, EVENT_88H_82H) \ +__PMC_EV(IAP, EVENT_88H_84H) \ +__PMC_EV(IAP, EVENT_88H_88H) \ +__PMC_EV(IAP, EVENT_88H_90H) \ +__PMC_EV(IAP, EVENT_88H_A0H) \ __PMC_EV(IAP, EVENT_88H_7FH) \ __PMC_EV(IAP, EVENT_88H_FFH) \ __PMC_EV(IAP, EVENT_89H_00H) \ @@ -869,7 +876,14 @@ __PMC_EV(IAP, EVENT_89H_10H) \ __PMC_EV(IAP, EVENT_89H_20H) \ __PMC_EV(IAP, EVENT_89H_30H) \ __PMC_EV(IAP, EVENT_89H_40H) \ +__PMC_EV(IAP, EVENT_89H_41H) \ __PMC_EV(IAP, EVENT_89H_80H) \ +__PMC_EV(IAP, EVENT_89H_81H) \ +__PMC_EV(IAP, EVENT_89H_82H) \ +__PMC_EV(IAP, EVENT_89H_84H) \ +__PMC_EV(IAP, EVENT_89H_88H) \ +__PMC_EV(IAP, EVENT_89H_90H) \ +__PMC_EV(IAP, EVENT_89H_A0H) \ __PMC_EV(IAP, EVENT_89H_7FH) \ __PMC_EV(IAP, EVENT_89H_FFH) \ __PMC_EV(IAP, EVENT_8AH_00H) \ @@ -2677,24 +2691,22 @@ __PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT_2M" __PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT", IAP_EVENT_85H_60H) \ __PMC_EV_ALIAS("ILD_STALL.LCP", IAP_EVENT_87H_01H) \ __PMC_EV_ALIAS("ILD_STALL.IQ_FULL", IAP_EVENT_87H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.COND", IAP_EVENT_88H_01H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_02H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN_COND", IAP_EVENT_88H_41H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN_COND", IAP_EVENT_88H_81H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_82H) \ __PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET", \ - IAP_EVENT_88H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_08H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_10H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_20H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN", IAP_EVENT_88H_40H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN", IAP_EVENT_88H_80H) \ + IAP_EVENT_88H_84H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_88H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_90H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_A0H) \ __PMC_EV_ALIAS("BR_INST_EXEC.ALL_BRANCHES", IAP_EVENT_88H_FFH) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.COND", IAP_EVENT_89H_01H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.NONTAKEN_COND", IAP_EVENT_89H_41H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.TAKEN_COND", IAP_EVENT_89H_81H) \ __PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET", \ - IAP_EVENT_89H_04H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.RETURN_NEAR", IAP_EVENT_89H_08H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_89H_10H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_89H_20H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.NONTAKEN", IAP_EVENT_89H_40H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.TAKEN", IAP_EVENT_89H_80H) \ + IAP_EVENT_89H_84H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.RETURN_NEAR", IAP_EVENT_89H_88H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_89H_90H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_89H_A0H) \ __PMC_EV_ALIAS("BR_MISP_EXEC.ALL_BRANCHES", IAP_EVENT_89H_FFH) \ __PMC_EV_ALIAS("IDQ_UOPS_NOT_DELIVERED.CORE", IAP_EVENT_9CH_01H) \ __PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_0", IAP_EVENT_A1H_01H) \ @@ -2906,24 +2918,22 @@ __PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT_2M" __PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT", IAP_EVENT_85H_60H) \ __PMC_EV_ALIAS("ILD_STALL.LCP", IAP_EVENT_87H_01H) \ __PMC_EV_ALIAS("ILD_STALL.IQ_FULL", IAP_EVENT_87H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.COND", IAP_EVENT_88H_01H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_02H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN_COND", IAP_EVENT_88H_41H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN_COND", IAP_EVENT_88H_81H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_82H) \ __PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET", \ - IAP_EVENT_88H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_08H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_10H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_20H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN", IAP_EVENT_88H_40H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN", IAP_EVENT_88H_80H) \ + IAP_EVENT_88H_84H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_88H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_90H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_A0H) \ __PMC_EV_ALIAS("BR_INST_EXEC.ALL_BRANCHES", IAP_EVENT_88H_FFH) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.COND", IAP_EVENT_89H_01H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.NONTAKEN_COND", IAP_EVENT_89H_41H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.TAKEN_COND", IAP_EVENT_89H_81H) \ __PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET", \ - IAP_EVENT_89H_04H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.RETURN_NEAR", IAP_EVENT_89H_08H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_89H_10H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_89H_20H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.NONTAKEN", IAP_EVENT_89H_40H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.TAKEN", IAP_EVENT_89H_80H) \ + IAP_EVENT_89H_84H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.RETURN_NEAR", IAP_EVENT_89H_88H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_89H_90H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_89H_A0H) \ __PMC_EV_ALIAS("BR_MISP_EXEC.ALL_BRANCHES", IAP_EVENT_89H_FFH) \ __PMC_EV_ALIAS("IDQ_UOPS_NOT_DELIVERED.CORE", IAP_EVENT_9CH_01H) \ __PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_0", IAP_EVENT_A1H_01H) \ @@ -3132,24 +3142,22 @@ __PMC_EV_ALIAS("ITLB_MISSES.WALK_DURATIO __PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT", IAP_EVENT_85H_10H) \ __PMC_EV_ALIAS("ILD_STALL.LCP", IAP_EVENT_87H_01H) \ __PMC_EV_ALIAS("ILD_STALL.IQ_FULL", IAP_EVENT_87H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.COND", IAP_EVENT_88H_01H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_02H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN_COND", IAP_EVENT_88H_41H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN_COND", IAP_EVENT_88H_81H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_82H) \ __PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET", \ - IAP_EVENT_88H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_08H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_10H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_20H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN", IAP_EVENT_88H_40H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN", IAP_EVENT_88H_80H) \ + IAP_EVENT_88H_84H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_88H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_90H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_A0H) \ __PMC_EV_ALIAS("BR_INST_EXEC.ALL_BRANCHES", IAP_EVENT_88H_FFH) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.COND", IAP_EVENT_89H_01H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.NONTAKEN_COND", IAP_EVENT_89H_41H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.TAKEN_COND", IAP_EVENT_89H_81H) \ __PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET", \ - IAP_EVENT_89H_04H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.RETURN_NEAR", IAP_EVENT_89H_08H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_89H_10H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_89H_20H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.NONTAKEN", IAP_EVENT_89H_40H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.TAKEN", IAP_EVENT_89H_80H) \ + IAP_EVENT_89H_84H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.RETURN_NEAR", IAP_EVENT_89H_88H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_89H_90H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_89H_A0H) \ __PMC_EV_ALIAS("BR_MISP_EXEC.ALL_BRANCHES", IAP_EVENT_89H_FFH) \ __PMC_EV_ALIAS("IDQ_UOPS_NOT_DELIVERED.CORE", IAP_EVENT_9CH_01H) \ __PMC_EV_ALIAS("UOPS_DISPATCHED_PORT.PORT_0", IAP_EVENT_A1H_01H) \ @@ -3363,24 +3371,22 @@ __PMC_EV_ALIAS("ITLB_MISSES.WALK_DURATIO __PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT", IAP_EVENT_85H_10H) \ __PMC_EV_ALIAS("ILD_STALL.LCP", IAP_EVENT_87H_01H) \ __PMC_EV_ALIAS("ILD_STALL.IQ_FULL", IAP_EVENT_87H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.COND", IAP_EVENT_88H_01H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_02H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN_COND", IAP_EVENT_88H_41H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN_COND", IAP_EVENT_88H_81H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_82H) \ __PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET", \ - IAP_EVENT_88H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_08H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_10H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_20H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN", IAP_EVENT_88H_40H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN", IAP_EVENT_88H_80H) \ + IAP_EVENT_88H_84H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_88H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_90H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_A0H) \ __PMC_EV_ALIAS("BR_INST_EXEC.ALL_BRANCHES", IAP_EVENT_88H_FFH) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.COND", IAP_EVENT_89H_01H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.NONTAKEN_COND", IAP_EVENT_89H_41H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.TAKEN_COND", IAP_EVENT_89H_81H) \ __PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET", \ - IAP_EVENT_89H_04H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.RETURN_NEAR", IAP_EVENT_89H_08H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_89H_10H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_89H_20H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.NONTAKEN", IAP_EVENT_89H_40H) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.TAKEN", IAP_EVENT_89H_80H) \ + IAP_EVENT_89H_84H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.RETURN_NEAR", IAP_EVENT_89H_88H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_89H_90H) \ +__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_89H_A0H) \ __PMC_EV_ALIAS("BR_MISP_EXEC.ALL_BRANCHES", IAP_EVENT_89H_FFH) \ __PMC_EV_ALIAS("IDQ_UOPS_NOT_DELIVERED.CORE", IAP_EVENT_9CH_01H) \ __PMC_EV_ALIAS("UOPS_DISPATCHED_PORT.PORT_0", IAP_EVENT_A1H_01H) \ @@ -3599,24 +3605,22 @@ __PMC_EV_ALIAS("ITLB_MISSES.WALK_DURATIO __PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT", IAP_EVENT_85H_10H) \ __PMC_EV_ALIAS("ILD_STALL.LCP", IAP_EVENT_87H_01H) \ __PMC_EV_ALIAS("ILD_STALL.IQ_FULL", IAP_EVENT_87H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.COND", IAP_EVENT_88H_01H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_02H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN_COND", IAP_EVENT_88H_41H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN_COND", IAP_EVENT_88H_81H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_JMP", IAP_EVENT_88H_82H) \ __PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET", \ - IAP_EVENT_88H_04H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_08H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_10H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_20H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN", IAP_EVENT_88H_40H) \ -__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN", IAP_EVENT_88H_80H) \ -__PMC_EV_ALIAS("BR_INST_EXE.ALL_BRANCHES", IAP_EVENT_88H_FFH) \ -__PMC_EV_ALIAS("BR_MISP_EXEC.COND", IAP_EVENT_89H_01H) \ + IAP_EVENT_88H_84H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_88H) \ +__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_90H) \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 01:23:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA130A2D; Tue, 10 Mar 2015 01:23:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 D54D8118; Tue, 10 Mar 2015 01:23:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A1NuZi076455; Tue, 10 Mar 2015 01:23:56 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A1NuL7076454; Tue, 10 Mar 2015 01:23:56 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503100123.t2A1NuL7076454@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 10 Mar 2015 01:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279833 - head/lib/libpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 01:23:57 -0000 Author: rstone Date: Tue Mar 10 01:23:55 2015 New Revision: 279833 URL: https://svnweb.freebsd.org/changeset/base/279833 Log: Use the correct event table for Haswell Xeon events Differential Revision: https://reviews.freebsd.org/D1588 MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libpmc/libpmc.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Tue Mar 10 01:23:47 2015 (r279832) +++ head/lib/libpmc/libpmc.c Tue Mar 10 01:23:55 2015 (r279833) @@ -325,7 +325,7 @@ PMC_CLASS_TABLE_DESC(core2, IAP, core2, PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); PMC_CLASS_TABLE_DESC(nehalem_ex, IAP, nehalem_ex, iap); PMC_CLASS_TABLE_DESC(haswell, IAP, haswell, iap); -PMC_CLASS_TABLE_DESC(haswell_xeon, IAP, haswell, iap); +PMC_CLASS_TABLE_DESC(haswell_xeon, IAP, haswell_xeon, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 01:24:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CBB2B6A; Tue, 10 Mar 2015 01:24:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 3D7CD11F; Tue, 10 Mar 2015 01:24:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A1O3LZ076537; Tue, 10 Mar 2015 01:24:03 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A1O38w076536; Tue, 10 Mar 2015 01:24:03 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503100124.t2A1O38w076536@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 10 Mar 2015 01:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279834 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 01:24:03 -0000 Author: rstone Date: Tue Mar 10 01:24:02 2015 New Revision: 279834 URL: https://svnweb.freebsd.org/changeset/base/279834 Log: Support architectural events on Haswell/Ivy Bridge Differential Revision: https://reviews.freebsd.org/D1589 MFC after: 1 month Sponsored by: Sandvine Inc Modified: head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Tue Mar 10 01:23:55 2015 (r279833) +++ head/sys/dev/hwpmc/pmc_events.h Tue Mar 10 01:24:02 2015 (r279834) @@ -2592,6 +2592,7 @@ __PMC_EV_ALIAS("SIMD_INT_64.SHUFFLE_MOVE * Aliases for Haswell core PMC events */ #define __PMC_EV_ALIAS_HASWELL_XEON() \ +__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ __PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \ __PMC_EV_ALIAS("LD_BLOCKS.NO_SR", IAP_EVENT_03H_08H) \ __PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \ @@ -2819,6 +2820,7 @@ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_DIRT #define __PMC_EV_ALIAS_HASWELL() \ +__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ __PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \ __PMC_EV_ALIAS("LD_BLOCKS.NO_SR", IAP_EVENT_03H_08H) \ __PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \ @@ -3046,6 +3048,7 @@ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_DIRT #define __PMC_EV_ALIAS_IVYBRIDGE() \ +__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ __PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \ __PMC_EV_ALIAS("LD_BLOCKS.NO_SR", IAP_EVENT_03H_08H) \ __PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \ @@ -3276,6 +3279,7 @@ __PMC_EV_ALIAS("L2_LINES_OUT.PF_DIRTY", * Aliases for Ivy Bridge Xeon PMC events (325462-045US January 2013) */ #define __PMC_EV_ALIAS_IVYBRIDGE_XEON() \ +__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ __PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \ __PMC_EV_ALIAS("LD_BLOCKS.NO_SR", IAP_EVENT_03H_08H) \ __PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \ From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 01:24:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 462CDCA4; Tue, 10 Mar 2015 01:24:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 2E898127; Tue, 10 Mar 2015 01:24:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A1OBEK076620; Tue, 10 Mar 2015 01:24:11 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A1O94j076608; Tue, 10 Mar 2015 01:24:09 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503100124.t2A1O94j076608@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 10 Mar 2015 01:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279835 - in head: lib/libpmc sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 01:24:11 -0000 Author: rstone Date: Tue Mar 10 01:24:08 2015 New Revision: 279835 URL: https://svnweb.freebsd.org/changeset/base/279835 Log: Fix Ivy Bridge+ MEM_UOPS_RETIRED counters The MEM_UOPS_RETIRED actually work the same way as the Sandy Bridge counters, but the counters were documented in a different way and that seemed to cause the Ivy Bridge counters to be implemented incorrectly. Use the same counter definitions as Sandy Bridge. While I'm here, rename the counters to match what's documented in the datasheet. Differential Revision: https://reviews.freebsd.org/D1590 MFC after: 1 month Sponsored by: Sandvine Inc. Modified: head/lib/libpmc/pmc.haswell.3 head/lib/libpmc/pmc.haswellxeon.3 head/lib/libpmc/pmc.ivybridge.3 head/lib/libpmc/pmc.ivybridgexeon.3 head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/pmc_events.h Modified: head/lib/libpmc/pmc.haswell.3 ============================================================================== --- head/lib/libpmc/pmc.haswell.3 Tue Mar 10 01:24:02 2015 (r279834) +++ head/lib/libpmc/pmc.haswell.3 Tue Mar 10 01:24:08 2015 (r279835) @@ -808,30 +808,24 @@ Count cases of saving new LBR records by Randomly sampled loads whose latency is above a user defined threshold. A small fraction of the overall loads are sampled due to randomization. -.It Li MEM_UOP_RETIRED.LOADS -.Pq Event D0H , Umask 01H -Qualify retired memory uops that are loads. Combine Supports PEBS and -with umask 10H, 20H, 40H, 80H. -.It Li MEM_UOP_RETIRED.STORES -.Pq Event D0H , Umask 02H -Qualify retired memory uops that are stores. -Combine with umask 10H, 20H, 40H, 80H. -.It Li MEM_UOP_RETIRED.STLB_MISS -.Pq Event D0H , Umask 10H -Qualify retired memory uops with STLB miss. Must -combine with umask 01H, 02H, to produce counts. -.It Li MEM_UOP_RETIRED.LOCK -.Pq Event D0H , Umask 20H -Qualify retired memory uops with lock. Must combine Supports PEBS and -with umask 01H, 02H, to produce counts. -.It Li MEM_UOP_RETIRED.SPLIT -.Pq Event D0H , Umask 40H -Qualify retired memory uops with line split. Must -combine with umask 01H, 02H, to produce counts. -.It Li MEM_UOP_RETIRED.ALL -.Pq Event D0H , Umask 80H -Qualify any retired memory uops. Must combine with Supports PEBS and -umask 01H, 02H, to produce counts. +.It Li MEM_UOPS_RETIRED.STLB_MISS_LOADS +.Pq Event D0H , Umask 11H +Count retired load uops that missed the STLB. +.It Li MEM_UOPS_RETIRED.STLB_MISS_STORES +.Pq Event D0H , Umask 12H +Count retired store uops that missed the STLB. +.It Li MEM_UOPS_RETIRED.SPLIT_LOADS +.Pq Event D0H , Umask 41H +Count retired load uops that were split across a cache line. +.It Li MEM_UOPS_RETIRED.SPLIT_STORES +.Pq Event D0H , Umask 42H +Count retired store uops that were split across a cache line. +.It Li MEM_UOPS_RETIRED.ALL_LOADS +.Pq Event D0H , Umask 81H +Count all retired load uops. +.It Li MEM_UOPS_RETIRED.ALL_STORES +.Pq Event D0H , Umask 82H +Count all retired store uops. .It Li MEM_LOAD_UOPS_RETIRED.L1_HIT .Pq Event D1H , Umask 01H Retired load uops with L1 cache hits as data sources. Modified: head/lib/libpmc/pmc.haswellxeon.3 ============================================================================== --- head/lib/libpmc/pmc.haswellxeon.3 Tue Mar 10 01:24:02 2015 (r279834) +++ head/lib/libpmc/pmc.haswellxeon.3 Tue Mar 10 01:24:08 2015 (r279835) @@ -809,30 +809,24 @@ Count cases of saving new LBR records by Randomly sampled loads whose latency is above a user defined threshold. A small fraction of the overall loads are sampled due to randomization. -.It Li MEM_UOP_RETIRED.LOADS -.Pq Event D0H , Umask 01H -Qualify retired memory uops that are loads. Combine Supports PEBS and -with umask 10H, 20H, 40H, 80H. -.It Li MEM_UOP_RETIRED.STORES -.Pq Event D0H , Umask 02H -Qualify retired memory uops that are stores. -Combine with umask 10H, 20H, 40H, 80H. -.It Li MEM_UOP_RETIRED.STLB_MISS -.Pq Event D0H , Umask 10H -Qualify retired memory uops with STLB miss. Must -combine with umask 01H, 02H, to produce counts. -.It Li MEM_UOP_RETIRED.LOCK -.Pq Event D0H , Umask 20H -Qualify retired memory uops with lock. Must combine Supports PEBS and -with umask 01H, 02H, to produce counts. -.It Li MEM_UOP_RETIRED.SPLIT -.Pq Event D0H , Umask 40H -Qualify retired memory uops with line split. Must -combine with umask 01H, 02H, to produce counts. -.It Li MEM_UOP_RETIRED.ALL -.Pq Event D0H , Umask 80H -Qualify any retired memory uops. Must combine with Supports PEBS and -umask 01H, 02H, to produce counts. +.It Li MEM_UOPS_RETIRED.STLB_MISS_LOADS +.Pq Event D0H , Umask 11H +Count retired load uops that missed the STLB. +.It Li MEM_UOPS_RETIRED.STLB_MISS_STORES +.Pq Event D0H , Umask 12H +Count retired store uops that missed the STLB. +.It Li MEM_UOPS_RETIRED.SPLIT_LOADS +.Pq Event D0H , Umask 41H +Count retired load uops that were split across a cache line. +.It Li MEM_UOPS_RETIRED.SPLIT_STORES +.Pq Event D0H , Umask 42H +Count retired store uops that were split across a cache line. +.It Li MEM_UOPS_RETIRED.ALL_LOADS +.Pq Event D0H , Umask 81H +Count all retired load uops. +.It Li MEM_UOPS_RETIRED.ALL_STORES +.Pq Event D0H , Umask 82H +Count all retired store uops. .It Li MEM_LOAD_UOPS_RETIRED.L1_HIT .Pq Event D1H , Umask 01H Retired load uops with L1 cache hits as data sources. Modified: head/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- head/lib/libpmc/pmc.ivybridge.3 Tue Mar 10 01:24:02 2015 (r279834) +++ head/lib/libpmc/pmc.ivybridge.3 Tue Mar 10 01:24:08 2015 (r279835) @@ -706,31 +706,24 @@ Specify threshold in MSR 0x3F6. .Pq Event CDH , Umask 02H Sample stores and collect precise store operation via PEBS record. PMC3 only. -.It Li MEM_UOP_RETIRED.LOADS -.Pq Event D0H , Umask 01H -Qualify retired memory uops that are loads. Combine with umask 10H, 20H, -40H, 80H. -Supports PEBS. -.It Li MEM_UOP_RETIRED.STORES -.Pq Event D0H , Umask 02H -Qualify retired memory uops that are stores. Combine with umask 10H, 20H, -40H, 80H. -.It Li MEM_UOP_RETIRED.STLB_MISS -.Pq Event D0H , Umask 10H -Qualify retired memory uops with STLB miss. Must combine with umask 01H, -02H, to produce counts. -.It Li MEM_UOP_RETIRED.LOCK -.Pq Event D0H , Umask 20H -Qualify retired memory uops with lock. Must combine with umask 01H, 02H, to -produce counts. -.It Li MEM_UOP_RETIRED.SPLIT -.Pq Event D0H , Umask 40H -Qualify retired memory uops with line split. Must combine with umask 01H, -02H, to produce counts. -.It Li MEM_UOP_RETIRED.ALL -.Pq Event D0H , Umask 80H -Qualify any retired memory uops. Must combine with umask 01H, 02H, to -produce counts. +.It Li MEM_UOPS_RETIRED.STLB_MISS_LOADS +.Pq Event D0H , Umask 11H +Count retired load uops that missed the STLB. +.It Li MEM_UOPS_RETIRED.STLB_MISS_STORES +.Pq Event D0H , Umask 12H +Count retired store uops that missed the STLB. +.It Li MEM_UOPS_RETIRED.SPLIT_LOADS +.Pq Event D0H , Umask 41H +Count retired load uops that were split across a cache line. +.It Li MEM_UOPS_RETIRED.SPLIT_STORES +.Pq Event D0H , Umask 42H +Count retired store uops that were split across a cache line. +.It Li MEM_UOPS_RETIRED.ALL_LOADS +.Pq Event D0H , Umask 81H +Count all retired load uops. +.It Li MEM_UOPS_RETIRED.ALL_STORES +.Pq Event D0H , Umask 82H +Count all retired store uops. .It Li MEM_LOAD_UOPS_RETIRED.L1_HIT .Pq Event D1H , Umask 01H Retired load uops with L1 cache hits as data sources. Modified: head/lib/libpmc/pmc.ivybridgexeon.3 ============================================================================== --- head/lib/libpmc/pmc.ivybridgexeon.3 Tue Mar 10 01:24:02 2015 (r279834) +++ head/lib/libpmc/pmc.ivybridgexeon.3 Tue Mar 10 01:24:08 2015 (r279835) @@ -718,31 +718,24 @@ Specify threshold in MSR 0x3F6. .Pq Event CDH , Umask 02H Sample stores and collect precise store operation via PEBS record. PMC3 only. -.It Li MEM_UOP_RETIRED.LOADS -.Pq Event D0H , Umask 01H -Qualify retired memory uops that are loads. Combine with umask 10H, 20H, -40H, 80H. -Supports PEBS. -.It Li MEM_UOP_RETIRED.STORES -.Pq Event D0H , Umask 02H -Qualify retired memory uops that are stores. Combine with umask 10H, 20H, -40H, 80H. -.It Li MEM_UOP_RETIRED.STLB_MISS -.Pq Event D0H , Umask 10H -Qualify retired memory uops with STLB miss. Must combine with umask 01H, -02H, to produce counts. -.It Li MEM_UOP_RETIRED.LOCK -.Pq Event D0H , Umask 20H -Qualify retired memory uops with lock. Must combine with umask 01H, 02H, to -produce counts. -.It Li MEM_UOP_RETIRED.SPLIT -.Pq Event D0H , Umask 40H -Qualify retired memory uops with line split. Must combine with umask 01H, -02H, to produce counts. -.It Li MEM_UOP_RETIRED.ALL -.Pq Event D0H , Umask 80H -Qualify any retired memory uops. Must combine with umask 01H, 02H, to -produce counts. +.It Li MEM_UOPS_RETIRED.STLB_MISS_LOADS +.Pq Event D0H , Umask 11H +Count retired load uops that missed the STLB. +.It Li MEM_UOPS_RETIRED.STLB_MISS_STORES +.Pq Event D0H , Umask 12H +Count retired store uops that missed the STLB. +.It Li MEM_UOPS_RETIRED.SPLIT_LOADS +.Pq Event D0H , Umask 41H +Count retired load uops that were split across a cache line. +.It Li MEM_UOPS_RETIRED.SPLIT_STORES +.Pq Event D0H , Umask 42H +Count retired store uops that were split across a cache line. +.It Li MEM_UOPS_RETIRED.ALL_LOADS +.Pq Event D0H , Umask 81H +Count all retired load uops. +.It Li MEM_UOPS_RETIRED.ALL_STORES +.Pq Event D0H , Umask 82H +Count all retired store uops. .It Li MEM_LOAD_UOPS_RETIRED.L1_HIT .Pq Event D1H , Umask 01H Retired load uops with L1 cache hits as data sources. Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 10 01:24:02 2015 (r279834) +++ head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 10 01:24:08 2015 (r279835) @@ -1597,29 +1597,21 @@ static struct iap_event_descr iap_events /* Sandy Bridge / Sandy Bridge Xeon - 11, 12, 21, 41, 42, 81, 82 */ IAPDESCR(D0H_00H, 0xD0, 0x00, IAP_F_FM | IAP_F_CC), - IAPDESCR(D0H_01H, 0xD0, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | - IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(D0H_02H, 0xD0, 0x02, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | - IAP_F_HWX), - IAPDESCR(D0H_10H, 0xD0, 0x10, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | - IAP_F_HWX), - IAPDESCR(D0H_11H, 0xD0, 0x11, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(D0H_12H, 0xD0, 0x12, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(D0H_20H, 0xD0, 0x20, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | - IAP_F_HWX), + IAPDESCR(D0H_01H, 0xD0, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(D0H_11H, 0xD0, 0x11, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(D0H_12H, 0xD0, 0x12, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(D0H_21H, 0xD0, 0x21, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(D0H_40H, 0xD0, 0x40, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | - IAP_F_HWX), - IAPDESCR(D0H_41H, 0xD0, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_SBX | - IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), /* Not in spec but in linux and Vtune guide */ - IAPDESCR(D0H_42H, 0xD0, 0x42, IAP_F_FM | IAP_F_SB | IAP_F_SBX | - IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), /* Not in spec but in linux and Vtune guide */ - IAPDESCR(D0H_80H, 0xD0, 0x80, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | - IAP_F_HWX), - IAPDESCR(D0H_81H, 0xD0, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_SBX | - IAP_F_IB | IAP_F_IBX), /* Not in spec but in linux and Vtune guide */ - IAPDESCR(D0H_82H, 0xD0, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_SBX | - IAP_F_IB | IAP_F_IBX), /* Not in spec but in linux and Vtune guide */ + IAPDESCR(D0H_41H, 0xD0, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(D0H_42H, 0xD0, 0x42, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(D0H_81H, 0xD0, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(D0H_82H, 0xD0, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB | + IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(D1H_01H, 0xD1, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(D1H_02H, 0xD1, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Tue Mar 10 01:24:02 2015 (r279834) +++ head/sys/dev/hwpmc/pmc_events.h Tue Mar 10 01:24:08 2015 (r279835) @@ -2775,14 +2775,12 @@ __PMC_EV_ALIAS("FP_ASSIST.SIMD_INPUT", I __PMC_EV_ALIAS("FP_ASSIST.ANY", IAP_EVENT_CAH_1EH) \ __PMC_EV_ALIAS("ROB_MISC_EVENTS.LBR_INSERTS", IAP_EVENT_CCH_20H) \ __PMC_EV_ALIAS("MEM_TRANS_RETIRED.LOAD_LATENCY", IAP_EVENT_CDH_01H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.LOADS", IAP_EVENT_D0H_01H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.STORES", IAP_EVENT_D0H_02H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.STLB_MISS", IAP_EVENT_D0H_10H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.LOCK", IAP_EVENT_D0H_20H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.SPLIT", IAP_EVENT_D0H_40H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.SPLIT_LOADS", IAP_EVENT_D0H_41H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.ALL", IAP_EVENT_D0H_80H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_LOADS", IAP_EVENT_D0H_11H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_STORES", IAP_EVENT_D0H_12H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_LOADS", IAP_EVENT_D0H_41H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_LOADS", IAP_EVENT_D0H_81H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_STORES", IAP_EVENT_D0H_82H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L1_HIT", IAP_EVENT_D1H_01H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2_HIT", IAP_EVENT_D1H_02H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.LLC_HIT", IAP_EVENT_D1H_04H) \ @@ -3003,14 +3001,12 @@ __PMC_EV_ALIAS("FP_ASSIST.SIMD_INPUT", I __PMC_EV_ALIAS("FP_ASSIST.ANY", IAP_EVENT_CAH_1EH) \ __PMC_EV_ALIAS("ROB_MISC_EVENTS.LBR_INSERTS", IAP_EVENT_CCH_20H) \ __PMC_EV_ALIAS("MEM_TRANS_RETIRED.LOAD_LATENCY", IAP_EVENT_CDH_01H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.LOADS", IAP_EVENT_D0H_01H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.STORES", IAP_EVENT_D0H_02H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.STLB_MISS", IAP_EVENT_D0H_10H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.LOCK", IAP_EVENT_D0H_20H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.SPLIT", IAP_EVENT_D0H_40H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.SPLIT_LOADS", IAP_EVENT_D0H_41H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.ALL", IAP_EVENT_D0H_80H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_LOADS", IAP_EVENT_D0H_11H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_STORES", IAP_EVENT_D0H_12H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_LOADS", IAP_EVENT_D0H_41H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_LOADS", IAP_EVENT_D0H_81H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_STORES", IAP_EVENT_D0H_82H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L1_HIT", IAP_EVENT_D1H_01H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2_HIT", IAP_EVENT_D1H_02H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.LLC_HIT", IAP_EVENT_D1H_04H) \ @@ -3229,15 +3225,12 @@ __PMC_EV_ALIAS("FP_ASSIST.ANY", IAP_EVEN __PMC_EV_ALIAS("ROB_MISC_EVENTS.LBR_INSERTS", IAP_EVENT_CCH_20H) \ __PMC_EV_ALIAS("MEM_TRANS_RETIRED.LOAD_LATENCY", IAP_EVENT_CDH_01H) \ __PMC_EV_ALIAS("MEM_TRANS_RETIRED.PRECISE_STORE", IAP_EVENT_CDH_02H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.LOADS", IAP_EVENT_D0H_01H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.STORES", IAP_EVENT_D0H_02H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.STLB_MISS", IAP_EVENT_D0H_10H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.LOCK", IAP_EVENT_D0H_20H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.SPLIT", IAP_EVENT_D0H_40H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.ALL", IAP_EVENT_D0H_80H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.ALL_LOADS", IAP_EVENT_D0H_81H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.ALL_STORES", IAP_EVENT_D0H_82H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_LOADS", IAP_EVENT_D0H_11H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_STORES", IAP_EVENT_D0H_12H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_LOADS", IAP_EVENT_D0H_41H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_LOADS", IAP_EVENT_D0H_81H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_STORES", IAP_EVENT_D0H_82H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L1_HIT", IAP_EVENT_D1H_01H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2_HIT", IAP_EVENT_D1H_02H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.LLC_HIT", IAP_EVENT_D1H_04H) \ @@ -3459,15 +3452,12 @@ __PMC_EV_ALIAS("FP_ASSIST.ANY", IAP_EVEN __PMC_EV_ALIAS("ROB_MISC_EVENTS.LBR_INSERTS", IAP_EVENT_CCH_20H) \ __PMC_EV_ALIAS("MEM_TRANS_RETIRED.LOAD_LATENCY", IAP_EVENT_CDH_01H) \ __PMC_EV_ALIAS("MEM_TRANS_RETIRED.PRECISE_STORE", IAP_EVENT_CDH_02H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.LOADS", IAP_EVENT_D0H_01H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.STORES", IAP_EVENT_D0H_02H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.STLB_MISS", IAP_EVENT_D0H_10H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.LOCK", IAP_EVENT_D0H_20H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.SPLIT", IAP_EVENT_D0H_40H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.ALL", IAP_EVENT_D0H_80H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.ALL_LOADS", IAP_EVENT_D0H_81H) \ -__PMC_EV_ALIAS("MEM_UOP_RETIRED.ALL_STORES", IAP_EVENT_D0H_82H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_LOADS", IAP_EVENT_D0H_11H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_STORES", IAP_EVENT_D0H_12H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_LOADS", IAP_EVENT_D0H_41H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_LOADS", IAP_EVENT_D0H_81H) \ +__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_STORES", IAP_EVENT_D0H_82H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L1_HIT", IAP_EVENT_D1H_01H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2_HIT", IAP_EVENT_D1H_02H) \ __PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.LLC_HIT", IAP_EVENT_D1H_04H) \ From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 01:24:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3FD5DEA; Tue, 10 Mar 2015 01:24:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 9F297130; Tue, 10 Mar 2015 01:24:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A1OH0U076690; Tue, 10 Mar 2015 01:24:17 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A1OH3x076689; Tue, 10 Mar 2015 01:24:17 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503100124.t2A1OH3x076689@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 10 Mar 2015 01:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279836 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 01:24:17 -0000 Author: rstone Date: Tue Mar 10 01:24:16 2015 New Revision: 279836 URL: https://svnweb.freebsd.org/changeset/base/279836 Log: Add missing counter definitions Differential Revision: https://reviews.freebsd.org/D1591 MFC after: 1 month Sponsored by: Sandvine Inc Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 10 01:24:08 2015 (r279835) +++ head/sys/dev/hwpmc/hwpmc_core.c Tue Mar 10 01:24:16 2015 (r279836) @@ -1126,6 +1126,10 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(79H_18H, 0x79, 0x18, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), + IAPDESCR(79H_24H, 0x79, 0x24, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), + IAPDESCR(79H_3CH, 0x79, 0x3C, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | + IAP_F_HWX), IAPDESCR(7AH, 0x7A, IAP_M_AGENT, IAP_F_CA | IAP_F_CC2), @@ -1272,7 +1276,8 @@ static struct iap_event_descr iap_events IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(A1H_08H, 0xA1, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(A1H_0CH, 0xA1, 0x0C, IAP_F_IB | IAP_F_IBX), + IAPDESCR(A1H_0CH, 0xA1, 0x0C, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAP_F_SBX | IAP_F_IBX), IAPDESCR(A1H_10H, 0xA1, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(A1H_20H, 0xA1, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/ From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 02:33:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2EBEC6A; Tue, 10 Mar 2015 02:33:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 CE44BBBF; Tue, 10 Mar 2015 02:33:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A2Xsuc009970; Tue, 10 Mar 2015 02:33:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A2XqE4009962; Tue, 10 Mar 2015 02:33:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503100233.t2A2XqE4009962@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 10 Mar 2015 02:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279837 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 02:33:55 -0000 Author: ian Date: Tue Mar 10 02:33:51 2015 New Revision: 279837 URL: https://svnweb.freebsd.org/changeset/base/279837 Log: Remove MODULES_OVERRIDE="" and WITHOUT_MODULES="ahc" from armv6 configs. These are left over from long ago when there was no way to load modules on early armv6 platforms, and when there was a build problem with ahc that has long since been fixed, and they just keep getting copy-pasted into new configs. Modified: head/sys/arm/conf/ARMADAXP head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/EXYNOS5.common head/sys/arm/conf/PANDABOARD head/sys/arm/conf/TS7800 head/sys/arm/conf/VYBRID head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Tue Mar 10 01:24:16 2015 (r279836) +++ head/sys/arm/conf/ARMADAXP Tue Mar 10 02:33:51 2015 (r279837) @@ -22,7 +22,6 @@ ident MV-88F78XX0 include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP -makeoptions MODULES_OVERRIDE="" makeoptions WERROR="-Werror" Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Tue Mar 10 01:24:16 2015 (r279836) +++ head/sys/arm/conf/CUBIEBOARD Tue Mar 10 02:33:51 2015 (r279837) @@ -23,9 +23,6 @@ ident CUBIEBOARD include "../allwinner/std.a10" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - options HZ=100 options SCHED_4BSD # 4BSD scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Tue Mar 10 01:24:16 2015 (r279836) +++ head/sys/arm/conf/CUBIEBOARD2 Tue Mar 10 02:33:51 2015 (r279837) @@ -23,9 +23,6 @@ ident CUBIEBOARD2 include "../allwinner/a20/std.a20" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - options HZ=100 options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Tue Mar 10 01:24:16 2015 (r279836) +++ head/sys/arm/conf/EXYNOS5.common Tue Mar 10 02:33:51 2015 (r279837) @@ -18,9 +18,6 @@ # # $FreeBSD$ -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - makeoptions WERROR="-Werror" options HZ=100 Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Tue Mar 10 01:24:16 2015 (r279836) +++ head/sys/arm/conf/PANDABOARD Tue Mar 10 02:33:51 2015 (r279837) @@ -29,9 +29,6 @@ hints "PANDABOARD.hints" include "../ti/omap4/pandaboard/std.pandaboard" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - options HZ=100 options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Tue Mar 10 01:24:16 2015 (r279836) +++ head/sys/arm/conf/TS7800 Tue Mar 10 02:33:51 2015 (r279837) @@ -8,7 +8,6 @@ ident TS7800 include "../mv/orion/std.ts7800" options SOC_MV_ORION -makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Tue Mar 10 01:24:16 2015 (r279836) +++ head/sys/arm/conf/VYBRID Tue Mar 10 02:33:51 2015 (r279837) @@ -21,9 +21,6 @@ ident VYBRID include "../freescale/vybrid/std.vybrid" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - makeoptions WERROR="-Werror" options HZ=100 Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Tue Mar 10 01:24:16 2015 (r279836) +++ head/sys/arm/conf/ZEDBOARD Tue Mar 10 02:33:51 2015 (r279837) @@ -23,9 +23,6 @@ ident ZEDBOARD include "../xilinx/zedboard/std.zedboard" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 08:33:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAC1F812; Tue, 10 Mar 2015 08:33:49 +0000 (UTC) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79DE32BB; Tue, 10 Mar 2015 08:33:49 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1YVFba-0001u3-9t; Tue, 10 Mar 2015 09:33:39 +0100 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Ian Lepore" Subject: Re: svn commit: r279837 - head/sys/arm/conf References: <201503100233.t2A2XqE4009962@svn.freebsd.org> Date: Tue, 10 Mar 2015 09:33:33 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201503100233.t2A2XqE4009962@svn.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: - X-Spam-Score: -1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED, BAYES_40 autolearn=disabled version=3.3.1 X-Scan-Signature: 025acf9a139f050bc01ccdeba87e03e0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 08:33:49 -0000 Hi, Does this make sense on arm4/arm5 like SHEEVAPLUG also? Ronald. On Tue, 10 Mar 2015 03:33:52 +0100, Ian Lepore wrote: > Author: ian > Date: Tue Mar 10 02:33:51 2015 > New Revision: 279837 > URL: https://svnweb.freebsd.org/changeset/base/279837 > > Log: > Remove MODULES_OVERRIDE="" and WITHOUT_MODULES="ahc" from armv6 > configs. > These are left over from long ago when there was no way to load modules > on early armv6 platforms, and when there was a build problem with ahc > that has long since been fixed, and they just keep getting copy-pasted > into new configs. > > Modified: > head/sys/arm/conf/ARMADAXP > head/sys/arm/conf/CUBIEBOARD > head/sys/arm/conf/CUBIEBOARD2 > head/sys/arm/conf/EXYNOS5.common > head/sys/arm/conf/PANDABOARD > head/sys/arm/conf/TS7800 > head/sys/arm/conf/VYBRID > head/sys/arm/conf/ZEDBOARD > > Modified: head/sys/arm/conf/ARMADAXP > ============================================================================== > --- head/sys/arm/conf/ARMADAXP Tue Mar 10 01:24:16 2015 (r279836) > +++ head/sys/arm/conf/ARMADAXP Tue Mar 10 02:33:51 2015 (r279837) > @@ -22,7 +22,6 @@ ident MV-88F78XX0 > include "../mv/armadaxp/std.mv78x60" > options SOC_MV_ARMADAXP > -makeoptions MODULES_OVERRIDE="" > makeoptions WERROR="-Werror" > > Modified: head/sys/arm/conf/CUBIEBOARD > ============================================================================== > --- head/sys/arm/conf/CUBIEBOARD Tue Mar 10 01:24:16 2015 (r279836) > +++ head/sys/arm/conf/CUBIEBOARD Tue Mar 10 02:33:51 2015 (r279837) > @@ -23,9 +23,6 @@ ident CUBIEBOARD > include "../allwinner/std.a10" > -makeoptions MODULES_OVERRIDE="" > -makeoptions WITHOUT_MODULES="ahc" > - > options HZ=100 > options SCHED_4BSD # 4BSD scheduler > options PREEMPTION # Enable kernel thread preemption > > Modified: head/sys/arm/conf/CUBIEBOARD2 > ============================================================================== > --- head/sys/arm/conf/CUBIEBOARD2 Tue Mar 10 01:24:16 2015 (r279836) > +++ head/sys/arm/conf/CUBIEBOARD2 Tue Mar 10 02:33:51 2015 (r279837) > @@ -23,9 +23,6 @@ ident CUBIEBOARD2 > include "../allwinner/a20/std.a20" > -makeoptions MODULES_OVERRIDE="" > -makeoptions WITHOUT_MODULES="ahc" > - > options HZ=100 > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > > Modified: head/sys/arm/conf/EXYNOS5.common > ============================================================================== > --- head/sys/arm/conf/EXYNOS5.common Tue Mar 10 01:24:16 2015 (r279836) > +++ head/sys/arm/conf/EXYNOS5.common Tue Mar 10 02:33:51 2015 (r279837) > @@ -18,9 +18,6 @@ > # > # $FreeBSD$ > -makeoptions MODULES_OVERRIDE="" > -makeoptions WITHOUT_MODULES="ahc" > - > makeoptions WERROR="-Werror" > options HZ=100 > > Modified: head/sys/arm/conf/PANDABOARD > ============================================================================== > --- head/sys/arm/conf/PANDABOARD Tue Mar 10 01:24:16 2015 (r279836) > +++ head/sys/arm/conf/PANDABOARD Tue Mar 10 02:33:51 2015 (r279837) > @@ -29,9 +29,6 @@ hints "PANDABOARD.hints" > include "../ti/omap4/pandaboard/std.pandaboard" > -makeoptions MODULES_OVERRIDE="" > -makeoptions WITHOUT_MODULES="ahc" > - > options HZ=100 > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > > Modified: head/sys/arm/conf/TS7800 > ============================================================================== > --- head/sys/arm/conf/TS7800 Tue Mar 10 01:24:16 2015 (r279836) > +++ head/sys/arm/conf/TS7800 Tue Mar 10 02:33:51 2015 (r279837) > @@ -8,7 +8,6 @@ ident TS7800 > include "../mv/orion/std.ts7800" > options SOC_MV_ORION > -makeoptions MODULES_OVERRIDE="" > #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > makeoptions WERROR="-Werror" > > Modified: head/sys/arm/conf/VYBRID > ============================================================================== > --- head/sys/arm/conf/VYBRID Tue Mar 10 01:24:16 2015 (r279836) > +++ head/sys/arm/conf/VYBRID Tue Mar 10 02:33:51 2015 (r279837) > @@ -21,9 +21,6 @@ > ident VYBRID > include "../freescale/vybrid/std.vybrid" > -makeoptions MODULES_OVERRIDE="" > -makeoptions WITHOUT_MODULES="ahc" > - > makeoptions WERROR="-Werror" > options HZ=100 > > Modified: head/sys/arm/conf/ZEDBOARD > ============================================================================== > --- head/sys/arm/conf/ZEDBOARD Tue Mar 10 01:24:16 2015 (r279836) > +++ head/sys/arm/conf/ZEDBOARD Tue Mar 10 02:33:51 2015 (r279837) > @@ -23,9 +23,6 @@ ident ZEDBOARD > include "../xilinx/zedboard/std.zedboard" > -makeoptions MODULES_OVERRIDE="" > -makeoptions WITHOUT_MODULES="ahc" > - > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > options INET # InterNETworking > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 09:16:32 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE57FE7C; Tue, 10 Mar 2015 09:16:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 BA42C950; Tue, 10 Mar 2015 09:16:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A9GWj7002295; Tue, 10 Mar 2015 09:16:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A9GW6C002294; Tue, 10 Mar 2015 09:16:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503100916.t2A9GW6C002294@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 10 Mar 2015 09:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279841 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 09:16:32 -0000 Author: tuexen Date: Tue Mar 10 09:16:31 2015 New Revision: 279841 URL: https://svnweb.freebsd.org/changeset/base/279841 Log: Fix a typo. MFC after: 1 week Modified: head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Tue Mar 10 08:15:33 2015 (r279840) +++ head/sys/netinet/sctp_timer.c Tue Mar 10 09:16:31 2015 (r279841) @@ -152,7 +152,7 @@ sctp_threshold_management(struct sctp_in struct mbuf *op_err; op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, - "Association error couter exceeded"); + "Association error counter exceeded"); inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_1; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (1); From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 09:41:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 787A7261; Tue, 10 Mar 2015 09:41:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 595E8BB0; Tue, 10 Mar 2015 09:41:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A9foF0015698; Tue, 10 Mar 2015 09:41:50 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A9fnqc015693; Tue, 10 Mar 2015 09:41:49 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201503100941.t2A9fnqc015693@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 10 Mar 2015 09:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279842 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 09:41:50 -0000 Author: scottl Date: Tue Mar 10 09:41:48 2015 New Revision: 279842 URL: https://svnweb.freebsd.org/changeset/base/279842 Log: Implement basic cpuset reporting in procstat via the -S flag. Obtained from: Netflix, Inc. MFC after: 3 days Added: head/usr.bin/procstat/procstat_cs.c (contents, props changed) Modified: head/usr.bin/procstat/Makefile head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h Modified: head/usr.bin/procstat/Makefile ============================================================================== --- head/usr.bin/procstat/Makefile Tue Mar 10 09:16:31 2015 (r279841) +++ head/usr.bin/procstat/Makefile Tue Mar 10 09:41:48 2015 (r279842) @@ -8,6 +8,7 @@ SRCS= procstat.c \ procstat_basic.c \ procstat_bin.c \ procstat_cred.c \ + procstat_cs.c \ procstat_files.c \ procstat_kstack.c \ procstat_rlimit.c \ Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Tue Mar 10 09:16:31 2015 (r279841) +++ head/usr.bin/procstat/procstat.1 Tue Mar 10 09:41:48 2015 (r279842) @@ -35,7 +35,7 @@ .Nm .Op Fl CHhn .Op Fl w Ar interval -.Op Fl b | c | e | f | i | j | k | l | r | s | t | v | x +.Op Fl b | c | e | f | i | j | k | l | r | s | S | t | v | x .Op Fl a | Ar pid | Ar core ... .Sh DESCRIPTION The @@ -75,6 +75,8 @@ Display resource limits for the process. Display resource usage information for the process. .It Fl s Display security credential information for the process. +.It Fl S +Display the cpuset information for the thread. .It Fl t Display thread information for the process. .It Fl v @@ -108,9 +110,16 @@ flag may be used to request per-thread s statistics for some options. For those options, the second field in the table will list the thread ID to which the row of information corresponds. +The +.Fl H +flag is implied for the +.Fl S +mode. .Pp -Some information, such as VM and file descriptor information, is available +Information for VM, file descriptor, and cpuset options is available only to the owner of a process or the superuser. +A cpuset value displayed as -1 means that the information is either invalid +or not available. .Ss Binary Information Display the process ID, command, and path to the process binary: .Pp Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Tue Mar 10 09:16:31 2015 (r279841) +++ head/usr.bin/procstat/procstat.c Tue Mar 10 09:41:48 2015 (r279842) @@ -40,7 +40,7 @@ #include "procstat.h" static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, rflag; -static int sflag, tflag, vflag, xflag; +static int sflag, tflag, vflag, xflag, Sflag;; int hflag, nflag, Cflag, Hflag; static void @@ -50,7 +50,7 @@ usage(void) fprintf(stderr, "usage: procstat [-CHhn] [-M core] [-N system] " "[-w interval] \n"); fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " - "-l | -r | -s | -t | -v | -x]\n"); + "-l | -r | -s | -S | -t | -v | -x]\n"); fprintf(stderr, " [-a | pid | core ...]\n"); exit(EX_USAGE); } @@ -85,6 +85,8 @@ procstat(struct procstat *prstat, struct procstat_vm(prstat, kipp); else if (xflag) procstat_auxv(prstat, kipp); + else if (Sflag) + procstat_cs(prstat, kipp); else procstat_basic(kipp); } @@ -128,7 +130,7 @@ main(int argc, char *argv[]) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "CHN:M:abcefijklhrstvw:x")) != -1) { + while ((ch = getopt(argc, argv, "CHN:M:abcefijklhrsStvw:x")) != -1) { switch (ch) { case 'C': Cflag++; @@ -144,6 +146,9 @@ main(int argc, char *argv[]) case 'N': nlistf = optarg; break; + case 'S': + Sflag++; + break; case 'a': aflag++; break; @@ -228,7 +233,7 @@ main(int argc, char *argv[]) /* We require that either 0 or 1 mode flags be set. */ tmp = bflag + cflag + eflag + fflag + iflag + jflag + (kflag ? 1 : 0) + - lflag + rflag + sflag + tflag + vflag + xflag; + lflag + rflag + sflag + tflag + vflag + xflag + Sflag; if (!(tmp == 0 || tmp == 1)) usage(); Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Tue Mar 10 09:16:31 2015 (r279841) +++ head/usr.bin/procstat/procstat.h Tue Mar 10 09:41:48 2015 (r279842) @@ -39,6 +39,7 @@ void procstat_auxv(struct procstat *prst void procstat_basic(struct kinfo_proc *kipp); void procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_cs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_env(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp, Added: head/usr.bin/procstat/procstat_cs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/procstat/procstat_cs.c Tue Mar 10 09:41:48 2015 (r279842) @@ -0,0 +1,108 @@ +/*- + * Copyright (c) 2007 Robert N. M. Watson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "procstat.h" + +void +procstat_cs(struct procstat *procstat, struct kinfo_proc *kipp) +{ + cpusetid_t cs; + cpuset_t mask; + struct kinfo_proc *kip; + unsigned int count, i; + int once, twice, lastcpu, cpu; + + if (!hflag) + printf("%5s %6s %-16s %-16s %2s %4s %-7s\n", "PID", + "TID", "COMM", "TDNAME", "CPU", "CSID", "CPU MASK"); + + kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, + kipp->ki_pid, &count); + if (kip == NULL) + return; + kinfo_proc_sort(kip, count); + for (i = 0; i < count; i++) { + kipp = &kip[i]; + printf("%5d ", kipp->ki_pid); + printf("%6d ", kipp->ki_tid); + printf("%-16s ", strlen(kipp->ki_comm) ? + kipp->ki_comm : "-"); + printf("%-16s ", (strlen(kipp->ki_tdname) && + (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ? + kipp->ki_tdname : "-"); + if (kipp->ki_oncpu != 255) + printf("%3d ", kipp->ki_oncpu); + else if (kipp->ki_lastcpu != 255) + printf("%3d ", kipp->ki_lastcpu); + else + printf("%3s ", "-"); + if (cpuset_getid(CPU_LEVEL_CPUSET, CPU_WHICH_TID, + kipp->ki_tid, &cs) != 0) { + cs = CPUSET_INVALID; + } + printf("%4d ", cs); + if ((cs != CPUSET_INVALID) && + (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, + kipp->ki_tid, sizeof(mask), &mask) == 0)) { + lastcpu = -1; + once = 0; + twice = 0; + for (cpu = 0; cpu < CPU_SETSIZE; cpu++) { + if (CPU_ISSET(cpu, &mask)) { + if (once == 0) { + printf("%d", cpu); + once = 1; + } else if (cpu == lastcpu + 1) { + twice = 1; + } else if (twice == 1) { + printf("-%d,%d", lastcpu, cpu); + twice = 0; + } else + printf(",%d", cpu); + lastcpu = cpu; + } + } + if (once && twice) + printf("-%d", lastcpu); + } + printf("\n"); + } + procstat_freeprocs(procstat, kip); +} From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 09:53:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66056824; Tue, 10 Mar 2015 09:53:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 511ACD8D; Tue, 10 Mar 2015 09:53:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2A9rGTE020674; Tue, 10 Mar 2015 09:53:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2A9rGNl020673; Tue, 10 Mar 2015 09:53:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503100953.t2A9rGNl020673@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 Mar 2015 09:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279843 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 09:53:16 -0000 Author: trasz Date: Tue Mar 10 09:53:15 2015 New Revision: 279843 URL: https://svnweb.freebsd.org/changeset/base/279843 Log: Refactor. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Tue Mar 10 09:41:48 2015 (r279842) +++ head/usr.sbin/autofs/common.c Tue Mar 10 09:53:15 2015 (r279843) @@ -449,6 +449,18 @@ node_expand_defined(struct node *n) return (cumulated_error); } +static bool +node_is_direct_key(const struct node *n) +{ + + if (n->n_parent != NULL && n->n_parent->n_parent == NULL && + strcmp(n->n_key, "/-") == 0) { + return (true); + } + + return (false); +} + bool node_is_direct_map(const struct node *n) { @@ -460,11 +472,7 @@ node_is_direct_map(const struct node *n) n = n->n_parent; } - assert(n->n_key != NULL); - if (strcmp(n->n_key, "/-") != 0) - return (false); - - return (true); + return (node_is_direct_key(n)); } bool @@ -538,11 +546,8 @@ node_path_x(const struct node *n, char * * Return "/-" for direct maps only if we were asked for path * to the "/-" node itself, not to any of its subnodes. */ - if (n->n_parent->n_parent == NULL && - strcmp(n->n_key, "/-") == 0 && - x[0] != '\0') { + if (node_is_direct_key(n) && x[0] != '\0') return (x); - } assert(n->n_key[0] != '\0'); path = concat(n->n_key, '/', x); From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 10:01:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5725A6A; Tue, 10 Mar 2015 10:01:51 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DB5CEA3; Tue, 10 Mar 2015 10:01:50 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2AA1fuR010419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Mar 2015 13:01:41 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2AA1fwh010418; Tue, 10 Mar 2015 13:01:41 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 10 Mar 2015 13:01:41 +0300 From: Gleb Smirnoff To: Konstantin Belousov Subject: Re: svn commit: r279764 - head/sys/vm Message-ID: <20150310100141.GS17947@FreeBSD.org> References: <201503080213.t282DlXj012465@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503080213.t282DlXj012465@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 10:01:52 -0000 On Sun, Mar 08, 2015 at 02:13:47AM +0000, Konstantin Belousov wrote: K> Author: kib K> Date: Sun Mar 8 02:13:46 2015 K> New Revision: 279764 K> URL: https://svnweb.freebsd.org/changeset/base/279764 K> K> Log: K> Fix function name in the panic message. Why not use "%s, __func__" always and never encounter this problem in future? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 10:18:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96559D6F; Tue, 10 Mar 2015 10:18:19 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 2051BFD3; Tue, 10 Mar 2015 10:18:18 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2AAID0p006429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Mar 2015 12:18:13 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2AAID0p006429 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2AAID3D006428; Tue, 10 Mar 2015 12:18:13 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Mar 2015 12:18:13 +0200 From: Konstantin Belousov To: Gleb Smirnoff Subject: Re: svn commit: r279764 - head/sys/vm Message-ID: <20150310101812.GS2379@kib.kiev.ua> References: <201503080213.t282DlXj012465@svn.freebsd.org> <20150310100141.GS17947@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150310100141.GS17947@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 10:18:19 -0000 On Tue, Mar 10, 2015 at 01:01:41PM +0300, Gleb Smirnoff wrote: > On Sun, Mar 08, 2015 at 02:13:47AM +0000, Konstantin Belousov wrote: > K> Author: kib > K> Date: Sun Mar 8 02:13:46 2015 > K> New Revision: 279764 > K> URL: https://svnweb.freebsd.org/changeset/base/279764 > K> > K> Log: > K> Fix function name in the panic message. > > Why not use "%s, __func__" always and never encounter this problem > in future? Because you cannot grep for the panic string when __func__ is used. From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 10:23:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 725A3F34; Tue, 10 Mar 2015 10:23:05 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EF433139; Tue, 10 Mar 2015 10:23:04 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2AAN2K3010541 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Mar 2015 13:23:02 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2AAN2gx010540; Tue, 10 Mar 2015 13:23:02 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 10 Mar 2015 13:23:02 +0300 From: Gleb Smirnoff To: Xin LI Subject: Re: svn commit: r279819 - head/sys/dev/hyperv/netvsc Message-ID: <20150310102302.GT17947@FreeBSD.org> References: <201503092011.t29KBH89014045@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503092011.t29KBH89014045@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 10:23:05 -0000 On Mon, Mar 09, 2015 at 08:11:17PM +0000, Xin LI wrote: X> Author: delphij X> Date: Mon Mar 9 20:11:16 2015 X> New Revision: 279819 X> URL: https://svnweb.freebsd.org/changeset/base/279819 X> X> Log: X> Fix CARP when in use in a HyperV environment: X> X> - Bump link state when stopping or starting the interface; X> - Don't handle SIOCGIFADDR specially, similar to r277103. X> X> This change is based on a previous revision from Andy Zhang X> (Microsoft) who did the diagnostic work and many thanks to X> them for their help in supporting the HyperV work. X> X> PR: kern/187203 X> MFC after: 2 weeks Thanks a lot, Xin and Andy! This was on my queue, but due to lack of HyperV at hand I constantly delayed fixing that. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 10:25:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4E6A119; Tue, 10 Mar 2015 10:25:28 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA7314E; Tue, 10 Mar 2015 10:25:27 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2AAPPtR010558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Mar 2015 13:25:25 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2AAPPZT010557; Tue, 10 Mar 2015 13:25:25 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 10 Mar 2015 13:25:25 +0300 From: Gleb Smirnoff To: Ian Lepore Subject: Re: svn commit: r279828 - head/sys/dev/cadence Message-ID: <20150310102525.GU17947@FreeBSD.org> References: <201503092239.t29MdxUo089384@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503092239.t29MdxUo089384@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 10:25:28 -0000 On Mon, Mar 09, 2015 at 10:39:59PM +0000, Ian Lepore wrote: I> Author: ian I> Date: Mon Mar 9 22:39:58 2015 I> New Revision: 279828 I> URL: https://svnweb.freebsd.org/changeset/base/279828 I> I> Log: I> Use the new ifnet API. Also, allocate bus_dma_maps as needed instead of I> pre-allocating them all at start-up. Also fix a bug in cgem_stop(); before, I> it wasn't properly unloading dma maps due to a cut-and-paste error. Ian, the new ifnet API isn't the last word in ifnet API. :) Since you are already into that, I'd appreciate if you look into projects/ifnet branch and convert cgem(4) to it. As examples, you can look at msk(4), bge(4), xl(4) and vtnet(4) in the branch. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 10:30:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03D26445; Tue, 10 Mar 2015 10:30:50 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A514240; Tue, 10 Mar 2015 10:30:48 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2AAUkIK010582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Mar 2015 13:30:46 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2AAUkRr010581; Tue, 10 Mar 2015 13:30:46 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 10 Mar 2015 13:30:46 +0300 From: Gleb Smirnoff To: Konstantin Belousov Subject: Re: svn commit: r279764 - head/sys/vm Message-ID: <20150310103046.GV17947@FreeBSD.org> References: <201503080213.t282DlXj012465@svn.freebsd.org> <20150310100141.GS17947@FreeBSD.org> <20150310101812.GS2379@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150310101812.GS2379@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 10:30:50 -0000 On Tue, Mar 10, 2015 at 12:18:13PM +0200, Konstantin Belousov wrote: K> On Tue, Mar 10, 2015 at 01:01:41PM +0300, Gleb Smirnoff wrote: K> > On Sun, Mar 08, 2015 at 02:13:47AM +0000, Konstantin Belousov wrote: K> > K> Author: kib K> > K> Date: Sun Mar 8 02:13:46 2015 K> > K> New Revision: 279764 K> > K> URL: https://svnweb.freebsd.org/changeset/base/279764 K> > K> K> > K> Log: K> > K> Fix function name in the panic message. K> > K> > Why not use "%s, __func__" always and never encounter this problem K> > in future? K> K> Because you cannot grep for the panic string when __func__ is used. Grepping for panic string doesn't work in general. A panic message can report pointers or numbers, which make text not unique. Actually, the messages that do report extra information are more useful. Also, if panic string resides in the source code under several levels of indentation, it is likely to be split into two lines. But you can always grep for the function name and locate the panic or KASSERT in the function manually, which isn't a big deal. And if %s, __func__ is used, you will never get to a wrong function. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 10:33:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A81E05C9; Tue, 10 Mar 2015 10:33:15 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F50B323; Tue, 10 Mar 2015 10:33:15 +0000 (UTC) Received: from c124.sec.cl.cam.ac.uk (c124.sec.cl.cam.ac.uk [128.232.18.124]) (authenticated bits=0) by theravensnest.org (8.15.1/8.14.9) with ESMTPSA id t2AAX591093127 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Mar 2015 10:33:06 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279764 - head/sys/vm From: David Chisnall In-Reply-To: <20150310101812.GS2379@kib.kiev.ua> Date: Tue, 10 Mar 2015 10:33:05 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201503080213.t282DlXj012465@svn.freebsd.org> <20150310100141.GS17947@FreeBSD.org> <20150310101812.GS2379@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 10:33:15 -0000 On 10 Mar 2015, at 10:18, Konstantin Belousov = wrote: >=20 > Because you cannot grep for the panic string when __func__ is used. The userspace assert uses __func__, __FILE__ and __LINE__, which means = that you never need to grep the source code to find out where the assert = came from: the assertion message tells you precisely where to go. David From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 10:47:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98150A28; Tue, 10 Mar 2015 10:47:06 +0000 (UTC) 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 5072A668; Tue, 10 Mar 2015 10:47:06 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YVHgf-0003JI-RS; Tue, 10 Mar 2015 13:46:57 +0300 Date: Tue, 10 Mar 2015 13:46:57 +0300 From: Slawa Olhovchenkov To: Konstantin Belousov Subject: Re: svn commit: r279699 - in head/sys: amd64/amd64 i386/i386 Message-ID: <20150310104657.GA66448@zxy.spb.ru> References: <201503062034.t26KYSP2063973@svn.freebsd.org> <20150309174252.GO2379@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150309174252.GO2379@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) 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 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 10:47:06 -0000 On Mon, Mar 09, 2015 at 07:42:52PM +0200, Konstantin Belousov wrote: > On Fri, Mar 06, 2015 at 08:34:28PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Fri Mar 6 20:34:28 2015 > > New Revision: 279699 > > URL: https://svnweb.freebsd.org/changeset/base/279699 > > > > Log: > > Only schedule interrupts on a single hyperthread of a modern Intel CPU core > > by default. Previously we used a single hyperthread on Pentium4-era > > cores but used both hyperthreads on more recent CPUs. > > > > MFC after: 2 weeks > > > > Modified: > > head/sys/amd64/amd64/mp_machdep.c > > head/sys/i386/i386/mp_machdep.c > > > > Modified: head/sys/amd64/amd64/mp_machdep.c > > ============================================================================== > > --- head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 16:43:54 2015 (r279698) > > +++ head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 20:34:28 2015 (r279699) > > @@ -828,8 +828,8 @@ set_interrupt_apic_ids(void) > > continue; > > > > /* Don't let hyperthreads service interrupts. */ > > - if (hyperthreading_cpus > 1 && > > - apic_id % hyperthreading_cpus != 0) > > + if (cpu_logical > 1 && > > + apic_id % cpu_logical != 0) > > continue; > > > > intr_add_cpu(i); > > > > Modified: head/sys/i386/i386/mp_machdep.c > > ============================================================================== > > --- head/sys/i386/i386/mp_machdep.c Fri Mar 6 16:43:54 2015 (r279698) > > +++ head/sys/i386/i386/mp_machdep.c Fri Mar 6 20:34:28 2015 (r279699) > > @@ -842,8 +842,8 @@ set_interrupt_apic_ids(void) > > continue; > > > > /* Don't let hyperthreads service interrupts. */ > > - if (hyperthreading_cpus > 1 && > > - apic_id % hyperthreading_cpus != 0) > > + if (cpu_logical > 1 && > > + apic_id % cpu_logical != 0) > > continue; > > > > intr_add_cpu(i); > > BTW, this sounds somewhat backward from the intention of the HTT/SMT. > The feature was aimed to reduce latency of memory or device registers > reads by allowing several contexts to stuck on the cache line fill > or waiting for the device response to read request. > > Since typical interrupt handler just EOIs the source or does nothing at > all to the source, what is the reasoning behind the change ? typical interrupt handler do TCP work? From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 11:29:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 375E23F2; Tue, 10 Mar 2015 11:29:44 +0000 (UTC) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps.rulingia.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B859EAEB; Tue, 10 Mar 2015 11:29:43 +0000 (UTC) Received: from server.rulingia.com (c220-239-242-83.belrs5.nsw.optusnet.com.au [220.239.242.83]) by vps.rulingia.com (8.14.9/8.14.9) with ESMTP id t2AB2BPx005179 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Mar 2015 22:02:17 +1100 (AEDT) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.9/8.14.9) with ESMTP id t2AB24mB023948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Mar 2015 22:02:05 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.9/8.14.9/Submit) id t2AB2278023938; Tue, 10 Mar 2015 22:02:02 +1100 (AEDT) (envelope-from peter) Date: Tue, 10 Mar 2015 22:02:02 +1100 From: Peter Jeremy To: Ian Lepore Subject: Re: svn commit: r279814 - head/sys/arm/conf Message-ID: <20150310110202.GA17394@server.rulingia.com> References: <201503091543.t29FhYVu081001@svn.freebsd.org> <1425916716.73796.28.camel@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: <1425916716.73796.28.camel@freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 11:29:44 -0000 --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2015-Mar-09 09:58:36 -0600, Ian Lepore wrote: >Can we not do this, and instead just build all modules? I'm not sure >why we eliminate or override modules on some armv6 socs and not on >others, but I think it's a concept that's past it's sell-by date now. >If there are a few specific modules that aren't good for arm, we should >be fixing that in the modules makefiles. For the most popular ARM SoCs, I'd suggest that about half of the modules don't make sense: There's no ISA or PCI bus available so there's no point in compiling modules that depend on either. --=20 Peter Jeremy --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJU/s8pXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFRUIyOTg2QzMwNjcxRTc0RTY1QzIyN0Ux NkE1OTdBMEU0QTIwQjM0AAoJEBall6Dkogs0Kz8P/1FRXTPgrszkje7ANxCQtF3r M1IPpOTTKXbcr6l7hmdipg/5TPV4CaByhU2EOJHS9XXb47pu/6JZ2jiUYf6pqa3S tyMJn8zA8Rpf530EvLgjKSFgjRDz9Po5SfIMEAOJOKiieYPI51KQP7PuNprJEjQ0 74OBrd3YCUzrDphldNIUORYyOOXfy01mifMVEroloLgwUarGI44dz9Cd9JClYeU0 Jr1UFD5953EbdVmyq92lfATykHgrbjYKPr6TGfnFWuOX2CV5PSL3+yzhxAknYk0B rHnLyknGmGbXWeunj9YHu95/ksx7SDRhq/iK06WQWUJy0VkpuSxSgvSuDhwce72O CpLJnwXo/YPShyHghf/Ap9qem2ylunyLtmAx/PGPrXSREU0X+YKAM9PVQtZWIdEQ lBfojTy66ZOCCWvfVMHHM9zq2395JZB/nKL8SHTWZdrWrvjt+S1GkhCZFrUTiXZo sYU25VR6MRx7ORopC8w84Ba+S9PFB6P/5Elq0zL3Jh87yJBTNFN3pljz7Tm9tDjX /oo7ppKcR4Dv1BPwukHy88GIcEChG7vsyI6lvdVFMb4mo6mYMqEpO5ahfcH9hj2q e1gHBtBXYd5SMj3gtP3BBsSUQi9sRXP3XFZeoEmvxhAUPgw4i2n7KwpkQNBWeNro 3rFhbyGo7pqg6XXDqrip =mVHe -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o-- From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 11:59:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D237D70; Tue, 10 Mar 2015 11:59:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 4E6E2E47; Tue, 10 Mar 2015 11:59:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ABxYin077929; Tue, 10 Mar 2015 11:59:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ABxYDa077928; Tue, 10 Mar 2015 11:59:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503101159.t2ABxYDa077928@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 Mar 2015 11:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279845 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 11:59:34 -0000 Author: trasz Date: Tue Mar 10 11:59:33 2015 New Revision: 279845 URL: https://svnweb.freebsd.org/changeset/base/279845 Log: Fix handling of direct maps, broken in r275756. Previously, running automount(8) would unmount direct map trigger nodes every second time. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Tue Mar 10 11:38:42 2015 (r279844) +++ head/usr.sbin/autofs/common.c Tue Mar 10 11:59:33 2015 (r279845) @@ -661,23 +661,25 @@ node_find_x(struct node *node, const cha char *tmp; size_t tmplen; - //log_debugx("looking up %s in %s", path, node->n_key); + //log_debugx("looking up %s in %s", path, node_path(node)); - tmp = node_path(node); - tmplen = strlen(tmp); - if (strncmp(tmp, path, tmplen) != 0) { - free(tmp); - return (NULL); - } - if (path[tmplen] != '/' && path[tmplen] != '\0') { - /* - * If we have two map entries like 'foo' and 'foobar', make - * sure the search for 'foobar' won't match 'foo' instead. - */ + if (!node_is_direct_key(node)) { + tmp = node_path(node); + tmplen = strlen(tmp); + if (strncmp(tmp, path, tmplen) != 0) { + free(tmp); + return (NULL); + } + if (path[tmplen] != '/' && path[tmplen] != '\0') { + /* + * If we have two map entries like 'foo' and 'foobar', make + * sure the search for 'foobar' won't match 'foo' instead. + */ + free(tmp); + return (NULL); + } free(tmp); - return (NULL); } - free(tmp); TAILQ_FOREACH(child, &node->n_children, n_next) { found = node_find_x(child, path); @@ -685,6 +687,9 @@ node_find_x(struct node *node, const cha return (found); } + if (node->n_parent == NULL || node_is_direct_key(node)) + return (NULL); + return (node); } @@ -693,9 +698,12 @@ node_find(struct node *root, const char { struct node *node; + assert(root->n_parent == NULL); + node = node_find_x(root, path); - if (node == root) - return (NULL); + if (node != NULL) + assert(node != root); + return (node); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 12:25:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20ED44B3; Tue, 10 Mar 2015 12:25:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 0BE1B204; Tue, 10 Mar 2015 12:25:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ACP6Bw091505; Tue, 10 Mar 2015 12:25:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ACP6bn091503; Tue, 10 Mar 2015 12:25:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503101225.t2ACP6bn091503@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 Mar 2015 12:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279846 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 12:25:07 -0000 Author: trasz Date: Tue Mar 10 12:25:05 2015 New Revision: 279846 URL: https://svnweb.freebsd.org/changeset/base/279846 Log: Properly pass options for direct maps. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automount.c head/usr.sbin/autofs/automountd.c Modified: head/usr.sbin/autofs/automount.c ============================================================================== --- head/usr.sbin/autofs/automount.c Tue Mar 10 11:59:33 2015 (r279845) +++ head/usr.sbin/autofs/automount.c Tue Mar 10 12:25:05 2015 (r279846) @@ -141,8 +141,8 @@ mount_autofs(const char *from, const cha } static void -mount_if_not_already(const struct node *n, const char *map, - const struct statfs *mntbuf, int nitems) +mount_if_not_already(const struct node *n, const char *map, const char *options, + const char *prefix, const struct statfs *mntbuf, int nitems) { const struct statfs *sb; char *mountpoint; @@ -175,7 +175,7 @@ mount_if_not_already(const struct node * mountpoint); } - mount_autofs(from, mountpoint, n->n_options, n->n_key); + mount_autofs(from, mountpoint, options, prefix); free(from); free(mountpoint); } @@ -184,7 +184,7 @@ static void mount_unmount(struct node *root) { struct statfs *mntbuf; - struct node *n, *n2, *n3; + struct node *n, *n2; int i, nitems; nitems = getmntinfo(&mntbuf, MNT_WAIT); @@ -216,15 +216,14 @@ mount_unmount(struct node *root) TAILQ_FOREACH(n, &root->n_children, n_next) { if (!node_is_direct_map(n)) { - mount_if_not_already(n, n->n_map, mntbuf, nitems); + mount_if_not_already(n, n->n_map, n->n_options, + n->n_key, mntbuf, nitems); continue; } TAILQ_FOREACH(n2, &n->n_children, n_next) { - TAILQ_FOREACH(n3, &n2->n_children, n_next) { - mount_if_not_already(n3, n->n_map, - mntbuf, nitems); - } + mount_if_not_already(n2, n->n_map, n->n_options, + "/", mntbuf, nitems); } } } Modified: head/usr.sbin/autofs/automountd.c ============================================================================== --- head/usr.sbin/autofs/automountd.c Tue Mar 10 11:59:33 2015 (r279845) +++ head/usr.sbin/autofs/automountd.c Tue Mar 10 12:25:05 2015 (r279846) @@ -202,7 +202,7 @@ handle_request(const struct autofs_daemo parent = root; } else { parent = node_new_map(root, checked_strdup(adr->adr_prefix), - checked_strdup(adr->adr_options), checked_strdup(map), + NULL, checked_strdup(map), checked_strdup("[kernel request]"), lineno); } @@ -231,19 +231,19 @@ handle_request(const struct autofs_daemo "failing mount", map, adr->adr_path); } + options = node_options(node); + options = concat(adr->adr_options, ',', options); + + /* + * Prepend options passed via automountd(8) command line. + */ + if (cmdline_options != NULL) + options = concat(cmdline_options, ',', options); + if (node->n_location == NULL) { log_debugx("found node defined at %s:%d; not a mountpoint", node->n_config_file, node->n_config_line); - options = node_options(node); - - /* - * Prepend options passed via automountd(8) command line. - */ - if (cmdline_options != NULL) { - options = concat(cmdline_options, ',', options); - } - nobrowse = pick_option("nobrowse", &options); if (nobrowse != NULL && adr->adr_key[0] == '\0') { log_debugx("skipping map %s due to \"nobrowse\" " @@ -293,14 +293,6 @@ handle_request(const struct autofs_daemo "failing mount", adr->adr_path); } - options = node_options(node); - - /* - * Prepend options passed via automountd(8) command line. - */ - if (cmdline_options != NULL) - options = concat(cmdline_options, ',', options); - /* * Append "automounted". */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 13:06:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBCA9F0F; Tue, 10 Mar 2015 13:06:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 C72E38B8; Tue, 10 Mar 2015 13:06:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AD6sK0011207; Tue, 10 Mar 2015 13:06:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AD6swu011206; Tue, 10 Mar 2015 13:06:54 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201503101306.t2AD6swu011206@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 10 Mar 2015 13:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279847 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 13:06:55 -0000 Author: glebius Date: Tue Mar 10 13:06:54 2015 New Revision: 279847 URL: https://svnweb.freebsd.org/changeset/base/279847 Log: Fix function name in comment. Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Mar 10 12:25:05 2015 (r279846) +++ head/sys/vm/vnode_pager.c Tue Mar 10 13:06:54 2015 (r279847) @@ -727,7 +727,7 @@ vnode_pager_local_getpages0(struct vnode /* * The requested page has valid blocks. Invalid part can only * exist at the end of file, and the page is made fully valid - * by zeroing in vm_pager_getpages(). Free non-requested + * by zeroing in vm_pager_get_pages(). Free non-requested * pages, since no i/o is done to read its content. */ if (mreq->valid != 0) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 13:12:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF1E82C8 for ; Tue, 10 Mar 2015 13:12:18 +0000 (UTC) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.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 996F09A7 for ; Tue, 10 Mar 2015 13:12:18 +0000 (UTC) Received: by pdbft15 with SMTP id ft15so1643920pdb.6 for ; Tue, 10 Mar 2015 06:12:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=TS3TPQnteD2De9rnc/HfHoG5F+J08Eto1aBL24p3OWk=; b=LWHUJKkZIQP5Ym6wsca5rzlDy2NU3mYHGjDEdvnuvDw8/Ei7rdLu/e5Wlx6iPyCS9G dPiPw+91gjvkLUyLE9vx95lvO55GdCnVS2/h73ZNp5u4fNSwfxp+Yw7YXTFvpTWB+h4J gx2AFIQrOsWDZpHE189HrW3oIHw/FuXhROseuWZw0GpTuhoYPkIaLFNOZZvfe5svZch7 bCJ9s81AUF0b8YG7IGMvOksFON8K1unxcpN4r8jZ3DyVmG7H3aDRfjGOx84pxC+3YUxj jdo6/CHX+SgQ6MXkXgqh1CrGHlf6/FO4EV6Sg/QSop+/Vu5WPNWYocdKA4D0IPomRV27 4sxQ== X-Gm-Message-State: ALoCoQk/TCs7YaRbplyHTjij4rpxqcO+R4xhpCy2+pu5jZp+UcbJY4q8xHsgEf5PdbqWSS9cLzdM X-Received: by 10.70.65.105 with SMTP id w9mr7556558pds.129.1425993131967; Tue, 10 Mar 2015 06:12:11 -0700 (PDT) Received: from [10.64.27.98] ([69.53.236.236]) by mx.google.com with ESMTPSA id i10sm1008673pdk.53.2015.03.10.06.12.07 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Mar 2015 06:12:09 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r279814 - head/sys/arm/conf Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_FAA0B91E-6401-4D66-BA52-28B567D63DEE"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b5 From: Warner Losh In-Reply-To: <20150310110202.GA17394@server.rulingia.com> Date: Tue, 10 Mar 2015 07:12:04 -0600 Message-Id: References: <201503091543.t29FhYVu081001@svn.freebsd.org> <1425916716.73796.28.camel@freebsd.org> <20150310110202.GA17394@server.rulingia.com> To: Peter Jeremy X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh , Ian Lepore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 13:12:19 -0000 --Apple-Mail=_FAA0B91E-6401-4D66-BA52-28B567D63DEE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 10, 2015, at 5:02 AM, Peter Jeremy wrote: >=20 > On 2015-Mar-09 09:58:36 -0600, Ian Lepore wrote: >> Can we not do this, and instead just build all modules? I'm not sure >> why we eliminate or override modules on some armv6 socs and not on >> others, but I think it's a concept that's past it's sell-by date now. >> If there are a few specific modules that aren't good for arm, we = should >> be fixing that in the modules makefiles. >=20 > For the most popular ARM SoCs, I'd suggest that about half of the > modules don't make sense: There's no ISA or PCI bus available so > there's no point in compiling modules that depend on either. Yea, I agree with that. I have some WiP for auto-loading and pruning the build that will help a lot with eliminating modules=E2=80=A6 I=E2=80=99= d really rather avoid trying to list every single one because that=E2=80=99s going to = fail. Warner --Apple-Mail=_FAA0B91E-6401-4D66-BA52-28B567D63DEE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJU/u2lAAoJEGwc0Sh9sBEARs8P/0oriYParLH2QASOybIJyItr vF2CH4dAaDPeFPWjq5DjFE4D1yoQRVt2UrDTWjW3prz9j4cofDfTSHz2CjZqxQd0 MwFki0d+PuhlTiqYQ/6PTl3vmCNEgZ5UxxGueJOgTYBe0NJGhS4A9NjO9ddFpIkP d2XkmZeHDmXGhMKbtRRKKS5gP7t+jKx7CIFLp6UaqmxGpZNDbVCC1PzJL5KZ4UPP QGgWYTzW5oTXFhtqyQbjky72+XBUDqWpHPsrBskmyLS6Y51dBLm3HvVGlqA0T9Vp UAaQB66m75pv7Jdq+o/8XZaMezrjk2ufytTrT/IrIgyfiOqdrqfier1UblPd5fAZ fKNpMdiTss90PEDKWO2kdbh2gp/YkMEteyftPcSdxsrhqn87ckOi7Qfvd8okPBVt PcNrCJ1MWtfbjFItlTppBZ+gLscD1enu2dhBDK3b9+wNRZHjiWtIHKXBlI5xf9Fv urm+ZWo7Q/oxPTaUQNL7+vibGds+df49LV0KfsPu+Y2XWfDrtCzoCEl5iqlPrloj 6mpKkXcRIK30eG0y4IZGWpJm80HJe9o8cqMUhlg8E/BJfP0jRDJ9NVXccwBzGNPa GRvMz41rTRxvNRWwhwtpfTFLNxldOk2BFu3TzqVMjNEde5+4U38TAUYmyVGL3PjV C4qsBQiCfhfHEnzn49+U =gRmm -----END PGP SIGNATURE----- --Apple-Mail=_FAA0B91E-6401-4D66-BA52-28B567D63DEE-- From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 13:55:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40B95DCE; Tue, 10 Mar 2015 13:55:07 +0000 (UTC) Received: from bigwig.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 171AAE40; Tue, 10 Mar 2015 13:55:07 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 717CAB93A; Tue, 10 Mar 2015 09:55:05 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r279699 - in head/sys: amd64/amd64 i386/i386 Date: Tue, 10 Mar 2015 09:54:43 -0400 Message-ID: <158511036.uSYxIlCjo8@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150309174252.GO2379@kib.kiev.ua> References: <201503062034.t26KYSP2063973@svn.freebsd.org> <20150309174252.GO2379@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.2.7 (bigwig.baldwin.cx); Tue, 10 Mar 2015 09:55:05 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 13:55:07 -0000 On Monday, March 09, 2015 07:42:52 PM Konstantin Belousov wrote: > On Fri, Mar 06, 2015 at 08:34:28PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Fri Mar 6 20:34:28 2015 > > New Revision: 279699 > > URL: https://svnweb.freebsd.org/changeset/base/279699 > > > > Log: > > Only schedule interrupts on a single hyperthread of a modern Intel CPU > > core > > by default. Previously we used a single hyperthread on Pentium4-era > > cores but used both hyperthreads on more recent CPUs. > > > > MFC after: 2 weeks > > > > Modified: > > head/sys/amd64/amd64/mp_machdep.c > > head/sys/i386/i386/mp_machdep.c > > > > Modified: head/sys/amd64/amd64/mp_machdep.c > > ========================================================================== > > ==== --- head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 16:43:54 > > 2015 (r279698) +++ head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 20:34:28 > > 2015 (r279699) @@ -828,8 +828,8 @@ set_interrupt_apic_ids(void) > > > > continue; > > > > /* Don't let hyperthreads service interrupts. */ > > > > - if (hyperthreading_cpus > 1 && > > - apic_id % hyperthreading_cpus != 0) > > + if (cpu_logical > 1 && > > + apic_id % cpu_logical != 0) > > > > continue; > > > > intr_add_cpu(i); > > > > Modified: head/sys/i386/i386/mp_machdep.c > > ========================================================================== > > ==== --- head/sys/i386/i386/mp_machdep.c Fri Mar 6 16:43:54 > > 2015 (r279698) +++ head/sys/i386/i386/mp_machdep.c Fri Mar 6 20:34:28 > > 2015 (r279699) @@ -842,8 +842,8 @@ set_interrupt_apic_ids(void) > > > > continue; > > > > /* Don't let hyperthreads service interrupts. */ > > > > - if (hyperthreading_cpus > 1 && > > - apic_id % hyperthreading_cpus != 0) > > + if (cpu_logical > 1 && > > + apic_id % cpu_logical != 0) > > > > continue; > > > > intr_add_cpu(i); > > BTW, this sounds somewhat backward from the intention of the HTT/SMT. > The feature was aimed to reduce latency of memory or device registers > reads by allowing several contexts to stuck on the cache line fill > or waiting for the device response to read request. > > Since typical interrupt handler just EOIs the source or does nothing at > all to the source, what is the reasoning behind the change ? It also affects where ithreads are run. SCHED_ULE does a soft binding of ithreads to the CPU that scheduled them (i.e. the CPU that received the interrupt). It also matters for bus_get_cpus(9) as this will affect the set of CPUs that returns so that by default multi queue NICs will only schedule one interrupt + bound ithread (and in some cases bound taskqueue thread) per- core rather than one per-thread. I have thought about having a separate tunable to control whether or not this is in effect if there are any workloads where having interrupts on all threads in a core helps (for all the cases I am aware of, people end up disabling HTT in the BIOS to get this effect instead). Ultimately I'd like to make it possible to manipulate the set of CPUs used for interrupts directly, but that's a larger change. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 14:22:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE3FE6FE; Tue, 10 Mar 2015 14:22:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 8F07D3B6; Tue, 10 Mar 2015 14:22:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AEMTLe049830; Tue, 10 Mar 2015 14:22:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AEMTHf049829; Tue, 10 Mar 2015 14:22:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201503101422.t2AEMTHf049829@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Mar 2015 14:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279849 - head/usr.bin/m4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 14:22:29 -0000 Author: bapt Date: Tue Mar 10 14:22:28 2015 New Revision: 279849 URL: https://svnweb.freebsd.org/changeset/base/279849 Log: Add OpenBSD copyright for reallocarray Move the function at the bottom of the misc.c file to clearly state the copyright only stand for this function PR: 198484 Submitted by: logan@elandsys.com Modified: head/usr.bin/m4/misc.c Modified: head/usr.bin/m4/misc.c ============================================================================== --- head/usr.bin/m4/misc.c Tue Mar 10 14:18:26 2015 (r279848) +++ head/usr.bin/m4/misc.c Tue Mar 10 14:22:28 2015 (r279849) @@ -64,6 +64,7 @@ unsigned char *bbase[MAXINP]; /* the ba unsigned char *bp; /* first available character */ unsigned char *endpbb; /* end of push-back buffer */ +static void *reallocarray(void *, size_t, size_t); /* * find the index of second str in the first str. @@ -352,23 +353,6 @@ xrealloc(void *old, size_t n, const char return p; } -/* - * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX - * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW - */ -#define MUL_NO_OVERFLOW (1UL << (sizeof(size_t) * 4)) - -static void * -reallocarray(void *optr, size_t nmemb, size_t size) -{ - if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && - nmemb > 0 && SIZE_MAX / nmemb < size) { - errno = ENOMEM; - return NULL; - } - return realloc(optr, size * nmemb); -} - void * xreallocarray(void *old, size_t s1, size_t s2, const char *fmt, ...) { @@ -483,3 +467,37 @@ dump_buffer(FILE *f, size_t m) for (s = bp; s-buf > (long)m;) fputc(*--s, f); } + +/* $OpenBSD: reallocarray.c,v 1.2 2014/12/08 03:45:00 bcook Exp $ */ +/* + * Copyright (c) 2008 Otto Moerbeek + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX + * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW + */ +#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) + +void * +reallocarray(void *optr, size_t nmemb, size_t size) +{ + if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && + nmemb > 0 && SIZE_MAX / nmemb < size) { + errno = ENOMEM; + return NULL; + } + return realloc(optr, size * nmemb); +} From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 14:36:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A833A48; Tue, 10 Mar 2015 14:36:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 15798755; Tue, 10 Mar 2015 14:36:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AEarug055078; Tue, 10 Mar 2015 14:36:53 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AEaqsq055068; Tue, 10 Mar 2015 14:36:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503101436.t2AEaqsq055068@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 10 Mar 2015 14:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279850 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 14:36:54 -0000 Author: ian Date: Tue Mar 10 14:36:51 2015 New Revision: 279850 URL: https://svnweb.freebsd.org/changeset/base/279850 Log: Remove MODULES_OVERRIDE="" for Marvel-based armv5 systems. Also add some #NO_UNIVERSE to configs that essentially duplicate DB-88F6XXX. Modified: head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/SHEEVAPLUG Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Tue Mar 10 14:22:28 2015 (r279849) +++ head/sys/arm/conf/DB-78XXX Tue Mar 10 14:36:51 2015 (r279850) @@ -8,7 +8,6 @@ ident DB-88F78XX include "../mv/discovery/std.db78xxx" options SOC_MV_DISCOVERY -makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Tue Mar 10 14:22:28 2015 (r279849) +++ head/sys/arm/conf/DB-88F5XXX Tue Mar 10 14:36:51 2015 (r279850) @@ -8,7 +8,6 @@ ident DB-88F5XXX include "../mv/orion/std.db88f5xxx" options SOC_MV_ORION -makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Tue Mar 10 14:22:28 2015 (r279849) +++ head/sys/arm/conf/DB-88F6XXX Tue Mar 10 14:36:51 2015 (r279850) @@ -8,7 +8,6 @@ ident DB-88F6XXX include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD -makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Tue Mar 10 14:22:28 2015 (r279849) +++ head/sys/arm/conf/DOCKSTAR Tue Mar 10 14:36:51 2015 (r279850) @@ -17,6 +17,7 @@ # # $FreeBSD$ # +#NO_UNIVERSE ident DOCKSTAR @@ -24,8 +25,6 @@ include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dockstar.dts -makeoptions MODULES_OVERRIDE="" - options SOC_MV_KIRKWOOD options SCHED_4BSD # 4BSD scheduler Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Tue Mar 10 14:22:28 2015 (r279849) +++ head/sys/arm/conf/DREAMPLUG-1001 Tue Mar 10 14:36:51 2015 (r279850) @@ -20,6 +20,7 @@ # # $FreeBSD$ # +#NO_UNIVERSE ident DREAMPLUG-1001 @@ -27,8 +28,6 @@ include "../mv/kirkwood/std.db88f6xxx" makeoptions FDT_DTS_FILE=dreamplug-1001.dts -makeoptions MODULES_OVERRIDE="" - options SOC_MV_KIRKWOOD options SCHED_4BSD # 4BSD scheduler Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Tue Mar 10 14:22:28 2015 (r279849) +++ head/sys/arm/conf/SHEEVAPLUG Tue Mar 10 14:36:51 2015 (r279850) @@ -3,12 +3,12 @@ # # $FreeBSD$ # +#NO_UNIVERSE ident SHEEVAPLUG include "../mv/kirkwood/std.db88f6xxx" options SOC_MV_KIRKWOOD -makeoptions MODULES_OVERRIDE="" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 14:43:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02360D88; Tue, 10 Mar 2015 14:43:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 E13F483C; Tue, 10 Mar 2015 14:43:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AEh75k059304; Tue, 10 Mar 2015 14:43:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AEh77w059303; Tue, 10 Mar 2015 14:43:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503101443.t2AEh77w059303@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 10 Mar 2015 14:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279851 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 14:43:08 -0000 Author: trasz Date: Tue Mar 10 14:43:07 2015 New Revision: 279851 URL: https://svnweb.freebsd.org/changeset/base/279851 Log: Fix typo. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automountd.8 Modified: head/usr.sbin/autofs/automountd.8 ============================================================================== --- head/usr.sbin/autofs/automountd.8 Tue Mar 10 14:36:51 2015 (r279850) +++ head/usr.sbin/autofs/automountd.8 Tue Mar 10 14:43:07 2015 (r279851) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2014 +.Dd March 10, 2015 .Dt AUTOMOUNTD 8 .Os .Sh NAME @@ -78,7 +78,7 @@ The default is 30. Debug mode: increase verbosity and do not daemonize. .It Fl o Ar options Specify mount options. -Options specified here ill be overridden by options entered in maps or +Options specified here will be overridden by options entered in maps or .Xr auto_master 5 . .It Fl v Increase verbosity. From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 14:55:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EADC9365; Tue, 10 Mar 2015 14:55:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 BBC959BE; Tue, 10 Mar 2015 14:55:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AEt6iW064400; Tue, 10 Mar 2015 14:55:06 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AEt633064398; Tue, 10 Mar 2015 14:55:06 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503101455.t2AEt633064398@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 10 Mar 2015 14:55:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279852 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 14:55:07 -0000 Author: loos Date: Tue Mar 10 14:55:05 2015 New Revision: 279852 URL: https://svnweb.freebsd.org/changeset/base/279852 Log: Fix off-by-one bugs. Spotted by: rpaulo (on another review) Modified: head/sys/dev/iicbus/ds3231.c head/sys/dev/iicbus/lm75.c Modified: head/sys/dev/iicbus/ds3231.c ============================================================================== --- head/sys/dev/iicbus/ds3231.c Tue Mar 10 14:43:07 2015 (r279851) +++ head/sys/dev/iicbus/ds3231.c Tue Mar 10 14:55:05 2015 (r279852) @@ -64,8 +64,6 @@ struct ds3231_softc { uint8_t sc_status; }; -static int ds3231_sqw_freq[] = { 1, 1024, 4096, 8192 }; - static void ds3231_start(void *); static int @@ -282,6 +280,7 @@ ds3231_bbsqw_sysctl(SYSCTL_HANDLER_ARGS) static int ds3231_sqw_freq_sysctl(SYSCTL_HANDLER_ARGS) { + int ds3231_sqw_freq[] = { 1, 1024, 4096, 8192 }; int error, freq, i, newf, tmp; struct ds3231_softc *sc; @@ -290,8 +289,8 @@ ds3231_sqw_freq_sysctl(SYSCTL_HANDLER_AR if (error != 0) return (error); tmp = (sc->sc_ctrl & DS3231_CTRL_RS_MASK) >> DS3231_CTRL_RS_SHIFT; - if (tmp > nitems(ds3231_sqw_freq)) - tmp = nitems(ds3231_sqw_freq); + if (tmp >= nitems(ds3231_sqw_freq)) + tmp = nitems(ds3231_sqw_freq) - 1; freq = ds3231_sqw_freq[tmp]; error = sysctl_handle_int(oidp, &freq, 0, req); if (error != 0 || req->newptr == NULL) Modified: head/sys/dev/iicbus/lm75.c ============================================================================== --- head/sys/dev/iicbus/lm75.c Tue Mar 10 14:43:07 2015 (r279851) +++ head/sys/dev/iicbus/lm75.c Tue Mar 10 14:55:05 2015 (r279852) @@ -90,8 +90,6 @@ struct lm75_softc { uint32_t sc_conf; }; -static int lm75_faults[4] = { 1, 2, 4, 6 }; - /* Utility functions */ static int lm75_conf_read(struct lm75_softc *); static int lm75_conf_write(struct lm75_softc *); @@ -457,14 +455,15 @@ static int lm75_faults_sysctl(SYSCTL_HANDLER_ARGS) { device_t dev; + int lm75_faults[] = { 1, 2, 4, 6 }; int error, faults, i, newf, tmp; struct lm75_softc *sc; dev = (device_t)arg1; sc = device_get_softc(dev); tmp = (sc->sc_conf & LM75_CONF_FAULT) >> LM75_CONF_FSHIFT; - if (tmp > nitems(lm75_faults)) - tmp = nitems(lm75_faults); + if (tmp >= nitems(lm75_faults)) + tmp = nitems(lm75_faults) - 1; faults = lm75_faults[tmp]; error = sysctl_handle_int(oidp, &faults, 0, req); From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 15:11:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88B78793; Tue, 10 Mar 2015 15:11:17 +0000 (UTC) Received: from relay.mailchannels.net (aso-006-i399.relay.mailchannels.net [143.95.81.28]) by mx1.freebsd.org (Postfix) with ESMTP id 77A31C66; Tue, 10 Mar 2015 15:11:15 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp1.ore.mailhop.org (ip-10-33-12-218.us-west-2.compute.internal [10.33.12.218]) by relay.mailchannels.net (Postfix) with ESMTPA id 979311008DC; Tue, 10 Mar 2015 14:33:06 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp1.ore.mailhop.org (smtp1.ore.mailhop.org [10.83.15.107]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Tue, 10 Mar 2015 14:33:08 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1425997987739:4236494055 X-MC-Ingress-Time: 1425997987738 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp1.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YVLDW-0004EJ-HH; Tue, 10 Mar 2015 14:33:06 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2AEX4Lm009637; Tue, 10 Mar 2015 08:33:05 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX197SsO+U/ONpKHwp2hpcrub Message-ID: <1425997984.33324.18.camel@freebsd.org> Subject: Re: svn commit: r279837 - head/sys/arm/conf From: Ian Lepore To: Ronald Klop Date: Tue, 10 Mar 2015 08:33:04 -0600 In-Reply-To: References: <201503100233.t2A2XqE4009962@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 15:11:17 -0000 On Tue, 2015-03-10 at 09:33 +0100, Ronald Klop wrote: > Hi, > > Does this make sense on arm4/arm5 like SHEEVAPLUG also? > > Ronald. > When I asked some other arm developers about doing this change, there was a request to not remove the overrides from all the armv4/5 configs, but I think for the high-functioning Marvel systems it makes sense, so I'll commit that today. -- Ian > > On Tue, 10 Mar 2015 03:33:52 +0100, Ian Lepore wrote: > > > Author: ian > > Date: Tue Mar 10 02:33:51 2015 > > New Revision: 279837 > > URL: https://svnweb.freebsd.org/changeset/base/279837 > > > > Log: > > Remove MODULES_OVERRIDE="" and WITHOUT_MODULES="ahc" from armv6 > > configs. > > These are left over from long ago when there was no way to load modules > > on early armv6 platforms, and when there was a build problem with ahc > > that has long since been fixed, and they just keep getting copy-pasted > > into new configs. > > > > Modified: > > head/sys/arm/conf/ARMADAXP > > head/sys/arm/conf/CUBIEBOARD > > head/sys/arm/conf/CUBIEBOARD2 > > head/sys/arm/conf/EXYNOS5.common > > head/sys/arm/conf/PANDABOARD > > head/sys/arm/conf/TS7800 > > head/sys/arm/conf/VYBRID > > head/sys/arm/conf/ZEDBOARD > > From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 15:33:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC3636B9; Tue, 10 Mar 2015 15:33:48 +0000 (UTC) Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [IPv6:2607:f8b0:4001:c03::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 8108FF02; Tue, 10 Mar 2015 15:33:48 +0000 (UTC) Received: by iecvj10 with SMTP id vj10so19231259iec.0; Tue, 10 Mar 2015 08:33:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=LoG2BaS5YRk6156vE3xr6CsLPWoPe7sDyroTbM5Ctjg=; b=xGX4X47vhm1CZ7dYbGOf/7GBew2jIlzo415R2v2n4E9zDs5g1dI82pAHstNrLHXs3A MDCTmVctCUaFV8ta4DoLUNV39jibATBXfE3R4cc9k4/Jl7DLm9fqrpS6fqNssDYmp65F eMyxLpKNZsC3BMptOdEwyFSpYWjGJw40iHaATjyWdMGRQYo0dYEQHp3HJBKVIrVBV91Z cWO4Nvodc7twltEyz42Hqxdj+DBVbblsSk4Sb8Sx8Ks4LgDXBIY7kdhkmUjNnZYE8pww qBNnTqg6HRkuisgnf1M5Op54lly+fYkT0JPhSZQ841ggq62i44lnp/7LGbPxKBQyx/nw 80yg== MIME-Version: 1.0 X-Received: by 10.50.36.65 with SMTP id o1mr56892277igj.32.1426001627943; Tue, 10 Mar 2015 08:33:47 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.66 with HTTP; Tue, 10 Mar 2015 08:33:47 -0700 (PDT) In-Reply-To: <201503100941.t2A9fnqc015693@svn.freebsd.org> References: <201503100941.t2A9fnqc015693@svn.freebsd.org> Date: Tue, 10 Mar 2015 08:33:47 -0700 X-Google-Sender-Auth: 6V86jm5gMoPQusxiVnEqi5piDY0 Message-ID: Subject: Re: svn commit: r279842 - head/usr.bin/procstat From: Adrian Chadd To: Scott Long Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 15:33:48 -0000 ooooo this will be helpful. Thanks! -a From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 16:01:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 711CAFC9; Tue, 10 Mar 2015 16:01:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 41726352; Tue, 10 Mar 2015 16:01:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AG1hQf098664; Tue, 10 Mar 2015 16:01:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AG1heb098663; Tue, 10 Mar 2015 16:01:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503101601.t2AG1heb098663@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 10 Mar 2015 16:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279853 - head/sys/powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 16:01:44 -0000 Author: nwhitehorn Date: Tue Mar 10 16:01:43 2015 New Revision: 279853 URL: https://svnweb.freebsd.org/changeset/base/279853 Log: Allow PowerMac systems to be booted from an FDT as well as Open Firmware. This is not complete yet: the gem(4) interface on my laptop seems to disappear from the PCI bus as a result of quiescing Open Firmware in the boot loader. Modified: head/sys/powerpc/powermac/platform_powermac.c Modified: head/sys/powerpc/powermac/platform_powermac.c ============================================================================== --- head/sys/powerpc/powermac/platform_powermac.c Tue Mar 10 14:55:05 2015 (r279852) +++ head/sys/powerpc/powermac/platform_powermac.c Tue Mar 10 16:01:43 2015 (r279853) @@ -126,6 +126,8 @@ powermac_mem_regions(platform_t plat, st int physacells = 1; memory = OF_finddevice("/memory"); + if (memory == -1) + memory = OF_finddevice("/memory@0"); /* "reg" has variable #address-cells, but #size-cells is always 1 */ OF_getprop(OF_parent(memory), "#address-cells", &physacells, @@ -154,23 +156,32 @@ powermac_mem_regions(platform_t plat, st /* "available" always has #address-cells = 1 */ propsize = OF_getprop(memory, "available", memoryprop, sizeof(memoryprop)); - propsize /= sizeof(cell_t); - for (i = 0, j = 0; i < propsize; i += 2, j++) { - avail[j].mr_start = memoryprop[i]; - avail[j].mr_size = memoryprop[i + 1]; - } + if (propsize <= 0) { + for (i = 0; i < *physsz; i++) { + avail[i].mr_start = phys[i].mr_start; + avail[i].mr_size = phys[i].mr_size; + } + + *availsz = *physsz; + } else { + propsize /= sizeof(cell_t); + for (i = 0, j = 0; i < propsize; i += 2, j++) { + avail[j].mr_start = memoryprop[i]; + avail[j].mr_size = memoryprop[i + 1]; + } #ifdef __powerpc64__ - /* Add in regions above 4 GB to the available list */ - for (i = 0; i < *physsz; i++) { - if (phys[i].mr_start > BUS_SPACE_MAXADDR_32BIT) { - avail[j].mr_start = phys[i].mr_start; - avail[j].mr_size = phys[i].mr_size; - j++; + /* Add in regions above 4 GB to the available list */ + for (i = 0; i < *physsz; i++) { + if (phys[i].mr_start > BUS_SPACE_MAXADDR_32BIT) { + avail[j].mr_start = phys[i].mr_start; + avail[j].mr_size = phys[i].mr_size; + j++; + } } - } #endif - *availsz = j; + *availsz = j; + } } static int From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 16:06:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 570D12FD; Tue, 10 Mar 2015 16:06:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 41B6B390; Tue, 10 Mar 2015 16:06:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AG68Ur099264; Tue, 10 Mar 2015 16:06:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AG68iO099263; Tue, 10 Mar 2015 16:06:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503101606.t2AG68iO099263@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Mar 2015 16:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279854 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 16:06:08 -0000 Author: hselasky Date: Tue Mar 10 16:06:07 2015 New Revision: 279854 URL: https://svnweb.freebsd.org/changeset/base/279854 Log: Lock softc before clearing bits. Found by: Dmitry Luhtionov MFC after: 1 week Modified: head/sys/dev/usb/input/uhid.c Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Tue Mar 10 16:01:43 2015 (r279853) +++ head/sys/dev/usb/input/uhid.c Tue Mar 10 16:06:07 2015 (r279854) @@ -518,7 +518,9 @@ uhid_open(struct usb_fifo *fifo, int ffl */ if (fflags & FREAD) { /* reset flags */ + mtx_lock(&sc->sc_mtx); sc->sc_flags &= ~UHID_FLAG_IMMED; + mtx_unlock(&sc->sc_mtx); if (usb_fifo_alloc_buffer(fifo, sc->sc_isize + 1, UHID_FRAME_NUM)) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 17:04:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C97C641; Tue, 10 Mar 2015 17:04:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 0D1D4D75; Tue, 10 Mar 2015 17:04:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AH4BR4027591; Tue, 10 Mar 2015 17:04:11 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AH4BmR027590; Tue, 10 Mar 2015 17:04:11 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503101704.t2AH4BmR027590@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 10 Mar 2015 17:04:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279855 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 17:04:12 -0000 Author: nwhitehorn Date: Tue Mar 10 17:04:11 2015 New Revision: 279855 URL: https://svnweb.freebsd.org/changeset/base/279855 Log: Let unchangeable 8-bit frame buffers have vaguely correct colors. MFC after: 2 weeks Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Tue Mar 10 16:06:07 2015 (r279854) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Tue Mar 10 17:04:11 2015 (r279855) @@ -54,6 +54,7 @@ struct ofwfb_softc { phandle_t sc_node; ihandle_t sc_handle; bus_space_tag_t sc_memt; + int iso_palette; }; static vd_probe_t ofwfb_probe; @@ -73,6 +74,12 @@ static const struct vt_driver vt_ofwfb_d .vd_priority = VD_PRIORITY_GENERIC+1, }; +static unsigned char ofw_colors[16] = { + /* See "16-color Text Extension" Open Firmware document, page 4 */ + 0, 4, 2, 6, 1, 5, 3, 7, + 8, 12, 10, 14, 9, 13, 11, 15 +}; + static struct ofwfb_softc ofwfb_conssoftc; VT_DRIVER_DECLARE(vt_ofwfb, vt_ofwfb_driver); @@ -121,6 +128,11 @@ ofwfb_bitblt_bitmap(struct vt_device *vd bgc = sc->fb_cmap[bg]; b = m = 0; + if (((struct ofwfb_softc *)vd->vd_softc)->iso_palette) { + fg = ofw_colors[fg]; + bg = ofw_colors[bg]; + } + line = (sc->fb_stride * y) + x * sc->fb_bpp/8; if (mask == NULL && sc->fb_bpp == 8 && (width % 8 == 0)) { /* Don't try to put off screen pixels */ @@ -255,7 +267,7 @@ static void ofwfb_initialize(struct vt_device *vd) { struct ofwfb_softc *sc = vd->vd_softc; - int i; + int i, err; cell_t retval; uint32_t oldpix; @@ -263,18 +275,24 @@ ofwfb_initialize(struct vt_device *vd) * Set up the color map */ + sc->iso_palette = 0; switch (sc->fb.fb_bpp) { case 8: vt_generate_cons_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, 255, 16, 255, 8, 255, 0); for (i = 0; i < 16; i++) { - OF_call_method("color!", sc->sc_handle, 4, 1, + err = OF_call_method("color!", sc->sc_handle, 4, 1, (cell_t)((sc->fb.fb_cmap[i] >> 16) & 0xff), (cell_t)((sc->fb.fb_cmap[i] >> 8) & 0xff), (cell_t)((sc->fb.fb_cmap[i] >> 0) & 0xff), (cell_t)i, &retval); + if (err) + break; } + if (i != 16) + sc->iso_palette = 1; + break; case 32: From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 17:10:57 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88A9281C; Tue, 10 Mar 2015 17:10:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 728FFDCE; Tue, 10 Mar 2015 17:10:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AHAvk8028936; Tue, 10 Mar 2015 17:10:57 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AHAt0V028926; Tue, 10 Mar 2015 17:10:55 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201503101710.t2AHAt0V028926@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Tue, 10 Mar 2015 17:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279856 - in head/lib/msun: man src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 17:10:57 -0000 Author: kargl Date: Tue Mar 10 17:10:54 2015 New Revision: 279856 URL: https://svnweb.freebsd.org/changeset/base/279856 Log: According to POSIX.1-2008, the Bessel functions of second kind should raise a divide-by-zero floating point exception for x = +-0 and an invalid floating point exception for x < 0 including x = -Inf. Update the code to raise the exception and update the documentation with hopefully better description of the behavior. Reviewed by: bde (code only) Modified: head/lib/msun/man/j0.3 head/lib/msun/src/e_j0.c head/lib/msun/src/e_j0f.c head/lib/msun/src/e_j1.c head/lib/msun/src/e_j1f.c head/lib/msun/src/e_jn.c head/lib/msun/src/e_jnf.c Modified: head/lib/msun/man/j0.3 ============================================================================== --- head/lib/msun/man/j0.3 Tue Mar 10 17:04:11 2015 (r279855) +++ head/lib/msun/man/j0.3 Tue Mar 10 17:10:54 2015 (r279856) @@ -28,7 +28,7 @@ .\" from: @(#)j0.3 6.7 (Berkeley) 4/19/91 .\" $FreeBSD$ .\" -.Dd February 18, 2008 +.Dd March 10, 2015 .Dt J0 3 .Os .Sh NAME @@ -77,24 +77,17 @@ The functions .Fn j0 , .Fn j0f , -.Fn j1 +.Fn j1 , and .Fn j1f -compute the -.Em Bessel function of the first kind of the order -0 and the -.Em order -1, respectively, -for the -real value +compute the Bessel function of the first kind of orders +0 and 1 for the real value .Fa x ; the functions .Fn jn and .Fn jnf -compute the -.Em Bessel function of the first kind of the integer -.Em order +compute the Bessel function of the first kind of the integer order .Fa n for the real value .Fa x . @@ -105,13 +98,8 @@ The functions .Fn y1 , and .Fn y1f -compute the linearly independent -.Em Bessel function of the second kind of the order -0 and the -.Em order -1, respectively, -for the -positive +compute the linearly independent Bessel function of the second kind +of orders 0 and 1 for the positive .Em real value .Fa x ; @@ -119,9 +107,7 @@ the functions .Fn yn and .Fn ynf -compute the -.Em Bessel function of the second kind for the integer -.Em order +compute the Bessel function of the second kind for the integer order .Fa n for the positive .Em real @@ -141,11 +127,20 @@ and .Fn ynf . If .Fa x -is negative, these routines will generate an invalid exception and -return \*(Na. +is negative, including -\*(If, these routines will generate an invalid +exception and return \*(Na. +If +.Fa x +is \*(Pm0, these routines +will generate a divide-by-zero exception and return -\*(If. If .Fa x -is 0 or a sufficiently small positive number, these routines +is a sufficiently small positive number, then +.Fn y1 , +.Fn y1f , +.Fn yn , +and +.Fn ynf will generate an overflow exception and return -\*(If. .Sh SEE ALSO .Xr math 3 Modified: head/lib/msun/src/e_j0.c ============================================================================== --- head/lib/msun/src/e_j0.c Tue Mar 10 17:04:11 2015 (r279855) +++ head/lib/msun/src/e_j0.c Tue Mar 10 17:10:54 2015 (r279856) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); static double pzero(double), qzero(double); +static const volatile double vone = 1, vzero = 0; + static const double huge = 1e300, one = 1.0, @@ -150,10 +152,16 @@ __ieee754_y0(double x) EXTRACT_WORDS(hx,lx,x); ix = 0x7fffffff&hx; - /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */ - if(ix>=0x7ff00000) return one/(x+x*x); - if((ix|lx)==0) return -one/zero; - if(hx<0) return zero/zero; + /* + * y0(NaN) = NaN. + * y0(Inf) = 0. + * y0(-Inf) = NaN and raise invalid exception. + */ + if(ix>=0x7ff00000) return vone/(x+x*x); + /* y0(+-0) = -inf and raise divide-by-zero exception. */ + if((ix|lx)==0) return -one/vzero; + /* y0(x<0) = NaN and raise invalid exception. */ + if(hx<0) return vzero/vzero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ /* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0)) * where x0 = x-pi/4 Modified: head/lib/msun/src/e_j0f.c ============================================================================== --- head/lib/msun/src/e_j0f.c Tue Mar 10 17:04:11 2015 (r279855) +++ head/lib/msun/src/e_j0f.c Tue Mar 10 17:10:54 2015 (r279856) @@ -16,11 +16,17 @@ #include __FBSDID("$FreeBSD$"); +/* + * See e_j0.c for complete comments. + */ + #include "math.h" #include "math_private.h" static float pzerof(float), qzerof(float); +static const volatile float vone = 1, vzero = 0; + static const float huge = 1e30, one = 1.0, @@ -107,10 +113,9 @@ __ieee754_y0f(float x) GET_FLOAT_WORD(hx,x); ix = 0x7fffffff&hx; - /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */ - if(ix>=0x7f800000) return one/(x+x*x); - if(ix==0) return -one/zero; - if(hx<0) return zero/zero; + if(ix>=0x7f800000) return vone/(x+x*x); + if(ix==0) return -one/vzero; + if(hx<0) return vzero/vzero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ /* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0)) * where x0 = x-pi/4 Modified: head/lib/msun/src/e_j1.c ============================================================================== --- head/lib/msun/src/e_j1.c Tue Mar 10 17:04:11 2015 (r279855) +++ head/lib/msun/src/e_j1.c Tue Mar 10 17:10:54 2015 (r279856) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); static double pone(double), qone(double); +static const volatile double vone = 1, vzero = 0; + static const double huge = 1e300, one = 1.0, @@ -147,10 +149,16 @@ __ieee754_y1(double x) EXTRACT_WORDS(hx,lx,x); ix = 0x7fffffff&hx; - /* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */ - if(ix>=0x7ff00000) return one/(x+x*x); - if((ix|lx)==0) return -one/zero; - if(hx<0) return zero/zero; + /* + * y1(NaN) = NaN. + * y1(Inf) = 0. + * y1(-Inf) = NaN and raise invalid exception. + */ + if(ix>=0x7ff00000) return vone/(x+x*x); + /* y1(+-0) = -inf and raise divide-by-zero exception. */ + if((ix|lx)==0) return -one/vzero; + /* y1(x<0) = NaN and raise invalid exception. */ + if(hx<0) return vzero/vzero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ s = sin(x); c = cos(x); Modified: head/lib/msun/src/e_j1f.c ============================================================================== --- head/lib/msun/src/e_j1f.c Tue Mar 10 17:04:11 2015 (r279855) +++ head/lib/msun/src/e_j1f.c Tue Mar 10 17:10:54 2015 (r279856) @@ -16,11 +16,17 @@ #include __FBSDID("$FreeBSD$"); +/* + * See e_j1.c for complete comments. + */ + #include "math.h" #include "math_private.h" static float ponef(float), qonef(float); +static const volatile float vone = 1, vzero = 0; + static const float huge = 1e30, one = 1.0, @@ -104,10 +110,9 @@ __ieee754_y1f(float x) GET_FLOAT_WORD(hx,x); ix = 0x7fffffff&hx; - /* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */ - if(ix>=0x7f800000) return one/(x+x*x); - if(ix==0) return -one/zero; - if(hx<0) return zero/zero; + if(ix>=0x7f800000) return vone/(x+x*x); + if(ix==0) return -one/vzero; + if(hx<0) return vzero/vzero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ s = sinf(x); c = cosf(x); Modified: head/lib/msun/src/e_jn.c ============================================================================== --- head/lib/msun/src/e_jn.c Tue Mar 10 17:04:11 2015 (r279855) +++ head/lib/msun/src/e_jn.c Tue Mar 10 17:10:54 2015 (r279856) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include "math.h" #include "math_private.h" +static const volatile double vone = 1, vzero = 0; + static const double invsqrtpi= 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */ two = 2.00000000000000000000e+00, /* 0x40000000, 0x00000000 */ @@ -220,10 +222,12 @@ __ieee754_yn(int n, double x) EXTRACT_WORDS(hx,lx,x); ix = 0x7fffffff&hx; - /* if Y(n,NaN) is NaN */ + /* yn(n,NaN) = NaN */ if((ix|((u_int32_t)(lx|-lx))>>31)>0x7ff00000) return x+x; - if((ix|lx)==0) return -one/zero; - if(hx<0) return zero/zero; + /* yn(n,+-0) = -inf and raise divide-by-zero exception. */ + if((ix|lx)==0) return -one/vzero; + /* yn(n,x<0) = NaN and raise invalid exception. */ + if(hx<0) return vzero/vzero; sign = 1; if(n<0){ n = -n; Modified: head/lib/msun/src/e_jnf.c ============================================================================== --- head/lib/msun/src/e_jnf.c Tue Mar 10 17:04:11 2015 (r279855) +++ head/lib/msun/src/e_jnf.c Tue Mar 10 17:10:54 2015 (r279856) @@ -16,9 +16,15 @@ #include __FBSDID("$FreeBSD$"); +/* + * See e_jn.c for complete comments. + */ + #include "math.h" #include "math_private.h" +static const volatile float vone = 1, vzero = 0; + static const float two = 2.0000000000e+00, /* 0x40000000 */ one = 1.0000000000e+00; /* 0x3F800000 */ @@ -172,10 +178,9 @@ __ieee754_ynf(int n, float x) GET_FLOAT_WORD(hx,x); ix = 0x7fffffff&hx; - /* if Y(n,NaN) is NaN */ if(ix>0x7f800000) return x+x; - if(ix==0) return -one/zero; - if(hx<0) return zero/zero; + if(ix==0) return -one/vzero; + if(hx<0) return vzero/vzero; sign = 1; if(n<0){ n = -n; From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 17:45:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0F7754E; Tue, 10 Mar 2015 17:45:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 9BCC637B; Tue, 10 Mar 2015 17:45:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AHjlEe046901; Tue, 10 Mar 2015 17:45:47 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AHjlcE046900; Tue, 10 Mar 2015 17:45:47 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201503101745.t2AHjlcE046900@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 10 Mar 2015 17:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279857 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 17:45:47 -0000 Author: vangyzen Date: Tue Mar 10 17:45:46 2015 New Revision: 279857 URL: https://svnweb.freebsd.org/changeset/base/279857 Log: Add myself to the src committers graph, with kib as my mentor. Approved by: kib (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Mar 10 17:10:54 2015 (r279856) +++ head/share/misc/committers-src.dot Tue Mar 10 17:45:46 2015 (r279857) @@ -296,6 +296,7 @@ tuexen [label="Michael Tuexen\ntuexen@Fr tychon [label="Tycho Nightingale\ntychon@FreeBSD.org\n2014/01/21"] ume [label="Hajimu UMEMOTO\nume@FreeBSD.org\n2000/02/26"] uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2010/01/28"] +vangyzen [label="Eric van Gyzen\nvangyzen@FreeBSD.org\n2015/03/08"] vanhu [label="Yvan Vanhullebus\nvanhu@FreeBSD.org\n2008/07/21"] versus [label="Konrad Jankowski\nversus@FreeBSD.org\n2008/10/27"] weongyo [label="Weongyo Jeong\nweongyo@FreeBSD.org\n2007/12/21"] @@ -560,6 +561,7 @@ kib -> rmh kib -> stas kib -> tijl kib -> trociny +kib -> vangyzen kib -> zont kmacy -> lstewart From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 18:00:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C41DB3A; Tue, 10 Mar 2015 18:00:33 +0000 (UTC) Received: from relay.mailchannels.net (ftx-008-i768.relay.mailchannels.net [50.61.143.68]) by mx1.freebsd.org (Postfix) with ESMTP id EBA526BF; Tue, 10 Mar 2015 18:00:30 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp1.ore.mailhop.org (ip-10-213-14-133.us-west-2.compute.internal [10.213.14.133]) by relay.mailchannels.net (Postfix) with ESMTPA id 54AB8120544; Tue, 10 Mar 2015 13:27:06 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp1.ore.mailhop.org (smtp1.ore.mailhop.org [10.21.145.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Tue, 10 Mar 2015 13:27:08 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1425994027448:1231751392 X-MC-Ingress-Time: 1425994027448 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp1.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YVKBd-0005um-6u; Tue, 10 Mar 2015 13:27:05 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2ADR31s009527; Tue, 10 Mar 2015 07:27:03 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX192pTePSl9xBlk/DW+T3T4M Message-ID: <1425994023.33324.9.camel@freebsd.org> Subject: Re: svn commit: r279828 - head/sys/dev/cadence From: Ian Lepore To: Gleb Smirnoff Date: Tue, 10 Mar 2015 07:27:03 -0600 In-Reply-To: <20150310102525.GU17947@FreeBSD.org> References: <201503092239.t29MdxUo089384@svn.freebsd.org> <20150310102525.GU17947@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Thomas Skibo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 18:00:33 -0000 On Tue, 2015-03-10 at 13:25 +0300, Gleb Smirnoff wrote: > On Mon, Mar 09, 2015 at 10:39:59PM +0000, Ian Lepore wrote: > I> Author: ian > I> Date: Mon Mar 9 22:39:58 2015 > I> New Revision: 279828 > I> URL: https://svnweb.freebsd.org/changeset/base/279828 > I> > I> Log: > I> Use the new ifnet API. Also, allocate bus_dma_maps as needed instead of > I> pre-allocating them all at start-up. Also fix a bug in cgem_stop(); before, > I> it wasn't properly unloading dma maps due to a cut-and-paste error. > > Ian, the new ifnet API isn't the last word in ifnet API. :) > > Since you are already into that, I'd appreciate if you look > into projects/ifnet branch and convert cgem(4) to it. > > As examples, you can look at msk(4), bge(4), xl(4) and vtnet(4) > in the branch. > Hrm, I know nothing about the cgem driver and very little about ethernet drivers in general (despite having "written" one, mostly by cut and paste from working drivers). I was committing this on behalf of a non-committer contributor who maintains the Xilinx/Zynq arm code. I just noticed I forgot to add to the commit... Submitted by: Thomas Skibo I'll add him to the CC on this, in case he has time to work up a patchset for the projects/ifnet branch for you. -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 19:17:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34B581A1; Tue, 10 Mar 2015 19:17:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 1FA0CF98; Tue, 10 Mar 2015 19:17:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AJHgbt090995; Tue, 10 Mar 2015 19:17:42 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AJHeQf090989; Tue, 10 Mar 2015 19:17:40 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201503101917.t2AJHeQf090989@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Tue, 10 Mar 2015 19:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279858 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 19:17:42 -0000 Author: jfv Date: Tue Mar 10 19:17:40 2015 New Revision: 279858 URL: https://svnweb.freebsd.org/changeset/base/279858 Log: This delta introduces SRIOV support, thanks to Ryan Stone of Sandvine for adding this major feature to the driver. Secondly, this updates the base driver with new 20G device support, and with the new firmware levels some changes to link handling and initialization were required. MFC after: 1 week Modified: head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlvc.c Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Tue Mar 10 17:45:46 2015 (r279857) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Tue Mar 10 19:17:40 2015 (r279858) @@ -42,7 +42,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0004 +#define I40E_FW_API_VERSION_MINOR 0x0002 struct i40e_aq_desc { __le16 flags; @@ -140,7 +140,12 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, + i40e_aqc_opc_set_cppm_configuration = 0x0103, + i40e_aqc_opc_set_arp_proxy_entry = 0x0104, + i40e_aqc_opc_set_ns_proxy_entry = 0x0105, + /* LAA */ + i40e_aqc_opc_mng_laa = 0x0106, /* AQ obsolete */ i40e_aqc_opc_mac_address_read = 0x0107, i40e_aqc_opc_mac_address_write = 0x0108, @@ -265,6 +270,7 @@ enum i40e_admin_queue_opc { /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, + i40e_aqc_opc_tunnel_key_structure = 0x0B10, /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -276,6 +282,8 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_oem_ocbb_initialize = 0xFE03, /* debug commands */ + i40e_aqc_opc_debug_get_deviceid = 0xFF00, + i40e_aqc_opc_debug_set_mode = 0xFF01, i40e_aqc_opc_debug_read_reg = 0xFF03, i40e_aqc_opc_debug_write_reg = 0xFF04, i40e_aqc_opc_debug_modify_reg = 0xFF07, @@ -509,8 +517,7 @@ struct i40e_aqc_mac_address_read { #define I40E_AQC_SAN_ADDR_VALID 0x20 #define I40E_AQC_PORT_ADDR_VALID 0x40 #define I40E_AQC_WOL_ADDR_VALID 0x80 -#define I40E_AQC_MC_MAG_EN_VALID 0x100 -#define I40E_AQC_ADDR_VALID_MASK 0x1F0 +#define I40E_AQC_ADDR_VALID_MASK 0xf0 u8 reserved[6]; __le32 addr_high; __le32 addr_low; @@ -533,9 +540,7 @@ struct i40e_aqc_mac_address_write { #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 #define I40E_AQC_WRITE_TYPE_PORT 0x8000 -#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 -#define I40E_AQC_WRITE_TYPE_MASK 0xC000 - +#define I40E_AQC_WRITE_TYPE_MASK 0xc000 __le16 mac_sah; __le32 mac_sal; u8 reserved[8]; @@ -1071,7 +1076,6 @@ struct i40e_aqc_set_vsi_promiscuous_mode __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; -#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000 u8 reserved[8]; }; @@ -2066,12 +2070,6 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_star #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT) #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT) -#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 -#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT) -#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xA -#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT) -#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 -#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT) struct i40e_aqc_get_cee_dcb_cfg_v1_resp { u8 reserved1; u8 oper_num_tc; Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Tue Mar 10 17:45:46 2015 (r279857) +++ head/sys/dev/ixl/i40e_common.c Tue Mar 10 19:17:40 2015 (r279858) @@ -866,7 +866,7 @@ static enum i40e_media_type i40e_get_med return media; } -#define I40E_PF_RESET_WAIT_COUNT 110 +#define I40E_PF_RESET_WAIT_COUNT 200 /** * i40e_pf_reset - Reset the PF * @hw: pointer to the hardware structure @@ -1108,11 +1108,9 @@ u32 i40e_led_get(struct i40e_hw *hw) if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); + /* ignore gpio LED src mode entries related to the activity LEDs */ + current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> + I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); switch (current_mode) { case I40E_COMBINED_ACTIVITY: case I40E_FILTER_ACTIVITY: @@ -1156,11 +1154,9 @@ void i40e_led_set(struct i40e_hw *hw, u3 if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); + /* ignore gpio LED src mode entries related to the activity LEDs */ + current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> + I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); switch (current_mode) { case I40E_COMBINED_ACTIVITY: case I40E_FILTER_ACTIVITY: @@ -1529,6 +1525,7 @@ aq_get_link_info_exit: return status; } + /** * i40e_aq_set_phy_int_mask * @hw: pointer to the hw struct @@ -2816,13 +2813,12 @@ i40e_aq_erase_nvm_exit: #define I40E_DEV_FUNC_CAP_MSIX_VF 0x44 #define I40E_DEV_FUNC_CAP_FLOW_DIRECTOR 0x45 #define I40E_DEV_FUNC_CAP_IEEE_1588 0x46 -#define I40E_DEV_FUNC_CAP_FLEX10 0xF1 +#define I40E_DEV_FUNC_CAP_MFP_MODE_1 0xF1 #define I40E_DEV_FUNC_CAP_CEM 0xF2 #define I40E_DEV_FUNC_CAP_IWARP 0x51 #define I40E_DEV_FUNC_CAP_LED 0x61 #define I40E_DEV_FUNC_CAP_SDP 0x62 #define I40E_DEV_FUNC_CAP_MDIO 0x63 -#define I40E_DEV_FUNC_CAP_WR_CSR_PROT 0x64 /** * i40e_parse_discover_capabilities @@ -2840,7 +2836,6 @@ static void i40e_parse_discover_capabili struct i40e_aqc_list_capabilities_element_resp *cap; u32 valid_functions, num_functions; u32 number, logical_id, phys_id; - u8 major_rev; struct i40e_hw_capabilities *p; u32 i = 0; u16 id; @@ -2859,7 +2854,6 @@ static void i40e_parse_discover_capabili number = LE32_TO_CPU(cap->number); logical_id = LE32_TO_CPU(cap->logical_id); phys_id = LE32_TO_CPU(cap->phys_id); - major_rev = cap->major_rev; switch (id) { case I40E_DEV_FUNC_CAP_SWITCH_MODE: @@ -2934,21 +2928,9 @@ static void i40e_parse_discover_capabili case I40E_DEV_FUNC_CAP_MSIX_VF: p->num_msix_vectors_vf = number; break; - case I40E_DEV_FUNC_CAP_FLEX10: - if (major_rev == 1) { - if (number == 1) { - p->flex10_enable = TRUE; - p->flex10_capable = TRUE; - } - } else { - /* Capability revision >= 2 */ - if (number & 1) - p->flex10_enable = TRUE; - if (number & 2) - p->flex10_capable = TRUE; - } - p->flex10_mode = logical_id; - p->flex10_status = phys_id; + case I40E_DEV_FUNC_CAP_MFP_MODE_1: + if (number == 1) + p->mfp_mode_1 = TRUE; break; case I40E_DEV_FUNC_CAP_CEM: if (number == 1) @@ -2981,18 +2963,11 @@ static void i40e_parse_discover_capabili p->fd_filters_guaranteed = number; p->fd_filters_best_effort = logical_id; break; - case I40E_DEV_FUNC_CAP_WR_CSR_PROT: - p->wr_csr_prot = (u64)number; - p->wr_csr_prot |= (u64)logical_id << 32; - break; default: break; } } - if (p->fcoe) - i40e_debug(hw, I40E_DEBUG_ALL, "device is FCoE capable\n"); - /* Always disable FCoE if compiled without the I40E_FCOE_ENA flag */ p->fcoe = FALSE; @@ -4948,63 +4923,6 @@ void i40e_set_pci_config_data(struct i40 } /** - * i40e_aq_debug_dump - * @hw: pointer to the hardware structure - * @cluster_id: specific cluster to dump - * @table_id: table id within cluster - * @start_index: index of line in the block to read - * @buff_size: dump buffer size - * @buff: dump buffer - * @ret_buff_size: actual buffer size returned - * @ret_next_table: next block to read - * @ret_next_index: next index to read - * - * Dump internal FW/HW data for debug purposes. - * - **/ -enum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, - u8 table_id, u32 start_index, u16 buff_size, - void *buff, u16 *ret_buff_size, - u8 *ret_next_table, u32 *ret_next_index, - struct i40e_asq_cmd_details *cmd_details) -{ - struct i40e_aq_desc desc; - struct i40e_aqc_debug_dump_internals *cmd = - (struct i40e_aqc_debug_dump_internals *)&desc.params.raw; - struct i40e_aqc_debug_dump_internals *resp = - (struct i40e_aqc_debug_dump_internals *)&desc.params.raw; - enum i40e_status_code status; - - if (buff_size == 0 || !buff) - return I40E_ERR_PARAM; - - i40e_fill_default_direct_cmd_desc(&desc, - i40e_aqc_opc_debug_dump_internals); - /* Indirect Command */ - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); - if (buff_size > I40E_AQ_LARGE_BUF) - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); - - cmd->cluster_id = cluster_id; - cmd->table_id = table_id; - cmd->idx = CPU_TO_LE32(start_index); - - desc.datalen = CPU_TO_LE16(buff_size); - - status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); - if (!status) { - if (ret_buff_size != NULL) - *ret_buff_size = LE16_TO_CPU(desc.datalen); - if (ret_next_table != NULL) - *ret_next_table = resp->table_id; - if (ret_next_index != NULL) - *ret_next_index = LE32_TO_CPU(resp->idx); - } - - return status; -} - -/** * i40e_read_bw_from_alt_ram * @hw: pointer to the hardware structure * @max_bw: pointer for max_bw read Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Tue Mar 10 17:45:46 2015 (r279857) +++ head/sys/dev/ixl/i40e_prototype.h Tue Mar 10 19:17:40 2015 (r279858) @@ -445,9 +445,4 @@ enum i40e_status_code i40e_aq_add_rem_co u16 vsi_seid, u16 queue, bool is_add, struct i40e_control_filter_stats *stats, struct i40e_asq_cmd_details *cmd_details); -enum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, - u8 table_id, u32 start_index, u16 buff_size, - void *buff, u16 *ret_buff_size, - u8 *ret_next_table, u32 *ret_next_index, - struct i40e_asq_cmd_details *cmd_details); #endif /* _I40E_PROTOTYPE_H_ */ Modified: head/sys/dev/ixl/i40e_type.h ============================================================================== --- head/sys/dev/ixl/i40e_type.h Tue Mar 10 17:45:46 2015 (r279857) +++ head/sys/dev/ixl/i40e_type.h Tue Mar 10 19:17:40 2015 (r279858) @@ -287,17 +287,7 @@ struct i40e_hw_capabilities { bool dcb; bool fcoe; bool iscsi; /* Indicates iSCSI enabled */ - bool flex10_enable; - bool flex10_capable; - u32 flex10_mode; -#define I40E_FLEX10_MODE_UNKNOWN 0x0 -#define I40E_FLEX10_MODE_DCC 0x1 -#define I40E_FLEX10_MODE_DCI 0x2 - - u32 flex10_status; -#define I40E_FLEX10_STATUS_DCC_ERROR 0x1 -#define I40E_FLEX10_STATUS_VC_MODE 0x2 - + bool mfp_mode_1; bool mgmt_cem; bool ieee_1588; bool iwarp; @@ -326,7 +316,6 @@ struct i40e_hw_capabilities { u8 rx_buf_chain_len; u32 enabled_tcmap; u32 maxtc; - u64 wr_csr_prot; }; struct i40e_mac_info { @@ -573,7 +562,7 @@ struct i40e_hw { u32 debug_mask; }; -static INLINE bool i40e_is_vf(struct i40e_hw *hw) +static inline bool i40e_is_vf(struct i40e_hw *hw) { return hw->mac.type == I40E_MAC_VF; } @@ -1274,9 +1263,6 @@ struct i40e_hw_port_stats { /* flow director stats */ u64 fd_atr_match; u64 fd_sb_match; - u64 fd_atr_tunnel_match; - u32 fd_atr_status; - u32 fd_sb_status; /* EEE LPI */ u32 tx_lpi_status; u32 rx_lpi_status; Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Tue Mar 10 17:45:46 2015 (r279857) +++ head/sys/dev/ixl/if_ixl.c Tue Mar 10 19:17:40 2015 (r279858) @@ -48,7 +48,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.3.6"; +char ixl_driver_version[] = "1.4.1"; /********************************************************************* * PCI Device ID Table @@ -70,6 +70,7 @@ static ixl_vendor_info_t ixl_vendor_info {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, 0, 0, 0}, + {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -113,16 +114,17 @@ static void ixl_configure_legacy(struct static void ixl_free_pci_resources(struct ixl_pf *); static void ixl_local_timer(void *); static int ixl_setup_interface(device_t, struct ixl_vsi *); -static bool ixl_config_link(struct i40e_hw *); +static void ixl_link_event(struct ixl_pf *, struct i40e_arq_event_info *); static void ixl_config_rss(struct ixl_vsi *); static void ixl_set_queue_rx_itr(struct ixl_queue *); static void ixl_set_queue_tx_itr(struct ixl_queue *); static int ixl_set_advertised_speeds(struct ixl_pf *, int); -static void ixl_enable_rings(struct ixl_vsi *); -static void ixl_disable_rings(struct ixl_vsi *); -static void ixl_enable_intr(struct ixl_vsi *); -static void ixl_disable_intr(struct ixl_vsi *); +static int ixl_enable_rings(struct ixl_vsi *); +static int ixl_disable_rings(struct ixl_vsi *); +static void ixl_enable_intr(struct ixl_vsi *); +static void ixl_disable_intr(struct ixl_vsi *); +static void ixl_disable_rings_intr(struct ixl_vsi *); static void ixl_enable_adminq(struct i40e_hw *); static void ixl_disable_adminq(struct i40e_hw *); @@ -139,6 +141,7 @@ static void ixl_unregister_vlan(void *, static void ixl_setup_vlan_filters(struct ixl_vsi *); static void ixl_init_filters(struct ixl_vsi *); +static void ixl_reconfigure_filters(struct ixl_vsi *vsi); static void ixl_add_filter(struct ixl_vsi *, u8 *, s16 vlan); static void ixl_del_filter(struct ixl_vsi *, u8 *, s16 vlan); static void ixl_add_hw_filters(struct ixl_vsi *, int, int); @@ -146,6 +149,8 @@ static void ixl_del_hw_filters(struct ix static struct ixl_mac_filter * ixl_find_filter(struct ixl_vsi *, u8 *, s16); static void ixl_add_mc_filter(struct ixl_vsi *, u8 *); +static void ixl_free_mac_filters(struct ixl_vsi *vsi); + /* Sysctl debug interface */ static int ixl_debug_info(SYSCTL_HANDLER_ARGS); @@ -175,6 +180,7 @@ static void ixl_add_sysctls_eth_stats(st struct i40e_eth_stats *); static void ixl_update_stats_counters(struct ixl_pf *); static void ixl_update_eth_stats(struct ixl_vsi *); +static void ixl_update_vsi_stats(struct ixl_vsi *); static void ixl_pf_reset_stats(struct ixl_pf *); static void ixl_vsi_reset_stats(struct ixl_vsi *); static void ixl_stat_update48(struct i40e_hw *, u32, u32, bool, @@ -188,7 +194,21 @@ static int ixl_sysctl_phy_abilities(SYSC static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_dump_txd(SYSCTL_HANDLER_ARGS); +#endif + +#ifdef PCI_IOV +static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err); + +static int ixl_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t*); +static void ixl_uninit_iov(device_t dev); +static int ixl_add_vf(device_t dev, uint16_t vfnum, const nvlist_t*); + +static void ixl_handle_vf_msg(struct ixl_pf *, + struct i40e_arq_event_info *); +static void ixl_handle_vflr(void *arg, int pending); + +static void ixl_reset_vf(struct ixl_pf *pf, struct ixl_vf *vf); +static void ixl_reinit_vf(struct ixl_pf *pf, struct ixl_vf *vf); #endif /********************************************************************* @@ -201,6 +221,11 @@ static device_method_t ixl_methods[] = { DEVMETHOD(device_attach, ixl_attach), DEVMETHOD(device_detach, ixl_detach), DEVMETHOD(device_shutdown, ixl_shutdown), +#ifdef PCI_IOV + DEVMETHOD(pci_init_iov, ixl_init_iov), + DEVMETHOD(pci_uninit_iov, ixl_uninit_iov), + DEVMETHOD(pci_add_vf, ixl_add_vf), +#endif {0, 0} }; @@ -213,9 +238,6 @@ DRIVER_MODULE(ixl, pci, ixl_driver, ixl_ MODULE_DEPEND(ixl, pci, 1, 1, 1); MODULE_DEPEND(ixl, ether, 1, 1, 1); -#ifdef DEV_NETMAP -MODULE_DEPEND(ixl, netmap, 1, 1, 1); -#endif /* DEV_NETMAP */ /* ** Global reset mutex @@ -290,10 +312,6 @@ int ixl_atr_rate = 20; TUNABLE_INT("hw.ixl.atr_rate", &ixl_atr_rate); #endif -#ifdef DEV_NETMAP -#define NETMAP_IXL_MAIN /* only bring in one part of the netmap code */ -#include -#endif /* DEV_NETMAP */ static char *ixl_fc_string[6] = { "None", @@ -304,6 +322,10 @@ static char *ixl_fc_string[6] = { "Default" }; +static MALLOC_DEFINE(M_IXL, "ixl", "ixl driver allocations"); + +static uint8_t ixl_bcast_addr[ETHER_ADDR_LEN] = + {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; /********************************************************************* * Device identification routine @@ -380,6 +402,10 @@ ixl_attach(device_t dev) struct ixl_vsi *vsi; u16 bus; int error = 0; +#ifdef PCI_IOV + nvlist_t *pf_schema, *vf_schema; + int iov_error; +#endif INIT_DEBUGOUT("ixl_attach: begin"); @@ -467,11 +493,6 @@ ixl_attach(device_t dev) SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "dump_desc", CTLTYPE_INT | CTLFLAG_WR, - pf, 0, ixl_sysctl_dump_txd, "I", "Desc dump"); #endif /* Save off the PCI information */ @@ -486,6 +507,8 @@ ixl_attach(device_t dev) hw->bus.device = pci_get_slot(dev); hw->bus.func = pci_get_function(dev); + pf->vc_debug_lvl = 1; + /* Do PCI setup - map BAR0, etc */ if (ixl_allocate_pci_resources(pf)) { device_printf(dev, "Allocation of PCI resources failed\n"); @@ -556,7 +579,8 @@ ixl_attach(device_t dev) } /* Set up host memory cache */ - error = i40e_init_lan_hmc(hw, vsi->num_queues, vsi->num_queues, 0, 0); + error = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, + hw->func_caps.num_rx_qp, 0, 0); if (error) { device_printf(dev, "init_lan_hmc failed: %d\n", error); goto err_get_cap; @@ -608,16 +632,8 @@ ixl_attach(device_t dev) } /* Determine link state */ - vsi->link_up = ixl_config_link(hw); - - /* Report if Unqualified modules are found */ - if ((vsi->link_up == FALSE) && - (pf->hw.phy.link_info.link_info & - I40E_AQ_MEDIA_AVAILABLE) && - (!(pf->hw.phy.link_info.an_info & - I40E_AQ_QUALIFIED_MODULE))) - device_printf(dev, "Link failed because " - "an unqualified module was detected\n"); + i40e_aq_get_link_info(hw, TRUE, NULL, NULL); + pf->link_up = i40e_get_link_status(hw); /* Setup OS specific network interface */ if (ixl_setup_interface(dev, vsi) != 0) { @@ -653,10 +669,27 @@ ixl_attach(device_t dev) vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); +#ifdef PCI_IOV + /* SR-IOV is only supported when MSI-X is in use. */ + if (pf->msix > 1) { + pf_schema = pci_iov_schema_alloc_node(); + vf_schema = pci_iov_schema_alloc_node(); + pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); + pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof", + IOV_SCHEMA_HASDEFAULT, TRUE); + pci_iov_schema_add_bool(vf_schema, "allow-set-mac", + IOV_SCHEMA_HASDEFAULT, FALSE); + pci_iov_schema_add_bool(vf_schema, "allow-promisc", + IOV_SCHEMA_HASDEFAULT, FALSE); + + iov_error = pci_iov_attach(dev, pf_schema, vf_schema); + if (iov_error != 0) + device_printf(dev, + "Failed to initialize SR-IOV (error=%d)\n", + iov_error); + } +#endif -#ifdef DEV_NETMAP - ixl_netmap_attach(vsi); -#endif /* DEV_NETMAP */ INIT_DEBUGOUT("ixl_attach: end"); return (0); @@ -692,6 +725,9 @@ ixl_detach(device_t dev) struct ixl_vsi *vsi = &pf->vsi; struct ixl_queue *que = vsi->queues; i40e_status status; +#ifdef PCI_IOV + int error; +#endif INIT_DEBUGOUT("ixl_detach: begin"); @@ -701,6 +737,14 @@ ixl_detach(device_t dev) return (EBUSY); } +#ifdef PCI_IOV + error = pci_iov_detach(dev); + if (error != 0) { + device_printf(dev, "SR-IOV in use; detach first.\n"); + return (error); + } +#endif + ether_ifdetach(vsi->ifp); if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) { IXL_PF_LOCK(pf); @@ -735,11 +779,6 @@ ixl_detach(device_t dev) EVENTHANDLER_DEREGISTER(vlan_unconfig, vsi->vlan_detach); callout_drain(&pf->timer); -#ifdef DEV_NETMAP - netmap_detach(vsi->ifp); -#endif /* DEV_NETMAP */ - - ixl_free_pci_resources(pf); bus_generic_detach(dev); if_free(vsi->ifp); @@ -908,7 +947,7 @@ static int ixl_ioctl(struct ifnet * ifp, u_long command, caddr_t data) { struct ixl_vsi *vsi = ifp->if_softc; - struct ixl_pf *pf = (struct ixl_pf *)vsi->back; + struct ixl_pf *pf = vsi->back; struct ifreq *ifr = (struct ifreq *) data; #if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; @@ -1133,6 +1172,8 @@ ixl_init_locked(struct ixl_pf *pf) i40e_aq_set_default_vsi(hw, vsi->seid, NULL); + ixl_reconfigure_filters(vsi); + /* Set MTU in hardware*/ int aq_error = i40e_aq_set_mac_config(hw, vsi->max_frame_size, TRUE, 0, NULL); @@ -1227,6 +1268,11 @@ ixl_intr(void *arg) mask = rd32(hw, I40E_PFINT_ICR0_ENA); +#ifdef PCI_IOV + if (icr0 & I40E_PFINT_ICR0_VFLR_MASK) + taskqueue_enqueue(pf->tq, &pf->vflr_task); +#endif + if (icr0 & I40E_PFINT_ICR0_ADMINQ_MASK) { taskqueue_enqueue(pf->tq, &pf->adminq); return; @@ -1330,8 +1376,12 @@ ixl_msix_adminq(void *arg) mask &= ~I40E_PFINT_ICR0_ENA_MAL_DETECT_MASK; } - if (reg & I40E_PFINT_ICR0_VFLR_MASK) +#ifdef PCI_IOV + if (reg & I40E_PFINT_ICR0_VFLR_MASK) { mask &= ~I40E_PFINT_ICR0_ENA_VFLR_MASK; + taskqueue_enqueue(pf->tq, &pf->vflr_task); + } +#endif reg = rd32(hw, I40E_PFINT_DYN_CTL0); reg = reg | I40E_PFINT_DYN_CTL0_CLEARPBA_MASK; @@ -1353,18 +1403,20 @@ static void ixl_media_status(struct ifnet * ifp, struct ifmediareq * ifmr) { struct ixl_vsi *vsi = ifp->if_softc; - struct ixl_pf *pf = (struct ixl_pf *)vsi->back; + struct ixl_pf *pf = vsi->back; struct i40e_hw *hw = &pf->hw; INIT_DEBUGOUT("ixl_media_status: begin"); IXL_PF_LOCK(pf); + hw->phy.get_link_info = TRUE; + pf->link_up = i40e_get_link_status(hw); ixl_update_link_status(pf); ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; - if (!vsi->link_up) { + if (!pf->link_up) { IXL_PF_UNLOCK(pf); return; } @@ -1754,15 +1806,14 @@ ixl_update_link_status(struct ixl_pf *pf struct ifnet *ifp = vsi->ifp; device_t dev = pf->dev; - - if (vsi->link_up){ + if (pf->link_up){ if (vsi->link_active == FALSE) { - i40e_aq_get_link_info(hw, TRUE, NULL, NULL); pf->fc = hw->fc.current_mode; if (bootverbose) { device_printf(dev,"Link is up %d Gbps %s," " Flow Control: %s\n", - ((vsi->link_speed == I40E_LINK_SPEED_40GB)? 40:10), + ((pf->link_speed == + I40E_LINK_SPEED_40GB)? 40:10), "Full Duplex", ixl_fc_string[pf->fc]); } vsi->link_active = TRUE; @@ -1771,10 +1822,12 @@ ixl_update_link_status(struct ixl_pf *pf ** partition is not at least 10GB */ if (hw->func_caps.npar_enable && - (hw->phy.link_info.link_speed == I40E_LINK_SPEED_1GB || - hw->phy.link_info.link_speed == I40E_LINK_SPEED_100MB)) - device_printf(dev, "The partition detected link" - "speed that is less than 10Gbps\n"); + (hw->phy.link_info.link_speed == + I40E_LINK_SPEED_1GB || + hw->phy.link_info.link_speed == + I40E_LINK_SPEED_100MB)) + device_printf(dev, "The partition detected" + "link speed that is less than 10Gbps\n"); if_link_state_change(ifp, LINK_STATE_UP); } } else { /* Link down */ @@ -1805,7 +1858,10 @@ ixl_stop(struct ixl_pf *pf) mtx_assert(&pf->pf_mtx, MA_OWNED); INIT_DEBUGOUT("ixl_stop: begin\n"); - ixl_disable_intr(vsi); + if (pf->num_vfs == 0) + ixl_disable_intr(vsi); + else + ixl_disable_rings_intr(vsi); ixl_disable_rings(vsi); /* Tell the stack that the interface is no longer active */ @@ -1858,6 +1914,11 @@ ixl_assign_vsi_legacy(struct ixl_pf *pf) taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", device_get_nameunit(dev)); TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); + +#ifdef PCI_IOV + TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); +#endif + pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, taskqueue_thread_enqueue, &pf->tq); taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", @@ -1906,6 +1967,11 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) pf->admvec = vector; /* Tasklet for Admin Queue */ TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); + +#ifdef PCI_IOV + TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); +#endif + pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, taskqueue_thread_enqueue, &pf->tq); taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", @@ -2330,6 +2396,10 @@ ixl_add_ifmedia(struct ixl_vsi *vsi, u32 if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_T)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_SX)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_SX, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_LX)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_LX, 0, NULL); if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || phy_type & (1 << I40E_PHY_TYPE_10GBASE_KX4) || @@ -2470,17 +2540,32 @@ ixl_setup_interface(device_t dev, struct return (0); } -static bool -ixl_config_link(struct i40e_hw *hw) +/* +** Run when the Admin Queue gets a +** link transition interrupt. +*/ +static void +ixl_link_event(struct ixl_pf *pf, struct i40e_arq_event_info *e) { + struct i40e_hw *hw = &pf->hw; + struct i40e_aqc_get_link_status *status = + (struct i40e_aqc_get_link_status *)&e->desc.params.raw; bool check; - i40e_aq_get_link_info(hw, TRUE, NULL, NULL); + hw->phy.get_link_info = TRUE; check = i40e_get_link_status(hw); + pf->link_up = check; #ifdef IXL_DEBUG printf("Link is %s\n", check ? "up":"down"); #endif - return (check); + /* Report if Unqualified modules are found */ + if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) && + (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) && + (!(status->link_info & I40E_AQ_LINK_UP))) + device_printf(pf->dev, "Link failed because " + "an unqualified module was detected\n"); + + return; } /********************************************************************* @@ -2498,7 +2583,7 @@ ixl_switch_config(struct ixl_pf *pf) device_t dev = vsi->dev; struct i40e_aqc_get_switch_config_resp *sw_config; u8 aq_buf[I40E_AQ_LARGE_BUF]; - int ret = I40E_SUCCESS; + int ret; u16 next = 0; memset(&aq_buf, 0, sizeof(aq_buf)); @@ -2506,19 +2591,26 @@ ixl_switch_config(struct ixl_pf *pf) ret = i40e_aq_get_switch_config(hw, sw_config, sizeof(aq_buf), &next, NULL); if (ret) { - device_printf(dev,"aq_get_switch_config failed!!\n"); + device_printf(dev,"aq_get_switch_config failed (ret=%d)!!\n", + ret); return (ret); } #ifdef IXL_DEBUG - printf("Switch config: header reported: %d in structure, %d total\n", + device_printf(dev, + "Switch config: header reported: %d in structure, %d total\n", sw_config->header.num_reported, sw_config->header.num_total); - printf("type=%d seid=%d uplink=%d downlink=%d\n", - sw_config->element[0].element_type, - sw_config->element[0].seid, - sw_config->element[0].uplink_seid, - sw_config->element[0].downlink_seid); + for (int i = 0; i < sw_config->header.num_reported; i++) { + device_printf(dev, + "%d: type=%d seid=%d uplink=%d downlink=%d\n", i, + sw_config->element[i].element_type, + sw_config->element[i].seid, + sw_config->element[i].uplink_seid, + sw_config->element[i].downlink_seid); + } #endif /* Simplified due to a single VSI at the moment */ + vsi->uplink_seid = sw_config->element[0].uplink_seid; + vsi->downlink_seid = sw_config->element[0].downlink_seid; vsi->seid = sw_config->element[0].seid; return (ret); } @@ -2533,6 +2625,7 @@ ixl_switch_config(struct ixl_pf *pf) static int ixl_initialize_vsi(struct ixl_vsi *vsi) { + struct ixl_pf *pf = vsi->back; struct ixl_queue *que = vsi->queues; device_t dev = vsi->dev; struct i40e_hw *hw = vsi->hw; @@ -2541,6 +2634,8 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) memset(&ctxt, 0, sizeof(ctxt)); ctxt.seid = vsi->seid; + if (pf->veb_seid != 0) + ctxt.uplink_seid = pf->veb_seid; ctxt.pf_num = hw->pf_id; err = i40e_aq_get_vsi_params(hw, &ctxt, NULL); if (err) { @@ -2582,6 +2677,8 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) vsi->hw_filters_add = 0; vsi->hw_filters_del = 0; + ctxt.flags = htole16(I40E_AQ_VSI_TYPE_PF); + err = i40e_aq_update_vsi_params(hw, &ctxt, NULL); if (err) { device_printf(dev,"update vsi params failed %x!!\n", @@ -2602,7 +2699,7 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) size = que->num_desc * sizeof(struct i40e_tx_desc); memset(&tctx, 0, sizeof(struct i40e_hmc_obj_txq)); tctx.new_context = 1; - tctx.base = (txr->dma.pa/128); + tctx.base = (txr->dma.pa/IXL_TX_CTX_BASE_UNITS); tctx.qlen = que->num_desc; tctx.fc_ena = 0; tctx.rdylist = vsi->info.qs_handle[0]; /* index is TC */ @@ -2632,7 +2729,7 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) ixl_init_tx_ring(que); /* Next setup the HMC RX Context */ - if (vsi->max_frame_size <= 2048) + if (vsi->max_frame_size <= MCLBYTES) rxr->mbuf_sz = MCLBYTES; else rxr->mbuf_sz = MJUMPAGESIZE; @@ -2649,7 +2746,7 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) rctx.dtype = 0; rctx.dsize = 1; /* do 32byte descriptors */ rctx.hsplit_0 = 0; /* no HDR split initially */ - rctx.base = (rxr->dma.pa/128); + rctx.base = (rxr->dma.pa/IXL_RX_CTX_BASE_UNITS); rctx.qlen = que->num_desc; rctx.tphrdesc_ena = 1; rctx.tphwdesc_ena = 1; @@ -2679,15 +2776,6 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) break; } wr32(vsi->hw, I40E_QRX_TAIL(que->me), 0); -#ifdef DEV_NETMAP - /* preserve queue */ - if (vsi->ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(vsi->ifp); - 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 -#endif /* DEV_NETMAP */ wr32(vsi->hw, I40E_QRX_TAIL(que->me), que->num_desc - 1); } return (err); @@ -2704,7 +2792,6 @@ ixl_free_vsi(struct ixl_vsi *vsi) { struct ixl_pf *pf = (struct ixl_pf *)vsi->back; struct ixl_queue *que = vsi->queues; - struct ixl_mac_filter *f; /* Free station queues */ for (int i = 0; i < vsi->num_queues; i++, que++) { @@ -2733,6 +2820,14 @@ ixl_free_vsi(struct ixl_vsi *vsi) free(vsi->queues, M_DEVBUF); /* Free VSI filter list */ + ixl_free_mac_filters(vsi); +} + +static void +ixl_free_mac_filters(struct ixl_vsi *vsi) +{ + struct ixl_mac_filter *f; + while (!SLIST_EMPTY(&vsi->ftl)) { f = SLIST_FIRST(&vsi->ftl); SLIST_REMOVE_HEAD(&vsi->ftl, next); @@ -2764,6 +2859,7 @@ ixl_setup_stations(struct ixl_pf *pf) vsi->hw = &pf->hw; vsi->id = 0; vsi->num_vlans = 0; + vsi->back = pf; /* Get memory for the station queues */ if (!(vsi->queues = @@ -3016,6 +3112,24 @@ ixl_set_queue_tx_itr(struct ixl_queue *q return; } +#define QUEUE_NAME_LEN 32 + +static void +ixl_add_vsi_sysctls(struct ixl_pf *pf, struct ixl_vsi *vsi, + struct sysctl_ctx_list *ctx, const char *sysctl_name) +{ + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + struct sysctl_oid_list *vsi_list; + + tree = device_get_sysctl_tree(pf->dev); + child = SYSCTL_CHILDREN(tree); + vsi->vsi_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, sysctl_name, + CTLFLAG_RD, NULL, "VSI Number"); + vsi_list = SYSCTL_CHILDREN(vsi->vsi_node); + + ixl_add_sysctls_eth_stats(ctx, vsi_list, &vsi->eth_stats); +} static void ixl_add_hw_stats(struct ixl_pf *pf) @@ -3023,18 +3137,19 @@ ixl_add_hw_stats(struct ixl_pf *pf) device_t dev = pf->dev; struct ixl_vsi *vsi = &pf->vsi; struct ixl_queue *queues = vsi->queues; - struct i40e_eth_stats *vsi_stats = &vsi->eth_stats; struct i40e_hw_port_stats *pf_stats = &pf->stats; struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); struct sysctl_oid *tree = device_get_sysctl_tree(dev); struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + struct sysctl_oid_list *vsi_list; - struct sysctl_oid *vsi_node, *queue_node; - struct sysctl_oid_list *vsi_list, *queue_list; + struct sysctl_oid *queue_node; + struct sysctl_oid_list *queue_list; struct tx_ring *txr; struct rx_ring *rxr; + char queue_namebuf[QUEUE_NAME_LEN]; /* Driver statistics */ SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "watchdog_events", @@ -3044,23 +3159,18 @@ ixl_add_hw_stats(struct ixl_pf *pf) CTLFLAG_RD, &pf->admin_irq, "Admin Queue IRQ Handled"); - /* VSI statistics */ -#define QUEUE_NAME_LEN 32 - char queue_namebuf[QUEUE_NAME_LEN]; - - // ERJ: Only one vsi now, re-do when >1 VSI enabled - // snprintf(vsi_namebuf, QUEUE_NAME_LEN, "vsi%d", vsi->info.stat_counter_idx); - vsi_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "vsi", - CTLFLAG_RD, NULL, "VSI-specific stats"); - vsi_list = SYSCTL_CHILDREN(vsi_node); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "vc_debug_level", + CTLFLAG_RW, &pf->vc_debug_lvl, 0, + "PF/VF Virtual Channel debug logging level"); - ixl_add_sysctls_eth_stats(ctx, vsi_list, vsi_stats); + ixl_add_vsi_sysctls(pf, &pf->vsi, ctx, "pf"); + vsi_list = SYSCTL_CHILDREN(pf->vsi.vsi_node); /* Queue statistics */ for (int q = 0; q < vsi->num_queues; q++) { snprintf(queue_namebuf, QUEUE_NAME_LEN, "que%d", q); - queue_node = SYSCTL_ADD_NODE(ctx, vsi_list, OID_AUTO, queue_namebuf, - CTLFLAG_RD, NULL, "Queue #"); + queue_node = SYSCTL_ADD_NODE(ctx, vsi_list, + OID_AUTO, queue_namebuf, CTLFLAG_RD, NULL, "Queue #"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 19:35:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE86BA4F; Tue, 10 Mar 2015 19:35:43 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 880D5262; Tue, 10 Mar 2015 19:35:43 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 868EAD44C06; Wed, 11 Mar 2015 06:35:35 +1100 (AEDT) Date: Wed, 11 Mar 2015 06:35:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Steve Kargl Subject: Re: svn commit: r279856 - in head/lib/msun: man src In-Reply-To: <201503101710.t2AHAt0V028926@svn.freebsd.org> Message-ID: <20150311051030.D2799@besplex.bde.org> References: <201503101710.t2AHAt0V028926@svn.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.1 cv=A5NVYcmG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=rIhH0MG7AAAA:8 a=4hfdkrk-Y2P5PyrcqB4A:9 a=CjuIK1q_8ugA:10 a=JrpDYYiBHwwA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 19:35:44 -0000 On Tue, 10 Mar 2015, Steve Kargl wrote: > Log: > According to POSIX.1-2008, the Bessel functions of second kind > should raise a divide-by-zero floating point exception for x = +-0 > and an invalid floating point exception for x < 0 including x = -Inf. > Update the code to raise the exception and update the documentation > with hopefully better description of the behavior. > > Reviewed by: bde (code only) Er, the functions have always (since Ng wrote them in 1992 or earlier) raised the exceptions, except with broken compilers like clang. > Modified: head/lib/msun/src/e_j0.c > ============================================================================== > --- head/lib/msun/src/e_j0.c Tue Mar 10 17:04:11 2015 (r279855) > +++ head/lib/msun/src/e_j0.c Tue Mar 10 17:10:54 2015 (r279856) > @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); > > static double pzero(double), qzero(double); > > +static const volatile double vone = 1, vzero = 0; > + This volatile hack works around the compiler bug. > static const double > huge = 1e300, > one = 1.0, > @@ -150,10 +152,16 @@ __ieee754_y0(double x) > > EXTRACT_WORDS(hx,lx,x); > ix = 0x7fffffff&hx; > - /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */ > - if(ix>=0x7ff00000) return one/(x+x*x); > - if((ix|lx)==0) return -one/zero; -one/zero must be evaluated at compile time, since it generates the divide-by-zero exception if it is evaluated correctly. But clang evaluates it to -Inf at compile time and doesn't generate the exception. > - if(hx<0) return zero/zero; zero/zero must be evaluated at compile time, since it generates the invalid operand exception if it is evaluated correctly. But clang evaluates it to the default quiet NaN at compile time and doesn't generate the exception. > + /* > + * y0(NaN) = NaN. > + * y0(Inf) = 0. > + * y0(-Inf) = NaN and raise invalid exception. > + */ > + if(ix>=0x7ff00000) return vone/(x+x*x); > + /* y0(+-0) = -inf and raise divide-by-zero exception. */ > + if((ix|lx)==0) return -one/vzero; > + /* y0(x<0) = NaN and raise invalid exception. */ > + if(hx<0) return vzero/vzero; The volatile variables are a trick to prevent compile-time evaluation. My review said to not organize the comments like this. They are verbose yet only hint that the return expressions are more subtle than they appear to be. > if(ix >= 0x40000000) { /* |x| >= 2.0 */ > /* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0)) > * where x0 = x-pi/4 Volatile hacks are already used a lot to work around this compiler bug. Sometimes even gcc needs them. This is a bug in clang because although translation-time evaluation is permitted unless the state of the FENV_ACCESS pragma is "on", clang doesn't support this pragma and its behaviour is fail-unsafe and the opposite of gcc's. gcc also doesn't support this pragma, but it does document its non-support. Implementations are required to document the default state of this pragma, but clang has almost null installed documentation. I have to look at the gcc documentation to see what arcane flags or pragmas like this do or should do. gcc48.info says: X '-frounding-math' X Disable transformations and optimizations that assume default X floating-point rounding behavior. This is round-to-zero for all X floating point to integer conversions, and round-to-nearest for all X other arithmetic truncations. This option should be specified for X programs that change the FP rounding mode dynamically, or that may X be executed with a non-default rounding mode. This option disables X constant folding of floating-point expressions at compile time X (which may be affected by rounding mode) and arithmetic X transformations that are unsafe in the presence of sign-dependent X rounding modes. X X The default is '-fno-rounding-math'. X X This option is experimental and does not currently guarantee to X disable all GCC optimizations that are affected by rounding mode. X Future versions of GCC may provide finer control of this setting X using C99's 'FENV_ACCESS' pragma. This command-line option will be X used to specify the default state for 'FENV_ACCESS'. X ... X * 'The default state for the 'FENV_ACCESS' pragma (C99 7.6.1).' X X This pragma is not implemented, but the default is to "off" unless X '-frounding-math' is used in which case it is "on". Note that this is mostly about rounding. With FENV_ACCESS on, even 1.0/3.0 cannot be evaluated at compile time. Not evaluating this at compile time would usually just be inefficient. So gcc defaults to FENV_ACCESS off. But gcc still doesn't evaluate at compile time expressions like 1.0/0.0 and 0.0/0.0 that would generate significant exeptions, even if you write these expressions with literal constants. -frounding-math works as advertised in gcc-4.2 and gcc-4.8. It causes the full inefficiencies, with 1.0/3.0 evaluated at run time with it but not without it, while 1.0/0.0 and 0.0/0.0 are evaluated at run time unconditionally. It acts sort of as if it turns FENV_ACCESS on. However, FENV_ACCESS itself is still broken -- it is silently ignored. -frounding-math is not supported in gcc-3.3.3. It is broken (doesn't give runtime evaluation of 1.0/0.0) in gcc-3.3.4. It is broken (unsupported = incompatible) in clang. FENV_ACCESS is broken (silently ignored) in clang. msun is being sloppy by using magic expressions to generate exceptions. It should sprinkle FENV_ACCESS as required. However, FENV_ACCESS requires a C99 compiler, and no C99 compilers are available. So msun has to use some unportable hacks. The ones that worked 20-30 years ago are at least short. Some of the other expessions that should cause exceptions are: (double) (1e300 * 1e300) This remains working in gcc and broken (no overflow exception) in clang. msun actually mostly uses 'return 1e300*1e300'. This causes different (worse) problems with gcc on i386. The expression is evaluated in extra precision/exponent range) and the extras are returned (except C11 breaks this). Then if the caller stores the result 1e600L to a double, an overflow exception occurs after all, but if the caller uses the extra precision then the garbage value 1e600L is used. (double) (1e-300 * 1e-300) This remains broken (no underflow exception) in both gcc and clang. This brokenness goes back to at least gcc-2.95. msun uses lots of volatile hacks to generate overflow and underflow, but it doesn't do this systematically so many of the less important functions remain unfixed. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 19:39:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9828DD87 for ; Tue, 10 Mar 2015 19:39:51 +0000 (UTC) Received: from nm20-vm6.bullet.mail.gq1.yahoo.com (nm20-vm6.bullet.mail.gq1.yahoo.com [98.136.217.37]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 601D22B1 for ; Tue, 10 Mar 2015 19:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1426016013; bh=4fVgvH59rcAbfTTOTaf1eOb+PZhRRVxukU3ITWx8PsI=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=U35Kmqg884SbvaBcXP5cWrE/v/BzPIy4GMejy8tZNlvds3kycLFnI+ev7kzXgz7RphalcJUmnjnvJEPZ4mli+Y7HXU+xVtjZWFwxSrGG0IeGqKvEPFC44PmNgDXZZFjwSr7GGt49FxTmVsu72nBroU1tXQw068zlw9pd1Ibek9IlzOmQrSGcy2U3p9KRiB4tnHgmz9bplh6ZGi1nP52kBVMM6BymDyDYQXMLBL6xAKU2v9ofnJW1A/oIq8v6RGlPNI7b9aOcZf05BJVpBJfZszeWi+0BqE5rSjEXrXPicmOx9LyiqtqvG3Pr3XB2Su3xt6IiFndkF6B4R4OHXzKWFg== Received: from [98.137.12.59] by nm20.bullet.mail.gq1.yahoo.com with NNFMP; 10 Mar 2015 19:33:33 -0000 Received: from [98.136.164.74] by tm4.bullet.mail.gq1.yahoo.com with NNFMP; 10 Mar 2015 19:33:33 -0000 Received: from [127.0.0.1] by smtp236.mail.gq1.yahoo.com with NNFMP; 10 Mar 2015 19:33:33 -0000 X-Yahoo-Newman-Id: 332378.81152.bm@smtp236.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: a4C4dpAVM1l3AYWWx5s5LI0KNDItxaQMcLVEDn17KU0Nu_0 q92HWC8o2aOE6e3SLL91sP5qSZ_ooG9D2Ogf4Fcn2H1P54MQPzZPwOOSmIIF Rm9Bh8ewYM0X2crKNuTSONm1nqpwOiaBPXce5so2Q74Eq1GKzaYJUvEYR_JE i7HOgU6sJ1hs7HJE.oCiSNusJGqqudl18SVJaC7aty7_bLAfub2Tx3wsqSAl 4_r_msEo3xXxRhupbogHX9Ojoru_LoEFBONjvLQiNbmG0uul4F9WeWTqvPyC 538xJO7CGAqCzHZXpm3b9ggQSk1qStZ8JQL0zGuWLr0I6ZPPtcipEpljgK5V 4nQdA_b9d0HfUD8c.Ua5IlUgNVrcVXLKcCog3rQc2AyvjyRQvxohCgcey0M0 Waq6RLsrLSE2mx7mRf.uqcGbK04p5ZfqOxVDHQwtk_wlbEk.EsqN2prVKoeY jF4iwsYOPPz7cJCpalLU8xqvne2VDxLArNq8TymZ.jmA5hoU8HWiJGfXgT1V VgPZKSg3ovqTQfF.Fi91Qfv.pXLXlv9CsAxY0BmaB X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r279828 - head/sys/dev/cadence From: Scott Long In-Reply-To: <201503092239.t29MdxUo089384@svn.freebsd.org> Date: Tue, 10 Mar 2015 13:33:29 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <9F60FF00-B6B4-4197-993A-9848F1C3A923@yahoo.com> References: <201503092239.t29MdxUo089384@svn.freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 19:39:51 -0000 > On Mar 9, 2015, at 4:39 PM, Ian Lepore wrote: >=20 > Author: ian > Date: Mon Mar 9 22:39:58 2015 > New Revision: 279828 > URL: https://svnweb.freebsd.org/changeset/base/279828 >=20 > Log: > Use the new ifnet API. Also, allocate bus_dma_maps as needed instead = of > pre-allocating them all at start-up. Also fix a bug in cgem_stop(); = before, > it wasn't properly unloading dma maps due to a cut-and-paste error. >=20 It=E2=80=99s generally a very bad idea to create and destroy maps for = every transaction. If the map results in being non-NULL, then you=E2=80=99re allocating and freeing = memory on every transaction, and possibly allocating and freeing large chunks of memory for bounce = buffers. Is there a reason why you=E2=80=99ve made this change? Thanks, Scott From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 19:49:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F145101; Tue, 10 Mar 2015 19:49:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 294E43E2; Tue, 10 Mar 2015 19:49:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AJnTGn006032; Tue, 10 Mar 2015 19:49:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AJnQL7006018; Tue, 10 Mar 2015 19:49:26 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503101949.t2AJnQL7006018@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 10 Mar 2015 19:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279859 - in head: lib/libc/net sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 19:49:29 -0000 Author: tuexen Date: Tue Mar 10 19:49:25 2015 New Revision: 279859 URL: https://svnweb.freebsd.org/changeset/base/279859 Log: Add a SCTP socket option to limit the cwnd for each path. MFC after: 1 month Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp.h head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Tue Mar 10 19:17:40 2015 (r279858) +++ head/lib/libc/net/sctp_sys_calls.c Tue Mar 10 19:49:25 2015 (r279859) @@ -383,6 +383,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_PR_ASSOC_STATUS: ((struct sctp_prstatus *)arg)->sprstat_assoc_id = id; break; + case SCTP_MAX_CWND: + ((struct sctp_assoc_value *)arg)->assoc_id = id; + break; default: break; } Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Tue Mar 10 19:17:40 2015 (r279858) +++ head/sys/netinet/sctp.h Tue Mar 10 19:49:25 2015 (r279859) @@ -128,6 +128,7 @@ struct sctp_paramhdr { #define SCTP_RECONFIG_SUPPORTED 0x00000029 #define SCTP_NRSACK_SUPPORTED 0x00000030 #define SCTP_PKTDROP_SUPPORTED 0x00000031 +#define SCTP_MAX_CWND 0x00000032 /* * read-only options Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Tue Mar 10 19:17:40 2015 (r279858) +++ head/sys/netinet/sctp_cc_functions.c Tue Mar 10 19:49:25 2015 (r279859) @@ -53,6 +53,19 @@ __FBSDID("$FreeBSD$"); #define SHIFT_MPTCP_MULTI 8 static void +sctp_enforce_cwnd_limit(struct sctp_association *assoc, struct sctp_nets *net) +{ + if ((assoc->max_cwnd > 0) && + (net->cwnd > assoc->max_cwnd) && + (net->cwnd > (net->mtu - sizeof(struct sctphdr)))) { + net->cwnd = assoc->max_cwnd; + if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { + net->cwnd = net->mtu - sizeof(struct sctphdr); + } + } +} + +static void sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) { struct sctp_association *assoc; @@ -80,6 +93,7 @@ sctp_set_initial_cc_param(struct sctp_tc net->cwnd = net->mtu - sizeof(struct sctphdr); } } + sctp_enforce_cwnd_limit(assoc, net); net->ssthresh = assoc->peers_rwnd; SDT_PROBE(sctp, cwnd, net, init, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, @@ -178,6 +192,7 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } net->cwnd = net->ssthresh; + sctp_enforce_cwnd_limit(asoc, net); SDT_PROBE(sctp, cwnd, net, fr, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, old_cwnd, net->cwnd); @@ -426,6 +441,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st if ((net->cc_mod.rtcc.vol_reduce) && (inst_ind != SCTP_INST_GAINING)) { net->cwnd += net->mtu; + sctp_enforce_cwnd_limit(&stcb->asoc, net); net->cc_mod.rtcc.vol_reduce--; } net->cc_mod.rtcc.last_step_state = 2; @@ -457,6 +473,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st if ((net->cc_mod.rtcc.vol_reduce) && (inst_ind != SCTP_INST_GAINING)) { net->cwnd += net->mtu; + sctp_enforce_cwnd_limit(&stcb->asoc, net); net->cc_mod.rtcc.vol_reduce--; } net->cc_mod.rtcc.last_step_state = 3; @@ -488,6 +505,7 @@ cc_bw_decrease(struct sctp_tcb *stcb, st if ((net->cc_mod.rtcc.vol_reduce) && (inst_ind != SCTP_INST_GAINING)) { net->cwnd += net->mtu; + sctp_enforce_cwnd_limit(&stcb->asoc, net); net->cc_mod.rtcc.vol_reduce--; } net->cc_mod.rtcc.last_step_state = 4; @@ -882,6 +900,7 @@ sctp_cwnd_update_after_sack_common(struc break; } net->cwnd += incr; + sctp_enforce_cwnd_limit(asoc, net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, incr, SCTP_CWND_LOG_FROM_SS); @@ -948,6 +967,7 @@ sctp_cwnd_update_after_sack_common(struc break; } net->cwnd += incr; + sctp_enforce_cwnd_limit(asoc, net); SDT_PROBE(sctp, cwnd, net, ack, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), @@ -1227,6 +1247,7 @@ sctp_cwnd_update_after_packet_dropped(st /* We always have 1 MTU */ net->cwnd = net->mtu; } + sctp_enforce_cwnd_limit(&stcb->asoc, net); if (net->cwnd - old_cwnd != 0) { /* log only changes */ SDT_PROBE(sctp, cwnd, net, pd, @@ -1251,6 +1272,7 @@ sctp_cwnd_update_after_output(struct sct net->ssthresh = net->cwnd; if (burst_limit) { net->cwnd = (net->flight_size + (burst_limit * net->mtu)); + sctp_enforce_cwnd_limit(&stcb->asoc, net); SDT_PROBE(sctp, cwnd, net, bl, stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), @@ -1589,6 +1611,7 @@ static void sctp_hs_cwnd_increase(struct sctp_tcb *stcb, struct sctp_nets *net) { int cur_val, i, indx, incr; + int old_cwnd = net->cwnd; cur_val = net->cwnd >> 10; indx = SCTP_HS_TABLE_SIZE - 1; @@ -1597,14 +1620,8 @@ sctp_hs_cwnd_increase(struct sctp_tcb *s /* normal mode */ if (net->net_ack > net->mtu) { net->cwnd += net->mtu; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_SS); - } } else { net->cwnd += net->net_ack; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, net->net_ack, SCTP_CWND_LOG_FROM_SS); - } } } else { for (i = net->last_hs_used; i < SCTP_HS_TABLE_SIZE; i++) { @@ -1616,9 +1633,10 @@ sctp_hs_cwnd_increase(struct sctp_tcb *s net->last_hs_used = indx; incr = ((sctp_cwnd_adjust[indx].increase) << 10); net->cwnd += incr; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, incr, SCTP_CWND_LOG_FROM_SS); - } + } + sctp_enforce_cwnd_limit(&stcb->asoc, net); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SS); } } @@ -1657,6 +1675,7 @@ sctp_hs_cwnd_decrease(struct sctp_tcb *s net->last_hs_used = indx; } } + sctp_enforce_cwnd_limit(&stcb->asoc, net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_FR); } @@ -1788,9 +1807,7 @@ sctp_hs_cwnd_update_after_sack(struct sc if (net->cwnd <= net->ssthresh) { /* We are in slow start */ if (net->flight_size + net->net_ack >= net->cwnd) { - sctp_hs_cwnd_increase(stcb, net); - } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, net->net_ack, @@ -1804,6 +1821,7 @@ sctp_hs_cwnd_update_after_sack(struct sc (net->partial_bytes_acked >= net->cwnd)) { net->partial_bytes_acked -= net->cwnd; net->cwnd += net->mtu; + sctp_enforce_cwnd_limit(asoc, net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_CA); @@ -2042,6 +2060,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s SCTP_CWND_LOG_FROM_SS); } } + sctp_enforce_cwnd_limit(&stcb->asoc, net); } else { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, net->net_ack, @@ -2063,6 +2082,7 @@ htcp_cong_avoid(struct sctp_tcb *stcb, s */ net->cwnd += net->mtu; net->partial_bytes_acked = 0; + sctp_enforce_cwnd_limit(&stcb->asoc, net); htcp_alpha_update(&net->cc_mod.htcp_ca); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->mtu, @@ -2109,6 +2129,7 @@ sctp_htcp_set_initial_cc_param(struct sc */ net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); net->ssthresh = stcb->asoc.peers_rwnd; + sctp_enforce_cwnd_limit(&stcb->asoc, net); htcp_init(net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { @@ -2212,6 +2233,7 @@ sctp_htcp_cwnd_update_after_fr(struct sc htcp_reset(&net->cc_mod.htcp_ca); net->ssthresh = htcp_recalc_ssthresh(net); net->cwnd = net->ssthresh; + sctp_enforce_cwnd_limit(asoc, net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_FR); @@ -2291,6 +2313,7 @@ sctp_htcp_cwnd_update_after_ecn_echo(str net->RTO <<= 1; } net->cwnd = net->ssthresh; + sctp_enforce_cwnd_limit(&stcb->asoc, net); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); } Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Mar 10 19:17:40 2015 (r279858) +++ head/sys/netinet/sctp_input.c Tue Mar 10 19:49:25 2015 (r279859) @@ -2763,6 +2763,7 @@ sctp_handle_cookie_echo(struct mbuf *m, inp->sctp_mobility_features = (*inp_p)->sctp_mobility_features; inp->sctp_socket = so; inp->sctp_frag_point = (*inp_p)->sctp_frag_point; + inp->max_cwnd = (*inp_p)->max_cwnd; inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off; inp->ecn_supported = (*inp_p)->ecn_supported; inp->prsctp_supported = (*inp_p)->prsctp_supported; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Mar 10 19:17:40 2015 (r279858) +++ head/sys/netinet/sctp_pcb.c Tue Mar 10 19:49:25 2015 (r279859) @@ -2474,6 +2474,7 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_associd_counter = 1; inp->partial_delivery_point = SCTP_SB_LIMIT_RCV(so) >> SCTP_PARTIAL_DELIVERY_SHIFT; inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT; + inp->max_cwnd = 0; inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off); inp->ecn_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_ecn_enable); inp->prsctp_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pr_enable); Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Tue Mar 10 19:17:40 2015 (r279858) +++ head/sys/netinet/sctp_pcb.h Tue Mar 10 19:49:25 2015 (r279859) @@ -404,6 +404,7 @@ struct sctp_inpcb { uint32_t sctp_frag_point; uint32_t partial_delivery_point; uint32_t sctp_context; + uint32_t max_cwnd; uint8_t local_strreset_support; uint32_t sctp_cmt_on_off; uint8_t ecn_supported; Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Tue Mar 10 19:17:40 2015 (r279858) +++ head/sys/netinet/sctp_peeloff.c Tue Mar 10 19:49:25 2015 (r279859) @@ -127,6 +127,7 @@ sctp_do_peeloff(struct socket *head, str n_inp->pktdrop_supported = inp->pktdrop_supported; n_inp->partial_delivery_point = inp->partial_delivery_point; n_inp->sctp_context = inp->sctp_context; + n_inp->max_cwnd = inp->max_cwnd; n_inp->local_strreset_support = inp->local_strreset_support; n_inp->inp_starting_point_for_iterator = NULL; /* copy in the authentication parameters from the original endpoint */ Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Tue Mar 10 19:17:40 2015 (r279858) +++ head/sys/netinet/sctp_structs.h Tue Mar 10 19:49:25 2015 (r279859) @@ -1199,6 +1199,7 @@ struct sctp_association { uint8_t sctp_cmt_pf; uint8_t use_precise_time; uint64_t sctp_features; + uint32_t max_cwnd; uint16_t port; /* remote UDP encapsulation port */ /* * The mapping array is used to track out of order sequences above Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Mar 10 19:17:40 2015 (r279858) +++ head/sys/netinet/sctp_usrreq.c Tue Mar 10 19:49:25 2015 (r279859) @@ -3694,6 +3694,33 @@ flags_out: } break; } + case SCTP_MAX_CWND: + { + struct sctp_assoc_value *av; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + av->assoc_value = stcb->asoc.max_cwnd; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_RLOCK(inp); + av->assoc_value = inp->max_cwnd; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_assoc_value); + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; @@ -6572,6 +6599,42 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_MAX_CWND: + { + struct sctp_assoc_value *av; + struct sctp_nets *net; + + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); + + if (stcb) { + stcb->asoc.max_cwnd = av->assoc_value; + if (stcb->asoc.max_cwnd > 0) { + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + if ((net->cwnd > stcb->asoc.max_cwnd) && + (net->cwnd > (net->mtu - sizeof(struct sctphdr)))) { + net->cwnd = stcb->asoc.max_cwnd; + if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { + net->cwnd = net->mtu - sizeof(struct sctphdr); + } + } + } + } + SCTP_TCB_UNLOCK(stcb); + } else { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || + (av->assoc_id == SCTP_FUTURE_ASSOC)) { + SCTP_INP_WLOCK(inp); + inp->max_cwnd = av->assoc_value; + SCTP_INP_WUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Mar 10 19:17:40 2015 (r279858) +++ head/sys/netinet/sctputil.c Tue Mar 10 19:49:25 2015 (r279859) @@ -936,6 +936,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, s asoc->sctp_frag_point = inp->sctp_frag_point; asoc->sctp_features = inp->sctp_features; asoc->default_dscp = inp->sctp_ep.default_dscp; + asoc->max_cwnd = inp->max_cwnd; #ifdef INET6 if (inp->sctp_ep.default_flowlabel) { asoc->default_flowlabel = inp->sctp_ep.default_flowlabel; From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 19:55:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42F342D7; Tue, 10 Mar 2015 19:55:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 2435F685; Tue, 10 Mar 2015 19:55:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AJticZ010311; Tue, 10 Mar 2015 19:55:44 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AJtito010309; Tue, 10 Mar 2015 19:55:44 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201503101955.t2AJtito010309@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Tue, 10 Mar 2015 19:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279860 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 19:55:45 -0000 Author: jfv Date: Tue Mar 10 19:55:43 2015 New Revision: 279860 URL: https://svnweb.freebsd.org/changeset/base/279860 Log: Replace the DEV_NETMAP code that accidentally got removed in the last commit. MFC after: 1 week Modified: head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Tue Mar 10 19:49:25 2015 (r279859) +++ head/sys/dev/ixl/if_ixl.c Tue Mar 10 19:55:43 2015 (r279860) @@ -239,6 +239,11 @@ DRIVER_MODULE(ixl, pci, ixl_driver, ixl_ MODULE_DEPEND(ixl, pci, 1, 1, 1); MODULE_DEPEND(ixl, ether, 1, 1, 1); +#ifdef DEV_NETMAP +MODULE_DEPEND(ixl, netmap, 1, 1, 1); +#endif /* DEV_NETMAP */ + + /* ** Global reset mutex */ @@ -312,6 +317,10 @@ int ixl_atr_rate = 20; TUNABLE_INT("hw.ixl.atr_rate", &ixl_atr_rate); #endif +#ifdef DEV_NETMAP +#define NETMAP_IXL_MAIN /* only bring in one part of the netmap code */ +#include +#endif /* DEV_NETMAP */ static char *ixl_fc_string[6] = { "None", @@ -690,6 +699,10 @@ ixl_attach(device_t dev) } #endif +#ifdef DEV_NETMAP + ixl_netmap_attach(vsi); +#endif /* DEV_NETMAP */ + INIT_DEBUGOUT("ixl_attach: end"); return (0); @@ -779,6 +792,9 @@ ixl_detach(device_t dev) EVENTHANDLER_DEREGISTER(vlan_unconfig, vsi->vlan_detach); callout_drain(&pf->timer); +#ifdef DEV_NETMAP + netmap_detach(vsi->ifp); +#endif /* DEV_NETMAP */ ixl_free_pci_resources(pf); bus_generic_detach(dev); if_free(vsi->ifp); @@ -2776,6 +2792,15 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) break; } wr32(vsi->hw, I40E_QRX_TAIL(que->me), 0); +#ifdef DEV_NETMAP + /* preserve queue */ + if (vsi->ifp->if_capenable & IFCAP_NETMAP) { + struct netmap_adapter *na = NA(vsi->ifp); + 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 +#endif /* DEV_NETMAP */ wr32(vsi->hw, I40E_QRX_TAIL(que->me), que->num_desc - 1); } return (err); Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Tue Mar 10 19:49:25 2015 (r279859) +++ head/sys/dev/ixl/ixl_txrx.c Tue Mar 10 19:55:43 2015 (r279860) @@ -62,6 +62,9 @@ static __inline void ixl_rx_discard(stru static __inline void ixl_rx_input(struct rx_ring *, struct ifnet *, struct mbuf *, u8); +#ifdef DEV_NETMAP +#include +#endif /* DEV_NETMAP */ /* ** Multiqueue Transmit driver @@ -484,12 +487,23 @@ fail: void ixl_init_tx_ring(struct ixl_queue *que) { +#ifdef DEV_NETMAP + struct netmap_adapter *na = NA(que->vsi->ifp); + struct netmap_slot *slot; +#endif /* DEV_NETMAP */ struct tx_ring *txr = &que->txr; struct ixl_tx_buf *buf; /* Clear the old ring contents */ IXL_TX_LOCK(txr); +#ifdef DEV_NETMAP + /* + * (under lock): if in netmap mode, do some consistency + * checks and set slot to entry 0 of the netmap ring. + */ + slot = netmap_reset(na, NR_TX, que->me, 0); +#endif /* DEV_NETMAP */ bzero((void *)txr->base, (sizeof(struct i40e_tx_desc)) * que->num_desc); @@ -514,6 +528,19 @@ ixl_init_tx_ring(struct ixl_queue *que) m_freem(buf->m_head); buf->m_head = NULL; } +#ifdef DEV_NETMAP + /* + * In netmap mode, set the map for the packet buffer. + * NOTE: Some drivers (not this one) also need to set + * the physical buffer address in the NIC ring. + * netmap_idx_n2k() maps a nic index, i, into the corresponding + * netmap slot index, si + */ + if (slot) { + 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 */ /* Clear the EOP index */ buf->eop_index = -1; } @@ -825,6 +852,11 @@ ixl_txeof(struct ixl_queue *que) mtx_assert(&txr->mtx, MA_OWNED); +#ifdef DEV_NETMAP + // XXX todo: implement moderation + if (netmap_tx_irq(que->vsi->ifp, que->me)) + return FALSE; +#endif /* DEF_NETMAP */ /* These are not the descriptors you seek, move along :) */ if (txr->avail == que->num_desc) { @@ -1126,8 +1158,16 @@ ixl_init_rx_ring(struct ixl_queue *que) struct ixl_rx_buf *buf; bus_dma_segment_t pseg[1], hseg[1]; int rsize, nsegs, error = 0; +#ifdef DEV_NETMAP + struct netmap_adapter *na = NA(que->vsi->ifp); + struct netmap_slot *slot; +#endif /* DEV_NETMAP */ IXL_RX_LOCK(rxr); +#ifdef DEV_NETMAP + /* same as in ixl_init_tx_ring() */ + slot = netmap_reset(na, NR_RX, que->me, 0); +#endif /* DEV_NETMAP */ /* Clear the ring contents */ rsize = roundup2(que->num_desc * sizeof(union i40e_rx_desc), DBA_ALIGN); @@ -1161,7 +1201,27 @@ ixl_init_rx_ring(struct ixl_queue *que) struct mbuf *mh, *mp; buf = &rxr->buffers[j]; - +#ifdef DEV_NETMAP + /* + * In netmap mode, fill the map and set the buffer + * address in the NIC ring, considering the offset + * between the netmap and NIC rings (see comment in + * ixgbe_setup_transmit_ring() ). No need to allocate + * an mbuf, so end the block with a continue; + */ + if (slot) { + int sj = netmap_idx_n2k(&na->rx_rings[que->me], j); + uint64_t paddr; + void *addr; + + addr = PNMB(na, slot + sj, &paddr); + netmap_load_map(na, rxr->dma.tag, buf->pmap, addr); + /* Update descriptor and the cached value */ + rxr->base[j].read.pkt_addr = htole64(paddr); + rxr->base[j].read.hdr_addr = 0; + continue; + } +#endif /* DEV_NETMAP */ /* ** Don't allocate mbufs if not ** doing header split, its wasteful @@ -1461,6 +1521,12 @@ ixl_rxeof(struct ixl_queue *que, int cou IXL_RX_LOCK(rxr); +#ifdef DEV_NETMAP + if (netmap_rx_irq(ifp, que->me, &count)) { + IXL_RX_UNLOCK(rxr); + return (FALSE); + } +#endif /* DEV_NETMAP */ for (i = rxr->next_check; count != 0;) { struct mbuf *sendmp, *mh, *mp; From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 20:22:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0817F95F; Tue, 10 Mar 2015 20:22:36 +0000 (UTC) Received: from relay.mailchannels.net (tkt-001-i374.relay.mailchannels.net [174.136.5.177]) by mx1.freebsd.org (Postfix) with ESMTP id B94C6A2C; Tue, 10 Mar 2015 20:22:34 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp7.ore.mailhop.org (ip-10-220-9-73.us-west-2.compute.internal [10.220.9.73]) by relay.mailchannels.net (Postfix) with ESMTPA id 127C642B9; Tue, 10 Mar 2015 20:06:20 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp7.ore.mailhop.org (smtp7.ore.mailhop.org [10.45.8.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Tue, 10 Mar 2015 20:06:21 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1426017981194:1682275550 X-MC-Ingress-Time: 1426017981194 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp7.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YVQPy-00079k-RH; Tue, 10 Mar 2015 20:06:18 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2AK6Ah8010137; Tue, 10 Mar 2015 14:06:10 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19Y9I+/zhtxBwsvplVl1sR3 Message-ID: <1426017970.33324.28.camel@freebsd.org> Subject: Re: svn commit: r279828 - head/sys/dev/cadence From: Ian Lepore To: Scott Long Date: Tue, 10 Mar 2015 14:06:10 -0600 In-Reply-To: <9F60FF00-B6B4-4197-993A-9848F1C3A923@yahoo.com> References: <201503092239.t29MdxUo089384@svn.freebsd.org> <9F60FF00-B6B4-4197-993A-9848F1C3A923@yahoo.com> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 X-AuthUser: hippie Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 20:22:36 -0000 On Tue, 2015-03-10 at 13:33 -0600, Scott Long wrote: > > On Mar 9, 2015, at 4:39 PM, Ian Lepore wrote: > >=20 > > Author: ian > > Date: Mon Mar 9 22:39:58 2015 > > New Revision: 279828 > > URL: https://svnweb.freebsd.org/changeset/base/279828 > >=20 > > Log: > > Use the new ifnet API. Also, allocate bus_dma_maps as needed instea= d of > > pre-allocating them all at start-up. Also fix a bug in cgem_stop();= before, > > it wasn't properly unloading dma maps due to a cut-and-paste error. > >=20 >=20 > It=A2s generally a very bad idea to create and destroy maps for every t= ransaction. If the map > results in being non-NULL, then you=A2re allocating and freeing memory = on every transaction, > and possibly allocating and freeing large chunks of memory for bounce b= uffers. Is there > a reason why you=A2ve made this change? Maps are always non-NULL on arm. Bounce pages are managed in pools and the initial minimum allocation happens when the first mapping is created, then extended as needed to keep a minimum of two bounce pages per map using that pool. Since mbufs never actually bounce on arm the pool just sits there at minimum allocation size, wasting a bit of memory but not costing any cycles on subsequent mappings, unless there are many maps created at once, in which case each new mapping created adds a couple more pages to the pool (which will still never get used). So creating 1024 maps all at once results in a bounce pool with 2048 pages in it, none of which will ever be used in the case of mbufs (because mbufs get to violate the rules about the buffer being aligned to a cacheline boundary, which is the primary cause of bouncing on arm). -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 20:43:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEEBADBF; Tue, 10 Mar 2015 20:43:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 D9A90C99; Tue, 10 Mar 2015 20:43:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AKhHSC034094; Tue, 10 Mar 2015 20:43:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AKhH9I034093; Tue, 10 Mar 2015 20:43:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201503102043.t2AKhH9I034093@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Mar 2015 20:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279861 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 20:43:18 -0000 Author: markj Date: Tue Mar 10 20:43:16 2015 New Revision: 279861 URL: https://svnweb.freebsd.org/changeset/base/279861 Log: MFV r279822: This merge is effectively a no-op since parts of it are already present in FreeBSD, and the rest is incorrect since gelf_newehdr(3) and gelf_newphdr(3) return pointers on FreeBSD rather than integers. Illumos issue: 5589 improper use of NULL in tools/ctf MFC after: 3 days Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Tue Mar 10 19:55:43 2015 (r279860) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Tue Mar 10 20:43:16 2015 (r279861) @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Routines for preparing tdata trees for conversion into CTF data, and * for placing the resulting data into an output file. From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 20:52:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B4771DA; Tue, 10 Mar 2015 20:52:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 46741DBF; Tue, 10 Mar 2015 20:52:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AKq40Y038833; Tue, 10 Mar 2015 20:52:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AKq4Gk038832; Tue, 10 Mar 2015 20:52:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201503102052.t2AKq4Gk038832@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Mar 2015 20:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279862 - head/cddl/contrib/opensolaris/common/ctf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 20:52:04 -0000 Author: markj Date: Tue Mar 10 20:52:03 2015 New Revision: 279862 URL: https://svnweb.freebsd.org/changeset/base/279862 Log: ctf_discard(): fetch the next list element before restarting the loop. If we end up skipping a dynamic type because it has already been committed to the container, we would previously either set the loop variable to an uninitialized local variable, or set it to itself, resulting in an infinite loop. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c ============================================================================== --- head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Tue Mar 10 20:43:16 2015 (r279861) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Tue Mar 10 20:52:03 2015 (r279862) @@ -583,10 +583,10 @@ ctf_discard(ctf_file_t *fp) return (0); /* no update required */ for (dtd = ctf_list_prev(&fp->ctf_dtdefs); dtd != NULL; dtd = ntd) { + ntd = ctf_list_prev(dtd); if (dtd->dtd_type <= fp->ctf_dtoldid) continue; /* skip types that have been committed */ - ntd = ctf_list_prev(dtd); ctf_dtd_delete(fp, dtd); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 21:05:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DD3D571; Tue, 10 Mar 2015 21:05:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 29660F42; Tue, 10 Mar 2015 21:05:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AL5Hf8044087; Tue, 10 Mar 2015 21:05:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AL5HBX044086; Tue, 10 Mar 2015 21:05:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503102105.t2AL5HBX044086@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 10 Mar 2015 21:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279863 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 21:05:18 -0000 Author: tuexen Date: Tue Mar 10 21:05:17 2015 New Revision: 279863 URL: https://svnweb.freebsd.org/changeset/base/279863 Log: Unlock the stcb when using setsockopt() for the SCTP_PEER_ADDR_THLDS option. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Mar 10 20:52:03 2015 (r279862) +++ head/sys/netinet/sctp_usrreq.c Tue Mar 10 21:05:17 2015 (r279863) @@ -6249,6 +6249,7 @@ sctp_setopt(struct socket *so, int optna stcb->asoc.def_net_failure = thlds->spt_pathmaxrxt; stcb->asoc.def_net_pf_threshold = thlds->spt_pathpfthld; } + SCTP_TCB_UNLOCK(stcb); } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 21:08:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE32B929; Tue, 10 Mar 2015 21:08:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 8F365F81; Tue, 10 Mar 2015 21:08:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AL8xfb044556; Tue, 10 Mar 2015 21:08:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AL8xnM044555; Tue, 10 Mar 2015 21:08:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201503102108.t2AL8xnM044555@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 10 Mar 2015 21:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279864 - head/cddl/contrib/opensolaris/common/ctf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 21:08:59 -0000 Author: markj Date: Tue Mar 10 21:08:58 2015 New Revision: 279864 URL: https://svnweb.freebsd.org/changeset/base/279864 Log: CTF containers use the ctf_dtoldid field as a threshold type index which indicates the range of type indices which have been committed to the container by ctf_update(). However, the top bit of the dtd_type field is not part of the type index; rather, it is a flag used to indicate that the corresponding CTF container is a parent. This is why the maximum CTF type index is 2^15 - 1 rather than 2^16 - 1. Therefore, this flag must be masked off (using the CTF_TYPE_TO_INDEX macro) when comparing a type index with the ctf_dtoldid field of a container. This bug was causing libctf to erroneously free committed type definitions in ctf_discard(). libdtrace holds some references to such types, resulting in a use-after-free. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c ============================================================================== --- head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Tue Mar 10 21:05:17 2015 (r279863) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Tue Mar 10 21:08:58 2015 (r279864) @@ -584,7 +584,7 @@ ctf_discard(ctf_file_t *fp) for (dtd = ctf_list_prev(&fp->ctf_dtdefs); dtd != NULL; dtd = ntd) { ntd = ctf_list_prev(dtd); - if (dtd->dtd_type <= fp->ctf_dtoldid) + if (CTF_TYPE_TO_INDEX(dtd->dtd_type) <= fp->ctf_dtoldid) continue; /* skip types that have been committed */ ctf_dtd_delete(fp, dtd); @@ -1328,7 +1328,7 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_fil */ if (dst_type == CTF_ERR && name[0] != '\0') { for (dtd = ctf_list_prev(&dst_fp->ctf_dtdefs); dtd != NULL && - dtd->dtd_type > dst_fp->ctf_dtoldid; + CTF_TYPE_TO_INDEX(dtd->dtd_type) > dst_fp->ctf_dtoldid; dtd = ctf_list_prev(dtd)) { if (CTF_INFO_KIND(dtd->dtd_data.ctt_info) == kind && dtd->dtd_name != NULL && From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 21:17:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 765AFBA0; Tue, 10 Mar 2015 21:17:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 612D0126; Tue, 10 Mar 2015 21:17:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ALHBMM049131; Tue, 10 Mar 2015 21:17:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ALHBHG049130; Tue, 10 Mar 2015 21:17:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503102117.t2ALHBHG049130@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Mar 2015 21:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279865 - head/sys/ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 21:17:11 -0000 Author: hselasky Date: Tue Mar 10 21:17:10 2015 New Revision: 279865 URL: https://svnweb.freebsd.org/changeset/base/279865 Log: Ensure setting promiscious mode when a network interface is up, is always non-blocking by not locking a SX type of mutex. Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Tue Mar 10 21:08:58 2015 (r279864) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Tue Mar 10 21:17:10 2015 (r279865) @@ -1916,19 +1916,22 @@ static int mlx4_en_ioctl(struct ifnet *d error = -mlx4_en_change_mtu(dev, ifr->ifr_mtu); break; case SIOCSIFFLAGS: - mutex_lock(&mdev->state_lock); if (dev->if_flags & IFF_UP) { - if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) { + mutex_lock(&mdev->state_lock); mlx4_en_start_port(dev); - else + mutex_unlock(&mdev->state_lock); + } else { mlx4_en_set_rx_mode(dev); + } } else { + mutex_lock(&mdev->state_lock); if (dev->if_drv_flags & IFF_DRV_RUNNING) { mlx4_en_stop_port(dev); - if_link_state_change(dev, LINK_STATE_DOWN); + if_link_state_change(dev, LINK_STATE_DOWN); } + mutex_unlock(&mdev->state_lock); } - mutex_unlock(&mdev->state_lock); break; case SIOCADDMULTI: case SIOCDELMULTI: From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 22:38:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 912C3B39; Tue, 10 Mar 2015 22:38:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 63069C15; Tue, 10 Mar 2015 22:38:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2AMcB66086928; Tue, 10 Mar 2015 22:38:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2AMcB6q086927; Tue, 10 Mar 2015 22:38:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503102238.t2AMcB6q086927@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 10 Mar 2015 22:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279867 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 22:38:11 -0000 Author: tuexen Date: Tue Mar 10 22:38:10 2015 New Revision: 279867 URL: https://svnweb.freebsd.org/changeset/base/279867 Log: Keep track on the socket lock state. This fixes a bug showing up on Mac OS X. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Mar 10 22:23:56 2015 (r279866) +++ head/sys/netinet/sctputil.c Tue Mar 10 22:38:10 2015 (r279867) @@ -2745,7 +2745,11 @@ set_error: static void sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state, - struct sockaddr *sa, uint32_t error) + struct sockaddr *sa, uint32_t error, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct mbuf *m_notify; struct sctp_paddr_change *spc; @@ -2828,7 +2832,7 @@ sctp_notify_peer_addr_change(struct sctp control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, - SCTP_SO_NOT_LOCKED); + so_locked); } @@ -3592,7 +3596,7 @@ sctp_ulp_notify(uint32_t notification, s net = (struct sctp_nets *)data; sctp_notify_peer_addr_change(stcb, SCTP_ADDR_UNREACHABLE, - (struct sockaddr *)&net->ro._l_addr, error); + (struct sockaddr *)&net->ro._l_addr, error, so_locked); break; } case SCTP_NOTIFY_INTERFACE_UP: @@ -3601,7 +3605,7 @@ sctp_ulp_notify(uint32_t notification, s net = (struct sctp_nets *)data; sctp_notify_peer_addr_change(stcb, SCTP_ADDR_AVAILABLE, - (struct sockaddr *)&net->ro._l_addr, error); + (struct sockaddr *)&net->ro._l_addr, error, so_locked); break; } case SCTP_NOTIFY_INTERFACE_CONFIRMED: @@ -3610,7 +3614,7 @@ sctp_ulp_notify(uint32_t notification, s net = (struct sctp_nets *)data; sctp_notify_peer_addr_change(stcb, SCTP_ADDR_CONFIRMED, - (struct sockaddr *)&net->ro._l_addr, error); + (struct sockaddr *)&net->ro._l_addr, error, so_locked); break; } case SCTP_NOTIFY_SPECIAL_SP_FAIL: @@ -3681,15 +3685,15 @@ sctp_ulp_notify(uint32_t notification, s break; case SCTP_NOTIFY_ASCONF_ADD_IP: sctp_notify_peer_addr_change(stcb, SCTP_ADDR_ADDED, data, - error); + error, so_locked); break; case SCTP_NOTIFY_ASCONF_DELETE_IP: sctp_notify_peer_addr_change(stcb, SCTP_ADDR_REMOVED, data, - error); + error, so_locked); break; case SCTP_NOTIFY_ASCONF_SET_PRIMARY: sctp_notify_peer_addr_change(stcb, SCTP_ADDR_MADE_PRIM, data, - error); + error, so_locked); break; case SCTP_NOTIFY_PEER_SHUTDOWN: sctp_notify_shutdown_event(stcb); From owner-svn-src-head@FreeBSD.ORG Tue Mar 10 23:27:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22C3DB04; Tue, 10 Mar 2015 23:27:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 E87533DA; Tue, 10 Mar 2015 23:27:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ANREcm010771; Tue, 10 Mar 2015 23:27:14 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ANREmU010768; Tue, 10 Mar 2015 23:27:14 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503102327.t2ANREmU010768@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 10 Mar 2015 23:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279868 - in head/sys: dev/pci kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 23:27:15 -0000 Author: rstone Date: Tue Mar 10 23:27:13 2015 New Revision: 279868 URL: https://svnweb.freebsd.org/changeset/base/279868 Log: Fix SR-IOV passthrough devices to allow ppt to attach A late change to the SR-IOV infrastructure broke passthrough of VFs. device_set_devclass() was being used to try to force the ppt driver to attach to the device, but this didn't work because the DF_FIXEDCLASS flag wasn't being set on the device, so the ppt driver probe routine would not match when it returned BUS_NOWILDCARD. Fix this by adding a new device function that both sets the devclass and sets the DF_FIXEDCLASS flag, and use that to force the ppt driver to attach to VFs. Differential Revision: https://reviews.freebsd.org/D2041 Reviewed by: jhb MFC after: 3 weeks Modified: head/sys/dev/pci/pci_iov.c head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/dev/pci/pci_iov.c ============================================================================== --- head/sys/dev/pci/pci_iov.c Tue Mar 10 22:38:10 2015 (r279867) +++ head/sys/dev/pci/pci_iov.c Tue Mar 10 23:27:13 2015 (r279868) @@ -586,7 +586,7 @@ pci_iov_enumerate_vfs(struct pci_devinfo * VFs. */ if (nvlist_get_bool(iov_config, "passthrough")) - device_set_devclass(vf, "ppt"); + device_set_devclass_fixed(vf, "ppt"); vfinfo = device_get_ivars(vf); Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Mar 10 22:38:10 2015 (r279867) +++ head/sys/kern/subr_bus.c Tue Mar 10 23:27:13 2015 (r279868) @@ -2683,6 +2683,25 @@ device_set_devclass(device_t dev, const } /** + * @brief Set the devclass of a device and mark the devclass fixed. + * @see device_set_devclass() + */ +int +device_set_devclass_fixed(device_t dev, const char *classname) +{ + int error; + + if (classname == NULL) + return (EINVAL); + + error = device_set_devclass(dev, classname); + if (error) + return (error); + dev->flags |= DF_FIXEDCLASS; + return (0); +} + +/** * @brief Set the driver of a device * * @retval 0 success Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Tue Mar 10 22:38:10 2015 (r279867) +++ head/sys/sys/bus.h Tue Mar 10 23:27:13 2015 (r279868) @@ -522,6 +522,7 @@ void device_quiet(device_t dev); void device_set_desc(device_t dev, const char* desc); void device_set_desc_copy(device_t dev, const char* desc); int device_set_devclass(device_t dev, const char *classname); +int device_set_devclass_fixed(device_t dev, const char *classname); int device_set_driver(device_t dev, driver_t *driver); void device_set_flags(device_t dev, u_int32_t flags); void device_set_softc(device_t dev, void *softc); From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 00:01:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC997F6C; Wed, 11 Mar 2015 00:01:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 8E2C1982; Wed, 11 Mar 2015 00:01:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2B01eWO026625; Wed, 11 Mar 2015 00:01:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2B01euw026624; Wed, 11 Mar 2015 00:01:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201503110001.t2B01euw026624@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 11 Mar 2015 00:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279869 - head/cddl/contrib/opensolaris/common/ctf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 00:01:40 -0000 Author: markj Date: Wed Mar 11 00:01:39 2015 New Revision: 279869 URL: https://svnweb.freebsd.org/changeset/base/279869 Log: When copying a type from a source CTF container to a destination container, ctf_add_type() first performs a by-name lookup of the type in the destination container. If this lookup returns a forward declaration for an enum, struct, or union, reset dst_type back to CTF_ERR, indicating that the source type is not in fact present in the destination container. This ensures that ctf_add_type() will also search the destination container's dynamic type list for the source type. Without this change, a pair of mutually recursive struct definitions could cause infinite recursion in ctf_add_type() if the destination container only contained forward declarations for the struct types: ctf_add_type() recursively calls itself on each struct member's type, and the forward declarations meant that the dynamic type list search would be skipped. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_create.c ============================================================================== --- head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Tue Mar 10 23:27:13 2015 (r279868) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_create.c Wed Mar 11 00:01:39 2015 (r279869) @@ -1313,10 +1313,13 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_fil * unless dst_type is a forward declaration and src_type is a struct, * union, or enum (i.e. the definition of the previous forward decl). */ - if (dst_type != CTF_ERR && dst_kind != kind && ( - dst_kind != CTF_K_FORWARD || (kind != CTF_K_ENUM && - kind != CTF_K_STRUCT && kind != CTF_K_UNION))) - return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + if (dst_type != CTF_ERR && dst_kind != kind) { + if (dst_kind != CTF_K_FORWARD || (kind != CTF_K_ENUM && + kind != CTF_K_STRUCT && kind != CTF_K_UNION)) + return (ctf_set_errno(dst_fp, ECTF_CONFLICT)); + else + dst_type = CTF_ERR; + } /* * If the non-empty name was not found in the appropriate hash, search From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 04:27:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2589DA4; Wed, 11 Mar 2015 04:27:28 +0000 (UTC) Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu [18.7.68.37]) (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 E302C9B8; Wed, 11 Mar 2015 04:27:27 +0000 (UTC) X-AuditID: 12074425-f79846d0000054e1-49-54ffc427562d Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id 51.94.21729.724CFF45; Wed, 11 Mar 2015 00:27:19 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id t2B4RIaY003477; Wed, 11 Mar 2015 00:27:19 -0400 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id t2B4RF3I025928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 11 Mar 2015 00:27:17 -0400 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id t2B4RFtH010324; Wed, 11 Mar 2015 00:27:15 -0400 (EDT) Date: Wed, 11 Mar 2015 00:27:15 -0400 (EDT) From: Benjamin Kaduk To: Slawa Olhovchenkov Subject: Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh In-Reply-To: <20150308133821.GF48476@zxy.spb.ru> Message-ID: References: <20150305123349.GP48476@zxy.spb.ru> <20150305123548.GO17947@FreeBSD.org> <48981079-C9B7-411D-87A3-5A8F04924314@FreeBSD.org> <20150305141334.GX48476@zxy.spb.ru> <63BD8258-D2C9-4C94-8A54-63AA104871D9@FreeBSD.org> <20150305144056.GY48476@zxy.spb.ru> <20150305151732.GA48476@zxy.spb.ru> <20150308133821.GF48476@zxy.spb.ru> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42IR4hRV1lU/8j/E4PoeC4tjD4+yW0x4HW3x p30Ki8WfTQtZLZq+LGByYPWY8Wk+i8fOWXfZPX6eFgpgjuKySUnNySxLLdK3S+DKOHtzP1vB fNOKqddfszQwPtXsYuTkkBAwkbjQep0ZwhaTuHBvPRuILSSwmEliwRGxLkYuIHsjo8TsjgYm COcQk8Tmc59YIJwGRonzr1YxgrSwCGhLPOl9yw5iswmoSMx8sxFslIiAusTar7fZQBqYBV4w SjQdngfWICwQIPFgeR8TiM0pYCCxsucdK4jNK+AgMePqc3aIDT+ZJbb09oMViQroSKzeP4UF okhQ4uTMJ2A2s4CWxPLp21gmMArOQpKahSS1gJFpFaNsSm6Vbm5iZk5xarJucXJiXl5qka6F Xm5miV5qSukmRlBIs7uo7mCccEjpEKMAB6MSD6/DjP8hQqyJZcWVuYcYJTmYlER5Nx4ECvEl 5adUZiQWZ8QXleakFh9ilOBgVhLhlTkMlONNSaysSi3Kh0lJc7AoifNu+sEXIiSQnliSmp2a WpBaBJOV4eBQkuD9cAioUbAoNT21Ii0zpwQhzcTBCTKcB2j4WpAa3uKCxNzizHSI/ClGRSlx 3t8gCQGQREZpHlwvLOW8YhQHekWYNwLkNh5guoLrfgU0mAloMIs12OCSRISUVANjhLnO6wln LskEuZVFza452be84H3jAkab+8//rY17L7P1Uc8Nxw/LCiPU/jfYf5ia8PiM7u2Pc7PYX3la LU5p3R6cKrVtQmgC19+b58qeLDry7u9+U/a42PWFH73tLQvPvJCpO7L4AsMmyUVXWxLEmOID Vky69yfN65SdUc32pxM0VS1fWy0JVGIpzkg01GIuKk4EAI6lQ1wUAwAA Cc: Benjamin Kaduk , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 04:27:28 -0000 On Sun, 8 Mar 2015, Slawa Olhovchenkov wrote: > On Thu, Mar 05, 2015 at 08:14:59PM -0500, Benjamin Kaduk wrote: > > > On Thu, 5 Mar 2015, Slawa Olhovchenkov wrote: > > > > > On Thu, Mar 05, 2015 at 10:11:43AM -0500, Benjamin Kaduk wrote: > > > > > > > On Thu, Mar 5, 2015 at 9:40 AM, Slawa Olhovchenkov wrote: > > > > > > > > Speaking as an upstream maintainer: don't use kerberized telnet. > > > > > > I am use this for test kerberos setup (check all setup correctly). > > > > I use ssh to test kerberos setups (I think sshd has better error message, > > for one). > > I don't see any error message from ssh (about kerberos), ssh just ask > password if any problem. What a problem? Silent. I said sshd, not ssh. ssh's output is not great; ssh -v just tells you that it's moving on to the next mechanims (password), which you could guess because it's asking for a password. But the kerberos client generally doesn't get a very informative error message anyway, since that could give too much information to an attacker -- the really useful parts will always be on the server side. > For debug ssh+kerberos I need stop sshd and run sshd with -D and -d. You can easily start a new sshd on a high port and leave the old one running. > And in this case debug messages very stranges for me. They will be less strange if you use it a lot :) > Also, telnet use less dependes and less restrictions. This is good for > step-to-step debug. I'm not sure what dependencies are a concern given that ssh is in the base system. What does youre step-to-step debug procedure look like? Mine is mostly just "use kinit to check that I can get a TGT", and then "use ssh to check that I can get a working service ticket". There could be an intermediate "use kgetcred to check that I can get a service ticket at all", but I usually skip it since I have lots of practice with ssh. Are there other steps I am missing? > > The problem with using telnet to test the kerberos setup is that if your > > kerberos setup works with telnet, you have the DES enctypes (weak > > cryptography) enabled. This means that the whole setup, even things > > other > > What you talk about DES? I don't see nothing about AES/DES/etc in krb5.conf. It would be allow_weak_crypto most likely, not an explicit list. See https://svnweb.freebsd.org/base/head/crypto/heimdal/appl/telnet/libtelnet/kerberos5.c?revision=233294&view=markup#l247 for where the client forces DES to be used. I also didn't mention the weak CFB cipher mode used, earlier. > > than telnet, are suffering from the vulnerabilities of weak crypto. > > Kerberos distributions have disabled DES by default for many years, now -- > > Apple has even completely removed the code for them from recent releases > > of OS X! Please see RFC 6649. > > I don't enable DES. And I have working kerberized telnet. What you > talk about? Supposedly there are patches to enable 3DES (but still CFB). Perhaps you could show the 'klist -v' output to remove some confusion > > > > I use kerberized ssh all the time; please tell me more about how it is > > > > broken (a new thread would be best). > > > > > > kerberized ssh broken in SSO mode: you can't do ssh login to > > > > I have a very different idea of what "SSO mode" means: I run kinit on my > > local machine and then use kerberos to authenticate to remote > > services. I > > SSO (for me) is from Windows world: you login in desktop and don't > need to enter password anymore. "desktop" is important -- it is a local machine. It's not giving your password to the remote server. > > should never type my password at something which is not a trusted local > > binary. > > As I know, you can't use kerberos outside controled perimeter (with > working NTP sync, revers DNS and etc). I.e. from random [network] > place you can't run kinit on local machine [notebook] and use kerberos > to ssh login. > > For may case this is requirement. I use kinit on my local machine and use kerberos to ssh login from all sorts of weird environments. The use of reverse DNS can be disabled; libkrb5 can store a time offset to correct for some classes of clock errors. Maybe your KDC is firewalled off? I know that trying to reason with sysadmins can frequently be a lost cause, but the kerberos protocol is explicitly designed to run over an untrusted network. > And for untrusted binary -- why don't use kerberos with OTP? It helps a little bit, but frankly, all the existing kerberos/OTP solutions are not all that good. > > > kerberized host (from outside world), input kerberos password and use > > > kerberos ticket. > > > > "input kerberos password and use kerberos ticket" doesn't make sense -- > > you are not using your kerberos ticket; you are using your password. > > PAM > > I am use kerberos ticket for passwordless login to internal hosts > (after using password for login to gateway host). > > > is going off and getting a ticket, sure (and hopefully validating it > > against the host keytab to avoid the Zanarotti attack!), but it is > > starting with your password. That is completely at odds with how Kerberos > > is intended to be used. > > Sorry, I don't understand you. Can explain? The basic idea of the attack is that if I know the password that sshd is trying to validate, I can fake a response from the KDC which is encrypted in the (key derived from that password) and make that response look like a valid TGT. In order to tell that the TGT it receives is actually from the KDC, and not the attacker, sshd has to use that TGT to get a service ticket it can validate (i.e., a service ticket for itself) > > > This is issuse between PAM and ssh thread emulation. > > > > It does seem likely that this sort of thing would be an issue with PAM, > > yes. I am not particularly motivated to look into it, though. > > > I do recall some issue where sshd in capsicum mode was not allowed to read > > the keytab in order to verify the supplied Kerberos credentials, which > > required using UsePrivilegeSeparation=yes instead of the default value > > (sandbox). Perhaps that would affect the password mode of operation as > > well. > > Currently, sshd for PAM (and kerberos PAM) fork child. Got ticket in > this child. And try to save ticket in parent (unsuccessful, of > course). As result -- I don't have valid ticket after ssh login. So this is just an inconvenience, then, not a fatal flaw? (If you're willing to type your password at sshd, you can type it again at kinit later.) Anyway, this mode works in linux, so fixing it must just be a small matter of programming. I have too much on my plate to take it on, though. -Ben From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 08:08:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BED84D6; Wed, 11 Mar 2015 08:08:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 170F11AF; Wed, 11 Mar 2015 08:08:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2B88tof053223; Wed, 11 Mar 2015 08:08:55 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2B88tRL053221; Wed, 11 Mar 2015 08:08:55 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201503110808.t2B88tRL053221@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 11 Mar 2015 08:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279875 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 08:08:56 -0000 Author: scottl Date: Wed Mar 11 08:08:54 2015 New Revision: 279875 URL: https://svnweb.freebsd.org/changeset/base/279875 Log: Fix a typo and update the date in the man page. Submitted by: emax Obtained from: Netflix, Inc. MFC after: 3 days Modified: head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Wed Mar 11 07:22:13 2015 (r279874) +++ head/usr.bin/procstat/procstat.1 Wed Mar 11 08:08:54 2015 (r279875) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2014 +.Dd March 10, 2015 .Dt PROCSTAT 1 .Os .Sh NAME Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Wed Mar 11 07:22:13 2015 (r279874) +++ head/usr.bin/procstat/procstat.c Wed Mar 11 08:08:54 2015 (r279875) @@ -40,7 +40,7 @@ #include "procstat.h" static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, rflag; -static int sflag, tflag, vflag, xflag, Sflag;; +static int sflag, tflag, vflag, xflag, Sflag; int hflag, nflag, Cflag, Hflag; static void From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 09:46:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D14DE9E1; Wed, 11 Mar 2015 09:46:42 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 904EBE22; Wed, 11 Mar 2015 09:46:42 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E08571FE022; Wed, 11 Mar 2015 10:46:39 +0100 (CET) Message-ID: <55000F2E.80804@selasky.org> Date: Wed, 11 Mar 2015 10:47:26 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Gleb Smirnoff Subject: Re: svn commit: r279828 - head/sys/dev/cadence References: <201503092239.t29MdxUo089384@svn.freebsd.org> In-Reply-To: <201503092239.t29MdxUo089384@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 09:46:42 -0000 On 03/09/15 23:39, Ian Lepore wrote: > - if ((ifp->if_flags & IFF_BROADCAST) == 0) > + if ((if_getflags(ifp) & IFF_BROADCAST) == 0) A comment: I think it would be better if the flags were not a bitmask, but an enum or structure, allowing for more than 32 or 64 bit-flags. if (if_getflags(ifp, broadcast) == 0) --HPS From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 12:57:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EDD4D40; Wed, 11 Mar 2015 12:57:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 59E6D82B; Wed, 11 Mar 2015 12:57:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2BCv86P090062; Wed, 11 Mar 2015 12:57:08 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2BCv8Mt090061; Wed, 11 Mar 2015 12:57:08 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201503111257.t2BCv8Mt090061@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Wed, 11 Mar 2015 12:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279884 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 12:57:08 -0000 Author: jah Date: Wed Mar 11 12:57:07 2015 New Revision: 279884 URL: https://svnweb.freebsd.org/changeset/base/279884 Log: Adding myself (jah) to committers-src.dot Approved by: kib (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Mar 11 11:17:09 2015 (r279883) +++ head/share/misc/committers-src.dot Wed Mar 11 12:57:07 2015 (r279884) @@ -178,6 +178,7 @@ ian [label="Ian Lepore\nian@FreeBSD.org\ iedowse [label="Ian Dowse\niedowse@FreeBSD.org\n2000/12/01"] imp [label="Warner Losh\nimp@FreeBSD.org\n1996/09/20"] ivoras [label="Ivan Voras\nivoras@FreeBSD.org\n2008/06/10"] +jah [label="Jason A. Harmening\njah@FreeBSD.org\n2015/03/08"] jamie [label="Jamie Gritton\njamie@FreeBSD.org\n2009/01/28"] jasone [label="Jason Evans\njasone@FreeBSD.org\n1999/03/03"] jceel [label="Jakub Klama\njceel@FreeBSD.org\n2011/09/25"] @@ -549,6 +550,7 @@ ken -> slm kib -> ae kib -> dchagin kib -> gjb +kib -> jah kib -> jlh kib -> jpaetzel kib -> lulf From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 14:25:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DB2EB4C; Wed, 11 Mar 2015 14:25:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 ED31633C; Wed, 11 Mar 2015 14:25:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2BEPOWB033213; Wed, 11 Mar 2015 14:25:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2BEPOkh033212; Wed, 11 Mar 2015 14:25:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503111425.t2BEPOkh033212@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 11 Mar 2015 14:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279886 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 14:25:25 -0000 Author: tuexen Date: Wed Mar 11 14:25:23 2015 New Revision: 279886 URL: https://svnweb.freebsd.org/changeset/base/279886 Log: Fix the adaptation of the path state when thresholds are changed using the SCTP_PEER_ADDR_THLDS socket option. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Mar 11 13:07:11 2015 (r279885) +++ head/sys/netinet/sctp_usrreq.c Wed Mar 11 14:25:23 2015 (r279886) @@ -6189,14 +6189,16 @@ sctp_setopt(struct socket *so, int optna } if (stcb != NULL) { if (net != NULL) { + net->failure_threshold = thlds->spt_pathmaxrxt; + net->pf_threshold = thlds->spt_pathpfthld; if (net->dest_state & SCTP_ADDR_PF) { - if ((net->failure_threshold > thlds->spt_pathmaxrxt) || - (net->failure_threshold <= thlds->spt_pathpfthld)) { + if ((net->error_count > net->failure_threshold) || + (net->error_count <= net->pf_threshold)) { net->dest_state &= ~SCTP_ADDR_PF; } } else { - if ((net->failure_threshold > thlds->spt_pathpfthld) && - (net->failure_threshold <= thlds->spt_pathmaxrxt)) { + if ((net->error_count > net->pf_threshold) && + (net->error_count <= net->failure_threshold)) { net->dest_state |= SCTP_ADDR_PF; sctp_send_hb(stcb, net, SCTP_SO_LOCKED); sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_TIMER + SCTP_LOC_3); @@ -6204,28 +6206,28 @@ sctp_setopt(struct socket *so, int optna } } if (net->dest_state & SCTP_ADDR_REACHABLE) { - if (net->failure_threshold > thlds->spt_pathmaxrxt) { + if (net->error_count > net->failure_threshold) { net->dest_state &= ~SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { - if (net->failure_threshold <= thlds->spt_pathmaxrxt) { + if (net->error_count <= net->failure_threshold) { net->dest_state |= SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } - net->failure_threshold = thlds->spt_pathmaxrxt; - net->pf_threshold = thlds->spt_pathpfthld; } else { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->failure_threshold = thlds->spt_pathmaxrxt; + net->pf_threshold = thlds->spt_pathpfthld; if (net->dest_state & SCTP_ADDR_PF) { - if ((net->failure_threshold > thlds->spt_pathmaxrxt) || - (net->failure_threshold <= thlds->spt_pathpfthld)) { + if ((net->error_count > net->failure_threshold) || + (net->error_count <= net->pf_threshold)) { net->dest_state &= ~SCTP_ADDR_PF; } } else { - if ((net->failure_threshold > thlds->spt_pathpfthld) && - (net->failure_threshold <= thlds->spt_pathmaxrxt)) { + if ((net->error_count > net->pf_threshold) && + (net->error_count <= net->failure_threshold)) { net->dest_state |= SCTP_ADDR_PF; sctp_send_hb(stcb, net, SCTP_SO_LOCKED); sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_TIMER + SCTP_LOC_3); @@ -6233,18 +6235,16 @@ sctp_setopt(struct socket *so, int optna } } if (net->dest_state & SCTP_ADDR_REACHABLE) { - if (net->failure_threshold > thlds->spt_pathmaxrxt) { + if (net->error_count > net->failure_threshold) { net->dest_state &= ~SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { - if (net->failure_threshold <= thlds->spt_pathmaxrxt) { + if (net->error_count <= net->failure_threshold) { net->dest_state |= SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } - net->failure_threshold = thlds->spt_pathmaxrxt; - net->pf_threshold = thlds->spt_pathpfthld; } stcb->asoc.def_net_failure = thlds->spt_pathmaxrxt; stcb->asoc.def_net_pf_threshold = thlds->spt_pathpfthld; From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 15:21:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D3AD96B; Wed, 11 Mar 2015 15:21:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 78B16D57; Wed, 11 Mar 2015 15:21:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2BFLei9063728; Wed, 11 Mar 2015 15:21:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2BFLeJx063727; Wed, 11 Mar 2015 15:21:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503111521.t2BFLeJx063727@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 11 Mar 2015 15:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279888 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 15:21:40 -0000 Author: tuexen Date: Wed Mar 11 15:21:39 2015 New Revision: 279888 URL: https://svnweb.freebsd.org/changeset/base/279888 Log: It seems that sb_acc is a better replacement for sb_cc than sb_ccc. At least it unbreaks the use of select() for SCTP sockets. MFC after: 3 days Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Wed Mar 11 15:10:30 2015 (r279887) +++ head/sys/netinet/sctp_os_bsd.h Wed Mar 11 15:21:39 2015 (r279888) @@ -390,7 +390,7 @@ typedef struct callout sctp_os_timer_t; /* get the socket type */ #define SCTP_SO_TYPE(so) ((so)->so_type) /* Use a macro for renaming sb_cc to sb_ccc */ -#define sb_cc sb_ccc +#define sb_cc sb_acc /* reserve sb space for a socket */ #define SCTP_SORESERVE(so, send, recv) soreserve(so, send, recv) /* wakeup a socket */ From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 15:40:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC6A0415; Wed, 11 Mar 2015 15:40:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 97D61F2D; Wed, 11 Mar 2015 15:40:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2BFeU2C070708; Wed, 11 Mar 2015 15:40:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2BFeU6X070707; Wed, 11 Mar 2015 15:40:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201503111540.t2BFeU6X070707@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 11 Mar 2015 15:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279889 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 15:40:30 -0000 Author: tuexen Date: Wed Mar 11 15:40:29 2015 New Revision: 279889 URL: https://svnweb.freebsd.org/changeset/base/279889 Log: Update a comment to get it aligned with the code change. Reported by: brueffer@ Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Wed Mar 11 15:21:39 2015 (r279888) +++ head/sys/netinet/sctp_os_bsd.h Wed Mar 11 15:40:29 2015 (r279889) @@ -389,7 +389,10 @@ typedef struct callout sctp_os_timer_t; #define SCTP_CLEAR_SO_NBIO(so) ((so)->so_state &= ~SS_NBIO) /* get the socket type */ #define SCTP_SO_TYPE(so) ((so)->so_type) -/* Use a macro for renaming sb_cc to sb_ccc */ +/* Use a macro for renaming sb_cc to sb_acc. + * Initially sb_ccc was used, but this broke select() when used + * with SCTP sockets. + */ #define sb_cc sb_acc /* reserve sb space for a socket */ #define SCTP_SORESERVE(so, send, recv) soreserve(so, send, recv) From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 16:02:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34D8E9F2; Wed, 11 Mar 2015 16:02:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 1DDBE26D; Wed, 11 Mar 2015 16:02:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2BG2RbF083240; Wed, 11 Mar 2015 16:02:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2BG2PF5083231; Wed, 11 Mar 2015 16:02:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503111602.t2BG2PF5083231@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 Mar 2015 16:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279891 - in head/sys: conf kern modules/mlxen net ofed/drivers/net/mlx4 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 16:02:27 -0000 Author: hselasky Date: Wed Mar 11 16:02:24 2015 New Revision: 279891 URL: https://svnweb.freebsd.org/changeset/base/279891 Log: Factor out mbuf hashing code from LAGG driver so that other network drivers can use it. This avoids some code duplication. Add missing default case to all switch statements while at it. Also move the hashing of the IPv6 flow field to layer 4 because the IPv6 flow field is constant on a per L4 connection basis and not on a per L3 network. Differential Revision: https://reviews.freebsd.org/D1987 Sponsored by: Mellanox Technologies MFC after: 1 month Added: head/sys/kern/uipc_mbufhash.c (contents, props changed) - copied, changed from r279890, head/sys/ofed/drivers/net/mlx4/utils.c Deleted: head/sys/ofed/drivers/net/mlx4/utils.c head/sys/ofed/drivers/net/mlx4/utils.h Modified: head/sys/conf/files head/sys/modules/mlxen/Makefile head/sys/net/ieee8023ad_lacp.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h head/sys/ofed/drivers/net/mlx4/en_tx.c head/sys/sys/mbuf.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Mar 11 15:42:21 2015 (r279890) +++ head/sys/conf/files Wed Mar 11 16:02:24 2015 (r279891) @@ -3140,6 +3140,7 @@ kern/uipc_debug.c optional ddb kern/uipc_domain.c standard kern/uipc_mbuf.c standard kern/uipc_mbuf2.c standard +kern/uipc_mbufhash.c standard kern/uipc_mqueue.c optional p1003_1b_mqueue kern/uipc_sem.c optional p1003_1b_semaphores kern/uipc_shm.c standard @@ -3857,9 +3858,6 @@ ofed/drivers/net/mlx4/sys_tune.c option ofed/drivers/net/mlx4/en_cq.c optional mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/utils.c optional mlxen \ - no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" ofed/drivers/net/mlx4/en_main.c optional mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" Copied and modified: head/sys/kern/uipc_mbufhash.c (from r279890, head/sys/ofed/drivers/net/mlx4/utils.c) ============================================================================== --- head/sys/ofed/drivers/net/mlx4/utils.c Wed Mar 11 15:42:21 2015 (r279890, copy source) +++ head/sys/kern/uipc_mbufhash.c Wed Mar 11 16:02:24 2015 (r279891) @@ -25,58 +25,34 @@ __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 #if defined(INET) || defined(INET6) #include #endif + #ifdef INET -#include -#include #include #endif #ifdef INET6 #include -#include -#include #endif #include -#include "utils.h" - -/* XXX this code should be factored out */ -/* XXX copied from if_lagg.c */ - static const void * -mlx4_en_gethdr(struct mbuf *m, u_int off, u_int len, void *buf) +m_ether_tcpip_hash_gethdr(const struct mbuf *m, const u_int off, + const u_int len, void *buf) { + if (m->m_pkthdr.len < (off + len)) { return (NULL); } else if (m->m_len < (off + len)) { @@ -87,22 +63,18 @@ mlx4_en_gethdr(struct mbuf *m, u_int off } uint32_t -mlx4_en_hashmbuf(uint32_t flags, struct mbuf *m, uint32_t key) +m_ether_tcpip_hash_init(void) +{ + uint32_t seed; + + seed = arc4random(); + return (fnv_32_buf(&seed, sizeof(seed), FNV1_32_INIT)); +} + +uint32_t +m_ether_tcpip_hash(const uint32_t flags, const struct mbuf *m, + const uint32_t key) { - uint16_t etype; - uint32_t p = key; - int off; - struct ether_header *eh; - const struct ether_vlan_header *vlan; -#ifdef INET - const struct ip *ip; - const uint32_t *ports; - int iphlen; -#endif -#ifdef INET6 - const struct ip6_hdr *ip6; - uint32_t flow; -#endif union { #ifdef INET struct ip ip; @@ -113,47 +85,57 @@ mlx4_en_hashmbuf(uint32_t flags, struct struct ether_vlan_header vlan; uint32_t port; } buf; + struct ether_header *eh; + const struct ether_vlan_header *vlan; +#ifdef INET + const struct ip *ip; +#endif +#ifdef INET6 + const struct ip6_hdr *ip6; +#endif + uint32_t p; + int off; + uint16_t etype; - + p = key; off = sizeof(*eh); if (m->m_len < off) - goto out; + goto done; eh = mtod(m, struct ether_header *); etype = ntohs(eh->ether_type); - if (flags & MLX4_F_HASHL2) { - p = hash32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); - p = hash32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); + if (flags & MBUF_HASHFLAG_L2) { + p = fnv_32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); + p = fnv_32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); } - /* Special handling for encapsulating VLAN frames */ - if ((m->m_flags & M_VLANTAG) && (flags & MLX4_F_HASHL2)) { - p = hash32_buf(&m->m_pkthdr.ether_vtag, + if ((m->m_flags & M_VLANTAG) && (flags & MBUF_HASHFLAG_L2)) { + p = fnv_32_buf(&m->m_pkthdr.ether_vtag, sizeof(m->m_pkthdr.ether_vtag), p); } else if (etype == ETHERTYPE_VLAN) { - vlan = mlx4_en_gethdr(m, off, sizeof(*vlan), &buf); + vlan = m_ether_tcpip_hash_gethdr(m, off, sizeof(*vlan), &buf); if (vlan == NULL) - goto out; + goto done; - if (flags & MLX4_F_HASHL2) - p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); + if (flags & MBUF_HASHFLAG_L2) + p = fnv_32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); etype = ntohs(vlan->evl_proto); off += sizeof(*vlan) - sizeof(*eh); } - switch (etype) { #ifdef INET case ETHERTYPE_IP: - ip = mlx4_en_gethdr(m, off, sizeof(*ip), &buf); + ip = m_ether_tcpip_hash_gethdr(m, off, sizeof(*ip), &buf); if (ip == NULL) - goto out; - - if (flags & MLX4_F_HASHL3) { - p = hash32_buf(&ip->ip_src, sizeof(struct in_addr), p); - p = hash32_buf(&ip->ip_dst, sizeof(struct in_addr), p); - } - if (!(flags & MLX4_F_HASHL4)) break; - switch (ip->ip_p) { + if (flags & MBUF_HASHFLAG_L3) { + p = fnv_32_buf(&ip->ip_src, sizeof(struct in_addr), p); + p = fnv_32_buf(&ip->ip_dst, sizeof(struct in_addr), p); + } + if (flags & MBUF_HASHFLAG_L4) { + const uint32_t *ports; + int iphlen; + + switch (ip->ip_p) { case IPPROTO_TCP: case IPPROTO_UDP: case IPPROTO_SCTP: @@ -161,29 +143,39 @@ mlx4_en_hashmbuf(uint32_t flags, struct if (iphlen < sizeof(*ip)) break; off += iphlen; - ports = mlx4_en_gethdr(m, off, sizeof(*ports), &buf); + ports = m_ether_tcpip_hash_gethdr(m, + off, sizeof(*ports), &buf); if (ports == NULL) break; - p = hash32_buf(ports, sizeof(*ports), p); + p = fnv_32_buf(ports, sizeof(*ports), p); + break; + default: break; + } } break; #endif #ifdef INET6 case ETHERTYPE_IPV6: - if (!(flags & MLX4_F_HASHL3)) - break; - ip6 = mlx4_en_gethdr(m, off, sizeof(*ip6), &buf); + ip6 = m_ether_tcpip_hash_gethdr(m, off, sizeof(*ip6), &buf); if (ip6 == NULL) - goto out; + break; + if (flags & MBUF_HASHFLAG_L3) { + p = fnv_32_buf(&ip6->ip6_src, sizeof(struct in6_addr), p); + p = fnv_32_buf(&ip6->ip6_dst, sizeof(struct in6_addr), p); + } + if (flags & MBUF_HASHFLAG_L4) { + uint32_t flow; - p = hash32_buf(&ip6->ip6_src, sizeof(struct in6_addr), p); - p = hash32_buf(&ip6->ip6_dst, sizeof(struct in6_addr), p); - flow = ip6->ip6_flow & IPV6_FLOWLABEL_MASK; - p = hash32_buf(&flow, sizeof(flow), p); /* IPv6 flow label */ + /* IPv6 flow label */ + flow = ip6->ip6_flow & IPV6_FLOWLABEL_MASK; + p = fnv_32_buf(&flow, sizeof(flow), p); + } break; #endif + default: + break; } -out: +done: return (p); } Modified: head/sys/modules/mlxen/Makefile ============================================================================== --- head/sys/modules/mlxen/Makefile Wed Mar 11 15:42:21 2015 (r279890) +++ head/sys/modules/mlxen/Makefile Wed Mar 11 16:02:24 2015 (r279891) @@ -4,7 +4,7 @@ KMOD = mlxen SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS += en_cq.c en_main.c en_netdev.c en_port.c en_resources.c -SRCS += en_rx.c en_tx.c utils.c +SRCS += en_rx.c en_tx.c SRCS += opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Wed Mar 11 15:42:21 2015 (r279890) +++ head/sys/net/ieee8023ad_lacp.c Wed Mar 11 16:02:24 2015 (r279891) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include /* hz */ #include /* for net/if.h */ @@ -758,16 +757,13 @@ void lacp_attach(struct lagg_softc *sc) { struct lacp_softc *lsc; - uint32_t seed; lsc = malloc(sizeof(struct lacp_softc), M_DEVBUF, M_WAITOK | M_ZERO); sc->sc_psc = lsc; lsc->lsc_softc = sc; - seed = arc4random(); - lsc->lsc_hashkey = FNV1_32_INIT; - lsc->lsc_hashkey = fnv_32_buf(&seed, sizeof(seed), lsc->lsc_hashkey); + lsc->lsc_hashkey = m_ether_tcpip_hash_init(); lsc->lsc_active_aggregator = NULL; lsc->lsc_strict_mode = 1; LACP_LOCK_INIT(lsc); @@ -843,7 +839,7 @@ lacp_select_tx_port(struct lagg_softc *s M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) hash = m->m_pkthdr.flowid >> sc->flowid_shift; else - hash = lagg_hashmbuf(sc, m, lsc->lsc_hashkey); + hash = m_ether_tcpip_hash(sc->sc_flags, m, lsc->lsc_hashkey); hash %= pm->pm_count; lp = pm->pm_map[hash]; Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Mar 11 15:42:21 2015 (r279890) +++ head/sys/net/if_lagg.c Wed Mar 11 16:02:24 2015 (r279891) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -131,7 +130,6 @@ static int lagg_media_change(struct ifne static void lagg_media_status(struct ifnet *, struct ifmediareq *); static struct lagg_port *lagg_link_active(struct lagg_softc *, struct lagg_port *); -static const void *lagg_gethdr(struct mbuf *, u_int, u_int, void *); /* Simple round robin */ static void lagg_rr_attach(struct lagg_softc *); @@ -490,7 +488,7 @@ lagg_clone_create(struct if_clone *ifc, sc->flowid_shift = V_def_flowid_shift; /* Hash all layers by default */ - sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; + sc->sc_flags = MBUF_HASHFLAG_L2|MBUF_HASHFLAG_L3|MBUF_HASHFLAG_L4; lagg_proto_attach(sc, LAGG_PROTO_DEFAULT); @@ -1349,7 +1347,15 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd LAGG_WUNLOCK(sc); break; case SIOCGLAGGFLAGS: - rf->rf_flags = sc->sc_flags; + rf->rf_flags = 0; + LAGG_RLOCK(sc, &tracker); + if (sc->sc_flags & MBUF_HASHFLAG_L2) + rf->rf_flags |= LAGG_F_HASHL2; + if (sc->sc_flags & MBUF_HASHFLAG_L3) + rf->rf_flags |= LAGG_F_HASHL3; + if (sc->sc_flags & MBUF_HASHFLAG_L4) + rf->rf_flags |= LAGG_F_HASHL4; + LAGG_RUNLOCK(sc, &tracker); break; case SIOCSLAGGHASH: error = priv_check(td, PRIV_NET_LAGG); @@ -1360,8 +1366,13 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd break; } LAGG_WLOCK(sc); - sc->sc_flags &= ~LAGG_F_HASHMASK; - sc->sc_flags |= rf->rf_flags & LAGG_F_HASHMASK; + sc->sc_flags = 0; + if (rf->rf_flags & LAGG_F_HASHL2) + sc->sc_flags |= MBUF_HASHFLAG_L2; + if (rf->rf_flags & LAGG_F_HASHL3) + sc->sc_flags |= MBUF_HASHFLAG_L3; + if (rf->rf_flags & LAGG_F_HASHL4) + sc->sc_flags |= MBUF_HASHFLAG_L4; LAGG_WUNLOCK(sc); break; case SIOCGLAGGPORT: @@ -1806,120 +1817,6 @@ found: return (rval); } -static const void * -lagg_gethdr(struct mbuf *m, u_int off, u_int len, void *buf) -{ - if (m->m_pkthdr.len < (off + len)) { - return (NULL); - } else if (m->m_len < (off + len)) { - m_copydata(m, off, len, buf); - return (buf); - } - return (mtod(m, char *) + off); -} - -uint32_t -lagg_hashmbuf(struct lagg_softc *sc, struct mbuf *m, uint32_t key) -{ - uint16_t etype; - uint32_t p = key; - int off; - struct ether_header *eh; - const struct ether_vlan_header *vlan; -#ifdef INET - const struct ip *ip; - const uint32_t *ports; - int iphlen; -#endif -#ifdef INET6 - const struct ip6_hdr *ip6; - uint32_t flow; -#endif - union { -#ifdef INET - struct ip ip; -#endif -#ifdef INET6 - struct ip6_hdr ip6; -#endif - struct ether_vlan_header vlan; - uint32_t port; - } buf; - - - off = sizeof(*eh); - if (m->m_len < off) - goto out; - eh = mtod(m, struct ether_header *); - etype = ntohs(eh->ether_type); - if (sc->sc_flags & LAGG_F_HASHL2) { - p = fnv_32_buf(&eh->ether_shost, ETHER_ADDR_LEN, p); - p = fnv_32_buf(&eh->ether_dhost, ETHER_ADDR_LEN, p); - } - - /* Special handling for encapsulating VLAN frames */ - if ((m->m_flags & M_VLANTAG) && (sc->sc_flags & LAGG_F_HASHL2)) { - p = fnv_32_buf(&m->m_pkthdr.ether_vtag, - sizeof(m->m_pkthdr.ether_vtag), p); - } else if (etype == ETHERTYPE_VLAN) { - vlan = lagg_gethdr(m, off, sizeof(*vlan), &buf); - if (vlan == NULL) - goto out; - - if (sc->sc_flags & LAGG_F_HASHL2) - p = fnv_32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); - etype = ntohs(vlan->evl_proto); - off += sizeof(*vlan) - sizeof(*eh); - } - - switch (etype) { -#ifdef INET - case ETHERTYPE_IP: - ip = lagg_gethdr(m, off, sizeof(*ip), &buf); - if (ip == NULL) - goto out; - - if (sc->sc_flags & LAGG_F_HASHL3) { - p = fnv_32_buf(&ip->ip_src, sizeof(struct in_addr), p); - p = fnv_32_buf(&ip->ip_dst, sizeof(struct in_addr), p); - } - if (!(sc->sc_flags & LAGG_F_HASHL4)) - break; - switch (ip->ip_p) { - case IPPROTO_TCP: - case IPPROTO_UDP: - case IPPROTO_SCTP: - iphlen = ip->ip_hl << 2; - if (iphlen < sizeof(*ip)) - break; - off += iphlen; - ports = lagg_gethdr(m, off, sizeof(*ports), &buf); - if (ports == NULL) - break; - p = fnv_32_buf(ports, sizeof(*ports), p); - break; - } - break; -#endif -#ifdef INET6 - case ETHERTYPE_IPV6: - if (!(sc->sc_flags & LAGG_F_HASHL3)) - break; - ip6 = lagg_gethdr(m, off, sizeof(*ip6), &buf); - if (ip6 == NULL) - goto out; - - p = fnv_32_buf(&ip6->ip6_src, sizeof(struct in6_addr), p); - p = fnv_32_buf(&ip6->ip6_dst, sizeof(struct in6_addr), p); - flow = ip6->ip6_flow & IPV6_FLOWLABEL_MASK; - p = fnv_32_buf(&flow, sizeof(flow), p); /* IPv6 flow label */ - break; -#endif - } -out: - return (p); -} - int lagg_enqueue(struct ifnet *ifp, struct mbuf *m) { @@ -2087,15 +1984,12 @@ lagg_lb_attach(struct lagg_softc *sc) { struct lagg_port *lp; struct lagg_lb *lb; - uint32_t seed; lb = malloc(sizeof(struct lagg_lb), M_DEVBUF, M_WAITOK | M_ZERO); sc->sc_capabilities = IFCAP_LAGG_FULLDUPLEX; - seed = arc4random(); - lb->lb_key = FNV1_32_INIT; - lb->lb_key = fnv_32_buf(&seed, sizeof(seed), lb->lb_key); + lb->lb_key = m_ether_tcpip_hash_init(); sc->sc_psc = lb; SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) @@ -2160,7 +2054,7 @@ lagg_lb_start(struct lagg_softc *sc, str M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) p = m->m_pkthdr.flowid >> sc->flowid_shift; else - p = lagg_hashmbuf(sc, m, lb->lb_key); + p = m_ether_tcpip_hash(sc->sc_flags, m, lb->lb_key); p %= sc->sc_count; lp = lb->lb_ports[p]; Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Wed Mar 11 15:42:21 2015 (r279890) +++ head/sys/net/if_lagg.h Wed Mar 11 16:02:24 2015 (r279891) @@ -279,7 +279,6 @@ extern struct mbuf *(*lagg_input_p)(stru extern void (*lagg_linkstate_p)(struct ifnet *, int ); int lagg_enqueue(struct ifnet *, struct mbuf *); -uint32_t lagg_hashmbuf(struct lagg_softc *, struct mbuf *, uint32_t); SYSCTL_DECL(_net_link_lagg); Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_tx.c Wed Mar 11 15:42:21 2015 (r279890) +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Wed Mar 11 16:02:24 2015 (r279891) @@ -49,7 +49,6 @@ #include #include "mlx4_en.h" -#include "utils.h" enum { MAX_INLINE = 104, /* 128 - 16 - 4 - 4 */ @@ -699,10 +698,10 @@ static void build_inline_wqe(struct mlx4 tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f; } -static unsigned long hashrandom; +static uint32_t hashrandom; static void hashrandom_init(void *arg) { - hashrandom = random(); + hashrandom = m_ether_tcpip_hash_init(); } SYSINIT(hashrandom_init, SI_SUB_KLD, SI_ORDER_SECOND, &hashrandom_init, NULL); @@ -724,7 +723,7 @@ u16 mlx4_en_select_queue(struct net_devi if (M_HASHTYPE_GET(mb) != M_HASHTYPE_NONE) queue_index = mb->m_pkthdr.flowid; else - queue_index = mlx4_en_hashmbuf(MLX4_F_HASHL3 | MLX4_F_HASHL4, mb, hashrandom); + queue_index = m_ether_tcpip_hash(MBUF_HASHFLAG_L3 | MBUF_HASHFLAG_L4, mb, hashrandom); return ((queue_index % rings_p_up) + (up * rings_p_up)); } Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Mar 11 15:42:21 2015 (r279890) +++ head/sys/sys/mbuf.h Wed Mar 11 16:02:24 2015 (r279891) @@ -1190,6 +1190,15 @@ rt_m_getfib(struct mbuf *m) ((_m)->m_pkthdr.fibnum) = (_fib); \ } while (0) +/* flags passed as first argument for "m_ether_tcpip_hash()" */ +#define MBUF_HASHFLAG_L2 (1 << 2) +#define MBUF_HASHFLAG_L3 (1 << 3) +#define MBUF_HASHFLAG_L4 (1 << 4) + +/* mbuf hashing helper routines */ +uint32_t m_ether_tcpip_hash_init(void); +uint32_t m_ether_tcpip_hash(const uint32_t, const struct mbuf *, const uint32_t); + #ifdef MBUF_PROFILING void m_profile(struct mbuf *m); #define M_PROFILE(m) m_profile(m) From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 17:35:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 837E58A9; Wed, 11 Mar 2015 17:35:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6F1B7F8A; Wed, 11 Mar 2015 17:35:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2BHZ8nx027065; Wed, 11 Mar 2015 17:35:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2BHZ8rp027064; Wed, 11 Mar 2015 17:35:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503111735.t2BHZ8rp027064@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Mar 2015 17:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279892 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 17:35:08 -0000 Author: jhb Date: Wed Mar 11 17:35:07 2015 New Revision: 279892 URL: https://svnweb.freebsd.org/changeset/base/279892 Log: Resize receive socket buffers that support autosizing when receiving TCP data via direct data placement. Sponsored by: Chelsio MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_ddp.c Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Wed Mar 11 16:02:24 2015 (r279891) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Wed Mar 11 17:35:07 2015 (r279892) @@ -65,6 +65,13 @@ __FBSDID("$FreeBSD$"); #include "common/t4_tcb.h" #include "tom/t4_tom.h" +VNET_DECLARE(int, tcp_do_autorcvbuf); +#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) +VNET_DECLARE(int, tcp_autorcvbuf_inc); +#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) +VNET_DECLARE(int, tcp_autorcvbuf_max); +#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) + #define PPOD_SZ(n) ((n) * sizeof(struct pagepod)) #define PPOD_SIZE (PPOD_SZ(1)) @@ -411,6 +418,21 @@ handle_ddp_data(struct toepcb *toep, __b else discourage_ddp(toep); + /* receive buffer autosize */ + if (sb->sb_flags & SB_AUTOSIZE && + V_tcp_do_autorcvbuf && + sb->sb_hiwat < V_tcp_autorcvbuf_max && + len > (sbspace(sb) / 8 * 7)) { + unsigned int hiwat = sb->sb_hiwat; + unsigned int newsize = min(hiwat + V_tcp_autorcvbuf_inc, + V_tcp_autorcvbuf_max); + + if (!sbreserve_locked(sb, newsize, so, NULL)) + sb->sb_flags &= ~SB_AUTOSIZE; + else + toep->rx_credits += newsize - hiwat; + } + KASSERT(toep->sb_cc >= sbused(sb), ("%s: sb %p has more data (%d) than last time (%d).", __func__, sb, sbused(sb), toep->sb_cc)); From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 20:15:50 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5907BC3; Wed, 11 Mar 2015 20:15:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 B0FE6776; Wed, 11 Mar 2015 20:15:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2BKFoxp003422; Wed, 11 Mar 2015 20:15:50 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2BKFo3D003421; Wed, 11 Mar 2015 20:15:50 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201503112015.t2BKFo3D003421@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 11 Mar 2015 20:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279894 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 20:15:50 -0000 Author: rrs Date: Wed Mar 11 20:15:49 2015 New Revision: 279894 URL: https://svnweb.freebsd.org/changeset/base/279894 Log: You need to have the capabilities and not skip it if you are not on head.. otherwise the file pointer will be NULL and when you try to do something with it you will crash. Make the #else be the old capabilites, and then remove the erroneous ifdefs for 11. MFC after: 1 week (with the other MFC I was going to do until the panic) Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Wed Mar 11 19:04:01 2015 (r279893) +++ head/sys/dev/hwpmc/hwpmc_logging.c Wed Mar 11 20:15:49 2015 (r279894) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #if (__FreeBSD_version >= 1100000) #include +#else +#include #endif #include #include @@ -570,9 +572,7 @@ pmclog_configure_log(struct pmc_mdep *md { int error; struct proc *p; -#if (__FreeBSD_version >= 1100000) cap_rights_t rights; -#endif /* * As long as it is possible to get a LOR between pmc_sx lock and * proctree/allproc sx locks used for adding a new process, assure @@ -595,12 +595,11 @@ pmclog_configure_log(struct pmc_mdep *md po->po_file)); /* get a reference to the file state */ -#if (__FreeBSD_version >= 1100000) error = fget_write(curthread, logfd, cap_rights_init(&rights, CAP_WRITE), &po->po_file); if (error) goto error; -#endif + /* mark process as owning a log file */ po->po_flags |= PMC_PO_OWNS_LOGFILE; error = kproc_create(pmclog_loop, po, &po->po_kthread, From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 21:36:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D988182; Wed, 11 Mar 2015 21:36:08 +0000 (UTC) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (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 25DC2FEB; Wed, 11 Mar 2015 21:36:07 +0000 (UTC) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPSA id 4635E104B77; Wed, 11 Mar 2015 14:36:07 -0700 (PDT) Date: Wed, 11 Mar 2015 14:36:07 -0700 From: hiren panchasara To: "Simon J. Gerraty" Subject: Re: svn commit: r278729 - head/sys/sys Message-ID: <20150311213607.GN88380@strugglingcoder.info> References: <201502132319.t1DNJZuP057045@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="b6Y3a1uK/7FdRsLm" Content-Disposition: inline In-Reply-To: <201502132319.t1DNJZuP057045@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 21:36:08 -0000 --b6Y3a1uK/7FdRsLm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 02/13/15 at 11:19P, Simon J. Gerraty wrote: > Author: sjg > Date: Fri Feb 13 23:19:35 2015 > New Revision: 278729 > URL: https://svnweb.freebsd.org/changeset/base/278729 >=20 > Log: > sbspace: size of bleft, mleft must match sockbuf fields to avoid > overflow on amd64 > =20 > Submitted by: anshukla@juniper.net > Obtained from: Juniper Networks Talking to sjg on -arch to MFC this. If he cannot get around doing that, I'll do it tomorrow.=20 Letting people know here to see if there are any objections. Cheers, Hiren --b6Y3a1uK/7FdRsLm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJVALVGXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/loeQIAKM9X5vwiw6Cc7cpEsGXHsYV kZg6t82C8+S3PKzQPIR+c6ef1NOo+8T210dbf1+tzEKM3aklOkEgFjduwWDtPFI1 ILfyZct5wAErKp9nd0KOWvdtb1FPsILXcgGTII8jb6EtMXMTYiS5OqsJET/2ARxL uNjKE4Au+CLl5aOi6Ck/XQyToET7x19KEup6FttN9CTcG4qZincIUpDzWn73LXDC UCcP+6CMw4GcHQ1VWkmajNhx3oihSdUv4jHr9YzWwQqZLBPkMxMFZpZ7bs0eX9rc zU8honGJsyoQ4T3RqLyiuklW4LWOzYxODo4Oh9Y+JPcCMi5HN+DeDM9OCSk7jE0= =9jza -----END PGP SIGNATURE----- --b6Y3a1uK/7FdRsLm-- From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 22:47:53 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E727936; Wed, 11 Mar 2015 22:47:53 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bn0108.outbound.protection.outlook.com [157.56.110.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7403A61; Wed, 11 Mar 2015 22:47:50 +0000 (UTC) Received: from BY2PR05CA023.namprd05.prod.outlook.com (10.141.250.13) by DM2PR05MB446.namprd05.prod.outlook.com (10.141.104.142) with Microsoft SMTP Server (TLS) id 15.1.99.14; Wed, 11 Mar 2015 22:47:43 +0000 Received: from BN1AFFO11OLC004.protection.gbl (2a01:111:f400:7c10::179) by BY2PR05CA023.outlook.office365.com (2a01:111:e400:2c5f::13) with Microsoft SMTP Server (TLS) id 15.1.112.16 via Frontend Transport; Wed, 11 Mar 2015 22:47:43 +0000 Received: from P-EMF03-SAC.jnpr.net (66.129.239.17) by BN1AFFO11OLC004.mail.protection.outlook.com (10.58.53.75) with Microsoft SMTP Server (TLS) id 15.1.112.13 via Frontend Transport; Wed, 11 Mar 2015 22:47:42 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF03-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Wed, 11 Mar 2015 15:46:54 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t2BMkrD62546; Wed, 11 Mar 2015 15:46:53 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 7977C580A3; Wed, 11 Mar 2015 15:46:53 -0700 (PDT) To: hiren panchasara Subject: Re: svn commit: r278729 - head/sys/sys In-Reply-To: <20150311213607.GN88380@strugglingcoder.info> References: <201502132319.t1DNJZuP057045@svn.freebsd.org> <20150311213607.GN88380@strugglingcoder.info> Comments: In-reply-to: hiren panchasara message dated "Wed, 11 Mar 2015 14:36:07 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Wed, 11 Mar 2015 15:46:53 -0700 Message-ID: <22497.1426114013@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.17 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.129.239.17) smtp.mailfrom=sjg@juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:66.129.239.17; CTRY:US; IPV:NLI; EFV:NLI; BMV:0; SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(24454002)(47776003)(110136001)(50986999)(76176999)(33716001)(92566002)(106466001)(50226001)(46102003)(558084003)(62966003)(117636001)(86362001)(77156002)(19580395003)(48376002)(50466002)(87936001)(105596002)(76506005)(2950100001)(57986006)(77096005)(19580405001)(6806004)(42262002)(62816006)(6606295002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR05MB446; H:P-EMF03-SAC.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR05MB446; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5001009)(5005006); SRVR:DM2PR05MB446; BCL:0; PCL:0; RULEID:; SRVR:DM2PR05MB446; X-Forefront-PRVS: 0512CC5201 X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2015 22:47:42.9041 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.17]; Helo=[P-EMF03-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR05MB446 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 22:47:53 -0000 hiren panchasara wrote: > Talking to sjg on -arch to MFC this. If he cannot get around doing that, > I'll do it tomorrow. I can do it - assuming no one objects. From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 01:05:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 026E12D6; Thu, 12 Mar 2015 01:05:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 E14F3A88; Thu, 12 Mar 2015 01:05:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C15sfX046200; Thu, 12 Mar 2015 01:05:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C15sAF046199; Thu, 12 Mar 2015 01:05:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201503120105.t2C15sAF046199@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 12 Mar 2015 01:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279896 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 01:05:55 -0000 Author: markj Date: Thu Mar 12 01:05:54 2015 New Revision: 279896 URL: https://svnweb.freebsd.org/changeset/base/279896 Log: Document m_collapse(). Reported by: kmacy Reviewed by: kmacy MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Thu Mar 12 01:03:04 2015 (r279895) +++ head/share/man/man9/mbuf.9 Thu Mar 12 01:05:54 2015 (r279896) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2015 +.Dd March 11, 2015 .Dt MBUF 9 .Os .\" @@ -141,6 +141,8 @@ .Ft struct mbuf * .Fn m_defrag "struct mbuf *m0" "int how" .Ft struct mbuf * +.Fn m_collapse "struct mbuf *m0" "int how" "int maxfrags" +.Ft struct mbuf * .Fn m_unshare "struct mbuf *m0" "int how" .\" .Sh DESCRIPTION @@ -983,6 +985,20 @@ depending on the caller's preference. This function is especially useful in network drivers, where certain long mbuf chains must be shortened before being added to TX descriptor lists. +.It Fn m_collapse m0 how maxfrags +Defragment an mbuf chain, returning a chain of at most +.Fa maxfrags +mbufs and clusters. +If allocation fails or the chain cannot be collapsed as requested, +.Dv NULL +will be returned, with the original chain possibly modified. +As with +.Fn m_defrag , +.Fa how +should be one of +.Dv M_WAITOK +or +.Dv M_NOWAIT . .It Fn m_unshare m0 how Create a version of the specified mbuf chain whose contents can be safely modified without affecting other users. From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 03:46:11 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C597264; Thu, 12 Mar 2015 03:46:11 +0000 (UTC) Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [IPv6:2607:f8b0:4001:c03::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 40D48D21; Thu, 12 Mar 2015 03:46:11 +0000 (UTC) Received: by iegc3 with SMTP id c3so14580609ieg.3; Wed, 11 Mar 2015 20:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=3N6NGGVtqQvXjNsvBknZOEXd1ZrSbpLSLeYtCz7owc0=; b=a3ZalDzcIB/ChyLXLNJUN1IfSFFMfOGEHO51AJ0Gt9iIkdlETDXHnKdv1Z1FLsrxL1 WBMUT7FaVAM4hPCHLtxBp+ljQIbm0hlzvnP86u5aRxUjNkz+i2vodjLExhL3nSKOTaGq XYIhAcVqLvvGrZO/NqgOFk73hZuWkJNbCvG75fsKtpi6p39lEbmVqABoHbipNJFhMIv7 l0rUR9vXrwght1TvqC7kYNJqCJHI0RdKDqjF+jE/g/j47Ren+Jnlv4D4VIf4+fzg2u3p zSQaUqry4u4MvweV1AroHJ6mH3SzFDpgtPkkZR23q1xlZNQTw3INQwixZGAJ1FCs2d05 K/Iw== MIME-Version: 1.0 X-Received: by 10.202.133.131 with SMTP id h125mr30625044oid.23.1426131970627; Wed, 11 Mar 2015 20:46:10 -0700 (PDT) Sender: royger@gmail.com Received: by 10.60.22.199 with HTTP; Wed, 11 Mar 2015 20:46:10 -0700 (PDT) In-Reply-To: <3050157.0anzMatu84@ralph.baldwin.cx> References: <201503062034.t26KYSP2063973@svn.freebsd.org> <3050157.0anzMatu84@ralph.baldwin.cx> Date: Thu, 12 Mar 2015 12:46:10 +0900 X-Google-Sender-Auth: OJqgW7QWtx24j4BQn7Q431IOt8Y Message-ID: Subject: Re: svn commit: r279699 - in head/sys: amd64/amd64 i386/i386 From: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Sergey Kandaurov , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 03:46:11 -0000 Hello, On Tue, Mar 10, 2015 at 12:30 AM, John Baldwin wrote: > On Saturday, March 07, 2015 12:55:06 AM Sergey Kandaurov wrote: >> On 6 March 2015 at 23:34, John Baldwin wrote: >> > Author: jhb >> > Date: Fri Mar 6 20:34:28 2015 >> > New Revision: 279699 >> > URL: https://svnweb.freebsd.org/changeset/base/279699 >> > >> > Log: >> > Only schedule interrupts on a single hyperthread of a modern Intel CPU >> > core >> > by default. Previously we used a single hyperthread on Pentium4-era >> > cores but used both hyperthreads on more recent CPUs. >> > >> > MFC after: 2 weeks >> > >> > Modified: >> > head/sys/amd64/amd64/mp_machdep.c >> > head/sys/i386/i386/mp_machdep.c >> > >> > Modified: head/sys/amd64/amd64/mp_machdep.c >> > ========================================================================== >> > ==== --- head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 16:43:54 2015 >> > (r279698) +++ head/sys/amd64/amd64/mp_machdep.c Fri Mar 6 20:34:28 >> > 2015 (r279699) @@ -828,8 +828,8 @@ set_interrupt_apic_ids(void) >> > >> > continue; >> > >> > /* Don't let hyperthreads service interrupts. */ >> > >> > - if (hyperthreading_cpus > 1 && >> > - apic_id % hyperthreading_cpus != 0) >> > + if (cpu_logical > 1 && >> > + apic_id % cpu_logical != 0) >> > >> > continue; >> > >> > intr_add_cpu(i); >> > >> > Modified: head/sys/i386/i386/mp_machdep.c >> > ========================================================================== >> > ==== --- head/sys/i386/i386/mp_machdep.c Fri Mar 6 16:43:54 2015 >> > (r279698) +++ head/sys/i386/i386/mp_machdep.c Fri Mar 6 20:34:28 >> > 2015 (r279699) @@ -842,8 +842,8 @@ set_interrupt_apic_ids(void) >> > >> > continue; >> > >> > /* Don't let hyperthreads service interrupts. */ >> > >> > - if (hyperthreading_cpus > 1 && >> > - apic_id % hyperthreading_cpus != 0) >> > + if (cpu_logical > 1 && >> > + apic_id % cpu_logical != 0) >> > >> > continue; >> > >> > intr_add_cpu(i); >> >> There are another two similar cases at sys/i386/xen/mp_machdep.c >> Both look like a no-op: static global never gets written data, >> the condition is never satisfied. >> I guess these variables can be safely reduced for clarity there: >> hyperthreading_cpus, hyperthreading_cpus_mask under i386/xen. > > Yes, that file is rotted a bit. I think it is for a mode of Xen that Xen > doesn't intend to support in the future and that it will be dropped from our > tree altogether at some point? Roger probably has a better feel on this? Yes, the i386 PV port has completely bitrotted since a long time ago, and AFAIK nobody has interest in fixing it so I plan to remove it soon. Roger. From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 03:57:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A860F41C; Thu, 12 Mar 2015 03:57:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 79AC4DF6; Thu, 12 Mar 2015 03:57:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C3v1JT026947; Thu, 12 Mar 2015 03:57:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C3v0g9026940; Thu, 12 Mar 2015 03:57:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503120357.t2C3v0g9026940@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Mar 2015 03:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279898 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 03:57:01 -0000 Author: imp Date: Thu Mar 12 03:57:00 2015 New Revision: 279898 URL: https://svnweb.freebsd.org/changeset/base/279898 Log: Add support for specifying unsupported / broken options that override any defaults or user specified actions on the command line. This would be useful for specifying features that are always broken or that cannot make sense on a specific architecture, like ACPI on pc98 or EISA on !i386 (!x86 usage of EISA is broken and there's no supported hardware that could have it in any event). Any items in BROKEN_OPTIONS are forced to "no" regardless of other settings. Clients are expected change BROKEN_OPTIONS with +=. It will not be unset, so other parts of the build system can have visibility into the options that are broken on this platform, though this should be very rare. Differential Revision: https://reviews.freebsd.org/D2009 Modified: head/share/mk/bsd.mkopt.mk head/sys/conf/kern.opts.mk Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Thu Mar 12 01:30:36 2015 (r279897) +++ head/share/mk/bsd.mkopt.mk Thu Mar 12 03:57:00 2015 (r279898) @@ -18,6 +18,10 @@ # after all this processing, allowing this file to be included # multiple times with different lists. # +# Other parts of the build system will set BROKEN_OPTIONS to a list +# of options that are broken on this platform. This will not be unset +# before returning. Clients are expected to always += this variable. +# # Users should generally define WITH_FOO or WITHOUT_FOO, but the build # system should use MK_FOO={yes,no} when it needs to override the # user's desires or default behavior. @@ -58,3 +62,11 @@ MK_${var}:= no .endif # !defined(MK_${var}) .endfor .undef __DEFAULT_NO_OPTIONS + +# +# MK_* options which are always no, usually because they are +# unsupported/badly broken on this architecture. +# +.for var in ${BROKEN_OPTIONS} +MK_${var}:= no +.endfor Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Thu Mar 12 01:30:36 2015 (r279897) +++ head/sys/conf/kern.opts.mk Thu Mar 12 03:57:00 2015 (r279898) @@ -83,6 +83,16 @@ MK_${var}:= no .undef __DEFAULT_NO_OPTIONS # +# MK_* options which are always no, usually because they are +# unsupported/badly broken on this architecture. +# +.for var in ${BROKEN_OPTIONS} +MK_${var}:= no +.endfor +.undef BROKEN_OPTIONS +#end of bsd.mkopt.mk expanded inline. + +# # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". # @@ -104,6 +114,3 @@ MK_${var}_SUPPORT:= yes .endif .endif .endfor - - - From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 03:57:20 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD6F3562; Thu, 12 Mar 2015 03:57:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 988D4E02; Thu, 12 Mar 2015 03:57:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C3vK22027042; Thu, 12 Mar 2015 03:57:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C3vKGU027041; Thu, 12 Mar 2015 03:57:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503120357.t2C3vKGU027041@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Mar 2015 03:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279899 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 03:57:20 -0000 Author: imp Date: Thu Mar 12 03:57:19 2015 New Revision: 279899 URL: https://svnweb.freebsd.org/changeset/base/279899 Log: Categorize certain kernel builds as being broken in certain places. Differential Revision: https://reviews.freebsd.org/D2010 Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Thu Mar 12 03:57:00 2015 (r279898) +++ head/sys/conf/kern.opts.mk Thu Mar 12 03:57:19 2015 (r279899) @@ -48,6 +48,33 @@ __DEFAULT_NO_OPTIONS = \ NAND \ OFED +# Some options are totally broken on some architectures. We disable +# them. If you need to enable them on an experimental basis, you +# must change this code. + +# Things that don't work based on the CPU +.if ${MACHINE_CPUARCH} == "arm" +BROKEN_OPTIONS+= CDDL ZFS +.endif + +.if ${MACHINE_CPUARCH} == "mips" +BROKEN_OPTIONS+= CDDL ZFS +.endif + +.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} == "powerpc" +BROKEN_OPTIONS+= ZFS +.endif + +# Things that don't work because the kernel doesn't have the support +# for them. +.if ${MACHINE} != "i386" +BROKEN_OPTIONS+= EISA +.endif + +.if ${MACHINE} != "i386" && ${MACHINE} != "amd64" +BROKEN_OPTIONS+= OFED +.endif + # expanded inline from bsd.mkopt.mk to avoid share/mk dependency # Those that default to yes From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 06:41:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD091913; Thu, 12 Mar 2015 06:41:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 A7E6B367; Thu, 12 Mar 2015 06:41:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C6f2oG004619; Thu, 12 Mar 2015 06:41:02 GMT (envelope-from kmoore@FreeBSD.org) Received: (from kmoore@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C6f2Gp004618; Thu, 12 Mar 2015 06:41:02 GMT (envelope-from kmoore@FreeBSD.org) Message-Id: <201503120641.t2C6f2Gp004618@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kmoore set sender to kmoore@FreeBSD.org using -f From: Kris Moore Date: Thu, 12 Mar 2015 06:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279901 - head/usr.sbin/freebsd-update X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 06:41:02 -0000 Author: kmoore (ports committer) Date: Thu Mar 12 06:41:01 2015 New Revision: 279901 URL: https://svnweb.freebsd.org/changeset/base/279901 Log: - Include commas in valid file-name chars freebsd-update will support Approved by: cperciva Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Mar 12 06:25:41 2015 (r279900) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Mar 12 06:41:01 2015 (r279901) @@ -1231,7 +1231,7 @@ fetch_metadata_sanity () { # Some aliases to save space later: ${P} is a character which can # appear in a path; ${M} is the four numeric metadata fields; and # ${H} is a sha256 hash. - P="[-+./:=%@_[~[:alnum:]]" + P="[-+./:=,%@_[~[:alnum:]]" M="[0-9]+\|[0-9]+\|[0-9]+\|[0-9]+" H="[0-9a-f]{64}" From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 06:43:59 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DD63A7A; Thu, 12 Mar 2015 06:43:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 165AA5FE; Thu, 12 Mar 2015 06:43:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C6hwTV005606; Thu, 12 Mar 2015 06:43:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C6hwgi005605; Thu, 12 Mar 2015 06:43:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503120643.t2C6hwgi005605@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Mar 2015 06:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279902 - in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/iio include/dt-bindings/pinctrl include/dt-bindings/regulator include/dt-bindings/reset include/dt-bindi... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 06:43:59 -0000 Author: imp Date: Thu Mar 12 06:43:58 2015 New Revision: 279902 URL: https://svnweb.freebsd.org/changeset/base/279902 Log: File names with commas in them cause issues for freebsd-update. We don't actually use these files at the moment, so eliminate them until we actually do. In the mean time, freebsd-update will be updated to eliminate the issues. Requested by: cperciva Deleted: head/sys/gnu/dts/arm/alphascale-asm9260-devkit.dts head/sys/gnu/dts/arm/alphascale-asm9260.dtsi head/sys/gnu/dts/arm/axm5516-amarillo.dts head/sys/gnu/dts/arm/axm55xx.dtsi head/sys/gnu/dts/arm/exynos5250-snow.dts head/sys/gnu/dts/arm/exynos5420-peach-pit.dts head/sys/gnu/dts/arm/exynos5800-peach-pi.dts head/sys/gnu/dts/arm/mmp2-brownstone.dts head/sys/gnu/dts/arm/mmp2.dtsi head/sys/gnu/dts/arm/pxa168-aspenite.dts head/sys/gnu/dts/arm/pxa168.dtsi head/sys/gnu/dts/arm/pxa910-dkb.dts head/sys/gnu/dts/arm/pxa910.dtsi head/sys/gnu/dts/arm/qcom-apq8064-cm-qs600.dts head/sys/gnu/dts/arm/qcom-apq8064-ifc6410.dts head/sys/gnu/dts/arm/qcom-apq8064-v2.0.dtsi head/sys/gnu/dts/arm/qcom-apq8064.dtsi head/sys/gnu/dts/arm/qcom-apq8074-dragonboard.dts head/sys/gnu/dts/arm/qcom-apq8084-ifc6540.dts head/sys/gnu/dts/arm/qcom-apq8084-mtp.dts head/sys/gnu/dts/arm/qcom-apq8084.dtsi head/sys/gnu/dts/arm/qcom-ipq8064-ap148.dts head/sys/gnu/dts/arm/qcom-ipq8064-v1.0.dtsi head/sys/gnu/dts/arm/qcom-ipq8064.dtsi head/sys/gnu/dts/arm/qcom-msm8660-surf.dts head/sys/gnu/dts/arm/qcom-msm8660.dtsi head/sys/gnu/dts/arm/qcom-msm8960-cdp.dts head/sys/gnu/dts/arm/qcom-msm8960.dtsi head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-honami.dts head/sys/gnu/dts/arm/qcom-msm8974.dtsi head/sys/gnu/dts/arm/s3c6400.dtsi head/sys/gnu/dts/arm/s3c6410-mini6410.dts head/sys/gnu/dts/arm/s3c6410-smdk6410.dts head/sys/gnu/dts/arm/s3c6410.dtsi head/sys/gnu/dts/arm/s3c64xx-pinctrl.dtsi head/sys/gnu/dts/arm/s3c64xx.dtsi head/sys/gnu/dts/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk.dts head/sys/gnu/dts/arm/socfpga_arria5.dtsi head/sys/gnu/dts/arm/socfpga_arria5_socdk.dts head/sys/gnu/dts/arm/socfpga_cyclone5.dtsi head/sys/gnu/dts/arm/socfpga_cyclone5_socdk.dts head/sys/gnu/dts/arm/socfpga_cyclone5_sockit.dts head/sys/gnu/dts/arm/socfpga_cyclone5_socrates.dts head/sys/gnu/dts/arm/socfpga_vt.dts head/sys/gnu/dts/include/dt-bindings/clock/alphascale,asm9260.h head/sys/gnu/dts/include/dt-bindings/clock/lsi,axm5516-clks.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa168.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa910.h head/sys/gnu/dts/include/dt-bindings/clock/maxim,max77686.h head/sys/gnu/dts/include/dt-bindings/clock/maxim,max77802.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-apq8084.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq806x.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8660.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8974.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-ipq806x.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-apq8084.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8974.h head/sys/gnu/dts/include/dt-bindings/clock/rockchip,rk808.h head/sys/gnu/dts/include/dt-bindings/clock/samsung,s3c64xx-clock.h head/sys/gnu/dts/include/dt-bindings/iio/ head/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-gpio.h head/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-mpp.h head/sys/gnu/dts/include/dt-bindings/regulator/ head/sys/gnu/dts/include/dt-bindings/reset/ head/sys/gnu/dts/include/dt-bindings/soc/ From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 07:05:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D5FAE35; Thu, 12 Mar 2015 07:05:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 7E511833; Thu, 12 Mar 2015 07:05:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C75TEK015429; Thu, 12 Mar 2015 07:05:29 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C75S0X015427; Thu, 12 Mar 2015 07:05:28 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201503120705.t2C75S0X015427@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 12 Mar 2015 07:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279903 - head/sys/dev/mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 07:05:29 -0000 Author: yongari Date: Thu Mar 12 07:05:28 2015 New Revision: 279903 URL: https://svnweb.freebsd.org/changeset/base/279903 Log: Add RTL8211F gigabit PHY support. PR: 197265 MFC after: 2 weeks Modified: head/sys/dev/mii/rgephy.c head/sys/dev/mii/rgephyreg.h Modified: head/sys/dev/mii/rgephy.c ============================================================================== --- head/sys/dev/mii/rgephy.c Thu Mar 12 06:43:58 2015 (r279902) +++ head/sys/dev/mii/rgephy.c Thu Mar 12 07:05:28 2015 (r279903) @@ -87,6 +87,7 @@ static int rgephy_service(struct mii_sof static void rgephy_status(struct mii_softc *); static int rgephy_mii_phy_auto(struct mii_softc *, int); static void rgephy_reset(struct mii_softc *); +static int rgephy_linkup(struct mii_softc *); static void rgephy_loop(struct mii_softc *); static void rgephy_load_dspcode(struct mii_softc *); @@ -147,7 +148,7 @@ static int rgephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int reg, speed, gig, anar; + int speed, gig, anar; switch (cmd) { case MII_POLLSTAT: @@ -237,20 +238,9 @@ setit: * Check to see if we have link. If we do, we don't * need to restart the autonegotiation process. */ - if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && - sc->mii_mpd_rev >= 2) { - /* RTL8211B(L) */ - reg = PHY_READ(sc, RGEPHY_MII_SSR); - if (reg & RGEPHY_SSR_LINK) { - sc->mii_ticks = 0; - break; - } - } else { - reg = PHY_READ(sc, RL_GMEDIASTAT); - if (reg & RL_GMEDIASTAT_LINK) { - sc->mii_ticks = 0; - break; - } + if (rgephy_linkup(sc) != 0) { + sc->mii_ticks = 0; + break; } /* Announce link loss right after it happens. */ @@ -283,6 +273,33 @@ setit: return (0); } +static int +rgephy_linkup(struct mii_softc *sc) +{ + int linkup; + uint16_t reg; + + linkup = 0; + if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && + sc->mii_mpd_rev >= RGEPHY_8211B) { + if (sc->mii_mpd_rev == RGEPHY_8211F) { + reg = PHY_READ(sc, RGEPHY_F_MII_SSR); + if (reg & RGEPHY_F_SSR_LINK) + linkup++; + } else { + reg = PHY_READ(sc, RGEPHY_MII_SSR); + if (reg & RGEPHY_SSR_LINK) + linkup++; + } + } else { + reg = PHY_READ(sc, RL_GMEDIASTAT); + if (reg & RL_GMEDIASTAT_LINK) + linkup++; + } + + return (linkup); +} + static void rgephy_status(struct mii_softc *sc) { @@ -293,18 +310,10 @@ rgephy_status(struct mii_softc *sc) mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; - if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev >= 2) { - ssr = PHY_READ(sc, RGEPHY_MII_SSR); - if (ssr & RGEPHY_SSR_LINK) - mii->mii_media_status |= IFM_ACTIVE; - } else { - bmsr = PHY_READ(sc, RL_GMEDIASTAT); - if (bmsr & RL_GMEDIASTAT_LINK) - mii->mii_media_status |= IFM_ACTIVE; - } + if (rgephy_linkup(sc) != 0) + mii->mii_media_status |= IFM_ACTIVE; bmsr = PHY_READ(sc, RGEPHY_MII_BMSR); - bmcr = PHY_READ(sc, RGEPHY_MII_BMCR); if (bmcr & RGEPHY_BMCR_ISO) { mii->mii_media_active |= IFM_NONE; @@ -323,26 +332,50 @@ rgephy_status(struct mii_softc *sc) } } - if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev >= 2) { - ssr = PHY_READ(sc, RGEPHY_MII_SSR); - switch (ssr & RGEPHY_SSR_SPD_MASK) { - case RGEPHY_SSR_S1000: - mii->mii_media_active |= IFM_1000_T; - break; - case RGEPHY_SSR_S100: - mii->mii_media_active |= IFM_100_TX; - break; - case RGEPHY_SSR_S10: - mii->mii_media_active |= IFM_10_T; - break; - default: - mii->mii_media_active |= IFM_NONE; - break; + if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && + sc->mii_mpd_rev >= RGEPHY_8211B) { + if (sc->mii_mpd_rev == RGEPHY_8211F) { + ssr = PHY_READ(sc, RGEPHY_F_MII_SSR); + switch (ssr & RGEPHY_F_SSR_SPD_MASK) { + case RGEPHY_F_SSR_S1000: + mii->mii_media_active |= IFM_1000_T; + break; + case RGEPHY_F_SSR_S100: + mii->mii_media_active |= IFM_100_TX; + break; + case RGEPHY_F_SSR_S10: + mii->mii_media_active |= IFM_10_T; + break; + default: + mii->mii_media_active |= IFM_NONE; + break; + } + if (ssr & RGEPHY_F_SSR_FDX) + mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; + + } else { + ssr = PHY_READ(sc, RGEPHY_MII_SSR); + switch (ssr & RGEPHY_SSR_SPD_MASK) { + case RGEPHY_SSR_S1000: + mii->mii_media_active |= IFM_1000_T; + break; + case RGEPHY_SSR_S100: + mii->mii_media_active |= IFM_100_TX; + break; + case RGEPHY_SSR_S10: + mii->mii_media_active |= IFM_10_T; + break; + default: + mii->mii_media_active |= IFM_NONE; + break; + } + if (ssr & RGEPHY_SSR_FDX) + mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } - if (ssr & RGEPHY_SSR_FDX) - mii->mii_media_active |= IFM_FDX; - else - mii->mii_media_active |= IFM_HDX; } else { bmsr = PHY_READ(sc, RL_GMEDIASTAT); if (bmsr & RL_GMEDIASTAT_1000MBPS) @@ -396,7 +429,7 @@ rgephy_loop(struct mii_softc *sc) int i; if (sc->mii_mpd_model != MII_MODEL_REALTEK_RTL8251 && - sc->mii_mpd_rev < 2) { + sc->mii_mpd_rev < RGEPHY_8211B) { PHY_WRITE(sc, RGEPHY_MII_BMCR, RGEPHY_BMCR_PDOWN); DELAY(1000); } @@ -430,7 +463,7 @@ rgephy_load_dspcode(struct mii_softc *sc int val; if (sc->mii_mpd_model == MII_MODEL_REALTEK_RTL8251 || - sc->mii_mpd_rev >= 2) + sc->mii_mpd_rev >= RGEPHY_8211B) return; PHY_WRITE(sc, 31, 0x0001); @@ -481,22 +514,34 @@ rgephy_reset(struct mii_softc *sc) { uint16_t pcr, ssr; - if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev == 3) { - /* RTL8211C(L) */ - ssr = PHY_READ(sc, RGEPHY_MII_SSR); - if ((ssr & RGEPHY_SSR_ALDPS) != 0) { - ssr &= ~RGEPHY_SSR_ALDPS; - PHY_WRITE(sc, RGEPHY_MII_SSR, ssr); + switch (sc->mii_mpd_rev) { + case RGEPHY_8211F: + pcr = PHY_READ(sc, RGEPHY_F_MII_PCR1); + if ((pcr & RGEPHY_F_PCR1_MDI_MM) != 0) { + pcr &= ~RGEPHY_F_PCR1_MDI_MM; + PHY_WRITE(sc, RGEPHY_F_MII_PCR1, pcr); } - } - - if (sc->mii_mpd_rev >= 2) { - pcr = PHY_READ(sc, RGEPHY_MII_PCR); - if ((pcr & RGEPHY_PCR_MDIX_AUTO) == 0) { - pcr &= ~RGEPHY_PCR_MDI_MASK; - pcr |= RGEPHY_PCR_MDIX_AUTO; - PHY_WRITE(sc, RGEPHY_MII_PCR, pcr); + break; + case RGEPHY_8211C: + if ((sc->mii_flags & MIIF_PHYPRIV0) == 0) { + /* RTL8211C(L) */ + ssr = PHY_READ(sc, RGEPHY_MII_SSR); + if ((ssr & RGEPHY_SSR_ALDPS) != 0) { + ssr &= ~RGEPHY_SSR_ALDPS; + PHY_WRITE(sc, RGEPHY_MII_SSR, ssr); + } + } + break; + default: + if (sc->mii_mpd_rev >= RGEPHY_8211B) { + pcr = PHY_READ(sc, RGEPHY_MII_PCR); + if ((pcr & RGEPHY_PCR_MDIX_AUTO) == 0) { + pcr &= ~RGEPHY_PCR_MDI_MASK; + pcr |= RGEPHY_PCR_MDIX_AUTO; + PHY_WRITE(sc, RGEPHY_MII_PCR, pcr); + } } + break; } mii_phy_reset(sc); Modified: head/sys/dev/mii/rgephyreg.h ============================================================================== --- head/sys/dev/mii/rgephyreg.h Thu Mar 12 06:43:58 2015 (r279902) +++ head/sys/dev/mii/rgephyreg.h Thu Mar 12 07:05:28 2015 (r279903) @@ -35,6 +35,10 @@ #ifndef _DEV_MII_RGEPHYREG_H_ #define _DEV_MII_RGEPHYREG_H_ +#define RGEPHY_8211B 2 +#define RGEPHY_8211C 3 +#define RGEPHY_8211F 6 + /* * RealTek 8169S/8110S gigE PHY registers */ @@ -162,4 +166,21 @@ #define RGEPHY_SSR_ALDPS 0x0008 /* RTL8211C(L) only */ #define RGEPHY_SSR_JABBER 0x0001 /* Jabber */ +/* RTL8211F */ +#define RGEPHY_F_MII_PCR1 0x18 /* PHY Specific control register 1 */ +#define RGEPHY_F_PCR1_MDI_MM 0x0200 /* MDI / MDIX Manual Mode */ +#define RGEPHY_F_PCR1_MDI_MODE 0x0100 /* MDI Mode (0=MDIX,1=MDI) */ +#define RGEPHY_F_PCR1_ALDPS_EN 0x0004 /* Link Down Power Saving Enable */ + +/* RTL8211F */ +#define RGEPHY_F_MII_SSR 0x1A /* PHY Specific status register */ +#define RGEPHY_F_SSR_S1000 0x0020 /* 1000Mbps */ +#define RGEPHY_F_SSR_S100 0x0010 /* 100Mbps */ +#define RGEPHY_F_SSR_S10 0x0000 /* 10Mbps */ +#define RGEPHY_F_SSR_SPD_MASK 0x0030 +#define RGEPHY_F_SSR_FDX 0x0008 /* full duplex */ +#define RGEPHY_F_SSR_LINK 0x0004 /* link up */ +#define RGEPHY_F_SSR_MDI 0x0002 /* MDI/MDIX */ +#define RGEPHY_F_SSR_JABBER 0x0001 /* Jabber */ + #endif /* _DEV_RGEPHY_MIIREG_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 08:32:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85AECC5D; Thu, 12 Mar 2015 08:32:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 71989199; Thu, 12 Mar 2015 08:32:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C8WNOa057203; Thu, 12 Mar 2015 08:32:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C8WNtp057202; Thu, 12 Mar 2015 08:32:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503120832.t2C8WNtp057202@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Mar 2015 08:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279906 - head/usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 08:32:23 -0000 Author: imp Date: Thu Mar 12 08:32:22 2015 New Revision: 279906 URL: https://svnweb.freebsd.org/changeset/base/279906 Log: These local variables are unused. gc them. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Mar 12 08:32:20 2015 (r279905) +++ head/usr.bin/Makefile Thu Mar 12 08:32:22 2015 (r279906) @@ -196,12 +196,9 @@ SUBDIR= ${_addr2line} \ write \ xargs \ xinstall \ - ${_xlint} \ xo \ - ${_xstr} \ xz \ xzdec \ - ${_yacc} \ yes \ ${_ypcat} \ ${_ypmatch} \ From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 08:32:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96CECB88; Thu, 12 Mar 2015 08:32:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 82871198; Thu, 12 Mar 2015 08:32:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C8WLfV057155; Thu, 12 Mar 2015 08:32:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C8WLMj057154; Thu, 12 Mar 2015 08:32:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503120832.t2C8WLMj057154@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Mar 2015 08:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279905 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 08:32:21 -0000 Author: imp Date: Thu Mar 12 08:32:20 2015 New Revision: 279905 URL: https://svnweb.freebsd.org/changeset/base/279905 Log: It appears that xlint isn't used in the build process, so it certainly doesn't need to be a build tool. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Mar 12 07:07:41 2015 (r279904) +++ head/Makefile.inc1 Thu Mar 12 08:32:20 2015 (r279905) @@ -1484,7 +1484,6 @@ cross-tools: .MAKE ${_binutils} \ ${_elftctools} \ ${_cc} \ - usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ ${_btxld} \ ${_crunchide} \ ${_kgzip} \ From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 08:32:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E3F1C7D; Thu, 12 Mar 2015 08:32:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 7A3A619A; Thu, 12 Mar 2015 08:32:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C8WPSc057248; Thu, 12 Mar 2015 08:32:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C8WP9H057247; Thu, 12 Mar 2015 08:32:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503120832.t2C8WP9H057247@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Mar 2015 08:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279907 - head/usr.bin/xlint X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 08:32:25 -0000 Author: imp Date: Thu Mar 12 08:32:24 2015 New Revision: 279907 URL: https://svnweb.freebsd.org/changeset/base/279907 Log: TARGET_* shouldn't be used here. Use MACHINE_* instead. Modified: head/usr.bin/xlint/Makefile.inc Modified: head/usr.bin/xlint/Makefile.inc ============================================================================== --- head/usr.bin/xlint/Makefile.inc Thu Mar 12 08:32:22 2015 (r279906) +++ head/usr.bin/xlint/Makefile.inc Thu Mar 12 08:32:24 2015 (r279907) @@ -5,18 +5,10 @@ WARNS?= 0 .PATH: ${.CURDIR}/../common -# These assignments duplicate much of the functionality of -# MACHINE_CPUARCH, but there's no easy way to export make functions... -.if defined(TARGET_ARCH) -TARGET_CPUARCH= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/} +.if exists(${.CURDIR}/../arch/${MACHINE_ARCH}) +CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH} .else -TARGET_CPUARCH= ${MACHINE_CPUARCH} -TARGET_ARCH= ${MACHINE_ARCH} -.endif -.if exists(${.CURDIR}/../arch/${TARGET_ARCH}) -CFLAGS+= -I${.CURDIR}/../arch/${TARGET_ARCH} -.else -CFLAGS+= -I${.CURDIR}/../arch/${TARGET_CPUARCH} +CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_CPUARCH} .endif CFLAGS+= -I${.CURDIR}/../common From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 08:40:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFD9A2EF; Thu, 12 Mar 2015 08:40:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 BB6C1216; Thu, 12 Mar 2015 08:40:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C8eXUP061629; Thu, 12 Mar 2015 08:40:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C8eXuv061628; Thu, 12 Mar 2015 08:40:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503120840.t2C8eXuv061628@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Mar 2015 08:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279908 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 08:40:33 -0000 Author: emaste Date: Thu Mar 12 08:40:32 2015 New Revision: 279908 URL: https://svnweb.freebsd.org/changeset/base/279908 Log: Provide automatic cross-binutils path if no BINUTILS_BOOTSTRAP The in-tree binutils does not support arm64, so will not work for the forthcoming FreeBSD arm64 port. BROKEN_OPTIONS will include BINUTILS_BOOTSTRAP, so provide a default CROSS_BINUTILS_PREFIX for this case. Reviewed by: imp Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Mar 12 08:32:24 2015 (r279907) +++ head/Makefile.inc1 Thu Mar 12 08:40:32 2015 (r279908) @@ -318,6 +318,19 @@ LOCALBASE?= /usr/local CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} .endif + +# If we do not have a bootstrap binutils (because the in-tree one does not +# support the target architecture), provide a default cross-binutils prefix. +# This allows aarch64 builds, for example, to automatically use the +# aarch64-binutils port or package. +.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ + !defined(CROSS_BINUTILS_PREFIX) +CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ +.if !exists(${CROSS_BINUTILS_PREFIX}) +.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. +.endif +.endif + XCOMPILERS= CC CXX CPP .for COMPILER in ${XCOMPILERS} .if defined(CROSS_COMPILER_PREFIX) From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 08:52:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBD237B4; Thu, 12 Mar 2015 08:52:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 A6E425E9; Thu, 12 Mar 2015 08:52:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C8q1ge067271; Thu, 12 Mar 2015 08:52:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C8q1YG067270; Thu, 12 Mar 2015 08:52:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503120852.t2C8q1YG067270@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Mar 2015 08:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279909 - head/contrib/jemalloc/include/jemalloc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 08:52:01 -0000 Author: emaste Date: Thu Mar 12 08:52:00 2015 New Revision: 279909 URL: https://svnweb.freebsd.org/changeset/base/279909 Log: Add aarch64 (arm64) #define for jemalloc Sponsored by: The FreeBSD Foundation Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Mar 12 08:40:32 2015 (r279908) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Mar 12 08:52:00 2015 (r279909) @@ -40,6 +40,9 @@ #ifdef __arm__ # define LG_SIZEOF_PTR 2 #endif +#ifdef __aarch64__ +# define LG_SIZEOF_PTR 3 +#endif #ifdef __mips__ #ifdef __mips_n64 # define LG_SIZEOF_PTR 3 From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 08:57:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9D3BA00; Thu, 12 Mar 2015 08:57:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 A565962D; Thu, 12 Mar 2015 08:57:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2C8vPf4067975; Thu, 12 Mar 2015 08:57:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2C8vPqA067974; Thu, 12 Mar 2015 08:57:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503120857.t2C8vPqA067974@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Mar 2015 08:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279910 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 08:57:25 -0000 Author: ae Date: Thu Mar 12 08:57:24 2015 New Revision: 279910 URL: https://svnweb.freebsd.org/changeset/base/279910 Log: Reset mbuf pointer to NULL in fastroute case to indicate that mbuf was consumed by filter. This fixes several panics due to accessing to mbuf after free. Submitted by: Kristof Provost MFC after: 1 week Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Mar 12 08:52:00 2015 (r279909) +++ head/sys/netpfil/pf/pf.c Thu Mar 12 08:57:24 2015 (r279910) @@ -5470,6 +5470,7 @@ pf_route6(struct mbuf **m, struct pf_rul PF_STATE_UNLOCK(s); m0->m_flags |= M_SKIP_FIREWALL; ip6_output(m0, NULL, NULL, 0, NULL, NULL, NULL); + *m = NULL; return; } From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 09:40:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F22F1919; Thu, 12 Mar 2015 09:40:14 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id B4327B3C; Thu, 12 Mar 2015 09:40:14 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 9D019780D0E; Thu, 12 Mar 2015 20:12:25 +1100 (AEDT) Date: Thu, 12 Mar 2015 20:12:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r279905 - head In-Reply-To: <201503120832.t2C8WLMj057154@svn.freebsd.org> Message-ID: <20150312195943.Q1351@besplex.bde.org> References: <201503120832.t2C8WLMj057154@svn.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.1 cv=baJSDo/B c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=ota8xrK1pAppv_RWnUgA:9 a=CjuIK1q_8ugA:10 a=BEHm7MUIhHwA:10 a=pMBbhQ5KQJoA:10 a=yErhdlsy_hEA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 09:40:15 -0000 On Thu, 12 Mar 2015, Warner Losh wrote: > Log: > It appears that xlint isn't used in the build process, so it certainly > doesn't need to be a build tool. It does appear to be used for lint.7 and lint libraries, just like in 2002 when it was added to cross-tools. It never was a build-tool. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 10:05:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 182061C8; Thu, 12 Mar 2015 10:05:25 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id CBD83E32; Thu, 12 Mar 2015 10:05:23 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 9607F783378; Thu, 12 Mar 2015 21:05:20 +1100 (AEDT) Date: Thu, 12 Mar 2015 21:05:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff Subject: Re: svn commit: r279764 - head/sys/vm In-Reply-To: <20150310103046.GV17947@FreeBSD.org> Message-ID: <20150312201342.W1351@besplex.bde.org> References: <201503080213.t282DlXj012465@svn.freebsd.org> <20150310100141.GS17947@FreeBSD.org> <20150310101812.GS2379@kib.kiev.ua> <20150310103046.GV17947@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.1 cv=Za4kaKlA c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=kc-W-k2yH3fbE6mVY34A:9 a=CjuIK1q_8ugA:10 Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 10:05:25 -0000 On Tue, 10 Mar 2015, Gleb Smirnoff wrote: > On Tue, Mar 10, 2015 at 12:18:13PM +0200, Konstantin Belousov wrote: > K> On Tue, Mar 10, 2015 at 01:01:41PM +0300, Gleb Smirnoff wrote: > K> > On Sun, Mar 08, 2015 at 02:13:47AM +0000, Konstantin Belousov wrote: > K> > K> Author: kib > K> > K> Date: Sun Mar 8 02:13:46 2015 > K> > K> New Revision: 279764 > K> > K> URL: https://svnweb.freebsd.org/changeset/base/279764 > K> > K> > K> > K> Log: > K> > K> Fix function name in the panic message. > K> > > K> > Why not use "%s, __func__" always and never encounter this problem > K> > in future? > K> > K> Because you cannot grep for the panic string when __func__ is used. It would also be an an obfuscation. > Grepping for panic string doesn't work in general. Yes it does. The string just needs to be reasonably unique. Even a mispelled function name is usually unique enough. Only function names like f or printf would give too many matches. __func__ is not unique enough. Neither are short format strings like "%d, %d, %d". Longer format strings might be unique enough, but are harder to type. > A panic message > can report pointers or numbers, which make text not unique. Actually, Uniqueness is not needed. Even for a function name you would probably only type a part of the name that you hope is unique, then examine the grep output to see if more context is needed. > the messages that do report extra information are more useful. Also, I consider them as usually just bloat. Use a debugger to find more info. Unfortunately, not all users can run debuggers, and optimization is now excessive so it breaks finding variable values. > if panic string resides in the source code under several levels of > indentation, it is likely to be split into two lines. That would be another obfuscation. Much worse that using __func__. > But you can always grep for the function name and locate the panic > or KASSERT in the function manually, which isn't a big deal. And > if %s, __func__ is used, you will never get to a wrong function. Better yet, spell all function names as __func__ or "this" in comments so that they are write-only there too ;-). Even better yet, spell all function names as __func__ in calls too. Something like __func__ would work for determining the function to call only for recursive calls. __func__ itself doesn't work for that since it is a string. Determining the name of a different function is more difficult. If I knew C++, I might be able to give an example using "this". In C I don't see a better obfuscation (that can be easily written) than using macros to change hard-to-type function names like printf to that_there_func_0. The name of the current function is of course this_here_func ;-). To actually be easier to type, change to names like _0, _1, _2, etc. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 10:20:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4535D667; Thu, 12 Mar 2015 10:20:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 18063F67; Thu, 12 Mar 2015 10:20:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CAKrOu009498; Thu, 12 Mar 2015 10:20:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CAKrd7009497; Thu, 12 Mar 2015 10:20:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503121020.t2CAKrd7009497@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Mar 2015 10:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279913 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 10:20:54 -0000 Author: mav Date: Thu Mar 12 10:20:53 2015 New Revision: 279913 URL: https://svnweb.freebsd.org/changeset/base/279913 Log: Fix couple BIO_DELETE bugs in geom_mirror. Do not report GEOM::candelete if none of providers support BIO_DELETE. If consumer still requests BIO_DELETE, report error instead of hanging. MFC after: 2 weeks Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Thu Mar 12 09:16:50 2015 (r279912) +++ head/sys/geom/mirror/g_mirror.c Thu Mar 12 10:20:53 2015 (r279913) @@ -1021,6 +1021,23 @@ g_mirror_sync_done(struct bio *bp) } static void +g_mirror_candelete(struct bio *bp) +{ + struct g_mirror_softc *sc; + struct g_mirror_disk *disk; + int *val; + + sc = bp->bio_to->geom->softc; + LIST_FOREACH(disk, &sc->sc_disks, d_next) { + if (disk->d_flags & G_MIRROR_DISK_FLAG_CANDELETE) + break; + } + val = (int *)bp->bio_data; + *val = (disk != NULL); + g_io_deliver(bp, 0); +} + +static void g_mirror_kernel_dump(struct bio *bp) { struct g_mirror_softc *sc; @@ -1114,9 +1131,10 @@ g_mirror_start(struct bio *bp) g_mirror_flush(sc, bp); return; case BIO_GETATTR: - if (g_handleattr_int(bp, "GEOM::candelete", 1)) + if (!strcmp(bp->bio_attribute, "GEOM::candelete")) { + g_mirror_candelete(bp); return; - else if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { + } else if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { g_mirror_kernel_dump(bp); return; } @@ -1680,6 +1698,10 @@ g_mirror_register_request(struct bio *bp ("Consumer %s not opened (r%dw%de%d).", cp->provider->name, cp->acr, cp->acw, cp->ace)); } + if (bioq_first(&queue) == NULL) { + g_io_deliver(bp, EOPNOTSUPP); + return; + } while ((cbp = bioq_takefirst(&queue)) != NULL) { G_MIRROR_LOGREQ(3, cbp, "Sending request."); cp = cbp->bio_caller1; From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 12:14:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51741858; Thu, 12 Mar 2015 12:14:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 3C5ADE8A; Thu, 12 Mar 2015 12:14:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CCEClA064607; Thu, 12 Mar 2015 12:14:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CCECoZ064606; Thu, 12 Mar 2015 12:14:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503121214.t2CCECoZ064606@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 12 Mar 2015 12:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279914 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 12:14:12 -0000 Author: trasz Date: Thu Mar 12 12:14:11 2015 New Revision: 279914 URL: https://svnweb.freebsd.org/changeset/base/279914 Log: Options from auto_master must be appended to options from maps, not prepended. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automountd.c Modified: head/usr.sbin/autofs/automountd.c ============================================================================== --- head/usr.sbin/autofs/automountd.c Thu Mar 12 10:20:53 2015 (r279913) +++ head/usr.sbin/autofs/automountd.c Thu Mar 12 12:14:11 2015 (r279914) @@ -232,7 +232,11 @@ handle_request(const struct autofs_daemo } options = node_options(node); - options = concat(adr->adr_options, ',', options); + + /* + * Append options from auto_master. + */ + options = concat(options, ',', adr->adr_options); /* * Prepend options passed via automountd(8) command line. From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 12:17:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DB5DA6E; Thu, 12 Mar 2015 12:17:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 1E593EB7; Thu, 12 Mar 2015 12:17:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CCHGoM065066; Thu, 12 Mar 2015 12:17:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CCHG2f065060; Thu, 12 Mar 2015 12:17:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503121217.t2CCHG2f065060@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 12 Mar 2015 12:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279915 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 12:17:17 -0000 Author: trasz Date: Thu Mar 12 12:17:15 2015 New Revision: 279915 URL: https://svnweb.freebsd.org/changeset/base/279915 Log: Make concat() accept NULL arguments. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automount.c head/usr.sbin/autofs/automountd.c head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/automount.c ============================================================================== --- head/usr.sbin/autofs/automount.c Thu Mar 12 12:14:11 2015 (r279914) +++ head/usr.sbin/autofs/automount.c Thu Mar 12 12:17:15 2015 (r279915) @@ -345,11 +345,7 @@ main_automount(int argc, char **argv) force_unmount = true; break; case 'o': - if (options == NULL) { - options = checked_strdup(optarg); - } else { - options = concat(options, ',', optarg); - } + options = concat(options, ',', optarg); break; case 'u': do_unmount = true; @@ -385,9 +381,7 @@ main_automount(int argc, char **argv) parse_master(root, AUTO_MASTER_PATH); if (show_maps) { - if (options != NULL) { - root->n_options = concat(options, ',', root->n_options); - } + root->n_options = concat(options, ',', root->n_options); if (show_maps > 1) { node_expand_indirect_maps(root); node_expand_ampersand(root, NULL); Modified: head/usr.sbin/autofs/automountd.c ============================================================================== --- head/usr.sbin/autofs/automountd.c Thu Mar 12 12:14:11 2015 (r279914) +++ head/usr.sbin/autofs/automountd.c Thu Mar 12 12:17:15 2015 (r279915) @@ -241,8 +241,7 @@ handle_request(const struct autofs_daemo /* * Prepend options passed via automountd(8) command line. */ - if (cmdline_options != NULL) - options = concat(cmdline_options, ',', options); + options = concat(cmdline_options, ',', options); if (node->n_location == NULL) { log_debugx("found node defined at %s:%d; not a mountpoint", @@ -455,11 +454,7 @@ main_automountd(int argc, char **argv) maxproc = atoi(optarg); break; case 'o': - if (options == NULL) { - options = checked_strdup(optarg); - } else { - options = concat(options, ',', optarg); - } + options = concat(options, ',', optarg); break; case 'v': debug++; Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Thu Mar 12 12:14:11 2015 (r279914) +++ head/usr.sbin/autofs/common.c Thu Mar 12 12:17:15 2015 (r279915) @@ -94,8 +94,10 @@ concat(const char *s1, char separator, c char *result; int ret; - assert(s1 != NULL); - assert(s2 != NULL); + if (s1 == NULL) + s1 = ""; + if (s2 == NULL) + s2 = ""; /* * If s2 starts with separator - skip it; otherwise concatenating From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 12:36:10 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04ACFF5C; Thu, 12 Mar 2015 12:36:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 E35EB138; Thu, 12 Mar 2015 12:36:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CCa93N074265; Thu, 12 Mar 2015 12:36:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CCa9OP074262; Thu, 12 Mar 2015 12:36:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503121236.t2CCa9OP074262@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 12 Mar 2015 12:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279916 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 12:36:10 -0000 Author: trasz Date: Thu Mar 12 12:36:08 2015 New Revision: 279916 URL: https://svnweb.freebsd.org/changeset/base/279916 Log: Make "automount -LL -o whatever" present options in the same order as used by automountd(8). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automount.c head/usr.sbin/autofs/common.c head/usr.sbin/autofs/common.h Modified: head/usr.sbin/autofs/automount.c ============================================================================== --- head/usr.sbin/autofs/automount.c Thu Mar 12 12:17:15 2015 (r279915) +++ head/usr.sbin/autofs/automount.c Thu Mar 12 12:36:08 2015 (r279916) @@ -381,13 +381,12 @@ main_automount(int argc, char **argv) parse_master(root, AUTO_MASTER_PATH); if (show_maps) { - root->n_options = concat(options, ',', root->n_options); if (show_maps > 1) { node_expand_indirect_maps(root); node_expand_ampersand(root, NULL); } node_expand_defined(root); - node_print(root); + node_print(root, options); return (0); } Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Thu Mar 12 12:17:15 2015 (r279915) +++ head/usr.sbin/autofs/common.c Thu Mar 12 12:36:08 2015 (r279916) @@ -607,13 +607,16 @@ node_options(const struct node *n) } static void -node_print_indent(const struct node *n, int indent) +node_print_indent(const struct node *n, const char *cmdline_options, + int indent) { const struct node *child, *first_child; - char *path, *options; + char *path, *options, *tmp; path = node_path(n); - options = node_options(n); + tmp = node_options(n); + options = concat(cmdline_options, ',', tmp); + free(tmp); /* * Do not show both parent and child node if they have the same @@ -644,16 +647,21 @@ node_print_indent(const struct node *n, free(options); TAILQ_FOREACH(child, &n->n_children, n_next) - node_print_indent(child, indent + 2); + node_print_indent(child, cmdline_options, indent + 2); } +/* + * Recursively print node with all its children. The cmdline_options + * argument is used for additional options to be prepended to all the + * others - usually those are the options passed by command line. + */ void -node_print(const struct node *n) +node_print(const struct node *n, const char *cmdline_options) { const struct node *child; TAILQ_FOREACH(child, &n->n_children, n_next) - node_print_indent(child, 0); + node_print_indent(child, cmdline_options, 0); } static struct node * Modified: head/usr.sbin/autofs/common.h ============================================================================== --- head/usr.sbin/autofs/common.h Thu Mar 12 12:17:15 2015 (r279915) +++ head/usr.sbin/autofs/common.h Thu Mar 12 12:36:08 2015 (r279916) @@ -87,7 +87,7 @@ void node_expand_ampersand(struct node * void node_expand_wildcard(struct node *root, const char *key); int node_expand_defined(struct node *root); void node_expand_indirect_maps(struct node *n); -void node_print(const struct node *n); +void node_print(const struct node *n, const char *cmdline_options); void parse_master(struct node *root, const char *path); void parse_map(struct node *parent, const char *map, const char *args, bool *wildcards); From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 14:18:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9628EDCF; Thu, 12 Mar 2015 14:18:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 813DEEC9; Thu, 12 Mar 2015 14:18:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CEIbYv022605; Thu, 12 Mar 2015 14:18:37 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CEIbM7022604; Thu, 12 Mar 2015 14:18:37 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201503121418.t2CEIbM7022604@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Thu, 12 Mar 2015 14:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279919 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 14:18:37 -0000 Author: jah Date: Thu Mar 12 14:18:36 2015 New Revision: 279919 URL: https://svnweb.freebsd.org/changeset/base/279919 Log: Using parent DMA tag in drm_pci_alloc(). This can allow drm2 devices to work with Intel DMAR enabled for the system, as long as DMAR is disabled for the drm2 device. Approved by: kib (mentor) MFC after: 1 week Modified: head/sys/dev/drm2/drm_pci.c Modified: head/sys/dev/drm2/drm_pci.c ============================================================================== --- head/sys/dev/drm2/drm_pci.c Thu Mar 12 13:40:02 2015 (r279918) +++ head/sys/dev/drm2/drm_pci.c Thu Mar 12 14:18:36 2015 (r279919) @@ -76,7 +76,9 @@ drm_pci_alloc(struct drm_device *dev, si if (mtx_owned(&dev->dma_lock)) DRM_ERROR("called while holding dma_lock\n"); - ret = bus_dma_tag_create(NULL, align, 0, /* tag, align, boundary */ + ret = bus_dma_tag_create( + bus_get_dma_tag(dev->device), /* parent */ + align, 0, /* align, boundary */ maxaddr, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ NULL, NULL, /* filtfunc, filtfuncargs */ size, 1, size, /* maxsize, nsegs, maxsegsize */ From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 14:55:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C4FEAE3; Thu, 12 Mar 2015 14:55:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 376103F7; Thu, 12 Mar 2015 14:55:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CEtYrs041323; Thu, 12 Mar 2015 14:55:34 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CEtYu1041322; Thu, 12 Mar 2015 14:55:34 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503121455.t2CEtYu1041322@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Mar 2015 14:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279920 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 14:55:34 -0000 Author: ae Date: Thu Mar 12 14:55:33 2015 New Revision: 279920 URL: https://svnweb.freebsd.org/changeset/base/279920 Log: Add if_input_default() method, that will be used for if_input initialization, when no input method specified before if_attach(). This prevents panics when if_input() method called directly e.g. from bpf(4) code. PR: 192426 Reviewed by: glebius MFC after: 1 week Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Mar 12 14:18:36 2015 (r279919) +++ head/sys/net/if.c Thu Mar 12 14:55:33 2015 (r279920) @@ -160,6 +160,7 @@ static void if_attachdomain1(struct ifne static int ifconf(u_long, caddr_t); static void if_freemulti(struct ifmultiaddr *); static void if_grow(void); +static void if_input_default(struct ifnet *, struct mbuf *); static void if_route(struct ifnet *, int flag, int fam); static int if_setflag(struct ifnet *, int, int, int *, int); static int if_transmit(struct ifnet *ifp, struct mbuf *m); @@ -665,6 +666,8 @@ if_attach_internal(struct ifnet *ifp, in ifp->if_transmit = if_transmit; ifp->if_qflush = if_qflush; } + if (ifp->if_input == NULL) + ifp->if_input = if_input_default; if (!vmove) { #ifdef MAC @@ -3516,6 +3519,13 @@ if_transmit(struct ifnet *ifp, struct mb return (error); } +static void +if_input_default(struct ifnet *ifp __unused, struct mbuf *m) +{ + + m_freem(m); +} + int if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, int adjust) { From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 15:20:06 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8679188C; Thu, 12 Mar 2015 15:20:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 717E88BF; Thu, 12 Mar 2015 15:20:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CFK6v9051721; Thu, 12 Mar 2015 15:20:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CFK6Cj051720; Thu, 12 Mar 2015 15:20:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503121520.t2CFK6Cj051720@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Mar 2015 15:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279922 - head/sys/boot/amd64/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 15:20:06 -0000 Author: jhb Date: Thu Mar 12 15:20:05 2015 New Revision: 279922 URL: https://svnweb.freebsd.org/changeset/base/279922 Log: Revert r279381. The EFI loader needs to use a separate libstand that is compiled against the ABI EFI expects (specifically, no stack redzone) so it cannot share libstand with userboot (which must use the System V ABI). Modified: head/sys/boot/amd64/efi/Makefile Modified: head/sys/boot/amd64/efi/Makefile ============================================================================== --- head/sys/boot/amd64/efi/Makefile Thu Mar 12 15:08:23 2015 (r279921) +++ head/sys/boot/amd64/efi/Makefile Thu Mar 12 15:20:05 2015 (r279922) @@ -84,7 +84,6 @@ loader.efi: loader.sym --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} LIBEFI= ${.OBJDIR}/../../efi/libefi/libefi.a -LIBSTAND= ${.OBJDIR}/../../userboot/libstand/libstand.a DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 15:25:23 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 962C02C9; Thu, 12 Mar 2015 15:25:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 814EF9CE; Thu, 12 Mar 2015 15:25:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CFPNhg056747; Thu, 12 Mar 2015 15:25:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CFPNm0056746; Thu, 12 Mar 2015 15:25:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503121525.t2CFPNm0056746@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Mar 2015 15:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279923 - head/sys/boot/amd64/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 15:25:23 -0000 Author: jhb Date: Thu Mar 12 15:25:22 2015 New Revision: 279923 URL: https://svnweb.freebsd.org/changeset/base/279923 Log: Fix 'make depend' by moving the LDSCRIPT dependency into DPADD. Sponsored by: Cisco Systems, Inc. Modified: head/sys/boot/amd64/efi/Makefile Modified: head/sys/boot/amd64/efi/Makefile ============================================================================== --- head/sys/boot/amd64/efi/Makefile Thu Mar 12 15:20:05 2015 (r279922) +++ head/sys/boot/amd64/efi/Makefile Thu Mar 12 15:25:22 2015 (r279923) @@ -55,8 +55,6 @@ FILESMODE_loader.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -Wl,-znocombreloc -${PROG}: ${LDSCRIPT} - CLEANFILES= vers.c loader.efi NEWVERSWHAT= "EFI loader" ${MACHINE_CPUARCH} @@ -85,7 +83,7 @@ loader.efi: loader.sym LIBEFI= ${.OBJDIR}/../../efi/libefi/libefi.a -DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} ${LDSCRIPT} LDADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} .endif # ${COMPILER_TYPE} != "gcc" From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 15:58:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A0AAFC2; Thu, 12 Mar 2015 15:58:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 85449DF7; Thu, 12 Mar 2015 15:58:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CFw8jS071577; Thu, 12 Mar 2015 15:58:08 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CFw8sk071576; Thu, 12 Mar 2015 15:58:08 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201503121558.t2CFw8sk071576@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 12 Mar 2015 15:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279925 - head/share/examples/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 15:58:08 -0000 Author: glebius Date: Thu Mar 12 15:58:07 2015 New Revision: 279925 URL: https://svnweb.freebsd.org/changeset/base/279925 Log: Add -p parameter to list PCI device to pass through to the guest. Reviewed by: neel Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Thu Mar 12 15:48:25 2015 (r279924) +++ head/share/examples/bhyve/vmrun.sh Thu Mar 12 15:58:07 2015 (r279925) @@ -62,6 +62,7 @@ usage() { echo " -i: force boot of the Installation CDROM image" echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" + echo " -p: pass-through a host PCI device at bus/slot/func (e.g. 10/0/0)" echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" echo "" [ -n "$msg" ] && errmsg "$msg" @@ -89,8 +90,9 @@ disk_total=0 apic_opt="" gdbport=0 loader_opt="" +pass_total=0 -while getopts ac:C:d:e:g:hH:iI:m:t: c ; do +while getopts ac:C:d:e:g:hH:iI:m:p:t: c ; do case $c in a) apic_opt="-a" @@ -123,6 +125,10 @@ while getopts ac:C:d:e:g:hH:iI:m:t: c ; m) memsize=${OPTARG} ;; + p) + eval "pass_dev${pass_total}=\"${OPTARG}\"" + pass_total=$(($pass_total + 1)) + ;; t) eval "tap_dev${tap_total}=\"${OPTARG}\"" tap_total=$(($tap_total + 1)) @@ -237,6 +243,14 @@ while [ 1 ]; do i=$(($i + 1)) done + i=0 + while [ $i -lt $pass_total ] ; do + eval "pass=\$pass_dev${i}" + devargs="$devargs -s $nextslot:0,passthru,${pass} " + nextslot=$(($nextslot + 1)) + i=$(($i + 1)) + done + ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -A -H -P \ -g ${gdbport} \ -s 0:0,hostbridge \ From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 16:19:19 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BBE4AC6; Thu, 12 Mar 2015 16:19:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 36FE5107; Thu, 12 Mar 2015 16:19:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CGJIx7081981; Thu, 12 Mar 2015 16:19:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CGJIjx081980; Thu, 12 Mar 2015 16:19:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503121619.t2CGJIjx081980@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 12 Mar 2015 16:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279927 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 16:19:19 -0000 Author: mav Date: Thu Mar 12 16:19:18 2015 New Revision: 279927 URL: https://svnweb.freebsd.org/changeset/base/279927 Log: Make DIOCGATTR in device mode handle "GEOM::candelete". MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Mar 12 16:05:52 2015 (r279926) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Mar 12 16:19:18 2015 (r279927) @@ -3130,7 +3130,9 @@ zvol_d_ioctl(struct cdev *dev, u_long cm struct diocgattr_arg *arg = (struct diocgattr_arg *)data; uint64_t refd, avail, usedobjs, availobjs; - if (strcmp(arg->name, "blocksavail") == 0) { + if (strcmp(arg->name, "GEOM::candelete") == 0) + arg->value.i = 1; + else if (strcmp(arg->name, "blocksavail") == 0) { dmu_objset_space(zv->zv_objset, &refd, &avail, &usedobjs, &availobjs); arg->value.off = avail / DEV_BSIZE; From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 17:01:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 105449C0; Thu, 12 Mar 2015 17:01:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 EF67898D; Thu, 12 Mar 2015 17:01:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CH1UmD004091; Thu, 12 Mar 2015 17:01:30 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CH1UVT004090; Thu, 12 Mar 2015 17:01:30 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503121701.t2CH1UVT004090@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 12 Mar 2015 17:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279928 - head/sys/powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 17:01:31 -0000 Author: nwhitehorn Date: Thu Mar 12 17:01:30 2015 New Revision: 279928 URL: https://svnweb.freebsd.org/changeset/base/279928 Log: The H_VIO_SIGNAL hypercall only enables interrupts for future received packets and does not schedule interrupts for any packets currently enqueued. Close two races where enqueued packets may not ever trigger interrupts. The first of these, at adapter initialization time, was especially severe since a rush of enqueued packets could actually fill the receive buffer completely, stalling the interface forever. MFC after: 2 weeks Modified: head/sys/powerpc/pseries/phyp_llan.c Modified: head/sys/powerpc/pseries/phyp_llan.c ============================================================================== --- head/sys/powerpc/pseries/phyp_llan.c Thu Mar 12 16:19:18 2015 (r279927) +++ head/sys/powerpc/pseries/phyp_llan.c Thu Mar 12 17:01:30 2015 (r279928) @@ -273,6 +273,9 @@ llan_init(void *xsc) sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; mtx_unlock(&sc->io_lock); + + /* Check for pending receives scheduled before interrupt enable */ + llan_intr(sc); } static int @@ -335,6 +338,7 @@ llan_intr(void *xsc) struct mbuf *m; mtx_lock(&sc->io_lock); +restart: phyp_hcall(H_VIO_SIGNAL, sc->unit, 0); while ((sc->rx_buf[sc->rx_dma_slot].control >> 7) == sc->rx_valid_val) { @@ -369,6 +373,15 @@ llan_intr(void *xsc) } phyp_hcall(H_VIO_SIGNAL, sc->unit, 1); + + /* + * H_VIO_SIGNAL enables interrupts for future packets only. + * Make sure none were queued between the end of the loop and the + * enable interrupts call. + */ + if ((sc->rx_buf[sc->rx_dma_slot].control >> 7) == sc->rx_valid_val) + goto restart; + mtx_unlock(&sc->io_lock); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 17:07:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75011C2E; Thu, 12 Mar 2015 17:07:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 609CAA00; Thu, 12 Mar 2015 17:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CH7P6x005282; Thu, 12 Mar 2015 17:07:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CH7OXj005279; Thu, 12 Mar 2015 17:07:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503121707.t2CH7OXj005279@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Mar 2015 17:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279929 - head/sys/boot/amd64/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 17:07:25 -0000 Author: jhb Date: Thu Mar 12 17:07:24 2015 New Revision: 279929 URL: https://svnweb.freebsd.org/changeset/base/279929 Log: Allow the EFI loader to work with large kernels and/or modules (for example, a large mfsroot). Note that for EFI the kernel and modules (as well as other metadata files such as splash screens or memory disk images) are loaded into a statically-sized staging area. When the EFI loader exits it copies this staging area down to the location the kernel expects to run at. - Add bounds checking to the copy routines to fail attempts to access memory outside of the staging area. Previously loading a combined kernel + modules larger than the staging size (32MB) would overflow the staging area trashing whatever memory was afterwards. Under Intel's OVMF firmware for qemu this resulted in fatal faults in the firmware itself. Now the attempt will fail with ENOMEM. - Allow the staging area size to be configured at compile time via an EFI_STAGING_SIZE variable in src.conf or on the command line. It accepts the size of the staging area in MB. The default size remains 32MB. MFC after: 2 weeks Sponsored by: Cisco Systems, Inc. Modified: head/sys/boot/amd64/efi/Makefile head/sys/boot/amd64/efi/copy.c Modified: head/sys/boot/amd64/efi/Makefile ============================================================================== --- head/sys/boot/amd64/efi/Makefile Thu Mar 12 17:01:30 2015 (r279928) +++ head/sys/boot/amd64/efi/Makefile Thu Mar 12 17:07:24 2015 (r279929) @@ -44,6 +44,10 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a # Include bcache code. HAVE_BCACHE= yes +.if defined(EFI_STAGING_SIZE) +CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} +.endif + # Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" Modified: head/sys/boot/amd64/efi/copy.c ============================================================================== --- head/sys/boot/amd64/efi/copy.c Thu Mar 12 17:01:30 2015 (r279928) +++ head/sys/boot/amd64/efi/copy.c Thu Mar 12 17:07:24 2015 (r279929) @@ -37,9 +37,13 @@ __FBSDID("$FreeBSD$"); #include #include -#define STAGE_PAGES 8192 /* 32MB */ +#ifndef EFI_STAGING_SIZE +#define EFI_STAGING_SIZE 32 +#endif -EFI_PHYSICAL_ADDRESS staging; +#define STAGE_PAGES ((EFI_STAGING_SIZE) * 1024 * 1024 / 4096) + +EFI_PHYSICAL_ADDRESS staging, staging_end; int stage_offset_set = 0; ssize_t stage_offset; @@ -55,6 +59,7 @@ x86_efi_copy_init(void) (unsigned long)(status & EFI_ERROR_MASK)); return (status); } + staging_end = staging + STAGE_PAGES * 4096; return (0); } @@ -68,6 +73,11 @@ x86_efi_copyin(const void *src, vm_offse stage_offset_set = 1; } + /* XXX: Callers do not check for failure. */ + if (dest + stage_offset + len > staging_end) { + errno = ENOMEM; + return (-1); + } bcopy(src, (void *)(dest + stage_offset), len); return (len); } @@ -76,6 +86,11 @@ ssize_t x86_efi_copyout(const vm_offset_t src, void *dest, const size_t len) { + /* XXX: Callers do not check for failure. */ + if (src + stage_offset + len > staging_end) { + errno = ENOMEM; + return (-1); + } bcopy((void *)(src + stage_offset), dest, len); return (len); } @@ -85,6 +100,10 @@ ssize_t x86_efi_readin(const int fd, vm_offset_t dest, const size_t len) { + if (dest + stage_offset + len > staging_end) { + errno = ENOMEM; + return (-1); + } return (read(fd, (void *)(dest + stage_offset), len)); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 17:10:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 127A4DF; Thu, 12 Mar 2015 17:10:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 F2B94A3C; Thu, 12 Mar 2015 17:10:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CHA4OP005759; Thu, 12 Mar 2015 17:10:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CHA4N2005758; Thu, 12 Mar 2015 17:10:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503121710.t2CHA4N2005758@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 12 Mar 2015 17:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279931 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 17:10:05 -0000 Author: jhb Date: Thu Mar 12 17:10:04 2015 New Revision: 279931 URL: https://svnweb.freebsd.org/changeset/base/279931 Log: Spin the twiddle in dosfs to give visual feedback for disk I/O on FAT filesystems as is done for other filesystems in the loader. MFC after: 1 week Modified: head/lib/libstand/dosfs.c Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Thu Mar 12 17:07:45 2015 (r279930) +++ head/lib/libstand/dosfs.c Thu Mar 12 17:10:04 2015 (r279931) @@ -786,7 +786,8 @@ static int ioget(struct open_file *fd, u_int lsec, void *buf, u_int nsec) { int err; - + + twiddle(1); if ((err = (fd->f_dev->dv_strategy)(fd->f_devdata, F_READ, lsec, secbyt(nsec), buf, NULL))) return(err); From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 18:06:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE98959D; Thu, 12 Mar 2015 18:06:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 BA42215D; Thu, 12 Mar 2015 18:06:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CI6Vxl034855; Thu, 12 Mar 2015 18:06:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CI6VSU034853; Thu, 12 Mar 2015 18:06:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503121806.t2CI6VSU034853@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 12 Mar 2015 18:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279932 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 18:06:31 -0000 Author: ian Date: Thu Mar 12 18:06:30 2015 New Revision: 279932 URL: https://svnweb.freebsd.org/changeset/base/279932 Log: Nullterminate strings returned via sysctl. PR: 195668 Modified: head/sys/vm/vm_phys.c head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Thu Mar 12 17:10:04 2015 (r279931) +++ head/sys/vm/vm_phys.c Thu Mar 12 18:06:30 2015 (r279932) @@ -263,6 +263,7 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) } } } + sbuf_putc(&sbuf, 0); /* nullterm */ error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); return (error); @@ -292,6 +293,7 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) sbuf_printf(&sbuf, "domain: %d\n", seg->domain); sbuf_printf(&sbuf, "free list: %p\n", seg->free_queues); } + sbuf_putc(&sbuf, 0); /* nullterm */ error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); return (error); Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Thu Mar 12 17:10:04 2015 (r279931) +++ head/sys/vm/vm_reserv.c Thu Mar 12 18:06:30 2015 (r279932) @@ -261,6 +261,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER sbuf_printf(&sbuf, "%5d: %6dK, %6d\n", level, unused_pages * ((int)PAGE_SIZE / 1024), counter); } + sbuf_putc(&sbuf, 0); /* nullterm */ error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); return (error); From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 18:09:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 836F0749; Thu, 12 Mar 2015 18:09:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6F040189; Thu, 12 Mar 2015 18:09:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CI9eVP035260; Thu, 12 Mar 2015 18:09:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CI9eIS035259; Thu, 12 Mar 2015 18:09:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503121809.t2CI9eIS035259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 12 Mar 2015 18:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279933 - head/sys/dev/wbwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 18:09:40 -0000 Author: ian Date: Thu Mar 12 18:09:39 2015 New Revision: 279933 URL: https://svnweb.freebsd.org/changeset/base/279933 Log: Nullterminate strings returned via sysctl. PR: 195668 Modified: head/sys/dev/wbwd/wbwd.c Modified: head/sys/dev/wbwd/wbwd.c ============================================================================== --- head/sys/dev/wbwd/wbwd.c Thu Mar 12 18:06:30 2015 (r279932) +++ head/sys/dev/wbwd/wbwd.c Thu Mar 12 18:09:39 2015 (r279933) @@ -252,6 +252,7 @@ sysctl_wb_debug(SYSCTL_HANDLER_ARGS) sbuf_printf(&sb, "CRF6 0x%02x ", sc->reg_timeout); sbuf_printf(&sb, "CRF7 0x%02x", sc->reg_2); + sbuf_putc(&sb, 0); /* nullterm */ error = sbuf_finish(&sb); sbuf_delete(&sb); return (error); From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 18:22:21 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83367B86; Thu, 12 Mar 2015 18:22:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6E58C37A; Thu, 12 Mar 2015 18:22:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CIMLtq044100; Thu, 12 Mar 2015 18:22:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CIML1c044098; Thu, 12 Mar 2015 18:22:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503121822.t2CIML1c044098@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 12 Mar 2015 18:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279934 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 18:22:21 -0000 Author: ian Date: Thu Mar 12 18:22:20 2015 New Revision: 279934 URL: https://svnweb.freebsd.org/changeset/base/279934 Log: Nullterminate strings returned via sysctl. PR: 195668 Modified: head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:09:39 2015 (r279933) +++ head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:22:20 2015 (r279934) @@ -321,6 +321,7 @@ skip: mtx_unlock(&e->lock); } + sbuf_putc(&sb, 0); /* nullterm */ rc = sbuf_finish(sb); sbuf_delete(sb); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Mar 12 18:09:39 2015 (r279933) +++ head/sys/dev/cxgbe/t4_main.c Thu Mar 12 18:22:20 2015 (r279934) @@ -5090,6 +5090,7 @@ sysctl_int_array(SYSCTL_HANDLER_ARGS) for (i = arg1; arg2; arg2 -= sizeof(int), i++) sbuf_printf(&sb, "%d ", *i); sbuf_trim(&sb); + sbuf_putc(&sb, 0); /* nullterm */ sbuf_finish(&sb); rc = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); sbuf_delete(&sb); From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 18:51:33 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8834E37A; Thu, 12 Mar 2015 18:51:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 70F03922; Thu, 12 Mar 2015 18:51:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CIpXcS060382; Thu, 12 Mar 2015 18:51:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CIpW7d060374; Thu, 12 Mar 2015 18:51:32 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503121851.t2CIpW7d060374@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Mar 2015 18:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279935 - in head: sbin/geom/class/part sys/geom/part sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 18:51:33 -0000 Author: ae Date: Thu Mar 12 18:51:31 2015 New Revision: 279935 URL: https://svnweb.freebsd.org/changeset/base/279935 Log: Add GUID and alias for Apple Core Storage partition. PR: 196241 MFC after: 1 week Modified: head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_gpt.c head/sys/sys/gpt.h Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Thu Mar 12 18:22:20 2015 (r279934) +++ head/sbin/geom/class/part/gpart.8 Thu Mar 12 18:51:31 2015 (r279935) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 12, 2014 +.Dd March 12, 2015 .Dt GPART 8 .Os .Sh NAME @@ -659,6 +659,12 @@ Another symbolic names that can be used .Cm gpart utility are: .Bl -tag -width ".Cm dragonfly-disklabel64" +.It Cm apple-core-storage +An Apple Mac OS X partition used by logical volume manager known as +Core Storage. +The scheme-specific type is +.Qq Li "!53746f72-6167-11aa-aa11-00306543ecac" +for GPT. .It Cm apple-hfs An Apple Mac OS X partition that contains a HFS or HFS+ filesystem. The scheme-specific types are Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Thu Mar 12 18:22:20 2015 (r279934) +++ head/sys/geom/part/g_part.c Thu Mar 12 18:51:31 2015 (r279935) @@ -70,6 +70,7 @@ struct g_part_alias_list { enum g_part_alias alias; } g_part_alias_list[G_PART_ALIAS_COUNT] = { { "apple-boot", G_PART_ALIAS_APPLE_BOOT }, + { "apple-core-storage", G_PART_ALIAS_APPLE_CORE_STORAGE }, { "apple-hfs", G_PART_ALIAS_APPLE_HFS }, { "apple-label", G_PART_ALIAS_APPLE_LABEL }, { "apple-raid", G_PART_ALIAS_APPLE_RAID }, Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Thu Mar 12 18:22:20 2015 (r279934) +++ head/sys/geom/part/g_part.h Thu Mar 12 18:51:31 2015 (r279935) @@ -85,6 +85,7 @@ enum g_part_alias { G_PART_ALIAS_DFBSD_HAMMER, /* A DfBSD HAMMER FS partition entry */ G_PART_ALIAS_DFBSD_HAMMER2, /* A DfBSD HAMMER2 FS partition entry */ G_PART_ALIAS_PREP_BOOT, /* A PREP/CHRP boot partition entry. */ + G_PART_ALIAS_APPLE_CORE_STORAGE,/* An Apple Core Storage partition. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Thu Mar 12 18:22:20 2015 (r279934) +++ head/sys/geom/part/g_part_gpt.c Thu Mar 12 18:51:31 2015 (r279935) @@ -146,6 +146,8 @@ static struct g_part_scheme g_part_gpt_s G_PART_SCHEME_DECLARE(g_part_gpt); static struct uuid gpt_uuid_apple_boot = GPT_ENT_TYPE_APPLE_BOOT; +static struct uuid gpt_uuid_apple_core_storage = + GPT_ENT_TYPE_APPLE_CORE_STORAGE; static struct uuid gpt_uuid_apple_hfs = GPT_ENT_TYPE_APPLE_HFS; static struct uuid gpt_uuid_apple_label = GPT_ENT_TYPE_APPLE_LABEL; static struct uuid gpt_uuid_apple_raid = GPT_ENT_TYPE_APPLE_RAID; @@ -198,6 +200,7 @@ static struct g_part_uuid_alias { int mbrtype; } gpt_uuid_alias_match[] = { { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT, 0xab }, + { &gpt_uuid_apple_core_storage, G_PART_ALIAS_APPLE_CORE_STORAGE, 0 }, { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS, 0xaf }, { &gpt_uuid_apple_label, G_PART_ALIAS_APPLE_LABEL, 0 }, { &gpt_uuid_apple_raid, G_PART_ALIAS_APPLE_RAID, 0 }, Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Thu Mar 12 18:22:20 2015 (r279934) +++ head/sys/sys/gpt.h Thu Mar 12 18:51:31 2015 (r279935) @@ -150,6 +150,8 @@ struct gpt_ent { {0x4C616265,0x6c00,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_APPLE_TV_RECOVERY \ {0x5265636f,0x7665,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} +#define GPT_ENT_TYPE_APPLE_CORE_STORAGE \ + {0x53746f72,0x6167,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}} #define GPT_ENT_TYPE_NETBSD_FFS \ {0x49f48d5a,0xb10e,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 20:14:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61126F21; Thu, 12 Mar 2015 20:14:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 4CF8C36E; Thu, 12 Mar 2015 20:14:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CKEnWW098578; Thu, 12 Mar 2015 20:14:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CKEmRj098577; Thu, 12 Mar 2015 20:14:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503122014.t2CKEmRj098577@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 12 Mar 2015 20:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279936 - head/sys/i386/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 20:14:49 -0000 Author: kib Date: Thu Mar 12 20:14:48 2015 New Revision: 279936 URL: https://svnweb.freebsd.org/changeset/base/279936 Log: Remove write-only variable. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/i386/isa/npx.c Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Thu Mar 12 18:51:31 2015 (r279935) +++ head/sys/i386/isa/npx.c Thu Mar 12 20:14:48 2015 (r279936) @@ -1365,9 +1365,7 @@ fpu_kern_leave(struct thread *td, struct int fpu_kern_thread(u_int flags) { - struct pcb *pcb; - pcb = curpcb; KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, ("Only kthread may use fpu_kern_thread")); KASSERT(curpcb->pcb_save == get_pcb_user_save_pcb(curpcb), From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 21:02:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0B61A7D; Thu, 12 Mar 2015 21:02:09 +0000 (UTC) Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com [IPv6:2607:f8b0:4003:c06::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 A11F5AE3; Thu, 12 Mar 2015 21:02:09 +0000 (UTC) Received: by oiba3 with SMTP id a3so7289876oib.1; Thu, 12 Mar 2015 14:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=elkRJ+a5rqEQHMAOL3SmYENjy0MfrIM81tvogG2DQD8=; b=TLnPWQIAKFvmYVPXnfPD4E3x8tZxiFx+Ip5jHwNUX4h9yFEAKwGZyqoFUmSP3cVgWq HNqi7ETRxhRvJaZQxoCvlko3eYNZRSMjzsJ/L56C4zKkAeavwTWXgpK0/2zgk2QGJbOA aRaX6QX7JYNR1f4NKmCQouiFFILFbAVVydp6v9hw8NHd/JwThn/KTr3wlv+8JbAH/QSg A2A3dYTTWBX3y35tEen+btOj6Y8f3DbfArenC46s77ukIS/oGKLPMyQidcx9PGxhHISa Er2uChpJGydexnIk/UZojIdVt/YGZhgSgNoXAHBzlygRvD9Bio18xmjeQCK9l1BUVJvs zhNQ== MIME-Version: 1.0 X-Received: by 10.43.16.196 with SMTP id pz4mr52722361icb.69.1426194128845; Thu, 12 Mar 2015 14:02:08 -0700 (PDT) Received: by 10.107.156.75 with HTTP; Thu, 12 Mar 2015 14:02:08 -0700 (PDT) In-Reply-To: <201503121806.t2CI6VSU034853@svn.freebsd.org> References: <201503121806.t2CI6VSU034853@svn.freebsd.org> Date: Thu, 12 Mar 2015 17:02:08 -0400 Message-ID: Subject: Re: svn commit: r279932 - head/sys/vm From: Ryan Stone To: Ian Lepore Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 21:02:10 -0000 On Thu, Mar 12, 2015 at 2:06 PM, Ian Lepore wrote: > Nullterminate strings returned via sysctl. > > PR: 195668 > To quote the manpage: > The *sbuf* family of functions allows one to safely > allocate, construct and release bounded null-terminated > strings in kernel space. IMO the sbuf API is broken if we have to explicitly null-terminate the string ourselves. From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 21:15:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7E39D3A; Thu, 12 Mar 2015 21:15:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 C1E6CC35; Thu, 12 Mar 2015 21:15:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CLFdqV026988; Thu, 12 Mar 2015 21:15:39 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CLFdmi026986; Thu, 12 Mar 2015 21:15:39 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503122115.t2CLFdmi026986@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Thu, 12 Mar 2015 21:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279937 - in head/sys/powerpc: include powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 21:15:40 -0000 Author: nwhitehorn Date: Thu Mar 12 21:15:38 2015 New Revision: 279937 URL: https://svnweb.freebsd.org/changeset/base/279937 Log: Provide VSX context in ucontext(3) API. Modified: head/sys/powerpc/include/ucontext.h head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/include/ucontext.h ============================================================================== --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) @@ -46,6 +46,7 @@ typedef struct __mcontext { uint32_t mc_av[2]; register_t mc_frame[42]; uint64_t mc_fpreg[33]; + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ } mcontext_t __aligned(16); #if defined(_KERNEL) && defined(__powerpc64__) @@ -60,6 +61,7 @@ typedef struct __mcontext32 { uint32_t mc_av[2]; uint32_t mc_frame[42]; uint64_t mc_fpreg[33]; + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ } mcontext32_t __aligned(16); #endif Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Thu Mar 12 20:14:48 2015 (r279936) +++ head/sys/powerpc/powerpc/exec_machdep.c Thu Mar 12 21:15:38 2015 (r279937) @@ -393,12 +393,17 @@ grab_mcontext(struct thread *td, mcontex } mcp->mc_flags |= _MC_FP_VALID; memcpy(&mcp->mc_fpscr, &pcb->pcb_fpu.fpscr, sizeof(double)); - memcpy(mcp->mc_fpreg, pcb->pcb_fpu.fpr, 32*sizeof(double)); for (i = 0; i < 32; i++) memcpy(&mcp->mc_fpreg[i], &pcb->pcb_fpu.fpr[i].fpr, sizeof(double)); } + if (pcb->pcb_flags & PCB_VSX) { + for (i = 0; i < 32; i++) + memcpy(&mcp->mc_vsxfpreg[i], + &pcb->pcb_fpu.fpr[i].vsr[2], sizeof(double)); + } + /* * Repeat for Altivec context */ @@ -415,8 +420,6 @@ grab_mcontext(struct thread *td, mcontex memcpy(mcp->mc_avec, pcb->pcb_vec.vr, sizeof(mcp->mc_avec)); } - /* XXX VSX context */ - mcp->mc_len = sizeof(*mcp); return (0); @@ -474,9 +477,12 @@ set_mcontext(struct thread *td, mcontext pcb->pcb_flags |= PCB_FPREGS; memcpy(&pcb->pcb_fpu.fpscr, &mcp->mc_fpscr, sizeof(double)); bzero(pcb->pcb_fpu.fpr, sizeof(pcb->pcb_fpu.fpr)); - for (i = 0; i < 32; i++) + for (i = 0; i < 32; i++) { memcpy(&pcb->pcb_fpu.fpr[i].fpr, &mcp->mc_fpreg[i], sizeof(double)); + memcpy(&pcb->pcb_fpu.fpr[i].vsr[2], + &mcp->mc_vsxfpreg[i], sizeof(double)); + } } if (mcp->mc_flags & _MC_AV_VALID) { @@ -490,8 +496,6 @@ set_mcontext(struct thread *td, mcontext memcpy(pcb->pcb_vec.vr, mcp->mc_avec, sizeof(mcp->mc_avec)); } - /* XXX VSX context */ - return (0); } @@ -721,6 +725,7 @@ grab_mcontext32(struct thread *td, mcont for (i = 0; i < 42; i++) mcp->mc_frame[i] = mcp64.mc_frame[i]; memcpy(mcp->mc_fpreg,mcp64.mc_fpreg,sizeof(mcp64.mc_fpreg)); + memcpy(mcp->mc_vsxfpreg,mcp64.mc_vsxfpreg,sizeof(mcp64.mc_vsxfpreg)); return (0); } @@ -756,6 +761,7 @@ set_mcontext32(struct thread *td, mconte mcp64.mc_frame[i] = mcp->mc_frame[i]; mcp64.mc_srr1 |= (td->td_frame->srr1 & 0xFFFFFFFF00000000ULL); memcpy(mcp64.mc_fpreg,mcp->mc_fpreg,sizeof(mcp64.mc_fpreg)); + memcpy(mcp64.mc_vsxfpreg,mcp->mc_vsxfpreg,sizeof(mcp64.mc_vsxfpreg)); error = set_mcontext(td, &mcp64); From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 21:22:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BD2EFFA; Thu, 12 Mar 2015 21:22:41 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 7EF97D28; Thu, 12 Mar 2015 21:22:40 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2CLMYWG006236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Mar 2015 23:22:34 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2CLMYWG006236 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2CLMY2K006235; Thu, 12 Mar 2015 23:22:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 Mar 2015 23:22:34 +0200 From: Konstantin Belousov To: Nathan Whitehorn Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc Message-ID: <20150312212234.GS2379@kib.kiev.ua> References: <201503122115.t2CLFdmi026986@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503122115.t2CLFdmi026986@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 21:22:41 -0000 On Thu, Mar 12, 2015 at 09:15:39PM +0000, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Thu Mar 12 21:15:38 2015 > New Revision: 279937 > URL: https://svnweb.freebsd.org/changeset/base/279937 > > Log: > Provide VSX context in ucontext(3) API. > > Modified: > head/sys/powerpc/include/ucontext.h > head/sys/powerpc/powerpc/exec_machdep.c > > Modified: head/sys/powerpc/include/ucontext.h > ============================================================================== > --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) > +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) > @@ -46,6 +46,7 @@ typedef struct __mcontext { > uint32_t mc_av[2]; > register_t mc_frame[42]; > uint64_t mc_fpreg[33]; > + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ > } mcontext_t __aligned(16); > > #if defined(_KERNEL) && defined(__powerpc64__) > @@ -60,6 +61,7 @@ typedef struct __mcontext32 { > uint32_t mc_av[2]; > uint32_t mc_frame[42]; > uint64_t mc_fpreg[33]; > + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ > } mcontext32_t __aligned(16); > #endif It looks as if you broken the ABI compatibility by the change. Am I wrong ? From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 21:29:46 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B933825D; Thu, 12 Mar 2015 21:29:46 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 9D638D6F; Thu, 12 Mar 2015 21:29:46 +0000 (UTC) Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU [128.32.117.67]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t2CLThUV011380 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 12 Mar 2015 14:29:44 -0700 Message-ID: <55020547.7050102@freebsd.org> Date: Thu, 12 Mar 2015 14:29:43 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> In-Reply-To: <20150312212234.GS2379@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYHdlxUMw4Jz1i2Ach4KZlyLTNiYp9PrFe0SKIrqfwPnznqijxI+vhgWN46zgROo8a51T/XLl8Djo0uAZs3zG/YBKKbkQDtCwg= X-Sonic-ID: C;ai9P5v7I5BGfhb5YxQPdhw== M;lNGC5v7I5BGfhb5YxQPdhw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 21:29:46 -0000 On 03/12/15 14:22, Konstantin Belousov wrote: > On Thu, Mar 12, 2015 at 09:15:39PM +0000, Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Thu Mar 12 21:15:38 2015 >> New Revision: 279937 >> URL: https://svnweb.freebsd.org/changeset/base/279937 >> >> Log: >> Provide VSX context in ucontext(3) API. >> >> Modified: >> head/sys/powerpc/include/ucontext.h >> head/sys/powerpc/powerpc/exec_machdep.c >> >> Modified: head/sys/powerpc/include/ucontext.h >> ============================================================================== >> --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) >> +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) >> @@ -46,6 +46,7 @@ typedef struct __mcontext { >> uint32_t mc_av[2]; >> register_t mc_frame[42]; >> uint64_t mc_fpreg[33]; >> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ >> } mcontext_t __aligned(16); >> >> #if defined(_KERNEL) && defined(__powerpc64__) >> @@ -60,6 +61,7 @@ typedef struct __mcontext32 { >> uint32_t mc_av[2]; >> uint32_t mc_frame[42]; >> uint64_t mc_fpreg[33]; >> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ >> } mcontext32_t __aligned(16); >> #endif > It looks as if you broken the ABI compatibility by the change. Am I wrong ? > That is correct. It's a tier-2 platform and -CURRENT, so I'm not sure it's worth the compatibility shims. I'm happy to add them if you think otherwise. -Nathan From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 21:35:36 2015 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7BA5453; Thu, 12 Mar 2015 21:35:36 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 276FCE4D; Thu, 12 Mar 2015 21:35:35 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2CLZUF9008804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Mar 2015 23:35:30 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2CLZUF9008804 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2CLZUfb008803; Thu, 12 Mar 2015 23:35:30 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 Mar 2015 23:35:30 +0200 From: Konstantin Belousov To: Nathan Whitehorn Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc Message-ID: <20150312213530.GT2379@kib.kiev.ua> References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55020547.7050102@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 21:35:36 -0000 On Thu, Mar 12, 2015 at 02:29:43PM -0700, Nathan Whitehorn wrote: > > On 03/12/15 14:22, Konstantin Belousov wrote: > > On Thu, Mar 12, 2015 at 09:15:39PM +0000, Nathan Whitehorn wrote: > >> Author: nwhitehorn > >> Date: Thu Mar 12 21:15:38 2015 > >> New Revision: 279937 > >> URL: https://svnweb.freebsd.org/changeset/base/279937 > >> > >> Log: > >> Provide VSX context in ucontext(3) API. > >> > >> Modified: > >> head/sys/powerpc/include/ucontext.h > >> head/sys/powerpc/powerpc/exec_machdep.c > >> > >> Modified: head/sys/powerpc/include/ucontext.h > >> ============================================================================== > >> --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) > >> +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) > >> @@ -46,6 +46,7 @@ typedef struct __mcontext { > >> uint32_t mc_av[2]; > >> register_t mc_frame[42]; > >> uint64_t mc_fpreg[33]; > >> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ > >> } mcontext_t __aligned(16); > >> > >> #if defined(_KERNEL) && defined(__powerpc64__) > >> @@ -60,6 +61,7 @@ typedef struct __mcontext32 { > >> uint32_t mc_av[2]; > >> uint32_t mc_frame[42]; > >> uint64_t mc_fpreg[33]; > >> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ > >> } mcontext32_t __aligned(16); > >> #endif > > It looks as if you broken the ABI compatibility by the change. Am I wrong ? > > > > That is correct. It's a tier-2 platform and -CURRENT, so I'm not sure > it's worth the compatibility shims. I'm happy to add them if you think > otherwise. You are main maintainer of PowerPC port, IMO, so it is your decision. Note that 'this is current' argument is not applicable, since the change also breaks stable/* binaries. I do understand the argument of PowerPC being tier 2 architecture, but this makes me sad. Anyway, it is yours. For x86, I have to introduce getcontextx(3) mechanism. From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 21:46:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 376B86DC; Thu, 12 Mar 2015 21:46:55 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 159D8F45; Thu, 12 Mar 2015 21:46:54 +0000 (UTC) Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU [128.32.117.67]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t2CLkr19000510 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 12 Mar 2015 14:46:53 -0700 Message-ID: <5502094D.5090001@freebsd.org> Date: Thu, 12 Mar 2015 14:46:53 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> <20150312213530.GT2379@kib.kiev.ua> In-Reply-To: <20150312213530.GT2379@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYsFIJJ666tUsDAxhHWm/cB8ZxLdFLSb45b2TxMqW4Vx3uRW+hd0fWXPoPfmp93Zu9hmUBRKL2dHWtMG7hk8rYUb/hd3S1wRyo= X-Sonic-ID: C;ZCjMSwHJ5BG+IL5YxQPdhw== M;itD9SwHJ5BG+IL5YxQPdhw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 21:46:55 -0000 On 03/12/15 14:35, Konstantin Belousov wrote: > On Thu, Mar 12, 2015 at 02:29:43PM -0700, Nathan Whitehorn wrote: >> On 03/12/15 14:22, Konstantin Belousov wrote: >>> On Thu, Mar 12, 2015 at 09:15:39PM +0000, Nathan Whitehorn wrote: >>>> Author: nwhitehorn >>>> Date: Thu Mar 12 21:15:38 2015 >>>> New Revision: 279937 >>>> URL: https://svnweb.freebsd.org/changeset/base/279937 >>>> >>>> Log: >>>> Provide VSX context in ucontext(3) API. >>>> >>>> Modified: >>>> head/sys/powerpc/include/ucontext.h >>>> head/sys/powerpc/powerpc/exec_machdep.c >>>> >>>> Modified: head/sys/powerpc/include/ucontext.h >>>> ============================================================================== >>>> --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) >>>> +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) >>>> @@ -46,6 +46,7 @@ typedef struct __mcontext { >>>> uint32_t mc_av[2]; >>>> register_t mc_frame[42]; >>>> uint64_t mc_fpreg[33]; >>>> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ >>>> } mcontext_t __aligned(16); >>>> >>>> #if defined(_KERNEL) && defined(__powerpc64__) >>>> @@ -60,6 +61,7 @@ typedef struct __mcontext32 { >>>> uint32_t mc_av[2]; >>>> uint32_t mc_frame[42]; >>>> uint64_t mc_fpreg[33]; >>>> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ >>>> } mcontext32_t __aligned(16); >>>> #endif >>> It looks as if you broken the ABI compatibility by the change. Am I wrong ? >>> >> That is correct. It's a tier-2 platform and -CURRENT, so I'm not sure >> it's worth the compatibility shims. I'm happy to add them if you think >> otherwise. > You are main maintainer of PowerPC port, IMO, so it is your decision. > > Note that 'this is current' argument is not applicable, since the change > also breaks stable/* binaries. > > I do understand the argument of PowerPC being tier 2 architecture, but this > makes me sad. Anyway, it is yours. For x86, I have to introduce > getcontextx(3) mechanism. > This is a good point. I'll try to fix it. Is my understanding of how this works correct? 1. Provide a sysarch() for the extended FPU state. 2. Implement getcontextx() in the C library to fill extra properties if required. 3. Store state for signal trampoline in variable-sized stack area Implementation of (2) seems to rely on having spare members in ucontext, which PowerPC unfortunately does not have. Is there a way around that? -Nathan From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 22:54:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB1272E5; Thu, 12 Mar 2015 22:54:24 +0000 (UTC) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::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 B478E882; Thu, 12 Mar 2015 22:54:24 +0000 (UTC) Received: by pabrd3 with SMTP id rd3so24186483pab.5; Thu, 12 Mar 2015 15:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=cg4jdGLXktAoSwyrNOBv3ddvPlLESPhL+0sL5ph0GzM=; b=V/lIYLqsRRuRMytGOblwwGCs877Afe/4S3KrLDJsoAR3XuDJLC4W3kQFbR0AfWfMkZ M7kD2HvF9ScUg5m5ID+GZ6WLTQoZkLb4LKlHhuBzp4q7jJ1OPtAsBlp3/44/OrzlSJ3D NmmDqNLhi3yLc2Hi6oMM8731PjIdX8bf9ajfQMFNkXlfBf0PP8j/SOY/QnNHEI3M1Vwd hYziwY2huoHO9VlCRTZKFdXB3yFJQIcTvY2HpUU+pV5E3/vWytNz1dzYo2oe1ktvJzw8 roi4Kc1Ou03GHajp5iy523EOJf8f6slbcmQ8GbjPr7j8+Rgeua6px09gEJ2OlzxFM6NA yiJQ== X-Received: by 10.70.35.193 with SMTP id k1mr83314111pdj.46.1426200864148; Thu, 12 Mar 2015 15:54:24 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id os6sm203428pac.28.2015.03.12.15.54.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2015 15:54:22 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <5502191D.1010901@FreeBSD.org> Date: Thu, 12 Mar 2015 15:54:21 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r279934 - head/sys/dev/cxgbe References: <201503121822.t2CIML1c044098@svn.freebsd.org> In-Reply-To: <201503121822.t2CIML1c044098@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 22:54:25 -0000 On 03/12/2015 11:22, Ian Lepore wrote: > Author: ian > Date: Thu Mar 12 18:22:20 2015 > New Revision: 279934 > URL: https://svnweb.freebsd.org/changeset/base/279934 > > Log: > Nullterminate strings returned via sysctl. > > PR: 195668 > > Modified: > head/sys/dev/cxgbe/t4_l2t.c > head/sys/dev/cxgbe/t4_main.c > > Modified: head/sys/dev/cxgbe/t4_l2t.c > ============================================================================== > --- head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:09:39 2015 (r279933) > +++ head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:22:20 2015 (r279934) > @@ -321,6 +321,7 @@ skip: > mtx_unlock(&e->lock); > } > > + sbuf_putc(&sb, 0); /* nullterm */ This breaks the build, please fix. Here's the relevant snippet from Jenkins: --- t4_l2t.o --- :324:12: error: incompatible pointer types passing 'struct sbuf **' to parameter of type 'struct sbuf *'; remove & [-Werror,-Wincompatible-pointer-types] sbuf_putc(&sb, 0); /* nullterm */ ^~~ :77:30: note: passing argument to parameter here int sbuf_putc(struct sbuf *, int); ^ 1 error generated. *** [t4_l2t.o] Error code 1 From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 23:31:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF90BB98; Thu, 12 Mar 2015 23:31:04 +0000 (UTC) Received: from relay.mailchannels.net (aso-006-i440.relay.mailchannels.net [23.91.64.121]) by mx1.freebsd.org (Postfix) with ESMTP id AEB5EC8E; Thu, 12 Mar 2015 23:31:03 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp4.ore.mailhop.org (ip-10-229-11-165.us-west-2.compute.internal [10.229.11.165]) by relay.mailchannels.net (Postfix) with ESMTPA id 8D2C4100A6D; Thu, 12 Mar 2015 23:25:01 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp4.ore.mailhop.org (smtp4.ore.mailhop.org [10.21.145.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Thu, 12 Mar 2015 23:25:01 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1426202701683:833093024 X-MC-Ingress-Time: 1426202701683 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp4.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YWCTL-00060B-UZ; Thu, 12 Mar 2015 23:25:00 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2CNOpfq014959; Thu, 12 Mar 2015 17:24:51 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19f0RL5OiUjwNIYM2EV9BCJ Message-ID: <1426202691.6265.4.camel@freebsd.org> Subject: Re: svn commit: r279932 - head/sys/vm From: Ian Lepore To: Ryan Stone Date: Thu, 12 Mar 2015 17:24:51 -0600 In-Reply-To: References: <201503121806.t2CI6VSU034853@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 23:31:04 -0000 On Thu, 2015-03-12 at 17:02 -0400, Ryan Stone wrote: > On Thu, Mar 12, 2015 at 2:06 PM, Ian Lepore wrote: > > > Nullterminate strings returned via sysctl. > > > > PR: 195668 > > > > To quote the manpage: > > > The *sbuf* family of functions allows one to safely > > allocate, construct and release bounded null-terminated > > strings in kernel space. > > IMO the sbuf API is broken if we have to explicitly null-terminate the > string ourselves. If we want the nullterm to be counted in the length of data in the buffer (and thus get transmitted back across the syscall boundary) we need to put an explicit counted nullterm byte into the buffer. I had started down the path of making that (counting the nullterm byte as part of the data in the buffer) a feature of sbuf that you could set with a flag, but then whoever added sbuf_new_for_sysctl() didn't propagate the flags field through the new function and I decided to not go off into the weeds making a new flavor of that takes flags. -- Ian From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 23:31:30 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71C43CE3; Thu, 12 Mar 2015 23:31:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 5DBA8CA0; Thu, 12 Mar 2015 23:31:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CNVUNp095986; Thu, 12 Mar 2015 23:31:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CNVUpm095985; Thu, 12 Mar 2015 23:31:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503122331.t2CNVUpm095985@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 12 Mar 2015 23:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279938 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 23:31:30 -0000 Author: ian Date: Thu Mar 12 23:31:29 2015 New Revision: 279938 URL: https://svnweb.freebsd.org/changeset/base/279938 Log: Fix a paste-o, sb is already a pointer in this one. Modified: head/sys/dev/cxgbe/t4_l2t.c Modified: head/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 21:15:38 2015 (r279937) +++ head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 23:31:29 2015 (r279938) @@ -321,7 +321,7 @@ skip: mtx_unlock(&e->lock); } - sbuf_putc(&sb, 0); /* nullterm */ + sbuf_putc(sb, 0); /* nullterm */ rc = sbuf_finish(sb); sbuf_delete(sb); From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 23:44:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BDF9FA8; Thu, 12 Mar 2015 23:44:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 17056E00; Thu, 12 Mar 2015 23:44:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2CNiSaD000771; Thu, 12 Mar 2015 23:44:28 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2CNiSeb000770; Thu, 12 Mar 2015 23:44:28 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201503122344.t2CNiSeb000770@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 12 Mar 2015 23:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279939 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 23:44:29 -0000 Author: rstone Date: Thu Mar 12 23:44:28 2015 New Revision: 279939 URL: https://svnweb.freebsd.org/changeset/base/279939 Log: hwpmc: Fix event number to match enum name Differential revision: https://reviews.freebsd.org/D1592 Reviewed by: Joseph Kong MFC after: 1 month Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Thu Mar 12 23:31:29 2015 (r279938) +++ head/sys/dev/hwpmc/hwpmc_core.c Thu Mar 12 23:44:28 2015 (r279939) @@ -1651,9 +1651,9 @@ static struct iap_event_descr iap_events IAPDESCR(D3H_01H, 0xD3, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(D3H_03H, 0xD0, 0x3, IAP_F_IBX ), + IAPDESCR(D3H_03H, 0xD3, 0x03, IAP_F_IBX), IAPDESCR(D3H_04H, 0xD3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX), /* Not defined for IBX */ - IAPDESCR(D3H_0CH, 0xD0, 0x0, IAP_F_IBX ), + IAPDESCR(D3H_0CH, 0xD3, 0x0C, IAP_F_IBX), IAPDESCR(D3H_10H, 0xD3, 0x10, IAP_F_IBX ), IAPDESCR(D3H_20H, 0xD3, 0x20, IAP_F_IBX ), From owner-svn-src-head@FreeBSD.ORG Thu Mar 12 23:45:35 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8227D1A4; Thu, 12 Mar 2015 23:45:35 +0000 (UTC) Received: from relay.mailchannels.net (ar-005-i205.relay.mailchannels.net [162.253.144.87]) by mx1.freebsd.org (Postfix) with ESMTP id D4E7AE1F; Thu, 12 Mar 2015 23:45:33 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp5.ore.mailhop.org (ip-10-237-13-110.us-west-2.compute.internal [10.237.13.110]) by relay.mailchannels.net (Postfix) with ESMTPA id 9645A12066C; Thu, 12 Mar 2015 23:39:00 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp5.ore.mailhop.org (smtp5.ore.mailhop.org [10.83.15.107]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Thu, 12 Mar 2015 23:39:00 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1426203540706:3833725909 X-MC-Ingress-Time: 1426203540706 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp5.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YWCgt-0000dF-SD; Thu, 12 Mar 2015 23:38:59 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2CNcwjZ014979; Thu, 12 Mar 2015 17:38:58 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX19vSGsIRjT7bzGQurhTA4vi Message-ID: <1426203538.6265.6.camel@freebsd.org> Subject: Re: svn commit: r279934 - head/sys/dev/cxgbe From: Ian Lepore To: Navdeep Parhar Date: Thu, 12 Mar 2015 17:38:58 -0600 In-Reply-To: <5502191D.1010901@FreeBSD.org> References: <201503121822.t2CIML1c044098@svn.freebsd.org> <5502191D.1010901@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 23:45:35 -0000 On Thu, 2015-03-12 at 15:54 -0700, Navdeep Parhar wrote: > On 03/12/2015 11:22, Ian Lepore wrote: > > Author: ian > > Date: Thu Mar 12 18:22:20 2015 > > New Revision: 279934 > > URL: https://svnweb.freebsd.org/changeset/base/279934 > > > > Log: > > Nullterminate strings returned via sysctl. > > > > PR: 195668 > > > > Modified: > > head/sys/dev/cxgbe/t4_l2t.c > > head/sys/dev/cxgbe/t4_main.c > > > > Modified: head/sys/dev/cxgbe/t4_l2t.c > > ============================================================================== > > --- head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:09:39 2015 (r279933) > > +++ head/sys/dev/cxgbe/t4_l2t.c Thu Mar 12 18:22:20 2015 (r279934) > > @@ -321,6 +321,7 @@ skip: > > mtx_unlock(&e->lock); > > } > > > > + sbuf_putc(&sb, 0); /* nullterm */ > > This breaks the build, please fix. > > Here's the relevant snippet from Jenkins: > > --- t4_l2t.o --- > :324:12: > error: incompatible pointer types passing 'struct sbuf **' to parameter > of type 'struct sbuf *'; remove & [-Werror,-Wincompatible-pointer-types] > sbuf_putc(&sb, 0); /* nullterm */ > ^~~ > :77:30: > note: passing argument to parameter here > int sbuf_putc(struct sbuf *, int); > ^ > 1 error generated. > *** [t4_l2t.o] Error code 1 > Ooops, sorry about that, I didn't notice the different levels of indirection in the two files and pasted the same line into both. -- Ian From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 00:09:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E6F46DD; Fri, 13 Mar 2015 00:09:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 4F02513C; Fri, 13 Mar 2015 00:09:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D090BQ011394; Fri, 13 Mar 2015 00:09:00 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D08xjY011385; Fri, 13 Mar 2015 00:08:59 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201503130008.t2D08xjY011385@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 13 Mar 2015 00:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279940 - in head/sys/powerpc: aim include pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 00:09:00 -0000 Author: nwhitehorn Date: Fri Mar 13 00:08:58 2015 New Revision: 279940 URL: https://svnweb.freebsd.org/changeset/base/279940 Log: Deallocate any leftover page table entries in the LPAR at boot. This prevents contamination from a previous kernel (e.g. after shutdown -r). Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/include/slb.h head/sys/powerpc/pseries/mmu_phyp.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Mar 12 23:44:28 2015 (r279939) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Mar 13 00:08:58 2015 (r279940) @@ -1898,6 +1898,8 @@ moea64_get_unique_vsid(void) { hash &= VSID_HASHMASK & ~(VSID_NBPW - 1); hash |= i; } + if (hash == VSID_VRMA) /* also special, avoid this too */ + continue; KASSERT(!(moea64_vsid_bitmap[n] & mask), ("Allocating in-use VSID %#zx\n", hash)); moea64_vsid_bitmap[n] |= mask; Modified: head/sys/powerpc/include/slb.h ============================================================================== --- head/sys/powerpc/include/slb.h Thu Mar 12 23:44:28 2015 (r279939) +++ head/sys/powerpc/include/slb.h Fri Mar 13 00:08:58 2015 (r279940) @@ -62,6 +62,9 @@ #define SLBE_ESID_MASK 0xfffffffff0000000UL /* Effective segment ID mask */ #define SLBE_ESID_SHIFT 28 +/* Virtual real-mode VSID in LPARs */ +#define VSID_VRMA 0x1ffffff + /* * User segment for copyin/out */ Modified: head/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- head/sys/powerpc/pseries/mmu_phyp.c Thu Mar 12 23:44:28 2015 (r279939) +++ head/sys/powerpc/pseries/mmu_phyp.c Fri Mar 13 00:08:58 2015 (r279940) @@ -114,6 +114,8 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t uint32_t prop[2]; uint32_t nptlp, shift = 0, slb_encoding = 0; uint32_t lp_size, lp_encoding; + struct lpte old; + uint64_t vsid; phandle_t dev, node, root; int idx, len, res; @@ -150,6 +152,18 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t moea64_pteg_count = final_pteg_count / sizeof(struct lpteg); + /* Clear any old page table entries */ + for (idx = 0; idx < moea64_pteg_count*8; idx++) { + phyp_pft_hcall(H_READ, 0, idx, 0, 0, &old.pte_hi, + &old.pte_lo, &old.pte_lo); + vsid = (old.pte_hi << (ADDR_API_SHFT64 - ADDR_PIDX_SHFT)) >> 28; + if (vsid == VSID_VRMA || vsid == 0 /* Older VRMA */) + continue; + + if (old.pte_hi & LPTE_VALID) + phyp_hcall(H_REMOVE, 0, idx, 0); + } + /* * Scan the large page size property for PAPR compatible machines. * See PAPR D.5 Changes to Section 5.1.4, 'CPU Node Properties' From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 01:16:15 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8B4F694; Fri, 13 Mar 2015 01:16:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 A485EC44; Fri, 13 Mar 2015 01:16:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D1GF9I042218; Fri, 13 Mar 2015 01:16:15 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D1GFhG042217; Fri, 13 Mar 2015 01:16:15 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201503130116.t2D1GFhG042217@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 13 Mar 2015 01:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279941 - head/sys/dev/mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 01:16:15 -0000 Author: yongari Date: Fri Mar 13 01:16:14 2015 New Revision: 279941 URL: https://svnweb.freebsd.org/changeset/base/279941 Log: Restore auto MDIX for RTL8211B and newer revision PHYs which was broken in r279903. Reported by: john <> feith . com Modified: head/sys/dev/mii/rgephy.c Modified: head/sys/dev/mii/rgephy.c ============================================================================== --- head/sys/dev/mii/rgephy.c Fri Mar 13 00:08:58 2015 (r279940) +++ head/sys/dev/mii/rgephy.c Fri Mar 13 01:16:14 2015 (r279941) @@ -531,7 +531,7 @@ rgephy_reset(struct mii_softc *sc) PHY_WRITE(sc, RGEPHY_MII_SSR, ssr); } } - break; + /* FALLTHROUGH */ default: if (sc->mii_mpd_rev >= RGEPHY_8211B) { pcr = PHY_READ(sc, RGEPHY_MII_PCR); From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 02:16:41 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24E6353F; Fri, 13 Mar 2015 02:16:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 0F8053D8; Fri, 13 Mar 2015 02:16:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D2GeO9069225; Fri, 13 Mar 2015 02:16:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D2Gel2069219; Fri, 13 Mar 2015 02:16:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503130216.t2D2Gel2069219@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 13 Mar 2015 02:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279943 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 02:16:41 -0000 Author: adrian Date: Fri Mar 13 02:16:39 2015 New Revision: 279943 URL: https://svnweb.freebsd.org/changeset/base/279943 Log: Commit 802.1q configuration support for the AR8327. This is slightly different to the other switches - the VLAN table (VTU) programs in the vlan port mapping /and/ the port config (tagged, untagged, passthrough, any.) So: * Add VTU operations to program the VTU (vlan table) * abstract out the mirror-disable function so it's .. well, a function. * setup the port to have a dot1q configuration for dot1q - the port security is VLAN (not per-port VLAN) and requires an entry in the VLAN table; * add set_dot1q / get_dot1q to program the VLAN table; * since the tagged/untagged ports are now programmed into the VTU, rather than global - plumb the ports /and/ untagged ports bitmaps through the arswitch API. Tested: * AP135 - QCA9558 SoC + AR8327N switch Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.h head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Fri Mar 13 01:18:46 2015 (r279942) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Fri Mar 13 02:16:39 2015 (r279943) @@ -66,6 +66,51 @@ #include "miibus_if.h" #include "etherswitch_if.h" + +static int +ar8327_vlan_op(struct arswitch_softc *sc, uint32_t op, uint32_t vid, + uint32_t data) +{ + int err; + + /* + * Wait for the "done" bit to finish. + */ + if (arswitch_waitreg(sc->sc_dev, AR8327_REG_VTU_FUNC1, + AR8327_VTU_FUNC1_BUSY, 0, 5)) + return (EBUSY); + + /* + * If it's a "load" operation, then ensure 'data' is loaded + * in first. + */ + if ((op & AR8327_VTU_FUNC1_OP) == AR8327_VTU_FUNC1_OP_LOAD) { + err = arswitch_writereg(sc->sc_dev, AR8327_REG_VTU_FUNC0, data); + if (err) + return (err); + } + + /* + * Set the VID. + */ + op |= ((vid & 0xfff) << AR8327_VTU_FUNC1_VID_S); + + /* + * Set busy bit to start loading in the command. + */ + op |= AR8327_VTU_FUNC1_BUSY; + arswitch_writereg(sc->sc_dev, AR8327_REG_VTU_FUNC1, op); + + /* + * Finally - wait for it to load. + */ + if (arswitch_waitreg(sc->sc_dev, AR8327_REG_VTU_FUNC1, + AR8327_VTU_FUNC1_BUSY, 0, 5)) + return (EBUSY); + + return (0); +} + static void ar8327_phy_fixup(struct arswitch_softc *sc, int phy) { @@ -742,7 +787,7 @@ ar8327_port_vlan_get(struct arswitch_sof /* Retrieve the PVID */ sc->hal.arswitch_vlan_get_pvid(sc, p->es_port, &p->es_pvid); - /* Retrieve the current port configuration */ + /* Retrieve the current port configuration from the VTU */ /* * DOUBLE_TAG * VLAN_MODE_ADD @@ -754,10 +799,24 @@ ar8327_port_vlan_get(struct arswitch_sof } static void +ar8327_port_disable_mirror(struct arswitch_softc *sc, int port) +{ + + arswitch_modifyreg(sc->sc_dev, + AR8327_REG_PORT_LOOKUP(port), + AR8327_PORT_LOOKUP_ING_MIRROR_EN, + 0); + arswitch_modifyreg(sc->sc_dev, + AR8327_REG_PORT_HOL_CTRL1(port), + AR8327_PORT_HOL_CTRL1_EG_MIRROR_EN, + 0); +} + +static void ar8327_reset_vlans(struct arswitch_softc *sc) { int i; - uint32_t mode, t; + uint32_t t; int ports; ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); @@ -787,43 +846,66 @@ ar8327_reset_vlans(struct arswitch_softc */ ports = 0x7f; + /* + * XXX TODO: set things up correctly for vlans! + */ for (i = 0; i < AR8327_NUM_PORTS; i++) { + int egress, ingress; - if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) + if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { sc->vid[i] = i | ETHERSWITCH_VID_VALID; + /* set egress == out_keep */ + ingress = AR8X16_PORT_VLAN_MODE_PORT_ONLY; + /* in_port_only, forward */ + egress = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; + } else if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + ingress = AR8X16_PORT_VLAN_MODE_SECURE; + egress = AR8327_PORT_VLAN1_OUT_MODE_UNMOD; + } else { + /* set egress == out_keep */ + ingress = AR8X16_PORT_VLAN_MODE_PORT_ONLY; + /* in_port_only, forward */ + egress = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; + } /* set pvid = 1; there's only one vlangroup to start with */ t = 1 << AR8327_PORT_VLAN0_DEF_SVID_S; t |= 1 << AR8327_PORT_VLAN0_DEF_CVID_S; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN0(i), t); - /* set egress == out_keep */ - mode = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; - t = AR8327_PORT_VLAN1_PORT_VLAN_PROP; - t |= mode << AR8327_PORT_VLAN1_OUT_MODE_S; + t |= egress << AR8327_PORT_VLAN1_OUT_MODE_S; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN1(i), t); /* Ports can see other ports */ + /* XXX not entirely true for dot1q? */ t = (ports & ~(1 << i)); /* all ports besides us */ t |= AR8327_PORT_LOOKUP_LEARN; - /* in_port_only, forward */ - t |= AR8X16_PORT_VLAN_MODE_PORT_ONLY << AR8327_PORT_LOOKUP_IN_MODE_S; + t |= ingress << AR8327_PORT_LOOKUP_IN_MODE_S; t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(i), t); + } - /* - * Disable port mirroring entirely. - */ - arswitch_modifyreg(sc->sc_dev, - AR8327_REG_PORT_LOOKUP(i), - AR8327_PORT_LOOKUP_ING_MIRROR_EN, - 0); - arswitch_modifyreg(sc->sc_dev, - AR8327_REG_PORT_HOL_CTRL1(i), - AR8327_PORT_HOL_CTRL1_EG_MIRROR_EN, - 0); + /* + * Disable port mirroring entirely. + */ + for (i = 0; i < AR8327_NUM_PORTS; i++) { + ar8327_port_disable_mirror(sc, i); + } + + /* + * If dot1q - set pvid; dot1q, etc. + */ + sc->vid[0] = 1; + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + for (i = 0; i < AR8327_NUM_PORTS; i++) { + /* Each port - pvid 1 */ + sc->hal.arswitch_vlan_set_pvid(sc, i, sc->vid[0]); + } + /* Initialise vlan1 - all ports, untagged */ + sc->hal.arswitch_set_dot1q_vlan(sc, ports, ports, sc->vid[0]); + sc->vid[0] |= ETHERSWITCH_VID_VALID; } ARSWITCH_UNLOCK(sc); @@ -867,9 +949,6 @@ static int ar8327_vlan_getvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) { - /* XXX for now, no dot1q vlans */ - if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) - return (EINVAL); return (ar8xxx_getvgroup(sc, vg)); } @@ -877,9 +956,6 @@ static int ar8327_vlan_setvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) { - /* XXX for now, no dot1q vlans */ - if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) - return (EINVAL); return (ar8xxx_setvgroup(sc, vg)); } @@ -939,6 +1015,98 @@ ar8327_atu_flush(struct arswitch_softc * return (ret); } +static int +ar8327_flush_dot1q_vlan(struct arswitch_softc *sc) +{ + + return (ar8327_vlan_op(sc, AR8327_VTU_FUNC1_OP_FLUSH, 0, 0)); +} + +static int +ar8327_purge_dot1q_vlan(struct arswitch_softc *sc, int vid) +{ + + return (ar8327_vlan_op(sc, AR8327_VTU_FUNC1_OP_PURGE, vid, 0)); +} + +static int +ar8327_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, + uint32_t *untagged_ports, int vid) +{ + int i, r; + uint32_t op, reg, val; + + op = AR8327_VTU_FUNC1_OP_GET_ONE; + + /* Filter out the vid flags; only grab the VLAN ID */ + vid &= 0xfff; + + /* XXX TODO: the VTU here stores egress mode - keep, tag, untagged, none */ + r = ar8327_vlan_op(sc, op, vid, 0); + if (r != 0) { + device_printf(sc->sc_dev, "%s: %d: op failed\n", __func__, vid); + } + + reg = arswitch_readreg(sc->sc_dev, AR8327_REG_VTU_FUNC0); + DPRINTF(sc->sc_dev, "%s: %d: reg=0x%08x\n", __func__, vid, reg); + + /* + * If any of the bits are set, update the port mask. + * Worry about the port config itself when getport() is called. + */ + *ports = 0; + for (i = 0; i < AR8327_NUM_PORTS; i++) { + val = reg >> AR8327_VTU_FUNC0_EG_MODE_S(i); + val = val & 0x3; + /* XXX KEEP (unmodified?) */ + if (val == AR8327_VTU_FUNC0_EG_MODE_TAG) { + *ports |= (1 << i); + } else if (val == AR8327_VTU_FUNC0_EG_MODE_UNTAG) { + *ports |= (1 << i); + *untagged_ports |= (1 << i); + } + } + + return (0); +} + +static int +ar8327_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, + uint32_t untagged_ports, int vid) +{ + int i; + uint32_t op, val, mode; + + op = AR8327_VTU_FUNC1_OP_LOAD; + vid &= 0xfff; + + DPRINTF(sc->sc_dev, + "%s: vid: %d, ports=0x%08x, untagged_ports=0x%08x\n", + __func__, + vid, + ports, + untagged_ports); + + /* + * Mark it as valid; and that it should use per-VLAN MAC table, + * not VID=0 when doing MAC lookups + */ + val = AR8327_VTU_FUNC0_VALID | AR8327_VTU_FUNC0_IVL; + + for (i = 0; i < AR8327_NUM_PORTS; i++) { + if ((ports & BIT(i)) == 0) + mode = AR8327_VTU_FUNC0_EG_MODE_NOT; + else if (untagged_ports & BIT(i)) + mode = AR8327_VTU_FUNC0_EG_MODE_UNTAG; + else + mode = AR8327_VTU_FUNC0_EG_MODE_TAG; + + val |= mode << AR8327_VTU_FUNC0_EG_MODE_S(i); + } + + return (ar8327_vlan_op(sc, op, vid, val)); +} + void ar8327_attach(struct arswitch_softc *sc) { @@ -952,6 +1120,10 @@ ar8327_attach(struct arswitch_softc *sc) sc->hal.arswitch_vlan_setvgroup = ar8327_vlan_setvgroup; sc->hal.arswitch_port_vlan_setup = ar8327_port_vlan_setup; sc->hal.arswitch_port_vlan_get = ar8327_port_vlan_get; + sc->hal.arswitch_flush_dot1q_vlan = ar8327_flush_dot1q_vlan; + sc->hal.arswitch_purge_dot1q_vlan = ar8327_purge_dot1q_vlan; + sc->hal.arswitch_set_dot1q_vlan = ar8327_set_dot1q_vlan; + sc->hal.arswitch_get_dot1q_vlan = ar8327_get_dot1q_vlan; sc->hal.arswitch_vlan_init_hw = ar8327_reset_vlans; sc->hal.arswitch_vlan_get_pvid = ar8327_get_pvid; Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Fri Mar 13 01:18:46 2015 (r279942) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Fri Mar 13 02:16:39 2015 (r279943) @@ -103,7 +103,8 @@ ar8xxx_purge_dot1q_vlan(struct arswitch_ } int -ar8xxx_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid) +ar8xxx_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, + uint32_t *untagged_ports, int vid) { uint32_t reg; int err; @@ -120,11 +121,13 @@ ar8xxx_get_dot1q_vlan(struct arswitch_so } reg &= ((1 << (sc->numphys + 1)) - 1); *ports = reg; + *untagged_ports = reg; return (0); } int -ar8xxx_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, int vid) +ar8xxx_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, + uint32_t untagged_ports, int vid) { int err; @@ -223,7 +226,7 @@ ar8xxx_reset_vlans(struct arswitch_softc ports = 0; for (i = 0; i <= sc->numphys; i++) ports |= (1 << i); - sc->hal.arswitch_set_dot1q_vlan(sc, ports, sc->vid[0]); + sc->hal.arswitch_set_dot1q_vlan(sc, ports, sc->vid[0], sc->vid[0]); sc->vid[0] |= ETHERSWITCH_VID_VALID; } else if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { /* Initialize the port based vlans. */ @@ -240,6 +243,7 @@ ar8xxx_reset_vlans(struct arswitch_softc ports << AR8X16_PORT_VLAN_DEST_PORTS_SHIFT | AR8X16_PORT_VLAN_MODE_SECURE << AR8X16_PORT_VLAN_MODE_PORT_ONLY); + /* XXX TODO: SECURE / PORT_ONLY is wrong? */ } } else { /* Disable the ingress filter and get everyone on all vlans. */ @@ -286,18 +290,21 @@ ar8xxx_getvgroup(struct arswitch_softc * switch (sc->vlan_mode) { case ETHERSWITCH_VLAN_DOT1Q: err = sc->hal.arswitch_get_dot1q_vlan(sc, &vg->es_member_ports, + &vg->es_untagged_ports, vg->es_vid); break; case ETHERSWITCH_VLAN_PORT: err = sc->hal.arswitch_get_port_vlan(sc, &vg->es_member_ports, vg->es_vid); + vg->es_untagged_ports = vg->es_member_ports; break; default: vg->es_member_ports = 0; + vg->es_untagged_ports = 0; err = -1; } ARSWITCH_UNLOCK(sc); - vg->es_untagged_ports = vg->es_member_ports; + return (err); } @@ -344,7 +351,8 @@ ar8xxx_setvgroup(struct arswitch_softc * /* Member Ports. */ switch (sc->vlan_mode) { case ETHERSWITCH_VLAN_DOT1Q: - err = sc->hal.arswitch_set_dot1q_vlan(sc, vg->es_member_ports, vid); + err = sc->hal.arswitch_set_dot1q_vlan(sc, vg->es_member_ports, + vg->es_untagged_ports, vid); break; case ETHERSWITCH_VLAN_PORT: err = sc->hal.arswitch_set_port_vlan(sc, vg->es_member_ports, vid); Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Fri Mar 13 01:18:46 2015 (r279942) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Fri Mar 13 02:16:39 2015 (r279943) @@ -37,8 +37,10 @@ int ar8xxx_set_pvid(struct arswitch_soft int ar8xxx_flush_dot1q_vlan(struct arswitch_softc *sc); int ar8xxx_purge_dot1q_vlan(struct arswitch_softc *sc, int vid); -int ar8xxx_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid); -int ar8xxx_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, int vid); +int ar8xxx_get_dot1q_vlan(struct arswitch_softc *sc, uint32_t *ports, + uint32_t *untagged_ports, int vid); +int ar8xxx_set_dot1q_vlan(struct arswitch_softc *sc, uint32_t ports, + uint32_t untagged_ports, int vid); int ar8xxx_get_port_vlan(struct arswitch_softc *sc, uint32_t *ports, int vid); int ar8xxx_set_port_vlan(struct arswitch_softc *sc, uint32_t ports, int vid); Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Fri Mar 13 01:18:46 2015 (r279942) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Fri Mar 13 02:16:39 2015 (r279943) @@ -103,9 +103,9 @@ struct arswitch_softc { int (* arswitch_purge_dot1q_vlan) (struct arswitch_softc *sc, int vid); int (* arswitch_get_dot1q_vlan) (struct arswitch_softc *, - uint32_t *ports, int vid); + uint32_t *ports, uint32_t *untagged_ports, int vid); int (* arswitch_set_dot1q_vlan) (struct arswitch_softc *sc, - uint32_t ports, int vid); + uint32_t ports, uint32_t untagged_ports, int vid); int (* arswitch_get_port_vlan) (struct arswitch_softc *sc, uint32_t *ports, int vid); int (* arswitch_set_port_vlan) (struct arswitch_softc *sc, From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 02:49:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B17E4AEC; Fri, 13 Mar 2015 02:49:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 9D9CF8DA; Fri, 13 Mar 2015 02:49:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D2nu69083315; Fri, 13 Mar 2015 02:49:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D2nuBs083314; Fri, 13 Mar 2015 02:49:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503130249.t2D2nuBs083314@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Mar 2015 02:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279944 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 02:49:56 -0000 Author: emaste Date: Fri Mar 13 02:49:55 2015 New Revision: 279944 URL: https://svnweb.freebsd.org/changeset/base/279944 Log: Delete stray clause 3 and renumber. Modified: head/sys/arm/include/in_cksum.h Modified: head/sys/arm/include/in_cksum.h ============================================================================== --- head/sys/arm/include/in_cksum.h Fri Mar 13 02:16:39 2015 (r279943) +++ head/sys/arm/include/in_cksum.h Fri Mar 13 02:49:55 2015 (r279944) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 02:54:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6479C7E; Fri, 13 Mar 2015 02:54:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 91B9D988; Fri, 13 Mar 2015 02:54:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D2slJh087359; Fri, 13 Mar 2015 02:54:47 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D2sl9i087358; Fri, 13 Mar 2015 02:54:47 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201503130254.t2D2sl9i087358@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 13 Mar 2015 02:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279945 - head/contrib/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 02:54:47 -0000 Author: sjg Date: Fri Mar 13 02:54:46 2015 New Revision: 279945 URL: https://svnweb.freebsd.org/changeset/base/279945 Log: Make sure that -- filemon is at start of a line, so that it is found as expected. Modified: head/contrib/bmake/meta.c Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Fri Mar 13 02:49:55 2015 (r279944) +++ head/contrib/bmake/meta.c Fri Mar 13 02:54:46 2015 (r279945) @@ -169,7 +169,7 @@ filemon_read(FILE *mfp, int fd) if ((fp = fdopen(fd, "r")) == NULL) err(1, "Could not read build monitor file '%d'", fd); - fprintf(mfp, "-- filemon acquired metadata --\n"); + fprintf(mfp, "\n-- filemon acquired metadata --\n"); while (fgets(buf, sizeof(buf), fp)) { fprintf(mfp, "%s", buf); From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 04:26:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B340ECE1; Fri, 13 Mar 2015 04:26:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 9EAA8369; Fri, 13 Mar 2015 04:26:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D4QnMR031412; Fri, 13 Mar 2015 04:26:49 GMT (envelope-from stas@FreeBSD.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D4Qnwu031411; Fri, 13 Mar 2015 04:26:49 GMT (envelope-from stas@FreeBSD.org) Message-Id: <201503130426.t2D4Qnwu031411@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: stas set sender to stas@FreeBSD.org using -f From: Stanislav Sedov Date: Fri, 13 Mar 2015 04:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279946 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 04:26:49 -0000 Author: stas Date: Fri Mar 13 04:26:48 2015 New Revision: 279946 URL: https://svnweb.freebsd.org/changeset/base/279946 Log: Fix debug symbols loading in libproc: 0 is a valid file descriptor. Reported by: Chris Torek Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Fri Mar 13 02:54:46 2015 (r279945) +++ head/lib/libproc/proc_sym.c Fri Mar 13 04:26:48 2015 (r279946) @@ -91,7 +91,7 @@ find_dbg_obj(const char *path) snprintf(dbg_path, sizeof(dbg_path), "/usr/lib/debug/%s.debug", path); fd = open(dbg_path, O_RDONLY); - if (fd > 0) + if (fd >= 0) return (fd); else return (open(path, O_RDONLY)); From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 07:29:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05F55372; Fri, 13 Mar 2015 07:29:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 E4D5E8C9; Fri, 13 Mar 2015 07:29:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D7Toxn016602; Fri, 13 Mar 2015 07:29:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D7ToGq016595; Fri, 13 Mar 2015 07:29:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201503130729.t2D7ToGq016595@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Mar 2015 07:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279947 - in head/share/doc: psd/title smm/title usd/title X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 07:29:51 -0000 Author: emaste Date: Fri Mar 13 07:29:49 2015 New Revision: 279947 URL: https://svnweb.freebsd.org/changeset/base/279947 Log: Remove UCB advertising clause per the letter dated July 22, 1999. Modified: head/share/doc/psd/title/Title head/share/doc/smm/title/Title head/share/doc/usd/title/Title Modified: head/share/doc/psd/title/Title ============================================================================== --- head/share/doc/psd/title/Title Fri Mar 13 04:26:48 2015 (r279946) +++ head/share/doc/psd/title/Title Fri Mar 13 07:29:49 2015 (r279947) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/smm/title/Title ============================================================================== --- head/share/doc/smm/title/Title Fri Mar 13 04:26:48 2015 (r279946) +++ head/share/doc/smm/title/Title Fri Mar 13 07:29:49 2015 (r279947) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/usd/title/Title ============================================================================== --- head/share/doc/usd/title/Title Fri Mar 13 04:26:48 2015 (r279946) +++ head/share/doc/usd/title/Title Fri Mar 13 07:29:49 2015 (r279947) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 08:47:17 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 502143E2; Fri, 13 Mar 2015 08:47:17 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 CB19F3D5; Fri, 13 Mar 2015 08:47:16 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2D8l2ac069723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Mar 2015 10:47:02 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2D8l2ac069723 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2D8l2lH069722; Fri, 13 Mar 2015 10:47:02 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Mar 2015 10:47:02 +0200 From: Konstantin Belousov To: Nathan Whitehorn Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc Message-ID: <20150313084702.GV2379@kib.kiev.ua> References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> <20150312213530.GT2379@kib.kiev.ua> <5502094D.5090001@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5502094D.5090001@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 08:47:17 -0000 On Thu, Mar 12, 2015 at 02:46:53PM -0700, Nathan Whitehorn wrote: > > On 03/12/15 14:35, Konstantin Belousov wrote: > > On Thu, Mar 12, 2015 at 02:29:43PM -0700, Nathan Whitehorn wrote: > >> On 03/12/15 14:22, Konstantin Belousov wrote: > >>> On Thu, Mar 12, 2015 at 09:15:39PM +0000, Nathan Whitehorn wrote: > >>>> Author: nwhitehorn > >>>> Date: Thu Mar 12 21:15:38 2015 > >>>> New Revision: 279937 > >>>> URL: https://svnweb.freebsd.org/changeset/base/279937 > >>>> > >>>> Log: > >>>> Provide VSX context in ucontext(3) API. > >>>> > >>>> Modified: > >>>> head/sys/powerpc/include/ucontext.h > >>>> head/sys/powerpc/powerpc/exec_machdep.c > >>>> > >>>> Modified: head/sys/powerpc/include/ucontext.h > >>>> ============================================================================== > >>>> --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) > >>>> +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) > >>>> @@ -46,6 +46,7 @@ typedef struct __mcontext { > >>>> uint32_t mc_av[2]; > >>>> register_t mc_frame[42]; > >>>> uint64_t mc_fpreg[33]; > >>>> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ > >>>> } mcontext_t __aligned(16); > >>>> > >>>> #if defined(_KERNEL) && defined(__powerpc64__) > >>>> @@ -60,6 +61,7 @@ typedef struct __mcontext32 { > >>>> uint32_t mc_av[2]; > >>>> uint32_t mc_frame[42]; > >>>> uint64_t mc_fpreg[33]; > >>>> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ > >>>> } mcontext32_t __aligned(16); > >>>> #endif > >>> It looks as if you broken the ABI compatibility by the change. Am I wrong ? > >>> > >> That is correct. It's a tier-2 platform and -CURRENT, so I'm not sure > >> it's worth the compatibility shims. I'm happy to add them if you think > >> otherwise. > > You are main maintainer of PowerPC port, IMO, so it is your decision. > > > > Note that 'this is current' argument is not applicable, since the change > > also breaks stable/* binaries. > > > > I do understand the argument of PowerPC being tier 2 architecture, but this > > makes me sad. Anyway, it is yours. For x86, I have to introduce > > getcontextx(3) mechanism. > > > This is a good point. I'll try to fix it. Is my understanding of how > this works correct? > > 1. Provide a sysarch() for the extended FPU state. > 2. Implement getcontextx() in the C library to fill extra properties if > required. > 3. Store state for signal trampoline in variable-sized stack area 4. Implement __getcontextx_size() and __fillcontextx2() for use in the deferred signal delivery while libthr is in critical section, see lib/libthr/thread/thr_sig.c:check_deferred_signal(). > > Implementation of (2) seems to rely on having spare members in ucontext, > which PowerPC unfortunately does not have. Is there a way around that? Indeed, this is very unfortunate. My concern is that typical application allocating ucontext_t on stack or by mallocing it, would get silent memory corruption after the extension of mcontext_t. It seems indeed that ABI breakage cannot be completely avoided, but it could be significantly reduced IMO. Is it true that mc_avec is only valid when _MC_AV_VALID bit is set ? If yes, we can introduce another mcontext flag, say _MC_XSTATE_VALID, which is mutually exclusive with the _MC_AC_VALID. The new flag indicates that there is external data, and the data is pointed to by some word placed in the previous mc_avec file, say mc_avec[0]. The altivec registers file content is moved into that external data area as well. Providing the external area size in mc_avec[1] allows to extend that block in the future-compatible manner. This way, applications which use ucontext_t and which are not aware about VSX, get the expected behaviour, possibly without seeing altivec. I.e. in typical case, we do not get random memory corruption. Meantime, I have a question. I looked at the powerpc/include/ucontex.h and tried to match it with the PowerISA specs 2.06 and 2.07. From what I understand, mc_fpreg corresponds to the floating-point registers file, mc_avec and mc_av to the 'Vector Facility Registers'. But I fail to see what would match the + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ file. The 7.2.1 Vector-Scalar Registers says 'Sixty-four 128-bit VSRs are provided'. From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 09:03:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7205D9E6; Fri, 13 Mar 2015 09:03:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 5487F803; Fri, 13 Mar 2015 09:03:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D93SgY062589; Fri, 13 Mar 2015 09:03:28 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D93Qwg062580; Fri, 13 Mar 2015 09:03:26 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503130903.t2D93Qwg062580@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 13 Mar 2015 09:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279948 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 09:03:28 -0000 Author: ae Date: Fri Mar 13 09:03:25 2015 New Revision: 279948 URL: https://svnweb.freebsd.org/changeset/base/279948 Log: Fix `ipfw fwd tablearg'. Use dedicated field nh4 in struct table_value to obtain IPv4 next hop address in tablearg case. Add `fwd tablearg' support for IPv6. ipfw(8) uses INADDR_ANY as next hop address in O_FORWARD_IP opcode for specifying tablearg case. For IPv6 we still use this opcode, but when packet identified as IPv6 packet, we obtain next hop address from dedicated field nh6 in struct table_value. Replace hopstore field in struct ip_fw_args with anonymous union and add hopstore6 field. Use this field to copy tablearg value for IPv6. Replace spare1 field in struct table_value with zoneid. Use it to keep scope zone id for link-local IPv6 addresses. Since spare1 was used internally, replace spare0 array with two variables spare0 and spare1. Use getaddrinfo(3)/getnameinfo(3) functions for parsing and formatting IPv6 addresses in table_value. Use zoneid field in struct table_value to store sin6_scope_id value. Since the kernel still uses embedded scope zone id to represent link-local addresses, convert next_hop6 address into this form before return from pfil processing. This also fixes in6_localip() check for link-local addresses. Differential Revision: https://reviews.freebsd.org/D2015 Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/tables.c head/sys/netinet/ip_fw.h head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_pfil.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_table_value.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Mar 13 07:29:49 2015 (r279947) +++ head/sbin/ipfw/ipfw.8 Fri Mar 13 09:03:25 2015 (r279948) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Aug 13, 2014 +.Dd March 13, 2015 .Dt IPFW 8 .Os .Sh NAME @@ -2078,6 +2078,8 @@ hook number to move packet to. maximum number of connections. .It Cm ipv4 IPv4 nexthop to fwd packets to. +.It Cm ipv6 +IPv6 nexthop to fwd packets to. .El .Pp The Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Fri Mar 13 07:29:49 2015 (r279947) +++ head/sbin/ipfw/tables.c Fri Mar 13 09:03:25 2015 (r279948) @@ -35,6 +35,7 @@ #include #include #include +#include #include "ipfw2.h" @@ -1384,6 +1385,7 @@ static void tentry_fill_value(ipfw_obj_header *oh, ipfw_obj_tentry *tent, char *arg, uint8_t type, uint32_t vmask) { + struct addrinfo hints, *res; uint32_t a4, flag, val, vm; ipfw_table_value *v; uint32_t i; @@ -1494,9 +1496,19 @@ tentry_fill_value(ipfw_obj_header *oh, i } break; case IPFW_VTYPE_NH6: - if (strchr(n, ':') != NULL && - inet_pton(AF_INET6, n, &v->nh6) == 1) - break; + if (strchr(n, ':') != NULL) { + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET6; + hints.ai_flags = AI_NUMERICHOST; + if (getaddrinfo(n, NULL, &hints, &res) == 0) { + v->nh6 = ((struct sockaddr_in6 *) + res->ai_addr)->sin6_addr; + v->zoneid = ((struct sockaddr_in6 *) + res->ai_addr)->sin6_scope_id; + freeaddrinfo(res); + break; + } + } etype = "ipv6"; break; } @@ -1643,10 +1655,11 @@ static void table_show_value(char *buf, size_t bufsize, ipfw_table_value *v, uint32_t vmask, int print_ip) { + char abuf[INET6_ADDRSTRLEN + IF_NAMESIZE + 2]; + struct sockaddr_in6 sa6; uint32_t flag, i, l; size_t sz; struct in_addr a4; - char abuf[INET6_ADDRSTRLEN]; sz = bufsize; @@ -1702,8 +1715,15 @@ table_show_value(char *buf, size_t bufsi l = snprintf(buf, sz, "%d,", v->dscp); break; case IPFW_VTYPE_NH6: - inet_ntop(AF_INET6, &v->nh6, abuf, sizeof(abuf)); - l = snprintf(buf, sz, "%s,", abuf); + sa6.sin6_family = AF_INET6; + sa6.sin6_len = sizeof(sa6); + sa6.sin6_addr = v->nh6; + sa6.sin6_port = 0; + sa6.sin6_scope_id = v->zoneid; + if (getnameinfo((const struct sockaddr *)&sa6, + sa6.sin6_len, abuf, sizeof(abuf), NULL, 0, + NI_NUMERICHOST) == 0) + l = snprintf(buf, sz, "%s,", abuf); break; } @@ -1862,11 +1882,12 @@ struct _table_value { uint32_t nat; /* O_NAT */ uint32_t nh4; uint8_t dscp; - uint8_t spare0[3]; + uint8_t spare0; + uint16_t spare1; /* -- 32 bytes -- */ struct in6_addr nh6; uint32_t limit; /* O_LIMIT */ - uint32_t spare1; + uint32_t zoneid; uint64_t refcnt; /* Number of references */ }; Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Fri Mar 13 07:29:49 2015 (r279947) +++ head/sys/netinet/ip_fw.h Fri Mar 13 09:03:25 2015 (r279948) @@ -721,7 +721,7 @@ struct _ipfw_dyn_rule { #define IPFW_VTYPE_TAG 0x00000020 /* tag/untag */ #define IPFW_VTYPE_DIVERT 0x00000040 /* divert/tee */ #define IPFW_VTYPE_NETGRAPH 0x00000080 /* netgraph/ngtee */ -#define IPFW_VTYPE_LIMIT 0x00000100 /* IPv6 nexthop */ +#define IPFW_VTYPE_LIMIT 0x00000100 /* limit */ #define IPFW_VTYPE_NH4 0x00000200 /* IPv4 nexthop */ #define IPFW_VTYPE_NH6 0x00000400 /* IPv6 nexthop */ @@ -817,10 +817,11 @@ typedef struct _ipfw_table_value { uint32_t nat; /* O_NAT */ uint32_t nh4; uint8_t dscp; - uint8_t spare0[3]; + uint8_t spare0; + uint16_t spare1; struct in6_addr nh6; uint32_t limit; /* O_LIMIT */ - uint32_t spare1; + uint32_t zoneid; /* scope zone id for nh6 */ uint64_t reserved; } ipfw_table_value; Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Mar 13 07:29:49 2015 (r279947) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Mar 13 09:03:25 2015 (r279948) @@ -2387,13 +2387,48 @@ do { \ if (q == NULL || q->rule != f || dyn_dir == MATCH_FORWARD) { struct sockaddr_in *sa; + sa = &(((ipfw_insn_sa *)cmd)->sa); if (sa->sin_addr.s_addr == INADDR_ANY) { - bcopy(sa, &args->hopstore, - sizeof(*sa)); - args->hopstore.sin_addr.s_addr = - htonl(tablearg); - args->next_hop = &args->hopstore; +#ifdef INET6 + /* + * We use O_FORWARD_IP opcode for + * fwd rule with tablearg, but tables + * now support IPv6 addresses. And + * when we are inspecting IPv6 packet, + * we can use nh6 field from + * table_value as next_hop6 address. + */ + if (is_ipv6) { + struct sockaddr_in6 *sa6; + + sa6 = args->next_hop6 = + &args->hopstore6; + sa6->sin6_family = AF_INET6; + sa6->sin6_len = sizeof(*sa6); + sa6->sin6_addr = TARG_VAL( + chain, tablearg, nh6); + /* + * Set sin6_scope_id only for + * link-local unicast addresses. + */ + if (IN6_IS_ADDR_LINKLOCAL( + &sa6->sin6_addr)) + sa6->sin6_scope_id = + TARG_VAL(chain, + tablearg, + zoneid); + } else +#endif + { + sa = args->next_hop = + &args->hopstore; + sa->sin_family = AF_INET; + sa->sin_len = sizeof(*sa); + sa->sin_addr.s_addr = htonl( + TARG_VAL(chain, tablearg, + nh4)); + } } else { args->next_hop = sa; } Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Mar 13 07:29:49 2015 (r279947) +++ head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Mar 13 09:03:25 2015 (r279948) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #include +#include #endif #include @@ -197,8 +198,20 @@ again: } #ifdef INET6 if (args.next_hop6 != NULL) { - bcopy(args.next_hop6, (fwd_tag+1), len); - if (in6_localip(&args.next_hop6->sin6_addr)) + struct sockaddr_in6 *sa6; + + sa6 = (struct sockaddr_in6 *)(fwd_tag + 1); + bcopy(args.next_hop6, sa6, len); + /* + * If nh6 address is link-local we should convert + * it to kernel internal form before doing any + * comparisons. + */ + if (sa6_embedscope(sa6, V_ip6_use_defzone) != 0) { + ret = EACCES; + break; + } + if (in6_localip(&sa6->sin6_addr)) (*m0)->m_flags |= M_FASTFWD_OURS; (*m0)->m_flags |= M_IP6_NEXTHOP; } Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Fri Mar 13 07:29:49 2015 (r279947) +++ head/sys/netpfil/ipfw/ip_fw_private.h Fri Mar 13 09:03:25 2015 (r279948) @@ -102,7 +102,10 @@ struct ip_fw_args { struct inpcb *inp; struct _ip6dn_args dummypar; /* dummynet->ip6_output */ - struct sockaddr_in hopstore; /* store here if cannot use a pointer */ + union { /* store here if cannot use a pointer */ + struct sockaddr_in hopstore; + struct sockaddr_in6 hopstore6; + }; }; MALLOC_DECLARE(M_IPFW); @@ -294,11 +297,12 @@ struct table_value { uint32_t nat; /* O_NAT */ uint32_t nh4; uint8_t dscp; - uint8_t spare0[3]; + uint8_t spare0; + uint16_t spare1; /* -- 32 bytes -- */ struct in6_addr nh6; uint32_t limit; /* O_LIMIT */ - uint32_t spare1; + uint32_t zoneid; /* scope zone id for nh6 */ uint64_t refcnt; /* Number of references */ }; Modified: head/sys/netpfil/ipfw/ip_fw_table_value.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_value.c Fri Mar 13 07:29:49 2015 (r279947) +++ head/sys/netpfil/ipfw/ip_fw_table_value.c Fri Mar 13 09:03:25 2015 (r279948) @@ -117,6 +117,7 @@ mask_table_value(struct table_value *src _MCPY(dscp, IPFW_VTYPE_DSCP); _MCPY(nh4, IPFW_VTYPE_NH4); _MCPY(nh6, IPFW_VTYPE_NH6); + _MCPY(zoneid, IPFW_VTYPE_NH6); #undef _MCPY } @@ -666,6 +667,7 @@ ipfw_import_table_value_v1(ipfw_table_va v.nh4 = iv->nh4; v.nh6 = iv->nh6; v.limit = iv->limit; + v.zoneid = iv->zoneid; memcpy(iv, &v, sizeof(ipfw_table_value)); } @@ -691,6 +693,7 @@ ipfw_export_table_value_v1(struct table_ iv.limit = v->limit; iv.nh4 = v->nh4; iv.nh6 = v->nh6; + iv.zoneid = v->zoneid; memcpy(piv, &iv, sizeof(iv)); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 09:38:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8708AE75; Fri, 13 Mar 2015 09:38:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6F0EDAE0; Fri, 13 Mar 2015 09:38:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D9cHRY077150; Fri, 13 Mar 2015 09:38:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D9cGYU077146; Fri, 13 Mar 2015 09:38:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503130938.t2D9cGYU077146@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Mar 2015 09:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279949 - in head: lib/libstand sys/boot/amd64 sys/boot/efi/libefi sys/boot/ficl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 09:38:18 -0000 Author: jhb Date: Fri Mar 13 09:38:16 2015 New Revision: 279949 URL: https://svnweb.freebsd.org/changeset/base/279949 Log: The System V ABI for amd64 allows functions to use space in a 128 byte redzone below the stack pointer for scratch space and requires interrupt and signal frames to avoid overwriting it. However, EFI uses the Windows ABI which does not support this. As a result, interrupt handlers in EFI push their interrupt frames directly on top of the stack pointer. If the compiler used the red zone in a function in the EFI loader, then a device interrupt that occurred while that function was running could trash its local variables. In practice this happens fairly reliable when using gzipfs as an interrupt during decompression can trash the local variables in the inflate_table() function resulting in corrupted output or hangs. Fix this by disabling the redzone for amd64 EFI binaries. This requires building not only the loader but any libraries used by the loader without redzone support. Thanks to Jilles for pointing me at the redzone once I found the stack corruption. Differential Revision: https://reviews.freebsd.org/D2054 Reviewed by: imp MFC after: 2 weeks Sponsored by: Cisco Systems, Inc. Modified: head/lib/libstand/Makefile head/sys/boot/amd64/Makefile.inc head/sys/boot/efi/libefi/Makefile head/sys/boot/ficl/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Fri Mar 13 09:03:25 2015 (r279948) +++ head/lib/libstand/Makefile Fri Mar 13 09:38:16 2015 (r279949) @@ -28,7 +28,7 @@ CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -m CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -fPIC +CFLAGS+= -fPIC -mno-red-zone .endif .if ${MACHINE} == "pc98" CFLAGS+= -Os Modified: head/sys/boot/amd64/Makefile.inc ============================================================================== --- head/sys/boot/amd64/Makefile.inc Fri Mar 13 09:03:25 2015 (r279948) +++ head/sys/boot/amd64/Makefile.inc Fri Mar 13 09:38:16 2015 (r279949) @@ -5,7 +5,7 @@ BINDIR?= /boot # See conf/kern.mk for the correct set of these -CFLAGS+= -ffreestanding +CFLAGS+= -ffreestanding -mno-red-zone CFLAGS+= -mno-mmx -mno-sse -mno-aes -mno-avx -msoft-float LDFLAGS+= -nostdlib Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Fri Mar 13 09:03:25 2015 (r279948) +++ head/sys/boot/efi/libefi/Makefile Fri Mar 13 09:38:16 2015 (r279949) @@ -9,7 +9,7 @@ SRCS= delay.c efi_console.c efinet.c efi SRCS+= nullconsole.c comconsole.c .if ${MACHINE_ARCH} == "amd64" -CFLAGS+= -fPIC +CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Fri Mar 13 09:03:25 2015 (r279948) +++ head/sys/boot/ficl/Makefile Fri Mar 13 09:38:16 2015 (r279949) @@ -21,6 +21,9 @@ CFLAGS+= -ffreestanding CFLAGS+= -march=i386 CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif +.if ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -mno-red-zone +.endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 09:41:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1468FF4; Fri, 13 Mar 2015 09:41:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 ACDFBBE2; Fri, 13 Mar 2015 09:41:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D9fSst078710; Fri, 13 Mar 2015 09:41:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D9fSR8078708; Fri, 13 Mar 2015 09:41:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503130941.t2D9fSR8078708@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Mar 2015 09:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279950 - in head/sys/boot: amd64/efi efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 09:41:28 -0000 Author: jhb Date: Fri Mar 13 09:41:27 2015 New Revision: 279950 URL: https://svnweb.freebsd.org/changeset/base/279950 Log: Enable bzipfs support in the EFI loader. - Add bzipfs to the list of supported filesystems in the EFI loader. - Increase the heap size allocated for the EFI loader from 2MB to 3MB. Differential Revision: https://reviews.freebsd.org/D2053 Reviewed by: benno, emaste, imp MFC after: 2 weeks Sponsored by: Cisco Systems, Inc. Modified: head/sys/boot/amd64/efi/conf.c head/sys/boot/efi/libefi/libefi.c Modified: head/sys/boot/amd64/efi/conf.c ============================================================================== --- head/sys/boot/amd64/efi/conf.c Fri Mar 13 09:38:16 2015 (r279949) +++ head/sys/boot/amd64/efi/conf.c Fri Mar 13 09:41:27 2015 (r279950) @@ -44,6 +44,7 @@ struct fs_ops *file_system[] = { &cd9660_fsops, &nfs_fsops, &gzipfs_fsops, + &bzipfs_fsops, NULL }; Modified: head/sys/boot/efi/libefi/libefi.c ============================================================================== --- head/sys/boot/efi/libefi/libefi.c Fri Mar 13 09:38:16 2015 (r279949) +++ head/sys/boot/efi/libefi/libefi.c Fri Mar 13 09:41:27 2015 (r279950) @@ -102,7 +102,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SY (void)console_control->SetMode(console_control, EfiConsoleControlScreenText); - heapsize = 2 * 1024 * 1024; + heapsize = 3 * 1024 * 1024; status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, EFI_SIZE_TO_PAGES(heapsize), &heap); if (status != EFI_SUCCESS) From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 09:45:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80C712F8; Fri, 13 Mar 2015 09:45:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6C97DC30; Fri, 13 Mar 2015 09:45:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D9j7lQ081561; Fri, 13 Mar 2015 09:45:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D9j7UT081560; Fri, 13 Mar 2015 09:45:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503130945.t2D9j7UT081560@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Mar 2015 09:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279951 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 09:45:07 -0000 Author: jhb Date: Fri Mar 13 09:45:06 2015 New Revision: 279951 URL: https://svnweb.freebsd.org/changeset/base/279951 Log: Simplify string mangling in ifmaybeload(). - Use strlcpy() instead of strcpy(). - Use strlcat() instead of a strlcpy() with a magic number subtracted from the length. - Replace strncmp(..., strlen(foo) + 1) with strcmp(...). Differential Revision: https://reviews.freebsd.org/D1814 Reviewed by: rpaulo MFC after: 2 weeks Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Fri Mar 13 09:41:27 2015 (r279950) +++ head/sbin/ifconfig/ifconfig.c Fri Mar 13 09:45:06 2015 (r279951) @@ -1280,9 +1280,8 @@ ifmaybeload(const char *name) } /* turn interface and unit into module name */ - strcpy(ifkind, "if_"); - strlcpy(ifkind + MOD_PREFIX_LEN, ifname, - sizeof(ifkind) - MOD_PREFIX_LEN); + strlcpy(ifkind, "if_", sizeof(ifkind)); + strlcat(ifkind, ifname, sizeof(ifkind)); /* scan files in kernel */ mstat.version = sizeof(struct module_stat); @@ -1299,8 +1298,8 @@ ifmaybeload(const char *name) cp = mstat.name; } /* already loaded? */ - if (strncmp(ifname, cp, strlen(ifname) + 1) == 0 || - strncmp(ifkind, cp, strlen(ifkind) + 1) == 0) + if (strcmp(ifname, cp) == 0 || + strcmp(ifkind, cp) == 0) return; } } From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 09:50:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13AE7519; Fri, 13 Mar 2015 09:50:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 F32B6CAD; Fri, 13 Mar 2015 09:50:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2D9oUMi082737; Fri, 13 Mar 2015 09:50:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2D9oUWL082735; Fri, 13 Mar 2015 09:50:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201503130950.t2D9oUWL082735@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Mar 2015 09:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279952 - in head: etc/defaults share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 09:50:31 -0000 Author: jhb Date: Fri Mar 13 09:50:29 2015 New Revision: 279952 URL: https://svnweb.freebsd.org/changeset/base/279952 Log: - Align comment for df flags variable in periodic.conf. - Note default value of df flags variable in periodoc.conf(5). MFC after: 1 week Modified: head/etc/defaults/periodic.conf head/share/man/man5/periodic.conf.5 Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Fri Mar 13 09:45:06 2015 (r279951) +++ head/etc/defaults/periodic.conf Fri Mar 13 09:50:29 2015 (r279952) @@ -89,7 +89,7 @@ daily_news_expire_enable="YES" # Run # 400.status-disks daily_status_disks_enable="YES" # Check disk status -daily_status_disks_df_flags="-l -h" # df(1) flags for check +daily_status_disks_df_flags="-l -h" # df(1) flags for check # 401.status-graid daily_status_graid_enable="NO" # Check graid(8) Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Fri Mar 13 09:45:06 2015 (r279951) +++ head/share/man/man5/periodic.conf.5 Fri Mar 13 09:50:29 2015 (r279952) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2015 +.Dd March 13, 2015 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -335,6 +335,8 @@ utility when .Va daily_status_disks_enable is set to .Dq Li YES . +The default is +.Fl l Fl h . .It Va daily_status_zfs_enable .Pq Vt bool Set to From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 10:26:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84C2CE8F; Fri, 13 Mar 2015 10:26:36 +0000 (UTC) Received: from bigwig.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 5A01B169; Fri, 13 Mar 2015 10:26:36 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DBFCDB93C; Fri, 13 Mar 2015 06:26:34 -0400 (EDT) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r279932 - head/sys/vm Date: Fri, 13 Mar 2015 06:24:47 -0400 Message-ID: <29142844.yUiOLJLpmU@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <1426202691.6265.4.camel@freebsd.org> References: <201503121806.t2CI6VSU034853@svn.freebsd.org> <1426202691.6265.4.camel@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.2.7 (bigwig.baldwin.cx); Fri, 13 Mar 2015 06:26:35 -0400 (EDT) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ryan Stone X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 10:26:36 -0000 On Thursday, March 12, 2015 05:24:51 PM Ian Lepore wrote: > On Thu, 2015-03-12 at 17:02 -0400, Ryan Stone wrote: > > On Thu, Mar 12, 2015 at 2:06 PM, Ian Lepore wrote: > > > > > Nullterminate strings returned via sysctl. > > > > > > PR: 195668 > > > > > > > To quote the manpage: > > > > > The *sbuf* family of functions allows one to safely > > > allocate, construct and release bounded null-terminated > > > strings in kernel space. > > > > IMO the sbuf API is broken if we have to explicitly null-terminate the > > string ourselves. > > If we want the nullterm to be counted in the length of data in the > buffer (and thus get transmitted back across the syscall boundary) we > need to put an explicit counted nullterm byte into the buffer. > > I had started down the path of making that (counting the nullterm byte > as part of the data in the buffer) a feature of sbuf that you could set > with a flag, but then whoever added sbuf_new_for_sysctl() didn't > propagate the flags field through the new function and I decided to not > go off into the weeds making a new flavor of that takes flags. One suggestion would be to consider using '\0' for a nul character instead of a bare 0. To me that communicates the intention more clearly to the reader. (One of the things I did not like about C++ < C++11 was the use of 0 for NULL. I much prefer nullptr and NULL in C over bare 0's for pointers for similar clarity reasons.) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 10:26:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3F42E91; Fri, 13 Mar 2015 10:26:36 +0000 (UTC) Received: from bigwig.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 AB2EA16A; Fri, 13 Mar 2015 10:26:36 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8D923B94E; Fri, 13 Mar 2015 06:26:35 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r279949 - in head: lib/libstand sys/boot/amd64 sys/boot/efi/libefi sys/boot/ficl Date: Fri, 13 Mar 2015 06:19:45 -0400 Message-ID: <3051169.gdTC0jACmW@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201503130938.t2D9cGYU077146@svn.freebsd.org> References: <201503130938.t2D9cGYU077146@svn.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.2.7 (bigwig.baldwin.cx); Fri, 13 Mar 2015 06:26:35 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 10:26:36 -0000 On Friday, March 13, 2015 09:38:16 AM John Baldwin wrote: > Author: jhb > Date: Fri Mar 13 09:38:16 2015 > New Revision: 279949 > URL: https://svnweb.freebsd.org/changeset/base/279949 > > Log: > The System V ABI for amd64 allows functions to use space in a 128 byte > redzone below the stack pointer for scratch space and requires > interrupt and signal frames to avoid overwriting it. However, EFI uses > the Windows ABI which does not support this. As a result, interrupt > handlers in EFI push their interrupt frames directly on top of the > stack pointer. If the compiler used the red zone in a function in the > EFI loader, then a device interrupt that occurred while that function > was running could trash its local variables. In practice this happens > fairly reliable when using gzipfs as an interrupt during decompression > can trash the local variables in the inflate_table() function > resulting in corrupted output or hangs. > > Fix this by disabling the redzone for amd64 EFI binaries. This > requires building not only the loader but any libraries used by the > loader without redzone support. > > Thanks to Jilles for pointing me at the redzone once I found the stack > corruption. Note that without this, gzipfs was effectively useless in the EFI loader for any non-trivial cases (it was even useless in my trivial cases during testing, but there might be some trivial case (zero-byte file or some such) that can be decompressed quickly enough to not trigger a device interrupt). Also, while the redzone is cute and all, it seems to me that it is very impractical for any ring 0 context. Specifically, the CPU doesn't know anything about it, and any interrupt or exception in ring 0 is going to push the hardware-defined bits of the frame (%rip, etc.) on top of the stack pointer overwriting part of the redzone. (Our kernel is built with -mno-red-zone as well.) You could perhaps always use a dedicated stack for all interrupts and faults via IST, but any nesting there would result in reusing a stack if you aren't careful (e.g. a fault in interrupt context). I suppose it might work to have one IST entry for device interrupts, a second for most faults / exceptions, and a third for double faults (double faults generally need a dedicated stack regardless). Of course, all these dedicated stacks would have to be per-CPU (as the double fault stack is) and any fault or interrupt would have to implicitly pin the thread for the duration (probably not a big deal). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 11:26:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DA3FA6F; Fri, 13 Mar 2015 11:26:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 58F3398D; Fri, 13 Mar 2015 11:26:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DBQ3qq028691; Fri, 13 Mar 2015 11:26:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DBQ3GA028690; Fri, 13 Mar 2015 11:26:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503131126.t2DBQ3GA028690@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 13 Mar 2015 11:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279953 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 11:26:03 -0000 Author: trasz Date: Fri Mar 13 11:26:02 2015 New Revision: 279953 URL: https://svnweb.freebsd.org/changeset/base/279953 Log: Rework the concat() algorithm to be correct in all cases. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Fri Mar 13 09:50:29 2015 (r279952) +++ head/usr.sbin/autofs/common.c Fri Mar 13 11:26:02 2015 (r279953) @@ -92,6 +92,7 @@ char * concat(const char *s1, char separator, const char *s2) { char *result; + char s1last, s2first; int ret; if (s1 == NULL) @@ -99,14 +100,22 @@ concat(const char *s1, char separator, c if (s2 == NULL) s2 = ""; - /* - * If s2 starts with separator - skip it; otherwise concatenating - * "/" and "/foo" would end up returning "//foo". - */ - if (s2[0] == separator) - s2++; + if (s1[0] == '\0') + s1last = '\0'; + else + s1last = s1[strlen(s1) - 1]; - if (s1[0] == '\0' || s2[0] == '\0' || s1[strlen(s1) - 1] == separator) { + s2first = s2[0]; + + if (s1last == separator && s2first == separator) { + /* + * If s1 ends with the separator and s2 begins with + * it - skip the latter; otherwise concatenating "/" + * and "/foo" would end up returning "//foo". + */ + ret = asprintf(&result, "%s%s", s1, s2 + 1); + } else if (s1last == separator || s2first == separator || + s1[0] == '\0' || s2[0] == '\0') { ret = asprintf(&result, "%s%s", s1, s2); } else { ret = asprintf(&result, "%s%c%s", s1, separator, s2); From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 12:28:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C69DE69A; Fri, 13 Mar 2015 12:28:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 B1841FAB; Fri, 13 Mar 2015 12:28:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DCS0YO057422; Fri, 13 Mar 2015 12:28:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DCS0OC057421; Fri, 13 Mar 2015 12:28:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503131228.t2DCS0OC057421@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 13 Mar 2015 12:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279954 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 12:28:01 -0000 Author: trasz Date: Fri Mar 13 12:27:59 2015 New Revision: 279954 URL: https://svnweb.freebsd.org/changeset/base/279954 Log: Get executable direct maps to work. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/automountd.c Modified: head/usr.sbin/autofs/automountd.c ============================================================================== --- head/usr.sbin/autofs/automountd.c Fri Mar 13 11:26:02 2015 (r279953) +++ head/usr.sbin/autofs/automountd.c Fri Mar 13 12:27:59 2015 (r279954) @@ -177,7 +177,7 @@ handle_request(const struct autofs_daemo const char *map; struct node *root, *parent, *node; FILE *f; - char *options, *fstype, *nobrowse, *retrycnt, *tmp; + char *key, *options, *fstype, *nobrowse, *retrycnt, *tmp; int error; bool wildcards; @@ -199,11 +199,25 @@ handle_request(const struct autofs_daemo map = adr->adr_from + 4; /* 4 for strlen("map "); */ root = node_new_root(); if (adr->adr_prefix[0] == '\0' || strcmp(adr->adr_prefix, "/") == 0) { + /* + * Direct map. autofs(4) doesn't have a way to determine + * correct map key, but since it's a direct map, we can just + * use adr_path instead. + */ parent = root; + key = checked_strdup(adr->adr_path); } else { + /* + * Indirect map. + */ parent = node_new_map(root, checked_strdup(adr->adr_prefix), NULL, checked_strdup(map), checked_strdup("[kernel request]"), lineno); + + if (adr->adr_key[0] == '\0') + key = NULL; + else + key = checked_strdup(adr->adr_key); } /* @@ -213,8 +227,7 @@ handle_request(const struct autofs_daemo * needs to be done for maps with wildcard entries, but also * for special and executable maps. */ - parse_map(parent, map, adr->adr_key[0] != '\0' ? adr->adr_key : NULL, - &wildcards); + parse_map(parent, map, key, &wildcards); if (!wildcards) wildcards = node_has_wildcards(parent); if (wildcards) @@ -222,8 +235,8 @@ handle_request(const struct autofs_daemo else log_debugx("map does not contain wildcard entries"); - if (adr->adr_key[0] != '\0') - node_expand_wildcard(root, adr->adr_key); + if (key != NULL) + node_expand_wildcard(root, key); node = node_find(root, adr->adr_path); if (node == NULL) { @@ -248,7 +261,7 @@ handle_request(const struct autofs_daemo node->n_config_file, node->n_config_line); nobrowse = pick_option("nobrowse", &options); - if (nobrowse != NULL && adr->adr_key[0] == '\0') { + if (nobrowse != NULL && key == NULL) { log_debugx("skipping map %s due to \"nobrowse\" " "option; exiting", map); done(0, true); @@ -265,12 +278,12 @@ handle_request(const struct autofs_daemo */ create_subtree(node, incomplete_hierarchy); - if (incomplete_hierarchy && adr->adr_key[0] != '\0') { + if (incomplete_hierarchy && key != NULL) { /* * We still need to create the single subdirectory * user is trying to access. */ - tmp = concat(adr->adr_path, '/', adr->adr_key); + tmp = concat(adr->adr_path, '/', key); node = node_find(root, tmp); if (node != NULL) create_subtree(node, false); @@ -288,8 +301,8 @@ handle_request(const struct autofs_daemo log_debugx("found node defined at %s:%d; it is a mountpoint", node->n_config_file, node->n_config_line); - node_expand_ampersand(node, - adr->adr_key[0] != '\0' ? adr->adr_key : NULL); + if (key != NULL) + node_expand_ampersand(node, key); error = node_expand_defined(node); if (error != 0) { log_errx(1, "variable expansion failed for %s; " From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 12:44:48 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E8C99BC; Fri, 13 Mar 2015 12:44:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 1F7251E6; Fri, 13 Mar 2015 12:44:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DCileb066411; Fri, 13 Mar 2015 12:44:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DCilY5066407; Fri, 13 Mar 2015 12:44:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503131244.t2DCilY5066407@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 13 Mar 2015 12:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279955 - in head: etc etc/autofs usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 12:44:48 -0000 Author: trasz Date: Fri Mar 13 12:44:46 2015 New Revision: 279955 URL: https://svnweb.freebsd.org/changeset/base/279955 Log: Add -noauto autofs map, for automatic handling of fstab entries marked "noauto". MFC after: 1 month Sponsored by: The FreeBSD Foundation Added: head/etc/autofs/special_noauto (contents, props changed) Modified: head/etc/auto_master head/etc/autofs/Makefile head/usr.sbin/autofs/auto_master.5 Modified: head/etc/auto_master ============================================================================== --- head/etc/auto_master Fri Mar 13 12:27:59 2015 (r279954) +++ head/etc/auto_master Fri Mar 13 12:44:46 2015 (r279955) @@ -6,3 +6,4 @@ # When using the -media special map, make sure to edit devd.conf(5) # to move the call to "automount -c" out of the comments section. #/media -media -nosuid +#/- -noauto Modified: head/etc/autofs/Makefile ============================================================================== --- head/etc/autofs/Makefile Fri Mar 13 12:27:59 2015 (r279954) +++ head/etc/autofs/Makefile Fri Mar 13 12:44:46 2015 (r279955) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= include_ldap special_hosts special_media special_null +FILES= include_ldap special_hosts special_media special_noauto special_null NO_OBJ= FILESDIR= /etc/autofs Added: head/etc/autofs/special_noauto ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/autofs/special_noauto Fri Mar 13 12:44:46 2015 (r279955) @@ -0,0 +1,29 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +print_available() { + sed 's/#.*//' /etc/fstab | awk '$4 ~ /noauto/ { print $2 }' +} + +print_one() { + local _mntpoint + + _mntpoint="${1%/}" + + sed 's/#.*//' /etc/fstab | awk ' + $2 == "'"${_mntpoint}"'" && $4 ~ /noauto/ { + if ($1 ~ /:/) { dev=$1 } else { dev=":"$1 } + print "-fstype=" $3 "," $4, dev + }' +} + +if [ $# -eq 0 ]; then + print_available + exit 0 +fi + +print_one "$1" +exit 0 + Modified: head/usr.sbin/autofs/auto_master.5 ============================================================================== --- head/usr.sbin/autofs/auto_master.5 Fri Mar 13 12:27:59 2015 (r279954) +++ head/usr.sbin/autofs/auto_master.5 Fri Mar 13 12:44:46 2015 (r279955) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 9, 2015 +.Dd March 13, 2015 .Dt AUTO_MASTER 5 .Os .Sh NAME @@ -260,6 +260,11 @@ when they are automatically created. .It Li -media Query devices that are not yet mounted, but contain valid filesystems. Generally used to access files on removable media. +.It Li -noauto +Mount filesystems configured in +.Xr fstab 5 +as "noauto". +This needs to be set up as a direct map. .It Li -null Prevent .Xr automountd 8 From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 13:46:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CE20E07; Fri, 13 Mar 2015 13:46:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 47FBBB53; Fri, 13 Mar 2015 13:46:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DDkpuD097346; Fri, 13 Mar 2015 13:46:51 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DDkpOA097345; Fri, 13 Mar 2015 13:46:51 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201503131346.t2DDkpOA097345@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 13 Mar 2015 13:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279956 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 13:46:51 -0000 Author: ae Date: Fri Mar 13 13:46:50 2015 New Revision: 279956 URL: https://svnweb.freebsd.org/changeset/base/279956 Log: Properly initialize scope zone id when next hop address stored directly in the O_FORWARD_IP6 opcode. Use getnameinfo(3) to formatting the IPv6 addresses of such opcodes. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Fri Mar 13 12:44:46 2015 (r279955) +++ head/sbin/ipfw/ipfw2.c Fri Mar 13 13:46:50 2015 (r279956) @@ -1525,11 +1525,14 @@ show_static_rule(struct cmdline_opts *co case O_FORWARD_IP6: { - char buf[4 + INET6_ADDRSTRLEN + 1]; + char buf[INET6_ADDRSTRLEN + IF_NAMESIZE + 2]; ipfw_insn_sa6 *s = (ipfw_insn_sa6 *)cmd; - bprintf(bp, "fwd %s", inet_ntop(AF_INET6, - &s->sa.sin6_addr, buf, sizeof(buf))); + 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); } @@ -3741,8 +3744,8 @@ chkarg: p->sa.sin6_family = AF_INET6; p->sa.sin6_port = port_number; p->sa.sin6_flowinfo = 0; - p->sa.sin6_scope_id = 0; - /* No table support for v6 yet. */ + p->sa.sin6_scope_id = + ((struct sockaddr_in6 *)&result)->sin6_scope_id; bcopy(&((struct sockaddr_in6*)&result)->sin6_addr, &p->sa.sin6_addr, sizeof(p->sa.sin6_addr)); } else { From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 15:23:42 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3259D7A; Fri, 13 Mar 2015 15:23:42 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 B563089B; Fri, 13 Mar 2015 15:23:42 +0000 (UTC) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t2DFNdK7031331 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 13 Mar 2015 08:23:40 -0700 Message-ID: <550300FB.4040000@freebsd.org> Date: Fri, 13 Mar 2015 08:23:39 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> <20150312213530.GT2379@kib.kiev.ua> <5502094D.5090001@freebsd.org> <20150313084702.GV2379@kib.kiev.ua> In-Reply-To: <20150313084702.GV2379@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVa5CyIz9vNhrmyabYfbBvT8pXOGwPKO4ycv+fwAoPPtC7zsKocOByxmzTJvVZJE5LWIw/wQjksbUDxFt8DfWeKXCL2pMJy5amQ= X-Sonic-ID: C;chch7ZTJ5BGUdb5YxQPdhw== M;dGh47ZTJ5BGUdb5YxQPdhw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 15:23:42 -0000 On 03/13/15 01:47, Konstantin Belousov wrote: > On Thu, Mar 12, 2015 at 02:46:53PM -0700, Nathan Whitehorn wrote: >> On 03/12/15 14:35, Konstantin Belousov wrote: >>> On Thu, Mar 12, 2015 at 02:29:43PM -0700, Nathan Whitehorn wrote: >>>> On 03/12/15 14:22, Konstantin Belousov wrote: >>>>> On Thu, Mar 12, 2015 at 09:15:39PM +0000, Nathan Whitehorn wrote: >>>>>> Author: nwhitehorn >>>>>> Date: Thu Mar 12 21:15:38 2015 >>>>>> New Revision: 279937 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/279937 >>>>>> >>>>>> Log: >>>>>> Provide VSX context in ucontext(3) API. >>>>>> >>>>>> Modified: >>>>>> head/sys/powerpc/include/ucontext.h >>>>>> head/sys/powerpc/powerpc/exec_machdep.c >>>>>> >>>>>> Modified: head/sys/powerpc/include/ucontext.h >>>>>> ============================================================================== >>>>>> --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) >>>>>> +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) >>>>>> @@ -46,6 +46,7 @@ typedef struct __mcontext { >>>>>> uint32_t mc_av[2]; >>>>>> register_t mc_frame[42]; >>>>>> uint64_t mc_fpreg[33]; >>>>>> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ >>>>>> } mcontext_t __aligned(16); >>>>>> >>>>>> #if defined(_KERNEL) && defined(__powerpc64__) >>>>>> @@ -60,6 +61,7 @@ typedef struct __mcontext32 { >>>>>> uint32_t mc_av[2]; >>>>>> uint32_t mc_frame[42]; >>>>>> uint64_t mc_fpreg[33]; >>>>>> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ >>>>>> } mcontext32_t __aligned(16); >>>>>> #endif >>>>> It looks as if you broken the ABI compatibility by the change. Am I wrong ? >>>>> >>>> That is correct. It's a tier-2 platform and -CURRENT, so I'm not sure >>>> it's worth the compatibility shims. I'm happy to add them if you think >>>> otherwise. >>> You are main maintainer of PowerPC port, IMO, so it is your decision. >>> >>> Note that 'this is current' argument is not applicable, since the change >>> also breaks stable/* binaries. >>> >>> I do understand the argument of PowerPC being tier 2 architecture, but this >>> makes me sad. Anyway, it is yours. For x86, I have to introduce >>> getcontextx(3) mechanism. >>> >> This is a good point. I'll try to fix it. Is my understanding of how >> this works correct? >> >> 1. Provide a sysarch() for the extended FPU state. >> 2. Implement getcontextx() in the C library to fill extra properties if >> required. >> 3. Store state for signal trampoline in variable-sized stack area > 4. Implement __getcontextx_size() and __fillcontextx2() for use > in the deferred signal delivery while libthr is in critical section, > see lib/libthr/thread/thr_sig.c:check_deferred_signal(). OK. >> Implementation of (2) seems to rely on having spare members in ucontext, >> which PowerPC unfortunately does not have. Is there a way around that? > Indeed, this is very unfortunate. > > My concern is that typical application allocating ucontext_t on stack or > by mallocing it, would get silent memory corruption after the extension > of mcontext_t. It seems indeed that ABI breakage cannot be completely > avoided, but it could be significantly reduced IMO. Is it true that > mc_avec is only valid when _MC_AV_VALID bit is set ? That is correct. > If yes, we can introduce another mcontext flag, say _MC_XSTATE_VALID, > which is mutually exclusive with the _MC_AC_VALID. The new flag > indicates that there is external data, and the data is pointed to by > some word placed in the previous mc_avec file, say mc_avec[0]. The > altivec registers file content is moved into that external data area as > well. Providing the external area size in mc_avec[1] allows to extend > that block in the future-compatible manner. > > This way, applications which use ucontext_t and which are not aware about > VSX, get the expected behaviour, possibly without seeing altivec. I.e. > in typical case, we do not get random memory corruption. OK, I guess that's reasonable. I'll think about this some and try to get some code written in the next few days. > Meantime, I have a question. I looked at the powerpc/include/ucontex.h > and tried to match it with the PowerISA specs 2.06 and 2.07. From what I > understand, mc_fpreg corresponds to the floating-point registers file, > mc_avec and mc_av to the 'Vector Facility Registers'. But I fail to see > what would match the > + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ > file. The 7.2.1 Vector-Scalar Registers says 'Sixty-four 128-bit VSRs > are provided'. > The 64 128-bit registers are a superset of the existing registers. Registers 33-64 are just the Altivec registers, with no changes. Registers 1-32 are the normal floating point registers, but widened to 128 bits from 64. What I had tried to do was to keep the layout of the bottom part of the structure unchanged for compatibility by storing only the extra half of registers 1-32 in a separate area. In particular, I wanted to keep the FP registers readable in a consecutive way. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 16:43:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B0BDDF9; Fri, 13 Mar 2015 16:43:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 2566C19A; Fri, 13 Mar 2015 16:43:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DGhsXp082865; Fri, 13 Mar 2015 16:43:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DGhr7X082855; Fri, 13 Mar 2015 16:43:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503131643.t2DGhr7X082855@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Mar 2015 16:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279957 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 16:43:55 -0000 Author: mav Date: Fri Mar 13 16:43:52 2015 New Revision: 279957 URL: https://svnweb.freebsd.org/changeset/base/279957 Log: Add DSM TRIM command support for virtual AHCI disks. It works only for virtual disks backed by ZVOLs and raw devices supporting BIO_DELETE. Virtual disks backed by files won't report this capability. MFC after: 2 weeks Relnotes: yes Modified: head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/block_if.h head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Fri Mar 13 13:46:50 2015 (r279956) +++ head/usr.sbin/bhyve/block_if.c Fri Mar 13 16:43:52 2015 (r279957) @@ -59,7 +59,8 @@ __FBSDID("$FreeBSD$"); enum blockop { BOP_READ, BOP_WRITE, - BOP_FLUSH + BOP_FLUSH, + BOP_DELETE }; enum blockstat { @@ -81,6 +82,7 @@ struct blockif_ctxt { int bc_magic; int bc_fd; int bc_ischr; + int bc_candelete; int bc_rdonly; off_t bc_size; int bc_sectsz; @@ -172,6 +174,7 @@ static void blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be) { struct blockif_req *br; + off_t arg[2]; int err; br = be->be_req; @@ -197,6 +200,17 @@ blockif_proc(struct blockif_ctxt *bc, st } else if (fsync(bc->bc_fd)) err = errno; break; + case BOP_DELETE: + if (!bc->bc_candelete) + err = EOPNOTSUPP; + else if (bc->bc_ischr) { + arg[0] = br->br_offset; + arg[1] = br->br_iov[0].iov_len; + if (ioctl(bc->bc_fd, DIOCGDELETE, arg)) + err = errno; + } else + err = EOPNOTSUPP; + break; default: err = EINVAL; break; @@ -276,9 +290,10 @@ blockif_open(const char *optstr, const c char *nopt, *xopts; struct blockif_ctxt *bc; struct stat sbuf; + struct diocgattr_arg arg; off_t size, psectsz, psectoff; int extra, fd, i, sectsz; - int nocache, sync, ro; + int nocache, sync, ro, candelete; pthread_once(&blockif_once, blockif_init); @@ -332,6 +347,7 @@ blockif_open(const char *optstr, const c size = sbuf.st_size; sectsz = DEV_BSIZE; psectsz = psectoff = 0; + candelete = 0; if (S_ISCHR(sbuf.st_mode)) { if (ioctl(fd, DIOCGMEDIASIZE, &size) < 0 || ioctl(fd, DIOCGSECTORSIZE, §sz)) { @@ -343,6 +359,10 @@ blockif_open(const char *optstr, const c assert(sectsz != 0); if (ioctl(fd, DIOCGSTRIPESIZE, &psectsz) == 0 && psectsz > 0) ioctl(fd, DIOCGSTRIPEOFFSET, &psectoff); + strlcpy(arg.name, "GEOM::candelete", sizeof(arg.name)); + arg.len = sizeof(arg.value.i); + if (ioctl(fd, DIOCGATTR, &arg) == 0) + candelete = arg.value.i; } else psectsz = sbuf.st_blksize; @@ -355,6 +375,7 @@ blockif_open(const char *optstr, const c bc->bc_magic = BLOCKIF_SIG; bc->bc_fd = fd; bc->bc_ischr = S_ISCHR(sbuf.st_mode); + bc->bc_candelete = candelete; bc->bc_rdonly = ro; bc->bc_size = size; bc->bc_sectsz = sectsz; @@ -434,6 +455,14 @@ blockif_flush(struct blockif_ctxt *bc, s } int +blockif_delete(struct blockif_ctxt *bc, struct blockif_req *breq) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (blockif_request(bc, breq, BOP_DELETE)); +} + +int blockif_cancel(struct blockif_ctxt *bc, struct blockif_req *breq) { struct blockif_elem *be; @@ -634,3 +663,11 @@ blockif_is_ro(struct blockif_ctxt *bc) assert(bc->bc_magic == BLOCKIF_SIG); return (bc->bc_rdonly); } + +int +blockif_candelete(struct blockif_ctxt *bc) +{ + + assert(bc->bc_magic == BLOCKIF_SIG); + return (bc->bc_candelete); +} Modified: head/usr.sbin/bhyve/block_if.h ============================================================================== --- head/usr.sbin/bhyve/block_if.h Fri Mar 13 13:46:50 2015 (r279956) +++ head/usr.sbin/bhyve/block_if.h Fri Mar 13 16:43:52 2015 (r279957) @@ -58,9 +58,11 @@ int blockif_sectsz(struct blockif_ctxt * void blockif_psectsz(struct blockif_ctxt *bc, int *size, int *off); int blockif_queuesz(struct blockif_ctxt *bc); int blockif_is_ro(struct blockif_ctxt *bc); +int blockif_candelete(struct blockif_ctxt *bc); int blockif_read(struct blockif_ctxt *bc, struct blockif_req *breq); int blockif_write(struct blockif_ctxt *bc, struct blockif_req *breq); int blockif_flush(struct blockif_ctxt *bc, struct blockif_req *breq); +int blockif_delete(struct blockif_ctxt *bc, struct blockif_req *breq); int blockif_cancel(struct blockif_ctxt *bc, struct blockif_req *breq); int blockif_close(struct blockif_ctxt *bc); Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 13:46:50 2015 (r279956) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 16:43:52 2015 (r279957) @@ -644,6 +644,100 @@ ahci_handle_flush(struct ahci_port *p, i } static inline void +read_prdt(struct ahci_port *p, int slot, uint8_t *cfis, + void *buf, int size) +{ + struct ahci_cmd_hdr *hdr; + struct ahci_prdt_entry *prdt; + void *to; + int i, len; + + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); + len = size; + to = buf; + prdt = (struct ahci_prdt_entry *)(cfis + 0x80); + for (i = 0; i < hdr->prdtl && len; i++) { + uint8_t *ptr; + uint32_t dbcsz; + int sublen; + + dbcsz = (prdt->dbc & DBCMASK) + 1; + ptr = paddr_guest2host(ahci_ctx(p->pr_sc), prdt->dba, dbcsz); + sublen = len < dbcsz ? len : dbcsz; + memcpy(to, ptr, sublen); + len -= sublen; + to += sublen; + prdt++; + } +} + +static void +ahci_handle_dsm_trim(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done) +{ + struct ahci_ioreq *aior; + struct blockif_req *breq; + uint8_t *entry; + uint64_t elba; + uint32_t len, elen; + int err; + uint8_t buf[512]; + + len = (uint16_t)cfis[13] << 8 | cfis[12]; + len *= 512; + read_prdt(p, slot, cfis, buf, sizeof(buf)); + +next: + entry = &buf[done]; + elba = ((uint64_t)entry[5] << 40) | + ((uint64_t)entry[4] << 32) | + ((uint64_t)entry[3] << 24) | + ((uint64_t)entry[2] << 16) | + ((uint64_t)entry[1] << 8) | + entry[0]; + elen = (uint16_t)entry[7] << 8 | entry[6]; + done += 8; + if (elen == 0) { + if (done >= len) { + ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + p->pending &= ~(1 << slot); + ahci_check_stopped(p); + return; + } + goto next; + } + + /* + * Pull request off free list + */ + aior = STAILQ_FIRST(&p->iofhd); + assert(aior != NULL); + STAILQ_REMOVE_HEAD(&p->iofhd, io_flist); + aior->cfis = cfis; + aior->slot = slot; + aior->len = len; + aior->done = done; + aior->prdtl = 0; + + breq = &aior->io_req; + breq->br_offset = elba * blockif_sectsz(p->bctx); + breq->br_iovcnt = 1; + breq->br_iov[0].iov_len = elen * blockif_sectsz(p->bctx); + + /* + * Mark this command in-flight. + */ + p->pending |= 1 << slot; + + /* + * Stuff request onto busy list + */ + TAILQ_INSERT_HEAD(&p->iobhd, aior, io_blist); + + err = blockif_delete(p->bctx, breq); + assert(err == 0); +} + +static inline void write_prdt(struct ahci_port *p, int slot, uint8_t *cfis, void *buf, int size) { @@ -684,10 +778,11 @@ handle_identify(struct ahci_port *p, int } else { uint16_t buf[256]; uint64_t sectors; - int sectsz, psectsz, psectoff; + int sectsz, psectsz, psectoff, candelete; uint16_t cyl; uint8_t sech, heads; + candelete = blockif_candelete(p->bctx); sectsz = blockif_sectsz(p->bctx); sectors = blockif_size(p->bctx) / sectsz; blockif_chs(p->bctx, &cyl, &heads, &sech); @@ -718,6 +813,7 @@ handle_identify(struct ahci_port *p, int buf[66] = 100; buf[67] = 100; buf[68] = 100; + buf[69] = 0; buf[75] = 31; buf[76] = (1 << 8 | 1 << 2); buf[80] = 0x1f0; @@ -736,6 +832,11 @@ handle_identify(struct ahci_port *p, int buf[101] = (sectors >> 16); buf[102] = (sectors >> 32); buf[103] = (sectors >> 48); + if (candelete) { + buf[69] |= ATA_SUPPORT_RZAT | ATA_SUPPORT_DRAT; + buf[105] = 1; + buf[169] = ATA_SUPPORT_DSM_TRIM; + } buf[106] = 0x4000; buf[209] = 0x4000; if (psectsz > sectsz) { @@ -1394,6 +1495,15 @@ ahci_handle_cmd(struct ahci_port *p, int case ATA_FLUSHCACHE48: ahci_handle_flush(p, slot, cfis); break; + case ATA_DATA_SET_MANAGEMENT: + if (cfis[11] == 0 && cfis[3] == ATA_DSM_TRIM && + cfis[13] == 0 && cfis[12] == 1) { + ahci_handle_dsm_trim(p, slot, cfis, 0); + break; + } + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); + break; case ATA_STANDBY_CMD: break; case ATA_NOP: @@ -1505,7 +1615,7 @@ ata_ioreq_cb(struct blockif_req *br, int struct pci_ahci_softc *sc; uint32_t tfd; uint8_t *cfis; - int pending, slot, ncq; + int pending, slot, ncq, dsm; DPRINTF("%s %d\n", __func__, err); @@ -1521,6 +1631,8 @@ ata_ioreq_cb(struct blockif_req *br, int if (cfis[2] == ATA_WRITE_FPDMA_QUEUED || cfis[2] == ATA_READ_FPDMA_QUEUED) ncq = 1; + if (cfis[2] == ATA_DATA_SET_MANAGEMENT) + dsm = 1; pthread_mutex_lock(&sc->mtx); @@ -1534,10 +1646,17 @@ ata_ioreq_cb(struct blockif_req *br, int */ STAILQ_INSERT_TAIL(&p->iofhd, aior, io_flist); - if (pending && !err) { - ahci_handle_dma(p, slot, cfis, aior->done, - hdr->prdtl - pending); - goto out; + if (dsm) { + if (aior->done != aior->len && !err) { + ahci_handle_dsm_trim(p, slot, cfis, aior->done); + goto out; + } + } else { + if (pending && !err) { + ahci_handle_dma(p, slot, cfis, aior->done, + hdr->prdtl - pending); + goto out; + } } if (!err && aior->done == aior->len) { From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 16:51:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D3BBFD0; Fri, 13 Mar 2015 16:51:07 +0000 (UTC) Received: from relay.mailchannels.net (aso-006-i437.relay.mailchannels.net [23.91.64.118]) by mx1.freebsd.org (Postfix) with ESMTP id CD5D31EE; Fri, 13 Mar 2015 16:51:05 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp7.ore.mailhop.org (ip-10-33-12-218.us-west-2.compute.internal [10.33.12.218]) by relay.mailchannels.net (Postfix) with ESMTPA id B4FF01D0DD0; Fri, 13 Mar 2015 16:14:50 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp7.ore.mailhop.org (smtp7.ore.mailhop.org [10.83.15.107]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Fri, 13 Mar 2015 16:14:51 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1426263290862:1414706375 X-MC-Ingress-Time: 1426263290862 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp7.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YWSEZ-0002Kr-MI; Fri, 13 Mar 2015 16:14:47 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2DGERPE016522; Fri, 13 Mar 2015 10:14:28 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1+Now8qP+CeloYSqrfdJgAx Message-ID: <1426263267.91779.19.camel@freebsd.org> Subject: Re: svn commit: r279932 - head/sys/vm From: Ian Lepore To: John Baldwin Date: Fri, 13 Mar 2015 10:14:27 -0600 In-Reply-To: <29142844.yUiOLJLpmU@ralph.baldwin.cx> References: <201503121806.t2CI6VSU034853@svn.freebsd.org> <1426202691.6265.4.camel@freebsd.org> <29142844.yUiOLJLpmU@ralph.baldwin.cx> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ryan Stone X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 16:51:07 -0000 On Fri, 2015-03-13 at 06:24 -0400, John Baldwin wrote: > On Thursday, March 12, 2015 05:24:51 PM Ian Lepore wrote: > > On Thu, 2015-03-12 at 17:02 -0400, Ryan Stone wrote: > > > On Thu, Mar 12, 2015 at 2:06 PM, Ian Lepore wrote: > > > > > > > Nullterminate strings returned via sysctl. > > > > > > > > PR: 195668 > > > > > > > > > > To quote the manpage: > > > > > > > The *sbuf* family of functions allows one to safely > > > > allocate, construct and release bounded null-terminated > > > > strings in kernel space. > > > > > > IMO the sbuf API is broken if we have to explicitly null-terminate the > > > string ourselves. > > > > If we want the nullterm to be counted in the length of data in the > > buffer (and thus get transmitted back across the syscall boundary) we > > need to put an explicit counted nullterm byte into the buffer. > > > > I had started down the path of making that (counting the nullterm byte > > as part of the data in the buffer) a feature of sbuf that you could set > > with a flag, but then whoever added sbuf_new_for_sysctl() didn't > > propagate the flags field through the new function and I decided to not > > go off into the weeds making a new flavor of that takes flags. > > One suggestion would be to consider using '\0' for a nul character instead of > a bare 0. To me that communicates the intention more clearly to the reader. > (One of the things I did not like about C++ < C++11 was the use of 0 for > NULL. I much prefer nullptr and NULL in C over bare 0's for pointers for > similar clarity reasons.) > I have waffled back and forth between preferring 0 or '\0' for 30 years, I just seem to go through phases with nullterm expression. In general I'm glad I got called away to an onsite meeting yesterday and didn't get far with these changes, because the more I think about it, the less satisfied I am with this expedient fix. The other fix I started on, where a new SBUF_COUNTNUL flag can be set to inform the sbuf_finish() code that you want the terminating nul counted in the data length just feels like a better fit for the overall "automaticness" of how the sbuf stuff works. -- Ian From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 17:06:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 772A16A9; Fri, 13 Mar 2015 17:06:13 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 59A66616; Fri, 13 Mar 2015 17:06:13 +0000 (UTC) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t2DH652f015277 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 13 Mar 2015 10:06:06 -0700 Message-ID: <550318FD.1070906@freebsd.org> Date: Fri, 13 Mar 2015 10:06:05 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> <20150312213530.GT2379@kib.kiev.ua> <5502094D.5090001@freebsd.org> <20150313084702.GV2379@kib.kiev.ua> In-Reply-To: <20150313084702.GV2379@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZlETUfs/FssNvl0s7GxX0s2NREI4MM2ci4QhNTAnfRMUd9RwnOLQwYdDn30bot/MMw0HZBuOdj7Al1KhQ40h1FU59MZxI1h4Y= X-Sonic-ID: C;Rr5IPKPJ5BGvSL5YxQPdhw== M;CIOFPKPJ5BGvSL5YxQPdhw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 17:06:13 -0000 On 03/13/15 01:47, Konstantin Belousov wrote: > On Thu, Mar 12, 2015 at 02:46:53PM -0700, Nathan Whitehorn wrote: >> On 03/12/15 14:35, Konstantin Belousov wrote: >>> On Thu, Mar 12, 2015 at 02:29:43PM -0700, Nathan Whitehorn wrote: >>>> On 03/12/15 14:22, Konstantin Belousov wrote: >>>>> On Thu, Mar 12, 2015 at 09:15:39PM +0000, Nathan Whitehorn wrote: >>>>>> Author: nwhitehorn >>>>>> Date: Thu Mar 12 21:15:38 2015 >>>>>> New Revision: 279937 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/279937 >>>>>> >>>>>> Log: >>>>>> Provide VSX context in ucontext(3) API. >>>>>> >>>>>> Modified: >>>>>> head/sys/powerpc/include/ucontext.h >>>>>> head/sys/powerpc/powerpc/exec_machdep.c >>>>>> >>>>>> Modified: head/sys/powerpc/include/ucontext.h >>>>>> ============================================================================== >>>>>> --- head/sys/powerpc/include/ucontext.h Thu Mar 12 20:14:48 2015 (r279936) >>>>>> +++ head/sys/powerpc/include/ucontext.h Thu Mar 12 21:15:38 2015 (r279937) >>>>>> @@ -46,6 +46,7 @@ typedef struct __mcontext { >>>>>> uint32_t mc_av[2]; >>>>>> register_t mc_frame[42]; >>>>>> uint64_t mc_fpreg[33]; >>>>>> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ >>>>>> } mcontext_t __aligned(16); >>>>>> >>>>>> #if defined(_KERNEL) && defined(__powerpc64__) >>>>>> @@ -60,6 +61,7 @@ typedef struct __mcontext32 { >>>>>> uint32_t mc_av[2]; >>>>>> uint32_t mc_frame[42]; >>>>>> uint64_t mc_fpreg[33]; >>>>>> + uint64_t mc_vsxfpreg[32]; /* low-order half of VSR0-31 */ >>>>>> } mcontext32_t __aligned(16); >>>>>> #endif >>>>> It looks as if you broken the ABI compatibility by the change. Am I wrong ? >>>>> >>>> That is correct. It's a tier-2 platform and -CURRENT, so I'm not sure >>>> it's worth the compatibility shims. I'm happy to add them if you think >>>> otherwise. >>> You are main maintainer of PowerPC port, IMO, so it is your decision. >>> >>> Note that 'this is current' argument is not applicable, since the change >>> also breaks stable/* binaries. >>> >>> I do understand the argument of PowerPC being tier 2 architecture, but this >>> makes me sad. Anyway, it is yours. For x86, I have to introduce >>> getcontextx(3) mechanism. >>> >> This is a good point. I'll try to fix it. Is my understanding of how >> this works correct? >> >> 1. Provide a sysarch() for the extended FPU state. >> 2. Implement getcontextx() in the C library to fill extra properties if >> required. >> 3. Store state for signal trampoline in variable-sized stack area > 4. Implement __getcontextx_size() and __fillcontextx2() for use > in the deferred signal delivery while libthr is in critical section, > see lib/libthr/thread/thr_sig.c:check_deferred_signal(). > >> Implementation of (2) seems to rely on having spare members in ucontext, >> which PowerPC unfortunately does not have. Is there a way around that? > Indeed, this is very unfortunate. One more thing I'd appreciate advice on: we have a much worse ABI issue with setjmp(). On 32-bit systems, _JBLEN is too small to hold all the nonvolatile vector registers. Do you have any ideas how to handle that? -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 17:23:51 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E48AAC5B; Fri, 13 Mar 2015 17:23:51 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 5209C89A; Fri, 13 Mar 2015 17:23:51 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2DHNjg4003710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Mar 2015 19:23:45 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2DHNjg4003710 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2DHNjP4003709; Fri, 13 Mar 2015 19:23:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Mar 2015 19:23:45 +0200 From: Konstantin Belousov To: Nathan Whitehorn Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc Message-ID: <20150313172345.GY2379@kib.kiev.ua> References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> <20150312213530.GT2379@kib.kiev.ua> <5502094D.5090001@freebsd.org> <20150313084702.GV2379@kib.kiev.ua> <550318FD.1070906@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <550318FD.1070906@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 17:23:52 -0000 On Fri, Mar 13, 2015 at 10:06:05AM -0700, Nathan Whitehorn wrote: > One more thing I'd appreciate advice on: we have a much worse ABI issue > with setjmp(). On 32-bit systems, _JBLEN is too small to hold all the > nonvolatile vector registers. Do you have any ideas how to handle that? There is no solution there. On x86, both 32 and 64 bit, setjmp only saves fpu control word (and mxcsr on amd64, where SSE2 is guaranteed to be presented). So only limited bits of the whole arch state is saved and restored. I suggest to just leave setjmp as it is. In fact, FreeBSD cannot work on 486SX due to this. Shell uses setjmp, and despite kernel carefully handling FPU-less CPU, shell fails from the beginning. Please note that ucontext_t API was designed by System V group to handle this deficiency in the setjmp/longjmp API, to cover the whole machine context and provide almost-portable interface for non-local control flow :/. As usual, SysV produced something which failed. In particular, the size and layout of ucontext_t is user-visible and cannot be changed. From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 17:25:00 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4CD1DEC; Fri, 13 Mar 2015 17:25:00 +0000 (UTC) Received: from bigwig.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 999808B8; Fri, 13 Mar 2015 17:25:00 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 82BCFB91F; Fri, 13 Mar 2015 13:24:58 -0400 (EDT) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r279932 - head/sys/vm Date: Fri, 13 Mar 2015 13:19 -0400 Message-ID: <3013452.2FfDYxpIKo@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <1426263267.91779.19.camel@freebsd.org> References: <201503121806.t2CI6VSU034853@svn.freebsd.org> <29142844.yUiOLJLpmU@ralph.baldwin.cx> <1426263267.91779.19.camel@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.2.7 (bigwig.baldwin.cx); Fri, 13 Mar 2015 13:24:58 -0400 (EDT) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ryan Stone X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 17:25:01 -0000 On Friday, March 13, 2015 10:14:27 AM Ian Lepore wrote: > On Fri, 2015-03-13 at 06:24 -0400, John Baldwin wrote: > > On Thursday, March 12, 2015 05:24:51 PM Ian Lepore wrote: > > > On Thu, 2015-03-12 at 17:02 -0400, Ryan Stone wrote: > > > > On Thu, Mar 12, 2015 at 2:06 PM, Ian Lepore wrote: > > > > > > > > > Nullterminate strings returned via sysctl. > > > > > > > > > > PR: 195668 > > > > > > > > > > > > > To quote the manpage: > > > > > > > > > The *sbuf* family of functions allows one to safely > > > > > allocate, construct and release bounded null-terminated > > > > > strings in kernel space. > > > > > > > > IMO the sbuf API is broken if we have to explicitly null-terminate the > > > > string ourselves. > > > > > > If we want the nullterm to be counted in the length of data in the > > > buffer (and thus get transmitted back across the syscall boundary) we > > > need to put an explicit counted nullterm byte into the buffer. > > > > > > I had started down the path of making that (counting the nullterm byte > > > as part of the data in the buffer) a feature of sbuf that you could set > > > with a flag, but then whoever added sbuf_new_for_sysctl() didn't > > > propagate the flags field through the new function and I decided to not > > > go off into the weeds making a new flavor of that takes flags. > > > > One suggestion would be to consider using '\0' for a nul character instead of > > a bare 0. To me that communicates the intention more clearly to the reader. > > (One of the things I did not like about C++ < C++11 was the use of 0 for > > NULL. I much prefer nullptr and NULL in C over bare 0's for pointers for > > similar clarity reasons.) > > > > I have waffled back and forth between preferring 0 or '\0' for 30 years, > I just seem to go through phases with nullterm expression. > > In general I'm glad I got called away to an onsite meeting yesterday and > didn't get far with these changes, because the more I think about it, > the less satisfied I am with this expedient fix. The other fix I > started on, where a new SBUF_COUNTNUL flag can be set to inform the > sbuf_finish() code that you want the terminating nul counted in the data > length just feels like a better fit for the overall "automaticness" of > how the sbuf stuff works. Hmm, I actually think that it's a bug that the terminating nul isn't included when draining. If we fixed that then I think that fixes most of these? The places that explicitly use 'sysctl_handle_string()' with an sbuf should probably just be using sbuf_len(sb) + 1' explicitly. (Another option would be to have a sysctl_handle_sbuf() that was a wrapper around sysctl_handle_string() that included the + 1 to hide that detail if there is more than one.) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 17:45:53 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA825C34; Fri, 13 Mar 2015 17:45:53 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 9BF60B58; Fri, 13 Mar 2015 17:45:53 +0000 (UTC) Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU [128.32.117.67]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t2DHjkXu007803 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 13 Mar 2015 10:45:46 -0700 Message-ID: <5503224A.3010100@freebsd.org> Date: Fri, 13 Mar 2015 10:45:46 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> <20150312213530.GT2379@kib.kiev.ua> <5502094D.5090001@freebsd.org> <20150313084702.GV2379@kib.kiev.ua> <550318FD.1070906@freebsd.org> <20150313172345.GY2379@kib.kiev.ua> In-Reply-To: <20150313172345.GY2379@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVbxseDHzgDV0Ig8R6UB3KkYvM9x33+X3w2/NIGKGPMEi5cXgS/COBK85TF1V8L3wdeL41GJQPNXp4lKHcaSlW6ay47DnAAmMMg= X-Sonic-ID: C;foMzx6jJ5BGUM+8Jj30JFw== M;VLxlx6jJ5BGUM+8Jj30JFw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 17:45:53 -0000 On 03/13/15 10:23, Konstantin Belousov wrote: > On Fri, Mar 13, 2015 at 10:06:05AM -0700, Nathan Whitehorn wrote: >> One more thing I'd appreciate advice on: we have a much worse ABI issue >> with setjmp(). On 32-bit systems, _JBLEN is too small to hold all the >> nonvolatile vector registers. Do you have any ideas how to handle that? > There is no solution there. On x86, both 32 and 64 bit, setjmp only > saves fpu control word (and mxcsr on amd64, where SSE2 is guaranteed to > be presented). So only limited bits of the whole arch state is saved > and restored. I suggest to just leave setjmp as it is. > > In fact, FreeBSD cannot work on 486SX due to this. Shell uses setjmp, > and despite kernel carefully handling FPU-less CPU, shell fails from the > beginning. > > Please note that ucontext_t API was designed by System V group to handle > this deficiency in the setjmp/longjmp API, to cover the whole machine > context and provide almost-portable interface for non-local control flow > :/. As usual, SysV produced something which failed. In particular, the > size and layout of ucontext_t is user-visible and cannot be changed. > We'll need to hack the compiler in this case, since it assumes setjmp() saves and restores the vector registers. I'm really not sure which option is worse. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 17:58:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3B1B1EB; Fri, 13 Mar 2015 17:58:28 +0000 (UTC) Received: from relay.mailchannels.net (tkt-001-i373.relay.mailchannels.net [174.136.5.175]) by mx1.freebsd.org (Postfix) with ESMTP id 2D087C90; Fri, 13 Mar 2015 17:58:26 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp5.ore.mailhop.org (ip-10-237-13-110.us-west-2.compute.internal [10.237.13.110]) by relay.mailchannels.net (Postfix) with ESMTPA id 83129100680; Fri, 13 Mar 2015 17:58:18 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp5.ore.mailhop.org (smtp5.ore.mailhop.org [10.45.8.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Fri, 13 Mar 2015 17:58:18 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1426269498757:3396344620 X-MC-Ingress-Time: 1426269498757 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp5.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YWTqi-00071T-0T; Fri, 13 Mar 2015 17:58:16 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2DHvwuP016751; Fri, 13 Mar 2015 11:57:58 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX18iIRWaFEO5DHw75k4FBabz Message-ID: <1426269478.19693.4.camel@freebsd.org> Subject: Re: svn commit: r279932 - head/sys/vm From: Ian Lepore To: John Baldwin Date: Fri, 13 Mar 2015 11:57:58 -0600 In-Reply-To: <3013452.2FfDYxpIKo@ralph.baldwin.cx> References: <201503121806.t2CI6VSU034853@svn.freebsd.org> <29142844.yUiOLJLpmU@ralph.baldwin.cx> <1426263267.91779.19.camel@freebsd.org> <3013452.2FfDYxpIKo@ralph.baldwin.cx> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-AuthUser: hippie Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ryan Stone X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 17:58:28 -0000 On Fri, 2015-03-13 at 13:19 -0400, John Baldwin wrote: > On Friday, March 13, 2015 10:14:27 AM Ian Lepore wrote: > > On Fri, 2015-03-13 at 06:24 -0400, John Baldwin wrote: > > > On Thursday, March 12, 2015 05:24:51 PM Ian Lepore wrote: [...] > > > > In general I'm glad I got called away to an onsite meeting yesterday and > > didn't get far with these changes, because the more I think about it, > > the less satisfied I am with this expedient fix. The other fix I > > started on, where a new SBUF_COUNTNUL flag can be set to inform the > > sbuf_finish() code that you want the terminating nul counted in the data > > length just feels like a better fit for the overall "automaticness" of > > how the sbuf stuff works. > > Hmm, I actually think that it's a bug that the terminating nul isn't included > when draining. If we fixed that then I think that fixes most of these? > The places that explicitly use 'sysctl_handle_string()' with an sbuf > should probably just be using sbuf_len(sb) + 1' explicitly. (Another > option would be to have a sysctl_handle_sbuf() that was a wrapper around > sysctl_handle_string() that included the + 1 to hide that detail if there is > more than one.) > Some of the uses of sbuf for sysctl use sbuf_bcat() for dealing with binary structs, so we can't just assume that a nullterm should be added and included in the buffer length -- there needs to be some mechanism to say explicitly "this is an sbuf for a sysctl string" (and more generally "this is an sbuf for a string where I want the nul byte counted as part of the data" because that could be useful in non-sysctl contexts too, especially in userland). -- Ian From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 17:59:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09549407; Fri, 13 Mar 2015 17:59:38 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 6AF89C9D; Fri, 13 Mar 2015 17:59:37 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2DHxVup011773 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Mar 2015 19:59:31 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2DHxVup011773 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2DHxVdU011772; Fri, 13 Mar 2015 19:59:31 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Mar 2015 19:59:31 +0200 From: Konstantin Belousov To: Nathan Whitehorn Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc Message-ID: <20150313175931.GA2379@kib.kiev.ua> References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> <20150312213530.GT2379@kib.kiev.ua> <5502094D.5090001@freebsd.org> <20150313084702.GV2379@kib.kiev.ua> <550318FD.1070906@freebsd.org> <20150313172345.GY2379@kib.kiev.ua> <5503224A.3010100@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5503224A.3010100@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 17:59:38 -0000 On Fri, Mar 13, 2015 at 10:45:46AM -0700, Nathan Whitehorn wrote: > We'll need to hack the compiler in this case, since it assumes setjmp() > saves and restores the vector registers. I'm really not sure which > option is worse. Changing the compiler is arguably much worse than breaking ABI of the tier 2 platform, indeed. We must maintain the situation where the stock build of the compilers work out of box. Still, how the compiler' assumptions are laid out ? It could be argued that compilers on x86 also assume that FPU register file is restored by longjmp. %st* and %xmm* are defined as not preserved across function calls, but I suspect that practical rule for setjmp() is that floating vars better not be used in the target frame. Hm, indeed f14-f31 and v20-v31 are marked as non-volatile for 64bit ABI. From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 18:04:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E221F7B0; Fri, 13 Mar 2015 18:04:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 C3057D81; Fri, 13 Mar 2015 18:04:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DI48HU023570; Fri, 13 Mar 2015 18:04:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DI48um023569; Fri, 13 Mar 2015 18:04:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503131804.t2DI48um023569@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Mar 2015 18:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279959 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 18:04:09 -0000 Author: mav Date: Fri Mar 13 18:04:07 2015 New Revision: 279959 URL: https://svnweb.freebsd.org/changeset/base/279959 Log: Use ahci_write_fis_d2h() for commands completion. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 17:45:34 2015 (r279958) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 18:04:07 2015 (r279959) @@ -773,8 +773,8 @@ handle_identify(struct ahci_port *p, int hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); if (p->atapi || hdr->prdtl == 0) { - p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - p->is |= AHCI_P_IX_TFE; + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); } else { uint16_t buf[256]; uint64_t sectors; @@ -851,19 +851,16 @@ handle_identify(struct ahci_port *p, int } ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); - p->tfd = ATA_S_DSC | ATA_S_READY; - p->is |= AHCI_P_IX_DP; - p->ci &= ~(1 << slot); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); } - ahci_generate_intr(p->pr_sc); } static void handle_atapi_identify(struct ahci_port *p, int slot, uint8_t *cfis) { if (!p->atapi) { - p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - p->is |= AHCI_P_IX_TFE; + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); } else { uint16_t buf[256]; @@ -894,11 +891,8 @@ handle_atapi_identify(struct ahci_port * buf[88] = (1 << 14 | 0x7f); ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); - p->tfd = ATA_S_DSC | ATA_S_READY; - p->is |= AHCI_P_IX_DHR; - p->ci &= ~(1 << slot); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); } - ahci_generate_intr(p->pr_sc); } static void @@ -1479,9 +1473,7 @@ ahci_handle_cmd(struct ahci_port *p, int p->mult_sectors = cfis[12]; p->tfd = ATA_S_DSC | ATA_S_READY; } - p->is |= AHCI_P_IX_DP; - p->ci &= ~(1 << slot); - ahci_generate_intr(p->pr_sc); + ahci_write_fis_d2h(p, slot, cfis, p->tfd); break; case ATA_READ_DMA: case ATA_WRITE_DMA: @@ -1517,17 +1509,15 @@ ahci_handle_cmd(struct ahci_port *p, int break; case ATA_PACKET_CMD: if (!p->atapi) { - p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - p->is |= AHCI_P_IX_TFE; - ahci_generate_intr(p->pr_sc); + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); } else handle_packet_cmd(p, slot, cfis); break; default: WPRINTF("Unsupported cmd:%02x\n", cfis[2]); - p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - p->is |= AHCI_P_IX_TFE; - ahci_generate_intr(p->pr_sc); + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); break; } } From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 18:13:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C5CEA26; Fri, 13 Mar 2015 18:13:25 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 0C8FBE9F; Fri, 13 Mar 2015 18:13:24 +0000 (UTC) Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU [128.32.117.67]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t2DIDMQP005832 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 13 Mar 2015 11:13:23 -0700 Message-ID: <550328C2.6060602@freebsd.org> Date: Fri, 13 Mar 2015 11:13:22 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> <20150312213530.GT2379@kib.kiev.ua> <5502094D.5090001@freebsd.org> <20150313084702.GV2379@kib.kiev.ua> <550318FD.1070906@freebsd.org> <20150313172345.GY2379@kib.kiev.ua> <5503224A.3010100@freebsd.org> <20150313175931.GA2379@kib.kiev.ua> In-Reply-To: <20150313175931.GA2379@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZnHMi/z/MD2aCkwRjsbWoCP18pfq0c4IQiGTiST18n4VzIeeWQL2KaRE+pH9mO2WtFckn/VbbzyQh/taiR0X6Jdt6zynLtV5U= X-Sonic-ID: C;pGGRoqzJ5BGP4u8Jj30JFw== M;2rfNoqzJ5BGP4u8Jj30JFw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 18:13:25 -0000 On 03/13/15 10:59, Konstantin Belousov wrote: > On Fri, Mar 13, 2015 at 10:45:46AM -0700, Nathan Whitehorn wrote: >> We'll need to hack the compiler in this case, since it assumes setjmp() >> saves and restores the vector registers. I'm really not sure which >> option is worse. > Changing the compiler is arguably much worse than breaking ABI of the > tier 2 platform, indeed. We must maintain the situation where the stock > build of the compilers work out of box. > > Still, how the compiler' assumptions are laid out ? It could be argued > that compilers on x86 also assume that FPU register file is restored by > longjmp. %st* and %xmm* are defined as not preserved across function > calls, but I suspect that practical rule for setjmp() is that floating > vars better not be used in the target frame. > > Hm, indeed f14-f31 and v20-v31 are marked as non-volatile for 64bit ABI. > The compiler assumes that f14-f31 and v20-v31 are preserved by setjmp() (and, e.g. glibc's setjmp() does in fact preserve them). It also tries not to use those registers too much, so the practical impact is limited, but it should actually be fixed. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 18:35:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B5E914D; Fri, 13 Mar 2015 18:35:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 4CCAD191; Fri, 13 Mar 2015 18:35:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DIZcHC037633; Fri, 13 Mar 2015 18:35:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DIZcB9037632; Fri, 13 Mar 2015 18:35:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503131835.t2DIZcB9037632@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Mar 2015 18:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279960 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 18:35:39 -0000 Author: mav Date: Fri Mar 13 18:35:38 2015 New Revision: 279960 URL: https://svnweb.freebsd.org/changeset/base/279960 Log: Add support for PIO variants of READ/WRITE commands for AHCI disks. AHCI API hides all PIO specifics, so this functionality is almost free. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 18:04:07 2015 (r279959) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 18:35:38 2015 (r279960) @@ -520,12 +520,14 @@ ahci_handle_dma(struct ahci_port *p, int readop = 1; prdt += seek; - if (cfis[2] == ATA_WRITE_DMA || cfis[2] == ATA_WRITE_DMA48 || - cfis[2] == ATA_WRITE_FPDMA_QUEUED) + if (cfis[2] == ATA_WRITE || cfis[2] == ATA_WRITE48 || + cfis[2] == ATA_WRITE_MUL || cfis[2] == ATA_WRITE_MUL48 || + cfis[2] == ATA_WRITE_DMA || cfis[2] == ATA_WRITE_DMA48 || + cfis[2] == ATA_WRITE_FPDMA_QUEUED) readop = 0; if (cfis[2] == ATA_WRITE_FPDMA_QUEUED || - cfis[2] == ATA_READ_FPDMA_QUEUED) { + cfis[2] == ATA_READ_FPDMA_QUEUED) { lba = ((uint64_t)cfis[10] << 40) | ((uint64_t)cfis[9] << 32) | ((uint64_t)cfis[8] << 24) | @@ -536,7 +538,9 @@ ahci_handle_dma(struct ahci_port *p, int if (!len) len = 65536; ncq = 1; - } else if (cfis[2] == ATA_READ_DMA48 || cfis[2] == ATA_WRITE_DMA48) { + } else if (cfis[2] == ATA_READ48 || cfis[2] == ATA_WRITE48 || + cfis[2] == ATA_READ_MUL48 || cfis[2] == ATA_WRITE_MUL48 || + cfis[2] == ATA_READ_DMA48 || cfis[2] == ATA_WRITE_DMA48) { lba = ((uint64_t)cfis[10] << 40) | ((uint64_t)cfis[9] << 32) | ((uint64_t)cfis[8] << 24) | @@ -1475,6 +1479,14 @@ ahci_handle_cmd(struct ahci_port *p, int } ahci_write_fis_d2h(p, slot, cfis, p->tfd); break; + case ATA_READ: + case ATA_WRITE: + case ATA_READ48: + case ATA_WRITE48: + case ATA_READ_MUL: + case ATA_WRITE_MUL: + case ATA_READ_MUL48: + case ATA_WRITE_MUL48: case ATA_READ_DMA: case ATA_WRITE_DMA: case ATA_READ_DMA48: From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 18:38:29 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2488E417; Fri, 13 Mar 2015 18:38:29 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 A02631D4; Fri, 13 Mar 2015 18:38:28 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2DIcNJb028490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Mar 2015 20:38:23 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2DIcNJb028490 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2DIcNmc028489; Fri, 13 Mar 2015 20:38:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Mar 2015 20:38:23 +0200 From: Konstantin Belousov To: Nathan Whitehorn Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc Message-ID: <20150313183823.GB2379@kib.kiev.ua> References: <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> <20150312213530.GT2379@kib.kiev.ua> <5502094D.5090001@freebsd.org> <20150313084702.GV2379@kib.kiev.ua> <550318FD.1070906@freebsd.org> <20150313172345.GY2379@kib.kiev.ua> <5503224A.3010100@freebsd.org> <20150313175931.GA2379@kib.kiev.ua> <550328C2.6060602@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <550328C2.6060602@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 18:38:29 -0000 On Fri, Mar 13, 2015 at 11:13:22AM -0700, Nathan Whitehorn wrote: > The compiler assumes that f14-f31 and v20-v31 are preserved by setjmp() > (and, e.g. glibc's setjmp() does in fact preserve them). It also tries > not to use those registers too much, so the practical impact is limited, > but it should actually be fixed. I think that the setjmp/longjmp case would benefit greatly from the versioning of the symbols. Versioning cannot solve all ABI issues, e.g. if you compiler used old machine/setjmp.h and then link resulting .o with newer libc, but for complete builds it will help and keep old binaries working not worse than now. From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 18:42:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98E786A1; Fri, 13 Mar 2015 18:42:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6B8862E4; Fri, 13 Mar 2015 18:42:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DIgiv4042000; Fri, 13 Mar 2015 18:42:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DIgiSs041997; Fri, 13 Mar 2015 18:42:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201503131842.t2DIgiSs041997@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 13 Mar 2015 18:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279962 - head/lib/libc/posix1e X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 18:42:44 -0000 Author: pfg Date: Fri Mar 13 18:42:43 2015 New Revision: 279962 URL: https://svnweb.freebsd.org/changeset/base/279962 Log: libc: plug memory leaks in edge cases for the posix1e code. CID: 1016705 CID: 1016706 CID: 1016707 Differential Revision: https://reviews.freebsd.org/D2023 Modified: head/lib/libc/posix1e/acl_calc_mask.c head/lib/libc/posix1e/acl_strip.c Modified: head/lib/libc/posix1e/acl_calc_mask.c ============================================================================== --- head/lib/libc/posix1e/acl_calc_mask.c Fri Mar 13 18:38:02 2015 (r279961) +++ head/lib/libc/posix1e/acl_calc_mask.c Fri Mar 13 18:42:43 2015 (r279962) @@ -104,6 +104,7 @@ acl_calc_mask(acl_t *acl_p) /* if no mask exists, check acl_cnt... */ if (acl_int_new->acl_cnt == ACL_MAX_ENTRIES) { errno = ENOMEM; + acl_free(acl_new); return (-1); } /* ...and add the mask entry */ Modified: head/lib/libc/posix1e/acl_strip.c ============================================================================== --- head/lib/libc/posix1e/acl_strip.c Fri Mar 13 18:38:02 2015 (r279961) +++ head/lib/libc/posix1e/acl_strip.c Fri Mar 13 18:42:43 2015 (r279962) @@ -82,8 +82,10 @@ _posix1e_acl_strip_np(const acl_t aclp, have_mask_entry = 0; acl_new = acl_init(ACL_MAX_ENTRIES); - if (acl_new == NULL) + if (acl_new == NULL) { + acl_free(acl_old); return (NULL); + } tag = ACL_UNDEFINED_TAG; /* only save the default user/group/other entries */ @@ -94,16 +96,16 @@ _posix1e_acl_strip_np(const acl_t aclp, assert(_entry_brand(entry) == ACL_BRAND_POSIX); if (acl_get_tag_type(entry, &tag) == -1) - return (NULL); + goto fail; switch(tag) { case ACL_USER_OBJ: case ACL_GROUP_OBJ: case ACL_OTHER: if (acl_get_tag_type(entry, &tag) == -1) - return (NULL); + goto fail; if (acl_get_permset(entry, &perm) == -1) - return (NULL); + goto fail; if (acl_create_entry(&acl_new, &entry_new) == -1) return (NULL); if (acl_set_tag_type(entry_new, tag) == -1) @@ -120,6 +122,10 @@ _posix1e_acl_strip_np(const acl_t aclp, default: break; } +fail: + acl_free(acl_new); + acl_free(acl_old); + return (NULL); } assert(_acl_brand(acl_new) == ACL_BRAND_POSIX); From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 20:06:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 648EEA03; Fri, 13 Mar 2015 20:06:03 +0000 (UTC) Received: from bigwig.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 37CCFE76; Fri, 13 Mar 2015 20:06:03 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3CB4DB93B; Fri, 13 Mar 2015 16:06:01 -0400 (EDT) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r279932 - head/sys/vm Date: Fri, 13 Mar 2015 14:34:30 -0400 Message-ID: <1700119.KBm0D9PSuZ@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <1426269478.19693.4.camel@freebsd.org> References: <201503121806.t2CI6VSU034853@svn.freebsd.org> <3013452.2FfDYxpIKo@ralph.baldwin.cx> <1426269478.19693.4.camel@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.2.7 (bigwig.baldwin.cx); Fri, 13 Mar 2015 16:06:01 -0400 (EDT) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ryan Stone X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 20:06:03 -0000 On Friday, March 13, 2015 11:57:58 AM Ian Lepore wrote: > On Fri, 2015-03-13 at 13:19 -0400, John Baldwin wrote: > > On Friday, March 13, 2015 10:14:27 AM Ian Lepore wrote: > > > On Fri, 2015-03-13 at 06:24 -0400, John Baldwin wrote: > > > > On Thursday, March 12, 2015 05:24:51 PM Ian Lepore wrote: > [...] > > > > > > In general I'm glad I got called away to an onsite meeting yesterday and > > > didn't get far with these changes, because the more I think about it, > > > the less satisfied I am with this expedient fix. The other fix I > > > started on, where a new SBUF_COUNTNUL flag can be set to inform the > > > sbuf_finish() code that you want the terminating nul counted in the data > > > length just feels like a better fit for the overall "automaticness" of > > > how the sbuf stuff works. > > > > Hmm, I actually think that it's a bug that the terminating nul isn't included > > when draining. If we fixed that then I think that fixes most of these? > > The places that explicitly use 'sysctl_handle_string()' with an sbuf > > should probably just be using sbuf_len(sb) + 1' explicitly. (Another > > option would be to have a sysctl_handle_sbuf() that was a wrapper around > > sysctl_handle_string() that included the + 1 to hide that detail if there is > > more than one.) > > > > Some of the uses of sbuf for sysctl use sbuf_bcat() for dealing with > binary structs, so we can't just assume that a nullterm should be added > and included in the buffer length -- there needs to be some mechanism to > say explicitly "this is an sbuf for a sysctl string" (and more generally > "this is an sbuf for a string where I want the nul byte counted as part > of the data" because that could be useful in non-sysctl contexts too, > especially in userland). Humm, that would seem to be an abuse of the API really. It is specifically designed for strings as someone else noted at the start of this thread (and as noted in the manpage). If anything I'd argue that the use cases that don't want a string should be the ones that should get a special flag in that case (or perhaps we should have a different little API to manage a buffer used for a draining sysctl where the data is a binary blob instead of a string). If you agree I'm happy to do some of the work (e.g. the different wrapper API). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 20:08:37 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0041DC36; Fri, 13 Mar 2015 20:08:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 DF556E96; Fri, 13 Mar 2015 20:08:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DK8aM5079789; Fri, 13 Mar 2015 20:08:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DK8ZDs079784; Fri, 13 Mar 2015 20:08:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503132008.t2DK8ZDs079784@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Mar 2015 20:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279963 - in head/sys/dev: ahci ata mvs siis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 20:08:37 -0000 Author: mav Date: Fri Mar 13 20:08:35 2015 New Revision: 279963 URL: https://svnweb.freebsd.org/changeset/base/279963 Log: Fix SATA Gen3 speed constants. MFC after: 1 week Modified: head/sys/dev/ahci/ahci.h head/sys/dev/ata/ata-all.h head/sys/dev/mvs/mvs.h head/sys/dev/siis/siis.h Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Fri Mar 13 18:42:43 2015 (r279962) +++ head/sys/dev/ahci/ahci.h Fri Mar 13 20:08:35 2015 (r279963) @@ -93,7 +93,7 @@ #define ATA_SS_SPD_NO_SPEED 0x00000000 #define ATA_SS_SPD_GEN1 0x00000010 #define ATA_SS_SPD_GEN2 0x00000020 -#define ATA_SS_SPD_GEN3 0x00000040 +#define ATA_SS_SPD_GEN3 0x00000030 #define ATA_SS_IPM_MASK 0x00000f00 #define ATA_SS_IPM_NO_DEVICE 0x00000000 @@ -131,7 +131,7 @@ #define ATA_SC_SPD_NO_SPEED 0x00000000 #define ATA_SC_SPD_SPEED_GEN1 0x00000010 #define ATA_SC_SPD_SPEED_GEN2 0x00000020 -#define ATA_SC_SPD_SPEED_GEN3 0x00000040 +#define ATA_SC_SPD_SPEED_GEN3 0x00000030 #define ATA_SC_IPM_MASK 0x00000f00 #define ATA_SC_IPM_NONE 0x00000000 Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Fri Mar 13 18:42:43 2015 (r279962) +++ head/sys/dev/ata/ata-all.h Fri Mar 13 20:08:35 2015 (r279963) @@ -105,6 +105,7 @@ #define ATA_SS_SPD_NO_SPEED 0x00000000 #define ATA_SS_SPD_GEN1 0x00000010 #define ATA_SS_SPD_GEN2 0x00000020 +#define ATA_SS_SPD_GEN3 0x00000030 #define ATA_SS_IPM_MASK 0x00000f00 #define ATA_SS_IPM_NO_DEVICE 0x00000000 @@ -140,7 +141,7 @@ #define ATA_SC_SPD_NO_SPEED 0x00000000 #define ATA_SC_SPD_SPEED_GEN1 0x00000010 #define ATA_SC_SPD_SPEED_GEN2 0x00000020 -#define ATA_SC_SPD_SPEED_GEN3 0x00000040 +#define ATA_SC_SPD_SPEED_GEN3 0x00000030 #define ATA_SC_IPM_MASK 0x00000f00 #define ATA_SC_IPM_NONE 0x00000000 Modified: head/sys/dev/mvs/mvs.h ============================================================================== --- head/sys/dev/mvs/mvs.h Fri Mar 13 18:42:43 2015 (r279962) +++ head/sys/dev/mvs/mvs.h Fri Mar 13 20:08:35 2015 (r279963) @@ -263,7 +263,7 @@ #define SATA_SS_SPD_NO_SPEED 0x00000000 #define SATA_SS_SPD_GEN1 0x00000010 #define SATA_SS_SPD_GEN2 0x00000020 -#define SATA_SS_SPD_GEN3 0x00000040 +#define SATA_SS_SPD_GEN3 0x00000030 #define SATA_SS_IPM_MASK 0x00000f00 #define SATA_SS_IPM_NO_DEVICE 0x00000000 @@ -298,7 +298,7 @@ #define SATA_SC_SPD_NO_SPEED 0x00000000 #define SATA_SC_SPD_SPEED_GEN1 0x00000010 #define SATA_SC_SPD_SPEED_GEN2 0x00000020 -#define SATA_SC_SPD_SPEED_GEN3 0x00000040 +#define SATA_SC_SPD_SPEED_GEN3 0x00000030 #define SATA_SC_IPM_MASK 0x00000f00 #define SATA_SC_IPM_NONE 0x00000000 Modified: head/sys/dev/siis/siis.h ============================================================================== --- head/sys/dev/siis/siis.h Fri Mar 13 18:42:43 2015 (r279962) +++ head/sys/dev/siis/siis.h Fri Mar 13 20:08:35 2015 (r279963) @@ -92,7 +92,7 @@ #define ATA_SS_SPD_NO_SPEED 0x00000000 #define ATA_SS_SPD_GEN1 0x00000010 #define ATA_SS_SPD_GEN2 0x00000020 -#define ATA_SS_SPD_GEN3 0x00000040 +#define ATA_SS_SPD_GEN3 0x00000030 #define ATA_SS_IPM_MASK 0x00000f00 #define ATA_SS_IPM_NO_DEVICE 0x00000000 @@ -128,7 +128,7 @@ #define ATA_SC_SPD_NO_SPEED 0x00000000 #define ATA_SC_SPD_SPEED_GEN1 0x00000010 #define ATA_SC_SPD_SPEED_GEN2 0x00000020 -#define ATA_SC_SPD_SPEED_GEN3 0x00000040 +#define ATA_SC_SPD_SPEED_GEN3 0x00000030 #define ATA_SC_IPM_MASK 0x00000f00 #define ATA_SC_IPM_NONE 0x00000000 From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 20:14:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69E0B2B7; Fri, 13 Mar 2015 20:14:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 55329F76; Fri, 13 Mar 2015 20:14:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DKEaBQ084113; Fri, 13 Mar 2015 20:14:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DKEZY3084111; Fri, 13 Mar 2015 20:14:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503132014.t2DKEZY3084111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Mar 2015 20:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279965 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 20:14:36 -0000 Author: mav Date: Fri Mar 13 20:14:35 2015 New Revision: 279965 URL: https://svnweb.freebsd.org/changeset/base/279965 Log: Polish AHCI disk identify data and fix speed negotiation. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/ahci.h head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/ahci.h ============================================================================== --- head/usr.sbin/bhyve/ahci.h Fri Mar 13 20:10:09 2015 (r279964) +++ head/usr.sbin/bhyve/ahci.h Fri Mar 13 20:14:35 2015 (r279965) @@ -96,13 +96,14 @@ #define ATA_SS_SPD_NO_SPEED 0x00000000 #define ATA_SS_SPD_GEN1 0x00000010 #define ATA_SS_SPD_GEN2 0x00000020 -#define ATA_SS_SPD_GEN3 0x00000040 +#define ATA_SS_SPD_GEN3 0x00000030 #define ATA_SS_IPM_MASK 0x00000f00 #define ATA_SS_IPM_NO_DEVICE 0x00000000 #define ATA_SS_IPM_ACTIVE 0x00000100 #define ATA_SS_IPM_PARTIAL 0x00000200 #define ATA_SS_IPM_SLUMBER 0x00000600 +#define ATA_SS_IPM_DEVSLEEP 0x00000800 #define ATA_SERROR 14 #define ATA_SE_DATA_CORRECTED 0x00000001 @@ -133,17 +134,19 @@ #define ATA_SC_SPD_NO_SPEED 0x00000000 #define ATA_SC_SPD_SPEED_GEN1 0x00000010 #define ATA_SC_SPD_SPEED_GEN2 0x00000020 -#define ATA_SC_SPD_SPEED_GEN3 0x00000040 +#define ATA_SC_SPD_SPEED_GEN3 0x00000030 #define ATA_SC_IPM_MASK 0x00000f00 #define ATA_SC_IPM_NONE 0x00000000 #define ATA_SC_IPM_DIS_PARTIAL 0x00000100 #define ATA_SC_IPM_DIS_SLUMBER 0x00000200 +#define ATA_SC_IPM_DIS_DEVSLEEP 0x00000400 #define ATA_SACTIVE 16 #define AHCI_MAX_PORTS 32 #define AHCI_MAX_SLOTS 32 +#define AHCI_MAX_IRQS 16 /* SATA AHCI v1.0 register defines */ #define AHCI_CAP 0x00 @@ -208,6 +211,9 @@ #define AHCI_CAP2_BOH 0x00000001 #define AHCI_CAP2_NVMP 0x00000002 #define AHCI_CAP2_APST 0x00000004 +#define AHCI_CAP2_SDS 0x00000008 +#define AHCI_CAP2_SADM 0x00000010 +#define AHCI_CAP2_DESO 0x00000020 #define AHCI_OFFSET 0x100 #define AHCI_STEP 0x80 @@ -265,6 +271,7 @@ #define AHCI_P_CMD_ACTIVE 0x10000000 #define AHCI_P_CMD_PARTIAL 0x20000000 #define AHCI_P_CMD_SLUMBER 0x60000000 +#define AHCI_P_CMD_DEVSLEEP 0x80000000 #define AHCI_P_TFD 0x20 #define AHCI_P_SIG 0x24 @@ -284,6 +291,17 @@ #define AHCI_P_FBS_ADO_SHIFT 12 #define AHCI_P_FBS_DWE 0x000f0000 #define AHCI_P_FBS_DWE_SHIFT 16 +#define AHCI_P_DEVSLP 0x44 +#define AHCI_P_DEVSLP_ADSE 0x00000001 +#define AHCI_P_DEVSLP_DSP 0x00000002 +#define AHCI_P_DEVSLP_DETO 0x000003fc +#define AHCI_P_DEVSLP_DETO_SHIFT 2 +#define AHCI_P_DEVSLP_MDAT 0x00007c00 +#define AHCI_P_DEVSLP_MDAT_SHIFT 10 +#define AHCI_P_DEVSLP_DITO 0x01ff8000 +#define AHCI_P_DEVSLP_DITO_SHIFT 15 +#define AHCI_P_DEVSLP_DM 0x0e000000 +#define AHCI_P_DEVSLP_DM_SHIFT 25 /* Just to be sure, if building as module. */ #if MAXPHYS < 512 * 1024 Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 20:10:09 2015 (r279964) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 20:14:35 2015 (r279965) @@ -431,7 +431,6 @@ ahci_port_stop(struct ahci_port *p) static void ahci_port_reset(struct ahci_port *pr) { - pr->sctl = 0; pr->serr = 0; pr->sact = 0; pr->xfermode = ATA_UDMA6; @@ -443,8 +442,11 @@ ahci_port_reset(struct ahci_port *pr) pr->tfd = 0x7F; return; } - pr->ssts = ATA_SS_DET_PHY_ONLINE | ATA_SS_SPD_GEN2 | - ATA_SS_IPM_ACTIVE; + pr->ssts = ATA_SS_DET_PHY_ONLINE | ATA_SS_IPM_ACTIVE; + if (pr->sctl & ATA_SC_SPD_MASK) + pr->ssts |= (pr->sctl & ATA_SC_SPD_MASK); + else + pr->ssts |= ATA_SS_SPD_GEN3; pr->tfd = (1 << 8) | ATA_S_DSC | ATA_S_DMA; if (!pr->atapi) { pr->sig = PxSIG_ATA; @@ -470,6 +472,7 @@ ahci_reset(struct pci_ahci_softc *sc) for (i = 0; i < sc->ports; i++) { sc->port[i].ie = 0; sc->port[i].is = 0; + sc->port[i].sctl = 0; ahci_port_reset(&sc->port[i]); } } @@ -807,26 +810,36 @@ handle_identify(struct ahci_port *p, int buf[53] = (1 << 1 | 1 << 2); if (p->mult_sectors) buf[59] = (0x100 | p->mult_sectors); - buf[60] = sectors; - buf[61] = (sectors >> 16); + if (sectors <= 0x0fffffff) { + buf[60] = sectors; + buf[61] = (sectors >> 16); + } else { + buf[60] = 0xffff; + buf[61] = 0x0fff; + } buf[63] = 0x7; if (p->xfermode & ATA_WDMA0) buf[63] |= (1 << ((p->xfermode & 7) + 8)); buf[64] = 0x3; - buf[65] = 100; - buf[66] = 100; - buf[67] = 100; - buf[68] = 100; + buf[65] = 120; + buf[66] = 120; + buf[67] = 120; + buf[68] = 120; buf[69] = 0; buf[75] = 31; - buf[76] = (1 << 8 | 1 << 2); + buf[76] = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | ATA_SATA_GEN3 | + ATA_SUPPORT_NCQ); buf[80] = 0x1f0; buf[81] = 0x28; - buf[82] = (1 << 5 | 1 << 14); - buf[83] = (1 << 10 | 1 << 12 | 1 << 13 | 1 << 14); + buf[82] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| + ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); + buf[83] = (ATA_SUPPORT_ADDRESS48 | ATA_SUPPORT_FLUSHCACHE | + ATA_SUPPORT_FLUSHCACHE48 | 1 << 14); buf[84] = (1 << 14); - buf[85] = (1 << 5 | 1 << 14); - buf[86] = (1 << 10 | 1 << 12 | 1 << 13); + buf[85] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| + ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); + buf[86] = (ATA_SUPPORT_ADDRESS48 | ATA_SUPPORT_FLUSHCACHE | + ATA_SUPPORT_FLUSHCACHE48); buf[87] = (1 << 14); buf[88] = 0x7f; if (p->xfermode & ATA_UDMA0) @@ -853,6 +866,7 @@ handle_identify(struct ahci_port *p, int buf[117] = sectsz / 2; buf[118] = ((sectsz / 2) >> 16); } + buf[222] = 0x1020; ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); @@ -1850,10 +1864,10 @@ pci_ahci_port_write(struct pci_ahci_soft WPRINTF("pci_ahci_port: read only registers 0x%"PRIx64"\n", offset); break; case AHCI_P_SCTL: + p->sctl = value; if (!(p->cmd & AHCI_P_CMD_ST)) { if (value & ATA_SC_DET_RESET) ahci_port_reset(p); - p->sctl = value; } break; case AHCI_P_SERR: From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 20:14:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 593253F6; Fri, 13 Mar 2015 20:14:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 44D66F81; Fri, 13 Mar 2015 20:14:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DKEu1w084190; Fri, 13 Mar 2015 20:14:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DKEuCc084189; Fri, 13 Mar 2015 20:14:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201503132014.t2DKEuCc084189@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 13 Mar 2015 20:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279966 - head/contrib/libxo/libxo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 20:14:56 -0000 Author: trasz Date: Fri Mar 13 20:14:55 2015 New Revision: 279966 URL: https://svnweb.freebsd.org/changeset/base/279966 Log: Mark xo_err(3), xo_errx(3), and xo_errc(3) as __dead2. Differential Revision: https://reviews.freebsd.org/D2059 Reviewed by: marcel@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/contrib/libxo/libxo/xo.h Modified: head/contrib/libxo/libxo/xo.h ============================================================================== --- head/contrib/libxo/libxo/xo.h Fri Mar 13 20:14:35 2015 (r279965) +++ head/contrib/libxo/libxo/xo.h Fri Mar 13 20:14:55 2015 (r279966) @@ -272,13 +272,13 @@ void xo_warnx (const char *fmt, ...); void -xo_err (int eval, const char *fmt, ...); +xo_err (int eval, const char *fmt, ...) __dead2; void -xo_errx (int eval, const char *fmt, ...); +xo_errx (int eval, const char *fmt, ...) __dead2; void -xo_errc (int eval, int code, const char *fmt, ...); +xo_errc (int eval, int code, const char *fmt, ...) __dead2; void xo_message_hcv (xo_handle_t *xop, int code, const char *fmt, va_list vap); From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 20:51:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CC97DB6; Fri, 13 Mar 2015 20:51:26 +0000 (UTC) Received: from relay.mailchannels.net (aso-006-i443.relay.mailchannels.net [23.91.64.124]) by mx1.freebsd.org (Postfix) with ESMTP id ACC6E5EE; Fri, 13 Mar 2015 20:51:23 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp3.ore.mailhop.org (ip-10-237-13-110.us-west-2.compute.internal [10.237.13.110]) by relay.mailchannels.net (Postfix) with ESMTPA id A172DA054F; Fri, 13 Mar 2015 20:42:24 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|hippie Received: from smtp3.ore.mailhop.org (smtp3.ore.mailhop.org [10.21.145.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Fri, 13 Mar 2015 20:42:25 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|hippie X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1426279344781:1644432435 X-MC-Ingress-Time: 1426279344781 Received: from c-73-34-117-227.hsd1.co.comcast.net ([73.34.117.227] helo=ilsoft.org) by smtp3.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1YWWPW-0001yk-Vf; Fri, 13 Mar 2015 20:42:23 +0000 Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t2DKgDBW017076; Fri, 13 Mar 2015 14:42:13 -0600 (MDT) (envelope-from ian@freebsd.org) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX18e/+cDNCdM2PPKpfzfmt9O Message-ID: <1426279333.45674.11.camel@freebsd.org> Subject: Re: svn commit: r279932 - head/sys/vm From: Ian Lepore To: John Baldwin Date: Fri, 13 Mar 2015 14:42:13 -0600 In-Reply-To: <1700119.KBm0D9PSuZ@ralph.baldwin.cx> References: <201503121806.t2CI6VSU034853@svn.freebsd.org> <3013452.2FfDYxpIKo@ralph.baldwin.cx> <1426269478.19693.4.camel@freebsd.org> <1700119.KBm0D9PSuZ@ralph.baldwin.cx> Content-Type: multipart/mixed; boundary="=-NcRRSB3FPT93nPMFnfu0" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 X-AuthUser: hippie Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ryan Stone X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 20:51:26 -0000 --=-NcRRSB3FPT93nPMFnfu0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, 2015-03-13 at 14:34 -0400, John Baldwin wrote: > On Friday, March 13, 2015 11:57:58 AM Ian Lepore wrote: > > On Fri, 2015-03-13 at 13:19 -0400, John Baldwin wrote: > > > On Friday, March 13, 2015 10:14:27 AM Ian Lepore wrote: > > > > On Fri, 2015-03-13 at 06:24 -0400, John Baldwin wrote: > > > > > On Thursday, March 12, 2015 05:24:51 PM Ian Lepore wrote: > > [...] > > > > > > > > In general I'm glad I got called away to an onsite meeting yesterday and > > > > didn't get far with these changes, because the more I think about it, > > > > the less satisfied I am with this expedient fix. The other fix I > > > > started on, where a new SBUF_COUNTNUL flag can be set to inform the > > > > sbuf_finish() code that you want the terminating nul counted in the data > > > > length just feels like a better fit for the overall "automaticness" of > > > > how the sbuf stuff works. > > > > > > Hmm, I actually think that it's a bug that the terminating nul isn't included > > > when draining. If we fixed that then I think that fixes most of these? > > > The places that explicitly use 'sysctl_handle_string()' with an sbuf > > > should probably just be using sbuf_len(sb) + 1' explicitly. (Another > > > option would be to have a sysctl_handle_sbuf() that was a wrapper around > > > sysctl_handle_string() that included the + 1 to hide that detail if there is > > > more than one.) > > > > > > > Some of the uses of sbuf for sysctl use sbuf_bcat() for dealing with > > binary structs, so we can't just assume that a nullterm should be added > > and included in the buffer length -- there needs to be some mechanism to > > say explicitly "this is an sbuf for a sysctl string" (and more generally > > "this is an sbuf for a string where I want the nul byte counted as part > > of the data" because that could be useful in non-sysctl contexts too, > > especially in userland). > > Humm, that would seem to be an abuse of the API really. It is specifically > designed for strings as someone else noted at the start of this thread (and > as noted in the manpage). If anything I'd argue that the use cases that don't > want a string should be the ones that should get a special flag in that case > (or perhaps we should have a different little API to manage a buffer used for > a draining sysctl where the data is a binary blob instead of a string). If > you agree I'm happy to do some of the work (e.g. the different wrapper API). > Given the existance of sbuf_bcpy() and sbuf_bcat() I'm not sure we can say using sbuf for binary data is any kind of violation; somebody just used the API that was provided to solve their problem. Binary data is the exception in the sysctl case, and the idea of having sbuf_new_for_sysctl() assume you're setting up to handle a sysctl string and requiring the rare binary uses to do something different does make a lot of sense. That might lead to a patch like the one below, which would automatically fix most of the current sysctl sbuf users, and the 2 or 3 places that are using binary data would need to add a line: sbuf_clear_flags(&sbuf, SBUF_INCLUDENUL); I should mention too that the larger problem I'm trying to clean up is that some sysctl strings include the nul byte in the data returned to userland and some don't. There are more direct callers of SYSCTL_OUT() that fail to add a nulterm, I have a whole separate set of fixes for those, but I'm becoming somewhat inclined to fix them by converting them to use sbuf and just make that the established idiom for returning dynamic strings via sysctl. -- Ian --=-NcRRSB3FPT93nPMFnfu0 Content-Disposition: inline; filename="sbuf_includenul.diff" Content-Type: text/x-patch; name="sbuf_includenul.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit Index: sys/kern/kern_sysctl.c =================================================================== --- sys/kern/kern_sysctl.c (revision 279962) +++ sys/kern/kern_sysctl.c (working copy) @@ -1807,7 +1807,7 @@ sbuf_new_for_sysctl(struct sbuf *s, char *buf, int struct sysctl_req *req) { - s = sbuf_new(s, buf, length, SBUF_FIXEDLEN); + s = sbuf_new(s, buf, length, SBUF_FIXEDLEN | SBUF_INCLUDENUL); sbuf_set_drain(s, sbuf_sysctl_drain, req); return (s); } Index: sys/kern/subr_sbuf.c =================================================================== --- sys/kern/subr_sbuf.c (revision 279962) +++ sys/kern/subr_sbuf.c (working copy) @@ -262,6 +262,28 @@ sbuf_uionew(struct sbuf *s, struct uio *uio, int * } #endif +int +sbuf_get_flags(struct sbuf *s) +{ + + return (s->s_flags); +} + +void +sbuf_clear_flags(struct sbuf *s, int flags) +{ + + s->s_flags &= ~(flags & SBUF_USRFLAGMSK); +} + +void +sbuf_set_flags(struct sbuf *s, int flags) +{ + + + s->s_flags |= (flags & SBUF_USRFLAGMSK); +} + /* * Clear an sbuf and reset its position. */ @@ -697,11 +719,13 @@ sbuf_finish(struct sbuf *s) assert_sbuf_integrity(s); assert_sbuf_state(s, 0); + s->s_buf[s->s_len] = '\0'; + if (s->s_flags & SBUF_INCLUDENUL) + s->s_len++; if (s->s_drain_func != NULL) { while (s->s_len > 0 && s->s_error == 0) s->s_error = sbuf_drain(s); } - s->s_buf[s->s_len] = '\0'; SBUF_SETFLAG(s, SBUF_FINISHED); #ifdef _KERNEL return (s->s_error); @@ -743,6 +767,10 @@ sbuf_len(struct sbuf *s) if (s->s_error != 0) return (-1); + + /* If finished, nulterm is already in len, else add one. */ + if ((s->s_flags & (SBUF_INCLUDENUL | SBUF_FINISHED)) == SBUF_INCLUDENUL) + return (s->s_len + 1); return (s->s_len); } Index: sys/sys/sbuf.h =================================================================== --- sys/sys/sbuf.h (revision 279962) +++ sys/sys/sbuf.h (working copy) @@ -48,6 +48,7 @@ struct sbuf { ssize_t s_len; /* current length of string */ #define SBUF_FIXEDLEN 0x00000000 /* fixed length buffer (default) */ #define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */ +#define SBUF_INCLUDENUL 0x00000002 /* nulterm byte is counted in len */ #define SBUF_USRFLAGMSK 0x0000ffff /* mask of flags the user may specify */ #define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */ #define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */ @@ -64,6 +65,9 @@ __BEGIN_DECLS struct sbuf *sbuf_new(struct sbuf *, char *, int, int); #define sbuf_new_auto() \ sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND) +int sbuf_get_flags(struct sbuf *); +void sbuf_clear_flags(struct sbuf *, int); +void sbuf_set_flags(struct sbuf *, int); void sbuf_clear(struct sbuf *); int sbuf_setpos(struct sbuf *, ssize_t); int sbuf_bcat(struct sbuf *, const void *, size_t); --=-NcRRSB3FPT93nPMFnfu0-- From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 20:56:18 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC6A8F99; Fri, 13 Mar 2015 20:56:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 97BD8627; Fri, 13 Mar 2015 20:56:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DKuIeZ003418; Fri, 13 Mar 2015 20:56:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DKuIgo003417; Fri, 13 Mar 2015 20:56:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503132056.t2DKuIgo003417@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Mar 2015 20:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279967 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 20:56:18 -0000 Author: mav Date: Fri Mar 13 20:56:17 2015 New Revision: 279967 URL: https://svnweb.freebsd.org/changeset/base/279967 Log: Change prdbc value reporting. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 20:14:55 2015 (r279966) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 20:56:17 2015 (r279967) @@ -1662,6 +1662,9 @@ ata_ioreq_cb(struct blockif_req *br, int */ STAILQ_INSERT_TAIL(&p->iofhd, aior, io_flist); + if (!err) + hdr->prdbc = aior->done; + if (dsm) { if (aior->done != aior->len && !err) { ahci_handle_dsm_trim(p, slot, cfis, aior->done); @@ -1677,13 +1680,8 @@ ata_ioreq_cb(struct blockif_req *br, int if (!err && aior->done == aior->len) { tfd = ATA_S_READY | ATA_S_DSC; - if (ncq) - hdr->prdbc = 0; - else - hdr->prdbc = aior->len; } else { tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - hdr->prdbc = 0; if (ncq) p->serr |= (1 << slot); } @@ -1738,6 +1736,9 @@ atapi_ioreq_cb(struct blockif_req *br, i */ STAILQ_INSERT_TAIL(&p->iofhd, aior, io_flist); + if (!err) + hdr->prdbc = aior->done; + if (pending && !err) { atapi_read(p, slot, cfis, aior->done, hdr->prdtl - pending); goto out; @@ -1745,12 +1746,10 @@ atapi_ioreq_cb(struct blockif_req *br, i if (!err && aior->done == aior->len) { tfd = ATA_S_READY | ATA_S_DSC; - hdr->prdbc = aior->len; } else { p->sense_key = ATA_SENSE_ILLEGAL_REQUEST; p->asc = 0x21; tfd = (p->sense_key << 12) | ATA_S_READY | ATA_S_ERROR; - hdr->prdbc = 0; } cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 21:01:26 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2639539A; Fri, 13 Mar 2015 21:01:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 11A54777; Fri, 13 Mar 2015 21:01:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2DL1POo007622; Fri, 13 Mar 2015 21:01:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2DL1Ptv007621; Fri, 13 Mar 2015 21:01:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503132101.t2DL1Ptv007621@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Mar 2015 21:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279968 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 21:01:26 -0000 Author: mav Date: Fri Mar 13 21:01:25 2015 New Revision: 279968 URL: https://svnweb.freebsd.org/changeset/base/279968 Log: Remove incorrect SERR register setting. At this point we have nothing to report through that register. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 20:56:17 2015 (r279967) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Mar 13 21:01:25 2015 (r279968) @@ -1682,8 +1682,6 @@ ata_ioreq_cb(struct blockif_req *br, int tfd = ATA_S_READY | ATA_S_DSC; } else { tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - if (ncq) - p->serr |= (1 << slot); } if (ncq) { From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 21:44:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46221D9; Fri, 13 Mar 2015 21:44:34 +0000 (UTC) Received: from bigwig.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 1ED80C0E; Fri, 13 Mar 2015 21:44:34 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 276A5B9A6; Fri, 13 Mar 2015 17:44:32 -0400 (EDT) From: John Baldwin To: Alexander Motin Subject: Re: svn commit: r279965 - head/usr.sbin/bhyve Date: Fri, 13 Mar 2015 17:04:32 -0400 Message-ID: <2486513.R1ROTfJbIk@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201503132014.t2DKEZY3084111@svn.freebsd.org> References: <201503132014.t2DKEZY3084111@svn.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.2.7 (bigwig.baldwin.cx); Fri, 13 Mar 2015 17:44:32 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 21:44:34 -0000 On Friday, March 13, 2015 08:14:35 PM Alexander Motin wrote: > Author: mav > Date: Fri Mar 13 20:14:35 2015 > New Revision: 279965 > URL: https://svnweb.freebsd.org/changeset/base/279965 > > Log: > Polish AHCI disk identify data and fix speed negotiation. > > MFC after: 2 weeks > > Modified: > head/usr.sbin/bhyve/ahci.h > head/usr.sbin/bhyve/pci_ahci.c > > Modified: head/usr.sbin/bhyve/ahci.h > ============================================================================== > --- head/usr.sbin/bhyve/ahci.h Fri Mar 13 20:10:09 2015 (r279964) > +++ head/usr.sbin/bhyve/ahci.h Fri Mar 13 20:14:35 2015 (r279965) > @@ -96,13 +96,14 @@ > #define ATA_SS_SPD_NO_SPEED 0x00000000 > #define ATA_SS_SPD_GEN1 0x00000010 > #define ATA_SS_SPD_GEN2 0x00000020 > -#define ATA_SS_SPD_GEN3 0x00000040 > +#define ATA_SS_SPD_GEN3 0x00000030 > > #define ATA_SS_IPM_MASK 0x00000f00 > #define ATA_SS_IPM_NO_DEVICE 0x00000000 > #define ATA_SS_IPM_ACTIVE 0x00000100 > #define ATA_SS_IPM_PARTIAL 0x00000200 > #define ATA_SS_IPM_SLUMBER 0x00000600 > +#define ATA_SS_IPM_DEVSLEEP 0x00000800 I wonder if it would make sense to have a shared header for these constants (given that it seems they are copied in 4 other places for in-kernel drivers)? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 21:44:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78EEADB; Fri, 13 Mar 2015 21:44:34 +0000 (UTC) Received: from bigwig.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 34D7EC0F; Fri, 13 Mar 2015 21:44:34 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3FEE0B945; Fri, 13 Mar 2015 17:44:31 -0400 (EDT) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r279932 - head/sys/vm Date: Fri, 13 Mar 2015 17:12:04 -0400 Message-ID: <2091019.TzmnaqNB4x@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <1426279333.45674.11.camel@freebsd.org> References: <201503121806.t2CI6VSU034853@svn.freebsd.org> <1700119.KBm0D9PSuZ@ralph.baldwin.cx> <1426279333.45674.11.camel@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.2.7 (bigwig.baldwin.cx); Fri, 13 Mar 2015 17:44:31 -0400 (EDT) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ryan Stone X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 21:44:34 -0000 On Friday, March 13, 2015 02:42:13 PM Ian Lepore wrote: > On Fri, 2015-03-13 at 14:34 -0400, John Baldwin wrote: > > On Friday, March 13, 2015 11:57:58 AM Ian Lepore wrote: > > > On Fri, 2015-03-13 at 13:19 -0400, John Baldwin wrote: > > > > On Friday, March 13, 2015 10:14:27 AM Ian Lepore wrote: > > > > > On Fri, 2015-03-13 at 06:24 -0400, John Baldwin wrote: > > > > > > On Thursday, March 12, 2015 05:24:51 PM Ian Lepore wrote: > > > [...] > > > > > > > > > > In general I'm glad I got called away to an onsite meeting yesterday and > > > > > didn't get far with these changes, because the more I think about it, > > > > > the less satisfied I am with this expedient fix. The other fix I > > > > > started on, where a new SBUF_COUNTNUL flag can be set to inform the > > > > > sbuf_finish() code that you want the terminating nul counted in the data > > > > > length just feels like a better fit for the overall "automaticness" of > > > > > how the sbuf stuff works. > > > > > > > > Hmm, I actually think that it's a bug that the terminating nul isn't included > > > > when draining. If we fixed that then I think that fixes most of these? > > > > The places that explicitly use 'sysctl_handle_string()' with an sbuf > > > > should probably just be using sbuf_len(sb) + 1' explicitly. (Another > > > > option would be to have a sysctl_handle_sbuf() that was a wrapper around > > > > sysctl_handle_string() that included the + 1 to hide that detail if there is > > > > more than one.) > > > > > > > > > > Some of the uses of sbuf for sysctl use sbuf_bcat() for dealing with > > > binary structs, so we can't just assume that a nullterm should be added > > > and included in the buffer length -- there needs to be some mechanism to > > > say explicitly "this is an sbuf for a sysctl string" (and more generally > > > "this is an sbuf for a string where I want the nul byte counted as part > > > of the data" because that could be useful in non-sysctl contexts too, > > > especially in userland). > > > > Humm, that would seem to be an abuse of the API really. It is specifically > > designed for strings as someone else noted at the start of this thread (and > > as noted in the manpage). If anything I'd argue that the use cases that don't > > want a string should be the ones that should get a special flag in that case > > (or perhaps we should have a different little API to manage a buffer used for > > a draining sysctl where the data is a binary blob instead of a string). If > > you agree I'm happy to do some of the work (e.g. the different wrapper API). > > > > Given the existance of sbuf_bcpy() and sbuf_bcat() I'm not sure we can > say using sbuf for binary data is any kind of violation; somebody just > used the API that was provided to solve their problem. Well, it still nul-terminates the result of those, so I think it's still really dealing with strings. Those can be useful for appending non nul-terminated strings (for example using the d_namelen from a dirent). However, I think an INCLUDENUL flag is fine. It is a smaller change than adding a new sysctl-drain API. > Binary data is the exception in the sysctl case, and the idea of having > sbuf_new_for_sysctl() assume you're setting up to handle a sysctl string > and requiring the rare binary uses to do something different does make a > lot of sense. That might lead to a patch like the one below, which > would automatically fix most of the current sysctl sbuf users, and the 2 > or 3 places that are using binary data would need to add a line: > > sbuf_clear_flags(&sbuf, SBUF_INCLUDENUL); > > I should mention too that the larger problem I'm trying to clean up is > that some sysctl strings include the nul byte in the data returned to > userland and some don't. There are more direct callers of SYSCTL_OUT() > that fail to add a nulterm, I have a whole separate set of fixes for > those, but I'm becoming somewhat inclined to fix them by converting them > to use sbuf and just make that the established idiom for returning > dynamic strings via sysctl. Either that or using sysctl_handle_string() when possible instead of bare SYSCTL_OUT(). I think your patch is fine. I agree this will be a much smaller change to roll out. :) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Mar 13 22:21:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E0D17FF; Fri, 13 Mar 2015 22:21:52 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 187DEFE9; Fri, 13 Mar 2015 22:21:51 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id B901F1A34DB; Sat, 14 Mar 2015 08:59:51 +1100 (AEDT) Date: Sat, 14 Mar 2015 08:59:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r279937 - in head/sys/powerpc: include powerpc In-Reply-To: <20150313175931.GA2379@kib.kiev.ua> Message-ID: <20150314072700.T9601@besplex.bde.org> References: <201503122115.t2CLFdmi026986@svn.freebsd.org> <20150312212234.GS2379@kib.kiev.ua> <55020547.7050102@freebsd.org> <20150312213530.GT2379@kib.kiev.ua> <5502094D.5090001@freebsd.org> <20150313084702.GV2379@kib.kiev.ua> <550318FD.1070906@freebsd.org> <20150313172345.GY2379@kib.kiev.ua> <5503224A.3010100@freebsd.org> <20150313175931.GA2379@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=ZuzUdbLG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=KEVyZfeDWfrjil2CFhUA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2015 22:21:52 -0000 On Fri, 13 Mar 2015, Konstantin Belousov wrote: > On Fri, Mar 13, 2015 at 10:45:46AM -0700, Nathan Whitehorn wrote: >> We'll need to hack the compiler in this case, since it assumes setjmp() >> saves and restores the vector registers. I'm really not sure which >> option is worse. > > Changing the compiler is arguably much worse than breaking ABI of the > tier 2 platform, indeed. We must maintain the situation where the stock > build of the compilers work out of box. > > Still, how the compiler' assumptions are laid out ? It could be argued > that compilers on x86 also assume that FPU register file is restored by > longjmp. That would be a compiler bug. > %st* and %xmm* are defined as not preserved across function > calls, but I suspect that practical rule for setjmp() is that floating > vars better not be used in the target frame. Indeed. They are not call-saved for ordinary functions, and it would be stupid for the compiler to treat setjmp() differently, since setjmp() wants to clobber the registers even more than an ordinary functions. > Hm, indeed f14-f31 and v20-v31 are marked as non-volatile for 64bit ABI. Powerpc has zillions of call-saved registers (I know little about powerpc, but checked this in its gcc .md file). There are complications for the FP environment. setjmp() is specified to save "its" environoment and longjmp() is specified to restore the environment saved by setjmp(). Environments seem to be under-specified. Floating point has an state that is actually called an environment, but is this part of the execution environment? Anyway, it is clear that most call-saved parts of the FP environment should be saved and restored (so that longjmp from signal handlers has a chance of working), but the exception flags should not be restored (since restoring them would forget exceptions). x86 setjmp/longjump attempts to do this, but is still very buggy: - i386 _setjmp saves the i387 control word but not not the SSE control word (if any). This is the setjmp that doesn't save the signal mask. - i386 ___longjmp cannot restore the SSE control word since it was not saved. (_longjmp is a weak alias for ___longjmp. I don't know why _longjmp needs aliasing but _setjmp doesn't. Similarly for the other 5 *setjmp/*longjmp pairs in x86.) - to preserve (that is, _not_ restore) the exception flags, someone removed the fninit that I wrote in all the i386 longjmps. This broke: - cleaning up of the state. Especially the tag word. Cleaning is needed for at least longjmp() from FreeBSD-[1-4]-compat signal handlers which can be entered with any FP state - avoiding getting an exception when reloading the FP control word. The correct change is something like: fnstsw %ax fninit fstenv tmp(%esp) # set the pending-exception bit in %ax if there are any unmasked # exceptions for the _new_ cw, else clear it # store %ax in tmp env # copy saved cw from jmp_buf to tmp env fldenv tmp(%esp) # do related stuff for SSE (simpler) The trip through the tmp env is needed since there is no instruction to load the new status word from a registers; anyway, it would be difficult to load the cw and status word separately without risking a trap for one (fninit only cleans enough for the next instruction). - i386 setjmp and __longjmp are identically broken. - i386 sigsetjmp and __siglongjmp are not even identically broken. They used to be almost identical copies of setjmp and __longjmp (sigsetjmp == setjmp in BSD). They shouldn't exist except as strong aliases, but still do despite extensive use of weak aliases and namespace messes like the triply underscored ___longjmp. No one removed the fninit's from them. So they are missing most of the above bugs, but the exception flags are not preserved as intended. - amd64 _setjmp, setjmp, and sigsetjmp are OK, except for the existence of sigsetjmp as a non-alias. They do preserve mxcsr. The bug of the existence of the file containing sigsetjmp was copied perfectly from i386, including my comments in it saying why it should not exist. - amd64 ___longjmp does preserve SSE exceptions. This requires merging the current exceptions with the saved control word in mxcsr. SSE exceptions are synchronous, and ldmxcsr cannot trap, so I think it is not necessary to adjust the pending-exception flag (or there is no such flag in mxcsr). amd64 _longjmp then has the same bugs as i386 _longjmp restoring the i387 cw, tag word and pending-exception flag without trapping. - amd64 __longjmp is like amd64 ___longjmp. - amd64 __siglongjmp is not even like amd64 ___longjmp. No one removed the fninit there either. These details are of course arcane and rarely matter. I tested the old versions using longjmp from signal handlers. FreeBSD-[1-4] signal handlers get the interrupted FP context. One interesting case is when the compiler temporarily changes the rounding mode. This may be interrupted by even a non-FP related signal like SIGINT. For longjmp to work, it must switch to the default rounding mode. Now (at least on x86), signal handlers get a clean state and longjmp doesn't need to do this particular cleaning (except in when mixing with old libraries that use old signal handlers). But fenv support for C99 makes things more complicated -- it isn't clear if the state set by an fenv call should be cleaned. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 00:02:54 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A929FAD5; Sat, 14 Mar 2015 00:02:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 955DAC00; Sat, 14 Mar 2015 00:02:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2E02s8F092806; Sat, 14 Mar 2015 00:02:54 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2E02svt092805; Sat, 14 Mar 2015 00:02:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <201503140002.t2E02svt092805@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 14 Mar 2015 00:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279969 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 00:02:54 -0000 Author: np Date: Sat Mar 14 00:02:53 2015 New Revision: 279969 URL: https://svnweb.freebsd.org/changeset/base/279969 Log: cxgbe(4): fix if_media handling for T520-BT cards. 1Gbps and 100Mbps are valid for this card. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Mar 13 21:01:25 2015 (r279968) +++ head/sys/dev/cxgbe/t4_main.c Sat Mar 14 00:02:53 2015 (r279969) @@ -2895,9 +2895,6 @@ build_medialist(struct port_info *pi, st switch(pi->port_type) { case FW_PORT_TYPE_BT_XFI: - ifmedia_add(media, m | IFM_10G_T, data, NULL); - break; - case FW_PORT_TYPE_BT_XAUI: ifmedia_add(media, m | IFM_10G_T, data, NULL); /* fall through */ From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 00:30:43 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0996B3; Sat, 14 Mar 2015 00:30:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 DBD01DE1; Sat, 14 Mar 2015 00:30:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2E0UgX7003600; Sat, 14 Mar 2015 00:30:42 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2E0Ugpf003597; Sat, 14 Mar 2015 00:30:42 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201503140030.t2E0Ugpf003597@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 14 Mar 2015 00:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279970 - in head/sys/x86: include x86 xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 00:30:43 -0000 Author: neel Date: Sat Mar 14 00:30:41 2015 New Revision: 279970 URL: https://svnweb.freebsd.org/changeset/base/279970 Log: Add x86 specific APIs 'lapic_ipi_alloc()' and 'lapic_ipi_free()' to allow IPI vectors to be dynamically allocated. This allows kernel modules like vmm.ko to allocate unique IPI slots when loaded (as opposed to hard allocating one or more vectors). Also, reorganize the fixed IPI vectors to create a contiguous space for dynamic IPI allocation. Reviewed by: kib, jhb Differential Revision: https://reviews.freebsd.org/D2042 Modified: head/sys/x86/include/apicvar.h head/sys/x86/x86/local_apic.c head/sys/x86/xen/xen_apic.c Modified: head/sys/x86/include/apicvar.h ============================================================================== --- head/sys/x86/include/apicvar.h Sat Mar 14 00:02:53 2015 (r279969) +++ head/sys/x86/include/apicvar.h Sat Mar 14 00:30:41 2015 (r279970) @@ -111,11 +111,8 @@ #define IPI_INVLPG (APIC_IPI_INTS + 2) #define IPI_INVLRNG (APIC_IPI_INTS + 3) #define IPI_INVLCACHE (APIC_IPI_INTS + 4) -#ifdef __i386__ -#define IPI_LAZYPMAP (APIC_IPI_INTS + 5) /* Lazy pmap release. */ -#endif /* Vector to handle bitmap based IPIs */ -#define IPI_BITMAP_VECTOR (APIC_IPI_INTS + 6) +#define IPI_BITMAP_VECTOR (APIC_IPI_INTS + 5) /* IPIs handled by IPI_BITMAP_VECTOR */ #define IPI_AST 0 /* Generate software trap. */ @@ -124,8 +121,15 @@ #define IPI_BITMAP_LAST IPI_HARDCLOCK #define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) -#define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ -#define IPI_SUSPEND (APIC_IPI_INTS + 8) /* Suspend CPU until restarted. */ +#define IPI_STOP (APIC_IPI_INTS + 6) /* Stop CPU until restarted. */ +#define IPI_SUSPEND (APIC_IPI_INTS + 7) /* Suspend CPU until restarted. */ +#ifdef __i386__ +#define IPI_LAZYPMAP (APIC_IPI_INTS + 8) /* Lazy pmap release. */ +#define IPI_DYN_FIRST (APIC_IPI_INTS + 9) +#else +#define IPI_DYN_FIRST (APIC_IPI_INTS + 8) +#endif +#define IPI_DYN_LAST (254) /* IPIs allocated at runtime */ /* * IPI_STOP_HARD does not need to occupy a slot in the IPI vector space since @@ -224,6 +228,8 @@ struct apic_ops { void (*ipi_raw)(register_t, u_int); void (*ipi_vectored)(u_int, int); int (*ipi_wait)(int); + int (*ipi_alloc)(inthand_t *ipifunc); + void (*ipi_free)(int vector); /* LVT */ int (*set_lvt_mask)(u_int, u_int, u_char); @@ -397,6 +403,20 @@ lapic_ipi_wait(int delay) } static inline int +lapic_ipi_alloc(inthand_t *ipifunc) +{ + + return (apic_ops.ipi_alloc(ipifunc)); +} + +static inline void +lapic_ipi_free(int vector) +{ + + return (apic_ops.ipi_free(vector)); +} + +static inline int lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked) { Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Sat Mar 14 00:02:53 2015 (r279969) +++ head/sys/x86/x86/local_apic.c Sat Mar 14 00:30:41 2015 (r279970) @@ -303,6 +303,8 @@ static int native_lapic_set_lvt_polarit enum intr_polarity pol); static int native_lapic_set_lvt_triggermode(u_int apic_id, u_int lvt, enum intr_trigger trigger); +static int native_lapic_ipi_alloc(inthand_t *ipifunc); +static void native_lapic_ipi_free(int vector); struct apic_ops apic_ops = { .create = native_lapic_create, @@ -329,6 +331,8 @@ struct apic_ops apic_ops = { .ipi_raw = native_lapic_ipi_raw, .ipi_vectored = native_lapic_ipi_vectored, .ipi_wait = native_lapic_ipi_wait, + .ipi_alloc = native_lapic_ipi_alloc, + .ipi_free = native_lapic_ipi_free, #endif .set_lvt_mask = native_lapic_set_lvt_mask, .set_lvt_mode = native_lapic_set_lvt_mode, @@ -1761,4 +1765,60 @@ native_lapic_ipi_vectored(u_int vector, } #endif /* DETECT_DEADLOCK */ } + +/* + * Since the IDT is shared by all CPUs the IPI slot update needs to be globally + * visible. + * + * Consider the case where an IPI is generated immediately after allocation: + * vector = lapic_ipi_alloc(ipifunc); + * ipi_selected(other_cpus, vector); + * + * In xAPIC mode a write to ICR_LO has serializing semantics because the + * APIC page is mapped as an uncached region. In x2APIC mode there is an + * explicit 'mfence' before the ICR MSR is written. Therefore in both cases + * the IDT slot update is globally visible before the IPI is delivered. + */ +static int +native_lapic_ipi_alloc(inthand_t *ipifunc) +{ + struct gate_descriptor *ip; + long func; + int idx, vector; + + KASSERT(ipifunc != &IDTVEC(rsvd), ("invalid ipifunc %p", ipifunc)); + + vector = -1; + mtx_lock_spin(&icu_lock); + for (idx = IPI_DYN_FIRST; idx <= IPI_DYN_LAST; idx++) { + ip = &idt[idx]; + func = (ip->gd_hioffset << 16) | ip->gd_looffset; + if (func == (uintptr_t)&IDTVEC(rsvd)) { + vector = idx; + setidt(vector, ipifunc, SDT_APIC, SEL_KPL, GSEL_APIC); + break; + } + } + mtx_unlock_spin(&icu_lock); + return (vector); +} + +static void +native_lapic_ipi_free(int vector) +{ + struct gate_descriptor *ip; + long func; + + KASSERT(vector >= IPI_DYN_FIRST && vector <= IPI_DYN_LAST, + ("%s: invalid vector %d", __func__, vector)); + + mtx_lock_spin(&icu_lock); + ip = &idt[vector]; + func = (ip->gd_hioffset << 16) | ip->gd_looffset; + KASSERT(func != (uintptr_t)&IDTVEC(rsvd), + ("invalid idtfunc %#lx", func)); + setidt(vector, &IDTVEC(rsvd), SDT_APICT, SEL_KPL, GSEL_APIC); + mtx_unlock_spin(&icu_lock); +} + #endif /* SMP */ Modified: head/sys/x86/xen/xen_apic.c ============================================================================== --- head/sys/x86/xen/xen_apic.c Sat Mar 14 00:02:53 2015 (r279969) +++ head/sys/x86/xen/xen_apic.c Sat Mar 14 00:30:41 2015 (r279970) @@ -311,7 +311,22 @@ xen_pv_lapic_ipi_wait(int delay) XEN_APIC_UNSUPPORTED; return (0); } -#endif + +static int +xen_pv_lapic_ipi_alloc(inthand_t *ipifunc) +{ + + XEN_APIC_UNSUPPORTED; + return (-1); +} + +static void +xen_pv_lapic_ipi_free(int vector) +{ + + XEN_APIC_UNSUPPORTED; +} +#endif /* SMP */ static int xen_pv_lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked) @@ -372,6 +387,8 @@ struct apic_ops xen_apic_ops = { .ipi_raw = xen_pv_lapic_ipi_raw, .ipi_vectored = xen_pv_lapic_ipi_vectored, .ipi_wait = xen_pv_lapic_ipi_wait, + .ipi_alloc = xen_pv_lapic_ipi_alloc, + .ipi_free = xen_pv_lapic_ipi_free, #endif .set_lvt_mask = xen_pv_lapic_set_lvt_mask, .set_lvt_mode = xen_pv_lapic_set_lvt_mode, From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 02:32:12 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 234A1E41; Sat, 14 Mar 2015 02:32:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 0D67EB6B; Sat, 14 Mar 2015 02:32:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2E2WBPR062486; Sat, 14 Mar 2015 02:32:11 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2E2W9VJ062472; Sat, 14 Mar 2015 02:32:09 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201503140232.t2E2W9VJ062472@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 14 Mar 2015 02:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279971 - in head/sys: amd64/amd64 amd64/include amd64/vmm amd64/vmm/intel amd64/vmm/io modules/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 02:32:12 -0000 Author: neel Date: Sat Mar 14 02:32:08 2015 New Revision: 279971 URL: https://svnweb.freebsd.org/changeset/base/279971 Log: Use lapic_ipi_alloc() to dynamically allocate IPI slots needed by bhyve when vmm.ko is loaded. Also relocate the 'justreturn' IPI handler to be alongside all other handlers. Requested by: kib Deleted: head/sys/amd64/vmm/vmm_ipi.c head/sys/amd64/vmm/vmm_ipi.h head/sys/amd64/vmm/vmm_support.S Modified: head/sys/amd64/amd64/apic_vector.S head/sys/amd64/include/smp.h head/sys/amd64/vmm/intel/ept.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_lapic.c head/sys/modules/vmm/Makefile Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Sat Mar 14 00:30:41 2015 (r279970) +++ head/sys/amd64/amd64/apic_vector.S Sat Mar 14 02:32:08 2015 (r279971) @@ -301,4 +301,35 @@ IDTVEC(rendezvous) call smp_rendezvous_action call as_lapic_eoi jmp doreti + +/* + * IPI handler whose purpose is to interrupt the CPU with minimum overhead. + * This is used by bhyve to force a host cpu executing in guest context to + * trap into the hypervisor. + * + * This handler is different from other IPI handlers in the following aspects: + * + * 1. It doesn't push a trapframe on the stack. + * + * This implies that a DDB backtrace involving 'justreturn' will skip the + * function that was interrupted by this handler. + * + * 2. It doesn't 'swapgs' when userspace is interrupted. + * + * The 'justreturn' handler does not access any pcpu data so it is not an + * issue. Moreover the 'justreturn' handler can only be interrupted by an NMI + * whose handler already doesn't trust GS.base when kernel code is interrupted. + */ + .text + SUPERALIGN_TEXT +IDTVEC(justreturn) + pushq %rax + pushq %rcx + pushq %rdx + call as_lapic_eoi + popq %rdx + popq %rcx + popq %rax + jmp doreti_iret + #endif /* SMP */ Modified: head/sys/amd64/include/smp.h ============================================================================== --- head/sys/amd64/include/smp.h Sat Mar 14 00:30:41 2015 (r279970) +++ head/sys/amd64/include/smp.h Sat Mar 14 02:32:08 2015 (r279971) @@ -54,6 +54,7 @@ inthand_t IDTVEC(ipi_intr_bitmap_handler), /* Bitmap based IPIs */ IDTVEC(cpustop), /* CPU stops & waits to be restarted */ IDTVEC(cpususpend), /* CPU suspends & waits to be resumed */ + IDTVEC(justreturn), /* interrupt CPU with minimum overhead */ IDTVEC(rendezvous); /* handle CPU rendezvous */ struct pmap; Modified: head/sys/amd64/vmm/intel/ept.c ============================================================================== --- head/sys/amd64/vmm/intel/ept.c Sat Mar 14 00:30:41 2015 (r279970) +++ head/sys/amd64/vmm/intel/ept.c Sat Mar 14 02:32:08 2015 (r279971) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include "vmx_cpufunc.h" -#include "vmm_ipi.h" #include "ept.h" #define EPT_SUPPORTS_EXEC_ONLY(cap) ((cap) & (1UL << 0)) Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Mar 14 00:30:41 2015 (r279970) +++ head/sys/amd64/vmm/intel/vmx.c Sat Mar 14 02:32:08 2015 (r279971) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include "vmm_lapic.h" #include "vmm_host.h" #include "vmm_ioport.h" -#include "vmm_ipi.h" #include "vmm_ktr.h" #include "vmm_stat.h" #include "vatpic.h" @@ -175,7 +174,7 @@ static int posted_interrupts; SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, posted_interrupts, CTLFLAG_RD, &posted_interrupts, 0, "APICv posted interrupt support"); -static int pirvec; +static int pirvec = -1; SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, posted_interrupt_vector, CTLFLAG_RD, &pirvec, 0, "APICv posted interrupt vector"); @@ -485,8 +484,8 @@ static int vmx_cleanup(void) { - if (pirvec != 0) - vmm_ipi_free(pirvec); + if (pirvec >= 0) + lapic_ipi_free(pirvec); if (vpid_unr != NULL) { delete_unrhdr(vpid_unr); @@ -694,8 +693,8 @@ vmx_init(int ipinum) MSR_VMX_TRUE_PINBASED_CTLS, PINBASED_POSTED_INTERRUPT, 0, &tmp); if (error == 0) { - pirvec = vmm_ipi_alloc(); - if (pirvec == 0) { + pirvec = lapic_ipi_alloc(&IDTVEC(justreturn)); + if (pirvec < 0) { if (bootverbose) { printf("vmx_init: unable to allocate " "posted interrupt vector\n"); Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Sat Mar 14 00:30:41 2015 (r279970) +++ head/sys/amd64/vmm/io/vlapic.c Sat Mar 14 02:32:08 2015 (r279971) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include -#include "vmm_ipi.h" #include "vmm_lapic.h" #include "vmm_ktr.h" #include "vmm_stat.h" Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat Mar 14 00:30:41 2015 (r279970) +++ head/sys/amd64/vmm/vmm.c Sat Mar 14 02:32:08 2015 (r279971) @@ -76,7 +76,6 @@ __FBSDID("$FreeBSD$"); #include "vlapic.h" #include "vpmtmr.h" #include "vrtc.h" -#include "vmm_ipi.h" #include "vmm_stat.h" #include "vmm_lapic.h" @@ -298,8 +297,8 @@ vmm_init(void) vmm_host_state_init(); - vmm_ipinum = vmm_ipi_alloc(); - if (vmm_ipinum == 0) + vmm_ipinum = lapic_ipi_alloc(&IDTVEC(justreturn)); + if (vmm_ipinum < 0) vmm_ipinum = IPI_AST; error = vmm_mem_init(); @@ -338,7 +337,7 @@ vmm_handler(module_t mod, int what, void vmm_resume_p = NULL; iommu_cleanup(); if (vmm_ipinum != IPI_AST) - vmm_ipi_free(vmm_ipinum); + lapic_ipi_free(vmm_ipinum); error = VMM_CLEANUP(); /* * Something bad happened - prevent new Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Sat Mar 14 00:30:41 2015 (r279970) +++ head/sys/amd64/vmm/vmm_lapic.c Sat Mar 14 02:32:08 2015 (r279971) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "vmm_ipi.h" #include "vmm_ktr.h" #include "vmm_lapic.h" #include "vlapic.h" Modified: head/sys/modules/vmm/Makefile ============================================================================== --- head/sys/modules/vmm/Makefile Sat Mar 14 00:30:41 2015 (r279970) +++ head/sys/modules/vmm/Makefile Sat Mar 14 02:32:08 2015 (r279971) @@ -19,13 +19,11 @@ SRCS+= vmm.c \ vmm_host.c \ vmm_instruction_emul.c \ vmm_ioport.c \ - vmm_ipi.c \ vmm_lapic.c \ vmm_mem.c \ vmm_stat.c \ vmm_util.c \ - x86.c \ - vmm_support.S + x86.c .PATH: ${.CURDIR}/../../amd64/vmm/io SRCS+= iommu.c \ From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 07:59:56 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 410D9B12; Sat, 14 Mar 2015 07:59:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 2B8A9E99; Sat, 14 Mar 2015 07:59:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2E7xtvC013469; Sat, 14 Mar 2015 07:59:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2E7xtdi013467; Sat, 14 Mar 2015 07:59:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503140759.t2E7xtdi013467@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 Mar 2015 07:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279972 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 07:59:56 -0000 Author: adrian Date: Sat Mar 14 07:59:54 2015 New Revision: 279972 URL: https://svnweb.freebsd.org/changeset/base/279972 Log: Add board support for the TP-Link TL-WR1043nd v2. This is a QCA9558 based design with on-chip 2GHz 3x3 11n wifi, AR8327N switch, 64MB RAM and 8MB flash. Of course, it runs FreeBSD. Added: head/sys/mips/conf/TL-WR1043NDv2 (contents, props changed) head/sys/mips/conf/TL-WR1043NDv2.hints (contents, props changed) Added: head/sys/mips/conf/TL-WR1043NDv2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/TL-WR1043NDv2 Sat Mar 14 07:59:54 2015 (r279972) @@ -0,0 +1,51 @@ +# +# TP-Link TL-WR1043nd v2 - based on the AP135 reference design. +# +# This contains a QCA9558 MIPS74k SoC with on-board 3x3 2GHz wifi, +# 64MiB RAM and an AR8327 5-port gigabit ethernet switch. +# +# $FreeBSD$ +# + +# Include the default QCA955x parameters +include "QCA955X_BASE" + +ident TL-WR1043NDv2 + +# Override hints with board values +hints "TL-WR1043NDv2.hints" + +options AR71XX_REALMEM=(64*1024*1024) + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch + +# read MSDOS formatted disks - USB +options MSDOSFS + +# Enable the uboot environment stuff rather then the +# redboot stuff. +options AR71XX_ENV_UBOOT + +# uzip - to boot natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS + +# Used for the static uboot partition map +device geom_map + +# yes, this board has a PCI connected atheros device +#device ath_pci +#options AR71XX_ATH_EEPROM +#device firmware # Used by the above +#options ATH_EEPROM_FIRMWARE + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" + +# Default to accept +options IPFIREWALL_DEFAULT_TO_ACCEPT Added: head/sys/mips/conf/TL-WR1043NDv2.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/TL-WR1043NDv2.hints Sat Mar 14 07:59:54 2015 (r279972) @@ -0,0 +1,149 @@ +# The TP-Link 1043NDv2 is based on the AP135 with a couple of minor +# differences - well, besides having no 11ac. + +# $FreeBSD$ + +# QCA955X_ETH_CFG_RGMII_EN (1 << 0) +hint.qca955x_gmac.0.gmac_cfg=0x1 + +# mdiobus0 on arge0 +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x19000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# mdiobus1 on arge1 - required to bring up arge1? +hint.argemdio.1.at="nexus0" +hint.argemdio.1.maddr=0x1a000000 +hint.argemdio.1.msize=0x1000 +hint.argemdio.1.order=0 + +# AR8327 - connected via mdiobus0 on arge0 +hint.arswitch.0.at="mdio0" +hint.arswitch.0.is_7240=0 # definitely not the internal switch! +hint.arswitch.0.is_9340=0 # not the internal switch! +hint.arswitch.0.numphys=5 # all ports are PHYs +hint.arswitch.0.phy4cpu=0 +hint.arswitch.0.is_rgmii=0 # not needed +hint.arswitch.0.is_gmii=0 # not needed + +# This is where it gets a bit odd. port 0 and port 6 are CPU ports. +# The current code only supports one CPU port. So hm, what should +# we do to hook PAD6 up to be RGMII but a PHY, not a MAC? + +# The other trick - how do we get arge1 (hooked up to GMAC0) to work? +# That's currently supposed to be hooked up to CPU port 0. + +# Other AR8327 configuration parameters + +# AP136-020 parameters + +# GMAC0 AR8327 -> GMAC1 (arge1) SoC, SGMII + +# AR8327_PAD_MAC_SGMII +hint.arswitch.0.pad.0.mode=3 +#hint.arswitch.0.pad.0.rxclk_delay_sel=0 +hint.arswitch.0.pad.0.sgmii_delay_en=1 + +# GMAC6 AR8327 -> GMAC0 (arge0) SoC, RGMII + +# AR8327_PAD_MAC_RGMII +hint.arswitch.0.pad.6.mode=6 +hint.arswitch.0.pad.6.txclk_delay_en=1 +hint.arswitch.0.pad.6.rxclk_delay_en=1 +# AR8327_CLK_DELAY_SEL1 +hint.arswitch.0.pad.6.txclk_delay_sel=1 +# AR8327_CLK_DELAY_SEL2 +hint.arswitch.0.pad.6.rxclk_delay_sel=2 + +hint.arswitch.0.led.ctrl0=0xcc35cc35 +hint.arswitch.0.led.ctrl1=0xca35ca35 +hint.arswitch.0.led.ctrl2=0xc935c935 +hint.arswitch.0.led.ctrl3=0x03ffff00 +int.arswitch.0.led.open_drain=1 + +# force_link=1 is required for the rest of the parameters +# to be configured. +hint.arswitch.0.port.0.force_link=1 +hint.arswitch.0.port.0.speed=1000 +hint.arswitch.0.port.0.duplex=1 +hint.arswitch.0.port.0.txpause=1 +hint.arswitch.0.port.0.rxpause=1 + +# force_link=1 is required for the rest of the parameters +# to be configured. +hint.arswitch.0.port.6.force_link=1 +hint.arswitch.0.port.6.speed=1000 +hint.arswitch.0.port.6.duplex=1 +hint.arswitch.0.port.6.txpause=1 +hint.arswitch.0.port.6.rxpause=1 + +# arge0 - hooked up to AR8327 GMAC6, RGMII +# set at 1000/full to the switch. +# so, lock both sides of this connect up to 1000/full; +# if_arge thus wont change the PLL configuration +# upon a link status change. +hint.arge.0.phymask=0x0 +hint.arge.0.miimode=3 # RGMII +hint.arge.0.media=1000 +hint.arge.0.fduplex=1 +hint.arge.0.pll_1000=0x56000000 + +hint.arge.0.eeprommac=0x1f01fc00 + +# arge1 - lock up to 1000/full +hint.arge.1.phymask=0x0 +hint.arge.1.media=1000 +hint.arge.1.fduplex=1 +hint.arge.1.miimode=5 # SGMII +hint.arge.1.pll_1000=0x03000101 + +# hint.arge.1.eeprommac=0x1f01fc06 + +# ath0: Where the ART is - last 64k in the flash +hint.ath.0.eepromaddr=0x1fff0000 +hint.ath.0.eepromsize=16384 + +# 128 KiB u-boot +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00020000 # 128k u-boot +hint.map.0.name="u-boot" +hint.map.0.readonly=1 + +# The TP-Link firmware will put the kernel first (variable size); +# then the rootfs will be placed hopefully at a 64KiB alignment +# by whatever calls mktplinkfw. + +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00020000 +hint.map.1.end="search:0x00020000:0x10000:.!/bin/sh" +hint.map.1.name="kernel" +hint.map.1.readonly=1 + +hint.map.2.at="flash/spi0" +hint.map.2.start="search:0x00020000:0x10000:.!/bin/sh" +hint.map.2.end=0x007d0000 +hint.map.2.name="rootfs" +hint.map.2.readonly=1 + +# 64KiB cfg +hint.map.3.at="flash/spi0" +hint.map.3.start=0x007d0000 +hint.map.3.end=0x007e0000 +hint.map.3.name="cfg" +hint.map.3.readonly=0 + +# 64KiB mib0 +hint.map.4.at="flash/spi0" +hint.map.4.start=0x007e0000 +hint.map.4.end=0x007f0000 +hint.map.4.name="mib0" +hint.map.4.readonly=1 + +# 64KiB ART +hint.map.5.at="flash/spi0" +hint.map.5.start=0x007f0000 +hint.map.5.end=0x00800000 # 64k ART +hint.map.5.name="ART" +hint.map.5.readonly=1 From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 08:29:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEA47F7D; Sat, 14 Mar 2015 08:29:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 A9A4D1DE; Sat, 14 Mar 2015 08:29:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2E8T4mh027481; Sat, 14 Mar 2015 08:29:04 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2E8T4JB027480; Sat, 14 Mar 2015 08:29:04 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503140829.t2E8T4JB027480@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 Mar 2015 08:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279973 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 08:29:04 -0000 Author: adrian Date: Sat Mar 14 08:29:03 2015 New Revision: 279973 URL: https://svnweb.freebsd.org/changeset/base/279973 Log: Compile some modules - I'm going to eventually just compile all the modules, but these are a subset of things that are worth playing with in deployed APs. (ipfw in particular is rather nice.) Modified: head/sys/mips/conf/QCA955X_BASE Modified: head/sys/mips/conf/QCA955X_BASE ============================================================================== --- head/sys/mips/conf/QCA955X_BASE Sat Mar 14 07:59:54 2015 (r279972) +++ head/sys/mips/conf/QCA955X_BASE Sat Mar 14 08:29:03 2015 (r279973) @@ -27,7 +27,7 @@ hints "QCA955X_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols # makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_ahb hwpmc" -makeoptions MODULES_OVERRIDE="" +makeoptions MODULES_OVERRIDE="if_vlan ipfw if_gre if_gif if_bridge bridgestp hwpmc" options DDB options KDB From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 08:45:55 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B048B38E; Sat, 14 Mar 2015 08:45:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 9BED0388; Sat, 14 Mar 2015 08:45:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2E8jtQg036570; Sat, 14 Mar 2015 08:45:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2E8jtTY036569; Sat, 14 Mar 2015 08:45:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503140845.t2E8jtTY036569@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Mar 2015 08:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279975 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 08:45:55 -0000 Author: mav Date: Sat Mar 14 08:45:54 2015 New Revision: 279975 URL: https://svnweb.freebsd.org/changeset/base/279975 Log: Improve NCQ errors reporting for virtual AHCI disks. While this implementation is still not perfect, previous was just broken. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Sat Mar 14 08:42:40 2015 (r279974) +++ head/usr.sbin/bhyve/pci_ahci.c Sat Mar 14 08:45:54 2015 (r279975) @@ -134,6 +134,7 @@ struct ahci_port { int reset; int mult_sectors; uint8_t xfermode; + uint8_t err_cfis[20]; uint8_t sense_key; uint8_t asc; uint32_t pending; @@ -299,18 +300,27 @@ ahci_write_fis_piosetup(struct ahci_port } static void -ahci_write_fis_sdb(struct ahci_port *p, int slot, uint32_t tfd) +ahci_write_fis_sdb(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t tfd) { uint8_t fis[8]; uint8_t error; error = (tfd >> 8) & 0xff; memset(fis, 0, sizeof(fis)); - fis[0] = error; + fis[0] = FIS_TYPE_SETDEVBITS; + fis[1] = (1 << 6); fis[2] = tfd & 0x77; - *(uint32_t *)(fis + 4) = (1 << slot); - if (fis[2] & ATA_S_ERROR) + fis[3] = error; + if (fis[2] & ATA_S_ERROR) { p->is |= AHCI_P_IX_TFE; + p->err_cfis[0] = slot; + p->err_cfis[2] = tfd & 0x77; + p->err_cfis[3] = error; + memcpy(&p->err_cfis[4], cfis + 4, 16); + } else { + *(uint32_t *)(fis + 4) = (1 << slot); + p->sact &= ~(1 << slot); + } p->tfd = tfd; ahci_write_fis(p, FIS_TYPE_SETDEVBITS, fis); } @@ -337,9 +347,13 @@ ahci_write_fis_d2h(struct ahci_port *p, fis[11] = cfis[11]; fis[12] = cfis[12]; fis[13] = cfis[13]; - if (fis[2] & ATA_S_ERROR) + if (fis[2] & ATA_S_ERROR) { p->is |= AHCI_P_IX_TFE; - else + p->err_cfis[0] = 0x80; + p->err_cfis[2] = tfd & 0xff; + p->err_cfis[3] = error; + memcpy(&p->err_cfis[4], cfis + 4, 16); + } else p->ci &= ~(1 << slot); p->tfd = tfd; ahci_write_fis(p, FIS_TYPE_REGD2H, fis); @@ -774,6 +788,29 @@ write_prdt(struct ahci_port *p, int slot } static void +ahci_handle_read_log(struct ahci_port *p, int slot, uint8_t *cfis) +{ + struct ahci_cmd_hdr *hdr; + uint8_t buf[512]; + + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); + if (p->atapi || hdr->prdtl == 0 || cfis[4] != 0x10 || + cfis[5] != 0 || cfis[9] != 0 || cfis[12] != 1 || cfis[13] != 0) { + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); + return; + } + + memset(buf, 0, sizeof(buf)); + memcpy(buf, p->err_cfis, sizeof(p->err_cfis)); + + if (cfis[2] == ATA_READ_LOG_EXT) + ahci_write_fis_piosetup(p); + write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); +} + +static void handle_identify(struct ahci_port *p, int slot, uint8_t *cfis) { struct ahci_cmd_hdr *hdr; @@ -839,7 +876,7 @@ handle_identify(struct ahci_port *p, int buf[85] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); buf[86] = (ATA_SUPPORT_ADDRESS48 | ATA_SUPPORT_FLUSHCACHE | - ATA_SUPPORT_FLUSHCACHE48); + ATA_SUPPORT_FLUSHCACHE48 | 1 << 15); buf[87] = (1 << 14); buf[88] = 0x7f; if (p->xfermode & ATA_UDMA0) @@ -866,6 +903,8 @@ handle_identify(struct ahci_port *p, int buf[117] = sectsz / 2; buf[118] = ((sectsz / 2) >> 16); } + buf[119] = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); + buf[120] = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); buf[222] = 0x1020; ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); @@ -1522,6 +1561,10 @@ ahci_handle_cmd(struct ahci_port *p, int ahci_write_fis_d2h(p, slot, cfis, (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); break; + case ATA_READ_LOG_EXT: + case ATA_READ_LOG_DMA_EXT: + ahci_handle_read_log(p, slot, cfis); + break; case ATA_STANDBY_CMD: break; case ATA_NOP: @@ -1684,10 +1727,9 @@ ata_ioreq_cb(struct blockif_req *br, int tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; } - if (ncq) { - p->sact &= ~(1 << slot); - ahci_write_fis_sdb(p, slot, tfd); - } else + if (ncq) + ahci_write_fis_sdb(p, slot, cfis, tfd); + else ahci_write_fis_d2h(p, slot, cfis, tfd); /* From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 09:46:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60FC4D62; Sat, 14 Mar 2015 09:46:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 32B77AE9; Sat, 14 Mar 2015 09:46:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2E9kiG7064528; Sat, 14 Mar 2015 09:46:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2E9ki5u064527; Sat, 14 Mar 2015 09:46:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503140946.t2E9ki5u064527@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Mar 2015 09:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279976 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 09:46:44 -0000 Author: mav Date: Sat Mar 14 09:46:43 2015 New Revision: 279976 URL: https://svnweb.freebsd.org/changeset/base/279976 Log: Add support for NCQ variant of DSM TRIM for virtual AHCI disks. The code is not really tested yet due to lack of initiator support. Requested by: imp MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Sat Mar 14 08:45:54 2015 (r279975) +++ head/usr.sbin/bhyve/pci_ahci.c Sat Mar 14 09:46:43 2015 (r279976) @@ -703,8 +703,13 @@ ahci_handle_dsm_trim(struct ahci_port *p int err; uint8_t buf[512]; - len = (uint16_t)cfis[13] << 8 | cfis[12]; - len *= 512; + if (cfis[2] == ATA_DATA_SET_MANAGEMENT) { + len = (uint16_t)cfis[13] << 8 | cfis[12]; + len *= 512; + } else { /* ATA_SEND_FPDMA_QUEUED */ + len = (uint16_t)cfis[11] << 8 | cfis[3]; + len *= 512; + } read_prdt(p, slot, cfis, buf, sizeof(buf)); next: @@ -866,6 +871,8 @@ handle_identify(struct ahci_port *p, int buf[75] = 31; buf[76] = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | ATA_SATA_GEN3 | ATA_SUPPORT_NCQ); + buf[77] = (ATA_SUPPORT_RCVSND_FPDMA_QUEUED | + (p->ssts & ATA_SS_SPD_MASK) >> 3); buf[80] = 0x1f0; buf[81] = 0x28; buf[82] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| @@ -1561,6 +1568,16 @@ ahci_handle_cmd(struct ahci_port *p, int ahci_write_fis_d2h(p, slot, cfis, (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); break; + case ATA_SEND_FPDMA_QUEUED: + if ((cfis[13] & 0x1f) == ATA_SFPDMA_DSM && + cfis[17] == 0 && cfis[16] == ATA_DSM_TRIM && + cfis[11] == 0 && cfis[13] == 1) { + ahci_handle_dsm_trim(p, slot, cfis, 0); + break; + } + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); + break; case ATA_READ_LOG_EXT: case ATA_READ_LOG_DMA_EXT: ahci_handle_read_log(p, slot, cfis); @@ -1688,9 +1705,12 @@ ata_ioreq_cb(struct blockif_req *br, int hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); if (cfis[2] == ATA_WRITE_FPDMA_QUEUED || - cfis[2] == ATA_READ_FPDMA_QUEUED) + cfis[2] == ATA_READ_FPDMA_QUEUED || + cfis[2] == ATA_SEND_FPDMA_QUEUED) ncq = 1; - if (cfis[2] == ATA_DATA_SET_MANAGEMENT) + if (cfis[2] == ATA_DATA_SET_MANAGEMENT || + (cfis[2] == ATA_SEND_FPDMA_QUEUED && + (cfis[13] & 0x1f) == ATA_SFPDMA_DSM)) dsm = 1; pthread_mutex_lock(&sc->mtx); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 10:38:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 167024DD; Sat, 14 Mar 2015 10:38:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 023BCF2D; Sat, 14 Mar 2015 10:38:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EAcQlP088264; Sat, 14 Mar 2015 10:38:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EAcQ8C088263; Sat, 14 Mar 2015 10:38:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503141038.t2EAcQ8C088263@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Mar 2015 10:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279977 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 10:38:27 -0000 Author: mav Date: Sat Mar 14 10:38:25 2015 New Revision: 279977 URL: https://svnweb.freebsd.org/changeset/base/279977 Log: Fix NOP and IDLE commands for virtual AHCI disks. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Sat Mar 14 09:46:43 2015 (r279976) +++ head/usr.sbin/bhyve/pci_ahci.c Sat Mar 14 10:38:25 2015 (r279977) @@ -1582,10 +1582,13 @@ ahci_handle_cmd(struct ahci_port *p, int case ATA_READ_LOG_DMA_EXT: ahci_handle_read_log(p, slot, cfis); break; - case ATA_STANDBY_CMD: - break; case ATA_NOP: + ahci_write_fis_d2h(p, slot, cfis, + (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); + break; + case ATA_STANDBY_CMD: case ATA_STANDBY_IMMEDIATE: + case ATA_IDLE_CMD: case ATA_IDLE_IMMEDIATE: case ATA_SLEEP: ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 12:18:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76628A4F; Sat, 14 Mar 2015 12:18:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 624C8A97; Sat, 14 Mar 2015 12:18:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ECIQ8B035593; Sat, 14 Mar 2015 12:18:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ECIQ4v035591; Sat, 14 Mar 2015 12:18:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503141218.t2ECIQ4v035591@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Mar 2015 12:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279979 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 12:18:27 -0000 Author: mav Date: Sat Mar 14 12:18:26 2015 New Revision: 279979 URL: https://svnweb.freebsd.org/changeset/base/279979 Log: Slightly polish virtual AHCI CD reporting. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Sat Mar 14 11:36:47 2015 (r279978) +++ head/usr.sbin/bhyve/pci_ahci.c Sat Mar 14 12:18:26 2015 (r279979) @@ -86,6 +86,7 @@ enum sata_fis_type { #define READ_TOC 0x43 #define GET_EVENT_STATUS_NOTIFICATION 0x4A #define MODE_SENSE_10 0x5A +#define REPORT_LUNS 0xA0 #define READ_12 0xA8 #define READ_CD 0xBE @@ -873,7 +874,7 @@ handle_identify(struct ahci_port *p, int ATA_SUPPORT_NCQ); buf[77] = (ATA_SUPPORT_RCVSND_FPDMA_QUEUED | (p->ssts & ATA_SS_SPD_MASK) >> 3); - buf[80] = 0x1f0; + buf[80] = 0x3f0; buf[81] = 0x28; buf[82] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); @@ -939,20 +940,28 @@ handle_atapi_identify(struct ahci_port * buf[53] = (1 << 2 | 1 << 1); buf[62] = 0x3f; buf[63] = 7; + if (p->xfermode & ATA_WDMA0) + buf[63] |= (1 << ((p->xfermode & 7) + 8)); buf[64] = 3; - buf[65] = 100; - buf[66] = 100; - buf[67] = 100; - buf[68] = 100; - buf[76] = (1 << 2 | 1 << 1); + buf[65] = 120; + buf[66] = 120; + buf[67] = 120; + buf[68] = 120; + buf[76] = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | ATA_SATA_GEN3); + buf[77] = ((p->ssts & ATA_SS_SPD_MASK) >> 3); buf[78] = (1 << 5); - buf[80] = (0x1f << 4); - buf[82] = (1 << 4); + buf[80] = 0x3f0; + buf[82] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_PACKET | + ATA_SUPPORT_RESET | ATA_SUPPORT_NOP); buf[83] = (1 << 14); buf[84] = (1 << 14); - buf[85] = (1 << 4); + buf[85] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_PACKET | + ATA_SUPPORT_RESET | ATA_SUPPORT_NOP); buf[87] = (1 << 14); - buf[88] = (1 << 14 | 0x7f); + buf[88] = 0x7f; + if (p->xfermode & ATA_UDMA0) + buf[88] |= (1 << ((p->xfermode & 7) + 8)); + buf[222] = 0x1020; ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); @@ -965,22 +974,41 @@ atapi_inquiry(struct ahci_port *p, int s uint8_t buf[36]; uint8_t *acmd; int len; + uint32_t tfd; acmd = cfis + 0x40; - buf[0] = 0x05; - buf[1] = 0x80; - buf[2] = 0x00; - buf[3] = 0x21; - buf[4] = 31; - buf[5] = 0; - buf[6] = 0; - buf[7] = 0; - atapi_string(buf + 8, "BHYVE", 8); - atapi_string(buf + 16, "BHYVE DVD-ROM", 16); - atapi_string(buf + 32, "001", 4); + if (acmd[1] & 1) { /* VPD */ + if (acmd[2] == 0) { /* Supported VPD pages */ + buf[0] = 0x05; + buf[1] = 0; + buf[2] = 0; + buf[3] = 1; + buf[4] = 0; + len = 4 + buf[3]; + } else { + p->sense_key = ATA_SENSE_ILLEGAL_REQUEST; + p->asc = 0x24; + tfd = (p->sense_key << 12) | ATA_S_READY | ATA_S_ERROR; + cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; + ahci_write_fis_d2h(p, slot, cfis, tfd); + return; + } + } else { + buf[0] = 0x05; + buf[1] = 0x80; + buf[2] = 0x00; + buf[3] = 0x21; + buf[4] = 31; + buf[5] = 0; + buf[6] = 0; + buf[7] = 0; + atapi_string(buf + 8, "BHYVE", 8); + atapi_string(buf + 16, "BHYVE DVD-ROM", 16); + atapi_string(buf + 32, "001", 4); + len = sizeof(buf); + } - len = sizeof(buf); if (len > acmd[4]) len = acmd[4]; cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; @@ -1184,6 +1212,19 @@ atapi_read_toc(struct ahci_port *p, int } static void +atapi_report_luns(struct ahci_port *p, int slot, uint8_t *cfis) +{ + uint8_t buf[16]; + + memset(buf, 0, sizeof(buf)); + buf[3] = 8; + + cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; + write_prdt(p, slot, cfis, buf, sizeof(buf)); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); +} + +static void atapi_read(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done, int seek) { @@ -1452,6 +1493,9 @@ handle_packet_cmd(struct ahci_port *p, i case READ_TOC: atapi_read_toc(p, slot, cfis); break; + case REPORT_LUNS: + atapi_report_luns(p, slot, cfis); + break; case READ_10: case READ_12: atapi_read(p, slot, cfis, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 12:29:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FCA3D14; Sat, 14 Mar 2015 12:29:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 11C67BC3; Sat, 14 Mar 2015 12:29:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ECTj9S040374; Sat, 14 Mar 2015 12:29:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ECTjIg040370; Sat, 14 Mar 2015 12:29:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503141229.t2ECTjIg040370@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Mar 2015 12:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279980 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 12:29:46 -0000 Author: dim Date: Sat Mar 14 12:29:44 2015 New Revision: 279980 URL: https://svnweb.freebsd.org/changeset/base/279980 Log: Allow relative pathnames in SRCS, so as to enable building software which includes more than one file with the same name, in different directories. For example, setting: SRCS+= foo/foo.c bar/foo.c baz/foo.c will now create separate objdirs 'foo', 'bar' and 'baz' for each of the sources in the list, and use those objdirs for the corresponding object files. Reviewed by: brooks, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D1984 Modified: head/share/mk/bsd.obj.mk head/share/mk/sys.mk Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Sat Mar 14 12:18:26 2015 (r279979) +++ head/share/mk/bsd.obj.mk Sat Mar 14 12:29:44 2015 (r279980) @@ -89,6 +89,16 @@ obj: .PHONY fi; \ ${ECHO} "${CANONICALOBJDIR} created for ${.CURDIR}"; \ fi +.for dir in ${SRCS:H:O:u} + @if ! test -d ${CANONICALOBJDIR}/${dir}/; then \ + mkdir -p ${CANONICALOBJDIR}/${dir}; \ + if ! test -d ${CANONICALOBJDIR}/${dir}/; then \ + ${ECHO} "Unable to create ${CANONICALOBJDIR}/${dir}."; \ + exit 1; \ + fi; \ + ${ECHO} "${CANONICALOBJDIR}/${dir} created for ${.CURDIR}"; \ + fi +.endfor .endif .if !target(objlink) Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sat Mar 14 12:18:26 2015 (r279979) +++ head/share/mk/sys.mk Sat Mar 14 12:29:44 2015 (r279980) @@ -242,21 +242,21 @@ YFLAGS ?= -d ${CTFCONVERT_CMD} .c.o: - ${CC} ${CFLAGS} -c ${.IMPSRC} + ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .cc .cpp .cxx .C: ${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} .cc.o .cpp.o .cxx.o .C.o: - ${CXX} ${CXXFLAGS} -c ${.IMPSRC} + ${CXX} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .m.o: - ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} + ${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .p.o: - ${PC} ${PFLAGS} -c ${.IMPSRC} + ${PC} ${PFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .e .r .F .f: @@ -264,14 +264,15 @@ YFLAGS ?= -d -o ${.TARGET} .e.o .r.o .F.o .f.o: - ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} + ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} -o ${.TARGET} .S.o: - ${CC} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} + ${CC} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .asm.o: - ${CC} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} + ${CC} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ + -o ${.TARGET} ${CTFCONVERT_CMD} .s.o: From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 12:40:27 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3BD5F26; Sat, 14 Mar 2015 12:40:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 CD478C98; Sat, 14 Mar 2015 12:40:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ECeRo8045715; Sat, 14 Mar 2015 12:40:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ECeKqP045674; Sat, 14 Mar 2015 12:40:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503141240.t2ECeKqP045674@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Mar 2015 12:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279981 - in head: contrib/compiler-rt/lib/builtins lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 12:40:28 -0000 Author: dim Date: Sat Mar 14 12:40:19 2015 New Revision: 279981 URL: https://svnweb.freebsd.org/changeset/base/279981 Log: Pull in r231965 from upstream compiler-rt trunk (by Jörg Sonnenberger): Refactor float to integer conversion to share the same code. 80bit Intel/PPC long double is excluded due to lacking support for the abstraction. Consistently provide saturation logic. Extend to long double on 128bit IEEE extended platforms. Initial patch with test cases from GuanHong Liu. Reviewed by Steve Canon. Differential Revision: http://reviews.llvm.org/D2804 Pull in r232107 from upstream compiler-rt trunk (by Ed Maste): Use signed int implementation for __fixint Requested by: emaste Added: head/contrib/compiler-rt/lib/builtins/fixtfdi.c (contents, props changed) head/contrib/compiler-rt/lib/builtins/fixtfsi.c (contents, props changed) head/contrib/compiler-rt/lib/builtins/fixtfti.c (contents, props changed) head/contrib/compiler-rt/lib/builtins/fixunstfdi.c (contents, props changed) head/contrib/compiler-rt/lib/builtins/fixunstfsi.c (contents, props changed) head/contrib/compiler-rt/lib/builtins/fixunstfti.c (contents, props changed) head/contrib/compiler-rt/lib/builtins/fp_fixint_impl.inc (contents, props changed) head/contrib/compiler-rt/lib/builtins/fp_fixuint_impl.inc (contents, props changed) Modified: head/contrib/compiler-rt/lib/builtins/fixdfdi.c head/contrib/compiler-rt/lib/builtins/fixdfsi.c head/contrib/compiler-rt/lib/builtins/fixdfti.c head/contrib/compiler-rt/lib/builtins/fixsfdi.c head/contrib/compiler-rt/lib/builtins/fixsfsi.c head/contrib/compiler-rt/lib/builtins/fixsfti.c head/contrib/compiler-rt/lib/builtins/fixunsdfdi.c head/contrib/compiler-rt/lib/builtins/fixunsdfsi.c head/contrib/compiler-rt/lib/builtins/fixunsdfti.c head/contrib/compiler-rt/lib/builtins/fixunssfdi.c head/contrib/compiler-rt/lib/builtins/fixunssfsi.c head/contrib/compiler-rt/lib/builtins/fixunssfti.c head/contrib/compiler-rt/lib/builtins/fixunsxfdi.c head/contrib/compiler-rt/lib/builtins/fixunsxfsi.c head/contrib/compiler-rt/lib/builtins/fixunsxfti.c head/contrib/compiler-rt/lib/builtins/fixxfdi.c head/contrib/compiler-rt/lib/builtins/fixxfti.c head/lib/libcompiler_rt/Makefile Modified: head/contrib/compiler-rt/lib/builtins/fixdfdi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixdfdi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixdfdi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -6,40 +6,17 @@ * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== - * - * This file implements __fixdfdi for the compiler_rt library. - * - * ===----------------------------------------------------------------------=== */ -#include "int_lib.h" - -/* Returns: convert a to a signed long long, rounding toward zero. */ - -/* Assumption: double is a IEEE 64 bit floating point type - * su_int is a 32 bit integral type - * value in double is representable in di_int (no range checking performed) - */ - -/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ - +#define DOUBLE_PRECISION +#include "fp_lib.h" ARM_EABI_FNALIAS(d2lz, fixdfdi) +typedef di_int fixint_t; +typedef du_int fixuint_t; +#include "fp_fixint_impl.inc" + COMPILER_RT_ABI di_int -__fixdfdi(double a) -{ - double_bits fb; - fb.f = a; - int e = ((fb.u.s.high & 0x7FF00000) >> 20) - 1023; - if (e < 0) - return 0; - di_int s = (si_int)(fb.u.s.high & 0x80000000) >> 31; - dwords r; - r.s.high = (fb.u.s.high & 0x000FFFFF) | 0x00100000; - r.s.low = fb.u.s.low; - if (e > 52) - r.all <<= (e - 52); - else - r.all >>= (52 - e); - return (r.all ^ s) - s; -} +__fixdfdi(fp_t a) { + return __fixint(a); +} Modified: head/contrib/compiler-rt/lib/builtins/fixdfsi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixdfsi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixdfsi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -1,50 +1,22 @@ -//===-- lib/fixdfsi.c - Double-precision -> integer conversion ----*- C -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements double-precision to integer conversion for the -// compiler-rt library. No range checking is performed; the behavior of this -// conversion is undefined for out of range values in the C standard. -// -//===----------------------------------------------------------------------===// +/* ===-- fixdfsi.c - Implement __fixdfsi -----------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + */ #define DOUBLE_PRECISION #include "fp_lib.h" - -#include "int_lib.h" +typedef si_int fixint_t; +typedef su_int fixuint_t; +#include "fp_fixint_impl.inc" ARM_EABI_FNALIAS(d2iz, fixdfsi) -COMPILER_RT_ABI int +COMPILER_RT_ABI si_int __fixdfsi(fp_t a) { - - // Break a into sign, exponent, significand - const rep_t aRep = toRep(a); - const rep_t aAbs = aRep & absMask; - const int sign = aRep & signBit ? -1 : 1; - const int exponent = (aAbs >> significandBits) - exponentBias; - const rep_t significand = (aAbs & significandMask) | implicitBit; - - // If 0 < exponent < significandBits, right shift to get the result. - if ((unsigned int)exponent < significandBits) { - return sign * (significand >> (significandBits - exponent)); - } - - // If exponent is negative, the result is zero. - else if (exponent < 0) { - return 0; - } - - // If significandBits < exponent, left shift to get the result. This shift - // may end up being larger than the type width, which incurs undefined - // behavior, but the conversion itself is undefined in that case, so - // whatever the compiler decides to do is fine. - else { - return sign * (significand << (exponent - significandBits)); - } + return __fixint(a); } Modified: head/contrib/compiler-rt/lib/builtins/fixdfti.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixdfti.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixdfti.c Sat Mar 14 12:40:19 2015 (r279981) @@ -6,40 +6,21 @@ * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== - * - * This file implements __fixdfti for the compiler_rt library. - * - * ===----------------------------------------------------------------------=== */ #include "int_lib.h" #ifdef CRT_HAS_128BIT +#define DOUBLE_PRECISION +#include "fp_lib.h" -/* Returns: convert a to a signed long long, rounding toward zero. */ - -/* Assumption: double is a IEEE 64 bit floating point type - * su_int is a 32 bit integral type - * value in double is representable in ti_int (no range checking performed) - */ - -/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ +typedef ti_int fixint_t; +typedef tu_int fixuint_t; +#include "fp_fixint_impl.inc" COMPILER_RT_ABI ti_int -__fixdfti(double a) -{ - double_bits fb; - fb.f = a; - int e = ((fb.u.s.high & 0x7FF00000) >> 20) - 1023; - if (e < 0) - return 0; - ti_int s = (si_int)(fb.u.s.high & 0x80000000) >> 31; - ti_int r = 0x0010000000000000uLL | (0x000FFFFFFFFFFFFFuLL & fb.u.all); - if (e > 52) - r <<= (e - 52); - else - r >>= (52 - e); - return (r ^ s) - s; +__fixdfti(fp_t a) { + return __fixint(a); } #endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/builtins/fixsfdi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixsfdi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixsfdi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -1,43 +1,23 @@ /* ===-- fixsfdi.c - Implement __fixsfdi -----------------------------------=== * - * The LLVM Compiler Infrastructure + * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== - * - * This file implements __fixsfdi for the compiler_rt library. - * - * ===----------------------------------------------------------------------=== - */ - -#include "int_lib.h" - -/* Returns: convert a to a signed long long, rounding toward zero. */ - -/* Assumption: float is a IEEE 32 bit floating point type - * su_int is a 32 bit integral type - * value in float is representable in di_int (no range checking performed) */ -/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ +#define SINGLE_PRECISION +#include "fp_lib.h" ARM_EABI_FNALIAS(f2lz, fixsfdi) +typedef di_int fixint_t; +typedef du_int fixuint_t; +#include "fp_fixint_impl.inc" + COMPILER_RT_ABI di_int -__fixsfdi(float a) -{ - float_bits fb; - fb.f = a; - int e = ((fb.u & 0x7F800000) >> 23) - 127; - if (e < 0) - return 0; - di_int s = (si_int)(fb.u & 0x80000000) >> 31; - di_int r = (fb.u & 0x007FFFFF) | 0x00800000; - if (e > 23) - r <<= (e - 23); - else - r >>= (23 - e); - return (r ^ s) - s; +__fixsfdi(fp_t a) { + return __fixint(a); } Modified: head/contrib/compiler-rt/lib/builtins/fixsfsi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixsfsi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixsfsi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -1,47 +1,22 @@ -//===-- lib/fixsfsi.c - Single-precision -> integer conversion ----*- C -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements single-precision to integer conversion for the -// compiler-rt library. No range checking is performed; the behavior of this -// conversion is undefined for out of range values in the C standard. -// -//===----------------------------------------------------------------------===// +/* ===-- fixsfsi.c - Implement __fixsfsi -----------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + */ #define SINGLE_PRECISION #include "fp_lib.h" +typedef si_int fixint_t; +typedef su_int fixuint_t; +#include "fp_fixint_impl.inc" ARM_EABI_FNALIAS(f2iz, fixsfsi) -COMPILER_RT_ABI int +COMPILER_RT_ABI si_int __fixsfsi(fp_t a) { - // Break a into sign, exponent, significand - const rep_t aRep = toRep(a); - const rep_t aAbs = aRep & absMask; - const int sign = aRep & signBit ? -1 : 1; - const int exponent = (aAbs >> significandBits) - exponentBias; - const rep_t significand = (aAbs & significandMask) | implicitBit; - - // If 0 < exponent < significandBits, right shift to get the result. - if ((unsigned int)exponent < significandBits) { - return sign * (significand >> (significandBits - exponent)); - } - - // If exponent is negative, the result is zero. - else if (exponent < 0) { - return 0; - } - - // If significandBits < exponent, left shift to get the result. This shift - // may end up being larger than the type width, which incurs undefined - // behavior, but the conversion itself is undefined in that case, so - // whatever the compiler decides to do is fine. - else { - return sign * (significand << (exponent - significandBits)); - } + return __fixint(a); } Modified: head/contrib/compiler-rt/lib/builtins/fixsfti.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixsfti.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixsfti.c Sat Mar 14 12:40:19 2015 (r279981) @@ -6,40 +6,21 @@ * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== - * - * This file implements __fixsfti for the compiler_rt library. - * - * ===----------------------------------------------------------------------=== */ #include "int_lib.h" #ifdef CRT_HAS_128BIT +#define SINGLE_PRECISION +#include "fp_lib.h" -/* Returns: convert a to a signed long long, rounding toward zero. */ - -/* Assumption: float is a IEEE 32 bit floating point type - * su_int is a 32 bit integral type - * value in float is representable in ti_int (no range checking performed) - */ - -/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ +typedef ti_int fixint_t; +typedef tu_int fixuint_t; +#include "fp_fixint_impl.inc" COMPILER_RT_ABI ti_int -__fixsfti(float a) -{ - float_bits fb; - fb.f = a; - int e = ((fb.u & 0x7F800000) >> 23) - 127; - if (e < 0) - return 0; - ti_int s = (si_int)(fb.u & 0x80000000) >> 31; - ti_int r = (fb.u & 0x007FFFFF) | 0x00800000; - if (e > 23) - r <<= (e - 23); - else - r >>= (23 - e); - return (r ^ s) - s; +__fixsfti(fp_t a) { + return __fixint(a); } #endif /* CRT_HAS_128BIT */ Added: head/contrib/compiler-rt/lib/builtins/fixtfdi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/fixtfdi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -0,0 +1,23 @@ +/* ===-- fixtfdi.c - Implement __fixtfdi -----------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + */ + +#define QUAD_PRECISION +#include "fp_lib.h" + +#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT) +typedef di_int fixint_t; +typedef du_int fixuint_t; +#include "fp_fixint_impl.inc" + +COMPILER_RT_ABI di_int +__fixtfdi(fp_t a) { + return __fixint(a); +} +#endif Added: head/contrib/compiler-rt/lib/builtins/fixtfsi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/fixtfsi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -0,0 +1,23 @@ +/* ===-- fixtfsi.c - Implement __fixtfsi -----------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + */ + +#define QUAD_PRECISION +#include "fp_lib.h" + +#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT) +typedef si_int fixint_t; +typedef su_int fixuint_t; +#include "fp_fixint_impl.inc" + +COMPILER_RT_ABI si_int +__fixtfsi(fp_t a) { + return __fixint(a); +} +#endif Added: head/contrib/compiler-rt/lib/builtins/fixtfti.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/fixtfti.c Sat Mar 14 12:40:19 2015 (r279981) @@ -0,0 +1,23 @@ +/* ===-- fixtfti.c - Implement __fixtfti -----------------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + */ + +#define QUAD_PRECISION +#include "fp_lib.h" + +#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT) +typedef ti_int fixint_t; +typedef tu_int fixuint_t; +#include "fp_fixint_impl.inc" + +COMPILER_RT_ABI ti_int +__fixtfti(fp_t a) { + return __fixint(a); +} +#endif Modified: head/contrib/compiler-rt/lib/builtins/fixunsdfdi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixunsdfdi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixunsdfdi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -6,42 +6,16 @@ * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== - * - * This file implements __fixunsdfdi for the compiler_rt library. - * - * ===----------------------------------------------------------------------=== - */ - -#include "int_lib.h" - -/* Returns: convert a to a unsigned long long, rounding toward zero. - * Negative values all become zero. - */ - -/* Assumption: double is a IEEE 64 bit floating point type - * du_int is a 64 bit integral type - * value in double is representable in du_int or is negative - * (no range checking performed) */ -/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ +#define DOUBLE_PRECISION +#include "fp_lib.h" +typedef du_int fixuint_t; +#include "fp_fixuint_impl.inc" ARM_EABI_FNALIAS(d2ulz, fixunsdfdi) COMPILER_RT_ABI du_int -__fixunsdfdi(double a) -{ - double_bits fb; - fb.f = a; - int e = ((fb.u.s.high & 0x7FF00000) >> 20) - 1023; - if (e < 0 || (fb.u.s.high & 0x80000000)) - return 0; - udwords r; - r.s.high = (fb.u.s.high & 0x000FFFFF) | 0x00100000; - r.s.low = fb.u.s.low; - if (e > 52) - r.all <<= (e - 52); - else - r.all >>= (52 - e); - return r.all; +__fixunsdfdi(fp_t a) { + return __fixuint(a); } Modified: head/contrib/compiler-rt/lib/builtins/fixunsdfsi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixunsdfsi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixunsdfsi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -6,39 +6,16 @@ * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== - * - * This file implements __fixunsdfsi for the compiler_rt library. - * - * ===----------------------------------------------------------------------=== - */ - -#include "int_lib.h" - -/* Returns: convert a to a unsigned int, rounding toward zero. - * Negative values all become zero. - */ - -/* Assumption: double is a IEEE 64 bit floating point type - * su_int is a 32 bit integral type - * value in double is representable in su_int or is negative - * (no range checking performed) */ -/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ +#define DOUBLE_PRECISION +#include "fp_lib.h" +typedef su_int fixuint_t; +#include "fp_fixuint_impl.inc" ARM_EABI_FNALIAS(d2uiz, fixunsdfsi) COMPILER_RT_ABI su_int -__fixunsdfsi(double a) -{ - double_bits fb; - fb.f = a; - int e = ((fb.u.s.high & 0x7FF00000) >> 20) - 1023; - if (e < 0 || (fb.u.s.high & 0x80000000)) - return 0; - return ( - 0x80000000u | - ((fb.u.s.high & 0x000FFFFF) << 11) | - (fb.u.s.low >> 21) - ) >> (31 - e); +__fixunsdfsi(fp_t a) { + return __fixuint(a); } Modified: head/contrib/compiler-rt/lib/builtins/fixunsdfti.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixunsdfti.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixunsdfti.c Sat Mar 14 12:40:19 2015 (r279981) @@ -6,42 +6,18 @@ * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== - * - * This file implements __fixunsdfti for the compiler_rt library. - * - * ===----------------------------------------------------------------------=== */ #include "int_lib.h" #ifdef CRT_HAS_128BIT - -/* Returns: convert a to a unsigned long long, rounding toward zero. - * Negative values all become zero. - */ - -/* Assumption: double is a IEEE 64 bit floating point type - * tu_int is a 64 bit integral type - * value in double is representable in tu_int or is negative - * (no range checking performed) - */ - -/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ +#define DOUBLE_PRECISION +#include "fp_lib.h" +typedef tu_int fixuint_t; +#include "fp_fixuint_impl.inc" COMPILER_RT_ABI tu_int -__fixunsdfti(double a) -{ - double_bits fb; - fb.f = a; - int e = ((fb.u.s.high & 0x7FF00000) >> 20) - 1023; - if (e < 0 || (fb.u.s.high & 0x80000000)) - return 0; - tu_int r = 0x0010000000000000uLL | (fb.u.all & 0x000FFFFFFFFFFFFFuLL); - if (e > 52) - r <<= (e - 52); - else - r >>= (52 - e); - return r; +__fixunsdftti(fp_t a) { + return __fixuint(a); } - #endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/builtins/fixunssfdi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixunssfdi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixunssfdi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -6,39 +6,16 @@ * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== - * - * This file implements __fixunssfdi for the compiler_rt library. - * - * ===----------------------------------------------------------------------=== - */ - -#include "int_lib.h" -/* Returns: convert a to a unsigned long long, rounding toward zero. - * Negative values all become zero. - */ - -/* Assumption: float is a IEEE 32 bit floating point type - * du_int is a 64 bit integral type - * value in float is representable in du_int or is negative - * (no range checking performed) */ -/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ +#define SINGLE_PRECISION +#include "fp_lib.h" +typedef du_int fixuint_t; +#include "fp_fixuint_impl.inc" ARM_EABI_FNALIAS(f2ulz, fixunssfdi) COMPILER_RT_ABI du_int -__fixunssfdi(float a) -{ - float_bits fb; - fb.f = a; - int e = ((fb.u & 0x7F800000) >> 23) - 127; - if (e < 0 || (fb.u & 0x80000000)) - return 0; - du_int r = (fb.u & 0x007FFFFF) | 0x00800000; - if (e > 23) - r <<= (e - 23); - else - r >>= (23 - e); - return r; +__fixunssfdi(fp_t a) { + return __fixuint(a); } Modified: head/contrib/compiler-rt/lib/builtins/fixunssfsi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixunssfsi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixunssfsi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -12,34 +12,14 @@ * ===----------------------------------------------------------------------=== */ -#include "int_lib.h" - -/* Returns: convert a to a unsigned int, rounding toward zero. - * Negative values all become zero. - */ - -/* Assumption: float is a IEEE 32 bit floating point type - * su_int is a 32 bit integral type - * value in float is representable in su_int or is negative - * (no range checking performed) - */ - -/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ +#define SINGLE_PRECISION +#include "fp_lib.h" +typedef su_int fixuint_t; +#include "fp_fixuint_impl.inc" ARM_EABI_FNALIAS(f2uiz, fixunssfsi) COMPILER_RT_ABI su_int -__fixunssfsi(float a) -{ - float_bits fb; - fb.f = a; - int e = ((fb.u & 0x7F800000) >> 23) - 127; - if (e < 0 || (fb.u & 0x80000000)) - return 0; - su_int r = (fb.u & 0x007FFFFF) | 0x00800000; - if (e > 23) - r <<= (e - 23); - else - r >>= (23 - e); - return r; +__fixunssfsi(fp_t a) { + return __fixuint(a); } Modified: head/contrib/compiler-rt/lib/builtins/fixunssfti.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixunssfti.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixunssfti.c Sat Mar 14 12:40:19 2015 (r279981) @@ -12,36 +12,12 @@ * ===----------------------------------------------------------------------=== */ -#include "int_lib.h" - -#ifdef CRT_HAS_128BIT - -/* Returns: convert a to a unsigned long long, rounding toward zero. - * Negative values all become zero. - */ - -/* Assumption: float is a IEEE 32 bit floating point type - * tu_int is a 64 bit integral type - * value in float is representable in tu_int or is negative - * (no range checking performed) - */ - -/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ +#if defined(CRT_HAS_128BIT) +typedef tu_int fixuint_t; +#include "fp_fixuint_impl.inc" COMPILER_RT_ABI tu_int -__fixunssfti(float a) -{ - float_bits fb; - fb.f = a; - int e = ((fb.u & 0x7F800000) >> 23) - 127; - if (e < 0 || (fb.u & 0x80000000)) - return 0; - tu_int r = (fb.u & 0x007FFFFF) | 0x00800000; - if (e > 23) - r <<= (e - 23); - else - r >>= (23 - e); - return r; +__fixunssfti(fp_t a) { + return __fixuint(a); } - -#endif /* CRT_HAS_128BIT */ +#endif Added: head/contrib/compiler-rt/lib/builtins/fixunstfdi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/fixunstfdi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -0,0 +1,22 @@ +/* ===-- fixunstfdi.c - Implement __fixunstfdi -----------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + */ + +#define QUAD_PRECISION +#include "fp_lib.h" + +#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT) +typedef du_int fixuint_t; +#include "fp_fixuint_impl.inc" + +COMPILER_RT_ABI du_int +__fixunstfdi(fp_t a) { + return __fixuint(a); +} +#endif Added: head/contrib/compiler-rt/lib/builtins/fixunstfsi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/fixunstfsi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -0,0 +1,22 @@ +/* ===-- fixunstfsi.c - Implement __fixunstfsi -----------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + */ + +#define QUAD_PRECISION +#include "fp_lib.h" + +#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT) +typedef su_int fixuint_t; +#include "fp_fixuint_impl.inc" + +COMPILER_RT_ABI su_int +__fixunstfsi(fp_t a) { + return __fixuint(a); +} +#endif Added: head/contrib/compiler-rt/lib/builtins/fixunstfti.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/fixunstfti.c Sat Mar 14 12:40:19 2015 (r279981) @@ -0,0 +1,22 @@ +/* ===-- fixunstfsi.c - Implement __fixunstfsi -----------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===----------------------------------------------------------------------=== + */ + +#define QUAD_PRECISION +#include "fp_lib.h" + +#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT) +typedef tu_int fixuint_t; +#include "fp_fixuint_impl.inc" + +COMPILER_RT_ABI tu_int +__fixunstfti(fp_t a) { + return __fixuint(a); +} +#endif Modified: head/contrib/compiler-rt/lib/builtins/fixunsxfdi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixunsxfdi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixunsxfdi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -38,6 +38,8 @@ __fixunsxfdi(long double a) int e = (fb.u.high.s.low & 0x00007FFF) - 16383; if (e < 0 || (fb.u.high.s.low & 0x00008000)) return 0; + if ((unsigned)e > sizeof(du_int) * CHAR_BIT) + return ~(du_int)0; return fb.u.low.all >> (63 - e); } Modified: head/contrib/compiler-rt/lib/builtins/fixunsxfsi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixunsxfsi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixunsxfsi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -23,7 +23,6 @@ /* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes * su_int is a 32 bit integral type * value in long double is representable in su_int or is negative - * (no range checking performed) */ /* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | @@ -38,6 +37,8 @@ __fixunsxfsi(long double a) int e = (fb.u.high.s.low & 0x00007FFF) - 16383; if (e < 0 || (fb.u.high.s.low & 0x00008000)) return 0; + if ((unsigned)e > sizeof(su_int) * CHAR_BIT) + return ~(su_int)0; return fb.u.low.s.high >> (31 - e); } Modified: head/contrib/compiler-rt/lib/builtins/fixunsxfti.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixunsxfti.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixunsxfti.c Sat Mar 14 12:40:19 2015 (r279981) @@ -21,9 +21,8 @@ */ /* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes - * tu_int is a 64 bit integral type + * tu_int is a 128 bit integral type * value in long double is representable in tu_int or is negative - * (no range checking performed) */ /* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | @@ -38,6 +37,8 @@ __fixunsxfti(long double a) int e = (fb.u.high.s.low & 0x00007FFF) - 16383; if (e < 0 || (fb.u.high.s.low & 0x00008000)) return 0; + if ((unsigned)e > sizeof(tu_int) * CHAR_BIT) + return ~(tu_int)0; tu_int r = fb.u.low.all; if (e > 63) r <<= (e - 63); Modified: head/contrib/compiler-rt/lib/builtins/fixxfdi.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixxfdi.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixxfdi.c Sat Mar 14 12:40:19 2015 (r279981) @@ -19,7 +19,7 @@ /* Returns: convert a to a signed long long, rounding toward zero. */ /* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes - * su_int is a 32 bit integral type + * di_int is a 64 bit integral type * value in long double is representable in di_int (no range checking performed) */ @@ -30,11 +30,15 @@ COMPILER_RT_ABI di_int __fixxfdi(long double a) { + const di_int di_max = (di_int)((~(du_int)0) / 2); + const di_int di_min = -di_max - 1; long_double_bits fb; fb.f = a; int e = (fb.u.high.s.low & 0x00007FFF) - 16383; if (e < 0) return 0; + if ((unsigned)e >= sizeof(di_int) * CHAR_BIT) + return a > 0 ? di_max : di_min; di_int s = -(si_int)((fb.u.high.s.low & 0x00008000) >> 15); di_int r = fb.u.low.all; r = (du_int)r >> (63 - e); Modified: head/contrib/compiler-rt/lib/builtins/fixxfti.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/fixxfti.c Sat Mar 14 12:29:44 2015 (r279980) +++ head/contrib/compiler-rt/lib/builtins/fixxfti.c Sat Mar 14 12:40:19 2015 (r279981) @@ -19,8 +19,8 @@ /* Returns: convert a to a signed long long, rounding toward zero. */ /* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes - * su_int is a 32 bit integral type - * value in long double is representable in ti_int (no range checking performed) + * ti_int is a 128 bit integral type + * value in long double is representable in ti_int */ /* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee | @@ -30,6 +30,8 @@ COMPILER_RT_ABI ti_int __fixxfti(long double a) { + const ti_int ti_max = (ti_int)((~(tu_int)0) / 2); + const ti_int ti_min = -ti_max - 1; long_double_bits fb; fb.f = a; int e = (fb.u.high.s.low & 0x00007FFF) - 16383; @@ -37,6 +39,8 @@ __fixxfti(long double a) return 0; ti_int s = -(si_int)((fb.u.high.s.low & 0x00008000) >> 15); ti_int r = fb.u.low.all; + if ((unsigned)e >= sizeof(ti_int) * CHAR_BIT) + return a > 0 ? ti_max : ti_min; if (e > 63) r <<= (e - 63); else Added: head/contrib/compiler-rt/lib/builtins/fp_fixint_impl.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/fp_fixint_impl.inc Sat Mar 14 12:40:19 2015 (r279981) @@ -0,0 +1,41 @@ +//===-- lib/fixdfsi.c - Double-precision -> integer conversion ----*- C -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements float to integer conversion for the +// compiler-rt library. +// +//===----------------------------------------------------------------------===// + +#include "fp_lib.h" + +static inline fixint_t __fixint(fp_t a) { + const fixint_t fixint_max = (fixint_t)((~(fixuint_t)0) / 2); + const fixint_t fixint_min = -fixint_max - 1; + // Break a into sign, exponent, significand + const rep_t aRep = toRep(a); + const rep_t aAbs = aRep & absMask; + const fixint_t sign = aRep & signBit ? -1 : 1; + const int exponent = (aAbs >> significandBits) - exponentBias; + const rep_t significand = (aAbs & significandMask) | implicitBit; + + // If exponent is negative, the result is zero. + if (exponent < 0) + return 0; + + // If the value is too large for the integer type, saturate. + if ((unsigned)exponent >= sizeof(fixint_t) * CHAR_BIT) + return sign == 1 ? fixint_max : fixint_min; + + // If 0 <= exponent < significandBits, right shift to get the result. + // Otherwise, shift left. + if (exponent < significandBits) + return sign * (significand >> (significandBits - exponent)); + else + return sign * ((fixint_t)significand << (exponent - significandBits)); +} Added: head/contrib/compiler-rt/lib/builtins/fp_fixuint_impl.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/builtins/fp_fixuint_impl.inc Sat Mar 14 12:40:19 2015 (r279981) @@ -0,0 +1,39 @@ +//===-- lib/fixdfsi.c - Double-precision -> integer conversion ----*- C -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements float to unsigned integer conversion for the +// compiler-rt library. +// +//===----------------------------------------------------------------------===// + +#include "fp_lib.h" + +static inline fixuint_t __fixuint(fp_t a) { + // Break a into sign, exponent, significand + const rep_t aRep = toRep(a); + const rep_t aAbs = aRep & absMask; + const int sign = aRep & signBit ? -1 : 1; + const int exponent = (aAbs >> significandBits) - exponentBias; + const rep_t significand = (aAbs & significandMask) | implicitBit; + + // If either the value or the exponent is negative, the result is zero. + if (sign == -1 || exponent < 0) + return 0; + + // If the value is too large for the integer type, saturate. + if ((unsigned)exponent > sizeof(fixuint_t) * CHAR_BIT) + return ~(fixuint_t)0; + + // If 0 <= exponent < significandBits, right shift to get the result. + // Otherwise, shift left. + if (exponent < significandBits) + return significand >> (significandBits - exponent); + else + return (fixuint_t)significand << (exponent - significandBits); +} Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Sat Mar 14 12:29:44 2015 (r279980) +++ head/lib/libcompiler_rt/Makefile Sat Mar 14 12:40:19 2015 (r279981) @@ -55,12 +55,18 @@ SRCF= absvdi2 \ fixdfti \ fixsfdi \ fixsfti \ + fixtfdi \ + fixtfsi \ + fixtfti \ fixunsdfdi \ fixunsdfsi \ fixunsdfti \ fixunssfdi \ fixunssfsi \ fixunssfti \ + fixunstfdi \ + fixunstfsi \ + fixunstfti \ fixunsxfdi \ fixunsxfsi \ fixunsxfti \ From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 13:00:39 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B6EF2D4; Sat, 14 Mar 2015 13:00:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 EB6F9E27; Sat, 14 Mar 2015 13:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ED0csu057092; Sat, 14 Mar 2015 13:00:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ED0cwn057090; Sat, 14 Mar 2015 13:00:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503141300.t2ED0cwn057090@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 13:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279982 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 13:00:39 -0000 Author: ian Date: Sat Mar 14 13:00:37 2015 New Revision: 279982 URL: https://svnweb.freebsd.org/changeset/base/279982 Log: Revert r279932; this is going to be fixed in the sbuf code instead. PR: 195668 Modified: head/sys/vm/vm_phys.c head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Sat Mar 14 12:40:19 2015 (r279981) +++ head/sys/vm/vm_phys.c Sat Mar 14 13:00:37 2015 (r279982) @@ -263,7 +263,6 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) } } } - sbuf_putc(&sbuf, 0); /* nullterm */ error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); return (error); @@ -293,7 +292,6 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) sbuf_printf(&sbuf, "domain: %d\n", seg->domain); sbuf_printf(&sbuf, "free list: %p\n", seg->free_queues); } - sbuf_putc(&sbuf, 0); /* nullterm */ error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); return (error); Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sat Mar 14 12:40:19 2015 (r279981) +++ head/sys/vm/vm_reserv.c Sat Mar 14 13:00:37 2015 (r279982) @@ -261,7 +261,6 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER sbuf_printf(&sbuf, "%5d: %6dK, %6d\n", level, unused_pages * ((int)PAGE_SIZE / 1024), counter); } - sbuf_putc(&sbuf, 0); /* nullterm */ error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); return (error); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 13:02:09 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30DD044F; Sat, 14 Mar 2015 13:02:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 1D0ADEC2; Sat, 14 Mar 2015 13:02:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ED28A8058423; Sat, 14 Mar 2015 13:02:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ED28C9058422; Sat, 14 Mar 2015 13:02:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503141302.t2ED28C9058422@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 13:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279983 - head/sys/dev/wbwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 13:02:09 -0000 Author: ian Date: Sat Mar 14 13:02:08 2015 New Revision: 279983 URL: https://svnweb.freebsd.org/changeset/base/279983 Log: Revert r279933; this is going to be fixed in sbuf instead. PR: 195668 Modified: head/sys/dev/wbwd/wbwd.c Modified: head/sys/dev/wbwd/wbwd.c ============================================================================== --- head/sys/dev/wbwd/wbwd.c Sat Mar 14 13:00:37 2015 (r279982) +++ head/sys/dev/wbwd/wbwd.c Sat Mar 14 13:02:08 2015 (r279983) @@ -252,7 +252,6 @@ sysctl_wb_debug(SYSCTL_HANDLER_ARGS) sbuf_printf(&sb, "CRF6 0x%02x ", sc->reg_timeout); sbuf_printf(&sb, "CRF7 0x%02x", sc->reg_2); - sbuf_putc(&sb, 0); /* nullterm */ error = sbuf_finish(&sb); sbuf_delete(&sb); return (error); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 13:04:40 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B502641; Sat, 14 Mar 2015 13:04:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 8757CEE4; Sat, 14 Mar 2015 13:04:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ED4e59058756; Sat, 14 Mar 2015 13:04:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ED4ett058753; Sat, 14 Mar 2015 13:04:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503141304.t2ED4ett058753@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 13:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279984 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 13:04:40 -0000 Author: ian Date: Sat Mar 14 13:04:39 2015 New Revision: 279984 URL: https://svnweb.freebsd.org/changeset/base/279984 Log: Revert r279934, r279938; this is going to be fixed in sbuf instead. PR: 195668 Modified: head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.c Sat Mar 14 13:02:08 2015 (r279983) +++ head/sys/dev/cxgbe/t4_l2t.c Sat Mar 14 13:04:39 2015 (r279984) @@ -321,7 +321,6 @@ skip: mtx_unlock(&e->lock); } - sbuf_putc(sb, 0); /* nullterm */ rc = sbuf_finish(sb); sbuf_delete(sb); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Mar 14 13:02:08 2015 (r279983) +++ head/sys/dev/cxgbe/t4_main.c Sat Mar 14 13:04:39 2015 (r279984) @@ -5087,7 +5087,6 @@ sysctl_int_array(SYSCTL_HANDLER_ARGS) for (i = arg1; arg2; arg2 -= sizeof(int), i++) sbuf_printf(&sb, "%d ", *i); sbuf_trim(&sb); - sbuf_putc(&sb, 0); /* nullterm */ sbuf_finish(&sb); rc = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); sbuf_delete(&sb); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 13:45:45 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45C75388; Sat, 14 Mar 2015 13:45:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 30AB02E5; Sat, 14 Mar 2015 13:45:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EDjiYH078553; Sat, 14 Mar 2015 13:45:44 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EDjiIR078551; Sat, 14 Mar 2015 13:45:44 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201503141345.t2EDjiIR078551@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 14 Mar 2015 13:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279986 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 13:45:45 -0000 Author: jilles Date: Sat Mar 14 13:45:43 2015 New Revision: 279986 URL: https://svnweb.freebsd.org/changeset/base/279986 Log: restore: Preserve timestamps to the nanosecond. The restore utility already knows the full-resolution timestamps, so the only thing to do is to stop converting the timespecs to timevals and use futimens() and utimensat(). Differential Revision: https://reviews.freebsd.org/D2020 Reviewed by: jhb Modified: head/sbin/restore/dirs.c head/sbin/restore/tape.c Modified: head/sbin/restore/dirs.c ============================================================================== --- head/sbin/restore/dirs.c Sat Mar 14 13:08:00 2015 (r279985) +++ head/sbin/restore/dirs.c Sat Mar 14 13:45:43 2015 (r279986) @@ -80,8 +80,8 @@ static struct inotab *inotab[HASHSIZE]; */ struct modeinfo { ino_t ino; - struct timeval ctimep[2]; - struct timeval mtimep[2]; + struct timespec ctimep[2]; + struct timespec mtimep[2]; mode_t mode; uid_t uid; gid_t gid; @@ -656,8 +656,8 @@ setdirmodes(int flags) else (void) chown(cp, node.uid, node.gid); (void) chmod(cp, node.mode); - utimes(cp, node.ctimep); - utimes(cp, node.mtimep); + utimensat(AT_FDCWD, cp, node.ctimep, 0); + utimensat(AT_FDCWD, cp, node.mtimep, 0); (void) chflags(cp, node.flags); } ep->e_flags &= ~NEW; @@ -746,13 +746,13 @@ allocinotab(struct context *ctxp, long s return (itp); node.ino = ctxp->ino; node.mtimep[0].tv_sec = ctxp->atime_sec; - node.mtimep[0].tv_usec = ctxp->atime_nsec / 1000; + node.mtimep[0].tv_nsec = ctxp->atime_nsec; node.mtimep[1].tv_sec = ctxp->mtime_sec; - node.mtimep[1].tv_usec = ctxp->mtime_nsec / 1000; + node.mtimep[1].tv_nsec = ctxp->mtime_nsec; node.ctimep[0].tv_sec = ctxp->atime_sec; - node.ctimep[0].tv_usec = ctxp->atime_nsec / 1000; + node.ctimep[0].tv_nsec = ctxp->atime_nsec; node.ctimep[1].tv_sec = ctxp->birthtime_sec; - node.ctimep[1].tv_usec = ctxp->birthtime_nsec / 1000; + node.ctimep[1].tv_nsec = ctxp->birthtime_nsec; node.extsize = ctxp->extsize; node.mode = ctxp->mode; node.flags = ctxp->file_flags; Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Sat Mar 14 13:08:00 2015 (r279985) +++ head/sbin/restore/tape.c Sat Mar 14 13:45:43 2015 (r279986) @@ -569,20 +569,20 @@ extractfile(char *name) gid_t gid; mode_t mode; int extsize; - struct timeval mtimep[2], ctimep[2]; + struct timespec mtimep[2], ctimep[2]; struct entry *ep; char *buf; curfile.name = name; curfile.action = USING; mtimep[0].tv_sec = curfile.atime_sec; - mtimep[0].tv_usec = curfile.atime_nsec / 1000; + mtimep[0].tv_nsec = curfile.atime_nsec; mtimep[1].tv_sec = curfile.mtime_sec; - mtimep[1].tv_usec = curfile.mtime_nsec / 1000; + mtimep[1].tv_nsec = curfile.mtime_nsec; ctimep[0].tv_sec = curfile.atime_sec; - ctimep[0].tv_usec = curfile.atime_nsec / 1000; + ctimep[0].tv_nsec = curfile.atime_nsec; ctimep[1].tv_sec = curfile.birthtime_sec; - ctimep[1].tv_usec = curfile.birthtime_nsec / 1000; + ctimep[1].tv_nsec = curfile.birthtime_nsec; extsize = curfile.extsize; uid = getuid(); if (uid == 0) @@ -628,8 +628,10 @@ extractfile(char *name) set_extattr_link(name, buf, extsize); (void) lchown(name, uid, gid); (void) lchmod(name, mode); - (void) lutimes(name, ctimep); - (void) lutimes(name, mtimep); + (void) utimensat(AT_FDCWD, name, ctimep, + AT_SYMLINK_NOFOLLOW); + (void) utimensat(AT_FDCWD, name, mtimep, + AT_SYMLINK_NOFOLLOW); (void) lchflags(name, flags); return (GOOD); } @@ -658,8 +660,8 @@ extractfile(char *name) } (void) chown(name, uid, gid); (void) chmod(name, mode); - (void) utimes(name, ctimep); - (void) utimes(name, mtimep); + (void) utimensat(AT_FDCWD, name, ctimep, 0); + (void) utimensat(AT_FDCWD, name, mtimep, 0); (void) chflags(name, flags); return (GOOD); @@ -688,8 +690,8 @@ extractfile(char *name) } (void) chown(name, uid, gid); (void) chmod(name, mode); - (void) utimes(name, ctimep); - (void) utimes(name, mtimep); + (void) utimensat(AT_FDCWD, name, ctimep, 0); + (void) utimensat(AT_FDCWD, name, mtimep, 0); (void) chflags(name, flags); return (GOOD); @@ -714,8 +716,8 @@ extractfile(char *name) set_extattr_fd(ofile, name, buf, extsize); (void) fchown(ofile, uid, gid); (void) fchmod(ofile, mode); - (void) futimes(ofile, ctimep); - (void) futimes(ofile, mtimep); + (void) futimens(ofile, ctimep); + (void) futimens(ofile, mtimep); (void) fchflags(ofile, flags); (void) close(ofile); return (GOOD); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 14:06:38 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83AB38B5; Sat, 14 Mar 2015 14:06:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6EFDC69D; Sat, 14 Mar 2015 14:06:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EE6c9N088054; Sat, 14 Mar 2015 14:06:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EE6cDF088053; Sat, 14 Mar 2015 14:06:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503141406.t2EE6cDF088053@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Mar 2015 14:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279987 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 14:06:38 -0000 Author: mav Date: Sat Mar 14 14:06:37 2015 New Revision: 279987 URL: https://svnweb.freebsd.org/changeset/base/279987 Log: Add checksums to identify data and NCQ command error log. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Sat Mar 14 13:45:43 2015 (r279986) +++ head/usr.sbin/bhyve/pci_ahci.c Sat Mar 14 14:06:37 2015 (r279987) @@ -794,6 +794,17 @@ write_prdt(struct ahci_port *p, int slot } static void +ahci_checksum(uint8_t *buf, int size) +{ + int i; + uint8_t sum = 0; + + for (i = 0; i < size - 1; i++) + sum += buf[i]; + buf[size - 1] = 0x100 - sum; +} + +static void ahci_handle_read_log(struct ahci_port *p, int slot, uint8_t *cfis) { struct ahci_cmd_hdr *hdr; @@ -809,6 +820,7 @@ ahci_handle_read_log(struct ahci_port *p memset(buf, 0, sizeof(buf)); memcpy(buf, p->err_cfis, sizeof(p->err_cfis)); + ahci_checksum(buf, sizeof(buf)); if (cfis[2] == ATA_READ_LOG_EXT) ahci_write_fis_piosetup(p); @@ -914,6 +926,8 @@ handle_identify(struct ahci_port *p, int buf[119] = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); buf[120] = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); buf[222] = 0x1020; + buf[255] = 0x00a5; + ahci_checksum((uint8_t *)buf, sizeof(buf)); ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); @@ -962,6 +976,8 @@ handle_atapi_identify(struct ahci_port * if (p->xfermode & ATA_UDMA0) buf[88] |= (1 << ((p->xfermode & 7) + 8)); buf[222] = 0x1020; + buf[255] = 0x00a5; + ahci_checksum((uint8_t *)buf, sizeof(buf)); ahci_write_fis_piosetup(p); write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 16:02:13 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DAF882A; Sat, 14 Mar 2015 16:02:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 7DE491CD; Sat, 14 Mar 2015 16:02:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EG2D3s045594; Sat, 14 Mar 2015 16:02:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EG2CSY045589; Sat, 14 Mar 2015 16:02:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503141602.t2EG2CSY045589@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 16:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279992 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 16:02:13 -0000 Author: ian Date: Sat Mar 14 16:02:11 2015 New Revision: 279992 URL: https://svnweb.freebsd.org/changeset/base/279992 Log: Add a new flag, SBUF_INCLUDENUL, and new get/set/clear functions for flags. The SBUF_INCLUDENUL flag causes the nulterm byte at the end of the string to be counted in the length of the data. If copying the data using the sbuf_data() and sbuf_len() functions, or if writing it automatically with a drain function, the net effect is that the nulterm byte is copied along with the rest of the data. Modified: head/share/man/man9/sbuf.9 head/sys/kern/subr_sbuf.c head/sys/sys/sbuf.h Modified: head/share/man/man9/sbuf.9 ============================================================================== --- head/share/man/man9/sbuf.9 Sat Mar 14 14:46:10 2015 (r279991) +++ head/share/man/man9/sbuf.9 Sat Mar 14 16:02:11 2015 (r279992) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 11, 2013 +.Dd March 14, 2015 .Dt SBUF 9 .Os .Sh NAME @@ -34,6 +34,9 @@ .Nm sbuf_new_auto , .Nm sbuf_new_for_sysctl , .Nm sbuf_clear , +.Nm sbuf_get_flags , +.Nm sbuf_set_flags , +.Nm sbuf_clear_flags , .Nm sbuf_setpos , .Nm sbuf_bcat , .Nm sbuf_bcopyin , @@ -67,6 +70,12 @@ .Ft void .Fn sbuf_clear "struct sbuf *s" .Ft int +.Fn sbuf_get_flags "struct sbuf *s" +.Ft void +.Fn sbuf_set_flags "struct sbuf *s" "int flags" +.Ft void +.Fn sbuf_clear_flags "struct sbuf *s" "int flags" +.Ft int .Fn sbuf_setpos "struct sbuf *s" "int pos" .Ft int .Fn sbuf_bcat "struct sbuf *s" "const void *buf" "size_t len" @@ -159,6 +168,8 @@ Attempting to extend the sbuf beyond thi .It Dv SBUF_AUTOEXTEND This indicates that the storage buffer may be extended as necessary, so long as resources allow, to hold additional data. +.It Dv SBUF_INCLUDENUL +This causes the final nulterm byte to be counted in the length of the data. .El .Pp Note that if @@ -211,6 +222,18 @@ function invalidates the contents of the and resets its position to zero. .Pp The +.Fn sbuf_get_flags +function returns the current user flags. +The +.Fn sbuf_set_flags +and +.Fn sbuf_get_flags +functions set or clear one or more user flags, respectively. +The user flags are described under the +.Fn sbuf_new +function. +.Pp +The .Fn sbuf_setpos function sets the .Fa sbuf Ns 's Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Sat Mar 14 14:46:10 2015 (r279991) +++ head/sys/kern/subr_sbuf.c Sat Mar 14 16:02:11 2015 (r279992) @@ -262,6 +262,28 @@ sbuf_uionew(struct sbuf *s, struct uio * } #endif +int +sbuf_get_flags(struct sbuf *s) +{ + + return (s->s_flags & SBUF_USRFLAGMSK); +} + +void +sbuf_clear_flags(struct sbuf *s, int flags) +{ + + s->s_flags &= ~(flags & SBUF_USRFLAGMSK); +} + +void +sbuf_set_flags(struct sbuf *s, int flags) +{ + + + s->s_flags |= (flags & SBUF_USRFLAGMSK); +} + /* * Clear an sbuf and reset its position. */ @@ -697,11 +719,13 @@ sbuf_finish(struct sbuf *s) assert_sbuf_integrity(s); assert_sbuf_state(s, 0); + s->s_buf[s->s_len] = '\0'; + if (s->s_flags & SBUF_INCLUDENUL) + s->s_len++; if (s->s_drain_func != NULL) { while (s->s_len > 0 && s->s_error == 0) s->s_error = sbuf_drain(s); } - s->s_buf[s->s_len] = '\0'; SBUF_SETFLAG(s, SBUF_FINISHED); #ifdef _KERNEL return (s->s_error); @@ -743,6 +767,10 @@ sbuf_len(struct sbuf *s) if (s->s_error != 0) return (-1); + + /* If finished, nulterm is already in len, else add one. */ + if ((s->s_flags & (SBUF_INCLUDENUL | SBUF_FINISHED)) == SBUF_INCLUDENUL) + return (s->s_len + 1); return (s->s_len); } Modified: head/sys/sys/sbuf.h ============================================================================== --- head/sys/sys/sbuf.h Sat Mar 14 14:46:10 2015 (r279991) +++ head/sys/sys/sbuf.h Sat Mar 14 16:02:11 2015 (r279992) @@ -48,6 +48,7 @@ struct sbuf { ssize_t s_len; /* current length of string */ #define SBUF_FIXEDLEN 0x00000000 /* fixed length buffer (default) */ #define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */ +#define SBUF_INCLUDENUL 0x00000002 /* nulterm byte is counted in len */ #define SBUF_USRFLAGMSK 0x0000ffff /* mask of flags the user may specify */ #define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */ #define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */ @@ -64,6 +65,9 @@ __BEGIN_DECLS struct sbuf *sbuf_new(struct sbuf *, char *, int, int); #define sbuf_new_auto() \ sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND) +int sbuf_get_flags(struct sbuf *); +void sbuf_clear_flags(struct sbuf *, int); +void sbuf_set_flags(struct sbuf *, int); void sbuf_clear(struct sbuf *); int sbuf_setpos(struct sbuf *, ssize_t); int sbuf_bcat(struct sbuf *, const void *, size_t); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 17:08:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B62B17D; Sat, 14 Mar 2015 17:08:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 EF59B966; Sat, 14 Mar 2015 17:08:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EH8UDN074394; Sat, 14 Mar 2015 17:08:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EH8TdR074383; Sat, 14 Mar 2015 17:08:29 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503141708.t2EH8TdR074383@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 17:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279993 - in head/sys: dev/cxgb dev/cxgbe kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 17:08:31 -0000 Author: ian Date: Sat Mar 14 17:08:28 2015 New Revision: 279993 URL: https://svnweb.freebsd.org/changeset/base/279993 Log: Set the SBUF_INCLUDENUL flag in sbuf_new_for_sysctl() so that sysctl strings returned to userland include the nulterm byte. Some uses of sbuf_new_for_sysctl() write binary data rather than strings; clear the SBUF_INCLUDENUL flag after calling sbuf_new_for_sysctl() in those cases. (Note that the sbuf code still automatically adds a nulterm byte in sbuf_finish(), but since it's not included in the length it won't get copied to userland along with the binary data.) Remove explicit adding of a nulterm byte in a couple places now that it gets done automatically by the sbuf drain code. PR: 195668 Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgbe/t4_main.c head/sys/kern/kern_descrip.c head/sys/kern/kern_malloc.c head/sys/kern/kern_proc.c head/sys/kern/kern_sysctl.c head/sys/vm/uma_core.c Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Sat Mar 14 16:02:11 2015 (r279992) +++ head/sys/dev/cxgb/cxgb_sge.c Sat Mar 14 17:08:28 2015 (r279993) @@ -3149,9 +3149,6 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS) } err = sbuf_finish(sb); - /* Output a trailing NUL. */ - if (err == 0) - err = SYSCTL_OUT(req, "", 1); sbuf_delete(sb); return (err); } @@ -3219,9 +3216,6 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS) } err = sbuf_finish(sb); - /* Output a trailing NUL. */ - if (err == 0) - err = SYSCTL_OUT(req, "", 1); sbuf_delete(sb); return (err); } @@ -3279,9 +3273,6 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS) } err = sbuf_finish(sb); - /* Output a trailing NUL. */ - if (err == 0) - err = SYSCTL_OUT(req, "", 1); sbuf_delete(sb); return (err); } Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Mar 14 16:02:11 2015 (r279992) +++ head/sys/dev/cxgbe/t4_main.c Sat Mar 14 17:08:28 2015 (r279993) @@ -5083,12 +5083,11 @@ sysctl_int_array(SYSCTL_HANDLER_ARGS) int rc, *i; struct sbuf sb; - sbuf_new(&sb, NULL, 32, SBUF_AUTOEXTEND); + sbuf_new_for_sysctl(&sb, NULL, 64, req); for (i = arg1; arg2; arg2 -= sizeof(int), i++) sbuf_printf(&sb, "%d ", *i); sbuf_trim(&sb); - sbuf_finish(&sb); - rc = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); + rc = sbuf_finish(&sb); sbuf_delete(&sb); return (rc); } Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Mar 14 16:02:11 2015 (r279992) +++ head/sys/kern/kern_descrip.c Sat Mar 14 17:08:28 2015 (r279993) @@ -3296,6 +3296,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER name = (int *)arg1; sbuf_new_for_sysctl(&sb, NULL, FILEDESC_SBUF_SIZE, req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) { sbuf_delete(&sb); @@ -3490,6 +3491,7 @@ sysctl_kern_proc_cwd(SYSCTL_HANDLER_ARGS name = (int *)arg1; sbuf_new_for_sysctl(&sb, NULL, sizeof(struct kinfo_file), req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) { sbuf_delete(&sb); Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Sat Mar 14 16:02:11 2015 (r279992) +++ head/sys/kern/kern_malloc.c Sat Mar 14 17:08:28 2015 (r279993) @@ -918,6 +918,7 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_ if (error != 0) return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + sbuf_clear_flags(&sbuf, SBUF_INCLUDENUL); mtx_lock(&malloc_mtx); /* Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Mar 14 16:02:11 2015 (r279992) +++ head/sys/kern/kern_proc.c Sat Mar 14 17:08:28 2015 (r279993) @@ -1273,6 +1273,7 @@ sysctl_out_proc(struct proc *p, struct s pid = p->p_pid; sbuf_new_for_sysctl(&sb, (char *)&ki, sizeof(ki), req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = kern_proc_out(p, &sb, flags); error2 = sbuf_finish(&sb); sbuf_delete(&sb); @@ -1934,6 +1935,7 @@ sysctl_kern_proc_auxv(SYSCTL_HANDLER_ARG return (0); } sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = proc_getauxv(curthread, p, &sb); error2 = sbuf_finish(&sb); PRELE(p); @@ -2421,6 +2423,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR name = (int *)arg1; sbuf_new_for_sysctl(&sb, NULL, sizeof(struct kinfo_vmentry), req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) { sbuf_delete(&sb); Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sat Mar 14 16:02:11 2015 (r279992) +++ head/sys/kern/kern_sysctl.c Sat Mar 14 17:08:28 2015 (r279993) @@ -1807,7 +1807,7 @@ sbuf_new_for_sysctl(struct sbuf *s, char struct sysctl_req *req) { - s = sbuf_new(s, buf, length, SBUF_FIXEDLEN); + s = sbuf_new(s, buf, length, SBUF_FIXEDLEN | SBUF_INCLUDENUL); sbuf_set_drain(s, sbuf_sysctl_drain, req); return (s); } Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Mar 14 16:02:11 2015 (r279992) +++ head/sys/vm/uma_core.c Sat Mar 14 17:08:28 2015 (r279993) @@ -3451,6 +3451,7 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS if (error != 0) return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + sbuf_clear_flags(&sbuf, SBUF_INCLUDENUL); count = 0; rw_rlock(&uma_rwlock); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 17:19:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC02D417; Sat, 14 Mar 2015 17:19:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 C6E2FA3D; Sat, 14 Mar 2015 17:19:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EHJnbn079372; Sat, 14 Mar 2015 17:19:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EHJn6o079370; Sat, 14 Mar 2015 17:19:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201503141719.t2EHJn6o079370@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 14 Mar 2015 17:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279994 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 17:19:50 -0000 Author: dim Date: Sat Mar 14 17:19:48 2015 New Revision: 279994 URL: https://svnweb.freebsd.org/changeset/base/279994 Log: Amend r277940, by also disabling -Wcast-qual warnings for a few specific aesni files on i386. Modified: head/sys/conf/files.i386 Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat Mar 14 17:08:28 2015 (r279993) +++ head/sys/conf/files.i386 Sat Mar 14 17:19:48 2015 (r279994) @@ -118,12 +118,12 @@ crypto/aesni/aeskeys_i386.S optional aes crypto/aesni/aesni.c optional aesni aesni_ghash.o optional aesni \ dependency "$S/crypto/aesni/aesni_ghash.c" \ - compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ + compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ no-implicit-rule \ clean "aesni_ghash.o" aesni_wrap.o optional aesni \ dependency "$S/crypto/aesni/aesni_wrap.c" \ - compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse -msse4 -maes ${.IMPSRC}" \ + compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes ${.IMPSRC}" \ no-implicit-rule \ clean "aesni_wrap.o" crypto/des/arch/i386/des_enc.S optional crypto | ipsec | netsmb From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 17:35:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AD9A87D; Sat, 14 Mar 2015 17:35:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 64BD0C0E; Sat, 14 Mar 2015 17:35:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EHZ54g088355; Sat, 14 Mar 2015 17:35:05 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EHZ5CC088354; Sat, 14 Mar 2015 17:35:05 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201503141735.t2EHZ5CC088354@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sat, 14 Mar 2015 17:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279996 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 17:35:05 -0000 Author: smh Date: Sat Mar 14 17:35:04 2015 New Revision: 279996 URL: https://svnweb.freebsd.org/changeset/base/279996 Log: Allow zvol_geom_worker to process BIO_DELETE's If zvol_geom_start is called with a BIO_DELETE from a thread which can sleep it queues it for later processing by the zvol_geom_worker. The zvol_geom_worker didn't have a delete case so would simply loose the bio hence preventing the original caller from every completing. In addition an other unknown types would suffer the same fate. Allow zvol_geom_worker to process BIO_DELETE's via zvol_strategy and return unsupported for all unknown bio types. MFC after: 2 weeks Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Mar 14 17:25:17 2015 (r279995) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Mar 14 17:35:04 2015 (r279996) @@ -2775,8 +2775,12 @@ zvol_geom_worker(void *arg) break; case BIO_READ: case BIO_WRITE: + case BIO_DELETE: zvol_strategy(bp); break; + default: + g_io_deliver(bp, EOPNOTSUPP); + break; } } } From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 18:11:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7C2DE7A; Sat, 14 Mar 2015 18:11:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 B2C68EB1; Sat, 14 Mar 2015 18:11:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EIBPmf006505; Sat, 14 Mar 2015 18:11:25 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EIBPeE006504; Sat, 14 Mar 2015 18:11:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503141811.t2EIBPeE006504@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 18:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279997 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 18:11:25 -0000 Author: ian Date: Sat Mar 14 18:11:24 2015 New Revision: 279997 URL: https://svnweb.freebsd.org/changeset/base/279997 Log: Use sbuf_new_for_sysctl() instead of plain sbuf_new() to ensure sysctl string returned to userland is nulterminated. PR: 195668 Modified: head/sys/netinet/tcp_hostcache.c Modified: head/sys/netinet/tcp_hostcache.c ============================================================================== --- head/sys/netinet/tcp_hostcache.c Sat Mar 14 17:35:04 2015 (r279996) +++ head/sys/netinet/tcp_hostcache.c Sat Mar 14 18:11:24 2015 (r279997) @@ -596,7 +596,7 @@ tcp_hc_update(struct in_conninfo *inc, s static int sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) { - int linesize = 128; + const int linesize = 128; struct sbuf sb; int i, error; struct hc_metrics *hc_entry; @@ -604,8 +604,7 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) char ip6buf[INET6_ADDRSTRLEN]; #endif - sbuf_new(&sb, NULL, linesize * (V_tcp_hostcache.cache_count + 1), - SBUF_FIXEDLEN); + sbuf_new_for_sysctl(&sb, NULL, linesize, req); sbuf_printf(&sb, "\nIP address MTU SSTRESH RTT RTTVAR BANDWIDTH " @@ -642,8 +641,7 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) THC_UNLOCK(&V_tcp_hostcache.hashbase[i].hch_mtx); } #undef msec - sbuf_finish(&sb); - error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + error = sbuf_finish(&sb); sbuf_delete(&sb); return(error); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 18:42:31 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 679274E7; Sat, 14 Mar 2015 18:42:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 52C12254; Sat, 14 Mar 2015 18:42:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EIgVgG021554; Sat, 14 Mar 2015 18:42:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EIgVRa021553; Sat, 14 Mar 2015 18:42:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503141842.t2EIgVRa021553@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 18:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279999 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 18:42:31 -0000 Author: ian Date: Sat Mar 14 18:42:30 2015 New Revision: 279999 URL: https://svnweb.freebsd.org/changeset/base/279999 Log: Use sbuf_new_for_sysctl() instead of plain sbuf_new() to ensure sysctl string returned to userland is nulterminated. PR: 195668 Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sat Mar 14 18:38:07 2015 (r279998) +++ head/sys/kern/sched_ule.c Sat Mar 14 18:42:30 2015 (r279999) @@ -2830,7 +2830,7 @@ sysctl_kern_sched_topology_spec(SYSCTL_H KASSERT(cpu_top != NULL, ("cpu_top isn't initialized")); - topo = sbuf_new(NULL, NULL, 500, SBUF_AUTOEXTEND); + topo = sbuf_new_for_sysctl(NULL, NULL, 512, req); if (topo == NULL) return (ENOMEM); @@ -2839,8 +2839,7 @@ sysctl_kern_sched_topology_spec(SYSCTL_H sbuf_printf(topo, "\n"); if (err == 0) { - sbuf_finish(topo); - err = SYSCTL_OUT(req, sbuf_data(topo), sbuf_len(topo)); + err = sbuf_finish(topo); } sbuf_delete(topo); return (err); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 18:46:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 039AA648; Sat, 14 Mar 2015 18:46:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 E372D26C; Sat, 14 Mar 2015 18:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EIkX9m022165; Sat, 14 Mar 2015 18:46:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EIkX9f022164; Sat, 14 Mar 2015 18:46:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503141846.t2EIkX9f022164@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 18:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280000 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 18:46:34 -0000 Author: ian Date: Sat Mar 14 18:46:33 2015 New Revision: 280000 URL: https://svnweb.freebsd.org/changeset/base/280000 Log: Use sbuf_new_for_sysctl() instead of plain sbuf_new() to ensure sysctl string returned to userland is nulterminated. PR: 195668 Modified: head/sys/kern/kern_fail.c Modified: head/sys/kern/kern_fail.c ============================================================================== --- head/sys/kern/kern_fail.c Sat Mar 14 18:42:30 2015 (r279999) +++ head/sys/kern/kern_fail.c Sat Mar 14 18:46:33 2015 (r280000) @@ -394,11 +394,10 @@ fail_point_sysctl(SYSCTL_HANDLER_ARGS) int error; /* Retrieving */ - sbuf_new(&sb, NULL, 128, SBUF_AUTOEXTEND); + sbuf_new_for_sysctl(&sb, NULL, 128, req); fail_point_get(fp, &sb); sbuf_trim(&sb); - sbuf_finish(&sb); - error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + error = sbuf_finish(&sb); sbuf_delete(&sb); /* Setting */ From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 18:49:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 614E87E6; Sat, 14 Mar 2015 18:49:14 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 1F60527F; Sat, 14 Mar 2015 18:49:13 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 52CFF425568; Sun, 15 Mar 2015 05:21:06 +1100 (AEDT) Date: Sun, 15 Mar 2015 05:21:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric Subject: Re: svn commit: r279981 - in head: contrib/compiler-rt/lib/builtins lib/libcompiler_rt In-Reply-To: <201503141240.t2ECeKqP045674@svn.freebsd.org> Message-ID: <20150315023356.X977@besplex.bde.org> References: <201503141240.t2ECeKqP045674@svn.freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=Za4kaKlA c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=c3-DdYJoA5YA:10 a=AYuOEJbmdvWyk8TZYWsA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 18:49:14 -0000 On Sat, 14 Mar 2015, Dimitry Andric wrote: > Log: > =EF=BB=BFPull in r231965 from upstream compiler-rt trunk (by J=C3=B6rg S= onnenberger): > > Refactor float to integer conversion to share the same code. > 80bit Intel/PPC long double is excluded due to lacking support > for the abstraction. Consistently provide saturation logic. > Extend to long double on 128bit IEEE extended platforms. I hoped that this would fix a longstanding conversion bug, but that bug is actually for integer to float conversion, and the conversion is inline. clang can't even convert integer 0 to floating point correctly (when the integer has type uintmax_t and is variable with value 0, and the rounding mode is downwards): X #include X #include X #include X=20 X int X main(void) X { X =09volatile uintmax_t er =3D 0; X=20 X =09fesetround(FE_DOWNWARD); X =09printf("%.4f\n", (double)er); X =09return (0); X } clang generates broken inline code giving a result of -0.0000. It does a magic conversion involving loading the variable as an integer, shuffling bits, subtracting a double and adding a double. The subtraction gives -0.0 when the rounding mode is downwards. gcc48 generates apparently-correct inline code. It does a less magic but slower conversion involving: - for values not exceeding INT64_MAX, just cvtsi2sdq - for values exceeding INT64_MAX, modify er to ((er >> 1) | (er & 1)), convert that using cvtsi2sdq, then double the result. Does this commit fix the differences between the runtime calculations and compile-time calculations for overflowing cases? Saturation logic should do this. My old test programs (previously last tested in 2004) show the differences. Compilers produced much the same garbage in 1994, 2004 and 2015. Before this commit, they do the following: - gcc48 saturates at compile time. Its runtime results are inconsistent except for some cases of converting negative values to unsigned: - generally, the result is 0x8000000000000000 in bits for 64-bit values and 0x80000000 for 32-bit values. This is the corect x86 value since it is what is generated on overflow by the hardware. Call it IOV. gcc corrupts even this value: - overflowing u_long or long -> (u_long)IOV or (long)IOV, OK - overflowing u_long, positive value -> 0 - overflowing u_long, negative value -> (u_long)IOV, OK, but it is weird that negative values overflow to a larger value than positive values= =2E - this is with 64-bit longs on amd64. For conversions to u_int and int, the results are the same (with the the 32-bit IOV), except for the weird last result. Now: - overflowing u_int, negative value -> 0. This is the one case for unsigned types where the runtime result is consistent with the compile time result. - clang gives identical results. gcc was much more inconsistent in 1994. Its typical behaviour was to handle u_int by storing an int64_t and discarding the top bits. uint64_t is harder to handle and was more broken. The behaviour is undefined on overflow, so these bugs are less serious than for converting 0. I prefer traps on overflow. Everyone is used to integer division trapping when the result would be infinite. x86 hardware makes the trap for this impossible to avoid (but the kernel could handle the trap and produce an in-band error result like IOV). Converting FP infinity to integer should do the same. Unfortunately, x86 hardware make this trap hard to get efficiently (traps for it would have to be enabled; then the kernel could produce a signal for the integer case and emulate the hardware trap handling for the FP case). Bruce From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 21:15:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E14B6BB; Sat, 14 Mar 2015 21:15:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 5958D1AA; Sat, 14 Mar 2015 21:15:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ELFk5R092832; Sat, 14 Mar 2015 21:15:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ELFkWP092831; Sat, 14 Mar 2015 21:15:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201503142115.t2ELFkWP092831@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 14 Mar 2015 21:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280004 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 21:15:46 -0000 Author: mav Date: Sat Mar 14 21:15:45 2015 New Revision: 280004 URL: https://svnweb.freebsd.org/changeset/base/280004 Log: Give block I/O interface multiple (8) execution threads. On parallel random I/O this allows better utilize wide storage pools. To not confuse prefetcher on linear I/O, consecutive requests are executed sequentially, following the same logic as was earlier implemented in CTL. Benchmarks of virtual AHCI disk, backed by ZVOL on RAID10 pool of 4 HDDs, show ~3.5 times random read performance improvements, while no degradation on linear I/O. MFC after: 2 weeks Modified: head/usr.sbin/bhyve/block_if.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Sat Mar 14 21:07:37 2015 (r280003) +++ head/usr.sbin/bhyve/block_if.c Sat Mar 14 21:15:45 2015 (r280004) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #define BLOCKIF_SIG 0xb109b109 #define BLOCKIF_MAXREQ 33 +#define BLOCKIF_NUMTHR 8 enum blockop { BOP_READ, @@ -65,6 +66,7 @@ enum blockop { enum blockstat { BST_FREE, + BST_BLOCK, BST_PEND, BST_BUSY, BST_DONE @@ -76,6 +78,7 @@ struct blockif_elem { enum blockop be_op; enum blockstat be_status; pthread_t be_tid; + off_t be_block; }; struct blockif_ctxt { @@ -88,16 +91,15 @@ struct blockif_ctxt { int bc_sectsz; int bc_psectsz; int bc_psectoff; - pthread_t bc_btid; + int bc_closing; + pthread_t bc_btid[BLOCKIF_NUMTHR]; pthread_mutex_t bc_mtx; pthread_cond_t bc_cond; - int bc_closing; /* Request elements and free/pending/busy queues */ TAILQ_HEAD(, blockif_elem) bc_freeq; TAILQ_HEAD(, blockif_elem) bc_pendq; TAILQ_HEAD(, blockif_elem) bc_busyq; - u_int bc_req_count; struct blockif_elem bc_reqs[BLOCKIF_MAXREQ]; }; @@ -116,58 +118,83 @@ static int blockif_enqueue(struct blockif_ctxt *bc, struct blockif_req *breq, enum blockop op) { - struct blockif_elem *be; - - assert(bc->bc_req_count < BLOCKIF_MAXREQ); + struct blockif_elem *be, *tbe; + off_t off; + int i; be = TAILQ_FIRST(&bc->bc_freeq); assert(be != NULL); assert(be->be_status == BST_FREE); - TAILQ_REMOVE(&bc->bc_freeq, be, be_link); - be->be_status = BST_PEND; be->be_req = breq; be->be_op = op; + switch (op) { + case BOP_READ: + case BOP_WRITE: + case BOP_DELETE: + off = breq->br_offset; + for (i = 0; i < breq->br_iovcnt; i++) + off += breq->br_iov[i].iov_len; + break; + default: + off = OFF_MAX; + } + be->be_block = off; + TAILQ_FOREACH(tbe, &bc->bc_pendq, be_link) { + if (tbe->be_block == breq->br_offset) + break; + } + if (tbe == NULL) { + TAILQ_FOREACH(tbe, &bc->bc_busyq, be_link) { + if (tbe->be_block == breq->br_offset) + break; + } + } + if (tbe == NULL) + be->be_status = BST_PEND; + else + be->be_status = BST_BLOCK; TAILQ_INSERT_TAIL(&bc->bc_pendq, be, be_link); - - bc->bc_req_count++; - - return (0); + return (be->be_status == BST_PEND); } static int -blockif_dequeue(struct blockif_ctxt *bc, struct blockif_elem **bep) +blockif_dequeue(struct blockif_ctxt *bc, pthread_t t, struct blockif_elem **bep) { struct blockif_elem *be; - if (bc->bc_req_count == 0) - return (ENOENT); - - be = TAILQ_FIRST(&bc->bc_pendq); - assert(be != NULL); - assert(be->be_status == BST_PEND); + TAILQ_FOREACH(be, &bc->bc_pendq, be_link) { + if (be->be_status == BST_PEND) + break; + assert(be->be_status == BST_BLOCK); + } + if (be == NULL) + return (0); TAILQ_REMOVE(&bc->bc_pendq, be, be_link); be->be_status = BST_BUSY; - be->be_tid = bc->bc_btid; + be->be_tid = t; TAILQ_INSERT_TAIL(&bc->bc_busyq, be, be_link); - *bep = be; - - return (0); + return (1); } static void blockif_complete(struct blockif_ctxt *bc, struct blockif_elem *be) { - assert(be->be_status == BST_DONE); + struct blockif_elem *tbe; - TAILQ_REMOVE(&bc->bc_busyq, be, be_link); + if (be->be_status == BST_DONE || be->be_status == BST_BUSY) + TAILQ_REMOVE(&bc->bc_busyq, be, be_link); + else + TAILQ_REMOVE(&bc->bc_pendq, be, be_link); + TAILQ_FOREACH(tbe, &bc->bc_pendq, be_link) { + if (tbe->be_req->br_offset == be->be_block) + tbe->be_status = BST_PEND; + } be->be_tid = 0; be->be_status = BST_FREE; be->be_req = NULL; TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); - - bc->bc_req_count--; } static void @@ -226,28 +253,27 @@ blockif_thr(void *arg) { struct blockif_ctxt *bc; struct blockif_elem *be; + pthread_t t; bc = arg; + t = pthread_self(); + pthread_mutex_lock(&bc->bc_mtx); for (;;) { - pthread_mutex_lock(&bc->bc_mtx); - while (!blockif_dequeue(bc, &be)) { + while (blockif_dequeue(bc, t, &be)) { pthread_mutex_unlock(&bc->bc_mtx); blockif_proc(bc, be); pthread_mutex_lock(&bc->bc_mtx); blockif_complete(bc, be); } - pthread_cond_wait(&bc->bc_cond, &bc->bc_mtx); - pthread_mutex_unlock(&bc->bc_mtx); - - /* - * Check ctxt status here to see if exit requested - */ + /* Check ctxt status here to see if exit requested */ if (bc->bc_closing) - pthread_exit(NULL); + break; + pthread_cond_wait(&bc->bc_cond, &bc->bc_mtx); } + pthread_mutex_unlock(&bc->bc_mtx); - /* Not reached */ + pthread_exit(NULL); return (NULL); } @@ -386,16 +412,16 @@ blockif_open(const char *optstr, const c TAILQ_INIT(&bc->bc_freeq); TAILQ_INIT(&bc->bc_pendq); TAILQ_INIT(&bc->bc_busyq); - bc->bc_req_count = 0; for (i = 0; i < BLOCKIF_MAXREQ; i++) { bc->bc_reqs[i].be_status = BST_FREE; TAILQ_INSERT_HEAD(&bc->bc_freeq, &bc->bc_reqs[i], be_link); } - pthread_create(&bc->bc_btid, NULL, blockif_thr, bc); - - snprintf(tname, sizeof(tname), "blk-%s", ident); - pthread_set_name_np(bc->bc_btid, tname); + for (i = 0; i < BLOCKIF_NUMTHR; i++) { + pthread_create(&bc->bc_btid[i], NULL, blockif_thr, bc); + snprintf(tname, sizeof(tname), "blk-%s-%d", ident, i); + pthread_set_name_np(bc->bc_btid[i], tname); + } return (bc); } @@ -409,13 +435,13 @@ blockif_request(struct blockif_ctxt *bc, err = 0; pthread_mutex_lock(&bc->bc_mtx); - if (bc->bc_req_count < BLOCKIF_MAXREQ) { + if (!TAILQ_EMPTY(&bc->bc_freeq)) { /* * Enqueue and inform the block i/o thread * that there is work available */ - blockif_enqueue(bc, breq, op); - pthread_cond_signal(&bc->bc_cond); + if (blockif_enqueue(bc, breq, op)) + pthread_cond_signal(&bc->bc_cond); } else { /* * Callers are not allowed to enqueue more than @@ -481,11 +507,7 @@ blockif_cancel(struct blockif_ctxt *bc, /* * Found it. */ - TAILQ_REMOVE(&bc->bc_pendq, be, be_link); - be->be_status = BST_FREE; - be->be_req = NULL; - TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); - bc->bc_req_count--; + blockif_complete(bc, be); pthread_mutex_unlock(&bc->bc_mtx); return (0); @@ -546,7 +568,7 @@ int blockif_close(struct blockif_ctxt *bc) { void *jval; - int err; + int err, i; err = 0; @@ -556,8 +578,9 @@ blockif_close(struct blockif_ctxt *bc) * Stop the block i/o thread */ bc->bc_closing = 1; - pthread_cond_signal(&bc->bc_cond); - pthread_join(bc->bc_btid, &jval); + pthread_cond_broadcast(&bc->bc_cond); + for (i = 0; i < BLOCKIF_NUMTHR; i++) + pthread_join(bc->bc_btid[i], &jval); /* XXX Cancel queued i/o's ??? */ From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 21:38:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F8029C1; Sat, 14 Mar 2015 21:38:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6B0BE371; Sat, 14 Mar 2015 21:38:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ELcq9Q002972; Sat, 14 Mar 2015 21:38:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ELcqh6002971; Sat, 14 Mar 2015 21:38:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503142138.t2ELcqh6002971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 21:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280005 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 21:38:52 -0000 Author: ian Date: Sat Mar 14 21:38:51 2015 New Revision: 280005 URL: https://svnweb.freebsd.org/changeset/base/280005 Log: Define a convenience macro, SYSCTL_OUT_STR() for handling strings the standard way (including the nulterm byte in the data returned to userland). This augments the existing sysctl_handle_string() in that this can be used with const strings without ugly inappropriate casting. Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Sat Mar 14 21:15:45 2015 (r280004) +++ head/sys/sys/sysctl.h Sat Mar 14 21:38:51 2015 (r280005) @@ -186,6 +186,7 @@ struct sysctl_oid { #define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l) #define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l) +#define SYSCTL_OUT_STR(r, p) (r->oldfunc)(r, p, strlen(p) + 1) int sysctl_handle_int(SYSCTL_HANDLER_ARGS); int sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS); From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 21:40:02 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7BEBB22; Sat, 14 Mar 2015 21:40:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 93E25376; Sat, 14 Mar 2015 21:40:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ELe24h003205; Sat, 14 Mar 2015 21:40:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ELe2Fl003203; Sat, 14 Mar 2015 21:40:02 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503142140.t2ELe2Fl003203@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 21:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280006 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 21:40:02 -0000 Author: ian Date: Sat Mar 14 21:40:01 2015 New Revision: 280006 URL: https://svnweb.freebsd.org/changeset/base/280006 Log: Use SYSCTL_OUT_STR() to return strings. PR: 195668 Modified: head/sys/kern/subr_bus.c head/sys/kern/subr_param.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sat Mar 14 21:38:51 2015 (r280005) +++ head/sys/kern/subr_bus.c Sat Mar 14 21:40:01 2015 (r280006) @@ -212,7 +212,7 @@ devclass_sysctl_handler(SYSCTL_HANDLER_A default: return (EINVAL); } - return (SYSCTL_OUT(req, value, strlen(value))); + return (SYSCTL_OUT_STR(req, value)); } static void @@ -269,7 +269,7 @@ device_sysctl_handler(SYSCTL_HANDLER_ARG default: return (EINVAL); } - error = SYSCTL_OUT(req, value, strlen(value)); + error = SYSCTL_OUT_STR(req, value); if (buf != NULL) free(buf, M_BUS); return (error); Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Sat Mar 14 21:38:51 2015 (r280005) +++ head/sys/kern/subr_param.c Sat Mar 14 21:40:01 2015 (r280006) @@ -300,6 +300,5 @@ init_param2(long physpages) static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS) { - return (SYSCTL_OUT(req, vm_guest_sysctl_names[vm_guest], - strlen(vm_guest_sysctl_names[vm_guest]))); + return (SYSCTL_OUT_STR(req, vm_guest_sysctl_names[vm_guest])); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 21:40:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A177CC61; Sat, 14 Mar 2015 21:40:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 88B1637D; Sat, 14 Mar 2015 21:40:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ELePig005177; Sat, 14 Mar 2015 21:40:25 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ELePfY005176; Sat, 14 Mar 2015 21:40:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503142140.t2ELePfY005176@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 21:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280007 - head/sys/xen/xenbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 21:40:25 -0000 Author: ian Date: Sat Mar 14 21:40:24 2015 New Revision: 280007 URL: https://svnweb.freebsd.org/changeset/base/280007 Log: Use SYSCTL_OUT_STR() to return strings. PR: 195668 Modified: head/sys/xen/xenbus/xenbusb.c Modified: head/sys/xen/xenbus/xenbusb.c ============================================================================== --- head/sys/xen/xenbus/xenbusb.c Sat Mar 14 21:40:01 2015 (r280006) +++ head/sys/xen/xenbus/xenbusb.c Sat Mar 14 21:40:24 2015 (r280007) @@ -330,7 +330,7 @@ xenbusb_device_sysctl_handler(SYSCTL_HAN default: return (EINVAL); } - return (SYSCTL_OUT(req, value, strlen(value))); + return (SYSCTL_OUT_STR(req, value)); } /** From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 21:40:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31B45D9B; Sat, 14 Mar 2015 21:40:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 01E34380; Sat, 14 Mar 2015 21:40:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ELeX1o005248; Sat, 14 Mar 2015 21:40:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ELeXHf005247; Sat, 14 Mar 2015 21:40:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503142140.t2ELeXHf005247@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 21:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280008 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 21:40:34 -0000 Author: ian Date: Sat Mar 14 21:40:33 2015 New Revision: 280008 URL: https://svnweb.freebsd.org/changeset/base/280008 Log: Use SYSCTL_OUT_STR() to return strings. PR: 195668 Modified: head/sys/dev/usb/net/usb_ethernet.c Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Sat Mar 14 21:40:24 2015 (r280007) +++ head/sys/dev/usb/net/usb_ethernet.c Sat Mar 14 21:40:33 2015 (r280008) @@ -155,7 +155,7 @@ ue_sysctl_parent(SYSCTL_HANDLER_ARGS) const char *name; name = device_get_nameunit(ue->ue_dev); - return SYSCTL_OUT(req, name, strlen(name)); + return SYSCTL_OUT_STR(req, name); } int From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 21:40:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0669ED7; Sat, 14 Mar 2015 21:40:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 BC6AC605; Sat, 14 Mar 2015 21:40:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ELeqlE005339; Sat, 14 Mar 2015 21:40:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ELeqZp005338; Sat, 14 Mar 2015 21:40:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503142140.t2ELeqZp005338@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 21:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280009 - head/sys/mips/rmi/dev/iic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 21:40:52 -0000 Author: ian Date: Sat Mar 14 21:40:51 2015 New Revision: 280009 URL: https://svnweb.freebsd.org/changeset/base/280009 Log: Use SYSCTL_OUT_STR() to return strings. PR: 195668 Modified: head/sys/mips/rmi/dev/iic/at24co2n.c Modified: head/sys/mips/rmi/dev/iic/at24co2n.c ============================================================================== --- head/sys/mips/rmi/dev/iic/at24co2n.c Sat Mar 14 21:40:33 2015 (r280008) +++ head/sys/mips/rmi/dev/iic/at24co2n.c Sat Mar 14 21:40:51 2015 (r280009) @@ -84,7 +84,7 @@ at24co2n_mac_sysctl(SYSCTL_HANDLER_ARGS) p = sc->sc_mac_addr; len = snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x", p[0], p[1], p[2], p[3], p[4], p[5]); - return SYSCTL_OUT(req, buf, len); + return SYSCTL_OUT_STR(req, buf); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 21:41:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 807CE76; Sat, 14 Mar 2015 21:41:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 6AD77609; Sat, 14 Mar 2015 21:41:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ELf1oH005893; Sat, 14 Mar 2015 21:41:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ELf18I005892; Sat, 14 Mar 2015 21:41:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503142141.t2ELf18I005892@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 21:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280010 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 21:41:01 -0000 Author: ian Date: Sat Mar 14 21:41:00 2015 New Revision: 280010 URL: https://svnweb.freebsd.org/changeset/base/280010 Log: Use SYSCTL_OUT_STR() to return strings. PR: 195668 Modified: head/sys/net80211/ieee80211_freebsd.c Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Sat Mar 14 21:40:51 2015 (r280009) +++ head/sys/net80211/ieee80211_freebsd.c Sat Mar 14 21:41:00 2015 (r280010) @@ -209,7 +209,7 @@ ieee80211_sysctl_parent(SYSCTL_HANDLER_A struct ieee80211com *ic = arg1; const char *name = ic->ic_ifp->if_xname; - return SYSCTL_OUT(req, name, strlen(name)); + return SYSCTL_OUT_STR(req, name); } static int From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 21:52:22 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B16A434; Sat, 14 Mar 2015 21:52:22 +0000 (UTC) Received: from bigwig.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 53DF875A; Sat, 14 Mar 2015 21:52:22 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6C171B93C; Sat, 14 Mar 2015 17:52:20 -0400 (EDT) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r279997 - head/sys/netinet Date: Sat, 14 Mar 2015 17:52:12 -0400 Message-ID: <12123739.Rz3jP8R4fM@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201503141811.t2EIBPeE006504@svn.freebsd.org> References: <201503141811.t2EIBPeE006504@svn.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.2.7 (bigwig.baldwin.cx); Sat, 14 Mar 2015 17:52:20 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 21:52:22 -0000 On Saturday, March 14, 2015 06:11:25 PM Ian Lepore wrote: > Author: ian > Date: Sat Mar 14 18:11:24 2015 > New Revision: 279997 > URL: https://svnweb.freebsd.org/changeset/base/279997 > > Log: > Use sbuf_new_for_sysctl() instead of plain sbuf_new() to ensure sysctl > string returned to userland is nulterminated. > > PR: 195668 This is not safe. sbuf_printf() is invoked with a lock held, so it isn't safe for the sbuf code to do a drain here. With sbuf_new_for_sysctl(), any call to an sbuf routine is a potential page fault, so the handler must either use sysctl_wire_old_buffer(), or the contents need to be output in one go. For this case I would prefer to use sbuf_len(sb) + 1 (or add INCLUDENUL to the args when creating it) and leave the sole SYSCTL_OUT() at the end. You will want to check the one or two other places you converted for this same issue as well. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 22:32:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6987AAF; Sat, 14 Mar 2015 22:32:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 91FBBA92; Sat, 14 Mar 2015 22:32:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2EMWG1q030550; Sat, 14 Mar 2015 22:32:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2EMWGSw030549; Sat, 14 Mar 2015 22:32:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503142232.t2EMWGSw030549@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 22:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280011 - head/sys/dev/iscsi_initiator X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 22:32:16 -0000 Author: ian Date: Sat Mar 14 22:32:15 2015 New Revision: 280011 URL: https://svnweb.freebsd.org/changeset/base/280011 Log: Use sysctl_handle_string() and the sbuf printf routines instead of large stack-allocated buffers and snprintf(). PR: 195668 Modified: head/sys/dev/iscsi_initiator/isc_sm.c Modified: head/sys/dev/iscsi_initiator/isc_sm.c ============================================================================== --- head/sys/dev/iscsi_initiator/isc_sm.c Sat Mar 14 21:41:00 2015 (r280010) +++ head/sys/dev/iscsi_initiator/isc_sm.c Sat Mar 14 22:32:15 2015 (r280011) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -586,14 +587,15 @@ isc_dump_options(SYSCTL_HANDLER_ARGS) { int error; isc_session_t *sp; - char buf[1024], *bp; + struct sbuf sb; + + sbuf_new_for_sysctl(&sb, NULL, 128, req); sp = (isc_session_t *)arg1; - bp = buf; - sprintf(bp, "targetname='%s'", sp->opt.targetName); - bp += strlen(bp); - sprintf(bp, " targetname='%s'", sp->opt.targetAddress); - error = SYSCTL_OUT(req, buf, strlen(buf)); + sbuf_printf(&sb, "targetname='%s'", sp->opt.targetName); + sbuf_printf(&sb, " targetaddress='%s'", sp->opt.targetAddress); + error = sbuf_finish(&sb); + sbuf_delete(&sb); return error; } #endif @@ -603,51 +605,24 @@ isc_dump_stats(SYSCTL_HANDLER_ARGS) { isc_session_t *sp; struct isc_softc *sc; - char buf[1024], *bp; - int error, n; - + int error; + struct sbuf sb; + sp = (isc_session_t *)arg1; sc = sp->isc; - bp = buf; - n = sizeof(buf); - snprintf(bp, n, "recv=%d sent=%d", sp->stats.nrecv, sp->stats.nsent); - bp += strlen(bp); - n -= strlen(bp); - snprintf(bp, n, " flags=0x%08x pdus-alloc=%d pdus-max=%d", - sp->flags, sc->npdu_alloc, sc->npdu_max); - bp += strlen(bp); - n -= strlen(bp); - snprintf(bp, n, " cws=%d cmd=%x exp=%x max=%x stat=%x itt=%x", - sp->cws, sp->sn.cmd, sp->sn.expCmd, sp->sn.maxCmd, sp->sn.stat, sp->sn.itt); - error = SYSCTL_OUT(req, buf, strlen(buf)); - return error; -} + sbuf_new_for_sysctl(&sb, NULL, 128, req); -static int -isc_sysctl_targetName(SYSCTL_HANDLER_ARGS) -{ - char buf[128], **cp; - int error; - - cp = (char **)arg1; - snprintf(buf, sizeof(buf), "%s", *cp); - error = SYSCTL_OUT(req, buf, strlen(buf)); + sbuf_printf(&sb, "recv=%d sent=%d", sp->stats.nrecv, sp->stats.nsent); + sbuf_printf(&sb, " flags=0x%08x pdus-alloc=%d pdus-max=%d", + sp->flags, sc->npdu_alloc, sc->npdu_max); + sbuf_printf(&sb, " cws=%d cmd=%x exp=%x max=%x stat=%x itt=%x", + sp->cws, sp->sn.cmd, sp->sn.expCmd, sp->sn.maxCmd, sp->sn.stat, sp->sn.itt); + error = sbuf_finish(&sb); + sbuf_delete(&sb); return error; } - -static int -isc_sysctl_targetAddress(SYSCTL_HANDLER_ARGS) -{ - char buf[128], **cp; - int error; - cp = (char **)arg1; - snprintf(buf, sizeof(buf), "%s", *cp); - error = SYSCTL_OUT(req, buf, strlen(buf)); - return error; -} - static void isc_add_sysctls(isc_session_t *sp) { @@ -668,7 +643,7 @@ isc_add_sysctls(isc_session_t *sp) "targetname", CTLTYPE_STRING | CTLFLAG_RD, (void *)&sp->opt.targetName, 0, - isc_sysctl_targetName, "A", "target name"); + sysctl_handle_string, "A", "target name"); SYSCTL_ADD_PROC(&sp->clist, SYSCTL_CHILDREN(sp->oid), @@ -676,7 +651,7 @@ isc_add_sysctls(isc_session_t *sp) "targeaddress", CTLTYPE_STRING | CTLFLAG_RD, (void *)&sp->opt.targetAddress, 0, - isc_sysctl_targetAddress, "A", "target address"); + sysctl_handle_string, "A", "target address"); SYSCTL_ADD_PROC(&sp->clist, SYSCTL_CHILDREN(sp->oid), From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 23:16:14 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C36BF49; Sat, 14 Mar 2015 23:16:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 D2165E4D; Sat, 14 Mar 2015 23:16:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ENGDCe049595; Sat, 14 Mar 2015 23:16:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ENGDdG049590; Sat, 14 Mar 2015 23:16:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503142316.t2ENGDdG049590@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 23:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280012 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 23:16:14 -0000 Author: ian Date: Sat Mar 14 23:16:12 2015 New Revision: 280012 URL: https://svnweb.freebsd.org/changeset/base/280012 Log: Use sbuf_printf() for sysctl strings instead of stack buffers and snprintf(). Modified: head/sys/kern/kern_et.c head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_et.c ============================================================================== --- head/sys/kern/kern_et.c Sat Mar 14 22:32:15 2015 (r280011) +++ head/sys/kern/kern_et.c Sat Mar 14 23:16:12 2015 (r280012) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -238,22 +239,24 @@ et_free(struct eventtimer *et) static int sysctl_kern_eventtimer_choice(SYSCTL_HANDLER_ARGS) { - char buf[512], *spc; + struct sbuf sb; struct eventtimer *et; - int error, off; + int error; + + if ((error = sysctl_wire_old_buffer(req, 0)) != 0) + return (error); + sbuf_new_for_sysctl(&sb, NULL, 0, req); - spc = ""; - error = 0; - buf[0] = 0; - off = 0; ET_LOCK(); SLIST_FOREACH(et, &eventtimers, et_all) { - off += snprintf(buf + off, sizeof(buf) - off, "%s%s(%d)", - spc, et->et_name, et->et_quality); - spc = " "; + if (et != SLIST_FIRST(&eventtimers)) + sbuf_putc(&sb, ' '); + sbuf_printf(&sb, "%s(%d)", et->et_name, et->et_quality); } ET_UNLOCK(); - error = SYSCTL_OUT(req, buf, strlen(buf)); + + error = sbuf_finish(&sb); + sbuf_delete(&sb); return (error); } SYSCTL_PROC(_kern_eventtimer, OID_AUTO, choice, Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Sat Mar 14 22:32:15 2015 (r280011) +++ head/sys/kern/kern_tc.c Sat Mar 14 23:16:12 2015 (r280012) @@ -25,6 +25,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1445,18 +1446,18 @@ SYSCTL_PROC(_kern_timecounter, OID_AUTO, static int sysctl_kern_timecounter_choice(SYSCTL_HANDLER_ARGS) { - char buf[32], *spc; + struct sbuf sb; struct timecounter *tc; int error; - spc = ""; - error = 0; - for (tc = timecounters; error == 0 && tc != NULL; tc = tc->tc_next) { - sprintf(buf, "%s%s(%d)", - spc, tc->tc_name, tc->tc_quality); - error = SYSCTL_OUT(req, buf, strlen(buf)); - spc = " "; + sbuf_new_for_sysctl(&sb, NULL, 0, req); + for (tc = timecounters; tc != NULL; tc = tc->tc_next) { + if (tc != timecounters) + sbuf_putc(&sb, ' '); + sbuf_printf(&sb, "%s(%d)", tc->tc_name, tc->tc_quality); } + error = sbuf_finish(&sb); + sbuf_delete(&sb); return (error); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 23:30:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBA18286; Sat, 14 Mar 2015 23:30:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 9CF99F51; Sat, 14 Mar 2015 23:30:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ENU4GC054682; Sat, 14 Mar 2015 23:30:04 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ENU4TM054680; Sat, 14 Mar 2015 23:30:04 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503142330.t2ENU4TM054680@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 23:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280013 - in head/sys/mips: nlm rmi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 23:30:04 -0000 Author: ian Date: Sat Mar 14 23:30:03 2015 New Revision: 280013 URL: https://svnweb.freebsd.org/changeset/base/280013 Log: Use sbuf_printf() for sysctl strings instead of static buffers and snprintf. Modified: head/sys/mips/nlm/cms.c head/sys/mips/rmi/fmn.c Modified: head/sys/mips/nlm/cms.c ============================================================================== --- head/sys/mips/nlm/cms.c Sat Mar 14 23:16:12 2015 (r280012) +++ head/sys/mips/nlm/cms.c Sat Mar 14 23:30:03 2015 (r280013) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -473,27 +474,22 @@ SYSINIT(start_msgring_threads, SI_SUB_SM static int sys_print_debug(SYSCTL_HANDLER_ARGS) { - int error, nb, i, fs; - static char xprintb[4096], *buf; + struct sbuf sb; + int error, i; - buf = xprintb; - fs = sizeof(xprintb); - nb = snprintf(buf, fs, + sbuf_new_for_sysctl(&sb, NULL, 64, req); + sbuf_printf(&sb, "\nID vc0 vc1 vc2 vc3 loops\n"); - buf += nb; - fs -= nb; for (i = 0; i < 32; i++) { if ((xlp_hw_thread_mask & (1 << i)) == 0) continue; - nb = snprintf(buf, fs, - "%2d: %8d %8d %8d %8d %8d\n", i, + sbuf_printf(&sb, "%2d: %8d %8d %8d %8d %8d\n", i, fmn_msgcount[i][0], fmn_msgcount[i][1], fmn_msgcount[i][2], fmn_msgcount[i][3], fmn_loops[i]); - buf += nb; - fs -= nb; } - error = SYSCTL_OUT(req, xprintb, buf - xprintb); + error = sbuf_finish(&sb); + sbuf_delete(&sb); return (error); } Modified: head/sys/mips/rmi/fmn.c ============================================================================== --- head/sys/mips/rmi/fmn.c Sat Mar 14 23:16:12 2015 (r280012) +++ head/sys/mips/rmi/fmn.c Sat Mar 14 23:30:03 2015 (r280013) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -468,27 +469,22 @@ SYSINIT(start_msgring_threads, SI_SUB_SM static int sys_print_debug(SYSCTL_HANDLER_ARGS) { - int error, nb, i, fs; - static char xprintb[4096], *buf; + struct sbuf sb; + int error, i; - buf = xprintb; - fs = sizeof(xprintb); - nb = snprintf(buf, fs, + sbuf_new_for_sysctl(&sb, NULL, 64, req); + sbuf_printf(&sb, "\nID INTR ER WU-SLP WU-ERR MSGS\n"); - buf += nb; - fs -= nb; for (i = 0; i < 32; i++) { if ((xlr_hw_thread_mask & (1 << i)) == 0) continue; - nb = snprintf(buf, fs, - "%2d: %8d %4d %8d %8d %8d\n", i, + sbuf_printf(&sb, "%2d: %8d %4d %8d %8d %8d\n", i, msgring_nintr[i/4], msgring_badintr[i/4], msgring_wakeup_sleep[i], msgring_wakeup_nosleep[i], msgring_nmsgs[i]); - buf += nb; - fs -= nb; } - error = SYSCTL_OUT(req, xprintb, buf - xprintb); + error = sbuf_finish(&sb); + sbuf_delete(&sb); return (error); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 23:57:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B4C64EB; Sat, 14 Mar 2015 23:57:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 16F6921E; Sat, 14 Mar 2015 23:57:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2ENvXeO068081; Sat, 14 Mar 2015 23:57:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2ENvXYp068080; Sat, 14 Mar 2015 23:57:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201503142357.t2ENvXYp068080@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 14 Mar 2015 23:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280014 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 23:57:34 -0000 Author: ian Date: Sat Mar 14 23:57:33 2015 New Revision: 280014 URL: https://svnweb.freebsd.org/changeset/base/280014 Log: Go back to using sbuf_new() with a preallocated large buffer, to avoid triggering an sbuf auto-drain copyout while holding a lock. Pointed out by: jhb Pointy hat: ian Modified: head/sys/netinet/tcp_hostcache.c Modified: head/sys/netinet/tcp_hostcache.c ============================================================================== --- head/sys/netinet/tcp_hostcache.c Sat Mar 14 23:30:03 2015 (r280013) +++ head/sys/netinet/tcp_hostcache.c Sat Mar 14 23:57:33 2015 (r280014) @@ -604,7 +604,8 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) char ip6buf[INET6_ADDRSTRLEN]; #endif - sbuf_new_for_sysctl(&sb, NULL, linesize, req); + sbuf_new(&sb, NULL, linesize * (V_tcp_hostcache.cache_count + 1), + SBUF_INCLUDENUL); sbuf_printf(&sb, "\nIP address MTU SSTRESH RTT RTTVAR BANDWIDTH " @@ -642,6 +643,8 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) } #undef msec error = sbuf_finish(&sb); + if (error == 0) + error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); sbuf_delete(&sb); return(error); }